This abstract contract implements a basic proxy that stores an implementation address. Fallback function calls are delegated to the implementation. This contract is meant to be inherited by other proxy contracts.
bytes32 _IMPLEMENTATION_SLOT
bytes32 _OWNER_SLOT
function implementation() public view virtual returns (address implementation_)
Returns the current implementation address.
Name | Type | Description |
---|---|---|
implementation_ | address | The address of the current implementation contract |
function setup(bytes params) external
Shadows the setup function of the implementation contract so it can’t be called directly via the proxy.
Name | Type | Description |
---|---|---|
params | bytes | The setup parameters for the implementation contract. |
function contractId() internal pure virtual returns (bytes32)
Returns the contract ID. It can be used as a check during upgrades. Meant to be implemented in derived contracts.
Name | Type | Description |
---|---|---|
[0] | bytes32 | bytes32 The contract ID |
fallback() external payable virtual
Fallback function. Delegates the call to the current implementation contract.
receive() external payable virtual
Payable fallback function. Can be overridden in derived contracts.