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
andxxReturn
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§
- Address
Empty Code - Custom error with signature
AddressEmptyCode(address)
and selector0x9996b315
.solidity error AddressEmptyCode(address target);
- Approval
- Event with signature
Approval(address,address,uint256)
and selector0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925
.solidity event Approval(address indexed owner, address indexed spender, uint256 value);
- ERC20
Insufficient Allowance - Custom error with signature
ERC20InsufficientAllowance(address,uint256,uint256)
and selector0xfb8f41b2
.solidity error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
- ERC20
Insufficient Balance - Custom error with signature
ERC20InsufficientBalance(address,uint256,uint256)
and selector0xe450d38c
.solidity error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
- ERC20
Invalid Approver - Custom error with signature
ERC20InvalidApprover(address)
and selector0xe602df05
.solidity error ERC20InvalidApprover(address approver);
- ERC20
Invalid Receiver - Custom error with signature
ERC20InvalidReceiver(address)
and selector0xec442f05
.solidity error ERC20InvalidReceiver(address receiver);
- ERC20
Invalid Sender - Custom error with signature
ERC20InvalidSender(address)
and selector0x96c6fd1e
.solidity error ERC20InvalidSender(address sender);
- ERC20
Invalid Spender - Custom error with signature
ERC20InvalidSpender(address)
and selector0x94280d62
.solidity error ERC20InvalidSpender(address spender);
- ERC1967
Invalid Implementation - Custom error with signature
ERC1967InvalidImplementation(address)
and selector0x4c9c8ce3
.solidity error ERC1967InvalidImplementation(address implementation);
- ERC1967
NonPayable - Custom error with signature
ERC1967NonPayable()
and selector0xb398979f
.solidity error ERC1967NonPayable();
- EspToken
Instance - A
EspToken
instance. - Failed
Inner Call - Custom error with signature
FailedInnerCall()
and selector0x1425ea42
.solidity error FailedInnerCall();
- Initialized
- Event with signature
Initialized(uint64)
and selector0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2
.solidity event Initialized(uint64 version);
- Invalid
Initialization - Custom error with signature
InvalidInitialization()
and selector0xf92ee8a9
.solidity error InvalidInitialization();
- NotInitializing
- Custom error with signature
NotInitializing()
and selector0xd7e6bcf8
.solidity error NotInitializing();
- Ownable
Invalid Owner - Custom error with signature
OwnableInvalidOwner(address)
and selector0x1e4fbdf7
.solidity error OwnableInvalidOwner(address owner);
- Ownable
Unauthorized Account - Custom error with signature
OwnableUnauthorizedAccount(address)
and selector0x118cdaa7
.solidity error OwnableUnauthorizedAccount(address account);
- Ownership
Transferred - Event with signature
OwnershipTransferred(address,address)
and selector0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0
.solidity event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
- Transfer
- Event with signature
Transfer(address,address,uint256)
and selector0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
.solidity event Transfer(address indexed from, address indexed to, uint256 value);
- UPGRADE_
INTERFACE_ VERSION Call - Function with signature
UPGRADE_INTERFACE_VERSION()
and selector0xad3cb1cc
.solidity function UPGRADE_INTERFACE_VERSION() external view returns (string memory);
- UPGRADE_
INTERFACE_ VERSION Return - Container type for the return parameters of the
UPGRADE_INTERFACE_VERSION()
function. - UUPS
Unauthorized Call Context - Custom error with signature
UUPSUnauthorizedCallContext()
and selector0xe07c8dba
.solidity error UUPSUnauthorizedCallContext();
- UUPS
Unsupported ProxiableUUID - Custom error with signature
UUPSUnsupportedProxiableUUID(bytes32)
and selector0xaa1d49a4
.solidity error UUPSUnsupportedProxiableUUID(bytes32 slot);
- Upgrade
- Event with signature
Upgrade(address)
and selector0xf78721226efe9a1bb678189a16d1554928b9f2192e2cb93eeda83b79fa40007d
.solidity event Upgrade(address implementation);
- Upgraded
- Event with signature
Upgraded(address)
and selector0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b
.solidity event Upgraded(address indexed implementation);
- allowance
Call - Function with signature
allowance(address,address)
and selector0xdd62ed3e
.solidity function allowance(address owner, address spender) external view returns (uint256);
- allowance
Return - Container type for the return parameters of the
allowance(address,address)
function. - approve
Call - Function with signature
approve(address,uint256)
and selector0x095ea7b3
.solidity function approve(address spender, uint256 value) external returns (bool);
- approve
Return - Container type for the return parameters of the
approve(address,uint256)
function. - balance
OfCall - Function with signature
balanceOf(address)
and selector0x70a08231
.solidity function balanceOf(address account) external view returns (uint256);
- balance
OfReturn - Container type for the return parameters of the
balanceOf(address)
function. - constructor
Call - Constructor`.
solidity constructor();
- decimals
Call - Function with signature
decimals()
and selector0x313ce567
.solidity function decimals() external view returns (uint8);
- decimals
Return - Container type for the return parameters of the
decimals()
function. - getVersion
Call - Function with signature
getVersion()
and selector0x0d8e6e2c
.solidity function getVersion() external pure returns (uint8 majorVersion, uint8 minorVersion, uint8 patchVersion);
- getVersion
Return - Container type for the return parameters of the
getVersion()
function. - initialize
Call - Function with signature
initialize(address,address)
and selector0x485cc955
.solidity function initialize(address _owner, address _initialGrantRecipient) external;
- initialize
Return - Container type for the return parameters of the
initialize(address,address)
function. - name
Call - Function with signature
name()
and selector0x06fdde03
.solidity function name() external view returns (string memory);
- name
Return - Container type for the return parameters of the
name()
function. - owner
Call - Function with signature
owner()
and selector0x8da5cb5b
.solidity function owner() external view returns (address);
- owner
Return - Container type for the return parameters of the
owner()
function. - proxiableUUID
Call - Function with signature
proxiableUUID()
and selector0x52d1902d
.solidity function proxiableUUID() external view returns (bytes32);
- proxiableUUID
Return - Container type for the return parameters of the
proxiableUUID()
function. - renounce
Ownership Call - Function with signature
renounceOwnership()
and selector0x715018a6
.solidity function renounceOwnership() external;
- renounce
Ownership Return - Container type for the return parameters of the
renounceOwnership()
function. - symbol
Call - Function with signature
symbol()
and selector0x95d89b41
.solidity function symbol() external view returns (string memory);
- symbol
Return - Container type for the return parameters of the
symbol()
function. - total
Supply Call - Function with signature
totalSupply()
and selector0x18160ddd
.solidity function totalSupply() external view returns (uint256);
- total
Supply Return - Container type for the return parameters of the
totalSupply()
function. - transfer
Call - Function with signature
transfer(address,uint256)
and selector0xa9059cbb
.solidity function transfer(address to, uint256 value) external returns (bool);
- transfer
From Call - Function with signature
transferFrom(address,address,uint256)
and selector0x23b872dd
.solidity function transferFrom(address from, address to, uint256 value) external returns (bool);
- transfer
From Return - Container type for the return parameters of the
transferFrom(address,address,uint256)
function. - transfer
Ownership Call - Function with signature
transferOwnership(address)
and selector0xf2fde38b
.solidity function transferOwnership(address newOwner) external;
- transfer
Ownership Return - Container type for the return parameters of the
transferOwnership(address)
function. - transfer
Return - Container type for the return parameters of the
transfer(address,uint256)
function. - upgrade
ToAnd Call Call - Function with signature
upgradeToAndCall(address,bytes)
and selector0x4f1ef286
.solidity function upgradeToAndCall(address newImplementation, bytes memory data) external payable;
- upgrade
ToAnd Call Return - Container type for the return parameters of the
upgradeToAndCall(address,bytes)
function.
Enums§
- EspToken
Calls - Container for all the
EspToken
function calls. - EspToken
Errors - Container for all the
EspToken
custom errors. - EspToken
Events - 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 givenprovider
and constructor arguments, if any. - new
- Creates a new wrapper around an on-chain
EspToken
contract instance.