ETH Price: $2,602.92 (+0.49%)
Gas: 4.03 Gwei

Contract

0x9401BeeE816D9805903c90EecE7058caF59A7fcc
 

Overview

ETH Balance

0.0116 ETH

Eth Value

$30.19 (@ $2,602.92/ETH)

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Purchase Traits ...201398172024-06-21 11:31:5961 days ago1718969519IN
0x9401BeeE...aF59A7fcc
0 ETH0.001250564.58307418
Purchase Traits ...200494632024-06-08 20:21:3573 days ago1717878095IN
0x9401BeeE...aF59A7fcc
0.0001 ETH0.000766797.68157405
Purchase Traits ...200476692024-06-08 14:20:3574 days ago1717856435IN
0x9401BeeE...aF59A7fcc
0 ETH0.003970928.42730631
Purchase Traits ...197715342024-04-30 23:54:59112 days ago1714521299IN
0x9401BeeE...aF59A7fcc
0 ETH0.001090365.98248565
Purchase Traits ...197715182024-04-30 23:51:47112 days ago1714521107IN
0x9401BeeE...aF59A7fcc
0 ETH0.00109297.38152927
Purchase Traits ...197714602024-04-30 23:40:11112 days ago1714520411IN
0x9401BeeE...aF59A7fcc
0 ETH0.001081935.93619631
Purchase Traits ...197606592024-04-29 11:25:35114 days ago1714389935IN
0x9401BeeE...aF59A7fcc
0 ETH0.00190998.56413601
Purchase Traits ...197606372024-04-29 11:21:11114 days ago1714389671IN
0x9401BeeE...aF59A7fcc
0 ETH0.002874468.45906649
Purchase Traits ...196083712024-04-08 3:47:59135 days ago1712548079IN
0x9401BeeE...aF59A7fcc
0 ETH0.001893799.95501713
Purchase Traits ...195069952024-03-24 21:14:35149 days ago1711314875IN
0x9401BeeE...aF59A7fcc
0 ETH0.0038613920.29545012
Purchase Traits ...194925102024-03-22 20:21:35151 days ago1711138895IN
0x9401BeeE...aF59A7fcc
0.0001 ETH0.0019700819.73599511
Purchase Traits ...194913612024-03-22 16:29:35152 days ago1711124975IN
0x9401BeeE...aF59A7fcc
0 ETH0.0062696526.49584708
Purchase Traits ...194913402024-03-22 16:25:11152 days ago1711124711IN
0x9401BeeE...aF59A7fcc
0 ETH0.0084901526.4762853
Purchase Traits ...194913192024-03-22 16:20:59152 days ago1711124459IN
0x9401BeeE...aF59A7fcc
0 ETH0.0058998526.6994498
Purchase Traits ...191041142024-01-28 9:21:59206 days ago1706433719IN
0x9401BeeE...aF59A7fcc
0 ETH0.0023419411.99283048
Purchase Traits ...190444092024-01-20 0:12:11214 days ago1705709531IN
0x9401BeeE...aF59A7fcc
0 ETH0.005351217.50996029
Purchase Traits ...190342232024-01-18 14:04:23216 days ago1705586663IN
0x9401BeeE...aF59A7fcc
0 ETH0.0134439733.33584297
Purchase Traits ...190342062024-01-18 14:00:59216 days ago1705586459IN
0x9401BeeE...aF59A7fcc
0 ETH0.0045411629.4859863
Purchase Traits ...190341992024-01-18 13:59:23216 days ago1705586363IN
0x9401BeeE...aF59A7fcc
0 ETH0.0099201627.953419
Purchase Traits ...190340142024-01-18 13:21:47216 days ago1705584107IN
0x9401BeeE...aF59A7fcc
0 ETH0.0075664829.82124324
Purchase Traits ...190146662024-01-15 20:27:35218 days ago1705350455IN
0x9401BeeE...aF59A7fcc
0 ETH0.0132363126.4401003
Purchase Traits ...189447232024-01-06 0:49:23228 days ago1704502163IN
0x9401BeeE...aF59A7fcc
0 ETH0.0024231211.80223415
Purchase Traits ...189445592024-01-06 0:15:47228 days ago1704500147IN
0x9401BeeE...aF59A7fcc
0 ETH0.0035874915.34173537
Purchase Traits ...189314212024-01-04 3:54:59230 days ago1704340499IN
0x9401BeeE...aF59A7fcc
0 ETH0.0039468113.91188571
Purchase Traits ...187527572023-12-10 2:12:59255 days ago1702174379IN
0x9401BeeE...aF59A7fcc
0 ETH0.0060109523.32794319
View all transactions

Latest 3 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
161191942022-12-05 14:26:47625 days ago1670250407
0x9401BeeE...aF59A7fcc
13.16 ETH
161182412022-12-05 11:15:11625 days ago1670238911
0x9401BeeE...aF59A7fcc
5.0002 ETH
160890612022-12-01 9:27:59629 days ago1669886879
0x9401BeeE...aF59A7fcc
9.1835 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FancyTraitV2Sale

Compiler Version
v0.8.14+commit.80d49f37

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 28 : FancyTraitV2Sale.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./interfaces/IFancyBears.sol";
import "./interfaces/IHoneyJars.sol";
import "./interfaces/IHoneyVesting.sol";
import "./interfaces/IHive.sol";
import "./interfaces/IHoneyToken.sol";
import "./interfaces/IFancyTraitsV2.sol";
import "./interfaces/IFancyBearStaking.sol";
import "./interfaces/IFancy721.sol";
import "./interfaces/ILevels.sol";
import "./Tag.sol";

