Contract 0x9483eFf448042c366a4297dB465FaE108d2e6ea6

  Note: Our ETH balance display is temporarily unavailable. Please check back later.
Txn Hash Method
Block
From
To
Value
0x90eafb446d1eb9fe319d3fb1b6dda897623b8e78f6f17cfb4aa382e4b89f1ef8Buy From Parlay ...179749622023-11-30 20:59:52175 days 16 hrs ago0x9841484a4a6c0b61c4eea71376d76453fd05ec9c IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0075075462611.500000252
0xbfc6702c9d8ebf64067f221676a6edd85a5f04f91c15201d383781c0440a9bf0Buy From Parlay ...149328702023-09-21 10:56:48246 days 2 hrs ago0xe966c59c15566a994391f6226fee5bc0ef70f87a IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0114564243811.50000005
0x14e07272e938cb708711bd3ab01897742049f5b15b5c8d17a7a6d9c14a5b07d2Buy From AMM Wit...139869652023-08-30 13:26:38268 days 24 mins ago0xe966c59c15566a994391f6226fee5bc0ef70f87a IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0008704380431.00000005
0xd97b7def05603a24e584a9814ad5564cb30511d8142d477358e3f470a3cc8902Buy From AMM Wit...139855072023-08-30 12:38:02268 days 1 hr ago0xe966c59c15566a994391f6226fee5bc0ef70f87a IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0010524400521.00000005
0x48fe155da4410b2d92db469ed22120f56ac08ee2e1d0a3d156c9a776b509fd52Buy From AMM Wit...139850282023-08-30 12:22:04268 days 1 hr ago0xe966c59c15566a994391f6226fee5bc0ef70f87a IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0010960460541.00000005
0xa98dc071c59d68f4d4d114df11ed5cc435f0765385b5604df0aec0e6d601f362Buy From Parlay ...139815622023-08-30 10:26:32268 days 3 hrs ago0xe966c59c15566a994391f6226fee5bc0ef70f87a IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0058689184951.00000005
0x05d4204757ec3f6608eee0cf957c800946d441614816a7f1133242d8ba50d136Buy From AMM Wit...139508322023-08-29 17:22:12268 days 20 hrs ago0xe966c59c15566a994391f6226fee5bc0ef70f87a IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0013182170651.00000005
0xd874ce61aba5c7b81d73cb4519da392fbf43a205ac33f1cf1f10fc0062d899f7Transfer Ownersh...135974442023-08-21 13:02:36277 days 48 mins ago0x9841484a4a6c0b61c4eea71376d76453fd05ec9c IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0000430050011.50000005
0xc1c1e4cd8110d0181832949a0926689e815a34c4f59d04e91e5b70859099ee53Buy From AMM Wit...133857842023-08-16 15:27:16281 days 22 hrs ago0x9841484a4a6c0b61c4eea71376d76453fd05ec9c IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0015375555771.50000005
0x9e1017286975f91b3ee7c3a6f71f55f0fb7d87834337b690a0288313f5fff044Buy From AMM Wit...133857192023-08-16 15:25:06281 days 22 hrs ago0x9841484a4a6c0b61c4eea71376d76453fd05ec9c IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0015375735781.50000005
0x6b263dfa1995c75ac0d7adf7c9cac5d0f7d73259863ba1067a812af8d69b4969Buy From AMM Wit...133857022023-08-16 15:24:32281 days 22 hrs ago0x9841484a4a6c0b61c4eea71376d76453fd05ec9c IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.001533373581.50000005
0x620aff27e51844b8f104c4058d773bb94ddbabf78279ec90cabd0aa1cb384f3aBuy From AMM Wit...133856832023-08-16 15:23:54281 days 22 hrs ago0x9841484a4a6c0b61c4eea71376d76453fd05ec9c IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0015375735781.50000005
0x111e6a869da62f2ca4c6123a0a983832b997be8137c4476f7b504f12633c30e5Buy From AMM Wit...133856612023-08-16 15:23:10281 days 22 hrs ago0x9841484a4a6c0b61c4eea71376d76453fd05ec9c IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0015377340791.50000005
0x95a6262656b59e7eaeba4bb5a2726d12ceef5922730d389edd2d46e92812af0eBuy From AMM Wit...133856452023-08-16 15:22:38281 days 22 hrs ago0x9841484a4a6c0b61c4eea71376d76453fd05ec9c IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.001537573581.50000005
0x4e09bfac3f519d4494e34a1f1474be36bd13264425fa960c2d226589dc64b032Buy From Parlay ...132896552023-08-14 10:02:58284 days 3 hrs ago0x9841484a4a6c0b61c4eea71376d76453fd05ec9c IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0002500500091.50000005
0x0ed5bf78e3aba7a0051422e310dc4b9fac32e528ea2d3758fa0d0efc48e8f099Buy From Parlay ...132893232023-08-14 9:51:54284 days 3 hrs ago0x9841484a4a6c0b61c4eea71376d76453fd05ec9c IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0109022163651.50000005
0x236da9615af8957f4e220c44447f591773c7a3158b8f97da64d01cd987c6fce4Buy From Parlay ...132889372023-08-14 9:39:02284 days 4 hrs ago0x9841484a4a6c0b61c4eea71376d76453fd05ec9c IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0001918290081.50000005
0x9e5304d757fd9df342a17c73300555fcef4c4f1bcc6507ea2027ed475b9da74aBuy From Parlay ...118272092023-07-11 13:34:46318 days 16 mins ago0xe966c59c15566a994391f6226fee5bc0ef70f87a IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0039335099681.00000005
0x8002f825c1406280ac60aa631250921895992b0c3fc68c46b550ad838e953bdaBuy From Parlay ...118270822023-07-11 13:30:32318 days 20 mins ago0xe966c59c15566a994391f6226fee5bc0ef70f87a IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0054142066851.00000005
0x05198cf91daaf9a2e63d6f2079777d536693dc5571a471e63c223b772fd701acBuy From AMM Wit...115685762023-07-05 13:53:40323 days 23 hrs ago0x34ad8d8c3e12b5a500fe983c43f2a0306dcf0ad1 IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0014219860371.50000005
0xa0484d45a65dd865911a229aaa0be1ce043bb30c3eb09d7fdd0e846efaa9cc47Buy From Parlay ...91929932023-05-11 14:07:34378 days 23 hrs ago0xe966c59c15566a994391f6226fee5bc0ef70f87a IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0039281871061.50000005
0x6348ba49578a26d9b3e1c53979f9cdd9d4c8b17dec9bb4b980161feb00295869Mint66906052023-03-14 15:54:38436 days 21 hrs ago0xab4e7acf7b5cfe4ca76cabed68e57357857a28fe IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0015536780381.500000049
0x8e9f8ca0fcc55ae005f36b2b40207eb2cb7cb30cf35197e31d70d190397748acBuy From Parlay ...65079062023-03-10 10:24:40441 days 3 hrs ago0xe21b80181304e3641424cdfb8376e73574ab4794 IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0076662171111.500000051
0x22f866b50ce5dbef354c551e441d218be0e43b552d08c585946e5fc82822a22bBuy From Parlay ...64676632023-03-09 12:03:14442 days 1 hr ago0xe21b80181304e3641424cdfb8376e73574ab4794 IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.0036331032281.500000049
0xbfbdfea73c13cf991fcd0e6e6fbb468621a5dddaa84328906b14d323d4fd8b1dBuy From AMM Wit...64676392023-03-09 12:02:26442 days 1 hr ago0xe21b80181304e3641424cdfb8376e73574ab4794 IN  0x9483eff448042c366a4297db465fae108d2e6ea60 ETH0.00226865271.500000049
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x9e5304d757fd9df342a17c73300555fcef4c4f1bcc6507ea2027ed475b9da74a118272092023-07-11 13:34:46318 days 16 mins ago 0x9483eff448042c366a4297db465fae108d2e6ea6 0x0ec9d8dac2178b041f85f60e3cf13cfaa3d23e0e0 ETH
0x8002f825c1406280ac60aa631250921895992b0c3fc68c46b550ad838e953bda118270822023-07-11 13:30:32318 days 20 mins ago 0x9483eff448042c366a4297db465fae108d2e6ea6 0x0ec9d8dac2178b041f85f60e3cf13cfaa3d23e0e0 ETH
0x05198cf91daaf9a2e63d6f2079777d536693dc5571a471e63c223b772fd701ac115685762023-07-05 13:53:40323 days 23 hrs ago 0x9483eff448042c366a4297db465fae108d2e6ea6 0xe2d8792afc867fc71e3718baf5984e25588ca6af0 ETH
0x05198cf91daaf9a2e63d6f2079777d536693dc5571a471e63c223b772fd701ac115685762023-07-05 13:53:40323 days 23 hrs ago 0x9483eff448042c366a4297db465fae108d2e6ea6 0x7f5301906dd04599e720cf95115354cd1596c21f0 ETH
0x05198cf91daaf9a2e63d6f2079777d536693dc5571a471e63c223b772fd701ac115685762023-07-05 13:53:40323 days 23 hrs ago 0x9483eff448042c366a4297db465fae108d2e6ea6 0x7465c5d60d3d095443cf9991da03304a30d42eae0 ETH
0x05198cf91daaf9a2e63d6f2079777d536693dc5571a471e63c223b772fd701ac115685762023-07-05 13:53:40323 days 23 hrs ago 0x9483eff448042c366a4297db465fae108d2e6ea6 0x7465c5d60d3d095443cf9991da03304a30d42eae0 ETH
0x5bc8f7f10273b220e74ea0b29d7e3aa940da7743974e7b3dd5bfe03fb621d22376332692023-04-05 11:36:46415 days 2 hrs ago 0x9483eff448042c366a4297db465fae108d2e6ea6 0xe1ceaa829525a08c1d39a5cebe4b42af58d771980 ETH
0x5bc8f7f10273b220e74ea0b29d7e3aa940da7743974e7b3dd5bfe03fb621d22376332692023-04-05 11:36:46415 days 2 hrs ago 0xfd4d94e538af8c176540a1ad7009184f03476737 0x9483eff448042c366a4297db465fae108d2e6ea60 ETH
0x776be00ab84527c97a0d6903ddea56afa08dfa5def8b8c1d0b9070d58146374f76326732023-04-05 11:16:54415 days 2 hrs ago 0x9483eff448042c366a4297db465fae108d2e6ea6 0xe1ceaa829525a08c1d39a5cebe4b42af58d771980 ETH
0x776be00ab84527c97a0d6903ddea56afa08dfa5def8b8c1d0b9070d58146374f76326732023-04-05 11:16:54415 days 2 hrs ago 0xfd4d94e538af8c176540a1ad7009184f03476737 0x9483eff448042c366a4297db465fae108d2e6ea60 ETH
0xfb97fea9f9db05182e77ea7c8f1e619e91f10f898ec56d22fefdad1d1daae5e172478232023-03-27 13:28:34424 days 22 mins ago 0x9483eff448042c366a4297db465fae108d2e6ea6 0xe1ceaa829525a08c1d39a5cebe4b42af58d771980 ETH
0xfb97fea9f9db05182e77ea7c8f1e619e91f10f898ec56d22fefdad1d1daae5e172478232023-03-27 13:28:34424 days 22 mins ago 0xfd4d94e538af8c176540a1ad7009184f03476737 0x9483eff448042c366a4297db465fae108d2e6ea60 ETH
0xf6a1fe6983e8403a580834b4fd31ca3355e6f5956569c252d3750416f41ec00368159732023-03-17 13:33:34434 days 17 mins ago 0x9483eff448042c366a4297db465fae108d2e6ea6 0xe1ceaa829525a08c1d39a5cebe4b42af58d771980 ETH
0xf6a1fe6983e8403a580834b4fd31ca3355e6f5956569c252d3750416f41ec00368159732023-03-17 13:33:34434 days 17 mins ago 0xfd4d94e538af8c176540a1ad7009184f03476737 0x9483eff448042c366a4297db465fae108d2e6ea60 ETH
0x8f8fa58957752857e11b284d6e5eb30ae7d89dbf689183205829e1e996ce3c9d68158932023-03-17 13:30:54434 days 20 mins ago 0xfd4d94e538af8c176540a1ad7009184f03476737 0x9483eff448042c366a4297db465fae108d2e6ea60 ETH
0x6348ba49578a26d9b3e1c53979f9cdd9d4c8b17dec9bb4b980161feb0029586966906052023-03-14 15:54:38436 days 21 hrs ago 0x9483eff448042c366a4297db465fae108d2e6ea6 0xe1ceaa829525a08c1d39a5cebe4b42af58d771980 ETH
0xbfbdfea73c13cf991fcd0e6e6fbb468621a5dddaa84328906b14d323d4fd8b1d64676392023-03-09 12:02:26442 days 1 hr ago 0x9483eff448042c366a4297db465fae108d2e6ea6 0x09238ea06f5d9b51ad886830f1fe47a2443a05f60 ETH
0xbfbdfea73c13cf991fcd0e6e6fbb468621a5dddaa84328906b14d323d4fd8b1d64676392023-03-09 12:02:26442 days 1 hr ago 0x9483eff448042c366a4297db465fae108d2e6ea6 0x4646d965e5e2666f3d6a8ebf457c4a9156bca59e0 ETH
0xbfbdfea73c13cf991fcd0e6e6fbb468621a5dddaa84328906b14d323d4fd8b1d64676392023-03-09 12:02:26442 days 1 hr ago 0x9483eff448042c366a4297db465fae108d2e6ea6 0x7465c5d60d3d095443cf9991da03304a30d42eae0 ETH
0xbfbdfea73c13cf991fcd0e6e6fbb468621a5dddaa84328906b14d323d4fd8b1d64676392023-03-09 12:02:26442 days 1 hr ago 0x9483eff448042c366a4297db465fae108d2e6ea6 0x7465c5d60d3d095443cf9991da03304a30d42eae0 ETH
0x8ca2df5b77b714a35e486f43b435a9eeae0c4ab93d0e1adc592de6c0d575451040968922023-01-13 14:57:32496 days 22 hrs ago 0x9483eff448042c366a4297db465fae108d2e6ea6 0xd62c9b42e2ca05385e2aa81b6cc482ebf9a5c2ae0 ETH
0x8ca2df5b77b714a35e486f43b435a9eeae0c4ab93d0e1adc592de6c0d575451040968922023-01-13 14:57:32496 days 22 hrs ago 0x9483eff448042c366a4297db465fae108d2e6ea6 0xe756e958f9eccbfa6d5e5bb88a41768f2a20c7bd0 ETH
0x8ca2df5b77b714a35e486f43b435a9eeae0c4ab93d0e1adc592de6c0d575451040968922023-01-13 14:57:32496 days 22 hrs ago 0x9483eff448042c366a4297db465fae108d2e6ea6 0x7465c5d60d3d095443cf9991da03304a30d42eae0 ETH
0x8ca2df5b77b714a35e486f43b435a9eeae0c4ab93d0e1adc592de6c0d575451040968922023-01-13 14:57:32496 days 22 hrs ago 0x9483eff448042c366a4297db465fae108d2e6ea6 0x7465c5d60d3d095443cf9991da03304a30d42eae0 ETH
0xd7d6b22ef725f61748a40ce7524bbbf615ab9367005270822f13337ef48d94a137984522022-12-29 13:52:24511 days 23 hrs ago 0x9483eff448042c366a4297db465fae108d2e6ea6 0x811ec542d4463ad89382997a1a502229b14086300 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
OvertimeVoucher

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 24 : OvertimeVoucher.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts-4.4.1/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-4.4.1/utils/Counters.sol";
import "@openzeppelin/contracts-4.4.1/access/Ownable.sol";
import "@openzeppelin/contracts-4.4.1/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts-4.4.1/utils/math/SafeMath.sol";
import "@openzeppelin/contracts-4.4.1/token/ERC20/utils/SafeERC20.sol";

