ETH Price: $4,481.31 (-4.82%)

Contract

0x786a879057d11bafE8eC2fd49f8f3AD4394F0E08
 

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
Claim230826422025-08-06 14:31:5962 days ago1754490719IN
0x786a8790...4394F0E08
0 ETH0.000113481.07394161
Claim230826002025-08-06 14:23:3562 days ago1754490215IN
0x786a8790...4394F0E08
0 ETH0.000091540.86674758
Claim230825832025-08-06 14:20:1162 days ago1754490011IN
0x786a8790...4394F0E08
0 ETH0.000283622.68499862
Claim230814922025-08-06 10:40:3563 days ago1754476835IN
0x786a8790...4394F0E08
0 ETH0.000045520.43419175
Claim230814562025-08-06 10:33:2363 days ago1754476403IN
0x786a8790...4394F0E08
0 ETH0.000250092.36828521
Claim230814502025-08-06 10:32:1163 days ago1754476331IN
0x786a8790...4394F0E08
0 ETH0.000051130.48780209
Claim230808512025-08-06 8:32:1163 days ago1754469131IN
0x786a8790...4394F0E08
0 ETH0.000251662.40053682
Claim230807902025-08-06 8:19:5963 days ago1754468399IN
0x786a8790...4394F0E08
0 ETH0.000247772.34555854
Claim230799702025-08-06 5:34:5963 days ago1754458499IN
0x786a8790...4394F0E08
0 ETH0.0002432.30021876
Claim230799382025-08-06 5:28:3563 days ago1754458115IN
0x786a8790...4394F0E08
0 ETH0.000248492.37116718
Claim230798962025-08-06 5:20:1163 days ago1754457611IN
0x786a8790...4394F0E08
0 ETH0.00005240.49629686
Claim230798062025-08-06 5:02:1163 days ago1754456531IN
0x786a8790...4394F0E08
0 ETH0.000233782.22977158
Claim230797842025-08-06 4:57:4763 days ago1754456267IN
0x786a8790...4394F0E08
0 ETH0.000233592.22785346
Claim230797172025-08-06 4:44:2363 days ago1754455463IN
0x786a8790...4394F0E08
0 ETH0.000233732.2303213
Claim230795872025-08-06 4:17:4763 days ago1754453867IN
0x786a8790...4394F0E08
0 ETH0.000237352.24623272
Claim230795712025-08-06 4:14:3563 days ago1754453675IN
0x786a8790...4394F0E08
0 ETH0.000237882.25234448
Claim230795332025-08-06 4:06:4763 days ago1754453207IN
0x786a8790...4394F0E08
0 ETH0.000237012.24443281
Claim230794912025-08-06 3:58:2363 days ago1754452703IN
0x786a8790...4394F0E08
0 ETH0.000238152.25525831
Claim230793432025-08-06 3:28:4763 days ago1754450927IN
0x786a8790...4394F0E08
0 ETH0.000038110.36093711
Claim230793062025-08-06 3:21:2363 days ago1754450483IN
0x786a8790...4394F0E08
0 ETH0.000241472.28680917
Claim230792212025-08-06 3:04:1163 days ago1754449451IN
0x786a8790...4394F0E08
0 ETH0.000038760.36698342
Claim230791902025-08-06 2:57:5963 days ago1754449079IN
0x786a8790...4394F0E08
0 ETH0.000032250.3077403
Claim230790702025-08-06 2:33:4763 days ago1754447627IN
0x786a8790...4394F0E08
0 ETH0.000237332.24737166
Claim230790112025-08-06 2:21:5963 days ago1754446919IN
0x786a8790...4394F0E08
0 ETH0.00023862.27542959
Claim230788472025-08-06 1:48:4763 days ago1754444927IN
0x786a8790...4394F0E08
0 ETH0.000237882.25193438
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Method Block
From
To
Transfer224421452025-05-08 23:45:11152 days ago1746747911
0x786a8790...4394F0E08
0.0112152 ETH
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:
BUILDClaimSeason0

Compiler Version
v0.8.26+commit.8a97fa7a

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

import {IBUILDClaimSeason0} from "./interfaces/IBUILDClaimSeason0.sol";
import {ITypeAndVersion} from "chainlink/contracts/src/v0.8/shared/interfaces/ITypeAndVersion.sol";

import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol";
import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";

