Skip to main content

Locked Tokens Contract

The LockedTokens contract defines the resources and interfaces used to store locked FLOW tokens owned by a token holder.

Source: LockedTokens.cdc

NetworkContract Address
Emulator/Canary0xf8d6e0586b0a20c7
Testnet0x95e019a17d0e23d7
Sandboxnet0xf4527793ee68aede
Mainnet0x8d0e87b65159ae63

StakingProxy

The StakingProxy contract defines the interfaces through which token holder and node operators perform staking operations with locked FLOW.

Source: StakingProxy.cdc

NetworkContract Address
Emulator/Canary0xf8d6e0586b0a20c7
Testnet0x7aad92e5a0715d21
Sandboxnet0xf4527793ee68aede
Mainnet0x62430cf28c26d095

Transactions

Use the following transactions to interact with the staking contracts.

Token Admin

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.

Token Admin Public Key

PurposeNetworkWeightEncoded Key
StandardTestnet100f845b840fd8c6a3078ea6b7ecb96d914832ee3b62323d4d42860235b4a175d75544f476aeb800e3a4bad2cc5375e47fc5e13356167a4512b6ad03e660c04b6db26246cba020364
LeaseTestnet1000f847b840fd8c6a3078ea6b7ecb96d914832ee3b62323d4d42860235b4a175d75544f476aeb800e3a4bad2cc5375e47fc5e13356167a4512b6ad03e660c04b6db26246cba02038203e8
StandardMainnet100f845b8406e4f43f79d3c1d8cacb3d5f3e7aeedb29feaeb4559fdb71a97e2fd0438565310e87670035d83bc10fe67fe314dba5363c81654595d64884b1ecad1512a64e65e020164
LeaseMainnet1000f847b8406e4f43f79d3c1d8cacb3d5f3e7aeedb29feaeb4559fdb71a97e2fd0438565310e87670035d83bc10fe67fe314dba5363c81654595d64884b1ecad1512a64e65e02018203e8
IDNameSource
TA.02Created Shared AccountlockedTokens/admin/admin_create_shared_accounts.cdc
TA.04Deposit Locked TokenslockedTokens/admin/deposit_locked_tokens.cdc
TA.05Unlock TokenslockedTokens/admin/unlock_tokens.cdc
TA.06Deposit Account CreatorlockedTokens/admin/admin_deposit_account_creator.cdc

Custodian

The custodian is an agent who acts on behalf of the token holder for the purpose of securing FLOW tokens.

IDNameSource
C.01Set Up Creator AccountlockedTokens/admin/custody_setup_account_creator.cdc
C.02Create Shared AccountslockedTokens/admin/custody_create_shared_accounts.cdc
C.03Create Only Shared AcccountlockedTokens/admin/custody_create_only_shared_account.cdc
C.04Create Shared Lease AccountslockedTokens/admin/custody_create_account_with_lease_account.cdc
C.05Create Only Shared Lease AcccountlockedTokens/admin/custody_create_only_lease_account.cdc

Token Holder

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.

IDNameSource
TH.01Withdraw Unlocked FLOWlockedTokens/user/withdraw_tokens.cdc
TH.02Deposit Unlocked FLOWlockedTokens/user/deposit_tokens.cdc
TH.03Get Unlock LimitlockedTokens/user/get_unlock_limit.cdc
TH.04Get Locked Account BalancelockedTokens/user/get_locked_account_balance.cdc
TH.05Get Locked Account AddresslockedTokens/user/get_locked_account_address.cdc

Staking

These transactions operate through the StakingProxy.NodeStakerProxy interface.

