ERC20VotesHarness.sol 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.0;
  3. import {ERC20Votes, ERC20} from "../patched/token/ERC20/extensions/ERC20Votes.sol";
  4. import {EIP712} from "../patched/utils/cryptography/EIP712.sol";
  5. contract ERC20VotesHarness is ERC20Votes {
  6. constructor(string memory name, string memory symbol) ERC20(name, symbol) EIP712(name, "1") {}
  7. function mint(address account, uint256 amount) external {
  8. _mint(account, amount);
  9. }
  10. function burn(address account, uint256 amount) external {
  11. _burn(account, amount);
  12. }
  13. // inspection
  14. function ckptClock(address account, uint32 pos) public view returns (uint32) {
  15. return checkpoints(account, pos)._key;
  16. }
  17. function ckptVotes(address account, uint32 pos) public view returns (uint224) {
  18. return checkpoints(account, pos)._value;
  19. }
  20. function numCheckpointsTotalSupply() public view returns (uint32) {
  21. return _numCheckpointsTotalSupply();
  22. }
  23. function ckptClockTotalSupply(uint32 pos) public view returns (uint32) {
  24. return _checkpointsTotalSupply(pos)._key;
  25. }
  26. function ckptVotesTotalSupply(uint32 pos) public view returns (uint224) {
  27. return _checkpointsTotalSupply(pos)._value;
  28. }
  29. function maxSupply() public view returns (uint224) {
  30. return _maxSupply();
  31. }
  32. }