golos.vestingsmart contract provides binding of the vesting to a token created by the
golos.vestingsmart contract supports the following operations:
golos.vestingsmart contract at the current price. In the smart contract, there is a table in the table that stores data on the availability of funds in the form of vesting on the balance sheet of each user. When purchasing the vesting, the transfer of funds (transaction) is performed directly in tokens. The user transfers a certain number of tokens from her/his balance to the
golos.vestingbalance. The user's balance is received amount of vesting at the current price as soon as the transaction is completed.
golos.vestingtable, an appropriate entry is made that only the recipient can use the delegated part of vesting. Data on the distribution of funds in the table are adjusted.
golos.vestingtable. If the operation to return the delegated vesting is created before the end of delegation, the delegator can not use the returned vesting before the delegated period deadline.
vesting_paramparameter is a «variant» type containing a structure of one of the following types:
setparamsaction for the first time, all three types of parameters are transitioned to the smart contract. When performing repeated calls (to change the settings) not all the parameters are allowed to be transferred.
vesting_withdrawparameter is used to set intervals to convert vesting into tokens. It is the structure:
intervals— number of intervals. The value to be set must be greater than zero.
interval_seconds— the duration of the interval (measured in seconds, in the first release the duration of the interval will be one week). The value to be set must be greater than zero.
vesting_amountparameter is used to set minimum number of vesting to be converted. It is the structure:
min_amount— minimum allowable (threshold) amount of vesting, below which it is not converted to tokens.
vesting_delegationparameter is used to set the delegation parameters. The value is a structure of the following form:
min_amount— the minimum allowable amount of vesting for delegation / return delegated. Specifying the number of vesting below this value is not allowed.
min_remainder— minimum balance delegated. It is not allowed to delegate less than this value. As a result of the return of the delegated, the balance must be at least this value, or it must be zero.
return_time— the time it takes to return the delegated funds (in seconds). The time is counted from the moment of withdrawing funds from the account to which they have been delegated, until the moment they are receipted on the delegators’ balance.
min_time— minimum delegation time (in seconds). The withdrawal of delegated funds is possible not earlier than this value.
setparamsaction is used to configure the
golos.vestingsmart contract. The signature of this action is:
symbol— identifier of the vesting for which the settings are made (there can be several types of vesting in the smart contract. For each type, a separate table is created containing the data on the distribution of this type of vesting).
Please note: The order of the parameters in params is important: the parameters must be transmitted in the same order as described in the variant, and not all parameters are allowed to be passed. This setparams rule is valid in all the contracts.
validateprmsaction checks all the parameters for validity and, respectively, controls the appearance of errors in them. The signature of this action is:
symbol— vesting identificator.
params— array of several parameters.
createaction is used to create and launch tokens in the vesting form. This action looks as:
symbol— identifier of the created vesting, symbol of the associated token located in the
notify_acc— the name of the account (
golos.ctrlsmart contract) to which notifications will be sent when the balance changes. Each identifier of the corresponding account corresponds to a
notify_accaccount, which is a smart management contract. Each time the balance changes, the weights of the «leaders» change; for this, a smart management contract receives a notification.
createaction requires a two-step authentication:
retireaction is used for taking the «burnt» vesting out of circulation. The signature of this action is:
quantity— the number and type of vesting to be «burnt». The parameter comes in the form of a structure containing fields:
user— user, performing the action.
assetvalue. The amount (i.e.
quantity) of vesting withdrawn from the system must be greater than zero, but not greater than the amount on the user's balance sheet, as well as the amount that is in the unlocked state.
createactions are similar to the actions of
golos.tokensmart contract. The difference is that the vesting is the token for shares and is not used as a cryptocurrency.
unlocklimitaction is used to limit the «burnt» by the smart contract part of the vesting from the account balance. The user can allow the smart contract to withdraw (i.e.«burn») a certain part of the vesting from its balance sheet (for example, when «burning» the vesting for purchasing bandwidth resources). The user-selected part of the vesting for «burning» must be previously unlocked. The signature of this action is:
owner— the account name that unlocks and gives permission to «burn» vesting from its balance.
quantity— specific vesting amount, safeguarded for «burning» and being in unlocked state. The specified quantity must be greater than zero or equal to zero. Zero number means no burning will be performed.
from— the account name that started the withdrawal process. In the process of withdrawing from the balance of this account, the amount of funds withdrawn in vesting.
to— the account name on whose balance the amount of token funds is transferred.
quantity— amount of funds allocated for withdrawal (i.e. conversion).
tomatch). Conversion is performed not once, but for a certain number of steps. The duration of one step is set by the action
setparams(by default, it is set to one week, and the duration of the entire process (all steps) of conversion — 13 weeks). Converting vesting into tokens is performed in equal shares. Conversion by different parts is not allowed.
convertis called again, the results of the previous conversion are canceled and new shares and a new balance are set in accordance with the current rate of vesting and token. In the process of conversion, internal actions are periodically called to verify the start of the payment of the next share and the execution of the current payment.
min_amount; when it’s not met, the vesting is never converted into tokens.
stopwithdrawaction is used for cancelling the «in progress» process of converting vesting to tokens.The signature of this action is:
owner— the account name that launched the conversion process.
symbol— a type of vesting for which the conversion process is canceled (conversion can be performed for each type of vesting separately and therefore a separate
stopwithdrawcall can cancel only one separate process).
owner. As soon as
stopwithdrawstarts, payments for conversion are immediately terminated.
delegateis used to delegate funds in the form of vesting. The signature of this action is:
from— the account name that launched the process of delegating the vesting. Specified amount of this account’s vesting will be marked as delegated.
to— the account name to which funds are delegated. The balance of this account will be credited with the amount of funds in vesting. This amount of funds is absolutely refundable and will be returned to the
fromaccount upon completion of the delegation.
quantity— amount of funds allocated for delegation.
interest_rate— the percentage of payment to the account
fromthat is deducted from curator fee of the account
payout_strategy— identifier of delegation strategy (delegation options):
to_delegator— delegation, in which reward from curation (curator fee) are charged to the account
to_delegated_vesting— delegation, in which reward from curation (curator fee) is added to delegated funds (with compound interest).
interest_rateparameter accepts one of two values: «0» —
to_delegatoror «1» —
toparameters must be different (if the user has two or more accounts, then delegation between them is allowed);
interest_rateinterest payment should not exceed the maximum delegation payment value set in the smart contract parameters when calling
delegateaction is called again for the same
topair, with the same vesting symbol, it is not allowed:
undelegateaction is used for partial or full refund of the delegated funds. The signature of this action is:
from— the account name that started the process of vesting delegation.
to— the account name to which funds were delegated.
quantity— the amount of funds received from the delegation. Value must be greater than zero.
undelegateaction requires meeting of the following rules:
tomust contain funds delegated by account
fromto the account
to, should not be less than
timeoutactions are internal operations-related and are called by the smart contract to check the following data:
openaction is used to create a record in the database to store the user's balance. The user can open the record both for himself and for another account. The signature of this action is:
owner— account name (signature owner).
symbol— parameter that uniquely identifies the vesting type.
ram_payer— account name that signs the transaction and pays for the use of RAM.
closeaction is used for memory brush up occupied by a record. The signature of this action is:
owner— account name, record owner.
symbol— parameter that uniquely identifies the vesting type.
paydelegatorsystem action is called by
golos.publicationsmart contract. The publication smart contract cannot imply any changes to the tables of the
golos.vestingsmart contract. Therefore, when closing a post, the publication smart contract calls the
paydelegatorand through it makes payments to the witnesses.
voter— curator name whose curatorial fees were paid to delegates.
reward— reward amount.
delegator— account name, recipient of the reward.
payout_strategy— identifier of delegation strategy. Accepts one of two values — «0» or «1». («0» — reward in tokens; «1» — reward in vesting).