Comment on page

ASX

The ASX contract is a governance ERC-20 token with a total supply of 100000000 tokens. The whole supply is minted in time of deployment and the owner of tokens decides how to distribute them. The idea is to distribute them in the following way: 50% - for the staking rewards, 25% - to the team, 25% - to the treasury.
Tokens for the staking rewards are distributed on the StakePrizePool contract as the rewards for the stETH staking.

Write methods description

approve()

Sets _amount as the allowance of _spender over the caller’s tokens. Returns a boolean value indicating whether the operation succeeded.
Parameters:
Name
Type
Description
_spender
address
A spender of tokens.
_amount
uint256
Amount that is allowed to spend.

burn()

Destroys _amount of tokens from the caller.
Parameters:
Name
Type
Description
_amount
uint256
Amount of tokens to destroy (to burn).

burnFrom()

Destroys _amount of tokens from _account, deducting from the caller’s allowance.
Parameters:
Name
Type
Description
_account
address
An address where tokens should be burned.
_amount
uint256
Amount of tokens to destroy (to burn).
Requirements:
  • the caller must have an allowance for _account’s tokens of at least _amount.

decreaseAllowance()

Atomically decreases the allowance granted to _spender by the caller.
Parameters:
Name
Type
Description
_spender
address
A spender of tokens.
_substructedValue
uint256
A value that should be subtracted.
Requirements:
  • _spender cannot be the zero address.
  • _spender must have an allowance for the caller of at least _substractedValue.

delegate()

Delegate votes from the sender to _delegatee.
Parameters:
Name
Type
Description
_delegatee
address
A delegatee for whom all spender’s votes will be delegated.

delegateBySig()

Delegates votes from the signer to _delegatee.
Parameters:
Name
Type
Description
_delegatee
address
A delegatee for whom all spender’s votes will be delegated.
_nonce
uint256
A unique number that must be used only for one signature.
_expiry
uint256
Timestamp when a signature expires.
_v
uint8
_v portion of signature.
_r
bytes32
_r portion of signature.
_s
bytes32
_s portion of signature.

increaseAllowance()

Atomically increases the allowance granted to _spender by the caller.
Parameters:
Name
Type
Description
_spender
address
A spender of tokens.
_addedValue
uint256
A value that should be added.
Requirements:
  • _spender cannot be the zero address.

initialize()

Allows to initialize the contract during the deployment.
Parameters:
Name
Type
Description
_name
string
A name of the token.
_symbol
string
A symbol of the token.
_cap
uint256
Maximum supply of the token.
_initialSupplyReceiver
address
A receiver of token that will be minted during the deployment.

permit()

Allows to create a new permit.
Parameters:
Name
Type
Description
_owner
address
An owner of a permit.
_spender
address
A spender for whom a permit will be created.
_value
uint256
A number of tokens that can be spent using this permit.
_deadline
uint256
Timestamp when a permit expires.
_v
uint8
_v portion of signature.
_r
bytes32
_r portion of signature.
_s
bytes32
_s portion of signature.

transfer()

Moves _amount tokens from the caller’s account to _to. Returns a boolean value indicating whether the operation succeeded.
Parameters:
Name
Type
Description
_to
address
A receiver of tokens.
_amount
uint256
Amount of tokens that should be transferred.
Requirements:
  • _to cannot be the zero address.
  • the caller must have a balance of at least _amount.

transferFrom()

Moves _amount tokens from _from to _to using the allowance mechanism. _amount is then deducted from the caller’s allowance. Returns a boolean value indicating whether the operation succeeded.
Parameters:
Name
Type
Description
_from
address
Who spends tokens.
_to
address
A receiver of tokens.
_amount
uint256
Amount of tokens that should be transferred.

Read methods description

DOMAIN_SEPARATOR()

A domain separator defined according to EIP-712.

allowance()

