190 - OZ UpgradeableBeacon
OpenZeppelin UpgradeableBeacon: is used in conjunction with one or more instances of BeaconProxy to determine their implementation contract, which is where they will delegate all function calls.
An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.
-
constructor(address implementation
)`: Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the beacon. -
implementation()
→address
: Returns the current implementation address. -
upgradeTo(address newImplementation)
: Upgrades the beacon to a new implementation. Emits an Upgraded event. Requirements: -
msg.sender
must be the owner of the contract -
newImplementation
must be a contract.
- UpgradeableBeacon -> BeaconProxy
- Owner -> Change Impl
- Constructor -> Impl Init
- Deployer -> Owner
_implementation()
_ugpradeTo(newImplementation)