Skip to content
Prev Previous commit
Next Next commit
fix codespell check
  • Loading branch information
JulissaDantes committed Nov 10, 2022
commit b866bcc63fc4f1e73dcd0d6c409ac3beea9d37df
4 changes: 2 additions & 2 deletions contracts/governance/utils/EIP5805.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ abstract contract EIP5805 is IEIP5805, Context, EIP712 {
mapping(address => Counters.Counter) private _nonces;

/**
* @dev Return the current timestamp, this can be overriden to use `block.timestamp` or any other mechanism
* @dev Return the current timestamp, this can be overridden to use `block.timestamp` or any other mechanism
*/
function clock() public view virtual override returns (uint256) {
return block.number;
Expand All @@ -62,7 +62,7 @@ abstract contract EIP5805 is IEIP5805, Context, EIP712 {
*/
function getPastVotes(address account, uint256 timepoint) public view virtual override returns (uint256) {
require(timepoint < clock(), "Checkpoints: invalid past lookup");
// TODO: optimisitc lookup
// TODO: optimistic lookup
return _delegateCheckpoints[account].upperLookup(SafeCast.toUint32(timepoint));
}

Expand Down
15 changes: 12 additions & 3 deletions contracts/token/ERC20/extensions/ERC20Votes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

pragma solidity ^0.8.0;

import "../ERC20.sol";
import "../../../governance/utils/EIP5805.sol";
import "./draft-ERC20Permit.sol";
import "../../../governance/utils/Votes.sol";

/**
* @dev Extension of ERC20 to support Compound-like voting and delegation. This version is more generic than Compound's,
Expand All @@ -21,7 +21,16 @@ import "../../../governance/utils/EIP5805.sol";
*
* _Available since v4.2._
*/
abstract contract ERC20Votes is ERC20, EIP5805 {
abstract contract ERC20Votes is Votes, ERC20Permit {
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() public view virtual override(ERC20Permit, EIP712) returns (bytes32) {
return super.DOMAIN_SEPARATOR();
}

function nonces(address owner) public view virtual override(ERC20Permit, Nonces) returns (uint256) {
return super.nonces(owner);
}

function _mint(address account, uint256 amount) internal virtual override {
require(totalSupply() + amount <= _maxSupply(), "ERC20Votes: total supply risks overflowing votes");
super._mint(account, amount);
Expand Down