Flow Staking Contract Reference
Contract
The FlowIDTableStaking
contract is the central table that manages staked nodes, delegation and rewards.
Source: FlowIDTableStaking.cdc
Network | Contract Address |
---|---|
Testnet | 0x9eca2b38b18b5dfe |
Mainnet | 0x8624b52f9ddcd04a |
Transactions
Getting Staking Info
These scripts are read-only and get info about the current state of the staking contract.
ID | Name | Source |
---|---|---|
SC.01 | Get Delegation Cut Percentage | idTableStaking/get_cut_percentage.cdc |
SC.02 | Get Minimum Stake Requirements | idTableStaking/get_stake_requirements.cdc |
SC.03 | Get Total Weekly Reward Payout | idTableStaking/get_weekly_payout.cdc |
SC.04 | Get Current Staked Node Table | idTableStaking/get_current_table.cdc |
SC.05 | Get Proposed Staked Node Table | idTableStaking/get_proposed_table.cdc |
SC.06 | Get Total Flow Staked | idTableStaking/get_total_staked.cdc |
SC.07 | Get Total Flow Staked by Node Type | idTableStaking/get_total_staked_by_type.cdc |
SC.08 | Get All Info about a single NodeID | idTableStaking/get_node_info.cdc |
SC.09 | Get a node's total Commitment (delegators) | idTableStaking/get_node_total_commitment.cdc |
SC.10 | Get All Info about a single Delegator | idTableStaking/delegation/get_delegator_info.cdc |
SC.11 | Get a node's total Commitment | idTableStaking/get_node_total_commitment_without_delegators.cdc |
Node Staker Transactions
Please see the Locked Tokens contract for information about staking with locked tokens. Documentation for staking with unlocked tokens will be updated when unlocked tokens are available to stake with.
Delegator Transactions
Please see the Locked Tokens contract for information about delegating with locked tokens. Documentation for delegating with unlocked tokens will be updated when unlocked tokens are available to delegate with.
Events
The FlowIDTableStaking
contract emits an event whenever an important action occurs.
See the staking events Documentation for more information about each event.
pub event NewEpoch(totalStaked: UFix64, totalRewardPayout: UFix64)
/// Node Events
pub event NewNodeCreated(nodeID: String, role: UInt8, amountCommitted: UFix64)
pub event TokensCommitted(nodeID: String, amount: UFix64)
pub event TokensStaked(nodeID: String, amount: UFix64)
pub event TokensUnstaking(nodeID: String, amount: UFix64)
pub event TokensUnstaked(nodeID: String, amount: UFix64)
pub event NodeRemovedAndRefunded(nodeID: String, amount: UFix64)
pub event RewardsPaid(nodeID: String, amount: UFix64)
pub event UnstakedTokensWithdrawn(nodeID: String, amount: UFix64)
pub event RewardTokensWithdrawn(nodeID: String, amount: UFix64)
/// Delegator Events
pub event NewDelegatorCreated(nodeID: String, delegatorID: UInt32)
pub event DelegatorTokensCommitted(nodeID: String, delegatorID: UInt32, amount: UFix64)
pub event DelegatorTokensStaked(nodeID: String, delegatorID: UInt32, amount: UFix64)
pub event DelegatorTokensUnstaking(nodeID: String, delegatorID: UInt32, amount: UFix64)
pub event DelegatorTokensUnstaked(nodeID: String, delegatorID: UInt32, amount: UFix64)
pub event DelegatorRewardsPaid(nodeID: String, delegatorID: UInt32, amount: UFix64)
pub event DelegatorUnstakedTokensWithdrawn(nodeID: String, delegatorID: UInt32, amount: UFix64)
pub event DelegatorRewardTokensWithdrawn(nodeID: String, delegatorID: UInt32, amount: UFix64)
/// Contract Field Change Events
pub event NewDelegatorCutPercentage(newCutPercentage: UFix64)
pub event NewWeeklyPayout(newPayout: UFix64)
pub event NewStakingMinimums(newMinimums: {UInt8: UFix64})