Create your own OPC-202 & OPC-721 (NFT) tokens

Introduce

Cryptocurrency is a type of digital currency known by names such as crypto, cryptocurrency,... The core of currency is Blockchain technology. The vast majority of people know about currencies through the names Bitcoin (BTC), Ethereum (ETH), XRP, TRON (TRX)...

In this article, I will guide you to create an OPC-202 standard token on the OPC Testnet network, so the token has no value, only transactions on the Testnet.

Platform

In this article, the token will be created according to the ERC-20 standard on the OPC Testnet platform. To be able to trade like AXS tokens, you need to deploy to the Mainnet (for a fee). Testnet is a network for developers to test before releasing to the Mainnet. Testnet will provide free OPC as a fee for each coin transfer transaction.

Preparation

  • Already have a MetaMask wallet, install the Extension MetaMask on the browser

  • Add Testnet network (skip if added before)

  • Get free OPC at OPC Testnet Faucet for up to 10 OPC/wallet (skip if received before)

Compilation and Deployment

Create contract

Open Remix IDE https://remix.ethereum.org

Create a new contract YourName.sol and copy the contract code from the OPC-202 (download temlate here) and OPC-721 (NFT) (download template here). Modify the name, symbol, decimals, and totalSupply values as per your requirement.

Complie OPC-202 và OPC-721 Contract

  1. Click the button to switch to the compilation page

  2. Select Yourname contract

  3. Enable Auto Compile and Enable optimization

  4. Click ABI to copy contract ABI and save

Deploy contract to OPC Testnet

  1. Click to switch to Deploy

  2. Select Injected Web3

  3. If for the first time it will pop up MetaMask to connect.

  4. Choose Yourname

  5. Click Deploy and a pop-up MetaMask will appear

Click “Confirm” to pay the transaction fee with the previously received free OPC.

Token will return to your MetaMask wallet. Go to MetaMask and add your Token so it shows up on the wallet. The transaction can be viewed at https://testnet.openchain.info/

Add Tokens to Metamask

Select the "Assets" tab, then click "Import token", paste the contract address of the newly created token in the "Token Contract Address" box, the other two fields Metamask itself gets from the blockchain, click "Add Custom Token" to add Token to the assets

Last updated