Verified contractExactMIT
TransparentUpgradeableProxy
Address0x9b6a1d4fa5d90e5f2d34130053978d14cd301d58
- Balance
0 ETH
- Transactions
285
- Compiler
solc 0.8.28
- Same code
Only this contract
Details
- Compiler
- solc 0.8.28+commit.7893614a
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- paris
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 23,975,151
- Creation transaction
- 0xcb24614d71…f75ca240ca
- Proxy implementation
- 0x563fe7f1…f5b14253DeepToken
118 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.55 KB
- @openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol8.33 KB
- @openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol4.03 KB
- @openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol9.28 KB
- @openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol12.13 KB
- @openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol17.8 KB
- @openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721BurnableUpgradeable.sol1.2 KB
- @openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol8.72 KB
- @openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721PausableUpgradeable.sol1.64 KB
- @openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol3.22 KB
- @openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol1.19 KB
- @openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol3.66 KB
- @openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol4.51 KB
- @openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol1.15 KB
- @openzeppelin/contracts/access/AccessControl.sol7.03 KB
- @openzeppelin/contracts/access/IAccessControl.sol3.34 KB
- @openzeppelin/contracts/access/Ownable.sol3.1 KB
- @openzeppelin/contracts/interfaces/IERC1363.sol4.45 KB
- @openzeppelin/contracts/interfaces/IERC165.sol193 B
- @openzeppelin/contracts/interfaces/IERC1967.sol637 B
- @openzeppelin/contracts/interfaces/IERC20.sol182 B
- @openzeppelin/contracts/interfaces/IERC4906.sol841 B
- @openzeppelin/contracts/interfaces/IERC721.sol185 B
- @openzeppelin/contracts/interfaces/draft-IERC6093.sol6.54 KB
- @openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol1.72 KB
- @openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol6.24 KB
- @openzeppelin/contracts/proxy/Proxy.sol2.67 KB
- @openzeppelin/contracts/proxy/beacon/IBeacon.sol473 B
- @openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol1.97 KB
- @openzeppelin/contracts/token/ERC20/ERC20.sol10.8 KB
- @openzeppelin/contracts/token/ERC20/IERC20.sol2.78 KB
- @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol684 B
- @openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol10.08 KB
- @openzeppelin/contracts/token/ERC721/IERC721.sol4.93 KB
- @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol997 B
- @openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol1.04 KB
- @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol792 B
- @openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol1.92 KB
- @openzeppelin/contracts/utils/Address.sol6 KB
- @openzeppelin/contracts/utils/Context.sol963 B
- @openzeppelin/contracts/utils/Errors.sol896 B
- @openzeppelin/contracts/utils/Panic.sol1.97 KB
- @openzeppelin/contracts/utils/Pausable.sol2.71 KB
- @openzeppelin/contracts/utils/ReentrancyGuard.sol3.38 KB
- @openzeppelin/contracts/utils/StorageSlot.sol4.18 KB
- @openzeppelin/contracts/utils/Strings.sol19.28 KB
- @openzeppelin/contracts/utils/introspection/ERC165.sol879 B
- @openzeppelin/contracts/utils/introspection/IERC165.sol871 B
- @openzeppelin/contracts/utils/math/Math.sol32.15 KB
- @openzeppelin/contracts/utils/math/SafeCast.sol34.94 KB
- @openzeppelin/contracts/utils/math/SignedMath.sol2.61 KB
- contracts/ArweaveGateway.sol2.86 KB
- contracts/FlexibleTieredStaking.sol46.19 KB
- contracts/IYieldStrategy.sol1.67 KB
- contracts/ImprovedTimelock.sol4.47 KB
- contracts/MockERC20.sol798 B
- contracts/PaniniNfts/PaniniNFTs.sol18.06 KB
- contracts/PaniniNfts/limitbreak/CreatorTokenValidator.sol7.77 KB
- contracts/PaniniNfts/limitbreak/interfaces/ICreatorToken.sol446 B
- contracts/PaniniNfts/limitbreak/interfaces/ICreatorTokenLegacy.sol313 B
- contracts/PaniniNfts/limitbreak/interfaces/ITransferValidator.sol360 B
- contracts/PaniniNfts/limitbreak/interfaces/ITransferValidatorSetTokenType.sol210 B
- contracts/PaniniNfts/openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol8.29 KB
- contracts/PaniniNfts/openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol3.55 KB
- contracts/PaniniNfts/openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol4.11 KB
- contracts/PaniniNfts/openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol8.94 KB
- contracts/PaniniNfts/openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol20.08 KB
- contracts/PaniniNfts/openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721BurnableUpgradeable.sol1.2 KB
- contracts/PaniniNfts/openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol9.03 KB
- contracts/PaniniNfts/openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721PausableUpgradeable.sol1.69 KB
- contracts/PaniniNfts/openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol3.26 KB
- contracts/PaniniNfts/openzeppelin/contracts-upgradeable/token/common/ERC2981Upgradeable.sol7.31 KB
- contracts/PaniniNfts/openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol1.18 KB
- contracts/PaniniNfts/openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol4.01 KB
- contracts/PaniniNfts/openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol1.18 KB
- contracts/PaniniNfts/openzeppelin/contracts/interfaces/IERC165.sol191 B
- contracts/PaniniNfts/openzeppelin/contracts/interfaces/IERC2981.sol1.11 KB
- contracts/PaniniNfts/openzeppelin/contracts/interfaces/IERC4906.sol840 B
- contracts/PaniniNfts/openzeppelin/contracts/interfaces/IERC721.sol184 B
- contracts/PaniniNfts/openzeppelin/contracts/interfaces/draft-IERC6093.sol6.64 KB
- contracts/PaniniNfts/openzeppelin/contracts/token/ERC721/IERC721.sol5.12 KB
- contracts/PaniniNfts/openzeppelin/contracts/token/ERC721/IERC721Receiver.sol996 B
- contracts/PaniniNfts/openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol1.06 KB
- contracts/PaniniNfts/openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol791 B
- contracts/PaniniNfts/openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol2.04 KB
- contracts/PaniniNfts/openzeppelin/contracts/utils/Panic.sol1.97 KB
- contracts/PaniniNfts/openzeppelin/contracts/utils/Strings.sol17.36 KB
- contracts/PaniniNfts/openzeppelin/contracts/utils/cryptography/ECDSA.sol7.82 KB
- contracts/PaniniNfts/openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol4.25 KB
- contracts/PaniniNfts/openzeppelin/contracts/utils/introspection/IERC165.sol869 B
- contracts/PaniniNfts/openzeppelin/contracts/utils/math/Math.sol29.27 KB
- contracts/PaniniNfts/openzeppelin/contracts/utils/math/SafeCast.sol34.94 KB
- contracts/PaniniNfts/openzeppelin/contracts/utils/math/SignedMath.sol2.64 KB
- contracts/PaniniNfts/smartlocks/SmartValidator.sol2.39 KB
- contracts/PaniniRoyaltyVault/PaniniRoyaltyVault.sol9.7 KB
- contracts/PaniniRoyaltyVault/openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol4.03 KB
- contracts/PaniniRoyaltyVault/openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol9.28 KB
- contracts/PaniniRoyaltyVault/openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol1.19 KB
- contracts/PaniniRoyaltyVault/openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol3.66 KB
- contracts/PaniniRoyaltyVault/openzeppelin/contracts/interfaces/IERC1363.sol4.45 KB
- contracts/PaniniRoyaltyVault/openzeppelin/contracts/interfaces/IERC165.sol191 B
- contracts/PaniniRoyaltyVault/openzeppelin/contracts/interfaces/IERC20.sol180 B
- contracts/PaniniRoyaltyVault/openzeppelin/contracts/token/ERC20/IERC20.sol2.78 KB
- contracts/PaniniRoyaltyVault/openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol10.07 KB
- contracts/PaniniRoyaltyVault/openzeppelin/contracts/utils/introspection/IERC165.sol869 B
- contracts/PaniniRoyaltyVault/uniswap/IUniswapV2Router02.sol2.58 KB
- contracts/Proxies.sol220 B
- contracts/ReflectiveToken.sol54.17 KB
- contracts/SimpleStaking.sol2.19 KB
- contracts/SimpleStakingV2.sol1.91 KB
- contracts/TokenDistribution.sol18.78 KB
- contracts/TreasuryYieldStrategy.sol9.95 KB
- contracts/mocks/MockERC20.sol419 B
- contracts/mocks/MockPriceOracle.sol1.25 KB
- contracts/mocks/MockUniswapRouter.sol2.93 KB
- contracts/nft.sol3.6 KB
- contracts/proxy/TransparentProxy.sol394 B
- contracts/utils/Import.sol179 B
@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.0) (proxy/transparent/TransparentUpgradeableProxy.sol)
pragma solidity ^0.8.22;
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 {
/// @dev See {UUPSUpgradeable-upgradeToAndCall}
function upgradeToAndCall(address newImplementation, bytes calldata data) 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. Relying on the value of the admin slot
* is generally fine if the implementation is trusted.
*
* 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 view 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
{
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "paris"
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.