ETH Price: $3,353.28 (+0.86%)

Contract

0x2f3715F710076Cfdb5AA872Bc8a4b965a07c3A08
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim Project To...201671862024-06-25 7:24:35151 days ago1719300275IN
0x2f3715F7...5a07c3A08
0 ETH0.000258563.25615122
Claim Project To...198289742024-05-09 0:40:59198 days ago1715215259IN
0x2f3715F7...5a07c3A08
0 ETH0.000289753.64896645
Claim Project To...197630322024-04-29 19:24:23207 days ago1714418663IN
0x2f3715F7...5a07c3A08
0 ETH0.000784799.88315329
Claim Project To...197487872024-04-27 19:35:11209 days ago1714246511IN
0x2f3715F7...5a07c3A08
0 ETH0.00042965.41020213
Claim Project To...197487852024-04-27 19:34:47209 days ago1714246487IN
0x2f3715F7...5a07c3A08
0 ETH0.00044245.57141503
Claim Project To...197487572024-04-27 19:29:11209 days ago1714246151IN
0x2f3715F7...5a07c3A08
0 ETH0.000428695.39871002
Claim Project To...197472272024-04-27 14:21:11209 days ago1714227671IN
0x2f3715F7...5a07c3A08
0 ETH0.000695718.76134144
Claim Project To...197367792024-04-26 3:12:59211 days ago1714101179IN
0x2f3715F7...5a07c3A08
0 ETH0.000455065.73075373
Claim Project To...197353852024-04-25 22:31:59211 days ago1714084319IN
0x2f3715F7...5a07c3A08
0 ETH0.000595237.49601667
Claim Project To...197346192024-04-25 19:58:23211 days ago1714075103IN
0x2f3715F7...5a07c3A08
0 ETH0.000666578.39441176
Claim Project To...197343432024-04-25 19:02:59211 days ago1714071779IN
0x2f3715F7...5a07c3A08
0 ETH0.0008341313.38743099
Claim Project To...197335652024-04-25 16:26:47211 days ago1714062407IN
0x2f3715F7...5a07c3A08
0 ETH0.0017207721.67026882
Claim Project To...197335292024-04-25 16:19:35211 days ago1714061975IN
0x2f3715F7...5a07c3A08
0 ETH0.0019550324.62040227
Claim Project To...197334982024-04-25 16:13:23211 days ago1714061603IN
0x2f3715F7...5a07c3A08
0 ETH0.0019971125.15033652
Claim Project To...197334822024-04-25 16:09:59211 days ago1714061399IN
0x2f3715F7...5a07c3A08
0 ETH0.0018959323.87612415
Claim Project To...197334432024-04-25 16:02:11211 days ago1714060931IN
0x2f3715F7...5a07c3A08
0 ETH0.0021256926.76965496
Subscribe197334302024-04-25 15:59:23211 days ago1714060763IN
0x2f3715F7...5a07c3A08
5 ETH0.0024538128.5168624
Subscribe197334182024-04-25 15:56:59211 days ago1714060619IN
0x2f3715F7...5a07c3A08
50 ETH0.002213325.71812838
Subscribe197334132024-04-25 15:55:59211 days ago1714060559IN
0x2f3715F7...5a07c3A08
0.28 ETH0.0023468527.27381236
Subscribe197334122024-04-25 15:55:47211 days ago1714060547IN
0x2f3715F7...5a07c3A08
6.3 ETH0.0023557627.37732984
Subscribe197333362024-04-25 15:40:35211 days ago1714059635IN
0x2f3715F7...5a07c3A08
0.501 ETH0.0030503935.44497282
Subscribe197330802024-04-25 14:49:11211 days ago1714056551IN
0x2f3715F7...5a07c3A08
0.3 ETH0.001447516.82439115
Subscribe197329842024-04-25 14:29:35211 days ago1714055375IN
0x2f3715F7...5a07c3A08
0.043 ETH0.0010306914.95143424
Subscribe197329462024-04-25 14:21:47211 days ago1714054907IN
0x2f3715F7...5a07c3A08
0.013 ETH0.0013684215.90301916
Subscribe197329392024-04-25 14:20:23211 days ago1714054823IN
0x2f3715F7...5a07c3A08
0.005 ETH0.0013343515.50921338
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
197543582024-04-28 14:17:23208 days ago1714313843
0x2f3715F7...5a07c3A08
79.18193725 ETH
197543582024-04-28 14:17:23208 days ago1714313843
0x2f3715F7...5a07c3A08
79.18193725 ETH
197364622024-04-26 2:09:11211 days ago1714097351
0x2f3715F7...5a07c3A08
1.20173591 ETH
197364622024-04-26 2:09:11211 days ago1714097351
0x2f3715F7...5a07c3A08
1.20173591 ETH
197334302024-04-25 15:59:23211 days ago1714060763
0x2f3715F7...5a07c3A08
5 ETH
197334182024-04-25 15:56:59211 days ago1714060619
0x2f3715F7...5a07c3A08
50 ETH
197334132024-04-25 15:55:59211 days ago1714060559
0x2f3715F7...5a07c3A08
0.28 ETH
197334122024-04-25 15:55:47211 days ago1714060547
0x2f3715F7...5a07c3A08
6.3 ETH
197333362024-04-25 15:40:35211 days ago1714059635
0x2f3715F7...5a07c3A08
0.501 ETH
197332492024-04-25 15:22:59211 days ago1714058579
0x2f3715F7...5a07c3A08
0.08841891 ETH
197332492024-04-25 15:22:59211 days ago1714058579
0x2f3715F7...5a07c3A08
0.08841891 ETH
197330802024-04-25 14:49:11211 days ago1714056551
0x2f3715F7...5a07c3A08
0.3 ETH
197329842024-04-25 14:29:35211 days ago1714055375
0x2f3715F7...5a07c3A08
0.043 ETH
197329462024-04-25 14:21:47211 days ago1714054907
0x2f3715F7...5a07c3A08
0.013 ETH
197329392024-04-25 14:20:23211 days ago1714054823
0x2f3715F7...5a07c3A08
0.005 ETH
197316852024-04-25 10:08:23212 days ago1714039703
0x2f3715F7...5a07c3A08
2.2 ETH
197303062024-04-25 5:30:47212 days ago1714023047
0x2f3715F7...5a07c3A08
0.64777394 ETH
197303062024-04-25 5:30:47212 days ago1714023047
0x2f3715F7...5a07c3A08
0.64777394 ETH
197302762024-04-25 5:24:47212 days ago1714022687
0x2f3715F7...5a07c3A08
0.42766469 ETH
197302762024-04-25 5:24:47212 days ago1714022687
0x2f3715F7...5a07c3A08
0.42766469 ETH
197293802024-04-25 2:23:47212 days ago1714011827
0x2f3715F7...5a07c3A08
0.12 ETH
197274482024-04-24 19:55:11212 days ago1713988511
0x2f3715F7...5a07c3A08
0.32 ETH
197266062024-04-24 17:05:47212 days ago1713978347
0x2f3715F7...5a07c3A08
0.40409974 ETH
197266062024-04-24 17:05:47212 days ago1713978347
0x2f3715F7...5a07c3A08
0.40409974 ETH
197265252024-04-24 16:49:11212 days ago1713977351
0x2f3715F7...5a07c3A08
0.5 ETH
View All Internal Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x9b804449...5966190cf
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
BatchAuctionUncapped

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 9999 runs

Other Settings:
paris EvmVersion
File 1 of 10 : BatchAuctionUncapped.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol";
import {IWETH9} from "./interfaces/IWETH9.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";

contract BatchAuctionUncapped is Ownable, ReentrancyGuard {
    using SafeCast for uint256;

    IERC20 public quoteToken;
    IERC20 public projectToken;

    bool public paused = false;
    bool public isQuoteWETH;
    bool public bazaarFeesClaimed = false;
    bool public auctionQuoteFeesClaimed = false;

    address public auctionOwner;

    uint256 public swapFeePercentage;
    uint256 public exitQuoteFeePercentage;

    uint256 public startTime;
    uint256 public endTime;

    uint256 public floorQuoteAmount;
    uint256 public totalProjectTokenAmount;

    // Subscriptions Accounting
    mapping(address => uint256) public subscriptions;

    uint256 public totalSubscriptions;
    uint256 public totalSwapFees;

    event Subscribed(address indexed subscriber, uint256 amount, uint256 fees);

    event ProjectTokenClaimed(
        address indexed user,
        IERC20 indexed token,
        uint256 amount
    );

    // isFees defines whether this is the auctionOwner claiming proceeds (isFees = false) or Bazaar team collecting auction fees (isFees = true)
    event AuctionQuoteTokensClaimed(
        address indexed user,
        IERC20 indexed token,
        uint256 amount,
        bool isFees
    );

    event AuctioneerProjectTokensRefunded(
        address indexed user,
        IERC20 indexed token,
        uint256 amountRefunded
    );

    event AuctionFeesSet(uint256 swapPercentage, uint256 exitQuotePercentage);

    modifier onlyAuctionOwner() {
        require(auctionOwner == msg.sender, "Only auction Owner");
        _;
    }

    constructor(
        address _auctionOwner,
        IERC20 _quoteToken,
        IERC20 _projectToken,
        uint256 _projectTokenAmount,
        uint256 _floorQuoteAmount,
        uint256 _startTime,
        uint256 _endTime,
        uint256 _swapFeePercentage,
        uint256 _exitQuoteFeePercentage,
        bool _isQuoteWETH
    ) Ownable(msg.sender) {
        require(
            _startTime < _endTime,
            "Auction start time must be less than end time"
        );
        require(
            _projectTokenAmount > 0,
            "Project token amount must be greater than 0"
        );

        auctionOwner = _auctionOwner;
        startTime = _startTime;
        endTime = _endTime;
        totalProjectTokenAmount = _projectTokenAmount;
        floorQuoteAmount = _floorQuoteAmount;
        quoteToken = _quoteToken;
        projectToken = _projectToken;
        swapFeePercentage = _swapFeePercentage;
        exitQuoteFeePercentage = _exitQuoteFeePercentage;
        isQuoteWETH = _isQuoteWETH;
    }

    // Admin Functions

    function setFees(
        uint256 _swapFeePercentage,
        uint256 _exitQuoteFeePercentage
    ) external onlyOwner nonReentrant {
        swapFeePercentage = _swapFeePercentage;
        exitQuoteFeePercentage = _exitQuoteFeePercentage;

        emit AuctionFeesSet(_swapFeePercentage, _exitQuoteFeePercentage);
    }

    function setPaused(bool _paused) external onlyAuctionOwner nonReentrant {
        paused = _paused;
    }

    // Auction Functions

    // subscriber parameter is only ever different from msg.sender for across swap handler,
    // or if a user wants to pay for someone else's subscription
    function subscribe(
        address subscriber,
        uint256 amount
    ) external payable nonReentrant {
        require(!paused, "Contract is paused");
        require(
            startTime < block.timestamp && block.timestamp < endTime,
            "Subscription period is not active"
        );

        // For ETH auctions, a user can choose between WETH and ETH by use of the msg.value field
        // if this field is the corect amount, we use msg.value and ETH. If not, we ensure a user
        // isn't sending ETH, and instead we'll withdraw WETH
        if (isQuoteWETH && msg.value == amount) {
            require(
                msg.value == amount,
                "Amount specified must be the same as msg.value for ETH"
            );
            // Convert ETH to WETH
            IWETH9(address(quoteToken)).deposit{value: msg.value}();
        } else {
            require(
                msg.value == 0,
                "No msg.value should be sent as user is paying with an ERC20"
            );
            SafeERC20.safeTransferFrom(
                quoteToken,
                msg.sender,
                address(this),
                amount
            );
        }

        uint256 fees = (amount * swapFeePercentage) / 1e18;
        uint256 subscriptionAmount = amount - fees;

        subscriptions[subscriber] += subscriptionAmount;
        totalSubscriptions += subscriptionAmount;
        totalSwapFees += fees;

        emit Subscribed(subscriber, amount, fees);
    }

    function claimProjectToken() external nonReentrant {
        require(block.timestamp > endTime, "Auction has not ended");
        uint256 subscriptionAmount = subscriptions[msg.sender];
        require(subscriptionAmount > 0, "No subscriptions");

        subscriptions[msg.sender] = 0;

        // If the floorQuoteAmount amount is not cleared, we use the floorQuoteAmount as our ratio
        // and not all of the tokens will be sold off
        uint256 divisor = totalSubscriptions < floorQuoteAmount ? floorQuoteAmount : totalSubscriptions;

        uint256 claimableAmount = (subscriptionAmount *
            totalProjectTokenAmount) / divisor;

        SafeERC20.safeTransfer(projectToken, msg.sender, claimableAmount);

        emit ProjectTokenClaimed(msg.sender, projectToken, claimableAmount);
    }

    // Auctioneer claims quoteTokens, and if the auction floor price is not cleared, they
    // claim their extra projectTokens as well
    function claimAuctioneerTokens() external onlyAuctionOwner nonReentrant {
        require(block.timestamp > endTime, "Auction has not ended");
        require(!auctionQuoteFeesClaimed, "Auction quote fees already claimed");

        uint256 auctionProceeds = totalSubscriptions -
            ((totalSubscriptions * exitQuoteFeePercentage) / 1e18);
        
        bool projectTokensToRefund = totalSubscriptions < floorQuoteAmount;

        if (isQuoteWETH) {
            IWETH9(address(quoteToken)).withdraw(auctionProceeds);

            // Transfer auction proceeds in ETH to the auction owner
            (bool success, ) = msg.sender.call{value: auctionProceeds}("");
            require(success, "Failed to send Ether to auction owner");
        } else {
            SafeERC20.safeTransfer(quoteToken, msg.sender, auctionProceeds);
        }

        if (projectTokensToRefund) {
            uint256 amountSold = totalProjectTokenAmount * totalSubscriptions / floorQuoteAmount;
            SafeERC20.safeTransfer(projectToken, msg.sender, totalProjectTokenAmount - amountSold);

            emit AuctioneerProjectTokensRefunded(
                msg.sender,
                projectToken,
                totalProjectTokenAmount - amountSold
            );
        }

        auctionQuoteFeesClaimed = true;

        emit AuctionQuoteTokensClaimed(
            msg.sender,
            quoteToken,
            auctionProceeds,
            false
        );
    }

    // Owner is the Factory contract which has the ability to claim the fees
    function claimBazaarFees(
        address feeRecipient
    ) external onlyOwner nonReentrant {
        require(block.timestamp > endTime, "Auction has not ended");
        require(!bazaarFeesClaimed, "Bazaar fees already claimed");

        // We don't care about under/overflow tag as it is not possible in this case
        uint256 totalFees = totalSwapFees +
            ((totalSubscriptions * exitQuoteFeePercentage) / 1e18);

        if (isQuoteWETH) {
            IWETH9(address(quoteToken)).withdraw(totalFees);

            // Transfer auction proceeds in ETH to the fee recipient
            (bool success, ) = feeRecipient.call{value: totalFees}("");
            require(success, "Failed to send Ether to auction owner");
        } else {
            SafeERC20.safeTransfer(quoteToken, feeRecipient, totalFees);
        }

        bazaarFeesClaimed = true;

        emit AuctionQuoteTokensClaimed(
            feeRecipient,
            quoteToken,
            totalFees,
            true
        );
    }

    fallback() external payable {}
}

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

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

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

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

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

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