contract FancyTraitV2Sale is AccessControlEnumerable, ReentrancyGuard {
    struct PurchaseData {
        uint256[] fancyBear;
        uint256[] amountToSpendFromBear;
        uint256[] honeyJars;
        uint256[] amountToSpendFromHoneyJars;
        address[] collectionsOnHive;
        uint256[] tokenIdsOnHive;
        uint256[] amountToSpendOnHive;
        uint256 amountToSpendFromWallet;
        uint256[] traitTokenIds;
        uint256[] amountPerTrait;
    }

    struct TokenSaleData {
        uint256 ethPrice;
        uint256 counter;
        uint256 maxSupply;
        bool saleActive;
        mapping(address => uint256) tokenPrice;
    }

    struct LevelAttributionArgs {
        address collection;
        uint256 tokenId;
    }

    struct SaleDataUpdateArgs {
        uint256 ethPrice;
        uint256 counter;
        uint256 maxSupply;
        bool saleActive;
        address[] tokenContracts;
        uint256[] tokenPrice;
    }

    using SafeMath for uint256;
    using SafeERC20 for IHoneyToken;
    using SafeERC20 for IERC20;

    bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE");
    bytes32 public constant WITHDRAW_ROLE = keccak256("WITHDRAW_ROLE");

    mapping(uint256 => TokenSaleData) public tokenSaleData;

    IFancyBears public fancyBearsContract;
    IHoneyToken public honeyTokenContract;
    IHoneyJars public honeyJarsContract;
    IHoneyVesting public honeyVestingContract;
    IFancyTraitsV2 public fancyTraitsV2Contract;
    ILevels public levelsContract;
    IFancyBearStaking public fancyBearStakingContract;
    IHive public hiveContract;

    // Add hive, vesting, staking contracts

    event Purchase(
        address indexed _sender,
        uint256[] _traitIds,
        uint256[] _quantities
    );

    event SaleDataUpdated(uint256 indexed _tokenId);
    event ERC20PriceUpdated(
        uint256 indexed _tokenId,
        address indexed _tokenContract,
        uint256 _price
    );
    event ETHPriceUpdated(uint256 indexed _tokenId, uint256 _price);
    event CounterCleared(uint256 indexed _tokenId);
    event MaxSupplyUpdated(uint256 indexed _tokenId, uint256 _maxSupply);
    event SaleToggled(uint256 indexed _tokenId, bool _saleActive);
    event SaleDataDeleted(uint256 indexed _tokenId);
    event WithdrawERC20(
        address _destination,
        address _tokenContract,
        uint256 _amount
    ); 
    event WithdrawETH(address _destination, uint256 _amount);

    constructor(
        IFancyBears _fancyBearsContract,
        IHoneyJars _honeyJarsContract,
        IHoneyVesting _honeyVestingContract,
        IFancyTraitsV2 _fancyTraitsV2Contract,
        IHoneyToken _honeyTokenContract,
        ILevels _levelsContract,
        IFancyBearStaking _fancyBearStakingContract,
        IHive _hiveContract
    ) {
        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);

        fancyTraitsV2Contract = _fancyTraitsV2Contract;
        honeyTokenContract = _honeyTokenContract;

        fancyBearsContract = _fancyBearsContract;
        honeyJarsContract = _honeyJarsContract;
        honeyVestingContract = _honeyVestingContract;
        levelsContract = _levelsContract;
        fancyBearStakingContract = _fancyBearStakingContract;
        hiveContract = _hiveContract;
    }

    function purchaseTraitsWithHoney(
        PurchaseData calldata purchaseData,
        LevelAttributionArgs calldata _levelAttributionArgs
    ) public {
        require(
            purchaseData.fancyBear.length <= 1,
            "purchaseTraits: cannot submit more than one fancy bear"
        );

        require(
            purchaseData.amountToSpendFromBear.length ==
                purchaseData.fancyBear.length,
            "purchaseTraits: fancy bear and amount to spend must match in length"
        );

        uint256 totalHoneyRequired;
        uint256 totalHoneySubmitted = purchaseData.amountToSpendFromWallet;

        if (purchaseData.fancyBear.length == 1) {
            require(
                fancyBearsContract.tokenByIndex(
                    purchaseData.fancyBear[0].sub(1)
                ) == purchaseData.fancyBear[0]
            );

            if (purchaseData.amountToSpendFromBear[0] > 0) {
                require(
                    fancyBearsContract.ownerOf(purchaseData.fancyBear[0]) ==
                        msg.sender ||
                        fancyBearStakingContract.getOwnerOf(
                            purchaseData.fancyBear[0]
                        ) ==
                        msg.sender,
                    "purchaseTraits: caller must own fancy bear if spending honey in bear"
                );

                totalHoneySubmitted += purchaseData.amountToSpendFromBear[0];
            }
        }

        require(
            purchaseData.traitTokenIds.length > 0,
            "purchaseTraitsWithHoney: must request at least 1 trait"
        );

        require(
            purchaseData.traitTokenIds.length ==
                purchaseData.amountPerTrait.length,
            "purchaseTraitsWithHoney: trait token ids and amounts must match in length"
        );

        for (uint256 i = 0; i < purchaseData.traitTokenIds.length; ) {

            require(
                tokenSaleData[purchaseData.traitTokenIds[i]].tokenPrice[
                    address(honeyTokenContract)
                ] != 0,
                "purchaseTraitsWithHoney: honey price not set"
            );

            require(
                tokenSaleData[purchaseData.traitTokenIds[i]].saleActive,
                "purchaseTraitsWithHoney: trait is not available for sale"
            );

            require(
                tokenSaleData[purchaseData.traitTokenIds[i]].counter.add(
                    purchaseData.amountPerTrait[i]
                ) <= tokenSaleData[purchaseData.traitTokenIds[i]].maxSupply,
                "purchaseTraitsWithHoney: request exceeds supply of trait"
            );

            totalHoneyRequired += (
                tokenSaleData[purchaseData.traitTokenIds[i]].tokenPrice[
                    address(honeyTokenContract)
                ]
            ).mul(purchaseData.amountPerTrait[i]);

            tokenSaleData[purchaseData.traitTokenIds[i]].counter += purchaseData
                .amountPerTrait[i];

            unchecked {
                i++;
            }
        }

        require(
            purchaseData.honeyJars.length ==
                purchaseData.amountToSpendFromHoneyJars.length,
            "purchaseTraits: honey jar ids and amounts to spend must match in length"
        );

        for (uint256 i = 0; i < purchaseData.honeyJars.length; ) {
            require(
                honeyJarsContract.ownerOf(purchaseData.honeyJars[i]) ==
                    msg.sender,
                "purchaseTraits: caller must be owner of all honey jars"
            );

            totalHoneySubmitted += purchaseData.amountToSpendFromHoneyJars[i];

            unchecked {
                i++;
            }
        }

        uint256 expectedLength = purchaseData.collectionsOnHive.length;

        require(
            purchaseData.tokenIdsOnHive.length == expectedLength,
            "purchaseTraits: tokenIdsOnHive array length mismatch"
        );

        require(
            purchaseData.amountToSpendOnHive.length == expectedLength,
            "purchaseTraits: amountToSpendOnHive array length mismatch"
        );

        for (uint256 i; i < expectedLength; ) {
            require(
                IFancy721(purchaseData.collectionsOnHive[i]).ownerOf(
                    purchaseData.tokenIdsOnHive[i]
                ) == msg.sender,
                "purchaseTraits: caller does not own token on collection"
            );

            totalHoneySubmitted += purchaseData.amountToSpendOnHive[i];

            unchecked {
                i++;
            }
        }

        require(
            totalHoneySubmitted == totalHoneyRequired,
            "purchaseTraits: honey required does not match honey submitted"
        );

        if (purchaseData.amountToSpendFromWallet != 0) {
            honeyTokenContract.safeTransferFrom(
                msg.sender,
                address(this),
                purchaseData.amountToSpendFromWallet
            );
        }

        
        if (
            purchaseData.fancyBear.length > 0 ||
            purchaseData.honeyJars.length > 0
        ) {
            if (
                purchaseData.amountToSpendFromBear.length > 0 &&
                purchaseData.amountToSpendFromBear[0] > 0
            ) {
                honeyVestingContract.spendHoney(
                    purchaseData.fancyBear,
                    purchaseData.amountToSpendFromBear,
                    purchaseData.honeyJars.length > 0
                        ? purchaseData.honeyJars
                        : new uint256[](0),
                    purchaseData.honeyJars.length > 0
                        ? purchaseData.amountToSpendFromHoneyJars
                        : new uint256[](0)
                );
            } else {
                honeyVestingContract.spendHoney(
                    new uint256[](0),
                    new uint256[](0),
                    purchaseData.honeyJars.length > 0
                        ? purchaseData.honeyJars
                        : new uint256[](0),
                    purchaseData.honeyJars.length > 0
                        ? purchaseData.amountToSpendFromHoneyJars
                        : new uint256[](0)
                );
            }
        }

        if (purchaseData.collectionsOnHive.length > 0) {
            hiveContract.spendHoneyFromTokenIdsOfCollections(
                purchaseData.collectionsOnHive,
                purchaseData.tokenIdsOnHive,
                purchaseData.amountToSpendOnHive
            );
        }

        if (purchaseData.fancyBear.length > 0) {
            levelsContract.consumeToken(
                address(fancyBearsContract), // collection address - Fancy Bears
                purchaseData.fancyBear[0], // Fancy Bear Token ID
                address(honeyTokenContract),
                totalHoneyRequired
            );
        } else if (_levelAttributionArgs.collection != address(0)) {

            levelsContract.consumeToken(
                _levelAttributionArgs.collection,
                _levelAttributionArgs.tokenId,
                address(honeyTokenContract),
                totalHoneyRequired
            );
        }

        fancyTraitsV2Contract.mintBatch(
            msg.sender,
            purchaseData.traitTokenIds,
            purchaseData.amountPerTrait,
            ""
        );

        emit Purchase(
            msg.sender,
            purchaseData.traitTokenIds,
            purchaseData.amountPerTrait
        );
    }

    function purchaseTraitsWithETH(
        uint256[] calldata _traitTokenIds,
        uint256[] calldata _amountPerTrait,
        LevelAttributionArgs calldata _levelAttributionArgs
    ) public payable nonReentrant {
        uint256 totalETHRequired;

        require(
            _traitTokenIds.length > 0,
            "purchaseTraitsWithETH: must request at least 1 trait"
        );

        require(
            _traitTokenIds.length == _amountPerTrait.length,
            "purchaseTraitsWithETH: trait token ids and amounts must match in length"
        );

        uint256 i;
        for (; i < _traitTokenIds.length; ) {

            require(
                tokenSaleData[_traitTokenIds[i]].ethPrice != 0,
                "purchaseTraitsWithETH: eth price not set"
            );

            require(
                tokenSaleData[_traitTokenIds[i]].saleActive,
                "purchaseTraitsWithETH: trait is not available for sale"
            );

            require(
                tokenSaleData[_traitTokenIds[i]].counter.add(
                    _amountPerTrait[i]
                ) <= tokenSaleData[_traitTokenIds[i]].maxSupply,
                "purchaseTraitsWithETH: request exceeds supply of trait"
            );

            totalETHRequired += (tokenSaleData[_traitTokenIds[i]]).ethPrice.mul(
                    _amountPerTrait[i]
                );

            tokenSaleData[_traitTokenIds[i]].counter += _amountPerTrait[i];

            unchecked {
                i++;
            }
        }

        require(
            msg.value >= totalETHRequired,
            "purchaseTraitsWithETH: incorrect amount of eth"
        );

        fancyTraitsV2Contract.mintBatch(
            msg.sender,
            _traitTokenIds,
            _amountPerTrait,
            ""
        );

        // add levels attribution

        if (_levelAttributionArgs.collection != address(0)) {
     
            levelsContract.consumeETH(
                _levelAttributionArgs.collection,
                _levelAttributionArgs.tokenId,
                totalETHRequired
            );
        }
    }

    function purchaseTraitsWithERC20(
        address _tokenContract,
        uint256[] calldata _traitTokenIds,
        uint256[] calldata _amountPerTrait,
        LevelAttributionArgs calldata _levelAttributionArgs
    ) public payable {
        uint256 totalTokensRequired;

        require(
            _tokenContract != address(0),
            "purchaseTraitsWithERC20: token contract cannot be the zero address"
        );

        require(
            _traitTokenIds.length > 0,
            "purchaseTraitsWithERC20: must request at least 1 trait"
        );

        require(
            _traitTokenIds.length == _amountPerTrait.length,
            "purchaseTraitsWithERC20: trait token ids and amounts must match in length"
        );

        uint256 i;
        for (; i < _traitTokenIds.length; ) {
            require(
                tokenSaleData[_traitTokenIds[i]].saleActive,
                "purchaseTraitsWithERC20: trait is not available for sale"
            );

            require(
                tokenSaleData[_traitTokenIds[i]].counter.add(
                    _amountPerTrait[i]
                ) <= tokenSaleData[_traitTokenIds[i]].maxSupply,
                "purchaseTraitsWithERC20: request exceeds supply of trait"
            );

            require(
                tokenSaleData[_traitTokenIds[i]].tokenPrice[_tokenContract] !=
                    0,
                "purchaseTraitsWithERC20: token price for trait not set"
            );

            totalTokensRequired += (tokenSaleData[_traitTokenIds[i]])
                .tokenPrice[_tokenContract]
                .mul(_amountPerTrait[i]);

            tokenSaleData[_traitTokenIds[i]].counter += _amountPerTrait[i];

            unchecked {
                i++;
            }
        }

        if (_levelAttributionArgs.collection != address(0)) {
  
            levelsContract.consumeToken(
                address(_levelAttributionArgs.collection),
                _levelAttributionArgs.tokenId,
                _tokenContract,
                totalTokensRequired
            );
        }

        IERC20(_tokenContract).safeTransferFrom(
            msg.sender,
            address(this),
            totalTokensRequired
        );

        fancyTraitsV2Contract.mintBatch(
            msg.sender,
            _traitTokenIds,
            _amountPerTrait,
            ""
        );

        emit Purchase(msg.sender, _traitTokenIds, _amountPerTrait);
    }

    function _updateSaleData(
        uint256 _tokenId,
        SaleDataUpdateArgs calldata _saleDataUpdateArgs
    ) internal onlyRole(MANAGER_ROLE) {
        require(
            _saleDataUpdateArgs.tokenContracts.length ==
                _saleDataUpdateArgs.tokenPrice.length,
            "updateSaleData: token array length mismatch"
        );

        tokenSaleData[_tokenId].ethPrice = _saleDataUpdateArgs.ethPrice;
        tokenSaleData[_tokenId].counter = _saleDataUpdateArgs.counter;
        tokenSaleData[_tokenId].maxSupply = _saleDataUpdateArgs.maxSupply;
        tokenSaleData[_tokenId].saleActive = _saleDataUpdateArgs.saleActive;

        uint256 i;
        for (; i < _saleDataUpdateArgs.tokenContracts.length; ) {
            tokenSaleData[_tokenId].tokenPrice[
                _saleDataUpdateArgs.tokenContracts[i]
            ] = _saleDataUpdateArgs.tokenPrice[i];

            unchecked {
                i++;
            }
        }

        emit SaleDataUpdated(_tokenId);
    }

    function updateSaleDataBulk(
        uint256[] calldata _tokenIds,
        SaleDataUpdateArgs[] calldata _saleDataUpdateArgs
    ) public onlyRole(MANAGER_ROLE) {
        require(
            _tokenIds.length == _saleDataUpdateArgs.length,
            "updateSaleDataBulk: arrays must match in length"
        );
        uint256 i;
        for (; i < _tokenIds.length; ) {
            _updateSaleData(_tokenIds[i], _saleDataUpdateArgs[i]);

            unchecked {
                i++;
            }
        }
    }

    function updateERC20Price(
        uint256[] calldata _traitTokenIds,
        address[][] calldata _tokenContracts,
        uint256[][] calldata _prices
    ) public onlyRole(MANAGER_ROLE) {
        uint256 expectedLength = _traitTokenIds.length;

        require(
            _tokenContracts.length == expectedLength,
            "updateERC20Price: token ids and token contracts do not match in length"
        );

        require(
            _prices.length == expectedLength,
            "updateERC20Price: token ids and prices do not match in length"
        );

        uint256 i;
        for (; i < _traitTokenIds.length; ) {
            require(
                _tokenContracts[i].length == _prices[i].length,
                "updateERC20Price: token contracts and prices do not match in length for token id"
            );

            uint256 j;
            for (; j < _tokenContracts[i].length; ) {
                tokenSaleData[_traitTokenIds[i]].tokenPrice[
                    _tokenContracts[i][j]
                ] = _prices[i][j];

                emit ERC20PriceUpdated(
                    _traitTokenIds[i],
                    _tokenContracts[i][j],
                    _prices[i][j]
                );

                unchecked {
                    j++;
                }
            }

            unchecked {
                i++;
            }
        }
    }

    function updateETHPrice(
        uint256[] calldata _tokenIds,
        uint256[] calldata _prices
    ) public onlyRole(MANAGER_ROLE) {
        require(
            _tokenIds.length == _prices.length,
            "updateETHPrice: token Ids and prices array must match in length"
        );
        for (uint256 i = 0; i < _tokenIds.length; i++) {
            tokenSaleData[_tokenIds[i]].ethPrice = _prices[i];
            emit ETHPriceUpdated(_tokenIds[i], _prices[i]);
        }
    }

    function clearCounter(uint256[] calldata _tokenIds)
        public
        onlyRole(MANAGER_ROLE)
    {
        for (uint256 i = 0; i < _tokenIds.length; i++) {
            tokenSaleData[_tokenIds[i]].counter = 0;
            emit CounterCleared(_tokenIds[i]);
        }
    }

    function updateMaxSupply(
        uint256[] calldata _tokenIds,
        uint256[] calldata _maxSupplies
    ) public onlyRole(MANAGER_ROLE) {
        require(
            _tokenIds.length == _maxSupplies.length,
            "updatePrice: token Ids and max supplies array must match in length"
        );
        for (uint256 i = 0; i < _tokenIds.length; i++) {
            require(
                _maxSupplies[i] >= tokenSaleData[_tokenIds[i]].counter,
                "updateMaxSupply: cannot set max supply below item counter"
            );

            tokenSaleData[_tokenIds[i]].maxSupply = _maxSupplies[i];
            emit MaxSupplyUpdated(_tokenIds[i], _maxSupplies[i]);
        }
    }

    function toggleSale(uint256[] calldata _tokenIds)
        public
        onlyRole(MANAGER_ROLE)
    {
        for (uint256 i = 0; i < _tokenIds.length; i++) {
            tokenSaleData[_tokenIds[i]].saleActive = !tokenSaleData[
                _tokenIds[i]
            ].saleActive;
            emit SaleToggled(
                _tokenIds[i],
                tokenSaleData[_tokenIds[i]].saleActive
            );
        }
    }

    function withdrawERC20(
        address _beneficiary,
        address[] calldata _tokenContracts,
        uint256[] calldata _amounts
    ) public onlyRole(WITHDRAW_ROLE) {
        require(
            _tokenContracts.length == _amounts.length,
            "withdrawERC20: token contracts and amounts array length mismatch"
        );

        uint256 i;
        for (; i < _tokenContracts.length; ) {
            IERC20(_tokenContracts[i]).safeTransfer(_beneficiary, _amounts[i]);
            emit WithdrawERC20(_beneficiary, _tokenContracts[i], _amounts[i]);

            unchecked {
                i++;
            }
        }
    }

    function getTokenPriceForTraitId(uint256 _traitId, address[] calldata _tokenContracts) public view returns (uint256[] memory) {
        uint256 i;
        uint256[] memory prices = new uint256[](_tokenContracts.length);

        for(; i < _tokenContracts.length;){
            prices[i] = tokenSaleData[_traitId].tokenPrice[_tokenContracts[i]];

            unchecked {
                i++;
            }
        }

        return prices;
    }

    function withdrawETH(address _beneficiary, uint256 _amount)
        public
        nonReentrant
        onlyRole(WITHDRAW_ROLE)
    {
        uint256 balance = address(this).balance;
        require(
            _amount <= balance,
            "withdrawETH: cannot withdraw more than the balance"
        );
        require(payable(_beneficiary).send(_amount));
    }
}

File 2 of 28 : ILevels.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.14;

abstract contract ILevels {

    address public honeyContract;

    function consumeToken(address _collectionAddress, uint256 _collectionTokenId, address _tokenAddress, uint256 _amount) public virtual;
    function consumeETH(address _collectionAddress, uint256 _collectionTokenId, uint256 _amount) public virtual;
    function getConsumedToken(address _collectionAddress, uint256 _collectionTokenId, address _tokenAddress) public virtual returns (uint256);
    function getConsumedETH(address _collectionAddress, uint256 _collectionTokenId) public virtual returns (uint256);
    
}

File 3 of 28 : IHoneyVesting.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;

abstract contract IHoneyVesting {
    function spendHoney(
        uint256[] calldata _fancyBearTokens, 
        uint256[] calldata _amountPerFancyBearToken, 
        uint256[] calldata _honeyJarTokens,
        uint256[] calldata _amountPerHoneyJarToken
    )
        external
        virtual;
}

File 4 of 28 : IHoneyToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;

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

abstract contract IHoneyToken is IERC20 {}

File 5 of 28 : IHoneyJars.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";

interface IHoneyJars is IERC721, IERC721Enumerable {

    function tokensInWallet(address _owner) external view returns(uint256[] memory);

}

File 6 of 28 : IHive.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.12;

interface IHive {

    function depositHoneyToTokenIdsOfCollections(
        address[] calldata _collections,
        uint256[] calldata _tokenIds,
        uint256[] calldata _amounts
    ) external;

    function spendHoneyFromTokenIdsOfCollections(
        address[] calldata _collections,
        uint256[] calldata _tokenIds,
        uint256[] calldata _amounts
    ) external;
    
}

File 7 of 28 : IFancyTraitsV2.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";

abstract contract IFancyTraitsV2 is IERC1155 {

    struct Trait {
        string name;
        string category;
        bool set;
    }

    mapping(uint256 => Trait) public traits;

    mapping(string => bool) public categoryValidation;
    uint256 public categoryPointer;
    string[] public categories;
    function getTrait(uint256 _tokenId) public virtual returns (string memory, string memory);
    function getCategories() public virtual returns (string[] memory);
    function mint(address _account, uint256 _id, uint256 _amount, bytes memory _data) public virtual;
    function mintBatch(address _account, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data) public virtual;
}

File 8 of 28 : IFancyBears.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";

interface IFancyBears is IERC721, IERC721Enumerable {

    function tokensInWallet(address _owner) external view returns(uint256[] memory);

}

File 9 of 28 : IFancyBearStaking.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.14;

