Verified contractPartialUNLICENSED
OLYHook
Address0xae518866f528db0382f125906e1cfecac3ef58a2
- Balance
0 ETH
- Transactions
1
- Compiler
solc 0.8.30
- Same code
Only this contract
Details
- Compiler
- solc 0.8.30+commit.73712a01
- Language
- solidity
- Optimization
- Yes, 600 runs
- EVM version
- cancun
- License
- UNLICENSED
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,155,037
- Creation transaction
- 0xe22e1b791c…cc37ee3e4e
- Libraries
- src/OLYHook.sol:OLYHookLib0xe0e5…513721src/OLYHook.sol:MarketCapLib0xb920…d36685src/OLYHook.sol:TruncatedOracle0xb90a…3fb443
71 files
The source code is large: one file is shown at a time. Choose a file in the list.
- src/OLYHook.solmain33.24 KB
- lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol4.03 KB
- lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol9.28 KB
- lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol6.57 KB
- lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol1.19 KB
- lib/openzeppelin-contracts/contracts/interfaces/IERC1967.sol637 B
- lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol182 B
- lib/openzeppelin-contracts/contracts/interfaces/IERC20Metadata.sol216 B
- lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol882 B
- lib/openzeppelin-contracts/contracts/interfaces/draft-IERC6093.sol6.54 KB
- lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Utils.sol6.24 KB
- lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol473 B
- lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155Receiver.sol2.6 KB
- lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol10.8 KB
- lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol2.78 KB
- lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Burnable.sol1.18 KB
- lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol684 B
- lib/openzeppelin-contracts/contracts/utils/Address.sol6 KB
- lib/openzeppelin-contracts/contracts/utils/Context.sol963 B
- lib/openzeppelin-contracts/contracts/utils/Errors.sol896 B
- lib/openzeppelin-contracts/contracts/utils/Panic.sol1.97 KB
- lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol4.18 KB
- lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol871 B
- lib/openzeppelin-contracts/contracts/utils/math/Math.sol32.15 KB
- lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol34.94 KB
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/interfaces/IExtsload.sol1.02 KB
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/interfaces/IExttload.sol699 B
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/interfaces/IHooks.sol8.23 KB
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/interfaces/IPoolManager.sol12.84 KB
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/interfaces/IProtocolFees.sol2.49 KB
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/interfaces/external/IERC20Minimal.sol3.04 KB
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/interfaces/external/IERC6909Claims.sol3.16 KB
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/libraries/BitMath.sol2.61 KB
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/libraries/CustomRevert.sol5.17 KB
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/libraries/FixedPoint128.sol297 B
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/libraries/FullMath.sol5.46 KB
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/libraries/Hooks.sol16.51 KB
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/libraries/LPFeeLibrary.sol3.6 KB
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/libraries/LiquidityMath.sol742 B
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/libraries/ParseBytes.sol1.2 KB
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/libraries/Position.sol4.81 KB
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/libraries/SafeCast.sol2.27 KB
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/libraries/StateLibrary.sol16.03 KB
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/libraries/TickMath.sol12.38 KB
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/types/BalanceDelta.sol2.34 KB
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/types/BeforeSwapDelta.sol1.47 KB
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/types/Currency.sol5.46 KB
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/types/PoolId.sol539 B
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/types/PoolKey.sol805 B
- lib/universal-router/lib/v4-periphery/lib/v4-core/src/types/PoolOperation.sol907 B
- lib/universal-router/lib/v4-periphery/lib/v4-core/test/utils/CurrencySettler.sol2.41 KB
- lib/v3-core/contracts/interfaces/IUniswapV3Factory.sol4.04 KB
- lib/v3-core/contracts/interfaces/IUniswapV3Pool.sol809 B
- lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol6.3 KB
- lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol2.6 KB
- lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol5.96 KB
- lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol1.81 KB
- lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol1.19 KB
- lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol6.51 KB
- src/BaseHookUpgradeable.sol8.34 KB
- src/EthPrice.sol7.72 KB
- src/interfaces/IOLYHook.sol1.62 KB
- src/interfaces/ITruncGeoOracle.sol3.62 KB
- src/interfaces/external/AggregatorV3Interface.sol683 B
- src/libs/Farms.sol10.85 KB
- src/libs/MarketCapLib.sol7.85 KB
- src/libs/OLYHookLib.sol19.47 KB
- src/libs/V3OracleLib.sol8.81 KB
- src/libs/V4OracleLib.sol9.35 KB
- src/oracle/TruncGeoOracleUpgradeable.sol5.98 KB
- src/oracle/TruncatedOracle.sol18.45 KB
lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/UUPSUpgradeable.sol)
pragma solidity ^0.8.22;
import {IERC1822Proxiable} from "@openzeppelin/contracts/interfaces/draft-IERC1822.sol";
import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol";
import {Initializable} from "./Initializable.sol";
/**
* @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
* {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
*
* A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
* reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
* `UUPSUpgradeable` with a custom implementation of upgrades.
*
* The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
*/
abstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable {
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable
address private immutable __self = address(this);
/**
* @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`
* and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,
* while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.
* If the getter returns `"5.0.0"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must
* be the empty byte string if no function should be called, making it impossible to invoke the `receive` function
* during an upgrade.
*/
string public constant UPGRADE_INTERFACE_VERSION = "5.0.0";
/**
* @dev The call is from an unauthorized context.
*/
error UUPSUnauthorizedCallContext();
/**
* @dev The storage `slot` is unsupported as a UUID.
*/
error UUPSUnsupportedProxiableUUID(bytes32 slot);
/**
* @dev Check that the execution is being performed through a delegatecall call and that the execution context is
* a proxy contract with an implementation (as defined in ERC-1967) pointing to self. This should only be the case
* for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
* function through ERC-1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
* fail.
*/
modifier onlyProxy() {
_checkProxy();
_;
}
/**
* @dev Check that the execution is not being performed through a delegate call. This allows a function to be
* callable on the implementing contract but not through proxies.
*/
modifier notDelegated() {
_checkNotDelegated();
_;
}
function __UUPSUpgradeable_init() internal onlyInitializing {
}
function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
}
/**
* @dev Implementation of the ERC-1822 {proxiableUUID} function. This returns the storage slot used by the
* implementation. It is used to validate the implementation's compatibility when performing an upgrade.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
*/
function proxiableUUID() external view virtual notDelegated returns (bytes32) {
return ERC1967Utils.IMPLEMENTATION_SLOT;
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
* encoded in `data`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*
* @custom:oz-upgrades-unsafe-allow-reachable delegatecall
*/
function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, data);
}
/**
* @dev Reverts if the execution is not performed via delegatecall or the execution
* context is not of a proxy with an ERC-1967 compliant implementation pointing to self.
*/
function _checkProxy() internal view virtual {
if (
address(this) == __self || // Must be called through delegatecall
ERC1967Utils.getImplementation() != __self // Must be called through an active proxy
) {
revert UUPSUnauthorizedCallContext();
}
}
/**
* @dev Reverts if the execution is performed via delegatecall.
* See {notDelegated}.
*/
function _checkNotDelegated() internal view virtual {
if (address(this) != __self) {
// Must not be called through delegatecall
revert UUPSUnauthorizedCallContext();
}
}
/**
* @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
* {upgradeToAndCall}.
*
* Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
*
* ```solidity
* function _authorizeUpgrade(address) internal onlyOwner {}
* ```
*/
function _authorizeUpgrade(address newImplementation) internal virtual;
/**
* @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.
*
* As a security check, {proxiableUUID} is invoked in the new implementation, and the return value
* is expected to be the implementation slot in ERC-1967.
*
* Emits an {IERC1967-Upgraded} event.
*/
function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {
try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {
if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {
revert UUPSUnsupportedProxiableUUID(slot);
}
ERC1967Utils.upgradeToAndCall(newImplementation, data);
} catch {
// The implementation is not UUPS
revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);
}
}
}
Compiler settingsShow
{
"viaIR": false,
"metadata": {
"appendCBOR": true,
"bytecodeHash": "ipfs",
"useLiteralContent": false
},
"libraries": {
"src/OLYHook.sol": {
"OLYHookLib": "0xe0e5ef74ab02b7f2fcd8de204cd8e2a319513721",
"MarketCapLib": "0xb920cfe56d7a86136c706043299348d1bad36685",
"TruncatedOracle": "0xb90af92ac1b41a09a40ecf89788d0068703fb443"
}
},
"optimizer": {
"runs": 600,
"enabled": true
},
"evmVersion": "cancun",
"remappings": [
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"forge-std/=lib/forge-std/src/",
"@uniswap/v4-core/=lib/universal-router/lib/v4-periphery/lib/v4-core/",
"@uniswap/v4-periphery/=lib/universal-router/lib/v4-periphery/",
"@uniswap/v3-core/=lib/v3-core/",
"@uniswap/v3-periphery/=lib/universal-router/lib/v3-periphery/",
"@uniswap/universal-router/=lib/universal-router/",
"permit2/=lib/universal-router/lib/permit2/",
"@interfaces/=src/interfaces/",
"@libs/=src/libs/",
"@core/=src/",
"@lens/=src/lens/",
"@utils/=src/utils/",
"@oracle/=src/oracle/",
"@test/=test/",
"@mocks/=test/mocks/",
"@script/=script/",
"@openzeppelin/uniswap-hooks/=lib/uniswap-hooks/",
"@ensdomains/=lib/universal-router/lib/v4-periphery/lib/v4-core/node_modules/@ensdomains/",
"@uniswap/v2-core/=lib/universal-router/node_modules/@uniswap/v2-core/",
"ds-test/=lib/universal-router/lib/solmate/lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"forge-gas-snapshot/=lib/universal-router/lib/permit2/lib/forge-gas-snapshot/src/",
"halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
"hardhat/=lib/universal-router/lib/v4-periphery/lib/v4-core/node_modules/hardhat/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"solmate/=lib/universal-router/lib/solmate/",
"uniswap-hooks/=lib/uniswap-hooks/src/",
"universal-router/=lib/universal-router/",
"v3-core/=lib/v3-core/",
"v3-periphery/=lib/v3-periphery/contracts/",
"v4-core/=lib/universal-router/lib/v4-periphery/lib/v4-core/src/",
"v4-periphery/=lib/universal-router/lib/v4-periphery/"
]
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.