Проверенный контрактТочноеMIT
TransparentUpgradeableProxy
Адрес0xf997baec4ba33041682bec7fa1ea598d4bff1ec3
- Баланс
0 ETH
- Транзакций
258
- Компилятор
solc 0.8.20
- Тот же код
ещё 1 298 контрактов
Подробности
- Компилятор
- solc 0.8.20+commit.a1b79de6
- Язык
- solidity
- Оптимизация
- Да, 200 прогонов
- Версия EVM
- paris
- Лицензия
- MIT
- Совпадение
- Точноекод создания: да, код в сети: да
- Проверен на Sourcify
- Создан в блоке
- 21 176 967
- Транзакция создания
- 0x8d3d8bc5e4…dba267b64b
- Реализация прокси
- 0xde837866…a60e3b5bWalletBasedClaimWithDirectWithdrawal
- Основная копия (больше всего транзакций)
- 0xda5e1988…847cbef6
112 файлов
Исходный код большой: показывается один файл. Выберите файл в списке.
- @openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.solглавный6,37 КБ
- @openzeppelin/contracts-upgradeable/../proxy/utils/Initializable.sol8,91 КБ
- @openzeppelin/contracts-upgradeable/../utils/ContextUpgradeable.sol1,19 КБ
- @openzeppelin/contracts-upgradeable/../utils/introspection/ERC165Upgradeable.sol1,18 КБ
- @openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol4,03 КБ
- @openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol8,91 КБ
- @openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol19,4 КБ
- @openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol1,19 КБ
- @openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol3,86 КБ
- @openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol4,36 КБ
- @openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol1,18 КБ
- @openzeppelin/contracts/access/AccessControl.sol7,05 КБ
- @openzeppelin/contracts/access/IAccessControl.sol3,26 КБ
- @openzeppelin/contracts/access/Ownable.sol3,1 КБ
- @openzeppelin/contracts/contracts-upgradeable/../proxy/utils/Initializable.sol8,91 КБ
- @openzeppelin/contracts/contracts-upgradeable/../utils/ContextUpgradeable.sol1,19 КБ
- @openzeppelin/contracts/contracts-upgradeable/../utils/introspection/ERC165Upgradeable.sol1,18 КБ
- @openzeppelin/contracts/contracts-upgradeable/access/OwnableUpgradeable.sol4,03 КБ
- @openzeppelin/contracts/contracts-upgradeable/proxy/utils/Initializable.sol8,91 КБ
- @openzeppelin/contracts/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol19,4 КБ
- @openzeppelin/contracts/contracts-upgradeable/utils/ContextUpgradeable.sol1,19 КБ
- @openzeppelin/contracts/contracts-upgradeable/utils/PausableUpgradeable.sol3,86 КБ
- @openzeppelin/contracts/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol4,36 КБ
- @openzeppelin/contracts/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol1,18 КБ
- @openzeppelin/contracts/interfaces/IERC1967.sol636 Б
- @openzeppelin/contracts/interfaces/IERC20.sol181 Б
- @openzeppelin/contracts/interfaces/IERC20Metadata.sol216 Б
- @openzeppelin/contracts/interfaces/IERC5267.sol739 Б
- @openzeppelin/contracts/interfaces/draft-IERC6093.sol6,53 КБ
- @openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol1,72 КБ
- @openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol6,72 КБ
- @openzeppelin/contracts/proxy/Proxy.sol2,67 КБ
- @openzeppelin/contracts/proxy/beacon/BeaconProxy.sol2,31 КБ
- @openzeppelin/contracts/proxy/beacon/IBeacon.sol472 Б
- @openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol2,22 КБ
- @openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol1,95 КБ
- @openzeppelin/contracts/proxy/utils/Initializable.sol8,91 КБ
- @openzeppelin/contracts/token/ERC20/ERC20.sol11,14 КБ
- @openzeppelin/contracts/token/ERC20/IERC20.sol2,78 КБ
- @openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol1,18 КБ
- @openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol2,77 КБ
- @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol683 Б
- @openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol3,8 КБ
- @openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol5,77 КБ
- @openzeppelin/contracts/token/ERC721/IERC721.sol4,93 КБ
- @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol995 Б
- @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol792 Б
- @openzeppelin/contracts/utils/Address.sol6,26 КБ
- @openzeppelin/contracts/utils/Context.sol963 Б
- @openzeppelin/contracts/utils/ContextUpgradeable.sol1,19 КБ
- @openzeppelin/contracts/utils/Create2.sol4,37 КБ
- @openzeppelin/contracts/utils/Nonces.sol1,49 КБ
- @openzeppelin/contracts/utils/ShortStrings.sol4,31 КБ
- @openzeppelin/contracts/utils/StorageSlot.sol3,93 КБ
- @openzeppelin/contracts/utils/Strings.sol3,1 КБ
- @openzeppelin/contracts/utils/cryptography/ECDSA.sol7,73 КБ
- @openzeppelin/contracts/utils/cryptography/EIP712.sol6,61 КБ
- @openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol3,76 КБ
- @openzeppelin/contracts/utils/introspection/ERC165.sol911 Б
- @openzeppelin/contracts/utils/introspection/ERC165Upgradeable.sol1,18 КБ
- @openzeppelin/contracts/utils/introspection/IERC165.sol869 Б
- @openzeppelin/contracts/utils/math/Math.sol15,12 КБ
- @openzeppelin/contracts/utils/math/SignedMath.sol1,26 КБ
- @openzeppelin/proxy/utils/Initializable.sol8,91 КБ
- @openzeppelin/utils/ContextUpgradeable.sol1,19 КБ
- @openzeppelin/utils/introspection/ERC165Upgradeable.sol1,18 КБ
- contracts/NFT/ERC721V1.sol6,77 КБ
- contracts/NFT/ERC721V2.sol1,14 КБ
- contracts/NFT/burnRegistry/BurnRegistryV1.sol4,14 КБ
- contracts/Proxies.sol218 Б
- contracts/XERC20/XERC20.sol10,99 КБ
- contracts/XERC20/XERC20Lockbox.sol4,34 КБ
- contracts/bridge/InceptionBridge.sol11,92 КБ
- contracts/bridge/InceptionBridgeStorage.sol8,87 КБ
- contracts/bridgeMiddleware/BridgeMiddleware.sol2,01 КБ
- contracts/bridgeMiddleware/MinimalProxyFactory.sol2,17 КБ
- contracts/factory/BridgeFactory.sol6,78 КБ
- contracts/governance/GovernorMultisig.sol1,64 КБ
- contracts/governance/Multiownable.sol8,52 КБ
- contracts/interfaces/IAcrossSpokePool.sol655 Б
- contracts/interfaces/IERC20.sol874 Б
- contracts/interfaces/IFactory.sol1,45 КБ
- contracts/interfaces/IInceptionBridge.sol2,05 КБ
- contracts/interfaces/IInceptionBridgeErrors.sol1,02 КБ
- contracts/interfaces/IInceptionRatioFeed.sol973 Б
- contracts/interfaces/IPriceFeed.sol304 Б
- contracts/interfaces/IRateProvider.sol178 Б
- contracts/interfaces/IXERC20.sol4,25 КБ
- contracts/interfaces/IXERC20Lockbox.sol2,47 КБ
- contracts/lib/CallDataRLPReader.sol3,66 КБ
- contracts/lib/EthereumVerifier.sol6,58 КБ
- contracts/lib/ProofParser.sol1,19 КБ
- contracts/lib/Utils.sol2,07 КБ
- contracts/mock/AcrossSpokePoolMock.sol1,33 КБ
- contracts/mock/ERC20Mock.sol507 Б
- contracts/mock/PriceFeedMock.sol824 Б
- contracts/multicall/Multicall3.sol9,61 КБ
- contracts/proxy/InitializableERC1967Proxy.sol716 Б
- contracts/proxy/InitializableTransparentUpgradeableProxy.sol6,28 КБ
- contracts/proxy/Proxy.sol343 Б
- contracts/rate_providers/InETH/InETHRateProvider.sol552 Б
- contracts/rate_providers/InceptionRateProvider.sol1,59 КБ
- contracts/rate_providers/InstETH/InstETHRateProvider.sol560 Б
- contracts/ratio_feed/InceptionRatioFeed.sol6,26 КБ
- contracts/storage/Storage.sol3,77 КБ
- contracts/tests/ERC20Mintable.sol498 Б
- contracts/tests/MultipleDepositor.sol848 Б
- contracts/tokens/EVE.sol391 Б
- contracts/tokens/USDC.sol927 Б
- contracts/tokens/USDT.sol927 Б
- contracts/treasury/TreasuryV1.sol2,34 КБ
- contracts/vault/VaultV1.sol4,82 КБ
@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);
}
}
Настройки компилятораПоказать
{
"metadata": {
"bytecodeHash": "ipfs"
},
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "paris",
"remappings": []
}Исходный код и метаданные: Sourcify.
Исходный код принадлежит авторам контракта.