Skip to content

Commit

Permalink
Add ACL package mode (mint) + package operator mode (transfer/approve…
Browse files Browse the repository at this point in the history
…/revoke) (#249)

* ACL package mode for whitelisting minting contracts through package

* Add package operator mode

* Typo

* Update CHANGELOG.md

Co-authored-by: Adam Stone <97986246+ACStoneCL@users.noreply.github.com>

* Update CHANGELOG.md

Co-authored-by: Adam Stone <97986246+ACStoneCL@users.noreply.github.com>

* Update CHANGELOG.md

Co-authored-by: Adam Stone <97986246+ACStoneCL@users.noreply.github.com>

* Update CHANGELOG.md

Co-authored-by: Adam Stone <97986246+ACStoneCL@users.noreply.github.com>

* Update CHANGELOG.md

Co-authored-by: Adam Stone <97986246+ACStoneCL@users.noreply.github.com>

* Update docs/modalities.md

Co-authored-by: Adam Stone <97986246+ACStoneCL@users.noreply.github.com>

* Update docs/modalities.md

Co-authored-by: Adam Stone <97986246+ACStoneCL@users.noreply.github.com>

* Update docs/modalities.md

Co-authored-by: Adam Stone <97986246+ACStoneCL@users.noreply.github.com>

* Update docs/modalities.md

Co-authored-by: Adam Stone <97986246+ACStoneCL@users.noreply.github.com>

* Update docs/modalities.md

Co-authored-by: Adam Stone <97986246+ACStoneCL@users.noreply.github.com>

* Update docs/modalities.md

Co-authored-by: Adam Stone <97986246+ACStoneCL@users.noreply.github.com>

* Update docs/modalities.md

Co-authored-by: Adam Stone <97986246+ACStoneCL@users.noreply.github.com>

* Update docs/modalities.md

Co-authored-by: Adam Stone <97986246+ACStoneCL@users.noreply.github.com>

* Update readme links

* bad commit

* Typo

---------

Co-authored-by: Adam Stone <97986246+ACStoneCL@users.noreply.github.com>
  • Loading branch information
gRoussac and ACStone-MTS authored Oct 3, 2023
1 parent 7b1eea5 commit b08ff4e
Show file tree
Hide file tree
Showing 16 changed files with 1,960 additions and 120 deletions.
21 changes: 19 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,24 @@ All notable changes to this project will be documented in this file. The format
[comment]: <> (Fixed: any bug fixes)
[comment]: <> (Security: in case of vulnerabilities)

## Release 1.5.0

### Changed

- Update to README (#248)
- Update CES parser version (#246)
- Update modalities.md (#245)
- Command fix (#244)
- JS Client: Omit dev dependencies when running audit (#241)
- Remove potential revert in init and remove cep47 events dict creation on install (#240)
- Reformatting documentation (#239)

### Added

- ACL package mode - Including a contract package in the `acl_whitelist` will result in automatic whitelisting for any future versions of that contract.

- Package operator mode - Approving a package in `operators` allows any future version of that contract to act as an operator for transfer/approve/revoke entrypoints.

## Release 1.4.0

### Changed
Expand All @@ -29,12 +47,11 @@ All notable changes to this project will be documented in this file. The format

- Modified the `json-schema` runtime argument to be an optional installation parameter.


## Release 1.3.0

### Changed

* Modified the `json-schema` runtime argument to be an optional installation parameter.
- Modified the `json-schema` runtime argument to be an optional installation parameter.

## Release 1.2.0

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ setup-test: build-contract
mkdir -p tests/wasm/1_1_0; curl -L https://github.com/casper-ecosystem/cep-78-enhanced-nft/releases/download/v1.1.0/cep-78-wasm.tar.gz | tar zxv -C tests/wasm/1_1_0/
mkdir -p tests/wasm/1_2_0; curl -L https://github.com/casper-ecosystem/cep-78-enhanced-nft/releases/download/v1.2.0/cep-78-wasm.tar.gz | tar zxv -C tests/wasm/1_2_0/
mkdir -p tests/wasm/1_3_0; curl -L https://github.com/casper-ecosystem/cep-78-enhanced-nft/releases/download/v1.3.0/cep-78-wasm.tar.gz | tar zxv -C tests/wasm/1_3_0/
mkdir -p tests/wasm/1_4_0; curl -L https://github.com/casper-ecosystem/cep-78-enhanced-nft/releases/download/v1.4.0/cep-78-wasm.tar.gz | tar zxv -C tests/wasm/1_4_0/

cp contract/target/wasm32-unknown-unknown/release/contract.wasm tests/wasm
cp client/mint_session/target/wasm32-unknown-unknown/release/mint_call.wasm tests/wasm
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The following are the optional parameters that can be passed in at the time of i

- `"whitelist_mode"`: The [`WhitelistMode`](/docs/modalities.md#whitelistmode) modality dictates whether the contract whitelist can be updated. This optional parameter will default to an unlocked whitelist that can be updated post installation. This parameter cannot be changed once the contract has been installed.
- `"holder_mode"`: The [`NFTHolderMode`](/docs/modalities.md#nftholdermode) modality dictates which entities can hold NFTs. This is an optional parameter and will default to a mixed mode allowing either `Accounts` or `Contracts` to hold NFTs. This parameter cannot be changed once the contract has been installed.
- `"contract_whitelist"`: The contract whitelist is a list of contract hashes that specifies which contracts can call the `mint()` entrypoint to mint NFTs. This is an optional parameter which will default to an empty whitelist. This value can be changed via the `set_variables` post installation. If the whitelist mode is set to locked, a non-empty whitelist must be passed; else, installation of the contract will fail.
- `"acl_whitelist"`: The ACL whitelist is a list of accounts and/or contract/package hashes that specifies which accounts and/or contracts can call the `mint()` entrypoint to mint NFTs. This is an optional parameter which will default to an empty whitelist. This value can be changed via the `set_variables` post installation. If the whitelist mode is set to locked, a non-empty whitelist must be passed; else, installation of the contract will fail.
- `"burn_mode"`: The [`BurnMode`](/docs/modalities.md#burnmode) modality dictates whether minted NFTs can be burnt. This is an optional parameter and will allow tokens to be burnt by default. This parameter cannot be changed once the contract has been installed.
- `"owner_reverse_lookup_mode"`: The [`OwnerReverseLookupMode`](/docs/modalities.md#reportingmode) modality dictates whether the lookup for owners to token identifiers is available. This is an optional parameter and will not provide the lookup by default. This parameter cannot be changed once the contract has been installed.
- `"events_mode"`: The [`EventsMode`](/docs/modalities.md#eventsmode) modality selects the event schema used to record any changes that occur to tokens issued by the contract instance.
Expand Down Expand Up @@ -106,8 +106,7 @@ folder within the project folder.

[Learn to check token ownership](./tutorials/token-ownership-tutorial.md) starting with version [v1.1.1](https://github.com/casper-ecosystem/cep-78-enhanced-nft/releases/tag/v1.1.1). The `OwnerReverseLookupMode` modality must be set to `Complete` as described [here](/docs/reverse-lookup.md).


### Upgrading to Version 1.1.1
### Upgrading to Version 1.1.1

Upgrade to v1.1.1 using a [Standard NamedKey Convention](./tutorials/standard-migration-tutorial.md) or a [Custom NamedKey Convention](./tutorials/custom-migration-tutorial.md).

Expand Down Expand Up @@ -290,3 +289,7 @@ by using the provided `Makefile` and running the `make test` command.
| 160 | MissingACLWhiteList |
| 161 | InvalidACLWhitelist |
| 162 | EmptyACLWhitelist |
| 163 | InvalidACLPackageMode |
| 164 | MissingACLPackageMode |
| 165 | InvalidPackageOperatorMode |
| 166 | MissingPackageOperatorMode |
4 changes: 4 additions & 0 deletions contract/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ pub const ARG_COLLECTION_SYMBOL: &str = "collection_symbol";
pub const ARG_CONTRACT_WHITELIST: &str = "contract_whitelist";
pub const ARG_ACL_WHITELIST: &str = "acl_whitelist";
pub const ARG_EVENTS_MODE: &str = "events_mode";
pub const ARG_ACL_PACKAGE_MODE: &str = "acl_package_mode";
pub const ARG_PACKAGE_OPERATOR_MODE: &str = "package_operator_mode";
pub const ARG_HASH_KEY_NAME_1_0_0: &str = "hash_key_name";
pub const ARG_HOLDER_MODE: &str = "holder_mode";
pub const ARG_IDENTIFIER_MODE: &str = "identifier_mode";
Expand Down Expand Up @@ -70,6 +72,8 @@ pub const ACL_WHITELIST: &str = "acl_whitelist";
pub const EVENT_TYPE: &str = "event_type";
pub const EVENTS: &str = "events";
pub const EVENTS_MODE: &str = "events_mode";
pub const ACL_PACKAGE_MODE: &str = "acl_package_mode";
pub const PACKAGE_OPERATOR_MODE: &str = "package_operator_mode";
pub const HASH_BY_INDEX: &str = "hash_by_index";
pub const HOLDER_MODE: &str = "holder_mode";
pub const IDENTIFIER_MODE: &str = "identifier_mode";
Expand Down
4 changes: 4 additions & 0 deletions contract/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ pub enum NFTCoreError {
MissingACLWhiteList = 160,
InvalidACLWhitelist = 161,
EmptyACLWhitelist = 162,
InvalidACLPackageMode = 163,
MissingACLPackageMode = 164,
InvalidPackageOperatorMode = 165,
MissingPackageOperatorMode = 166,
}

impl From<NFTCoreError> for ApiError {
Expand Down
Loading

0 comments on commit b08ff4e

Please sign in to comment.