Functions
constructor
function constructor(
address account,
address minter_
) public
Construct a new Zen token
Parameters
setMinter
function setMinter(
address minter_
) external
Change the minter address
Parameters
mint
function mint(
address dst,
uint256 rawAmount
) external
Mint new tokens
Parameters
allowance
function allowance(
address account,
address spender
) external returns (uint256)
Get the number of tokens spender
is approved to spend on behalf of account
Parameters
Return Values
approve
function approve(
address spender,
uint256 rawAmount
) external returns (bool)
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
Return Values
permit
function permit(
address owner,
address spender,
uint256 rawAmount,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external
Triggers an approval from owner to spends
Parameters
balanceOf
function balanceOf(
address account
) external returns (uint256)
Get the number of tokens held by the account
Parameters
Return Values
transfer
function transfer(
address dst,
uint256 rawAmount
) external returns (bool)
Transfer amount
tokens from msg.sender
to dst
Parameters
Return Values
transferFrom
function transferFrom(
address src,
address dst,
uint256 rawAmount
) external returns (bool)
Transfer amount
tokens from src
to dst
Parameters
Return Values
delegate
function delegate(
address delegatee
) public
Delegate votes from msg.sender
to delegatee
Parameters
delegateBySig
function delegateBySig(
address delegatee,
uint256 nonce,
uint256 expiry,
uint8 v,
bytes32 r,
bytes32 s
) public
Delegates votes from signatory to delegatee
Parameters
getCurrentVotes
function getCurrentVotes(
address account
) external returns (uint96)
Gets the current votes balance for account
Parameters
Return Values
getPriorVotes
function getPriorVotes(
address account,
uint256 blockNumber
) public returns (uint96)
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
Return Values
_delegate
function _delegate(
address delegator,
address delegatee
) internal
Parameters
_transferTokens
function _transferTokens(
address src,
address dst,
uint96 amount
) internal
Parameters
_moveDelegates
function _moveDelegates(
address srcRep,
address dstRep,
uint96 amount
) internal
Parameters
_writeCheckpoint
function _writeCheckpoint(
address delegatee,
uint32 nCheckpoints,
uint96 oldVotes,
uint96 newVotes
) internal
Parameters
safe32
function safe32(
uint256 n,
string errorMessage
) internal returns (uint32)
Parameters
safe96
function safe96(
uint256 n,
string errorMessage
) internal returns (uint96)
Parameters
add96
function add96(
uint96 a,
uint96 b,
string errorMessage
) internal returns (uint96)
Parameters
sub96
function sub96(
uint96 a,
uint96 b,
string errorMessage
) internal returns (uint96)
Parameters
getChainId
function getChainId() internal returns (uint256)
Events
MinterChanged
event MinterChanged(
address minter,
address newMinter
)
An event thats emitted when the minter address is changed
Parameters
event DelegateChanged(
address delegator,
address fromDelegate,
address toDelegate
)
An event thats emitted when an account changes its delegate
Parameters
event DelegateVotesChanged(
address delegate,
uint256 previousBalance,
uint256 newBalance
)
An event thats emitted when a delegate account's vote balance changes
Parameters
event Transfer(
address from,
address to,
uint256 amount
)
The standard EIP-20 transfer event
Parameters
event Approval(
address owner,
address spender,
uint256 amount
)
The standard EIP-20 approval event
Parameters