API
The api of governance module
esLBR
Lybra governance token
Key Events
Event | Description |
---|---|
| An event thats emitted when an account changes its delegate. |
| An event thats emitted when a delegate account’s vote balance changes. |
Read-Only Functions
Function | Description |
---|---|
| Get the |
| Get the address |
| Retrieve the Requirements:
|
| Retrieve the number of votes for Requirements:
|
getVotes(address account) | Gets the current votes balance for |
State-Changing Functions
Function | Description |
---|---|
delegate(address delegatee) | Delegate votes from the sender to |
delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) | Delegate votes from the signatory to the delegatee. This method has the same purpose as Delegate but it instead enables offline signatures to participate in Lybra governance vote delegation. |
Lybra Governance Contract
LybraGovernance.sol
Key Events
Event | Description |
---|---|
| An event emitted when a new proposal is created. |
| An event emitted when a vote has been cast on a proposal. |
VoteCastWithParams(voter, proposalId, support, weight, reason, params) | An event emitted when a vote has been cast with params on a proposal. |
| An event emitted when a proposal has been canceled. |
| An event emitted when a proposal has been queued in the Timelock. |
| An event emitted when a proposal has been executed in the Timelock. |
Read-Only Functions
Function | Description |
---|---|
| Clock used for flagging checkpoints. |
| Description of the clock. |
| A description of the possible There are 2 standard keys:
If a counting module makes use of encoded
|
| Voting power of an |
| Voting power of an |
| Ballot receipt record for a voter.
|
| The proposal id is produced by hashing the ABI encoded Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the same proposal (with same operation and same description) will have the same id if submitted on multiple governors across multiple networks. This also means that in order to execute the same operation twice (on the same governor) the proposer will have to change the description in order to avoid proposal id conflicts. |
| Returns whether |
| |
| Timepoint at which votes close. If using block number, votes close at the end of this block, so it is possible to cast a vote during this block. |
| Public accessor to check the eta of a queued proposal |
proposalProposer | The account that created a proposal. |
| Timepoint used to retrieve user’s votes and quorum. If using block number , the snapshot is performed at the end of this block. Hence, voting for this proposal starts at the beginning of the following block. |
| The number of votes required in order for a voter to become a proposer. |
| Minimum number of cast voted required for a proposal to be successful. |
| Current state of a proposal. |
| Public accessor to check the address of the timelock |
| Delay, between the proposal is created and the vote starts. The unit this duration is expressed in depends on the clock (see EIP-6372) this contract uses. This can be increased to leave time for users to buy voting power, or delegate it, before the voting of a proposal starts. |
| Delay between the vote start and vote end. The unit this duration is expressed in depends on the clock (see EIP-6372) this contract uses. |
State-Changing Functions
Function | Description |
---|---|
| Cast a vote Emits a |
| Cast a vote using the user’s cryptographic signature. Emits a |
| Cast a vote with a reason Emits a |
| Cast a vote with a reason and additional encoded parameters Emits a |
| Cast a vote with a reason and additional encoded parameters using the user’s cryptographic signature. Emits a |
| Create a new proposal. Vote start after a delay specified by Emits a |
| Function to queue a proposal to the timelock. |
| checkOnlyRole(keccak256("TIMELOCK")). Execute a successful proposal. This requires the quorum to be reached, the vote to be successful, and the deadline to be reached. Emits a Note: some module can modify the requirements for execution, for example by adding an additional timelock. |
| Cancel a proposal. A proposal is cancellable by the proposer, but only while it is Pending state, i.e. before the vote starts. Emits a |
updateTimelock | Public endpoint to update the underlying timelock instance. Restricted to the timelock itself, so updates must be proposed, scheduled, and executed through governance proposals. |
Timelock
GovernanceTimelock.sol inherit TimelockController.sol
Key Events
Event | Description |
---|---|
| Emitted when a call is scheduled as part of operation |
| Emitted when a call is performed as part of operation |
| Emitted when new proposal is scheduled with non-zero salt. |
| Emitted when operation |
MinDelayChange | Emitted when the minimum delay for future operations is modified. |
| Emitted when
|
| Emitted when
|
| Emitted when
|
Read-Only Functions
Function | Description |
---|---|
| Returns whether an id correspond to a registered operation. This includes both Pending, Ready and Done operations. |
| Returns whether an operation is pending or not. Note that a "pending" operation may also be "ready". |
| Returns whether an operation is ready for execution. Note that a "ready" operation is also "pending". |
| Returns whether an operation is done or not. |
| Returns the timestamp at which an operation becomes ready (0 for unset operations, 1 for done operations). |
| Returns the minimum delay for an operation to become valid. This value can be changed by executing an operation that calls |
| Returns the identifier of an operation containing a single transaction. |
| Returns the identifier of an operation containing a batch of transactions. |
| Returns |
| Revert with a standard message if account is missing role. The format of the revert reason is given by the following regular expression: /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ |
| Revert with a standard message if account is missing role. The format of the revert reason is given by the following regular expression: /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ |
| Returns the admin role that controls To change a role’s admin, use |
State-Changing Functions
Function | Description |
---|---|
| Cancel an operation. Requirements:
|
| Execute an (ready) operation containing a single transaction. Emits a Requirements:
|
| Execute an (ready) operation containing a batch of transactions. Emits one Requirements:
|
| Grants If Requirements:
|
| Revokes If Requirements:
|
| Revokes Roles are often managed via If the calling account had been granted Requirements:
|
| Schedule an operation containing a single transaction. Emits Requirements:
|
| Schedule an operation containing a batch of transactions. Emits Requirements:
|
| Changes the minimum timelock duration for future operations. Emits a Requirements:
|
Last updated