Token

esLBR

esLBR is an ERC-20 token that allows the owner to delegate voting rights to any address, including their own address. Changes to the owner’s token balance automatically adjust the voting rights of the delegate.

esLBR is escrowed LBR. It has the same value as LBR and is subject to the total supply of LBR. esLBR cannot be traded or transferred but has voting rights and can share in protocol earnings. Mining rewards are the primary source of esLBR.

esLBR holders can convert their esLBR toLBR through a vesting process. Once the process is started, esLBR will be linearly converted to LBR over a period of 90 days.

ERC20Votes

The voting power of each account in our governance setup will be determined by an ERC20 token. The token has to implement the ERC20Votes extension. This extension will keep track of historical balances so that voting power is retrieved from past snapshots rather than current balance, which is an important protection that prevents double voting.

Delegate

Delegate votes from the sender to the delegatee. Users can delegate to 1 address at a time, and the number of votes added to the delegatee’s vote count is equivalent to the balance of esLBR in the user’s account. Votes are delegated from the current block and onward, until the sender delegates again.

function delegate(address delegatee)
  • delegatee: The address to which msg.sender wishes to delegate their votes to.

  • RETURN: No return, reverts on error.

  • Emits a DelegateChanged or DelegateVotesChanged depending on the signer and delegatee.

Delegate By Signature

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. For more details on how to create an offline signature, review EIP-712.

function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s)
  • delegatee: The address in which the sender wishes to delegate their votes to.

  • nonce: The contract state required to match the signature. This can be retrieved from the contract’s public nonces mapping.

  • expiry: The time at which to expire the signature. A block timestamp as seconds since the unix epoch (uint).

  • v: The recovery byte of the signature.

  • r: Half of the ECDSA signature pair.

  • s: Half of the ECDSA signature pair.

  • RETURN: No return, reverts on error.

  • Emits a DelegateChanged or DelegateVotesChanged depending on the signer and delegatee.

Get Votes

Gets the current votes balance for an account.

function getVotes(address account) returns (uint256)
  • account: Address of the account in which to retrieve the number of votes.

  • RETURN: The number of votes (integer).

Get Past Votes

Retrieve the number of votes for account at the end of timepoint.

function getPastVotes(address account, uint256 timepoint) returns (uint256)
  • account: Address of the account in which to retrieve the prior number of votes.

  • timepoint: The block number(must be in the past) at which to retrieve the prior number of votes.

  • RETURN: The number of votes at the end of timepoint.

Get Past Total Supply

Retrieve the totalSupply at the end of timepoint. Note, this value is the sum of all balances. It is NOT the sum of all the delegated votes!

function getPastTotalSupply(uint256 timepoint) returns (uint256)
  • timepoint: The block number(must be in the past) at which to retrieve the prior number of votes.

  • RETURN: The total supply of token at the end of timepoint.

Last updated