Module MockERC20

Module MockERC20 

Source
Expand description

Generated by the following Solidity interface…

interface MockERC20 {
    error AllowanceOverflow();
    error AllowanceUnderflow();
    error InsufficientAllowance();
    error InsufficientBalance();
    error InvalidPermit();
    error Permit2AllowanceIsFixedAtInfinity();
    error PermitExpired();
    error TotalSupplyOverflow();

    event Approval(address indexed owner, address indexed spender, uint256 amount);
    event Transfer(address indexed from, address indexed to, uint256 amount);

    constructor(string name_, string symbol_, uint8 decimals_);

    function DOMAIN_SEPARATOR() external view returns (bytes32 result);
    function allowance(address owner, address spender) external view returns (uint256 result);
    function approve(address spender, uint256 amount) external returns (bool);
    function balanceOf(address owner) external view returns (uint256 result);
    function burn(address from, uint256 value) external;
    function decimals() external view returns (uint8);
    function directSpendAllowance(address owner, address spender, uint256 amount) external;
    function directTransfer(address from, address to, uint256 amount) external;
    function mint(address to, uint256 value) external;
    function name() external view returns (string memory);
    function nonces(address owner) external view returns (uint256 result);
    function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;
    function symbol() external view returns (string memory);
    function totalSupply() external view returns (uint256 result);
    function transfer(address to, uint256 amount) external returns (bool);
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

…which was generated by the following JSON ABI:

[
  {
    "type": "constructor",
    "inputs": [
      {
        "name": "name_",
        "type": "string",
        "internalType": "string"
      },
      {
        "name": "symbol_",
        "type": "string",
        "internalType": "string"
      },
      {
        "name": "decimals_",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "DOMAIN_SEPARATOR",
    "inputs": [],
    "outputs": [
      {
        "name": "result",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "allowance",
    "inputs": [
      {
        "name": "owner",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "spender",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "result",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "approve",
    "inputs": [
      {
        "name": "spender",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "amount",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "balanceOf",
    "inputs": [
      {
        "name": "owner",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "result",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "burn",
    "inputs": [
      {
        "name": "from",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "value",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "decimals",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "directSpendAllowance",
    "inputs": [
      {
        "name": "owner",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "spender",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "amount",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "directTransfer",
    "inputs": [
      {
        "name": "from",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "to",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "amount",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "mint",
    "inputs": [
      {
        "name": "to",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "value",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "name",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "string",
        "internalType": "string"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "nonces",
    "inputs": [
      {
        "name": "owner",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "result",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "permit",
    "inputs": [
      {
        "name": "owner",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "spender",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "value",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "deadline",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "v",
        "type": "uint8",
        "internalType": "uint8"
      },
      {
        "name": "r",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "s",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "symbol",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "string",
        "internalType": "string"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "totalSupply",
    "inputs": [],
    "outputs": [
      {
        "name": "result",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "transfer",
    "inputs": [
      {
        "name": "to",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "amount",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "transferFrom",
    "inputs": [
      {
        "name": "from",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "to",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "amount",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "event",
    "name": "Approval",
    "inputs": [
      {
        "name": "owner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "spender",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "amount",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "Transfer",
    "inputs": [
      {
        "name": "from",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "to",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "amount",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      }
    ],
    "anonymous": false
  },
  {
    "type": "error",
    "name": "AllowanceOverflow",
    "inputs": []
  },
  {
    "type": "error",
    "name": "AllowanceUnderflow",
    "inputs": []
  },
  {
    "type": "error",
    "name": "InsufficientAllowance",
    "inputs": []
  },
  {
    "type": "error",
    "name": "InsufficientBalance",
    "inputs": []
  },
  {
    "type": "error",
    "name": "InvalidPermit",
    "inputs": []
  },
  {
    "type": "error",
    "name": "Permit2AllowanceIsFixedAtInfinity",
    "inputs": []
  },
  {
    "type": "error",
    "name": "PermitExpired",
    "inputs": []
  },
  {
    "type": "error",
    "name": "TotalSupplyOverflow",
    "inputs": []
  }
]

Structs§

AllowanceOverflow
Custom error with signature AllowanceOverflow() and selector 0xf9067066.
AllowanceUnderflow
Custom error with signature AllowanceUnderflow() and selector 0x8301ab38.
Approval
Event with signature Approval(address,address,uint256) and selector 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925.
DOMAIN_SEPARATORCall
Function with signature DOMAIN_SEPARATOR() and selector 0x3644e515.
DOMAIN_SEPARATORReturn
Container type for the return parameters of the DOMAIN_SEPARATOR() function.
InsufficientAllowance
Custom error with signature InsufficientAllowance() and selector 0x13be252b.
InsufficientBalance
Custom error with signature InsufficientBalance() and selector 0xf4d678b8.
InvalidPermit
Custom error with signature InvalidPermit() and selector 0xddafbaef.
MockERC20Instance
A MockERC20 instance.
Permit2AllowanceIsFixedAtInfinity
Custom error with signature Permit2AllowanceIsFixedAtInfinity() and selector 0x3f68539a.
PermitExpired
Custom error with signature PermitExpired() and selector 0x1a15a3cc.
TotalSupplyOverflow
Custom error with signature TotalSupplyOverflow() and selector 0xe5cfe957.
Transfer
Event with signature Transfer(address,address,uint256) and selector 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef.
allowanceCall
Function with signature allowance(address,address) and selector 0xdd62ed3e.
allowanceReturn
Container type for the return parameters of the allowance(address,address) function.
approveCall
Function with signature approve(address,uint256) and selector 0x095ea7b3.
approveReturn
Container type for the return parameters of the approve(address,uint256) function.
balanceOfCall
Function with signature balanceOf(address) and selector 0x70a08231.
balanceOfReturn
Container type for the return parameters of the balanceOf(address) function.
burnCall
Function with signature burn(address,uint256) and selector 0x9dc29fac.
burnReturn
Container type for the return parameters of the burn(address,uint256) function.
constructorCall
Constructor`.
decimalsCall
Function with signature decimals() and selector 0x313ce567.
decimalsReturn
Container type for the return parameters of the decimals() function.
directSpendAllowanceCall
Function with signature directSpendAllowance(address,address,uint256) and selector 0xd30ed3b3.
directSpendAllowanceReturn
Container type for the return parameters of the directSpendAllowance(address,address,uint256) function.
directTransferCall
Function with signature directTransfer(address,address,uint256) and selector 0xf83d1791.
directTransferReturn
Container type for the return parameters of the directTransfer(address,address,uint256) function.
mintCall
Function with signature mint(address,uint256) and selector 0x40c10f19.
mintReturn
Container type for the return parameters of the mint(address,uint256) function.
nameCall
Function with signature name() and selector 0x06fdde03.
nameReturn
Container type for the return parameters of the name() function.
noncesCall
Function with signature nonces(address) and selector 0x7ecebe00.
noncesReturn
Container type for the return parameters of the nonces(address) function.
permitCall
Function with signature permit(address,address,uint256,uint256,uint8,bytes32,bytes32) and selector 0xd505accf.
permitReturn
Container type for the return parameters of the permit(address,address,uint256,uint256,uint8,bytes32,bytes32) function.
symbolCall
Function with signature symbol() and selector 0x95d89b41.
symbolReturn
Container type for the return parameters of the symbol() function.
totalSupplyCall
Function with signature totalSupply() and selector 0x18160ddd.
totalSupplyReturn
Container type for the return parameters of the totalSupply() function.
transferCall
Function with signature transfer(address,uint256) and selector 0xa9059cbb.
transferFromCall
Function with signature transferFrom(address,address,uint256) and selector 0x23b872dd.
transferFromReturn
Container type for the return parameters of the transferFrom(address,address,uint256) function.
transferReturn
Container type for the return parameters of the transfer(address,uint256) function.

Enums§

MockERC20Calls
Container for all the MockERC20 function calls.
MockERC20Errors
Container for all the MockERC20 custom errors.
MockERC20Events
Container for all the MockERC20 events.

Statics§

BYTECODE
The creation / init bytecode of the contract.
DEPLOYED_BYTECODE
The runtime bytecode of the contract, as deployed on the network.

Functions§

deploy
Deploys this contract using the given provider and constructor arguments, if any.
deploy_builder
Creates a RawCallBuilder for deploying this contract using the given provider and constructor arguments, if any.
new
Creates a new wrapper around an on-chain MockERC20 contract instance.