Skip to content
Verified contractPartialMIT

DualPoolHook

Address0x0000005bb4df4109bf356a585c8b8ea70fcbaac0
Balance

0 ETH

 

Transactions

11

 

Compiler

solc 0.8.26

 

Same code

3 more contracts

 

Details

Compiler
solc 0.8.26+commit.8a97fa7a
Language
solidity
Optimization
Yes, 200 runs
EVM version
cancun
Via IR
yes
License
MIT
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
25,589,269
Creation transaction
0xdf805db7ff…943fbeee71

74 files

The source code is large: one file is shown at a time. Choose a file in the list.

lib/blocknumberish/src/BlockNumberish.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title BlockNumberish
/// A helper contract to get the current block number on different chains
/// inspired by https://github.com/ProjectOpenSea/tstorish/blob/main/src/Tstorish.sol
/// @custom:security-contact [email protected]
contract BlockNumberish {
    // Arbitrum One chain ID.
    uint256 private constant ARB_CHAIN_ID = 42_161;
    // Unichain chain ID.
    uint256 private constant UNICHAIN_CHAIN_ID = 130;
    /// @dev Function selector for arbBlockNumber() from: https://github.com/OffchainLabs/nitro-precompile-interfaces/blob/f49a4889b486fd804a7901203f5f663cfd1581c8/ArbSys.sol#L17
    uint32 private constant ARB_SYS_SELECTOR = 0xa3b1b31d;
    /// @dev Arbitrum system contract address (address(100))
    uint8 private constant ARB_SYS_ADDRESS = 0x64;
    /// @dev Function selector for getFlashblockNumber() from: https://github.com/Uniswap/flashblocks_number_contract/blob/a667d57f0055de80b9909c8837e872c4364853c3/src/IFlashblockNumber.sol#L70
    uint32 private constant UNICHAIN_FLASHBLOCK_NUMBER_SELECTOR = 0xe5b37c5d;
    /// @dev Unichain flashblock number address
    address private constant UNICHAIN_FLASHBLOCK_NUMBER_ADDRESS = 0x3c3A8a41E095C76b03f79f70955fFf3b03cf753E;

    /// @notice Internal view function to get the current block number.
    /// @dev Returns Arbitrum block number on Arbitrum One, standard block number elsewhere.
    function _getBlockNumberish() internal view returns (uint256 blockNumber) {
        if (block.chainid == ARB_CHAIN_ID) {
            assembly {
                mstore(0x00, ARB_SYS_SELECTOR)
                // staticcall(gas, address, argsOffset, argsSize, retOffset, retSize)
                let success := staticcall(gas(), ARB_SYS_ADDRESS, 0x1c, 0x04, 0x00, 0x20)
                // revert if the call fails from OOG or returns malformed data
                if or(iszero(success), iszero(eq(returndatasize(), 0x20))) {
                    revert(0, 0)
                }

                // load the stored block number from memory
                blockNumber := mload(0x00)
            }
        } else {
            blockNumber = block.number;
        }
    }

    /// @notice Internal view function to get the current flashblock number.
    /// @dev Returns Unichain flashblock number on Unichain, 0 elsewhere.
    function _getFlashblockNumberish() internal view returns (uint256 flashblockNumber) {
        if (block.chainid == UNICHAIN_CHAIN_ID) {
            assembly {
                mstore(0x00, UNICHAIN_FLASHBLOCK_NUMBER_SELECTOR)
                // staticcall(gas, address, argsOffset, argsSize, retOffset, retSize)
                let success := staticcall(gas(), UNICHAIN_FLASHBLOCK_NUMBER_ADDRESS, 0x1c, 0x04, 0x00, 0x20)
                // revert if the call fails from OOG or returns malformed data
                if or(iszero(success), iszero(eq(returndatasize(), 0x20))) {
                    revert(0, 0)
                }

                // load the stored block number from memory
                flashblockNumber := mload(0x00)
            }
        }
    }
}
Compiler settingsShow
{
  "viaIR": true,
  "metadata": {
    "appendCBOR": true,
    "bytecodeHash": "none",
    "useLiteralContent": false
  },
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "cancun",
  "remappings": [
    "@uniswap/v4-core/=lib/v4-core/",
    "@uniswap/v4-periphery/=lib/v4-periphery/",
    "@uniswap/blocknumberish/=lib/blocknumberish/",
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "@protocol-fees/=lib/protocol-fees/src/",
    "forge-std/=lib/forge-std/src/",
    "solmate/=lib/v4-core/lib/solmate/",
    "solady/=lib/solady/src/",
    "v4-core/=lib/v4-core/src/",
    "permit2/=lib/v4-periphery/lib/permit2/",
    "lib/fluid-contracts-public/:lib/openzeppelin-contracts/=lib/fluid-contracts-public/lib/openzeppelin-contracts/",
    "@ensdomains/=lib/v4-core/node_modules/@ensdomains/",
    "@eth-optimism-bedrock/=lib/protocol-fees/lib/optimism/packages/contracts-bedrock/",
    "BokkyPooBahsDateTimeLibrary/=lib/protocol-fees/lib/BokkyPooBahsDateTimeLibrary/",
    "blocknumberish/=lib/blocknumberish/src/",
    "briefcase/=lib/briefcase/src/",
    "dao-signer/=lib/protocol-fees/lib/dao-signer/",
    "ds-test/=lib/protocol-fees/lib/solmate/lib/ds-test/src/",
    "eas-contracts/=lib/protocol-fees/lib/dao-signer/lib/eas-contracts/contracts/",
    "erc4626-tests/=lib/fluid-contracts-public/lib/erc4626-tests/",
    "fluid-contracts-public/=lib/fluid-contracts-public/contracts/",
    "forge-gas-snapshot/=lib/v4-periphery/lib/permit2/lib/forge-gas-snapshot/src/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "hardhat/=lib/v4-core/node_modules/hardhat/",
    "kontrol-cheatcodes/=lib/protocol-fees/lib/optimism/packages/contracts-bedrock/lib/kontrol-cheatcodes/src/",
    "lib-keccak/=lib/protocol-fees/lib/optimism/packages/contracts-bedrock/lib/lib-keccak/contracts/",
    "murky/=lib/protocol-fees/lib/murky/",
    "openzeppelin-contracts-upgradeable/=lib/fluid-contracts-public/lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts-v5/=lib/protocol-fees/lib/optimism/packages/contracts-bedrock/lib/openzeppelin-contracts-v5/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "optimism/=lib/protocol-fees/lib/optimism/",
    "pancake-v3-contracts/=lib/pancake-v3-contracts/",
    "protocol-fees/=lib/protocol-fees/",
    "safe-contracts/=lib/protocol-fees/lib/optimism/packages/contracts-bedrock/lib/safe-contracts/",
    "scripts/libraries/Config.sol=lib/protocol-fees/lib/optimism/packages/contracts-bedrock/scripts/libraries/Config.sol",
    "solady-v0.0.245/=lib/protocol-fees/lib/optimism/packages/contracts-bedrock/lib/solady-v0.0.245/src/",
    "src/AgreementAnchor.sol=lib/protocol-fees/lib/dao-signer/src/AgreementAnchor.sol",
    "src/AgreementAnchorFactory.sol=lib/protocol-fees/lib/dao-signer/src/AgreementAnchorFactory.sol",
    "src/interfaces/IAgreementAnchorFactory.sol=lib/protocol-fees/lib/dao-signer/src/interfaces/IAgreementAnchorFactory.sol",
    "tstorish/=lib/tstorish/src/",
    "v2-core/=lib/v2-core/contracts/",
    "v3-core/=lib/v3-core/",
    "v4-periphery/=lib/v4-periphery/"
  ]
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.