Solidity API
Last updated
Last updated
Constructor has no inputs to guarantee same deterministic address across chains.
Setting high proposal threshold locks propose action, which also lock vote actions.
Reverts if initialization paramters are incorrect.
Only used at initialization, as params deleted from factory storage after setup.
Name | Type | Description |
---|---|---|
Reverts if thresholds are incorrect.
Returns the state of a proposal for a required quorum.
Return the voting period.
Returns the voting timestamps.
Return a user's voting power.
Emitted when a governance is created.
Creates a new governance proxy.
Returns the governance initialization parameters at proxy deploy.
Emitted when a new proposal is created.
Emitted when a proposal is executed.
Emmited when the governance strategy is upgraded.
Emitted when voting thresholds get updated.
Only governance can update thresholds.
Emitted when implementation written to proxy storage.
Emitted also at first variable initialization.
Emitted when a voter votes.
Initializes the Rigoblock Governance.
Params are stored in factory and read from there.
Returns the actions proposed for a given proposal.
Returns a proposal for a given id.
Returns the state of a proposal.
Returns the receipt of a voter for a given proposal.
Computes the current voting power of the given account.
Returns the governance parameters.
Returns the name of the governace.
Returns the total number of proposals.
Returns all proposals ever made to the governance.
Returns the voting period.
Updates the proposal and quorum thresholds to the given values.
Only callable by the governance contract itself. Thresholds can only be updated via a successful governance proposal.
Updates the governance implementation address.
Only callable after successful voting.
Updates the governance strategy plugin.
Only callable by the governance contract itself.
Casts a vote for the given proposal.
Only callable during the voting period for that proposal. One address can only vote once.
Casts a vote for the given proposal, by signature.
Only callable during the voting period for that proposal. One voter can only vote once.
Executes a proposal that has passed and is currently executable.
Creates a proposal on the the given actions. Must have at least proposalThreshold
.
Must have at least proposalThreshold
of voting power to call this function.
Constants are copied in the bytecode and not assigned a storage slot, can safely be added to this contract.
Contract version
Maximum operations per proposal
The EIP-712 typehash for the contract's domain
The EIP-712 typehash for the vote struct
Immutables are copied in the bytecode and not assigned a storage slot
New immutables can safely be added to this contract without ordering.
Initializes the Rigoblock Governance.
Params are stored in factory and read from there.
Returns the actions proposed for a given proposal.
Returns the state of a proposal.
Returns the receipt of a voter for a given proposal.
Computes the current voting power of the given account.
Returns the governance parameters.
Returns the name of the governace.
Returns the total number of proposals.
Returns all proposals ever made to the governance.
Returns the voting period.
Returns a proposal for a given id.
Updates the proposal and quorum thresholds to the given values.
Only callable by the governance contract itself. Thresholds can only be updated via a successful governance proposal.
Updates the governance implementation address.
Only callable after successful voting.
Updates the governance strategy plugin.
Only callable by the governance contract itself.
Returns whether an address is a contract.
Creates a proposal on the the given actions. Must have at least proposalThreshold
.
Must have at least proposalThreshold
of voting power to call this function.
Casts a vote for the given proposal.
Only callable during the voting period for that proposal. One address can only vote once.
Casts a vote for the given proposal, by signature.
Only callable during the voting period for that proposal. One voter can only vote once.
Executes a proposal that has passed and is currently executable.
Casts a vote for the given proposal.
Only callable during the voting period for that proposal.
Creates a new governance proxy.
Returns the governance initialization parameters at proxy deploy.
Returns whether an address is a contract.
Emitted when implementation written to proxy storage.
Emitted also at first variable initialization.
Sets address of implementation contract.
Fallback function forwards all transactions and returns all received return data.
Allows this contract to receive ether.
Method to read/write from/to implementation slot.
Reverts if initialization paramters are incorrect.
Only used at initialization, as params deleted from factory storage after setup.
Reverts if thresholds are incorrect.
Returns the state of a proposal for a required quorum.
Return a user's voting power.
Return the voting period.
Returns the voting timestamps.
It is more gas efficient at deploy to reading immutable from internal method.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
params
struct IRigoblockGovernanceFactory.Parameters
Tuple of factory parameters.
proposalThreshold
uint256
Number of votes required to make a proposal.
quorumThreshold
uint256
Number of votes required for a proposal to succeed.
proposal
struct IGovernanceState.Proposal
Tuple of the proposal.
minimumQuorum
uint256
Number of votes required for a proposal to pass.
[0]
enum IGovernanceState.ProposalState
Tuple of the proposal state.
[0]
uint256
Number of seconds of period duration.
startBlockOrTime
uint256
Timestamp when proposal starts.
endBlockOrTime
uint256
Timestamp when voting ends.
account
address
Address to check votes for.
governance
address
Address of the governance proxy.
implementation
address
Address of the governance implementation contract.
governanceStrategy
address
Address of the voting strategy.
proposalThreshold
uint256
Number of votes required for creating a new proposal.
quorumThreshold
uint256
Number of votes required for execution.
timeType
enum IGovernanceState.TimeType
Enum of time type (block number or timestamp).
name
string
Human readable string of the name.
governance
address
Address of the new governance.
[0]
struct IRigoblockGovernanceFactory.Parameters
Tuple of the governance parameters.
proposer
address
Address of the proposer.
proposalId
uint256
Number of the proposal.
actions
struct IGovernanceVoting.ProposedAction[]
Struct array of actions (targets, datas, values).
startBlockOrTime
uint256
Timestamp in seconds after which proposal can be voted on.
endBlockOrTime
uint256
Timestamp in seconds after which proposal can be executed.
description
string
String description of proposal.
proposalId
uint256
Number of the proposal.
newStrategy
address
Address of the new strategy contract.
proposalThreshold
uint256
Number of votes required to add a proposal.
quorumThreshold
uint256
Number of votes required to execute a proposal.
newImplementation
address
Address of the new implementation.
voter
address
Address of the voter.
proposalId
uint256
Number of the proposal.
voteType
enum IGovernanceVoting.VoteType
Number of vote type.
votingPower
uint256
Number of votes.
proposalId
uint256
Number of the proposal.
proposedActions
struct IGovernanceVoting.ProposedAction[]
Array of tuple of proposed actions.
proposalId
uint256
The number of the proposal.
proposalWrapper
struct IGovernanceState.ProposalWrapper
Tuple wrapper of the proposal and proposed actions tuples.
proposalId
uint256
Number of the proposal.
[0]
enum IGovernanceState.ProposalState
Number of proposal state.
proposalId
uint256
Number of the proposal.
voter
address
Address of the voter.
[0]
struct IGovernanceState.Receipt
Tuple of voter receipt.
account
address
The address of the account.
votingPower
uint256
The current voting power of the given account.
[0]
struct IGovernanceState.EnhancedParams
Tuple of the governance parameters.
[0]
string
Human readable string of the name.
count
uint256
The number of proposals.
proposalWrapper
struct IGovernanceState.ProposalWrapper[]
Tuple array of all governance proposals.
[0]
uint256
Number of blocks or seconds.
newProposalThreshold
uint256
The new value for the proposal threshold.
newQuorumThreshold
uint256
The new value for the quorum threshold.
newImplementation
address
Address of the new governance implementation contract.
newStrategy
address
Address of the new strategy contract.
proposalId
uint256
The ID of the proposal to vote on.
voteType
enum IGovernanceVoting.VoteType
Whether to support, not support or abstain.
proposalId
uint256
The ID of the proposal to vote on.
voteType
enum IGovernanceVoting.VoteType
Whether to support, not support or abstain.
v
uint8
the v field of the signature.
r
bytes32
the r field of the signature.
s
bytes32
the s field of the signature.
proposalId
uint256
The ID of the proposal to execute.
actions
struct IGovernanceVoting.ProposedAction[]
The proposed actions. An action specifies a contract call.
description
string
A text description for the proposal.
proposalId
uint256
The ID of the newly created proposal.
proposalId
uint256
Number of the proposal.
proposedActions
struct IGovernanceVoting.ProposedAction[]
Array of tuple of proposed actions.
proposalId
uint256
Number of the proposal.
[0]
enum IGovernanceState.ProposalState
Number of proposal state.
proposalId
uint256
Number of the proposal.
voter
address
Address of the voter.
[0]
struct IGovernanceState.Receipt
Tuple of voter receipt.
account
address
The address of the account.
[0]
uint256
[0]
struct IGovernanceState.EnhancedParams
Tuple of the governance parameters.
[0]
string
Human readable string of the name.
count
uint256
The number of proposals.
proposalWrapper
struct IGovernanceState.ProposalWrapper[]
Tuple array of all governance proposals.
[0]
uint256
Number of blocks or seconds.
proposalId
uint256
The number of the proposal.
proposalWrapper
struct IGovernanceState.ProposalWrapper
Tuple wrapper of the proposal and proposed actions tuples.
newProposalThreshold
uint256
The new value for the proposal threshold.
newQuorumThreshold
uint256
The new value for the quorum threshold.
newImplementation
address
Address of the new governance implementation contract.
newStrategy
address
Address of the new strategy contract.
[0]
bool
Bool target address has code.
actions
struct IGovernanceVoting.ProposedAction[]
The proposed actions. An action specifies a contract call.
description
string
A text description for the proposal.
proposalId
uint256
The ID of the newly created proposal.
proposalId
uint256
The ID of the proposal to vote on.
voteType
enum IGovernanceVoting.VoteType
Whether to support, not support or abstain.
proposalId
uint256
The ID of the proposal to vote on.
voteType
enum IGovernanceVoting.VoteType
Whether to support, not support or abstain.
v
uint8
the v field of the signature.
r
bytes32
the r field of the signature.
s
bytes32
the s field of the signature.
proposalId
uint256
The ID of the proposal to execute.
implementation
address
Address of the governance implementation contract.
governanceStrategy
address
Address of the voting strategy.
proposalThreshold
uint256
Number of votes required for creating a new proposal.
quorumThreshold
uint256
Number of votes required for execution.
timeType
enum IGovernanceState.TimeType
Enum of time type (block number or timestamp).
name
string
Human readable string of the name.
governance
address
Address of the new governance.
[0]
struct IRigoblockGovernanceFactory.Parameters
Tuple of the governance parameters.
[0]
bool
Bool target address has code.
newImplementation
address
Address of the new implementation.
s
struct RigoblockGovernanceProxy.ImplementationSlot
Storage slot of the governance implementation.
params
struct IRigoblockGovernanceFactory.Parameters
Tuple of factory parameters.
proposalThreshold
uint256
Number of votes required to make a proposal.
quorumThreshold
uint256
Number of votes required for a proposal to succeed.
proposal
struct IGovernanceState.Proposal
Tuple of the proposal.
minimumQuorum
uint256
Number of votes required for a proposal to pass.
[0]
enum IGovernanceState.ProposalState
Tuple of the proposal state.
account
address
Address to check votes for.
[0]
uint256
Number of seconds of period duration.
startBlockOrTime
uint256
Timestamp when proposal starts.
endBlockOrTime
uint256
Timestamp when voting ends.