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
xxCallandxxReturntypes, they usually can be converted/transmuted from existing struct - Event types should be exported
- structs should be exported and renamed with
xxSolsuffix 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 ERC1967Proxy {
error AddressEmptyCode(address target);
error ERC1967InvalidImplementation(address implementation);
error ERC1967NonPayable();
error FailedInnerCall();
event Upgraded(address indexed implementation);
constructor(address implementation, bytes _data) payable;
fallback() external payable;
}…which was generated by the following JSON ABI:
[
{
"type": "constructor",
"inputs": [
{
"name": "implementation",
"type": "address",
"internalType": "address"
},
{
"name": "_data",
"type": "bytes",
"internalType": "bytes"
}
],
"stateMutability": "payable"
},
{
"type": "fallback",
"stateMutability": "payable"
},
{
"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": "FailedInnerCall",
"inputs": []
}
]Structs§
- Address
Empty Code - Custom error with signature
AddressEmptyCode(address)and selector0x9996b315. - ERC1967
Invalid Implementation - Custom error with signature
ERC1967InvalidImplementation(address)and selector0x4c9c8ce3. - ERC1967
NonPayable - Custom error with signature
ERC1967NonPayable()and selector0xb398979f. - ERC1967
Proxy Instance - A
ERC1967Proxyinstance. - Failed
Inner Call - Custom error with signature
FailedInnerCall()and selector0x1425ea42. - Upgraded
- Event with signature
Upgraded(address)and selector0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. - constructor
Call - Constructor`.
Enums§
- ERC1967
Proxy Errors - Container for all the
ERC1967Proxycustom errors. - ERC1967
Proxy Events - Container for all the
ERC1967Proxyevents.
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
providerand constructor arguments, if any. - deploy_
builder - Creates a
RawCallBuilderfor deploying this contract using the givenproviderand constructor arguments, if any. - new
- Creates a new wrapper around an on-chain
ERC1967Proxycontract instance.