IGovValidators
Interface Description
License: MIT
This is the voting contract that is queried on the proposal's second voting stage
Enums info
ProposalState
ProposalType
Structs info
ProposalSettings
The struct holds information about settings for validators proposal
Parameters:
duration
uint64
the duration of voting
executionDelay
uint64
the delay in seconds after voting end
quorum
uint128
the percentage of validators token supply to confirm the proposal
ProposalCore
The struct holds core properties of a proposal
Parameters:
executed
bool
the boolean flag that indicates whether the proposal is executed or not
snapshotId
uint56
the id of snapshot
voteEnd
uint64
the timestamp of voting end of the proposal
executeAfter
uint64
the timestamp of execution in seconds after voting end
quorum
uint128
the percentage of validators token supply to confirm the proposal
votesFor
uint256
the total number of votes in proposal from all voters
votesAgainst
uint256
the total number of votes against proposal from all voters
InternalProposal
The struct holds information about the internal proposal
Parameters:
proposalType
enum IGovValidators.ProposalType
the ProposalType
enum
core
struct IGovValidators.ProposalCore
the struct that holds information about core properties of the proposal
descriptionURL
string
the string with link to IPFS doc with proposal description
data
bytes
the data to be executed
ExternalProposal
The struct holds information about the external proposal
Parameters:
core
struct IGovValidators.ProposalCore
the struct that holds information about core properties of a proposal
InternalProposalView
The struct that is used in view functions of contract as a return argument
Parameters:
proposal
struct IGovValidators.InternalProposal
the InternalProposal
struct
proposalState
enum IGovValidators.ProposalState
the ProposalState
enum
requiredQuorum
uint256
the percentage of validators token supply to confirm the proposal
Functions info
validatorsCount (0xed612f8c)
The function for getting current number of validators
Return values:
[0]
uint256
number
of validators
createInternalProposal (0x9661803d)
Create internal proposal for changing validators balances, base quorum, base duration
Parameters:
proposalType
enum IGovValidators.ProposalType
ProposalType
0 - ChangeInternalDurationAndQuorum
, change base duration and quorum 1 - ChangeBalances
, change address balance 2 - MonthlyWithdraw
, monthly token withdraw 3 - OffchainProposal
, offchain action
data
bytes
New packed data, depending on proposal type
createExternalProposal (0xdc2a7714)
Create external proposal. This function can call only Gov
contract
Parameters:
proposalId
uint256
Proposal ID from Gov
contract
proposalSettings
struct IGovValidators.ProposalSettings
ProposalSettings
struct
voteInternalProposal (0x5a34c7e1)
voteExternalProposal (0xba877b80)
cancelVoteInternalProposal (0x5478197e)
cancelVoteExternalProposal (0xea1941d0)
executeInternalProposal (0x65f3f23f)
Only for internal proposals. External proposals should be executed from governance.
Parameters:
proposalId
uint256
Internal proposal ID
executeExternalProposal (0x430c885a)
The function called by governance that marks the external proposal as executed
Parameters:
proposalId
uint256
External proposal ID
changeSettings (0xb395fec0)
changeBalances (0x62a4107d)
The function for changing validators balances
Parameters:
newValues
uint256[]
the array of new balances
userAddresses
address[]
the array validators addresses
monthlyWithdraw (0x3271f009)
getExternalProposal (0xe14ea231)
The function for getting information about the external proposals
Parameters:
index
uint256
the index of proposal
Return values:
[0]
struct IGovValidators.ExternalProposal
ExternalProposal
struct
getInternalProposals (0x8a847ae4)
The function for getting information about internal proposals
Parameters:
offset
uint256
the starting proposal index
limit
uint256
the length of the observed proposals
Return values:
[0]
struct IGovValidators.InternalProposalView[]
InternalProposalView
struct array
getProposalState (0x7b839d93)
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)
The function for getting proposal required quorum
Parameters:
proposalId
uint256
the id of proposal
isInternal
bool
the boolean flag, if true then proposal is internal
Return values:
[0]
uint256
the number of votes to reach the quorum
isValidator (0xfacd743b)
The function that checks if a user is a validator
Parameters:
user
address
the address of a user
Return values:
[0]
bool
flag
, if true, than user is a validator