ERC20VotesBlocknumberHarness.sol 870 B

1234567891011121314151617181920212223242526272829
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.0;
  3. import "../patched/token/ERC20/extensions/ERC20Votes.sol";
  4. contract ERC20VotesBlocknumberHarness 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. }