Deploy Your NFT Smart Contract
Next, we'll use WAX-CDT tools to deploy your NFT smart contract to the WAX mainnet. Refer to WAX-CDT Deploy for more information.
From Docker, open and unlock your wallet.
cleos wallet open -n mywallet && cleos wallet unlock -n mywallet --password {wallet.pwd}
Using cleos or an EOSIO compatible wallet, create a new public/private key pair for your smart contract.
cleos wallet create_key -n mywallet
From the command line, use
cleos system newaccount
. The example below uses waxdappacct1 as the primary WAX Account holder and creates a new smart contract account named waxnftowner1. To run this command, you'll need to have the proper authority. This means that the wallet containing your primary account must be opened and unlocked.cleos -u [chain-api-url] system newaccount waxdappacct1 waxnftowner1 EOS7jEb46pDiWvA39faCoFn3jUdn6LfL51irdXbvfpuSko86iNU5x --stake-net '5.00000000 WAX' --stake-cpu '5.00000000 WAX' --buy-ram-kbytes 32
To run the inline create action in the simpleassets smart contract, you'll need to give your new waxnftowner1@active permission the additional eosio.code permission. This permission enhances security and allows your smart contract to send inline actions. From the command line, run the
cleos set account permission
command, and include the literal--add-code
parameter.cleos -u [chain-api-url] set account permission waxnftowner1 active --add-code
To verify the new permission, use the
cleos get account
command:cleos -u [chain-api-url] get account waxnftowner1
The active permission now displays the new waxnftowner1@eosio.code permission.
created: 2019-12-02T16:13:29.500
permissions:
owner 1: 1 EOS7jEb46pDiWvA39faCoFn3jUdn6LfL51irdXbvfpuSko86iNU5x
active 1: 1 EOS7jEb46pDiWvA39faCoFn3jUdn6LfL51irdXbvfpuSko86iNU5x, 1 waxnftowner1@eosio.codeFinally, set your contract with the
cleos set contract
command (make sure that you're in the waxnft folder):cleos -u [chain-api-url] set contract waxnftowner1 $(pwd) waxrng.wasm waxrng.abi