Contracts
StZETA
StZETA serves as the fundamental contract, functioning as a liquid staking pool. This contract handles deposits and withdrawals, mints and burns liquid tokens, delegates funds to node operators, applies fees, and distributes rewards.The StZETA contract introduces stZETA, an ERC20 token, which indicates an account's proportion of the total ZETA tokens within the Zearn system. Being a non-rebasable token, the quantity of tokens in the user's wallet remains unchanged. However, its value may fluctuate over time as the volume of ZETA tokens within the protocol isn't static. It's worth noting that stZETA will be incorporated into a range of DeFi applications across ZetaChain.
View Methods
symbol()
Provides the token's symbol, typically a condensed form of its name.
decimals()
Provides the number of decimals required to represent a token amount accurately.
totalSupply()
Provides the total number of tokens currently in circulation.
balanceOf()
Indicates the quantity of tokens held by the account
getTotalStakeAcrossAllValidators()
Provides the aggregate of delegated ZETA across all validators.
Returns:
total
uint256
The total delegated ZETA across all validators
getTotalPooledZETA()
Provides the summed total of pooled ZETA
Returns:
total
uint2560
The total pooled ZETA inside the protocol
convertZETATostZETA()
Provides the ZETA value for any given stZETA amount input into the function.
Parameters:
_amountInZETA
uint256
Amount of ZETA to be converted to stZETA
Returns
amountInstZETA
uint256
Amount of stZETA after conversion
totalstZETASupply
uint256
Total stZETA in the contract
totalPooledZETA
uint256
Total ZETA in the staking pool
Methods
transfer()
Transfers amount tokens from the account of the initiator to the to account.
NOTE
Requirements:
to
should not be assigned the zero address.the caller should maintain a minimum balance of
amount
.the contract ought to be active, not paused.
Parameters
to
address
Address of tokens recipient
amount
uint256
Amount of tokens to transfer
Returns:
A boolean value that shows if the operation was successful.
allowance()
This is the number of tokens that the spender is permitted to spend on behalf of owner using transferFrom. It's initially set to zero.
NOTE
This value changes when approve
or transferFrom
is called.
Parameters
owner
address
Address of owner
spender
address
Address of spender
approve()
Establishes amount as the allocation for spender in relation to the caller's tokens.
NOTE
Requirements:
spender
cannot be the zero address.the contract must not be paused.
Parameters:
spender
address
Address of spender
amount
uint256
Amount of tokens
Returns:
A boolean value that shows if the operation was successful.
transferFrom()
Transfers amount tokens from the from to the to via the allowance process. This amount is subsequently reduced from the caller's allowance.
NOTE
Requirements:
from
andto
cannot be the zero addresses.from
must have a balance of at leastamount
.the caller must have allowance for
from
(sender)'s tokens of at leastamount
.the contract must not be paused.
Parameters:
from
address
Address of spender
to
address
Address of recipient
amount
uint256
Amount of tokens
Returns:
A boolean value that shows if the operation was successful.
increaseAllowance()
Increments the allowance provided to the spender by the caller by an addedValue, in a precise and atomic manner.
NOTE
Requirements:
spender
cannot be the the zero address.the contract must not be paused.
Parameters:
spender
address
Address of spender
addedValue
uint256
Amount of tokens to increase allowance
Returns:
A boolean value that shows if the operation was successful.
decreaseAllowance()
Reduces the allowance given to spender by the caller by subtractedValue in a single operation.
NOTE
Requirements:
spender
cannot be the the zero address.spender
must have allowance for the caller of at leastsubtractedValue
.the contract must not be paused.
Parameters:
spender
address
Address of spender
subtractedValue
uint256
Amount of tokens to decrease allowance
Returns:
A boolean value that shows if the operation was successful.
submit()
Transfer ZETA to the stZETA contract, which then generates stZETA for the sender.
Parameters:
{ value: unit256 }
Amount to submit in ZETA
calculatePendingBufferedTokens()
Calculate the total amount stored in all the NFTs owned by stZETA contract
Returns:
pendingBufferedTokens
uint256
The total pending buffered tokens
NodeOperatorsRegistry
Coming soon
Last updated