import "../../interfaces/ISportsAMM.sol";
import "../../interfaces/IParlayMarketsAMM.sol";
import "../../interfaces/ISportPositionalMarket.sol";
import "../../interfaces/IPosition.sol";

contract OvertimeVoucher is ERC721URIStorage, Ownable {
    /* ========== LIBRARIES ========== */

    using Counters for Counters.Counter;
    using SafeMath for uint;
    using SafeERC20 for IERC20;

    /* ========== STATE VARIABLES ========== */

    Counters.Counter private _tokenIds;

    string public _name = "Overtime Voucher";
    string public _symbol = "OVER";
    bool public paused = false;
    string public tokenURITwenty;
    string public tokenURIFifty;
    string public tokenURIHundred;
    string public tokenURITwoHundred;
    string public tokenURIFiveHundred;
    string public tokenURIThousand;

    ISportsAMM public sportsAMM;
    IParlayMarketsAMM public parlayAMM;

    IERC20 public sUSD;
    mapping(uint => uint) public amountInVoucher;

    /* ========== CONSTANTS ========== */
    uint private constant ONE = 1e18;
    uint private constant TWENTY = 20 * 1e18;
    uint private constant FIFTY = 50 * 1e18;
    uint private constant HUNDRED = 100 * 1e18;
    uint private constant TWO_HUNDRED = 200 * 1e18;
    uint private constant FIVE_HUNDRED = 500 * 1e18;
    uint private constant THOUSAND = 1000 * 1e18;

    /* ========== CONSTRUCTOR ========== */

    constructor(
        address _sUSD,
        string memory _tokenURITwenty,
        string memory _tokenURIFifty,
        string memory _tokenURIHundred,
        string memory _tokenURITwoHundred,
        string memory _tokenURIFiveHundred,
        string memory _tokenURIThousand,
        address _sportsamm,
        address _parlayAMM
    ) ERC721(_name, _symbol) {
        sUSD = IERC20(_sUSD);
        tokenURITwenty = _tokenURITwenty;
        tokenURIFifty = _tokenURIFifty;
        tokenURIHundred = _tokenURIHundred;
        tokenURITwoHundred = _tokenURITwoHundred;
        tokenURIFiveHundred = _tokenURIFiveHundred;
        tokenURIThousand = _tokenURIThousand;
        sportsAMM = ISportsAMM(_sportsamm);
        sUSD.approve(_sportsamm, type(uint256).max);
        parlayAMM = IParlayMarketsAMM(_parlayAMM);
        sUSD.approve(_parlayAMM, type(uint256).max);
    }

    /* ========== TRV ========== */

    function mint(address recipient, uint amount) external returns (uint newItemId) {
        require(!paused, "Cant mint while paused");

        require(
            amount == TWENTY ||
                amount == FIFTY ||
                amount == HUNDRED ||
                amount == TWO_HUNDRED ||
                amount == FIVE_HUNDRED ||
                amount == THOUSAND,
            "Invalid amount"
        );

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

        _tokenIds.increment();

        newItemId = _tokenIds.current();

        _mint(recipient, newItemId);

        _setTokenURI(
            newItemId,
            amount == TWENTY ? tokenURITwenty : amount == FIFTY ? tokenURIFifty : amount == HUNDRED
                ? tokenURIHundred
                : amount == TWO_HUNDRED
                ? tokenURITwoHundred
                : amount == FIVE_HUNDRED
                ? tokenURIFiveHundred
                : tokenURIThousand
        );

        amountInVoucher[newItemId] = amount;
    }

    function buyFromAMMWithVoucher(
        address market,
        ISportsAMM.Position position,
        uint amount,
        uint tokenId
    ) external {
        require(!paused, "Cant buy while paused");
        require(ERC721.ownerOf(tokenId) == msg.sender, "You are not the voucher owner!");

        uint quote = sportsAMM.buyFromAmmQuote(market, position, amount);
        require(quote < amountInVoucher[tokenId], "Insufficient amount in voucher");

        sportsAMM.buyFromAMM(market, position, amount, quote, 0);
        amountInVoucher[tokenId] = amountInVoucher[tokenId] - quote;

        (IPosition home, IPosition away, IPosition draw) = ISportPositionalMarket(market).getOptions();
        IPosition target = position == ISportsAMM.Position.Home ? home : position == ISportsAMM.Position.Away ? away : draw;

        IERC20(address(target)).safeTransfer(msg.sender, amount);

        //if less than 1 sUSD, transfer the rest to the owner and burn
        if (amountInVoucher[tokenId] < 1e18) {
            sUSD.safeTransfer(address(msg.sender), amountInVoucher[tokenId]);
            super._burn(tokenId);
        }
        emit BoughtFromAmmWithVoucher(msg.sender, market, position, amount, quote, address(sUSD), address(target));
    }

    function buyFromParlayAMMWithVoucher(
        address[] calldata _sportMarkets,
        uint[] calldata _positions,
        uint _sUSDPaid,
        uint _additionalSlippage,
        uint _expectedPayout,
        uint tokenId
    ) external {
        require(!paused, "Cant buy while paused");
        require(ERC721.ownerOf(tokenId) == msg.sender, "You are not the voucher owner!");

        require(_sUSDPaid <= amountInVoucher[tokenId], "Insufficient amount in voucher");

        parlayAMM.buyFromParlay(_sportMarkets, _positions, _sUSDPaid, _additionalSlippage, _expectedPayout, msg.sender);
        amountInVoucher[tokenId] = amountInVoucher[tokenId] - _sUSDPaid;

        //if less than 1 sUSD, transfer the rest to the owner and burn
        if (amountInVoucher[tokenId] < 1e18) {
            sUSD.safeTransfer(address(msg.sender), amountInVoucher[tokenId]);
            super._burn(tokenId);
        }
        emit BoughtFromParlayWithVoucher(msg.sender, _sportMarkets, _positions, _sUSDPaid, _expectedPayout, address(sUSD));
    }

    /* ========== VIEW ========== */

    /* ========== INTERNALS ========== */

    /* ========== CONTRACT MANAGEMENT ========== */

    /// @notice Retrieve sUSD from the contract
    /// @param account whom to send the sUSD
    /// @param amount how much sUSD to retrieve
    function retrieveSUSDAmount(address payable account, uint amount) external onlyOwner {
        sUSD.safeTransfer(account, amount);
    }

    // function burnToken(uint _tokenId, address _recepient) external onlyOwner {
    //     require(amountInVoucher[_tokenId] > 0, "Amount is zero");
    //     if(_recepient != address(0)) {
    //         sUSD.safeTransfer(_recepient, amountInVoucher[_tokenId]);
    //     }
    //     super._burn(_tokenId);
    // }

    function setTokenUris(
        string memory _tokenURITwenty,
        string memory _tokenURIFifty,
        string memory _tokenURIHundred,
        string memory _tokenURITwoHundred,
        string memory _tokenURIFiveHundred,
        string memory _tokenURIThousand
    ) external onlyOwner {
        tokenURITwenty = _tokenURITwenty;
        tokenURIFifty = _tokenURIFifty;
        tokenURIHundred = _tokenURIHundred;
        tokenURITwoHundred = _tokenURITwoHundred;
        tokenURIFiveHundred = _tokenURIFiveHundred;
        tokenURIThousand = _tokenURIThousand;
    }

    function setPause(bool _state) external onlyOwner {
        paused = _state;
        emit Paused(_state);
    }

    function setParlayAMM(address _parlayAMM) external onlyOwner {
        if (address(_parlayAMM) != address(0)) {
            sUSD.approve(address(sportsAMM), 0);
        }
        parlayAMM = IParlayMarketsAMM(_parlayAMM);
        sUSD.approve(_parlayAMM, type(uint256).max);
        emit NewParlayAMM(_parlayAMM);
    }

    function setSportsAMM(address _sportsAMM) external onlyOwner {
        if (address(_sportsAMM) != address(0)) {
            sUSD.approve(address(sportsAMM), 0);
        }
        sportsAMM = ISportsAMM(_sportsAMM);
        sUSD.approve(_sportsAMM, type(uint256).max);
        emit NewSportsAMM(_sportsAMM);
    }

    /* ========== EVENTS ========== */

    event BoughtFromAmmWithVoucher(
        address buyer,
        address market,
        ISportsAMM.Position position,
        uint amount,
        uint sUSDPaid,
        address susd,
        address asset
    );
    event BoughtFromParlayWithVoucher(
        address buyer,
        address[] _sportMarkets,
        uint[] _positions,
        uint _sUSDPaid,
        uint _expectedPayout,
        address susd
    );
    event NewTokenUri(string _tokenURI);
    event NewSportsAMM(address _sportsAMM);
    event NewParlayAMM(address _parlayAMM);
    event Paused(bool _state);
}

