ERCs
ERC-5805 — Voting with delegation
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
| Method | Shape | Purpose |
|---|---|---|
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).