IDNameSource
TH.06Register NodelockedTokens/staker/register_node.cdc
TH.07Get Node IDlockedTokens/staker/get_node_id.cdc
TH.08Stake New Locked FLOWlockedTokens/staker/stake_new_tokens.cdc
TH.09Re-stake Unstaked FLOWlockedTokens/staker/stake_unstaked_tokens.cdc
TH.10Re-stake Rewarded FLOWlockedTokens/staker/stake_rewarded_tokens.cdc
TH.11Request Unstake of FLOWlockedTokens/staker/request_unstaking.cdc
TH.12Unstake All FLOWlockedTokens/staker/unstake_all.cdc
TH.13Withdraw Unstaked FLOWlockedTokens/staker/withdraw_unstaked_tokens.cdc
TH.14Withdraw Rewarded FLOWlockedTokens/staker/withdraw_rewarded_tokens.cdc
TH.25Update Networking AddresslockedTokens/staker/update_networking_address.cdc

See the staking documentation for how to get info about a staked node.

Delegating

These transactions operate through the StakingProxy.NodeDelegatorProxy interface.

IDNameSource
TH.17Register DelegatorlockedTokens/delegator/register_delegator.cdc
TH.18Get Delegator IDlockedTokens/delegator/get_delegator_id.cdc
TH.25Get Delegated Node IDlockedTokens/delegator/get_delegator_node_id.cdc
TH.19Delegate New Locked FLOWlockedTokens/delegator/delegate_new_tokens.cdc
TH.20Re-delegate Unstaked FLOWlockedTokens/delegator/delegate_unstaked_tokens.cdc
TH.21Re-delegate Rewarded FLOWlockedTokens/delegator/delegate_rewarded_tokens.cdc
TH.22Request Unstake of Delegated FLOWlockedTokens/delegator/request_unstaking.cdc
TH.23Withdraw Unstaked Delegated FLOWlockedTokens/delegator/withdraw_unstaked_tokens.cdc
TH.24Withdraw Rewarded Delegated FLOWlockedTokens/delegator/withdraw_rewarded_tokens.cdc

See the staking documentation for how to get info about a staked delegator.

Node Operator Staking Proxy

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.

IDNameSource
NO.01Set Up Operator AccountstakingProxy/setup_node_account.cdc

Register an Operator Node

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.

IDNameSource
TH.15Get Operator Node Info for registrationstakingProxy/get_node_info.cdc
TH.16Register Operator NodestakingProxy/register_node.cdc

Staking

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.

IDNameSource
NO.02Add Node InfostakingProxy/add_node_info.cdc
NO.03Remove Node InfostakingProxy/remove_node_info.cdc
NO.04Remove Staking ProxystakingProxy/remove_staking_proxy.cdc
NO.05Stake New Locked FLOWstakingProxy/stake_new_tokens.cdc
NO.06Re-stake Unstaked FLOWstakingProxy/stake_unstaked_tokens.cdc
NO.07Unstake FLOWstakingProxy/unstake_all.cdc
NO.08Withdraw Unstaked FLOWstakingProxy/withdraw_unstaked.cdc
NO.09Withdraw Rewarded FLOWstakingProxy/withdraw_rewards.cdc

Events

The LockedTokens contract defines events that can be monitored for important actions.

SharedAccountRegistered

Emitted when a new shared (locked) account is registered.

SharedAccountRegistered

_10
pub event SharedAccountRegistered(address: Address)

UnlockedAccountRegistered

Emitted when a new user (unlocked) account is registered. This and SharedAccountRegistered are always emitted at the same time.

UnlockedAccountRegistered

_10
pub event UnlockedAccountRegistered(address: Address)

UnlockLimitIncreased

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.

UnlockLimitIncreased

_10
pub event UnlockLimitIncreased(address: Address, increaseAmount: UFix64, newLimit: UFix64)

LockedAccountRegisteredAsNode

Emitted when a user registers their locked account as a node operator.

LockedAccountRegisteredAsNode

_10
pub event LockedAccountRegisteredAsNode(address: Address, nodeID: String)

LockedAccountRegisteredAsDelegator

Emitted when a user registers their locked account as a delegator.

LockedAccountRegisteredAsDelegator

_10
pub event LockedAccountRegisteredAsDelegator(address: Address, nodeID: String)

LockedTokensDeposited

Emitted when the token admin deposits locked tokens from the token sale.

LockedTokensDeposited

_10
pub event LockedTokensDeposited(address: Address, amount: UFix64)