Proposal
queue
queueHappening after proposal execution
function queue() override publicEvents emitted:
Queued
execute
executeProposal execution.
function execute() override publicEvents emitted:
Executed
cancel
cancelProposal cancel.
function cancel() override publicEvents emitted:
Canceled
castVote
castVoteProcessing voter's vote is it for or against proposal.
function castVote(
uint32 /*proposalId*/,
address voter,
uint128 votes,
bool support,
string reason
) override public onlyStakingAccount(voter)Parameters:
uint32
The id of the proposal
voter
address
The address of the voter
votes
uint128
Number of votes given for proposal
support
bool
True if voting in favor, false if against
reason
string
Reason of the decided vote
Events emitted:
VoteCast
onActionsExecuted
onActionsExecutedCallback for executed actions.
function onActionsExecuted() override public onlyRootstate
stateGets the state of the proposal based on the specified conditions.
function state() private view returns (ProposalState)Return values:
ProposalState
Current proposal state
unlockCastedVote
unlockCastedVoteUnlocks casted vote only if proposal state is not active.
function unlockCastedVote(address accountOwner) override public view onlyStakingAccount(accountOwner)Parameters:
accountOwner
address
The address of the account owner
unlockVoteTokens
unlockVoteTokensUnlocks vote tokens based on the proposal state.
function unlockVoteTokens(address accountOwner) override public view onlyStakingAccount(accountOwner)Parameters:
accountOwner
address
The address of the account owner
_buildAccountInitialData
_buildAccountInitialDataBuilds initial data for account.
function _buildAccountInitialData(address accountOwner) private inline pure returns (TvmCell)Parameters:
accountOwner
address
The address of the account owner
Return values:
TvmCell
Account initial data in cell format
_buildStakingInitData
_buildStakingInitDataBuilds initial data for staking.
function _buildStakingInitData(uint8 platformType, TvmCell initialData) private inline view returns (TvmCell)Parameters:
platformType
uint8
The type of the platform
initialData
TvmCell
Initial data represented in cell format
Return values:
TvmCell
Staking initial data in cell format
requestUpgrade
requestUpgradeCreates request for upgrading proposal for different version
function requestUpgrade(address sendGasTo) override public viewParameters:
sendGasTo
address
Address where to send spent gas
Events emitted:
CodeUpgradeRequested
upgrade
upgradeUpgrades code to the new version
function upgrade(TvmCell code, uint16 newVersion, address sendGasTo) override public onlyRootParameters:
code
TvmCell
Code to be set for upgraded version
newVersion
uint16
New version of the code
sendGasTo
address
Address where to send spent gas
Events emitted:
ProposalCodeUpgraded
Last updated
Was this helpful?