golos.ctrl) smart contract implements logic for election of witnesses, including the following:
golos.ctrlsmart contract contains settings that apply to the Golos application as a whole. These settings can be used to the change parameters of any subsystems (for example, emission distribution between pools). Other Golos application smart contracts can access the
golos.ctrlsmart contract and get these settings, percentage ratios of the funds distributed by pools, limits on battery resources. Also, the smart contracts can obtain a list of the most rated witnesses with corresponding authority values. This makes it possible to verify the authenticity of actions certified by witnesses.
golos.ctrlsmart contract contains a kit of the parameters. To configure the contract, it needs to apply the action
setparamsaction. The list of available parameters used by the contract is as follows:
ctrl_token— a token symbol that uniquely identifies a specific token:
multisig_acc— an account name that controls a multisignature authorisation.
max_witnesses— a maximum number of witnesses that can take a decision (for example, sign transactions) on behalf of the application. The
multisig_accparameter contains a list of such witnesses.
multisig_perms— a required number of signatures from the most rated witnesses that have a permission to perform actions on behalf of the application. To change a parameter value it requires an appropriate level of permission. Different parameters require a different level of permission that is connected to their importance. There are three permission levels:
super_majority— a high level of permission. To get such level it needs to pick up at least «two-thirds plus one» votes of the most rated witnesses (if this parameter is "0", it takes default value — "2/3+1");
majority— an average level of permission. To get such level it needs to pick up at least «half plus one» votes of the most rated witnesses (if this parameter is "0", it takes default value — "1/2+1");
minor_majority— a low level of permission. To get such level it needs to pick up at least «one-third plus one» votes of the the most rated witnesses (if this parameter is "0", it takes default value — "1/3+1").
max_witness_votes— a maximum number of witnesses for which a user can vote.
update_auth— a parameter that specifies frequency of updating the authorization for the
period— an update period (in seconds). Re-authorization change for account is not performed if specified period has not passed since the last update.
setparamsaction is used to configure the
golos.ctrlsmart contract parameters. The action has the following form:
params— a value in the form of a structure containing fields with the setting parameters.
validateprmsaction checks parameters for validity and controls if there are errors or not. The
validateprmsaction is called by the smart contract. It has the following form:
params— a value in the form of a structure containing the parameters to be checked.
regwitnessaction is used to register candidates for witnesses. The action has the following form:
witness— a name of a candidate for witnesses.
url— a website address from where information about the candidate can be obtained, including the reasons for her/his desire to become a witness. The address string must not exceed 256 characters.
regwitnessaction requires a signature of the witness candidate.
unregwitnessaction is used to withdraw a user's candidacy from among the registered candidates to the witnesses. The action has the following form:
witness— the user name to be removed from the list of witnesses registered as candidates.
unregwitnessaction can be called either by the candidate (in case of a withdrawal) or by a witness who found a discrepancy of the witness capabilities to desirable witness requirements, and mismatched data published on the web site with her/his relevant data.
stopwitnessaction is used to temporarily suspend active actions of a witness (or a witness candidate). The action has the following form:
witness— account name of a witness (or a witness candidate) whose activity is temporarily suspended.
witnessaccount should be active;
witnessaccount activity can be continued in case it has performed the
startwitnessaction is used to resume suspended witness activity (or a witness candidate activity). The action has the following form:
witness— account name of a witness (or a witness candidate), whose activity is resumed.
witnessaccount activity should be suspended, that is, the operation
stopwitnessshould be performed previously;
votewitnessaction is used to vote for a witness candidate. The action has the following form:
voter— an account name that is voting for the witness candidate.
witness— a name of the witness candidate for whom the vote is cast.
votewitnessaction requires signing the
witnesscandidate name must first be registered through a call to
voteraccount for all candidates should not exceed the
unvotewitnis used to withdraw a previously cast vote for a witness candidate.
voter— an account name that intends to withdraw her/his vote which was previously cast for the witness candidate.
witness— the witness candidate name from whom the vote is withdrawn.
unvotewitnaction requires signing the
changevestis an internal and unavailable to the user action. It is used by
golos.vestingsmart contract to notify the
golos.ctrlsmart contract about a change of the vesting amount on the user's balance. The
changevestaction has the following form:
who— an account name whose vesting amount has been changed.
diff— a relative change of vesting amount.
changevestaction is called automatically each time in case the vesting amount is changed on a user's balance. The
golos.vestingsmart contract informs the
golos.ctrlsmart contract about this change. Because changing the vesting amount on the user's balance changes the weight of this user's vote, the witness rating that the user voted for will also be changed. The
golos.ctrlsmart contract corrects the rating of each witness based on received information about the change. The data of the smart contract table is not modified.
multisig_accauthorization will automatically be changed too.
banaction bans a user from publishing and curating any posts. Any account can be banned if the content of its publication or comment poses a direct threat to the life of the application or the blockchain as a whole (for example, a statement in a harsh negative form that could affect the reputation of application, campaigning or calling users, etc.).
account— the account to be banned.
unbanaction cancels the ban for a user to publish and curate posts.
account— the account to be unbanned.