CTEX-20 Token
CTEX-20 Tokens on CTEX Chain
This token standard is equivalent of ERC20 built on top of the CTEX Chain network. Users would have to need CTEX in order to cover the transaction fees for sending CTEX-20 tokens. These tokens can be easily integrated into other dapps and get listed on cryptocurrency exchanges.
There is a separate smart contract for creating and issuing CTEX-20 tokens for interested parties or developers where all they have to do is enter name, ticker, details and quantity of tokens to mint it within 10 minutes.
CTEX-20 smart contract ABI:
CTEX20Contract Interface
Copy
Explainfunction totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);CTEX Chain provides RPC APIs to developers for using Web3 library to call functions directly in a smart contract. Follow the steps below to interact with the smart contract by using Web3 Library and NodeJS.
Init Web3 Provider
Firstly, init Web3 provider by connecting CTEX Chain Fullnode RPC endpoint.
Check CTEX Chain Network page to find details about Testnet or Mainnet network information.
Copy
Unlock Wallet
Refer Create new wallet page for creating/unlocking a new wallet.
Example:
Copy
Init Web3 CTEX20 Contract
Copy
Check Balance
Use call function balanceOf() from CTEX20 contract to check token balance for any address.
Example:
Copy
Estimate TX Fee (gas)
To send tokens, CTEX is needed to cover the transaction fees.
Method:
Copy
Example:
Copy
Token Transfer
To transfer CTEX20token, transfer function is used.
Example:
Copy
Last updated