XANK-issued ERC20 public smart contract repository.
The whitepaper can be found here.
Interaction with XANK is done at the address at 0x0e7f79e89ba8c4a13431129fb2db0d4f444b5b9a
. See
https://etherscan.io/token/0x0e7f79e89ba8c4a13431129fb2db0d4f444b5b9a for live on-chain details.
XANK (XANK) is an ERC20 token that is Centrally Minted and Burned and Locked by XANK
The public interface of XANK is the ERC20 interface specified by EIP-20.
name()
symbol()
decimals()
totalSupply()
balanceOf(address who)
transfer(address to, uint256 value)
approve(address spender, uint256 value)
allowance(address owner, address spender)
transferFrom(address from, address to, uint256 value)
And the usual events.
event Transfer(address indexed from, address indexed to, uint256 value)
event Approval(address indexed owner, address indexed spender, uint256 value)
Typical interaction with the contract will use transfer
to move the token as payment.
Additionally, a pattern involving approve
and transferFrom
can be used to allow another
address to move tokens from your address to a third party without the need for the middleperson
to custody the tokens, such as in the 0x protocol.
There is a well known gotcha involving the ERC20 approve
method. The problem occurs when the owner decides
to change the allowance of a spender that already has an allowance. If the spender sends a transferFrom
transaction at a similar time that the owner sends the new approve
transaction
and the transferFrom
by the spender goes through first, then the spender gets to use the
original allowance, and also get approved for the intended new allowance.
The recommended mitigation in cases where the owner does not trust the spender is to first set the allowance to zero before setting it to a new amount, checking that the allowance was not spent before sending the new approval transaction. Note, however, that any allowance change is subject to front-running, which is as simple as watching the mempool for certain transactions and then offering a higher gas price to get another transaction mined onto the blockchain more quickly.
In the event of a critical security threat, XANK has the ability to pause transfers and approvals of the XANK token. The simple model for pausing transfers following OpenZeppelin's Pausable.