Zen
Functions
constructor
Construct a new Zen token
Parameters
account
address
The initial account to grant all the tokens
minter_
address
The account with minting ability
setMinter
Change the minter address
Parameters
minter_
address
The address of the new minter
mint
Mint new tokens
Parameters
dst
address
The address of the destination account
rawAmount
uint256
The number of tokens to be minted
allowance
Get the number of tokens spender
is approved to spend on behalf of account
Parameters
account
address
The address of the account holding the funds
spender
address
The address of the account spending the funds
Return Values
[0]
uint256
The number of tokens approved
approve
Approve spender
to transfer up to amount
from src
This will overwrite the approval amount for spender
and is subject to issues noted here
Parameters
spender
address
The address of the account which may transfer tokens
rawAmount
uint256
The number of tokens that are approved (2^256-1 means infinite)
Return Values
[0]
bool
Whether or not the approval succeeded
permit
Triggers an approval from owner to spends
Parameters
owner
address
The address to approve from
spender
address
The address to be approved
rawAmount
uint256
The number of tokens that are approved (2^256-1 means infinite)
deadline
uint256
The time at which to expire the signature
v
uint8
The recovery byte of the signature
r
bytes32
Half of the ECDSA signature pair
s
bytes32
Half of the ECDSA signature pair
balanceOf
Get the number of tokens held by the account
Parameters
account
address
The address of the account to get the balance of
Return Values
[0]
uint256
The number of tokens held
transfer
Transfer amount
tokens from msg.sender
to dst
Parameters
dst
address
The address of the destination account
rawAmount
uint256
The number of tokens to transfer
Return Values
[0]
bool
Whether or not the transfer succeeded
transferFrom
Transfer amount
tokens from src
to dst
Parameters
src
address
The address of the source account
dst
address
The address of the destination account
rawAmount
uint256
The number of tokens to transfer
Return Values
[0]
bool
Whether or not the transfer succeeded
delegate
Delegate votes from msg.sender
to delegatee
Parameters
delegatee
address
The address to delegate votes to
delegateBySig
Delegates votes from signatory to delegatee
Parameters
delegatee
address
The address to delegate votes to
nonce
uint256
The contract state required to match the signature
expiry
uint256
The time at which to expire the signature
v
uint8
The recovery byte of the signature
r
bytes32
Half of the ECDSA signature pair
s
bytes32
Half of the ECDSA signature pair
getCurrentVotes
Gets the current votes balance for account
Parameters
account
address
The address to get votes balance
Return Values
[0]
uint96
The number of current votes for account
getPriorVotes
Determine the prior number of votes for an account as of a block number
Block number must be a finalized block or else this function will revert to prevent misinformation.
Parameters
account
address
The address of the account to check
blockNumber
uint256
The block number to get the vote balance at
Return Values
[0]
uint96
The number of votes the account had as of the given block
_delegate
Parameters
delegator
address
delegatee
address
_transferTokens
Parameters
src
address
dst
address
amount
uint96
_moveDelegates
Parameters
srcRep
address
dstRep
address
amount
uint96
_writeCheckpoint
Parameters
delegatee
address
nCheckpoints
uint32
oldVotes
uint96
newVotes
uint96
safe32
Parameters
n
uint256
errorMessage
string
safe96
Parameters
n
uint256
errorMessage
string
add96
Parameters
a
uint96
b
uint96
errorMessage
string
sub96
Parameters
a
uint96
b
uint96
errorMessage
string
getChainId
Events
MinterChanged
An event thats emitted when the minter address is changed
Parameters
minter
address
newMinter
address
### DelegateChanged
An event thats emitted when an account changes its delegate
Parameters
delegator
address
fromDelegate
address
toDelegate
address
### DelegateVotesChanged
An event thats emitted when a delegate account's vote balance changes
Parameters
delegate
address
previousBalance
uint256
newBalance
uint256
### Transfer
The standard EIP-20 transfer event
Parameters
from
address
to
address
amount
uint256
### Approval
The standard EIP-20 approval event
Parameters
owner
address
spender
address
amount
uint256
Last updated