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

Add a full workflow in the docs #269

Merged
merged 27 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0744133
Move existing tutorials to the docs folder
ipopescu Feb 5, 2024
e5a0c53
Updated links
ipopescu Feb 5, 2024
3125b45
Add an initial full-tutorial
ipopescu Feb 14, 2024
b9784c3
Add an initial quickstart
ipopescu Feb 14, 2024
d77bfbe
Fix title in quickstart
ipopescu Feb 14, 2024
ecd7875
Rename full tutorial to full installation tutorial
ipopescu Feb 14, 2024
2f598e3
Initial query and updated links
ipopescu Feb 14, 2024
ec76931
Initial transfer document + move files to a folder
ipopescu Feb 15, 2024
04b162d
Add a brief testing file
ipopescu Feb 16, 2024
8e4b050
Minor edits
ipopescu Feb 16, 2024
2a8da0f
Move content frm using-casper-client.md to new tutorials
ipopescu Feb 16, 2024
6bdf631
Minor edits
ipopescu Feb 29, 2024
c1c9d0f
Switch back to nctl commands
ipopescu Feb 29, 2024
5abe955
Updated commands after testing
ipopescu Feb 29, 2024
874edb4
Minor edits
ipopescu Mar 1, 2024
f053c8e
Fix old links
ipopescu Mar 1, 2024
691e907
Fix link
ipopescu Mar 1, 2024
a4e5c3d
Remove tests\wasm link; it only exists when building
ipopescu Mar 1, 2024
520ba67
Fix headers
ipopescu Mar 1, 2024
69be0f0
Merge branch 'dev' of https://github.com/casper-ecosystem/cep-78-enha…
ipopescu Mar 1, 2024
1c1eac0
Review feedback for checking balances
ipopescu Mar 11, 2024
0f52d31
Updated TOC
ipopescu Mar 11, 2024
ea985bb
Reverting merge updates to the Changelog
ipopescu Mar 12, 2024
f066112
Remove explanation covered in the contract writing docs
ipopescu Mar 12, 2024
e54f51b
Add back a brief explanation about the imports
ipopescu Mar 12, 2024
c5f490a
Add missing entrypoints and an important note
ipopescu Mar 12, 2024
4b55cb6
Note about token_hash during minting
ipopescu Mar 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,4 @@ All notable changes to this project will be documented in this file. The format

- **If an account attempts to install a second CEP-78 contract with the same name, it will overwrite the access rights and render the first instance unusable.**

[Keep a Changelog]: https://keepachangelog.com/en/1.0.0
[Keep a Changelog]: https://keepachangelog.com/en/1.0.0
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ The following are the optional parameters that can be passed in at the time of i

#### Example deploy

The following is an example of installing the NFT contract via a deploy using the Rust CLI Casper client. You can find more examples [here](/docs/using-casper-client.md).
The following is an example of installing the NFT contract via a deploy using the Rust CLI Casper client. You can find more examples [here](/docs/tutorials/getting-started/full-installation-tutorial.md).

