Contract detail
UpgradeableBeacon
UpgradeableBeacon is a verified Robinhood Chain smart contract at 0x27feb332…664ffd77 with 2 indexed transactions.
- Address type
- Smart contract
- Transactions
- 2
- First indexed block
- #50533
- Latest indexed block
- #84000006
- ERC-20 transfers
- 1
- Emitted events
- 4
- Verification
- Verified
- Compiler
- v0.8.27+commit.40a35a09
- Verification match
- partial
- Creation transaction
- 0x7e6c9f8f…07992190
- Created at block
- #50533
- Language
- solidity
- EVM version
- cancun
- License
- none
- Compiler optimization
- Enabled · 200 runs
- Proxy type
- basic_implementation
- Implementation
- 0x95b58bf6c2b1d5f4d1786f1b0dea42e80132833e
Related activity
Transactions
| Transaction | Block | From | To | Value (wei) |
|---|---|---|---|---|
| 0xbe7d9833…c91b19d1 | #831010 | 0x38d0eaba…f83cc101 | 0x27feb332…664ffd77 | 0 |
| 0x3a217854…e77b0295 | #820217 | 0x84bf9954…44f79f99 | 0x27feb332…664ffd77 | 0 |
Verified contract
Contract source code
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/UpgradeableBeacon.sol)
pragma solidity ^0.8.20;
import {IBeacon} from "./IBeacon.sol";
import {Ownable} from "../../access/Ownable.sol";
/**
* @dev This contract 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.
*/
contract UpgradeableBeacon is IBeacon, Ownable {
address private _implementation;
/**
* @dev The `implementation` of the beacon is invalid.
*/
error BeaconInvalidImplementation(address implementation);
/**
* @dev Emitted when the implementation returned by the beacon is changed.
*/
event Upgraded(address indexed implementation);
/**
* @dev Sets the address of the initial implementation, and the initial owner who can upgrade the beacon.
*/
constructor(address implementation_, address initialOwner) Ownable(initialOwner) {
_setImplementation(implementation_);
}
/**
* @dev Returns the current implementation address.
*/
function implementation() public view virtual returns (address) {
return _implementation;
}
/**
* @dev 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.
*/
function upgradeTo(address newImplementation) public virtual onlyOwner {
_setImplementation(newImplementation);
}
/**
* @dev Sets the implementation contract address for this beacon
*
* Requirements:
*
* - `newImplementation` must be a contract.
*/
function _setImplementation(address newImplementation) private {
if (newImplementation.code.length == 0) {
revert BeaconInvalidImplementation(newImplementation);
}
_implementation = newImplementation;
emit Upgraded(newImplementation);
}
}