Module EspToken

Source
Expand description

§What to re-export, what to hide?

  • export contract struct itself, but try to avoid export instance type (instead, use ::new() to get a handle)
  • avoid exporting xxCall and xxReturn types, they usually can be converted/transmuted from existing struct
  • Event types should be exported
  • structs should be exported and renamed with xxSol suffix to avoid confusion with other rust types
    • see module doc for more explanation on types duplication issue in alloy

Generated by the following Solidity interface…

interface EspToken {
    error AddressEmptyCode(address target);
    error ERC1967InvalidImplementation(address implementation);
    error ERC1967NonPayable();
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
    error ERC20InvalidApprover(address approver);
    error ERC20InvalidReceiver(address receiver);
    error ERC20InvalidSender(address sender);
    error ERC20InvalidSpender(address spender);
    error FailedInnerCall();
    error InvalidInitialization();
    error NotInitializing();
    error OwnableInvalidOwner(address owner);
    error OwnableUnauthorizedAccount(address account);
    error UUPSUnauthorizedCallContext();
    error UUPSUnsupportedProxiableUUID(bytes32 slot);

    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Initialized(uint64 version);
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Upgrade(address implementation);
    event Upgraded(address indexed implementation);

    constructor();

    function UPGRADE_INTERFACE_VERSION() external view returns (string memory);
    function allowance(address owner, address spender) external view returns (uint256);
    function approve(address spender, uint256 value) external returns (bool);
    function balanceOf(address account) external view returns (uint256);
    function decimals() external view returns (uint8);
    function getVersion() external pure returns (uint8 majorVersion, uint8 minorVersion, uint8 patchVersion);
    function initialize(address _owner, address _initialGrantRecipient) external;
    function name() external view returns (string memory);
    function owner() external view returns (address);
    function proxiableUUID() external view returns (bytes32);
    function renounceOwnership() external;
    function symbol() external view returns (string memory);
    function totalSupply() external view returns (uint256);
    function transfer(address to, uint256 value) external returns (bool);
    function transferFrom(address from, address to, uint256 value) external returns (bool);
    function transferOwnership(address newOwner) external;
    function upgradeToAndCall(address newImplementation, bytes memory data) external payable;
}

…which was generated by the following JSON ABI:

