Verified contractExactMIT
TransparentUpgradeableProxy
Address0x1fc1bc7ef87ace92a3f2eed44581111eb1ffdeaf
- Balance
0 ETH
- Transactions
1,073
- Compiler
solc 0.8.20
- Same code
1,298 more contracts
Details
- Compiler
- solc 0.8.20+commit.a1b79de6
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- paris
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 22,588,045
- Creation transaction
- 0x30bd0ef21a…5d5027257b
- Proxy implementation
- 0x5daa068b…d162084bSimpleOFTAdapter
- Main copy (most transactions)
- 0xda5e1988…847cbef6
112 files
The source code is large: one file is shown at a time. Choose a file in the list.
- @openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.solmain6.37 KB
- @openzeppelin/contracts-upgradeable/../proxy/utils/Initializable.sol8.91 KB
- @openzeppelin/contracts-upgradeable/../utils/ContextUpgradeable.sol1.19 KB
- @openzeppelin/contracts-upgradeable/../utils/introspection/ERC165Upgradeable.sol1.18 KB
- @openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol4.03 KB
- @openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol8.91 KB
- @openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol19.4 KB
- @openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol1.19 KB
- @openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol3.86 KB
- @openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol4.36 KB
- @openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol1.18 KB
- @openzeppelin/contracts/access/AccessControl.sol7.05 KB
- @openzeppelin/contracts/access/IAccessControl.sol3.26 KB
- @openzeppelin/contracts/access/Ownable.sol3.1 KB
- @openzeppelin/contracts/contracts-upgradeable/../proxy/utils/Initializable.sol8.91 KB
- @openzeppelin/contracts/contracts-upgradeable/../utils/ContextUpgradeable.sol1.19 KB
- @openzeppelin/contracts/contracts-upgradeable/../utils/introspection/ERC165Upgradeable.sol1.18 KB
- @openzeppelin/contracts/contracts-upgradeable/access/OwnableUpgradeable.sol4.03 KB
- @openzeppelin/contracts/contracts-upgradeable/proxy/utils/Initializable.sol8.91 KB
- @openzeppelin/contracts/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol19.4 KB
- @openzeppelin/contracts/contracts-upgradeable/utils/ContextUpgradeable.sol1.19 KB
- @openzeppelin/contracts/contracts-upgradeable/utils/PausableUpgradeable.sol3.86 KB
- @openzeppelin/contracts/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol4.36 KB
- @openzeppelin/contracts/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol1.18 KB
- @openzeppelin/contracts/interfaces/IERC1967.sol636 B
- @openzeppelin/contracts/interfaces/IERC20.sol181 B
- @openzeppelin/contracts/interfaces/IERC20Metadata.sol216 B
- @openzeppelin/contracts/interfaces/IERC5267.sol739 B
- @openzeppelin/contracts/interfaces/draft-IERC6093.sol6.53 KB
- @openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol1.72 KB
- @openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol6.72 KB
- @openzeppelin/contracts/proxy/Proxy.sol2.67 KB
- @openzeppelin/contracts/proxy/beacon/BeaconProxy.sol2.31 KB
- @openzeppelin/contracts/proxy/beacon/IBeacon.sol472 B
- @openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol2.22 KB
- @openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol1.95 KB
- @openzeppelin/contracts/proxy/utils/Initializable.sol8.91 KB
- @openzeppelin/contracts/token/ERC20/ERC20.sol11.14 KB
- @openzeppelin/contracts/token/ERC20/IERC20.sol2.78 KB
- @openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol1.18 KB
- @openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol2.77 KB
- @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol683 B
- @openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol3.8 KB
- @openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol5.77 KB
- @openzeppelin/contracts/token/ERC721/IERC721.sol4.93 KB
- @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol995 B
- @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol792 B
- @openzeppelin/contracts/utils/Address.sol6.26 KB
- @openzeppelin/contracts/utils/Context.sol963 B
- @openzeppelin/contracts/utils/ContextUpgradeable.sol1.19 KB
- @openzeppelin/contracts/utils/Create2.sol4.37 KB
- @openzeppelin/contracts/utils/Nonces.sol1.49 KB
- @openzeppelin/contracts/utils/ShortStrings.sol4.31 KB
- @openzeppelin/contracts/utils/StorageSlot.sol3.93 KB
- @openzeppelin/contracts/utils/Strings.sol3.1 KB
- @openzeppelin/contracts/utils/cryptography/ECDSA.sol7.73 KB
- @openzeppelin/contracts/utils/cryptography/EIP712.sol6.61 KB
- @openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol3.76 KB
- @openzeppelin/contracts/utils/introspection/ERC165.sol911 B
- @openzeppelin/contracts/utils/introspection/ERC165Upgradeable.sol1.18 KB
- @openzeppelin/contracts/utils/introspection/IERC165.sol869 B
- @openzeppelin/contracts/utils/math/Math.sol15.12 KB
- @openzeppelin/contracts/utils/math/SignedMath.sol1.26 KB
- @openzeppelin/proxy/utils/Initializable.sol8.91 KB
- @openzeppelin/utils/ContextUpgradeable.sol1.19 KB
- @openzeppelin/utils/introspection/ERC165Upgradeable.sol1.18 KB
- contracts/NFT/ERC721V1.sol6.77 KB
- contracts/NFT/ERC721V2.sol1.14 KB
- contracts/NFT/burnRegistry/BurnRegistryV1.sol4.14 KB
- contracts/Proxies.sol218 B
- contracts/XERC20/XERC20.sol10.99 KB
- contracts/XERC20/XERC20Lockbox.sol4.34 KB
- contracts/bridge/InceptionBridge.sol11.92 KB
- contracts/bridge/InceptionBridgeStorage.sol8.87 KB
- contracts/bridgeMiddleware/BridgeMiddleware.sol2.01 KB
- contracts/bridgeMiddleware/MinimalProxyFactory.sol2.17 KB
- contracts/factory/BridgeFactory.sol6.78 KB
- contracts/governance/GovernorMultisig.sol1.64 KB
- contracts/governance/Multiownable.sol8.52 KB
- contracts/interfaces/IAcrossSpokePool.sol655 B
- contracts/interfaces/IERC20.sol874 B
- contracts/interfaces/IFactory.sol1.45 KB
- contracts/interfaces/IInceptionBridge.sol2.05 KB
- contracts/interfaces/IInceptionBridgeErrors.sol1.02 KB
- contracts/interfaces/IInceptionRatioFeed.sol973 B
- contracts/interfaces/IPriceFeed.sol304 B
- contracts/interfaces/IRateProvider.sol178 B
- contracts/interfaces/IXERC20.sol4.25 KB
- contracts/interfaces/IXERC20Lockbox.sol2.47 KB
- contracts/lib/CallDataRLPReader.sol3.66 KB
- contracts/lib/EthereumVerifier.sol6.58 KB
- contracts/lib/ProofParser.sol1.19 KB
- contracts/lib/Utils.sol2.07 KB
- contracts/mock/AcrossSpokePoolMock.sol1.33 KB
- contracts/mock/ERC20Mock.sol507 B
- contracts/mock/PriceFeedMock.sol824 B
- contracts/multicall/Multicall3.sol9.61 KB
- contracts/proxy/InitializableERC1967Proxy.sol716 B
- contracts/proxy/InitializableTransparentUpgradeableProxy.sol6.28 KB
- contracts/proxy/Proxy.sol343 B
- contracts/rate_providers/InETH/InETHRateProvider.sol552 B
- contracts/rate_providers/InceptionRateProvider.sol1.59 KB
- contracts/rate_providers/InstETH/InstETHRateProvider.sol560 B
- contracts/ratio_feed/InceptionRatioFeed.sol6.26 KB
- contracts/storage/Storage.sol3.77 KB
- contracts/tests/ERC20Mintable.sol498 B
- contracts/tests/MultipleDepositor.sol848 B
- contracts/tokens/EVE.sol391 B
- contracts/tokens/USDC.sol927 B
- contracts/tokens/USDT.sol927 B
- contracts/treasury/TreasuryV1.sol2.34 KB
- contracts/vault/VaultV1.sol4.82 KB
@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol
// 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
* things that go hand in hand:
*
* 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if
* that call matches the {ITransparentUpgradeableProxy-upgradeToAndCall} function exposed by the proxy itself.
* 2. If the admin calls the proxy, it can call the `upgradeToAndCall` function but any other call won't be forwarded to
* the implementation. If the admin tries to call a function on the implementation it will fail with an error indicating
* the proxy admin cannot fallback to the target implementation.
*
* These properties mean that the admin account can only be used for upgrading the proxy, so it's best if it's a
* dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to
* call a function from the proxy implementation. For this reason, the proxy deploys an instance of {ProxyAdmin} and
* allows upgrades only if they come through it. You should think of the `ProxyAdmin` instance as the administrative
* interface of the proxy, including the ability to change who can trigger upgrades by transferring ownership.
*
* NOTE: The real interface of this proxy is that defined in `ITransparentUpgradeableProxy`. This contract does not
* inherit from that interface, and instead `upgradeToAndCall` is implicitly implemented using a custom dispatch
* mechanism in `_fallback`. Consequently, the compiler will not produce an ABI for this contract. This is necessary to
* fully implement transparency without decoding reverts caused by selector clashes between the proxy and the
* implementation.
*
* NOTE: This proxy does not inherit from {Context} deliberately. The {ProxyAdmin} of this contract won't send a
* meta-transaction in any way, and any other meta-transaction setup should be made in the implementation contract.
*
* IMPORTANT: This contract avoids unnecessary storage reads by setting the admin only during construction as an
* immutable variable, preventing any changes thereafter. However, the admin slot defined in ERC-1967 can still be
* overwritten by the implementation logic pointed to by this proxy. In such cases, the contract may end up in an
* undesirable state where the admin slot is different from the actual admin.
*
* WARNING: It is not recommended to extend this contract to add additional external functions. If you do so, the
* compiler will not check that there are no selector conflicts, due to the note above. A selector clash between any new
* function and the functions declared in {ITransparentUpgradeableProxy} will be resolved in favor of the new one. This
* could render the `upgradeToAndCall` function inaccessible, preventing upgradeability and compromising transparency.
*/
contract TransparentUpgradeableProxy is ERC1967Proxy {
// An immutable address for the admin to avoid unnecessary SLOADs before each call
// at the expense of removing the ability to change the admin once it's set.
// This is acceptable if the admin is always a ProxyAdmin instance or similar contract
// with its own ability to transfer the permissions to another account.
address private immutable _admin;
/**
* @dev The proxy caller is the current admin, and can't fallback to the proxy target.
*/
error ProxyDeniedAdminAccess();
/**
* @dev Initializes an upgradeable proxy managed by an instance of a {ProxyAdmin} with an `initialOwner`,
* backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in
* {ERC1967Proxy-constructor}.
*/
constructor(address _logic, address initialOwner, bytes memory _data) payable ERC1967Proxy(_logic, _data) {
_admin = address(new ProxyAdmin(initialOwner));
// Set the storage value and emit an event for ERC-1967 compatibility
ERC1967Utils.changeAdmin(_proxyAdmin());
}
/**
* @dev Returns the admin of this proxy.
*/
function _proxyAdmin() internal virtual returns (address) {
return _admin;
}
/**
* @dev If caller is the admin process the call internally, otherwise transparently fallback to the proxy behavior.
*/
function _fallback() internal virtual override {
if (msg.sender == _proxyAdmin()) {
if (msg.sig != ITransparentUpgradeableProxy.upgradeToAndCall.selector) {
revert ProxyDeniedAdminAccess();
} else {
_dispatchUpgradeToAndCall();
}
} else {
super._fallback();
}
}
/**
* @dev Upgrade the implementation of the proxy. See {ERC1967Utils-upgradeToAndCall}.
*
* Requirements:
*
* - If `data` is empty, `msg.value` must be zero.
*/
function _dispatchUpgradeToAndCall() private {
(address newImplementation, bytes memory data) = abi.decode(msg.data[4:], (address, bytes));
ERC1967Utils.upgradeToAndCall(newImplementation, data);
}
}
Compiler settingsShow
{
"metadata": {
"bytecodeHash": "ipfs"
},
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "paris",
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.