abstract contract IFancyBearStaking {

    struct TokenStakingData {
        address owner;
        uint256 timestamp;
    }

    mapping(uint256 => TokenStakingData) public stakingDataByTokenId;
    uint256 public minimumHoneyConsumption;
    uint256 public cooldown;

    function getOwnerOf(uint256 _tokenId) public virtual returns (address);
    function getTimestampOf(uint256 _tokenId) public virtual returns (uint256);
}

File 10 of 28 : IFancy721.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.12;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";

abstract contract IFancy721 is IERC721Enumerable {

    mapping(string => bool) public categoryValidation;
    uint256 public categoryPointer;
    string[] public categories;

    function safeMint(address _to, uint256[] calldata _apeTokenIds) public virtual;
    function tokensInWallet(address _owner) public virtual returns(uint256[] memory);
    function getCategories() public virtual returns (string[] memory);

}

File 11 of 28 : Tag.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;

//                      ---------------[ ]---------------
//                      -------[ ]-------------[ ]-------
//                      ---------------------------------
//                      ----[ ]--------[ ]--------[ ]----
//                      ---------------------------------
//                      -------[ ]-------------[ ]-------
//                      ---------------[ ]---------------

File 12 of 28 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @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.
 *
 * ```
 * 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.
 */
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 of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @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._indexes[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 read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 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 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastvalue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastvalue;
                // Update the index for the moved value
                set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
            }

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

            // Delete the index for the deleted slot
            delete set._indexes[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._indexes[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) {
        return _values(set._inner);
    }

    // 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;

        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 on 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;

        assembly {
            result := store
        }

        return result;
    }
}

File 13 of 28 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 14 of 28 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

File 15 of 28 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 16 of 28 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 17 of 28 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @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;
    }
}

File 18 of 28 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @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://diligence.consensys.net/posts/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.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @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, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * 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.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @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`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 19 of 28 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

File 20 of 28 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;
}