File 2 of 24 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

File 3 of 24 : Counters.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 4 of 24 : 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 5 of 24 : ERC721URIStorage.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721URIStorage.sol)

pragma solidity ^0.8.0;

import "../ERC721.sol";

/**
 * @dev ERC721 token with storage based token URI management.
 */
abstract contract ERC721URIStorage is ERC721 {
    using Strings for uint256;

    // Optional mapping for token URIs
    mapping(uint256 => string) private _tokenURIs;

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721URIStorage: URI query for nonexistent token");

        string memory _tokenURI = _tokenURIs[tokenId];
        string memory base = _baseURI();

        // If there is no base URI, return the token URI.
        if (bytes(base).length == 0) {
            return _tokenURI;
        }
        // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
        if (bytes(_tokenURI).length > 0) {
            return string(abi.encodePacked(base, _tokenURI));
        }

        return super.tokenURI(tokenId);
    }

    /**
     * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {
        require(_exists(tokenId), "ERC721URIStorage: URI set of nonexistent token");
        _tokenURIs[tokenId] = _tokenURI;
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual override {
        super._burn(tokenId);

        if (bytes(_tokenURIs[tokenId]).length != 0) {
            delete _tokenURIs[tokenId];
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 7 of 24 : 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 8 of 24 : ISportsAMM.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface ISportsAMM {
    /* ========== VIEWS / VARIABLES ========== */

    enum Position {
        Home,
        Away,
        Draw
    }

    function getMarketDefaultOdds(address _market, bool isSell) external view returns (uint[] memory);

    function isMarketInAMMTrading(address _market) external view returns (bool);

    function availableToBuyFromAMM(address market, Position position) external view returns (uint _available);

    function buyFromAMM(
        address market,
        Position position,
        uint amount,
        uint expectedPayout,
        uint additionalSlippage
    ) external;

    function buyFromAmmQuote(
        address market,
        Position position,
        uint amount
    ) external view returns (uint);

    function buyFromAmmQuoteForParlayAMM(
        address market,
        Position position,
        uint amount
    ) external view returns (uint);

    function updateParlayVolume(address _account, uint _amount) external;
}

File 9 of 24 : IParlayMarketsAMM.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";

interface IParlayMarketsAMM {
    /* ========== VIEWS / VARIABLES ========== */

    function parlaySize() external view returns (uint);

    function sUSD() external view returns (IERC20Upgradeable);

    function sportsAmm() external view returns (address);

    function parlayAmmFee() external view returns (uint);

    function maxAllowedRiskPerCombination() external view returns (uint);

    function riskPerCombination(
        address _sportMarkets1,
        uint _position1,
        address _sportMarkets2,
        uint _position2,
        address _sportMarkets3,
        uint _position3,
        address _sportMarkets4,
        uint _position4
    ) external view returns (uint);

    function isActiveParlay(address _parlayMarket) external view returns (bool isActiveParlayMarket);

    function exerciseParlay(address _parlayMarket) external;

    function exerciseSportMarketInParlay(address _parlayMarket, address _sportMarket) external;

    function triggerResolvedEvent(address _account, bool _userWon) external;

    function resolveParlay() external;

    function buyFromParlay(
        address[] calldata _sportMarkets,
        uint[] calldata _positions,
        uint _sUSDPaid,
        uint _additionalSlippage,
        uint _expectedPayout,
        address _differentRecepient
    ) external;
}

File 10 of 24 : ISportPositionalMarket.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.16;

import "../interfaces/IPositionalMarketManager.sol";
import "../interfaces/IPosition.sol";
import "../interfaces/IPriceFeed.sol";

interface ISportPositionalMarket {
    /* ========== TYPES ========== */

    enum Phase {
        Trading,
        Maturity,
        Expiry
    }
    enum Side {
        Cancelled,
        Home,
        Away,
        Draw
    }

    /* ========== VIEWS / VARIABLES ========== */

    function getOptions()
        external
        view
        returns (
            IPosition home,
            IPosition away,
            IPosition draw
        );

    function times() external view returns (uint maturity, uint destruction);

    function getGameDetails() external view returns (bytes32 gameId, string memory gameLabel);

    function getGameId() external view returns (bytes32);

    function deposited() external view returns (uint);

    function optionsCount() external view returns (uint);

    function creator() external view returns (address);

    function resolved() external view returns (bool);

    function cancelled() external view returns (bool);

    function paused() external view returns (bool);

    function phase() external view returns (Phase);

    function canResolve() external view returns (bool);

    function result() external view returns (Side);

    function tags(uint idx) external view returns (uint);

    function getStampedOdds()
        external
        view
        returns (
            uint,
            uint,
            uint
        );

    function balancesOf(address account)
        external
        view
        returns (
            uint home,
            uint away,
            uint draw
        );

    function totalSupplies()
        external
        view
        returns (
            uint home,
            uint away,
            uint draw
        );

    function getMaximumBurnable(address account) external view returns (uint amount);

    /* ========== MUTATIVE FUNCTIONS ========== */

    function setPaused(bool _paused) external;

    function updateDates(uint256 _maturity, uint256 _expiry) external;

    function mint(uint value) external;

    function exerciseOptions() external;

    function restoreInvalidOdds(
        uint _homeOdds,
        uint _awayOdds,
        uint _drawOdds
    ) external;

    function burnOptions(uint amount) external;

    function burnOptionsMaximum() external;
}

File 11 of 24 : IPosition.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.5.16;

import "./IPositionalMarket.sol";

interface IPosition {
    /* ========== VIEWS / VARIABLES ========== */

    function getBalanceOf(address account) external view returns (uint);

    function getTotalSupply() external view returns (uint);
}

File 12 of 24 : 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 24 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overriden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @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.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, _data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 15 of 24 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 16 of 24 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

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

pragma solidity ^0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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 18 of 24 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 20 of 24 : 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 21 of 24 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

File 22 of 24 : IPositionalMarketManager.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.5.16;

import "../interfaces/IPositionalMarket.sol";

interface IPositionalMarketManager {
    /* ========== VIEWS / VARIABLES ========== */

    function durations() external view returns (uint expiryDuration, uint maxTimeToMaturity);

    function capitalRequirement() external view returns (uint);

    function marketCreationEnabled() external view returns (bool);

    function onlyAMMMintingAndBurning() external view returns (bool);

    function transformCollateral(uint value) external view returns (uint);

    function reverseTransformCollateral(uint value) external view returns (uint);

    function totalDeposited() external view returns (uint);

    function numActiveMarkets() external view returns (uint);

    function activeMarkets(uint index, uint pageSize) external view returns (address[] memory);

    function numMaturedMarkets() external view returns (uint);

    function maturedMarkets(uint index, uint pageSize) external view returns (address[] memory);

    function isActiveMarket(address candidate) external view returns (bool);

    function isKnownMarket(address candidate) external view returns (bool);

    function getThalesAMM() external view returns (address);

    /* ========== MUTATIVE FUNCTIONS ========== */

    function createMarket(
        bytes32 oracleKey,
        uint strikePrice,
        uint maturity,
        uint initialMint // initial sUSD to mint options for,
    ) external returns (IPositionalMarket);

    function resolveMarket(address market) external;

    function expireMarkets(address[] calldata market) external;

    function transferSusdTo(
        address sender,
        address receiver,
        uint amount
    ) external;
}

File 23 of 24 : IPriceFeed.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.5.16;

interface IPriceFeed {
    // Structs
    struct RateAndUpdatedTime {
        uint216 rate;
        uint40 time;
    }

    // Mutative functions
    function addAggregator(bytes32 currencyKey, address aggregatorAddress) external;

    function removeAggregator(bytes32 currencyKey) external;

    // Views

    function rateForCurrency(bytes32 currencyKey) external view returns (uint);

    function rateAndUpdatedTime(bytes32 currencyKey) external view returns (uint rate, uint time);

    function getRates() external view returns (uint[] memory);

    function getCurrencies() external view returns (bytes32[] memory);
}

File 24 of 24 : IPositionalMarket.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.5.16;

import "../interfaces/IPositionalMarketManager.sol";
import "../interfaces/IPosition.sol";
import "../interfaces/IPriceFeed.sol";

interface IPositionalMarket {
    /* ========== TYPES ========== */

    enum Phase {
        Trading,
        Maturity,
        Expiry
    }
    enum Side {
        Up,
        Down
    }

    /* ========== VIEWS / VARIABLES ========== */

    function getOptions() external view returns (IPosition up, IPosition down);

    function times() external view returns (uint maturity, uint destructino);

    function getOracleDetails()
        external
        view
        returns (
            bytes32 key,
            uint strikePrice,
            uint finalPrice
        );