contract BUILDClaimSeason0 is IBUILDClaimSeason0, ITypeAndVersion, Pausable {
  using SafeERC20 for IERC20;

  /// @inheritdoc ITypeAndVersion
  string public constant typeAndVersion = "BUILDClaimSeason0 1.0.0";

  /// @notice The ID for the project admin role
  /// @dev Hash: 0x52eafc11f6f81f86878bffd31109a0d92f37506527754f00788853ff9f63b130
  bytes32 public constant PROJECT_ADMIN_ROLE = keccak256("PROJECT_ADMIN_ROLE");

  /// @notice The ID for the project approver role
  /// @dev Hash: 0x2994bd4882683bca108c813a4379f82de215a9fa2c66048fbe6e80d8137bba5f
  bytes32 public constant PROJECT_APPROVER_ROLE = keccak256("PROJECT_APPROVER_ROLE");

  /// @notice The amount of tokens claimed by each user
  mapping(address user => uint256 claimed) private s_claimedAmounts;

  /// @notice The accepted season 0 config for the project
  ProjectSeasonConfig private s_config;

  /// @notice The proposed season 0 config for the project
  ProjectSeasonConfig private s_proposedConfig;

  /// @notice The mapping from roles (PROJECT_ADMIN_ROLE, PROJECT_APPROVER_ROLE) to their respective
  /// owners
  mapping(bytes32 role => address holder) private s_roleHolder;

  /// @notice The mapping from roles (PROJECT_ADMIN_ROLE, PROJECT_APPROVER_ROLE) to their respective
  /// pending owners
  /// @dev pending owners can accept the role transfer and become the new owner
  mapping(bytes32 role => address pendingHolder) private s_pendingRoleHolder;

  /// @notice The project token
  IERC20 private immutable i_token;

  // ================================================================
  // |                       Initialization                         |
  // ================================================================

  /// @notice constructor
  /// @param token The project token
  /// @param approver The project approver
  /// @param config The initial config for the project's season 0
  constructor(address token, address approver, ProjectSeasonConfig memory config) {
    if (token == address(0) || approver == address(0)) {
      revert InvalidZeroAddress();
    }

    _validateConfig(config);

    i_token = IERC20(token);
    s_roleHolder[PROJECT_ADMIN_ROLE] = msg.sender;
    s_pendingRoleHolder[PROJECT_APPROVER_ROLE] = approver;
    s_proposedConfig = config;

    emit RoleTransferred(PROJECT_ADMIN_ROLE, address(0), msg.sender);
    emit RoleTransferProposed(PROJECT_APPROVER_ROLE, address(0), approver);
    emit ProjectSeasonConfigProposed(config);
  }

  /// @notice Project admin can propose new configs
  /// @dev Overwrites if there's already a proposed config
  /// @param config The proposed config
  function proposeConfig(
    ProjectSeasonConfig calldata config
  ) external onlyRole(PROJECT_ADMIN_ROLE) {
    _validateConfig(config);

    s_proposedConfig = config;

    emit ProjectSeasonConfigProposed(config);
  }

  /// @notice Project approvers can approve the proposed configs and put them into effect
  /// @dev Reverts if the proposed config is not the expected config (i.e. the hashes don't match)
  /// @dev Reverts if no token has been deposited yet
  /// @param configDigest The hash of the config to be accepted
  function acceptConfig(
    bytes32 configDigest
  ) external onlyRole(PROJECT_APPROVER_ROLE) {
    if (configDigest == bytes32(0)) {
      revert InvalidConfigDigest();
    }

    if (i_token.balanceOf(address(this)) == 0) {
      revert ZeroTokenDeposited();
    }

    ProjectSeasonConfig memory proposedConfig = s_proposedConfig;
    bytes32 proposedConfigDigest = keccak256(abi.encode(proposedConfig));
    if (proposedConfigDigest != configDigest) {
      revert ConfigDigestMismatch(proposedConfigDigest, configDigest);
    }

    // make sure we're not accepting empty values
    _validateConfig(proposedConfig);

    s_config = proposedConfig;
    delete s_proposedConfig;

    emit ProjectSeasonConfigUpdated(
      address(i_token),
      0, // season 0
      proposedConfig
    );
  }

  /// @inheritdoc IBUILDClaimSeason0
  function getToken() external view returns (IERC20) {
    return i_token;
  }

  /// @notice Returns the proposed config, including the withdrawal recipient, claim end date, and
  /// the merkle root.
  /// @return The proposed config
  function getProposedConfig() external view returns (ProjectSeasonConfig memory) {
    return s_proposedConfig;
  }

  /// @notice Returns the accepted config, including the withdrawal recipient, claim end date, and
  /// the merkle root.
  /// @return The accepted config
  function getConfig() external view returns (ProjectSeasonConfig memory) {
    return s_config;
  }

  /// @notice Util function for validating the proposed config
  /// @dev Reverts if one of the fields in the config is invalid
  /// @dev claimEndsAt < curr timestamp is the mechanism for ending the claim period
  /// @param config The proposed config
  function _validateConfig(
    ProjectSeasonConfig memory config
  ) private pure {
    if (config.merkleRoot == bytes32(0)) {
      revert InvalidMerkleRoot();
    }
    if (config.withdrawalRecipient == address(0)) {
      revert InvalidZeroAddress();
    }
  }

  // ================================================================
  // |                        Token Deposits                        |
  // ================================================================

  /// @inheritdoc IBUILDClaimSeason0
  /// @dev can be done when claim period active or not.
  function deposit(
    uint256 amount
  ) external onlyRole(PROJECT_ADMIN_ROLE) {
    if (amount == 0) {
      revert InvalidTokenAmount();
    }

    i_token.safeTransferFrom(msg.sender, address(this), amount);

    emit Deposited(address(i_token), msg.sender, amount);
  }

  // ================================================================
  // |                       Token Withdrawals                      |
  // ================================================================

  /// @inheritdoc IBUILDClaimSeason0
  function withdraw() external onlyRole(PROJECT_ADMIN_ROLE) {
    if (s_config.withdrawalRecipient == address(0)) {
      revert UnsetConfig();
    }
    if (isClaimActive()) {
      revert CannotWithdrawWhileClaimIsActive();
    }

    uint256 amount = i_token.balanceOf(address(this));
    if (amount == 0) {
      revert ZeroTokenBalance();
    }
    address recipient = s_config.withdrawalRecipient;

    i_token.safeTransfer(recipient, amount);

    emit Withdrawn(address(i_token), recipient, amount);
  }

  // ================================================================
  // |                         Token Claims                         |
  // ================================================================

  /// @inheritdoc IBUILDClaimSeason0
  function claim(address user, ClaimParams[] calldata params) external whenNotPaused {
    if (!isClaimActive()) {
      revert EnforcedClaimPeriodActive();
    }
    if (params.length > 1) {
      revert InvalidClaimParamsLength();
    }

    _claim(user, params[0]); // will only have one season: s0
  }

  /// @inheritdoc IBUILDClaimSeason0
  function getClaimedAmounts(
    UserSeasonId[] calldata usersAndSeasonIds
  ) external view returns (uint256[] memory) {
    uint256[] memory amounts = new uint256[](usersAndSeasonIds.length);
    for (uint256 i; i < usersAndSeasonIds.length; ++i) {
      amounts[i] = s_claimedAmounts[usersAndSeasonIds[i].user];
    }
    return amounts;
  }

  /// @inheritdoc IBUILDClaimSeason0
  function isClaimActive() public view returns (bool) {
    return block.timestamp < s_config.claimEndsAt;
  }

  /// @notice Util function that claims tokens for a user for multiple seasons
  /// @param user The user address
  /// @param params A claim params including the season ID (ignored as there's only season 0),
  /// proof, and the token amount
  function _claim(address user, ClaimParams calldata params) private {
    uint256 claimableAmount = params.maxTokenAmount;

    _validateMerkleProof(user, claimableAmount, params.salt, params.proof);

    if (s_claimedAmounts[user] > 0) {
      revert UserAlreadyClaimed();
    }
    if (claimableAmount == 0) {
      revert InvalidTokenAmount();
    }

    s_claimedAmounts[user] = claimableAmount;

    i_token.safeTransfer(user, claimableAmount);

    emit Claimed(user, /* season 0 */ 0, claimableAmount, claimableAmount);
  }

  /// @notice Validates if the user is eligible to claim the amount of tokens.
  /// A merkle tree's leaf consists of a user address and their token amount.
  /// @param user The user's address
  /// @param tokenAmount The user's total claimable token amount
  /// @param salt A randomly generated salt to prevent brute-force guessing of merkle proofs
  /// @param proof The merkle proof of the user's address and max token amount
  function _validateMerkleProof(
    address user,
    uint256 tokenAmount,
    uint256 salt,
    bytes32[] memory proof
  ) private view {
    // verify the merkle proof
    if (
      !MerkleProof.verify(
        proof,
        s_config.merkleRoot,
        keccak256(bytes.concat(keccak256(abi.encode(user, tokenAmount, salt))))
      )
    ) {
      revert InvalidMerkleProof();
    }
  }

  // ================================================================
  // |                       Pause / Unpause                        |
  // ================================================================
  /// @notice This function pauses the contract
  /// @dev Sets the pause flag to true
  function emergencyPause() external onlyRole(PROJECT_APPROVER_ROLE) {
    _pause();
  }

  /// @notice This function unpauses the contract
  /// @dev Sets the pause flag to false
  function emergencyUnpause() external onlyRole(PROJECT_APPROVER_ROLE) {
    _unpause();
  }

  // ================================================================
  // |                         Role Management                      |
  // ================================================================

  /// @notice Proposes a role transfer to a new holder
  /// @param role The role to transfer
  /// @param newHolder The new holder of the role
  function proposeRoleTransfer(bytes32 role, address newHolder) external onlyRole(role) {
    _validateRole(role);
    if (newHolder == address(0)) {
      revert InvalidZeroAddress();
    }

    address currentRoleHolder = s_roleHolder[role];
    address pendingRoleHolder = s_pendingRoleHolder[role];
    if (pendingRoleHolder == newHolder || currentRoleHolder == newHolder) {
      return;
    }

    s_pendingRoleHolder[role] = newHolder;

    emit RoleTransferProposed(role, currentRoleHolder, newHolder);
  }

  /// @notice Accepts a role transfer to a new holder
  /// @dev The role transfer must be proposed first by the current role holder
  /// @param role The role to accept
  function acceptRoleTransfer(
    bytes32 role
  ) external {
    _validateRole(role);
    address pendingRoleHolder = s_pendingRoleHolder[role];
    if (msg.sender != pendingRoleHolder) {
      revert UnauthorizedAccount(msg.sender, role);
    }

    address currentRoleHolder = s_roleHolder[role];

    // proposeRoleTransfer checks if pending and proposed role holder are the same, or if the
    // pending role holder is already the role holder
    s_roleHolder[role] = pendingRoleHolder;
    delete s_pendingRoleHolder[role];

    emit RoleTransferred(role, currentRoleHolder, pendingRoleHolder);
  }

  /// @notice Returns the current holder address of the given role
  /// @return The address that's holding the role
  function getRoleHolder(
    bytes32 role
  ) external view returns (address) {
    return s_roleHolder[role];
  }

  /// @notice Returns the pending holder address of the given role
  /// @return The address that has a pending transfer for the role
  function getPendingRoleHolder(
    bytes32 role
  ) external view returns (address) {
    return s_pendingRoleHolder[role];
  }

  /// @notice Util function for validating the role
  /// @param role The role to validate
  /// @dev Valid roles: PROJECT_ADMIN_ROLE, PROJECT_APPROVER_ROLE
  function _validateRole(
    bytes32 role
  ) private pure {
    if (role != PROJECT_ADMIN_ROLE && role != PROJECT_APPROVER_ROLE) {
      revert InvalidRole(role);
    }
  }

  /// @notice Modifier that checks if msg.sender is the role holder
  /// @param role The role that the msg.sender should have
  modifier onlyRole(
    bytes32 role
  ) {
    if (msg.sender != s_roleHolder[role]) {
      revert UnauthorizedAccount(msg.sender, role);
    }
    _;
  }
}

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

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

