Skip to main content Link Menu Expand (external link) Document Search Copy Copied

UUPSUpgradeable

An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing UUPSUpgradeable with a custom implementation of upgrades. The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. _Available since v4.1._

Methods

proxiableUUID

function proxiableUUID() external view returns (bytes32)

Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the notDelegated modifier.

Returns

NameTypeDescription
_0bytes32undefined

upgradeTo

function upgradeTo(address newImplementation) external nonpayable

Upgrade the implementation of the proxy to newImplementation. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.

Parameters

NameTypeDescription
newImplementationaddressundefined

upgradeToAndCall

function upgradeToAndCall(address newImplementation, bytes data) external payable

Upgrade the implementation of the proxy to newImplementation, and subsequently execute the function call encoded in data. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.

Parameters

NameTypeDescription
newImplementationaddressundefined
databytesundefined

Events

AdminChanged

event AdminChanged(address previousAdmin, address newAdmin)

Emitted when the admin account has changed.

Parameters

NameTypeDescription
previousAdminaddressundefined
newAdminaddressundefined

BeaconUpgraded

event BeaconUpgraded(address indexed beacon)

Emitted when the beacon is changed.

Parameters

NameTypeDescription
beacon indexedaddressundefined

Initialized

event Initialized(uint8 version)

Triggered when the contract has been initialized or reinitialized.

Parameters

NameTypeDescription
versionuint8undefined

Upgraded

event Upgraded(address indexed implementation)

Emitted when the implementation is upgraded.

Parameters

NameTypeDescription
implementation indexedaddressundefined

Back to top

Copyright © Guardians Of The Ball. This site is powered by Gitlab Pages