Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cis2-dynamic-nft example contract #368

Merged
merged 14 commits into from
Jan 11, 2024
Binary file added .DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
- examples/voting/Cargo.toml
- examples/eSealing/Cargo.toml
- examples/auction/Cargo.toml
- examples/cis2-dynamic-nft/Cargo.toml
bogacyigitbasi marked this conversation as resolved.
Show resolved Hide resolved
- examples/cis2-multi/Cargo.toml
- examples/cis2-multi-royalties/Cargo.toml
- examples/cis2-nft/Cargo.toml
Expand Down Expand Up @@ -600,6 +601,7 @@ jobs:
- examples/cis2-wccd/Cargo.toml
- examples/cis2-nft/Cargo.toml
- examples/cis2-multi/Cargo.toml
- examples/cis2-dynamic-nft/Cargo.toml
- examples/cis2-multi-royalties/Cargo.toml
- examples/nametoken/Cargo.toml
- examples/account-signature-checks/Cargo.toml
Expand Down Expand Up @@ -678,6 +680,7 @@ jobs:
- examples/eSealing/Cargo.toml
- examples/auction/Cargo.toml
- examples/cis2-multi/Cargo.toml
- examples/cis2-dynamic-nft/Cargo.toml
- examples/cis2-multi-royalties/Cargo.toml
- examples/cis2-nft/Cargo.toml
- examples/cis3-nft-sponsored-txs/Cargo.toml
Expand Down Expand Up @@ -807,6 +810,7 @@ jobs:
- examples/eSealing
- examples/auction
- examples/cis2-multi
- examples/cis2-dynamic-nft
- examples/cis2-multi-royalties
- examples/cis2-nft
- examples/cis3-nft-sponsored-txs
Expand Down
7 changes: 4 additions & 3 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ The list of contracts is as follows:
- [account-signature-checks](./account-signature-checks) A simple contract that
demonstrates how account signature checks can be performed in smart contracts.
- [two-step-transfer](./two-step-transfer) A contract that acts like an account (can send, store and accept CCD),
but requires n > 1 ordained accounts to agree to the sending of CCD before it is accepted.
but requires n > 1 ordained accounts to agree to the sending of CCD before it is accepted.
- [auction](./auction) A contract implementing an simple auction.
- [piggy-bank](./piggy-bank) The smart contract created as part of the Piggy Bank tutorial.
- [memo](./memo/) An extremely minimal contract that can be used to
mimic the memo feature. Normally a transfer between accounts cannot add any
information other than the amount being transferred. Making transfers to this
intermediate contract instead works around this limitation.
- [cis2-dynamic-nft](./cis2-dynamic-nft) An example implementation of the CIS-2 Concordium Token Standard
containing dynamic NFTs.
- [cis2-multi](./cis2-multi) An example implementation of the CIS-2 Concordium Token Standard and CIS-3 Concordium Sponsored Transaction Standard containing multiple token types.
- [cis2-multi-royalties](./cis2-multi-royalties) An example implementation of the CIS-2 Concordium Token Standard which allows the token minter to be paid royalties
containing multiple token types.
Expand All @@ -44,14 +46,13 @@ The list of contracts is as follows:
- [sponsoredTransactions](./cis3-nft-sponsored-txs) A contract implementing the sponsored transaction mechanism (CIS3 standard).
- [smartContractUpgrade](./smart-contract-upgrade) An example of how to upgrade a smart contract. The state is migrated during the upgrade.


## Running the tests

To run the tests for an example contract in the folder `EXAMPLE` open a terminal an run the following commands:

1. `cd EXAMPLE`
2. `cargo concordium test --out concordium-out/module.wasm.v1`

The smart contract upgrade example has specific instructions for running the tests. See the module documentation in `./smart-contract-upgrade/contract-version1/tests/tests.rs`.

To learn more about testing contracts, please refer to [our integration testing documentation](https://developer.concordium.software/en/mainnet/smart-contracts/guides/integration-test-contract.html).

26 changes: 26 additions & 0 deletions examples/cis2-dynamic-nft/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
bogacyigitbasi marked this conversation as resolved.
Show resolved Hide resolved
name = "cis2_dynamic_nft"
version = "0.1.0"
authors = [ "Concordium <[email protected]>" ]
edition = "2021"
license = "MPL-2.0"
description = "An example implementation of the CIS-2 Concordium Token Standard containing dynamic NFTs"

[features]
default = ["std"]
std = ["concordium-std/std", "concordium-cis2/std"]
wee_alloc = ["concordium-std/wee_alloc"]

[dependencies]
concordium-std = {path = "../../concordium-std", default-features = false}
concordium-cis2 = {path = "../../concordium-cis2", default-features = false}

[dev-dependencies]
concordium-smart-contract-testing = { path = "../../contract-testing" }

[lib]
crate-type=["cdylib", "rlib"]

[profile.release]
codegen-units = 1
opt-level = "s"
Loading
Loading