interface IBUILDClaimSeason0 {
  /// @notice this event is emitted when a token deposit is made
  /// @param token The token address
  /// @param sender The depositor address
  /// @param amount The deposit amount
  event Deposited(address indexed token, address indexed sender, uint256 amount);

  /// @notice this event is emitted when a token withdrawal is made
  /// @param token The token address
  /// @param recipient The withdrawal address
  /// @param amount The withdrawal amount
  event Withdrawn(address indexed token, address indexed recipient, uint256 amount);

  /// @notice this event is emitted when a claim is made
  /// @param user The user address
  /// @param seasonId The season id
  /// @param amount The claim amount
  /// @param userClaimedInSeason The cumulative amount claimed by the user in the season
  event Claimed(
    address indexed user, uint256 seasonId, uint256 amount, uint256 userClaimedInSeason
  );

  /// @notice this event is emitted when a project's season config is changed
  /// @param token The project's token address
  /// @param seasonId The season id (= 0)
  /// @param config the updated config
  event ProjectSeasonConfigUpdated(
    address indexed token, uint256 indexed seasonId, ProjectSeasonConfig config
  );

  /// @notice this event is emitted when a project's season config is proposed
  /// @param config the proposed config
  event ProjectSeasonConfigProposed(ProjectSeasonConfig config);

  event RoleTransferProposed(
    bytes32 indexed role, address currentRoleOwner, address proposedRoleOwner
  );

  event RoleTransferred(bytes32 indexed role, address previousRoleOwner, address newRoleOwner);

  /// @notice this error is thrown when an empty merkle root is provided
  error InvalidMerkleRoot();

  /// @notice this error is thrown when an invalid merkle proof is provided
  error InvalidMerkleProof();

  /// @notice this error is thrown when a zero token amount is provided for deposit or claim.
  error InvalidTokenAmount();

  /// @notice This error is thrown whenever a zero-address is supplied when
  /// a non-zero address is required
  error InvalidZeroAddress();

  /// @notice this error is thrown when a zero token balance in withdraw.
  error ZeroTokenBalance();

  /// @notice This error is thrown when empty bytes are given as an expected config digest.
  error InvalidConfigDigest();

  /// @notice this error is thrown when a zero address is provided as the user address or the user
  /// address doesn't match the msg.sender (when using claim), or the tx.origin (when using
  /// multicall3Claim)
  /// @param user The user address
  error InvalidUser(address user);

  /// @notice this error is thrown when an invalid role is provided
  error InvalidRole(bytes32 role);

  /// @notice this error is thrown when a withdrawal attempt is made while the project season
  /// configuration is not set.
  error UnsetConfig();

  /// @notice this error is thrown when an unauthorized address tries to call a function
  /// @param account The unauthorized address
  /// @param role The role that the address is missing
  error UnauthorizedAccount(address account, bytes32 role);

  /// @notice This error is thrown when the hashes of the proposed and expected config don't match.
  error ConfigDigestMismatch(bytes32 proposedConfigDigest, bytes32 expectedConfigDigest);

  /// @notice This error is thrown when the claim period is still active
  error EnforcedClaimPeriodActive();

  /// @notice This error is thrown when the claim period ended
  error CannotWithdrawWhileClaimIsActive();

  /// @notice This error is thrown when the user has already claimed their tokens.
  error UserAlreadyClaimed();

  /// @notice This error is thrown when the project approver tries to accept proposed configs but
  /// the project admin hasn't deposited any tokens
  error ZeroTokenDeposited();

  /// @notice This error is thrown when more than one claim params is given.
  error InvalidClaimParamsLength();

  /// @notice This struct defines the configs for the project's season 0
  struct ProjectSeasonConfig {
    bytes32 merkleRoot; // The root for the allowlist merkle tree
    uint96 claimEndsAt; // ──────────╮ The unix timestamp for the claim period end date in seconds
    address withdrawalRecipient; // ─╯ The initial recipient address for leftover token withdrawal
  }

  /// @notice This struct defines the parameters for claiming tokens
  struct ClaimParams {
    /// @notice The season id, must be 0.
    uint256 seasonId;
    /// @notice The merkle proof for the user's token amount for season 0
    bytes32[] proof;
    /// @notice A randomly generated salt to prevent brute-force guessing of merkle proofs
    uint256 salt;
    /// @notice The total token amount user can get for season 0
    uint256 maxTokenAmount;
  }

  /// @notice This struct defines the user and season id for the claimed amounts query
  struct UserSeasonId {
    /// @notice The user address
    address user;
    /// @notice The season id (ignored)
    uint256 seasonId;
  }

  /// @notice Project admins can deposit tokens for the program.
  /// @param amount The deposit amount
  function deposit(
    uint256 amount
  ) external;

  /// @notice Project admins can execute the scheduled token withdrawal
  function withdraw() external;

  /// @notice Calculates the unlocked tokens for a particular user and transfers the tokens to the
  /// user.
  /// The user must provide a valid merkle proof and total token amount they will get after unlock
  /// finishes.
  /// This function is to be used by EOAs when they claim from a single BUILDClaimSeason0 contract,
  /// as well
  /// as by multisig wallets when they claim from a single BUILDClaimSeason0 contract
  /// @param user The address of the user claiming the tokens. This should match the msg.sender.
  /// @param params Claim params including the season IDs, proofs, and max token amounts
  function claim(address user, ClaimParams[] calldata params) external;

  /// @notice Returns the project token
  /// @return the token address
  function getToken() external view returns (IERC20);

  /// @notice Returns the amounts of tokens that have been claimed by the users for season 0
  /// @param usersAndSeasonIds The user addresses and season ids (ignored)
  /// @return uint256[] The amounts of claimed tokens
  function getClaimedAmounts(
    UserSeasonId[] calldata usersAndSeasonIds
  ) external view returns (uint256[] memory);

  /// @notice returns whether the claim period is active or not.
  /// @return bool whether the claim period is active.
  function isClaimActive() external view returns (bool);
}

File 3 of 15 : ITypeAndVersion.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface ITypeAndVersion {
  function typeAndVersion() external pure returns (string memory);
}

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

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
import {Address} from "../../../utils/Address.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 {
    _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
  }

  /**
   * @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 {
    _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
  }

  /**
   * @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 {
    bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

    if (!_callOptionalReturnBool(token, approvalCall)) {
      _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
      _callOptionalReturn(token, approvalCall);
    }
  }

  /**
   * @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 rely 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 rely 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}.
   * Opposedly, 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 high-level call (i.e. a regular function call to a contract), 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 data The call data (encoded using abi.encode or one of its variants).
   *
   * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the
   * requirements.
   */
  function _callOptionalReturn(IERC20 token, bytes memory data) private {
    uint256 returnSize;
    uint256 returnValue;
    assembly ("memory-safe") {
      let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
      // bubble errors
      if iszero(success) {
        let ptr := mload(0x40)
        returndatacopy(ptr, 0, returndatasize())
        revert(ptr, returndatasize())
      }
      returnSize := returndatasize()
      returnValue := mload(0)
    }

    if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
      revert SafeERC20FailedOperation(address(token));
    }
  }

  /**
   * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), 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 data The call data (encoded using abi.encode or one of its variants).
   *
   * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool
   * instead.
   */
  function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
    bool success;
    uint256 returnSize;
    uint256 returnValue;
    assembly ("memory-safe") {
      success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
      returnSize := returndatasize()
      returnValue := mload(0)
    }
    return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
  }
}

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