    function fees() external view returns (uint poolFee, uint creatorFee);

    function deposited() external view returns (uint);

    function creator() external view returns (address);

    function resolved() external view returns (bool);

    function phase() external view returns (Phase);

    function oraclePrice() external view returns (uint);

    function oraclePriceAndTimestamp() external view returns (uint price, uint updatedAt);

    function canResolve() external view returns (bool);

    function result() external view returns (Side);

    function balancesOf(address account) external view returns (uint up, uint down);

    function totalSupplies() external view returns (uint up, uint down);

    function getMaximumBurnable(address account) external view returns (uint amount);

    /* ========== MUTATIVE FUNCTIONS ========== */

    function mint(uint value) external;

    function exerciseOptions() external returns (uint);

    function burnOptions(uint amount) external;

    function burnOptionsMaximum() external;
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_sUSD","type":"address"},{"internalType":"string","name":"_tokenURITwenty","type":"string"},{"internalType":"string","name":"_tokenURIFifty","type":"string"},{"internalType":"string","name":"_tokenURIHundred","type":"string"},{"internalType":"string","name":"_tokenURITwoHundred","type":"string"},{"internalType":"string","name":"_tokenURIFiveHundred","type":"string"},{"internalType":"string","name":"_tokenURIThousand","type":"string"},{"internalType":"address","name":"_sportsamm","type":"address"},{"internalType":"address","name":"_parlayAMM","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"address","name":"market","type":"address"},{"indexed":false,"internalType":"enum ISportsAMM.Position","name":"position","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sUSDPaid","type":"uint256"},{"indexed":false,"internalType":"address","name":"susd","type":"address"},{"indexed":false,"internalType":"address","name":"asset","type":"address"}],"name":"BoughtFromAmmWithVoucher","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"address[]","name":"_sportMarkets","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"_positions","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"_sUSDPaid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_expectedPayout","type":"uint256"},{"indexed":false,"internalType":"address","name":"susd","type":"address"}],"name":"BoughtFromParlayWithVoucher","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_parlayAMM","type":"address"}],"name":"NewParlayAMM","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_sportsAMM","type":"address"}],"name":"NewSportsAMM","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_tokenURI","type":"string"}],"name":"NewTokenUri","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"_state","type":"bool"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"_name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"amountInVoucher","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"market","type":"address"},{"internalType":"enum ISportsAMM.Position","name":"position","type":"uint8"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"buyFromAMMWithVoucher","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_sportMarkets","type":"address[]"},{"internalType":"uint256[]","name":"_positions","type":"uint256[]"},{"internalType":"uint256","name":"_sUSDPaid","type":"uint256"},{"internalType":"uint256","name":"_additionalSlippage","type":"uint256"},{"internalType":"uint256","name":"_expectedPayout","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"buyFromParlayAMMWithVoucher","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[{"internalType":"uint256","name":"newItemId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"parlayAMM","outputs":[{"internalType":"contract IParlayMarketsAMM","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"retrieveSUSDAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sUSD","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_parlayAMM","type":"address"}],"name":"setParlayAMM","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sportsAMM","type":"address"}],"name":"setSportsAMM","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_tokenURITwenty","type":"string"},{"internalType":"string","name":"_tokenURIFifty","type":"string"},{"internalType":"string","name":"_tokenURIHundred","type":"string"},{"internalType":"string","name":"_tokenURITwoHundred","type":"string"},{"internalType":"string","name":"_tokenURIFiveHundred","type":"string"},{"internalType":"string","name":"_tokenURIThousand","type":"string"}],"name":"setTokenUris","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sportsAMM","outputs":[{"internalType":"contract ISportsAMM","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenURIFifty","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenURIFiveHundred","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenURIHundred","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenURIThousand","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenURITwenty","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenURITwoHundred","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c0604052601060808190526f27bb32b93a34b6b2902b37bab1b432b960811b60a090815262000033916009919062000454565b506040805180820190915260048082526327ab22a960e11b60209092019182526200006191600a9162000454565b50600b805460ff191690553480156200007957600080fd5b506040516200382e3803806200382e8339810160408190526200009c91620005ca565b60098054620000ab906200072e565b80601f0160208091040260200160405190810160405280929190818152602001828054620000d9906200072e565b80156200012a5780601f10620000fe576101008083540402835291602001916200012a565b820191906000526020600020905b8154815290600101906020018083116200010c57829003601f168201915b5050505050600a80546200013e906200072e565b80601f01602080910402602001604051908101604052809291908181526020018280546200016c906200072e565b8015620001bd5780601f106200019157610100808354040283529160200191620001bd565b820191906000526020600020905b8154815290600101906020018083116200019f57829003601f168201915b50508451620001d793506000925060208601915062000454565b508051620001ed90600190602084019062000454565b5050506200020a62000204620003fe60201b60201c565b62000402565b601480546001600160a01b0319166001600160a01b038b1617905587516200023a90600c9060208b019062000454565b5086516200025090600d9060208a019062000454565b5085516200026690600e90602089019062000454565b5084516200027c90600f90602088019062000454565b5083516200029290601090602087019062000454565b508251620002a890601190602086019062000454565b50601280546001600160a01b0319166001600160a01b0384811691821790925560145460405163095ea7b360e01b8152600481019290925260001960248301529091169063095ea7b390604401602060405180830381600087803b1580156200031057600080fd5b505af115801562000325573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200034b919062000705565b50601380546001600160a01b0319166001600160a01b0383811691821790925560145460405163095ea7b360e01b8152600481019290925260001960248301529091169063095ea7b390604401602060405180830381600087803b158015620003b357600080fd5b505af1158015620003c8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003ee919062000705565b5050505050505050505062000781565b3390565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b82805462000462906200072e565b90600052602060002090601f016020900481019282620004865760008555620004d1565b82601f10620004a157805160ff1916838001178555620004d1565b82800160010185558215620004d1579182015b82811115620004d1578251825591602001919060010190620004b4565b50620004df929150620004e3565b5090565b5b80821115620004df5760008155600101620004e4565b80516001600160a01b03811681146200051257600080fd5b919050565b600082601f83011262000528578081fd5b81516001600160401b03808211156200054557620005456200076b565b604051601f8301601f19908116603f011681019082821181831017156200057057620005706200076b565b816040528381526020925086838588010111156200058c578485fd5b8491505b83821015620005af578582018301518183018401529082019062000590565b83821115620005c057848385830101525b9695505050505050565b60008060008060008060008060006101208a8c031215620005e9578485fd5b620005f48a620004fa565b60208b01519099506001600160401b038082111562000611578687fd5b6200061f8d838e0162000517565b995060408c015191508082111562000635578687fd5b620006438d838e0162000517565b985060608c015191508082111562000659578687fd5b620006678d838e0162000517565b975060808c01519150808211156200067d578687fd5b6200068b8d838e0162000517565b965060a08c0151915080821115620006a1578586fd5b620006af8d838e0162000517565b955060c08c0151915080821115620006c5578485fd5b50620006d48c828d0162000517565b935050620006e560e08b01620004fa565b9150620006f66101008b01620004fa565b90509295985092959850929598565b60006020828403121562000717578081fd5b8151801515811462000727578182fd5b9392505050565b600181811c908216806200074357607f821691505b602082108114156200076557634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b61309d80620007916000396000f3fe608060405234801561001057600080fd5b50600436106102275760003560e01c8063715018a611610130578063b88d4fde116100b8578063e81e52ee1161007c578063e81e52ee1461046d578063e985e9c514610480578063e9e520d6146104bc578063efb1fe35146104c4578063f2fde38b146104d757600080fd5b8063b88d4fde14610419578063bedb86fb1461042c578063c87b56dd1461043f578063c992528814610452578063d28d88521461046557600080fd5b80639324cac7116100ff5780639324cac7146103c357806395d89b41146103d6578063a22cb465146103de578063aed8fc9e146103f1578063b09f12661461041157600080fd5b8063715018a61461038f578063755f388b146103975780637d550e051461039f5780638da5cb5b146103b257600080fd5b80633ccdb11f116101b35780634f66adf1116101825780634f66adf114610341578063563dae4e146103545780635c975abb1461035c5780636352211e1461036957806370a082311461037c57600080fd5b80633ccdb11f146102f257806340c10f19146102fa57806342842e0e1461031b57806346acf2241461032e57600080fd5b80630ec9efd3116101fa5780630ec9efd3146102a957806314ef86fe146102b15780631b291c7f146102b95780631cc28552146102cc57806323b872dd146102df57600080fd5b806301ffc9a71461022c57806306fdde0314610254578063081812fc14610269578063095ea7b314610294575b600080fd5b61023f61023a3660046129cf565b6104ea565b60405190151581526020015b60405180910390f35b61025c61053c565b60405161024b9190612e28565b61027c610277366004612b41565b6105ce565b6040516001600160a01b03909116815260200161024b565b6102a76102a23660046128f9565b61065b565b005b61025c610771565b61025c6107ff565b6102a76102c736600461290b565b61080c565b6102a76102da366004612748565b610a4c565b6102a76102ed3660046127c7565b610bee565b61025c610c1f565b61030d6103083660046128f9565b610c2c565b60405190815260200161024b565b6102a76103293660046127c7565b610e76565b6102a761033c3660046128b1565b610e91565b6102a761034f366004612a53565b611257565b61025c611301565b600b5461023f9060ff1681565b61027c610377366004612b41565b61130e565b61030d61038a366004612748565b611385565b6102a761140c565b61025c611442565b60135461027c906001600160a01b031681565b6007546001600160a01b031661027c565b60145461027c906001600160a01b031681565b61025c61144f565b6102a76103ec366004612884565b61145e565b61030d6103ff366004612b41565b60156020526000908152604090205481565b61025c61146d565b6102a7610427366004612807565b61147a565b6102a761043a366004612997565b6114b2565b61025c61044d366004612b41565b61151d565b60125461027c906001600160a01b031681565b61025c611694565b6102a761047b366004612748565b6116a1565b61023f61048e36600461278f565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61025c61183c565b6102a76104d2366004612764565b611849565b6102a76104e5366004612748565b61188a565b60006001600160e01b031982166380ac58cd60e01b148061051b57506001600160e01b03198216635b5e139f60e01b145b8061053657506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606000805461054b90612f82565b80601f016020809104026020016040519081016040528092919081815260200182805461057790612f82565b80156105c45780601f10610599576101008083540402835291602001916105c4565b820191906000526020600020905b8154815290600101906020018083116105a757829003601f168201915b5050505050905090565b60006105d982611925565b61063f5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b60006106668261130e565b9050806001600160a01b0316836001600160a01b031614156106d45760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610636565b336001600160a01b03821614806106f057506106f0813361048e565b6107625760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610636565b61076c8383611942565b505050565b600f805461077e90612f82565b80601f01602080910402602001604051908101604052809291908181526020018280546107aa90612f82565b80156107f75780601f106107cc576101008083540402835291602001916107f7565b820191906000526020600020905b8154815290600101906020018083116107da57829003601f168201915b505050505081565b6011805461077e90612f82565b600b5460ff16156108575760405162461bcd60e51b815260206004820152601560248201527410d85b9d08189d5e481dda1a5b19481c185d5cd959605a1b6044820152606401610636565b336108618261130e565b6001600160a01b0316146108b75760405162461bcd60e51b815260206004820152601e60248201527f596f7520617265206e6f742074686520766f7563686572206f776e65722100006044820152606401610636565b6000818152601560205260409020548411156109155760405162461bcd60e51b815260206004820152601e60248201527f496e73756666696369656e7420616d6f756e7420696e20766f756368657200006044820152606401610636565b60135460405163f9b2c83360e01b81526001600160a01b039091169063f9b2c83390610953908b908b908b908b908b908b908b903390600401612dd0565b600060405180830381600087803b15801561096d57600080fd5b505af1158015610981573d6000803e3d6000fd5b50505060008281526015602052604090205461099f91508590612f3f565b6000828152601560205260409020819055670de0b6b3a764000011156109f1576000818152601560205260409020546014546109e8916001600160a01b039091169033906119b0565b6109f181611a13565b6014546040517f71fb51bcf134e995851a6a160fb77a3e69ef292c12aaf05c8cb49a4b944d4bf291610a3a9133918c918c918c918c918c918b916001600160a01b031690612d13565b60405180910390a15050505050505050565b6007546001600160a01b03163314610a765760405162461bcd60e51b815260040161063690612e8d565b6001600160a01b03811615610b0f5760145460125460405163095ea7b360e01b81526001600160a01b0391821660048201526000602482015291169063095ea7b390604401602060405180830381600087803b158015610ad557600080fd5b505af1158015610ae9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0d91906129b3565b505b601380546001600160a01b0319166001600160a01b0383811691821790925560145460405163095ea7b360e01b8152600481019290925260001960248301529091169063095ea7b390604401602060405180830381600087803b158015610b7557600080fd5b505af1158015610b89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bad91906129b3565b506040516001600160a01b03821681527f85dec884b9d5f668d61f62f842433df60cc0928a0bccbf0dafb98e992f2c4f41906020015b60405180910390a150565b610bf83382611a53565b610c145760405162461bcd60e51b815260040161063690612ec2565b61076c838383611b39565b6010805461077e90612f82565b600b5460009060ff1615610c7b5760405162461bcd60e51b815260206004820152601660248201527510d85b9d081b5a5b9d081dda1a5b19481c185d5cd95960521b6044820152606401610636565b6801158e460913d00000821480610c9a57506802b5e3af16b188000082145b80610cad575068056bc75e2d6310000082145b80610cc05750680ad78ebc5ac620000082145b80610cd35750681b1ae4d6e2ef50000082145b80610ce65750683635c9adc5dea0000082145b610d235760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b6044820152606401610636565b601454610d3b906001600160a01b0316333085611cd9565b610d49600880546001019055565b50600854610d578382611d11565b610e5f816801158e460913d000008414610dce576802b5e3af16b18800008414610dc75768056bc75e2d631000008414610dc057680ad78ebc5ac62000008414610db957681b1ae4d6e2ef5000008414610db2576011610dd1565b6010610dd1565b600f610dd1565b600e610dd1565b600d610dd1565b600c5b8054610ddc90612f82565b80601f0160208091040260200160405190810160405280929190818152602001828054610e0890612f82565b8015610e555780601f10610e2a57610100808354040283529160200191610e55565b820191906000526020600020905b815481529060010190602001808311610e3857829003601f168201915b5050505050611e44565b600081815260156020526040902091909155919050565b61076c8383836040518060200160405280600081525061147a565b600b5460ff1615610edc5760405162461bcd60e51b815260206004820152601560248201527410d85b9d08189d5e481dda1a5b19481c185d5cd959605a1b6044820152606401610636565b33610ee68261130e565b6001600160a01b031614610f3c5760405162461bcd60e51b815260206004820152601e60248201527f596f7520617265206e6f742074686520766f7563686572206f776e65722100006044820152606401610636565b60125460405163270e13ef60e01b81526000916001600160a01b03169063270e13ef90610f7190889088908890600401612d6c565b60206040518083038186803b158015610f8957600080fd5b505afa158015610f9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc19190612b59565b60008381526015602052604090205490915081106110215760405162461bcd60e51b815260206004820152601e60248201527f496e73756666696369656e7420616d6f756e7420696e20766f756368657200006044820152606401610636565b60125460405163221d7ae160e21b81526001600160a01b0390911690638875eb849061105a908890889088908790600090600401612d97565b600060405180830381600087803b15801561107457600080fd5b505af1158015611088573d6000803e3d6000fd5b5050506000838152601560205260409020546110a691508290612f3f565b60156000848152602001908152602001600020819055506000806000876001600160a01b031663cc2ee1966040518163ffffffff1660e01b815260040160606040518083038186803b1580156110fb57600080fd5b505afa15801561110f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111339190612a07565b9194509250905060008088600281111561115d57634e487b7160e01b600052602160045260246000fd5b1461119557600188600281111561118457634e487b7160e01b600052602160045260246000fd5b1461118f5781611197565b82611197565b835b90506111ad6001600160a01b03821633896119b0565b600086815260156020526040902054670de0b6b3a764000011156111fd576000868152601560205260409020546014546111f4916001600160a01b039091169033906119b0565b6111fd86611a13565b6014546040517f5225d682e99fd1872cb0110d60372f8ebb3e5407caf698baed5b26daeafd8292916112449133918d918d918d918c916001600160a01b0316908990612c86565b60405180910390a1505050505050505050565b6007546001600160a01b031633146112815760405162461bcd60e51b815260040161063690612e8d565b855161129490600c90602089019061259a565b5084516112a890600d90602088019061259a565b5083516112bc90600e90602087019061259a565b5082516112d090600f90602086019061259a565b5081516112e490601090602085019061259a565b5080516112f890601190602084019061259a565b50505050505050565b600c805461077e90612f82565b6000818152600260205260408120546001600160a01b0316806105365760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610636565b60006001600160a01b0382166113f05760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610636565b506001600160a01b031660009081526003602052604090205490565b6007546001600160a01b031633146114365760405162461bcd60e51b815260040161063690612e8d565b6114406000611ecf565b565b600e805461077e90612f82565b60606001805461054b90612f82565b611469338383611f21565b5050565b600a805461077e90612f82565b6114843383611a53565b6114a05760405162461bcd60e51b815260040161063690612ec2565b6114ac84848484611ff0565b50505050565b6007546001600160a01b031633146114dc5760405162461bcd60e51b815260040161063690612e8d565b600b805460ff19168215159081179091556040519081527f0e2fb031ee032dc02d8011dc50b816eb450cf856abd8261680dac74f72165bd290602001610be3565b606061152882611925565b61158e5760405162461bcd60e51b815260206004820152603160248201527f45524337323155524953746f726167653a2055524920717565727920666f72206044820152703737b732bc34b9ba32b73a103a37b5b2b760791b6064820152608401610636565b600082815260066020526040812080546115a790612f82565b80601f01602080910402602001604051908101604052809291908181526020018280546115d390612f82565b80156116205780601f106115f557610100808354040283529160200191611620565b820191906000526020600020905b81548152906001019060200180831161160357829003601f168201915b50505050509050600061163e60408051602081019091526000815290565b9050805160001415611651575092915050565b81511561168357808260405160200161166b929190612c57565b60405160208183030381529060405292505050919050565b61168c84612023565b949350505050565b6009805461077e90612f82565b6007546001600160a01b031633146116cb5760405162461bcd60e51b815260040161063690612e8d565b6001600160a01b038116156117645760145460125460405163095ea7b360e01b81526001600160a01b0391821660048201526000602482015291169063095ea7b390604401602060405180830381600087803b15801561172a57600080fd5b505af115801561173e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176291906129b3565b505b601280546001600160a01b0319166001600160a01b0383811691821790925560145460405163095ea7b360e01b8152600481019290925260001960248301529091169063095ea7b390604401602060405180830381600087803b1580156117ca57600080fd5b505af11580156117de573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061180291906129b3565b506040516001600160a01b03821681527ffff8440c271c1df6e96cbb45fef2b4a959501f65ce7e2a6ed01efabb263ea56590602001610be3565b600d805461077e90612f82565b6007546001600160a01b031633146118735760405162461bcd60e51b815260040161063690612e8d565b601454611469906001600160a01b031683836119b0565b6007546001600160a01b031633146118b45760405162461bcd60e51b815260040161063690612e8d565b6001600160a01b0381166119195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610636565b61192281611ecf565b50565b6000908152600260205260409020546001600160a01b0316151590565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906119778261130e565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6040516001600160a01b03831660248201526044810182905261076c90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526120fb565b611a1c816121cd565b60008181526006602052604090208054611a3590612f82565b1590506119225760008181526006602052604081206119229161261e565b6000611a5e82611925565b611abf5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610636565b6000611aca8361130e565b9050806001600160a01b0316846001600160a01b03161480611b055750836001600160a01b0316611afa846105ce565b6001600160a01b0316145b8061168c57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff1661168c565b826001600160a01b0316611b4c8261130e565b6001600160a01b031614611bb45760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610636565b6001600160a01b038216611c165760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610636565b611c21600082611942565b6001600160a01b0383166000908152600360205260408120805460019290611c4a908490612f3f565b90915550506001600160a01b0382166000908152600360205260408120805460019290611c78908490612f13565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6040516001600160a01b03808516602483015283166044820152606481018290526114ac9085906323b872dd60e01b906084016119dc565b6001600160a01b038216611d675760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610636565b611d7081611925565b15611dbd5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610636565b6001600160a01b0382166000908152600360205260408120805460019290611de6908490612f13565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b611e4d82611925565b611eb05760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b6064820152608401610636565b6000828152600660209081526040909120825161076c9284019061259a565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03161415611f835760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610636565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611ffb848484611b39565b61200784848484612268565b6114ac5760405162461bcd60e51b815260040161063690612e3b565b606061202e82611925565b6120925760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610636565b60006120a960408051602081019091526000815290565b905060008151116120c957604051806020016040528060008152506120f4565b806120d384612375565b6040516020016120e4929190612c57565b6040516020818303038152906040525b9392505050565b6000612150826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661248f9092919063ffffffff16565b80519091501561076c578080602001905181019061216e91906129b3565b61076c5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610636565b60006121d88261130e565b90506121e5600083611942565b6001600160a01b038116600090815260036020526040812080546001929061220e908490612f3f565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60006001600160a01b0384163b1561236a57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906122ac903390899088908890600401612cd6565b602060405180830381600087803b1580156122c657600080fd5b505af19250505080156122f6575060408051601f3d908101601f191682019092526122f3918101906129eb565b60015b612350573d808015612324576040519150601f19603f3d011682016040523d82523d6000602084013e612329565b606091505b5080516123485760405162461bcd60e51b815260040161063690612e3b565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061168c565b506001949350505050565b6060816123995750506040805180820190915260018152600360fc1b602082015290565b8160005b81156123c357806123ad81612fbd565b91506123bc9050600a83612f2b565b915061239d565b60008167ffffffffffffffff8111156123ec57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612416576020820181803683370190505b5090505b841561168c5761242b600183612f3f565b9150612438600a86612fd8565b612443906030612f13565b60f81b81838151811061246657634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350612488600a86612f2b565b945061241a565b606061168c848460008585843b6124e85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610636565b600080866001600160a01b031685876040516125049190612c3b565b60006040518083038185875af1925050503d8060008114612541576040519150601f19603f3d011682016040523d82523d6000602084013e612546565b606091505b5091509150612556828286612561565b979650505050505050565b606083156125705750816120f4565b8251156125805782518084602001fd5b8160405162461bcd60e51b81526004016106369190612e28565b8280546125a690612f82565b90600052602060002090601f0160209004810192826125c8576000855561260e565b82601f106125e157805160ff191683800117855561260e565b8280016001018555821561260e579182015b8281111561260e5782518255916020019190600101906125f3565b5061261a929150612654565b5090565b50805461262a90612f82565b6000825580601f1061263a575050565b601f01602090049060005260206000209081019061192291905b5b8082111561261a5760008155600101612655565b600067ffffffffffffffff8084111561268457612684613018565b604051601f8501601f19908116603f011681019082821181831017156126ac576126ac613018565b816040528093508581528686860111156126c557600080fd5b858560208301376000602087830101525050509392505050565b60008083601f8401126126f0578182fd5b50813567ffffffffffffffff811115612707578182fd5b6020830191508360208260051b850101111561272257600080fd5b9250929050565b600082601f830112612739578081fd5b6120f483833560208501612669565b600060208284031215612759578081fd5b81356120f48161302e565b60008060408385031215612776578081fd5b82356127818161302e565b946020939093013593505050565b600080604083850312156127a1578182fd5b82356127ac8161302e565b915060208301356127bc8161302e565b809150509250929050565b6000806000606084860312156127db578081fd5b83356127e68161302e565b925060208401356127f68161302e565b929592945050506040919091013590565b6000806000806080858703121561281c578081fd5b84356128278161302e565b935060208501356128378161302e565b925060408501359150606085013567ffffffffffffffff811115612859578182fd5b8501601f81018713612869578182fd5b61287887823560208401612669565b91505092959194509250565b60008060408385031215612896578182fd5b82356128a18161302e565b915060208301356127bc81613043565b600080600080608085870312156128c6578384fd5b84356128d18161302e565b93506020850135600381106128e4578384fd5b93969395505050506040820135916060013590565b60008060408385031215612776578182fd5b60008060008060008060008060c0898b031215612926578586fd5b883567ffffffffffffffff8082111561293d578788fd5b6129498c838d016126df565b909a50985060208b0135915080821115612961578788fd5b5061296e8b828c016126df565b999c989b5099604081013598606082013598506080820135975060a09091013595509350505050565b6000602082840312156129a8578081fd5b81356120f481613043565b6000602082840312156129c4578081fd5b81516120f481613043565b6000602082840312156129e0578081fd5b81356120f481613051565b6000602082840312156129fc578081fd5b81516120f481613051565b600080600060608486031215612a1b578081fd5b8351612a268161302e565b6020850151909350612a378161302e565b6040850151909250612a488161302e565b809150509250925092565b60008060008060008060c08789031215612a6b578384fd5b863567ffffffffffffffff80821115612a82578586fd5b612a8e8a838b01612729565b97506020890135915080821115612aa3578586fd5b612aaf8a838b01612729565b96506040890135915080821115612ac4578586fd5b612ad08a838b01612729565b95506060890135915080821115612ae5578384fd5b612af18a838b01612729565b94506080890135915080821115612b06578384fd5b612b128a838b01612729565b935060a0890135915080821115612b27578283fd5b50612b3489828a01612729565b9150509295509295509295565b600060208284031215612b52578081fd5b5035919050565b600060208284031215612b6a578081fd5b5051919050565b81835260006020808501945082825b85811015612bae578135612b938161302e565b6001600160a01b031687529582019590820190600101612b80565b509495945050505050565b81835260006001600160fb1b03831115612bd1578081fd5b8260051b80836020870137939093016020019283525090919050565b60008151808452612c05816020860160208601612f56565b601f01601f19169290920160200192915050565b60038110612c3757634e487b7160e01b600052602160045260246000fd5b9052565b60008251612c4d818460208701612f56565b9190910192915050565b60008351612c69818460208801612f56565b835190830190612c7d818360208801612f56565b01949350505050565b6001600160a01b038881168252878116602083015260e0820190612cad6040840189612c19565b86606084015285608084015280851660a084015280841660c08401525098975050505050505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612d0990830184612bed565b9695505050505050565b600060018060a01b03808b16835260c06020840152612d3660c084018a8c612b71565b8381036040850152612d4981898b612bb9565b606085019790975250608083019490945250911660a09091015295945050505050565b6001600160a01b038416815260608101612d896020830185612c19565b826040830152949350505050565b6001600160a01b038616815260a08101612db46020830187612c19565b8460408301528360608301528260808301529695505050505050565b60c081526000612de460c083018a8c612b71565b8281036020840152612df781898b612bb9565b60408401979097525050606081019390935260808301919091526001600160a01b031660a090910152949350505050565b6020815260006120f46020830184612bed565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60008219821115612f2657612f26612fec565b500190565b600082612f3a57612f3a613002565b500490565b600082821015612f5157612f51612fec565b500390565b60005b83811015612f71578181015183820152602001612f59565b838111156114ac5750506000910152565b600181811c90821680612f9657607f821691505b60208210811415612fb757634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415612fd157612fd1612fec565b5060010190565b600082612fe757612fe7613002565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461192257600080fd5b801515811461192257600080fd5b6001600160e01b03198116811461192257600080fdfea26469706673582212206b03c8f1ab1f0199dd59fb6664cc8d35a46d305ac81da961dbcb939412c4080764736f6c63430008040033000000000000000000000000e1ceaa829525a08c1d39a5cebe4b42af58d77198000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000007465c5d60d3d095443cf9991da03304a30d42eae0000000000000000000000000ec9d8dac2178b041f85f60e3cf13cfaa3d23e0e000000000000000000000000000000000000000000000000000000000000004368747470733a2f2f7468616c65732d70726f746f636f6c2e73332e65752d6e6f7274682d312e616d617a6f6e6177732e636f6d2f766f7563686572312d32302e706e670000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004368747470733a2f2f7468616c65732d70726f746f636f6c2e73332e65752d6e6f7274682d312e616d617a6f6e6177732e636f6d2f766f7563686572312d35302e706e670000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004468747470733a2f2f7468616c65732d70726f746f636f6c2e73332e65752d6e6f7274682d312e616d617a6f6e6177732e636f6d2f766f7563686572312d3130302e706e6700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004468747470733a2f2f7468616c65732d70726f746f636f6c2e73332e65752d6e6f7274682d312e616d617a6f6e6177732e636f6d2f766f7563686572312d3230302e706e6700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004468747470733a2f2f7468616c65732d70726f746f636f6c2e73332e65752d6e6f7274682d312e616d617a6f6e6177732e636f6d2f766f7563686572312d3530302e706e6700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004568747470733a2f2f7468616c65732d70726f746f636f6c2e73332e65752d6e6f7274682d312e616d617a6f6e6177732e636f6d2f766f7563686572312d313030302e706e67000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102275760003560e01c8063715018a611610130578063b88d4fde116100b8578063e81e52ee1161007c578063e81e52ee1461046d578063e985e9c514610480578063e9e520d6146104bc578063efb1fe35146104c4578063f2fde38b146104d757600080fd5b8063b88d4fde14610419578063bedb86fb1461042c578063c87b56dd1461043f578063c992528814610452578063d28d88521461046557600080fd5b80639324cac7116100ff5780639324cac7146103c357806395d89b41146103d6578063a22cb465146103de578063aed8fc9e146103f1578063b09f12661461041157600080fd5b8063715018a61461038f578063755f388b146103975780637d550e051461039f5780638da5cb5b146103b257600080fd5b80633ccdb11f116101b35780634f66adf1116101825780634f66adf114610341578063563dae4e146103545780635c975abb1461035c5780636352211e1461036957806370a082311461037c57600080fd5b80633ccdb11f146102f257806340c10f19146102fa57806342842e0e1461031b57806346acf2241461032e57600080fd5b80630ec9efd3116101fa5780630ec9efd3146102a957806314ef86fe146102b15780631b291c7f146102b95780631cc28552146102cc57806323b872dd146102df57600080fd5b806301ffc9a71461022c57806306fdde0314610254578063081812fc14610269578063095ea7b314610294575b600080fd5b61023f61023a3660046129cf565b6104ea565b60405190151581526020015b60405180910390f35b61025c61053c565b60405161024b9190612e28565b61027c610277366004612b41565b6105ce565b6040516001600160a01b03909116815260200161024b565b6102a76102a23660046128f9565b61065b565b005b61025c610771565b61025c6107ff565b6102a76102c736600461290b565b61080c565b6102a76102da366004612748565b610a4c565b6102a76102ed3660046127c7565b610bee565b61025c610c1f565b61030d6103083660046128f9565b610c2c565b60405190815260200161024b565b6102a76103293660046127c7565b610e76565b6102a761033c3660046128b1565b610e91565b6102a761034f366004612a53565b611257565b61025c611301565b600b5461023f9060ff1681565b61027c610377366004612b41565b61130e565b61030d61038a366004612748565b611385565b6102a761140c565b61025c611442565b60135461027c906001600160a01b031681565b6007546001600160a01b031661027c565b60145461027c906001600160a01b031681565b61025c61144f565b6102a76103ec366004612884565b61145e565b61030d6103ff366004612b41565b60156020526000908152604090205481565b61025c61146d565b6102a7610427366004612807565b61147a565b6102a761043a366004612997565b6114b2565b61025c61044d366004612b41565b61151d565b60125461027c906001600160a01b031681565b61025c611694565b6102a761047b366004612748565b6116a1565b61023f61048e36600461278f565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61025c61183c565b6102a76104d2366004612764565b611849565b6102a76104e5366004612748565b61188a565b60006001600160e01b031982166380ac58cd60e01b148061051b57506001600160e01b03198216635b5e139f60e01b145b8061053657506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606000805461054b90612f82565b80601f016020809104026020016040519081016040528092919081815260200182805461057790612f82565b80156105c45780601f10610599576101008083540402835291602001916105c4565b820191906000526020600020905b8154815290600101906020018083116105a757829003601f168201915b5050505050905090565b60006105d982611925565b61063f5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b60006106668261130e565b9050806001600160a01b0316836001600160a01b031614156106d45760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610636565b336001600160a01b03821614806106f057506106f0813361048e565b6107625760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610636565b61076c8383611942565b505050565b600f805461077e90612f82565b80601f01602080910402602001604051908101604052809291908181526020018280546107aa90612f82565b80156107f75780601f106107cc576101008083540402835291602001916107f7565b820191906000526020600020905b8154815290600101906020018083116107da57829003601f168201915b505050505081565b6011805461077e90612f82565b600b5460ff16156108575760405162461bcd60e51b815260206004820152601560248201527410d85b9d08189d5e481dda1a5b19481c185d5cd959605a1b6044820152606401610636565b336108618261130e565b6001600160a01b0316146108b75760405162461bcd60e51b815260206004820152601e60248201527f596f7520617265206e6f742074686520766f7563686572206f776e65722100006044820152606401610636565b6000818152601560205260409020548411156109155760405162461bcd60e51b815260206004820152601e60248201527f496e73756666696369656e7420616d6f756e7420696e20766f756368657200006044820152606401610636565b60135460405163f9b2c83360e01b81526001600160a01b039091169063f9b2c83390610953908b908b908b908b908b908b908b903390600401612dd0565b600060405180830381600087803b15801561096d57600080fd5b505af1158015610981573d6000803e3d6000fd5b50505060008281526015602052604090205461099f91508590612f3f565b6000828152601560205260409020819055670de0b6b3a764000011156109f1576000818152601560205260409020546014546109e8916001600160a01b039091169033906119b0565b6109f181611a13565b6014546040517f71fb51bcf134e995851a6a160fb77a3e69ef292c12aaf05c8cb49a4b944d4bf291610a3a9133918c918c918c918c918c918b916001600160a01b031690612d13565b60405180910390a15050505050505050565b6007546001600160a01b03163314610a765760405162461bcd60e51b815260040161063690612e8d565b6001600160a01b03811615610b0f5760145460125460405163095ea7b360e01b81526001600160a01b0391821660048201526000602482015291169063095ea7b390604401602060405180830381600087803b158015610ad557600080fd5b505af1158015610ae9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0d91906129b3565b505b601380546001600160a01b0319166001600160a01b0383811691821790925560145460405163095ea7b360e01b8152600481019290925260001960248301529091169063095ea7b390604401602060405180830381600087803b158015610b7557600080fd5b505af1158015610b89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bad91906129b3565b506040516001600160a01b03821681527f85dec884b9d5f668d61f62f842433df60cc0928a0bccbf0dafb98e992f2c4f41906020015b60405180910390a150565b610bf83382611a53565b610c145760405162461bcd60e51b815260040161063690612ec2565b61076c838383611b39565b6010805461077e90612f82565b600b5460009060ff1615610c7b5760405162461bcd60e51b815260206004820152601660248201527510d85b9d081b5a5b9d081dda1a5b19481c185d5cd95960521b6044820152606401610636565b6801158e460913d00000821480610c9a57506802b5e3af16b188000082145b80610cad575068056bc75e2d6310000082145b80610cc05750680ad78ebc5ac620000082145b80610cd35750681b1ae4d6e2ef50000082145b80610ce65750683635c9adc5dea0000082145b610d235760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b6044820152606401610636565b601454610d3b906001600160a01b0316333085611cd9565b610d49600880546001019055565b50600854610d578382611d11565b610e5f816801158e460913d000008414610dce576802b5e3af16b18800008414610dc75768056bc75e2d631000008414610dc057680ad78ebc5ac62000008414610db957681b1ae4d6e2ef5000008414610db2576011610dd1565b6010610dd1565b600f610dd1565b600e610dd1565b600d610dd1565b600c5b8054610ddc90612f82565b80601f0160208091040260200160405190810160405280929190818152602001828054610e0890612f82565b8015610e555780601f10610e2a57610100808354040283529160200191610e55565b820191906000526020600020905b815481529060010190602001808311610e3857829003601f168201915b5050505050611e44565b600081815260156020526040902091909155919050565b61076c8383836040518060200160405280600081525061147a565b600b5460ff1615610edc5760405162461bcd60e51b815260206004820152601560248201527410d85b9d08189d5e481dda1a5b19481c185d5cd959605a1b6044820152606401610636565b33610ee68261130e565b6001600160a01b031614610f3c5760405162461bcd60e51b815260206004820152601e60248201527f596f7520617265206e6f742074686520766f7563686572206f776e65722100006044820152606401610636565b60125460405163270e13ef60e01b81526000916001600160a01b03169063270e13ef90610f7190889088908890600401612d6c565b60206040518083038186803b158015610f8957600080fd5b505afa158015610f9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc19190612b59565b60008381526015602052604090205490915081106110215760405162461bcd60e51b815260206004820152601e60248201527f496e73756666696369656e7420616d6f756e7420696e20766f756368657200006044820152606401610636565b60125460405163221d7ae160e21b81526001600160a01b0390911690638875eb849061105a908890889088908790600090600401612d97565b600060405180830381600087803b15801561107457600080fd5b505af1158015611088573d6000803e3d6000fd5b5050506000838152601560205260409020546110a691508290612f3f565b60156000848152602001908152602001600020819055506000806000876001600160a01b031663cc2ee1966040518163ffffffff1660e01b815260040160606040518083038186803b1580156110fb57600080fd5b505afa15801561110f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111339190612a07565b9194509250905060008088600281111561115d57634e487b7160e01b600052602160045260246000fd5b1461119557600188600281111561118457634e487b7160e01b600052602160045260246000fd5b1461118f5781611197565b82611197565b835b90506111ad6001600160a01b03821633896119b0565b600086815260156020526040902054670de0b6b3a764000011156111fd576000868152601560205260409020546014546111f4916001600160a01b039091169033906119b0565b6111fd86611a13565b6014546040517f5225d682e99fd1872cb0110d60372f8ebb3e5407caf698baed5b26daeafd8292916112449133918d918d918d918c916001600160a01b0316908990612c86565b60405180910390a1505050505050505050565b6007546001600160a01b031633146112815760405162461bcd60e51b815260040161063690612e8d565b855161129490600c90602089019061259a565b5084516112a890600d90602088019061259a565b5083516112bc90600e90602087019061259a565b5082516112d090600f90602086019061259a565b5081516112e490601090602085019061259a565b5080516112f890601190602084019061259a565b50505050505050565b600c805461077e90612f82565b6000818152600260205260408120546001600160a01b0316806105365760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610636565b60006001600160a01b0382166113f05760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610636565b506001600160a01b031660009081526003602052604090205490565b6007546001600160a01b031633146114365760405162461bcd60e51b815260040161063690612e8d565b6114406000611ecf565b565b600e805461077e90612f82565b60606001805461054b90612f82565b611469338383611f21565b5050565b600a805461077e90612f82565b6114843383611a53565b6114a05760405162461bcd60e51b815260040161063690612ec2565b6114ac84848484611ff0565b50505050565b6007546001600160a01b031633146114dc5760405162461bcd60e51b815260040161063690612e8d565b600b805460ff19168215159081179091556040519081527f0e2fb031ee032dc02d8011dc50b816eb450cf856abd8261680dac74f72165bd290602001610be3565b606061152882611925565b61158e5760405162461bcd60e51b815260206004820152603160248201527f45524337323155524953746f726167653a2055524920717565727920666f72206044820152703737b732bc34b9ba32b73a103a37b5b2b760791b6064820152608401610636565b600082815260066020526040812080546115a790612f82565b80601f01602080910402602001604051908101604052809291908181526020018280546115d390612f82565b80156116205780601f106115f557610100808354040283529160200191611620565b820191906000526020600020905b81548152906001019060200180831161160357829003601f168201915b50505050509050600061163e60408051602081019091526000815290565b9050805160001415611651575092915050565b81511561168357808260405160200161166b929190612c57565b60405160208183030381529060405292505050919050565b61168c84612023565b949350505050565b6009805461077e90612f82565b6007546001600160a01b031633146116cb5760405162461bcd60e51b815260040161063690612e8d565b6001600160a01b038116156117645760145460125460405163095ea7b360e01b81526001600160a01b0391821660048201526000602482015291169063095ea7b390604401602060405180830381600087803b15801561172a57600080fd5b505af115801561173e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176291906129b3565b505b601280546001600160a01b0319166001600160a01b0383811691821790925560145460405163095ea7b360e01b8152600481019290925260001960248301529091169063095ea7b390604401602060405180830381600087803b1580156117ca57600080fd5b505af11580156117de573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061180291906129b3565b506040516001600160a01b03821681527ffff8440c271c1df6e96cbb45fef2b4a959501f65ce7e2a6ed01efabb263ea56590602001610be3565b600d805461077e90612f82565b6007546001600160a01b031633146118735760405162461bcd60e51b815260040161063690612e8d565b601454611469906001600160a01b031683836119b0565b6007546001600160a01b031633146118b45760405162461bcd60e51b815260040161063690612e8d565b6001600160a01b0381166119195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610636565b61192281611ecf565b50565b6000908152600260205260409020546001600160a01b0316151590565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906119778261130e565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6040516001600160a01b03831660248201526044810182905261076c90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526120fb565b611a1c816121cd565b60008181526006602052604090208054611a3590612f82565b1590506119225760008181526006602052604081206119229161261e565b6000611a5e82611925565b611abf5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610636565b6000611aca8361130e565b9050806001600160a01b0316846001600160a01b03161480611b055750836001600160a01b0316611afa846105ce565b6001600160a01b0316145b8061168c57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff1661168c565b826001600160a01b0316611b4c8261130e565b6001600160a01b031614611bb45760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610636565b6001600160a01b038216611c165760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610636565b611c21600082611942565b6001600160a01b0383166000908152600360205260408120805460019290611c4a908490612f3f565b90915550506001600160a01b0382166000908152600360205260408120805460019290611c78908490612f13565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6040516001600160a01b03808516602483015283166044820152606481018290526114ac9085906323b872dd60e01b906084016119dc565b6001600160a01b038216611d675760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610636565b611d7081611925565b15611dbd5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610636565b6001600160a01b0382166000908152600360205260408120805460019290611de6908490612f13565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b611e4d82611925565b611eb05760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b6064820152608401610636565b6000828152600660209081526040909120825161076c9284019061259a565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03161415611f835760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610636565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611ffb848484611b39565b61200784848484612268565b6114ac5760405162461bcd60e51b815260040161063690612e3b565b606061202e82611925565b6120925760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610636565b60006120a960408051602081019091526000815290565b905060008151116120c957604051806020016040528060008152506120f4565b806120d384612375565b6040516020016120e4929190612c57565b6040516020818303038152906040525b9392505050565b6000612150826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661248f9092919063ffffffff16565b80519091501561076c578080602001905181019061216e91906129b3565b61076c5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610636565b60006121d88261130e565b90506121e5600083611942565b6001600160a01b038116600090815260036020526040812080546001929061220e908490612f3f565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60006001600160a01b0384163b1561236a57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906122ac903390899088908890600401612cd6565b602060405180830381600087803b1580156122c657600080fd5b505af19250505080156122f6575060408051601f3d908101601f191682019092526122f3918101906129eb565b60015b612350573d808015612324576040519150601f19603f3d011682016040523d82523d6000602084013e612329565b606091505b5080516123485760405162461bcd60e51b815260040161063690612e3b565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061168c565b506001949350505050565b6060816123995750506040805180820190915260018152600360fc1b602082015290565b8160005b81156123c357806123ad81612fbd565b91506123bc9050600a83612f2b565b915061239d565b60008167ffffffffffffffff8111156123ec57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612416576020820181803683370190505b5090505b841561168c5761242b600183612f3f565b9150612438600a86612fd8565b612443906030612f13565b60f81b81838151811061246657634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350612488600a86612f2b565b945061241a565b606061168c848460008585843b6124e85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610636565b600080866001600160a01b031685876040516125049190612c3b565b60006040518083038185875af1925050503d8060008114612541576040519150601f19603f3d011682016040523d82523d6000602084013e612546565b606091505b5091509150612556828286612561565b979650505050505050565b606083156125705750816120f4565b8251156125805782518084602001fd5b8160405162461bcd60e51b81526004016106369190612e28565b8280546125a690612f82565b90600052602060002090601f0160209004810192826125c8576000855561260e565b82601f106125e157805160ff191683800117855561260e565b8280016001018555821561260e579182015b8281111561260e5782518255916020019190600101906125f3565b5061261a929150612654565b5090565b50805461262a90612f82565b6000825580601f1061263a575050565b601f01602090049060005260206000209081019061192291905b5b8082111561261a5760008155600101612655565b600067ffffffffffffffff8084111561268457612684613018565b604051601f8501601f19908116603f011681019082821181831017156126ac576126ac613018565b816040528093508581528686860111156126c557600080fd5b858560208301376000602087830101525050509392505050565b60008083601f8401126126f0578182fd5b50813567ffffffffffffffff811115612707578182fd5b6020830191508360208260051b850101111561272257600080fd5b9250929050565b600082601f830112612739578081fd5b6120f483833560208501612669565b600060208284031215612759578081fd5b81356120f48161302e565b60008060408385031215612776578081fd5b82356127818161302e565b946020939093013593505050565b600080604083850312156127a1578182fd5b82356127ac8161302e565b915060208301356127bc8161302e565b809150509250929050565b6000806000606084860312156127db578081fd5b83356127e68161302e565b925060208401356127f68161302e565b929592945050506040919091013590565b6000806000806080858703121561281c578081fd5b84356128278161302e565b935060208501356128378161302e565b925060408501359150606085013567ffffffffffffffff811115612859578182fd5b8501601f81018713612869578182fd5b61287887823560208401612669565b91505092959194509250565b60008060408385031215612896578182fd5b82356128a18161302e565b915060208301356127bc81613043565b600080600080608085870312156128c6578384fd5b84356128d18161302e565b93506020850135600381106128e4578384fd5b93969395505050506040820135916060013590565b60008060408385031215612776578182fd5b60008060008060008060008060c0898b031215612926578586fd5b883567ffffffffffffffff8082111561293d578788fd5b6129498c838d016126df565b909a50985060208b0135915080821115612961578788fd5b5061296e8b828c016126df565b999c989b5099604081013598606082013598506080820135975060a09091013595509350505050565b6000602082840312156129a8578081fd5b81356120f481613043565b6000602082840312156129c4578081fd5b81516120f481613043565b6000602082840312156129e0578081fd5b81356120f481613051565b6000602082840312156129fc578081fd5b81516120f481613051565b600080600060608486031215612a1b578081fd5b8351612a268161302e565b6020850151909350612a378161302e565b6040850151909250612a488161302e565b809150509250925092565b60008060008060008060c08789031215612a6b578384fd5b863567ffffffffffffffff80821115612a82578586fd5b612a8e8a838b01612729565b97506020890135915080821115612aa3578586fd5b612aaf8a838b01612729565b96506040890135915080821115612ac4578586fd5b612ad08a838b01612729565b95506060890135915080821115612ae5578384fd5b612af18a838b01612729565b94506080890135915080821115612b06578384fd5b612b128a838b01612729565b935060a0890135915080821115612b27578283fd5b50612b3489828a01612729565b9150509295509295509295565b600060208284031215612b52578081fd5b5035919050565b600060208284031215612b6a578081fd5b5051919050565b81835260006020808501945082825b85811015612bae578135612b938161302e565b6001600160a01b031687529582019590820190600101612b80565b509495945050505050565b81835260006001600160fb1b03831115612bd1578081fd5b8260051b80836020870137939093016020019283525090919050565b60008151808452612c05816020860160208601612f56565b601f01601f19169290920160200192915050565b60038110612c3757634e487b7160e01b600052602160045260246000fd5b9052565b60008251612c4d818460208701612f56565b9190910192915050565b60008351612c69818460208801612f56565b835190830190612c7d818360208801612f56565b01949350505050565b6001600160a01b038881168252878116602083015260e0820190612cad6040840189612c19565b86606084015285608084015280851660a084015280841660c08401525098975050505050505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612d0990830184612bed565b9695505050505050565b600060018060a01b03808b16835260c06020840152612d3660c084018a8c612b71565b8381036040850152612d4981898b612bb9565b606085019790975250608083019490945250911660a09091015295945050505050565b6001600160a01b038416815260608101612d896020830185612c19565b826040830152949350505050565b6001600160a01b038616815260a08101612db46020830187612c19565b8460408301528360608301528260808301529695505050505050565b60c081526000612de460c083018a8c612b71565b8281036020840152612df781898b612bb9565b60408401979097525050606081019390935260808301919091526001600160a01b031660a090910152949350505050565b6020815260006120f46020830184612bed565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60008219821115612f2657612f26612fec565b500190565b600082612f3a57612f3a613002565b500490565b600082821015612f5157612f51612fec565b500390565b60005b83811015612f71578181015183820152602001612f59565b838111156114ac5750506000910152565b600181811c90821680612f9657607f821691505b60208210811415612fb757634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415612fd157612fd1612fec565b5060010190565b600082612fe757612fe7613002565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461192257600080fd5b801515811461192257600080fd5b6001600160e01b03198116811461192257600080fdfea26469706673582212206b03c8f1ab1f0199dd59fb6664cc8d35a46d305ac81da961dbcb939412c4080764736f6c63430008040033

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

000000000000000000000000e1ceaa829525a08c1d39a5cebe4b42af58d77198000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000007465c5d60d3d095443cf9991da03304a30d42eae0000000000000000000000000ec9d8dac2178b041f85f60e3cf13cfaa3d23e0e000000000000000000000000000000000000000000000000000000000000004368747470733a2f2f7468616c65732d70726f746f636f6c2e73332e65752d6e6f7274682d312e616d617a6f6e6177732e636f6d2f766f7563686572312d32302e706e670000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004368747470733a2f2f7468616c65732d70726f746f636f6c2e73332e65752d6e6f7274682d312e616d617a6f6e6177732e636f6d2f766f7563686572312d35302e706e670000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004468747470733a2f2f7468616c65732d70726f746f636f6c2e73332e65752d6e6f7274682d312e616d617a6f6e6177732e636f6d2f766f7563686572312d3130302e706e6700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004468747470733a2f2f7468616c65732d70726f746f636f6c2e73332e65752d6e6f7274682d312e616d617a6f6e6177732e636f6d2f766f7563686572312d3230302e706e6700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004468747470733a2f2f7468616c65732d70726f746f636f6c2e73332e65752d6e6f7274682d312e616d617a6f6e6177732e636f6d2f766f7563686572312d3530302e706e6700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004568747470733a2f2f7468616c65732d70726f746f636f6c2e73332e65752d6e6f7274682d312e616d617a6f6e6177732e636f6d2f766f7563686572312d313030302e706e67000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _sUSD (address): 0xE1ceaa829525a08C1d39A5CEBe4b42aF58d77198
Arg [1] : _tokenURITwenty (string): https://thales-protocol.s3.eu-north-1.amazonaws.com/voucher1-20.png
Arg [2] : _tokenURIFifty (string): https://thales-protocol.s3.eu-north-1.amazonaws.com/voucher1-50.png
Arg [3] : _tokenURIHundred (string): https://thales-protocol.s3.eu-north-1.amazonaws.com/voucher1-100.png
Arg [4] : _tokenURITwoHundred (string): https://thales-protocol.s3.eu-north-1.amazonaws.com/voucher1-200.png
Arg [5] : _tokenURIFiveHundred (string): https://thales-protocol.s3.eu-north-1.amazonaws.com/voucher1-500.png
Arg [6] : _tokenURIThousand (string): https://thales-protocol.s3.eu-north-1.amazonaws.com/voucher1-1000.png
Arg [7] : _sportsamm (address): 0x7465c5d60d3d095443CF9991Da03304A30D42Eae
Arg [8] : _parlayAMM (address): 0x0ec9D8Dac2178b041f85f60E3cF13CfaA3d23e0e

-----Encoded View---------------
33 Constructor Arguments found :
Arg [0] : 000000000000000000000000e1ceaa829525a08c1d39a5cebe4b42af58d77198
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [2] : 00000000000000000000000000000000000000000000000000000000000001a0
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000220
Arg [4] : 00000000000000000000000000000000000000000000000000000000000002a0
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000320
Arg [6] : 00000000000000000000000000000000000000000000000000000000000003a0
Arg [7] : 0000000000000000000000007465c5d60d3d095443cf9991da03304a30d42eae
Arg [8] : 0000000000000000000000000ec9d8dac2178b041f85f60e3cf13cfaa3d23e0e
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000043
Arg [10] : 68747470733a2f2f7468616c65732d70726f746f636f6c2e73332e65752d6e6f
Arg [11] : 7274682d312e616d617a6f6e6177732e636f6d2f766f7563686572312d32302e
Arg [12] : 706e670000000000000000000000000000000000000000000000000000000000
Arg [13] : 0000000000000000000000000000000000000000000000000000000000000043
Arg [14] : 68747470733a2f2f7468616c65732d70726f746f636f6c2e73332e65752d6e6f
Arg [15] : 7274682d312e616d617a6f6e6177732e636f6d2f766f7563686572312d35302e
Arg [16] : 706e670000000000000000000000000000000000000000000000000000000000
Arg [17] : 0000000000000000000000000000000000000000000000000000000000000044
Arg [18] : 68747470733a2f2f7468616c65732d70726f746f636f6c2e73332e65752d6e6f
Arg [19] : 7274682d312e616d617a6f6e6177732e636f6d2f766f7563686572312d313030
Arg [20] : 2e706e6700000000000000000000000000000000000000000000000000000000
Arg [21] : 0000000000000000000000000000000000000000000000000000000000000044
Arg [22] : 68747470733a2f2f7468616c65732d70726f746f636f6c2e73332e65752d6e6f
Arg [23] : 7274682d312e616d617a6f6e6177732e636f6d2f766f7563686572312d323030
Arg [24] : 2e706e6700000000000000000000000000000000000000000000000000000000
Arg [25] : 0000000000000000000000000000000000000000000000000000000000000044
Arg [26] : 68747470733a2f2f7468616c65732d70726f746f636f6c2e73332e65752d6e6f
Arg [27] : 7274682d312e616d617a6f6e6177732e636f6d2f766f7563686572312d353030
Arg [28] : 2e706e6700000000000000000000000000000000000000000000000000000000
Arg [29] : 0000000000000000000000000000000000000000000000000000000000000045
Arg [30] : 68747470733a2f2f7468616c65732d70726f746f636f6c2e73332e65752d6e6f
Arg [31] : 7274682d312e616d617a6f6e6177732e636f6d2f766f7563686572312d313030
Arg [32] : 302e706e67000000000000000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading