# Mintage

# Contract Specification

Built-in token issuance contract. Contract address is vite_000000000000000000000000000000000000000595292d996d

ABI:

Copy [ // Issue new token {"type":"function","name":"Mint","inputs":[{"name":"isReIssuable","type":"bool"},{"name":"tokenName","type":"string"},{"name":"tokenSymbol","type":"string"},{"name":"totalSupply","type":"uint256"},{"name":"decimals","type":"uint8"},{"name":"maxSupply","type":"uint256"},{"name":"ownerBurnOnly","type":"bool"}]}, // Re-issue. Mint additional tokens {"type":"function","name":"Issue","inputs":[{"name":"tokenId","type":"tokenId"},{"name":"amount","type":"uint256"},{"name":"beneficial","type":"address"}]}, // Burn {"type":"function","name":"Burn","inputs":[]}, // Transfer ownership of re-issuable token {"type":"function","name":"TransferOwner","inputs":[{"name":"tokenId","type":"tokenId"},{"name":"newOwner","type":"address"}]}, // Change token type from re-issuable to non-reissuable {"type":"function","name":"ChangeTokenType","inputs":[{"name":"tokenId","type":"tokenId"}]}, // Query token information {"type":"function","name":"GetTokenInfo","inputs":[{"name":"tokenId","type":"tokenId"},{"name":"bid","type":"uint8"}]}, // Callback function for token information query {"type":"callback","name":"GetTokenInfo","inputs":[{"name":"tokenId","type":"tokenId"},{"name":"bid","type":"uint8"},{"name":"exist","type":"bool"},{"name":"decimals","type":"uint8"},{"name":"tokenSymbol","type":"string"},{"name":"index","type":"uint16"},{"name":"owner","type":"address"}]}, // Token issued event {"type":"event","name":"mint","inputs":[{"name":"tokenId","type":"tokenId","indexed":true}]}, // Token re-issued event {"type":"event","name":"issue","inputs":[{"name":"tokenId","type":"tokenId","indexed":true}]}, // Token burned event {"type":"event","name":"burn","inputs":[{"name":"tokenId","type":"tokenId","indexed":true},{"name":"address","type":"address"},{"name":"amount","type":"uint256"}]}, // Ownership transferred event {"type":"event","name":"transferOwner","inputs":[{"name":"tokenId","type":"tokenId","indexed":true},{"name":"owner","type":"address"}]}, // Token type changed event {"type":"event","name":"changeTokenType","inputs":[{"name":"tokenId","type":"tokenId","indexed":true}]} ]

Querying token information function will return execution results in callback.

# mintage_getMintData

Generate request data for issuing new token. Equivalent to Mint method in ABI.

  • Parameters:

Object

  1. tokenName:string Token name in 1-40 characters, including uppercase/lowercase letters, spaces and underscores. Cannot contain consecutive spaces or begin/end by space
  2. tokenSymbol: string Token symbol in 1-10 characters, including uppercase/lowercase letters, spaces and underscores.
  3. totalSupply: big.int Total supply. Cannot exceed 225612^{256}-1
  4. decimals: uint8 Decimal digits. Having 10decimals<=totalSupply10^{decimals}<=totalSupply
  5. isReIssuable: bool Whether the token can be re-issued. true means the token is in dynamic total supply and additional tokens can be minted.
  6. maxSupply: uint256 Maximum supply. Mandatory for re-issuable token. Cannot exceed 225612^{256}-1. Having maxSupply>=totalSupplymaxSupply>=totalSupply
  7. ownerBurnOnly: bool Whether the token can be burned by the owner only. Mandatory for re-issuable token. All token holders can burn if this flag is false
  • Returns:

    • []byte Data
  • Example:

# mintage_getIssueData

Generate request data for re-issuing the specified amount of tokens. Equivalent to Issue method in ABI.

  • Parameters:

Object

  1. tokenId: TokenId Token ID
  2. amount: uint64 Re-issuance amount
  3. beneficial: Hash The account address to receive newly minted tokens
  • Returns:

    • []byte Data
  • Example:

# mintage_getBurnData

Generate request data for burning token. Equivalent to Burn method in ABI.

  • Parameters:

  • Returns:

    • []byte Data
  • Example:

# mintage_getTransferOwnerData

Generate request data for transferring token ownership. Equivalent to TransferOwner method in ABI.

  • Parameters:

Object

  1. TokenId: Token ID
  2. Address: The account address of new owner
  • Returns:

    • []byte Data
  • Example:

# mintage_getChangeTokenTypeData

Generate request data for changing token type. This method can only change re-issuable token to non-reissuable. Equivalent to ChangeTokenType method in ABI.

  • Parameters:

    • TokenId: Token ID
  • Returns:

    • []byte Data
  • Example:

# mintage_getTokenInfoList

Return a list of all tokens issued

  • Parameters:

    • int: Page index,starting from 0
    • int: Page size
  • Returns:

Array<TokenInfo>

  1. tokenName: string Token name
  2. tokenSymbol: string Token symbol
  3. totalSupply: big.Int Total supply
  4. decimals: uint8 Decimal digits
  5. owner: Address Token owner
  6. isReIssuable: bool Whether the token can be re-issued
  7. maxSupply: big.Int Maximum supply
  8. ownBurnOnly: bool Whether the token can be burned by the owner only
  9. tokenId: TokenId Token ID
  10. index: uint16 Token index between 0-999. For token having the same symbol, sequential indexes will be allocated according to when the token is issued.
  • Example:

# mintage_getTokenInfoById

Return token info by ID

  • Parameters:

    • TokenId: Token ID
  • Returns:

TokenInfo

  1. tokenName: string Token name
  2. tokenSymbol: string Token symbol
  3. totalSupply: big.Int Total supply
  4. decimals: uint8 Decimal digits
  5. owner: Address Token owner
  6. isReIssuable: bool Whether the token can be re-issued
  7. maxSupply: big.Int Maximum supply
  8. ownBurnOnly: bool Whether the token can be burned by the owner only
  9. tokenId: TokenId Token ID
  10. index: uint16 Token index between 0-999. For token having the same symbol, sequential indexes will be allocated according to when the token is issued.
  • Example:

# mintage_getTokenInfoListByOwner

Return a list of tokens issued by the specified owner

  • Parameters:

    • Address: The account address of token owner
  • Returns:

Array<TokenInfo>

  1. tokenName: string Token name
  2. tokenSymbol: string Token symbol
  3. totalSupply: big.Int Total supply
  4. decimals: uint8 Decimal digits
  5. owner: Address Token owner
  6. isReIssuable: bool Whether the token can be re-issued
  7. maxSupply: big.Int Maximum supply
  8. ownBurnOnly: bool Whether the token can be burned by the owner only
  9. tokenId: TokenId Token ID
  10. index: uint16 Token index between 0-999. For token having the same symbol, sequential indexes will be allocated according to when the token is issued.
  • Example: