From c3355fed416b080132cc23403d75ae57281da303 Mon Sep 17 00:00:00 2001 From: Berlian Gur Date: Tue, 12 Jul 2022 16:59:03 +0800 Subject: [PATCH 1/3] Update erc721.md Instructions for ERC-721 should be provided in this document.. not ERC-20 --- examples/erc721.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/erc721.md b/examples/erc721.md index 382b400..76aa60f 100644 --- a/examples/erc721.md +++ b/examples/erc721.md @@ -1,4 +1,4 @@ -# ERC20-token deployment guide +# ERC721-token deployment guide This ERC20 token example is just one of many ways a token canister can be developed and still conform to EXT standards. Note the following for this example: - No notifications - these can be added in future. The `notify` field is ignored From 4ba01ef17b6acd94ccf05ec05c1a7d5b5859b96e Mon Sep 17 00:00:00 2001 From: Berlian Gur Date: Tue, 12 Jul 2022 19:21:47 +0800 Subject: [PATCH 2/3] Update erc721.md --- examples/erc721.md | 48 +++++++++------------------------------------- 1 file changed, 9 insertions(+), 39 deletions(-) diff --git a/examples/erc721.md b/examples/erc721.md index 76aa60f..97836fe 100644 --- a/examples/erc721.md +++ b/examples/erc721.md @@ -1,48 +1,18 @@ # ERC721-token deployment guide -This ERC20 token example is just one of many ways a token canister can be developed and still conform to EXT standards. Note the following for this example: - -- No notifications - these can be added in future. The `notify` field is ignored -- All TokenIDs are ignored, but must be present (you can use any text field e.g. "") -- You can use the canister id as the token id (note for using with Stoic) -- No memo's - this can be added in future with notifications. The `memo` field is ignored -- No erc20 `transferFrom` - you can use the `transfer` call and change the `from` address ## Deploy locally and test -The following deploys a test token (Me Token/MET) and mints the entire supply to the provided principal. We then follow with some basic tests: +The following deploys a test token. We then follow with some basic tests: ``` -dfx canister create ext_erc20 -dfx build ext_erc20 -dfx canister install ext_erc20 --argument="(\"Me Token\", \"MET\", 3, 100000000:nat, principal \"sensj-ihxp6-tyvl7-7zwvj-fr42h-7ojjp-n7kxk-z6tvo-vxykp-umhfk-wqe\")" +dfx canister create ext_erc721 +dfx build ext_erc721 +dfx canister install ext_erc721 --argument="(principal \"sensj-ihxp6-tyvl7-7zwvj-fr42h-7ojjp-n7kxk-z6tvo-vxykp-umhfk-wqe\")" //Get canister ID -dfx canister id ext_erc20 - -//Supply -dfx canister call ext_erc20 supply "(\"\")" - -//Metadata -dfx canister call ext_erc20 metadata "(\"\")" - -//Balance - can query using the principal or address -dfx canister call ext_erc20 balance "(record { user = (variant { \"principal\" = principal \"sensj-ihxp6-tyvl7-7zwvj-fr42h-7ojjp-n7kxk-z6tvo-vxykp-umhfk-wqe\" }); token = \"\" } )" -dfx canister call ext_erc20 balance "(record { user = (variant { address = \"86d374abf9b9c532108cc15a7a9e6d21ac6dddd8d34b5babaf7e6244e6d1a638\" }); token = \"\" } )" -``` -## Deploy live and load into Stoic -To deploy live, you would follow the same as above except you should: -1. Set the network to ic - i.e. `--network ic` -2. Set cycles when creating the canister +dfx canister id ext_erc721 -The following will deploy live with 2T cycles (please ensure you have enough cycles) -``` -dfx canister --network ic create ext_erc20 --with-cycles 2000000000000 -dfx build --network ic ext_erc20 -dfx canister --network ic install ext_erc20 --argument="(\"Toniq Token\", \"NIQ\", 6, 100_000_000_000_000:nat, principal \"sensj-ihxp6-tyvl7-7zwvj-fr42h-7ojjp-n7kxk-z6tvo-vxykp-umhfk-wqe\")" +//Mint NFT +dfx canister call ext_erc721 mintNFT "(record { to = (variant { \"principal\" = principal \"sensj-ihxp6-tyvl7-7zwvj-fr42h-7ojjp-n7kxk-z6tvo-vxykp-umhfk-wqe\" }); metadata = opt vec{1}; } )" -//Get canister ID -dfx canister --network ic id ext_erc20 +//Supply +dfx canister call ext_erc721 supply "(\"\")" ``` - -**You can then take the canister ID and load it directly into Stoic:** - -![a4a883a8-a7fd-466e-8707-14de79ae87fa](https://user-images.githubusercontent.com/13844325/122918390-3105c300-d3b3-11eb-8a9d-26048999f678.png) - From 74a101802fc6f9223edb91dbc504d1d8a8976c4c Mon Sep 17 00:00:00 2001 From: Berlian Gur Date: Tue, 12 Jul 2022 19:22:02 +0800 Subject: [PATCH 3/3] Create erc721.md