ETH Price: $1,976.66 (+0.41%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim243902142026-02-05 11:04:3516 days ago1770289475IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.00001180.25996361
Claim243902132026-02-05 11:04:2316 days ago1770289463IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000019830.25228846
Claim243900062026-02-05 10:22:4716 days ago1770286967IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000007590.16716852
Claim243900052026-02-05 10:22:3516 days ago1770286955IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000013380.1702838
Claim243899842026-02-05 10:18:2316 days ago1770286703IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000012050.15344042
Claim243899582026-02-05 10:13:1116 days ago1770286391IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000168742.14886739
Claim243899382026-02-05 10:09:1116 days ago1770286151IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000169522.15635808
Claim243898702026-02-05 9:55:3516 days ago1770285335IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000013230.16829257
Claim243898612026-02-05 9:53:3516 days ago1770285215IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000167742.13542048
Claim243897982026-02-05 9:40:5916 days ago1770284459IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000171652.18380199
Claim243897702026-02-05 9:35:2316 days ago1770284123IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000174552.22066371
Claim243897502026-02-05 9:31:1116 days ago1770283871IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.00017662.24624834
Claim243897242026-02-05 9:25:5916 days ago1770283559IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000180262.29439762
Claim243897122026-02-05 9:23:3516 days ago1770283415IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000182222.31768615
Claim243896962026-02-05 9:20:2316 days ago1770283223IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000179622.28554602
Claim243896892026-02-05 9:18:5916 days ago1770283139IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000177412.25816324
Claim243896772026-02-05 9:16:3516 days ago1770282995IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000172472.19298633
Claim243896252026-02-05 9:06:1116 days ago1770282371IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000010150.12918382
Claim243895782026-02-05 8:56:4716 days ago1770281807IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000168912.14775511
Claim243895722026-02-05 8:55:3516 days ago1770281735IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000012070.15364044
Claim243894472026-02-05 8:30:2316 days ago1770280223IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000171372.18001274
Claim243874162026-02-05 1:40:4717 days ago1770255647IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000177322.25574938
Claim243873862026-02-05 1:34:4717 days ago1770255287IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000167382.12922224
Claim243867742026-02-04 23:31:4717 days ago1770247907IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.0001682.13720774
Claim243857602026-02-04 20:06:4717 days ago1770235607IN
0xa48dcEdb...c8fc2c9C7
0 ETH0.000189072.40491611
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MerkleDistributorWithDeadline

Compiler Version
v0.8.30+commit.73712a01

Optimization Enabled:
Yes with 800 runs

Other Settings:
prague EvmVersion
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.30;

import "./MerkleDistributor.sol";
import "@openzeppelin/contracts/access/Ownable2Step.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

/**
 * @title MerkleDistributorWithDeadline
 * @notice Merkle airdrop distributor with a claim deadline, pausable claims, and owner-controlled recovery.
 * @dev
 * - Claims are only valid while not paused and while `block.timestamp <= endTime`.
 * - `withdrawUnclaimed()` allows recovering remaining airdrop tokens after the claim window.
 * - `emergencyWithdraw()` allows recovering tokens during the claim window, but only when paused.
 * - Pause/unpause is granted to owner-configured pausers.
 */
contract MerkleDistributorWithDeadline is MerkleDistributor, Ownable2Step, Pausable {
    using SafeERC20 for IERC20;

    uint256 public immutable endTime;

    mapping(address => bool) public isPauser;

    event PauserUpdated(address indexed pauser, bool allowed);
    event UnclaimedWithdrawal(uint256 amount);
    event EmergencyWithdrawal(uint256 amount);

    error EndTimeInPast();
    error ClaimWindowFinished();
    error NoWithdrawDuringClaim();
    error NotPauser();

    modifier onlyPauser() {
        if (!isPauser[msg.sender] && msg.sender != owner()) revert NotPauser();
        _;
    }

    /**
     * @notice Deploy a merkle distributor with a fixed claim deadline
     * @dev Sets the owner to `msg.sender` and grants the owner pauser rights.
     * @param token_ ERC20 token being distributed
     * @param merkleRoot_ Merkle root of eligible claims (must match the leaf format in {MerkleDistributor})
     * @param endTime_ UNIX timestamp after which claims are no longer allowed
     */
    constructor(address token_, bytes32 merkleRoot_, uint256 endTime_)
        Ownable(msg.sender)
        MerkleDistributor(token_, merkleRoot_)
    {
        if (endTime_ <= block.timestamp) revert EndTimeInPast();
        endTime = endTime_;

        isPauser[msg.sender] = true;
        emit PauserUpdated(msg.sender, true);
    }

    /**
     * @notice Claim tokens if eligible under the merkle root
     * @dev Reverts if paused, after the deadline, already claimed, or proof is invalid.
     * @param index Merkle tree leaf index
     * @param account Recipient address for the claim
     * @param amount Amount of tokens to claim
     * @param merkleProof Merkle proof for (index, account, amount)
     */
    function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof)
        public
        override
        whenNotPaused
    {
        if (block.timestamp > endTime) revert ClaimWindowFinished();
        super.claim(index, account, amount, merkleProof);
    }

    /**
     * @notice Withdraw remaining (unclaimed) airdrop tokens after the claim window ends
     * @dev Callable only by the owner, and only after `endTime`.
     */
    function withdrawUnclaimed() external onlyOwner {
        if (block.timestamp <= endTime) revert NoWithdrawDuringClaim();
        uint256 amount = IERC20(token).balanceOf(address(this));
        IERC20(token).safeTransfer(msg.sender, amount);
        emit UnclaimedWithdrawal(amount);
    }

    /**
     * @notice Emergency withdraw of the airdrop token while paused
     * @dev Intended for incident response (e.g. critical vulnerability). This only withdraws the
     *      configured airdrop token (the same token used for claims). Unlike {withdrawUnclaimed}, this is
     *      callable during the claim window, but only when the contract is paused.
     * @param _amount Amount of airdrop tokens to withdraw
     */
    function emergencyWithdraw(uint256 _amount) external onlyOwner whenPaused {
        if (_amount == 0) revert InvalidArgument();
        IERC20(token).safeTransfer(msg.sender, _amount);
        emit EmergencyWithdrawal(_amount);
    }

    /**
     * @notice Recover ERC20 tokens accidentally sent to this contract
     * @dev Intended for recovering non-airdrop tokens. This function explicitly disallows recovering
     *      the airdrop token (use {withdrawUnclaimed} / {emergencyWithdraw} for that).
     * @param _erc20 ERC20 token to recover
     * @param _to Recipient address
     * @param _amount Amount to transfer
     */
    function recoverERC20(address _erc20, address _to, uint256 _amount) external onlyOwner {
        if (_erc20 == token || _erc20 == address(0) || _to == address(0)) revert InvalidArgument();
        if (_amount == 0) revert InvalidArgument();
        IERC20(_erc20).safeTransfer(_to, _amount);
    }

    /**
     * @notice Configure which accounts can pause/unpause claims
     * @dev Owner can grant or revoke pauser permissions in batch.
     * @param pausers List of addresses to update
     * @param allowed True to grant pauser rights; false to revoke
     */
    function setPausers(address[] calldata pausers, bool allowed) external onlyOwner {
        for (uint256 i = 0; i < pausers.length; i++) {
            address pauser = pausers[i];
            isPauser[pauser] = allowed;
            emit PauserUpdated(pauser, allowed);
        }
    }

    /**
     * @notice Pause claims
     * @dev Callable by an approved pauser or owner. While paused, {claim} reverts.
     */
    function pause() external onlyPauser {
        _pause();
    }

    /**
     * @notice Unpause claims
     * @dev Callable by an approved pauser or owner.
     */
    function unpause() external onlyPauser {
        _unpause();
    }
}

// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.30;

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./interfaces/IMerkleDistributor.sol";

/**
 * @title MerkleDistributor
 * @notice Base merkle airdrop distributor implementation.
 * @dev
 * - Claim eligibility is proven with a Merkle proof against {merkleRoot}.
 * - Leaves are computed as: `keccak256( bytes.concat( keccak256(abi.encode(index, account, amount)) ) )`.
 * - Uses OpenZeppelin {MerkleProof.verify}, which assumes sorted sibling pairs at each step.
 *   Your offchain merkle tree builder must match this convention.
 */
abstract contract MerkleDistributor is IMerkleDistributor {
    using SafeERC20 for IERC20;

    error AlreadyClaimed();
    error InvalidProof();
    error InvalidArgument();

    address public immutable override token;
    bytes32 public immutable override merkleRoot;

    // This is a packed array of booleans.
    mapping(uint256 => uint256) private claimedBitMap;

    /**
     * @notice Create a distributor instance
     * @param token_ ERC20 token being distributed
     * @param merkleRoot_ Merkle root for eligible claims
     */
    constructor(address token_, bytes32 merkleRoot_) {
        if (token_ == address(0)) revert InvalidArgument();
        if (merkleRoot_ == bytes32(0)) revert InvalidArgument();
        token = token_;
        merkleRoot = merkleRoot_;
    }

    /**
     * @notice Returns whether a given index has been claimed
     * @param index Merkle tree leaf index
     */
    function isClaimed(uint256 index) public view override returns (bool) {
        uint256 claimedWordIndex = index / 256;
        uint256 claimedBitIndex = index % 256;
        uint256 claimedWord = claimedBitMap[claimedWordIndex];
        uint256 mask = (1 << claimedBitIndex);
        return claimedWord & mask == mask;
    }

    function _setClaimed(uint256 index) private {
        uint256 claimedWordIndex = index / 256;
        uint256 claimedBitIndex = index % 256;
        claimedBitMap[claimedWordIndex] = claimedBitMap[claimedWordIndex] | (1 << claimedBitIndex);
    }

    /**
     * @notice Claim tokens for `account` if included in the merkle root
     * @dev Reverts if already claimed or if `merkleProof` is invalid.
     * @param index Merkle tree leaf index
     * @param account Recipient address for the claim
     * @param amount Amount of tokens to claim
     * @param merkleProof Merkle proof for (index, account, amount)
     */
    function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof)
        public
        virtual
        override
    {
        if (isClaimed(index)) revert AlreadyClaimed();

        // Verify the merkle proof.
        bytes32 node = keccak256(bytes.concat(keccak256(abi.encode(index, account, amount))));
        if (!MerkleProof.verify(merkleProof, merkleRoot, node)) {
            revert InvalidProof();
        }

        // Mark it claimed and send the token.
        _setClaimed(index);
        IERC20(token).safeTransfer(account, amount);

        emit Claimed(index, account, amount);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.20;

import {Ownable} from "./Ownable.sol";

/**
 * @dev Contract module which provides access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * This extension of the {Ownable} contract includes a two-step mechanism to transfer
 * ownership, where the new owner must call {acceptOwnership} in order to replace the
 * old one. This can help prevent common mistakes, such as transfers of ownership to
 * incorrect accounts, or to contracts that are unable to interact with the
 * permission system.
 *
 * The initial owner is specified at deployment time in the constructor for `Ownable`. This
 * can later be changed with {transferOwnership} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2Step is Ownable {
    address private _pendingOwner;

    event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Returns the address of the pending owner.
     */
    function pendingOwner() public view virtual returns (address) {
        return _pendingOwner;
    }

    /**
     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
     * Can only be called by the current owner.
     *
     * Setting `newOwner` to the zero address is allowed; this can be used to cancel an initiated ownership transfer.
     */
    function transferOwnership(address newOwner) public virtual override onlyOwner {
        _pendingOwner = newOwner;
        emit OwnershipTransferStarted(owner(), newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual override {
        delete _pendingOwner;
        super._transferOwnership(newOwner);
    }

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() public virtual {
        address sender = _msgSender();
        if (pendingOwner() != sender) {
            revert OwnableUnauthorizedAccount(sender);
        }
        _transferOwnership(sender);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (utils/Pausable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    bool private _paused;

    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    /**
     * @dev The operation failed because the contract is paused.
     */
    error EnforcedPause();

    /**
     * @dev The operation failed because the contract is not paused.
     */
    error ExpectedPause();

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        if (paused()) {
            revert EnforcedPause();
        }
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        if (!paused()) {
            revert ExpectedPause();
        }
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.5.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC-20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    /**
     * @dev An operation with an ERC-20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        if (!_safeTransfer(token, to, value, true)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        if (!_safeTransferFrom(token, from, to, value, true)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
     */
    function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
        return _safeTransfer(token, to, value, false);
    }

    /**
     * @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
     */
    function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
        return _safeTransferFrom(token, from, to, value, false);
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     *
     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
     * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
     * set here.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        if (!_safeApprove(token, spender, value, false)) {
            if (!_safeApprove(token, spender, 0, true)) revert SafeERC20FailedOperation(address(token));
            if (!_safeApprove(token, spender, value, true)) revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that relies on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            safeTransfer(token, to, value);
        } else if (!token.transferAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
     * has no code. This can be used to implement an {ERC721}-like safe transfer that relies on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferFromAndCallRelaxed(
        IERC1363 token,
        address from,
        address to,
        uint256 value,
        bytes memory data
    ) internal {
        if (to.code.length == 0) {
            safeTransferFrom(token, from, to, value);
        } else if (!token.transferFromAndCall(from, to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
     * Oppositely, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
     * once without retrying, and relies on the returned value to be true.
     *
     * Reverts if the returned value is other than `true`.
     */
    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            forceApprove(token, to, value);
        } else if (!token.approveAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity `token.transfer(to, value)` call, relaxing the requirement on the return value: the
     * return value is optional (but if data is returned, it must not be false).
     *
     * @param token The token targeted by the call.
     * @param to The recipient of the tokens
     * @param value The amount of token to transfer
     * @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.
     */
    function _safeTransfer(IERC20 token, address to, uint256 value, bool bubble) private returns (bool success) {
        bytes4 selector = IERC20.transfer.selector;

        assembly ("memory-safe") {
            let fmp := mload(0x40)
            mstore(0x00, selector)
            mstore(0x04, and(to, shr(96, not(0))))
            mstore(0x24, value)
            success := call(gas(), token, 0, 0x00, 0x44, 0x00, 0x20)
            // if call success and return is true, all is good.
            // otherwise (not success or return is not true), we need to perform further checks
            if iszero(and(success, eq(mload(0x00), 1))) {
                // if the call was a failure and bubble is enabled, bubble the error
                if and(iszero(success), bubble) {
                    returndatacopy(fmp, 0x00, returndatasize())
                    revert(fmp, returndatasize())
                }
                // if the return value is not true, then the call is only successful if:
                // - the token address has code
                // - the returndata is empty
                success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))
            }
            mstore(0x40, fmp)
        }
    }

    /**
     * @dev Imitates a Solidity `token.transferFrom(from, to, value)` call, relaxing the requirement on the return
     * value: the return value is optional (but if data is returned, it must not be false).
     *
     * @param token The token targeted by the call.
     * @param from The sender of the tokens
     * @param to The recipient of the tokens
     * @param value The amount of token to transfer
     * @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.
     */
    function _safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value,
        bool bubble
    ) private returns (bool success) {
        bytes4 selector = IERC20.transferFrom.selector;

        assembly ("memory-safe") {
            let fmp := mload(0x40)
            mstore(0x00, selector)
            mstore(0x04, and(from, shr(96, not(0))))
            mstore(0x24, and(to, shr(96, not(0))))
            mstore(0x44, value)
            success := call(gas(), token, 0, 0x00, 0x64, 0x00, 0x20)
            // if call success and return is true, all is good.
            // otherwise (not success or return is not true), we need to perform further checks
            if iszero(and(success, eq(mload(0x00), 1))) {
                // if the call was a failure and bubble is enabled, bubble the error
                if and(iszero(success), bubble) {
                    returndatacopy(fmp, 0x00, returndatasize())
                    revert(fmp, returndatasize())
                }
                // if the return value is not true, then the call is only successful if:
                // - the token address has code
                // - the returndata is empty
                success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))
            }
            mstore(0x40, fmp)
            mstore(0x60, 0)
        }
    }

    /**
     * @dev Imitates a Solidity `token.approve(spender, value)` call, relaxing the requirement on the return value:
     * the return value is optional (but if data is returned, it must not be false).
     *
     * @param token The token targeted by the call.
     * @param spender The spender of the tokens
     * @param value The amount of token to transfer
     * @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.
     */
    function _safeApprove(IERC20 token, address spender, uint256 value, bool bubble) private returns (bool success) {
        bytes4 selector = IERC20.approve.selector;

        assembly ("memory-safe") {
            let fmp := mload(0x40)
            mstore(0x00, selector)
            mstore(0x04, and(spender, shr(96, not(0))))
            mstore(0x24, value)
            success := call(gas(), token, 0, 0x00, 0x44, 0x00, 0x20)
            // if call success and return is true, all is good.
            // otherwise (not success or return is not true), we need to perform further checks
            if iszero(and(success, eq(mload(0x00), 1))) {
                // if the call was a failure and bubble is enabled, bubble the error
                if and(iszero(success), bubble) {
                    returndatacopy(fmp, 0x00, returndatasize())
                    revert(fmp, returndatasize())
                }
                // if the return value is not true, then the call is only successful if:
                // - the token address has code
                // - the returndata is empty
                success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))
            }
            mstore(0x40, fmp)
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MerkleProof.sol)
// This file was procedurally generated from scripts/generate/templates/MerkleProof.js.

pragma solidity ^0.8.20;

import {Hashes} from "./Hashes.sol";

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The tree and the proofs can be generated using our
 * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
 * You will find a quickstart guide in the readme.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the Merkle tree could be reinterpreted as a leaf value.
 * OpenZeppelin's JavaScript library generates Merkle trees that are safe
 * against this attack out of the box.
 *
 * IMPORTANT: Consider memory side-effects when using custom hashing functions
 * that access memory in an unsafe way.
 *
 * NOTE: This library supports proof verification for merkle trees built using
 * custom _commutative_ hashing functions (i.e. `H(a, b) == H(b, a)`). Proving
 * leaf inclusion in trees built using non-commutative hashing functions requires
 * additional logic that is not supported by this library.
 */
library MerkleProof {
    /**
     *@dev The multiproof provided is not valid.
     */
    error MerkleProofInvalidMultiproof();

    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     *
     * This version handles proofs in memory with the default hashing function.
     */
    function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leaves & pre-images are assumed to be sorted.
     *
     * This version handles proofs in memory with the default hashing function.
     */
    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = Hashes.commutativeKeccak256(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     *
     * This version handles proofs in memory with a custom hashing function.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf,
        function(bytes32, bytes32) view returns (bytes32) hasher
    ) internal view returns (bool) {
        return processProof(proof, leaf, hasher) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leaves & pre-images are assumed to be sorted.
     *
     * This version handles proofs in memory with a custom hashing function.
     */
    function processProof(
        bytes32[] memory proof,
        bytes32 leaf,
        function(bytes32, bytes32) view returns (bytes32) hasher
    ) internal view returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = hasher(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     *
     * This version handles proofs in calldata with the default hashing function.
     */
    function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
        return processProofCalldata(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leaves & pre-images are assumed to be sorted.
     *
     * This version handles proofs in calldata with the default hashing function.
     */
    function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = Hashes.commutativeKeccak256(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     *
     * This version handles proofs in calldata with a custom hashing function.
     */
    function verifyCalldata(
        bytes32[] calldata proof,
        bytes32 root,
        bytes32 leaf,
        function(bytes32, bytes32) view returns (bytes32) hasher
    ) internal view returns (bool) {
        return processProofCalldata(proof, leaf, hasher) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leaves & pre-images are assumed to be sorted.
     *
     * This version handles proofs in calldata with a custom hashing function.
     */
    function processProofCalldata(
        bytes32[] calldata proof,
        bytes32 leaf,
        function(bytes32, bytes32) view returns (bytes32) hasher
    ) internal view returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = hasher(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * This version handles multiproofs in memory with the default hashing function.
     *
     * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
     * The `leaves` must be validated independently. See {processMultiProof}.
     */
    function multiProofVerify(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProof(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
     * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
     * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
     * respectively.
     *
     * This version handles multiproofs in memory with the default hashing function.
     *
     * CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
     * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
     * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
     *
     * NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
     * and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
     * validating the leaves elsewhere.
     */
    function processMultiProof(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the Merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 proofFlagsLen = proofFlags.length;

        // Check proof validity.
        if (leavesLen + proof.length != proofFlagsLen + 1) {
            revert MerkleProofInvalidMultiproof();
        }

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](proofFlagsLen);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < proofFlagsLen; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i]
                ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
                : proof[proofPos++];
            hashes[i] = Hashes.commutativeKeccak256(a, b);
        }

        if (proofFlagsLen > 0) {
            if (proofPos != proof.length) {
                revert MerkleProofInvalidMultiproof();
            }
            unchecked {
                return hashes[proofFlagsLen - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    /**
     * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * This version handles multiproofs in memory with a custom hashing function.
     *
     * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
     * The `leaves` must be validated independently. See {processMultiProof}.
     */
    function multiProofVerify(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32 root,
        bytes32[] memory leaves,
        function(bytes32, bytes32) view returns (bytes32) hasher
    ) internal view returns (bool) {
        return processMultiProof(proof, proofFlags, leaves, hasher) == root;
    }

    /**
     * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
     * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
     * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
     * respectively.
     *
     * This version handles multiproofs in memory with a custom hashing function.
     *
     * CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
     * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
     * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
     *
     * NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
     * and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
     * validating the leaves elsewhere.
     */
    function processMultiProof(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32[] memory leaves,
        function(bytes32, bytes32) view returns (bytes32) hasher
    ) internal view returns (bytes32 merkleRoot) {
        // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the Merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 proofFlagsLen = proofFlags.length;

        // Check proof validity.
        if (leavesLen + proof.length != proofFlagsLen + 1) {
            revert MerkleProofInvalidMultiproof();
        }

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](proofFlagsLen);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < proofFlagsLen; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i]
                ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
                : proof[proofPos++];
            hashes[i] = hasher(a, b);
        }

        if (proofFlagsLen > 0) {
            if (proofPos != proof.length) {
                revert MerkleProofInvalidMultiproof();
            }
            unchecked {
                return hashes[proofFlagsLen - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    /**
     * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * This version handles multiproofs in calldata with the default hashing function.
     *
     * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
     * The `leaves` must be validated independently. See {processMultiProofCalldata}.
     */
    function multiProofVerifyCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProofCalldata(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
     * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
     * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
     * respectively.
     *
     * This version handles multiproofs in calldata with the default hashing function.
     *
     * CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
     * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
     * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
     *
     * NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
     * and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
     * validating the leaves elsewhere.
     */
    function processMultiProofCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the Merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 proofFlagsLen = proofFlags.length;

        // Check proof validity.
        if (leavesLen + proof.length != proofFlagsLen + 1) {
            revert MerkleProofInvalidMultiproof();
        }

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](proofFlagsLen);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < proofFlagsLen; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i]
                ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
                : proof[proofPos++];
            hashes[i] = Hashes.commutativeKeccak256(a, b);
        }

        if (proofFlagsLen > 0) {
            if (proofPos != proof.length) {
                revert MerkleProofInvalidMultiproof();
            }
            unchecked {
                return hashes[proofFlagsLen - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    /**
     * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * This version handles multiproofs in calldata with a custom hashing function.
     *
     * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
     * The `leaves` must be validated independently. See {processMultiProofCalldata}.
     */
    function multiProofVerifyCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32 root,
        bytes32[] memory leaves,
        function(bytes32, bytes32) view returns (bytes32) hasher
    ) internal view returns (bool) {
        return processMultiProofCalldata(proof, proofFlags, leaves, hasher) == root;
    }

    /**
     * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
     * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
     * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
     * respectively.
     *
     * This version handles multiproofs in calldata with a custom hashing function.
     *
     * CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
     * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
     * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
     *
     * NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
     * and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
     * validating the leaves elsewhere.
     */
    function processMultiProofCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32[] memory leaves,
        function(bytes32, bytes32) view returns (bytes32) hasher
    ) internal view returns (bytes32 merkleRoot) {
        // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the Merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 proofFlagsLen = proofFlags.length;

        // Check proof validity.
        if (leavesLen + proof.length != proofFlagsLen + 1) {
            revert MerkleProofInvalidMultiproof();
        }

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](proofFlagsLen);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < proofFlagsLen; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i]
                ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
                : proof[proofPos++];
            hashes[i] = hasher(a, b);
        }

        if (proofFlagsLen > 0) {
            if (proofPos != proof.length) {
                revert MerkleProofInvalidMultiproof();
            }
            unchecked {
                return hashes[proofFlagsLen - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }
}

// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.0;

// Allows anyone to claim a token if they exist in a merkle root.
interface IMerkleDistributor {
    // Returns the address of the token distributed by this contract.
    function token() external view returns (address);
    // Returns the merkle root of the merkle tree containing account balances available to claim.
    function merkleRoot() external view returns (bytes32);
    // Returns true if the index has been marked claimed.
    function isClaimed(uint256 index) external view returns (bool);
    // Claim the given amount of the token to the given address. Reverts if the inputs are invalid.
    function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external;

    // This event is triggered whenever a call to #claim succeeds.
    event Claimed(uint256 index, address account, uint256 amount);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)

pragma solidity >=0.4.16;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1363.sol)

pragma solidity >=0.6.2;

import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";

/**
 * @title IERC1363
 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
 *
 * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
 * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
 */
interface IERC1363 is IERC20, IERC165 {
    /*
     * Note: the ERC-165 identifier for this interface is 0xb0202a11.
     * 0xb0202a11 ===
     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^
     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
     */

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @param data Additional data with no specified format, sent in call to `spender`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (utils/cryptography/Hashes.sol)

pragma solidity ^0.8.20;

/**
 * @dev Library of standard hash functions.
 *
 * _Available since v5.1._
 */
library Hashes {
    /**
     * @dev Commutative Keccak256 hash of a sorted pair of bytes32. Frequently used when working with merkle proofs.
     *
     * NOTE: Equivalent to the `standardNodeHash` in our https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
     */
    function commutativeKeccak256(bytes32 a, bytes32 b) internal pure returns (bytes32) {
        return a < b ? efficientKeccak256(a, b) : efficientKeccak256(b, a);
    }

    /**
     * @dev Implementation of keccak256(abi.encode(a, b)) that doesn't allocate or expand memory.
     */
    function efficientKeccak256(bytes32 a, bytes32 b) internal pure returns (bytes32 value) {
        assembly ("memory-safe") {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 13 of 15 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol)

pragma solidity >=0.4.16;

import {IERC20} from "../token/ERC20/IERC20.sol";

File 14 of 15 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC165.sol)

pragma solidity >=0.4.16;

import {IERC165} from "../utils/introspection/IERC165.sol";

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)

pragma solidity >=0.4.16;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

Settings
{
  "remappings": [
    "forge-std/=lib/forge-std/src/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 800
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "prague",
  "viaIR": false
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"bytes32","name":"merkleRoot_","type":"bytes32"},{"internalType":"uint256","name":"endTime_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyClaimed","type":"error"},{"inputs":[],"name":"ClaimWindowFinished","type":"error"},{"inputs":[],"name":"EndTimeInPast","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"InvalidArgument","type":"error"},{"inputs":[],"name":"InvalidProof","type":"error"},{"inputs":[],"name":"NoWithdrawDuringClaim","type":"error"},{"inputs":[],"name":"NotPauser","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdrawal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pauser","type":"address"},{"indexed":false,"internalType":"bool","name":"allowed","type":"bool"}],"name":"PauserUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"UnclaimedWithdrawal","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"isClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isPauser","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_erc20","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"pausers","type":"address[]"},{"internalType":"bool","name":"allowed","type":"bool"}],"name":"setPausers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawUnclaimed","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60e060405234801561000f575f5ffd5b5060405161110438038061110483398101604081905261002e916101a0565b3383836001600160a01b0382166100585760405163a9cb9e0d60e01b815260040160405180910390fd5b806100765760405163a9cb9e0d60e01b815260040160405180910390fd5b6001600160a01b0391821660805260a05281166100ac57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6100b581610133565b504281116100d6576040516372e54d4d60e01b815260040160405180910390fd5b60c0819052335f81815260036020908152604091829020805460ff1916600190811790915591519182527f902923dcd4814f6cef7005a70e01d5cf2035ab02d4523ef3b865f1d7bab885af910160405180910390a25050506101df565b600280546001600160a01b031916905561014c8161014f565b50565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f5f5f606084860312156101b2575f5ffd5b83516001600160a01b03811681146101c8575f5ffd5b602085015160409095015190969495509392505050565b60805160a05160c051610ec36102415f395f81816101ad01528181610441015261049e01525f8181610173015261096201525f81816102af015281816102db015281816104f3015281816105730152818161066001526109c00152610ec35ff3fe608060405234801561000f575f5ffd5b506004361061012f575f3560e01c80635c975abb116100ad5780638da5cb5b1161007d578063e30c397811610063578063e30c397814610286578063f2fde38b14610297578063fc0c546a146102aa575f5ffd5b80638da5cb5b1461024e5780639e34070f14610273575f5ffd5b80635c975abb14610224578063715018a61461023657806379ba50971461023e5780638456cb5914610246575f5ffd5b80633197cbb6116101025780633f4ba83a116100e85780633f4ba83a146101d757806346fbf68e146101df5780635312ea8e14610211575f5ffd5b80633197cbb6146101a857806333fc56d9146101cf575f5ffd5b80631171bda9146101335780632647714e146101485780632e7ba6ef1461015b5780632eb4a7ab1461016e575b5f5ffd5b610146610141366004610cbc565b6102d1565b005b610146610156366004610d3e565b610389565b610146610169366004610d95565b610437565b6101957f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6101957f000000000000000000000000000000000000000000000000000000000000000081565b610146610494565b6101466105d1565b6102016101ed366004610df8565b60036020525f908152604090205460ff1681565b604051901515815260200161019f565b61014661021f366004610e11565b610623565b600254600160a01b900460ff16610201565b6101466106b7565b6101466106c8565b610146610711565b6001546001600160a01b03165b6040516001600160a01b03909116815260200161019f565b610201610281366004610e11565b610761565b6002546001600160a01b031661025b565b6101466102a5366004610df8565b61079f565b61025b7f000000000000000000000000000000000000000000000000000000000000000081565b6102d961081d565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316148061032057506001600160a01b038316155b8061033257506001600160a01b038216155b156103505760405163a9cb9e0d60e01b815260040160405180910390fd5b805f036103705760405163a9cb9e0d60e01b815260040160405180910390fd5b6103846001600160a01b038416838361084a565b505050565b61039161081d565b5f5b82811015610431575f8484838181106103ae576103ae610e28565b90506020020160208101906103c39190610df8565b6001600160a01b0381165f8181526003602052604090819020805487151560ff1990911617905551919250907f902923dcd4814f6cef7005a70e01d5cf2035ab02d4523ef3b865f1d7bab885af9061042090861515815260200190565b60405180910390a250600101610393565b50505050565b61043f61087f565b7f00000000000000000000000000000000000000000000000000000000000000004211156104805760405163d365f61160e01b815260040160405180910390fd5b61048d85858585856108aa565b5050505050565b61049c61081d565b7f000000000000000000000000000000000000000000000000000000000000000042116104dc57604051630ee56a2b60e41b815260040160405180910390fd5b6040516370a0823160e01b81523060048201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610540573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105649190610e3c565b905061059a6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016338361084a565b6040518181527f87045ccbebe712e7f7444ee3ab071093f31e20b7c33dc69f972890df40492cdf906020015b60405180910390a150565b335f9081526003602052604090205460ff161580156105fb57506001546001600160a01b03163314155b156106195760405163492f678160e01b815260040160405180910390fd5b610621610a38565b565b61062b61081d565b610633610a8d565b805f036106535760405163a9cb9e0d60e01b815260040160405180910390fd5b6106876001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016338361084a565b6040518181527fcbba13897c2ac3f7fdb11e857b1a5a5c47f51e3fbeffa74d430f2b06177b45c0906020016105c6565b6106bf61081d565b6106215f610ab7565b60025433906001600160a01b031681146107055760405163118cdaa760e01b81526001600160a01b03821660048201526024015b60405180910390fd5b61070e81610ab7565b50565b335f9081526003602052604090205460ff1615801561073b57506001546001600160a01b03163314155b156107595760405163492f678160e01b815260040160405180910390fd5b610621610add565b5f8061076f61010084610e67565b90505f61077e61010085610e7a565b5f9283526020839052604090922054600190921b9182169091149392505050565b6107a761081d565b600280546001600160a01b03831673ffffffffffffffffffffffffffffffffffffffff1990911681179091556107e56001546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6001546001600160a01b031633146106215760405163118cdaa760e01b81523360048201526024016106fc565b6108578383836001610b20565b61038457604051635274afe760e01b81526001600160a01b03841660048201526024016106fc565b600254600160a01b900460ff16156106215760405163d93c066560e01b815260040160405180910390fd5b6108b385610761565b156108d157604051630c8d9eab60e31b815260040160405180910390fd5b60408051602081018790526001600160a01b03861691810191909152606081018490525f9060800160408051601f198184030181528282528051602091820120908301520160405160208183030381529060405280519060200120905061098d8383808060200260200160405190810160405280939291908181526020018383602002808284375f920191909152507f00000000000000000000000000000000000000000000000000000000000000009250859150610b829050565b6109aa576040516309bde33960e01b815260040160405180910390fd5b6109b386610b97565b6109e76001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016868661084a565b604080518781526001600160a01b03871660208201529081018590527f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed0269060600160405180910390a1505050505050565b610a40610a8d565b6002805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600254600160a01b900460ff1661062157604051638dfc202b60e01b815260040160405180910390fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916905561070e81610bd2565b610ae561087f565b6002805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610a703390565b60405163a9059cbb60e01b5f8181526001600160a01b038616600452602485905291602083604481808b5af1925060015f51148316610b76578383151615610b6a573d5f823e3d81fd5b5f873b113d1516831692505b60405250949350505050565b5f82610b8e8584610c30565b14949350505050565b5f610ba461010083610e67565b90505f610bb361010084610e7a565b5f928352602083905260409092208054600190931b9092179091555050565b600180546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f81815b8451811015610c6a57610c6082868381518110610c5357610c53610e28565b6020026020010151610c72565b9150600101610c34565b509392505050565b5f818310610c8c575f828152602084905260409020610c9a565b5f8381526020839052604090205b9392505050565b80356001600160a01b0381168114610cb7575f5ffd5b919050565b5f5f5f60608486031215610cce575f5ffd5b610cd784610ca1565b9250610ce560208501610ca1565b929592945050506040919091013590565b5f5f83601f840112610d06575f5ffd5b50813567ffffffffffffffff811115610d1d575f5ffd5b6020830191508360208260051b8501011115610d37575f5ffd5b9250929050565b5f5f5f60408486031215610d50575f5ffd5b833567ffffffffffffffff811115610d66575f5ffd5b610d7286828701610cf6565b90945092505060208401358015158114610d8a575f5ffd5b809150509250925092565b5f5f5f5f5f60808688031215610da9575f5ffd5b85359450610db960208701610ca1565b935060408601359250606086013567ffffffffffffffff811115610ddb575f5ffd5b610de788828901610cf6565b969995985093965092949392505050565b5f60208284031215610e08575f5ffd5b610c9a82610ca1565b5f60208284031215610e21575f5ffd5b5035919050565b634e487b7160e01b5f52603260045260245ffd5b5f60208284031215610e4c575f5ffd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b5f82610e7557610e75610e53565b500490565b5f82610e8857610e88610e53565b50069056fea2646970667358221220a2b9dbb39c29df44f6aa9638b01f5cf9329b02c314faae32b35e7c17c4b16b4f64736f6c634300081e0033000000000000000000000000086f405146ce90135750bbec9a063a8b20a8bffb66cc7831d34f692fb77c40495e401d508b8c3f6cc5d57ded574b3f4086e3ca610000000000000000000000000000000000000000000000000000000069849450

Deployed Bytecode

0x608060405234801561000f575f5ffd5b506004361061012f575f3560e01c80635c975abb116100ad5780638da5cb5b1161007d578063e30c397811610063578063e30c397814610286578063f2fde38b14610297578063fc0c546a146102aa575f5ffd5b80638da5cb5b1461024e5780639e34070f14610273575f5ffd5b80635c975abb14610224578063715018a61461023657806379ba50971461023e5780638456cb5914610246575f5ffd5b80633197cbb6116101025780633f4ba83a116100e85780633f4ba83a146101d757806346fbf68e146101df5780635312ea8e14610211575f5ffd5b80633197cbb6146101a857806333fc56d9146101cf575f5ffd5b80631171bda9146101335780632647714e146101485780632e7ba6ef1461015b5780632eb4a7ab1461016e575b5f5ffd5b610146610141366004610cbc565b6102d1565b005b610146610156366004610d3e565b610389565b610146610169366004610d95565b610437565b6101957f66cc7831d34f692fb77c40495e401d508b8c3f6cc5d57ded574b3f4086e3ca6181565b6040519081526020015b60405180910390f35b6101957f000000000000000000000000000000000000000000000000000000006984945081565b610146610494565b6101466105d1565b6102016101ed366004610df8565b60036020525f908152604090205460ff1681565b604051901515815260200161019f565b61014661021f366004610e11565b610623565b600254600160a01b900460ff16610201565b6101466106b7565b6101466106c8565b610146610711565b6001546001600160a01b03165b6040516001600160a01b03909116815260200161019f565b610201610281366004610e11565b610761565b6002546001600160a01b031661025b565b6101466102a5366004610df8565b61079f565b61025b7f000000000000000000000000086f405146ce90135750bbec9a063a8b20a8bffb81565b6102d961081d565b7f000000000000000000000000086f405146ce90135750bbec9a063a8b20a8bffb6001600160a01b0316836001600160a01b0316148061032057506001600160a01b038316155b8061033257506001600160a01b038216155b156103505760405163a9cb9e0d60e01b815260040160405180910390fd5b805f036103705760405163a9cb9e0d60e01b815260040160405180910390fd5b6103846001600160a01b038416838361084a565b505050565b61039161081d565b5f5b82811015610431575f8484838181106103ae576103ae610e28565b90506020020160208101906103c39190610df8565b6001600160a01b0381165f8181526003602052604090819020805487151560ff1990911617905551919250907f902923dcd4814f6cef7005a70e01d5cf2035ab02d4523ef3b865f1d7bab885af9061042090861515815260200190565b60405180910390a250600101610393565b50505050565b61043f61087f565b7f00000000000000000000000000000000000000000000000000000000698494504211156104805760405163d365f61160e01b815260040160405180910390fd5b61048d85858585856108aa565b5050505050565b61049c61081d565b7f000000000000000000000000000000000000000000000000000000006984945042116104dc57604051630ee56a2b60e41b815260040160405180910390fd5b6040516370a0823160e01b81523060048201525f907f000000000000000000000000086f405146ce90135750bbec9a063a8b20a8bffb6001600160a01b0316906370a0823190602401602060405180830381865afa158015610540573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105649190610e3c565b905061059a6001600160a01b037f000000000000000000000000086f405146ce90135750bbec9a063a8b20a8bffb16338361084a565b6040518181527f87045ccbebe712e7f7444ee3ab071093f31e20b7c33dc69f972890df40492cdf906020015b60405180910390a150565b335f9081526003602052604090205460ff161580156105fb57506001546001600160a01b03163314155b156106195760405163492f678160e01b815260040160405180910390fd5b610621610a38565b565b61062b61081d565b610633610a8d565b805f036106535760405163a9cb9e0d60e01b815260040160405180910390fd5b6106876001600160a01b037f000000000000000000000000086f405146ce90135750bbec9a063a8b20a8bffb16338361084a565b6040518181527fcbba13897c2ac3f7fdb11e857b1a5a5c47f51e3fbeffa74d430f2b06177b45c0906020016105c6565b6106bf61081d565b6106215f610ab7565b60025433906001600160a01b031681146107055760405163118cdaa760e01b81526001600160a01b03821660048201526024015b60405180910390fd5b61070e81610ab7565b50565b335f9081526003602052604090205460ff1615801561073b57506001546001600160a01b03163314155b156107595760405163492f678160e01b815260040160405180910390fd5b610621610add565b5f8061076f61010084610e67565b90505f61077e61010085610e7a565b5f9283526020839052604090922054600190921b9182169091149392505050565b6107a761081d565b600280546001600160a01b03831673ffffffffffffffffffffffffffffffffffffffff1990911681179091556107e56001546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6001546001600160a01b031633146106215760405163118cdaa760e01b81523360048201526024016106fc565b6108578383836001610b20565b61038457604051635274afe760e01b81526001600160a01b03841660048201526024016106fc565b600254600160a01b900460ff16156106215760405163d93c066560e01b815260040160405180910390fd5b6108b385610761565b156108d157604051630c8d9eab60e31b815260040160405180910390fd5b60408051602081018790526001600160a01b03861691810191909152606081018490525f9060800160408051601f198184030181528282528051602091820120908301520160405160208183030381529060405280519060200120905061098d8383808060200260200160405190810160405280939291908181526020018383602002808284375f920191909152507f66cc7831d34f692fb77c40495e401d508b8c3f6cc5d57ded574b3f4086e3ca619250859150610b829050565b6109aa576040516309bde33960e01b815260040160405180910390fd5b6109b386610b97565b6109e76001600160a01b037f000000000000000000000000086f405146ce90135750bbec9a063a8b20a8bffb16868661084a565b604080518781526001600160a01b03871660208201529081018590527f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed0269060600160405180910390a1505050505050565b610a40610a8d565b6002805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600254600160a01b900460ff1661062157604051638dfc202b60e01b815260040160405180910390fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916905561070e81610bd2565b610ae561087f565b6002805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610a703390565b60405163a9059cbb60e01b5f8181526001600160a01b038616600452602485905291602083604481808b5af1925060015f51148316610b76578383151615610b6a573d5f823e3d81fd5b5f873b113d1516831692505b60405250949350505050565b5f82610b8e8584610c30565b14949350505050565b5f610ba461010083610e67565b90505f610bb361010084610e7a565b5f928352602083905260409092208054600190931b9092179091555050565b600180546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f81815b8451811015610c6a57610c6082868381518110610c5357610c53610e28565b6020026020010151610c72565b9150600101610c34565b509392505050565b5f818310610c8c575f828152602084905260409020610c9a565b5f8381526020839052604090205b9392505050565b80356001600160a01b0381168114610cb7575f5ffd5b919050565b5f5f5f60608486031215610cce575f5ffd5b610cd784610ca1565b9250610ce560208501610ca1565b929592945050506040919091013590565b5f5f83601f840112610d06575f5ffd5b50813567ffffffffffffffff811115610d1d575f5ffd5b6020830191508360208260051b8501011115610d37575f5ffd5b9250929050565b5f5f5f60408486031215610d50575f5ffd5b833567ffffffffffffffff811115610d66575f5ffd5b610d7286828701610cf6565b90945092505060208401358015158114610d8a575f5ffd5b809150509250925092565b5f5f5f5f5f60808688031215610da9575f5ffd5b85359450610db960208701610ca1565b935060408601359250606086013567ffffffffffffffff811115610ddb575f5ffd5b610de788828901610cf6565b969995985093965092949392505050565b5f60208284031215610e08575f5ffd5b610c9a82610ca1565b5f60208284031215610e21575f5ffd5b5035919050565b634e487b7160e01b5f52603260045260245ffd5b5f60208284031215610e4c575f5ffd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b5f82610e7557610e75610e53565b500490565b5f82610e8857610e88610e53565b50069056fea2646970667358221220a2b9dbb39c29df44f6aa9638b01f5cf9329b02c314faae32b35e7c17c4b16b4f64736f6c634300081e0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000086f405146ce90135750bbec9a063a8b20a8bffb66cc7831d34f692fb77c40495e401d508b8c3f6cc5d57ded574b3f4086e3ca610000000000000000000000000000000000000000000000000000000069849450

-----Decoded View---------------
Arg [0] : token_ (address): 0x086F405146Ce90135750Bbec9A063a8B20A8bfFb
Arg [1] : merkleRoot_ (bytes32): 0x66cc7831d34f692fb77c40495e401d508b8c3f6cc5d57ded574b3f4086e3ca61
Arg [2] : endTime_ (uint256): 1770296400

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000086f405146ce90135750bbec9a063a8b20a8bffb
Arg [1] : 66cc7831d34f692fb77c40495e401d508b8c3f6cc5d57ded574b3f4086e3ca61
Arg [2] : 0000000000000000000000000000000000000000000000000000000069849450


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.