File 3 of 10 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
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);
}

File 4 of 10 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 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 {
    using Address for address;

    /**
     * @dev An operation with an ERC20 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.
     */
    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.
     */
    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.
     */
    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 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).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            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 silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
    }
}

File 5 of 10 : SafeCast.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SafeCast.sol)
// This file was procedurally generated from scripts/generate/templates/SafeCast.js.

pragma solidity ^0.8.20;

/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such an operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeCast {
    /**
     * @dev Value doesn't fit in an uint of `bits` size.
     */
    error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);

    /**
     * @dev An int value doesn't fit in an uint of `bits` size.
     */
    error SafeCastOverflowedIntToUint(int256 value);

    /**
     * @dev Value doesn't fit in an int of `bits` size.
     */
    error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);

    /**
     * @dev An uint value doesn't fit in an int of `bits` size.
     */
    error SafeCastOverflowedUintToInt(uint256 value);

    /**
     * @dev Returns the downcasted uint248 from uint256, reverting on
     * overflow (when the input is greater than largest uint248).
     *
     * Counterpart to Solidity's `uint248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     */
    function toUint248(uint256 value) internal pure returns (uint248) {
        if (value > type(uint248).max) {
            revert SafeCastOverflowedUintDowncast(248, value);
        }
        return uint248(value);
    }

    /**
     * @dev Returns the downcasted uint240 from uint256, reverting on
     * overflow (when the input is greater than largest uint240).
     *
     * Counterpart to Solidity's `uint240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     */
    function toUint240(uint256 value) internal pure returns (uint240) {
        if (value > type(uint240).max) {
            revert SafeCastOverflowedUintDowncast(240, value);
        }
        return uint240(value);
    }

    /**
     * @dev Returns the downcasted uint232 from uint256, reverting on
     * overflow (when the input is greater than largest uint232).
     *
     * Counterpart to Solidity's `uint232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     */
    function toUint232(uint256 value) internal pure returns (uint232) {
        if (value > type(uint232).max) {
            revert SafeCastOverflowedUintDowncast(232, value);
        }
        return uint232(value);
    }

    /**
     * @dev Returns the downcasted uint224 from uint256, reverting on
     * overflow (when the input is greater than largest uint224).
     *
     * Counterpart to Solidity's `uint224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     */
    function toUint224(uint256 value) internal pure returns (uint224) {
        if (value > type(uint224).max) {
            revert SafeCastOverflowedUintDowncast(224, value);
        }
        return uint224(value);
    }

    /**
     * @dev Returns the downcasted uint216 from uint256, reverting on
     * overflow (when the input is greater than largest uint216).
     *
     * Counterpart to Solidity's `uint216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     */
    function toUint216(uint256 value) internal pure returns (uint216) {
        if (value > type(uint216).max) {
            revert SafeCastOverflowedUintDowncast(216, value);
        }
        return uint216(value);
    }

    /**
     * @dev Returns the downcasted uint208 from uint256, reverting on
     * overflow (when the input is greater than largest uint208).
     *
     * Counterpart to Solidity's `uint208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     */
    function toUint208(uint256 value) internal pure returns (uint208) {
        if (value > type(uint208).max) {
            revert SafeCastOverflowedUintDowncast(208, value);
        }
        return uint208(value);
    }

    /**
     * @dev Returns the downcasted uint200 from uint256, reverting on
     * overflow (when the input is greater than largest uint200).
     *
     * Counterpart to Solidity's `uint200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     */
    function toUint200(uint256 value) internal pure returns (uint200) {
        if (value > type(uint200).max) {
            revert SafeCastOverflowedUintDowncast(200, value);
        }
        return uint200(value);
    }

    /**
     * @dev Returns the downcasted uint192 from uint256, reverting on
     * overflow (when the input is greater than largest uint192).
     *
     * Counterpart to Solidity's `uint192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     */
    function toUint192(uint256 value) internal pure returns (uint192) {
        if (value > type(uint192).max) {
            revert SafeCastOverflowedUintDowncast(192, value);
        }
        return uint192(value);
    }

    /**
     * @dev Returns the downcasted uint184 from uint256, reverting on
     * overflow (when the input is greater than largest uint184).
     *
     * Counterpart to Solidity's `uint184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     */
    function toUint184(uint256 value) internal pure returns (uint184) {
        if (value > type(uint184).max) {
            revert SafeCastOverflowedUintDowncast(184, value);
        }
        return uint184(value);
    }

    /**
     * @dev Returns the downcasted uint176 from uint256, reverting on
     * overflow (when the input is greater than largest uint176).
     *
     * Counterpart to Solidity's `uint176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     */
    function toUint176(uint256 value) internal pure returns (uint176) {
        if (value > type(uint176).max) {
            revert SafeCastOverflowedUintDowncast(176, value);
        }
        return uint176(value);
    }

    /**
     * @dev Returns the downcasted uint168 from uint256, reverting on
     * overflow (when the input is greater than largest uint168).
     *
     * Counterpart to Solidity's `uint168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     */
    function toUint168(uint256 value) internal pure returns (uint168) {
        if (value > type(uint168).max) {
            revert SafeCastOverflowedUintDowncast(168, value);
        }
        return uint168(value);
    }

    /**
     * @dev Returns the downcasted uint160 from uint256, reverting on
     * overflow (when the input is greater than largest uint160).
     *
     * Counterpart to Solidity's `uint160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     */
    function toUint160(uint256 value) internal pure returns (uint160) {
        if (value > type(uint160).max) {
            revert SafeCastOverflowedUintDowncast(160, value);
        }
        return uint160(value);
    }

    /**
     * @dev Returns the downcasted uint152 from uint256, reverting on
     * overflow (when the input is greater than largest uint152).
     *
     * Counterpart to Solidity's `uint152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     */
    function toUint152(uint256 value) internal pure returns (uint152) {
        if (value > type(uint152).max) {
            revert SafeCastOverflowedUintDowncast(152, value);
        }
        return uint152(value);
    }

    /**
     * @dev Returns the downcasted uint144 from uint256, reverting on
     * overflow (when the input is greater than largest uint144).
     *
     * Counterpart to Solidity's `uint144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     */
    function toUint144(uint256 value) internal pure returns (uint144) {
        if (value > type(uint144).max) {
            revert SafeCastOverflowedUintDowncast(144, value);
        }
        return uint144(value);
    }

    /**
     * @dev Returns the downcasted uint136 from uint256, reverting on
     * overflow (when the input is greater than largest uint136).
     *
     * Counterpart to Solidity's `uint136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     */
    function toUint136(uint256 value) internal pure returns (uint136) {
        if (value > type(uint136).max) {
            revert SafeCastOverflowedUintDowncast(136, value);
        }
        return uint136(value);
    }

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        if (value > type(uint128).max) {
            revert SafeCastOverflowedUintDowncast(128, value);
        }
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint120 from uint256, reverting on
     * overflow (when the input is greater than largest uint120).
     *
     * Counterpart to Solidity's `uint120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     */
    function toUint120(uint256 value) internal pure returns (uint120) {
        if (value > type(uint120).max) {
            revert SafeCastOverflowedUintDowncast(120, value);
        }
        return uint120(value);
    }

    /**
     * @dev Returns the downcasted uint112 from uint256, reverting on
     * overflow (when the input is greater than largest uint112).
     *
     * Counterpart to Solidity's `uint112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     */
    function toUint112(uint256 value) internal pure returns (uint112) {
        if (value > type(uint112).max) {
            revert SafeCastOverflowedUintDowncast(112, value);
        }
        return uint112(value);
    }

    /**
     * @dev Returns the downcasted uint104 from uint256, reverting on
     * overflow (when the input is greater than largest uint104).
     *
     * Counterpart to Solidity's `uint104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     */
    function toUint104(uint256 value) internal pure returns (uint104) {
        if (value > type(uint104).max) {
            revert SafeCastOverflowedUintDowncast(104, value);
        }
        return uint104(value);
    }

    /**
     * @dev Returns the downcasted uint96 from uint256, reverting on
     * overflow (when the input is greater than largest uint96).
     *
     * Counterpart to Solidity's `uint96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     */
    function toUint96(uint256 value) internal pure returns (uint96) {
        if (value > type(uint96).max) {
            revert SafeCastOverflowedUintDowncast(96, value);
        }
        return uint96(value);
    }

    /**
     * @dev Returns the downcasted uint88 from uint256, reverting on
     * overflow (when the input is greater than largest uint88).
     *
     * Counterpart to Solidity's `uint88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     */
    function toUint88(uint256 value) internal pure returns (uint88) {
        if (value > type(uint88).max) {
            revert SafeCastOverflowedUintDowncast(88, value);
        }
        return uint88(value);
    }

    /**
     * @dev Returns the downcasted uint80 from uint256, reverting on
     * overflow (when the input is greater than largest uint80).
     *
     * Counterpart to Solidity's `uint80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     */
    function toUint80(uint256 value) internal pure returns (uint80) {
        if (value > type(uint80).max) {
            revert SafeCastOverflowedUintDowncast(80, value);
        }
        return uint80(value);
    }

    /**
     * @dev Returns the downcasted uint72 from uint256, reverting on
     * overflow (when the input is greater than largest uint72).
     *
     * Counterpart to Solidity's `uint72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     */
    function toUint72(uint256 value) internal pure returns (uint72) {
        if (value > type(uint72).max) {
            revert SafeCastOverflowedUintDowncast(72, value);
        }
        return uint72(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        if (value > type(uint64).max) {
            revert SafeCastOverflowedUintDowncast(64, value);
        }
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint56 from uint256, reverting on
     * overflow (when the input is greater than largest uint56).
     *
     * Counterpart to Solidity's `uint56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     */
    function toUint56(uint256 value) internal pure returns (uint56) {
        if (value > type(uint56).max) {
            revert SafeCastOverflowedUintDowncast(56, value);
        }
        return uint56(value);
    }

    /**
     * @dev Returns the downcasted uint48 from uint256, reverting on
     * overflow (when the input is greater than largest uint48).
     *
     * Counterpart to Solidity's `uint48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     */
    function toUint48(uint256 value) internal pure returns (uint48) {
        if (value > type(uint48).max) {
            revert SafeCastOverflowedUintDowncast(48, value);
        }
        return uint48(value);
    }

    /**
     * @dev Returns the downcasted uint40 from uint256, reverting on
     * overflow (when the input is greater than largest uint40).
     *
     * Counterpart to Solidity's `uint40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     */
    function toUint40(uint256 value) internal pure returns (uint40) {
        if (value > type(uint40).max) {
            revert SafeCastOverflowedUintDowncast(40, value);
        }
        return uint40(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        if (value > type(uint32).max) {
            revert SafeCastOverflowedUintDowncast(32, value);
        }
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint24 from uint256, reverting on
     * overflow (when the input is greater than largest uint24).
     *
     * Counterpart to Solidity's `uint24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     */
    function toUint24(uint256 value) internal pure returns (uint24) {
        if (value > type(uint24).max) {
            revert SafeCastOverflowedUintDowncast(24, value);
        }
        return uint24(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        if (value > type(uint16).max) {
            revert SafeCastOverflowedUintDowncast(16, value);
        }
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        if (value > type(uint8).max) {
            revert SafeCastOverflowedUintDowncast(8, value);
        }
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        if (value < 0) {
            revert SafeCastOverflowedIntToUint(value);
        }
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int248 from int256, reverting on
     * overflow (when the input is less than smallest int248 or
     * greater than largest int248).
     *
     * Counterpart to Solidity's `int248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     */
    function toInt248(int256 value) internal pure returns (int248 downcasted) {
        downcasted = int248(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(248, value);
        }
    }

    /**
     * @dev Returns the downcasted int240 from int256, reverting on
     * overflow (when the input is less than smallest int240 or
     * greater than largest int240).
     *
     * Counterpart to Solidity's `int240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     */
    function toInt240(int256 value) internal pure returns (int240 downcasted) {
        downcasted = int240(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(240, value);
        }
    }

    /**
     * @dev Returns the downcasted int232 from int256, reverting on
     * overflow (when the input is less than smallest int232 or
     * greater than largest int232).
     *
     * Counterpart to Solidity's `int232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     */
    function toInt232(int256 value) internal pure returns (int232 downcasted) {
        downcasted = int232(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(232, value);
        }
    }

    /**
     * @dev Returns the downcasted int224 from int256, reverting on
     * overflow (when the input is less than smallest int224 or
     * greater than largest int224).
     *
     * Counterpart to Solidity's `int224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     */
    function toInt224(int256 value) internal pure returns (int224 downcasted) {
        downcasted = int224(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(224, value);
        }
    }

    /**
     * @dev Returns the downcasted int216 from int256, reverting on
     * overflow (when the input is less than smallest int216 or
     * greater than largest int216).
     *
     * Counterpart to Solidity's `int216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     */
    function toInt216(int256 value) internal pure returns (int216 downcasted) {
        downcasted = int216(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(216, value);
        }
    }

    /**
     * @dev Returns the downcasted int208 from int256, reverting on
     * overflow (when the input is less than smallest int208 or
     * greater than largest int208).
     *
     * Counterpart to Solidity's `int208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     */
    function toInt208(int256 value) internal pure returns (int208 downcasted) {
        downcasted = int208(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(208, value);
        }
    }

    /**
     * @dev Returns the downcasted int200 from int256, reverting on
     * overflow (when the input is less than smallest int200 or
     * greater than largest int200).
     *
     * Counterpart to Solidity's `int200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     */
    function toInt200(int256 value) internal pure returns (int200 downcasted) {
        downcasted = int200(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(200, value);
        }
    }

    /**
     * @dev Returns the downcasted int192 from int256, reverting on
     * overflow (when the input is less than smallest int192 or
     * greater than largest int192).
     *
     * Counterpart to Solidity's `int192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     */
    function toInt192(int256 value) internal pure returns (int192 downcasted) {
        downcasted = int192(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(192, value);
        }
    }

    /**
     * @dev Returns the downcasted int184 from int256, reverting on
     * overflow (when the input is less than smallest int184 or
     * greater than largest int184).
     *
     * Counterpart to Solidity's `int184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     */
    function toInt184(int256 value) internal pure returns (int184 downcasted) {
        downcasted = int184(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(184, value);
        }
    }

    /**
     * @dev Returns the downcasted int176 from int256, reverting on
     * overflow (when the input is less than smallest int176 or
     * greater than largest int176).
     *
     * Counterpart to Solidity's `int176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     */
    function toInt176(int256 value) internal pure returns (int176 downcasted) {
        downcasted = int176(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(176, value);
        }
    }

    /**
     * @dev Returns the downcasted int168 from int256, reverting on
     * overflow (when the input is less than smallest int168 or
     * greater than largest int168).
     *
     * Counterpart to Solidity's `int168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     */
    function toInt168(int256 value) internal pure returns (int168 downcasted) {
        downcasted = int168(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(168, value);
        }
    }

    /**
     * @dev Returns the downcasted int160 from int256, reverting on
     * overflow (when the input is less than smallest int160 or
     * greater than largest int160).
     *
     * Counterpart to Solidity's `int160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     */
    function toInt160(int256 value) internal pure returns (int160 downcasted) {
        downcasted = int160(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(160, value);
        }
    }

    /**
     * @dev Returns the downcasted int152 from int256, reverting on
     * overflow (when the input is less than smallest int152 or
     * greater than largest int152).
     *
     * Counterpart to Solidity's `int152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     */
    function toInt152(int256 value) internal pure returns (int152 downcasted) {
        downcasted = int152(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(152, value);
        }
    }

    /**
     * @dev Returns the downcasted int144 from int256, reverting on
     * overflow (when the input is less than smallest int144 or
     * greater than largest int144).
     *
     * Counterpart to Solidity's `int144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     */
    function toInt144(int256 value) internal pure returns (int144 downcasted) {
        downcasted = int144(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(144, value);
        }
    }

    /**
     * @dev Returns the downcasted int136 from int256, reverting on
     * overflow (when the input is less than smallest int136 or
     * greater than largest int136).
     *
     * Counterpart to Solidity's `int136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     */
    function toInt136(int256 value) internal pure returns (int136 downcasted) {
        downcasted = int136(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(136, value);
        }
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toInt128(int256 value) internal pure returns (int128 downcasted) {
        downcasted = int128(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(128, value);
        }
    }

    /**
     * @dev Returns the downcasted int120 from int256, reverting on
     * overflow (when the input is less than smallest int120 or
     * greater than largest int120).
     *
     * Counterpart to Solidity's `int120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     */
    function toInt120(int256 value) internal pure returns (int120 downcasted) {
        downcasted = int120(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(120, value);
        }
    }

    /**
     * @dev Returns the downcasted int112 from int256, reverting on
     * overflow (when the input is less than smallest int112 or
     * greater than largest int112).
     *
     * Counterpart to Solidity's `int112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     */
    function toInt112(int256 value) internal pure returns (int112 downcasted) {
        downcasted = int112(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(112, value);
        }
    }

    /**
     * @dev Returns the downcasted int104 from int256, reverting on
     * overflow (when the input is less than smallest int104 or
     * greater than largest int104).
     *
     * Counterpart to Solidity's `int104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     */
    function toInt104(int256 value) internal pure returns (int104 downcasted) {
        downcasted = int104(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(104, value);
        }
    }

    /**
     * @dev Returns the downcasted int96 from int256, reverting on
     * overflow (when the input is less than smallest int96 or
     * greater than largest int96).
     *
     * Counterpart to Solidity's `int96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     */
    function toInt96(int256 value) internal pure returns (int96 downcasted) {
        downcasted = int96(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(96, value);
        }
    }

    /**
     * @dev Returns the downcasted int88 from int256, reverting on
     * overflow (when the input is less than smallest int88 or
     * greater than largest int88).
     *
     * Counterpart to Solidity's `int88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     */
    function toInt88(int256 value) internal pure returns (int88 downcasted) {
        downcasted = int88(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(88, value);
        }
    }

    /**
     * @dev Returns the downcasted int80 from int256, reverting on
     * overflow (when the input is less than smallest int80 or
     * greater than largest int80).
     *
     * Counterpart to Solidity's `int80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     */
    function toInt80(int256 value) internal pure returns (int80 downcasted) {
        downcasted = int80(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(80, value);
        }
    }

    /**
     * @dev Returns the downcasted int72 from int256, reverting on
     * overflow (when the input is less than smallest int72 or
     * greater than largest int72).
     *
     * Counterpart to Solidity's `int72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     */
    function toInt72(int256 value) internal pure returns (int72 downcasted) {
        downcasted = int72(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(72, value);
        }
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toInt64(int256 value) internal pure returns (int64 downcasted) {
        downcasted = int64(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(64, value);
        }
    }

    /**
     * @dev Returns the downcasted int56 from int256, reverting on
     * overflow (when the input is less than smallest int56 or
     * greater than largest int56).
     *
     * Counterpart to Solidity's `int56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     */
    function toInt56(int256 value) internal pure returns (int56 downcasted) {
        downcasted = int56(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(56, value);
        }
    }

    /**
     * @dev Returns the downcasted int48 from int256, reverting on
     * overflow (when the input is less than smallest int48 or
     * greater than largest int48).
     *
     * Counterpart to Solidity's `int48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     */
    function toInt48(int256 value) internal pure returns (int48 downcasted) {
        downcasted = int48(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(48, value);
        }
    }

    /**
     * @dev Returns the downcasted int40 from int256, reverting on
     * overflow (when the input is less than smallest int40 or
     * greater than largest int40).
     *
     * Counterpart to Solidity's `int40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     */
    function toInt40(int256 value) internal pure returns (int40 downcasted) {
        downcasted = int40(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(40, value);
        }
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toInt32(int256 value) internal pure returns (int32 downcasted) {
        downcasted = int32(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(32, value);
        }
    }

    /**
     * @dev Returns the downcasted int24 from int256, reverting on
     * overflow (when the input is less than smallest int24 or
     * greater than largest int24).
     *
     * Counterpart to Solidity's `int24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     */
    function toInt24(int256 value) internal pure returns (int24 downcasted) {
        downcasted = int24(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(24, value);
        }
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toInt16(int256 value) internal pure returns (int16 downcasted) {
        downcasted = int16(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(16, value);
        }
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits
     */
    function toInt8(int256 value) internal pure returns (int8 downcasted) {
        downcasted = int8(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(8, value);
        }
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
        if (value > uint256(type(int256).max)) {
            revert SafeCastOverflowedUintToInt(value);
        }
        return int256(value);
    }
}

File 6 of 10 : IWETH9.sol
pragma solidity >=0.7.0 < 0.9.0;

interface IWETH9 {
    // Events
    event Approval(address indexed src, address indexed guy, uint wad);
    event Transfer(address indexed src, address indexed dst, uint wad);
    event Deposit(address indexed dst, uint wad);
    event Withdrawal(address indexed src, uint wad);

    // Functions
    function balanceOf(address wad) external returns (uint);
    function deposit() external payable;
    function withdraw(uint wad) external;
    function totalSupply() external view returns (uint);
    function approve(address guy, uint wad) external returns (bool);
    function transfer(address dst, uint wad) external returns (bool);
    function transferFrom(
        address src,
        address dst,
        uint wad
    ) external returns (bool);
}

File 7 of 10 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant NOT_ENTERED = 1;
    uint256 private constant ENTERED = 2;

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // Any calls to nonReentrant after this point will fail
        _status = ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

File 8 of 10 : Context.sol
// 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;
    }
}

File 9 of 10 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 10 of 10 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

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

    /**
     * @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 AddressInsufficientBalance(address(this));
        }

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

    /**
     * @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
     * {FailedInnerCall} 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 AddressInsufficientBalance(address(this));
        }
        (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 {FailedInnerCall}) 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 {FailedInnerCall} 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 {FailedInnerCall}.
     */
    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
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert FailedInnerCall();
        }
    }
}

Settings
{
  "remappings": [
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "balancer-lbp-patch/=lib/balancer-lbp-patch/node_modules/@balancer-labs/",
    "@balancer-labs/=lib/balancer-lbp-patch/node_modules/@balancer-labs/",
    "@ensdomains/=lib/balancer-v2-monorepo/node_modules/@ensdomains/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "@solidity-parser/=lib/balancer-v2-monorepo/node_modules/",
    "balancer-v2-monorepo/=lib/balancer-v2-monorepo/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "hardhat/=lib/balancer-v2-monorepo/node_modules/hardhat/",
    "openzeppelin-0.7/=lib/openzeppelin-0.7/contracts/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "prettier-plugin-solidity/=lib/balancer-v2-monorepo/node_modules/prettier-plugin-solidity/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 9999
  },
  "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

[{"inputs":[{"internalType":"address","name":"_auctionOwner","type":"address"},{"internalType":"contract IERC20","name":"_quoteToken","type":"address"},{"internalType":"contract IERC20","name":"_projectToken","type":"address"},{"internalType":"uint256","name":"_projectTokenAmount","type":"uint256"},{"internalType":"uint256","name":"_floorQuoteAmount","type":"uint256"},{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_endTime","type":"uint256"},{"internalType":"uint256","name":"_swapFeePercentage","type":"uint256"},{"internalType":"uint256","name":"_exitQuoteFeePercentage","type":"uint256"},{"internalType":"bool","name":"_isQuoteWETH","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"swapPercentage","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"exitQuotePercentage","type":"uint256"}],"name":"AuctionFeesSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isFees","type":"bool"}],"name":"AuctionQuoteTokensClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountRefunded","type":"uint256"}],"name":"AuctioneerProjectTokensRefunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ProjectTokenClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"subscriber","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fees","type":"uint256"}],"name":"Subscribed","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"auctionOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"auctionQuoteFeesClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bazaarFeesClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimAuctioneerTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"feeRecipient","type":"address"}],"name":"claimBazaarFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimProjectToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exitQuoteFeePercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"floorQuoteAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isQuoteWETH","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"projectToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"quoteToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_swapFeePercentage","type":"uint256"},{"internalType":"uint256","name":"_exitQuoteFeePercentage","type":"uint256"}],"name":"setFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"subscriber","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"subscribe","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"subscriptions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapFeePercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalProjectTokenAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSubscriptions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSwapFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x6080604052600436106101815760003560e01c806378e97925116100d5578063bed3f89e11610084578063f046395a11610061578063f046395a14610459578063f2fde38b14610486578063f86e39ef146104a6578063f90ad592146104c657005b8063bed3f89e14610400578063c61a77f214610416578063d3924aaf1461042c57005b80638de69284116100b25780638de69284146103c157806395e00a22146103d4578063a4ac0d49146103ea57005b806378e979251461034d5780637d7b8a6b146103635780638da5cb5b1461039657005b8063243fe924116101315780635c975abb1161010e5780635c975abb146102c1578063715018a614610303578063723463091461031857005b8063243fe924146102695780633197cbb61461027e5780634b60ce771461029457005b806316c38b3c1161015f57806316c38b3c146101e15780631e75f23514610201578063217a4b701461021757005b80630b78f9c01461018357806313239b8a146101a35780631328b870146101b8575b005b34801561018f57600080fd5b5061018161019e3660046117bb565b6104fa565b3480156101af57600080fd5b5061018161055a565b3480156101c457600080fd5b506101ce600c5481565b6040519081526020015b60405180910390f35b3480156101ed57600080fd5b506101816101fc3660046117eb565b6106e1565b34801561020d57600080fd5b506101ce60095481565b34801561022357600080fd5b506002546102449073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101d8565b34801561027557600080fd5b5061018161079d565b34801561028a57600080fd5b506101ce60085481565b3480156102a057600080fd5b506003546102449073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102cd57600080fd5b506003546102f39074010000000000000000000000000000000000000000900460ff1681565b60405190151581526020016101d8565b34801561030f57600080fd5b50610181610c20565b34801561032457600080fd5b506003546102f39077010000000000000000000000000000000000000000000000900460ff1681565b34801561035957600080fd5b506101ce60075481565b34801561036f57600080fd5b506003546102f3907501000000000000000000000000000000000000000000900460ff1681565b3480156103a257600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff16610244565b6101816103cf366004611831565b610c32565b3480156103e057600080fd5b506101ce60065481565b3480156103f657600080fd5b506101ce60055481565b34801561040c57600080fd5b506101ce600d5481565b34801561042257600080fd5b506101ce600a5481565b34801561043857600080fd5b506004546102449073ffffffffffffffffffffffffffffffffffffffff1681565b34801561046557600080fd5b506101ce61047436600461185b565b600b6020526000908152604090205481565b34801561049257600080fd5b506101816104a136600461185b565b610fec565b3480156104b257600080fd5b506101816104c136600461185b565b61104d565b3480156104d257600080fd5b506003546102f390760100000000000000000000000000000000000000000000900460ff1681565b61050261139b565b61050a6113ee565b6005829055600681905560408051838152602081018390527fe7e2a095726aa7e61c651d0bea81dc8918f53351816feedbe765b4436e4bc463910160405180910390a161055660018055565b5050565b6105626113ee565b60085442116105b85760405162461bcd60e51b815260206004820152601560248201527f41756374696f6e20686173206e6f7420656e646564000000000000000000000060448201526064015b60405180910390fd5b336000908152600b6020526040902054806106155760405162461bcd60e51b815260206004820152601060248201527f4e6f20737562736372697074696f6e730000000000000000000000000000000060448201526064016105af565b336000908152600b60205260408120819055600954600c541061063a57600c5461063e565b6009545b9050600081600a548461065191906118a5565b61065b91906118bc565b6003549091506106829073ffffffffffffffffffffffffffffffffffffffff163383611431565b60035460405182815273ffffffffffffffffffffffffffffffffffffffff9091169033907fbe73a18309fe904ddf9986e4f1f4c65a7d33988a6ad96f82b1c4ed87e19bb99c9060200160405180910390a35050506106df60018055565b565b60045473ffffffffffffffffffffffffffffffffffffffff1633146107485760405162461bcd60e51b815260206004820152601260248201527f4f6e6c792061756374696f6e204f776e6572000000000000000000000000000060448201526064016105af565b6107506113ee565b600380547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000831515021790556001805550565b50565b60045473ffffffffffffffffffffffffffffffffffffffff1633146108045760405162461bcd60e51b815260206004820152601260248201527f4f6e6c792061756374696f6e204f776e6572000000000000000000000000000060448201526064016105af565b61080c6113ee565b600854421161085d5760405162461bcd60e51b815260206004820152601560248201527f41756374696f6e20686173206e6f7420656e646564000000000000000000000060448201526064016105af565b60035477010000000000000000000000000000000000000000000000900460ff16156108f15760405162461bcd60e51b815260206004820152602260248201527f41756374696f6e2071756f7465206665657320616c726561647920636c61696d60448201527f656400000000000000000000000000000000000000000000000000000000000060648201526084016105af565b6000670de0b6b3a7640000600654600c5461090c91906118a5565b61091691906118bc565b600c5461092391906118f7565b600954600c5460035492935010907501000000000000000000000000000000000000000000900460ff1615610a9a576002546040517f2e1a7d4d0000000000000000000000000000000000000000000000000000000081526004810184905273ffffffffffffffffffffffffffffffffffffffff90911690632e1a7d4d90602401600060405180830381600087803b1580156109be57600080fd5b505af11580156109d2573d6000803e3d6000fd5b50506040516000925033915084908381818185875af1925050503d8060008114610a18576040519150601f19603f3d011682016040523d82523d6000602084013e610a1d565b606091505b5050905080610a945760405162461bcd60e51b815260206004820152602560248201527f4661696c656420746f2073656e6420457468657220746f2061756374696f6e2060448201527f6f776e657200000000000000000000000000000000000000000000000000000060648201526084016105af565b50610abe565b600254610abe9073ffffffffffffffffffffffffffffffffffffffff163384611431565b8015610b7c576000600954600c54600a54610ad991906118a5565b610ae391906118bc565b600354600a54919250610b1b9173ffffffffffffffffffffffffffffffffffffffff909116903390610b169085906118f7565b611431565b600354600a5473ffffffffffffffffffffffffffffffffffffffff9091169033907fda2be1a9e45b257b4871e346718e2baecb61ac0f6eb99017f52965723ea8ac3690610b699085906118f7565b60405190815260200160405180910390a3505b600380547fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff1677010000000000000000000000000000000000000000000000179055600254604080518481526000602082015273ffffffffffffffffffffffffffffffffffffffff9092169133917f4a603ce815dea65b6c1f72f879380d681a068027dc8b99055a03c15559c7a29b910160405180910390a350506106df60018055565b610c2861139b565b6106df60006114b7565b610c3a6113ee565b60035474010000000000000000000000000000000000000000900460ff1615610ca55760405162461bcd60e51b815260206004820152601260248201527f436f6e747261637420697320706175736564000000000000000000000000000060448201526064016105af565b42600754108015610cb7575060085442105b610d295760405162461bcd60e51b815260206004820152602160248201527f537562736372697074696f6e20706572696f64206973206e6f7420616374697660448201527f650000000000000000000000000000000000000000000000000000000000000060648201526084016105af565b6003547501000000000000000000000000000000000000000000900460ff168015610d5357508034145b15610e5557803414610dcd5760405162461bcd60e51b815260206004820152603660248201527f416d6f756e7420737065636966696564206d757374206265207468652073616d60448201527f65206173206d73672e76616c756520666f72204554480000000000000000000060648201526084016105af565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b158015610e3757600080fd5b505af1158015610e4b573d6000803e3d6000fd5b5050505050610eee565b3415610ec95760405162461bcd60e51b815260206004820152603b60248201527f4e6f206d73672e76616c75652073686f756c642062652073656e74206173207560448201527f73657220697320706179696e67207769746820616e204552433230000000000060648201526084016105af565b600254610eee9073ffffffffffffffffffffffffffffffffffffffff1633308461152c565b6000670de0b6b3a764000060055483610f0791906118a5565b610f1191906118bc565b90506000610f1f82846118f7565b73ffffffffffffffffffffffffffffffffffffffff85166000908152600b6020526040812080549293508392909190610f5990849061190a565b9250508190555080600c6000828254610f72919061190a565b9250508190555081600d6000828254610f8b919061190a565b9091555050604080518481526020810184905273ffffffffffffffffffffffffffffffffffffffff8616917ff94991dcbea6e8ac439cbc93bd9c62a4d39f04e0ad656df9a703f13552c2787f910160405180910390a2505061055660018055565b610ff461139b565b73ffffffffffffffffffffffffffffffffffffffff8116611044576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024016105af565b61079a816114b7565b61105561139b565b61105d6113ee565b60085442116110ae5760405162461bcd60e51b815260206004820152601560248201527f41756374696f6e20686173206e6f7420656e646564000000000000000000000060448201526064016105af565b600354760100000000000000000000000000000000000000000000900460ff161561111b5760405162461bcd60e51b815260206004820152601b60248201527f42617a616172206665657320616c726561647920636c61696d6564000000000060448201526064016105af565b6000670de0b6b3a7640000600654600c5461113691906118a5565b61114091906118bc565b600d5461114d919061190a565b6003549091507501000000000000000000000000000000000000000000900460ff16156112d4576002546040517f2e1a7d4d0000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff90911690632e1a7d4d90602401600060405180830381600087803b1580156111e057600080fd5b505af11580156111f4573d6000803e3d6000fd5b5050505060008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114611252576040519150601f19603f3d011682016040523d82523d6000602084013e611257565b606091505b50509050806112ce5760405162461bcd60e51b815260206004820152602560248201527f4661696c656420746f2073656e6420457468657220746f2061756374696f6e2060448201527f6f776e657200000000000000000000000000000000000000000000000000000060648201526084016105af565b506112f8565b6002546112f89073ffffffffffffffffffffffffffffffffffffffff168383611431565b600380547fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff16760100000000000000000000000000000000000000000000179055600254604080518381526001602082015273ffffffffffffffffffffffffffffffffffffffff928316928516917f4a603ce815dea65b6c1f72f879380d681a068027dc8b99055a03c15559c7a29b910160405180910390a35061079a60018055565b60005473ffffffffffffffffffffffffffffffffffffffff1633146106df576040517f118cdaa70000000000000000000000000000000000000000000000000000000081523360048201526024016105af565b60026001540361142a576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600155565b60405173ffffffffffffffffffffffffffffffffffffffff8381166024830152604482018390526114b291859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611578565b505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60405173ffffffffffffffffffffffffffffffffffffffff84811660248301528381166044830152606482018390526115729186918216906323b872dd9060840161146b565b50505050565b600061159a73ffffffffffffffffffffffffffffffffffffffff84168361160e565b905080516000141580156115bf5750808060200190518101906115bd919061191d565b155b156114b2576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201526024016105af565b606061161c83836000611625565b90505b92915050565b606081471015611663576040517fcd7860590000000000000000000000000000000000000000000000000000000081523060048201526024016105af565b6000808573ffffffffffffffffffffffffffffffffffffffff16848660405161168c919061193a565b60006040518083038185875af1925050503d80600081146116c9576040519150601f19603f3d011682016040523d82523d6000602084013e6116ce565b606091505b50915091506116de8683836116ea565b925050505b9392505050565b6060826116ff576116fa82611779565b6116e3565b8151158015611723575073ffffffffffffffffffffffffffffffffffffffff84163b155b15611772576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024016105af565b50806116e3565b8051156117895780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080604083850312156117ce57600080fd5b50508035926020909101359150565b801515811461079a57600080fd5b6000602082840312156117fd57600080fd5b81356116e3816117dd565b803573ffffffffffffffffffffffffffffffffffffffff8116811461182c57600080fd5b919050565b6000806040838503121561184457600080fd5b61184d83611808565b946020939093013593505050565b60006020828403121561186d57600080fd5b61161c82611808565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761161f5761161f611876565b6000826118f2577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8181038181111561161f5761161f611876565b8082018082111561161f5761161f611876565b60006020828403121561192f57600080fd5b81516116e3816117dd565b6000825160005b8181101561195b5760208186018101518583015201611941565b50600092019182525091905056fea264697066735822122053aa300564fa7ed88ef3671687f7acb888428e2f317f54d20d55a710579f274764736f6c63430008140033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.