Before we start, a quick question, do you have any idea about how to create your NFT with MegaNode? If you want to know more, please check our article 👉 ( Create your First NFT on BSC Using MegaNode in 5mins）
In today’s tutorial, we will provide a step-by-step guide to the developer on how to issue Non-Fungible Tokens (NFTs) (ERC721/1155) on BNB Application Sidechain (BAS) Aries Testnet and how to bridge the issued NFTs from BAS to BSC.
We aim to keep this tutorial as simple as possible and hence tend to use as minimal resources as possible and have used the following tools in this tutorial.
Set up the Environment:
Ensure that you have the Metamask Wallet extension installed and running on our browser.
Configure the Metamask wallet for use with the Aries Testnet. Use the following details to add the Aries Testnet. For further details, refer here.
Network Name: Aries Testnet
Chain ID: 0x75 or 117
Currency Symbol: ARS
Block Explorer URL: https://bas-aries-testnet-explorer.nodereal.io/
BAS Aires is also on BNBChain List now! You can easily connect with our testnet in a split second there.
Remix IDE: https://remix.ethereum.org/
Celer BAS Testnet Bridge: https://test-bas-bridge.celer.network/#/transfer
Issue Fungible BEP20 Tokens
- Navigate to Remix IDE. We will be using it for compiling and deploying our smart contract for BEP20 tokens on the Aries Testnet.
- Create a new contract and name the file as NFT.sol, as shown in the figure below. You can use the contract code from this repo.
3. You can always modify and be innovative: remember the smart contract in this tutorial is just a sample.
4. Acquire Test Tokens: Make sure to get some test ARS tokens for deploying your smart contracts on the BAS Aries Testnet. You can use the Testnet Faucet for acquiring test tokens.
5. Compile the BEP20 token contract: follow the below steps to compile your smart contract.
Step1: Switch to the compile page. Make sure the compiler version is the same as specified on the top of the smart contract code.
Step2: Select “Happy Monkey – NFT.sol” contract
Step3: Enable “Auto compile” and “optimization”
Step4: Click “ABI” to copy the contract ABI and save it.
6. Deploy the contract to BAS Aries Testnet
Step1: Click button to switch to compile button.
Step2: Select “Injected Web3”
Step3: Select “Happy Monkey – NFT.sol”
Step4: Client “Deploy” button and Metamask will pop up. Click the “confirm” button on the Metamask pop up to sign and broadcast transactions to BAS.
Once the transaction is confirmed, you will be able to see this transaction in the activity log of Metamask Wallet. By clicking on the log, you can open the transaction details and also get the link to view our transaction on the BAS Explorer.
7. You can also interact with the contract using the different functions. To mint i.e. issue an NFT to a specific user we use the “safeMint” function of the deployed smart contract. Navigate to the deployed contracts and collapse the “HappyMonkey” contract to view the list of functions available for use with the deployed contract.
8. Use the safeMint function to mint new NFTs to a specific user address. Here, pass the public address of the user (in our case, Account#2 of our Metamask wallet). Scroll up in the Value field input the mint price, in our case, 50000000000000000 Wei. After this, click the transact button to execute the safeMint function. On pressing the transact button, Metamask notification will pop up asking you to confirm the transaction, click the Confirm button. Ensure that you are using the account that was used to deploy the smart contract for using the safeMint function.
9. The function will return the address of the owner of the specific NFT.As this is the first NFT generated, it has a tokenId as “1”. We can confirm if the account#2 has received the NFT or is the owner of the HappyMonkey NFT #1 by using the ownerOf function. Simply pass the tokenId i.e. 1 to the function and press the call button.
10. On the receiving end, the user can import the NFT token details into their Metamask wallet to view the assets. Please note that currently, Metamask Web Extension does not support the use of NFTs however, the mobile app version does support it. For the next steps to view the owned NFTs in your Metamask wallet, we will be using the Metamask Mobile Application.
11. Ensure that you are using the same account whose public address was issued by the NFT.After you have logged on to the Metamask wallet using your secret recovery phrase and specifying a password, the next step is to add the BAS Aries Testnet configuration to the wallet.
12. Ensure that your account is connected to the BAS Aries Testnet. Also, ensure that you have enough ARS test tokens in your account. If not, you can use the BAS Aries Testnet Faucet to acquire some, as mentioned earlier.
13. To view the owned NFT assets of your Metamask Mobile Wallet. Click on the NFTs tab and then on the Import Tokens. Fill in the NFT details. In the address field, pass the address of the deployed contract and in the Id field pass the tokenID. Then click the Import button.
These are the simple steps to deploy an NFT smart contract on the BAS Aries Testnet and then issue or mint NFTs to different users.
Last but not least, if you are interested in deploying your own custom BAS but don’t know how to start, we get you covered! NodeReal can deploy the whole infrastructure for you. Submit your application here and our team will reach you asap.
Join Our Community
Join our community to learn more about NodeReal and stay up to date with us!