[
  {
    "type": "constructor",
    "inputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "UPGRADE_INTERFACE_VERSION",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "string",
        "internalType": "string"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "allowance",
    "inputs": [
      {
        "name": "owner",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "spender",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "approve",
    "inputs": [
      {
        "name": "spender",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "value",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "balanceOf",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "decimals",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getVersion",
    "inputs": [],
    "outputs": [
      {
        "name": "majorVersion",
        "type": "uint8",
        "internalType": "uint8"
      },
      {
        "name": "minorVersion",
        "type": "uint8",
        "internalType": "uint8"
      },
      {
        "name": "patchVersion",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "stateMutability": "pure"
  },
  {
    "type": "function",
    "name": "initialize",
    "inputs": [
      {
        "name": "_owner",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_initialGrantRecipient",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "name",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "string",
        "internalType": "string"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "owner",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "proxiableUUID",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "renounceOwnership",
    "inputs": [],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "symbol",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "string",
        "internalType": "string"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "totalSupply",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "transfer",
    "inputs": [
      {
        "name": "to",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "value",
        "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": "value",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "transferOwnership",
    "inputs": [
      {
        "name": "newOwner",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "upgradeToAndCall",
    "inputs": [
      {
        "name": "newImplementation",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "data",
        "type": "bytes",
        "internalType": "bytes"
      }
    ],
    "outputs": [],
    "stateMutability": "payable"
  },
  {
    "type": "event",
    "name": "Approval",
    "inputs": [
      {
        "name": "owner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "spender",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "value",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "Initialized",
    "inputs": [
      {
        "name": "version",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "OwnershipTransferred",
    "inputs": [
      {
        "name": "previousOwner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "newOwner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "Transfer",
    "inputs": [
      {
        "name": "from",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "to",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "value",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "Upgrade",
    "inputs": [
      {
        "name": "implementation",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "Upgraded",
    "inputs": [
      {
        "name": "implementation",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "error",
    "name": "AddressEmptyCode",
    "inputs": [
      {
        "name": "target",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "ERC1967InvalidImplementation",
    "inputs": [
      {
        "name": "implementation",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "ERC1967NonPayable",
    "inputs": []
  },
  {
    "type": "error",
    "name": "ERC20InsufficientAllowance",
    "inputs": [
      {
        "name": "spender",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "allowance",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "needed",
        "type": "uint256",
        "internalType": "uint256"
      }
    ]
  },
  {
    "type": "error",
    "name": "ERC20InsufficientBalance",
    "inputs": [
      {
        "name": "sender",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "balance",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "needed",
        "type": "uint256",
        "internalType": "uint256"
      }
    ]
  },
  {
    "type": "error",
    "name": "ERC20InvalidApprover",
    "inputs": [
      {
        "name": "approver",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "ERC20InvalidReceiver",
    "inputs": [
      {
        "name": "receiver",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "ERC20InvalidSender",
    "inputs": [
      {
        "name": "sender",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "ERC20InvalidSpender",
    "inputs": [
      {
        "name": "spender",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "FailedInnerCall",
    "inputs": []
  },
  {
    "type": "error",
    "name": "InvalidInitialization",
    "inputs": []
  },
  {
    "type": "error",
    "name": "NotInitializing",
    "inputs": []
  },
  {
    "type": "error",
    "name": "OwnableInvalidOwner",
    "inputs": [
      {
        "name": "owner",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "OwnableUnauthorizedAccount",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "UUPSUnauthorizedCallContext",
    "inputs": []
  },
  {
    "type": "error",
    "name": "UUPSUnsupportedProxiableUUID",
    "inputs": [
      {
        "name": "slot",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ]
  }
]

Structs§

AddressEmptyCode
Custom error with signature AddressEmptyCode(address) and selector 0x9996b315. solidity error AddressEmptyCode(address target);
Approval
Event with signature Approval(address,address,uint256) and selector 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. solidity event Approval(address indexed owner, address indexed spender, uint256 value);
ERC20InsufficientAllowance
Custom error with signature ERC20InsufficientAllowance(address,uint256,uint256) and selector 0xfb8f41b2. solidity error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
ERC20InsufficientBalance
Custom error with signature ERC20InsufficientBalance(address,uint256,uint256) and selector 0xe450d38c. solidity error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
ERC20InvalidApprover
Custom error with signature ERC20InvalidApprover(address) and selector 0xe602df05. solidity error ERC20InvalidApprover(address approver);
ERC20InvalidReceiver
Custom error with signature ERC20InvalidReceiver(address) and selector 0xec442f05. solidity error ERC20InvalidReceiver(address receiver);
ERC20InvalidSender
Custom error with signature ERC20InvalidSender(address) and selector 0x96c6fd1e. solidity error ERC20InvalidSender(address sender);
ERC20InvalidSpender
Custom error with signature ERC20InvalidSpender(address) and selector 0x94280d62. solidity error ERC20InvalidSpender(address spender);
ERC1967InvalidImplementation
Custom error with signature ERC1967InvalidImplementation(address) and selector 0x4c9c8ce3. solidity error ERC1967InvalidImplementation(address implementation);
ERC1967NonPayable
Custom error with signature ERC1967NonPayable() and selector 0xb398979f. solidity error ERC1967NonPayable();
EspTokenInstance
A EspToken instance.
FailedInnerCall
Custom error with signature FailedInnerCall() and selector 0x1425ea42. solidity error FailedInnerCall();
Initialized
Event with signature Initialized(uint64) and selector 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. solidity event Initialized(uint64 version);
InvalidInitialization
Custom error with signature InvalidInitialization() and selector 0xf92ee8a9. solidity error InvalidInitialization();
NotInitializing
Custom error with signature NotInitializing() and selector 0xd7e6bcf8. solidity error NotInitializing();
OwnableInvalidOwner
Custom error with signature OwnableInvalidOwner(address) and selector 0x1e4fbdf7. solidity error OwnableInvalidOwner(address owner);
OwnableUnauthorizedAccount
Custom error with signature OwnableUnauthorizedAccount(address) and selector 0x118cdaa7. solidity error OwnableUnauthorizedAccount(address account);
OwnershipTransferred
Event with signature OwnershipTransferred(address,address) and selector 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. solidity event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
Transfer
Event with signature Transfer(address,address,uint256) and selector 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. solidity event Transfer(address indexed from, address indexed to, uint256 value);
UPGRADE_INTERFACE_VERSIONCall
Function with signature UPGRADE_INTERFACE_VERSION() and selector 0xad3cb1cc. solidity function UPGRADE_INTERFACE_VERSION() external view returns (string memory);
UPGRADE_INTERFACE_VERSIONReturn
Container type for the return parameters of the UPGRADE_INTERFACE_VERSION() function.
UUPSUnauthorizedCallContext
Custom error with signature UUPSUnauthorizedCallContext() and selector 0xe07c8dba. solidity error UUPSUnauthorizedCallContext();
UUPSUnsupportedProxiableUUID
Custom error with signature UUPSUnsupportedProxiableUUID(bytes32) and selector 0xaa1d49a4. solidity error UUPSUnsupportedProxiableUUID(bytes32 slot);
Upgrade
Event with signature Upgrade(address) and selector 0xf78721226efe9a1bb678189a16d1554928b9f2192e2cb93eeda83b79fa40007d. solidity event Upgrade(address implementation);
Upgraded
Event with signature Upgraded(address) and selector 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. solidity event Upgraded(address indexed implementation);
allowanceCall
Function with signature allowance(address,address) and selector 0xdd62ed3e. solidity function allowance(address owner, address spender) external view returns (uint256);
allowanceReturn
Container type for the return parameters of the allowance(address,address) function.
approveCall
Function with signature approve(address,uint256) and selector 0x095ea7b3. solidity function approve(address spender, uint256 value) external returns (bool);
approveReturn
Container type for the return parameters of the approve(address,uint256) function.
balanceOfCall
Function with signature balanceOf(address) and selector 0x70a08231. solidity function balanceOf(address account) external view returns (uint256);
balanceOfReturn
Container type for the return parameters of the balanceOf(address) function.
constructorCall
Constructor`. solidity constructor();
decimalsCall
Function with signature decimals() and selector 0x313ce567. solidity function decimals() external view returns (uint8);
decimalsReturn
Container type for the return parameters of the decimals() function.
getVersionCall
Function with signature getVersion() and selector 0x0d8e6e2c. solidity function getVersion() external pure returns (uint8 majorVersion, uint8 minorVersion, uint8 patchVersion);
getVersionReturn
Container type for the return parameters of the getVersion() function.
initializeCall
Function with signature initialize(address,address) and selector 0x485cc955. solidity function initialize(address _owner, address _initialGrantRecipient) external;
initializeReturn
Container type for the return parameters of the initialize(address,address) function.
nameCall
Function with signature name() and selector 0x06fdde03. solidity function name() external view returns (string memory);
nameReturn
Container type for the return parameters of the name() function.
ownerCall
Function with signature owner() and selector 0x8da5cb5b. solidity function owner() external view returns (address);
ownerReturn
Container type for the return parameters of the owner() function.
proxiableUUIDCall
Function with signature proxiableUUID() and selector 0x52d1902d. solidity function proxiableUUID() external view returns (bytes32);
proxiableUUIDReturn
Container type for the return parameters of the proxiableUUID() function.
renounceOwnershipCall
Function with signature renounceOwnership() and selector 0x715018a6. solidity function renounceOwnership() external;
renounceOwnershipReturn
Container type for the return parameters of the renounceOwnership() function.
symbolCall
Function with signature symbol() and selector 0x95d89b41. solidity function symbol() external view returns (string memory);
symbolReturn
Container type for the return parameters of the symbol() function.
totalSupplyCall
Function with signature totalSupply() and selector 0x18160ddd. solidity function totalSupply() external view returns (uint256);
totalSupplyReturn
Container type for the return parameters of the totalSupply() function.
transferCall
Function with signature transfer(address,uint256) and selector 0xa9059cbb. solidity function transfer(address to, uint256 value) external returns (bool);
transferFromCall
Function with signature transferFrom(address,address,uint256) and selector 0x23b872dd. solidity function transferFrom(address from, address to, uint256 value) external returns (bool);
transferFromReturn
Container type for the return parameters of the transferFrom(address,address,uint256) function.
transferOwnershipCall
Function with signature transferOwnership(address) and selector 0xf2fde38b. solidity function transferOwnership(address newOwner) external;
transferOwnershipReturn
Container type for the return parameters of the transferOwnership(address) function.
transferReturn
Container type for the return parameters of the transfer(address,uint256) function.
upgradeToAndCallCall
Function with signature upgradeToAndCall(address,bytes) and selector 0x4f1ef286. solidity function upgradeToAndCall(address newImplementation, bytes memory data) external payable;
upgradeToAndCallReturn
Container type for the return parameters of the upgradeToAndCall(address,bytes) function.

Enums§

EspTokenCalls
Container for all the EspToken function calls.
EspTokenErrors
Container for all the EspToken custom errors.
EspTokenEvents
Container for all the EspToken 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 EspToken contract instance.