Skip to content

Consider removing IVotingToken in favor of IERC5805 #80

@davidlaprade

Description

@davidlaprade

IVotingToken is custom to this repo and is a strict subset of IERC5805. The two interfaces are, effectively, the following:

interface IVotingToken {
  function clock() external view returns (uint48);
  function transfer(address to, uint256 amount) external returns (bool);
  function transferFrom(address from, address to, uint256 amount) external returns (bool);
  function delegate(address delegatee) external;
  function getPastVotes(address account, uint256 blockNumber) external view returns (uint256);
}

vs

interface IERC5805 {
    error VotesExpiredSignature(uint256 expiry);
    event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
    event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);
    function getVotes(address account) external view returns (uint256);
    function getPastVotes(address account, uint256 timepoint) external view returns (uint256);
    function getPastTotalSupply(uint256 timepoint) external view returns (uint256);
    function delegates(address account) external view returns (address);
    function delegate(address delegatee) external;
    function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;
    function clock() external view returns (uint48);
    function CLOCK_MODE() external view returns (string memory);
}

Using IVotingToken gives us maximal compatibility, whereas using IERC5805 probably makes things simpler/more obvious for integrators (since you get it by default with ERC20Votes).

Ultimately it's probably not a huge difference. The number of people who have IVotingToken-compatible tokens that aren't also IERC5805-compatible is likely to be pretty small. But worth considering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions