ERC20VotesTimestampHarness.sol 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.0;
  3. import "../patched/token/ERC20/extensions/ERC20Votes.sol";
  4. contract ERC20VotesTimestampHarness is ERC20Votes {
  5. constructor(string memory name, string memory symbol) ERC20(name, symbol) ERC20Permit(name) {}
  6. function mint(address account, uint256 amount) external {
  7. _mint(account, amount);
  8. }
  9. function burn(address account, uint256 amount) external {
  10. _burn(account, amount);
  11. }
  12. // inspection
  13. function ckptFromBlock(address account, uint32 pos) public view returns (uint32) {
  14. return checkpoints(account, pos).fromBlock;
  15. }
  16. function ckptVotes(address account, uint32 pos) public view returns (uint224) {
  17. return checkpoints(account, pos).votes;
  18. }
  19. function maxSupply() public view returns (uint224) {
  20. return _maxSupply();
  21. }
  22. // clock
  23. function clock() public view override returns (uint48) {
  24. return uint48(block.timestamp);
  25. }
  26. // solhint-disable-next-line func-name-mixedcase
  27. function CLOCK_MODE() public view virtual override returns (string memory) {
  28. return "mode=timestamp";
  29. }
  30. }