DAORoot

propose

Creates new DAO proposal.

function propose(
        uint32 answerId,
        TonAction[] tonActions,
        EthAction[] ethActions,
        string description
    ) override public

Parameters:

NameTypeDescription

answerId

uint32

tonActions

TonAction[]

List of everscale actions

ethActions

EthAction[]

List of ethereum actions

description

string

Description of the proposal

deployProposal

Deploys Proposal contract (creates a new instance of Platform contract).

function deployProposal(
        uint32 nonce,
        address accountOwner,
        TvmCell proposalData
    ) override public onlyStakingAccount(accountOwner)onProposalDeployed
NameTypeDescription

nonce

uint32

accountOwner

address

The address of owner of the account

proposalData

TvmCell

Information about the proposal, including answer id, description, list of TON and EVM actions

Events emitted:

  • ProposalCreated

onProposalSucceeded

Callback method after successful proposal.

function onProposalSucceeded(
        uint32 proposalId,
        address proposer,
        TonAction[] tonActions,
        EthAction[] ethActions
    ) override public onlyProposal(proposalId)

Parameters:

NameTypeDescription

proposalId

uint32

The id of the proposal

proposer

address

Address of the proposal creator

tonActions

TonAction[]

List of everscale actions

ethActions

EthAction[]

List of ethereum actions

Events emitted:

  • ExecutingTonActions

executeTonAction

Does the transfer based on the action payload.

function executeTonAction(TonAction action) private pure inline

Parameters:

NameTypeDescription

action

TonAction

The everscale action to be executed

executeEthActions

Based on the list of actions fills necessary data, adds actions to the chain of actions, encodes them to the event data and deploys events.

function executeEthActions(address proposer, EthAction[] actions) private view inline

Parameters:

NameTypeDescription

proposer

address

Address of the proposal creator

actions

EthAction[]

The ethereum action to be executed

calcTonActionsValue

Calculates total value of actions on Everscale.

function calcTonActionsValue(TonAction[] actions) public pure returns (uint128 totalValue)

Parameters:

NameTypeDescription

actions

TonAction[]

The list of actions to be calculated

Return values:

NameTypeDescription

totalValue

uint128

Total value of the actions list

calcEthActionsValue

Calculates total value of actions on Ethereum.

function calcEthActionsValue(
        EthAction[] actions
    ) public view returns (uint128 totalValue)

Parameters:

NameTypeDescription

actions

EthAction[]

The list of actions to be calculated

Return values:

NameTypeDescription

totalValue

uint128

Total value of the actions list

_buildProposalInitialData Builds initial data for Proposal

function _buildProposalInitialData(uint32 proposalId) private inline pure returns (TvmCell)

Parameters:

NameTypeDescription

proposalId

uint32

The id of the proposal

Return values:

TypeDescription

TvmCell

Proposal initial data in cell format

_buildStakingAccountInitialData

Builds initial data for Staking account

function _buildStakingAccountInitialData(address accountOwner) private inline pure returns (TvmCell)

Parameters:

NameTypeDescription

accountOwner

address

The address of the staking account owner

Return values:

TypeDescription

TvmCell

Staking account initial data in cell format

_buildInitData

Builds initial data for specified Platform type.

function _buildInitData(PlatformType platformType, TvmCell initialData) private view returns (TvmCell)

Parameters:

NameTypeDescription

platformType

PlatformType

Type of the platform

initialData

TvmCell

The proposal initial data in cell format

Return values:

TypeDescriptionDescription

TvmCell

Initial data represented in cell format

Type of the platform

requestUpgradeProposal

Creates request for upgrading proposal for different version.

function requestUpgradeProposal(
        uint16 currentVersion,
        address sendGasTo,
        uint32 proposalId
    ) override public onlyProposal(proposalId)

Parameters:

NameTypeDescription

currentVersion

uint16

Current version of proposal

sendGasTo

address

Address where to send spent gas

proposalId

uint32

The id of the proposal

setStakingRoot

Sets staking root address from params and transfers remaining gas to admin

function setStakingRoot(address newStakingRoot) override public onlyAdmin

Parameters:

NameTypeDescription

newStakingRoot

address

The address of the new staking root

Events emitted:

  • StakingRootUpdated

transferAdmin

Transfers admin role to other address.

function transferAdmin(address newAdmin) override public onlyAdmin

Parameters:

NameTypeDescription

newAdmin

address

The address of the new admin

Events emitted:

  • AdminTransferAccepted

Last updated