How to Create Mintable Token CRC20 Coinex Smart Chain


Coinex Smart Chain (hereinafter referred to as CSC) is one of the best blockchain platforms for creating crypto tokens or building DApps, Coinex Smart Chain (CSC) is represented as a super secure blockchain platform in the crypto space, CSC blockchain supports multiple token standards for token building, such as CRC20, CRC721 NFT, CRC115 and build smart contracts and decentralized applications.

CRC20 tokens are commensurate tokens, which means that all units of CRC20 tokens have the same value with each other & CRC20 tokens can be traded on DEX or CEX platforms. Anyone can print CRC20 tokens freely on the coinex smart chain blockchain, you can use trumple , hardhat or Remix IDE.

In the previous article we discussed how to make standard fix supply RC20 tokens, but in this article I will provide a tutorial on how to “Create Mintable Token CRC20”. Mintable is a feature on CRC20 tokens that allows to increase supply at any time, usually this is used for StableCOIN (FIAT) tokens or game reward tokens that are set for Unlimited Supply. The Mintable feature allows you to print any amount at any time.

 

Create Mintable Token CRC20 Coinex Smart Chain

1. Prepare Wallet EVM & Coin native Coinex Smart Chain (CET)

You can use the wallet metamask browser or android smartphone, but for convenience we recommend you use the wallet metask browser.
Buy CET coins on “Coinex Exchange“, CET coins are used to pay gas fees when creating CRC20 token smart contracts, token minting processes and several other transactions. For all this process you only need 10 CET coins or the equivalent of $0.63, this fee is very cheap when compared to ethereum which has to prepare $75-$150 to create a smart contract.

 

2. Solidity Smart Contract

We will use remixethereumIDE and solidity to build a smart contract and deploy it to the Coinex Smart Chain mainet. You can use OppenZepplin’s open source solidity to build smart contracts or use other open sources.

# Solidity Smart Contract (Standart)
We will use remixethereumIDE and solidity to build a smart contract and deploy it to the Coinex Smart Chain mainet. You can use OppenZepplin’s open source solidity to build smart contracts or use other open sources.

pragma solidity ^0.8.4;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract CryptoVIRMintableToken is ERC20 {
constructor() ERC20("CryptoVIR Mintable Token", "CVRM1") {
_mint(msg.sender, 1000 * 10 ** decimals());
}
}

# Mintable Feature
The following are the mintable features that you need to input into your smart contract, so that your CRC20 token has a mintable function

import "@openzeppelin/contracts/access/Ownable.sol";

function mint(address to, uint256 amount) public onlyOwner {
_mint(to, amount);
}

# Combined Results of the Smart Contract above
This solidity smart contract is what you need to input into remixethereumIDE,

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract CryptoVIRMintableToken is ERC20, Ownable {
constructor() ERC20("CryptoVIR Mintable Token", "CVRM1") {
_mint(msg.sender, 1000 * 10 ** decimals());
}

function mint(address to, uint256 amount) public onlyOwner {
_mint(to, amount);
}
}

 

3. Deploy Mintable Token CRC20

I use RemixEthereumIDE to deploy smart contracts, make sure your wallet is filled with some CET coins.
# Go to the remix.ethereum.org site, connect your wallet, create a new sol file and enter the solidity smart contract code
# Use compiler version 0.8.4 , click “Auto Compile” and “Enable Optimization 200
# Wait for the complie process to finish, make sure there are no warnings or errors during compilation, make sure a green check appears on the left

 

# In the ENVIRONMENT section select “Injected Web3
# ACCOUNT : Select the wallet you use to deploy the smart contract
# CONTRACT : Choose your smart contract name, for example “CryptoVIRMintableToken

 

# Click “Deploy” and confirm “Confirm” on your wallet

 

# Wait 3-5 seconds, and check the status of your transaction in the block explorer, once fully confirmed, your token will be printed on the coinex smart chain blockchain

# Process deploy completed, The smart contract is completely on the blockchain, and the tokens are minted according to the initial minting amount when first deployed.

 

4. How to Use CRC20 Minting Feature

Minting is a feature to add token supply, you can use RemixEthereumIDE or do the minting process on the Coinex blockchain explorer (CSC). in this article I will show you how to mint in RemixEthereumIDE.

# Because the token that we are deploying uses Decimal 18, then when you want to mint, you must add a number (ZERO) with the number 18. My example will mint 3000 tokens, then what we have to input is 3000000000000000000000

# Enter RemixEthereumIDE, scroll to the bottom of “Deployed Contract“, you will see a smart contract that has been deployed, click the smart contract

 

# Click the “Mint” button, In the “to” field, enter the address that will receive the token and enter “amount” the number of tokens you want to mint. Click “transact” + confirm on your wallet

 

# After the minting process is complete, the supply of tokens will increase according to the number of tokens you are minting

GOOD LUCK


Alif Fahmi

hi , I'm Alif, I'm a blockchain & cryptocurrency lover, I love writing & learning, my job is web developer & crypto trader