Module ERC1967Proxy

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 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§

AddressEmptyCode
Custom error with signature AddressEmptyCode(address) and selector 0x9996b315. solidity error AddressEmptyCode(address target);
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();
ERC1967ProxyInstance
A ERC1967Proxy instance.
FailedInnerCall
Custom error with signature FailedInnerCall() and selector 0x1425ea42. solidity error FailedInnerCall();
Upgraded
Event with signature Upgraded(address) and selector 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. solidity event Upgraded(address indexed implementation);
constructorCall
Constructor`. solidity constructor(address implementation, bytes _data) payable;

Enums§

ERC1967ProxyErrors
Container for all the ERC1967Proxy custom errors.
ERC1967ProxyEvents
Container for all the ERC1967Proxy 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 ERC1967Proxy contract instance.