Skip to content

Commit

Permalink
Add ownership and pausing functionality to Asset and NFT examples (#790)
Browse files Browse the repository at this point in the history
## Type of change

<!--Delete points that do not apply-->

- Improvement (refactoring, restructuring repository, cleaning tech
debt, ...)

## Changes

The following changes have been made:

- Add ownership to the native-asset app
- Add ownership to the NFT app
- Upgrades native-asset tests to use Rust SDK
- Upgrades NFT tests to use Rust SDK

## Notes

- There was an internal discussion to add ownership and pausing
functionality to the apps to make them production-ready. Ownership has
been added to the native asset app and both ownership and pausing have
been added to the NFT app.
- SDK tests related to metadata are ignored until nested heap types are
supported.
- Dependent on FuelLabs/sway-libs#226

## Related Issues

<!--Delete everything after the "#" symbol and replace it with a number.
No spaces between hash and number-->

Closes #784
  • Loading branch information
bitzoic authored Apr 22, 2024
1 parent c489f15 commit 379ceb7
Show file tree
Hide file tree
Showing 54 changed files with 12,546 additions and 410 deletions.
4,087 changes: 4,087 additions & 0 deletions NFT/Cargo.lock

Large diffs are not rendered by default.

40 changes: 14 additions & 26 deletions NFT/Forc.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,29 @@
name = "NFT-contract"
source = "member"
dependencies = [
"asset",
"src20",
"src3",
"src7",
"std",
]

[[package]]
name = "asset"
source = "git+https://github.com/FuelLabs/sway-libs?tag=v0.18.0#8d196e9379463d4596ac582a20a84ed52ff58c69"
dependencies = [
"src7",
"standards",
"std",
"sway_libs",
]

[[package]]
name = "core"
source = "path+from-root-C3992B43B72ADB8C"

[[package]]
name = "src20"
source = "git+https://github.com/FuelLabs/sway-standards?tag=v0.3.3#4198b4b07449ad16104cc8a0501f3013670fdcfd"
dependencies = ["std"]
source = "path+from-root-9889F771D40C5D34"

[[package]]
name = "src3"
source = "git+https://github.com/FuelLabs/sway-standards?tag=v0.3.3#4198b4b07449ad16104cc8a0501f3013670fdcfd"
dependencies = ["std"]

[[package]]
name = "src7"
source = "git+https://github.com/FuelLabs/sway-standards?tag=v0.3.3#4198b4b07449ad16104cc8a0501f3013670fdcfd"
name = "standards"
source = "git+https://github.com/FuelLabs/sway-standards?tag=v0.4.1#0a6f3ba0bce036a0ce61f15ed4480c71af32d3aa"
dependencies = ["std"]

[[package]]
name = "std"
source = "git+https://github.com/fuellabs/sway?tag=v0.49.1#2ac7030570f22510b0ac2a7b5ddf7baa20bdc0e1"
source = "git+https://github.com/fuellabs/sway?tag=v0.53.0#b30f0e83d3f3d336007e3dfce45a48a87e731345"
dependencies = ["core"]

[[package]]
name = "sway_libs"
source = "git+https://github.com/FuelLabs/sway-libs?tag=v0.20.1#34a2d5a0f118a72c972153ca44140c0f5f78a680"
dependencies = [
"standards",
"std",
]
3 changes: 3 additions & 0 deletions NFT/NFT-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ edition = "2021"
license = "Apache-2.0"

[dependencies]
fuels = { version = "0.54.0", features = ["fuel-core-lib"] }
sha2 = { version = "0.10.7" }
tokio = { version = "1.12", features = ["rt", "macros"] }

[[test]]
harness = true
Expand Down
6 changes: 2 additions & 4 deletions NFT/NFT-contract/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ license = "Apache-2.0"
name = "NFT-contract"

[dependencies]
asset = { git = "https://github.com/FuelLabs/sway-libs", tag = "v0.18.0" }
src20 = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.3.3" }
src3 = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.3.3" }
src7 = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.3.3" }
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.4.1" }
sway_libs = { git = "https://github.com/FuelLabs/sway-libs", tag = "v0.20.1" }
6 changes: 6 additions & 0 deletions NFT/NFT-contract/src/interface.sw
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
library;

abi Constructor {
#[storage(read, write)]
fn constructor(owner: Identity);
}
Loading

0 comments on commit 379ceb7

Please sign in to comment.