Zen
Functions
constructor
Construct a new Zen token
Parameters
Name | Type | Description |
---|---|---|
| address | The initial account to grant all the tokens |
| address | The account with minting ability |
setMinter
Change the minter address
Parameters
Name | Type | Description |
---|---|---|
| address | The address of the new minter |
mint
Mint new tokens
Parameters
Name | Type | Description |
---|---|---|
| address | The address of the destination account |
| uint256 | The number of tokens to be minted |
allowance
Get the number of tokens spender
is approved to spend on behalf of account
Parameters
Name | Type | Description |
---|---|---|
| address | The address of the account holding the funds |
| address | The address of the account spending the funds |
Return Values
Name | Type | Description |
---|---|---|
| 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
Name | Type | Description |
---|---|---|
| address | The address of the account which may transfer tokens |
| uint256 | The number of tokens that are approved (2^256-1 means infinite) |
Return Values
Name | Type | Description |
---|---|---|
| bool | Whether or not the approval succeeded |
permit
Triggers an approval from owner to spends
Parameters
Name | Type | Description |
---|---|---|
| address | The address to approve from |
| address | The address to be approved |
| uint256 | The number of tokens that are approved (2^256-1 means infinite) |
| uint256 | The time at which to expire the signature |
| uint8 | The recovery byte of the signature |
| bytes32 | Half of the ECDSA signature pair |
| bytes32 | Half of the ECDSA signature pair |
balanceOf
Get the number of tokens held by the account
Parameters
Name | Type | Description |
---|---|---|
| address | The address of the account to get the balance of |
Return Values
Name | Type | Description |
---|---|---|
| uint256 | The number of tokens held |
transfer
Transfer amount
tokens from msg.sender
to dst
Parameters
Name | Type | Description |
---|---|---|
| address | The address of the destination account |
| uint256 | The number of tokens to transfer |
Return Values
Name | Type | Description |
---|---|---|
| bool | Whether or not the transfer succeeded |
transferFrom
Transfer amount
tokens from src
to dst
Parameters
Name | Type | Description |
---|---|---|
| address | The address of the source account |
| address | The address of the destination account |
| uint256 | The number of tokens to transfer |
Return Values
Name | Type | Description |
---|---|---|
| bool | Whether or not the transfer succeeded |
delegate
Delegate votes from msg.sender
to delegatee
Parameters
Name | Type | Description |
---|---|---|
| address | The address to delegate votes to |
delegateBySig
Delegates votes from signatory to delegatee
Parameters
Name | Type | Description |
---|---|---|
| address | The address to delegate votes to |
| uint256 | The contract state required to match the signature |
| uint256 | The time at which to expire the signature |
| uint8 | The recovery byte of the signature |
| bytes32 | Half of the ECDSA signature pair |
| bytes32 | Half of the ECDSA signature pair |
getCurrentVotes
Gets the current votes balance for account
Parameters
Name | Type | Description |
---|---|---|
| address | The address to get votes balance |
Return Values
Name | Type | Description |
---|---|---|
| uint96 | The number of current votes for |
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
Name | Type | Description |
---|---|---|
| address | The address of the account to check |
| uint256 | The block number to get the vote balance at |
Return Values
Name | Type | Description |
---|---|---|
| uint96 | The number of votes the account had as of the given block |
_delegate
Parameters
Name | Type | Description |
---|---|---|
| address | |
| address |
_transferTokens
Parameters
Name | Type | Description |
---|---|---|
| address | |
| address | |
| uint96 |
_moveDelegates
Parameters
Name | Type | Description |
---|---|---|
| address | |
| address | |
| uint96 |
_writeCheckpoint
Parameters
Name | Type | Description |
---|---|---|
| address | |
| uint32 | |
| uint96 | |
| uint96 |
safe32
Parameters
Name | Type | Description |
---|---|---|
| uint256 | |
| string |
safe96
Parameters
Name | Type | Description |
---|---|---|
| uint256 | |
| string |
add96
Parameters
Name | Type | Description |
---|---|---|
| uint96 | |
| uint96 | |
| string |
sub96
Parameters
Name | Type | Description |
---|---|---|
| uint96 | |
| uint96 | |
| string |
getChainId
Events
MinterChanged
An event thats emitted when the minter address is changed
Parameters
Name | Type | Description |
---|---|---|
| address | |
| address | |
### DelegateChanged |
An event thats emitted when an account changes its delegate
Parameters
Name | Type | Description |
---|---|---|
| address | |
| address | |
| address | |
### DelegateVotesChanged |
An event thats emitted when a delegate account's vote balance changes
Parameters
Name | Type | Description |
---|---|---|
| address | |
| uint256 | |
| uint256 | |
### Transfer |
The standard EIP-20 transfer event
Parameters
Name | Type | Description |
---|---|---|
| address | |
| address | |
| uint256 | |
### Approval |
The standard EIP-20 approval event
Parameters
Name | Type | Description |
---|---|---|
| address | |
| address | |
| uint256 |
Last updated