ERC20PermitMock.sol 726 B

123456789101112131415161718192021222324
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity >=0.6.0 <0.8.0;
  3. import "../drafts/ERC20Permit.sol";
  4. contract ERC20PermitMock is ERC20Permit {
  5. constructor (
  6. string memory name,
  7. string memory symbol,
  8. address initialAccount,
  9. uint256 initialBalance
  10. ) public payable ERC20(name, symbol) ERC20Permit(name) {
  11. _mint(initialAccount, initialBalance);
  12. }
  13. function getChainId() external view returns (uint256 chainId) {
  14. this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  15. // solhint-disable-next-line no-inline-assembly
  16. assembly {
  17. chainId := chainid()
  18. }
  19. }
  20. }