pragma solidity ^0.8.20;

/**
 * @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.0.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 Initializes the contract in unpaused state.
   */
  constructor() {
    _paused = false;
  }

  /**
   * @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.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: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)

pragma solidity ^0.8.20;

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.1.0) (utils/Address.sol)

pragma solidity ^0.8.20;

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

/**
 * @dev Collection of functions related to the address type
 */
library Address {
  /**
   * @dev There's no code at `target` (it is not a contract).
   */
  error AddressEmptyCode(address target);

  /**
   * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
   * `recipient`, forwarding all available gas and reverting on errors.
   *
   * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
   * of certain opcodes, possibly making contracts go over the 2300 gas limit
   * imposed by `transfer`, making them unable to receive funds via
   * `transfer`. {sendValue} removes this limitation.
   *
   * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
   *
   * IMPORTANT: because control is transferred to `recipient`, care must be
   * taken to not create reentrancy vulnerabilities. Consider using
   * {ReentrancyGuard} or the
   * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions
   * pattern].
   */
  function sendValue(address payable recipient, uint256 amount) internal {
    if (address(this).balance < amount) {
      revert Errors.InsufficientBalance(address(this).balance, amount);
    }

    (bool success,) = recipient.call{value: amount}("");
    if (!success) {
      revert Errors.FailedCall();
    }
  }

  /**
   * @dev Performs a Solidity function call using a low level `call`. A
   * plain `call` is an unsafe replacement for a function call: use this
   * function instead.
   *
   * If `target` reverts with a revert reason or custom error, it is bubbled
   * up by this function (like regular Solidity function calls). However, if
   * the call reverted with no returned reason, this function reverts with a
   * {Errors.FailedCall} error.
   *
   * Returns the raw returned data. To convert to the expected return value,
   * use
   * https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
   *
   * Requirements:
   *
   * - `target` must be a contract.
   * - calling `target` with `data` must not revert.
   */
  function functionCall(address target, bytes memory data) internal returns (bytes memory) {
    return functionCallWithValue(target, data, 0);
  }

  /**
   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
   * but also transferring `value` wei to `target`.
   *
   * Requirements:
   *
   * - the calling contract must have an ETH balance of at least `value`.
   * - the called Solidity function must be `payable`.
   */
  function functionCallWithValue(
    address target,
    bytes memory data,
    uint256 value
  ) internal returns (bytes memory) {
    if (address(this).balance < value) {
      revert Errors.InsufficientBalance(address(this).balance, value);
    }
    (bool success, bytes memory returndata) = target.call{value: value}(data);
    return verifyCallResultFromTarget(target, success, returndata);
  }

  /**
   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
   * but performing a static call.
   */
  function functionStaticCall(
    address target,
    bytes memory data
  ) internal view returns (bytes memory) {
    (bool success, bytes memory returndata) = target.staticcall(data);
    return verifyCallResultFromTarget(target, success, returndata);
  }

  /**
   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
   * but performing a delegate call.
   */
  function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
    (bool success, bytes memory returndata) = target.delegatecall(data);
    return verifyCallResultFromTarget(target, success, returndata);
  }

  /**
   * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the
   * target
   * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in
   * case
   * of an unsuccessful call.
   */
  function verifyCallResultFromTarget(
    address target,
    bool success,
    bytes memory returndata
  ) internal view returns (bytes memory) {
    if (!success) {
      _revert(returndata);
    } else {
      // only check if target is a contract if the call was successful and the return data is empty
      // otherwise we already know that it was a contract
      if (returndata.length == 0 && target.code.length == 0) {
        revert AddressEmptyCode(target);
      }
      return returndata;
    }
  }

  /**
   * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by
   * bubbling the
   * revert reason or with a default {Errors.FailedCall} error.
   */
  function verifyCallResult(
    bool success,
    bytes memory returndata
  ) internal pure returns (bytes memory) {
    if (!success) {
      _revert(returndata);
    } else {
      return returndata;
    }
  }

  /**
   * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.
   */
  function _revert(
    bytes memory returndata
  ) private pure {
    // Look for revert reason and bubble it up if present
    if (returndata.length > 0) {
      // The easiest way to bubble the revert reason is using memory via assembly
      assembly ("memory-safe") {
        let returndata_size := mload(returndata)
        revert(add(32, returndata), returndata_size)
      }
    } else {
      revert Errors.FailedCall();
    }
  }
}

// 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.1.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) private pure returns (bytes32 value) {
    assembly ("memory-safe") {
      mstore(0x00, a)
      mstore(0x20, b)
      value := keccak256(0x00, 0x40)
    }
  }
}

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

pragma solidity ^0.8.20;

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

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

pragma solidity ^0.8.20;

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

File 14 of 15 : Errors.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of common custom errors used in multiple contracts
 *
 * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.
 * It is recommended to avoid relying on the error API for critical functionality.
 *
 * _Available since v5.1._
 */
library Errors {
  /**
   * @dev The ETH balance of the account is not enough to perform the operation.
   */
  error InsufficientBalance(uint256 balance, uint256 needed);

  /**
   * @dev A call to an address target failed. The target may have reverted.
   */
  error FailedCall();

  /**
   * @dev The deployment failed.
   */
  error FailedDeployment();

  /**
   * @dev A necessary precompile is missing.
   */
  error MissingPrecompile(address);
}

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

pragma solidity ^0.8.20;

/**
 * @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": [
    "@openzeppelin/=lib/vendor/openzeppelin-solidity/v5.1.0/",
    "@[email protected]/=lib/vendor/openzeppelin-solidity/v5.2.0/",
    "chainlink/=lib/vendor/chainlink/v2.18.0/",
    "forge-std/=lib/vendor/forge-std/v1.9.4/src/",
    "vendor/=lib/vendor/forge-std/v1.9.4/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"approver","type":"address"},{"components":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint96","name":"claimEndsAt","type":"uint96"},{"internalType":"address","name":"withdrawalRecipient","type":"address"}],"internalType":"struct IBUILDClaimSeason0.ProjectSeasonConfig","name":"config","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CannotWithdrawWhileClaimIsActive","type":"error"},{"inputs":[{"internalType":"bytes32","name":"proposedConfigDigest","type":"bytes32"},{"internalType":"bytes32","name":"expectedConfigDigest","type":"bytes32"}],"name":"ConfigDigestMismatch","type":"error"},{"inputs":[],"name":"EnforcedClaimPeriodActive","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"InvalidClaimParamsLength","type":"error"},{"inputs":[],"name":"InvalidConfigDigest","type":"error"},{"inputs":[],"name":"InvalidMerkleProof","type":"error"},{"inputs":[],"name":"InvalidMerkleRoot","type":"error"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"InvalidRole","type":"error"},{"inputs":[],"name":"InvalidTokenAmount","type":"error"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"InvalidUser","type":"error"},{"inputs":[],"name":"InvalidZeroAddress","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"UnauthorizedAccount","type":"error"},{"inputs":[],"name":"UnsetConfig","type":"error"},{"inputs":[],"name":"UserAlreadyClaimed","type":"error"},{"inputs":[],"name":"ZeroTokenBalance","type":"error"},{"inputs":[],"name":"ZeroTokenDeposited","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"seasonId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"userClaimedInSeason","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint96","name":"claimEndsAt","type":"uint96"},{"internalType":"address","name":"withdrawalRecipient","type":"address"}],"indexed":false,"internalType":"struct IBUILDClaimSeason0.ProjectSeasonConfig","name":"config","type":"tuple"}],"name":"ProjectSeasonConfigProposed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"uint256","name":"seasonId","type":"uint256"},{"components":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint96","name":"claimEndsAt","type":"uint96"},{"internalType":"address","name":"withdrawalRecipient","type":"address"}],"indexed":false,"internalType":"struct IBUILDClaimSeason0.ProjectSeasonConfig","name":"config","type":"tuple"}],"name":"ProjectSeasonConfigUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":false,"internalType":"address","name":"currentRoleOwner","type":"address"},{"indexed":false,"internalType":"address","name":"proposedRoleOwner","type":"address"}],"name":"RoleTransferProposed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":false,"internalType":"address","name":"previousRoleOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newRoleOwner","type":"address"}],"name":"RoleTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"PROJECT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROJECT_APPROVER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"configDigest","type":"bytes32"}],"name":"acceptConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"acceptRoleTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"components":[{"internalType":"uint256","name":"seasonId","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"uint256","name":"maxTokenAmount","type":"uint256"}],"internalType":"struct IBUILDClaimSeason0.ClaimParams[]","name":"params","type":"tuple[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyUnpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"seasonId","type":"uint256"}],"internalType":"struct IBUILDClaimSeason0.UserSeasonId[]","name":"usersAndSeasonIds","type":"tuple[]"}],"name":"getClaimedAmounts","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getConfig","outputs":[{"components":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint96","name":"claimEndsAt","type":"uint96"},{"internalType":"address","name":"withdrawalRecipient","type":"address"}],"internalType":"struct IBUILDClaimSeason0.ProjectSeasonConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getPendingRoleHolder","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getProposedConfig","outputs":[{"components":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint96","name":"claimEndsAt","type":"uint96"},{"internalType":"address","name":"withdrawalRecipient","type":"address"}],"internalType":"struct IBUILDClaimSeason0.ProjectSeasonConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleHolder","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isClaimActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint96","name":"claimEndsAt","type":"uint96"},{"internalType":"address","name":"withdrawalRecipient","type":"address"}],"internalType":"struct IBUILDClaimSeason0.ProjectSeasonConfig","name":"config","type":"tuple"}],"name":"proposeConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"newHolder","type":"address"}],"name":"proposeRoleTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"typeAndVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a060405234801561001057600080fd5b50604051611bf6380380611bf683398101604081905261002f916102c6565b6000805460ff191690556001600160a01b038316158061005657506001600160a01b038216155b156100745760405163f6b2911f60e01b815260040160405180910390fd5b61007d81610246565b6001600160a01b038381166080527fe7115abbcdc801ae3aba056edac6a7f7ff3db3a9880f81af4e78e83ec4fd2b7680546001600160a01b031990811633908117909255600080516020611bd68339815191526000908152600760209081527f8bfc1049f7abc9bbe0fd5f22c3c7673ab4ba83b0cd5d3478217d3a341c51b53580548887169416939093179092558451600455848201516040808701519095166c01000000000000000000000000026001600160601b03909116176005558351908152908101919091527f52eafc11f6f81f86878bffd31109a0d92f37506527754f00788853ff9f63b130917f274dd4127a55dcb6f6c12ed38fec5007d965d2afffa8b0bc75c3dc8f3f6b2224910160405180910390a260408051600081526001600160a01b0384166020820152600080516020611bd6833981519152917fb93d211fef339e62e4a986ce31abbb23516b8327d44a372c8c9c1cca3613fbf5910160405180910390a260408051825181526020808401516001600160601b031690820152828201516001600160a01b03168183015290517fab6fe5085216b189c91d03572d22edb96b6b37158d45072b985784615f841b509181900360600190a150505061036f565b805161026557604051639dd854d360e01b815260040160405180910390fd5b60408101516001600160a01b03166102905760405163f6b2911f60e01b815260040160405180910390fd5b50565b80516001600160a01b03811681146102aa57600080fd5b919050565b80516001600160601b03811681146102aa57600080fd5b600080600083850360a08112156102dc57600080fd5b6102e585610293565b93506102f360208601610293565b92506060603f198201121561030757600080fd5b50604051606081016001600160401b038111828210171561033857634e487b7160e01b600052604160045260246000fd5b6040908152850151815261034e606086016102af565b602082015261035f60808601610293565b6040820152809150509250925092565b6080516118146103c2600039600081816101ba01528181610554015281816106c1015281816107fd015281816108af015281816108e201528181610cd401528181610d06015261116801526118146000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c806379724e1d116100ad578063b32541bd11610071578063b32541bd1461033a578063b6b55f251461034d578063c3f909d414610360578063dbd25610146103bc578063f8e066cd146103cf57600080fd5b806379724e1d1461026d5780637fc27803146102805780639612b22714610293578063a362ca72146102a8578063ac7f0fdb1461031157600080fd5b806341c04d5e116100f457806341c04d5e146101fa5780634a4e3bd51461021d57806351858e27146102255780635c975abb1461022d578063663e43351461024457600080fd5b806312a983461461013157806315fcb7ad1461015a578063181f5a771461016f57806321df0da7146101b85780633ccfd60b146101f2575b600080fd5b61014461013f366004611371565b6103e2565b60405161015191906113e8565b60405180910390f35b61016d61016836600461142b565b6104b0565b005b6101ab6040518060400160405280601781526020017f4255494c44436c61696d536561736f6e3020312e302e3000000000000000000081525081565b6040516101519190611444565b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610151565b61016d61071d565b61020f60008051602061179f83398151915281565b604051908152602001610151565b61016d610948565b61016d6109bf565b60005460ff165b6040519015158152602001610151565b6101da61025236600461142b565b6000908152600660205260409020546001600160a01b031690565b61016d61027b36600461142b565b610a33565b6003546001600160601b03164210610234565b61020f6000805160206117bf83398151915281565b6103046040805160608101825260008082526020820181905291810191909152506040805160608101825260045481526005546001600160601b0381166020830152600160601b90046001600160a01b03169181019190915290565b6040516101519190611492565b6101da61031f36600461142b565b6000908152600760205260409020546001600160a01b031690565b61016d6103483660046114da565b610aff565b61016d61035b36600461142b565b610c3a565b6103046040805160608101825260008082526020820181905291810191909152506040805160608101825260025481526003546001600160601b0381166020830152600160601b90046001600160a01b03169181019190915290565b61016d6103ca36600461150a565b610d60565b61016d6103dd366004611594565b610de3565b606060008267ffffffffffffffff8111156103ff576103ff6115af565b604051908082528060200260200182016040528015610428578160200160208202803683370190505b50905060005b838110156104a8576001600086868481811061044c5761044c6115c5565b61046292602060409092020190810191506115db565b6001600160a01b03166001600160a01b0316815260200190815260200160002054828281518110610495576104956115c5565b602090810291909101015260010161042e565b509392505050565b6000805160206117bf833981519152600081905260066020527fa79a5229defc653423d31ec33d6b6234d276f1c23259b0e4710aa336d561f6e5546001600160a01b0316331461052157604051631573ca3760e01b8152336004820152602481018290526044015b60405180910390fd5b8161053f57604051630ed9e7a160e01b815260040160405180910390fd5b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156105a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c791906115f8565b6000036105e757604051637059a51160e01b815260040160405180910390fd5b6040805160608101825260045481526005546001600160601b038116602080840191909152600160601b9091046001600160a01b0316828401529151909160009161063491849101611492565b604051602081830303815290604052805190602001209050838114610676576040516324f7d61360e21b81526004810182905260248101859052604401610518565b61067f82610eb1565b815160025560208201516040808401516001600160601b03909216600160601b6001600160a01b039384160217600355600060048190556005819055905190917f000000000000000000000000000000000000000000000000000000000000000016907ff6773904962b99a4d55c21fc2d392901d111002911f2f6d71fe02f77019844b79061070f908690611492565b60405180910390a350505050565b60008051602061179f833981519152600081905260066020527fe7115abbcdc801ae3aba056edac6a7f7ff3db3a9880f81af4e78e83ec4fd2b76546001600160a01b0316331461078957604051631573ca3760e01b815233600482015260248101829052604401610518565b600354600160601b90046001600160a01b03166107b9576040516321a28e7560e21b815260040160405180910390fd5b6003546001600160601b03164210156107e557604051638a1200b160e01b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561084c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087091906115f8565b90508060000361089357604051639ab109cb60e01b815260040160405180910390fd5b6003546001600160a01b03600160601b9091048116906108d6907f0000000000000000000000000000000000000000000000000000000000000000168284610efb565b806001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb8460405161093b91815260200190565b60405180910390a3505050565b6000805160206117bf833981519152600081905260066020527fa79a5229defc653423d31ec33d6b6234d276f1c23259b0e4710aa336d561f6e5546001600160a01b031633146109b457604051631573ca3760e01b815233600482015260248101829052604401610518565b6109bc610f5a565b50565b6000805160206117bf833981519152600081905260066020527fa79a5229defc653423d31ec33d6b6234d276f1c23259b0e4710aa336d561f6e5546001600160a01b03163314610a2b57604051631573ca3760e01b815233600482015260248101829052604401610518565b6109bc610fac565b610a3c81610fe9565b6000818152600760205260409020546001600160a01b0316338114610a7d57604051631573ca3760e01b815233600482015260248101839052604401610518565b600082815260066020908152604080832080546001600160a01b03198082166001600160a01b038881169182179094556007865295849020805490911690558251911680825292810193909352909184917f274dd4127a55dcb6f6c12ed38fec5007d965d2afffa8b0bc75c3dc8f3f6b222491015b60405180910390a2505050565b60008281526006602052604090205482906001600160a01b03163314610b4157604051631573ca3760e01b815233600482015260248101829052604401610518565b610b4a83610fe9565b6001600160a01b038216610b715760405163f6b2911f60e01b815260040160405180910390fd5b6000838152600660209081526040808320546007909252909120546001600160a01b0391821691908116908416811480610bbc5750836001600160a01b0316826001600160a01b0316145b15610bc8575050505050565b60008581526007602090815260409182902080546001600160a01b0319166001600160a01b03888116918217909255835191861682529181019190915286917fb93d211fef339e62e4a986ce31abbb23516b8327d44a372c8c9c1cca3613fbf5910160405180910390a250505b505050565b60008051602061179f833981519152600081905260066020527fe7115abbcdc801ae3aba056edac6a7f7ff3db3a9880f81af4e78e83ec4fd2b76546001600160a01b03163314610ca657604051631573ca3760e01b815233600482015260248101829052604401610518565b81600003610cc757604051632160733960e01b815260040160405180910390fd5b610cfc6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333085611036565b60405182815233907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316907f8752a472e571a816aea92eec8dae9baf628e840f4929fbcc2d155e6233ff68a79060200160405180910390a35050565b610d68611075565b6003546001600160601b03164210610d93576040516379dce75160e01b815260040160405180910390fd5b6001811115610db5576040516382e6c4d360e01b815260040160405180910390fd5b610c358383836000818110610dcc57610dcc6115c5565b9050602002810190610dde9190611611565b61109b565b60008051602061179f833981519152600081905260066020527fe7115abbcdc801ae3aba056edac6a7f7ff3db3a9880f81af4e78e83ec4fd2b76546001600160a01b03163314610e4f57604051631573ca3760e01b815233600482015260248101829052604401610518565b610e66610e6136849003840184611646565b610eb1565b816004610e7382826116bf565b9050507fab6fe5085216b189c91d03572d22edb96b6b37158d45072b985784615f841b5082604051610ea59190611703565b60405180910390a15050565b8051610ed057604051639dd854d360e01b815260040160405180910390fd5b60408101516001600160a01b03166109bc5760405163f6b2911f60e01b815260040160405180910390fd5b6040516001600160a01b03838116602483015260448201839052610c3591859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050506111d9565b610f6261124a565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b610fb4611075565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610f8f3390565b60008051602061179f833981519152811415801561101557506000805160206117bf8339815191528114155b156109bc5760405163125a2bb760e01b815260048101829052602401610518565b6040516001600160a01b03848116602483015283811660448301526064820183905261106f9186918216906323b872dd90608401610f28565b50505050565b60005460ff16156110995760405163d93c066560e01b815260040160405180910390fd5b565b60608101356110ee838260408501356110b7602087018761174d565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061126d92505050565b6001600160a01b0383166000908152600160205260409020541561112557604051638246991960e01b815260040160405180910390fd5b8060000361114657604051632160733960e01b815260040160405180910390fd5b6001600160a01b03808416600090815260016020526040902082905561118f907f0000000000000000000000000000000000000000000000000000000000000000168483610efb565b6040805160008152602081018390529081018290526001600160a01b038416907f9cdcf2f7714cca3508c7f0110b04a90a80a3a8dd0e35de99689db74d28c5383e90606001610af2565b600080602060008451602086016000885af1806111fc576040513d6000823e3d81fd5b50506000513d91508115611214578060011415611221565b6001600160a01b0384163b155b1561106f57604051635274afe760e01b81526001600160a01b0385166004820152602401610518565b60005460ff1661109957604051638dfc202b60e01b815260040160405180910390fd5b600254604080516001600160a01b0387166020820152908101859052606081018490526112d191839160800160408051601f1981840301815282825280516020918201209083015201604051602081830303815290604052805190602001206112ee565b61106f5760405163582f497d60e11b815260040160405180910390fd5b6000826112fb8584611304565b14949350505050565b600081815b84518110156104a85761133582868381518110611328576113286115c5565b602002602001015161133f565b9150600101611309565b600081831061135b57600082815260208490526040902061136a565b60008381526020839052604090205b9392505050565b6000806020838503121561138457600080fd5b823567ffffffffffffffff81111561139b57600080fd5b8301601f810185136113ac57600080fd5b803567ffffffffffffffff8111156113c357600080fd5b8560208260061b84010111156113d857600080fd5b6020919091019590945092505050565b602080825282518282018190526000918401906040840190835b81811015611420578351835260209384019390920191600101611402565b509095945050505050565b60006020828403121561143d57600080fd5b5035919050565b602081526000825180602084015260005b818110156114725760208186018101516040868401015201611455565b506000604082850101526040601f19601f83011684010191505092915050565b815181526020808301516001600160601b0316908201526040918201516001600160a01b03169181019190915260600190565b6001600160a01b03811681146109bc57600080fd5b600080604083850312156114ed57600080fd5b8235915060208301356114ff816114c5565b809150509250929050565b60008060006040848603121561151f57600080fd5b833561152a816114c5565b9250602084013567ffffffffffffffff81111561154657600080fd5b8401601f8101861361155757600080fd5b803567ffffffffffffffff81111561156e57600080fd5b8660208260051b840101111561158357600080fd5b939660209190910195509293505050565b600060608284031280156115a757600080fd5b509092915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000602082840312156115ed57600080fd5b813561136a816114c5565b60006020828403121561160a57600080fd5b5051919050565b60008235607e1983360301811261162757600080fd5b9190910192915050565b6001600160601b03811681146109bc57600080fd5b6000606082840312801561165957600080fd5b506040516060810167ffffffffffffffff8111828210171561168b57634e487b7160e01b600052604160045260246000fd5b6040528235815260208301356116a081611631565b602082015260408301356116b3816114c5565b60408201529392505050565b8135815560208201356116d181611631565b60408301356116df816114c5565b6001600160601b03198160601b166001600160601b03831617600184015550505050565b8135815260608101602083013561171981611631565b6001600160601b031660208301526040830135611735816114c5565b6001600160a01b031660409290920191909152919050565b6000808335601e1984360301811261176457600080fd5b83018035915067ffffffffffffffff82111561177f57600080fd5b6020019150600581901b360382131561179757600080fd5b925092905056fe52eafc11f6f81f86878bffd31109a0d92f37506527754f00788853ff9f63b1302994bd4882683bca108c813a4379f82de215a9fa2c66048fbe6e80d8137bba5fa2646970667358221220e99e32f7ee7ea9868dddb6917e1130a046e9f529abbe3814c0944f248f05200964736f6c634300081a00332994bd4882683bca108c813a4379f82de215a9fa2c66048fbe6e80d8137bba5f000000000000000000000000e6bfd33f52d82ccb5b37e16d3dd81f9ffdabb195000000000000000000000000ee75744aea289834d6b3b3b009c2009f38e5c9c87f56602462d2f02bf5815385b3cf38761a0e33c4c4048a1ee0e104c0dbe73e8f0000000000000000000000000000000000000000000000000000000068936def00000000000000000000000096b364ca3f5989be2b0dbce6d6fa9478c97e4c54

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061012c5760003560e01c806379724e1d116100ad578063b32541bd11610071578063b32541bd1461033a578063b6b55f251461034d578063c3f909d414610360578063dbd25610146103bc578063f8e066cd146103cf57600080fd5b806379724e1d1461026d5780637fc27803146102805780639612b22714610293578063a362ca72146102a8578063ac7f0fdb1461031157600080fd5b806341c04d5e116100f457806341c04d5e146101fa5780634a4e3bd51461021d57806351858e27146102255780635c975abb1461022d578063663e43351461024457600080fd5b806312a983461461013157806315fcb7ad1461015a578063181f5a771461016f57806321df0da7146101b85780633ccfd60b146101f2575b600080fd5b61014461013f366004611371565b6103e2565b60405161015191906113e8565b60405180910390f35b61016d61016836600461142b565b6104b0565b005b6101ab6040518060400160405280601781526020017f4255494c44436c61696d536561736f6e3020312e302e3000000000000000000081525081565b6040516101519190611444565b7f000000000000000000000000e6bfd33f52d82ccb5b37e16d3dd81f9ffdabb1955b6040516001600160a01b039091168152602001610151565b61016d61071d565b61020f60008051602061179f83398151915281565b604051908152602001610151565b61016d610948565b61016d6109bf565b60005460ff165b6040519015158152602001610151565b6101da61025236600461142b565b6000908152600660205260409020546001600160a01b031690565b61016d61027b36600461142b565b610a33565b6003546001600160601b03164210610234565b61020f6000805160206117bf83398151915281565b6103046040805160608101825260008082526020820181905291810191909152506040805160608101825260045481526005546001600160601b0381166020830152600160601b90046001600160a01b03169181019190915290565b6040516101519190611492565b6101da61031f36600461142b565b6000908152600760205260409020546001600160a01b031690565b61016d6103483660046114da565b610aff565b61016d61035b36600461142b565b610c3a565b6103046040805160608101825260008082526020820181905291810191909152506040805160608101825260025481526003546001600160601b0381166020830152600160601b90046001600160a01b03169181019190915290565b61016d6103ca36600461150a565b610d60565b61016d6103dd366004611594565b610de3565b606060008267ffffffffffffffff8111156103ff576103ff6115af565b604051908082528060200260200182016040528015610428578160200160208202803683370190505b50905060005b838110156104a8576001600086868481811061044c5761044c6115c5565b61046292602060409092020190810191506115db565b6001600160a01b03166001600160a01b0316815260200190815260200160002054828281518110610495576104956115c5565b602090810291909101015260010161042e565b509392505050565b6000805160206117bf833981519152600081905260066020527fa79a5229defc653423d31ec33d6b6234d276f1c23259b0e4710aa336d561f6e5546001600160a01b0316331461052157604051631573ca3760e01b8152336004820152602481018290526044015b60405180910390fd5b8161053f57604051630ed9e7a160e01b815260040160405180910390fd5b6040516370a0823160e01b81523060048201527f000000000000000000000000e6bfd33f52d82ccb5b37e16d3dd81f9ffdabb1956001600160a01b0316906370a0823190602401602060405180830381865afa1580156105a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c791906115f8565b6000036105e757604051637059a51160e01b815260040160405180910390fd5b6040805160608101825260045481526005546001600160601b038116602080840191909152600160601b9091046001600160a01b0316828401529151909160009161063491849101611492565b604051602081830303815290604052805190602001209050838114610676576040516324f7d61360e21b81526004810182905260248101859052604401610518565b61067f82610eb1565b815160025560208201516040808401516001600160601b03909216600160601b6001600160a01b039384160217600355600060048190556005819055905190917f000000000000000000000000e6bfd33f52d82ccb5b37e16d3dd81f9ffdabb19516907ff6773904962b99a4d55c21fc2d392901d111002911f2f6d71fe02f77019844b79061070f908690611492565b60405180910390a350505050565b60008051602061179f833981519152600081905260066020527fe7115abbcdc801ae3aba056edac6a7f7ff3db3a9880f81af4e78e83ec4fd2b76546001600160a01b0316331461078957604051631573ca3760e01b815233600482015260248101829052604401610518565b600354600160601b90046001600160a01b03166107b9576040516321a28e7560e21b815260040160405180910390fd5b6003546001600160601b03164210156107e557604051638a1200b160e01b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000907f000000000000000000000000e6bfd33f52d82ccb5b37e16d3dd81f9ffdabb1956001600160a01b0316906370a0823190602401602060405180830381865afa15801561084c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087091906115f8565b90508060000361089357604051639ab109cb60e01b815260040160405180910390fd5b6003546001600160a01b03600160601b9091048116906108d6907f000000000000000000000000e6bfd33f52d82ccb5b37e16d3dd81f9ffdabb195168284610efb565b806001600160a01b03167f000000000000000000000000e6bfd33f52d82ccb5b37e16d3dd81f9ffdabb1956001600160a01b03167fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb8460405161093b91815260200190565b60405180910390a3505050565b6000805160206117bf833981519152600081905260066020527fa79a5229defc653423d31ec33d6b6234d276f1c23259b0e4710aa336d561f6e5546001600160a01b031633146109b457604051631573ca3760e01b815233600482015260248101829052604401610518565b6109bc610f5a565b50565b6000805160206117bf833981519152600081905260066020527fa79a5229defc653423d31ec33d6b6234d276f1c23259b0e4710aa336d561f6e5546001600160a01b03163314610a2b57604051631573ca3760e01b815233600482015260248101829052604401610518565b6109bc610fac565b610a3c81610fe9565b6000818152600760205260409020546001600160a01b0316338114610a7d57604051631573ca3760e01b815233600482015260248101839052604401610518565b600082815260066020908152604080832080546001600160a01b03198082166001600160a01b038881169182179094556007865295849020805490911690558251911680825292810193909352909184917f274dd4127a55dcb6f6c12ed38fec5007d965d2afffa8b0bc75c3dc8f3f6b222491015b60405180910390a2505050565b60008281526006602052604090205482906001600160a01b03163314610b4157604051631573ca3760e01b815233600482015260248101829052604401610518565b610b4a83610fe9565b6001600160a01b038216610b715760405163f6b2911f60e01b815260040160405180910390fd5b6000838152600660209081526040808320546007909252909120546001600160a01b0391821691908116908416811480610bbc5750836001600160a01b0316826001600160a01b0316145b15610bc8575050505050565b60008581526007602090815260409182902080546001600160a01b0319166001600160a01b03888116918217909255835191861682529181019190915286917fb93d211fef339e62e4a986ce31abbb23516b8327d44a372c8c9c1cca3613fbf5910160405180910390a250505b505050565b60008051602061179f833981519152600081905260066020527fe7115abbcdc801ae3aba056edac6a7f7ff3db3a9880f81af4e78e83ec4fd2b76546001600160a01b03163314610ca657604051631573ca3760e01b815233600482015260248101829052604401610518565b81600003610cc757604051632160733960e01b815260040160405180910390fd5b610cfc6001600160a01b037f000000000000000000000000e6bfd33f52d82ccb5b37e16d3dd81f9ffdabb19516333085611036565b60405182815233907f000000000000000000000000e6bfd33f52d82ccb5b37e16d3dd81f9ffdabb1956001600160a01b0316907f8752a472e571a816aea92eec8dae9baf628e840f4929fbcc2d155e6233ff68a79060200160405180910390a35050565b610d68611075565b6003546001600160601b03164210610d93576040516379dce75160e01b815260040160405180910390fd5b6001811115610db5576040516382e6c4d360e01b815260040160405180910390fd5b610c358383836000818110610dcc57610dcc6115c5565b9050602002810190610dde9190611611565b61109b565b60008051602061179f833981519152600081905260066020527fe7115abbcdc801ae3aba056edac6a7f7ff3db3a9880f81af4e78e83ec4fd2b76546001600160a01b03163314610e4f57604051631573ca3760e01b815233600482015260248101829052604401610518565b610e66610e6136849003840184611646565b610eb1565b816004610e7382826116bf565b9050507fab6fe5085216b189c91d03572d22edb96b6b37158d45072b985784615f841b5082604051610ea59190611703565b60405180910390a15050565b8051610ed057604051639dd854d360e01b815260040160405180910390fd5b60408101516001600160a01b03166109bc5760405163f6b2911f60e01b815260040160405180910390fd5b6040516001600160a01b03838116602483015260448201839052610c3591859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050506111d9565b610f6261124a565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b610fb4611075565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610f8f3390565b60008051602061179f833981519152811415801561101557506000805160206117bf8339815191528114155b156109bc5760405163125a2bb760e01b815260048101829052602401610518565b6040516001600160a01b03848116602483015283811660448301526064820183905261106f9186918216906323b872dd90608401610f28565b50505050565b60005460ff16156110995760405163d93c066560e01b815260040160405180910390fd5b565b60608101356110ee838260408501356110b7602087018761174d565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061126d92505050565b6001600160a01b0383166000908152600160205260409020541561112557604051638246991960e01b815260040160405180910390fd5b8060000361114657604051632160733960e01b815260040160405180910390fd5b6001600160a01b03808416600090815260016020526040902082905561118f907f000000000000000000000000e6bfd33f52d82ccb5b37e16d3dd81f9ffdabb195168483610efb565b6040805160008152602081018390529081018290526001600160a01b038416907f9cdcf2f7714cca3508c7f0110b04a90a80a3a8dd0e35de99689db74d28c5383e90606001610af2565b600080602060008451602086016000885af1806111fc576040513d6000823e3d81fd5b50506000513d91508115611214578060011415611221565b6001600160a01b0384163b155b1561106f57604051635274afe760e01b81526001600160a01b0385166004820152602401610518565b60005460ff1661109957604051638dfc202b60e01b815260040160405180910390fd5b600254604080516001600160a01b0387166020820152908101859052606081018490526112d191839160800160408051601f1981840301815282825280516020918201209083015201604051602081830303815290604052805190602001206112ee565b61106f5760405163582f497d60e11b815260040160405180910390fd5b6000826112fb8584611304565b14949350505050565b600081815b84518110156104a85761133582868381518110611328576113286115c5565b602002602001015161133f565b9150600101611309565b600081831061135b57600082815260208490526040902061136a565b60008381526020839052604090205b9392505050565b6000806020838503121561138457600080fd5b823567ffffffffffffffff81111561139b57600080fd5b8301601f810185136113ac57600080fd5b803567ffffffffffffffff8111156113c357600080fd5b8560208260061b84010111156113d857600080fd5b6020919091019590945092505050565b602080825282518282018190526000918401906040840190835b81811015611420578351835260209384019390920191600101611402565b509095945050505050565b60006020828403121561143d57600080fd5b5035919050565b602081526000825180602084015260005b818110156114725760208186018101516040868401015201611455565b506000604082850101526040601f19601f83011684010191505092915050565b815181526020808301516001600160601b0316908201526040918201516001600160a01b03169181019190915260600190565b6001600160a01b03811681146109bc57600080fd5b600080604083850312156114ed57600080fd5b8235915060208301356114ff816114c5565b809150509250929050565b60008060006040848603121561151f57600080fd5b833561152a816114c5565b9250602084013567ffffffffffffffff81111561154657600080fd5b8401601f8101861361155757600080fd5b803567ffffffffffffffff81111561156e57600080fd5b8660208260051b840101111561158357600080fd5b939660209190910195509293505050565b600060608284031280156115a757600080fd5b509092915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000602082840312156115ed57600080fd5b813561136a816114c5565b60006020828403121561160a57600080fd5b5051919050565b60008235607e1983360301811261162757600080fd5b9190910192915050565b6001600160601b03811681146109bc57600080fd5b6000606082840312801561165957600080fd5b506040516060810167ffffffffffffffff8111828210171561168b57634e487b7160e01b600052604160045260246000fd5b6040528235815260208301356116a081611631565b602082015260408301356116b3816114c5565b60408201529392505050565b8135815560208201356116d181611631565b60408301356116df816114c5565b6001600160601b03198160601b166001600160601b03831617600184015550505050565b8135815260608101602083013561171981611631565b6001600160601b031660208301526040830135611735816114c5565b6001600160a01b031660409290920191909152919050565b6000808335601e1984360301811261176457600080fd5b83018035915067ffffffffffffffff82111561177f57600080fd5b6020019150600581901b360382131561179757600080fd5b925092905056fe52eafc11f6f81f86878bffd31109a0d92f37506527754f00788853ff9f63b1302994bd4882683bca108c813a4379f82de215a9fa2c66048fbe6e80d8137bba5fa2646970667358221220e99e32f7ee7ea9868dddb6917e1130a046e9f529abbe3814c0944f248f05200964736f6c634300081a0033

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

000000000000000000000000e6bfd33f52d82ccb5b37e16d3dd81f9ffdabb195000000000000000000000000ee75744aea289834d6b3b3b009c2009f38e5c9c87f56602462d2f02bf5815385b3cf38761a0e33c4c4048a1ee0e104c0dbe73e8f0000000000000000000000000000000000000000000000000000000068936def00000000000000000000000096b364ca3f5989be2b0dbce6d6fa9478c97e4c54

-----Decoded View---------------
Arg [0] : token (address): 0xE6Bfd33F52d82Ccb5b37E16D3dD81f9FFDAbB195
Arg [1] : approver (address): 0xeE75744AeA289834d6b3b3B009c2009F38e5c9C8
Arg [2] : config (tuple):
Arg [1] : merkleRoot (bytes32): 0x7f56602462d2f02bf5815385b3cf38761a0e33c4c4048a1ee0e104c0dbe73e8f
Arg [2] : claimEndsAt (uint96): 1754492399
Arg [3] : withdrawalRecipient (address): 0x96B364ca3F5989be2b0DbCe6d6fA9478C97E4c54


-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000e6bfd33f52d82ccb5b37e16d3dd81f9ffdabb195
Arg [1] : 000000000000000000000000ee75744aea289834d6b3b3b009c2009f38e5c9c8
Arg [2] : 7f56602462d2f02bf5815385b3cf38761a0e33c4c4048a1ee0e104c0dbe73e8f
Arg [3] : 0000000000000000000000000000000000000000000000000000000068936def
Arg [4] : 00000000000000000000000096b364ca3f5989be2b0dbce6d6fa9478c97e4c54


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ 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.