EternalStorageProxy
contract EternalStorageProxy
is OwnedEternalStorage, IEternalStorageProxy
This proxy holds the storage of an upgradable contract and delegates every call to the current implementation. It allows the contract's behavior to be updated and provides authorization control functionality.
Index
Reference
Events
OwnershipTransferred
event OwnershipTransferred(address previousOwner, address newOwner)
Emitted by the `transferOwnership` function every time the ownership of this contract changes.
- Parameters:
previousOwner
- Represents the previous owner of the contract.newOwner
- Represents the new owner of the contract.
Upgraded
event Upgraded(uint256 version, address implementation)
Emitted by the `upgradeTo` function every time the implementation gets upgraded.
- Parameters:
version
- The new version number of the upgraded implementation.implementation
- The new address of the upgraded implementation.
Functions
fallback
function (address _implementationAddress, address _ownerAddress) public
- Parameters:
_implementationAddress
- The address of the implementation. This must either be the address of an already-constructed contract, or `address(0)`. In the latter case, the implementation can be set later using the `upgradeTo` function._ownerAddress
- The owner of the contract. If set to `address(0)`, then `msg.sender` will be used instead.
fallback
function () external payable
Fallback function allowing a `delegatecall` to the given implementation. This function will return whatever the implementation call returns.
getOwner
function getOwner() external view returns (address)
Returns the address of the contract owner.
- Returns:
- address
implementation
function implementation() public view returns (address)
Returns the address of the current implementation.
- Returns:
- address
transferOwnership
function transferOwnership(address _newOwner) external
Allows the current owner to irrevocably transfer control of the contract to a `_newOwner`.
- Modifiers:
- onlyOwner
- Parameters:
_newOwner
- The address ownership is transferred to.
upgradeTo
function upgradeTo(address _newImplementation) external returns (bool)
Allows the owner to upgrade the current implementation.
- Modifiers:
- onlyOwner
- Parameters:
_newImplementation
- Represents the address where the new implementation is set.- Returns:
- bool
version
function version() public view returns (uint256)
Returns the version number of the current implementation.
- Returns:
- uint256