cyber.stake
system smart contract provides voting methods for validators, which allow users to use their votes, as well as resources on balance sheets, most effectively. Cyber.stake
also provides the user with the ability to authorize another user to vote.cyber.stake
smart contract.setproxylvl
.token_symbol
— symbol of the token for which the stake is being created.max_proxies
— maximum allowed proxy account values. The zero element of the vector sets the maximum number of users who can be trusted in the voting if the proxy account level is the first. The first element of the vector sets the maximum number of parts into which the stake can be divided if the level of the proxy account is second. If there are fourth or more levels in the proxy system, the vector will contain three or more elements.depriving_window
— the length of the period (in seconds) during which funds withdrawn back to the delegate cannot be used by him. Funds can be recalled by recallvote
operation call. Withdrawn funds during this period cannot be taken into account when calculating the share of resources.min_own_staked_for_election
— the minimum number of tokens staked which the user must have in his/her repository to be a candidate for validators. token_symbol
token. The token creator, by calling create, allows other users to translate tokens of this type into the state of the stake. When creating a stake for a system token, you must have system rights.enable
action allows to deduce a certain type of token from use for a while. This action sets the enable flag to true.token_symbol
parameter is the symbol of the token affected by the enable flag set to true.token_symbol
is a system one, then when the enable flag is set on the node, the restriction on the use of resources by stake is enabled.token_symbol
token creator are required to call this action.open
action is used to create a balance for a user.owner
— username for which balance is being created.token_code
— symbol of the token that will be listed on the balance.ram_payer
— name of the account paying for opening the balance. If the parameter accepts the default value std::nullopt
, then the owner himself pays for opening the balance. open
action should be signed by the user who pays for opening a balance. Owner rights are being requested by default.delegatevote
action is used to delegate to another account the right to dispose of staked tokens (in whole or in part) when voting for validators.grantor_name
— an account who delegates the right to dispose of a steak. This is either an ordinary user or a proxy account whose proxy level higher than that of a recipient.recipient_name
— name of the proxy account that is trusted with the voting right.quantity
— number of staked tokens that the proxy recipient_name
can use when voting. The parameter must be greater than zero. delegatevote
) to the ёrecipient_nameё recipient, whose proxy_level
proxy level is lower than that of the sender grantor_name
.Note: Since in the current release the number of levels of proxy accounts is limited to three (zero is a validator, the first is directly a proxy account, the second is an ordinary user), voice transfer from one proxy account to another is not possible. Having received a vote from an ordinary user, a proxy account can use it only when voting for validators.
delegatevote
action should be signed by the grantor_name
account.recallvote
action is used to withdraw the right to use a delegated stake when voting for validators. The steak value is set as a percentage and can be withdrawn either partially or completely.grantor_name
— name of the account that withdraws the right to use the stake.recipient_name
— name of the account from which the right to use the stake is withdrawn.token_code
— staked token symbol.pct
— share of stake (in percent), the right to use of which is revoked. grantor_name
account immediately after the recallvote
operation is completed.recallvote
action should be signed by the grantor_name
account.setgrntterms
action is used to distribute additionally allocated staked tokens between validators when voting. These tokens are distributed in accordance with the specified proportions..grantor_name
— name of the account that delegates the extra share of stake.recipient_name
— name of the proxy account, recipient of the extra share of staked tokens.token_code
— staked token symbol.pct
— share (in percent) of additional votes received, which will be given for the recipient_name
candidate.break_fee
— the parameter that controls the change in the fee set by the candidate. The value of this parameter is the percentage of commission charged by the grantor_name
account for the recipient_name
candidate. If the candidate during the voting process sets the value of fee greater than break_fee
, the recall operation will be automatically called to recall the votes of this candidate.break_min_own_staked
— the parameter that controls the availability of secured tokens in the recipient_name
candidate. The value of this parameter is set by the grantor_name
account. By default, this change is set to the current min_own_staked
value. If the candidate reduces min_own_staked
(in order to withdraw funds to a liquid state), the next time the balance of the grantor_name
account is updated, the recall operation will be automatically called to revoke the allocated tokens from this candidate. min_own_staked
.withdraw
action is used to withdraw staked tokens and make them liquid.account
— name of the account withdrawing staked tokens.quantity
— number of tokens withdrawn. This value shpild be positive. withdraw
action is calling, the cyber.stake
smart contract sends a notification to token creator, which makes the final decision on the withdrawal of tokens. The withdrawal of tokens is performed immediately without any delay.cyber.bios
smart contract. The operation is performed if the remainder of the user’s stake covers the costs of the resources used by him taking into account the funds being withdrawn.withdraw
action should be signed by the account
.setproxylvl
action sets the proxy account level for a user.account
— name of the account for which a proxy account level is set.token_code
— number of staked tokens available to the user.level
— level being set. setproxylvl
action should be signed by the account
.setproxyfee
action sets a size of the commission for an agent (a candidate for validators) that users voted for.account
— name of the agent that users have voted for.token_code
— symbol of tokens constituting a reward to the agent.fee
— amount of commission deductions to be taken from the amount of reward that the agent receives. This parameter is calculated at the time of reward payment. The parameter takes values from «0» to «10000» inclusive («0» corresponds to «0 %», «10000» corresponds to «100 %»). setminstaked
action sets the minimum possible size of a steak allocated for voting by an agent (a candidate for validators).account
— name of the agent.token_code
— symbol of staked tokens.min_own_staked
— minimum possible steak, which is allocated for voting by the agent himself. This value should be positive. min_own_staked
less than min_own_staked_for_election
one during a voting, then the votes cast for him are automatically canceled.setkey
action sets the public key for a validator, which will be used for signing blocks.account
— name of the validator to which the public key is being set.token_code
— symbol of staked tokens.signing_key
— the public key (i.e. validator signature).updatefunds
action is used to update a user’s stake.account
— name of the account for which the steak size is being updated.token_code
— symbol of staked tokens. updatefunds
action sets the actual value for a user’s stake. This operation simplifies the procedure for calculating user rewards, including share determination for a user. The updatefunds
action can also be used during other actions, such as revoking tokens or voting. That is, when performing active operations that require updating a stake.updatefunds
action can be called by any user. Authorization is not required.reward
action is used to pay rewards to users by crediting the corresponding amounts to their balances.rewards
— a vector containing account names and the payouts associated to them.sym
— symbol of tokens in which the reward is being paid. reward
action should be signed by the sym
token creator.pick
action updates the entire list of validators, including candidates for validators, and notifies the cyber.stake
contract about changes in the list, as well as about appearance of a new validator selected from the candidates at a certain time.token_code
— number of tokens held by a candidate, notification of which is sent.accounts
— vector of accounts that are current validators, as well as candidates for validators. cyber.govern
smart contract. The first n-1
validators from the list (n
is total number of validators) are selected in accordance with the number of votes cast for them, taking into account the weight of each vote. The last validator from this list is pseudo-random. This validator is selected according to a formula that takes into account the time elapsed since the last validator selection and the number of votes cast for this candidate.n-1
validators, get the opportunity to appear among these validators after a certain time. Candidate priorities are calculated using get_top
method in the cyber.govern
smart contract. This method determines the selected candidates who received the most votes and the reserve candidates. The method takes into account the length of stay in the status of a candidate (since when did the candidate remain among the non-elected). Each of the candidates is located in the list of the priority field in accordance with the priority calculated for it.pick
operation is called by the cyber.govern
smart contract and updates the priority field, moving all candidates in the queue to positions according to their calculated priority, and notifies cyber.stake
of changes in the candidate list at the current time.pick
action should be signed by the token_code
token creatordelegateuse
action is used to delegate resources (RAM, NET, CPU, Storage) to another user, which can be used at user’s discretion (unlike this operation, delegatevote
delegates resources that can be used only for voting).grantor_name
— name of the account, who is a delegator of a stake.recipient_name
— name of the account, who is a recipient of a stake.quantity
— amount of delegated stake. This parameter should be positive. delegateuse
action is calling, the cyber.stake
smart contract sends a notification to the token creator, who makes the final decision on the stake delegation.cyber.bios
smart contract. The operation is performed if the remainder of the delegator’s stake covers the costs of the resources used by him taking into account the funds being delegated.recalluse
action is used to revoke the delegated portion of a stake.grantor_name
— name of the account revoking the delegated portion of the stake.recipient_name
— name of the account whose delegated portion of the stake is being revoked.quantity
— amount of revoked stake. This parameter should be positive. depriving_window
parameter when the create operation is called. The delegator can use the returned portion of the stake only after this period.recalluse
call, the returned funds can only be used after the depriving_window
time has passed.grantor_name
— name of the account that revokes the delegated portion of the stakerecipient_name
— name of the account whose delegated portion of the stake is being revoked.token_code
— revoked part of the stake. Value should be positive. suspendcand
action allows a user to set maximum proxy level (lowest) for a validator if this validator has not been active for a long time (30 days).account
— account of a validator whose activity is checked.token_code
— a symbol of staked tokens of the validator.setautorcmode
action allows a token issuer (excluding CYBER tokens) to enable/disable automatic reset of votes. This action is paired with setautorc
. When the mode is on, the votes will not be reset automatically until a voter sets parameters with the action setautorc
.token_code
— a token code of an issuer.enabled
— true
enables auto recall mode (reset of votes).setautorc
, a user indicates conditions under which his vote for validator should be reset. This action is paired with setautorcmode
.account
— account of a validator.token_code
— a symbol of staked tokens held by the validator.break_fee_enabled
— true
controls change in fee set by the validator.break_min_stake_enabled
— true
controls availability of staked tokens of the validator.break_fee
and break_min_own_staked
are set using setgrntterms. To perform the action, authorization of the validator is required.setinfo
action allows a validator to provide a link to his page and to announce any info about himself on-chain.account
— account of the validator.token_code
— symbol of staked tokens.url
— a link to validator's page (the url string is limited to 2048 characters).info
— additional information about the validator (the info string is limited to 2048 characters).get_votes_sum
inline function returns the total number of votes available to validator candidates who received the most votes by validator candidates who received the most votes.token_code
— symbol of staked tokens by which votes were determined.limit
— the requested number of first candidates from the priority list for which the total number of votes is determined. The first on the list are the candidates who received the most votes. By default, the parameter takes a null value.If limit
is null, then this action returns total number of votes of all candidates from the priority
list.get_top
inline function returns a list of the most rated candidates, compiled according to a certain principle.token_code
— symbol of tokens tokens by which the votes were defined.elected_num
— the requested number of candidates who received the largest number of votes among those elected as validators.reserve_num
— the requested number of reserve candidates who were not included in the list of eligible candidates. The list of reserve candidates includes those candidates who received the most votes among remaining candidates, taking into account the time when each of the candidates did not appear in the list of validators.strict
— true
ignores the votes of candidates who do not have a public key. Default is true
. get_top
function returns a list of candidates made up of the requested number of elected_num
elected to validators and the number of reserve_num
backups added to it taking into account the strict parameter.