AIXChain Blockchain Document
  • INTRODUCTION
    • Getting started with smart contract development
    • Build a Decentralized Library
  • AIXC AND ARC TOKEN
    • ARC
      • ARX Transfer
      • Query ARX balance
    • ARC-10
      • Issue ARC-10 token
      • Participate ARC-10
      • ARC-10 Transfer
      • Query ARC-10 balance
      • ARC-10 Transfer in Smart Contracts
    • ARC-20
      • Protocol Interface
      • Contract Example
      • Issuing ARC-20 tokens tutorial
    • ARC-721
      • Protocol Interface
      • Contract Example
  • ACCOUNT MODEL
  • BUILD NODE
    • How to setup a Super node to produce Blocks
      • Recommended configuration & Environment
      • Example cloud services
      • Deployment guide
    • Super Representative
      • How to become a SR
      • Super Representatives Election
      • How to change witness name
  • HTTP API
    • Introduction
    • API Signature and Broadcast Flow
    • API List
      • Full Node API Overview
      • Address Utilities
        • GenerateAddress
        • CreateAddress
        • ValidateAddress
      • Accounts
        • CreateAccount
        • GetAccount
        • UpdateAccount
        • AccountPermissionUpdate
        • GetAccountBalance
      • Account Resources
        • GetAccountResource
        • GetAccountNet
        • FreezeBalance
        • UnfreezeBalance
        • GetDelegatedResource
        • GetDelegatedResourceAccountIndex
      • Query the Network
        • GetBlockByNum
        • GetBlockById
        • GetBlockByLatestNum
        • GetBlockByLimitNext
        • GetNowBlock
        • GetTransactionById
        • GetTransactionInfoById
        • GetTransactionInfoByBlockNum
        • ListNodes
        • GetNodeInfo
        • GetChainParameters
        • GetBlockBalance
      • ARC10 Token
        • GetAssetIssueByAccount
        • GetAssetIssueById
        • GetAssetIssueList
        • GetPaginatedAssetIssueList
        • TransferAsset
        • CreateAssetIssue
        • UnfreezeAsset
        • UpdateAsset
      • Transactions
        • GetContract
        • GetTransactionSign
        • BroadcastTransaction
        • BroadcastHex
        • EasyTransfer
        • EasyTransferByPrivate
        • CreateTransaction
      • Voting & SRs
        • ListWitnesses
        • CreateWitness
        • UpdateWitness
        • GetBrokerage
        • UpdateBrokerage
        • VoteWitnessAccount
        • GetReward
        • WithdrawBalance
        • GetNextMaintenanceTime
      • Smart Contracts
        • TriggerSmartContract
        • DeployContract
        • UpdateSetting
        • UpdateEnergyLimit
        • ClearAbi
        • GetContract
        • TriggerConstantContract
      • Proposals
      • Solidity Node API
    • RPC List
  • AIXCHAIN CLI
  • Aixchain SDK
    • Quickstart
    • Address and Signature
    • Sending Transaction
    • Smart Contract
  • Faucet Aixchain
  • Wallets
Powered by GitBook
On this page
  • ARC-20 contract standard
  • Optional Items
  • Required Items
  • Event Functions
  1. AIXC AND ARC TOKEN
  2. ARC-20

Protocol Interface

ARC-20 contract standard

ARC-20 is a set of contract standards for the issuance of token assets, contracts written in compliance with this standard are considered to be a ARC-20 contract. When wallets and exchanges are docking the assets of the ARC-20 contract, from this set of standards, you can know which functions and events the contract defines, so as to facilitate the docking.

Optional Items

Token Name

string public name = "AixChain";

Token Abbreviation

string public symbol = "Aixc";

Token Precision(Decimals)

uint8 public decimals = 6;

Required Items

contract ARC20 {
             function totalSupply() constant returns (uint theTotalSupply);
             function balanceOf(address _owner) constant returns (uint balance);
             function transfer(address _to, uint _value) returns (bool success);
             function transferFrom(address _from, address _to, uint _value) returns (bool success);
             function approve(address _spender, uint _value) returns (bool success);
             function allowance(address _owner, address _spender) constant returns (uint remaining);
             event Transfer(address indexed _from, address indexed _to, uint _value);
             event Approval(address indexed _owner, address indexed _spender, uint _value);
}

totalSupply() This function returns the total supply of the token.

balanceOf() This function returns the token balance of the specific account.

transfer() This function is used to transfer a number of tokens to a specific address.

approve() This function is used to authorize the third party (like a DAPP smart contract) to transfer the token from the token owner’s account.

transferFrom() This function is used to allow the third party to transfer the token from an owner account to a receiver account. The owner account must be approved to be called by the third party.

allowance() This function is used to query the remaining amount of tokens the third party can transfer.

Event Functions

When the token is successfully transferred, the contract will trigger a Transfer Event.

event Transfer(address indexed _from, address indexed _to, uint256 _value)

When approval() is successfully called, the contract will trigger an Approval Event.

event Approval(address indexed _owner, address indexed _spender, uint256 _value)
PreviousARC-20NextContract Example

Last updated 29 days ago