File 21 of 28 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../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;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @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, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 22 of 28 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` 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 amount
    ) external returns (bool);

    /**
     * @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);
}

File 23 of 28 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

File 24 of 28 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @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;

    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() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 25 of 28 : IAccessControlEnumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";

/**
 * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
 */
interface IAccessControlEnumerable is IAccessControl {
    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) external view returns (address);

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) external view returns (uint256);
}

File 26 of 28 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 27 of 28 : AccessControlEnumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)

pragma solidity ^0.8.0;

import "./IAccessControlEnumerable.sol";
import "./AccessControl.sol";
import "../utils/structs/EnumerableSet.sol";

/**
 * @dev Extension of {AccessControl} that allows enumerating the members of each role.
 */
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {
    using EnumerableSet for EnumerableSet.AddressSet;

    mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {
        return _roleMembers[role].at(index);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {
        return _roleMembers[role].length();
    }

    /**
     * @dev Overload {_grantRole} to track enumerable memberships
     */
    function _grantRole(bytes32 role, address account) internal virtual override {
        super._grantRole(role, account);
        _roleMembers[role].add(account);
    }

    /**
     * @dev Overload {_revokeRole} to track enumerable memberships
     */
    function _revokeRole(bytes32 role, address account) internal virtual override {
        super._revokeRole(role, account);
        _roleMembers[role].remove(account);
    }
}

File 28 of 28 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "london",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IFancyBears","name":"_fancyBearsContract","type":"address"},{"internalType":"contract IHoneyJars","name":"_honeyJarsContract","type":"address"},{"internalType":"contract IHoneyVesting","name":"_honeyVestingContract","type":"address"},{"internalType":"contract IFancyTraitsV2","name":"_fancyTraitsV2Contract","type":"address"},{"internalType":"contract IHoneyToken","name":"_honeyTokenContract","type":"address"},{"internalType":"contract ILevels","name":"_levelsContract","type":"address"},{"internalType":"contract IFancyBearStaking","name":"_fancyBearStakingContract","type":"address"},{"internalType":"contract IHive","name":"_hiveContract","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"CounterCleared","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"_tokenContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"_price","type":"uint256"}],"name":"ERC20PriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_price","type":"uint256"}],"name":"ETHPriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_maxSupply","type":"uint256"}],"name":"MaxSupplyUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_sender","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"_traitIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"_quantities","type":"uint256[]"}],"name":"Purchase","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"SaleDataDeleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"SaleDataUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"_saleActive","type":"bool"}],"name":"SaleToggled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_destination","type":"address"},{"indexed":false,"internalType":"address","name":"_tokenContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"WithdrawERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_destination","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"WithdrawETH","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"clearCounter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fancyBearStakingContract","outputs":[{"internalType":"contract IFancyBearStaking","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fancyBearsContract","outputs":[{"internalType":"contract IFancyBears","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fancyTraitsV2Contract","outputs":[{"internalType":"contract IFancyTraitsV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_traitId","type":"uint256"},{"internalType":"address[]","name":"_tokenContracts","type":"address[]"}],"name":"getTokenPriceForTraitId","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hiveContract","outputs":[{"internalType":"contract IHive","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"honeyJarsContract","outputs":[{"internalType":"contract IHoneyJars","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"honeyTokenContract","outputs":[{"internalType":"contract IHoneyToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"honeyVestingContract","outputs":[{"internalType":"contract IHoneyVesting","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"levelsContract","outputs":[{"internalType":"contract ILevels","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenContract","type":"address"},{"internalType":"uint256[]","name":"_traitTokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_amountPerTrait","type":"uint256[]"},{"components":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct FancyTraitV2Sale.LevelAttributionArgs","name":"_levelAttributionArgs","type":"tuple"}],"name":"purchaseTraitsWithERC20","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_traitTokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_amountPerTrait","type":"uint256[]"},{"components":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct FancyTraitV2Sale.LevelAttributionArgs","name":"_levelAttributionArgs","type":"tuple"}],"name":"purchaseTraitsWithETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256[]","name":"fancyBear","type":"uint256[]"},{"internalType":"uint256[]","name":"amountToSpendFromBear","type":"uint256[]"},{"internalType":"uint256[]","name":"honeyJars","type":"uint256[]"},{"internalType":"uint256[]","name":"amountToSpendFromHoneyJars","type":"uint256[]"},{"internalType":"address[]","name":"collectionsOnHive","type":"address[]"},{"internalType":"uint256[]","name":"tokenIdsOnHive","type":"uint256[]"},{"internalType":"uint256[]","name":"amountToSpendOnHive","type":"uint256[]"},{"internalType":"uint256","name":"amountToSpendFromWallet","type":"uint256"},{"internalType":"uint256[]","name":"traitTokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amountPerTrait","type":"uint256[]"}],"internalType":"struct FancyTraitV2Sale.PurchaseData","name":"purchaseData","type":"tuple"},{"components":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct FancyTraitV2Sale.LevelAttributionArgs","name":"_levelAttributionArgs","type":"tuple"}],"name":"purchaseTraitsWithHoney","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"toggleSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenSaleData","outputs":[{"internalType":"uint256","name":"ethPrice","type":"uint256"},{"internalType":"uint256","name":"counter","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"bool","name":"saleActive","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_traitTokenIds","type":"uint256[]"},{"internalType":"address[][]","name":"_tokenContracts","type":"address[][]"},{"internalType":"uint256[][]","name":"_prices","type":"uint256[][]"}],"name":"updateERC20Price","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_prices","type":"uint256[]"}],"name":"updateETHPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_maxSupplies","type":"uint256[]"}],"name":"updateMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"components":[{"internalType":"uint256","name":"ethPrice","type":"uint256"},{"internalType":"uint256","name":"counter","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"bool","name":"saleActive","type":"bool"},{"internalType":"address[]","name":"tokenContracts","type":"address[]"},{"internalType":"uint256[]","name":"tokenPrice","type":"uint256[]"}],"internalType":"struct FancyTraitV2Sale.SaleDataUpdateArgs[]","name":"_saleDataUpdateArgs","type":"tuple[]"}],"name":"updateSaleDataBulk","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"address[]","name":"_tokenContracts","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawETH","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b5060405162004ca838038062004ca883398101604081905262000034916200024b565b600160025562000046600033620000dc565b600880546001600160a01b03199081166001600160a01b03978816179091556005805482169587169590951790945560048054851698861698909817909755600680548416968516969096179095556007805483169484169490941790935560098054821693831693909317909255600a8054831693821693909317909255600b8054909116929091169190911790556200030c565b620000f382826200011f60201b620035891760201c565b60008281526001602090815260409091206200011a9183906200360d620001c0821b17901c565b505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620001bc576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556200017b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6000620001d7836001600160a01b038416620001e0565b90505b92915050565b60008181526001830160205260408120546200022957508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620001da565b506000620001da565b6001600160a01b03811681146200024857600080fd5b50565b600080600080600080600080610100898b0312156200026957600080fd5b8851620002768162000232565b60208a0151909850620002898162000232565b60408a01519097506200029c8162000232565b60608a0151909650620002af8162000232565b60808a0151909550620002c28162000232565b60a08a0151909450620002d58162000232565b60c08a0151909350620002e88162000232565b60e08a0151909250620002fb8162000232565b809150509295985092959890939650565b61498c806200031c6000396000f3fe6080604052600436106101e35760003560e01c80637c095f2b11610102578063c132bfe211610095578063ec87621c11610064578063ec87621c146105fa578063f2d24b321461061c578063f81b78ad1461063c578063fd25d4611461065c57600080fd5b8063c132bfe214610573578063ca15c87314610586578063d547741f146105a6578063e02023a1146105c657600080fd5b80639fa58e35116100d15780639fa58e35146104fe578063a08a6c721461051e578063a217fddf1461053e578063ba9bd4281461055357600080fd5b80637c095f2b1461047e5780638ce343941461049e5780639010d07c146104be57806391d14854146104de57600080fd5b8063327cbe361161017a57806359f627cb1161014957806359f627cb146103f157806372fb4e711461041e5780637651721b1461043e5780637bde97ee1461045e57600080fd5b8063327cbe361461037157806336568abe1461039157806342d6f6f7146103b15780634782f779146103d157600080fd5b806323e3fbc1116101b657806323e3fbc114610272578063248a9ca3146102aa57806324ac8cc2146102e85780632f2ff15d1461035157600080fd5b806301ffc9a7146101e85780630265a02e1461021d578063168b140b1461023f578063238b7bbe1461025f575b600080fd5b3480156101f457600080fd5b50610208610203366004613f76565b61067c565b60405190151581526020015b60405180910390f35b34801561022957600080fd5b5061023d610238366004613fb8565b6106a7565b005b34801561024b57600080fd5b5061023d61025a366004614059565b611ad8565b61023d61026d36600461409b565b611c25565b34801561027e57600080fd5b50600a54610292906001600160a01b031681565b6040516001600160a01b039091168152602001610214565b3480156102b657600080fd5b506102da6102c536600461411d565b60009081526020819052604090206001015490565b604051908152602001610214565b3480156102f457600080fd5b5061032f61030336600461411d565b600360208190526000918252604090912080546001820154600283015492909301549092919060ff1684565b6040805194855260208501939093529183015215156060820152608001610214565b34801561035d57600080fd5b5061023d61036c36600461414e565b6121c3565b34801561037d57600080fd5b5061023d61038c36600461417e565b6121ee565b34801561039d57600080fd5b5061023d6103ac36600461414e565b6122ce565b3480156103bd57600080fd5b5061023d6103cc366004614059565b61234c565b3480156103dd57600080fd5b5061023d6103ec3660046141ea565b6123fb565b3480156103fd57600080fd5b5061041161040c366004614216565b612520565b604051610214919061429d565b34801561042a57600080fd5b50600754610292906001600160a01b031681565b34801561044a57600080fd5b50600454610292906001600160a01b031681565b34801561046a57600080fd5b5061023d6104793660046142b0565b612600565b34801561048a57600080fd5b5061023d610499366004614333565b6127aa565b3480156104aa57600080fd5b50600554610292906001600160a01b031681565b3480156104ca57600080fd5b506102926104d93660046143cd565b612b98565b3480156104ea57600080fd5b506102086104f936600461414e565b612bb0565b34801561050a57600080fd5b50600954610292906001600160a01b031681565b34801561052a57600080fd5b50600854610292906001600160a01b031681565b34801561054a57600080fd5b506102da600081565b34801561055f57600080fd5b5061023d61056e36600461417e565b612bd9565b61023d6105813660046143ef565b612e00565b34801561059257600080fd5b506102da6105a136600461411d565b6133ec565b3480156105b257600080fd5b5061023d6105c136600461414e565b613403565b3480156105d257600080fd5b506102da7f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec81565b34801561060657600080fd5b506102da60008051602061493783398151915281565b34801561062857600080fd5b5061023d61063736600461417e565b613429565b34801561064857600080fd5b50600654610292906001600160a01b031681565b34801561066857600080fd5b50600b54610292906001600160a01b031681565b60006001600160e01b03198216635a05180f60e01b14806106a157506106a182613622565b92915050565b60016106b38380614482565b905011156107275760405162461bcd60e51b815260206004820152603660248201527f70757263686173655472616974733a2063616e6e6f74207375626d6974206d6f6044820152753932903a3430b71037b732903330b731bc903132b0b960511b60648201526084015b60405180910390fd5b6107318280614482565b90506107406020840184614482565b9050146107c15760405162461bcd60e51b815260206004820152604360248201527f70757263686173655472616974733a2066616e6379206265617220616e64206160448201527f6d6f756e7420746f207370656e64206d757374206d6174636820696e206c656e6064820152620cee8d60eb1b608482015260a40161071e565b600060e08301356107d28480614482565b9050600103610ad7576107e58480614482565b60008181106107f6576107f66144cc565b60045460209091029290920135916001600160a01b03169050634f6ccce761084960016108238980614482565b6000818110610834576108346144cc565b9050602002013561365790919063ffffffff16565b6040518263ffffffff1660e01b815260040161086791815260200190565b602060405180830381865afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a891906144e2565b146108b257600080fd5b60006108c16020860186614482565b60008181106108d2576108d26144cc565b905060200201351115610ad75760045433906001600160a01b0316636352211e6108fc8780614482565b600081811061090d5761090d6144cc565b905060200201356040518263ffffffff1660e01b815260040161093291815260200190565b602060405180830381865afa15801561094f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097391906144fb565b6001600160a01b03161480610a245750600a5433906001600160a01b031663836387106109a08780614482565b60008181106109b1576109b16144cc565b905060200201356040518263ffffffff1660e01b81526004016109d691815260200190565b6020604051808303816000875af11580156109f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1991906144fb565b6001600160a01b0316145b610aa45760405162461bcd60e51b8152602060048201526044602482018190527f70757263686173655472616974733a2063616c6c6572206d757374206f776e20908201527f66616e63792062656172206966207370656e64696e6720686f6e657920696e206064820152633132b0b960e11b608482015260a40161071e565b610ab16020850185614482565b6000818110610ac257610ac26144cc565b9050602002013581610ad4919061452e565b90505b6000610ae7610100860186614482565b905011610b555760405162461bcd60e51b815260206004820152603660248201527f707572636861736554726169747357697468486f6e65793a206d7573742072656044820152751c5d595cdd08185d081b19585cdd080c481d1c985a5d60521b606482015260840161071e565b610b63610120850185614482565b9050610b73610100860186614482565b905014610bfa5760405162461bcd60e51b815260206004820152604960248201527f707572636861736554726169747357697468486f6e65793a207472616974207460448201527f6f6b656e2069647320616e6420616d6f756e7473206d757374206d61746368206064820152680d2dc40d8cadccee8d60bb1b608482015260a40161071e565b60005b610c0b610100860186614482565b9050811015610fb05760036000610c26610100880188614482565b84818110610c3657610c366144cc565b6020908102929092013583525081810192909252604090810160009081206005546001600160a01b031682526004019092528120549003610cce5760405162461bcd60e51b815260206004820152602c60248201527f707572636861736554726169747357697468486f6e65793a20686f6e6579207060448201526b1c9a58d9481b9bdd081cd95d60a21b606482015260840161071e565b60036000610ce0610100880188614482565b84818110610cf057610cf06144cc565b602090810292909201358352508101919091526040016000206003015460ff16610d7d5760405162461bcd60e51b815260206004820152603860248201527f707572636861736554726169747357697468486f6e65793a207472616974206960448201527773206e6f7420617661696c61626c6520666f722073616c6560401b606482015260840161071e565b60036000610d8f610100880188614482565b84818110610d9f57610d9f6144cc565b90506020020135815260200190815260200160002060020154610e2f86806101200190610dcc9190614482565b84818110610ddc57610ddc6144cc565b905060200201356003600089806101000190610df89190614482565b87818110610e0857610e086144cc565b9050602002013581526020019081526020016000206001015461366390919063ffffffff16565b1115610e9e5760405162461bcd60e51b815260206004820152603860248201527f707572636861736554726169747357697468486f6e65793a207265717565737460448201527708195e18d959591cc81cdd5c1c1b1e481bd9881d1c985a5d60421b606482015260840161071e565b610f26610eaf610120870187614482565b83818110610ebf57610ebf6144cc565b905060200201356003600088806101000190610edb9190614482565b86818110610eeb57610eeb6144cc565b6020908102929092013583525081810192909252604090810160009081206005546001600160a01b031682526004019092529020549061366f565b610f30908461452e565b9250610f40610120860186614482565b82818110610f5057610f506144cc565b905060200201356003600087806101000190610f6c9190614482565b85818110610f7c57610f7c6144cc565b9050602002013581526020019081526020016000206001016000828254610fa3919061452e565b9091555050600101610bfd565b50610fbe6060850185614482565b9050610fcd6040860186614482565b9050146110525760405162461bcd60e51b815260206004820152604760248201527f70757263686173655472616974733a20686f6e6579206a61722069647320616e60448201527f6420616d6f756e747320746f207370656e64206d757374206d6174636820696e606482015266040d8cadccee8d60cb1b608482015260a40161071e565b60005b6110626040860186614482565b90508110156111af5760065433906001600160a01b0316636352211e61108b6040890189614482565b8581811061109b5761109b6144cc565b905060200201356040518263ffffffff1660e01b81526004016110c091815260200190565b602060405180830381865afa1580156110dd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110191906144fb565b6001600160a01b0316146111765760405162461bcd60e51b815260206004820152603660248201527f70757263686173655472616974733a2063616c6c6572206d757374206265206f604482015275776e6572206f6620616c6c20686f6e6579206a61727360501b606482015260840161071e565b6111836060860186614482565b82818110611193576111936144cc565b90506020020135826111a5919061452e565b9150600101611055565b5060006111bf6080860186614482565b91508190506111d160a0870187614482565b90501461123d5760405162461bcd60e51b815260206004820152603460248201527f70757263686173655472616974733a20746f6b656e4964734f6e4869766520616044820152730e4e4c2f240d8cadccee8d040dad2e6dac2e8c6d60631b606482015260840161071e565b8061124b60c0870187614482565b9050146112c05760405162461bcd60e51b815260206004820152603960248201527f70757263686173655472616974733a20616d6f756e74546f5370656e644f6e4860448201527f697665206172726179206c656e677468206d69736d6174636800000000000000606482015260840161071e565b60005b8181101561144457336112d96080880188614482565b838181106112e9576112e96144cc565b90506020020160208101906112fe9190614546565b6001600160a01b0316636352211e61131960a08a018a614482565b85818110611329576113296144cc565b905060200201356040518263ffffffff1660e01b815260040161134e91815260200190565b602060405180830381865afa15801561136b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138f91906144fb565b6001600160a01b03161461140b5760405162461bcd60e51b815260206004820152603760248201527f70757263686173655472616974733a2063616c6c657220646f6573206e6f742060448201527f6f776e20746f6b656e206f6e20636f6c6c656374696f6e000000000000000000606482015260840161071e565b61141860c0870187614482565b82818110611428576114286144cc565b905060200201358361143a919061452e565b92506001016112c3565b508282146114ba5760405162461bcd60e51b815260206004820152603d60248201527f70757263686173655472616974733a20686f6e6579207265717569726564206460448201527f6f6573206e6f74206d6174636820686f6e6579207375626d6974746564000000606482015260840161071e565b60e0850135156114e0576005546114e0906001600160a01b0316333060e089013561367b565b60006114ec8680614482565b90501180611508575060006115046040870187614482565b9050115b156117f457600061151c6020870187614482565b905011801561154f575060006115356020870187614482565b6000818110611546576115466144cc565b90506020020135115b156116a6576007546001600160a01b031663d17c1c9f61156f8780614482565b61157c60208a018a614482565b600061158b60408d018d614482565b9050116115a6576040805160008152602081019091526115e5565b6115b360408c018c614482565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050505b60006115f460408e018e614482565b90501161160f5760408051600081526020810190915261164e565b61161c60608d018d614482565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050505b6040518763ffffffff1660e01b815260040161166f969594939291906145af565b600060405180830381600087803b15801561168957600080fd5b505af115801561169d573d6000803e3d6000fd5b505050506117f4565b6007546040805160008082526020820181815282840184526001600160a01b039094169363d17c1c9f939091906116df908b018b614482565b9050116116fa57604080516000815260208101909152611739565b61170760408a018a614482565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050505b600061174860408c018c614482565b905011611763576040805160008152602081019091526117a2565b61177060608b018b614482565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050505b6040518563ffffffff1660e01b81526004016117c1949392919061460b565b600060405180830381600087803b1580156117db57600080fd5b505af11580156117ef573d6000803e3d6000fd5b505050505b60006118036080870187614482565b9050111561189757600b546001600160a01b031663f533c9d46118296080880188614482565b61183660a08a018a614482565b61184360c08c018c614482565b6040518763ffffffff1660e01b815260040161186496959493929190614658565b600060405180830381600087803b15801561187e57600080fd5b505af1158015611892573d6000803e3d6000fd5b505050505b60006118a38680614482565b90501115611952576009546004546001600160a01b03918216916347f56b6991166118ce8880614482565b60008181106118df576118df6144cc565b6005546040516001600160e01b031960e088901b16815261191b95946020909302929092013592506001600160a01b03169089906004016146c5565b600060405180830381600087803b15801561193557600080fd5b505af1158015611949573d6000803e3d6000fd5b505050506119f8565b60006119616020860186614546565b6001600160a01b0316146119f8576009546001600160a01b03166347f56b6961198d6020870187614546565b6005546040516001600160e01b031960e085901b1681526119c5929160208a0135916001600160a01b039091169089906004016146c5565b600060405180830381600087803b1580156119df57600080fd5b505af11580156119f3573d6000803e3d6000fd5b505050505b6008546001600160a01b0316631f7fdffa33611a18610100890189614482565b611a266101208b018b614482565b6040518663ffffffff1660e01b8152600401611a469594939291906146ef565b600060405180830381600087803b158015611a6057600080fd5b505af1158015611a74573d6000803e3d6000fd5b503392507faa5d8a87d361046c955298cdf1cd5de785b7d134d56ffe456806d3de409e89a29150611aab9050610100880188614482565b611ab96101208a018a614482565b604051611ac99493929190614745565b60405180910390a25050505050565b600080516020614937833981519152611af181336136e6565b60005b82811015611c1f5760036000858584818110611b1257611b126144cc565b90506020020135815260200190815260200160002060030160009054906101000a900460ff161560036000868685818110611b4f57611b4f6144cc565b90506020020135815260200190815260200160002060030160006101000a81548160ff021916908315150217905550838382818110611b9057611b906144cc565b905060200201357fa04432bc9092a95cb96adf3c62d3000f9f6b7af5c0a1439fbae35d9b773cf1c060036000878786818110611bce57611bce6144cc565b90506020020135815260200190815260200160002060030160009054906101000a900460ff16604051611c05911515815260200190565b60405180910390a280611c178161476c565b915050611af4565b50505050565b6002805403611c765760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161071e565b60028055600084611ce65760405162461bcd60e51b815260206004820152603460248201527f7075726368617365547261697473576974684554483a206d7573742072657175604482015273195cdd08185d081b19585cdd080c481d1c985a5d60621b606482015260840161071e565b848314611d6b5760405162461bcd60e51b815260206004820152604760248201527f7075726368617365547261697473576974684554483a20747261697420746f6b60448201527f656e2069647320616e6420616d6f756e7473206d757374206d6174636820696e606482015266040d8cadccee8d60cb1b608482015260a40161071e565b60005b8581101561203c5760036000888884818110611d8c57611d8c6144cc565b90506020020135815260200190815260200160002060000154600003611e055760405162461bcd60e51b815260206004820152602860248201527f7075726368617365547261697473576974684554483a20657468207072696365604482015267081b9bdd081cd95d60c21b606482015260840161071e565b60036000888884818110611e1b57611e1b6144cc565b602090810292909201358352508101919091526040016000206003015460ff16611ea65760405162461bcd60e51b815260206004820152603660248201527f7075726368617365547261697473576974684554483a207472616974206973206044820152756e6f7420617661696c61626c6520666f722073616c6560501b606482015260840161071e565b60036000888884818110611ebc57611ebc6144cc565b90506020020135815260200190815260200160002060020154611f07868684818110611eea57611eea6144cc565b90506020020135600360008b8b87818110610e0857610e086144cc565b1115611f745760405162461bcd60e51b815260206004820152603660248201527f7075726368617365547261697473576974684554483a207265717565737420656044820152751e18d959591cc81cdd5c1c1b1e481bd9881d1c985a5d60521b606482015260840161071e565b611fcd858583818110611f8957611f896144cc565b90506020020135600360008a8a86818110611fa657611fa66144cc565b9050602002013581526020019081526020016000206000015461366f90919063ffffffff16565b611fd7908361452e565b9150848482818110611feb57611feb6144cc565b9050602002013560036000898985818110612008576120086144cc565b905060200201358152602001908152602001600020600101600082825461202f919061452e565b9091555050600101611d6e565b813410156120a35760405162461bcd60e51b815260206004820152602e60248201527f7075726368617365547261697473576974684554483a20696e636f727265637460448201526d040c2dadeeadce840decc40cae8d60931b606482015260840161071e565b600854604051630fbfeffd60e11b81526001600160a01b0390911690631f7fdffa906120db9033908b908b908b908b906004016146ef565b600060405180830381600087803b1580156120f557600080fd5b505af1158015612109573d6000803e3d6000fd5b506000925061211e9150506020850185614546565b6001600160a01b0316146121b5576009546001600160a01b03166380b57fd161214a6020860186614546565b6040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526020860135602482015260448101859052606401600060405180830381600087803b15801561219c57600080fd5b505af11580156121b0573d6000803e3d6000fd5b505050505b505060016002555050505050565b6000828152602081905260409020600101546121df81336136e6565b6121e9838361374a565b505050565b60008051602061493783398151915261220781336136e6565b83821461226e5760405162461bcd60e51b815260206004820152602f60248201527f75706461746553616c654461746142756c6b3a20617272617973206d7573742060448201526e0dac2e8c6d040d2dc40d8cadccee8d608b1b606482015260840161071e565b60005b848110156122c6576122be86868381811061228e5761228e6144cc565b905060200201358585848181106122a7576122a76144cc565b90506020028101906122b99190614785565b61376c565b600101612271565b505050505050565b6001600160a01b038116331461233e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161071e565b6123488282613939565b5050565b60008051602061493783398151915261236581336136e6565b60005b82811015611c1f57600060036000868685818110612388576123886144cc565b905060200201358152602001908152602001600020600101819055508383828181106123b6576123b66144cc565b905060200201357fdfdd873df6e0bceeaed28e2561412a65cfb5197f879900a9d4c72de16ab3723260405160405180910390a2806123f38161476c565b915050612368565b600280540361244c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161071e565b600280557f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec61247b81336136e6565b47808311156124e75760405162461bcd60e51b815260206004820152603260248201527f77697468647261774554483a2063616e6e6f74207769746864726177206d6f7260448201527165207468616e207468652062616c616e636560701b606482015260840161071e565b6040516001600160a01b0385169084156108fc029085906000818181858888f1935050505061251557600080fd5b505060016002555050565b60606000808367ffffffffffffffff81111561253e5761253e614563565b604051908082528060200260200182016040528015612567578160200160208202803683370190505b5090505b838210156125f557600086815260036020526040812060040190868685818110612597576125976144cc565b90506020020160208101906125ac9190614546565b6001600160a01b03166001600160a01b03168152602001908152602001600020548183815181106125df576125df6144cc565b602090810291909101015260019091019061256b565b9150505b9392505050565b7f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec61262b81336136e6565b8382146126a2576040805162461bcd60e51b81526020600482015260248101919091527f776974686472617745524332303a20746f6b656e20636f6e747261637473206160448201527f6e6420616d6f756e7473206172726179206c656e677468206d69736d61746368606482015260840161071e565b60005b848110156127a157612701878585848181106126c3576126c36144cc565b905060200201358888858181106126dc576126dc6144cc565b90506020020160208101906126f19190614546565b6001600160a01b0316919061395b565b7f33c35f9541201e342d5e7467016e65a0a06182eb12a5f17103f71cec95b6cb2987878784818110612735576127356144cc565b905060200201602081019061274a9190614546565b86868581811061275c5761275c6144cc565b90506020020135604051612791939291906001600160a01b039384168152919092166020820152604081019190915260600190565b60405180910390a16001016126a5565b50505050505050565b6000805160206149378339815191526127c381336136e6565b858481146128485760405162461bcd60e51b815260206004820152604660248201527f757064617465455243323050726963653a20746f6b656e2069647320616e642060448201527f746f6b656e20636f6e74726163747320646f206e6f74206d6174636820696e206064820152650d8cadccee8d60d31b608482015260a40161071e565b8281146128bd5760405162461bcd60e51b815260206004820152603d60248201527f757064617465455243323050726963653a20746f6b656e2069647320616e642060448201527f70726963657320646f206e6f74206d6174636820696e206c656e677468000000606482015260840161071e565b60005b87811015612b8d578484828181106128da576128da6144cc565b90506020028101906128ec9190614482565b9050878783818110612900576129006144cc565b90506020028101906129129190614482565b9050146129a05760405162461bcd60e51b815260206004820152605060248201527f757064617465455243323050726963653a20746f6b656e20636f6e747261637460448201527f7320616e642070726963657320646f206e6f74206d6174636820696e206c656e60648201526f19dd1a08199bdc881d1bdad95b881a5960821b608482015260a40161071e565b60005b8787838181106129b5576129b56144cc565b90506020028101906129c79190614482565b9050811015612b84578585838181106129e2576129e26144cc565b90506020028101906129f49190614482565b82818110612a0457612a046144cc565b90506020020135600360008c8c86818110612a2157612a216144cc565b90506020020135815260200190815260200160002060040160008a8a86818110612a4d57612a4d6144cc565b9050602002810190612a5f9190614482565b85818110612a6f57612a6f6144cc565b9050602002016020810190612a849190614546565b6001600160a01b03168152602081019190915260400160002055878783818110612ab057612ab06144cc565b9050602002810190612ac29190614482565b82818110612ad257612ad26144cc565b9050602002016020810190612ae79190614546565b6001600160a01b03168a8a84818110612b0257612b026144cc565b905060200201357f10e97cfd97f7a4f385e38c6cfeb8f4bca299d27e2eeaea110521722ad357bc40888886818110612b3c57612b3c6144cc565b9050602002810190612b4e9190614482565b85818110612b5e57612b5e6144cc565b90506020020135604051612b7491815260200190565b60405180910390a36001016129a3565b506001016128c0565b505050505050505050565b60008281526001602052604081206125f9908361398b565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600080516020614937833981519152612bf281336136e6565b838214612c725760405162461bcd60e51b815260206004820152604260248201527f75706461746550726963653a20746f6b656e2049647320616e64206d6178207360448201527f7570706c696573206172726179206d757374206d6174636820696e206c656e676064820152610e8d60f31b608482015260a40161071e565b60005b848110156122c65760036000878784818110612c9357612c936144cc565b90506020020135815260200190815260200160002060010154848483818110612cbe57612cbe6144cc565b905060200201351015612d395760405162461bcd60e51b815260206004820152603960248201527f7570646174654d6178537570706c793a2063616e6e6f7420736574206d61782060448201527f737570706c792062656c6f77206974656d20636f756e74657200000000000000606482015260840161071e565b838382818110612d4b57612d4b6144cc565b9050602002013560036000888885818110612d6857612d686144cc565b90506020020135815260200190815260200160002060020181905550858582818110612d9657612d966144cc565b905060200201357f44ecfc706d63e347851cfd40acfa6cf2e3a41faa3e8b460210c03938e84a91ad858584818110612dd057612dd06144cc565b90506020020135604051612de691815260200190565b60405180910390a280612df88161476c565b915050612c75565b60006001600160a01b038716612e895760405162461bcd60e51b815260206004820152604260248201527f70757263686173655472616974735769746845524332303a20746f6b656e206360448201527f6f6e74726163742063616e6e6f7420626520746865207a65726f206164647265606482015261737360f01b608482015260a40161071e565b84612ef55760405162461bcd60e51b815260206004820152603660248201527f70757263686173655472616974735769746845524332303a206d7573742072656044820152751c5d595cdd08185d081b19585cdd080c481d1c985a5d60521b606482015260840161071e565b848314612f7c5760405162461bcd60e51b815260206004820152604960248201527f70757263686173655472616974735769746845524332303a207472616974207460448201527f6f6b656e2069647320616e6420616d6f756e7473206d757374206d61746368206064820152680d2dc40d8cadccee8d60bb1b608482015260a40161071e565b60005b858110156132885760036000888884818110612f9d57612f9d6144cc565b602090810292909201358352508101919091526040016000206003015460ff1661302a5760405162461bcd60e51b815260206004820152603860248201527f70757263686173655472616974735769746845524332303a207472616974206960448201527773206e6f7420617661696c61626c6520666f722073616c6560401b606482015260840161071e565b60036000888884818110613040576130406144cc565b9050602002013581526020019081526020016000206002015461306e868684818110611eea57611eea6144cc565b11156130dd5760405162461bcd60e51b815260206004820152603860248201527f70757263686173655472616974735769746845524332303a207265717565737460448201527708195e18d959591cc81cdd5c1c1b1e481bd9881d1c985a5d60421b606482015260840161071e565b600360008888848181106130f3576130f36144cc565b9050602002013581526020019081526020016000206004016000896001600160a01b03166001600160a01b031681526020019081526020016000205460000361319d5760405162461bcd60e51b815260206004820152603660248201527f70757263686173655472616974735769746845524332303a20746f6b656e20706044820152751c9a58d948199bdc881d1c985a5d081b9bdd081cd95d60521b606482015260840161071e565b6132198585838181106131b2576131b26144cc565b90506020020135600360008a8a868181106131cf576131cf6144cc565b90506020020135815260200190815260200160002060040160008b6001600160a01b03166001600160a01b031681526020019081526020016000205461366f90919063ffffffff16565b613223908361452e565b9150848482818110613237576132376144cc565b9050602002013560036000898985818110613254576132546144cc565b905060200201358152602001908152602001600020600101600082825461327b919061452e565b9091555050600101612f7f565b60006132976020850185614546565b6001600160a01b03161461331c576009546001600160a01b03166347f56b696132c36020860186614546565b85602001358b866040518563ffffffff1660e01b81526004016132e994939291906146c5565b600060405180830381600087803b15801561330357600080fd5b505af1158015613317573d6000803e3d6000fd5b505050505b6133316001600160a01b03891633308561367b565b600854604051630fbfeffd60e11b81526001600160a01b0390911690631f7fdffa906133699033908b908b908b908b906004016146ef565b600060405180830381600087803b15801561338357600080fd5b505af1158015613397573d6000803e3d6000fd5b50505050336001600160a01b03167faa5d8a87d361046c955298cdf1cd5de785b7d134d56ffe456806d3de409e89a2888888886040516133da9493929190614745565b60405180910390a25050505050505050565b60008181526001602052604081206106a190613997565b60008281526020819052604090206001015461341f81336136e6565b6121e98383613939565b60008051602061493783398151915261344281336136e6565b8382146134b75760405162461bcd60e51b815260206004820152603f60248201527f75706461746545544850726963653a20746f6b656e2049647320616e6420707260448201527f69636573206172726179206d757374206d6174636820696e206c656e67746800606482015260840161071e565b60005b848110156122c6578383828181106134d4576134d46144cc565b90506020020135600360008888858181106134f1576134f16144cc565b9050602002013581526020019081526020016000206000018190555085858281811061351f5761351f6144cc565b905060200201357f8ada4546c77a7e35ede2f59028a5e375180a9aefab2a7360004d5460f6f4ae29858584818110613559576135596144cc565b9050602002013560405161356f91815260200190565b60405180910390a2806135818161476c565b9150506134ba565b6135938282612bb0565b612348576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556135c93390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006125f9836001600160a01b0384166139a1565b60006001600160e01b03198216637965db0b60e01b14806106a157506301ffc9a760e01b6001600160e01b03198316146106a1565b60006125f982846147a5565b60006125f9828461452e565b60006125f982846147bc565b6040516001600160a01b0380851660248301528316604482015260648101829052611c1f9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526139f0565b6136f08282612bb0565b61234857613708816001600160a01b03166014613ac2565b613713836020613ac2565b604051602001613724929190614807565b60408051601f198184030181529082905262461bcd60e51b825261071e9160040161487c565b6137548282613589565b60008281526001602052604090206121e9908261360d565b60008051602061493783398151915261378581336136e6565b61379260a0830183614482565b90506137a16080840184614482565b9050146138045760405162461bcd60e51b815260206004820152602b60248201527f75706461746553616c65446174613a20746f6b656e206172726179206c656e6760448201526a0e8d040dad2e6dac2e8c6d60ab1b606482015260840161071e565b600083815260036020908152604091829020843581559084013560018201559083013560029091015561383d60808301606084016148bd565b6000848152600360208190526040822001805460ff1916921515929092179091555b61386c6080840184614482565b90508110156139085761388260a0840184614482565b82818110613892576138926144cc565b905060200201356003600086815260200190815260200160002060040160008580608001906138c19190614482565b858181106138d1576138d16144cc565b90506020020160208101906138e69190614546565b6001600160a01b0316815260208101919091526040016000205560010161385f565b60405184907fc8495fe7971ceb37aaa76d46be369f8eb8b077d903717c154c0618cec4f3519e90600090a250505050565b6139438282613c5e565b60008281526001602052604090206121e99082613cc3565b6040516001600160a01b0383166024820152604481018290526121e990849063a9059cbb60e01b906064016136af565b60006125f98383613cd8565b60006106a1825490565b60008181526001830160205260408120546139e8575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556106a1565b5060006106a1565b6000613a45826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613d029092919063ffffffff16565b8051909150156121e95780806020019051810190613a6391906148da565b6121e95760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161071e565b60606000613ad18360026147bc565b613adc90600261452e565b67ffffffffffffffff811115613af457613af4614563565b6040519080825280601f01601f191660200182016040528015613b1e576020820181803683370190505b509050600360fc1b81600081518110613b3957613b396144cc565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613b6857613b686144cc565b60200101906001600160f81b031916908160001a9053506000613b8c8460026147bc565b613b9790600161452e565b90505b6001811115613c0f576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613bcb57613bcb6144cc565b1a60f81b828281518110613be157613be16144cc565b60200101906001600160f81b031916908160001a90535060049490941c93613c08816148f7565b9050613b9a565b5083156125f95760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161071e565b613c688282612bb0565b15612348576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006125f9836001600160a01b038416613d19565b6000826000018281548110613cef57613cef6144cc565b9060005260206000200154905092915050565b6060613d118484600085613e0c565b949350505050565b60008181526001830160205260408120548015613e02576000613d3d6001836147a5565b8554909150600090613d51906001906147a5565b9050818114613db6576000866000018281548110613d7157613d716144cc565b9060005260206000200154905080876000018481548110613d9457613d946144cc565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613dc757613dc761490e565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506106a1565b60009150506106a1565b606082471015613e6d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161071e565b6001600160a01b0385163b613ec45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161071e565b600080866001600160a01b03168587604051613ee09190614924565b60006040518083038185875af1925050503d8060008114613f1d576040519150601f19603f3d011682016040523d82523d6000602084013e613f22565b606091505b5091509150613f32828286613f3d565b979650505050505050565b60608315613f4c5750816125f9565b825115613f5c5782518084602001fd5b8160405162461bcd60e51b815260040161071e919061487c565b600060208284031215613f8857600080fd5b81356001600160e01b0319811681146125f957600080fd5b600060408284031215613fb257600080fd5b50919050565b60008060608385031215613fcb57600080fd5b823567ffffffffffffffff811115613fe257600080fd5b83016101408186031215613ff557600080fd5b91506140048460208501613fa0565b90509250929050565b60008083601f84011261401f57600080fd5b50813567ffffffffffffffff81111561403757600080fd5b6020830191508360208260051b850101111561405257600080fd5b9250929050565b6000806020838503121561406c57600080fd5b823567ffffffffffffffff81111561408357600080fd5b61408f8582860161400d565b90969095509350505050565b6000806000806000608086880312156140b357600080fd5b853567ffffffffffffffff808211156140cb57600080fd5b6140d789838a0161400d565b909750955060208801359150808211156140f057600080fd5b506140fd8882890161400d565b909450925061411190508760408801613fa0565b90509295509295909350565b60006020828403121561412f57600080fd5b5035919050565b6001600160a01b038116811461414b57600080fd5b50565b6000806040838503121561416157600080fd5b82359150602083013561417381614136565b809150509250929050565b6000806000806040858703121561419457600080fd5b843567ffffffffffffffff808211156141ac57600080fd5b6141b88883890161400d565b909650945060208701359150808211156141d157600080fd5b506141de8782880161400d565b95989497509550505050565b600080604083850312156141fd57600080fd5b823561420881614136565b946020939093013593505050565b60008060006040848603121561422b57600080fd5b83359250602084013567ffffffffffffffff81111561424957600080fd5b6142558682870161400d565b9497909650939450505050565b600081518084526020808501945080840160005b8381101561429257815187529582019590820190600101614276565b509495945050505050565b6020815260006125f96020830184614262565b6000806000806000606086880312156142c857600080fd5b85356142d381614136565b9450602086013567ffffffffffffffff808211156142f057600080fd5b6142fc89838a0161400d565b9096509450604088013591508082111561431557600080fd5b506143228882890161400d565b969995985093965092949392505050565b6000806000806000806060878903121561434c57600080fd5b863567ffffffffffffffff8082111561436457600080fd5b6143708a838b0161400d565b9098509650602089013591508082111561438957600080fd5b6143958a838b0161400d565b909650945060408901359150808211156143ae57600080fd5b506143bb89828a0161400d565b979a9699509497509295939492505050565b600080604083850312156143e057600080fd5b50508035926020909101359150565b60008060008060008060a0878903121561440857600080fd5b863561441381614136565b9550602087013567ffffffffffffffff8082111561443057600080fd5b61443c8a838b0161400d565b9097509550604089013591508082111561445557600080fd5b5061446289828a0161400d565b909450925061447690508860608901613fa0565b90509295509295509295565b6000808335601e1984360301811261449957600080fd5b83018035915067ffffffffffffffff8211156144b457600080fd5b6020019150600581901b360382131561405257600080fd5b634e487b7160e01b600052603260045260246000fd5b6000602082840312156144f457600080fd5b5051919050565b60006020828403121561450d57600080fd5b81516125f981614136565b634e487b7160e01b600052601160045260246000fd5b6000821982111561454157614541614518565b500190565b60006020828403121561455857600080fd5b81356125f981614136565b634e487b7160e01b600052604160045260246000fd5b81835260006001600160fb1b0383111561459257600080fd5b8260051b8083602087013760009401602001938452509192915050565b6080815260006145c360808301888a614579565b82810360208401526145d6818789614579565b905082810360408401526145ea8186614262565b905082810360608401526145fe8185614262565b9998505050505050505050565b60808152600061461e6080830187614262565b82810360208401526146308187614262565b905082810360408401526146448186614262565b90508281036060840152613f328185614262565b6060808252810186905260008760808301825b8981101561469b57823561467e81614136565b6001600160a01b031682526020928301929091019060010161466b565b5083810360208501526146af81888a614579565b91505082810360408401526145fe818587614579565b6001600160a01b039485168152602081019390935292166040820152606081019190915260800190565b6001600160a01b03861681526080602082018190526000906147149083018688614579565b8281036040840152614727818587614579565b83810360609094019390935250506000815260200195945050505050565b604081526000614759604083018688614579565b8281036020840152613f32818587614579565b60006001820161477e5761477e614518565b5060010190565b6000823560be1983360301811261479b57600080fd5b9190910192915050565b6000828210156147b7576147b7614518565b500390565b60008160001904831182151516156147d6576147d6614518565b500290565b60005b838110156147f65781810151838201526020016147de565b83811115611c1f5750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161483f8160178501602088016147db565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516148708160288401602088016147db565b01602801949350505050565b602081526000825180602084015261489b8160408501602087016147db565b601f01601f19169190910160400192915050565b801515811461414b57600080fd5b6000602082840312156148cf57600080fd5b81356125f9816148af565b6000602082840312156148ec57600080fd5b81516125f9816148af565b60008161490657614906614518565b506000190190565b634e487b7160e01b600052603160045260246000fd5b6000825161479b8184602087016147db56fe241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08a2646970667358221220f7c68cac120a719b5746df30ffd633373153264305965c9679729aedaca70e5164736f6c634300080e003300000000000000000000000087084ec881d5a15c918057f326790db177d218f200000000000000000000000055f3bc084da207b7347538b74cc388deeb3ab4480000000000000000000000007bb5178af214b8c5e714ee29d40045e37bc89d42000000000000000000000000ebfaa4261935abec133b5dc41baf210a2b8eb24d00000000000000000000000033b4fe5e40e4903a0849ca97b3292eac3eb0aa36000000000000000000000000c69661b848b02ce0288c58c0aa01d0d99cb85dfc000000000000000000000000786075ff1962f45ca0fa122d677b9f2925f4a8c600000000000000000000000035c6de1445889df00a9e8c4a2734cc10b02d868a

Deployed Bytecode

0x6080604052600436106101e35760003560e01c80637c095f2b11610102578063c132bfe211610095578063ec87621c11610064578063ec87621c146105fa578063f2d24b321461061c578063f81b78ad1461063c578063fd25d4611461065c57600080fd5b8063c132bfe214610573578063ca15c87314610586578063d547741f146105a6578063e02023a1146105c657600080fd5b80639fa58e35116100d15780639fa58e35146104fe578063a08a6c721461051e578063a217fddf1461053e578063ba9bd4281461055357600080fd5b80637c095f2b1461047e5780638ce343941461049e5780639010d07c146104be57806391d14854146104de57600080fd5b8063327cbe361161017a57806359f627cb1161014957806359f627cb146103f157806372fb4e711461041e5780637651721b1461043e5780637bde97ee1461045e57600080fd5b8063327cbe361461037157806336568abe1461039157806342d6f6f7146103b15780634782f779146103d157600080fd5b806323e3fbc1116101b657806323e3fbc114610272578063248a9ca3146102aa57806324ac8cc2146102e85780632f2ff15d1461035157600080fd5b806301ffc9a7146101e85780630265a02e1461021d578063168b140b1461023f578063238b7bbe1461025f575b600080fd5b3480156101f457600080fd5b50610208610203366004613f76565b61067c565b60405190151581526020015b60405180910390f35b34801561022957600080fd5b5061023d610238366004613fb8565b6106a7565b005b34801561024b57600080fd5b5061023d61025a366004614059565b611ad8565b61023d61026d36600461409b565b611c25565b34801561027e57600080fd5b50600a54610292906001600160a01b031681565b6040516001600160a01b039091168152602001610214565b3480156102b657600080fd5b506102da6102c536600461411d565b60009081526020819052604090206001015490565b604051908152602001610214565b3480156102f457600080fd5b5061032f61030336600461411d565b600360208190526000918252604090912080546001820154600283015492909301549092919060ff1684565b6040805194855260208501939093529183015215156060820152608001610214565b34801561035d57600080fd5b5061023d61036c36600461414e565b6121c3565b34801561037d57600080fd5b5061023d61038c36600461417e565b6121ee565b34801561039d57600080fd5b5061023d6103ac36600461414e565b6122ce565b3480156103bd57600080fd5b5061023d6103cc366004614059565b61234c565b3480156103dd57600080fd5b5061023d6103ec3660046141ea565b6123fb565b3480156103fd57600080fd5b5061041161040c366004614216565b612520565b604051610214919061429d565b34801561042a57600080fd5b50600754610292906001600160a01b031681565b34801561044a57600080fd5b50600454610292906001600160a01b031681565b34801561046a57600080fd5b5061023d6104793660046142b0565b612600565b34801561048a57600080fd5b5061023d610499366004614333565b6127aa565b3480156104aa57600080fd5b50600554610292906001600160a01b031681565b3480156104ca57600080fd5b506102926104d93660046143cd565b612b98565b3480156104ea57600080fd5b506102086104f936600461414e565b612bb0565b34801561050a57600080fd5b50600954610292906001600160a01b031681565b34801561052a57600080fd5b50600854610292906001600160a01b031681565b34801561054a57600080fd5b506102da600081565b34801561055f57600080fd5b5061023d61056e36600461417e565b612bd9565b61023d6105813660046143ef565b612e00565b34801561059257600080fd5b506102da6105a136600461411d565b6133ec565b3480156105b257600080fd5b5061023d6105c136600461414e565b613403565b3480156105d257600080fd5b506102da7f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec81565b34801561060657600080fd5b506102da60008051602061493783398151915281565b34801561062857600080fd5b5061023d61063736600461417e565b613429565b34801561064857600080fd5b50600654610292906001600160a01b031681565b34801561066857600080fd5b50600b54610292906001600160a01b031681565b60006001600160e01b03198216635a05180f60e01b14806106a157506106a182613622565b92915050565b60016106b38380614482565b905011156107275760405162461bcd60e51b815260206004820152603660248201527f70757263686173655472616974733a2063616e6e6f74207375626d6974206d6f6044820152753932903a3430b71037b732903330b731bc903132b0b960511b60648201526084015b60405180910390fd5b6107318280614482565b90506107406020840184614482565b9050146107c15760405162461bcd60e51b815260206004820152604360248201527f70757263686173655472616974733a2066616e6379206265617220616e64206160448201527f6d6f756e7420746f207370656e64206d757374206d6174636820696e206c656e6064820152620cee8d60eb1b608482015260a40161071e565b600060e08301356107d28480614482565b9050600103610ad7576107e58480614482565b60008181106107f6576107f66144cc565b60045460209091029290920135916001600160a01b03169050634f6ccce761084960016108238980614482565b6000818110610834576108346144cc565b9050602002013561365790919063ffffffff16565b6040518263ffffffff1660e01b815260040161086791815260200190565b602060405180830381865afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a891906144e2565b146108b257600080fd5b60006108c16020860186614482565b60008181106108d2576108d26144cc565b905060200201351115610ad75760045433906001600160a01b0316636352211e6108fc8780614482565b600081811061090d5761090d6144cc565b905060200201356040518263ffffffff1660e01b815260040161093291815260200190565b602060405180830381865afa15801561094f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097391906144fb565b6001600160a01b03161480610a245750600a5433906001600160a01b031663836387106109a08780614482565b60008181106109b1576109b16144cc565b905060200201356040518263ffffffff1660e01b81526004016109d691815260200190565b6020604051808303816000875af11580156109f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1991906144fb565b6001600160a01b0316145b610aa45760405162461bcd60e51b8152602060048201526044602482018190527f70757263686173655472616974733a2063616c6c6572206d757374206f776e20908201527f66616e63792062656172206966207370656e64696e6720686f6e657920696e206064820152633132b0b960e11b608482015260a40161071e565b610ab16020850185614482565b6000818110610ac257610ac26144cc565b9050602002013581610ad4919061452e565b90505b6000610ae7610100860186614482565b905011610b555760405162461bcd60e51b815260206004820152603660248201527f707572636861736554726169747357697468486f6e65793a206d7573742072656044820152751c5d595cdd08185d081b19585cdd080c481d1c985a5d60521b606482015260840161071e565b610b63610120850185614482565b9050610b73610100860186614482565b905014610bfa5760405162461bcd60e51b815260206004820152604960248201527f707572636861736554726169747357697468486f6e65793a207472616974207460448201527f6f6b656e2069647320616e6420616d6f756e7473206d757374206d61746368206064820152680d2dc40d8cadccee8d60bb1b608482015260a40161071e565b60005b610c0b610100860186614482565b9050811015610fb05760036000610c26610100880188614482565b84818110610c3657610c366144cc565b6020908102929092013583525081810192909252604090810160009081206005546001600160a01b031682526004019092528120549003610cce5760405162461bcd60e51b815260206004820152602c60248201527f707572636861736554726169747357697468486f6e65793a20686f6e6579207060448201526b1c9a58d9481b9bdd081cd95d60a21b606482015260840161071e565b60036000610ce0610100880188614482565b84818110610cf057610cf06144cc565b602090810292909201358352508101919091526040016000206003015460ff16610d7d5760405162461bcd60e51b815260206004820152603860248201527f707572636861736554726169747357697468486f6e65793a207472616974206960448201527773206e6f7420617661696c61626c6520666f722073616c6560401b606482015260840161071e565b60036000610d8f610100880188614482565b84818110610d9f57610d9f6144cc565b90506020020135815260200190815260200160002060020154610e2f86806101200190610dcc9190614482565b84818110610ddc57610ddc6144cc565b905060200201356003600089806101000190610df89190614482565b87818110610e0857610e086144cc565b9050602002013581526020019081526020016000206001015461366390919063ffffffff16565b1115610e9e5760405162461bcd60e51b815260206004820152603860248201527f707572636861736554726169747357697468486f6e65793a207265717565737460448201527708195e18d959591cc81cdd5c1c1b1e481bd9881d1c985a5d60421b606482015260840161071e565b610f26610eaf610120870187614482565b83818110610ebf57610ebf6144cc565b905060200201356003600088806101000190610edb9190614482565b86818110610eeb57610eeb6144cc565b6020908102929092013583525081810192909252604090810160009081206005546001600160a01b031682526004019092529020549061366f565b610f30908461452e565b9250610f40610120860186614482565b82818110610f5057610f506144cc565b905060200201356003600087806101000190610f6c9190614482565b85818110610f7c57610f7c6144cc565b9050602002013581526020019081526020016000206001016000828254610fa3919061452e565b9091555050600101610bfd565b50610fbe6060850185614482565b9050610fcd6040860186614482565b9050146110525760405162461bcd60e51b815260206004820152604760248201527f70757263686173655472616974733a20686f6e6579206a61722069647320616e60448201527f6420616d6f756e747320746f207370656e64206d757374206d6174636820696e606482015266040d8cadccee8d60cb1b608482015260a40161071e565b60005b6110626040860186614482565b90508110156111af5760065433906001600160a01b0316636352211e61108b6040890189614482565b8581811061109b5761109b6144cc565b905060200201356040518263ffffffff1660e01b81526004016110c091815260200190565b602060405180830381865afa1580156110dd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110191906144fb565b6001600160a01b0316146111765760405162461bcd60e51b815260206004820152603660248201527f70757263686173655472616974733a2063616c6c6572206d757374206265206f604482015275776e6572206f6620616c6c20686f6e6579206a61727360501b606482015260840161071e565b6111836060860186614482565b82818110611193576111936144cc565b90506020020135826111a5919061452e565b9150600101611055565b5060006111bf6080860186614482565b91508190506111d160a0870187614482565b90501461123d5760405162461bcd60e51b815260206004820152603460248201527f70757263686173655472616974733a20746f6b656e4964734f6e4869766520616044820152730e4e4c2f240d8cadccee8d040dad2e6dac2e8c6d60631b606482015260840161071e565b8061124b60c0870187614482565b9050146112c05760405162461bcd60e51b815260206004820152603960248201527f70757263686173655472616974733a20616d6f756e74546f5370656e644f6e4860448201527f697665206172726179206c656e677468206d69736d6174636800000000000000606482015260840161071e565b60005b8181101561144457336112d96080880188614482565b838181106112e9576112e96144cc565b90506020020160208101906112fe9190614546565b6001600160a01b0316636352211e61131960a08a018a614482565b85818110611329576113296144cc565b905060200201356040518263ffffffff1660e01b815260040161134e91815260200190565b602060405180830381865afa15801561136b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138f91906144fb565b6001600160a01b03161461140b5760405162461bcd60e51b815260206004820152603760248201527f70757263686173655472616974733a2063616c6c657220646f6573206e6f742060448201527f6f776e20746f6b656e206f6e20636f6c6c656374696f6e000000000000000000606482015260840161071e565b61141860c0870187614482565b82818110611428576114286144cc565b905060200201358361143a919061452e565b92506001016112c3565b508282146114ba5760405162461bcd60e51b815260206004820152603d60248201527f70757263686173655472616974733a20686f6e6579207265717569726564206460448201527f6f6573206e6f74206d6174636820686f6e6579207375626d6974746564000000606482015260840161071e565b60e0850135156114e0576005546114e0906001600160a01b0316333060e089013561367b565b60006114ec8680614482565b90501180611508575060006115046040870187614482565b9050115b156117f457600061151c6020870187614482565b905011801561154f575060006115356020870187614482565b6000818110611546576115466144cc565b90506020020135115b156116a6576007546001600160a01b031663d17c1c9f61156f8780614482565b61157c60208a018a614482565b600061158b60408d018d614482565b9050116115a6576040805160008152602081019091526115e5565b6115b360408c018c614482565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050505b60006115f460408e018e614482565b90501161160f5760408051600081526020810190915261164e565b61161c60608d018d614482565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050505b6040518763ffffffff1660e01b815260040161166f969594939291906145af565b600060405180830381600087803b15801561168957600080fd5b505af115801561169d573d6000803e3d6000fd5b505050506117f4565b6007546040805160008082526020820181815282840184526001600160a01b039094169363d17c1c9f939091906116df908b018b614482565b9050116116fa57604080516000815260208101909152611739565b61170760408a018a614482565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050505b600061174860408c018c614482565b905011611763576040805160008152602081019091526117a2565b61177060608b018b614482565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050505b6040518563ffffffff1660e01b81526004016117c1949392919061460b565b600060405180830381600087803b1580156117db57600080fd5b505af11580156117ef573d6000803e3d6000fd5b505050505b60006118036080870187614482565b9050111561189757600b546001600160a01b031663f533c9d46118296080880188614482565b61183660a08a018a614482565b61184360c08c018c614482565b6040518763ffffffff1660e01b815260040161186496959493929190614658565b600060405180830381600087803b15801561187e57600080fd5b505af1158015611892573d6000803e3d6000fd5b505050505b60006118a38680614482565b90501115611952576009546004546001600160a01b03918216916347f56b6991166118ce8880614482565b60008181106118df576118df6144cc565b6005546040516001600160e01b031960e088901b16815261191b95946020909302929092013592506001600160a01b03169089906004016146c5565b600060405180830381600087803b15801561193557600080fd5b505af1158015611949573d6000803e3d6000fd5b505050506119f8565b60006119616020860186614546565b6001600160a01b0316146119f8576009546001600160a01b03166347f56b6961198d6020870187614546565b6005546040516001600160e01b031960e085901b1681526119c5929160208a0135916001600160a01b039091169089906004016146c5565b600060405180830381600087803b1580156119df57600080fd5b505af11580156119f3573d6000803e3d6000fd5b505050505b6008546001600160a01b0316631f7fdffa33611a18610100890189614482565b611a266101208b018b614482565b6040518663ffffffff1660e01b8152600401611a469594939291906146ef565b600060405180830381600087803b158015611a6057600080fd5b505af1158015611a74573d6000803e3d6000fd5b503392507faa5d8a87d361046c955298cdf1cd5de785b7d134d56ffe456806d3de409e89a29150611aab9050610100880188614482565b611ab96101208a018a614482565b604051611ac99493929190614745565b60405180910390a25050505050565b600080516020614937833981519152611af181336136e6565b60005b82811015611c1f5760036000858584818110611b1257611b126144cc565b90506020020135815260200190815260200160002060030160009054906101000a900460ff161560036000868685818110611b4f57611b4f6144cc565b90506020020135815260200190815260200160002060030160006101000a81548160ff021916908315150217905550838382818110611b9057611b906144cc565b905060200201357fa04432bc9092a95cb96adf3c62d3000f9f6b7af5c0a1439fbae35d9b773cf1c060036000878786818110611bce57611bce6144cc565b90506020020135815260200190815260200160002060030160009054906101000a900460ff16604051611c05911515815260200190565b60405180910390a280611c178161476c565b915050611af4565b50505050565b6002805403611c765760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161071e565b60028055600084611ce65760405162461bcd60e51b815260206004820152603460248201527f7075726368617365547261697473576974684554483a206d7573742072657175604482015273195cdd08185d081b19585cdd080c481d1c985a5d60621b606482015260840161071e565b848314611d6b5760405162461bcd60e51b815260206004820152604760248201527f7075726368617365547261697473576974684554483a20747261697420746f6b60448201527f656e2069647320616e6420616d6f756e7473206d757374206d6174636820696e606482015266040d8cadccee8d60cb1b608482015260a40161071e565b60005b8581101561203c5760036000888884818110611d8c57611d8c6144cc565b90506020020135815260200190815260200160002060000154600003611e055760405162461bcd60e51b815260206004820152602860248201527f7075726368617365547261697473576974684554483a20657468207072696365604482015267081b9bdd081cd95d60c21b606482015260840161071e565b60036000888884818110611e1b57611e1b6144cc565b602090810292909201358352508101919091526040016000206003015460ff16611ea65760405162461bcd60e51b815260206004820152603660248201527f7075726368617365547261697473576974684554483a207472616974206973206044820152756e6f7420617661696c61626c6520666f722073616c6560501b606482015260840161071e565b60036000888884818110611ebc57611ebc6144cc565b90506020020135815260200190815260200160002060020154611f07868684818110611eea57611eea6144cc565b90506020020135600360008b8b87818110610e0857610e086144cc565b1115611f745760405162461bcd60e51b815260206004820152603660248201527f7075726368617365547261697473576974684554483a207265717565737420656044820152751e18d959591cc81cdd5c1c1b1e481bd9881d1c985a5d60521b606482015260840161071e565b611fcd858583818110611f8957611f896144cc565b90506020020135600360008a8a86818110611fa657611fa66144cc565b9050602002013581526020019081526020016000206000015461366f90919063ffffffff16565b611fd7908361452e565b9150848482818110611feb57611feb6144cc565b9050602002013560036000898985818110612008576120086144cc565b905060200201358152602001908152602001600020600101600082825461202f919061452e565b9091555050600101611d6e565b813410156120a35760405162461bcd60e51b815260206004820152602e60248201527f7075726368617365547261697473576974684554483a20696e636f727265637460448201526d040c2dadeeadce840decc40cae8d60931b606482015260840161071e565b600854604051630fbfeffd60e11b81526001600160a01b0390911690631f7fdffa906120db9033908b908b908b908b906004016146ef565b600060405180830381600087803b1580156120f557600080fd5b505af1158015612109573d6000803e3d6000fd5b506000925061211e9150506020850185614546565b6001600160a01b0316146121b5576009546001600160a01b03166380b57fd161214a6020860186614546565b6040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526020860135602482015260448101859052606401600060405180830381600087803b15801561219c57600080fd5b505af11580156121b0573d6000803e3d6000fd5b505050505b505060016002555050505050565b6000828152602081905260409020600101546121df81336136e6565b6121e9838361374a565b505050565b60008051602061493783398151915261220781336136e6565b83821461226e5760405162461bcd60e51b815260206004820152602f60248201527f75706461746553616c654461746142756c6b3a20617272617973206d7573742060448201526e0dac2e8c6d040d2dc40d8cadccee8d608b1b606482015260840161071e565b60005b848110156122c6576122be86868381811061228e5761228e6144cc565b905060200201358585848181106122a7576122a76144cc565b90506020028101906122b99190614785565b61376c565b600101612271565b505050505050565b6001600160a01b038116331461233e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161071e565b6123488282613939565b5050565b60008051602061493783398151915261236581336136e6565b60005b82811015611c1f57600060036000868685818110612388576123886144cc565b905060200201358152602001908152602001600020600101819055508383828181106123b6576123b66144cc565b905060200201357fdfdd873df6e0bceeaed28e2561412a65cfb5197f879900a9d4c72de16ab3723260405160405180910390a2806123f38161476c565b915050612368565b600280540361244c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161071e565b600280557f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec61247b81336136e6565b47808311156124e75760405162461bcd60e51b815260206004820152603260248201527f77697468647261774554483a2063616e6e6f74207769746864726177206d6f7260448201527165207468616e207468652062616c616e636560701b606482015260840161071e565b6040516001600160a01b0385169084156108fc029085906000818181858888f1935050505061251557600080fd5b505060016002555050565b60606000808367ffffffffffffffff81111561253e5761253e614563565b604051908082528060200260200182016040528015612567578160200160208202803683370190505b5090505b838210156125f557600086815260036020526040812060040190868685818110612597576125976144cc565b90506020020160208101906125ac9190614546565b6001600160a01b03166001600160a01b03168152602001908152602001600020548183815181106125df576125df6144cc565b602090810291909101015260019091019061256b565b9150505b9392505050565b7f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec61262b81336136e6565b8382146126a2576040805162461bcd60e51b81526020600482015260248101919091527f776974686472617745524332303a20746f6b656e20636f6e747261637473206160448201527f6e6420616d6f756e7473206172726179206c656e677468206d69736d61746368606482015260840161071e565b60005b848110156127a157612701878585848181106126c3576126c36144cc565b905060200201358888858181106126dc576126dc6144cc565b90506020020160208101906126f19190614546565b6001600160a01b0316919061395b565b7f33c35f9541201e342d5e7467016e65a0a06182eb12a5f17103f71cec95b6cb2987878784818110612735576127356144cc565b905060200201602081019061274a9190614546565b86868581811061275c5761275c6144cc565b90506020020135604051612791939291906001600160a01b039384168152919092166020820152604081019190915260600190565b60405180910390a16001016126a5565b50505050505050565b6000805160206149378339815191526127c381336136e6565b858481146128485760405162461bcd60e51b815260206004820152604660248201527f757064617465455243323050726963653a20746f6b656e2069647320616e642060448201527f746f6b656e20636f6e74726163747320646f206e6f74206d6174636820696e206064820152650d8cadccee8d60d31b608482015260a40161071e565b8281146128bd5760405162461bcd60e51b815260206004820152603d60248201527f757064617465455243323050726963653a20746f6b656e2069647320616e642060448201527f70726963657320646f206e6f74206d6174636820696e206c656e677468000000606482015260840161071e565b60005b87811015612b8d578484828181106128da576128da6144cc565b90506020028101906128ec9190614482565b9050878783818110612900576129006144cc565b90506020028101906129129190614482565b9050146129a05760405162461bcd60e51b815260206004820152605060248201527f757064617465455243323050726963653a20746f6b656e20636f6e747261637460448201527f7320616e642070726963657320646f206e6f74206d6174636820696e206c656e60648201526f19dd1a08199bdc881d1bdad95b881a5960821b608482015260a40161071e565b60005b8787838181106129b5576129b56144cc565b90506020028101906129c79190614482565b9050811015612b84578585838181106129e2576129e26144cc565b90506020028101906129f49190614482565b82818110612a0457612a046144cc565b90506020020135600360008c8c86818110612a2157612a216144cc565b90506020020135815260200190815260200160002060040160008a8a86818110612a4d57612a4d6144cc565b9050602002810190612a5f9190614482565b85818110612a6f57612a6f6144cc565b9050602002016020810190612a849190614546565b6001600160a01b03168152602081019190915260400160002055878783818110612ab057612ab06144cc565b9050602002810190612ac29190614482565b82818110612ad257612ad26144cc565b9050602002016020810190612ae79190614546565b6001600160a01b03168a8a84818110612b0257612b026144cc565b905060200201357f10e97cfd97f7a4f385e38c6cfeb8f4bca299d27e2eeaea110521722ad357bc40888886818110612b3c57612b3c6144cc565b9050602002810190612b4e9190614482565b85818110612b5e57612b5e6144cc565b90506020020135604051612b7491815260200190565b60405180910390a36001016129a3565b506001016128c0565b505050505050505050565b60008281526001602052604081206125f9908361398b565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600080516020614937833981519152612bf281336136e6565b838214612c725760405162461bcd60e51b815260206004820152604260248201527f75706461746550726963653a20746f6b656e2049647320616e64206d6178207360448201527f7570706c696573206172726179206d757374206d6174636820696e206c656e676064820152610e8d60f31b608482015260a40161071e565b60005b848110156122c65760036000878784818110612c9357612c936144cc565b90506020020135815260200190815260200160002060010154848483818110612cbe57612cbe6144cc565b905060200201351015612d395760405162461bcd60e51b815260206004820152603960248201527f7570646174654d6178537570706c793a2063616e6e6f7420736574206d61782060448201527f737570706c792062656c6f77206974656d20636f756e74657200000000000000606482015260840161071e565b838382818110612d4b57612d4b6144cc565b9050602002013560036000888885818110612d6857612d686144cc565b90506020020135815260200190815260200160002060020181905550858582818110612d9657612d966144cc565b905060200201357f44ecfc706d63e347851cfd40acfa6cf2e3a41faa3e8b460210c03938e84a91ad858584818110612dd057612dd06144cc565b90506020020135604051612de691815260200190565b60405180910390a280612df88161476c565b915050612c75565b60006001600160a01b038716612e895760405162461bcd60e51b815260206004820152604260248201527f70757263686173655472616974735769746845524332303a20746f6b656e206360448201527f6f6e74726163742063616e6e6f7420626520746865207a65726f206164647265606482015261737360f01b608482015260a40161071e565b84612ef55760405162461bcd60e51b815260206004820152603660248201527f70757263686173655472616974735769746845524332303a206d7573742072656044820152751c5d595cdd08185d081b19585cdd080c481d1c985a5d60521b606482015260840161071e565b848314612f7c5760405162461bcd60e51b815260206004820152604960248201527f70757263686173655472616974735769746845524332303a207472616974207460448201527f6f6b656e2069647320616e6420616d6f756e7473206d757374206d61746368206064820152680d2dc40d8cadccee8d60bb1b608482015260a40161071e565b60005b858110156132885760036000888884818110612f9d57612f9d6144cc565b602090810292909201358352508101919091526040016000206003015460ff1661302a5760405162461bcd60e51b815260206004820152603860248201527f70757263686173655472616974735769746845524332303a207472616974206960448201527773206e6f7420617661696c61626c6520666f722073616c6560401b606482015260840161071e565b60036000888884818110613040576130406144cc565b9050602002013581526020019081526020016000206002015461306e868684818110611eea57611eea6144cc565b11156130dd5760405162461bcd60e51b815260206004820152603860248201527f70757263686173655472616974735769746845524332303a207265717565737460448201527708195e18d959591cc81cdd5c1c1b1e481bd9881d1c985a5d60421b606482015260840161071e565b600360008888848181106130f3576130f36144cc565b9050602002013581526020019081526020016000206004016000896001600160a01b03166001600160a01b031681526020019081526020016000205460000361319d5760405162461bcd60e51b815260206004820152603660248201527f70757263686173655472616974735769746845524332303a20746f6b656e20706044820152751c9a58d948199bdc881d1c985a5d081b9bdd081cd95d60521b606482015260840161071e565b6132198585838181106131b2576131b26144cc565b90506020020135600360008a8a868181106131cf576131cf6144cc565b90506020020135815260200190815260200160002060040160008b6001600160a01b03166001600160a01b031681526020019081526020016000205461366f90919063ffffffff16565b613223908361452e565b9150848482818110613237576132376144cc565b9050602002013560036000898985818110613254576132546144cc565b905060200201358152602001908152602001600020600101600082825461327b919061452e565b9091555050600101612f7f565b60006132976020850185614546565b6001600160a01b03161461331c576009546001600160a01b03166347f56b696132c36020860186614546565b85602001358b866040518563ffffffff1660e01b81526004016132e994939291906146c5565b600060405180830381600087803b15801561330357600080fd5b505af1158015613317573d6000803e3d6000fd5b505050505b6133316001600160a01b03891633308561367b565b600854604051630fbfeffd60e11b81526001600160a01b0390911690631f7fdffa906133699033908b908b908b908b906004016146ef565b600060405180830381600087803b15801561338357600080fd5b505af1158015613397573d6000803e3d6000fd5b50505050336001600160a01b03167faa5d8a87d361046c955298cdf1cd5de785b7d134d56ffe456806d3de409e89a2888888886040516133da9493929190614745565b60405180910390a25050505050505050565b60008181526001602052604081206106a190613997565b60008281526020819052604090206001015461341f81336136e6565b6121e98383613939565b60008051602061493783398151915261344281336136e6565b8382146134b75760405162461bcd60e51b815260206004820152603f60248201527f75706461746545544850726963653a20746f6b656e2049647320616e6420707260448201527f69636573206172726179206d757374206d6174636820696e206c656e67746800606482015260840161071e565b60005b848110156122c6578383828181106134d4576134d46144cc565b90506020020135600360008888858181106134f1576134f16144cc565b9050602002013581526020019081526020016000206000018190555085858281811061351f5761351f6144cc565b905060200201357f8ada4546c77a7e35ede2f59028a5e375180a9aefab2a7360004d5460f6f4ae29858584818110613559576135596144cc565b9050602002013560405161356f91815260200190565b60405180910390a2806135818161476c565b9150506134ba565b6135938282612bb0565b612348576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556135c93390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006125f9836001600160a01b0384166139a1565b60006001600160e01b03198216637965db0b60e01b14806106a157506301ffc9a760e01b6001600160e01b03198316146106a1565b60006125f982846147a5565b60006125f9828461452e565b60006125f982846147bc565b6040516001600160a01b0380851660248301528316604482015260648101829052611c1f9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526139f0565b6136f08282612bb0565b61234857613708816001600160a01b03166014613ac2565b613713836020613ac2565b604051602001613724929190614807565b60408051601f198184030181529082905262461bcd60e51b825261071e9160040161487c565b6137548282613589565b60008281526001602052604090206121e9908261360d565b60008051602061493783398151915261378581336136e6565b61379260a0830183614482565b90506137a16080840184614482565b9050146138045760405162461bcd60e51b815260206004820152602b60248201527f75706461746553616c65446174613a20746f6b656e206172726179206c656e6760448201526a0e8d040dad2e6dac2e8c6d60ab1b606482015260840161071e565b600083815260036020908152604091829020843581559084013560018201559083013560029091015561383d60808301606084016148bd565b6000848152600360208190526040822001805460ff1916921515929092179091555b61386c6080840184614482565b90508110156139085761388260a0840184614482565b82818110613892576138926144cc565b905060200201356003600086815260200190815260200160002060040160008580608001906138c19190614482565b858181106138d1576138d16144cc565b90506020020160208101906138e69190614546565b6001600160a01b0316815260208101919091526040016000205560010161385f565b60405184907fc8495fe7971ceb37aaa76d46be369f8eb8b077d903717c154c0618cec4f3519e90600090a250505050565b6139438282613c5e565b60008281526001602052604090206121e99082613cc3565b6040516001600160a01b0383166024820152604481018290526121e990849063a9059cbb60e01b906064016136af565b60006125f98383613cd8565b60006106a1825490565b60008181526001830160205260408120546139e8575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556106a1565b5060006106a1565b6000613a45826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613d029092919063ffffffff16565b8051909150156121e95780806020019051810190613a6391906148da565b6121e95760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161071e565b60606000613ad18360026147bc565b613adc90600261452e565b67ffffffffffffffff811115613af457613af4614563565b6040519080825280601f01601f191660200182016040528015613b1e576020820181803683370190505b509050600360fc1b81600081518110613b3957613b396144cc565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613b6857613b686144cc565b60200101906001600160f81b031916908160001a9053506000613b8c8460026147bc565b613b9790600161452e565b90505b6001811115613c0f576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613bcb57613bcb6144cc565b1a60f81b828281518110613be157613be16144cc565b60200101906001600160f81b031916908160001a90535060049490941c93613c08816148f7565b9050613b9a565b5083156125f95760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161071e565b613c688282612bb0565b15612348576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006125f9836001600160a01b038416613d19565b6000826000018281548110613cef57613cef6144cc565b9060005260206000200154905092915050565b6060613d118484600085613e0c565b949350505050565b60008181526001830160205260408120548015613e02576000613d3d6001836147a5565b8554909150600090613d51906001906147a5565b9050818114613db6576000866000018281548110613d7157613d716144cc565b9060005260206000200154905080876000018481548110613d9457613d946144cc565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613dc757613dc761490e565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506106a1565b60009150506106a1565b606082471015613e6d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161071e565b6001600160a01b0385163b613ec45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161071e565b600080866001600160a01b03168587604051613ee09190614924565b60006040518083038185875af1925050503d8060008114613f1d576040519150601f19603f3d011682016040523d82523d6000602084013e613f22565b606091505b5091509150613f32828286613f3d565b979650505050505050565b60608315613f4c5750816125f9565b825115613f5c5782518084602001fd5b8160405162461bcd60e51b815260040161071e919061487c565b600060208284031215613f8857600080fd5b81356001600160e01b0319811681146125f957600080fd5b600060408284031215613fb257600080fd5b50919050565b60008060608385031215613fcb57600080fd5b823567ffffffffffffffff811115613fe257600080fd5b83016101408186031215613ff557600080fd5b91506140048460208501613fa0565b90509250929050565b60008083601f84011261401f57600080fd5b50813567ffffffffffffffff81111561403757600080fd5b6020830191508360208260051b850101111561405257600080fd5b9250929050565b6000806020838503121561406c57600080fd5b823567ffffffffffffffff81111561408357600080fd5b61408f8582860161400d565b90969095509350505050565b6000806000806000608086880312156140b357600080fd5b853567ffffffffffffffff808211156140cb57600080fd5b6140d789838a0161400d565b909750955060208801359150808211156140f057600080fd5b506140fd8882890161400d565b909450925061411190508760408801613fa0565b90509295509295909350565b60006020828403121561412f57600080fd5b5035919050565b6001600160a01b038116811461414b57600080fd5b50565b6000806040838503121561416157600080fd5b82359150602083013561417381614136565b809150509250929050565b6000806000806040858703121561419457600080fd5b843567ffffffffffffffff808211156141ac57600080fd5b6141b88883890161400d565b909650945060208701359150808211156141d157600080fd5b506141de8782880161400d565b95989497509550505050565b600080604083850312156141fd57600080fd5b823561420881614136565b946020939093013593505050565b60008060006040848603121561422b57600080fd5b83359250602084013567ffffffffffffffff81111561424957600080fd5b6142558682870161400d565b9497909650939450505050565b600081518084526020808501945080840160005b8381101561429257815187529582019590820190600101614276565b509495945050505050565b6020815260006125f96020830184614262565b6000806000806000606086880312156142c857600080fd5b85356142d381614136565b9450602086013567ffffffffffffffff808211156142f057600080fd5b6142fc89838a0161400d565b9096509450604088013591508082111561431557600080fd5b506143228882890161400d565b969995985093965092949392505050565b6000806000806000806060878903121561434c57600080fd5b863567ffffffffffffffff8082111561436457600080fd5b6143708a838b0161400d565b9098509650602089013591508082111561438957600080fd5b6143958a838b0161400d565b909650945060408901359150808211156143ae57600080fd5b506143bb89828a0161400d565b979a9699509497509295939492505050565b600080604083850312156143e057600080fd5b50508035926020909101359150565b60008060008060008060a0878903121561440857600080fd5b863561441381614136565b9550602087013567ffffffffffffffff8082111561443057600080fd5b61443c8a838b0161400d565b9097509550604089013591508082111561445557600080fd5b5061446289828a0161400d565b909450925061447690508860608901613fa0565b90509295509295509295565b6000808335601e1984360301811261449957600080fd5b83018035915067ffffffffffffffff8211156144b457600080fd5b6020019150600581901b360382131561405257600080fd5b634e487b7160e01b600052603260045260246000fd5b6000602082840312156144f457600080fd5b5051919050565b60006020828403121561450d57600080fd5b81516125f981614136565b634e487b7160e01b600052601160045260246000fd5b6000821982111561454157614541614518565b500190565b60006020828403121561455857600080fd5b81356125f981614136565b634e487b7160e01b600052604160045260246000fd5b81835260006001600160fb1b0383111561459257600080fd5b8260051b8083602087013760009401602001938452509192915050565b6080815260006145c360808301888a614579565b82810360208401526145d6818789614579565b905082810360408401526145ea8186614262565b905082810360608401526145fe8185614262565b9998505050505050505050565b60808152600061461e6080830187614262565b82810360208401526146308187614262565b905082810360408401526146448186614262565b90508281036060840152613f328185614262565b6060808252810186905260008760808301825b8981101561469b57823561467e81614136565b6001600160a01b031682526020928301929091019060010161466b565b5083810360208501526146af81888a614579565b91505082810360408401526145fe818587614579565b6001600160a01b039485168152602081019390935292166040820152606081019190915260800190565b6001600160a01b03861681526080602082018190526000906147149083018688614579565b8281036040840152614727818587614579565b83810360609094019390935250506000815260200195945050505050565b604081526000614759604083018688614579565b8281036020840152613f32818587614579565b60006001820161477e5761477e614518565b5060010190565b6000823560be1983360301811261479b57600080fd5b9190910192915050565b6000828210156147b7576147b7614518565b500390565b60008160001904831182151516156147d6576147d6614518565b500290565b60005b838110156147f65781810151838201526020016147de565b83811115611c1f5750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161483f8160178501602088016147db565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516148708160288401602088016147db565b01602801949350505050565b602081526000825180602084015261489b8160408501602087016147db565b601f01601f19169190910160400192915050565b801515811461414b57600080fd5b6000602082840312156148cf57600080fd5b81356125f9816148af565b6000602082840312156148ec57600080fd5b81516125f9816148af565b60008161490657614906614518565b506000190190565b634e487b7160e01b600052603160045260246000fd5b6000825161479b8184602087016147db56fe241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08a2646970667358221220f7c68cac120a719b5746df30ffd633373153264305965c9679729aedaca70e5164736f6c634300080e0033

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

00000000000000000000000087084ec881d5a15c918057f326790db177d218f200000000000000000000000055f3bc084da207b7347538b74cc388deeb3ab4480000000000000000000000007bb5178af214b8c5e714ee29d40045e37bc89d42000000000000000000000000ebfaa4261935abec133b5dc41baf210a2b8eb24d00000000000000000000000033b4fe5e40e4903a0849ca97b3292eac3eb0aa36000000000000000000000000c69661b848b02ce0288c58c0aa01d0d99cb85dfc000000000000000000000000786075ff1962f45ca0fa122d677b9f2925f4a8c600000000000000000000000035c6de1445889df00a9e8c4a2734cc10b02d868a

-----Decoded View---------------
Arg [0] : _fancyBearsContract (address): 0x87084ec881d5A15C918057F326790dB177D218F2
Arg [1] : _honeyJarsContract (address): 0x55f3bc084Da207B7347538B74cC388DEEB3AB448
Arg [2] : _honeyVestingContract (address): 0x7BB5178af214B8c5E714EE29D40045E37Bc89d42
Arg [3] : _fancyTraitsV2Contract (address): 0xeBfaa4261935aBEC133b5dc41Baf210a2b8Eb24D
Arg [4] : _honeyTokenContract (address): 0x33B4fE5e40E4903A0849cA97B3292eac3EB0aA36
Arg [5] : _levelsContract (address): 0xc69661B848B02Ce0288C58C0AA01D0d99Cb85dfc
Arg [6] : _fancyBearStakingContract (address): 0x786075FF1962F45ca0Fa122d677b9F2925f4a8C6
Arg [7] : _hiveContract (address): 0x35c6de1445889dF00a9e8c4A2734Cc10B02d868A

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 00000000000000000000000087084ec881d5a15c918057f326790db177d218f2
Arg [1] : 00000000000000000000000055f3bc084da207b7347538b74cc388deeb3ab448
Arg [2] : 0000000000000000000000007bb5178af214b8c5e714ee29d40045e37bc89d42
Arg [3] : 000000000000000000000000ebfaa4261935abec133b5dc41baf210a2b8eb24d
Arg [4] : 00000000000000000000000033b4fe5e40e4903a0849ca97b3292eac3eb0aa36
Arg [5] : 000000000000000000000000c69661b848b02ce0288c58c0aa01d0d99cb85dfc
Arg [6] : 000000000000000000000000786075ff1962f45ca0fa122d677b9f2925f4a8c6
Arg [7] : 00000000000000000000000035c6de1445889df00a9e8c4a2734cc10b02d868a


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.