From 5b784a4766b264c1bd9dbca561ad38dac69567a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dj8yf0=CE=BCl?= <26653921+dj8yfo@users.noreply.github.com> Date: Sat, 4 Jan 2025 22:46:23 +0200 Subject: [PATCH] update usages of `cargo-near` (#2392) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update mentions of `cargo near deploy` cmd * chore: update mentions of `cargo near build` cmd --------- Co-authored-by: dj8yf0μl Co-authored-by: Guille --- docs/2.build/2.smart-contracts/quickstart.md | 2 +- docs/2.build/5.primitives/ft.md | 2 +- docs/3.tutorials/auction/0-intro.md | 4 ++-- .../crosswords/01-basics/02-add-functions-call.md | 2 +- .../crosswords/01-basics/03-hashing-and-unit-tests.md | 4 ++-- .../crosswords/01-basics/04-simple-frontend.md | 2 +- .../crosswords/02-beginner/04-adding-a-puzzle.md | 2 +- .../02-beginner/06-logging-in-implementation.md | 2 +- .../crosswords/03-intermediate/05-base64vecu8.md | 2 +- docs/3.tutorials/examples/advanced-xcc.md | 4 +--- docs/3.tutorials/examples/count-near.md | 4 +--- docs/3.tutorials/examples/donation.md | 4 +--- docs/3.tutorials/examples/guest-book.md | 4 +--- docs/3.tutorials/examples/xcc.md | 4 +--- docs/3.tutorials/fts/1-skeleton.md | 2 +- docs/3.tutorials/fts/2-define-a-token.md | 4 ++-- docs/3.tutorials/fts/3-circulating-supply.md | 3 ++- docs/3.tutorials/fts/4.storage.md | 4 ++-- docs/3.tutorials/fts/5.transfers.md | 4 ++-- docs/3.tutorials/fts/6-marketplace.md | 10 +++++----- docs/3.tutorials/nfts/1-skeleton.md | 2 +- docs/3.tutorials/nfts/2-minting.md | 4 ++-- docs/3.tutorials/nfts/2-upgrade.md | 2 +- docs/3.tutorials/nfts/3-enumeration.md | 2 +- docs/3.tutorials/nfts/4-core.md | 2 +- docs/3.tutorials/nfts/5-approval.md | 2 +- docs/3.tutorials/nfts/6-royalty.md | 2 +- docs/3.tutorials/nfts/7-events.md | 2 +- docs/3.tutorials/nfts/8-marketplace.md | 2 +- docs/3.tutorials/nfts/9-series.md | 2 +- docs/3.tutorials/nfts/js/2-minting.md | 2 +- 31 files changed, 42 insertions(+), 51 deletions(-) diff --git a/docs/2.build/2.smart-contracts/quickstart.md b/docs/2.build/2.smart-contracts/quickstart.md index 38f180ec0e4..f24c99ae06b 100644 --- a/docs/2.build/2.smart-contracts/quickstart.md +++ b/docs/2.build/2.smart-contracts/quickstart.md @@ -439,6 +439,6 @@ At the time of this writing, this example works with the following versions: - node: `20.18.0` - rustc: `1.81.0` - near-cli-rs: `0.17.0` -- cargo-near: `0.10.1` +- cargo-near: `0.13.2` ::: diff --git a/docs/2.build/5.primitives/ft.md b/docs/2.build/5.primitives/ft.md index fde2273a306..204924346d2 100644 --- a/docs/2.build/5.primitives/ft.md +++ b/docs/2.build/5.primitives/ft.md @@ -71,7 +71,7 @@ On initialization you will define the token's metadata such as its name (e.g. Et To initialize a FT contract you will need to deploy it and then call the `new` method defining the token's metadata. ```bash -cargo near deploy with-init-call new json-args '{"owner_id": "", "total_supply": "1000000000000000", "metadata": { "spec": "ft-1.0.0", "name": "Example Token Name", "symbol": "EXLT", "decimals": 8 }}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm with-init-call new json-args '{"owner_id": "", "total_supply": "1000000000000000", "metadata": { "spec": "ft-1.0.0", "name": "Example Token Name", "symbol": "EXLT", "decimals": 8 }}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send ``` :::tip diff --git a/docs/3.tutorials/auction/0-intro.md b/docs/3.tutorials/auction/0-intro.md index bb7bd99e0a9..6179c3b2af5 100644 --- a/docs/3.tutorials/auction/0-intro.md +++ b/docs/3.tutorials/auction/0-intro.md @@ -110,8 +110,8 @@ Ready to start? Let's jump to the [The Auction Contract](./1.1-basic.md) and beg - near-cli: `0.12.0` - rustc: `1.78.0` - cargo: `1.80.1` -- cargo-near: `0.6.2` +- cargo-near: `0.13.2` - rustc: `1.78.0` - node: `21.6.1` -::: \ No newline at end of file +::: diff --git a/docs/3.tutorials/crosswords/01-basics/02-add-functions-call.md b/docs/3.tutorials/crosswords/01-basics/02-add-functions-call.md index 169ff5ee823..6bb13b0cd34 100644 --- a/docs/3.tutorials/crosswords/01-basics/02-add-functions-call.md +++ b/docs/3.tutorials/crosswords/01-basics/02-add-functions-call.md @@ -187,7 +187,7 @@ Let's deploy the contract (to the subaccount we created) and then check this aga Ensure that in your command line application, you're in the directory that contains the `Cargo.toml` file, then run: ```bash -cargo near deploy crossword.friend.testnet without-init-call network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm crossword.friend.testnet without-init-call network-config testnet sign-with-keychain send ``` Congratulations, you've deployed the smart contract! Note that NEAR CLI will output a link to [NEAR Explorer](https://nearblocks.io/) where you can inspect details of the transaction. diff --git a/docs/3.tutorials/crosswords/01-basics/03-hashing-and-unit-tests.md b/docs/3.tutorials/crosswords/01-basics/03-hashing-and-unit-tests.md index 1b16386828b..a0b9b37e9b2 100644 --- a/docs/3.tutorials/crosswords/01-basics/03-hashing-and-unit-tests.md +++ b/docs/3.tutorials/crosswords/01-basics/03-hashing-and-unit-tests.md @@ -150,7 +150,7 @@ Create fresh account if you wish, which is good practice: Deploy the contract: ```bash -cargo near deploy crossword.friend.testnet without-init-call network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm crossword.friend.testnet without-init-call network-config testnet sign-with-keychain send ``` Call the "new" method: @@ -225,7 +225,7 @@ Create fresh account if you wish, which is good practice: Deploy the contract and call the initialization method: ```bash -cargo near deploy crossword.friend.testnet with-init-call new json-args '{"solution": "69c2feb084439956193f4c21936025f14a5a5a78979d67ae34762e18a7206a0f"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm crossword.friend.testnet with-init-call new json-args '{"solution": "69c2feb084439956193f4c21936025f14a5a5a78979d67ae34762e18a7206a0f"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send ``` Now that we're using Batch Actions, no one can call this `new` method before us. diff --git a/docs/3.tutorials/crosswords/01-basics/04-simple-frontend.md b/docs/3.tutorials/crosswords/01-basics/04-simple-frontend.md index 85be144970d..722f07a86e9 100644 --- a/docs/3.tutorials/crosswords/01-basics/04-simple-frontend.md +++ b/docs/3.tutorials/crosswords/01-basics/04-simple-frontend.md @@ -126,7 +126,7 @@ Create fresh account if you wish, which is good practice: Deploy the contract: ```bash -cargo near deploy crossword.friend.testnet with-init-call new json-args '{"solution": "69c2feb084439956193f4c21936025f14a5a5a78979d67ae34762e18a7206a0f"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm crossword.friend.testnet with-init-call new json-args '{"solution": "69c2feb084439956193f4c21936025f14a5a5a78979d67ae34762e18a7206a0f"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send ``` Return to the project root and start the React app: diff --git a/docs/3.tutorials/crosswords/02-beginner/04-adding-a-puzzle.md b/docs/3.tutorials/crosswords/02-beginner/04-adding-a-puzzle.md index ddddfb1dcfb..cf91cf0c9c1 100644 --- a/docs/3.tutorials/crosswords/02-beginner/04-adding-a-puzzle.md +++ b/docs/3.tutorials/crosswords/02-beginner/04-adding-a-puzzle.md @@ -83,7 +83,7 @@ Here's how to delete and recreate the subaccount using NEAR CLI: Deploy, calling the "new" method with the parameter for owner_id: ```bash -cargo near deploy crossword.friend.testnet with-init-call new json-args '{"owner_id": "crossword.friend.testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm crossword.friend.testnet with-init-call new json-args '{"owner_id": "crossword.friend.testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send ``` Now we're ready to construct our new crossword puzzle and add it via the `new_puzzle` method. Let's start with the clues for this new puzzle. diff --git a/docs/3.tutorials/crosswords/02-beginner/06-logging-in-implementation.md b/docs/3.tutorials/crosswords/02-beginner/06-logging-in-implementation.md index 39f682c8de9..25a78444f70 100644 --- a/docs/3.tutorials/crosswords/02-beginner/06-logging-in-implementation.md +++ b/docs/3.tutorials/crosswords/02-beginner/06-logging-in-implementation.md @@ -170,7 +170,7 @@ Create fresh account if you wish, which is good practice: Deploy the contract: ```bash -cargo near deploy crossword.friend.testnet with-init-call new json-args '{"owner_id": "crossword.friend.testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm crossword.friend.testnet with-init-call new json-args '{"owner_id": "crossword.friend.testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send ``` Add the crossword puzzle: diff --git a/docs/3.tutorials/crosswords/03-intermediate/05-base64vecu8.md b/docs/3.tutorials/crosswords/03-intermediate/05-base64vecu8.md index fe4a6048836..3896e065785 100644 --- a/docs/3.tutorials/crosswords/03-intermediate/05-base64vecu8.md +++ b/docs/3.tutorials/crosswords/03-intermediate/05-base64vecu8.md @@ -158,7 +158,7 @@ cargo near build ```bash -cargo near deploy $NEAR_ACCT with-init-call new json-args '{"owner_id": "'$NEAR_ACCT'", "creator_account": "testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm $NEAR_ACCT with-init-call new json-args '{"owner_id": "'$NEAR_ACCT'", "creator_account": "testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send ``` diff --git a/docs/3.tutorials/examples/advanced-xcc.md b/docs/3.tutorials/examples/advanced-xcc.md index 1329a6dfc20..e2edac64fc0 100644 --- a/docs/3.tutorials/examples/advanced-xcc.md +++ b/docs/3.tutorials/examples/advanced-xcc.md @@ -290,9 +290,7 @@ In order to deploy the contract you will need to create a NEAR account. Go into the directory containing the smart contract (`cd contract-advanced-ts` or `cd contract-advanced-rs`), build and deploy it: ```bash -cargo near build - -cargo near deploy with-init-call new json-args '{"hello_account":"hello.near-example.testnet","guestbook_account":"guestbook_account.near-example.testnet","counter_account":"counter_account.near-example.testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm with-init-call new json-args '{"hello_account":"hello.near-example.testnet","guestbook_account":"guestbook_account.near-example.testnet","counter_account":"counter_account.near-example.testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send ```
diff --git a/docs/3.tutorials/examples/count-near.md b/docs/3.tutorials/examples/count-near.md index 8a5e191d9c0..e5e9db885d8 100644 --- a/docs/3.tutorials/examples/count-near.md +++ b/docs/3.tutorials/examples/count-near.md @@ -183,9 +183,7 @@ In order to deploy the contract you will need to create a NEAR account. Go into the directory containing the smart contract (`cd contract-ts` or `cd contract-rs`), build and deploy it: ```bash -cargo near build - -cargo near deploy +cargo near deploy build-non-reproducible-wasm ``` :::tip To interact with your contract from the [frontend](#frontend), simply replace the value of the `testnet` key in the `config.js` file. diff --git a/docs/3.tutorials/examples/donation.md b/docs/3.tutorials/examples/donation.md index 43c7e84bf8c..95bd637a8b7 100644 --- a/docs/3.tutorials/examples/donation.md +++ b/docs/3.tutorials/examples/donation.md @@ -186,9 +186,7 @@ In order to deploy the contract you will need to create a NEAR account. Go into the directory containing the smart contract (`cd contract-ts` or `cd contract-rs`), build and deploy it: ```bash -cargo near build - -cargo near deploy +cargo near deploy build-non-reproducible-wasm ``` :::tip diff --git a/docs/3.tutorials/examples/guest-book.md b/docs/3.tutorials/examples/guest-book.md index 416642aeddc..86be34a066e 100644 --- a/docs/3.tutorials/examples/guest-book.md +++ b/docs/3.tutorials/examples/guest-book.md @@ -184,9 +184,7 @@ In order to deploy the contract you will need to create a NEAR account. Go into the directory containing the smart contract (`cd contract-ts` or `cd contract-rs`), build and deploy it: ```bash -cargo near build - -cargo near deploy +cargo near deploy build-non-reproducible-wasm ``` :::tip diff --git a/docs/3.tutorials/examples/xcc.md b/docs/3.tutorials/examples/xcc.md index d77bc75038a..f0af14951ce 100644 --- a/docs/3.tutorials/examples/xcc.md +++ b/docs/3.tutorials/examples/xcc.md @@ -168,9 +168,7 @@ In order to deploy the contract you will need to create a NEAR account. Go into the directory containing the smart contract (`cd contract-advanced-ts` or `cd contract-advanced-rs`), build and deploy it: ```bash -cargo near build - -cargo near deploy with-init-call new json-args '{"hello_account":"hello.near-example.testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm with-init-call new json-args '{"hello_account":"hello.near-example.testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send ```
diff --git a/docs/3.tutorials/fts/1-skeleton.md b/docs/3.tutorials/fts/1-skeleton.md index 851e8b9b967..1efd4496ebf 100644 --- a/docs/3.tutorials/fts/1-skeleton.md +++ b/docs/3.tutorials/fts/1-skeleton.md @@ -181,5 +181,5 @@ At the time of this writing, this example works with the following versions: - rustc: `1.77.1` - near-sdk-rs: `5.1.0` (with enabled `legacy` feature) -- cargo-near: `0.6.1` +- cargo-near: `0.13.2` ::: diff --git a/docs/3.tutorials/fts/2-define-a-token.md b/docs/3.tutorials/fts/2-define-a-token.md index 9d2a03b28ee..35e60609978 100644 --- a/docs/3.tutorials/fts/2-define-a-token.md +++ b/docs/3.tutorials/fts/2-define-a-token.md @@ -118,7 +118,7 @@ echo $FT_CONTRACT_ID Verify that the correct account ID is printed in the terminal. If everything looks correct you can now deploy your contract. For simplicity, let's call the default metadata initialization function you wrote earlier so that you don't have to type the metadata manually in the CLI. In the root of your FT project run the following command to deploy your smart contract. ```bash -cargo near deploy $FT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$FT_CONTRACT_ID'", "total_supply": "0"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm $FT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$FT_CONTRACT_ID'", "total_supply": "0"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send ``` At this point, the contract should have been deployed to your account and initialized. @@ -186,6 +186,6 @@ At the time of this writing, this example works with the following versions: - rustc: `1.77.1` - near-sdk-rs: `5.1.0` (with enabled `legacy` feature) -- cargo-near: `0.6.1` +- cargo-near: `0.13.2` - near-cli-rs: `0.17.0` ::: diff --git a/docs/3.tutorials/fts/3-circulating-supply.md b/docs/3.tutorials/fts/3-circulating-supply.md index f53e5d81e99..5dd764621b1 100644 --- a/docs/3.tutorials/fts/3-circulating-supply.md +++ b/docs/3.tutorials/fts/3-circulating-supply.md @@ -267,7 +267,7 @@ cargo near build It's time to deploy the contract, initialize it and mint the total supply. Let's create an initial supply of 1000 `gtNEAR`. Since it has 24 decimal places, you should put `1000` followed by 24 zeros in the total supply field. ```bash -cargo near deploy $EVENTS_FT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$EVENTS_FT_CONTRACT_ID'", "total_supply": "1000000000000000000000000000"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm $EVENTS_FT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$EVENTS_FT_CONTRACT_ID'", "total_supply": "1000000000000000000000000000"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send ``` You can check to see if everything went through properly by looking at the output in your CLI: @@ -385,6 +385,7 @@ At the time of this writing, this example works with the following versions: - rustc: `1.77.1` - near-sdk-rs: `5.1.0` (with enabled `legacy` feature) +- cargo-near: `0.13.2` - cargo-near: `0.6.1` - near-cli-rs: `0.17.0` ::: diff --git a/docs/3.tutorials/fts/4.storage.md b/docs/3.tutorials/fts/4.storage.md index aff6d8b39bf..8ec07dde4f9 100644 --- a/docs/3.tutorials/fts/4.storage.md +++ b/docs/3.tutorials/fts/4.storage.md @@ -171,7 +171,7 @@ cargo near build It's time to deploy the contract, initialize it and mint the total supply. Let's once again create an initial supply of 1000 `gtNEAR`. ```bash -cargo near deploy $STORAGE_FT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$STORAGE_FT_CONTRACT_ID'", "total_supply": "1000000000000000000000000000"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm $STORAGE_FT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$STORAGE_FT_CONTRACT_ID'", "total_supply": "1000000000000000000000000000"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send ``` If you now query for the storage paid by the owner, you should see that they're registered! @@ -235,6 +235,6 @@ At the time of this writing, this example works with the following versions: - rustc: `1.77.1` - near-sdk-rs: `5.1.0` (with enabled `legacy` feature) -- cargo-near: `0.6.1` +- cargo-near: `0.13.2` - near-cli-rs: `0.17.0` ::: diff --git a/docs/3.tutorials/fts/5.transfers.md b/docs/3.tutorials/fts/5.transfers.md index 680d67866f9..022945a3b22 100644 --- a/docs/3.tutorials/fts/5.transfers.md +++ b/docs/3.tutorials/fts/5.transfers.md @@ -163,7 +163,7 @@ cargo near build It's time to deploy the contract, initialize it and mint the total supply. Let's once again create an initial supply of 1000 `gtNEAR`. ```bash -cargo near deploy $TRANSFER_FT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$TRANSFER_FT_CONTRACT_ID'", "total_supply": "1000000000000000000000000000"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm $TRANSFER_FT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$TRANSFER_FT_CONTRACT_ID'", "total_supply": "1000000000000000000000000000"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send ``` You can check if you own the FTs by running the following command: @@ -380,6 +380,6 @@ At the time of this writing, this example works with the following versions: - rustc: `1.77.1` - near-sdk-rs: `5.1.0` (with enabled `legacy` feature) -- cargo-near: `0.6.1` +- cargo-near: `0.13.2` - near-cli-rs: `0.17.0` ::: diff --git a/docs/3.tutorials/fts/6-marketplace.md b/docs/3.tutorials/fts/6-marketplace.md index 177dbd3a253..c8017da3833 100644 --- a/docs/3.tutorials/fts/6-marketplace.md +++ b/docs/3.tutorials/fts/6-marketplace.md @@ -42,7 +42,7 @@ Let's start by building both the finished FT contract and the marketplace contra ```bash -cd market-contract && cargo near build && cd .. +cd market-contract && cargo near build non-reproducible-wasm && cd .. ``` This will install the dependencies for the marketplace contract as well as the FT contract. Note that there's also `ft-tutorial/out` directory with pre-build nft contract wasm file which you'll use to place the NFTs for sale. @@ -174,7 +174,7 @@ Now that you *hopefully* have a good understanding of how the marketplace contra The first thing you'll want to do is deploy a new FT, NFT, and marketplace contract. ```bash -cd market-contract && cargo near build && cd .. +cd market-contract && cargo near build non-reproducible-wasm && cd .. ``` To deploy the FT contract and export an environment variable, run the following command: @@ -182,7 +182,7 @@ To deploy the FT contract and export an environment variable, run the following ```bash export FT_CONTRACT= near create-account $FT_CONTRACT --useFaucet -cd 5.transfers/ && cargo near deploy $FT_CONTRACT with-init-call new_default_meta json-args '{"owner_id": "'$FT_CONTRACT'", "total_supply": "1000000000000000000000000000"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send && cd ../ +cd 5.transfers/ && cargo near deploy build-non-reproducible-wasm $FT_CONTRACT with-init-call new_default_meta json-args '{"owner_id": "'$FT_CONTRACT'", "total_supply": "1000000000000000000000000000"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send && cd ../ ``` Next, you'll deploy the NFT and marketplace contracts. @@ -196,7 +196,7 @@ near deploy $NFT_CONTRACT out/nft-contract.wasm ```bash export MARKETPLACE_CONTRACT= near create-account $MARKETPLACE_CONTRACT --useFaucet -cd market-contract/ && cargo near deploy $MARKETPLACE_CONTRACT with-init-call new json-args '{"owner_id": "'$MARKETPLACE_CONTRACT'", "ft_id": "'$FT_CONTRACT'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send && cd ../ +cd market-contract/ && cargo near deploy build-non-reproducible-wasm $MARKETPLACE_CONTRACT with-init-call new json-args '{"owner_id": "'$MARKETPLACE_CONTRACT'", "ft_id": "'$FT_CONTRACT'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send && cd ../ ``` Check and see if your environment variables are all correct by running the following command. Each output should be different. @@ -613,6 +613,6 @@ At the time of this writing, this example works with the following versions: - rustc: `1.77.1` - near-sdk-rs: `5.1.0` (with enabled `legacy` feature) -- cargo-near: `0.6.1` +- cargo-near: `0.13.2` - near-cli: `4.0.13` ::: diff --git a/docs/3.tutorials/nfts/1-skeleton.md b/docs/3.tutorials/nfts/1-skeleton.md index b7fa67f9e79..5e284e0b815 100644 --- a/docs/3.tutorials/nfts/1-skeleton.md +++ b/docs/3.tutorials/nfts/1-skeleton.md @@ -263,7 +263,7 @@ At the time of this writing, this example works with the following versions: - rustc: `1.76.0` - near-sdk-rs: `5.1.0` -- cargo-near: `0.6.1` +- cargo-near: `0.13.2` - NFT standard: [NEP171](https://nomicon.io/Standards/Tokens/NonFungibleToken/Core), version `1.0.0` ::: diff --git a/docs/3.tutorials/nfts/2-minting.md b/docs/3.tutorials/nfts/2-minting.md index fe44ac23e69..87f620fdfa8 100644 --- a/docs/3.tutorials/nfts/2-minting.md +++ b/docs/3.tutorials/nfts/2-minting.md @@ -251,7 +251,7 @@ Verify that the correct account ID is printed in the terminal. If everything loo In the root of your NFT project run the following command to deploy your smart contract and answer questions: ```bash -cargo near deploy $NFT_CONTRACT_ID +cargo near deploy build-non-reproducible-wasm $NFT_CONTRACT_ID > Select the need for initialization: with-init-call - Add an initialize > What is the name of the function? new_default_meta @@ -267,7 +267,7 @@ cargo near deploy $NFT_CONTRACT_ID You don't need to answer these questions every time. If you look at the results you will find the message `Here is the console command if you ever need to re-run it again`. The next line is the command which you may use instead of answering to interactive questions: ```bash -cargo near deploy $NFT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$NFT_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm $NFT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$NFT_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send ``` You've just deployed and initialized the contract with some default metadata and set your account ID as the owner. At this point, you're ready to call your first view function. diff --git a/docs/3.tutorials/nfts/2-upgrade.md b/docs/3.tutorials/nfts/2-upgrade.md index fad585637b4..35d340210d7 100644 --- a/docs/3.tutorials/nfts/2-upgrade.md +++ b/docs/3.tutorials/nfts/2-upgrade.md @@ -48,7 +48,7 @@ Let's move over to the `enumeration.rs` file and implement that logic: Now that you've implemented the necessary logic for `nft_tokens_for_owner`, it's time to build and re-deploy the contract to your account. Using the cargo-near, deploy the contract as you did in the previous tutorial: ```bash -cargo near deploy $NFT_CONTRACT_ID without-init-call network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm $NFT_CONTRACT_ID without-init-call network-config testnet sign-with-keychain send ``` Once the contract has been redeployed, let's test and see if the state migrated correctly by running a simple view function: diff --git a/docs/3.tutorials/nfts/3-enumeration.md b/docs/3.tutorials/nfts/3-enumeration.md index 677ff25d649..8b0b2a3d959 100644 --- a/docs/3.tutorials/nfts/3-enumeration.md +++ b/docs/3.tutorials/nfts/3-enumeration.md @@ -56,7 +56,7 @@ Next, you can use the CLI to query these new methods and validate that they work Now that you've implemented the necessary logic for `nft_tokens_for_owner`, it's time to build and re-deploy the contract to your account. Using the cargo-near, deploy the contract as you did in the previous tutorials: ```bash -cargo near deploy $NFT_CONTRACT_ID without-init-call network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm $NFT_CONTRACT_ID without-init-call network-config testnet sign-with-keychain send ``` --- diff --git a/docs/3.tutorials/nfts/4-core.md b/docs/3.tutorials/nfts/4-core.md index b822ca1a0d1..eb2e6ca1100 100644 --- a/docs/3.tutorials/nfts/4-core.md +++ b/docs/3.tutorials/nfts/4-core.md @@ -145,7 +145,7 @@ With that finished, you've now successfully added the necessary logic to allow u Using cargo-near, deploy the contract as you did in the previous tutorials: ```bash -cargo near deploy $NFT_CONTRACT_ID without-init-call network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm $NFT_CONTRACT_ID without-init-call network-config testnet sign-with-keychain send ``` :::tip diff --git a/docs/3.tutorials/nfts/5-approval.md b/docs/3.tutorials/nfts/5-approval.md index 91ce732314a..79b5f83aeca 100644 --- a/docs/3.tutorials/nfts/5-approval.md +++ b/docs/3.tutorials/nfts/5-approval.md @@ -288,7 +288,7 @@ Next, you'll deploy this contract to the network. Using the cargo-near, deploy and initialize the contract as you did in the previous tutorials: ```bash -cargo near deploy $APPROVAL_NFT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$APPROVAL_NFT_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm $APPROVAL_NFT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$APPROVAL_NFT_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send ```
diff --git a/docs/3.tutorials/nfts/6-royalty.md b/docs/3.tutorials/nfts/6-royalty.md index 434f21d9b88..73d535f7315 100644 --- a/docs/3.tutorials/nfts/6-royalty.md +++ b/docs/3.tutorials/nfts/6-royalty.md @@ -166,7 +166,7 @@ Next, you'll deploy this contract to the network. Using the cargo-near, deploy and initialize the contract as you did in the previous tutorials: ```bash -cargo near deploy $ROYALTY_NFT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$ROYALTY_NFT_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm $ROYALTY_NFT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$ROYALTY_NFT_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send ``` ### Minting {#minting} diff --git a/docs/3.tutorials/nfts/7-events.md b/docs/3.tutorials/nfts/7-events.md index 0800e063002..7e7b1a10cb2 100644 --- a/docs/3.tutorials/nfts/7-events.md +++ b/docs/3.tutorials/nfts/7-events.md @@ -207,7 +207,7 @@ Next, you'll deploy this contract to the network. Using the cargo-near, deploy and initialize the contract as you did in the previous tutorials: ```bash -cargo near deploy $EVENTS_NFT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$EVENTS_NFT_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm $EVENTS_NFT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$EVENTS_NFT_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send ```
diff --git a/docs/3.tutorials/nfts/8-marketplace.md b/docs/3.tutorials/nfts/8-marketplace.md index fca75d6e4b7..8db4f6da0e2 100644 --- a/docs/3.tutorials/nfts/8-marketplace.md +++ b/docs/3.tutorials/nfts/8-marketplace.md @@ -191,7 +191,7 @@ Next, you'll deploy this contract to the network. Using the build script, deploy the contract as you did in the previous tutorials: ```bash -cargo near deploy $MARKETPLACE_CONTRACT_ID with-init-call new json-args '{"owner_id": "'$MARKETPLACE_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm $MARKETPLACE_CONTRACT_ID with-init-call new json-args '{"owner_id": "'$MARKETPLACE_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send ```
diff --git a/docs/3.tutorials/nfts/9-series.md b/docs/3.tutorials/nfts/9-series.md index 3914fe298c6..3887969e17b 100644 --- a/docs/3.tutorials/nfts/9-series.md +++ b/docs/3.tutorials/nfts/9-series.md @@ -316,7 +316,7 @@ echo $NFT_CONTRACT_ID This should return your ``. The next step is to initialize the contract with some default metadata. ```bash -cargo near deploy $NFT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$NFT_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send +cargo near deploy build-non-reproducible-wasm $NFT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$NFT_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send ``` If you now query for the metadata of the contract, it should return our default metadata. diff --git a/docs/3.tutorials/nfts/js/2-minting.md b/docs/3.tutorials/nfts/js/2-minting.md index e82458a0b29..2b19705b496 100644 --- a/docs/3.tutorials/nfts/js/2-minting.md +++ b/docs/3.tutorials/nfts/js/2-minting.md @@ -222,7 +222,7 @@ Verify that the correct account ID is printed in the terminal. If everything loo In the root of your NFT project run the following command to deploy your smart contract. ```bash -cargo near deploy $NFT_CONTRACT_ID +cargo near deploy build-non-reproducible-wasm $NFT_CONTRACT_ID ``` At this point, the contract should have been deployed to your account and you're ready to move onto testing and minting NFTs.