Contract 0x6e125fAf93C6eF968beb48a2B00Dcf8178237037

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x74fd783811c16c7e394eb93127c2c17b4e61d006d178f859ffce1b70a8dc688cCreate Ask Order587195502023-03-30 17:13:0843 mins ago0xbb9186142d0ecfb38c63fcc411533104bee9bda2 IN  0x6e125faf93c6ef968beb48a2b00dcf81782370370 FTM0.010445055582
0xb805e05ed4786648e430a7c80923312a2900eae4073f64899fceee3bbfc8e052Create Ask Order587195292023-03-30 17:12:2044 mins ago0xbb9186142d0ecfb38c63fcc411533104bee9bda2 IN  0x6e125faf93c6ef968beb48a2b00dcf81782370370 FTM0.010601161454
0xbf6c1c977aab98be0ecfcbf15d239ca7596bfc22fab51c16030553ae7a4ef153Create Ask Order587195102023-03-30 17:11:4244 mins ago0xbb9186142d0ecfb38c63fcc411533104bee9bda2 IN  0x6e125faf93c6ef968beb48a2b00dcf81782370370 FTM0.010980410573
0x0c21fef810377b1d192b8133ad25633536d3e5b30029fcfef839689c389f9e81Modify Ask Order587189562023-03-30 16:56:221 hr ago0xc6ed60b27afbc86be541d30d51c5b86ed7afe3ab IN  0x6e125faf93c6ef968beb48a2b00dcf81782370370 FTM0.001806303031
0xd55ba2b2f29c99d8da7716f85b036493107668306434b11c7e988033404a2aa2Buy Token Using ...587184692023-03-30 16:41:171 hr 15 mins ago0xd4d992f9509efe9b3ca1b7acfaab384ebb99e0cd IN  0x6e125faf93c6ef968beb48a2b00dcf81782370378.369 FTM0.008981121211
0x99aba5add488530c1f4be47e1e0ae87c21544a7f1ebd5ee278aa31c05a64893cBuy Token Using ...587184602023-03-30 16:40:571 hr 15 mins ago0xd4d992f9509efe9b3ca1b7acfaab384ebb99e0cd IN  0x6e125faf93c6ef968beb48a2b00dcf81782370378 FTM0.010003805562
0x79532d7a0047d1e93a802dc4a4ff54bb96d1ebaf5936996eab87548634ceaa09Buy Token Using ...587184382023-03-30 16:40:171 hr 16 mins ago0xd4d992f9509efe9b3ca1b7acfaab384ebb99e0cd IN  0x6e125faf93c6ef968beb48a2b00dcf81782370374.98 FTM0.009374337195
0xa8432802d412620d2f575d191b13894b820046fd48ca7c462e404f95c9bc002dBuy Token Using ...587184172023-03-30 16:39:471 hr 16 mins ago0xd4d992f9509efe9b3ca1b7acfaab384ebb99e0cd IN  0x6e125faf93c6ef968beb48a2b00dcf81782370376.509 FTM0.009003605318
0xe5343d9b9b920c0a33105f2b5807af9dbb6776e13ccfde99302b0af95bb21712Buy Token Using ...587183692023-03-30 16:38:341 hr 17 mins ago0xd4d992f9509efe9b3ca1b7acfaab384ebb99e0cd IN  0x6e125faf93c6ef968beb48a2b00dcf817823703712 FTM0.009724485336
0x79574bd2ad32c0ede882ab7eb2408960e10626bc3377fae766fcb65e1f64f189Create Ask Order587166422023-03-30 15:43:112 hrs 13 mins ago0xbb9186142d0ecfb38c63fcc411533104bee9bda2 IN  0x6e125faf93c6ef968beb48a2b00dcf81782370370 FTM0.01131030594
0x20457c21d90d6dbabae698e182f003d1ab8b1dd92a862bd80810bb724e80d860Create Ask Order587161972023-03-30 15:28:292 hrs 28 mins ago0xbb9186142d0ecfb38c63fcc411533104bee9bda2 IN  0x6e125faf93c6ef968beb48a2b00dcf81782370370 FTM0.017068466729
0xc18f7f9b984f5b1e6075b9f289e2c49efa2199f53772c0d5d7bdc61807cac57aModify Ask Order587151542023-03-30 14:52:203 hrs 4 mins ago0xebec640c42a2d36ba3e3b0c38e2e1c45e293292a IN  0x6e125faf93c6ef968beb48a2b00dcf81782370370 FTM0.002041650092
0x112355f55551b4cf0ad7483b1cedef698f7c1671c1a1e331b93bf2b33999ca52Buy Token Using ...587133212023-03-30 13:59:213 hrs 57 mins ago0xf77c8dbeafeff7c2f6bfc9a06c98b0c30a30aa3c IN  0x6e125faf93c6ef968beb48a2b00dcf81782370374.97 FTM0.00705815678
0x3c2b9e31a01e0555cd464377f804dc852f09021783931a15b9593c92dcadaa35Buy Token Using ...587133062023-03-30 13:58:533 hrs 57 mins ago0xf77c8dbeafeff7c2f6bfc9a06c98b0c30a30aa3c IN  0x6e125faf93c6ef968beb48a2b00dcf81782370376.508 FTM0.012270688711
0x46cb607cc67a2cf036350b45e5431d026561988a2a5d17ceac78cd197670256dBuy Token Using ...587132932023-03-30 13:58:333 hrs 57 mins ago0xf77c8dbeafeff7c2f6bfc9a06c98b0c30a30aa3c IN  0x6e125faf93c6ef968beb48a2b00dcf81782370378.35 FTM0.008063309735
0x66fbe414c320f0d65d2da53299bac744a1062772717967a756e6d178d45e1c93Create Ask Order587125712023-03-30 13:34:414 hrs 21 mins ago0xae5d57259b6802632b4a807666d7b7b8b9c986d0 IN  0x6e125faf93c6ef968beb48a2b00dcf81782370370 FTM0.016478059903
0x910895e3841f22ab1f86c5b00abf72b2f8307631af2bac1bc7ffc6af9e1bfa47Modify Ask Order587099372023-03-30 12:19:565 hrs 36 mins ago0xbb9186142d0ecfb38c63fcc411533104bee9bda2 IN  0x6e125faf93c6ef968beb48a2b00dcf81782370370 FTM0.001308999891
0xcf493cf62c865eecd5b004995c11c86d47374658ca93fdc75540f4975d141c50Modify Ask Order587098962023-03-30 12:18:505 hrs 37 mins ago0xbb9186142d0ecfb38c63fcc411533104bee9bda2 IN  0x6e125faf93c6ef968beb48a2b00dcf81782370370 FTM0.002159595233
0x782d82440680db19419d6ddc36ac28b3576c4087abfcbc21804bfd9238ef76a7Modify Ask Order587098632023-03-30 12:18:065 hrs 38 mins ago0xbb9186142d0ecfb38c63fcc411533104bee9bda2 IN  0x6e125faf93c6ef968beb48a2b00dcf81782370370 FTM0.001315013713
0x8c38fd2fc0576fb6126c4d68528728d3308b7c79ecd6c2998198273a75cf2a1aModify Ask Order587071482023-03-30 11:04:546 hrs 51 mins ago0xc6ed60b27afbc86be541d30d51c5b86ed7afe3ab IN  0x6e125faf93c6ef968beb48a2b00dcf81782370370 FTM0.001509341317
0xb72a7b7ee6f973f244dfc94ead9944e94aa2ddab0689042616578ec9b3923ebbModify Ask Order587063312023-03-30 10:46:477 hrs 9 mins ago0xebec640c42a2d36ba3e3b0c38e2e1c45e293292a IN  0x6e125faf93c6ef968beb48a2b00dcf81782370370 FTM0.001177021181
0x15748f371d9a4b5765c7b2864ba28d7025bfc12c077567b65f882016a46973efModify Ask Order587019172023-03-30 9:21:498 hrs 34 mins ago0x97de9764b3788c23f6c1de9e3b0fcce9c76c9cb9 IN  0x6e125faf93c6ef968beb48a2b00dcf81782370370 FTM0.00161787477
0xdf763eb280d66def03695284113b3365429ab6d9f41f61b43e4d17391f48cbcfModify Ask Order586996462023-03-30 8:37:489 hrs 18 mins ago0xc6ed60b27afbc86be541d30d51c5b86ed7afe3ab IN  0x6e125faf93c6ef968beb48a2b00dcf81782370370 FTM0.001808738129
0x6cdb1d53d29bcc0770d9ee4ba8ed38953a62e6a74a01c62c739eec6450e3fdd1Modify Ask Order586994702023-03-30 8:34:549 hrs 21 mins ago0xbb9186142d0ecfb38c63fcc411533104bee9bda2 IN  0x6e125faf93c6ef968beb48a2b00dcf81782370370 FTM0.001785176214
0xc73142eb513a2e113ac6a26a601bee4ba8661fbb772375f81b8aa1ebf1f5e7feModify Ask Order586993832023-03-30 8:33:269 hrs 23 mins ago0xbb9186142d0ecfb38c63fcc411533104bee9bda2 IN  0x6e125faf93c6ef968beb48a2b00dcf81782370370 FTM0.001792259034
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xd55ba2b2f29c99d8da7716f85b036493107668306434b11c7e988033404a2aa2587184692023-03-30 16:41:171 hr 15 mins ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token8.369 FTM
0x99aba5add488530c1f4be47e1e0ae87c21544a7f1ebd5ee278aa31c05a64893c587184602023-03-30 16:40:571 hr 15 mins ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token8 FTM
0x79532d7a0047d1e93a802dc4a4ff54bb96d1ebaf5936996eab87548634ceaa09587184382023-03-30 16:40:171 hr 16 mins ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token4.98 FTM
0xa8432802d412620d2f575d191b13894b820046fd48ca7c462e404f95c9bc002d587184172023-03-30 16:39:471 hr 16 mins ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token6.509 FTM
0xe5343d9b9b920c0a33105f2b5807af9dbb6776e13ccfde99302b0af95bb21712587183692023-03-30 16:38:341 hr 17 mins ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token12 FTM
0x112355f55551b4cf0ad7483b1cedef698f7c1671c1a1e331b93bf2b33999ca52587133212023-03-30 13:59:213 hrs 57 mins ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token4.97 FTM
0x3c2b9e31a01e0555cd464377f804dc852f09021783931a15b9593c92dcadaa35587133062023-03-30 13:58:533 hrs 57 mins ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token6.508 FTM
0x46cb607cc67a2cf036350b45e5431d026561988a2a5d17ceac78cd197670256d587132932023-03-30 13:58:333 hrs 57 mins ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token8.35 FTM
0x48c8c447ffe6cb092935f3d55d65c4720d3653f7e6179da5428ca0cbcbd72717586974442023-03-30 7:57:289 hrs 59 mins ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token74 FTM
0x13074d521a3ab39e5c35379280789008dc7511932c2eb629ab83a938c776269f586889412023-03-30 5:01:2312 hrs 55 mins ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token6.5 FTM
0x6552c5524d51f05d4ef4bbe7d23d2f63b7e3e4ee23cd6aefa652a48a26a59c03586888572023-03-30 4:59:5412 hrs 56 mins ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token11.9 FTM
0xab298803e34474b208cd691fbd3d35632a9ba349ce1c2080d4e54a6a07e102da586750742023-03-30 0:26:3817 hrs 29 mins ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token4 FTM
0xbfedcbc4daf7f6e962c71a5b1494cc86820f7738c8709e16fabe400c4466f63b586658912023-03-29 21:25:0520 hrs 31 mins ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token3.99 FTM
0xa72140ed21b6bbdcb354a39c1096248a6eef810a189e8d6d1567105a8eed0e26586650742023-03-29 21:07:4920 hrs 48 mins ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token4.95 FTM
0xb3b5a4c70a0681bfc9279464da3ecb897fb785850ca6168dc5a32387adda83aa586624102023-03-29 20:13:5321 hrs 42 mins ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token4 FTM
0xa7888cd6da1b42ae9ce0c3f35566a62b50ee862def0da92c1a07e3efc84207af586623432023-03-29 20:12:3321 hrs 43 mins ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token3.98 FTM
0x37462c107a049aaf5cdc93757ea7ce0cf92a8d122615e59cd49f18f99fdc9e75586618392023-03-29 20:04:0721 hrs 52 mins ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token3.97 FTM
0x0ff129c05540608c86419ece7abe965f322e4c35c759c2f861df06b4479ab22b586617252023-03-29 20:02:0521 hrs 54 mins ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token4.41 FTM
0x1dcfe02dceb08e6404cc9496f11fad0b80a88b13b24f6bdd7f920558091f24ad586461072023-03-29 14:35:351 day 3 hrs ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token4.42 FTM
0x15e55783493d5f5a5c12c016c55182476adf4acfcf6204d524075a286ccfa51a586460992023-03-29 14:35:271 day 3 hrs ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token4.43 FTM
0xea4b74fec2858fadb2a13a8f2f76055fc85cd236b75dbe35f7d77a6394555b5d586440342023-03-29 13:47:021 day 4 hrs ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token25 FTM
0x040c6b62db80bcaa50feca055715757c3c567c94bdbbfecefa9ee4b2e3d92fb0586366612023-03-29 11:31:501 day 6 hrs ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token3.96 FTM
0x23c866c8d7d4e827f9e0c6b086f8100a63bb02e279843006f24af206314a27eb586350562023-03-29 10:56:301 day 6 hrs ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token38.8 FTM
0x7f650288329751df57c97eedc1c294ec0fc14188ca55c0fde24065ec9799654d586056322023-03-29 0:23:541 day 17 hrs ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token3.97 FTM
0xe0e947dcf4d7310988141d292a9f9ebaec618010df2fa673794352fa9f588ad9586056182023-03-29 0:23:381 day 17 hrs ago 0x6e125faf93c6ef968beb48a2b00dcf8178237037 Fantom Finance: Wrapped Fantom Token4 FTM
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
WigoNFTMarket

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 999999 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 15 : WigoNFTMarket.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";

