The LockedTokens
contract defines the resources and interfaces
used to store locked FLOW tokens owned by a token holder.
Source: LockedTokens.cdc
Network | Contract Address |
---|---|
Emulator/Canary | 0xf8d6e0586b0a20c7 |
Testnet | 0x95e019a17d0e23d7 |
Sandboxnet | 0xf4527793ee68aede |
Mainnet | 0x8d0e87b65159ae63 |
The StakingProxy
contract defines the interfaces through which token holder
and node operators perform staking operations with locked FLOW.
Source: StakingProxy.cdc
Network | Contract Address |
---|---|
Emulator/Canary | 0xf8d6e0586b0a20c7 |
Testnet | 0x7aad92e5a0715d21 |
Sandboxnet | 0xf4527793ee68aede |
Mainnet | 0x62430cf28c26d095 |
Use the following transactions to interact with the staking contracts.
The token admin is the administrator responsible for distributing and releasing locked FLOW tokens. The token admin has possession of a single account that is used to control the lockups for all locked FLOW.
The token admin creates a shared account for each token holder that is co-owned by the token admin and the token holder. The shared account is used to store all locked FLOW owned by a token holder.
The token admin public key is used by account creators to configure token holder accounts to hold locked FLOW.
Purpose | Network | Weight | Encoded Key |
---|---|---|---|
Standard | Testnet | 100 | f845b840fd8c6a3078ea6b7ecb96d914832ee3b62323d4d42860235b4a175d75544f476aeb800e3a4bad2cc5375e47fc5e13356167a4512b6ad03e660c04b6db26246cba020364 |
Lease | Testnet | 1000 | f847b840fd8c6a3078ea6b7ecb96d914832ee3b62323d4d42860235b4a175d75544f476aeb800e3a4bad2cc5375e47fc5e13356167a4512b6ad03e660c04b6db26246cba02038203e8 |
Standard | Mainnet | 100 | f845b8406e4f43f79d3c1d8cacb3d5f3e7aeedb29feaeb4559fdb71a97e2fd0438565310e87670035d83bc10fe67fe314dba5363c81654595d64884b1ecad1512a64e65e020164 |
Lease | Mainnet | 1000 | f847b8406e4f43f79d3c1d8cacb3d5f3e7aeedb29feaeb4559fdb71a97e2fd0438565310e87670035d83bc10fe67fe314dba5363c81654595d64884b1ecad1512a64e65e02018203e8 |
ID | Name | Source |
---|---|---|
TA.02 | Created Shared Account | lockedTokens/admin/admin_create_shared_accounts.cdc |
TA.04 | Deposit Locked Tokens | lockedTokens/admin/deposit_locked_tokens.cdc |
TA.05 | Unlock Tokens | lockedTokens/admin/unlock_tokens.cdc |
TA.06 | Deposit Account Creator | lockedTokens/admin/admin_deposit_account_creator.cdc |
The custodian is an agent who acts on behalf of the token holder for the purpose of securing FLOW tokens.
ID | Name | Source |
---|---|---|
C.01 | Set Up Creator Account | lockedTokens/admin/custody_setup_account_creator.cdc |
C.02 | Create Shared Accounts | lockedTokens/admin/custody_create_shared_accounts.cdc |
C.03 | Create Only Shared Acccount | lockedTokens/admin/custody_create_only_shared_account.cdc |
C.04 | Create Shared Lease Accounts | lockedTokens/admin/custody_create_account_with_lease_account.cdc |
C.05 | Create Only Shared Lease Acccount | lockedTokens/admin/custody_create_only_lease_account.cdc |
The token holder is a user who holds possession of locked and unlocked FLOW tokens.
The token holder can stake and delegate locked or unlocked FLOW
through the StakingProxy
contract.
The token holder can withdraw unlocked FLOW from the shared account created by the token admin.
ID | Name | Source |
---|---|---|
TH.01 | Withdraw Unlocked FLOW | lockedTokens/user/withdraw_tokens.cdc |
TH.02 | Deposit Unlocked FLOW | lockedTokens/user/deposit_tokens.cdc |
TH.03 | Get Unlock Limit | lockedTokens/user/get_unlock_limit.cdc |
TH.04 | Get Locked Account Balance | lockedTokens/user/get_locked_account_balance.cdc |
TH.05 | Get Locked Account Address | lockedTokens/user/get_locked_account_address.cdc |
These transactions operate through the StakingProxy.NodeStakerProxy
interface.
ID | Name | Source |
---|---|---|
TH.06 | Register Node | lockedTokens/staker/register_node.cdc |
TH.07 | Get Node ID | lockedTokens/staker/get_node_id.cdc |
TH.08 | Stake New Locked FLOW | lockedTokens/staker/stake_new_tokens.cdc |
TH.09 | Re-stake Unstaked FLOW | lockedTokens/staker/stake_unstaked_tokens.cdc |
TH.10 | Re-stake Rewarded FLOW | lockedTokens/staker/stake_rewarded_tokens.cdc |
TH.11 | Request Unstake of FLOW | lockedTokens/staker/request_unstaking.cdc |
TH.12 | Unstake All FLOW | lockedTokens/staker/unstake_all.cdc |
TH.13 | Withdraw Unstaked FLOW | lockedTokens/staker/withdraw_unstaked_tokens.cdc |
TH.14 | Withdraw Rewarded FLOW | lockedTokens/staker/withdraw_rewarded_tokens.cdc |
TH.25 | Update Networking Address | lockedTokens/staker/update_networking_address.cdc |
See the staking documentation for how to get info about a staked node.
These transactions operate through the StakingProxy.NodeDelegatorProxy
interface.
ID | Name | Source |
---|---|---|
TH.17 | Register Delegator | lockedTokens/delegator/register_delegator.cdc |
TH.18 | Get Delegator ID | lockedTokens/delegator/get_delegator_id.cdc |
TH.25 | Get Delegated Node ID | lockedTokens/delegator/get_delegator_node_id.cdc |
TH.19 | Delegate New Locked FLOW | lockedTokens/delegator/delegate_new_tokens.cdc |
TH.20 | Re-delegate Unstaked FLOW | lockedTokens/delegator/delegate_unstaked_tokens.cdc |
TH.21 | Re-delegate Rewarded FLOW | lockedTokens/delegator/delegate_rewarded_tokens.cdc |
TH.22 | Request Unstake of Delegated FLOW | lockedTokens/delegator/request_unstaking.cdc |
TH.23 | Withdraw Unstaked Delegated FLOW | lockedTokens/delegator/withdraw_unstaked_tokens.cdc |
TH.24 | Withdraw Rewarded Delegated FLOW | lockedTokens/delegator/withdraw_rewarded_tokens.cdc |
See the staking documentation for how to get info about a staked delegator.
The node operator is an independent user who operators a Flow node on behalf of a token holder. These transactions should only be used for those who are in a relationship where a node operator operates a node for a token holder and the relationship needs to be managed on chain.
ID | Name | Source |
---|---|---|
NO.01 | Set Up Operator Account | stakingProxy/setup_node_account.cdc |
These transactions are used in the case where the node info has to be transferred on-chain. If the node info can be exchanged off-chain, the normal node registration functions can be used.
ID | Name | Source |
---|---|---|
TH.15 | Get Operator Node Info for registration | stakingProxy/get_node_info.cdc |
TH.16 | Register Operator Node | stakingProxy/register_node.cdc |
These transactions operate through the StakingProxy.NodeStakerProxy
interface.
The node operator can perform the following staking actions using locked or unlocked FLOW owned by the token holder.
Note: The node operator can perform these actions on behalf of the token holder, but only with explicit permission. This permission can be revoked by the token holder.
ID | Name | Source |
---|---|---|
NO.02 | Add Node Info | stakingProxy/add_node_info.cdc |
NO.03 | Remove Node Info | stakingProxy/remove_node_info.cdc |
NO.04 | Remove Staking Proxy | stakingProxy/remove_staking_proxy.cdc |
NO.05 | Stake New Locked FLOW | stakingProxy/stake_new_tokens.cdc |
NO.06 | Re-stake Unstaked FLOW | stakingProxy/stake_unstaked_tokens.cdc |
NO.07 | Unstake FLOW | stakingProxy/unstake_all.cdc |
NO.08 | Withdraw Unstaked FLOW | stakingProxy/withdraw_unstaked.cdc |
NO.09 | Withdraw Rewarded FLOW | stakingProxy/withdraw_rewards.cdc |
The LockedTokens
contract defines events that can be monitored for important actions.
Emitted when a new shared (locked) account is registered.
1pub event SharedAccountRegistered(address: Address)
Emitted when a new user (unlocked) account is registered. This and SharedAccountRegistered
are always emitted at the same time.
1pub event UnlockedAccountRegistered(address: Address)
Emitted when the token admin increases the unlock limit for a locked account. This will usually happen when a milestone is reached in the vesting of the locked tokens.
1pub event UnlockLimitIncreased(address: Address, increaseAmount: UFix64, newLimit: UFix64)
Emitted when a user registers their locked account as a node operator.
1pub event LockedAccountRegisteredAsNode(address: Address, nodeID: String)
Emitted when a user registers their locked account as a delegator.
1pub event LockedAccountRegisteredAsDelegator(address: Address, nodeID: String)
Emitted when the token admin deposits locked tokens from the token sale.
1pub event LockedTokensDeposited(address: Address, amount: UFix64)