Cub
Inherits: Proxy, ERC1967Upgrade, ICub
Author: mortimr @ Kiln
The cub is controlled by a Hatcher in charge of providing its status details and implementation address.
Unstructured Storage Friendly
Functions
___initializeCub
Initializer to not rely on the constructor.
function ___initializeCub(address beacon, bytes memory data) external;
Parameters
| Name | Type | Description |
|---|---|---|
beacon | address | The address of the beacon to pull its info from |
data | bytes | The calldata to add to the initial call, if any |
_implementation
Internal utility to retrieve the implementation from the beacon.
function _implementation() internal view virtual override returns (address);
Returns
| Name | Type | Description |
|---|---|---|
<none> | address | The implementation address |
onlyBeacon
Prevents unauthorized calls.
This will make the method transparent, forcing unauthorized callers into the fallback.
modifier onlyBeacon();
onlyMe
Prevents unauthorized calls.
This will make the method transparent, forcing unauthorized callers into the fallback.
modifier onlyMe();
appliedFixes
Public method that emits the AppliedFixes event.
Transparent to all callers except the cub itself
function appliedFixes(address[] memory fixers) public onlyMe;
Parameters
| Name | Type | Description |
|---|---|---|
fixers | address[] |
applyFix
Applies the provided fix.
Transparent to all callers except the hatcher
function applyFix(address fixer) external onlyBeacon;
Parameters
| Name | Type | Description |
|---|---|---|
fixer | address |
_fixes
Retrieve the list of fixes for this cub from the hatcher.
function _fixes(address beacon) internal view returns (address[] memory);
Parameters
| Name | Type | Description |
|---|---|---|
beacon | address | Address of the hatcher acting as a beacon |
Returns
| Name | Type | Description |
|---|---|---|
<none> | address[] | List of fixes to apply |
_status
Retrieve the status for this cub from the hatcher.
function _status(address beacon) internal view returns (address, bool, bool);
Parameters
| Name | Type | Description |
|---|---|---|
beacon | address | Address of the hatcher acting as a beacon |
Returns
| Name | Type | Description |
|---|---|---|
<none> | address | First value is true if fixes are pending, second value is true if cub is paused |
<none> | bool | |
<none> | bool |
_commit
Commits fixes to the hatcher.
function _commit(address beacon) internal;
Parameters
| Name | Type | Description |
|---|---|---|
beacon | address | Address of the hatcher acting as a beacon |
_fix
Fetches the current cub status and acts accordingly.
function _fix(address beacon) internal returns (address);
Parameters
| Name | Type | Description |
|---|---|---|
beacon | address | Address of the hatcher acting as a beacon |
_applyFix
Applies the given fix, and reverts in case of error.
function _applyFix(address fixer) internal;
Parameters
| Name | Type | Description |
|---|---|---|
fixer | address | Address that implements the fix |
_fallback
Fallback method that ends up forwarding calls as delegatecalls to the implementation.
function _fallback() internal override(Proxy);