ERCs

ERC-5805 — Voting with delegation

eips.ethereum.org/EIPS/eip-5805

A delegation API for governance tokens. Token holders can delegate their voting power to another address; voting weight is read at a snapshot block (or timestamp, see ERC-6372).

import {
  delegate,
  delegates,
  delegate_by_sig,
  get_votes,
  get_past_votes,
  get_past_total_supply,
} from "@ethernauta/erc/5805";

Surface

MethodShapePurpose
delegates({ account })Callable<Address>Current delegate.
delegate({ delegatee })Signable<Hash32>Set delegation.
delegate_by_sig({ delegatee, nonce, expiry, v, r, s })Signable<Hash32>Gasless delegation.
get_votes({ account })Callable<Uint256>Current voting power.
get_past_votes({ account, timepoint })Callable<Uint256>Historical voting power.
get_past_total_supply({ timepoint })Callable<Uint256>Historical supply.

timepoint is either a block number or a unix timestamp, depending on the contract’s clock_mode (ERC-6372).

See also

  • ERC-6372 — block vs time mode.
  • EIP-712delegate_by_sig uses typed-data.