ETH Price: $3,386.93 (-1.44%)
Gas: 3 Gwei

Contract

0x32953D7ae37B05075b88c34E800aE80C1Cb1B794
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Configure Drop201778382024-06-26 19:06:112 days ago1719428771IN
0x32953D7a...C1Cb1B794
0 ETH0.001899818.38302388
Configure Drop201108322024-06-17 10:12:4712 days ago1718619167IN
0x32953D7a...C1Cb1B794
0 ETH0.00163267.20434291
Purchase200282632024-06-05 21:17:5923 days ago1717622279IN
0x32953D7a...C1Cb1B794
0.0885 ETH0.0037780122.33928059
Purchase200111432024-06-03 11:57:4726 days ago1717415867IN
0x32953D7a...C1Cb1B794
0.0249 ETH0.001539718.92097217
Purchase200110032024-06-03 11:29:4726 days ago1717414187IN
0x32953D7a...C1Cb1B794
0.0249 ETH0.0017621910.21001206
Purchase200107972024-06-03 10:48:3526 days ago1717411715IN
0x32953D7a...C1Cb1B794
0.0249 ETH0.001518968.80076425
Purchase200107562024-06-03 10:40:2326 days ago1717411223IN
0x32953D7a...C1Cb1B794
0.0249 ETH0.001537318.90704826
Purchase200046122024-06-02 14:04:1126 days ago1717337051IN
0x32953D7a...C1Cb1B794
0.0249 ETH0.001634519.47025383
Purchase200045002024-06-02 13:41:4726 days ago1717335707IN
0x32953D7a...C1Cb1B794
0.0249 ETH0.001291627.4835724
Purchase200044042024-06-02 13:22:2326 days ago1717334543IN
0x32953D7a...C1Cb1B794
0.0249 ETH0.001517858.79433034
Purchase200041772024-06-02 12:36:4727 days ago1717331807IN
0x32953D7a...C1Cb1B794
0.0498 ETH0.00106736.18387793
Purchase200001242024-06-01 23:01:4727 days ago1717282907IN
0x32953D7a...C1Cb1B794
0.0498 ETH0.000919285.32626926
Purchase199992722024-06-01 20:10:4727 days ago1717272647IN
0x32953D7a...C1Cb1B794
0.0249 ETH0.00085574.9579
Purchase199977032024-06-01 14:55:4727 days ago1717253747IN
0x32953D7a...C1Cb1B794
0.0609 ETH0.0013297.85781509
Purchase199966682024-06-01 11:27:5928 days ago1717241279IN
0x32953D7a...C1Cb1B794
0.0609 ETH0.000789164.66594656
Configure Drop199930242024-05-31 23:14:4728 days ago1717197287IN
0x32953D7a...C1Cb1B794
0 ETH0.001395776.15859187
Purchase199925432024-05-31 21:37:4728 days ago1717191467IN
0x32953D7a...C1Cb1B794
0.0249 ETH0.001513958.7717007
Purchase199858112024-05-30 23:03:4729 days ago1717110227IN
0x32953D7a...C1Cb1B794
0.0249 ETH0.001438118.33231859
Purchase199851932024-05-30 20:59:5929 days ago1717102799IN
0x32953D7a...C1Cb1B794
0.0249 ETH0.001429618.28304691
Purchase199798682024-05-30 3:05:2330 days ago1717038323IN
0x32953D7a...C1Cb1B794
0.0609 ETH0.001132516.69605828
Purchase199792482024-05-30 1:00:4730 days ago1717030847IN
0x32953D7a...C1Cb1B794
0.0609 ETH0.0027358616.17703655
Purchase199788962024-05-29 23:49:5930 days ago1717026599IN
0x32953D7a...C1Cb1B794
0.0249 ETH0.001363067.89746118
Purchase199773082024-05-29 18:30:3530 days ago1717007435IN
0x32953D7a...C1Cb1B794
0.0249 ETH0.0018347910.63066217
Purchase199766482024-05-29 16:16:1130 days ago1716999371IN
0x32953D7a...C1Cb1B794
0.0609 ETH0.0031778418.78913692
Purchase199766462024-05-29 16:15:4730 days ago1716999347IN
0x32953D7a...C1Cb1B794
0.0249 ETH0.0032726418.96143404
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To Value
200282632024-06-05 21:17:5923 days ago1717622279
0x32953D7a...C1Cb1B794
0.0135 ETH
200282632024-06-05 21:17:5923 days ago1717622279
0x32953D7a...C1Cb1B794
0.075 ETH
200111432024-06-03 11:57:4726 days ago1717415867
0x32953D7a...C1Cb1B794
0.0009 ETH
200111432024-06-03 11:57:4726 days ago1717415867
0x32953D7a...C1Cb1B794
0.024 ETH
200110032024-06-03 11:29:4726 days ago1717414187
0x32953D7a...C1Cb1B794
0.0009 ETH
200110032024-06-03 11:29:4726 days ago1717414187
0x32953D7a...C1Cb1B794
0.024 ETH
200107972024-06-03 10:48:3526 days ago1717411715
0x32953D7a...C1Cb1B794
0.0009 ETH
200107972024-06-03 10:48:3526 days ago1717411715
0x32953D7a...C1Cb1B794
0.024 ETH
200107562024-06-03 10:40:2326 days ago1717411223
0x32953D7a...C1Cb1B794
0.0009 ETH
200107562024-06-03 10:40:2326 days ago1717411223
0x32953D7a...C1Cb1B794
0.024 ETH
200046122024-06-02 14:04:1126 days ago1717337051
0x32953D7a...C1Cb1B794
0.0009 ETH
200046122024-06-02 14:04:1126 days ago1717337051
0x32953D7a...C1Cb1B794
0.024 ETH
200045002024-06-02 13:41:4726 days ago1717335707
0x32953D7a...C1Cb1B794
0.0009 ETH
200045002024-06-02 13:41:4726 days ago1717335707
0x32953D7a...C1Cb1B794
0.024 ETH
200044042024-06-02 13:22:2326 days ago1717334543
0x32953D7a...C1Cb1B794
0.0009 ETH
200044042024-06-02 13:22:2326 days ago1717334543
0x32953D7a...C1Cb1B794
0.024 ETH
200041772024-06-02 12:36:4727 days ago1717331807
0x32953D7a...C1Cb1B794
0.0018 ETH
200041772024-06-02 12:36:4727 days ago1717331807
0x32953D7a...C1Cb1B794
0.048 ETH
200001242024-06-01 23:01:4727 days ago1717282907
0x32953D7a...C1Cb1B794
0.0018 ETH
200001242024-06-01 23:01:4727 days ago1717282907
0x32953D7a...C1Cb1B794
0.048 ETH
199992722024-06-01 20:10:4727 days ago1717272647
0x32953D7a...C1Cb1B794
0.0009 ETH
199992722024-06-01 20:10:4727 days ago1717272647
0x32953D7a...C1Cb1B794
0.024 ETH
199977032024-06-01 14:55:4727 days ago1717253747
0x32953D7a...C1Cb1B794
0.0009 ETH
199977032024-06-01 14:55:4727 days ago1717253747
0x32953D7a...C1Cb1B794
0.06 ETH
199966682024-06-01 11:27:5928 days ago1717241279
0x32953D7a...C1Cb1B794
0.0009 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TLStacks1155

Compiler Version
v0.8.22+commit.4fc1097e

Optimization Enabled:
Yes with 20000 runs

Other Settings:
paris EvmVersion
File 1 of 19 : TLStacks1155.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.22;

import {Ownable} from "openzeppelin/access/Ownable.sol";
import {Pausable} from "openzeppelin/utils/Pausable.sol";
import {ReentrancyGuard} from "openzeppelin/utils/ReentrancyGuard.sol";
import {MerkleProof} from "openzeppelin/utils/cryptography/MerkleProof.sol";
import {IERC1155TL} from "tl-creator-contracts/erc-1155/IERC1155TL.sol";
import {TransferHelper} from "tl-sol-tools/payments/TransferHelper.sol";
import {SanctionsCompliance} from "tl-sol-tools/payments/SanctionsCompliance.sol";
import {OwnableAccessControl} from "tl-sol-tools/access/OwnableAccessControl.sol";
import {DropPhase, DropType, DropErrors} from "./utils/CommonUtils.sol";
import {Drop, ITLStacks1155Events} from "./utils/TLStacks1155Utils.sol";

/*//////////////////////////////////////////////////////////////////////////
                            TL Stacks 1155
//////////////////////////////////////////////////////////////////////////*/

