Learn how to utilize the contract capabilities.
DEFAULT_ADMIN_ROLE
: Default admin role identifier. Addresses with this role have the highest contract management privileges and can manage all other roles.MANAGER_ROLE
: Manager role identifier. Addresses with this role can perform all management operations except contract upgrades and permission management, such as configuring token access controls, pausing/resuming contracts, etc.MINTER_ROLE
: Minter role identifier. Addresses with this role can mint new tokens.BURNER_ROLE
: Burner role identifier. Addresses with this role can burn tokens.PAUSER_ROLE
: Pauser role identifier. Addresses with this role can pause and resume all token activities.SALVAGER_ROLE
: Salvager role identifier. Addresses with this role can recover assets accidentally sent to the contract address.UPGRADER_ROLE
: Upgrader role identifier. Addresses with this role can upgrade the contract to new versions.getRoleAdmin(role)
: Query the admin role that manages a specific role. For example, query who can grant or revoke MINTER_ROLE
.hasRole(role, account)
: Check if a specific address has a certain role. This is the core function for verifying operation permissions.name
: Get the token’s full name, e.g., “Cobo Token”.symbol
: Get the token’s symbol, e.g., “COBO”.decimals
: Get the token’s decimal places. This determines the smallest unit of the token, e.g., 18
means the token can be divided to 18 decimal places.totalSupply
: Query the total supply of tokens.balanceOf
: Query the token balance of a specific address.allowance
: Query the amount of tokens that one address (owner) has authorized another address (spender) to spend. This is part of the ERC20 approve
and transferFrom
mechanism.accessListEnabled
: Check if token access restrictions (allowlist) functionality is enabled. Returns true
or false
.isAccessListed
: Check if a specific address is on the allowlist.getAccessList
: Get the complete list of allowlisted addresses.isBlocklisted
: Check if a specific address is on the blocklist.getBlocklist
: Get the complete list of blocklisted addresses.paused
: Check if the contract is currently paused. When paused, all token transfers, minting, and burning operations are blocked.contractUri
: Get the contract’s metadata URI. This URI points to a JSON file containing detailed token information, following ERC-721 metadata standards.version
: View the current contract implementation version number.UPGRADE_INTERFACE_VERSION
: View the current contract’s upgrade interface version.supportsInterface
: Check if the contract supports a specific interface standard (e.g., ERC-165).mint
: Mint new tokens and assign them to a specified address, increasing totalSupply
. Typically used when investors subscribe or assets are issued.burn
: Destroy a specified amount of tokens, reducing totalSupply
. Typically used when investors redeem or assets are retired.burnFrom
: Destroy tokens that an address has authorized to you. Requires prior authorization through the approve
function.transfer
: Send tokens from your address to another address.transferFrom
: Send tokens from one address to another. This operation requires you to have prior approve
authorization from the payer’s address.approve
: Authorize another address (spender) to withdraw no more than a specified amount of tokens from your address. This is the foundation for creating automatic payments or decentralized trading.grantRole
: Grant a role (such as MINTER_ROLE
) to an address. Only addresses with admin privileges for that role can execute this operation.revokeRole
: Revoke a role from an address.renounceRole
: Renounce a certain role that your own address holds. This is a security operation; once renounced, it cannot be recovered unless an admin re-grants it.toggleAccesslist
: Enable or disable token access restrictions (allowlist) functionality. This is a key compliance control switch.accessListAdd
: Add one or more addresses to the allowlist. Only allowlisted addresses can receive or send tokens (if toggleAccesslist
is enabled).accessListRemove
: Remove one or more addresses from the allowlist.blockListAdd
: Add one or more addresses to the blocklist. Blocklisted addresses cannot perform any token interactions.blockListRemove
: Remove one or more addresses from the blocklist.pause
: Pause all token activities (transfers, minting, burning). Used for emergency situations, such as discovering security vulnerabilities or needing critical maintenance.unpause
: Resume a paused contract, returning token activities to normal.upgradeToAndCall
: Upgrade the contract to a new implementation address and optionally call a function for initialization. This is the core for seamless contract upgrades and feature iterations.contractUriUpdate
: Update the contract’s metadata URI.salvageNative
: Recover native tokens (such as ETH) accidentally sent to the contract address.salvageERC20
: Recover other ERC-20 tokens accidentally sent to the contract address.