Overview
ETH Balance
0 ETH
ETH Value
$0.00| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 31052857 | 225 days ago | Contract Creation | 0 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
BeaconProxyFactory
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
No with 200 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
// Dependency imports
import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";
import {BeaconProxy} from "@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol";
import {UpgradeableBeacon} from "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol";
// Internal imports
import {IBeaconProxyFactory} from "src/interfaces/IBeaconProxyFactory.sol";
/**
* @dev Implementation of a factory that allows for deterministic deployment of BeaconProxys from an UpgradeableBeacon
* using the Create2 opcode. The salt used for the Create2 deployment is the hash of the sender and the base salt.
*/
contract BeaconProxyFactory is IBeaconProxyFactory, UpgradeableBeacon {
/// @inheritdoc IBeaconProxyFactory
uint256 public numProxies;
/// @notice Creates a new BeaconProxyFactory
/// @param _implementation The implementation contract for the beacon that will be used by BeaconProxys created
/// by this factory
/// @param _owner The owner of this factory, allowed to update the beacon implementation
constructor(address _implementation, address _owner) UpgradeableBeacon(_implementation, _owner) {}
/// @inheritdoc IBeaconProxyFactory
function computeProxyAddress(address sender, bytes memory data, bytes32 baseSalt)
external
view
returns (address proxy)
{
return
Create2.computeAddress(_getDeploySalt(sender, baseSalt), keccak256(_getCreationCode(data)), address(this));
}
/// @inheritdoc IBeaconProxyFactory
function createProxy(bytes memory data, bytes32 baseSalt) external returns (address proxy) {
proxy = Create2.deploy(0, _getDeploySalt(msg.sender, baseSalt), _getCreationCode(data));
numProxies++;
// Emit an event for the newly created proxy
emit BeaconProxyCreated(proxy, data, baseSalt);
}
/// @dev Returns the deploy salt for the BeaconProxy, which is the hash of the sender and the base salt
/// @param sender The address that will deploy the beacon proxy using the factory
/// @param baseSalt The base salt used for deterministic deployment
/// @return salt The deploy salt for the BeaconProxy
function _getDeploySalt(address sender, bytes32 baseSalt) internal pure returns (bytes32 salt) {
return keccak256(abi.encode(sender, baseSalt));
}
/// @dev Returns the creation code for the BeaconProxy
/// @param data The initialization data for the BeaconProxy
/// @return bytecode The creation code for the BeaconProxy
function _getCreationCode(bytes memory data) internal view returns (bytes memory bytecode) {
bytecode = abi.encodePacked(
type(BeaconProxy).creationCode, // BeaconProxy's runtime bytecode
abi.encode(address(this), data) // Constructor arguments: beacon address and initialization data
);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Create2.sol)
pragma solidity ^0.8.20;
import {Errors} from "./Errors.sol";
/**
* @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.
* `CREATE2` can be used to compute in advance the address where a smart
* contract will be deployed, which allows for interesting new mechanisms known
* as 'counterfactual interactions'.
*
* See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more
* information.
*/
library Create2 {
/**
* @dev There's no code to deploy.
*/
error Create2EmptyBytecode();
/**
* @dev Deploys a contract using `CREATE2`. The address where the contract
* will be deployed can be known in advance via {computeAddress}.
*
* The bytecode for a contract can be obtained from Solidity with
* `type(contractName).creationCode`.
*
* Requirements:
*
* - `bytecode` must not be empty.
* - `salt` must have not been used for `bytecode` already.
* - the factory must have a balance of at least `amount`.
* - if `amount` is non-zero, `bytecode` must have a `payable` constructor.
*/
function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address addr) {
if (address(this).balance < amount) {
revert Errors.InsufficientBalance(address(this).balance, amount);
}
if (bytecode.length == 0) {
revert Create2EmptyBytecode();
}
assembly ("memory-safe") {
addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)
// if no address was created, and returndata is not empty, bubble revert
if and(iszero(addr), not(iszero(returndatasize()))) {
let p := mload(0x40)
returndatacopy(p, 0, returndatasize())
revert(p, returndatasize())
}
}
if (addr == address(0)) {
revert Errors.FailedDeployment();
}
}
/**
* @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the
* `bytecodeHash` or `salt` will result in a new destination address.
*/
function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {
return computeAddress(salt, bytecodeHash, address(this));
}
/**
* @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at
* `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.
*/
function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address addr) {
assembly ("memory-safe") {
let ptr := mload(0x40) // Get free memory pointer
// | | ↓ ptr ... ↓ ptr + 0x0B (start) ... ↓ ptr + 0x20 ... ↓ ptr + 0x40 ... |
// |-------------------|---------------------------------------------------------------------------|
// | bytecodeHash | CCCCCCCCCCCCC...CC |
// | salt | BBBBBBBBBBBBB...BB |
// | deployer | 000000...0000AAAAAAAAAAAAAAAAAAA...AA |
// | 0xFF | FF |
// |-------------------|---------------------------------------------------------------------------|
// | memory | 000000...00FFAAAAAAAAAAAAAAAAAAA...AABBBBBBBBBBBBB...BBCCCCCCCCCCCCC...CC |
// | keccak(start, 85) | ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ |
mstore(add(ptr, 0x40), bytecodeHash)
mstore(add(ptr, 0x20), salt)
mstore(ptr, deployer) // Right-aligned with 12 preceding garbage bytes
let start := add(ptr, 0x0b) // The hashed data starts at the final garbage byte which we will set to 0xff
mstore8(start, 0xff)
addr := and(keccak256(start, 85), 0xffffffffffffffffffffffffffffffffffffffff)
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (proxy/beacon/BeaconProxy.sol)
pragma solidity ^0.8.20;
import {IBeacon} from "./IBeacon.sol";
import {Proxy} from "../Proxy.sol";
import {ERC1967Utils} from "../ERC1967/ERC1967Utils.sol";
/**
* @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.
*
* The beacon address can only be set once during construction, and cannot be changed afterwards. It is stored in an
* immutable variable to avoid unnecessary storage reads, and also in the beacon storage slot specified by
* https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] so that it can be accessed externally.
*
* CAUTION: Since the beacon address can never be changed, you must ensure that you either control the beacon, or trust
* the beacon to not upgrade the implementation maliciously.
*
* IMPORTANT: Do not use the implementation logic to modify the beacon storage slot. Doing so would leave the proxy in
* an inconsistent state where the beacon storage slot does not match the beacon address.
*/
contract BeaconProxy is Proxy {
// An immutable address for the beacon to avoid unnecessary SLOADs before each delegate call.
address private immutable _beacon;
/**
* @dev Initializes the proxy with `beacon`.
*
* If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This
* will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity
* constructor.
*
* Requirements:
*
* - `beacon` must be a contract with the interface {IBeacon}.
* - If `data` is empty, `msg.value` must be zero.
*/
constructor(address beacon, bytes memory data) payable {
ERC1967Utils.upgradeBeaconToAndCall(beacon, data);
_beacon = beacon;
}
/**
* @dev Returns the current implementation address of the associated beacon.
*/
function _implementation() internal view virtual override returns (address) {
return IBeacon(_getBeacon()).implementation();
}
/**
* @dev Returns the beacon.
*/
function _getBeacon() internal view virtual returns (address) {
return _beacon;
}
}// 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);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
interface IBeaconProxyFactory {
/// @notice Error thrown when an invalid address is provided
error InvalidAddress();
/// @notice Emitted when a new BeaconProxy is created
/// @param proxy The address of the new BeaconProxy
/// @param data The data used to initialize the BeaconProxy
/// @param baseSalt The base salt used for deterministic deployment
event BeaconProxyCreated(address indexed proxy, bytes data, bytes32 baseSalt);
/// @notice Computes the address of a BeaconProxy before deployment
/// @param sender The address that will deploy the BeaconProxy using the factory
/// @param data The initialization data passed to the BeaconProxy
/// @param baseSalt The base salt used for deterministic deployment
/// @return proxy The predicted address of the BeaconProxy
function computeProxyAddress(address sender, bytes memory data, bytes32 baseSalt)
external
view
returns (address proxy);
/// @notice Returns the number of BeaconProxys deployed by the factory
/// @return _numProxies The number of BeaconProxys deployed by the factory
function numProxies() external view returns (uint256 _numProxies);
/// @notice Creates a new beacon proxy
/// @param data The initialization data passed to the proxy
/// @param baseSalt The base salt used for deterministic deployment
/// @return proxy The address of the new BeaconProxy
function createProxy(bytes memory data, bytes32 baseSalt) external returns (address proxy);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of common custom errors used in multiple contracts
*
* IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.
* It is recommended to avoid relying on the error API for critical functionality.
*
* _Available since v5.1._
*/
library Errors {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error InsufficientBalance(uint256 balance, uint256 needed);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedCall();
/**
* @dev The deployment failed.
*/
error FailedDeployment();
/**
* @dev A necessary precompile is missing.
*/
error MissingPrecompile(address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)
pragma solidity ^0.8.20;
/**
* @dev This is the interface that {BeaconProxy} expects of its beacon.
*/
interface IBeacon {
/**
* @dev Must return an address that can be used as a delegate call target.
*
* {UpgradeableBeacon} will check that this address is a contract.
*/
function implementation() external view returns (address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/Proxy.sol)
pragma solidity ^0.8.20;
/**
* @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
* instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
* be specified by overriding the virtual {_implementation} function.
*
* Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a
* different contract through the {_delegate} function.
*
* The success and return data of the delegated call will be returned back to the caller of the proxy.
*/
abstract contract Proxy {
/**
* @dev Delegates the current call to `implementation`.
*
* This function does not return to its internal call site, it will return directly to the external caller.
*/
function _delegate(address implementation) internal virtual {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 {
revert(0, returndatasize())
}
default {
return(0, returndatasize())
}
}
}
/**
* @dev This is a virtual function that should be overridden so it returns the address to which the fallback
* function and {_fallback} should delegate.
*/
function _implementation() internal view virtual returns (address);
/**
* @dev Delegates the current call to the address returned by `_implementation()`.
*
* This function does not return to its internal call site, it will return directly to the external caller.
*/
function _fallback() internal virtual {
_delegate(_implementation());
}
/**
* @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other
* function in the contract matches the call data.
*/
fallback() external payable virtual {
_fallback();
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (proxy/ERC1967/ERC1967Utils.sol)
pragma solidity ^0.8.21;
import {IBeacon} from "../beacon/IBeacon.sol";
import {IERC1967} from "../../interfaces/IERC1967.sol";
import {Address} from "../../utils/Address.sol";
import {StorageSlot} from "../../utils/StorageSlot.sol";
/**
* @dev This library provides getters and event emitting update functions for
* https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots.
*/
library ERC1967Utils {
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1.
*/
// solhint-disable-next-line private-vars-leading-underscore
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev The `implementation` of the proxy is invalid.
*/
error ERC1967InvalidImplementation(address implementation);
/**
* @dev The `admin` of the proxy is invalid.
*/
error ERC1967InvalidAdmin(address admin);
/**
* @dev The `beacon` of the proxy is invalid.
*/
error ERC1967InvalidBeacon(address beacon);
/**
* @dev An upgrade function sees `msg.value > 0` that may be lost.
*/
error ERC1967NonPayable();
/**
* @dev Returns the current implementation address.
*/
function getImplementation() internal view returns (address) {
return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;
}
/**
* @dev Stores a new address in the ERC-1967 implementation slot.
*/
function _setImplementation(address newImplementation) private {
if (newImplementation.code.length == 0) {
revert ERC1967InvalidImplementation(newImplementation);
}
StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;
}
/**
* @dev Performs implementation upgrade with additional setup call if data is nonempty.
* This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
* to avoid stuck value in the contract.
*
* Emits an {IERC1967-Upgraded} event.
*/
function upgradeToAndCall(address newImplementation, bytes memory data) internal {
_setImplementation(newImplementation);
emit IERC1967.Upgraded(newImplementation);
if (data.length > 0) {
Address.functionDelegateCall(newImplementation, data);
} else {
_checkNonPayable();
}
}
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1.
*/
// solhint-disable-next-line private-vars-leading-underscore
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Returns the current admin.
*
* TIP: To get this value clients can read directly from the storage slot shown below (specified by ERC-1967) using
* the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
* `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`
*/
function getAdmin() internal view returns (address) {
return StorageSlot.getAddressSlot(ADMIN_SLOT).value;
}
/**
* @dev Stores a new address in the ERC-1967 admin slot.
*/
function _setAdmin(address newAdmin) private {
if (newAdmin == address(0)) {
revert ERC1967InvalidAdmin(address(0));
}
StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;
}
/**
* @dev Changes the admin of the proxy.
*
* Emits an {IERC1967-AdminChanged} event.
*/
function changeAdmin(address newAdmin) internal {
emit IERC1967.AdminChanged(getAdmin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
* This is the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1.
*/
// solhint-disable-next-line private-vars-leading-underscore
bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;
/**
* @dev Returns the current beacon.
*/
function getBeacon() internal view returns (address) {
return StorageSlot.getAddressSlot(BEACON_SLOT).value;
}
/**
* @dev Stores a new beacon in the ERC-1967 beacon slot.
*/
function _setBeacon(address newBeacon) private {
if (newBeacon.code.length == 0) {
revert ERC1967InvalidBeacon(newBeacon);
}
StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;
address beaconImplementation = IBeacon(newBeacon).implementation();
if (beaconImplementation.code.length == 0) {
revert ERC1967InvalidImplementation(beaconImplementation);
}
}
/**
* @dev Change the beacon and trigger a setup call if data is nonempty.
* This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
* to avoid stuck value in the contract.
*
* Emits an {IERC1967-BeaconUpgraded} event.
*
* CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since
* it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for
* efficiency.
*/
function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {
_setBeacon(newBeacon);
emit IERC1967.BeaconUpgraded(newBeacon);
if (data.length > 0) {
Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
} else {
_checkNonPayable();
}
}
/**
* @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract
* if an upgrade doesn't perform an initialization call.
*/
function _checkNonPayable() private {
if (msg.value > 0) {
revert ERC1967NonPayable();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1967.sol)
pragma solidity ^0.8.20;
/**
* @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
*/
interface IERC1967 {
/**
* @dev Emitted when the implementation is upgraded.
*/
event Upgraded(address indexed implementation);
/**
* @dev Emitted when the admin account has changed.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Emitted when the beacon is changed.
*/
event BeaconUpgraded(address indexed beacon);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)
pragma solidity ^0.8.20;
import {Errors} from "./Errors.sol";
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert Errors.InsufficientBalance(address(this).balance, amount);
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert Errors.FailedCall();
}
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {Errors.FailedCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert Errors.InsufficientBalance(address(this).balance, value);
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case
* of an unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {Errors.FailedCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly ("memory-safe") {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert Errors.FailedCall();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.20;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC-1967 implementation slot:
* ```solidity
* contract ERC1967 {
* // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(newImplementation.code.length > 0);
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*
* TIP: Consider using this library along with {SlotDerivation}.
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct Int256Slot {
int256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Int256Slot` with member `value` located at `slot`.
*/
function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
assembly ("memory-safe") {
r.slot := store.slot
}
}
/**
* @dev Returns a `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
assembly ("memory-safe") {
r.slot := store.slot
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}{
"remappings": [
"ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
"solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/",
"@morpho-blue/=lib/morpho-blue/src/",
"@morpho-blue-irm/=lib/morpho-blue-irm/src/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
"morpho-blue-irm/=lib/morpho-blue-irm/src/",
"morpho-blue/=lib/morpho-blue/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/",
"openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
"solmate/=lib/morpho-blue-irm/lib/solmate/src/"
],
"optimizer": {
"enabled": false,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": true,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_implementation","type":"address"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"BeaconInvalidImplementation","type":"error"},{"inputs":[],"name":"Create2EmptyBytecode","type":"error"},{"inputs":[],"name":"FailedDeployment","type":"error"},{"inputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"proxy","type":"address"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"},{"indexed":false,"internalType":"bytes32","name":"baseSalt","type":"bytes32"}],"name":"BeaconProxyCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bytes32","name":"baseSalt","type":"bytes32"}],"name":"computeProxyAddress","outputs":[{"internalType":"address","name":"proxy","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bytes32","name":"baseSalt","type":"bytes32"}],"name":"createProxy","outputs":[{"internalType":"address","name":"proxy","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numProxies","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
6080604052346100305761001a610014610104565b90610126565b610022610035565b61162c610398823961162c90f35b61003b565b60405190565b5f80fd5b601f801991011690565b634e487b7160e01b5f52604160045260245ffd5b906100679061003f565b810190811060018060401b0382111761007f57604052565b610049565b90610097610090610035565b928361005d565b565b5f80fd5b60018060a01b031690565b6100b19061009d565b90565b6100bd816100a8565b036100c457565b5f80fd5b905051906100d5826100b4565b565b91906040838203126100ff57806100f36100fc925f86016100c8565b936020016100c8565b90565b610099565b6101226119c48038038061011781610084565b9283398101906100d7565b9091565b9061013091610132565b565b61013e61014392610195565b610282565b565b90565b90565b61015f61015a61016492610145565b610148565b61009d565b90565b6101709061014b565b90565b61017c906100a8565b9052565b9190610193905f60208501940190610173565b565b806101b06101aa6101a55f610167565b6100a8565b916100a8565b146101c0576101be90610338565b565b6101e36101cc5f610167565b5f918291631e4fbdf760e01b835260048301610180565b0390fd5b90565b6101fe6101f961020392610145565b610148565b6101e7565b90565b5f1b90565b9061021c60018060a01b0391610206565b9181191691161790565b61023a61023561023f9261009d565b610148565b61009d565b90565b61024b90610226565b90565b61025790610242565b90565b90565b9061027261026d6102799261024e565b61025a565b825461020b565b9055565b5f0190565b803b6102966102905f6101ea565b916101e7565b146102e8576102a681600161025d565b6102d07fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b9161024e565b906102d9610035565b806102e38161027d565b0390a2565b610303905f91829163211eb15960e21b835260048301610180565b0390fd5b5f1c90565b60018060a01b031690565b61032361032891610307565b61030c565b90565b6103359054610317565b90565b6103415f61032b565b61034b825f61025d565b9061037f6103797f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361024e565b9161024e565b91610388610035565b806103928161027d565b0390a356fe60806040526004361015610013575b6104f0565b61001d5f3561009c565b8063227fce20146100975780633659cfe6146100925780635c60da1b1461008d5780636a0cdb081461008857806370bf749714610083578063715018a61461007e5780638da5cb5b146100795763f2fde38b0361000e576104bd565b610488565b610455565b610420565b610389565b610301565b6102bf565b610243565b60e01c90565b60405190565b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f80fd5b601f801991011690565b634e487b7160e01b5f52604160045260245ffd5b906100e4906100bc565b810190811067ffffffffffffffff8211176100fe57604052565b6100c6565b9061011661010f6100a2565b92836100da565b565b67ffffffffffffffff8111610136576101326020916100bc565b0190565b6100c6565b90825f939282370152565b9092919261015b61015682610118565b610103565b93818552602085019082840111610177576101759261013b565b565b6100b8565b9080601f8301121561019a5781602061019793359101610146565b90565b6100b4565b90565b6101ab8161019f565b036101b257565b5f80fd5b905035906101c3826101a2565b565b9190604083820312610205575f8301359067ffffffffffffffff8211610200576101f4816101fd93860161017c565b936020016101b6565b90565b6100b0565b6100ac565b60018060a01b031690565b61021e9061020a565b90565b61022a90610215565b9052565b9190610241905f60208501940190610221565b565b346102745761027061025f6102593660046101c5565b9061067a565b6102676100a2565b9182918261022e565b0390f35b6100a8565b61028281610215565b0361028957565b5f80fd5b9050359061029a82610279565b565b906020828203126102b5576102b2915f0161028d565b90565b6100ac565b5f0190565b346102ed576102d76102d236600461029c565b61072d565b6102df6100a2565b806102e9816102ba565b0390f35b6100a8565b5f9103126102fc57565b6100ac565b34610331576103113660046102f2565b61032d61031c610764565b6103246100a2565b9182918261022e565b0390f35b6100a8565b90916060828403126103845761034e835f840161028d565b9260208301359067ffffffffffffffff821161037f576103738161037c93860161017c565b936040016101b6565b90565b6100b0565b6100ac565b346103ba576103b66103a561039f366004610336565b9161078c565b6103ad6100a2565b9182918261022e565b0390f35b6100a8565b1c90565b90565b6103d69060086103db93026103bf565b6103c3565b90565b906103e991546103c6565b90565b6103f860025f906103de565b90565b90565b610407906103fb565b9052565b919061041e905f602085019401906103fe565b565b34610450576104303660046102f2565b61044c61043b6103ec565b6104436100a2565b9182918261040b565b0390f35b6100a8565b34610483576104653660046102f2565b61046d61081d565b6104756100a2565b8061047f816102ba565b0390f35b6100a8565b346104b8576104983660046102f2565b6104b46104a3610827565b6104ab6100a2565b9182918261022e565b0390f35b6100a8565b346104eb576104d56104d036600461029c565b6108a1565b6104dd6100a2565b806104e7816102ba565b0390f35b6100a8565b5f80fd5b5f90565b90565b90565b61051261050d610517926104f8565b6104fb565b6103fb565b90565b5f1c90565b61052b6105309161051a565b6103c3565b90565b61053d905461051f565b90565b634e487b7160e01b5f52601160045260245ffd5b61055d906103fb565b5f19811461056b5760010190565b610540565b5f1b90565b906105815f1991610570565b9181191691161790565b61059f61059a6105a4926103fb565b6104fb565b6103fb565b90565b90565b906105bf6105ba6105c69261058b565b6105a7565b8254610575565b9055565b6105de6105d96105e39261020a565b6104fb565b61020a565b90565b6105ef906105ca565b90565b6105fb906105e6565b90565b5190565b60209181520190565b90825f9392825e0152565b61063561063e6020936106439361062c816105fe565b93848093610602565b9586910161060b565b6100bc565b0190565b6106509061019f565b9052565b929160206106706106789360408701908782035f890152610616565b940190610647565b565b91906106846104f4565b506106ab5f6106943384906108d3565b6106a66106a08761098c565b926104fe565b610a3d565b926106c86106c16106bc6002610533565b610554565b60026105aa565b8390916106f57ffc6ca44b2e0253d7b333f816a6b6e52e7292a56fd5f38e52946f9dfc812d698b926105f2565b9261070a6107016100a2565b92839283610654565b0390a2565b6107209061071b610b2a565b610722565b565b61072b90610bb6565b565b6107369061070f565b565b60018060a01b031690565b61074f6107549161051a565b610738565b90565b6107619054610743565b90565b61076c6104f4565b506107776001610757565b90565b60200190565b610789906105e6565b90565b6107a56107cd936107ab9261079f6104f4565b506108d3565b9161098c565b6107bd6107b7826105fe565b9161077a565b206107c730610780565b91610c3b565b90565b6107d8610b2a565b6107e061080a565b565b6107f66107f16107fb926104f8565b6104fb565b61020a565b90565b610807906107e2565b90565b61081b6108165f6107fe565b610c6c565b565b6108256107d0565b565b61082f6104f4565b506108395f610757565b90565b61084d90610848610b2a565b61084f565b565b8061086a61086461085f5f6107fe565b610215565b91610215565b1461087a5761087890610c6c565b565b61089d6108865f6107fe565b5f918291631e4fbdf760e01b83526004830161022e565b0390fd5b6108aa9061083c565b565b5f90565b9160206108d19294936108ca60408201965f830190610221565b0190610647565b565b610906906108df6108ac565b506108f76108eb6100a2565b938492602084016108b0565b602082018103825203826100da565b610918610912826105fe565b9161077a565b2090565b606090565b916109449261093760408201935f830190610221565b6020818403910152610616565b90565b905090565b6109716109689260209261095f816105fe565b94858093610947565b9384910161060b565b0190565b61098390610989939261094c565b9061094c565b90565b61099461091c565b50610a0b61091e6109a760208201610103565b90808252610cd960208301396109e56109bf30610780565b6109d66109ca6100a2565b95869260208401610921565b602082018103825203846100da565b6109fc6109f06100a2565b93849260208401610975565b602082018103825203826100da565b90565b610a17906105e6565b90565b916020610a3b929493610a3460408201965f8301906103fe565b01906103fe565b565b919091610a486104f4565b50610a5230610a0e565b31610a65610a5f836103fb565b916103fb565b10610b0257610a73826105fe565b610a85610a7f5f6104fe565b916103fb565b14610ae65760208251920190f5903d1519821516610adb5781610ab8610ab2610aad5f6107fe565b610215565b91610215565b14610abf57565b5f63b06ebf3d60e01b815280610ad7600482016102ba565b0390fd5b6040513d5f823e3d90fd5b5f631328927760e21b815280610afe600482016102ba565b0390fd5b610b0b30610a0e565b31610b265f92839263cf47918160e01b845260048401610a1a565b0390fd5b610b32610827565b610b4b610b45610b40610ccb565b610215565b91610215565b03610b5257565b610b74610b5d610ccb565b5f91829163118cdaa760e01b83526004830161022e565b0390fd5b90610b8960018060a01b0391610570565b9181191691161790565b90565b90610bab610ba6610bb2926105f2565b610b93565b8254610b78565b9055565b803b610bca610bc45f6104fe565b916103fb565b14610c1c57610bda816001610b96565b610c047fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b916105f2565b90610c0d6100a2565b80610c17816102ba565b0390a2565b610c37905f91829163211eb15960e21b83526004830161022e565b0390fd5b91600b92610c476104f4565b50604051926040840152602083015281520160ff8153605560018060a01b0391201690565b610c755f610757565b610c7f825f610b96565b90610cb3610cad7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0936105f2565b916105f2565b91610cbc6100a2565b80610cc6816102ba565b0390a3565b610cd36104f4565b50339056fe60a060405261001561000f6101a6565b906101c8565b61001d610034565b61023e6106e08239608051816101e6015261023e90f35b60405190565b601f801991011690565b634e487b7160e01b5f52604160045260245ffd5b906100629061003a565b810190811060018060401b0382111761007a57604052565b610044565b9061009261008b610034565b9283610058565b565b5f80fd5b5f80fd5b60018060a01b031690565b6100b09061009c565b90565b6100bc816100a7565b036100c357565b5f80fd5b905051906100d4826100b3565b565b5f80fd5b5f80fd5b60018060401b0381116100fa576100f660209161003a565b0190565b610044565b90825f9392825e0152565b9092919261011f61011a826100de565b61007f565b9381855260208501908284011161013b57610139926100ff565b565b6100da565b9080601f8301121561015e5781602061015b9351910161010a565b90565b6100d6565b9190916040818403126101a15761017c835f83016100c7565b92602082015160018060401b03811161019c576101999201610140565b90565b610098565b610094565b6101c461091e803803806101b98161007f565b928339810190610163565b9091565b906101d39082610292565b608052565b90565b6101ef6101ea6101f49261009c565b6101d8565b61009c565b90565b610200906101db565b90565b61020c906101f7565b90565b5f0190565b5190565b90565b90565b61023261022d6102379261021b565b6101d8565b610218565b90565b610243906101db565b90565b61024f9061023a565b90565b61025b906101f7565b90565b60e01b90565b9060208282031261027d5761027a915f016100c7565b90565b610094565b61028a610034565b3d5f823e3d90fd5b9061029c82610453565b816102c77f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e91610203565b906102d0610034565b806102da8161020f565b0390a26102e681610214565b6102f86102f25f61021e565b91610218565b115f1461039157602061031561031061032b94610246565b610252565b635c60da1b90610323610034565b94859261025e565b8252818061033b6004820161020f565b03915afa90811561038c57610358925f9261035c575b50906105de565b505b565b61037e91925060203d8111610385575b6103768183610058565b810190610264565b905f610351565b503d61036c565b610282565b505061039b610563565b61035a565b6103a9906100a7565b9052565b91906103c0905f602085019401906103a0565b565b90565b90565b5f1b90565b6103e16103dc6103e6926103c2565b6103c8565b6103c5565b90565b6104127fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d506103cd565b90565b9061042660018060a01b03916103c8565b9181191691161790565b90565b9061044861044361044f92610203565b610430565b8254610415565b9055565b803b6104676104615f61021e565b91610218565b1461054457602061049d610498836104936104b3955f61048d6104886103e9565b61060d565b01610433565b610246565b610252565b635c60da1b906104ab610034565b93849261025e565b825281806104c36004820161020f565b03915afa90811561053f575f91610511575b50803b6104ea6104e45f61021e565b91610218565b146104f25750565b61050d905f918291634c9c8ce360e01b8352600483016103ad565b0390fd5b610532915060203d8111610538575b61052a8183610058565b810190610264565b5f6104d5565b503d610520565b610282565b61055f905f918291631933b43b60e21b8352600483016103ad565b0390fd5b346105766105705f61021e565b91610218565b1161057d57565b5f63b398979f60e01b8152806105956004820161020f565b0390fd5b606090565b906105b06105ab836100de565b61007f565b918252565b3d5f146105d0576105c53d61059e565b903d5f602084013e5b565b6105d8610599565b906105ce565b5f8061060a936105ec610599565b508390602081019051915af4906106016105b5565b90919091610615565b90565b90565b151590565b9061062990610622610599565b5015610610565b5f146106355750610699565b61063e82610214565b61065061064a5f61021e565b91610218565b148061067e575b61065f575090565b61067a905f918291639996b31560e01b8352600483016103ad565b0390fd5b50803b61069361068d5f61021e565b91610218565b14610657565b6106a281610214565b6106b46106ae5f61021e565b91610218565b115f146106c357805190602001fd5b5f63d6bda27560e01b8152806106db6004820161020f565b0390fdfe608060405261000c610128565b6101bd565b5f90565b60018060a01b031690565b90565b61003761003261003c92610015565b610020565b610015565b90565b61004890610023565b90565b6100549061003f565b90565b61006090610023565b90565b61006c90610057565b90565b60405190565b601f801991011690565b634e487b7160e01b5f52604160045260245ffd5b9061009d90610075565b810190811067ffffffffffffffff8211176100b757604052565b61007f565b60e01b90565b5f80fd5b6100cf90610015565b90565b6100db816100c6565b036100e257565b5f80fd5b905051906100f3826100d2565b565b9060208282031261010e5761010b915f016100e6565b90565b6100c2565b5f0190565b61012061006f565b3d5f823e3d90fd5b610130610011565b50610164602061014e6101496101446101db565b61004b565b610063565b635c60da1b9061015c61006f565b9384926100bc565b8252818061017460048201610113565b03915afa9081156101b8575f9161018a575b5090565b6101ab915060203d81116101b1575b6101a38183610093565b8101906100f5565b5f610186565b503d610199565b610118565b5f8091368280378136915af43d5f803e5f146101d7573d5ff35b3d5ffd5b6101e3610011565b507f00000000000000000000000000000000000000000000000000000000000000009056fea2646970667358221220475f111ed0b2b68df6e9b479f8b3550d1b5eb65bd302ad96259965703faac2ed64736f6c634300081a0033a2646970667358221220ec70fedcd4e5965f98770a6480487c92ef71cc51daff4bb00917301dc578aec364736f6c634300081a0033000000000000000000000000057a2a1cc13a9af430976af912a27a05de537673000000000000000000000000639d2dd24304ac2e6a691d8c1cff4a2665925fee
Deployed Bytecode
0x60806040526004361015610013575b6104f0565b61001d5f3561009c565b8063227fce20146100975780633659cfe6146100925780635c60da1b1461008d5780636a0cdb081461008857806370bf749714610083578063715018a61461007e5780638da5cb5b146100795763f2fde38b0361000e576104bd565b610488565b610455565b610420565b610389565b610301565b6102bf565b610243565b60e01c90565b60405190565b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f80fd5b601f801991011690565b634e487b7160e01b5f52604160045260245ffd5b906100e4906100bc565b810190811067ffffffffffffffff8211176100fe57604052565b6100c6565b9061011661010f6100a2565b92836100da565b565b67ffffffffffffffff8111610136576101326020916100bc565b0190565b6100c6565b90825f939282370152565b9092919261015b61015682610118565b610103565b93818552602085019082840111610177576101759261013b565b565b6100b8565b9080601f8301121561019a5781602061019793359101610146565b90565b6100b4565b90565b6101ab8161019f565b036101b257565b5f80fd5b905035906101c3826101a2565b565b9190604083820312610205575f8301359067ffffffffffffffff8211610200576101f4816101fd93860161017c565b936020016101b6565b90565b6100b0565b6100ac565b60018060a01b031690565b61021e9061020a565b90565b61022a90610215565b9052565b9190610241905f60208501940190610221565b565b346102745761027061025f6102593660046101c5565b9061067a565b6102676100a2565b9182918261022e565b0390f35b6100a8565b61028281610215565b0361028957565b5f80fd5b9050359061029a82610279565b565b906020828203126102b5576102b2915f0161028d565b90565b6100ac565b5f0190565b346102ed576102d76102d236600461029c565b61072d565b6102df6100a2565b806102e9816102ba565b0390f35b6100a8565b5f9103126102fc57565b6100ac565b34610331576103113660046102f2565b61032d61031c610764565b6103246100a2565b9182918261022e565b0390f35b6100a8565b90916060828403126103845761034e835f840161028d565b9260208301359067ffffffffffffffff821161037f576103738161037c93860161017c565b936040016101b6565b90565b6100b0565b6100ac565b346103ba576103b66103a561039f366004610336565b9161078c565b6103ad6100a2565b9182918261022e565b0390f35b6100a8565b1c90565b90565b6103d69060086103db93026103bf565b6103c3565b90565b906103e991546103c6565b90565b6103f860025f906103de565b90565b90565b610407906103fb565b9052565b919061041e905f602085019401906103fe565b565b34610450576104303660046102f2565b61044c61043b6103ec565b6104436100a2565b9182918261040b565b0390f35b6100a8565b34610483576104653660046102f2565b61046d61081d565b6104756100a2565b8061047f816102ba565b0390f35b6100a8565b346104b8576104983660046102f2565b6104b46104a3610827565b6104ab6100a2565b9182918261022e565b0390f35b6100a8565b346104eb576104d56104d036600461029c565b6108a1565b6104dd6100a2565b806104e7816102ba565b0390f35b6100a8565b5f80fd5b5f90565b90565b90565b61051261050d610517926104f8565b6104fb565b6103fb565b90565b5f1c90565b61052b6105309161051a565b6103c3565b90565b61053d905461051f565b90565b634e487b7160e01b5f52601160045260245ffd5b61055d906103fb565b5f19811461056b5760010190565b610540565b5f1b90565b906105815f1991610570565b9181191691161790565b61059f61059a6105a4926103fb565b6104fb565b6103fb565b90565b90565b906105bf6105ba6105c69261058b565b6105a7565b8254610575565b9055565b6105de6105d96105e39261020a565b6104fb565b61020a565b90565b6105ef906105ca565b90565b6105fb906105e6565b90565b5190565b60209181520190565b90825f9392825e0152565b61063561063e6020936106439361062c816105fe565b93848093610602565b9586910161060b565b6100bc565b0190565b6106509061019f565b9052565b929160206106706106789360408701908782035f890152610616565b940190610647565b565b91906106846104f4565b506106ab5f6106943384906108d3565b6106a66106a08761098c565b926104fe565b610a3d565b926106c86106c16106bc6002610533565b610554565b60026105aa565b8390916106f57ffc6ca44b2e0253d7b333f816a6b6e52e7292a56fd5f38e52946f9dfc812d698b926105f2565b9261070a6107016100a2565b92839283610654565b0390a2565b6107209061071b610b2a565b610722565b565b61072b90610bb6565b565b6107369061070f565b565b60018060a01b031690565b61074f6107549161051a565b610738565b90565b6107619054610743565b90565b61076c6104f4565b506107776001610757565b90565b60200190565b610789906105e6565b90565b6107a56107cd936107ab9261079f6104f4565b506108d3565b9161098c565b6107bd6107b7826105fe565b9161077a565b206107c730610780565b91610c3b565b90565b6107d8610b2a565b6107e061080a565b565b6107f66107f16107fb926104f8565b6104fb565b61020a565b90565b610807906107e2565b90565b61081b6108165f6107fe565b610c6c565b565b6108256107d0565b565b61082f6104f4565b506108395f610757565b90565b61084d90610848610b2a565b61084f565b565b8061086a61086461085f5f6107fe565b610215565b91610215565b1461087a5761087890610c6c565b565b61089d6108865f6107fe565b5f918291631e4fbdf760e01b83526004830161022e565b0390fd5b6108aa9061083c565b565b5f90565b9160206108d19294936108ca60408201965f830190610221565b0190610647565b565b610906906108df6108ac565b506108f76108eb6100a2565b938492602084016108b0565b602082018103825203826100da565b610918610912826105fe565b9161077a565b2090565b606090565b916109449261093760408201935f830190610221565b6020818403910152610616565b90565b905090565b6109716109689260209261095f816105fe565b94858093610947565b9384910161060b565b0190565b61098390610989939261094c565b9061094c565b90565b61099461091c565b50610a0b61091e6109a760208201610103565b90808252610cd960208301396109e56109bf30610780565b6109d66109ca6100a2565b95869260208401610921565b602082018103825203846100da565b6109fc6109f06100a2565b93849260208401610975565b602082018103825203826100da565b90565b610a17906105e6565b90565b916020610a3b929493610a3460408201965f8301906103fe565b01906103fe565b565b919091610a486104f4565b50610a5230610a0e565b31610a65610a5f836103fb565b916103fb565b10610b0257610a73826105fe565b610a85610a7f5f6104fe565b916103fb565b14610ae65760208251920190f5903d1519821516610adb5781610ab8610ab2610aad5f6107fe565b610215565b91610215565b14610abf57565b5f63b06ebf3d60e01b815280610ad7600482016102ba565b0390fd5b6040513d5f823e3d90fd5b5f631328927760e21b815280610afe600482016102ba565b0390fd5b610b0b30610a0e565b31610b265f92839263cf47918160e01b845260048401610a1a565b0390fd5b610b32610827565b610b4b610b45610b40610ccb565b610215565b91610215565b03610b5257565b610b74610b5d610ccb565b5f91829163118cdaa760e01b83526004830161022e565b0390fd5b90610b8960018060a01b0391610570565b9181191691161790565b90565b90610bab610ba6610bb2926105f2565b610b93565b8254610b78565b9055565b803b610bca610bc45f6104fe565b916103fb565b14610c1c57610bda816001610b96565b610c047fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b916105f2565b90610c0d6100a2565b80610c17816102ba565b0390a2565b610c37905f91829163211eb15960e21b83526004830161022e565b0390fd5b91600b92610c476104f4565b50604051926040840152602083015281520160ff8153605560018060a01b0391201690565b610c755f610757565b610c7f825f610b96565b90610cb3610cad7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0936105f2565b916105f2565b91610cbc6100a2565b80610cc6816102ba565b0390a3565b610cd36104f4565b50339056fe60a060405261001561000f6101a6565b906101c8565b61001d610034565b61023e6106e08239608051816101e6015261023e90f35b60405190565b601f801991011690565b634e487b7160e01b5f52604160045260245ffd5b906100629061003a565b810190811060018060401b0382111761007a57604052565b610044565b9061009261008b610034565b9283610058565b565b5f80fd5b5f80fd5b60018060a01b031690565b6100b09061009c565b90565b6100bc816100a7565b036100c357565b5f80fd5b905051906100d4826100b3565b565b5f80fd5b5f80fd5b60018060401b0381116100fa576100f660209161003a565b0190565b610044565b90825f9392825e0152565b9092919261011f61011a826100de565b61007f565b9381855260208501908284011161013b57610139926100ff565b565b6100da565b9080601f8301121561015e5781602061015b9351910161010a565b90565b6100d6565b9190916040818403126101a15761017c835f83016100c7565b92602082015160018060401b03811161019c576101999201610140565b90565b610098565b610094565b6101c461091e803803806101b98161007f565b928339810190610163565b9091565b906101d39082610292565b608052565b90565b6101ef6101ea6101f49261009c565b6101d8565b61009c565b90565b610200906101db565b90565b61020c906101f7565b90565b5f0190565b5190565b90565b90565b61023261022d6102379261021b565b6101d8565b610218565b90565b610243906101db565b90565b61024f9061023a565b90565b61025b906101f7565b90565b60e01b90565b9060208282031261027d5761027a915f016100c7565b90565b610094565b61028a610034565b3d5f823e3d90fd5b9061029c82610453565b816102c77f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e91610203565b906102d0610034565b806102da8161020f565b0390a26102e681610214565b6102f86102f25f61021e565b91610218565b115f1461039157602061031561031061032b94610246565b610252565b635c60da1b90610323610034565b94859261025e565b8252818061033b6004820161020f565b03915afa90811561038c57610358925f9261035c575b50906105de565b505b565b61037e91925060203d8111610385575b6103768183610058565b810190610264565b905f610351565b503d61036c565b610282565b505061039b610563565b61035a565b6103a9906100a7565b9052565b91906103c0905f602085019401906103a0565b565b90565b90565b5f1b90565b6103e16103dc6103e6926103c2565b6103c8565b6103c5565b90565b6104127fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d506103cd565b90565b9061042660018060a01b03916103c8565b9181191691161790565b90565b9061044861044361044f92610203565b610430565b8254610415565b9055565b803b6104676104615f61021e565b91610218565b1461054457602061049d610498836104936104b3955f61048d6104886103e9565b61060d565b01610433565b610246565b610252565b635c60da1b906104ab610034565b93849261025e565b825281806104c36004820161020f565b03915afa90811561053f575f91610511575b50803b6104ea6104e45f61021e565b91610218565b146104f25750565b61050d905f918291634c9c8ce360e01b8352600483016103ad565b0390fd5b610532915060203d8111610538575b61052a8183610058565b810190610264565b5f6104d5565b503d610520565b610282565b61055f905f918291631933b43b60e21b8352600483016103ad565b0390fd5b346105766105705f61021e565b91610218565b1161057d57565b5f63b398979f60e01b8152806105956004820161020f565b0390fd5b606090565b906105b06105ab836100de565b61007f565b918252565b3d5f146105d0576105c53d61059e565b903d5f602084013e5b565b6105d8610599565b906105ce565b5f8061060a936105ec610599565b508390602081019051915af4906106016105b5565b90919091610615565b90565b90565b151590565b9061062990610622610599565b5015610610565b5f146106355750610699565b61063e82610214565b61065061064a5f61021e565b91610218565b148061067e575b61065f575090565b61067a905f918291639996b31560e01b8352600483016103ad565b0390fd5b50803b61069361068d5f61021e565b91610218565b14610657565b6106a281610214565b6106b46106ae5f61021e565b91610218565b115f146106c357805190602001fd5b5f63d6bda27560e01b8152806106db6004820161020f565b0390fdfe608060405261000c610128565b6101bd565b5f90565b60018060a01b031690565b90565b61003761003261003c92610015565b610020565b610015565b90565b61004890610023565b90565b6100549061003f565b90565b61006090610023565b90565b61006c90610057565b90565b60405190565b601f801991011690565b634e487b7160e01b5f52604160045260245ffd5b9061009d90610075565b810190811067ffffffffffffffff8211176100b757604052565b61007f565b60e01b90565b5f80fd5b6100cf90610015565b90565b6100db816100c6565b036100e257565b5f80fd5b905051906100f3826100d2565b565b9060208282031261010e5761010b915f016100e6565b90565b6100c2565b5f0190565b61012061006f565b3d5f823e3d90fd5b610130610011565b50610164602061014e6101496101446101db565b61004b565b610063565b635c60da1b9061015c61006f565b9384926100bc565b8252818061017460048201610113565b03915afa9081156101b8575f9161018a575b5090565b6101ab915060203d81116101b1575b6101a38183610093565b8101906100f5565b5f610186565b503d610199565b610118565b5f8091368280378136915af43d5f803e5f146101d7573d5ff35b3d5ffd5b6101e3610011565b507f00000000000000000000000000000000000000000000000000000000000000009056fea2646970667358221220475f111ed0b2b68df6e9b479f8b3550d1b5eb65bd302ad96259965703faac2ed64736f6c634300081a0033a2646970667358221220ec70fedcd4e5965f98770a6480487c92ef71cc51daff4bb00917301dc578aec364736f6c634300081a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000057a2a1cc13a9af430976af912a27a05de537673000000000000000000000000639d2dd24304ac2e6a691d8c1cff4a2665925fee
-----Decoded View---------------
Arg [0] : _implementation (address): 0x057A2a1CC13A9Af430976af912A27A05DE537673
Arg [1] : _owner (address): 0x639d2dD24304aC2e6A691d8c1cFf4a2665925fee
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000057a2a1cc13a9af430976af912a27a05de537673
Arg [1] : 000000000000000000000000639d2dd24304ac2e6a691d8c1cff4a2665925fee
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.