InverterTransparentUpgradeableProxy_v1.sol
Last updated
Last updated
Inherits:
Author: Inverter Network
An alternative variant of the of OpenZeppelin that allows for upgrading the linked implementation of the proxy to the implementation provided by a linked beacon.
*This contract is a fork of the from openzeppelin. We adapted the callable functions of the admin account to only be able to upgrade the implementation to the newest implementation of the linked. !!! IMPORTANT !!!
If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches the {IInverterTransparentUpgradeableProxy_v1-upgradeToNewestVersion} function exposed by the proxy itself.
If the admin calls the proxy, it can call the upgradeToNewestVersion
function but any other call won't be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error indicating the proxy admin cannot fallback to the target implementation. These properties mean that the admin account can only be used for upgrading the proxy, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. For this reason, the proxy deploys an instance of {ProxyAdmin} and allows upgrades only if they come through it. You should think of the ProxyAdmin
instance as the administrative interface of the proxy, including the ability to change who can trigger upgrades by transferring ownership.*
The address of the admin that can update the implementation address of this proxy.
The address of the beacon that is used to fetch the implementation address.
The major version of the implementation.
The minor version of the implementation.
The patch version of the implementation.
Returns the version of the linked implementation.
This overrides the possible use of a "version" function in the modules that are called via the Proxy Beacon structure.
Returns
<none>
uint256
The major version.
<none>
uint256
The minor version.
<none>
uint256
The patch version.
Fallback function to delegate calls to the implementation contract even if the call data is empty but msg.value > 0.
Upgrades the implementation to the newest version listed in the beacon.
If caller is the admin process the call internally, otherwise transparently fallback to the proxy behavior.
If the proxy caller is the current admin then it can only call the admin functions.
The provided beacon address doesn't support the interface .