Skip to content

IMarketToken

ERC-20 metadata token with market-owned mint/burn authority.

The owning market proxy should be the only authorized minter/burner. Implements ERC-165 so third parties can detect AVM market tokens.

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) view

Parameters

  • owneraddress
  • spenderaddress

Returns

  • uint256

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) nonpayable

Parameters

  • spenderaddress
  • valueuint256

Returns

  • bool

Returns the value of tokens owned by account.

function balanceOf(address account) returns (uint256) view

Parameters

  • accountaddress

Returns

  • uint256
function burn(address from, uint256 amount) nonpayable

Parameters

  • fromaddress
  • amountuint256

Returns the decimals places of the token.

function decimals() returns (uint8) view

Returns

  • uint8
function mint(address to, uint256 amount) nonpayable

Parameters

  • toaddress
  • amountuint256

Returns the name of the token.

function name() returns (string) view

Returns

  • string

Gets the address of the owner.

function owner() returns (address) view

Returns

  • address

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) view

Parameters

  • interfaceIdbytes4

Returns

  • bool

Returns the symbol of the token.

function symbol() returns (string) view

Returns

  • string

Returns the value of tokens in existence.

function totalSupply() returns (uint256) view

Returns

  • uint256

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) nonpayable

Parameters

  • toaddress
  • valueuint256

Returns

  • bool

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) nonpayable

Parameters

  • fromaddress
  • toaddress
  • valueuint256

Returns

  • bool

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

  • owneraddress
  • spenderaddress
  • valueuint256

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

  • fromaddress
  • toaddress
  • valueuint256