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


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

Source: StakingProxy.cdc

NetworkContract Address


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
TA.01Set Up Admin AccountlockedTokens/admin/create_admin_collection.cdc
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


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

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.

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


These transactions operate through the StakingProxy.NodeStakerProxy interface.

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.


These transactions operate through the StakingProxy.NodeDelegatorProxy interface.

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.

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.

TH.15Get Operator Node Info for registrationstakingProxy/get_node_info.cdc
TH.16Register Operator NodestakingProxy/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.

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


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


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

pub event SharedAccountRegistered(address: Address)


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

pub 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.

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


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

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


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

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


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

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