import {IWETH} from "./interfaces/IWETH.sol";

import {ICollectionWhitelistChecker} from "./interfaces/ICollectionWhitelistChecker.sol";

import {IWigoGalaxy} from "./interfaces/IWigoGalaxy.sol";

contract WigoNFTMarket is ERC721Holder, Ownable, ReentrancyGuard {
    using EnumerableSet for EnumerableSet.AddressSet;
    using EnumerableSet for EnumerableSet.UintSet;

    using SafeERC20 for IERC20;

    enum CollectionStatus {
        Pending,
        Open,
        Close
    }

    IWigoGalaxy public galaxy;

    address public immutable WFTM;

    uint256 public constant TOTAL_MAX_FEE = 1500; // 15% of a sale
    uint256 public constant REFERRER_MAX_FEE = 250; // 2.5% seller's referral and 2.5% buyer's referral

    address public adminAddress;
    address public treasuryAddress;

    uint256 public minimumAskPrice; // in wei
    uint256 public maximumAskPrice; // in wei

    uint256 public referrerFee;

    mapping(address => uint256) public pendingRevenue; // For creator/treasury to claim

    EnumerableSet.AddressSet private _collectionAddressSet;

    mapping(address => mapping(uint256 => Ask)) private _askDetails; // Ask details (price + seller address) for a given collection and a tokenId
    mapping(address => EnumerableSet.UintSet) private _askTokenIds; // Set of tokenIds for a collection
    mapping(address => Collection) private _collections; // Details about the collections
    mapping(address => mapping(address => EnumerableSet.UintSet))
        private _tokenIdsOfSellerForCollection;

    struct Ask {
        address seller; // address of the seller
        uint256 price; // price of the token
    }

    struct Collection {
        CollectionStatus status; // status of the collection
        address creatorAddress; // address of the creator
        address whitelistChecker; // whitelist checker (if not set --> 0x00)
        uint256 tradingFee; // trading fee (100 = 1%, 500 = 5%, 5 = 0.05%)
        uint256 creatorFee; // creator fee (100 = 1%, 500 = 5%, 5 = 0.05%)
    }

    // Ask order is cancelled
    event AskCancel(
        address indexed collection,
        address indexed seller,
        uint256 indexed tokenId
    );

    // Ask order is created
    event AskNew(
        address indexed collection,
        address indexed seller,
        uint256 indexed tokenId,
        uint256 askPrice
    );

    // Ask order is updated
    event AskUpdate(
        address indexed collection,
        address indexed seller,
        uint256 indexed tokenId,
        uint256 askPrice
    );

    // Collection is closed for trading and new listings
    event CollectionClose(address indexed collection);

    // New collection is added
    event CollectionNew(
        address indexed collection,
        address indexed creator,
        address indexed whitelistChecker,
        uint256 tradingFee,
        uint256 creatorFee
    );

    // Existing collection is updated
    event CollectionUpdate(
        address indexed collection,
        address indexed creator,
        address indexed whitelistChecker,
        uint256 tradingFee,
        uint256 creatorFee
    );

    // Admin and Treasury Addresses are updated
    event NewAdminAndTreasuryAddresses(
        address indexed admin,
        address indexed treasury
    );

    // Referrer fee is updated
    event NewReferrerFee(uint256 referrerFee);

    // WigoGalaxy Address is updated
    event NewWigoGalaxyAddress(address indexed galaxy);

    // Minimum/maximum ask prices are updated
    event NewMinimumAndMaximumAskPrices(
        uint256 minimumAskPrice,
        uint256 maximumAskPrice
    );

    // Recover NFT tokens sent by accident
    event NonFungibleTokenRecovery(
        address indexed token,
        uint256 indexed tokenId
    );

    // Pending revenue is claimed
    event RevenueClaim(address indexed claimer, uint256 amount);

    // Recover ERC20 tokens sent by accident
    event TokenRecovery(address indexed token, uint256 amount);

    // Ask order is matched by a trade
    event Trade(
        address indexed collection,
        uint256 indexed tokenId,
        address indexed seller,
        address buyer,
        uint256 askPrice,
        uint256 netPrice,
        bool withFTM
    );

    // Modifier for the admin
    modifier onlyAdmin() {
        require(msg.sender == adminAddress, "Management: Not admin");
        _;
    }

    /**
     * @notice Constructor
     * @param _adminAddress: address of the admin
     * @param _treasuryAddress: address of the treasury
     * @param _WFTMAddress: WFTM address
     * @param _minimumAskPrice: minimum ask price
     * @param _maximumAskPrice: maximum ask price
     */
    constructor(
        address _adminAddress,
        address _treasuryAddress,
        address _WFTMAddress,
        address _wigoGalaxyAddress,
        uint256 _minimumAskPrice,
        uint256 _maximumAskPrice,
        uint256 _referrerFee
    ) {
        require(
            _adminAddress != address(0),
            "Operations: Admin address cannot be zero"
        );
        require(
            _treasuryAddress != address(0),
            "Operations: Treasury address cannot be zero"
        );
        require(
            _WFTMAddress != address(0),
            "Operations: WFTM address cannot be zero"
        );
        require(
            _wigoGalaxyAddress != address(0),
            "Operations: WigoGalaxy address cannot be zero"
        );
        require(
            _minimumAskPrice > 0,
            "Operations: _minimumAskPrice must be > 0"
        );
        require(
            _minimumAskPrice < _maximumAskPrice,
            "Operations: _minimumAskPrice < _maximumAskPrice"
        );
        require(
            _referrerFee <= REFERRER_MAX_FEE,
            "Operations: referrerFee must inferior to REFERRER_MAX_FEE"
        );

        adminAddress = _adminAddress;
        treasuryAddress = _treasuryAddress;

        WFTM = _WFTMAddress;

        galaxy = IWigoGalaxy(_wigoGalaxyAddress);

        minimumAskPrice = _minimumAskPrice;
        maximumAskPrice = _maximumAskPrice;

        referrerFee = _referrerFee;
    }

    /**
     * @notice Buy token with FTM by matching the price of an existing ask order
     * @param _collection: contract address of the NFT
     * @param _tokenId: tokenId of the NFT purchased
     */
    function buyTokenUsingFTM(address _collection, uint256 _tokenId)
        external
        payable
        nonReentrant
    {
        // Wrap FTM
        IWETH(WFTM).deposit{value: msg.value}();

        _buyToken(_collection, _tokenId, msg.value, true);
    }

    /**
     * @notice Buy token with WFTM by matching the price of an existing ask order
     * @param _collection: contract address of the NFT
     * @param _tokenId: tokenId of the NFT purchased
     * @param _price: price (must be equal to the askPrice set by the seller)
     */
    function buyTokenUsingWFTM(
        address _collection,
        uint256 _tokenId,
        uint256 _price
    ) external nonReentrant {
        IERC20(WFTM).safeTransferFrom(
            address(msg.sender),
            address(this),
            _price
        );

        _buyToken(_collection, _tokenId, _price, false);
    }

    /**
     * @notice Cancel existing ask order
     * @param _collection: contract address of the NFT
     * @param _tokenId: tokenId of the NFT
     */
    function cancelAskOrder(address _collection, uint256 _tokenId)
        external
        nonReentrant
    {
        // Verify the sender has listed it
        require(
            _tokenIdsOfSellerForCollection[msg.sender][_collection].contains(
                _tokenId
            ),
            "Order: Token not listed"
        );

        // Adjust the information
        _tokenIdsOfSellerForCollection[msg.sender][_collection].remove(
            _tokenId
        );
        delete _askDetails[_collection][_tokenId];
        _askTokenIds[_collection].remove(_tokenId);

        // Transfer the NFT back to the user
        IERC721(_collection).transferFrom(
            address(this),
            address(msg.sender),
            _tokenId
        );

        // Emit event
        emit AskCancel(_collection, msg.sender, _tokenId);
    }

    /**
     * @notice Claim pending revenue (treasury or creators)
     */
    function claimPendingRevenue() external nonReentrant {
        uint256 revenueToClaim = pendingRevenue[msg.sender];
        require(revenueToClaim != 0, "Claim: Nothing to claim");
        pendingRevenue[msg.sender] = 0;

        IERC20(WFTM).safeTransfer(address(msg.sender), revenueToClaim);

        emit RevenueClaim(msg.sender, revenueToClaim);
    }

    /**
     * @notice Create ask order
     * @param _collection: contract address of the NFT
     * @param _tokenId: tokenId of the NFT
     * @param _askPrice: price for listing (in wei)
     */
    function createAskOrder(
        address _collection,
        uint256 _tokenId,
        uint256 _askPrice
    ) external nonReentrant {
        // Verify price is not too low/high
        require(
            _askPrice >= minimumAskPrice && _askPrice <= maximumAskPrice,
            "Order: Price not within range"
        );

        // Verify collection is accepted
        require(
            _collections[_collection].status == CollectionStatus.Open,
            "Collection: Not for listing"
        );

        // Verify token has restriction
        require(
            _canTokenBeListed(_collection, _tokenId),
            "Order: tokenId not eligible"
        );

        // Transfer NFT to this contract
        IERC721(_collection).safeTransferFrom(
            address(msg.sender),
            address(this),
            _tokenId
        );

        // Adjust the information
        _tokenIdsOfSellerForCollection[msg.sender][_collection].add(_tokenId);
        _askDetails[_collection][_tokenId] = Ask({
            seller: msg.sender,
            price: _askPrice
        });

        // Add tokenId to the askTokenIds set
        _askTokenIds[_collection].add(_tokenId);

        // Emit event
        emit AskNew(_collection, msg.sender, _tokenId, _askPrice);
    }

    /**
     * @notice Modify existing ask order
     * @param _collection: contract address of the NFT
     * @param _tokenId: tokenId of the NFT
     * @param _newPrice: new price for listing (in wei)
     */
    function modifyAskOrder(
        address _collection,
        uint256 _tokenId,
        uint256 _newPrice
    ) external nonReentrant {
        // Verify new price is not too low/high
        require(
            _newPrice >= minimumAskPrice && _newPrice <= maximumAskPrice,
            "Order: Price not within range"
        );

        // Verify collection is accepted
        require(
            _collections[_collection].status == CollectionStatus.Open,
            "Collection: Not for listing"
        );

        // Verify the sender has listed it
        require(
            _tokenIdsOfSellerForCollection[msg.sender][_collection].contains(
                _tokenId
            ),
            "Order: Token not listed"
        );

        // Adjust the information
        _askDetails[_collection][_tokenId].price = _newPrice;

        // Emit event
        emit AskUpdate(_collection, msg.sender, _tokenId, _newPrice);
    }

    /**
     * @notice Add a new collection
     * @param _collection: collection address
     * @param _creator: creator address (must be 0x00 if none)
     * @param _whitelistChecker: whitelist checker (for additional restrictions, must be 0x00 if none)
     * @param _tradingFee: trading fee (100 = 1%, 500 = 5%, 5 = 0.05%)
     * @param _creatorFee: creator fee (100 = 1%, 500 = 5%, 5 = 0.05%, 0 if creator is 0x00)
     * @dev Callable by admin
     */
    function addCollection(
        address _collection,
        address _creator,
        address _whitelistChecker,
        uint256 _tradingFee,
        uint256 _creatorFee
    ) external onlyAdmin {
        require(
            !_collectionAddressSet.contains(_collection),
            "Operations: Collection already listed"
        );
        require(
            IERC721(_collection).supportsInterface(0x80ac58cd),
            "Operations: Not ERC721"
        );

        require(
            (_creatorFee == 0 && _creator == address(0)) ||
                (_creatorFee != 0 && _creator != address(0)),
            "Operations: Creator parameters incorrect"
        );

        require(
            _tradingFee + _creatorFee <= TOTAL_MAX_FEE,
            "Operations: Sum of fee must inferior to TOTAL_MAX_FEE"
        );

        _collectionAddressSet.add(_collection);

        _collections[_collection] = Collection({
            status: CollectionStatus.Open,
            creatorAddress: _creator,
            whitelistChecker: _whitelistChecker,
            tradingFee: _tradingFee,
            creatorFee: _creatorFee
        });

        emit CollectionNew(
            _collection,
            _creator,
            _whitelistChecker,
            _tradingFee,
            _creatorFee
        );
    }

    /**
     * @notice Allows the admin to close collection for trading and new listing
     * @param _collection: collection address
     * @dev Callable by admin
     */
    function closeCollectionForTradingAndListing(address _collection)
        external
        onlyAdmin
    {
        require(
            _collectionAddressSet.contains(_collection),
            "Operations: Collection not listed"
        );

        _collections[_collection].status = CollectionStatus.Close;
        _collectionAddressSet.remove(_collection);

        emit CollectionClose(_collection);
    }

    /**
     * @notice Modify collection characteristics
     * @param _collection: collection address
     * @param _creator: creator address (must be 0x00 if none)
     * @param _whitelistChecker: whitelist checker (for additional restrictions, must be 0x00 if none)
     * @param _tradingFee: trading fee (100 = 1%, 500 = 5%, 5 = 0.05%)
     * @param _creatorFee: creator fee (100 = 1%, 500 = 5%, 5 = 0.05%, 0 if creator is 0x00)
     * @dev Callable by admin
     */
    function modifyCollection(
        address _collection,
        address _creator,
        address _whitelistChecker,
        uint256 _tradingFee,
        uint256 _creatorFee
    ) external onlyAdmin {
        require(
            _collectionAddressSet.contains(_collection),
            "Operations: Collection not listed"
        );

        require(
            (_creatorFee == 0 && _creator == address(0)) ||
                (_creatorFee != 0 && _creator != address(0)),
            "Operations: Creator parameters incorrect"
        );

        require(
            _tradingFee + _creatorFee <= TOTAL_MAX_FEE,
            "Operations: Sum of fee must inferior to TOTAL_MAX_FEE"
        );

        _collections[_collection] = Collection({
            status: CollectionStatus.Open,
            creatorAddress: _creator,
            whitelistChecker: _whitelistChecker,
            tradingFee: _tradingFee,
            creatorFee: _creatorFee
        });

        emit CollectionUpdate(
            _collection,
            _creator,
            _whitelistChecker,
            _tradingFee,
            _creatorFee
        );
    }

    /**
     * @notice Allows the admin to update minimum and maximum prices for a token (in wei)
     * @param _minimumAskPrice: minimum ask price
     * @param _maximumAskPrice: maximum ask price
     * @dev Callable by admin
     */
    function updateMinimumAndMaximumPrices(
        uint256 _minimumAskPrice,
        uint256 _maximumAskPrice
    ) external onlyAdmin {
        require(
            _minimumAskPrice < _maximumAskPrice,
            "Operations: _minimumAskPrice < _maximumAskPrice"
        );

        minimumAskPrice = _minimumAskPrice;
        maximumAskPrice = _maximumAskPrice;

        emit NewMinimumAndMaximumAskPrices(_minimumAskPrice, _maximumAskPrice);
    }

    /**
     * @notice Allows the owner to recover tokens sent to the contract by mistake
     * @param _token: token address
     * @dev Callable by owner
     */
    function recoverFungibleTokens(address _token) external onlyOwner {
        require(_token != WFTM, "Operations: Cannot recover WFTM");
        uint256 amountToRecover = IERC20(_token).balanceOf(address(this));
        require(amountToRecover != 0, "Operations: No token to recover");

        IERC20(_token).safeTransfer(address(msg.sender), amountToRecover);

        emit TokenRecovery(_token, amountToRecover);
    }

    /**
     * @notice Allows the owner to recover NFTs sent to the contract by mistake
     * @param _token: NFT token address
     * @param _tokenId: tokenId
     * @dev Callable by owner
     */
    function recoverNonFungibleToken(address _token, uint256 _tokenId)
        external
        onlyOwner
        nonReentrant
    {
        require(
            !_askTokenIds[_token].contains(_tokenId),
            "Operations: NFT not recoverable"
        );
        IERC721(_token).safeTransferFrom(
            address(this),
            address(msg.sender),
            _tokenId
        );

        emit NonFungibleTokenRecovery(_token, _tokenId);
    }

    /**
     * @notice Set admin address
     * @dev Only callable by owner
     * @param _adminAddress: address of the admin
     * @param _treasuryAddress: address of the treasury
     */
    function setAdminAndTreasuryAddresses(
        address _adminAddress,
        address _treasuryAddress
    ) external onlyOwner {
        require(
            _adminAddress != address(0),
            "Operations: Admin address cannot be zero"
        );
        require(
            _treasuryAddress != address(0),
            "Operations: Treasury address cannot be zero"
        );

        adminAddress = _adminAddress;
        treasuryAddress = _treasuryAddress;

        emit NewAdminAndTreasuryAddresses(_adminAddress, _treasuryAddress);
    }

    /**
     * @notice Set referrer fee
     * @dev Only callable by owner
     * @param _referrerFee: New referrer fee
     */
    function setReferrerFee(uint256 _referrerFee) external onlyOwner {
        require(
            _referrerFee <= REFERRER_MAX_FEE,
            "Operations: referrerFee must inferior to REFERRER_MAX_FEE"
        );

        referrerFee = _referrerFee;

        emit NewReferrerFee(_referrerFee);
    }

    /**
     * @notice Set WigoGalaxy address
     * @dev Only callable by owner
     * @param _wigoGalaxyAddress: address of the WigoGalaxy
     */
    function setWigoGalaxyAddress(address _wigoGalaxyAddress)
        external
        onlyOwner
    {
        require(
            _wigoGalaxyAddress != address(0),
            "Operations: WigoGalaxy address cannot be zero"
        );

        galaxy = IWigoGalaxy(_wigoGalaxyAddress);

        emit NewWigoGalaxyAddress(_wigoGalaxyAddress);
    }

    /**
     * @notice Check asks for an array of tokenIds in a collection
     * @param collection: address of the collection
     * @param tokenIds: array of tokenId
     */
    function viewAsksByCollectionAndTokenIds(
        address collection,
        uint256[] calldata tokenIds
    ) external view returns (bool[] memory statuses, Ask[] memory askInfo) {
        uint256 length = tokenIds.length;

        statuses = new bool[](length);
        askInfo = new Ask[](length);

        for (uint256 i = 0; i < length; i++) {
            if (_askTokenIds[collection].contains(tokenIds[i])) {
                statuses[i] = true;
            } else {
                statuses[i] = false;
            }

            askInfo[i] = _askDetails[collection][tokenIds[i]];
        }

        return (statuses, askInfo);
    }

    /**
     * @notice View ask orders for a given collection across all sellers
     * @param collection: address of the collection
     * @param cursor: cursor
     * @param size: size of the response
     */
    function viewAsksByCollection(
        address collection,
        uint256 cursor,
        uint256 size
    )
        external
        view
        returns (
            uint256[] memory tokenIds,
            Ask[] memory askInfo,
            uint256
        )
    {
        uint256 length = size;

        if (length > _askTokenIds[collection].length() - cursor) {
            length = _askTokenIds[collection].length() - cursor;
        }

        tokenIds = new uint256[](length);
        askInfo = new Ask[](length);

        for (uint256 i = 0; i < length; i++) {
            tokenIds[i] = _askTokenIds[collection].at(cursor + i);
            askInfo[i] = _askDetails[collection][tokenIds[i]];
        }

        return (tokenIds, askInfo, cursor + length);
    }

    /**
     * @notice View ask orders for a given collection and a seller
     * @param collection: address of the collection
     * @param seller: address of the seller
     * @param cursor: cursor
     * @param size: size of the response
     */
    function viewAsksByCollectionAndSeller(
        address collection,
        address seller,
        uint256 cursor,
        uint256 size
    )
        external
        view
        returns (
            uint256[] memory tokenIds,
            Ask[] memory askInfo,
            uint256
        )
    {
        uint256 length = size;

        if (
            length >
            _tokenIdsOfSellerForCollection[seller][collection].length() - cursor
        ) {
            length =
                _tokenIdsOfSellerForCollection[seller][collection].length() -
                cursor;
        }

        tokenIds = new uint256[](length);
        askInfo = new Ask[](length);

        for (uint256 i = 0; i < length; i++) {
            tokenIds[i] = _tokenIdsOfSellerForCollection[seller][collection].at(
                cursor + i
            );
            askInfo[i] = _askDetails[collection][tokenIds[i]];
        }

        return (tokenIds, askInfo, cursor + length);
    }

    /*
     * @notice View addresses and details for all the collections available for trading
     * @param cursor: cursor
     * @param size: size of the response
     */
    function viewCollections(uint256 cursor, uint256 size)
        external
        view
        returns (
            address[] memory collectionAddresses,
            Collection[] memory collectionDetails,
            uint256
        )
    {
        uint256 length = size;

        if (length > _collectionAddressSet.length() - cursor) {
            length = _collectionAddressSet.length() - cursor;
        }

        collectionAddresses = new address[](length);
        collectionDetails = new Collection[](length);

        for (uint256 i = 0; i < length; i++) {
            collectionAddresses[i] = _collectionAddressSet.at(cursor + i);
            collectionDetails[i] = _collections[collectionAddresses[i]];
        }

        return (collectionAddresses, collectionDetails, cursor + length);
    }

    /**
     * @notice Calculate price and associated fees for a collection
     * @param collection: address of the collection
     * @param price: listed price
     */
    function calculatePriceAndFeesForCollection(
        address collection,
        uint256 price
    )
        external
        view
        returns (
            uint256 netPrice,
            uint256 tradingFee,
            uint256 creatorFee
        )
    {
        if (_collections[collection].status != CollectionStatus.Open) {
            return (0, 0, 0);
        }

        return (_calculatePriceAndFeesForCollection(collection, price));
    }

    /**
     * @notice Checks if an array of tokenIds can be listed
     * @param _collection: address of the collection
     * @param _tokenIds: array of tokenIds
     * @dev if collection is not for trading, it returns array of bool with false
     */
    function canTokensBeListed(
        address _collection,
        uint256[] calldata _tokenIds
    ) external view returns (bool[] memory listingStatuses) {
        listingStatuses = new bool[](_tokenIds.length);

        if (_collections[_collection].status != CollectionStatus.Open) {
            return listingStatuses;
        }

        for (uint256 i = 0; i < _tokenIds.length; i++) {
            listingStatuses[i] = _canTokenBeListed(_collection, _tokenIds[i]);
        }

        return listingStatuses;
    }

    /**
     * @notice Buy token by matching the price of an existing ask order
     * @param _collection: contract address of the NFT
     * @param _tokenId: tokenId of the NFT purchased
     * @param _price: price (must match the askPrice from the seller)
     * @param _withFTM: whether the token is bought with FTM (true) or WFTM (false)
     */
    function _buyToken(
        address _collection,
        uint256 _tokenId,
        uint256 _price,
        bool _withFTM
    ) internal {
        require(
            _collections[_collection].status == CollectionStatus.Open,
            "Collection: Not for trading"
        );
        require(
            _askTokenIds[_collection].contains(_tokenId),
            "Buy: Not for sale"
        );

        Ask memory askOrder = _askDetails[_collection][_tokenId];

        // Front-running protection
        require(_price == askOrder.price, "Buy: Incorrect price");
        require(msg.sender != askOrder.seller, "Buy: Buyer cannot be seller");

        // Calculate the net price (collected by seller), trading fee (collected by treasury to burn), creator fee (collected by creator), referrer fee (collected by buyer and seller referrers)
        (
            uint256 netPrice,
            uint256 tradingFee,
            uint256 creatorFee
        ) = _calculatePriceAndFeesForCollection(_collection, _price);

        // Update storage information
        _tokenIdsOfSellerForCollection[askOrder.seller][_collection].remove(
            _tokenId
        );
        delete _askDetails[_collection][_tokenId];
        _askTokenIds[_collection].remove(_tokenId);

        // Transfer WFTM to seller
        IERC20(WFTM).safeTransfer(askOrder.seller, netPrice);

        // Transfer WFTM to referrals
        uint256 count = _payReferrersFees(askOrder.seller, msg.sender, _price);

        if (count == 0) {
            tradingFee += (_price * referrerFee) / 5000;
        } else if (count == 1) {
            tradingFee += (_price * referrerFee) / 10000;
        }

        // Update pending revenues for treasury/creator (if any!)
        if (creatorFee != 0) {
            pendingRevenue[
                _collections[_collection].creatorAddress
            ] += creatorFee;
        }

        // Update trading fee if not equal to 0
        if (tradingFee != 0) {
            pendingRevenue[treasuryAddress] += tradingFee;
        }

        // Transfer NFT to buyer
        IERC721(_collection).safeTransferFrom(
            address(this),
            address(msg.sender),
            _tokenId
        );

        // Emit event
        emit Trade(
            _collection,
            _tokenId,
            askOrder.seller,
            msg.sender,
            _price,
            netPrice,
            _withFTM
        );
    }

    /**
     * @notice Calculate price and associated fees for a collection
     * @param _collection: address of the collection
     * @param _askPrice: listed price
     */
    function _calculatePriceAndFeesForCollection(
        address _collection,
        uint256 _askPrice
    )
        internal
        view
        returns (
            uint256 netPrice,
            uint256 tradingFee,
            uint256 creatorFee
        )
    {
        tradingFee = (_askPrice * _collections[_collection].tradingFee) / 10000;
        creatorFee = (_askPrice * _collections[_collection].creatorFee) / 10000;
        uint256 refFee = (_askPrice * referrerFee) / 10000;

        netPrice = _askPrice - tradingFee - creatorFee - (2 * refFee);

        return (netPrice, tradingFee, creatorFee);
    }

    /**
     * @notice pay referrers fees
     * @param _seller: seller address
     * @param _buyer: buyer address
     * @param _askPrice: listed price
     */
    function _payReferrersFees(
        address _seller,
        address _buyer,
        uint256 _askPrice
    ) internal returns (uint256 count) {
        if (galaxy.hasRegistered(_seller)) {
            (address sellerRef, bool sellerRefIsActive, ) = galaxy
                .getReferralData(_seller);

            if (sellerRefIsActive && sellerRef != address(0)) {
                IERC20(WFTM).safeTransfer(
                    sellerRef,
                    (_askPrice * referrerFee) / 10000
                );
                count += 1;
            }
        }

        if (galaxy.hasRegistered(_buyer)) {
            (address buyerRef, bool buyerRefIsActive, ) = galaxy
                .getReferralData(_buyer);

            if (buyerRefIsActive && buyerRef != address(0)) {
                IERC20(WFTM).safeTransfer(
                    buyerRef,
                    (_askPrice * referrerFee) / 10000
                );
                count += 1;
            }
        }

        return (count);
    }

    /**
     * @notice Checks if a token can be listed
     * @param _collection: address of the collection
     * @param _tokenId: tokenId
     */
    function _canTokenBeListed(address _collection, uint256 _tokenId)
        internal
        view
        returns (bool)
    {
        address whitelistCheckerAddress = _collections[_collection]
            .whitelistChecker;
        return
            (whitelistCheckerAddress == address(0)) ||
            ICollectionWhitelistChecker(whitelistCheckerAddress).canList(
                _tokenId
            );
    }
}

File 2 of 15 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

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

File 3 of 15 : 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 4 of 15 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (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 5 of 15 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

File 6 of 15 : 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 7 of 15 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (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`.
     *
     * 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;

    /**
     * @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 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 the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

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

File 8 of 15 : ERC721Holder.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol)

pragma solidity ^0.8.0;

import "../IERC721Receiver.sol";

/**
 * @dev Implementation of the {IERC721Receiver} interface.
 *
 * Accepts all token transfers.
 * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.
 */
contract ERC721Holder is IERC721Receiver {
    /**
     * @dev See {IERC721Receiver-onERC721Received}.
     *
     * Always returns `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address,
        address,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC721Received.selector;
    }
}

File 9 of 15 : IWETH.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.5.0;

interface IWETH {
    function deposit() external payable;

    function transfer(address to, uint256 value) external returns (bool);

    function withdraw(uint256) external;
}

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

interface ICollectionWhitelistChecker {
    function canList(uint256 _tokenId) external view returns (bool);
}

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

interface IWigoGalaxy {
    function getReferralData(address _residentAddress)
        external
        view
        returns (
            address,
            bool,
            uint256
        );

    function hasRegistered(address _residentAddress)
        external
        view
        returns (bool);
}

File 12 of 15 : 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 13 of 15 : 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 14 of 15 : 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 15 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 999999
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_adminAddress","type":"address"},{"internalType":"address","name":"_treasuryAddress","type":"address"},{"internalType":"address","name":"_WFTMAddress","type":"address"},{"internalType":"address","name":"_wigoGalaxyAddress","type":"address"},{"internalType":"uint256","name":"_minimumAskPrice","type":"uint256"},{"internalType":"uint256","name":"_maximumAskPrice","type":"uint256"},{"internalType":"uint256","name":"_referrerFee","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"collection","type":"address"},{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"AskCancel","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"collection","type":"address"},{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"askPrice","type":"uint256"}],"name":"AskNew","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"collection","type":"address"},{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"askPrice","type":"uint256"}],"name":"AskUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"collection","type":"address"}],"name":"CollectionClose","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"collection","type":"address"},{"indexed":true,"internalType":"address","name":"creator","type":"address"},{"indexed":true,"internalType":"address","name":"whitelistChecker","type":"address"},{"indexed":false,"internalType":"uint256","name":"tradingFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"creatorFee","type":"uint256"}],"name":"CollectionNew","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"collection","type":"address"},{"indexed":true,"internalType":"address","name":"creator","type":"address"},{"indexed":true,"internalType":"address","name":"whitelistChecker","type":"address"},{"indexed":false,"internalType":"uint256","name":"tradingFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"creatorFee","type":"uint256"}],"name":"CollectionUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"admin","type":"address"},{"indexed":true,"internalType":"address","name":"treasury","type":"address"}],"name":"NewAdminAndTreasuryAddresses","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"minimumAskPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maximumAskPrice","type":"uint256"}],"name":"NewMinimumAndMaximumAskPrices","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"referrerFee","type":"uint256"}],"name":"NewReferrerFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"galaxy","type":"address"}],"name":"NewWigoGalaxyAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"NonFungibleTokenRecovery","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"claimer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RevenueClaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenRecovery","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"collection","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":false,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"askPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"netPrice","type":"uint256"},{"indexed":false,"internalType":"bool","name":"withFTM","type":"bool"}],"name":"Trade","type":"event"},{"inputs":[],"name":"REFERRER_MAX_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOTAL_MAX_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WFTM","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"},{"internalType":"address","name":"_creator","type":"address"},{"internalType":"address","name":"_whitelistChecker","type":"address"},{"internalType":"uint256","name":"_tradingFee","type":"uint256"},{"internalType":"uint256","name":"_creatorFee","type":"uint256"}],"name":"addCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"adminAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"buyTokenUsingFTM","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"buyTokenUsingWFTM","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"calculatePriceAndFeesForCollection","outputs":[{"internalType":"uint256","name":"netPrice","type":"uint256"},{"internalType":"uint256","name":"tradingFee","type":"uint256"},{"internalType":"uint256","name":"creatorFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"canTokensBeListed","outputs":[{"internalType":"bool[]","name":"listingStatuses","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"cancelAskOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimPendingRevenue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"}],"name":"closeCollectionForTradingAndListing","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_askPrice","type":"uint256"}],"name":"createAskOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"galaxy","outputs":[{"internalType":"contract IWigoGalaxy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maximumAskPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumAskPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_newPrice","type":"uint256"}],"name":"modifyAskOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"},{"internalType":"address","name":"_creator","type":"address"},{"internalType":"address","name":"_whitelistChecker","type":"address"},{"internalType":"uint256","name":"_tradingFee","type":"uint256"},{"internalType":"uint256","name":"_creatorFee","type":"uint256"}],"name":"modifyCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"pendingRevenue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"recoverFungibleTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"recoverNonFungibleToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"referrerFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_adminAddress","type":"address"},{"internalType":"address","name":"_treasuryAddress","type":"address"}],"name":"setAdminAndTreasuryAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_referrerFee","type":"uint256"}],"name":"setReferrerFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_wigoGalaxyAddress","type":"address"}],"name":"setWigoGalaxyAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasuryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minimumAskPrice","type":"uint256"},{"internalType":"uint256","name":"_maximumAskPrice","type":"uint256"}],"name":"updateMinimumAndMaximumPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"cursor","type":"uint256"},{"internalType":"uint256","name":"size","type":"uint256"}],"name":"viewAsksByCollection","outputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"components":[{"internalType":"address","name":"seller","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct WigoNFTMarket.Ask[]","name":"askInfo","type":"tuple[]"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"address","name":"seller","type":"address"},{"internalType":"uint256","name":"cursor","type":"uint256"},{"internalType":"uint256","name":"size","type":"uint256"}],"name":"viewAsksByCollectionAndSeller","outputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"components":[{"internalType":"address","name":"seller","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct WigoNFTMarket.Ask[]","name":"askInfo","type":"tuple[]"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"viewAsksByCollectionAndTokenIds","outputs":[{"internalType":"bool[]","name":"statuses","type":"bool[]"},{"components":[{"internalType":"address","name":"seller","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct WigoNFTMarket.Ask[]","name":"askInfo","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"cursor","type":"uint256"},{"internalType":"uint256","name":"size","type":"uint256"}],"name":"viewCollections","outputs":[{"internalType":"address[]","name":"collectionAddresses","type":"address[]"},{"components":[{"internalType":"enum WigoNFTMarket.CollectionStatus","name":"status","type":"uint8"},{"internalType":"address","name":"creatorAddress","type":"address"},{"internalType":"address","name":"whitelistChecker","type":"address"},{"internalType":"uint256","name":"tradingFee","type":"uint256"},{"internalType":"uint256","name":"creatorFee","type":"uint256"}],"internalType":"struct WigoNFTMarket.Collection[]","name":"collectionDetails","type":"tuple[]"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60a06040523480156200001157600080fd5b5060405162005ab838038062005ab883398101604081905262000034916200040d565b6200003f33620003a0565b600180556001600160a01b038716620000b05760405162461bcd60e51b815260206004820152602860248201527f4f7065726174696f6e733a2041646d696e20616464726573732063616e6e6f74604482015267206265207a65726f60c01b60648201526084015b60405180910390fd5b6001600160a01b0386166200011c5760405162461bcd60e51b815260206004820152602b60248201527f4f7065726174696f6e733a20547265617375727920616464726573732063616e60448201526a6e6f74206265207a65726f60a81b6064820152608401620000a7565b6001600160a01b038516620001845760405162461bcd60e51b815260206004820152602760248201527f4f7065726174696f6e733a205746544d20616464726573732063616e6e6f74206044820152666265207a65726f60c81b6064820152608401620000a7565b6001600160a01b038416620001f25760405162461bcd60e51b815260206004820152602d60248201527f4f7065726174696f6e733a205769676f47616c6178792061646472657373206360448201526c616e6e6f74206265207a65726f60981b6064820152608401620000a7565b60008311620002555760405162461bcd60e51b815260206004820152602860248201527f4f7065726174696f6e733a205f6d696e696d756d41736b5072696365206d7573604482015267074206265203e20360c41b6064820152608401620000a7565b818310620002be5760405162461bcd60e51b815260206004820152602f60248201527f4f7065726174696f6e733a205f6d696e696d756d41736b5072696365203c205f60448201526e6d6178696d756d41736b507269636560881b6064820152608401620000a7565b60fa811115620003375760405162461bcd60e51b815260206004820152603960248201527f4f7065726174696f6e733a207265666572726572466565206d75737420696e6660448201527f6572696f7220746f2052454645525245525f4d41585f464545000000000000006064820152608401620000a7565b600380546001600160a01b03199081166001600160a01b03998a16179091556004805482169789169790971790965560609490941b6001600160601b03191660805260028054909516929095169190911790925560059190915560069190915560075562000486565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200040857600080fd5b919050565b600080600080600080600060e0888a03121562000428578283fd5b6200043388620003f0565b96506200044360208901620003f0565b95506200045360408901620003f0565b94506200046360608901620003f0565b93506080880151925060a0880151915060c0880151905092959891949750929550565b60805160601c6155e9620004cf6000396000818161031601528181610b1401528181610c2b015281816128620152818161395b01528181613fab01526147a001526155e96000f3fe6080604052600436106102345760003560e01c8063956bfb2211610138578063c5f956af116100b0578063e17734a31161007f578063f2fde38b11610064578063f2fde38b1461070c578063f81a95db1461072c578063fc6f94681461074c57600080fd5b8063e17734a3146106cc578063e67bfef8146106ec57600080fd5b8063c5f956af1461063f578063ce1ef8f61461066c578063d286ef741461068c578063ddf9ba6f146106ac57600080fd5b80639e0140c811610107578063b6c1d2cf116100ec578063b6c1d2cf146105dd578063bb0fd147146105f2578063c5d4618e1461061257600080fd5b80639e0140c814610582578063b2ea3931146105bd57600080fd5b8063956bfb221461051757806395f420981461052c57806398a5155a1461054c5780639b2adcdc1461056257600080fd5b80634f06d441116101cb578063715018a61161019a578063803b64a11161017f578063803b64a11461049d57806384a40864146104bd5780638da5cb5b146104ec57600080fd5b8063715018a614610468578063791e80181461047d57600080fd5b80634f06d441146103ed57806351c383ea146104035780636b248032146104325780636e88a7bd1461045257600080fd5b806322f67b6d1161020757806322f67b6d1461035d578063327708801461038b5780633ffd1781146103a057806343774864146103c057600080fd5b8063150b7a0214610239578063209cbe7e146102b357806320b6b2fc146102d757806321dbe87614610304575b600080fd5b34801561024557600080fd5b5061027d610254366004614eb8565b7f150b7a0200000000000000000000000000000000000000000000000000000000949350505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b3480156102bf57600080fd5b506102c96105dc81565b6040519081526020016102aa565b3480156102e357600080fd5b506102c96102f2366004614e0a565b60086020526000908152604090205481565b34801561031057600080fd5b506103387f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102aa565b34801561036957600080fd5b5061037d610378366004614ff4565b610779565b6040516102aa92919061534b565b61039e6103993660046150b4565b610a98565b005b3480156103ac57600080fd5b5061039e6103bb366004614e0a565b610ba8565b3480156103cc57600080fd5b506002546103389073ffffffffffffffffffffffffffffffffffffffff1681565b3480156103f957600080fd5b506102c960055481565b34801561040f57600080fd5b5061042361041e36600461515d565b610e5d565b6040516102aa93929190615226565b34801561043e57600080fd5b5061039e61044d366004614e5e565b6111fb565b34801561045e57600080fd5b506102c960075481565b34801561047457600080fd5b5061039e61162a565b34801561048957600080fd5b5061039e610498366004614e26565b6116b7565b3480156104a957600080fd5b5061039e6104b83660046150df565b611901565b3480156104c957600080fd5b506104dd6104d83660046150df565b611ceb565b6040516102aa93929190615379565b3480156104f857600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff16610338565b34801561052357600080fd5b506102c960fa81565b34801561053857600080fd5b5061039e6105473660046150b4565b612026565b34801561055857600080fd5b506102c960065481565b34801561056e57600080fd5b5061039e61057d3660046150df565b6122bb565b34801561058e57600080fd5b506105a261059d3660046150b4565b61257b565b604080519384526020840192909252908201526060016102aa565b3480156105c957600080fd5b5061039e6105d836600461515d565b61260c565b3480156105e957600080fd5b5061039e612763565b3480156105fe57600080fd5b5061039e61060d3660046150b4565b6128da565b34801561061e57600080fd5b5061063261062d366004614ff4565b612b3a565b6040516102aa9190615338565b34801561064b57600080fd5b506004546103389073ffffffffffffffffffffffffffffffffffffffff1681565b34801561067857600080fd5b5061039e610687366004614e0a565b612ccd565b34801561069857600080fd5b506104dd6106a7366004614faf565b612e60565b3480156106b857600080fd5b5061039e6106c7366004614e0a565b6131c5565b3480156106d857600080fd5b5061039e6106e7366004614e5e565b61337b565b3480156106f857600080fd5b5061039e6107073660046150df565b6138cf565b34801561071857600080fd5b5061039e610727366004614e0a565b613999565b34801561073857600080fd5b5061039e61074736600461512d565b613ac9565b34801561075857600080fd5b506003546103389073ffffffffffffffffffffffffffffffffffffffff1681565b606080828067ffffffffffffffff8111156107bd577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156107e6578160200160208202803683370190505b5092508067ffffffffffffffff811115610829577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561086e57816020015b60408051808201909152600080825260208201528152602001906001900390816108475790505b50915060005b81811015610a8e576108ec8686838181106108b8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff8b166000908152600c6020908152604090912093910201359050613c16565b1561094157600184828151811061092c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9115156020928302919091019091015261098d565b600084828151811061097c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b911515602092830291909101909101525b73ffffffffffffffffffffffffffffffffffffffff87166000908152600b60205260408120908787848181106109ec577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602090810292909201358352508181019290925260409081016000208151808301909252805473ffffffffffffffffffffffffffffffffffffffff16825260010154918101919091528351849083908110610a70577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101819052508080610a86906154fa565b915050610874565b5050935093915050565b60026001541415610b0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b60026001819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b158015610b7a57600080fd5b505af1158015610b8e573d6000803e3d6000fd5b5050505050610ba08282346001613c33565b505060018055565b60005473ffffffffffffffffffffffffffffffffffffffff163314610c29576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b01565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610cdf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4f7065726174696f6e733a2043616e6e6f74207265636f766572205746544d006044820152606401610b01565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8316906370a082319060240160206040518083038186803b158015610d4757600080fd5b505afa158015610d5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7f9190615145565b905080610de8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4f7065726174696f6e733a204e6f20746f6b656e20746f207265636f766572006044820152606401610b01565b610e0973ffffffffffffffffffffffffffffffffffffffff831633836141e2565b8173ffffffffffffffffffffffffffffffffffffffff167f14f11966a996e0629572e51064726d2057a80fbd34efc066682c06a71dbb6e9882604051610e5191815260200190565b60405180910390a25050565b60608060008385610e6e60096142bb565b610e7891906154b7565b811115610e975785610e8a60096142bb565b610e9491906154b7565b90505b8067ffffffffffffffff811115610ed7577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015610f00578160200160208202803683370190505b5093508067ffffffffffffffff811115610f43577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015610fba57816020015b6040805160a0810182526000808252602080830182905292820181905260608201819052608082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff909201910181610f615790505b50925060005b818110156111df57610fdd610fd58289615429565b6009906142c5565b858281518110611016577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d600086838151811061108d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040908101600020815160a081019092528054829060ff166002811115611107577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600281111561113f577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b8152815473ffffffffffffffffffffffffffffffffffffffff6101009091048116602083015260018301541660408201526002820154606082015260039091015460809091015284518590839081106111c1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001018190525080806111d7906154fa565b915050610fc0565b5083836111ec8389615429565b935093509350505b9250925092565b60035473ffffffffffffffffffffffffffffffffffffffff16331461127c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d616e6167656d656e743a204e6f742061646d696e00000000000000000000006044820152606401610b01565b6112876009866142d1565b611313576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4f7065726174696f6e733a20436f6c6c656374696f6e206e6f74206c6973746560448201527f64000000000000000000000000000000000000000000000000000000000000006064820152608401610b01565b80158015611335575073ffffffffffffffffffffffffffffffffffffffff8416155b8061135f5750801580159061135f575073ffffffffffffffffffffffffffffffffffffffff841615155b6113eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f4f7065726174696f6e733a2043726561746f7220706172616d6574657273206960448201527f6e636f72726563740000000000000000000000000000000000000000000000006064820152608401610b01565b6105dc6113f88284615429565b1115611486576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4f7065726174696f6e733a2053756d206f6620666565206d75737420696e666560448201527f72696f7220746f20544f54414c5f4d41585f46454500000000000000000000006064820152608401610b01565b6040805160a08101909152806001815273ffffffffffffffffffffffffffffffffffffffff8087166020808401919091528682166040808501919091526060840187905260809093018590529088166000908152600d909152208151815482907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001836002811115611543577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b021790555060208281015182547fffffffffffffffffffffff0000000000000000000000000000000000000000ff1661010073ffffffffffffffffffffffffffffffffffffffff928316021783556040808501516001850180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691841691909117905560608501516002850155608090940151600390930192909255825185815290810184905285821692878316928916917f655bd8b9d972737b566ec5473b537d81d079c6e251d4986005bf3f36000eacef91015b60405180910390a45050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146116ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b01565b6116b56000614300565b565b60005473ffffffffffffffffffffffffffffffffffffffff163314611738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b01565b73ffffffffffffffffffffffffffffffffffffffff82166117db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f4f7065726174696f6e733a2041646d696e20616464726573732063616e6e6f7460448201527f206265207a65726f0000000000000000000000000000000000000000000000006064820152608401610b01565b73ffffffffffffffffffffffffffffffffffffffff811661187e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f4f7065726174696f6e733a20547265617375727920616464726573732063616e60448201527f6e6f74206265207a65726f0000000000000000000000000000000000000000006064820152608401610b01565b600380547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff858116918217909355600480549092169284169283179091556040517f2a1b1d9b1cb634e511bbf940f66e95082249486cf37efdb4bccba1c5f4c00b9b90600090a35050565b6002600154141561196e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b01565b6002600155600554811080159061198757506006548111155b6119ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4f726465723a205072696365206e6f742077697468696e2072616e67650000006044820152606401610b01565b600173ffffffffffffffffffffffffffffffffffffffff84166000908152600d602052604090205460ff166002811115611a50577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b14611ab7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f436f6c6c656374696f6e3a204e6f7420666f72206c697374696e6700000000006044820152606401610b01565b611ac18383614375565b611b27576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4f726465723a20746f6b656e4964206e6f7420656c696769626c6500000000006044820152606401610b01565b6040517f42842e0e0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810183905273ffffffffffffffffffffffffffffffffffffffff8416906342842e0e90606401600060405180830381600087803b158015611b9b57600080fd5b505af1158015611baf573d6000803e3d6000fd5b5050336000908152600e6020908152604080832073ffffffffffffffffffffffffffffffffffffffff891684529091529020611bee9250905083614450565b50604080518082018252338152602080820184815273ffffffffffffffffffffffffffffffffffffffff8781166000818152600b85528681208982528552868120955186547fffffffffffffffffffffffff000000000000000000000000000000000000000016931692909217855591516001909401939093558252600c905220611c799083614450565b50813373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167faa0431463bb62c812c04a1e5310cf43dd9baedc7a8eab71e02f572c741467e8c84604051611cda91815260200190565b60405180910390a450506001805550565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600c60205260408120606091829184908690611d22906142bb565b611d2c91906154b7565b811115611d705773ffffffffffffffffffffffffffffffffffffffff87166000908152600c602052604090208690611d63906142bb565b611d6d91906154b7565b90505b8067ffffffffffffffff811115611db0577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dd9578160200160208202803683370190505b5093508067ffffffffffffffff811115611e1c577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e6157816020015b6040805180820190915260008082526020820152815260200190600190039081611e3a5790505b50925060005b8181101561200957611ea7611e7c8289615429565b73ffffffffffffffffffffffffffffffffffffffff8a166000908152600c60205260409020906142c5565b858281518110611ee0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001018181525050600b60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000868381518110611f66577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60209081029190910181015182528181019290925260409081016000208151808301909252805473ffffffffffffffffffffffffffffffffffffffff16825260010154918101919091528451859083908110611feb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101819052508080612001906154fa565b915050611e67565b5083836120168389615429565b9350935093505093509350939050565b60026001541415612093576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b01565b6002600155336000908152600e6020908152604080832073ffffffffffffffffffffffffffffffffffffffff8616845290915290206120d29082613c16565b612138576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4f726465723a20546f6b656e206e6f74206c69737465640000000000000000006044820152606401610b01565b336000908152600e6020908152604080832073ffffffffffffffffffffffffffffffffffffffff861684529091529020612172908261445c565b5073ffffffffffffffffffffffffffffffffffffffff82166000818152600b60209081526040808320858452825280832080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600101839055928252600c9052206121e1908261445c565b506040517f23b872dd0000000000000000000000000000000000000000000000000000000081523060048201523360248201526044810182905273ffffffffffffffffffffffffffffffffffffffff8316906323b872dd90606401600060405180830381600087803b15801561225657600080fd5b505af115801561226a573d6000803e3d6000fd5b505060405183925033915073ffffffffffffffffffffffffffffffffffffffff8516907fa5764ea233325154a6388255c54b9f302ec2ed8586af0a9a606cd64e88298eb790600090a4505060018055565b60026001541415612328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b01565b6002600155600554811080159061234157506006548111155b6123a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4f726465723a205072696365206e6f742077697468696e2072616e67650000006044820152606401610b01565b600173ffffffffffffffffffffffffffffffffffffffff84166000908152600d602052604090205460ff16600281111561240a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b14612471576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f436f6c6c656374696f6e3a204e6f7420666f72206c697374696e6700000000006044820152606401610b01565b336000908152600e6020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915290206124ab9083613c16565b612511576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4f726465723a20546f6b656e206e6f74206c69737465640000000000000000006044820152606401610b01565b73ffffffffffffffffffffffffffffffffffffffff83166000818152600b6020908152604080832086845282529182902060010184905590518381528492339290917f492437c0ade072acdf12e63a19d8df68bb5e414e2098dc470239df87702343ea9101611cda565b60008080600173ffffffffffffffffffffffffffffffffffffffff86166000908152600d602052604090205460ff1660028111156125e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b146125f5575060009150819050806111f4565b6125ff8585614468565b9250925092509250925092565b60035473ffffffffffffffffffffffffffffffffffffffff16331461268d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d616e6167656d656e743a204e6f742061646d696e00000000000000000000006044820152606401610b01565b80821061271c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4f7065726174696f6e733a205f6d696e696d756d41736b5072696365203c205f60448201527f6d6178696d756d41736b507269636500000000000000000000000000000000006064820152608401610b01565b6005829055600681905560408051838152602081018390527fb25b7c478b617cc7fb07f97a49dc7dcba200dae3abbcb0aa17216e2ae6deaef7910160405180910390a15050565b600260015414156127d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b01565b6002600155336000908152600860205260409020548061284c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f436c61696d3a204e6f7468696e6720746f20636c61696d0000000000000000006044820152606401610b01565b3360008181526008602052604081205561289e907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690836141e2565b60405181815233907fc6cb6f1a9d5212d4ee3819d9b175a85e8333a7327d53dfbc1b610e1fd8ec3cb59060200160405180910390a25060018055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461295b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b01565b600260015414156129c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b01565b600260015573ffffffffffffffffffffffffffffffffffffffff82166000908152600c602052604090206129fc9082613c16565b15612a63576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4f7065726174696f6e733a204e4654206e6f74207265636f76657261626c65006044820152606401610b01565b6040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201523360248201526044810182905273ffffffffffffffffffffffffffffffffffffffff8316906342842e0e90606401600060405180830381600087803b158015612ad757600080fd5b505af1158015612aeb573d6000803e3d6000fd5b505060405183925073ffffffffffffffffffffffffffffffffffffffff851691507f861c3ea25dbda3af0bf5d258ba8582c0276c9446b1479e817be3f1b4a89acf9190600090a3505060018055565b60608167ffffffffffffffff811115612b7c577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015612ba5578160200160208202803683370190505b509050600173ffffffffffffffffffffffffffffffffffffffff85166000908152600d602052604090205460ff166002811115612c0b577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b14612c1557612cc6565b60005b82811015612cc457612c6985858584818110612c5d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020135614375565b828281518110612ca2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9115156020928302919091019091015280612cbc816154fa565b915050612c18565b505b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314612d4e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b01565b73ffffffffffffffffffffffffffffffffffffffff8116612df1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f7065726174696f6e733a205769676f47616c6178792061646472657373206360448201527f616e6e6f74206265207a65726f000000000000000000000000000000000000006064820152608401610b01565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517f360d2d6d8efaf9c060942d519f3117620ed52929bcee888996411d71038802a590600090a250565b73ffffffffffffffffffffffffffffffffffffffff8084166000908152600e602090815260408083209388168352929052908120606091829184908690612ea6906142bb565b612eb091906154b7565b811115612f015773ffffffffffffffffffffffffffffffffffffffff8088166000908152600e60209081526040808320938c168352929052208690612ef4906142bb565b612efe91906154b7565b90505b8067ffffffffffffffff811115612f41577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015612f6a578160200160208202803683370190505b5093508067ffffffffffffffff811115612fad577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015612ff257816020015b6040805180820190915260008082526020820152815260200190600190039081612fcb5790505b50925060005b818110156131a75761304561300d8289615429565b73ffffffffffffffffffffffffffffffffffffffff808b166000908152600e60209081526040808320938f16835292905220906142c5565b85828151811061307e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001018181525050600b60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000868381518110613104577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60209081029190910181015182528181019290925260409081016000208151808301909252805473ffffffffffffffffffffffffffffffffffffffff16825260010154918101919091528451859083908110613189577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181905250808061319f906154fa565b915050612ff8565b5083836131b48389615429565b935093509350509450945094915050565b60035473ffffffffffffffffffffffffffffffffffffffff163314613246576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d616e6167656d656e743a204e6f742061646d696e00000000000000000000006044820152606401610b01565b6132516009826142d1565b6132dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4f7065726174696f6e733a20436f6c6c656374696f6e206e6f74206c6973746560448201527f64000000000000000000000000000000000000000000000000000000000000006064820152608401610b01565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600d6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166002179055613336600982614546565b5060405173ffffffffffffffffffffffffffffffffffffffff8216907ff6df65a3d7d931af345d93f0420a22e8910de36c0d027c1d1ac93d5be509f5a990600090a250565b60035473ffffffffffffffffffffffffffffffffffffffff1633146133fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d616e6167656d656e743a204e6f742061646d696e00000000000000000000006044820152606401610b01565b6134076009866142d1565b15613494576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4f7065726174696f6e733a20436f6c6c656374696f6e20616c7265616479206c60448201527f69737465640000000000000000000000000000000000000000000000000000006064820152608401610b01565b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f80ac58cd00000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8616906301ffc9a79060240160206040518083038186803b15801561351957600080fd5b505afa15801561352d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135519190615113565b6135b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f7065726174696f6e733a204e6f7420455243373231000000000000000000006044820152606401610b01565b801580156135d9575073ffffffffffffffffffffffffffffffffffffffff8416155b8061360357508015801590613603575073ffffffffffffffffffffffffffffffffffffffff841615155b61368f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f4f7065726174696f6e733a2043726561746f7220706172616d6574657273206960448201527f6e636f72726563740000000000000000000000000000000000000000000000006064820152608401610b01565b6105dc61369c8284615429565b111561372a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4f7065726174696f6e733a2053756d206f6620666565206d75737420696e666560448201527f72696f7220746f20544f54414c5f4d41585f46454500000000000000000000006064820152608401610b01565b613735600986614568565b506040805160a08101909152806001815273ffffffffffffffffffffffffffffffffffffffff8087166020808401919091528682166040808501919091526060840187905260809093018590529088166000908152600d909152208151815482907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018360028111156137f3577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b021790555060208281015182547fffffffffffffffffffffff0000000000000000000000000000000000000000ff1661010073ffffffffffffffffffffffffffffffffffffffff928316021783556040808501516001850180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691841691909117905560608501516002850155608090940151600390930192909255825185815290810184905285821692878316928916917f4863c75720ebabd11e0cf1c60b58786b5572680a20fa1b568c203964ae56026a910161161b565b6002600154141561393c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b01565b600260015561398373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001633308461458a565b6139908383836000613c33565b50506001805550565b60005473ffffffffffffffffffffffffffffffffffffffff163314613a1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b01565b73ffffffffffffffffffffffffffffffffffffffff8116613abd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610b01565b613ac681614300565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314613b4a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b01565b60fa811115613bdb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f4f7065726174696f6e733a207265666572726572466565206d75737420696e6660448201527f6572696f7220746f2052454645525245525f4d41585f464545000000000000006064820152608401610b01565b60078190556040518181527f341ddd809a02bf4a22ffd6d48934739cb86e43bbe9c8f6bf2cc0d54ccc46a1ae9060200160405180910390a150565b600081815260018301602052604081205415155b90505b92915050565b600173ffffffffffffffffffffffffffffffffffffffff85166000908152600d602052604090205460ff166002811115613c96577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b14613cfd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f436f6c6c656374696f6e3a204e6f7420666f722074726164696e6700000000006044820152606401610b01565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600c60205260409020613d2c9084613c16565b613d92576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4275793a204e6f7420666f722073616c650000000000000000000000000000006044820152606401610b01565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600b60209081526040808320878452825291829020825180840190935280549093168252600190920154918101829052908314613e48576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f4275793a20496e636f72726563742070726963650000000000000000000000006044820152606401610b01565b805173ffffffffffffffffffffffffffffffffffffffff16331415613ec9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4275793a2042757965722063616e6e6f742062652073656c6c657200000000006044820152606401610b01565b6000806000613ed88887614468565b865173ffffffffffffffffffffffffffffffffffffffff9081166000908152600e60209081526040808320938f168352929052209295509093509150613f1e908861445c565b5073ffffffffffffffffffffffffffffffffffffffff88166000818152600b602090815260408083208b8452825280832080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600101839055928252600c905220613f8d908861445c565b508351613fd29073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690856141e2565b6000613fe3856000015133896145ee565b9050806140165761138860075488613ffb919061547a565b6140059190615441565b61400f9084615429565b9250614047565b80600114156140475761271060075488614030919061547a565b61403a9190615441565b6140449084615429565b92505b811561409e5773ffffffffffffffffffffffffffffffffffffffff808a166000908152600d602090815260408083205461010090049093168252600890529081208054849290614098908490615429565b90915550505b82156140e15760045473ffffffffffffffffffffffffffffffffffffffff16600090815260086020526040812080548592906140db908490615429565b90915550505b6040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201523360248201526044810189905273ffffffffffffffffffffffffffffffffffffffff8a16906342842e0e90606401600060405180830381600087803b15801561415557600080fd5b505af1158015614169573d6000803e3d6000fd5b5050865160408051338152602081018c9052908101889052891515606082015273ffffffffffffffffffffffffffffffffffffffff91821693508b9250908c16907fdaac0e40b8f01e970d08d4e8ae57ac31a5845fffde104c43f05e19bbec78491e9060800160405180910390a4505050505050505050565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526142b69084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915261497f565b505050565b6000613c2d825490565b6000613c2a8383614a8b565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001830160205260408120541515613c2a565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600d602052604081206001015490911680158061444857506040517f5314a9310000000000000000000000000000000000000000000000000000000081526004810184905273ffffffffffffffffffffffffffffffffffffffff821690635314a9319060240160206040518083038186803b15801561441057600080fd5b505afa158015614424573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144489190615113565b949350505050565b6000613c2a8383614adc565b6000613c2a8383614b2b565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600d602052604081206002015481908190612710906144a3908661547a565b6144ad9190615441565b73ffffffffffffffffffffffffffffffffffffffff86166000908152600d6020526040902060030154909250612710906144e7908661547a565b6144f19190615441565b9050600061271060075486614506919061547a565b6145109190615441565b905061451d81600261547a565b8261452885886154b7565b61453291906154b7565b61453c91906154b7565b9350509250925092565b6000613c2a8373ffffffffffffffffffffffffffffffffffffffff8416614b2b565b6000613c2a8373ffffffffffffffffffffffffffffffffffffffff8416614adc565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526145e89085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401614234565b50505050565b6002546040517fa0d0352600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152600092169063a0d035269060240160206040518083038186803b15801561465a57600080fd5b505afa15801561466e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146929190615113565b156147d8576002546040517fa367463300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152600092839291169063a36746339060240160606040518083038186803b15801561470657600080fd5b505afa15801561471a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061473e9190615077565b5091509150808015614765575073ffffffffffffffffffffffffffffffffffffffff821615155b156147d5576147c7826127106007548761477f919061547a565b6147899190615441565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001691906141e2565b6147d2600184615429565b92505b50505b6002546040517fa0d0352600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301529091169063a0d035269060240160206040518083038186803b15801561484357600080fd5b505afa158015614857573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061487b9190615113565b15612cc6576002546040517fa367463300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152600092839291169063a36746339060240160606040518083038186803b1580156148ef57600080fd5b505afa158015614903573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906149279190615077565b509150915080801561494e575073ffffffffffffffffffffffffffffffffffffffff821615155b1561497657614968826127106007548761477f919061547a565b614973600184615429565b92505b50509392505050565b60006149e1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16614c939092919063ffffffff16565b8051909150156142b657808060200190518101906149ff9190615113565b6142b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610b01565b6000826000018281548110614ac9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154905092915050565b6000818152600183016020526040812054614b2357508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155613c2d565b506000613c2d565b60008181526001830160205260408120548015614c89576000614b4f6001836154b7565b8554909150600090614b63906001906154b7565b9050818114614c16576000866000018281548110614baa577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154905080876000018481548110614bf4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000918252602080832090910192909255918252600188019052604090208390555b8554869080614c4e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050613c2d565b6000915050613c2d565b606061444884846000858573ffffffffffffffffffffffffffffffffffffffff85163b614d1c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b01565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051614d45919061520a565b60006040518083038185875af1925050503d8060008114614d82576040519150601f19603f3d011682016040523d82523d6000602084013e614d87565b606091505b5091509150614d97828286614da2565b979650505050505050565b60608315614db1575081612cc6565b825115614dc15782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0191906153d8565b80518015158114614e0557600080fd5b919050565b600060208284031215614e1b578081fd5b8135612cc681615591565b60008060408385031215614e38578081fd5b8235614e4381615591565b91506020830135614e5381615591565b809150509250929050565b600080600080600060a08688031215614e75578081fd5b8535614e8081615591565b94506020860135614e9081615591565b93506040860135614ea081615591565b94979396509394606081013594506080013592915050565b60008060008060808587031215614ecd578384fd5b8435614ed881615591565b93506020850135614ee881615591565b925060408501359150606085013567ffffffffffffffff80821115614f0b578283fd5b818701915087601f830112614f1e578283fd5b813581811115614f3057614f30615562565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715614f7657614f76615562565b816040528281528a6020848701011115614f8e578586fd5b82602086016020830137918201602001949094529598949750929550505050565b60008060008060808587031215614fc4578384fd5b8435614fcf81615591565b93506020850135614fdf81615591565b93969395505050506040820135916060013590565b600080600060408486031215615008578283fd5b833561501381615591565b9250602084013567ffffffffffffffff8082111561502f578384fd5b818601915086601f830112615042578384fd5b813581811115615050578485fd5b8760208260051b8501011115615064578485fd5b6020830194508093505050509250925092565b60008060006060848603121561508b578283fd5b835161509681615591565b92506150a460208501614df5565b9150604084015190509250925092565b600080604083850312156150c6578182fd5b82356150d181615591565b946020939093013593505050565b6000806000606084860312156150f3578283fd5b83356150fe81615591565b95602085013595506040909401359392505050565b600060208284031215615124578081fd5b613c2a82614df5565b60006020828403121561513e578081fd5b5035919050565b600060208284031215615156578081fd5b5051919050565b6000806040838503121561516f578081fd5b50508035926020909101359150565b6000815180845260208085019450808401835b838110156151af578151151587529582019590820190600101615191565b509495945050505050565b6000815180845260208085019450808401835b838110156151af578151805173ffffffffffffffffffffffffffffffffffffffff16885283015183880152604090960195908201906001016151cd565b6000825161521c8184602087016154ce565b9190910192915050565b6060808252845182820181905260009190608090818501906020808a01865b8381101561527757815173ffffffffffffffffffffffffffffffffffffffff1685529382019390820190600101615245565b50508683038188015288518084528982019382019250865b818110156153205784518051600381106152d0577f4e487b71000000000000000000000000000000000000000000000000000000008a52602160045260248afd5b85528084015173ffffffffffffffffffffffffffffffffffffffff90811685870152604080830151909116908601528781015188860152860151868501529382019360a09093019260010161528f565b50505080945050505050826040830152949350505050565b602081526000613c2a602083018461517e565b60408152600061535e604083018561517e565b828103602084015261537081856151ba565b95945050505050565b606080825284519082018190526000906020906080840190828801845b828110156153b257815184529284019290840190600101615396565b505050838103828501526153c681876151ba565b92505050826040830152949350505050565b60208152600082518060208401526153f78160408501602087016154ce565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000821982111561543c5761543c615533565b500190565b600082615475577f4e487b710000000000000000000000000000000000000000000000000000000081526012600452602481fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156154b2576154b2615533565b500290565b6000828210156154c9576154c9615533565b500390565b60005b838110156154e95781810151838201526020016154d1565b838111156145e85750506000910152565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561552c5761552c615533565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff81168114613ac657600080fdfea2646970667358221220373f3b4fea995bda0fa4808b32e43001f5ebeddbcfeb772849be4ae582a5da2d64736f6c6343000804003300000000000000000000000061e468f685392948504da7a49463fd508ec1e2cd00000000000000000000000053dce346b09a521d7dd277872f136cf4b98ea32600000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83000000000000000000000000e63f6ab514167a7f28dd81d332a5e9f00819b9aa000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000084595161401484a0000000000000000000000000000000000000000000000000000000000000000000096

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

00000000000000000000000061e468f685392948504da7a49463fd508ec1e2cd00000000000000000000000053dce346b09a521d7dd277872f136cf4b98ea32600000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83000000000000000000000000e63f6ab514167a7f28dd81d332a5e9f00819b9aa000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000084595161401484a0000000000000000000000000000000000000000000000000000000000000000000096

-----Decoded View---------------
Arg [0] : _adminAddress (address): 0x61e468f685392948504da7a49463fd508ec1e2cd
Arg [1] : _treasuryAddress (address): 0x53dce346b09a521d7dd277872f136cf4b98ea326
Arg [2] : _WFTMAddress (address): 0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83
Arg [3] : _wigoGalaxyAddress (address): 0xe63f6ab514167a7f28dd81d332a5e9f00819b9aa
Arg [4] : _minimumAskPrice (uint256): 10000000000000000
Arg [5] : _maximumAskPrice (uint256): 10000000000000000000000000
Arg [6] : _referrerFee (uint256): 150

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 00000000000000000000000061e468f685392948504da7a49463fd508ec1e2cd
Arg [1] : 00000000000000000000000053dce346b09a521d7dd277872f136cf4b98ea326
Arg [2] : 00000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83
Arg [3] : 000000000000000000000000e63f6ab514167a7f28dd81d332a5e9f00819b9aa
Arg [4] : 000000000000000000000000000000000000000000000000002386f26fc10000
Arg [5] : 000000000000000000000000000000000000000000084595161401484a000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000096


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Validator ID :
0 FTM

Amount Staked
0

Amount Delegated
0

Staking Total
0

Staking Start Epoch
0

Staking Start Time
0

Proof of Importance
0

Origination Score
0

Validation Score
0

Active
0

Online
0

Downtime
0 s
Address Amount claimed Rewards Created On Epoch Created On
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.