Returns the remaining number of tokens that the_spender will be allowed to spend on behalf of the owner through _transferFrom. This is zero by default. This value changes when _approve, or _transferFrom, or _increaseAllowance, or _decreaseAllowance are called.
Parameters:
Name
Type
Description
_owner
address
An owner of tokens.
_spender
address
A spender of tokens.
Return:
Name
Type
Description
_allowance
uint256
Remaining number of tokens.

balanceOf()

Returns the amount of tokens owned by the _account.
Parameters:
Name
Type
Description
_account
address
An account whose balance to check.
Return:
Name
Type
Description
_balance
uint256
Amount of tokens owned by the _account.

cap()

Returns the cap on the token’s total supply.
Return:
Name
Type
Description
_cap
uint256
The cap on the token’s total supply.

checkpoints()

Get the _pos-th checkpoint for _account.
Parameters:
Name
Type
Description
_account
address
An account to get a checkpoint.
_pos
uint32
A position of a checkpoint.

decimals()

Returns the number of decimals used to get its user representation. For example, if _decimals equals 2, a balance of 505 tokens should be displayed to a user as 5.05 (500 / 10 ** 2). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value ERC-20 uses, unless this function is overridden.
Return:
Name
Type
Description
_decimals
uint8
The number of decimals used to get its user representation.

delegates()

Get the address _account is currently delegating to.
Parameters:
Name
Type
Description
_account
address
An address to check.
Return:
Name
Type
Description
_delegate
address
A delegate of an _account.

getCurrentVotes()

Comp version of the getVotes method, with uint96 return type. Gets the current balance of votes for the _account.
Parameters:
Name
Type
Description
_account
address
An account where to check the balance of votes.
Return:
Name
Type
Description
_balance
uint96
Current balance of votes for the _account.

getPastTotalSupply()

Retrieve the _totalSupply at the end of _blockNumber. Note, this value is the sum of all balances. It is but NOT the sum of all the delegated votes!
Parameters:
Name
Type
Description
_blockNumber
uint256
A block number to check the total supply for.
Requirements:
  • _blockNumber must have been already mined.
Return:
Name
Type
Description
_totalSupply
uint256
The _totalSupply at the end of _blockNumber.

getPastVotes()

Retrieve the number of votes for an _account at the end of _blockNumber.
Parameters:
Name
Type
Description
_account
address
An account for which to check the number of votes.
_blockNumber
uint256
A block number where to check the number of votes for an account.
Requirements:
  • _blockNumber must have been already mined.
Return:
Name
Type
Description
_balance
uint256
The number of votes for an _account at the end of _blockNumber.

getPriorVotes()

Comp version of the getPastVotes method, with uint96 return type. Retrieve the number of votes for an _account at the end of _blockNumber.
Parameters:
Name
Type
Description
_account
address
An account for which to check the number of votes.
_blockNumber
uint256
A block number where to check the number of votes for an account.
Requirements:
  • _blockNumber must have been already mined.
Return:
Name
Type
Description
_balance
uint96
The number of votes for an _account at the end of _blockNumber.

getVotes()

Gets the current votes balance for an _account.
Parameters:
Name
Type
Description
_account
address
An account where to check the number of votes.
Return:
Name
Type
Description
_balance
uint256
The current balance of votes for an _account.

name()

Returns the name of the token.
Return:
Name
Type
Description
_name
string
The name of the token.

nonces()

Returns the number of used nonces for an _owner.
Parameters:
Name
Type
Description
_owner
address
A user for whom to check the number of nonces.
Return:
Name
Type
Description
_amount
uint256
The number of nonces for an _owner.

numCheckpoints()

Get number of checkpoints for _account.
Parameters:
Name
Type
Description
_account
address
An account for whom to check the number of checkpoints.
Return:
Name
Type
Description
_amount
uint32
The number of checkpoints for _account.

symbol()

Returns the symbol of the token, usually a shorter version of the name.
Return:
Name
Type
Description
_symbol
string
The symbol of the token.

totalSupply()

Returns the amount of tokens in existence.
Return:
Name
Type
Description
_totalSupply
uint256
The amount of tokens in existence.