Source Code
Overview
S Balance
0 S
More Info
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Loading...
Loading
Contract Name:
ERC1967Proxy
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (proxy/ERC1967/ERC1967Proxy.sol)pragma solidity ^0.8.20;import {Proxy} from "../Proxy.sol";import {ERC1967Utils} from "./ERC1967Utils.sol";/*** @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an* implementation address that can be changed. This address is stored in storage in the location specified by* https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the* implementation behind the proxy.*/contract ERC1967Proxy is Proxy {/*** @dev Initializes the upgradeable proxy with an initial implementation specified by `implementation`.** If `_data` is nonempty, it's used as data in a delegate call to `implementation`. This will typically be an* encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.** Requirements:** - If `data` is empty, `msg.value` must be zero.*/constructor(address implementation, bytes memory _data) payable {
1234567891011121314151617181920212223242526// 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);
123456789101112131415161718192021222324// 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);}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.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[EIP1967] 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;
12345678910111213141516// 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);}
1234567891011121314151617181920212223242526// 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);
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (proxy/ERC1967/ERC1967Utils.sol)pragma solidity ^0.8.20;import {IBeacon} from "../beacon/IBeacon.sol";import {Address} from "../../utils/Address.sol";import {StorageSlot} from "../../utils/StorageSlot.sol";/*** @dev This abstract contract provides getters and event emitting update functions for* https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.*/library ERC1967Utils {// We re-declare ERC-1967 events here because they can't be used directly from IERC1967.// This will be fixed in Solidity 0.8.21. At that point we should remove these events./*** @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);
1234567891011121314151617181920212223242526// 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.
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (proxy/transparent/ProxyAdmin.sol)pragma solidity ^0.8.20;import {ITransparentUpgradeableProxy} from "./TransparentUpgradeableProxy.sol";import {Ownable} from "../../access/Ownable.sol";/*** @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an* explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.*/contract ProxyAdmin is Ownable {/*** @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgrade(address)`* and `upgradeAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,* while `upgradeAndCall` will invoke the `receive` function if the second argument is the empty byte string.* If the getter returns `"5.0.0"`, only `upgradeAndCall(address,bytes)` is present, and the second argument must* be the empty byte string if no function should be called, making it impossible to invoke the `receive` function* during an upgrade.*/string public constant UPGRADE_INTERFACE_VERSION = "5.0.0";/*** @dev Sets the initial owner who can perform upgrades.*/
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (proxy/transparent/TransparentUpgradeableProxy.sol)pragma solidity ^0.8.20;import {ERC1967Utils} from "../ERC1967/ERC1967Utils.sol";import {ERC1967Proxy} from "../ERC1967/ERC1967Proxy.sol";import {IERC1967} from "../../interfaces/IERC1967.sol";import {ProxyAdmin} from "./ProxyAdmin.sol";/*** @dev Interface for {TransparentUpgradeableProxy}. In order to implement transparency, {TransparentUpgradeableProxy}* does not implement this interface directly, and its upgradeability mechanism is implemented by an internal dispatch* mechanism. The compiler is unaware that these functions are implemented by {TransparentUpgradeableProxy} and will not* include them in the ABI so this interface must be used to interact with it.*/interface ITransparentUpgradeableProxy is IERC1967 {function upgradeToAndCall(address, bytes calldata) external payable;}/*** @dev This contract implements a proxy that is upgradeable through an associated {ProxyAdmin} instance.** To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector* clashing], which can potentially be used in an attack, this contract uses the* https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)pragma solidity ^0.8.20;/*** @dev Collection of functions related to the address type*/library Address {/*** @dev The ETH balance of the account is not enough to perform the operation.*/error AddressInsufficientBalance(address account);/*** @dev There's no code at `target` (it is not a contract).*/error AddressEmptyCode(address target);/*** @dev A call to an address target failed. The target may have reverted.*/error FailedInnerCall();/*** @dev Replacement for Solidity's `transfer`: sends `amount` wei to
1234567891011121314151617181920212223242526// 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;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.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 ERC1967 implementation slot:* ```solidity* contract ERC1967 {* 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;
12345678910111213141516171819{"optimizer": {"enabled": true,"runs": 200},"outputSelection": {"*": {"*": ["evm.bytecode","evm.deployedBytecode","devdoc","userdoc","metadata","abi"]}},"evmVersion": "paris"}
[{"inputs":[{"internalType":"address","name":"implementation","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"stateMutability":"payable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"stateMutability":"payable","type":"fallback"}]
Contract Creation Code
608060405260405161040a38038061040a83398101604081905261002291610268565b61002c8282610033565b5050610352565b61003c82610092565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a280511561008657610081828261010e565b505050565b61008e610185565b5050565b806001600160a01b03163b6000036100cd57604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161012b9190610336565b600060405180830381855af49150503d8060008114610166576040519150601f19603f3d011682016040523d82523d6000602084013e61016b565b606091505b50909250905061017c8583836101a6565b95945050505050565b34156101a45760405163b398979f60e01b815260040160405180910390fd5b565b6060826101bb576101b682610205565b6101fe565b81511580156101d257506001600160a01b0384163b155b156101fb57604051639996b31560e01b81526001600160a01b03851660048201526024016100c4565b50805b9392505050565b8051156102155780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b634e487b7160e01b600052604160045260246000fd5b60005b8381101561025f578181015183820152602001610247565b50506000910152565b6000806040838503121561027b57600080fd5b82516001600160a01b038116811461029257600080fd5b60208401519092506001600160401b03808211156102af57600080fd5b818501915085601f8301126102c357600080fd5b8151818111156102d5576102d561022e565b604051601f8201601f19908116603f011681019083821181831017156102fd576102fd61022e565b8160405282815288602084870101111561031657600080fd5b610327836020830160208801610244565b80955050505050509250929050565b60008251610348818460208701610244565b9190910192915050565b60aa806103606000396000f3fe6080604052600a600c565b005b60186014601a565b6051565b565b6000604c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015606f573d6000f35b3d6000fdfea2646970667358221220d0232cfa81216c3e4973e570f043b57ccb69ae4a81b8bc064338713721c87a9f64736f6c63430008140033000000000000000000000000ac63e55a9d6b331987072f98bedf216f51370e2800000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000124883b53e80000000000000000000000003ba925fdeae6b46d0bb4d424d829982cb2f7309e0000000000000000000000003291b1ae6b74d59a4334bba0257873dda5d18115000000000000000000000000dffef99d0456a3a87cd0d4d322c6db13cbf1e8db0000000000000000000000002688c2bb0eeea0cd10de520699090a36469d788a00000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600a600c565b005b60186014601a565b6051565b565b6000604c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015606f573d6000f35b3d6000fdfea2646970667358221220d0232cfa81216c3e4973e570f043b57ccb69ae4a81b8bc064338713721c87a9f64736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ac63e55a9d6b331987072f98bedf216f51370e2800000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000124883b53e80000000000000000000000003ba925fdeae6b46d0bb4d424d829982cb2f7309e0000000000000000000000003291b1ae6b74d59a4334bba0257873dda5d18115000000000000000000000000dffef99d0456a3a87cd0d4d322c6db13cbf1e8db0000000000000000000000002688c2bb0eeea0cd10de520699090a36469d788a00000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : implementation (address): 0xaC63e55a9D6B331987072f98beDf216F51370E28
Arg [1] : _data (bytes): 0x883b53e80000000000000000000000003ba925fdeae6b46d0bb4d424d829982cb2f7309e0000000000000000000000003291b1ae6b74d59a4334bba0257873dda5d18115000000000000000000000000dffef99d0456a3a87cd0d4d322c6db13cbf1e8db0000000000000000000000002688c2bb0eeea0cd10de520699090a36469d788a00000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-----Encoded View---------------
13 Constructor Arguments found :
Arg [0] : 000000000000000000000000ac63e55a9d6b331987072f98bedf216f51370e28
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000124
Arg [3] : 883b53e80000000000000000000000003ba925fdeae6b46d0bb4d424d829982c
Arg [4] : b2f7309e0000000000000000000000003291b1ae6b74d59a4334bba0257873dd
Arg [5] : a5d18115000000000000000000000000dffef99d0456a3a87cd0d4d322c6db13
Arg [6] : cbf1e8db0000000000000000000000002688c2bb0eeea0cd10de520699090a36
Arg [7] : 469d788a00000000000000000000000000000000000000000000000000000000
Arg [8] : 000186a000000000000000000000000000000000000000000000000000000000
Arg [9] : 000000e000000000000000000000000000000000000000000000000000000000
Arg [10] : 0000010000000000000000000000000000000000000000000000000000000000
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.