```bash
casper-client put-deploy -n http://65.108.0.148:7777/rpc --chain-name "casper-test" --payment-amount 500000000000 -k keys/secret_key.pem --session-path contract/target/wasm32-unknown-unknown/release/contract.wasm \
casper-client put-deploy -n https://rpc.testnet.casperlabs.io/ --chain-name "casper-test" --payment-amount 500000000000 -k keys/secret_key.pem --session-path contract/target/wasm32-unknown-unknown/release/contract.wasm \
--session-arg "collection_name:string='enhanced-nft-1'" \
--session-arg "collection_symbol:string='ENFT-1'" \
--session-arg "total_token_supply:u64='10'" \
Expand Down Expand Up @@ -104,15 +104,15 @@ folder within the project folder.

### Checking Token Ownership

[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).
[Learn to check token ownership](./docs/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

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).
Upgrade to v1.1.1 using a [Standard NamedKey Convention](./docs/tutorials/standard-migration-tutorial.md) or a [Custom NamedKey Convention](./docs/tutorials/custom-migration-tutorial.md).

## Installing and Interacting with the Contract using the Rust Casper Client

You can find instructions on installing an instance of the CEP-78 contract using the Rust CLI Casper client [here](/docs/using-casper-client.md).
You can find instructions on installing an instance of the CEP-78 contract using the Rust CLI Casper client [here](/docs/tutorials/getting-started/full-installation-tutorial.md).

## Test Suite and Specification

Expand Down
4 changes: 2 additions & 2 deletions docs/modalities.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ The `OwnerReverseLookupMode` modality is set at install and determines if a give
This modality provides the following options:

1. `NoLookup`: The reporting and receipt functionality is not supported. In this option, the contract instance does not maintain a reverse lookup database of ownership and therefore has more predictable gas costs and greater scaling.
2. `Complete`: The reporting and receipt functionality is supported. Token ownership will be tracked by the contract instance using the system described [here](reverse-lookup.md).
3. `TransfersOnly`: The reporting and receipt functionality is supported like `Complete`. However, it does not begin tracking until the first transfer. This modality is for use cases where the majority of NFTs are owned by a private minter and only NFT's that have been transferred benefit from reverse lookup tracking. Token ownership will also be tracked by the contract instance using the system described [here](reverse-lookup.md).
2. `Complete`: The reporting and receipt functionality is supported. Token ownership will be tracked by the contract instance using the system described [here](../docs/reverse-lookup.md#owner-reverse-lookup-functionality).
3. `TransfersOnly`: The reporting and receipt functionality is supported like `Complete`. However, it does not begin tracking until the first transfer. This modality is for use cases where the majority of NFTs are owned by a private minter and only NFT's that have been transferred benefit from reverse lookup tracking. Token ownership will also be tracked by the contract instance using the system described [here](../docs/reverse-lookup.md#owner-reverse-lookup-functionality).

Additionally, when set to `Complete`, causes a receipt to be returned by the `mint` or `transfer` entrypoints, which the caller can store in their account or contract context for later reference.

Expand Down
2 changes: 1 addition & 1 deletion docs/reverse-lookup.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Owner Reverse Lookup Functionality

In version 1.0 of the CEP-78 Enhanced NFT Standard contract, tracking minted tokens consisted of a single, unbounded list that would grow in size with each additional token. As a result, gas costs would increase over time as the list must be overwritten with each new minting. The related tutorial can be found [here](../tutorials/token-ownership-tutorial.md).
In version 1.0 of the CEP-78 Enhanced NFT Standard contract, tracking minted tokens consisted of a single, unbounded list that would grow in size with each additional token. As a result, gas costs would increase over time as the list must be overwritten with each new minting. The related tutorial can be found [here](../docs/tutorials/token-ownership-tutorial.md).

In an effort to stabilize the gas costs of larger NFT collections, version 1.1 of CEP-78 includes the use of a pre-allocated page system to track ownership of NFTs within the contract.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ This tutorial uses the Casper command-line client to upgrade *and* migrate from
- Your v1.0.0 NFT contract instance uses custom NamedKeys for the contract package hash and contract package access URef.
- You have the v1.0.0 contract package hash stored under a custom NamedKey in the account that installed the contract.
- You have the v1.0.0 contract package access URef stored under a custom NamedKey in the account that installed the contract.
- You understand what is new in [Version 1.1](https://github.com/casper-ecosystem/cep-78-enhanced-nft/releases/tag/v1.1.1) of the CEP-78 Enhanced NFT Standard.
- You understand what is new in [Version 1.1.0](https://github.com/casper-ecosystem/cep-78-enhanced-nft/releases/tag/v1.1.0) of the CEP-78 Enhanced NFT Standard.

## Upgrading and Migrating Terminology

The upgrade to version 1.1.1 involves a data migration to a new [page system](../docs/reverse-lookup.md#the-cep-78-page-system) tracking token ownership. The usual [upgrade](https://docs.casper.network/developers/writing-onchain-code/upgrading-contracts/) process triggers the data migration. For more information, see [Standard Migration Tutorial](standard-migration-tutorial.md#upgrading-and-migrating-terminology).
The upgrade to version 1.1.1 involves a data migration to a new [page system](../reverse-lookup.md#the-cep-78-page-system) tracking token ownership. The usual [upgrade](https://docs.casperlabs.io/dapp-dev-guide/writing-contracts/upgrading-contracts/) process triggers the data migration. For more information, see [Standard Migration Tutorial](standard-migration-tutorial.md#upgrading-and-migrating-terminology).

## Steps to Upgrade to Version 1.1.1

Expand All @@ -22,7 +22,7 @@ The `cep-78-wasm` folder contains the `contract.wasm` to send to the network to

### Custom NamedKeys before Migration

The custom migration path assumes that the contract has modified the NamedKey entries created during the v1.0.0. See the example below as well as the [NamedKeyConvention](../docs/modalities.md#namedkeyconventionmode) modality.
The custom migration path assumes that the contract has modified the NamedKey entries created during the v1.0.0. See the example below as well as the [NamedKeyConvention](../modalities.md#namedkeyconventionmode) modality.

| NamedKey Pre-Migration | Explanation |
|-------------|-------------|
Expand All @@ -38,8 +38,8 @@ The custom migration path assumes that the contract has modified the NamedKey en

When upgrading using the `casper-client`, you must provide four runtime arguments:

- `named_key_convention`: The [NamedKeyConvention](../docs/modalities.md#namedkeyconventionmode) runtime argument as a u8 value equal to 2: `--session-arg "named_key_convention:u8='2'"`. See the [ARG_NAMED_KEY_CONVENTION](https://github.com/casper-ecosystem/cep-78-enhanced-nft/blob/408db77c3b9ca22752c7f877ea99a01dfca03a7b/contract/src/main.rs#L1991).
- `collection_name`: The collection name specified when the contract was [installed](../docs/using-casper-client.md#installing-the-contract) using the `collection_name` option. See the [contract code](https://github.com/casper-ecosystem/cep-78-enhanced-nft/blob/408db77c3b9ca22752c7f877ea99a01dfca03a7b/contract/src/main.rs#L93) for details. 
- `named_key_convention`: The [NamedKeyConvention](../modalities.md#namedkeyconventionmode) runtime argument as a u8 value equal to 2: `--session-arg "named_key_convention:u8='2'"`. See the [ARG_NAMED_KEY_CONVENTION](https://github.com/casper-ecosystem/cep-78-enhanced-nft/blob/408db77c3b9ca22752c7f877ea99a01dfca03a7b/contract/src/main.rs#L1991).
- `collection_name`: The collection name specified when the contract was [installed](./getting-started/full-installation-tutorial.md) using the `collection_name` option. See the [contract code](https://github.com/casper-ecosystem/cep-78-enhanced-nft/blob/408db77c3b9ca22752c7f877ea99a01dfca03a7b/contract/src/main.rs#L93) for details. 
- `hash_key_name`: The custom contract package hash NamedKey as a String. See the [ARG_HASH_KEY_NAME_1_0_0](https://github.com/casper-ecosystem/cep-78-enhanced-nft/blob/408db77c3b9ca22752c7f877ea99a01dfca03a7b/contract/src/main.rs#L2006).
- `access_key_name`: The custom contract package access NamedKey as a String. See the [ARG_ACCESS_KEY_NAME_1_0_0](https://github.com/casper-ecosystem/cep-78-enhanced-nft/blob/408db77c3b9ca22752c7f877ea99a01dfca03a7b/contract/src/main.rs#L2005).

Expand All @@ -64,7 +64,7 @@ Here is the full list of required arguments:
- `secret-key`: The file name containing the secret key of the account paying for the deploy.
- `payment-amount`: The payment for the deploy in motes.
- `session-path`: The path to the compiled Wasm on your computer. When using the [cep-78-wasm.tar.gz](https://github.com/casper-ecosystem/cep-78-enhanced-nft/releases/download/v1.1.1/cep-78-wasm.tar.gz) provided, this would be the path to the `contract.wasm` file.
- `named_key_convention`: Argument that specifies the use of the `V_1_0_standard` [NamedKeyConvention](../docs/modalities.md#namedkeyconventionmode).
- `named_key_convention`: Argument that specifies the use of the `V_1_0_standard` [NamedKeyConvention](../modalities.md#namedkeyconventionmode).
- `collection_name`: Argument that specifies the collection name as a String.
- `hash_key_name`: The custom contract package hash NamedKey as a String.
- `access_key_name`: The custom contract package access NamedKey as a String.
Expand All @@ -85,7 +85,7 @@ The following is an example of upgrading and migrating to version 1.1.1 of a pre

```bash
casper-client put-deploy \
--node-addres http://65.21.235.219:7777 \
--node-addres https://rpc.testnet.casperlabs.io/ \
--chain-name "casper-test" \
--secret-key ~/KEYS/secret_key.pem \
--payment-amount 300000000000 \
Expand Down
Loading
Loading