Проверенный контрактТочноеMIT
TransparentUpgradeableProxy
Адрес0x6ecfa38fee8a5277b91efda204c235814f0122e8
- Баланс
0 ETH
- Транзакций
11 581
- Компилятор
solc 0.8.26
- Тот же код
ещё 20 контрактов
Подробности
- Компилятор
- solc 0.8.26+commit.8a97fa7a
- Язык
- solidity
- Оптимизация
- Да, 200 прогонов
- Версия EVM
- cancun
- Лицензия
- MIT
- Совпадение
- Точноекод создания: да, код в сети: да
- Проверен на Sourcify
- Создан в блоке
- 21 529 392
- Транзакция создания
- 0x975da52012…b176b8daff
- Реализация прокси
- 0x25739865…51bdc993AaveFundingPool
165 файлов
Исходный код большой: показывается один файл. Выберите файл в списке.
- @openzeppelin/contracts-v4/proxy/transparent/TransparentUpgradeableProxy.solглавный8,34 КБ
- @openzeppelin/contracts-upgradeable-v4/access/AccessControlUpgradeable.sol8,87 КБ
- @openzeppelin/contracts-upgradeable-v4/access/IAccessControlUpgradeable.sol2,93 КБ
- @openzeppelin/contracts-upgradeable-v4/interfaces/IERC5267Upgradeable.sol749 Б
- @openzeppelin/contracts-upgradeable-v4/proxy/utils/Initializable.sol6,64 КБ
- @openzeppelin/contracts-upgradeable-v4/security/ReentrancyGuardUpgradeable.sol3,68 КБ
- @openzeppelin/contracts-upgradeable-v4/token/ERC20/ERC20Upgradeable.sol13,49 КБ
- @openzeppelin/contracts-upgradeable-v4/token/ERC20/IERC20Upgradeable.sol2,75 КБ
- @openzeppelin/contracts-upgradeable-v4/token/ERC20/extensions/ERC20PermitUpgradeable.sol4,04 КБ
- @openzeppelin/contracts-upgradeable-v4/token/ERC20/extensions/IERC20MetadataUpgradeable.sol716 Б
- @openzeppelin/contracts-upgradeable-v4/token/ERC20/extensions/IERC20PermitUpgradeable.sol3,81 КБ
- @openzeppelin/contracts-upgradeable-v4/token/ERC20/utils/SafeERC20Upgradeable.sol7,1 КБ
- @openzeppelin/contracts-upgradeable-v4/utils/AddressUpgradeable.sol9,38 КБ
- @openzeppelin/contracts-upgradeable-v4/utils/ContextUpgradeable.sol1,48 КБ
- @openzeppelin/contracts-upgradeable-v4/utils/CountersUpgradeable.sol1,41 КБ
- @openzeppelin/contracts-upgradeable-v4/utils/StringsUpgradeable.sol2,85 КБ
- @openzeppelin/contracts-upgradeable-v4/utils/cryptography/ECDSAUpgradeable.sol9,16 КБ
- @openzeppelin/contracts-upgradeable-v4/utils/cryptography/EIP712Upgradeable.sol8,06 КБ
- @openzeppelin/contracts-upgradeable-v4/utils/introspection/ERC165Upgradeable.sol1,54 КБ
- @openzeppelin/contracts-upgradeable-v4/utils/introspection/IERC165Upgradeable.sol864 Б
- @openzeppelin/contracts-upgradeable-v4/utils/math/MathUpgradeable.sol12,8 КБ
- @openzeppelin/contracts-upgradeable-v4/utils/math/SignedMathUpgradeable.sol1,27 КБ
- @openzeppelin/contracts-upgradeable-v4/utils/structs/EnumerableSetUpgradeable.sol12,97 КБ
- @openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol8,28 КБ
- @openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol8,91 КБ
- @openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol12,47 КБ
- @openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PermitUpgradeable.sol3,2 КБ
- @openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol19,4 КБ
- @openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol1,19 КБ
- @openzeppelin/contracts-upgradeable/utils/NoncesUpgradeable.sol2,33 КБ
- @openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol4,36 КБ
- @openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol8,69 КБ
- @openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol1,18 КБ
- @openzeppelin/contracts-v4/access/Ownable.sol2,62 КБ
- @openzeppelin/contracts-v4/interfaces/IERC1967.sol667 Б
- @openzeppelin/contracts-v4/interfaces/draft-IERC1822.sol879 Б
- @openzeppelin/contracts-v4/proxy/ERC1967/ERC1967Proxy.sol1,29 КБ
- @openzeppelin/contracts-v4/proxy/ERC1967/ERC1967Upgrade.sol6,04 КБ
- @openzeppelin/contracts-v4/proxy/Proxy.sol3,25 КБ
- @openzeppelin/contracts-v4/proxy/beacon/IBeacon.sol450 Б
- @openzeppelin/contracts-v4/proxy/transparent/ProxyAdmin.sol2,86 КБ
- @openzeppelin/contracts-v4/utils/Address.sol9,36 КБ
- @openzeppelin/contracts-v4/utils/Context.sol962 Б
- @openzeppelin/contracts-v4/utils/StorageSlot.sol4,11 КБ
- @openzeppelin/contracts/access/AccessControl.sol7,05 КБ
- @openzeppelin/contracts/access/IAccessControl.sol3,26 КБ
- @openzeppelin/contracts/access/Ownable.sol3,1 КБ
- @openzeppelin/contracts/access/Ownable2Step.sol1,99 КБ
- @openzeppelin/contracts/interfaces/IERC5267.sol739 Б
- @openzeppelin/contracts/interfaces/draft-IERC6093.sol6,53 КБ
- @openzeppelin/contracts/token/ERC20/ERC20.sol11,14 КБ
- @openzeppelin/contracts/token/ERC20/IERC20.sol2,78 КБ
- @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/Strings.sol3,1 КБ
- @openzeppelin/contracts/utils/cryptography/ECDSA.sol7,73 КБ
- @openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol3,76 КБ
- @openzeppelin/contracts/utils/introspection/ERC165.sol911 Б
- @openzeppelin/contracts/utils/introspection/IERC165.sol869 Б
- @openzeppelin/contracts/utils/math/Math.sol15,12 КБ
- @openzeppelin/contracts/utils/math/SafeCast.sol34,69 КБ
- @openzeppelin/contracts/utils/math/SignedMath.sol1,26 КБ
- @openzeppelin/contracts/utils/structs/EnumerableSet.sol12,97 КБ
- contracts/common/EIP2535/Diamond.sol2,51 КБ
- contracts/common/EIP2535/facets/DiamondCutFacet.sol1,3 КБ
- contracts/common/EIP2535/facets/DiamondLoupeFacet.sol6,34 КБ
- contracts/common/EIP2535/facets/OwnershipFacet.sol744 Б
- contracts/common/EIP2535/interfaces/IDiamond.sol624 Б
- contracts/common/EIP2535/interfaces/IDiamondCut.sol956 Б
- contracts/common/EIP2535/interfaces/IDiamondLoupe.sol1,54 КБ
- contracts/common/EIP2535/interfaces/IERC165.sol528 Б
- contracts/common/EIP2535/interfaces/IERC173.sol766 Б
- contracts/common/EIP2535/libraries/LibDiamond.sol8,86 КБ
- contracts/common/EIP2535/upgradeInitializers/DiamondInit.sol2,07 КБ
- contracts/common/EIP2535/upgradeInitializers/DiamondMultiInit.sol1,14 КБ
- contracts/common/ERC3156/IERC3156FlashBorrower.sol645 Б
- contracts/common/ERC3156/IERC3156FlashLender.sol1,18 КБ
- contracts/common/codec/WordCodec.sol4,1 КБ
- contracts/common/rewards/distributor/IMultipleRewardDistributor.sol3,04 КБ
- contracts/common/rewards/distributor/IRewardDistributor.sol1,11 КБ
- contracts/common/rewards/distributor/LinearMultipleRewardDistributor.sol7,39 КБ
- contracts/common/rewards/distributor/LinearReward.sol3,4 КБ
- contracts/common/rewards/distributor/LinearRewardDistributor.sol3,69 КБ
- contracts/common/utils/PermissionedSwap.sol3,34 КБ
- contracts/core/FlashLoans.sol2,95 КБ
- contracts/core/FxUSDBasePool.sol20,62 КБ
- contracts/core/FxUSDRegeneracy.sol17,27 КБ
- contracts/core/PegKeeper.sol7,75 КБ
- contracts/core/PoolManager.sol24,15 КБ
- contracts/core/ProtocolFees.sol14,43 КБ
- contracts/core/ReservePool.sol3,72 КБ
- contracts/core/pool/AaveFundingPool.sol12,21 КБ
- contracts/core/pool/BasePool.sol22,87 КБ
- contracts/core/pool/PoolConstant.sol1,15 КБ
- contracts/core/pool/PoolErrors.sol2,34 КБ
- contracts/core/pool/PoolStorage.sol19,06 КБ
- contracts/core/pool/PositionLogic.sol4,92 КБ
- contracts/core/pool/TickLogic.sol9,81 КБ
- contracts/fund/AssetManagement.sol442 Б
- contracts/helpers/EmptyContract.sol85 Б
- contracts/helpers/External.sol216 Б
- contracts/helpers/GaugeRewarder.sol2,2 КБ
- contracts/helpers/RevenuePool.sol10,38 КБ
- contracts/helpers/converter/MultiPathConverter.sol2,95 КБ
- contracts/helpers/interfaces/IMultiPathConverter.sol402 Б
- contracts/helpers/interfaces/ITokenConverter.sol5,63 КБ
- contracts/interfaces/Aave/IAaveV3Pool.sol3,73 КБ
- contracts/interfaces/Balancer/IBalancerVault.sol2,72 КБ
- contracts/interfaces/Balancer/IFlashLoanRecipient.sol736 Б
- contracts/interfaces/Chainlink/AggregatorV3Interface.sol729 Б
- contracts/interfaces/Curve/ICurvePoolOracle.sol1,7 КБ
- contracts/interfaces/Curve/ICurveStableSwapNG.sol10,83 КБ
- contracts/interfaces/IAaveFundingPool.sol1,49 КБ
- contracts/interfaces/IFxUSDBasePool.sol8,53 КБ
- contracts/interfaces/IFxUSDRegeneracy.sol2,13 КБ
- contracts/interfaces/IPegKeeper.sol2,83 КБ
- contracts/interfaces/IPool.sol9,85 КБ
- contracts/interfaces/IPoolManager.sol8,72 КБ
- contracts/interfaces/IProtocolFees.sol4,82 КБ
- contracts/interfaces/IReservePool.sol1,3 КБ
- contracts/interfaces/IRewardSplitter.sol552 Б
- contracts/interfaces/IWrappedEther.sol169 Б
- contracts/libraries/BitMath.sol2,89 КБ
- contracts/libraries/Math.sol1,03 КБ
- contracts/libraries/TickBitmap.sol1,72 КБ
- contracts/libraries/TickMath.sol15,2 КБ
- contracts/mocks/MockAaveV3Pool.sol933 Б
- contracts/mocks/MockAggregatorV3Interface.sol1,31 КБ
- contracts/mocks/MockCurveStableSwapNG.sol405 Б
- contracts/mocks/MockERC20.sol515 Б
- contracts/mocks/MockMultiPathConverter.sol1,3 КБ
- contracts/mocks/MockMultipleRewardDistributor.sol497 Б
- contracts/mocks/MockPriceOracle.sol736 Б
- contracts/mocks/MockRateProvider.sol408 Б
- contracts/mocks/MockStakedFxUSD.sol4,05 КБ
- contracts/periphery/facets/FlashLoanCallbackFacet.sol1,99 КБ
- contracts/periphery/facets/FlashLoanFacetBase.sol1,81 КБ
- contracts/periphery/facets/FxUSDBasePoolFacet.sol6,77 КБ
- contracts/periphery/facets/MigrateFacet.sol12,12 КБ
- contracts/periphery/facets/PositionOperateFlashLoanFacet.sol8,95 КБ
- contracts/periphery/facets/RouterManagementFacet.sol2,65 КБ
- contracts/periphery/libraries/LibRouter.sol8,41 КБ
- contracts/price-oracle/LSDPriceOracleBase.sol8,1 КБ
- contracts/price-oracle/SpotPriceOracleBase.sol5,01 КБ
- contracts/price-oracle/StETHPriceOracle.sol1,36 КБ
- contracts/price-oracle/interfaces/IPriceOracle.sol1,1 КБ
- contracts/price-oracle/interfaces/ISpotPriceOracle.sol2,52 КБ
- contracts/price-oracle/interfaces/ITwapOracle.sol580 Б
- contracts/rate-provider/interfaces/IRateProvider.sol244 Б
- contracts/v2/MarketV2.sol29,55 КБ
- contracts/v2/interfaces/IFxBoostableRebalancePool.sol4,37 КБ
- contracts/v2/interfaces/IFxFractionalTokenV2.sol929 Б
- contracts/v2/interfaces/IFxMarketV2.sol10,22 КБ
- contracts/v2/interfaces/IFxRebalancePoolRegistry.sol839 Б
- contracts/v2/interfaces/IFxReservePool.sol506 Б
- contracts/v2/interfaces/IFxShareableRebalancePool.sol2,74 КБ
- contracts/v2/interfaces/IFxTreasuryV2.sol10,53 КБ
- contracts/v2/interfaces/IFxUSD.sol7,75 КБ
- contracts/voting-escrow/interfaces/ILiquidityGauge.sol5,94 КБ
@openzeppelin/contracts-v4/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);
}
}
Настройки компилятораПоказать
{
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "cancun"
}Исходный код и метаданные: Sourcify.
Исходный код принадлежит авторам контракта.