/// @title TLStacks1155
/// @notice Transient Labs Stacks mint contract for ERC1155TL contracts
/// @author transientlabs.xyz
/// @custom:version-last-updated 2.3.1
contract TLStacks1155 is
    Ownable,
    Pausable,
    ReentrancyGuard,
    TransferHelper,
    SanctionsCompliance,
    ITLStacks1155Events,
    DropErrors
{
    /*//////////////////////////////////////////////////////////////////////////
                                  Constants
    //////////////////////////////////////////////////////////////////////////*/

    string public constant VERSION = "2.3.1";
    bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
    bytes32 public constant APPROVED_MINT_CONTRACT = keccak256("APPROVED_MINT_CONTRACT");

    /*//////////////////////////////////////////////////////////////////////////
                                State Variables
    //////////////////////////////////////////////////////////////////////////*/

    address public protocolFeeReceiver; // the payout receiver for the protocol fee
    uint256 public protocolFee; // the protocol fee, in eth, to charge the buyer
    address public weth; // weth address
    mapping(address => mapping(uint256 => Drop)) internal _drops; // nft address -> token id -> Drop
    mapping(address => mapping(uint256 => mapping(uint256 => mapping(address => uint256)))) internal _numberMinted; // nft address -> token id -> round -> user -> number minted
    mapping(address => mapping(uint256 => uint256)) internal _rounds; // nft address -> token id -> round

    /*//////////////////////////////////////////////////////////////////////////
                                Constructor
    //////////////////////////////////////////////////////////////////////////*/

    constructor(
        address initOwner,
        address initSanctionsOracle,
        address initWethAddress,
        address initProtocolFeeReceiver,
        uint256 initProtocolFee
    ) Ownable(initOwner) Pausable() ReentrancyGuard() SanctionsCompliance(initSanctionsOracle) {
        _setWethAddress(initWethAddress);
        _setProtocolFeeSettings(initProtocolFeeReceiver, initProtocolFee);
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Owner Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice Function to set a new weth address
    /// @dev Requires owner
    /// @param newWethAddress The new weth address
    function setWethAddress(address newWethAddress) external onlyOwner {
        _setWethAddress(newWethAddress);
    }

    /// @notice Function to set the protocol fee settings
    /// @dev Requires owner
    /// @param newProtocolFeeReceiver The new protocol fee receiver
    /// @param newProtocolFee The new protocol fee in ETH
    function setProtocolFeeSettings(address newProtocolFeeReceiver, uint256 newProtocolFee) external onlyOwner {
        _setProtocolFeeSettings(newProtocolFeeReceiver, newProtocolFee);
    }

    /// @notice Function to pause the contract
    /// @dev Requires owner
    /// @param status The boolean to set the internal pause variable
    function pause(bool status) external onlyOwner {
        if (status) {
            _pause();
        } else {
            _unpause();
        }
    }

    /// @notice Function to set the sanctions oracle
    /// @dev Requires owner
    /// @param newOracle The new oracle address
    function setSanctionsOracle(address newOracle) external onlyOwner {
        _updateSanctionsOracle(newOracle);
    }

    /*//////////////////////////////////////////////////////////////////////////
                            Drop Configuration Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice Function to configure a drop
    /// @dev Caller must be the nft contract owner or an admin on the contract
    /// @dev Reverts if
    ///     - the payout receiver is the zero address
    ///     - a drop is already configured and live
    ///     - the `intiialSupply` does not equal the `supply`
    ///     - the `decayRate` is non-zero and there is a presale configured
    /// @param nftAddress The nft contract address
    /// @param tokenId The token id of the ERC-1155 token
    /// @param drop The drop to configure
    function configureDrop(address nftAddress, uint256 tokenId, Drop calldata drop)
        external
        whenNotPaused
        nonReentrant
    {
        // sanctions
        _isSanctioned(msg.sender, true);
        _isSanctioned(drop.payoutReceiver, true);

        // check pre-conditions
        if (!_isDropAdmin(nftAddress)) revert NotDropAdmin();
        if (!_checkPayoutReceiver(drop.payoutReceiver)) revert InvalidPayoutReceiver();
        if (!_isApprovedMintContract(nftAddress)) revert NotApprovedMintContract();
        if (drop.initialSupply != drop.supply) revert InvalidDropSupply();
        if (drop.decayRate != 0 && drop.dropType != DropType.VELOCITY) revert InvalidDropType();
        if (drop.dropType == DropType.VELOCITY && drop.presaleDuration != 0) revert NotAllowedForVelocityDrops();

        // check if drop is already configured and live
        Drop memory mDrop = _drops[nftAddress][tokenId];
        DropPhase mPhase = _getDropPhase(mDrop);
        if (mDrop.dropType != DropType.NOT_CONFIGURED && mPhase != DropPhase.ENDED) {
            revert DropAlreadyConfigured();
        }

        // store drop
        _drops[nftAddress][tokenId] = drop;

        // increment drop round if drop was previously set
        if (mDrop.dropType != DropType.NOT_CONFIGURED) {
            _rounds[nftAddress][tokenId] += 1;
        }

        emit DropConfigured(nftAddress, tokenId, drop);
    }

    /// @notice Function to update the payout receiver of a drop
    /// @dev Caller must be the nft contract owner or an admin on the contract
    /// @param nftAddress The nft contract address
    /// @param tokenId The token id of the ERC-1155 token
    /// @param payoutReceiver The recipient of the funds from the mint
    function updateDropPayoutReceiver(address nftAddress, uint256 tokenId, address payoutReceiver)
        external
        whenNotPaused
        nonReentrant
    {
        // sanctions
        _isSanctioned(payoutReceiver, true);

        // check pre-conditions
        if (!_isDropAdmin(nftAddress)) revert NotDropAdmin();
        Drop memory drop = _drops[nftAddress][tokenId];
        DropPhase mPhase = _getDropPhase(drop);
        if (mPhase == DropPhase.NOT_CONFIGURED || mPhase == DropPhase.ENDED) revert DropUpdateNotAllowed();
        if (!_checkPayoutReceiver(payoutReceiver)) revert InvalidPayoutReceiver();

        // set new payout receiver
        drop.payoutReceiver = payoutReceiver;
        _drops[nftAddress][tokenId].payoutReceiver = drop.payoutReceiver;

        emit DropUpdated(nftAddress, tokenId, drop);
    }

    /// @notice Function to update the drop public allowance
    /// @dev Caller must be the nft contract owner or an admin on the contract
    /// @param nftAddress The nft contract address
    /// @param tokenId The token id of the ERC-1155 token
    /// @param allowance The number of tokens allowed to be minted per wallet during the public phase of the drop
    function updateDropAllowance(address nftAddress, uint256 tokenId, uint256 allowance)
        external
        whenNotPaused
        nonReentrant
    {
        // check pre-conditions
        if (!_isDropAdmin(nftAddress)) revert NotDropAdmin();
        Drop memory drop = _drops[nftAddress][tokenId];
        DropPhase mPhase = _getDropPhase(drop);
        if (mPhase == DropPhase.NOT_CONFIGURED || mPhase == DropPhase.ENDED) revert DropUpdateNotAllowed();

        // set new allowance
        drop.allowance = allowance;
        _drops[nftAddress][tokenId].allowance = drop.allowance;

        emit DropUpdated(nftAddress, tokenId, drop);
    }

    /// @notice Function to update the drop prices and currency
    /// @dev Caller must be the nft contract owner or an admin on the contract
    /// @param nftAddress The nft contract address
    /// @param tokenId The token id of the ERC-1155 token
    /// @param currencyAddress The currency address (zero address represents ETH)
    /// @param presaleCost The cost of each token during the presale phase
    /// @param publicCost The cost of each token during the presale phase
    function updateDropPrices(
        address nftAddress,
        uint256 tokenId,
        address currencyAddress,
        uint256 presaleCost,
        uint256 publicCost
    ) external whenNotPaused nonReentrant {
        // check pre-conditions
        if (!_isDropAdmin(nftAddress)) revert NotDropAdmin();
        Drop memory drop = _drops[nftAddress][tokenId];
        DropPhase mPhase = _getDropPhase(drop);
        if (mPhase == DropPhase.NOT_CONFIGURED || mPhase == DropPhase.ENDED) revert DropUpdateNotAllowed();

        // set currency address and prices
        drop.currencyAddress = currencyAddress;
        drop.presaleCost = presaleCost;
        drop.publicCost = publicCost;
        _drops[nftAddress][tokenId].currencyAddress = drop.currencyAddress;
        _drops[nftAddress][tokenId].presaleCost = drop.presaleCost;
        _drops[nftAddress][tokenId].publicCost = drop.publicCost;

        emit DropUpdated(nftAddress, tokenId, drop);
    }

    /// @notice Function to adjust drop durations
    /// @dev Caller must be the nft contract owner or an admin on the contract
    /// @param nftAddress The nft contract address
    /// @param tokenId The token id of the ERC-1155 token
    /// @param startTime The timestamp at which the drop starts
    /// @param presaleDuration The duration of the presale phase of the drop, in seconds
    /// @param publicDuration The duration of the public phase
    function updateDropDuration(
        address nftAddress,
        uint256 tokenId,
        uint256 startTime,
        uint256 presaleDuration,
        uint256 publicDuration
    ) external whenNotPaused nonReentrant {
        // check pre-conditions
        if (!_isDropAdmin(nftAddress)) revert NotDropAdmin();
        Drop memory drop = _drops[nftAddress][tokenId];
        DropPhase mPhase = _getDropPhase(drop);
        if (mPhase == DropPhase.NOT_CONFIGURED || mPhase == DropPhase.ENDED) revert DropUpdateNotAllowed();
        if (drop.dropType == DropType.VELOCITY && presaleDuration != 0) revert NotAllowedForVelocityDrops();

        // update durations
        drop.startTime = startTime;
        drop.presaleDuration = presaleDuration;
        drop.publicDuration = publicDuration;
        _drops[nftAddress][tokenId].startTime = drop.startTime;
        _drops[nftAddress][tokenId].presaleDuration = drop.presaleDuration;
        _drops[nftAddress][tokenId].publicDuration = drop.publicDuration;

        emit DropUpdated(nftAddress, tokenId, drop);
    }

    /// @notice Function to adjust the drop merkle root
    /// @dev Caller must be the nft contract owner or an admin on the contract
    /// @param nftAddress The nft contract address
    /// @param tokenId The token id of the ERC-1155 token
    /// @param presaleMerkleRoot The merkle root for the presale phase (each leaf is abi encoded with the recipient and number they can mint during presale)
    function updateDropPresaleMerkleRoot(address nftAddress, uint256 tokenId, bytes32 presaleMerkleRoot)
        external
        whenNotPaused
        nonReentrant
    {
        // check pre-conditions
        if (!_isDropAdmin(nftAddress)) revert NotDropAdmin();
        Drop memory drop = _drops[nftAddress][tokenId];
        DropPhase mPhase = _getDropPhase(drop);
        if (mPhase == DropPhase.NOT_CONFIGURED || mPhase == DropPhase.ENDED) revert DropUpdateNotAllowed();
        if (drop.dropType == DropType.VELOCITY) revert NotAllowedForVelocityDrops();

        // update merkle root
        drop.presaleMerkleRoot = presaleMerkleRoot;
        _drops[nftAddress][tokenId].presaleMerkleRoot = drop.presaleMerkleRoot;

        emit DropUpdated(nftAddress, tokenId, drop);
    }

    /// @notice Function to adjust the drop decay rate
    /// @dev Caller must be the nft contract owner or an admin on the contract
    /// @param nftAddress The nft contract address
    /// @param tokenId The token id of the ERC-1155 token
    /// @param decayRate The merkle root for the presale phase (each leaf is abi encoded with the recipient and number they can mint during presale)
    function updateDropDecayRate(address nftAddress, uint256 tokenId, int256 decayRate)
        external
        whenNotPaused
        nonReentrant
    {
        // check pre-conditions
        if (!_isDropAdmin(nftAddress)) revert NotDropAdmin();
        Drop memory drop = _drops[nftAddress][tokenId];
        DropPhase mPhase = _getDropPhase(drop);
        if (mPhase == DropPhase.NOT_CONFIGURED || mPhase == DropPhase.ENDED) revert DropUpdateNotAllowed();
        if (drop.dropType != DropType.VELOCITY) revert NotAllowedForVelocityDrops();

        // update decay rate
        drop.decayRate = decayRate;
        _drops[nftAddress][tokenId].decayRate = drop.decayRate;

        emit DropUpdated(nftAddress, tokenId, drop);
    }

    function closeDrop(address nftAddress, uint256 tokenId) external nonReentrant {
        if (!_isDropAdmin(nftAddress)) revert NotDropAdmin();

        // delete the drop
        delete _drops[nftAddress][tokenId];

        // clear the number minted round
        _rounds[nftAddress][tokenId]++;

        emit DropClosed(nftAddress, tokenId);
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Purchase Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice Function to purchase a single token via a drop
    /// @dev Reverts on any of the following conditions
    ///     - Drop isn't active or configured
    ///     - numberToMint is 0
    ///     - Invalid merkle proof during the presale phase
    ///     - Insufficent protocol fee
    ///     - Insufficient funds
    ///     - Already minted the allowance for the recipient
    ///     - Receiver is a contract that doesn't implement proper ERC-1155 receiving functions
    /// @param nftAddress The nft contract address
    /// @param tokenId The nft token id
    /// @param recipient The receiver of the nft (msg.sender is the payer but this allows delegation)
    /// @param numberToMint The number of tokens to mint
    /// @param presaleNumberCanMint The number of tokens the recipient can mint during presale
    /// @param proof The merkle proof for the presale page
    /// @return refundAmount The amount of eth refunded bqck to the caller
    function purchase(
        address nftAddress,
        uint256 tokenId,
        address recipient,
        uint256 numberToMint,
        uint256 presaleNumberCanMint,
        bytes32[] calldata proof
    ) external payable whenNotPaused nonReentrant returns (uint256 refundAmount) {
        _isSanctioned(msg.sender, true);
        _isSanctioned(recipient, true);

        // cache drop
        Drop memory drop = _drops[nftAddress][tokenId];
        DropPhase dropPhase = _getDropPhase(drop);
        uint256 round = _rounds[nftAddress][tokenId];
        uint256 numberMinted = _numberMinted[nftAddress][tokenId][round][recipient];
        uint256 numberCanMint = numberToMint; // cache and then update depending on phase
        uint256 cost = drop.presaleCost;

        // pre-conditions - revert for safety and expected behavior from users - UX for batch purchases needs to be smart in order to avoid reverting conditions
        if (numberToMint == 0) revert MintZeroTokens();
        if (dropPhase == DropPhase.PRESALE) {
            bytes32 hashedRecipient = keccak256(abi.encode(recipient));
            bytes32 leaf = keccak256(bytes.concat(keccak256(abi.encode(hashedRecipient, presaleNumberCanMint)))); // double hash to prevent second preimage attack: https://github.com/OpenZeppelin/openzeppelin-contracts/issues/3091
            if (!MerkleProof.verify(proof, drop.presaleMerkleRoot, leaf)) revert NotOnAllowlist();
            numberCanMint = _getNumberCanMint(presaleNumberCanMint, numberMinted, drop.supply);
        } else if (dropPhase == DropPhase.PUBLIC_SALE) {
            numberCanMint = _getNumberCanMint(drop.allowance, numberMinted, drop.supply);
            cost = drop.publicCost;
        } else {
            revert YouShallNotMint();
        }
        if (numberCanMint == 0) revert AlreadyReachedMintAllowance();

        // limit numberToMint to numberCanMint
        if (numberToMint > numberCanMint) {
            numberToMint = numberCanMint;
        }

        // adjust drop state
        _updateDropState(nftAddress, tokenId, round, recipient, numberToMint, drop);

        // settle funds
        refundAmount = _settleUp(numberToMint, cost, drop);

        // mint
        _mintToken(nftAddress, tokenId, recipient, numberToMint);

        emit Purchase(
            nftAddress,
            tokenId,
            recipient,
            drop.currencyAddress,
            numberToMint,
            cost,
            drop.decayRate,
            dropPhase == DropPhase.PRESALE
        );

        return refundAmount;
    }

    /*//////////////////////////////////////////////////////////////////////////
                            External View Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice Function to get a drop
    /// @param nftAddress The nft contract address
    /// @param tokenId The nft token id
    /// @return Drop The drop for the nft contract and token id
    function getDrop(address nftAddress, uint256 tokenId) external view returns (Drop memory) {
        return _drops[nftAddress][tokenId];
    }

    /// @notice Function to get a number of drops for a contract
    /// @param nftAddress The nft contract address
    /// @param tokenIds The nft token ids
    /// @return drops An array of Drops
    function getDrops(address nftAddress, uint256[] calldata tokenIds) external view returns (Drop[] memory drops) {
        drops = new Drop[](tokenIds.length);
        for (uint256 i = 0; i < tokenIds.length; i++) {
            drops[i] = _drops[nftAddress][tokenIds[i]];
        }
    }

    /// @notice Function to get number minted on a drop for an address
    /// @param nftAddress The nft contract address
    /// @param tokenId The nft token id
    /// @param recipient The recipient of the nft
    /// @return uint256 The number of tokens minted
    function getNumberMinted(address nftAddress, uint256 tokenId, address recipient) external view returns (uint256) {
        uint256 round = _rounds[nftAddress][tokenId];
        return _numberMinted[nftAddress][tokenId][round][recipient];
    }

    /// @notice Function to get the drop phase
    /// @param nftAddress The nft contract address
    /// @param tokenId The nft token id
    /// @return DropPhase The drop phase
    function getDropPhase(address nftAddress, uint256 tokenId) external view returns (DropPhase) {
        Drop memory drop = _drops[nftAddress][tokenId];
        return _getDropPhase(drop);
    }

    /// @notice Function to get the drop round
    /// @param nftAddress The nft contract address
    /// @param tokenId The nft token id
    /// @return uint256 The round for the drop based on the nft contract and token id
    function getDropRound(address nftAddress, uint256 tokenId) external view returns (uint256) {
        return _rounds[nftAddress][tokenId];
    }

    /*//////////////////////////////////////////////////////////////////////////
                            Internal Helper Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice Internal function to set the weth address
    /// @param newWethAddress The new weth address
    function _setWethAddress(address newWethAddress) internal {
        address prevWethAddress = weth;
        weth = newWethAddress;

        emit WethUpdated(prevWethAddress, newWethAddress);
    }

    /// @notice Internal function to set the protocol fee settings
    /// @param newProtocolFeeReceiver The new protocol fee receiver
    /// @param newProtocolFee The new protocol fee in ETH
    function _setProtocolFeeSettings(address newProtocolFeeReceiver, uint256 newProtocolFee) internal {
        protocolFeeReceiver = newProtocolFeeReceiver;
        protocolFee = newProtocolFee;

        emit ProtocolFeeUpdated(newProtocolFeeReceiver, newProtocolFee);
    }

    /// @notice Internal function to check if msg.sender is the owner or an admin on the contract
    /// @param nftAddress The nft contract address
    /// @return bool Boolean indicating if msg.sender is the owner or an admin on the nft contract
    function _isDropAdmin(address nftAddress) internal view returns (bool) {
        return (
            msg.sender == OwnableAccessControl(nftAddress).owner()
                || OwnableAccessControl(nftAddress).hasRole(ADMIN_ROLE, msg.sender)
        );
    }

    /// @notice Intenral function to check if this contract is an approved mint contract
    /// @param nftAddress The nft contract address
    /// @return bool Boolean indicating if this contract is approved or not
    function _isApprovedMintContract(address nftAddress) internal view returns (bool) {
        return OwnableAccessControl(nftAddress).hasRole(APPROVED_MINT_CONTRACT, address(this));
    }

    /// @notice Internal function to check if a payout address is a valid address
    /// @param payoutReceiver The payout address to check
    /// @return bool Indication of if the payout address is not the zero address
    function _checkPayoutReceiver(address payoutReceiver) internal pure returns (bool) {
        return payoutReceiver != address(0);
    }

    /// @notice Internal function to get the drop phase
    /// @param drop The drop in question
    /// @return DropPhase The drop phase enum value
    function _getDropPhase(Drop memory drop) internal view returns (DropPhase) {
        if (drop.payoutReceiver == address(0)) return DropPhase.NOT_CONFIGURED;
        if (drop.supply == 0) return DropPhase.ENDED;
        if (block.timestamp < drop.startTime) return DropPhase.NOT_STARTED;
        if (block.timestamp >= drop.startTime && block.timestamp < drop.startTime + drop.presaleDuration) {
            return DropPhase.PRESALE;
        }
        if (
            block.timestamp >= drop.startTime + drop.presaleDuration
                && block.timestamp < drop.startTime + drop.presaleDuration + drop.publicDuration
        ) return DropPhase.PUBLIC_SALE;
        return DropPhase.ENDED;
    }

    /// @notice Internal function to determine how many tokens can be minted by an address
    /// @param allowance The amount allowed to mint
    /// @param numberMinted The amount already minted
    /// @param supply The drop supply
    /// @return numberCanMint The number of tokens allowed to mint
    function _getNumberCanMint(uint256 allowance, uint256 numberMinted, uint256 supply)
        internal
        pure
        returns (uint256 numberCanMint)
    {
        if (numberMinted < allowance) {
            numberCanMint = allowance - numberMinted;
            if (numberCanMint > supply) {
                numberCanMint = supply;
            }
        } else {
            numberCanMint = 0;
        }
    }

    /// @notice Function to update the state of the drop
    /// @param nftAddress The nft contract address
    /// @param tokenId The nft token id
    /// @param round The drop round for number minted
    /// @param recipient The receiver of the nft (msg.sender is the payer but this allows delegation)
    /// @param numberToMint The number of tokens to mint
    /// @param drop The Drop cached in memory
    function _updateDropState(
        address nftAddress,
        uint256 tokenId,
        uint256 round,
        address recipient,
        uint256 numberToMint,
        Drop memory drop
    ) internal {
        // velocity mint
        if (drop.dropType == DropType.VELOCITY) {
            uint256 durationAdjust = drop.decayRate < 0
                ? uint256(-1 * drop.decayRate) * numberToMint
                : uint256(drop.decayRate) * numberToMint;
            if (drop.decayRate < 0) {
                if (durationAdjust > drop.publicDuration) {
                    _drops[nftAddress][tokenId].publicDuration = 0;
                } else {
                    _drops[nftAddress][tokenId].publicDuration -= durationAdjust;
                }
            } else {
                _drops[nftAddress][tokenId].publicDuration += durationAdjust;
            }
        }

        // regular state (applicable to all types of drops)
        _drops[nftAddress][tokenId].supply -= numberToMint;
        _numberMinted[nftAddress][tokenId][round][recipient] += numberToMint;
    }

    /// @notice Internal function to distribute funds for a _purchase
    /// @param numberToMint The number of tokens that can be minted
    /// @param cost The cost per token
    /// @param drop The drop
    /// @return refundAmount The amount of eth refunded to msg.sender
    function _settleUp(uint256 numberToMint, uint256 cost, Drop memory drop) internal returns (uint256 refundAmount) {
        uint256 totalProtocolFee = numberToMint * protocolFee;
        uint256 totalSale = numberToMint * cost;
        if (drop.currencyAddress == address(0)) {
            uint256 totalCost = totalSale + totalProtocolFee;
            if (msg.value < totalCost) revert InsufficientFunds();
            _safeTransferETH(drop.payoutReceiver, totalSale, weth);
            refundAmount = msg.value - totalCost;
        } else {
            if (msg.value < totalProtocolFee) revert InsufficientFunds();
            _safeTransferFromERC20(msg.sender, drop.payoutReceiver, drop.currencyAddress, totalSale);
            refundAmount = msg.value - totalProtocolFee;
        }
        _safeTransferETH(protocolFeeReceiver, totalProtocolFee, weth);
        if (refundAmount > 0) {
            _safeTransferETH(msg.sender, refundAmount, weth);
        }
        return refundAmount;
    }

    /// @notice Internal function to mint the token
    /// @param nftAddress The nft contract address
    /// @param tokenId The nft token id
    /// @param recipient The receiver of the nft (msg.sender is the payer but this allows delegation)
    /// @param numberToMint The number of tokens to mint
    function _mintToken(address nftAddress, uint256 tokenId, address recipient, uint256 numberToMint) internal {
        address[] memory recipients = new address[](1);
        recipients[0] = recipient;
        uint256[] memory amounts = new uint256[](1);
        amounts[0] = numberToMint;
        IERC1155TL(nftAddress).externalMint(tokenId, recipients, amounts);
    }
}

File 2 of 19 : 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 19 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)

pragma solidity ^0.8.20;

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

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

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

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

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

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

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

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

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

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

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

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

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

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

File 4 of 19 : 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 5 of 19 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.20;

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The tree and the proofs can be generated using our
 * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
 * You will find a quickstart guide in the readme.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the Merkle tree could be reinterpreted as a leaf value.
 * OpenZeppelin's JavaScript library generates Merkle trees that are safe
 * against this attack out of the box.
 */
library MerkleProof {
    /**
     *@dev The multiproof provided is not valid.
     */
    error MerkleProofInvalidMultiproof();

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

    /**
     * @dev Calldata version of {verify}
     */
    function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
        return processProofCalldata(proof, leaf) == root;
    }

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

    /**
     * @dev Calldata version of {processProof}
     */
    function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
     */
    function multiProofVerify(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProof(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Calldata version of {multiProofVerify}
     *
     * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
     */
    function multiProofVerifyCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProofCalldata(proof, proofFlags, leaves) == root;
    }

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

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

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

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

    /**
     * @dev Calldata version of {processMultiProof}.
     *
     * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
     */
    function processMultiProofCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the Merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 proofLen = proof.length;
        uint256 totalHashes = proofFlags.length;

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

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

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

    /**
     * @dev Sorts the pair (a, b) and hashes the result.
     */
    function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
        return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
    }

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

File 6 of 19 : IERC1155TL.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.22;

/// @title IERC1155TL.sol
/// @notice Interface for ERC1155TL
/// @dev Interface id = 0x452d5a4a
/// @author transientlabs.xyz
/// @custom:version 3.0.0
interface IERC1155TL {
    /*//////////////////////////////////////////////////////////////////////////
                                    Types
    //////////////////////////////////////////////////////////////////////////*/

    /// @dev Struct defining a token
    struct Token {
        bool created;
        string uri;
    }

    /*//////////////////////////////////////////////////////////////////////////
                                    Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice Function to get token creation details
    /// @param tokenId The token to lookup
    function getTokenDetails(uint256 tokenId) external view returns (Token memory);

    /// @notice Function to create a token that can be minted to creator or airdropped
    /// @dev Requires owner or admin
    /// @param newUri The uri for the token to create
    /// @param addresses The addresses to mint the new token to
    /// @param amounts The amount of the new token to mint to each address
    function createToken(string calldata newUri, address[] calldata addresses, uint256[] calldata amounts) external;

    /// @notice Function to create a token that can be minted to creator or airdropped
    /// @dev Overloaded function where you can set the token royalty config in this tx
    /// @dev Requires owner or admin
    /// @param newUri The uri for the token to create
    /// @param addresses The addresses to mint the new token to
    /// @param amounts The amount of the new token to mint to each address
    /// @param royaltyAddress Royalty payout address for the created token
    /// @param royaltyPercent Royalty percentage for this token
    function createToken(
        string calldata newUri,
        address[] calldata addresses,
        uint256[] calldata amounts,
        address royaltyAddress,
        uint256 royaltyPercent
    ) external;

    /// @notice function to batch create tokens that can be minted to creator or airdropped
    /// @dev requires owner or admin
    /// @param newUris the uris for the tokens to create
    /// @param addresses 2d dynamic array holding the addresses to mint the new tokens to
    /// @param amounts 2d dynamic array holding the amounts of the new tokens to mint to each address
    function batchCreateToken(string[] calldata newUris, address[][] calldata addresses, uint256[][] calldata amounts)
        external;

    /// @notice Function to batch create tokens that can be minted to creator or airdropped
    /// @dev Overloaded function where you can set the token royalty config in this tx
    /// @dev Requires owner or admin
    /// @param newUris Rhe uris for the tokens to create
    /// @param addresses 2d dynamic array holding the addresses to mint the new tokens to
    /// @param amounts 2d dynamic array holding the amounts of the new tokens to mint to each address
    /// @param royaltyAddresses Royalty payout addresses for the tokens
    /// @param royaltyPercents Royalty payout percents for the tokens
    function batchCreateToken(
        string[] calldata newUris,
        address[][] calldata addresses,
        uint256[][] calldata amounts,
        address[] calldata royaltyAddresses,
        uint256[] calldata royaltyPercents
    ) external;

    /// @notice Function to mint existing token to recipients
    /// @dev Requires owner or admin
    /// @param tokenId The token to mint
    /// @param addresses The addresses to mint to
    /// @param amounts Amounts of the token to mint to each address
    function mintToken(uint256 tokenId, address[] calldata addresses, uint256[] calldata amounts) external;

    /// @notice External mint function
    /// @dev Requires caller to be an approved mint contract
    /// @param tokenId The token to mint
    /// @param addresses The addresses to mint to
    /// @param amounts Amounts of the token to mint to each address
    function externalMint(uint256 tokenId, address[] calldata addresses, uint256[] calldata amounts) external;

    /// @notice Function to burn tokens from an account
    /// @dev Msg.sender must be token owner or operator
    /// @dev If this function is called from another contract as part of a burn/redeem, the contract must ensure that no amount is '0' or if it is, that it isn't a vulnerability.
    /// @param from Address to burn from
    /// @param tokenIds Array of tokens to burn
    /// @param amounts Amount of each token to burn
    function burn(address from, uint256[] calldata tokenIds, uint256[] calldata amounts) external;

    /// @notice Function to set a token uri
    /// @dev Requires owner or admin
    /// @param tokenId The token to mint
    /// @param newUri The new token uri
    function setTokenUri(uint256 tokenId, string calldata newUri) external;
}

File 7 of 19 : TransferHelper.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {SafeERC20} from "openzeppelin/token/ERC20/utils/SafeERC20.sol";
import {IWETH, IERC20} from "./IWETH.sol";

/// @title Transfer Helper
/// @notice Abstract contract that has helper function for sending ETH and ERC20's safely
/// @author transientlabs.xyz
/// @custom:version 3.0.0
abstract contract TransferHelper {
    /*//////////////////////////////////////////////////////////////////////////
                                    Types
    //////////////////////////////////////////////////////////////////////////*/

    using SafeERC20 for IERC20;
    using SafeERC20 for IWETH;

    /*//////////////////////////////////////////////////////////////////////////
                                    Errors
    //////////////////////////////////////////////////////////////////////////*/

    /// @dev ETH transfer failed
    error ETHTransferFailed();

    /// @dev Transferred too few ERC-20 tokens
    error InsufficentERC20Transfer();

    /*//////////////////////////////////////////////////////////////////////////
                                   ETH Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice Function to force transfer ETH, defaulting to forwarding 100k gas
    /// @dev On failure to send the ETH, the ETH is converted to WETH and sent
    /// @dev Care should be taken to always pass the proper WETH address that adheres to IWETH
    /// @param recipient The recipient of the ETH
    /// @param amount The amount of ETH to send
    /// @param weth The WETH token address
    function _safeTransferETH(address recipient, uint256 amount, address weth) internal {
        _safeTransferETH(recipient, amount, weth, 1e5);
    }

    /// @notice Function to force transfer ETH, with a gas limit
    /// @dev On failure to send the ETH, the ETH is converted to WETH and sent
    /// @dev Care should be taken to always pass the proper WETH address that adheres to IWETH
    /// @dev If the `amount` is zero, the function returns in order to save gas
    /// @param recipient The recipient of the ETH
    /// @param amount The amount of ETH to send
    /// @param weth The WETH token address
    /// @param gasLimit The gas to forward
    function _safeTransferETH(address recipient, uint256 amount, address weth, uint256 gasLimit) internal {
        if (amount == 0) return;
        (bool success,) = recipient.call{value: amount, gas: gasLimit}("");
        if (!success) {
            IWETH token = IWETH(weth);
            token.deposit{value: amount}();
            token.safeTransfer(recipient, amount);
        }
    }

    /*//////////////////////////////////////////////////////////////////////////
                                  ERC-20 Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice Function to safely transfer ERC-20 tokens from the contract, without checking for token tax
    /// @dev Does not check if the sender has enough balance as that is handled by the token contract
    /// @dev Does not check for token tax as that could lock up funds in the contract
    /// @dev Reverts on failure to transfer
    /// @dev If the `amount` is zero, the function returns in order to save gas
    /// @param recipient The recipient of the ERC-20 token
    /// @param currency The address of the ERC-20 token
    /// @param amount The amount of ERC-20 to send
    function _safeTransferERC20(address recipient, address currency, uint256 amount) internal {
        if (amount == 0) return;
        IERC20(currency).safeTransfer(recipient, amount);
    }

    /// @notice Function to safely transfer ERC-20 tokens from another address to a recipient
    /// @dev Does not check if the sender has enough balance or allowance for this contract as that is handled by the token contract
    /// @dev Reverts on failure to transfer
    /// @dev Reverts if there is a token tax taken out
    /// @dev Returns and doesn't do anything if the sender and recipient are the same address
    /// @dev If the `amount` is zero, the function returns in order to save gas
    /// @param sender The sender of the tokens
    /// @param recipient The recipient of the ERC-20 token
    /// @param currency The address of the ERC-20 token
    /// @param amount The amount of ERC-20 to send
    function _safeTransferFromERC20(address sender, address recipient, address currency, uint256 amount) internal {
        if (amount == 0) return;
        if (sender == recipient) return;
        IERC20 token = IERC20(currency);
        uint256 intialBalance = token.balanceOf(recipient);
        token.safeTransferFrom(sender, recipient, amount);
        uint256 finalBalance = token.balanceOf(recipient);
        if (finalBalance - intialBalance < amount) revert InsufficentERC20Transfer();
    }
}

File 8 of 19 : SanctionsCompliance.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

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

/// @title Sanctions Compliance
/// @notice Abstract contract to comply with U.S. sanctioned addresses
/// @dev Uses the Chainalysis Sanctions Oracle for checking sanctions
/// @author transientlabs.xyz
/// @custom:version 3.0.0
contract SanctionsCompliance {
    /*//////////////////////////////////////////////////////////////////////////
                                State Variables
    //////////////////////////////////////////////////////////////////////////*/

    IChainalysisSanctionsOracle public oracle;

    /*//////////////////////////////////////////////////////////////////////////
                                    Errors
    //////////////////////////////////////////////////////////////////////////*/

    /// @dev Sanctioned address by OFAC
    error SanctionedAddress();

    /*//////////////////////////////////////////////////////////////////////////
                                    Events
    //////////////////////////////////////////////////////////////////////////*/

    event SanctionsOracleUpdated(address indexed prevOracle, address indexed newOracle);

    /*//////////////////////////////////////////////////////////////////////////
                                    Constructor
    //////////////////////////////////////////////////////////////////////////*/

    constructor(address initOracle) {
        _updateSanctionsOracle(initOracle);
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Internal Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice Internal function to change the sanctions oracle
    /// @param newOracle The new sanctions oracle address
    function _updateSanctionsOracle(address newOracle) internal {
        address prevOracle = address(oracle);
        oracle = IChainalysisSanctionsOracle(newOracle);

        emit SanctionsOracleUpdated(prevOracle, newOracle);
    }

    /// @notice Internal function to check the sanctions oracle for an address
    /// @dev Disable sanction checking by setting the oracle to the zero address
    /// @param sender The address that is trying to send money
    /// @param shouldRevertIfSanctioned A flag indicating if the call should revert if the sender is sanctioned. Set to false if wanting to get a result.
    /// @return isSanctioned Boolean indicating if the sender is sanctioned
    function _isSanctioned(address sender, bool shouldRevertIfSanctioned) internal view returns (bool isSanctioned) {
        if (address(oracle) == address(0)) {
            return false;
        }
        isSanctioned = oracle.isSanctioned(sender);
        if (shouldRevertIfSanctioned && isSanctioned) revert SanctionedAddress();
        return isSanctioned;
    }
}

File 9 of 19 : OwnableAccessControl.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {Ownable} from "openzeppelin/access/Ownable.sol";
import {EnumerableSet} from "openzeppelin/utils/structs/EnumerableSet.sol";

/// @title OwnableAccessControl.sol
/// @notice Single owner, flexible access control mechanics
/// @dev Can easily be extended by inheriting and applying additional roles
/// @dev By default, only the owner can grant roles but by inheriting, but you
///      may allow other roles to grant roles by using the internal helper.
/// @author transientlabs.xyz
/// @custom:version 3.0.0
abstract contract OwnableAccessControl is Ownable {
    /*//////////////////////////////////////////////////////////////////////////
                                State Variables
    //////////////////////////////////////////////////////////////////////////*/

    using EnumerableSet for EnumerableSet.AddressSet;

    uint256 private _c; // counter to be able to revoke all priviledges
    mapping(uint256 => mapping(bytes32 => mapping(address => bool))) private _roleStatus;
    mapping(uint256 => mapping(bytes32 => EnumerableSet.AddressSet)) private _roleMembers;

    /*//////////////////////////////////////////////////////////////////////////
                                    Events
    //////////////////////////////////////////////////////////////////////////*/

    /// @param from Address that authorized the role change
    /// @param user The address who's role has been changed
    /// @param approved Boolean indicating the user's status in role
    /// @param role The bytes32 role created in the inheriting contract
    event RoleChange(address indexed from, address indexed user, bool indexed approved, bytes32 role);

    /// @param from Address that authorized the revoke
    event AllRolesRevoked(address indexed from);

    /*//////////////////////////////////////////////////////////////////////////
                                    Errors
    //////////////////////////////////////////////////////////////////////////*/

    /// @dev Does not have specified role
    error NotSpecifiedRole(bytes32 role);

    /// @dev Is not specified role or owner
    error NotRoleOrOwner(bytes32 role);

    /*//////////////////////////////////////////////////////////////////////////
                                    Modifiers
    //////////////////////////////////////////////////////////////////////////*/

    modifier onlyRole(bytes32 role) {
        if (!hasRole(role, msg.sender)) {
            revert NotSpecifiedRole(role);
        }
        _;
    }

    modifier onlyRoleOrOwner(bytes32 role) {
        if (!hasRole(role, msg.sender) && owner() != msg.sender) {
            revert NotRoleOrOwner(role);
        }
        _;
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Constructor
    //////////////////////////////////////////////////////////////////////////*/

    constructor() Ownable(msg.sender) {}

    /*//////////////////////////////////////////////////////////////////////////
                            External Role Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice Function to revoke all roles currently present
    /// @dev Increments the `_c` variables
    /// @dev Requires owner privileges
    function revokeAllRoles() external onlyOwner {
        _c++;
        emit AllRolesRevoked(msg.sender);
    }

    /// @notice Function to renounce role
    /// @param role Bytes32 role created in inheriting contracts
    function renounceRole(bytes32 role) external {
        address[] memory members = new address[](1);
        members[0] = msg.sender;
        _setRole(role, members, false);
    }

    /// @notice Function to grant/revoke a role to an address
    /// @dev Requires owner to call this function but this may be further
    ///      extended using the internal helper function in inheriting contracts
    /// @param role Bytes32 role created in inheriting contracts
    /// @param roleMembers List of addresses that should have roles attached to them based on `status`
    /// @param status Bool whether to remove or add `roleMembers` to the `role`
    function setRole(bytes32 role, address[] memory roleMembers, bool status) external onlyOwner {
        _setRole(role, roleMembers, status);
    }

    /*//////////////////////////////////////////////////////////////////////////
                                External View Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice Function to see if an address is the owner
    /// @param role Bytes32 role created in inheriting contracts
    /// @param potentialRoleMember Address to check for role membership
    function hasRole(bytes32 role, address potentialRoleMember) public view returns (bool) {
        return _roleStatus[_c][role][potentialRoleMember];
    }

    /// @notice Function to get role members
    /// @param role Bytes32 role created in inheriting contracts
    function getRoleMembers(bytes32 role) public view returns (address[] memory) {
        return _roleMembers[_c][role].values();
    }

    /*//////////////////////////////////////////////////////////////////////////
                                Internal Helper Functions
    //////////////////////////////////////////////////////////////////////////*/

    /// @notice Helper function to set addresses for a role
    /// @param role Bytes32 role created in inheriting contracts
    /// @param roleMembers List of addresses that should have roles attached to them based on `status`
    /// @param status Bool whether to remove or add `roleMembers` to the `role`
    function _setRole(bytes32 role, address[] memory roleMembers, bool status) internal {
        for (uint256 i = 0; i < roleMembers.length; i++) {
            _roleStatus[_c][role][roleMembers[i]] = status;
            if (status) {
                _roleMembers[_c][role].add(roleMembers[i]);
            } else {
                _roleMembers[_c][role].remove(roleMembers[i]);
            }
            emit RoleChange(msg.sender, roleMembers[i], status, role);
        }
    }
}

File 10 of 19 : CommonUtils.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.22;

/// @dev Enum to encapsulate drop phases
enum DropPhase {
    NOT_CONFIGURED,
    NOT_STARTED,
    PRESALE,
    PUBLIC_SALE,
    ENDED
}

/// @dev Enum to encapsulate drop types
enum DropType {
    NOT_CONFIGURED,
    REGULAR,
    VELOCITY
}

/// @dev Errors for Drops
interface DropErrors {
    error NotDropAdmin();
    error NotApprovedMintContract();
    error InvalidPayoutReceiver();
    error InvalidDropSupply();
    error DropAlreadyConfigured();
    error DropUpdateNotAllowed();
    error InvalidDropType();
    error NotAllowedForVelocityDrops();
    error MintZeroTokens();
    error NotOnAllowlist();
    error YouShallNotMint();
    error AlreadyReachedMintAllowance();
    error InvalidBatchArguments();
    error InsufficientFunds();
}

/// @dev Errors for the Auction House
interface AuctionHouseErrors {
    error PercentageTooLarge();
    error CallerNotTokenOwner();
    error AuctionHouseNotApproved();
    error PayoutToZeroAddress();
    error NftNotOwnedBySeller();
    error NftNotTransferred();
    error AuctionNotConfigured();
    error AuctionNotStarted();
    error AuctionStarted();
    error AuctionNotOpen();
    error BidTooLow();
    error AuctionEnded();
    error AuctionNotEnded();
    error InsufficientMsgValue();
    error SaleNotConfigured();
    error SaleNotOpen();
}

File 11 of 19 : TLStacks1155Utils.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.22;

import {DropType} from "./CommonUtils.sol";

/// @dev stacks drop struct
/// @param initialSupply The initial supply of the drop
/// @param supply The current supply left in the drop
/// @param allowance The allowance to mint per wallet during public mint
/// @param currencyAddress The currency address
/// @param payoutReceiver The address that receives the payout of the mint
/// @param startTime The time at which the drop opens
/// @param presaleDuration The duration for the presale phase of the drop
/// @param presaleCost The cost for each token in the presale phase
/// @param presaleMerkleRoot The merkle root for the presale phase of the drop
/// @param publicDuration The duration of the public sale phase
/// @param publicCost The cost of each token during the public sale phase
struct Drop {
    DropType dropType;
    address payoutReceiver;
    uint256 initialSupply;
    uint256 supply;
    uint256 allowance;
    address currencyAddress;
    uint256 startTime;
    uint256 presaleDuration;
    uint256 presaleCost;
    bytes32 presaleMerkleRoot;
    uint256 publicDuration;
    uint256 publicCost;
    int256 decayRate;
}

interface ITLStacks1155Events {
    event WethUpdated(address indexed prevWeth, address indexed newWeth);
    event ProtocolFeeUpdated(address indexed newProtocolFeeReceiver, uint256 indexed newProtocolFee);

    event DropConfigured(address indexed nftAddress, uint256 indexed tokenId, Drop drop);
    event DropUpdated(address indexed nftAddress, uint256 indexed tokenId, Drop drop);
    event DropClosed(address indexed nftAddress, uint256 indexed tokenId);

    event Purchase(
        address indexed nftAddress,
        uint256 indexed tokenId,
        address nftReceiver,
        address currencyAddress,
        uint256 amount,
        uint256 price,
        int256 decayRate,
        bool isPresale
    );
}

File 12 of 19 : 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 13 of 19 : 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 14 of 19 : IWETH.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

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

interface IWETH is IERC20 {
    function deposit() external payable;
}

File 15 of 19 : IChainalysisSanctionsOracle.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

interface IChainalysisSanctionsOracle {
    function isSanctioned(address addr) external view returns (bool);
}

File 16 of 19 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.20;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```solidity
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position is the index of the value in the `values` array plus 1.
        // Position 0 is used to mean a value is not in the set.
        mapping(bytes32 value => uint256) _positions;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._positions[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We cache the value's position to prevent multiple reads from the same storage slot
        uint256 position = set._positions[value];

        if (position != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 valueIndex = position - 1;
            uint256 lastIndex = set._values.length - 1;

            if (valueIndex != lastIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the lastValue to the index where the value to delete is
                set._values[valueIndex] = lastValue;
                // Update the tracked position of the lastValue (that was just moved)
                set._positions[lastValue] = position;
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the tracked position for the deleted slot
            delete set._positions[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._positions[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 17 of 19 : 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 18 of 19 : 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 19 of 19 : 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": [
    "@manifoldxyz/libraries-solidity/=lib/tl-creator-contracts/lib/tl-sol-tools/lib/royalty-registry-solidity/lib/libraries-solidity/",
    "@openzeppelin/contracts-upgradeable/=lib/tl-creator-contracts/lib/tl-sol-tools/lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/tl-creator-contracts/lib/tl-sol-tools/lib/openzeppelin-contracts/contracts/",
    "create2-helpers/=lib/tl-creator-contracts/lib/tl-sol-tools/lib/royalty-registry-solidity/lib/create2-helpers/",
    "create2-scripts/=lib/tl-creator-contracts/lib/tl-sol-tools/lib/royalty-registry-solidity/lib/create2-helpers/script/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/tl-creator-contracts/lib/tl-sol-tools/lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "libraries-solidity/=lib/tl-creator-contracts/lib/tl-sol-tools/lib/royalty-registry-solidity/lib/libraries-solidity/contracts/",
    "murky/=lib/murky/src/",
    "openzeppelin-contracts-upgradeable/=lib/tl-creator-contracts/lib/tl-sol-tools/lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/murky/lib/openzeppelin-contracts/",
    "openzeppelin-upgradeable/=lib/tl-creator-contracts/lib/tl-sol-tools/lib/openzeppelin-contracts-upgradeable/contracts/",
    "openzeppelin/=lib/tl-creator-contracts/lib/tl-sol-tools/lib/openzeppelin-contracts/contracts/",
    "royalty-registry-solidity/=lib/tl-creator-contracts/lib/tl-sol-tools/lib/royalty-registry-solidity/contracts/",
    "tl-creator-contracts/=lib/tl-creator-contracts/src/",
    "tl-sol-tools/=lib/tl-creator-contracts/lib/tl-sol-tools/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 20000
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"initOwner","type":"address"},{"internalType":"address","name":"initSanctionsOracle","type":"address"},{"internalType":"address","name":"initWethAddress","type":"address"},{"internalType":"address","name":"initProtocolFeeReceiver","type":"address"},{"internalType":"uint256","name":"initProtocolFee","type":"uint256"}],"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":"AlreadyReachedMintAllowance","type":"error"},{"inputs":[],"name":"DropAlreadyConfigured","type":"error"},{"inputs":[],"name":"DropUpdateNotAllowed","type":"error"},{"inputs":[],"name":"ETHTransferFailed","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InsufficentERC20Transfer","type":"error"},{"inputs":[],"name":"InsufficientFunds","type":"error"},{"inputs":[],"name":"InvalidBatchArguments","type":"error"},{"inputs":[],"name":"InvalidDropSupply","type":"error"},{"inputs":[],"name":"InvalidDropType","type":"error"},{"inputs":[],"name":"InvalidPayoutReceiver","type":"error"},{"inputs":[],"name":"MintZeroTokens","type":"error"},{"inputs":[],"name":"NotAllowedForVelocityDrops","type":"error"},{"inputs":[],"name":"NotApprovedMintContract","type":"error"},{"inputs":[],"name":"NotDropAdmin","type":"error"},{"inputs":[],"name":"NotOnAllowlist","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"},{"inputs":[],"name":"SanctionedAddress","type":"error"},{"inputs":[],"name":"YouShallNotMint","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"DropClosed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"enum DropType","name":"dropType","type":"uint8"},{"internalType":"address","name":"payoutReceiver","type":"address"},{"internalType":"uint256","name":"initialSupply","type":"uint256"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"address","name":"currencyAddress","type":"address"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"presaleDuration","type":"uint256"},{"internalType":"uint256","name":"presaleCost","type":"uint256"},{"internalType":"bytes32","name":"presaleMerkleRoot","type":"bytes32"},{"internalType":"uint256","name":"publicDuration","type":"uint256"},{"internalType":"uint256","name":"publicCost","type":"uint256"},{"internalType":"int256","name":"decayRate","type":"int256"}],"indexed":false,"internalType":"struct Drop","name":"drop","type":"tuple"}],"name":"DropConfigured","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"enum DropType","name":"dropType","type":"uint8"},{"internalType":"address","name":"payoutReceiver","type":"address"},{"internalType":"uint256","name":"initialSupply","type":"uint256"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"address","name":"currencyAddress","type":"address"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"presaleDuration","type":"uint256"},{"internalType":"uint256","name":"presaleCost","type":"uint256"},{"internalType":"bytes32","name":"presaleMerkleRoot","type":"bytes32"},{"internalType":"uint256","name":"publicDuration","type":"uint256"},{"internalType":"uint256","name":"publicCost","type":"uint256"},{"internalType":"int256","name":"decayRate","type":"int256"}],"indexed":false,"internalType":"struct Drop","name":"drop","type":"tuple"}],"name":"DropUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newProtocolFeeReceiver","type":"address"},{"indexed":true,"internalType":"uint256","name":"newProtocolFee","type":"uint256"}],"name":"ProtocolFeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"nftReceiver","type":"address"},{"indexed":false,"internalType":"address","name":"currencyAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"int256","name":"decayRate","type":"int256"},{"indexed":false,"internalType":"bool","name":"isPresale","type":"bool"}],"name":"Purchase","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prevOracle","type":"address"},{"indexed":true,"internalType":"address","name":"newOracle","type":"address"}],"name":"SanctionsOracleUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prevWeth","type":"address"},{"indexed":true,"internalType":"address","name":"newWeth","type":"address"}],"name":"WethUpdated","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"APPROVED_MINT_CONTRACT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"closeDrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nftAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"enum DropType","name":"dropType","type":"uint8"},{"internalType":"address","name":"payoutReceiver","type":"address"},{"internalType":"uint256","name":"initialSupply","type":"uint256"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"address","name":"currencyAddress","type":"address"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"presaleDuration","type":"uint256"},{"internalType":"uint256","name":"presaleCost","type":"uint256"},{"internalType":"bytes32","name":"presaleMerkleRoot","type":"bytes32"},{"internalType":"uint256","name":"publicDuration","type":"uint256"},{"internalType":"uint256","name":"publicCost","type":"uint256"},{"internalType":"int256","name":"decayRate","type":"int256"}],"internalType":"struct Drop","name":"drop","type":"tuple"}],"name":"configureDrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nftAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getDrop","outputs":[{"components":[{"internalType":"enum DropType","name":"dropType","type":"uint8"},{"internalType":"address","name":"payoutReceiver","type":"address"},{"internalType":"uint256","name":"initialSupply","type":"uint256"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"address","name":"currencyAddress","type":"address"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"presaleDuration","type":"uint256"},{"internalType":"uint256","name":"presaleCost","type":"uint256"},{"internalType":"bytes32","name":"presaleMerkleRoot","type":"bytes32"},{"internalType":"uint256","name":"publicDuration","type":"uint256"},{"internalType":"uint256","name":"publicCost","type":"uint256"},{"internalType":"int256","name":"decayRate","type":"int256"}],"internalType":"struct Drop","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getDropPhase","outputs":[{"internalType":"enum DropPhase","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getDropRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftAddress","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"getDrops","outputs":[{"components":[{"internalType":"enum DropType","name":"dropType","type":"uint8"},{"internalType":"address","name":"payoutReceiver","type":"address"},{"internalType":"uint256","name":"initialSupply","type":"uint256"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"address","name":"currencyAddress","type":"address"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"presaleDuration","type":"uint256"},{"internalType":"uint256","name":"presaleCost","type":"uint256"},{"internalType":"bytes32","name":"presaleMerkleRoot","type":"bytes32"},{"internalType":"uint256","name":"publicDuration","type":"uint256"},{"internalType":"uint256","name":"publicCost","type":"uint256"},{"internalType":"int256","name":"decayRate","type":"int256"}],"internalType":"struct Drop[]","name":"drops","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"getNumberMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracle","outputs":[{"internalType":"contract IChainalysisSanctionsOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFeeReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"numberToMint","type":"uint256"},{"internalType":"uint256","name":"presaleNumberCanMint","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"purchase","outputs":[{"internalType":"uint256","name":"refundAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newProtocolFeeReceiver","type":"address"},{"internalType":"uint256","name":"newProtocolFee","type":"uint256"}],"name":"setProtocolFeeSettings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOracle","type":"address"}],"name":"setSanctionsOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newWethAddress","type":"address"}],"name":"setWethAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nftAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"allowance","type":"uint256"}],"name":"updateDropAllowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nftAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"int256","name":"decayRate","type":"int256"}],"name":"updateDropDecayRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nftAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"presaleDuration","type":"uint256"},{"internalType":"uint256","name":"publicDuration","type":"uint256"}],"name":"updateDropDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nftAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"payoutReceiver","type":"address"}],"name":"updateDropPayoutReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nftAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes32","name":"presaleMerkleRoot","type":"bytes32"}],"name":"updateDropPresaleMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nftAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"currencyAddress","type":"address"},{"internalType":"uint256","name":"presaleCost","type":"uint256"},{"internalType":"uint256","name":"publicCost","type":"uint256"}],"name":"updateDropPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b50604051620041b9380380620041b9833981016040819052620000349162000214565b83856001600160a01b0381166200006557604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200007081620000b0565b506000805460ff60a01b19169055600180556200008d8162000100565b50620000998362000152565b620000a58282620001a4565b50505050506200027b565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f9dc7a30661b0eef899195a36c42f80a98cafd90e68cd8a50af361f2b04916dbf90600090a35050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907fdfc4c08fb23afd3ed9497c154a48cb9a7eb5e5ef2307e641ec9faef507d4e38a90600090a35050565b600380546001600160a01b0319166001600160a01b03841690811790915560048290556040518291907f389f6e01d911ce2a6919bdcf4e57d270003243ca9c54e7911454a70f89aee19e90600090a35050565b80516001600160a01b03811681146200020f57600080fd5b919050565b600080600080600060a086880312156200022d57600080fd5b6200023886620001f7565b94506200024860208701620001f7565b93506200025860408701620001f7565b92506200026860608701620001f7565b9150608086015190509295509295909350565b613f2e806200028b6000396000f3fe6080604052600436106101c25760003560e01c8063715018a6116100f7578063a96e242311610095578063c1cf6ca311610064578063c1cf6ca31461054d578063e4d86ebf1461057a578063f2fde38b1461059a578063ffa1ad74146105ba57600080fd5b8063a96e2423146104ca578063ab04d723146104ea578063b0e21e8a14610517578063b3edf8101461052d57600080fd5b8063825c7d10116100d1578063825c7d101461044c5780638547b2371461046c5780638da5cb5b1461048c5780639ddd8982146104aa57600080fd5b8063715018a6146103e357806375b238fc146103f85780637dc0d1d01461042c57600080fd5b806339a51be5116101645780635c975abb1161013e5780635c975abb146103485780635d97fda71461038357806360f91a68146103a357806361b34cab146103c357600080fd5b806339a51be5146102dd5780633fc8cef314610315578063452aaf0f1461033557600080fd5b806310572b24116101a057806310572b241461023c5780631ff7f0bc1461025c578063303acbe1146102905780633766daac146102bd57600080fd5b806302329a29146101c75780630484992f146101e95780630c018ebd1461021c575b600080fd5b3480156101d357600080fd5b506101e76101e236600461353f565b610610565b005b3480156101f557600080fd5b50610209610204366004613581565b610631565b6040519081526020015b60405180910390f35b34801561022857600080fd5b506101e76102373660046135ad565b61065c565b34801561024857600080fd5b506101e76102573660046135ff565b6108d2565b34801561026857600080fd5b506102097ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af581565b34801561029c57600080fd5b506102b06102ab36600461368d565b610b71565b60405161021391906137d0565b3480156102c957600080fd5b506102096102d83660046135ff565b610d82565b3480156102e957600080fd5b506003546102fd906001600160a01b031681565b6040516001600160a01b039091168152602001610213565b34801561032157600080fd5b506005546102fd906001600160a01b031681565b61020961034336600461381f565b610dd6565b34801561035457600080fd5b5060005474010000000000000000000000000000000000000000900460ff166040519015158152602001610213565b34801561038f57600080fd5b506101e761039e366004613581565b611275565b3480156103af57600080fd5b506101e76103be3660046138a5565b6113db565b3480156103cf57600080fd5b506101e76103de36600461390f565b611818565b3480156103ef57600080fd5b506101e7611a26565b34801561040457600080fd5b506102097fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177581565b34801561043857600080fd5b506002546102fd906001600160a01b031681565b34801561045857600080fd5b506101e7610467366004613581565b611a3a565b34801561047857600080fd5b506101e761048736600461390f565b611a4c565b34801561049857600080fd5b506000546001600160a01b03166102fd565b3480156104b657600080fd5b506101e76104c5366004613944565b611ca7565b3480156104d657600080fd5b506101e76104e5366004613944565b611cb8565b3480156104f657600080fd5b5061050a610505366004613581565b611cc9565b6040516102139190613961565b34801561052357600080fd5b5061020960045481565b34801561053957600080fd5b506101e7610548366004613970565b611e38565b34801561055957600080fd5b5061056d610568366004613581565b6120bf565b60405161021391906139b4565b34801561058657600080fd5b506101e761059536600461390f565b6121bb565b3480156105a657600080fd5b506101e76105b5366004613944565b612416565b3480156105c657600080fd5b506106036040518060400160405280600581526020017f322e332e3100000000000000000000000000000000000000000000000000000081525081565b60405161021391906139f2565b61061861246f565b8015610629576106266124b5565b50565b610626612541565b6001600160a01b03821660009081526008602090815260408083208484529091529020545b92915050565b610664612598565b61066c6125ed565b61067585612630565b6106ab576040517f97905a9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516600090815260066020908152604080832087845290915280822081516101a081019092528054829060ff1660028111156106f1576106f16136e2565b6002811115610702576107026136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b90910154610180909101529050600061079d82612756565b905060008160048111156107b3576107b36136e2565b14806107d0575060048160048111156107ce576107ce6136e2565b145b15610807576040517f671f983900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0385811660a0840181905261010084018681526101608501868152928a1660008181526006602090815260408083208d8452909152908190206004810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016909517909455915160078401559251600a90920191909155518791907f3af5243656bab825206fa93e23588ca20d21a4154112f1b7baf8f67a1d584a22906108b8908690613961565b60405180910390a350506108cb60018055565b5050505050565b6108da612598565b6108e26125ed565b6108ed816001612828565b506108f783612630565b61092d576040517f97905a9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815260066020908152604080832085845290915280822081516101a081019092528054829060ff166002811115610973576109736136e2565b6002811115610984576109846136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b909101546101809091015290506000610a1f82612756565b90506000816004811115610a3557610a356136e2565b1480610a5257506004816004811115610a5057610a506136e2565b145b15610a89576040517f671f983900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316610ac9576040517fbece2c0200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038381166020848101829052918716600081815260068452604080822089835290945283902080547fffffffffffffffffffffff0000000000000000000000000000000000000000ff166101009093029290921790915590518591907f3af5243656bab825206fa93e23588ca20d21a4154112f1b7baf8f67a1d584a2290610b59908690613961565b60405180910390a35050610b6c60018055565b505050565b60608167ffffffffffffffff811115610b8c57610b8c613a43565b604051908082528060200260200182016040528015610c3e57816020015b610c2b604080516101a08101909152806000815260200160006001600160a01b0316815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001600080191681526020016000815260200160008152602001600081525090565b815260200190600190039081610baa5790505b50905060005b82811015610d7a576001600160a01b038516600090815260066020526040812090858584818110610c7757610c77613a72565b60209081029290920135835250810191909152604090810160002081516101a081019092528054829060ff166002811115610cb457610cb46136e2565b6002811115610cc557610cc56136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b90910154610180909101528251839083908110610d6757610d67613a72565b6020908102919091010152600101610c44565b509392505050565b6001600160a01b0380841660008181526008602090815260408083208784528252808320549383526007825280832087845282528083209383529281528282209385168252929092529020545b9392505050565b6000610de0612598565b610de86125ed565b610df3336001612828565b50610dff866001612828565b506001600160a01b03881660009081526006602090815260408083208a845290915280822081516101a081019092528054829060ff166002811115610e4657610e466136e2565b6002811115610e5757610e576136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b909101546101809091015290506000610ef282612756565b6001600160a01b03808c1660008181526008602090815260408083208f8452825280832054938352600782528083208f845282528083208484528252808320948e16835293905291822054610100860151939450909290918a9190829003610f86576040517fa214551800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002856004811115610f9a57610f9a6136e2565b036110e357604080516001600160a01b038e16602082015260009101604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825280516020918201209083018190529082018d90529150600090606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828252805160209182012090830152016040516020818303038152906040528051906020012090506110958b8b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050506101208a01518361290d565b6110cb576040517f231e418300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110da8c868a60600151612923565b93505050611150565b60038560048111156110f7576110f76136e2565b0361111e5761110f8660800151848860600151612923565b91508561016001519050611150565b6040517fe328674300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8160000361118a576040517f1db1223d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b818b111561119657819a505b6111a48e8e868f8f8b612953565b6111af8b8288612b24565b96506111bd8e8e8e8e612c70565b8c8e6001600160a01b03167feda13398eab6427cfc43332a4123b9180660f1c2041e62beb9906a0018edb78d8e8960a001518f868c61018001516002600481111561120a5761120a6136e2565b8d600481111561121c5761121c6136e2565b604080516001600160a01b03988916815297909616602088015294860193909352606085019190915260808401521460a082015260c00160405180910390a350505050505061126a60018055565b979650505050505050565b61127d6125ed565b61128682612630565b6112bc576040517f97905a9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0382166000818152600660208181526040808420868552825280842080547fffffffffffffffffffffff0000000000000000000000000000000000000000001681556001810185905560028101859055600381018590556004810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556005810185905592830184905560078301849055600880840185905560098401859055600a8401859055600b909301849055938352908152828220848352905290812080549161139383613ad0565b909155505060405181906001600160a01b038416907f859e571ffe149a71f0b6da6c58ab9a4da0dcb5ab7aa85bfa0e75a8e8892b778b90600090a36113d760018055565b5050565b6113e3612598565b6113eb6125ed565b6113f6336001612828565b5061141161140a6040830160208401613944565b6001612828565b5061141b83612630565b611451576040517f97905a9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114726114646040830160208401613944565b6001600160a01b0316151590565b6114a8576040517fbece2c0200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114b183612d85565b6114e7576040517f1632f66900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060600135816040013514611528576040517f7a83811c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101808101351580159061155a575060026115466020830183613b20565b6002811115611557576115576136e2565b14155b15611591576040517fff40f35400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026115a06020830183613b20565b60028111156115b1576115b16136e2565b1480156115c1575060e081013515155b156115f8576040517f264cc88700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815260066020908152604080832085845290915280822081516101a081019092528054829060ff16600281111561163e5761163e6136e2565b600281111561164f5761164f6136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b9091015461018090910152905060006116ea82612756565b9050600082516002811115611701576117016136e2565b141580156117215750600481600481111561171e5761171e6136e2565b14155b15611758576040517ff75f23ae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0385166000908152600660209081526040808320878452909152902083906117878282613b98565b50600090508251600281111561179f5761179f6136e2565b146117de576001600160a01b038516600090815260086020908152604080832087845290915281208054600192906117d8908490613cb4565b90915550505b83856001600160a01b03167f8920dfc9a5a7a92ca2867c2689ce956746542b69def7ae0e3683201b66e02fa085604051610b599190613cc7565b611820612598565b6118286125ed565b61183183612630565b611867576040517f97905a9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815260066020908152604080832085845290915280822081516101a081019092528054829060ff1660028111156118ad576118ad6136e2565b60028111156118be576118be6136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b90910154610180909101529050600061195982612756565b9050600081600481111561196f5761196f6136e2565b148061198c5750600481600481111561198a5761198a6136e2565b145b156119c3576040517f671f983900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b608082018390526001600160a01b038516600081815260066020908152604080832088845290915290819020600301859055518591907f3af5243656bab825206fa93e23588ca20d21a4154112f1b7baf8f67a1d584a2290610b59908690613961565b611a2e61246f565b611a386000612df3565b565b611a4261246f565b6113d78282612e5b565b611a54612598565b611a5c6125ed565b611a6583612630565b611a9b576040517f97905a9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815260066020908152604080832085845290915280822081516101a081019092528054829060ff166002811115611ae157611ae16136e2565b6002811115611af257611af26136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b909101546101809091015290506000611b8d82612756565b90506000816004811115611ba357611ba36136e2565b1480611bc057506004816004811115611bbe57611bbe6136e2565b145b15611bf7576040517f671f983900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600282516002811115611c0c57611c0c6136e2565b14611c43576040517f264cc88700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61018082018390526001600160a01b038516600081815260066020908152604080832088845290915290819020600b01859055518591907f3af5243656bab825206fa93e23588ca20d21a4154112f1b7baf8f67a1d584a2290610b59908690613961565b611caf61246f565b61062681612ec6565b611cc061246f565b61062681612f30565b611d4a604080516101a08101909152806000815260200160006001600160a01b0316815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001600080191681526020016000815260200160008152602001600081525090565b6001600160a01b03831660009081526006602090815260408083208584529091529081902081516101a081019092528054829060ff166002811115611d9157611d916136e2565b6002811115611da257611da26136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b9091015461018090910152905092915050565b611e40612598565b611e486125ed565b611e5185612630565b611e87576040517f97905a9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516600090815260066020908152604080832087845290915280822081516101a081019092528054829060ff166002811115611ecd57611ecd6136e2565b6002811115611ede57611ede6136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b909101546101809091015290506000611f7982612756565b90506000816004811115611f8f57611f8f6136e2565b1480611fac57506004816004811115611faa57611faa6136e2565b145b15611fe3576040517f671f983900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600282516002811115611ff857611ff86136e2565b14801561200457508315155b1561203b576040517f264cc88700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60c0820185905260e0820184815261014083018481526001600160a01b03891660008181526006602081815260408084208d855290915291829020600581018b90559451908501559151600990930192909255518791907f3af5243656bab825206fa93e23588ca20d21a4154112f1b7baf8f67a1d584a22906108b8908690613961565b6001600160a01b038216600090815260066020908152604080832084845290915280822081516101a08101909252805483929190829060ff166002811115612109576121096136e2565b600281111561211a5761211a6136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b909101546101809091015290506121b381612756565b949350505050565b6121c3612598565b6121cb6125ed565b6121d483612630565b61220a576040517f97905a9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815260066020908152604080832085845290915280822081516101a081019092528054829060ff166002811115612250576122506136e2565b6002811115612261576122616136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b9091015461018090910152905060006122fc82612756565b90506000816004811115612312576123126136e2565b148061232f5750600481600481111561232d5761232d6136e2565b145b15612366576040517f671f983900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028251600281111561237b5761237b6136e2565b036123b2576040517f264cc88700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61012082018390526001600160a01b038516600081815260066020908152604080832088845290915290819020600801859055518591907f3af5243656bab825206fa93e23588ca20d21a4154112f1b7baf8f67a1d584a2290610b59908690613961565b61241e61246f565b6001600160a01b038116612466576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024015b60405180910390fd5b61062681612df3565b6000546001600160a01b03163314611a38576040517f118cdaa700000000000000000000000000000000000000000000000000000000815233600482015260240161245d565b6124bd612598565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586125243390565b6040516001600160a01b03909116815260200160405180910390a1565b612549612f9a565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33612524565b60005474010000000000000000000000000000000000000000900460ff1615611a38576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260015403612629576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600155565b6000816001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612670573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126949190613d84565b6001600160a01b0316336001600160a01b0316148061065657506040517f91d148540000000000000000000000000000000000000000000000000000000081527fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177560048201523360248201526001600160a01b038316906391d14854906044015b602060405180830381865afa158015612732573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106569190613da1565b60208101516000906001600160a01b031661277357506000919050565b816060015160000361278757506004919050565b8160c0015142101561279b57506001919050565b8160c0015142101580156127c157508160e001518260c001516127be9190613cb4565b42105b156127ce57506002919050565b8160e001518260c001516127e29190613cb4565b421015801561281357508161014001518260e001518360c001516128069190613cb4565b6128109190613cb4565b42105b1561282057506003919050565b506004919050565b6002546000906001600160a01b031661284357506000610656565b6002546040517fdf592f7d0000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301529091169063df592f7d90602401602060405180830381865afa1580156128a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128ca9190613da1565b90508180156128d65750805b15610656576040517f2e70c0b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008261291a8584612fee565b14949350505050565b600083831015612949576129378385613dbe565b9050818111156129445750805b610dcf565b5060009392505050565b600281516002811115612968576129686136e2565b03612a955760008082610180015112612991578282610180015161298c9190613dd1565b6129cd565b828261018001517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6129c39190613de8565b6129cd9190613dd1565b905060008261018001511215612a5757816101400151811115612a16576001600160a01b0387166000908152600660209081526040808320898452909152812060090155612a93565b6001600160a01b038716600090815260066020908152604080832089845290915281206009018054839290612a4c908490613dbe565b90915550612a939050565b6001600160a01b038716600090815260066020908152604080832089845290915281206009018054839290612a8d908490613cb4565b90915550505b505b6001600160a01b038616600090815260066020908152604080832088845290915281206002018054849290612acb908490613dbe565b90915550506001600160a01b0380871660009081526007602090815260408083208984528252808320888452825280832093871683529290529081208054849290612b17908490613cb4565b9091555050505050505050565b60008060045485612b359190613dd1565b90506000612b438587613dd1565b60a08501519091506001600160a01b0316612bcf576000612b648383613cb4565b905080341015612ba0576040517f356680b700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6020850151600554612bbd919084906001600160a01b0316613029565b612bc78134613dbe565b935050612c2a565b81341015612c09576040517f356680b700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612c1d3385602001518660a0015184613038565b612c278234613dbe565b92505b600354600554612c48916001600160a01b0390811691859116613029565b8215612c6757600554612c6790339085906001600160a01b0316613029565b50509392505050565b604080516001808252818301909252600091602080830190803683370190505090508281600081518110612ca657612ca6613a72565b6001600160a01b0392909216602092830291909101909101526040805160018082528183019092526000918160200160208202803683370190505090508281600081518110612cf757612cf7613a72565b60209081029190910101526040517fd8c3a2740000000000000000000000000000000000000000000000000000000081526001600160a01b0387169063d8c3a27490612d4b90889086908690600401613e34565b600060405180830381600087803b158015612d6557600080fd5b505af1158015612d79573d6000803e3d6000fd5b50505050505050505050565b6040517f91d148540000000000000000000000000000000000000000000000000000000081527ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af560048201523060248201526000906001600160a01b038316906391d1485490604401612715565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03841690811790915560048290556040518291907f389f6e01d911ce2a6919bdcf4e57d270003243ca9c54e7911454a70f89aee19e90600090a35050565b600280546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f9dc7a30661b0eef899195a36c42f80a98cafd90e68cd8a50af361f2b04916dbf90600090a35050565b600580546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907fdfc4c08fb23afd3ed9497c154a48cb9a7eb5e5ef2307e641ec9faef507d4e38a90600090a35050565b60005474010000000000000000000000000000000000000000900460ff16611a38576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600081815b8451811015610d7a5761301f8286838151811061301257613012613a72565b60200260200101516131cd565b9150600101612ff3565b610b6c838383620186a06131f9565b80156131c757826001600160a01b0316846001600160a01b031603156131c7576040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b03848116600483015283916000918316906370a0823190602401602060405180830381865afa1580156130bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130e09190613ec3565b90506130f76001600160a01b0383168787866132d4565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038681166004830152600091908416906370a0823190602401602060405180830381865afa15801561315a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061317e9190613ec3565b90508361318b8383613dbe565b10156131c3576040517f35bfbdb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505b50505050565b60008183106131e9576000828152602084905260409020610dcf565b5060009182526020526040902090565b82156131c7576000846001600160a01b0316848390604051600060405180830381858888f193505050503d806000811461324f576040519150601f19603f3d011682016040523d82523d6000602084013e613254565b606091505b50509050806108cb576000839050806001600160a01b031663d0e30db0866040518263ffffffff1660e01b81526004016000604051808303818588803b15801561329d57600080fd5b505af11580156132b1573d6000803e3d6000fd5b506132cc935050506001600160a01b03831690508787613350565b505050505050565b6040516001600160a01b0384811660248301528381166044830152606482018390526131c79186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613381565b6040516001600160a01b03838116602483015260448201839052610b6c91859182169063a9059cbb90606401613309565b60006133966001600160a01b038416836133fd565b905080516000141580156133bb5750808060200190518101906133b99190613da1565b155b15610b6c576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b038416600482015260240161245d565b6060610dcf8383600084600080856001600160a01b031684866040516134239190613edc565b60006040518083038185875af1925050503d8060008114613460576040519150601f19603f3d011682016040523d82523d6000602084013e613465565b606091505b509150915061347586838361347f565b9695505050505050565b60608261348f57612944826134ef565b81511580156134a657506001600160a01b0384163b155b156134e8576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b038516600482015260240161245d565b5080610dcf565b8051156134ff5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b801515811461062657600080fd5b60006020828403121561355157600080fd5b8135610dcf81613531565b6001600160a01b038116811461062657600080fd5b803561357c8161355c565b919050565b6000806040838503121561359457600080fd5b823561359f8161355c565b946020939093013593505050565b600080600080600060a086880312156135c557600080fd5b85356135d08161355c565b94506020860135935060408601356135e78161355c565b94979396509394606081013594506080013592915050565b60008060006060848603121561361457600080fd5b833561361f8161355c565b92506020840135915060408401356136368161355c565b809150509250925092565b60008083601f84011261365357600080fd5b50813567ffffffffffffffff81111561366b57600080fd5b6020830191508360208260051b850101111561368657600080fd5b9250929050565b6000806000604084860312156136a257600080fd5b83356136ad8161355c565b9250602084013567ffffffffffffffff8111156136c957600080fd5b6136d586828701613641565b9497909650939450505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60038110613721576137216136e2565b9052565b613730828251613711565b602081015161374a60208401826001600160a01b03169052565b5060408101516040830152606081015160608301526080810151608083015260a081015161378360a08401826001600160a01b03169052565b5060c0818101519083015260e08082015190830152610100808201519083015261012080820151908301526101408082015190830152610160808201519083015261018090810151910152565b6020808252825182820181905260009190848201906040850190845b81811015613813576137ff838551613725565b928401926101a092909201916001016137ec565b50909695505050505050565b600080600080600080600060c0888a03121561383a57600080fd5b87356138458161355c565b965060208801359550604088013561385c8161355c565b9450606088013593506080880135925060a088013567ffffffffffffffff81111561388657600080fd5b6138928a828b01613641565b989b979a50959850939692959293505050565b60008060008385036101e08112156138bc57600080fd5b84356138c78161355c565b9350602085013592506101a07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08201121561390157600080fd5b506040840190509250925092565b60008060006060848603121561392457600080fd5b833561392f8161355c565b95602085013595506040909401359392505050565b60006020828403121561395657600080fd5b8135610dcf8161355c565b6101a081016106568284613725565b600080600080600060a0868803121561398857600080fd5b85356139938161355c565b97602087013597506040870135966060810135965060800135945092505050565b60208101600583106139c8576139c86136e2565b91905290565b60005b838110156139e95781810151838201526020016139d1565b50506000910152565b6020815260008251806020840152613a118160408501602087016139ce565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613b0157613b01613aa1565b5060010190565b6003811061062657600080fd5b803561357c81613b08565b600060208284031215613b3257600080fd5b8135610dcf81613b08565b6000813561065681613b08565b60038210613b5a57613b5a6136e2565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541660ff831681178255505050565b600081356106568161355c565b613baa613ba483613b3d565b82613b4a565b613bff613bb960208401613b8b565b82547fffffffffffffffffffffff0000000000000000000000000000000000000000ff1660089190911b74ffffffffffffffffffffffffffffffffffffffff0016178255565b604082013560018201556060820135600282015560808201356003820155613c65613c2c60a08401613b8b565b600483016001600160a01b0382167fffffffffffffffffffffffff00000000000000000000000000000000000000008254161781555050565b60c0820135600582015560e08201356006820155610100820135600782015561012082013560088201556101408201356009820155610160820135600a820155610180820135600b8201555050565b8082018082111561065657610656613aa1565b6101a08101613cde82613cd985613b15565b613711565b613cea60208401613571565b6001600160a01b038116602084015250604083013560408301526060830135606083015260808301356080830152613d2460a08401613571565b6001600160a01b031660a083015260c0838101359083015260e08084013590830152610100808401359083015261012080840135908301526101408084013590830152610160808401359083015261018092830135929091019190915290565b600060208284031215613d9657600080fd5b8151610dcf8161355c565b600060208284031215613db357600080fd5b8151610dcf81613531565b8181038181111561065657610656613aa1565b808202811582820484141761065657610656613aa1565b808202600082127f800000000000000000000000000000000000000000000000000000000000000084141615613e2057613e20613aa1565b818105831482151761065657610656613aa1565b6000606082018583526020606081850152818651808452608086019150828801935060005b81811015613e7e5784516001600160a01b031683529383019391830191600101613e59565b50508481036040860152855180825290820192508186019060005b81811015613eb557825185529383019391830191600101613e99565b509298975050505050505050565b600060208284031215613ed557600080fd5b5051919050565b60008251613eee8184602087016139ce565b919091019291505056fea26469706673582212207696c73b5d5c252b7dedbc8cbfbaf143adaec71ebaac095943d41ea53b960c7e64736f6c6343000816003300000000000000000000000077b35947d508012589a91ca4c9d168824376cc7d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003328b944c4000

Deployed Bytecode

0x6080604052600436106101c25760003560e01c8063715018a6116100f7578063a96e242311610095578063c1cf6ca311610064578063c1cf6ca31461054d578063e4d86ebf1461057a578063f2fde38b1461059a578063ffa1ad74146105ba57600080fd5b8063a96e2423146104ca578063ab04d723146104ea578063b0e21e8a14610517578063b3edf8101461052d57600080fd5b8063825c7d10116100d1578063825c7d101461044c5780638547b2371461046c5780638da5cb5b1461048c5780639ddd8982146104aa57600080fd5b8063715018a6146103e357806375b238fc146103f85780637dc0d1d01461042c57600080fd5b806339a51be5116101645780635c975abb1161013e5780635c975abb146103485780635d97fda71461038357806360f91a68146103a357806361b34cab146103c357600080fd5b806339a51be5146102dd5780633fc8cef314610315578063452aaf0f1461033557600080fd5b806310572b24116101a057806310572b241461023c5780631ff7f0bc1461025c578063303acbe1146102905780633766daac146102bd57600080fd5b806302329a29146101c75780630484992f146101e95780630c018ebd1461021c575b600080fd5b3480156101d357600080fd5b506101e76101e236600461353f565b610610565b005b3480156101f557600080fd5b50610209610204366004613581565b610631565b6040519081526020015b60405180910390f35b34801561022857600080fd5b506101e76102373660046135ad565b61065c565b34801561024857600080fd5b506101e76102573660046135ff565b6108d2565b34801561026857600080fd5b506102097ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af581565b34801561029c57600080fd5b506102b06102ab36600461368d565b610b71565b60405161021391906137d0565b3480156102c957600080fd5b506102096102d83660046135ff565b610d82565b3480156102e957600080fd5b506003546102fd906001600160a01b031681565b6040516001600160a01b039091168152602001610213565b34801561032157600080fd5b506005546102fd906001600160a01b031681565b61020961034336600461381f565b610dd6565b34801561035457600080fd5b5060005474010000000000000000000000000000000000000000900460ff166040519015158152602001610213565b34801561038f57600080fd5b506101e761039e366004613581565b611275565b3480156103af57600080fd5b506101e76103be3660046138a5565b6113db565b3480156103cf57600080fd5b506101e76103de36600461390f565b611818565b3480156103ef57600080fd5b506101e7611a26565b34801561040457600080fd5b506102097fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177581565b34801561043857600080fd5b506002546102fd906001600160a01b031681565b34801561045857600080fd5b506101e7610467366004613581565b611a3a565b34801561047857600080fd5b506101e761048736600461390f565b611a4c565b34801561049857600080fd5b506000546001600160a01b03166102fd565b3480156104b657600080fd5b506101e76104c5366004613944565b611ca7565b3480156104d657600080fd5b506101e76104e5366004613944565b611cb8565b3480156104f657600080fd5b5061050a610505366004613581565b611cc9565b6040516102139190613961565b34801561052357600080fd5b5061020960045481565b34801561053957600080fd5b506101e7610548366004613970565b611e38565b34801561055957600080fd5b5061056d610568366004613581565b6120bf565b60405161021391906139b4565b34801561058657600080fd5b506101e761059536600461390f565b6121bb565b3480156105a657600080fd5b506101e76105b5366004613944565b612416565b3480156105c657600080fd5b506106036040518060400160405280600581526020017f322e332e3100000000000000000000000000000000000000000000000000000081525081565b60405161021391906139f2565b61061861246f565b8015610629576106266124b5565b50565b610626612541565b6001600160a01b03821660009081526008602090815260408083208484529091529020545b92915050565b610664612598565b61066c6125ed565b61067585612630565b6106ab576040517f97905a9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516600090815260066020908152604080832087845290915280822081516101a081019092528054829060ff1660028111156106f1576106f16136e2565b6002811115610702576107026136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b90910154610180909101529050600061079d82612756565b905060008160048111156107b3576107b36136e2565b14806107d0575060048160048111156107ce576107ce6136e2565b145b15610807576040517f671f983900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0385811660a0840181905261010084018681526101608501868152928a1660008181526006602090815260408083208d8452909152908190206004810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016909517909455915160078401559251600a90920191909155518791907f3af5243656bab825206fa93e23588ca20d21a4154112f1b7baf8f67a1d584a22906108b8908690613961565b60405180910390a350506108cb60018055565b5050505050565b6108da612598565b6108e26125ed565b6108ed816001612828565b506108f783612630565b61092d576040517f97905a9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815260066020908152604080832085845290915280822081516101a081019092528054829060ff166002811115610973576109736136e2565b6002811115610984576109846136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b909101546101809091015290506000610a1f82612756565b90506000816004811115610a3557610a356136e2565b1480610a5257506004816004811115610a5057610a506136e2565b145b15610a89576040517f671f983900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316610ac9576040517fbece2c0200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038381166020848101829052918716600081815260068452604080822089835290945283902080547fffffffffffffffffffffff0000000000000000000000000000000000000000ff166101009093029290921790915590518591907f3af5243656bab825206fa93e23588ca20d21a4154112f1b7baf8f67a1d584a2290610b59908690613961565b60405180910390a35050610b6c60018055565b505050565b60608167ffffffffffffffff811115610b8c57610b8c613a43565b604051908082528060200260200182016040528015610c3e57816020015b610c2b604080516101a08101909152806000815260200160006001600160a01b0316815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001600080191681526020016000815260200160008152602001600081525090565b815260200190600190039081610baa5790505b50905060005b82811015610d7a576001600160a01b038516600090815260066020526040812090858584818110610c7757610c77613a72565b60209081029290920135835250810191909152604090810160002081516101a081019092528054829060ff166002811115610cb457610cb46136e2565b6002811115610cc557610cc56136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b90910154610180909101528251839083908110610d6757610d67613a72565b6020908102919091010152600101610c44565b509392505050565b6001600160a01b0380841660008181526008602090815260408083208784528252808320549383526007825280832087845282528083209383529281528282209385168252929092529020545b9392505050565b6000610de0612598565b610de86125ed565b610df3336001612828565b50610dff866001612828565b506001600160a01b03881660009081526006602090815260408083208a845290915280822081516101a081019092528054829060ff166002811115610e4657610e466136e2565b6002811115610e5757610e576136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b909101546101809091015290506000610ef282612756565b6001600160a01b03808c1660008181526008602090815260408083208f8452825280832054938352600782528083208f845282528083208484528252808320948e16835293905291822054610100860151939450909290918a9190829003610f86576040517fa214551800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002856004811115610f9a57610f9a6136e2565b036110e357604080516001600160a01b038e16602082015260009101604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825280516020918201209083018190529082018d90529150600090606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828252805160209182012090830152016040516020818303038152906040528051906020012090506110958b8b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050506101208a01518361290d565b6110cb576040517f231e418300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110da8c868a60600151612923565b93505050611150565b60038560048111156110f7576110f76136e2565b0361111e5761110f8660800151848860600151612923565b91508561016001519050611150565b6040517fe328674300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8160000361118a576040517f1db1223d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b818b111561119657819a505b6111a48e8e868f8f8b612953565b6111af8b8288612b24565b96506111bd8e8e8e8e612c70565b8c8e6001600160a01b03167feda13398eab6427cfc43332a4123b9180660f1c2041e62beb9906a0018edb78d8e8960a001518f868c61018001516002600481111561120a5761120a6136e2565b8d600481111561121c5761121c6136e2565b604080516001600160a01b03988916815297909616602088015294860193909352606085019190915260808401521460a082015260c00160405180910390a350505050505061126a60018055565b979650505050505050565b61127d6125ed565b61128682612630565b6112bc576040517f97905a9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0382166000818152600660208181526040808420868552825280842080547fffffffffffffffffffffff0000000000000000000000000000000000000000001681556001810185905560028101859055600381018590556004810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556005810185905592830184905560078301849055600880840185905560098401859055600a8401859055600b909301849055938352908152828220848352905290812080549161139383613ad0565b909155505060405181906001600160a01b038416907f859e571ffe149a71f0b6da6c58ab9a4da0dcb5ab7aa85bfa0e75a8e8892b778b90600090a36113d760018055565b5050565b6113e3612598565b6113eb6125ed565b6113f6336001612828565b5061141161140a6040830160208401613944565b6001612828565b5061141b83612630565b611451576040517f97905a9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114726114646040830160208401613944565b6001600160a01b0316151590565b6114a8576040517fbece2c0200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114b183612d85565b6114e7576040517f1632f66900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060600135816040013514611528576040517f7a83811c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101808101351580159061155a575060026115466020830183613b20565b6002811115611557576115576136e2565b14155b15611591576040517fff40f35400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026115a06020830183613b20565b60028111156115b1576115b16136e2565b1480156115c1575060e081013515155b156115f8576040517f264cc88700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815260066020908152604080832085845290915280822081516101a081019092528054829060ff16600281111561163e5761163e6136e2565b600281111561164f5761164f6136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b9091015461018090910152905060006116ea82612756565b9050600082516002811115611701576117016136e2565b141580156117215750600481600481111561171e5761171e6136e2565b14155b15611758576040517ff75f23ae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0385166000908152600660209081526040808320878452909152902083906117878282613b98565b50600090508251600281111561179f5761179f6136e2565b146117de576001600160a01b038516600090815260086020908152604080832087845290915281208054600192906117d8908490613cb4565b90915550505b83856001600160a01b03167f8920dfc9a5a7a92ca2867c2689ce956746542b69def7ae0e3683201b66e02fa085604051610b599190613cc7565b611820612598565b6118286125ed565b61183183612630565b611867576040517f97905a9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815260066020908152604080832085845290915280822081516101a081019092528054829060ff1660028111156118ad576118ad6136e2565b60028111156118be576118be6136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b90910154610180909101529050600061195982612756565b9050600081600481111561196f5761196f6136e2565b148061198c5750600481600481111561198a5761198a6136e2565b145b156119c3576040517f671f983900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b608082018390526001600160a01b038516600081815260066020908152604080832088845290915290819020600301859055518591907f3af5243656bab825206fa93e23588ca20d21a4154112f1b7baf8f67a1d584a2290610b59908690613961565b611a2e61246f565b611a386000612df3565b565b611a4261246f565b6113d78282612e5b565b611a54612598565b611a5c6125ed565b611a6583612630565b611a9b576040517f97905a9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815260066020908152604080832085845290915280822081516101a081019092528054829060ff166002811115611ae157611ae16136e2565b6002811115611af257611af26136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b909101546101809091015290506000611b8d82612756565b90506000816004811115611ba357611ba36136e2565b1480611bc057506004816004811115611bbe57611bbe6136e2565b145b15611bf7576040517f671f983900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600282516002811115611c0c57611c0c6136e2565b14611c43576040517f264cc88700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61018082018390526001600160a01b038516600081815260066020908152604080832088845290915290819020600b01859055518591907f3af5243656bab825206fa93e23588ca20d21a4154112f1b7baf8f67a1d584a2290610b59908690613961565b611caf61246f565b61062681612ec6565b611cc061246f565b61062681612f30565b611d4a604080516101a08101909152806000815260200160006001600160a01b0316815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001600080191681526020016000815260200160008152602001600081525090565b6001600160a01b03831660009081526006602090815260408083208584529091529081902081516101a081019092528054829060ff166002811115611d9157611d916136e2565b6002811115611da257611da26136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b9091015461018090910152905092915050565b611e40612598565b611e486125ed565b611e5185612630565b611e87576040517f97905a9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516600090815260066020908152604080832087845290915280822081516101a081019092528054829060ff166002811115611ecd57611ecd6136e2565b6002811115611ede57611ede6136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b909101546101809091015290506000611f7982612756565b90506000816004811115611f8f57611f8f6136e2565b1480611fac57506004816004811115611faa57611faa6136e2565b145b15611fe3576040517f671f983900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600282516002811115611ff857611ff86136e2565b14801561200457508315155b1561203b576040517f264cc88700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60c0820185905260e0820184815261014083018481526001600160a01b03891660008181526006602081815260408084208d855290915291829020600581018b90559451908501559151600990930192909255518791907f3af5243656bab825206fa93e23588ca20d21a4154112f1b7baf8f67a1d584a22906108b8908690613961565b6001600160a01b038216600090815260066020908152604080832084845290915280822081516101a08101909252805483929190829060ff166002811115612109576121096136e2565b600281111561211a5761211a6136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b909101546101809091015290506121b381612756565b949350505050565b6121c3612598565b6121cb6125ed565b6121d483612630565b61220a576040517f97905a9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815260066020908152604080832085845290915280822081516101a081019092528054829060ff166002811115612250576122506136e2565b6002811115612261576122616136e2565b815281546001600160a01b03610100918290048116602084015260018401546040840152600284015460608401526003840154608084015260048401541660a0830152600583015460c0830152600683015460e083015260078301549082015260088201546101208201526009820154610140820152600a820154610160820152600b9091015461018090910152905060006122fc82612756565b90506000816004811115612312576123126136e2565b148061232f5750600481600481111561232d5761232d6136e2565b145b15612366576040517f671f983900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028251600281111561237b5761237b6136e2565b036123b2576040517f264cc88700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61012082018390526001600160a01b038516600081815260066020908152604080832088845290915290819020600801859055518591907f3af5243656bab825206fa93e23588ca20d21a4154112f1b7baf8f67a1d584a2290610b59908690613961565b61241e61246f565b6001600160a01b038116612466576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024015b60405180910390fd5b61062681612df3565b6000546001600160a01b03163314611a38576040517f118cdaa700000000000000000000000000000000000000000000000000000000815233600482015260240161245d565b6124bd612598565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586125243390565b6040516001600160a01b03909116815260200160405180910390a1565b612549612f9a565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33612524565b60005474010000000000000000000000000000000000000000900460ff1615611a38576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260015403612629576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600155565b6000816001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612670573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126949190613d84565b6001600160a01b0316336001600160a01b0316148061065657506040517f91d148540000000000000000000000000000000000000000000000000000000081527fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177560048201523360248201526001600160a01b038316906391d14854906044015b602060405180830381865afa158015612732573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106569190613da1565b60208101516000906001600160a01b031661277357506000919050565b816060015160000361278757506004919050565b8160c0015142101561279b57506001919050565b8160c0015142101580156127c157508160e001518260c001516127be9190613cb4565b42105b156127ce57506002919050565b8160e001518260c001516127e29190613cb4565b421015801561281357508161014001518260e001518360c001516128069190613cb4565b6128109190613cb4565b42105b1561282057506003919050565b506004919050565b6002546000906001600160a01b031661284357506000610656565b6002546040517fdf592f7d0000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301529091169063df592f7d90602401602060405180830381865afa1580156128a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128ca9190613da1565b90508180156128d65750805b15610656576040517f2e70c0b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008261291a8584612fee565b14949350505050565b600083831015612949576129378385613dbe565b9050818111156129445750805b610dcf565b5060009392505050565b600281516002811115612968576129686136e2565b03612a955760008082610180015112612991578282610180015161298c9190613dd1565b6129cd565b828261018001517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6129c39190613de8565b6129cd9190613dd1565b905060008261018001511215612a5757816101400151811115612a16576001600160a01b0387166000908152600660209081526040808320898452909152812060090155612a93565b6001600160a01b038716600090815260066020908152604080832089845290915281206009018054839290612a4c908490613dbe565b90915550612a939050565b6001600160a01b038716600090815260066020908152604080832089845290915281206009018054839290612a8d908490613cb4565b90915550505b505b6001600160a01b038616600090815260066020908152604080832088845290915281206002018054849290612acb908490613dbe565b90915550506001600160a01b0380871660009081526007602090815260408083208984528252808320888452825280832093871683529290529081208054849290612b17908490613cb4565b9091555050505050505050565b60008060045485612b359190613dd1565b90506000612b438587613dd1565b60a08501519091506001600160a01b0316612bcf576000612b648383613cb4565b905080341015612ba0576040517f356680b700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6020850151600554612bbd919084906001600160a01b0316613029565b612bc78134613dbe565b935050612c2a565b81341015612c09576040517f356680b700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612c1d3385602001518660a0015184613038565b612c278234613dbe565b92505b600354600554612c48916001600160a01b0390811691859116613029565b8215612c6757600554612c6790339085906001600160a01b0316613029565b50509392505050565b604080516001808252818301909252600091602080830190803683370190505090508281600081518110612ca657612ca6613a72565b6001600160a01b0392909216602092830291909101909101526040805160018082528183019092526000918160200160208202803683370190505090508281600081518110612cf757612cf7613a72565b60209081029190910101526040517fd8c3a2740000000000000000000000000000000000000000000000000000000081526001600160a01b0387169063d8c3a27490612d4b90889086908690600401613e34565b600060405180830381600087803b158015612d6557600080fd5b505af1158015612d79573d6000803e3d6000fd5b50505050505050505050565b6040517f91d148540000000000000000000000000000000000000000000000000000000081527ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af560048201523060248201526000906001600160a01b038316906391d1485490604401612715565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03841690811790915560048290556040518291907f389f6e01d911ce2a6919bdcf4e57d270003243ca9c54e7911454a70f89aee19e90600090a35050565b600280546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f9dc7a30661b0eef899195a36c42f80a98cafd90e68cd8a50af361f2b04916dbf90600090a35050565b600580546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907fdfc4c08fb23afd3ed9497c154a48cb9a7eb5e5ef2307e641ec9faef507d4e38a90600090a35050565b60005474010000000000000000000000000000000000000000900460ff16611a38576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600081815b8451811015610d7a5761301f8286838151811061301257613012613a72565b60200260200101516131cd565b9150600101612ff3565b610b6c838383620186a06131f9565b80156131c757826001600160a01b0316846001600160a01b031603156131c7576040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b03848116600483015283916000918316906370a0823190602401602060405180830381865afa1580156130bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130e09190613ec3565b90506130f76001600160a01b0383168787866132d4565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038681166004830152600091908416906370a0823190602401602060405180830381865afa15801561315a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061317e9190613ec3565b90508361318b8383613dbe565b10156131c3576040517f35bfbdb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505b50505050565b60008183106131e9576000828152602084905260409020610dcf565b5060009182526020526040902090565b82156131c7576000846001600160a01b0316848390604051600060405180830381858888f193505050503d806000811461324f576040519150601f19603f3d011682016040523d82523d6000602084013e613254565b606091505b50509050806108cb576000839050806001600160a01b031663d0e30db0866040518263ffffffff1660e01b81526004016000604051808303818588803b15801561329d57600080fd5b505af11580156132b1573d6000803e3d6000fd5b506132cc935050506001600160a01b03831690508787613350565b505050505050565b6040516001600160a01b0384811660248301528381166044830152606482018390526131c79186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613381565b6040516001600160a01b03838116602483015260448201839052610b6c91859182169063a9059cbb90606401613309565b60006133966001600160a01b038416836133fd565b905080516000141580156133bb5750808060200190518101906133b99190613da1565b155b15610b6c576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b038416600482015260240161245d565b6060610dcf8383600084600080856001600160a01b031684866040516134239190613edc565b60006040518083038185875af1925050503d8060008114613460576040519150601f19603f3d011682016040523d82523d6000602084013e613465565b606091505b509150915061347586838361347f565b9695505050505050565b60608261348f57612944826134ef565b81511580156134a657506001600160a01b0384163b155b156134e8576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b038516600482015260240161245d565b5080610dcf565b8051156134ff5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b801515811461062657600080fd5b60006020828403121561355157600080fd5b8135610dcf81613531565b6001600160a01b038116811461062657600080fd5b803561357c8161355c565b919050565b6000806040838503121561359457600080fd5b823561359f8161355c565b946020939093013593505050565b600080600080600060a086880312156135c557600080fd5b85356135d08161355c565b94506020860135935060408601356135e78161355c565b94979396509394606081013594506080013592915050565b60008060006060848603121561361457600080fd5b833561361f8161355c565b92506020840135915060408401356136368161355c565b809150509250925092565b60008083601f84011261365357600080fd5b50813567ffffffffffffffff81111561366b57600080fd5b6020830191508360208260051b850101111561368657600080fd5b9250929050565b6000806000604084860312156136a257600080fd5b83356136ad8161355c565b9250602084013567ffffffffffffffff8111156136c957600080fd5b6136d586828701613641565b9497909650939450505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60038110613721576137216136e2565b9052565b613730828251613711565b602081015161374a60208401826001600160a01b03169052565b5060408101516040830152606081015160608301526080810151608083015260a081015161378360a08401826001600160a01b03169052565b5060c0818101519083015260e08082015190830152610100808201519083015261012080820151908301526101408082015190830152610160808201519083015261018090810151910152565b6020808252825182820181905260009190848201906040850190845b81811015613813576137ff838551613725565b928401926101a092909201916001016137ec565b50909695505050505050565b600080600080600080600060c0888a03121561383a57600080fd5b87356138458161355c565b965060208801359550604088013561385c8161355c565b9450606088013593506080880135925060a088013567ffffffffffffffff81111561388657600080fd5b6138928a828b01613641565b989b979a50959850939692959293505050565b60008060008385036101e08112156138bc57600080fd5b84356138c78161355c565b9350602085013592506101a07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08201121561390157600080fd5b506040840190509250925092565b60008060006060848603121561392457600080fd5b833561392f8161355c565b95602085013595506040909401359392505050565b60006020828403121561395657600080fd5b8135610dcf8161355c565b6101a081016106568284613725565b600080600080600060a0868803121561398857600080fd5b85356139938161355c565b97602087013597506040870135966060810135965060800135945092505050565b60208101600583106139c8576139c86136e2565b91905290565b60005b838110156139e95781810151838201526020016139d1565b50506000910152565b6020815260008251806020840152613a118160408501602087016139ce565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613b0157613b01613aa1565b5060010190565b6003811061062657600080fd5b803561357c81613b08565b600060208284031215613b3257600080fd5b8135610dcf81613b08565b6000813561065681613b08565b60038210613b5a57613b5a6136e2565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541660ff831681178255505050565b600081356106568161355c565b613baa613ba483613b3d565b82613b4a565b613bff613bb960208401613b8b565b82547fffffffffffffffffffffff0000000000000000000000000000000000000000ff1660089190911b74ffffffffffffffffffffffffffffffffffffffff0016178255565b604082013560018201556060820135600282015560808201356003820155613c65613c2c60a08401613b8b565b600483016001600160a01b0382167fffffffffffffffffffffffff00000000000000000000000000000000000000008254161781555050565b60c0820135600582015560e08201356006820155610100820135600782015561012082013560088201556101408201356009820155610160820135600a820155610180820135600b8201555050565b8082018082111561065657610656613aa1565b6101a08101613cde82613cd985613b15565b613711565b613cea60208401613571565b6001600160a01b038116602084015250604083013560408301526060830135606083015260808301356080830152613d2460a08401613571565b6001600160a01b031660a083015260c0838101359083015260e08084013590830152610100808401359083015261012080840135908301526101408084013590830152610160808401359083015261018092830135929091019190915290565b600060208284031215613d9657600080fd5b8151610dcf8161355c565b600060208284031215613db357600080fd5b8151610dcf81613531565b8181038181111561065657610656613aa1565b808202811582820484141761065657610656613aa1565b808202600082127f800000000000000000000000000000000000000000000000000000000000000084141615613e2057613e20613aa1565b818105831482151761065657610656613aa1565b6000606082018583526020606081850152818651808452608086019150828801935060005b81811015613e7e5784516001600160a01b031683529383019391830191600101613e59565b50508481036040860152855180825290820192508186019060005b81811015613eb557825185529383019391830191600101613e99565b509298975050505050505050565b600060208284031215613ed557600080fd5b5051919050565b60008251613eee8184602087016139ce565b919091019291505056fea26469706673582212207696c73b5d5c252b7dedbc8cbfbaf143adaec71ebaac095943d41ea53b960c7e64736f6c63430008160033

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

00000000000000000000000077b35947d508012589a91ca4c9d168824376cc7d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003328b944c4000

-----Decoded View---------------
Arg [0] : initOwner (address): 0x77B35947d508012589a91CA4c9d168824376Cc7D
Arg [1] : initSanctionsOracle (address): 0x0000000000000000000000000000000000000000
Arg [2] : initWethAddress (address): 0x0000000000000000000000000000000000000000
Arg [3] : initProtocolFeeReceiver (address): 0x0000000000000000000000000000000000000000
Arg [4] : initProtocolFee (uint256): 900000000000000

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000077b35947d508012589a91ca4c9d168824376cc7d
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [4] : 0000000000000000000000000000000000000000000000000003328b944c4000


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.