Verified contractExactMIT
TransparentUpgradeableProxy
Address0xe1de9910fe71cc216490ac7fcf019e13a34481d7
- Balance
0 ETH
- Transactions
7,619
- Compiler
solc 0.8.19
- Same code
250 more contracts
Details
- Compiler
- solc 0.8.19+commit.7dd6d404
- Language
- solidity
- Optimization
- Yes, 999,999 runs
- EVM version
- paris
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 20,785,718
- Creation transaction
- 0xbfc967b9bb…4349ebe1c3
- Proxy implementation
- 0x81622ed0…e0d7b454source code not verified
259 files
The source code is large: one file is shown at a time. Choose a file in the list.
- @openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.solmain8.34 KB
- @arbitrum/nitro-contracts/src/bridge/IBridge.sol4.45 KB
- @arbitrum/nitro-contracts/src/bridge/IOutbox.sol5.5 KB
- @arbitrum/nitro-contracts/src/bridge/IOwnable.sol337 B
- @arbitrum/nitro-contracts/src/precompiles/ArbSys.sol5.38 KB
- @layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol2.7 KB
- @layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol2.68 KB
- @layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingChannel.sol1.43 KB
- @layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingComposer.sol1.03 KB
- @layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingContext.sol239 B
- @layerzerolabs/lz-evm-v1-0.7/contracts/interfaces/ILayerZeroEndpoint.sol5.9 KB
- @layerzerolabs/lz-evm-v1-0.7/contracts/interfaces/ILayerZeroUserApplicationConfig.sol1.36 KB
- @openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol3.15 KB
- @openzeppelin/contracts-upgradeable/interfaces/IERC1271Upgradeable.sol677 B
- @openzeppelin/contracts-upgradeable/interfaces/IERC165Upgradeable.sol172 B
- @openzeppelin/contracts-upgradeable/interfaces/IERC4906Upgradeable.sol865 B
- @openzeppelin/contracts-upgradeable/interfaces/IERC721Upgradeable.sol165 B
- @openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol6.64 KB
- @openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol13.47 KB
- @openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol2.75 KB
- @openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol716 B
- @openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol17.86 KB
- @openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol998 B
- @openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol4.91 KB
- @openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol7.45 KB
- @openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol2.87 KB
- @openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721EnumerableUpgradeable.sol1.06 KB
- @openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.sol794 B
- @openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol9.38 KB
- @openzeppelin/contracts-upgradeable/utils/CheckpointsUpgradeable.sol20.62 KB
- @openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol1.35 KB
- @openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol2.85 KB
- @openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol9.16 KB
- @openzeppelin/contracts-upgradeable/utils/cryptography/SignatureCheckerUpgradeable.sol2.35 KB
- @openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol1.52 KB
- @openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol864 B
- @openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol12.8 KB
- @openzeppelin/contracts-upgradeable/utils/math/SafeCastUpgradeable.sol35.09 KB
- @openzeppelin/contracts-upgradeable/utils/math/SignedMathUpgradeable.sol1.27 KB
- @openzeppelin/contracts/access/AccessControl.sol8.23 KB
- @openzeppelin/contracts/access/IAccessControl.sol2.92 KB
- @openzeppelin/contracts/access/Ownable.sol2.62 KB
- @openzeppelin/contracts/crosschain/CrossChainEnabled.sol1.81 KB
- @openzeppelin/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL1.sol1.52 KB
- @openzeppelin/contracts/crosschain/arbitrum/LibArbitrumL1.sol1.58 KB
- @openzeppelin/contracts/crosschain/errors.sol222 B
- @openzeppelin/contracts/crosschain/optimism/CrossChainEnabledOptimism.sol1.42 KB
- @openzeppelin/contracts/crosschain/optimism/LibOptimism.sol1.39 KB
- @openzeppelin/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.sol2.58 KB
- @openzeppelin/contracts/governance/TimelockController.sol14.82 KB
- @openzeppelin/contracts/interfaces/IERC1967.sol667 B
- @openzeppelin/contracts/interfaces/IERC20.sol151 B
- @openzeppelin/contracts/interfaces/IERC4626.sol12.18 KB
- @openzeppelin/contracts/interfaces/draft-IERC1822.sol879 B
- @openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol1.29 KB
- @openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol6.04 KB
- @openzeppelin/contracts/proxy/Proxy.sol3.25 KB
- @openzeppelin/contracts/proxy/beacon/IBeacon.sol450 B
- @openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol2.86 KB
- @openzeppelin/contracts/security/Pausable.sol2.55 KB
- @openzeppelin/contracts/security/ReentrancyGuard.sol3.13 KB
- @openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol2.5 KB
- @openzeppelin/contracts/token/ERC20/ERC20.sol12.85 KB
- @openzeppelin/contracts/token/ERC20/IERC20.sol2.74 KB
- @openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol11.45 KB
- @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol683 B
- @openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol2.26 KB
- @openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol6.94 KB
- @openzeppelin/contracts/token/ERC721/ERC721.sol17.01 KB
- @openzeppelin/contracts/token/ERC721/IERC721.sol4.88 KB
- @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol987 B
- @openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol6.81 KB
- @openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol1.02 KB
- @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol761 B
- @openzeppelin/contracts/utils/Address.sol9.36 KB
- @openzeppelin/contracts/utils/Context.sol844 B
- @openzeppelin/contracts/utils/Create2.sol3.95 KB
- @openzeppelin/contracts/utils/StorageSlot.sol4.11 KB
- @openzeppelin/contracts/utils/Strings.sol2.78 KB
- @openzeppelin/contracts/utils/cryptography/ECDSA.sol9.13 KB
- @openzeppelin/contracts/utils/introspection/ERC165.sol987 B
- @openzeppelin/contracts/utils/introspection/IERC165.sol853 B
- @openzeppelin/contracts/utils/math/Math.sol12.79 KB
- @openzeppelin/contracts/utils/math/SignedMath.sol1.26 KB
- @openzeppelin/contracts/utils/structs/EnumerableMap.sol21.33 KB
- @openzeppelin/contracts/utils/structs/EnumerableSet.sol12.96 KB
- @openzeppelin/contracts/vendor/arbitrum/IBridge.sol3.89 KB
- @openzeppelin/contracts/vendor/arbitrum/IOutbox.sol5.25 KB
- @openzeppelin/contracts/vendor/optimism/ICrossDomainMessenger.sol1.05 KB
- @openzeppelin/contracts/vendor/polygon/IFxMessageProcessor.sol291 B
- contracts/Mailbox.sol15.06 KB
- contracts/avs/ECDSAServiceManagerBase.sol11.01 KB
- contracts/avs/ECDSAStakeRegistry.sol26.43 KB
- contracts/avs/ECDSAStakeRegistryStorage.sol2.4 KB
- contracts/avs/HyperlaneServiceManager.sol10.07 KB
- contracts/client/GasRouter.sol2.74 KB
- contracts/client/MailboxClient.sol3.07 KB
- contracts/client/Router.sol7.77 KB
- contracts/hooks/ArbL2ToL1Hook.sol2.67 KB
- contracts/hooks/MerkleTreeHook.sol2.72 KB
- contracts/hooks/OPStackHook.sol2.79 KB
- contracts/hooks/PausableHook.sol1.58 KB
- contracts/hooks/PolygonPosHook.sol2.54 KB
- contracts/hooks/ProtocolFee.sol4.11 KB
- contracts/hooks/aggregation/ERC5164Hook.sol2.06 KB
- contracts/hooks/aggregation/StaticAggregationHook.sol2.13 KB
- contracts/hooks/aggregation/StaticAggregationHookFactory.sol826 B
- contracts/hooks/igp/InterchainGasPaymaster.sol11.15 KB
- contracts/hooks/igp/StorageGasOracle.sol3.5 KB
- contracts/hooks/layer-zero/LayerZeroV1Hook.sol4.66 KB
- contracts/hooks/layer-zero/LayerZeroV2Hook.sol4.52 KB
- contracts/hooks/libs/AbstractMessageIdAuthHook.sol3.26 KB
- contracts/hooks/libs/AbstractPostDispatchHook.sol2.59 KB
- contracts/hooks/libs/StandardHookMetadata.sol5.55 KB
- contracts/hooks/routing/DestinationRecipientRoutingHook.sol1.62 KB
- contracts/hooks/routing/DomainRoutingHook.sol3.1 KB
- contracts/hooks/routing/FallbackDomainRoutingHook.sol1.76 KB
- contracts/hooks/warp-route/RateLimitedHook.sol1.93 KB
- contracts/interfaces/IGasOracle.sol488 B
- contracts/interfaces/IInterchainGasPaymaster.sol1.06 KB
- contracts/interfaces/IInterchainSecurityModule.sol1.29 KB
- contracts/interfaces/ILiquidityLayerMessageRecipient.sol288 B
- contracts/interfaces/ILiquidityLayerRouter.sol364 B
- contracts/interfaces/IMailbox.sol3.45 KB
- contracts/interfaces/IMessageRecipient.sol231 B
- contracts/interfaces/IRouter.sol428 B
- contracts/interfaces/IValidatorAnnounce.sol1.05 KB
- contracts/interfaces/avs/IRemoteChallenger.sol836 B
- contracts/interfaces/avs/vendored/IAVSDirectory.sol726 B
- contracts/interfaces/avs/vendored/IDelegationManager.sol1.4 KB
- contracts/interfaces/avs/vendored/IECDSAStakeRegistryEventsAndErrors.sol4.44 KB
- contracts/interfaces/avs/vendored/IPaymentCoordinator.sol1.92 KB
- contracts/interfaces/avs/vendored/IServiceManager.sol1.45 KB
- contracts/interfaces/avs/vendored/IServiceManagerUI.sol2.9 KB
- contracts/interfaces/avs/vendored/ISignatureUtils.sol1.07 KB
- contracts/interfaces/avs/vendored/ISlasher.sol334 B
- contracts/interfaces/avs/vendored/IStrategy.sol5.52 KB
- contracts/interfaces/hooks/IMessageDispatcher.sol917 B
- contracts/interfaces/hooks/IPostDispatchHook.sol1.84 KB
- contracts/interfaces/isms/IAggregationIsm.sol723 B
- contracts/interfaces/isms/ICcipReadIsm.sol1.18 KB
- contracts/interfaces/isms/IMultisigIsm.sol823 B
- contracts/interfaces/isms/IRoutingIsm.sol577 B
- contracts/interfaces/optimism/ICrossDomainMessenger.sol1.15 KB
- contracts/isms/NoopIsm.sol417 B
- contracts/isms/PausableIsm.sol1.03 KB
- contracts/isms/TrustedRelayerIsm.sol856 B
- contracts/isms/aggregation/AbstractAggregationIsm.sol2.6 KB
- contracts/isms/aggregation/StaticAggregationIsm.sol1.07 KB
- contracts/isms/aggregation/StaticAggregationIsmFactory.sol526 B
- contracts/isms/ccip-read/AbstractCcipReadIsm.sol1.59 KB
- contracts/isms/hook/AbstractMessageIdAuthorizedIsm.sol4.69 KB
- contracts/isms/hook/ArbL2ToL1Ism.sol4.74 KB
- contracts/isms/hook/ERC5164Ism.sol1.61 KB
- contracts/isms/hook/OPStackIsm.sol1.84 KB
- contracts/isms/hook/PolygonPosIsm.sol1.87 KB
- contracts/isms/hook/layer-zero/LayerZeroV2Ism.sol3.82 KB
- contracts/isms/libs/AggregationIsmMetadata.sol2.46 KB
- contracts/isms/libs/MerkleRootMultisigIsmMetadata.sol3.94 KB
- contracts/isms/libs/MessageIdMultisigIsmMetadata.sol2.59 KB
- contracts/isms/multisig/AbstractMerkleRootMultisigIsm.sol3.26 KB
- contracts/isms/multisig/AbstractMessageIdMultisigIsm.sol2.4 KB
- contracts/isms/multisig/AbstractMultisigIsm.sol4.06 KB
- contracts/isms/multisig/StaticMultisigIsm.sol2.1 KB
- contracts/isms/multisig/ValidatorAnnounce.sol4.8 KB
- contracts/isms/routing/AbstractRoutingIsm.sol1.47 KB
- contracts/isms/routing/DefaultFallbackRoutingIsm.sol1.2 KB
- contracts/isms/routing/DomainRoutingIsm.sol4.43 KB
- contracts/isms/routing/DomainRoutingIsmFactory.sol1.79 KB
- contracts/isms/routing/InterchainAccountIsm.sol1.35 KB
- contracts/isms/warp-route/RateLimitedIsm.sol1.74 KB
- contracts/libs/CheckpointLib.sol2.36 KB
- contracts/libs/EnumerableMapEnrollment.sol3.49 KB
- contracts/libs/EnumerableMapExtended.sol2.61 KB
- contracts/libs/Indexed.sol202 B
- contracts/libs/LibBit.sol608 B
- contracts/libs/Merkle.sol8.24 KB
- contracts/libs/Message.sol4.99 KB
- contracts/libs/MetaProxy.sol1.28 KB
- contracts/libs/MinimalProxy.sol787 B
- contracts/libs/RateLimited.sol3.92 KB
- contracts/libs/StaticAddressSetFactory.sol4.44 KB
- contracts/libs/TypeCasts.sol428 B
- contracts/middleware/InterchainAccountRouter.sol25.16 KB
- contracts/middleware/InterchainQueryRouter.sol6.03 KB
- contracts/middleware/libs/Call.sol3.41 KB
- contracts/middleware/libs/InterchainAccountMessage.sol3.03 KB
- contracts/middleware/libs/InterchainQueryMessage.sol4.06 KB
- contracts/middleware/libs/OwnableMulticall.sol701 B
- contracts/middleware/liquidity-layer/LiquidityLayerRouter.sol5.13 KB
- contracts/middleware/liquidity-layer/adapters/CircleBridgeAdapter.sol8.46 KB
- contracts/middleware/liquidity-layer/adapters/PortalAdapter.sol7.77 KB
- contracts/middleware/liquidity-layer/interfaces/ILiquidityLayerAdapter.sol552 B
- contracts/middleware/liquidity-layer/interfaces/circle/ICircleMessageTransmitter.sol1.55 KB
- contracts/middleware/liquidity-layer/interfaces/circle/ITokenMessenger.sol2.82 KB
- contracts/middleware/liquidity-layer/interfaces/portal/IPortalTokenBridge.sol2 KB
- contracts/mock/MockCircleMessageTransmitter.sol1.1 KB
- contracts/mock/MockCircleTokenMessenger.sol986 B
- contracts/mock/MockERC5164.sol720 B
- contracts/mock/MockHyperlaneEnvironment.sol1.67 KB
- contracts/mock/MockMailbox.sol2.57 KB
- contracts/mock/MockPortalBridge.sol2.47 KB
- contracts/mock/MockToken.sol401 B
- contracts/test/ERC20Test.sol3.61 KB
- contracts/test/ERC4626/ERC4626Test.sol437 B
- contracts/test/ERC721Test.sol535 B
- contracts/test/LightTestRecipient.sol363 B
- contracts/test/TestGasRouter.sol449 B
- contracts/test/TestInterchainGasPaymaster.sol649 B
- contracts/test/TestIsm.sol493 B
- contracts/test/TestLayerZeroTreasury.sol330 B
- contracts/test/TestLiquidityLayerMessageRecipient.sol662 B
- contracts/test/TestMailbox.sol1.62 KB
- contracts/test/TestMerkle.sol843 B
- contracts/test/TestMerkleTreeHook.sol902 B
- contracts/test/TestMessage.sol1.47 KB
- contracts/test/TestPostDispatchHook.sol1.43 KB
- contracts/test/TestQuery.sol1.49 KB
- contracts/test/TestQuerySender.sol2.63 KB
- contracts/test/TestRecipient.sol1.53 KB
- contracts/test/TestRemoteChallenger.sol637 B
- contracts/test/TestRouter.sol992 B
- contracts/test/TestSendReceiver.sol1.96 KB
- contracts/test/TestTokenRecipient.sol1.26 KB
- contracts/test/avs/TestAVSDirectory.sol2.99 KB
- contracts/test/avs/TestDelegationManager.sol1.11 KB
- contracts/test/avs/TestHyperlaneServiceManager.sol973 B
- contracts/test/avs/TestPaymentCoordinator.sol729 B
- contracts/test/avs/TestSlasher.sol239 B
- contracts/token/HypERC20.sol2.29 KB
- contracts/token/HypERC20Collateral.sol1.98 KB
- contracts/token/HypERC20CollateralVaultDeposit.sol2.88 KB
- contracts/token/HypERC721.sol2.55 KB
- contracts/token/HypERC721Collateral.sol2.4 KB
- contracts/token/HypNative.sol2.69 KB
- contracts/token/extensions/FastHypERC20.sol1.74 KB
- contracts/token/extensions/FastHypERC20Collateral.sol1.8 KB
- contracts/token/extensions/HypERC20CollateralVaultDeposit.sol2.88 KB
- contracts/token/extensions/HypERC721URICollateral.sol1.19 KB
- contracts/token/extensions/HypERC721URIStorage.sol2.89 KB
- contracts/token/extensions/HypFiatToken.sol1.08 KB
- contracts/token/extensions/HypNativeScaled.sol1.74 KB
- contracts/token/extensions/HypXERC20.sol820 B
- contracts/token/extensions/HypXERC20Lockbox.sol2.3 KB
- contracts/token/interfaces/IFiatToken.sol946 B
- contracts/token/interfaces/IXERC20.sol2.46 KB
- contracts/token/interfaces/IXERC20Lockbox.sol1.61 KB
- contracts/token/libs/FastTokenRouter.sol6.64 KB
- contracts/token/libs/TokenMessage.sol858 B
- contracts/token/libs/TokenRouter.sol6.65 KB
- contracts/upgrade/ProxyAdmin.sol193 B
- contracts/upgrade/TimelockController.sol210 B
- contracts/upgrade/TransparentUpgradeableProxy.sol242 B
- contracts/upgrade/Versioned.sol204 B
- fx-portal/contracts/lib/ExitPayloadReader.sol4.88 KB
- fx-portal/contracts/lib/Merkle.sol1.18 KB
- fx-portal/contracts/lib/MerklePatriciaProof.sol5.2 KB
- fx-portal/contracts/lib/RLPReader.sol10.1 KB
- fx-portal/contracts/tunnel/FxBaseRootTunnel.sol7.37 KB
@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/transparent/TransparentUpgradeableProxy.sol)
pragma solidity ^0.8.0;
import "../ERC1967/ERC1967Proxy.sol";
/**
* @dev Interface for {TransparentUpgradeableProxy}. In order to implement transparency, {TransparentUpgradeableProxy}
* does not implement this interface directly, and some of its functions are 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 admin() external view returns (address);
function implementation() external view returns (address);
function changeAdmin(address) external;
function upgradeTo(address) external;
function upgradeToAndCall(address, bytes memory) external payable;
}
/**
* @dev This contract implements a proxy that is upgradeable by an admin.
*
* 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 one of the admin functions exposed by the proxy itself.
* 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the
* implementation. If the admin tries to call a function on the implementation it will fail with an error that says
* "admin cannot fallback to proxy target".
*
* These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing
* the admin, 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.
*
* Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,
* you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.
*
* NOTE: The real interface of this proxy is that defined in `ITransparentUpgradeableProxy`. This contract does not
* inherit from that interface, and instead the admin functions are 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.
*
* 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 admin operations inaccessible, which could prevent upgradeability. Transparency may also be compromised.
*/
contract TransparentUpgradeableProxy is ERC1967Proxy {
/**
* @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and
* optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.
*/
constructor(address _logic, address admin_, bytes memory _data) payable ERC1967Proxy(_logic, _data) {
_changeAdmin(admin_);
}
/**
* @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.
*
* CAUTION: This modifier is deprecated, as it could cause issues if the modified function has arguments, and the
* implementation provides a function with the same selector.
*/
modifier ifAdmin() {
if (msg.sender == _getAdmin()) {
_;
} else {
_fallback();
}
}
/**
* @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 == _getAdmin()) {
bytes memory ret;
bytes4 selector = msg.sig;
if (selector == ITransparentUpgradeableProxy.upgradeTo.selector) {
ret = _dispatchUpgradeTo();
} else if (selector == ITransparentUpgradeableProxy.upgradeToAndCall.selector) {
ret = _dispatchUpgradeToAndCall();
} else if (selector == ITransparentUpgradeableProxy.changeAdmin.selector) {
ret = _dispatchChangeAdmin();
} else if (selector == ITransparentUpgradeableProxy.admin.selector) {
ret = _dispatchAdmin();
} else if (selector == ITransparentUpgradeableProxy.implementation.selector) {
ret = _dispatchImplementation();
} else {
revert("TransparentUpgradeableProxy: admin cannot fallback to proxy target");
}
assembly {
return(add(ret, 0x20), mload(ret))
}
} else {
super._fallback();
}
}
/**
* @dev Returns the current admin.
*
* TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the
* https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
* `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`
*/
function _dispatchAdmin() private returns (bytes memory) {
_requireZeroValue();
address admin = _getAdmin();
return abi.encode(admin);
}
/**
* @dev Returns the current implementation.
*
* TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the
* https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
* `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`
*/
function _dispatchImplementation() private returns (bytes memory) {
_requireZeroValue();
address implementation = _implementation();
return abi.encode(implementation);
}
/**
* @dev Changes the admin of the proxy.
*
* Emits an {AdminChanged} event.
*/
function _dispatchChangeAdmin() private returns (bytes memory) {
_requireZeroValue();
address newAdmin = abi.decode(msg.data[4:], (address));
_changeAdmin(newAdmin);
return "";
}
/**
* @dev Upgrade the implementation of the proxy.
*/
function _dispatchUpgradeTo() private returns (bytes memory) {
_requireZeroValue();
address newImplementation = abi.decode(msg.data[4:], (address));
_upgradeToAndCall(newImplementation, bytes(""), false);
return "";
}
/**
* @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified
* by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the
* proxied contract.
*/
function _dispatchUpgradeToAndCall() private returns (bytes memory) {
(address newImplementation, bytes memory data) = abi.decode(msg.data[4:], (address, bytes));
_upgradeToAndCall(newImplementation, data, true);
return "";
}
/**
* @dev Returns the current admin.
*
* CAUTION: This function is deprecated. Use {ERC1967Upgrade-_getAdmin} instead.
*/
function _admin() internal view virtual returns (address) {
return _getAdmin();
}
/**
* @dev To keep this contract fully transparent, all `ifAdmin` functions must be payable. This helper is here to
* emulate some proxy functions being non-payable while still allowing value to pass through.
*/
function _requireZeroValue() private {
require(msg.value == 0);
}
}
Compiler settingsShow
{
"metadata": {
"bytecodeHash": "ipfs"
},
"libraries": {},
"optimizer": {
"runs": 999999,
"enabled": true
},
"evmVersion": "paris",
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.