IMarketToken
Overview
Section titled “Overview”ERC-20 metadata token with market-owned mint/burn authority.
IMarketToken
Section titled “IMarketToken”The owning market proxy should be the only authorized minter/burner. Implements ERC-165 so third parties can detect AVM market tokens.
Functions
Section titled “Functions”allowance
Section titled “allowance”Returns the remaining number of tokens that spender will be allowed to spend on behalf of owner through {transferFrom}. This is zero by default. This value changes when {approve} or {transferFrom} are called.
function allowance(address owner, address spender) returns (uint256) viewParameters
owner—addressspender—address
Returns
uint256
approve
Section titled “approve”Sets a value amount of tokens as the allowance of spender over the caller’s tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender’s allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 Emits an {Approval} event.
function approve(address spender, uint256 value) returns (bool) nonpayableParameters
spender—addressvalue—uint256
Returns
bool
balanceOf
Section titled “balanceOf”Returns the value of tokens owned by account.
function balanceOf(address account) returns (uint256) viewParameters
account—address
Returns
uint256
function burn(address from, uint256 amount) nonpayableParameters
from—addressamount—uint256
decimals
Section titled “decimals”Returns the decimals places of the token.
function decimals() returns (uint8) viewReturns
uint8
function mint(address to, uint256 amount) nonpayableParameters
to—addressamount—uint256
Returns the name of the token.
function name() returns (string) viewReturns
string
Gets the address of the owner.
function owner() returns (address) viewReturns
address
supportsInterface
Section titled “supportsInterface”Returns true if this contract implements the interface defined by interfaceId. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section] to learn more about how these ids are created. This function call must use less than 30 000 gas.
function supportsInterface(bytes4 interfaceId) returns (bool) viewParameters
interfaceId—bytes4
Returns
bool
symbol
Section titled “symbol”Returns the symbol of the token.
function symbol() returns (string) viewReturns
string
totalSupply
Section titled “totalSupply”Returns the value of tokens in existence.
function totalSupply() returns (uint256) viewReturns
uint256
transfer
Section titled “transfer”Moves a value amount of tokens from the caller’s account to to. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.
function transfer(address to, uint256 value) returns (bool) nonpayableParameters
to—addressvalue—uint256
Returns
bool
transferFrom
Section titled “transferFrom”Moves a value amount of tokens from from to to using the allowance mechanism. value is then deducted from the caller’s allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.
function transferFrom(address from, address to, uint256 value) returns (bool) nonpayableParameters
from—addressto—addressvalue—uint256
Returns
bool
Events
Section titled “Events”Approval
Section titled “Approval”Emitted when the allowance of a spender for an owner is set by a call to {approve}. value is the new allowance.
event Approval(indexed address owner, indexed address spender, uint256 value)Parameters
owner—addressspender—addressvalue—uint256
Transfer
Section titled “Transfer”Emitted when value tokens are moved from one account (from) to another (to). Note that value may be zero.
event Transfer(indexed address from, indexed address to, uint256 value)Parameters
from—addressto—addressvalue—uint256