IGovValidators

Interface Description

License: MIT

interface IGovValidators

This is the voting contract that is queried on the proposal's second voting stage

Enums info

ProposalState

enum ProposalState {
	 Voting,
	 Defeated,
	 Succeeded,
	 Locked,
	 Executed,
	 Undefined
}

ProposalType

enum ProposalType {
	 ChangeSettings,
	 ChangeBalances,
	 MonthlyWithdraw,
	 OffchainProposal
}

Structs info

ProposalSettings

struct ProposalSettings {
	uint64 duration;
	uint64 executionDelay;
	uint128 quorum;
}

The struct holds information about settings for validators proposal

Parameters:

ProposalCore

struct ProposalCore {
	bool executed;
	uint56 snapshotId;
	uint64 voteEnd;
	uint64 executeAfter;
	uint128 quorum;
	uint256 votesFor;
	uint256 votesAgainst;
}

The struct holds core properties of a proposal

Parameters:

InternalProposal

struct InternalProposal {
	IGovValidators.ProposalType proposalType;
	IGovValidators.ProposalCore core;
	string descriptionURL;
	bytes data;
}

The struct holds information about the internal proposal

Parameters:

ExternalProposal

struct ExternalProposal {
	IGovValidators.ProposalCore core;
}

The struct holds information about the external proposal

Parameters:

InternalProposalView

struct InternalProposalView {
	IGovValidators.InternalProposal proposal;
	IGovValidators.ProposalState proposalState;
	uint256 requiredQuorum;
}

The struct that is used in view functions of contract as a return argument

Parameters:

Functions info

validatorsCount (0xed612f8c)

function validatorsCount() external view returns (uint256)

The function for getting current number of validators

Return values:

createInternalProposal (0x9661803d)

function createInternalProposal(
    IGovValidators.ProposalType proposalType,
    string calldata descriptionURL,
    bytes calldata data
) external

Create internal proposal for changing validators balances, base quorum, base duration

Parameters:

createExternalProposal (0xdc2a7714)

function createExternalProposal(
    uint256 proposalId,
    IGovValidators.ProposalSettings calldata proposalSettings
) external

Create external proposal. This function can call only Gov contract

Parameters:

voteInternalProposal (0x5a34c7e1)

function voteInternalProposal(
    uint256 proposalId,
    uint256 amount,
    bool isVoteFor
) external

voteExternalProposal (0xba877b80)

function voteExternalProposal(
    uint256 proposalId,
    uint256 amount,
    bool isVoteFor
) external

cancelVoteInternalProposal (0x5478197e)

function cancelVoteInternalProposal(uint256 proposalId) external

cancelVoteExternalProposal (0xea1941d0)

function cancelVoteExternalProposal(uint256 proposalId) external

executeInternalProposal (0x65f3f23f)

function executeInternalProposal(uint256 proposalId) external

Only for internal proposals. External proposals should be executed from governance.

Parameters:

executeExternalProposal (0x430c885a)

function executeExternalProposal(uint256 proposalId) external

The function called by governance that marks the external proposal as executed

Parameters:

changeSettings (0xb395fec0)

function changeSettings(
    uint64 duration,
    uint64 executionDelay,
    uint128 quorum
) external

changeBalances (0x62a4107d)

function changeBalances(
    uint256[] calldata newValues,
    address[] calldata userAddresses
) external

The function for changing validators balances

Parameters:

monthlyWithdraw (0x3271f009)

function monthlyWithdraw(
    address[] calldata tokens,
    uint256[] calldata amounts,
    address destination
) external

getExternalProposal (0xe14ea231)

function getExternalProposal(
    uint256 index
) external view returns (IGovValidators.ExternalProposal memory)

The function for getting information about the external proposals

Parameters:

Return values:

getInternalProposals (0x8a847ae4)

function getInternalProposals(
    uint256 offset,
    uint256 limit
) external view returns (IGovValidators.InternalProposalView[] memory)

The function for getting information about internal proposals

Parameters:

Return values:

getProposalState (0x7b839d93)

function getProposalState(
    uint256 proposalId,
    bool isInternal
) external view returns (IGovValidators.ProposalState)

Return proposal state

Options: Voting - proposal where addresses can vote. Defeated - proposal where voting time is over and proposal defeated. Succeeded - proposal with the required number of votes. Executed - executed proposal (only for internal proposal). Undefined - nonexistent proposal.

getProposalRequiredQuorum (0xbd7782fc)

function getProposalRequiredQuorum(
    uint256 proposalId,
    bool isInternal
) external view returns (uint256)

The function for getting proposal required quorum

Parameters:

Return values:

isValidator (0xfacd743b)

function isValidator(address user) external view returns (bool)

The function that checks if a user is a validator

Parameters:

Return values: