Stake Actions
Instructions pertaining to the management of stakes including staking BOID tokens, unstaking, and handling stake delegation.
stake
Transfers BOID tokens from a user's internal account balance to their staked balance.
Input Parameters
boid_id: Name, // Staker's BOID account name
quantity: u64 // Amount of BOID tokens to stakeAuthentication
- The action must be authorized by the contract or the
boid_idaccount.
Validation
quantityshould be greater than zero.
Table Updates
- Deducts
quantityfromaccount.balance - Increment
account.stake.self_stakedbyquantity
Inline Actions
- Transfers BOID tokens equivalent to
quantitytostake.boidwith a memo indicating staking.
stake.deleg
Facilitates the delegation of a stake to another account, potentially with a stake lock until a specified round.
Input Parameters
from_boid_id: Name, // Delegating account's BOID name
to_boid_id: Name, // Recipient account's BOID name
stake_quantity: u64, // Amount of BOID tokens to delegate
lock_until_round: u32 // Round number until which stake is lockedAuthentication
- The action requires the authorization of the contract or the delegating
from_boid_id.
Validation
- The
from_boid_idmust have sufficient BOID inself_staked. - The
lock_until_roundmust be set beyond the current round by at least the minimum lock duration configured.
Table Updates
- Adjusts
account.stake.self_stakedandaccount.stake.received_delegated_stakeby the delegated amount.
unstke.deleg
Returns delegated BOID tokens from the stakes table to the delegator's self_stake.
Input Parameters
stake_id: u64 // Unique ID for the delegated stakeAuthentication
- Requires authorization from the contract or the
stake.from_boid_id.
Validation
- Unstaking can only occur after the stake lock period has ended.
Table Updates
- Reinstates
account.stake.self_staked - Reduces
account.stake.received_delegated_stake - Removes the entry for the delegated stake.
unstake.init
Begins the unstaking process, scheduling the transfer of tokens from self_staked to the user's balance.
Input Parameters
boid_id: Name, // Staker's BOID account name
quantity: u64 // Amount of BOID tokens to unstakeAuthentication
- Authorized by the contract or the
boid_id.
Validation
quantitymust not be more than the availableself_stakedamount.- There should be no ongoing unstaking process for the account.
Table Updates
- Records an entry in
account.stake.unstakingfor the pending unstake.
unstake.stop
Aborts an active unstaking operation.
Input Parameters
boid_id: Name // Staker's BOID account nameAuthentication
- Authorized by the contract or the
boid_id.
Validation
- An unstaking process should currently be in progress to be cancelled.
Table Updates
- Clears the
account.stake.unstakingprocess.
unstake.end
Concludes the unstaking process by transferring funds from self_staked to the user's available balance.
Input Parameters
boid_id: Name // Staker's BOID account nameAuthentication
- No authentication is enforced by the code.
Validation
- An unstaking invoking is required that has passed its release round.
Table Updates
- Increases
account.balance - Decreases
account.stake.self_staked - Removes the pending unstaking entry
account.stake.unstaking
Inline Actions
- Processes BOID token transfers from
stake.boidto the requestor.
withdraw
Withdraws BOID tokens from a BOID account to an external address on the Proton blockchain.
Input Parameters
boid_id: Name, // Originating BOID account name
quantity: u64, // Token amount to withdraw
to: ChainAccount // Destination Proton chain accountAuthentication
- Action must be authorized by the owner of
boid_id.
Validation
quantityshould not surpass the withdrawable account balance.
Inline Actions
- Directly transfers BOID tokens to the specified external account.
internalxfer
Executes an internal transfer of BOID tokens from the sender to the recipient within the ecosystem.
Input Parameters
from_boid_id: Name, // Sending account's BOID name
to_boid_id: Name, // Receiving account's BOID name
quantity: u64, // Token quantity for the transfer
memo: string // Memo text for the transferAuthentication
- Required from the
from_boid_idowner.
Validation
from_boid_idmust not matchto_boid_id, andquantityhas to be positive.
Table Updates
- Updates
from_boid_idandto_boid_idbalances as per the transfer amount.

