This example assumes the ERC1155 Access Control is Role Based.
Your Sidekick smart wallet should be the new
owner
now if you plan to execute transactions from Sidekick. It won’t work to mint new tokens if you do not transfer ownership
to the Sidekick smart wallet or use Role Based Access Control and grant the minter role to the Sidekick smart wallet.Mint an NFT with Role Based Access Control
1
Complete Sidekick Setup
Make sure you have gone through the Sidekick Setup guide.
2
Get your Sidekick smart wallet address
Send a GET request to the
/sidekick/smart-account-address
endpoint to retrieve your Sidekick smart wallet address. This address will be used to interact with your NFT contracts.3
Grant the minter role to the Sidekick smart wallet address from the contract
4
Mint the NFT
Now that your Sidekick smart wallet has the minter role, you can send a POST request to the
/write/erc1155/{chainId}/{contractAddress}/mint
endpoint to mint an NFT from the backend.If your NFT is not Role Based, instead of granting the minter role you will need to transfer ownership of the contract to the Sidekick smart wallet.
Deploy and Mint from Sidekick
You can also deploy your contract from Sidekick and mint, without any extra steps.1
Deploy the NFT contract
Deploy the NFT contract using Sidekick.
2
Mint the NFT
Mint the NFT using Sidekick.