Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update imported file name
  • Loading branch information
JulissaDantes committed Nov 10, 2022
commit 5c9bcf04028cc334a9e38982f0d9e96d2ac4ddfd
2 changes: 1 addition & 1 deletion contracts/governance/utils/EIP5805.sol
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ abstract contract EIP5805 is IEIP5805, Context, EIP712 {
*/
function getPastTotalSupply(uint256 timepoint) public view virtual override returns (uint256) {
require(timepoint < clock(), "Checkpoints: invalid past lookup");
// TODO: optimisitc lookup
// TODO: optimistic lookup
return _totalCheckpoints.upperLookup(SafeCast.toUint32(timepoint));
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/governance/utils/IEIP5805.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface IEIP5805 {
event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance);

/**
* @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() external view returns (uint256);

Expand Down
11 changes: 2 additions & 9 deletions contracts/token/ERC20/extensions/ERC20Votes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
pragma solidity ^0.8.0;

import "./draft-ERC20Permit.sol";
import "../../../governance/utils/Votes.sol";
import "../../../governance/utils/EIP5805.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,7 @@ import "../../../governance/utils/Votes.sol";
*
* _Available since v4.2._
*/
abstract contract ERC20Votes is Votes, ERC20Permit {
abstract contract ERC20Votes is EIP5805, ERC20Permit {
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() public view virtual override(ERC20Permit, EIP712) returns (bytes32) {
return super.DOMAIN_SEPARATOR();
Expand Down Expand Up @@ -58,11 +58,4 @@ abstract contract ERC20Votes is Votes, ERC20Permit {
function _maxSupply() internal view virtual returns (uint224) {
return type(uint224).max;
}

function _unsafeAccess(Checkpoint[] storage ckpts, uint256 pos) private pure returns (Checkpoint storage result) {
assembly {
mstore(0, ckpts.slot)
result.slot := add(keccak256(0, 0x20), pos)
}
}
}
2 changes: 1 addition & 1 deletion test/utils/cryptography/EIP712.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ contract('EIP712', function (accounts) {

it('domain separator', async function () {
expect(
await this.eip712.DOMAIN_SEPARATOR(),
await this.eip712.domainSeparator(),
).to.equal(
await domainSeparator(name, version, this.chainId, this.eip712.address),
);
Expand Down