Skip to main content

ERC20 Fungible Token with fixed supply

The smart contract template for fungible tokens. No new tokens can be created after the initial emission. In a video game, fixed fungible tokens can represent gems available only in limited supply.

This meta-transaction version enables you to send transactions on behalf of your users so they can use their tokens without having to pay for gas fees.

The fixed supply version of this standard guarantees no token will ever be created after the initial emission.

caution

To use this contract, you will need to import the etherjs library, create and sign a typeTransaction before you can use the function executeMetadata().

Parameters

  • definitiveName: The name of your smart contract which will be reflected on-chain.

  • definitiveSymbol: The symbol of your smart contract which will be reflected on-chain

  • definitiveSupply: The total amount of tokens that will ever be minted.

  • initialOwnerOrMultisigContract: The address that will own the ERC20 contract.

Functions

FunctionInput ParametersDescription
PAUSER_ROLENoneReturns the value of the pauser role.
DEFAULT_ADMIN_ROLENoneReturns the address of the admin role.
pauseNoneCalled to pause by address with a pauser role, disables every variable state changes of the contract.
pausedNoneReturns true when the contract is paused. Returns false otherwise.
unpauseNoneCalled to unpause by address with a pauser role.
executeMetaTransaction(address userAddress, bytes memory functionSignature, bytes32 sigR, bytes32 sigS, uint8 sigV)Executes a transaction on behalf of another user by providing their address, the function to call and the signature of the transaction.
getDomainSeparatorNoneReturns the domain separator according to the EIP712.
getChainIdNoneReturns the chain id according to the EIP712.
supportsInterface(bytes4 interfaceID)Returns true if the contract implements the specified interface.
hasRole(bytes32 role, address account)Returns true if the address specified has been granted the role.
getRoleAdmin(bytes32 role)Returns the role that can control the specified role.
grantRole(bytes32 role, address account)Grants a role to the address specified.
revokeRole(bytes32 role, address account)Removes a role from an address.
renounceRole(bytes32 role, address account)Removes a role from an address. The address must be the caller address.
burn(address, uint256 amount)Erases a specified amount of token.
burnFrom(address account, uint256 amount)Erases a specified amount of token from a wallet address. Allowance of the spender must be higher than the amount of tokens being burnt.
nameNoneReturns the descriptive name of the smart contract.
symbolNoneReturns the symbol set for this contract.
decimalsNoneReturns the number of decimals you can divide your token into. (ex. 1 ETH = 10^18 Wei)
totalSupplyNoneReturns the total amount of tokens.
balanceOf(address account)Returns the number of tokens assigned to an account.
transfer(address to, uint256 amount)Returns true when the transfer of tokens has been successful to the specified address.
transferFrom(address from, address to, uint256 amount)Returns true when the transfer of tokens has been successful to the specified address. Notice that the allowance of the spender must be higher than the amount of tokens being transferred.
allowance(address owner, address spender)Returns the amount that a spender can transfer on behalf of the owner.
approve(address to, uint256 amount)Returns true when the allowance of a spender by the specified amount has successfully been increased.
increaseAllowance(address spender, uint256 addedValue)Returns true when the allowance of the spender has successfully been increased.
decreaseAllowance(address spender, uint256 subtractedValue)Returns true when the allowance of the spender has successfully been decreased.
  • Parameters
  • Functions