AVAX Price: $22.23 (+2.98%)
Gas: 1.1 nAVAX
 

Overview

AVAX Balance

Avalanche C-Chain LogoAvalanche C-Chain LogoAvalanche C-Chain Logo0 AVAX

AVAX Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Approval For...601510462025-04-12 14:43:3911 days ago1744469019IN
0x15e6C37C...757949BEC
0 AVAX0.000029971.01
Set Approval For...601510282025-04-12 14:43:1511 days ago1744468995IN
0x15e6C37C...757949BEC
0 AVAX0.000032641.1
Set Approval For...599125762025-04-08 19:45:3514 days ago1744141535IN
0x15e6C37C...757949BEC
0 AVAX0.000029971.01
Set Approval For...587160682025-03-14 15:00:0440 days ago1741964404IN
0x15e6C37C...757949BEC
0 AVAX0.000037091.25
Set Approval For...587160642025-03-14 15:00:0040 days ago1741964400IN
0x15e6C37C...757949BEC
0 AVAX0.000035911.21
Set Approval For...587160612025-03-14 14:59:5540 days ago1741964395IN
0x15e6C37C...757949BEC
0 AVAX0.000035911.21
Set Approval For...587160572025-03-14 14:59:4940 days ago1741964389IN
0x15e6C37C...757949BEC
0 AVAX0.000035911.21
Set Approval For...583828172025-03-07 20:37:2946 days ago1741379849IN
0x15e6C37C...757949BEC
0 AVAX0.000076382.5738675
Set Approval For...582825032025-03-05 22:44:4848 days ago1741214688IN
0x15e6C37C...757949BEC
0 AVAX0.00003181.07151304
Set Approval For...577163452025-02-22 18:45:1459 days ago1740249914IN
0x15e6C37C...757949BEC
0 AVAX0.000074192.5
Set Approval For...577163442025-02-22 18:45:1159 days ago1740249911IN
0x15e6C37C...757949BEC
0 AVAX0.000074192.5
Set Approval For...577163342025-02-22 18:44:5659 days ago1740249896IN
0x15e6C37C...757949BEC
0 AVAX0.000074192.5
Set Approval For...577163342025-02-22 18:44:5659 days ago1740249896IN
0x15e6C37C...757949BEC
0 AVAX0.000074192.5
Set Approval For...577163342025-02-22 18:44:5659 days ago1740249896IN
0x15e6C37C...757949BEC
0 AVAX0.000074192.5
Set Approval For...576246402025-02-20 22:38:1061 days ago1740091090IN
0x15e6C37C...757949BEC
0 AVAX0.000093582
Set Approval For...563103442025-01-25 0:28:4488 days ago1737764924IN
0x15e6C37C...757949BEC
0 AVAX0.000037091.25
Set Approval For...563103292025-01-25 0:28:1888 days ago1737764898IN
0x15e6C37C...757949BEC
0 AVAX0.000039171.32
Set Approval For...563103292025-01-25 0:28:1888 days ago1737764898IN
0x15e6C37C...757949BEC
0 AVAX0.000039171.32
Set Approval For...554372362025-01-06 23:56:32106 days ago1736207792IN
0x15e6C37C...757949BEC
0 AVAX0.000074192.5
Set Approval For...554372192025-01-06 23:55:54106 days ago1736207754IN
0x15e6C37C...757949BEC
0 AVAX0.000074192.5
Set Approval For...554372052025-01-06 23:55:33106 days ago1736207733IN
0x15e6C37C...757949BEC
0 AVAX0.000074192.5
Set Approval For...554371882025-01-06 23:55:07106 days ago1736207707IN
0x15e6C37C...757949BEC
0 AVAX0.000074192.5
Set Approval For...548768182024-12-25 19:53:34118 days ago1735156414IN
0x15e6C37C...757949BEC
0 AVAX0.000074192.5
Set Approval For...548768172024-12-25 19:53:32118 days ago1735156412IN
0x15e6C37C...757949BEC
0 AVAX0.000074192.5
Set Approval For...548768162024-12-25 19:53:31118 days ago1735156411IN
0x15e6C37C...757949BEC
0 AVAX0.000074192.5
View all transactions

Latest 6 internal transactions

Parent Transaction Hash Block From To
90115892022-01-01 21:16:211207 days ago1641071781
0x15e6C37C...757949BEC
324.7 AVAX
90100672022-01-01 20:25:271207 days ago1641068727
0x15e6C37C...757949BEC
7,289.6 AVAX
90015542022-01-01 15:40:021208 days ago1641051602
0x15e6C37C...757949BEC
3,054.9 AVAX
89804632022-01-01 3:51:291208 days ago1641009089
0x15e6C37C...757949BEC
1,888.7 AVAX
89728652021-12-31 23:36:191208 days ago1640993779
0x15e6C37C...757949BEC
1,523.2 AVAX
89537442021-12-31 12:54:131209 days ago1640955253
0x15e6C37C...757949BEC
1,064.2 AVAX
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PoliceAndThief2

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 25 : PoliceAndThief2.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;

import "./Ownable.sol";
import "./Pauseable.sol";
import "./ERC721Enumerable.sol";
import "./IPoliceAndThief.sol";
import "./IBank.sol";
import "./ITraits.sol";
import "./ILOOT.sol";
import "./Pauseable.sol";
import "./ISeed.sol";

contract PoliceAndThief2 is IPoliceAndThief, ERC721Enumerable, Ownable, Pauseable {

    // mint price
    uint256 public MINT_PRICE = 1.7 ether;
    // max number of tokens that can be minted - 50000 in production
    uint256 public immutable MAX_TOKENS;
    // number of tokens that can be claimed for free - 20% of MAX_TOKENS
    uint256 public PAID_TOKENS;
    // number of tokens have been minted so far
    uint16 public minted;

    // mapping from tokenId to a struct containing the token's traits
    mapping(uint256 => ThiefPolice) public tokenTraits;
    // mapping from hashed(tokenTrait) to the tokenId it's associated with
    // used to ensure there are no duplicates
    mapping(uint256 => uint256) public existingCombinations;
    // reference to the Bank for choosing random Police thieves
    IBank public bank;
    // reference to $LOOT for burning on mint
    ILOOT public loot;
    // reference to Traits
    ITraits public traits;

    ISeed public randomSource;

    bool private _reentrant = false;

    address public swapper;

    modifier nonReentrant() {
        require(!_reentrant, "No reentrancy");
        _reentrant = true;
        _;
        _reentrant = false;
    }

    /**
     * instantiates contract and rarity tables
     */
    constructor(ILOOT _loot, ITraits _traits, uint256 _maxTokens) ERC721("Police & Thief Game", 'POLICE') {
        loot = _loot;
        traits = _traits;

        MAX_TOKENS = _maxTokens;
        PAID_TOKENS = _maxTokens / 5;
    }

    function setRandomSource(ISeed _seed) external onlyOwner {
        randomSource = _seed;
    }

    function mintOldTokens(address oldGame, uint256 id, address ownr) external {
        require(msg.sender == swapper, "Only swapper");

        tokenTraits[id] = IPoliceAndThief(oldGame).getTokenTraits(id);
        minted++;
        _safeMint(ownr,id);
    }

    /***EXTERNAL */

    /**
     * mint a token - 90% Thief, 10% Polices
     * The first 20% are free to claim, the remaining cost $LOOT
     */
    function mint(uint256 amount, bool stake) external payable nonReentrant whenNotPaused {
        require(tx.origin == _msgSender(), "Only EOA");
        require(minted + amount <= MAX_TOKENS, "All tokens minted");
        require(amount > 0 && amount <= 30, "Invalid mint amount");

        if (minted < PAID_TOKENS) {
            require(minted + amount <= PAID_TOKENS, "All tokens on-sale already sold");
            require(amount * MINT_PRICE == msg.value, "Invalid payment amount");
        } else {
            require(msg.value == 0);
        }

        uint256 totalLootCost = 0;
        uint16[] memory tokenIds = new uint16[](amount);
        address[] memory owners = new address[](amount);
        uint256 seed;
        uint256 firstMinted = minted;

        for (uint i = 0; i < amount; i++) {
            minted++;
            seed = random(minted);
            randomSource.update(minted ^ seed);
            generate(minted, seed);
            address recipient = selectRecipient(seed);
            totalLootCost += mintCost(minted);
            if (!stake || recipient != _msgSender()) {
                owners[i] = recipient;
            } else {
                tokenIds[i] = minted;
                owners[i] = address(bank);
            }

        }

        if (totalLootCost > 0) loot.burn(_msgSender(), totalLootCost);

        for (uint i = 0; i < owners.length; i++) {
            uint id = firstMinted + i + 1;
            if (!stake || owners[i] != _msgSender()) {
                _safeMint(owners[i], id);
            }
        }
        if (stake) bank.addManyToBankAndPack(_msgSender(), tokenIds);
    }

    /**
     * the first 20% are paid in AVAX
     * the next 20% are 20000 $LOOT
     * the next 40% are 40000 $LOOT
     * the final 20% are 80000 $LOOT
     * @param tokenId the ID to check the cost of to mint
   * @return the cost of the given token ID
   */
    function mintCost(uint256 tokenId) public view returns (uint256) {
        if (tokenId <= PAID_TOKENS) return 0;
        if (tokenId <= MAX_TOKENS * 2 / 5) return 20000 ether;
        if (tokenId <= MAX_TOKENS * 4 / 5) return 40000 ether;
        return 60000 ether;
    }

    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override nonReentrant {
        // Hardcode the Bank's approval so that users don't have to waste gas approving
        if (_msgSender() != address(bank))
            require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _transfer(from, to, tokenId);
    }

    /***INTERNAL */

    /**
     * generates traits for a specific token, checking to make sure it's unique
     * @param tokenId the id of the token to generate traits for
   * @param seed a pseudorandom 256 bit number to derive traits from
   * @return t - a struct of traits for the given token ID
   */
    function generate(uint256 tokenId, uint256 seed) internal returns (ThiefPolice memory t) {
        t = selectTraits(seed);
        if (existingCombinations[structToHash(t)] == 0) {
            tokenTraits[tokenId] = t;
            existingCombinations[structToHash(t)] = tokenId;
            return t;
        }
        return generate(tokenId, random(seed));
    }

    /**
     * uses A.J. Walker's Alias algorithm for O(1) rarity table lookup
     * ensuring O(1) instead of O(n) reduces mint cost by more than 50%
     * probability & alias tables are generated off-chain beforehand
     * @param seed portion of the 256 bit seed to remove trait correlation
   * @param traitType the trait type to select a trait for
   * @return the ID of the randomly selected trait
   */
    function selectTrait(uint16 seed, uint8 traitType) internal view returns (uint8) {
        return traits.selectTrait(seed, traitType);
    }

    /**
     * the first 20% (ETH purchases) go to the minter
     * the remaining 80% have a 10% chance to be given to a random staked police
     * @param seed a random value to select a recipient from
   * @return the address of the recipient (either the minter or the Police thief's owner)
   */
    function selectRecipient(uint256 seed) internal view returns (address) {
        if (minted <= PAID_TOKENS || ((seed >> 245) % 10) != 0) return _msgSender();
        // top 10 bits haven't been used
        address thief = bank.randomPoliceOwner(seed >> 144);
        // 144 bits reserved for trait selection
        if (thief == address(0x0)) return _msgSender();
        return thief;
    }

    /**
     * selects the species and all of its traits based on the seed value
     * @param seed a pseudorandom 256 bit number to derive traits from
   * @return t -  a struct of randomly selected traits
   */
    function selectTraits(uint256 seed) internal view returns (ThiefPolice memory t) {
        t.isThief = (seed & 0xFFFF) % 10 != 0;
        uint8 shift = t.isThief ? 0 : 10;

        seed >>= 16;
        t.uniform = selectTrait(uint16(seed & 0xFFFF), 0 + shift);

        seed >>= 16;
        t.hair = selectTrait(uint16(seed & 0xFFFF), 1 + shift);

        seed >>= 16;
        t.facialHair = selectTrait(uint16(seed & 0xFFFF), 2 + shift);

        seed >>= 16;
        t.eyes = selectTrait(uint16(seed & 0xFFFF), 3 + shift);

        seed >>= 16;
        t.accessory = selectTrait(uint16(seed & 0xFFFF), 4 + shift);

        seed >>= 16;
        t.headgear = selectTrait(uint16(seed & 0xFFFF), 5 + shift);

        seed >>= 16;
        if (!t.isThief) {
            t.neckGear = selectTrait(uint16(seed & 0xFFFF), 6 + shift);
            t.alphaIndex = selectTrait(uint16(seed & 0xFFFF), 7 + shift);
        }
    }

    /**
     * converts a struct to a 256 bit hash to check for uniqueness
     * @param s the struct to pack into a hash
   * @return the 256 bit hash of the struct
   */
    function structToHash(ThiefPolice memory s) internal pure returns (uint256) {
        return uint256(keccak256(
                abi.encodePacked(
                    s.isThief,
                    s.uniform,
                    s.hair,
                    s.facialHair,
                    s.eyes,
                    s.headgear,
                    s.accessory,
                    s.neckGear,
                    s.alphaIndex
                )
            ));
    }

    /**
     * generates a pseudorandom number
     * @param seed a value ensure different outcomes for different sources in the same block
   * @return a pseudorandom value
   */
    function random(uint256 seed) internal view returns (uint256) {
        return uint256(keccak256(abi.encodePacked(
                tx.origin,
                blockhash(block.number - 1),
                block.timestamp,
                seed
            ))) ^ randomSource.seed();
    }

    /***READ */

    function getTokenTraits(uint256 tokenId) external view override returns (ThiefPolice memory) {
        return tokenTraits[tokenId];
    }

    function getPaidTokens() external view override returns (uint256) {
        return PAID_TOKENS;
    }

    /***ADMIN */

    /**
     * called after deployment so that the contract can get random police thieves
     * @param _bank the address of the Bank
   */
    function setBank(address _bank) external onlyOwner {
        bank = IBank(_bank);
    }

    /**
     * allows owner to withdraw funds from minting
     */
    function withdraw() external onlyOwner {
        payable(owner()).transfer(address(this).balance);
    }

    /**
     * updates the number of tokens for sale
     */
    function setPaidTokens(uint256 _paidTokens) external onlyOwner {
        PAID_TOKENS = _paidTokens;
    }

    /**
     * enables owner to pause / unpause minting
     */
    function setPaused(bool _paused) external onlyOwner {
        if (_paused) _pause();
        else _unpause();
    }

    /***RENDER */

    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
        return traits.tokenURI(tokenId);
    }

    function changePrice(uint256 _price) public onlyOwner {
        MINT_PRICE = _price;
    }

    function setTraits(ITraits addr) public onlyOwner {
        traits = addr;
    }

    function setSwapper(address _sw) public onlyOwner {
        swapper = _sw;
    }
}

File 2 of 25 : Strings.sol
// SPDX-License-Identifier: MIT

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 3 of 25 : PoliceAndThief.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;

import "./Ownable.sol";
import "./Pauseable.sol";
import "./ERC721Enumerable.sol";
import "./IPoliceAndThief.sol";
import "./IBank.sol";
import "./ITraits.sol";
import "./ILOOT.sol";
import "./Pauseable.sol";
import "./ISeed.sol";

contract PoliceAndThief is IPoliceAndThief, ERC721Enumerable, Ownable, Pauseable {

    // mint price
    uint256 public MINT_PRICE = 1.7 ether;
    uint256 public MAX_MINT = 30;
    // max number of tokens that can be minted - 50000 in production
    uint256 public immutable MAX_TOKENS;
    // number of tokens that can be claimed for free - 20% of MAX_TOKENS
    uint256 public PAID_TOKENS;
    // number of tokens have been minted so far
    uint16 public minted;

    // mapping from tokenId to a struct containing the token's traits
    mapping(uint256 => ThiefPolice) public tokenTraits;
    // mapping from hashed(tokenTrait) to the tokenId it's associated with
    // used to ensure there are no duplicates
    mapping(uint256 => uint256) public existingCombinations;
    // reference to the Bank for choosing random Police thieves
    IBank public bank;
    // reference to $LOOT for burning on mint
    ILOOT public loot;
    // reference to Traits
    ITraits public traits;

    ISeed public randomSource;

    bool private _reentrant = false;
    bool private stakingActive = true;

    modifier nonReentrant() {
        require(!_reentrant, "No reentrancy");
        _reentrant = true;
        _;
        _reentrant = false;
    }

    /**
     * instantiates contract and rarity tables
     */
    constructor(ILOOT _loot, ITraits _traits, uint256 _maxTokens) ERC721("Police Game", 'WGAME') {
        loot = _loot;
        traits = _traits;

        MAX_TOKENS = _maxTokens;
        PAID_TOKENS = _maxTokens / 5;
    }

    function setRandomSource(ISeed _seed) external onlyOwner {
        randomSource = _seed;
    }

    /***EXTERNAL */

    /**
     * mint a token - 90% Thief, 10% Polices
     * The first 20% are free to claim, the remaining cost $LOOT
     */
    function mint(uint256 amount, bool stake) external payable nonReentrant whenNotPaused {
        require(!stake || stakingActive, "Staking not activated");

        require(tx.origin == _msgSender(), "Only EOA");
        require(minted + amount <= MAX_TOKENS, "All tokens minted");
        require(amount > 0 && amount <= MAX_MINT, "Invalid mint amount");

        if (minted < PAID_TOKENS) {
            require(minted + amount <= PAID_TOKENS, "All tokens on-sale already sold");
            require(amount * MINT_PRICE == msg.value, "Invalid payment amount");
        } else {
            require(msg.value == 0);
        }

        uint256 totalLootCost = 0;
        uint16[] memory tokenIds = new uint16[](amount);
        address[] memory owners = new address[](amount);
        uint256 seed;
        uint256 firstMinted = minted;

        for (uint i = 0; i < amount; i++) {
            minted++;
            seed = random(minted);
            randomSource.update(minted ^ seed);
            generate(minted, seed);
            address recipient = selectRecipient(seed);
            totalLootCost += mintCost(minted);
            if (!stake || recipient != _msgSender()) {
                owners[i] = recipient;
            } else {
                tokenIds[i] = minted;
                owners[i] = address(bank);
            }

        }

        if (totalLootCost > 0) loot.burn(_msgSender(), totalLootCost);

        for (uint i = 0; i < owners.length; i++) {
            uint id = firstMinted + i + 1;
            if (!stake || owners[i] != _msgSender()) {
                _safeMint(owners[i], id);
            }
        }
        if (stake) bank.addManyToBankAndPack(_msgSender(), tokenIds);
    }

    /**
     * the first 20% are paid in AVAX
     * the next 20% are 20000 $LOOT
     * the next 40% are 40000 $LOOT
     * the final 20% are 80000 $LOOT
     * @param tokenId the ID to check the cost of to mint
   * @return the cost of the given token ID
   */
    function mintCost(uint256 tokenId) public view returns (uint256) {
        if (tokenId <= PAID_TOKENS) return 0;
        if (tokenId <= MAX_TOKENS * 2 / 5) return 20000 ether;
        if (tokenId <= MAX_TOKENS * 4 / 5) return 40000 ether;
        return 60000 ether;
    }

    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override nonReentrant {
        // Hardcode the Bank's approval so that users don't have to waste gas approving
        if (_msgSender() != address(bank))
            require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _transfer(from, to, tokenId);
    }

    /***INTERNAL */

    /**
     * generates traits for a specific token, checking to make sure it's unique
     * @param tokenId the id of the token to generate traits for
   * @param seed a pseudorandom 256 bit number to derive traits from
   * @return t - a struct of traits for the given token ID
   */
    function generate(uint256 tokenId, uint256 seed) internal returns (ThiefPolice memory t) {
        t = selectTraits(seed);
        if (existingCombinations[structToHash(t)] == 0) {
            tokenTraits[tokenId] = t;
            existingCombinations[structToHash(t)] = tokenId;
            return t;
        }
        return generate(tokenId, random(seed));
    }

    /**
     * uses A.J. Walker's Alias algorithm for O(1) rarity table lookup
     * ensuring O(1) instead of O(n) reduces mint cost by more than 50%
     * probability & alias tables are generated off-chain beforehand
     * @param seed portion of the 256 bit seed to remove trait correlation
   * @param traitType the trait type to select a trait for
   * @return the ID of the randomly selected trait
   */
    function selectTrait(uint16 seed, uint8 traitType) internal view returns (uint8) {
        return traits.selectTrait(seed, traitType);
    }

    /**
     * the first 20% (ETH purchases) go to the minter
     * the remaining 80% have a 10% chance to be given to a random staked police
     * @param seed a random value to select a recipient from
   * @return the address of the recipient (either the minter or the Police thief's owner)
   */
    function selectRecipient(uint256 seed) internal view returns (address) {
        if (minted <= PAID_TOKENS || ((seed >> 245) % 10) != 0) return _msgSender();
        // top 10 bits haven't been used
        address thief = bank.randomPoliceOwner(seed >> 144);
        // 144 bits reserved for trait selection
        if (thief == address(0x0)) return _msgSender();
        return thief;
    }

    /**
     * selects the species and all of its traits based on the seed value
     * @param seed a pseudorandom 256 bit number to derive traits from
   * @return t -  a struct of randomly selected traits
   */
    function selectTraits(uint256 seed) internal view returns (ThiefPolice memory t) {
        t.isThief = (seed & 0xFFFF) % 10 != 0;
        uint8 shift = t.isThief ? 0 : 10;

        seed >>= 16;
        t.uniform = selectTrait(uint16(seed & 0xFFFF), 0 + shift);

        seed >>= 16;
        t.hair = selectTrait(uint16(seed & 0xFFFF), 1 + shift);

        seed >>= 16;
        t.facialHair = selectTrait(uint16(seed & 0xFFFF), 2 + shift);

        seed >>= 16;
        t.eyes = selectTrait(uint16(seed & 0xFFFF), 3 + shift);

        seed >>= 16;
        t.accessory = selectTrait(uint16(seed & 0xFFFF), 4 + shift);

        seed >>= 16;
        t.headgear = selectTrait(uint16(seed & 0xFFFF), 5 + shift);

        seed >>= 16;
        if (!t.isThief) {
            t.neckGear = selectTrait(uint16(seed & 0xFFFF), 6 + shift);
            t.alphaIndex = selectTrait(uint16(seed & 0xFFFF), 7 + shift);
        }
    }

    /**
     * converts a struct to a 256 bit hash to check for uniqueness
     * @param s the struct to pack into a hash
   * @return the 256 bit hash of the struct
   */
    function structToHash(ThiefPolice memory s) internal pure returns (uint256) {
        return uint256(keccak256(
                abi.encodePacked(
                    s.isThief,
                    s.uniform,
                    s.hair,
                    s.facialHair,
                    s.eyes,
                    s.headgear,
                    s.accessory,
                    s.neckGear,
                    s.alphaIndex
                )
            ));
    }

    /**
     * generates a pseudorandom number
     * @param seed a value ensure different outcomes for different sources in the same block
   * @return a pseudorandom value
   */
    function random(uint256 seed) internal view returns (uint256) {
        return uint256(keccak256(abi.encodePacked(
                tx.origin,
                blockhash(block.number - 1),
                block.timestamp,
                seed
            ))) ^ randomSource.seed();
    }

    /***READ */

    function getTokenTraits(uint256 tokenId) external view override returns (ThiefPolice memory) {
        return tokenTraits[tokenId];
    }

    function getPaidTokens() external view override returns (uint256) {
        return PAID_TOKENS;
    }

    /***ADMIN */

    /**
     * called after deployment so that the contract can get random police thieves
     * @param _bank the address of the Bank
   */
    function setBank(address _bank) external onlyOwner {
        bank = IBank(_bank);
    }

    /**
     * allows owner to withdraw funds from minting
     */
    function withdraw() external onlyOwner {
        payable(owner()).transfer(address(this).balance);
    }

    /**
     * updates the number of tokens for sale
     */
    function setPaidTokens(uint256 _paidTokens) external onlyOwner {
        PAID_TOKENS = _paidTokens;
    }

    /**
     * enables owner to pause / unpause minting
     */
    function setPaused(bool _paused) external onlyOwner {
        if (_paused) _pause();
        else _unpause();
    }

    /***RENDER */

    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
        return traits.tokenURI(tokenId);
    }

    function changePrice(uint256 _price) public onlyOwner {
        MINT_PRICE = _price;
    }

    function setStakingActive(bool _staking) public onlyOwner {
        stakingActive = _staking;
    }

    function setTraits(ITraits addr) public onlyOwner {
        traits = addr;
    }
}

File 4 of 25 : Pauseable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./Context.sol";

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

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

    bool private _paused;

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

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

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

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

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

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

File 5 of 25 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./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() {
        _setOwner(_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 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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 6 of 25 : LOOT.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;
import "./ERC20.sol";
import "./Ownable.sol";

contract LOOT is ERC20, Ownable {

    // a mapping from an address to whether or not it can mint / burn
    mapping(address => bool) controllers;

    constructor() ERC20("LOOT", "LOOT") { }

    /**
     * mints $LOOT to a recipient
     * @param to the recipient of the $LOOT
   * @param amount the amount of $LOOT to mint
   */
    function mint(address to, uint256 amount) external {
        require(controllers[msg.sender], "Only controllers can mint");
        _mint(to, amount);
    }

    /**
     * burns $LOOT from a holder
     * @param from the holder of the $LOOT
   * @param amount the amount of $LOOT to burn
   */
    function burn(address from, uint256 amount) external {
        require(controllers[msg.sender], "Only controllers can burn");
        _burn(from, amount);
    }

    /**
     * enables an address to mint / burn
     * @param controller the address to enable
   */
    function addController(address controller) external onlyOwner {
        controllers[controller] = true;
    }

    /**
     * disables an address from minting / burning
     * @param controller the address to disbale
   */
    function removeController(address controller) external onlyOwner {
        controllers[controller] = false;
    }
}

File 7 of 25 : ITraits.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;

interface ITraits {
    function tokenURI(uint256 tokenId) external view returns (string memory);
    function selectTrait(uint16 seed, uint8 traitType) external view returns(uint8);
}

File 8 of 25 : ISeed.sol
// SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.0;

interface ISeed {
    function seed() external view returns(uint256);
    function update(uint256 _seed) external returns(uint256);
}

File 9 of 25 : IPoliceAndThief.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;

interface IPoliceAndThief {

    // struct to store each token's traits
    struct ThiefPolice {
        bool isThief;
        uint8 uniform;
        uint8 hair;
        uint8 eyes;
        uint8 facialHair;
        uint8 headgear;
        uint8 neckGear;
        uint8 accessory;
        uint8 alphaIndex;
    }

    function getPaidTokens() external view returns (uint256);
    function getTokenTraits(uint256 tokenId) external view returns (ThiefPolice memory);
}

File 10 of 25 : ILOOT.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;

interface ILOOT  {

    function burn(address from, uint256 amount) external;
}

File 11 of 25 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

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 12 of 25 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT

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 13 of 25 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC721.sol";

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

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

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

File 14 of 25 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./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 25 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 16 of 25 : IERC20.sol
// SPDX-License-Identifier: MIT

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 17 of 25 : IERC165.sol
// SPDX-License-Identifier: MIT

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 18 of 25 : IBank.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;

import "./Bank.sol";

interface IBank {
    function addManyToBankAndPack(address account, uint16[] calldata tokenIds) external;
    function randomPoliceOwner(uint256 seed) external view returns (address);
    function bank(uint256) external view returns(uint16, uint80, address);
    function totalLootEarned() external view returns(uint256);
    function lastClaimTimestamp() external view returns(uint256);
    function setOldTokenInfo(uint256 _tokenId) external;

    function pack(uint256, uint256) external view returns(Bank.Stake memory);
    function packIndices(uint256) external view returns(uint256);

}

File 19 of 25 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./ERC721.sol";
import "./IERC721Enumerable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

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

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _allTokens.length;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

    /**
     * @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` cannot be the zero address.
     * - `to` cannot be the zero address.
     *
     * 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 override {
        super._beforeTokenTransfer(from, to, tokenId);

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }
}

File 20 of 25 : ERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./IERC721Metadata.sol";
import "./Address.sol";
import "./Context.sol";
import "./Strings.sol";
import "./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 {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_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");
        transferFrom(from, to, tokenId);
    }

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

    /**
     * @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 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 21 of 25 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./IERC20Metadata.sol";
import "./Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
    unchecked {
        _approve(sender, _msgSender(), currentAllowance - amount);
    }

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
    unchecked {
        _approve(_msgSender(), spender, currentAllowance - subtractedValue);
    }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
    unchecked {
        _balances[sender] = senderBalance - amount;
    }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

    /***@dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
    unchecked {
        _balances[account] = accountBalance - amount;
    }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens 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 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 22 of 25 : ERC165.sol
// SPDX-License-Identifier: MIT

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 23 of 25 : Context.sol
// SPDX-License-Identifier: MIT

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 24 of 25 : Bank.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;

import "./IERC721Receiver.sol";
import "./Pauseable.sol";
import "./PoliceAndThief.sol";
import "./LOOT.sol";

contract Bank is Ownable, IERC721Receiver, Pauseable {

    // maximum alpha score for a Police
    uint8 public constant MAX_ALPHA = 8;

    // struct to store a stake's token, owner, and earning values
    struct Stake {
        uint16 tokenId;
        uint80 value;
        address owner;
    }

    event TokenStaked(address owner, uint256 tokenId, uint256 value);
    event ThiefClaimed(uint256 tokenId, uint256 earned, bool unstaked);
    event PoliceClaimed(uint256 tokenId, uint256 earned, bool unstaked);

    // reference to the PoliceAndThief NFT contract
    PoliceAndThief game;
    // reference to the $LOOT contract for minting $LOOT earnings
    LOOT loot;

    // maps tokenId to stake
    mapping(uint256 => Stake) public bank;
    // maps alpha to all Police stakes with that alpha
    mapping(uint256 => Stake[]) public pack;
    // tracks location of each Police in Pack
    mapping(uint256 => uint256) public packIndices;
    // total alpha scores staked
    uint256 public totalAlphaStaked = 0;
    // any rewards distributed when no wolves are staked
    uint256 public unaccountedRewards = 0;
    // amount of $LOOT due for each alpha point staked
    uint256 public lootPerAlpha = 0;

    // thief earn 10000 $LOOT per day
    uint256 public DAILY_LOOT_RATE = 10000 ether;
    // thief must have 2 days worth of $LOOT to unstake or else it's too cold
    uint256 public MINIMUM_TO_EXIT = 2 days;
    // wolves take a 20% tax on all $LOOT claimed
    uint256 public constant LOOT_CLAIM_TAX_PERCENTAGE = 20;
    // there will only ever be (roughly) 2.4 billion $LOOT earned through staking
    uint256 public constant MAXIMUM_GLOBAL_LOOT = 2400000000 ether;

    // amount of $LOOT earned so far
    uint256 public totalLootEarned;
    // number of Thief staked in the Bank
    uint256 public totalThiefStaked;
    // the last time $LOOT was claimed
    uint256 public lastClaimTimestamp;

    // emergency rescue to allow unstaking without any checks but without $LOOT
    bool public rescueEnabled = false;

    bool private _reentrant = false;

    modifier nonReentrant() {
        require(!_reentrant, "No reentrancy");
        _reentrant = true;
        _;
        _reentrant = false;
    }

    /**
     * @param _game reference to the PoliceAndThief NFT contract
   * @param _loot reference to the $LOOT token
   */
    constructor(PoliceAndThief _game, LOOT _loot) {
        game = _game;
        loot = _loot;
    }

    /***STAKING */

    /**
     * adds Thief and Polices to the Bank and Pack
     * @param account the address of the staker
   * @param tokenIds the IDs of the Thief and Polices to stake
   */
    function addManyToBankAndPack(address account, uint16[] calldata tokenIds) external nonReentrant {
        require((account == _msgSender() && account == tx.origin) || _msgSender() == address(game), "DONT GIVE YOUR TOKENS AWAY");

        for (uint i = 0; i < tokenIds.length; i++) {
            if (tokenIds[i] == 0) {
                continue;
            }

            if (_msgSender() != address(game)) {// dont do this step if its a mint + stake
                require(game.ownerOf(tokenIds[i]) == _msgSender(), "AINT YO TOKEN");
                game.transferFrom(_msgSender(), address(this), tokenIds[i]);
            }

            if (isThief(tokenIds[i]))
                _addThiefToBank(account, tokenIds[i]);
            else
                _addPoliceToPack(account, tokenIds[i]);
        }
    }

    /**
     * adds a single Thief to the Bank
     * @param account the address of the staker
   * @param tokenId the ID of the Thief to add to the Bank
   */
    function _addThiefToBank(address account, uint256 tokenId) internal whenNotPaused _updateEarnings {
        bank[tokenId] = Stake({
        owner : account,
        tokenId : uint16(tokenId),
        value : uint80(block.timestamp)
        });
        totalThiefStaked += 1;
        emit TokenStaked(account, tokenId, block.timestamp);
    }

    /**
     * adds a single Police to the Pack
     * @param account the address of the staker
   * @param tokenId the ID of the Police to add to the Pack
   */
    function _addPoliceToPack(address account, uint256 tokenId) internal {
        uint256 alpha = _alphaForPolice(tokenId);
        totalAlphaStaked += alpha;
        // Portion of earnings ranges from 8 to 5
        packIndices[tokenId] = pack[alpha].length;
        // Store the location of the police in the Pack
        pack[alpha].push(Stake({
        owner : account,
        tokenId : uint16(tokenId),
        value : uint80(lootPerAlpha)
        }));
        // Add the police to the Pack
        emit TokenStaked(account, tokenId, lootPerAlpha);
    }

    /***CLAIMING / UNSTAKING */

    /**
     * realize $LOOT earnings and optionally unstake tokens from the Bank / Pack
     * to unstake a Thief it will require it has 2 days worth of $LOOT unclaimed
     * @param tokenIds the IDs of the tokens to claim earnings from
   * @param unstake whether or not to unstake ALL of the tokens listed in tokenIds
   */
    function claimManyFromBankAndPack(uint16[] calldata tokenIds, bool unstake) external nonReentrant whenNotPaused _updateEarnings {
        require(msg.sender == tx.origin, "Only EOA");
        uint256 owed = 0;
        for (uint i = 0; i < tokenIds.length; i++) {
            if (isThief(tokenIds[i]))
                owed += _claimThiefFromBank(tokenIds[i], unstake);
            else
                owed += _claimPoliceFromPack(tokenIds[i], unstake);
        }
        if (owed == 0) return;
        loot.mint(_msgSender(), owed);
    }

    /**
     * realize $LOOT earnings for a single Thief and optionally unstake it
     * if not unstaking, pay a 20% tax to the staked Polices
     * if unstaking, there is a 50% chance all $LOOT is stolen
     * @param tokenId the ID of the Thief to claim earnings from
   * @param unstake whether or not to unstake the Thief
   * @return owed - the amount of $LOOT earned
   */
    function _claimThiefFromBank(uint256 tokenId, bool unstake) internal returns (uint256 owed) {
        Stake memory stake = bank[tokenId];
        require(stake.owner == _msgSender(), "SWIPER, NO SWIPING");
        require(!(unstake && block.timestamp - stake.value < MINIMUM_TO_EXIT), "GONNA BE COLD WITHOUT TWO DAY'S LOOT");
        if (totalLootEarned < MAXIMUM_GLOBAL_LOOT) {
            owed = (block.timestamp - stake.value) * DAILY_LOOT_RATE / 1 days;
        } else if (stake.value > lastClaimTimestamp) {
            owed = 0;
            // $LOOT production stopped already
        } else {
            owed = (lastClaimTimestamp - stake.value) * DAILY_LOOT_RATE / 1 days;
            // stop earning additional $LOOT if it's all been earned
        }
        if (unstake) {
            if (random(tokenId) & 1 == 1) {// 50% chance of all $LOOT stolen
                _payPoliceTax(owed);
                owed = 0;
            }
            game.transferFrom(address(this), _msgSender(), tokenId);
            // send back Thief
            delete bank[tokenId];
            totalThiefStaked -= 1;
        } else {
            _payPoliceTax(owed * LOOT_CLAIM_TAX_PERCENTAGE / 100);
            // percentage tax to staked wolves
            owed = owed * (100 - LOOT_CLAIM_TAX_PERCENTAGE) / 100;
            // remainder goes to Thief owner
            bank[tokenId] = Stake({
            owner : _msgSender(),
            tokenId : uint16(tokenId),
            value : uint80(block.timestamp)
            });
            // reset stake
        }
        emit ThiefClaimed(tokenId, owed, unstake);
    }

    /**
     * realize $LOOT earnings for a single Police and optionally unstake it
     * Polices earn $LOOT proportional to their Alpha rank
     * @param tokenId the ID of the Police to claim earnings from
   * @param unstake whether or not to unstake the Police
   * @return owed - the amount of $LOOT earned
   */
    function _claimPoliceFromPack(uint256 tokenId, bool unstake) internal returns (uint256 owed) {
        require(game.ownerOf(tokenId) == address(this), "AINT A PART OF THE PACK");
        uint256 alpha = _alphaForPolice(tokenId);
        Stake memory stake = pack[alpha][packIndices[tokenId]];
        require(stake.owner == _msgSender(), "SWIPER, NO SWIPING");
        owed = (alpha) * (lootPerAlpha - stake.value);
        // Calculate portion of tokens based on Alpha
        if (unstake) {
            totalAlphaStaked -= alpha;
            // Remove Alpha from total staked
            game.transferFrom(address(this), _msgSender(), tokenId);
            // Send back Police
            Stake memory lastStake = pack[alpha][pack[alpha].length - 1];
            pack[alpha][packIndices[tokenId]] = lastStake;
            // Shuffle last Police to current position
            packIndices[lastStake.tokenId] = packIndices[tokenId];
            pack[alpha].pop();
            // Remove duplicate
            delete packIndices[tokenId];
            // Delete old mapping
        } else {
            pack[alpha][packIndices[tokenId]] = Stake({
            owner : _msgSender(),
            tokenId : uint16(tokenId),
            value : uint80(lootPerAlpha)
            });
            // reset stake
        }
        emit PoliceClaimed(tokenId, owed, unstake);
    }

    /**
     * emergency unstake tokens
     * @param tokenIds the IDs of the tokens to claim earnings from
   */
    function rescue(uint256[] calldata tokenIds) external nonReentrant {
        require(rescueEnabled, "RESCUE DISABLED");
        uint256 tokenId;
        Stake memory stake;
        Stake memory lastStake;
        uint256 alpha;
        for (uint i = 0; i < tokenIds.length; i++) {
            tokenId = tokenIds[i];
            if (isThief(tokenId)) {
                stake = bank[tokenId];
                require(stake.owner == _msgSender(), "SWIPER, NO SWIPING");
                game.transferFrom(address(this), _msgSender(), tokenId);
                // send back Thief
                delete bank[tokenId];
                totalThiefStaked -= 1;
                emit ThiefClaimed(tokenId, 0, true);
            } else {
                alpha = _alphaForPolice(tokenId);
                stake = pack[alpha][packIndices[tokenId]];
                require(stake.owner == _msgSender(), "SWIPER, NO SWIPING");
                totalAlphaStaked -= alpha;
                // Remove Alpha from total staked
                game.transferFrom(address(this), _msgSender(), tokenId);
                // Send back Police
                lastStake = pack[alpha][pack[alpha].length - 1];
                pack[alpha][packIndices[tokenId]] = lastStake;
                // Shuffle last Police to current position
                packIndices[lastStake.tokenId] = packIndices[tokenId];
                pack[alpha].pop();
                // Remove duplicate
                delete packIndices[tokenId];
                // Delete old mapping
                emit PoliceClaimed(tokenId, 0, true);
            }
        }
    }

    /***ACCOUNTING */

    /**
     * add $LOOT to claimable pot for the Pack
     * @param amount $LOOT to add to the pot
   */
    function _payPoliceTax(uint256 amount) internal {
        if (totalAlphaStaked == 0) {// if there's no staked wolves
            unaccountedRewards += amount;
            // keep track of $LOOT due to wolves
            return;
        }
        // makes sure to include any unaccounted $LOOT
        lootPerAlpha += (amount + unaccountedRewards) / totalAlphaStaked;
        unaccountedRewards = 0;
    }

    /**
     * tracks $LOOT earnings to ensure it stops once 2.4 billion is eclipsed
     */
    modifier _updateEarnings() {
        if (totalLootEarned < MAXIMUM_GLOBAL_LOOT) {
            totalLootEarned +=
            (block.timestamp - lastClaimTimestamp)
            * totalThiefStaked
            * DAILY_LOOT_RATE / 1 days;
            lastClaimTimestamp = block.timestamp;
        }
        _;
    }

    /***ADMIN */

    function setSettings(uint256 rate, uint256 exit) external onlyOwner {
        MINIMUM_TO_EXIT = exit;
        DAILY_LOOT_RATE = rate;
    }

    /**
     * allows owner to enable "rescue mode"
     * simplifies accounting, prioritizes tokens out in emergency
     */
    function setRescueEnabled(bool _enabled) external onlyOwner {
        rescueEnabled = _enabled;
    }

    /**
     * enables owner to pause / unpause minting
     */
    function setPaused(bool _paused) external onlyOwner {
        if (_paused) _pause();
        else _unpause();
    }

    /***READ ONLY */

    /**
     * checks if a token is a Thief
     * @param tokenId the ID of the token to check
   * @return thief - whether or not a token is a Thief
   */
    function isThief(uint256 tokenId) public view returns (bool thief) {
        (thief, , , , , , , , ) = game.tokenTraits(tokenId);
    }

    /**
     * gets the alpha score for a Police
     * @param tokenId the ID of the Police to get the alpha score for
   * @return the alpha score of the Police (5-8)
   */
    function _alphaForPolice(uint256 tokenId) internal view returns (uint8) {
        (, , , , , , , , uint8 alphaIndex) = game.tokenTraits(tokenId);
        return MAX_ALPHA - alphaIndex;
        // alpha index is 0-3
    }

    /**
     * chooses a random Police thief when a newly minted token is stolen
     * @param seed a random value to choose a Police from
   * @return the owner of the randomly selected Police thief
   */
    function randomPoliceOwner(uint256 seed) external view returns (address) {
        if (totalAlphaStaked == 0) return address(0x0);
        uint256 bucket = (seed & 0xFFFFFFFF) % totalAlphaStaked;
        // choose a value from 0 to total alpha staked
        uint256 cumulative;
        seed >>= 32;
        // loop through each bucket of Polices with the same alpha score
        for (uint i = MAX_ALPHA - 3; i <= MAX_ALPHA; i++) {
            cumulative += pack[i].length * i;
            // if the value is not inside of that bucket, keep going
            if (bucket >= cumulative) continue;
            // get the address of a random Police with that alpha score
            return pack[i][seed % pack[i].length].owner;
        }
        return address(0x0);
    }

    /**
     * generates a pseudorandom number
     * @param seed a value ensure different outcomes for different sources in the same block
   * @return a pseudorandom value
   */
    function random(uint256 seed) internal view returns (uint256) {
        return uint256(keccak256(abi.encodePacked(
                tx.origin,
                blockhash(block.number - 1),
                block.timestamp,
                seed,
                totalThiefStaked,
                totalAlphaStaked,
                lastClaimTimestamp
            ))) ^ game.randomSource().seed();
    }

    function onERC721Received(
        address,
        address from,
        uint256,
        bytes calldata
    ) external pure override returns (bytes4) {
        require(from == address(0x0), "Cannot send tokens to Barn directly");
        return IERC721Receiver.onERC721Received.selector;
    }
}

File 25 of 25 : Address.sol
// SPDX-License-Identifier: MIT

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);
            }
        }
    }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"contract ILOOT","name":"_loot","type":"address"},{"internalType":"contract ITraits","name":"_traits","type":"address"},{"internalType":"uint256","name":"_maxTokens","type":"uint256"}],"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":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"MAX_TOKENS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAID_TOKENS","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":[],"name":"bank","outputs":[{"internalType":"contract IBank","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"changePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"existingCombinations","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPaidTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenTraits","outputs":[{"components":[{"internalType":"bool","name":"isThief","type":"bool"},{"internalType":"uint8","name":"uniform","type":"uint8"},{"internalType":"uint8","name":"hair","type":"uint8"},{"internalType":"uint8","name":"eyes","type":"uint8"},{"internalType":"uint8","name":"facialHair","type":"uint8"},{"internalType":"uint8","name":"headgear","type":"uint8"},{"internalType":"uint8","name":"neckGear","type":"uint8"},{"internalType":"uint8","name":"accessory","type":"uint8"},{"internalType":"uint8","name":"alphaIndex","type":"uint8"}],"internalType":"struct IPoliceAndThief.ThiefPolice","name":"","type":"tuple"}],"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":[],"name":"loot","outputs":[{"internalType":"contract ILOOT","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"stake","type":"bool"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mintCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"oldGame","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"ownr","type":"address"}],"name":"mintOldTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minted","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","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":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"randomSource","outputs":[{"internalType":"contract ISeed","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":"_bank","type":"address"}],"name":"setBank","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_paidTokens","type":"uint256"}],"name":"setPaidTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISeed","name":"_seed","type":"address"}],"name":"setRandomSource","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sw","type":"address"}],"name":"setSwapper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITraits","name":"addr","type":"address"}],"name":"setTraits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenTraits","outputs":[{"internalType":"bool","name":"isThief","type":"bool"},{"internalType":"uint8","name":"uniform","type":"uint8"},{"internalType":"uint8","name":"hair","type":"uint8"},{"internalType":"uint8","name":"eyes","type":"uint8"},{"internalType":"uint8","name":"facialHair","type":"uint8"},{"internalType":"uint8","name":"headgear","type":"uint8"},{"internalType":"uint8","name":"neckGear","type":"uint8"},{"internalType":"uint8","name":"accessory","type":"uint8"},{"internalType":"uint8","name":"alphaIndex","type":"uint8"}],"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":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"traits","outputs":[{"internalType":"contract ITraits","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":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a06040526717979cfe362a0000600b556000601360146101000a81548160ff0219169083151502179055503480156200003857600080fd5b50604051620065b1380380620065b183398181016040528101906200005e91906200045d565b6040518060400160405280601381526020017f506f6c69636520262054686965662047616d65000000000000000000000000008152506040518060400160405280600681526020017f504f4c49434500000000000000000000000000000000000000000000000000008152508160009080519060200190620000e2929190620002af565b508060019080519060200190620000fb929190620002af565b5050506200011e62000112620001e160201b60201c565b620001e960201b60201c565b6001600a60146101000a81548160ff02191690831515021790555082601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060808181525050600581620001d29190620004e8565b600c8190555050505062000585565b600033905090565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b828054620002bd906200054f565b90600052602060002090601f016020900481019282620002e157600085556200032d565b82601f10620002fc57805160ff19168380011785556200032d565b828001600101855582156200032d579182015b828111156200032c5782518255916020019190600101906200030f565b5b5090506200033c919062000340565b5090565b5b808211156200035b57600081600090555060010162000341565b5090565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620003918262000364565b9050919050565b6000620003a58262000384565b9050919050565b620003b78162000398565b8114620003c357600080fd5b50565b600081519050620003d781620003ac565b92915050565b6000620003ea8262000384565b9050919050565b620003fc81620003dd565b81146200040857600080fd5b50565b6000815190506200041c81620003f1565b92915050565b6000819050919050565b620004378162000422565b81146200044357600080fd5b50565b60008151905062000457816200042c565b92915050565b6000806000606084860312156200047957620004786200035f565b5b60006200048986828701620003c6565b93505060206200049c868287016200040b565b9250506040620004af8682870162000446565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000620004f58262000422565b9150620005028362000422565b925082620005155762000514620004b9565b5b828204905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200056857607f821691505b602082108114156200057f576200057e62000520565b5b50919050565b608051615ffb620005b660003960008181610fcf015281816110200152818161153d0152612a4a0152615ffb6000f3fe60806040526004361061025c5760003560e01c80636f4f736611610144578063b88d4fde116100b6578063e05c57bf1161007a578063e05c57bf14610911578063e1fc334f14610956578063e985e9c514610981578063eb0b4453146109be578063f2fde38b146109e7578063f47c84c514610a105761025c565b8063b88d4fde1461082c578063c002d23d14610855578063c084f54014610880578063c87b56dd146108ab578063d773826d146108e85761025c565b806395d89b411161010857806395d89b411461071e5780639b7b2ab0146107495780639c82f2a414610774578063a1b8f3741461079d578063a22cb465146107da578063a2b40d19146108035761025c565b80636f4f73661461062557806370a082311461064e57806376cdb03b1461068b5780638da5cb5b146106b657806394e56847146106e15761025c565b80632b3297f9116101dd57806342842e0e116101a157806342842e0e146105105780634f02c420146105395780634f6ccce7146105645780635c975abb146105a15780636352211e146105cc57806367f68fac146106095761025c565b80632b3297f91461043d5780632f745c59146104685780633431a753146104a55780633ccfd60b146104ce5780634018b1f8146104e55761025c565b80630c89b766116102245780630c89b7661461035857806316c38b3c1461038357806318160ddd146103ac57806323b872dd146103d757806327de8f27146104005761025c565b806301ffc9a71461026157806306fdde031461029e578063081812fc146102c9578063090d23b914610306578063095ea7b31461032f575b600080fd5b34801561026d57600080fd5b5061028860048036038101906102839190613fd1565b610a3b565b6040516102959190614019565b60405180910390f35b3480156102aa57600080fd5b506102b3610ab5565b6040516102c091906140cd565b60405180910390f35b3480156102d557600080fd5b506102f060048036038101906102eb9190614125565b610b47565b6040516102fd9190614193565b60405180910390f35b34801561031257600080fd5b5061032d600480360381019061032891906141da565b610bcc565b005b34801561033b57600080fd5b5061035660048036038101906103519190614207565b610c8c565b005b34801561036457600080fd5b5061036d610da4565b60405161037a91906142a6565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a591906142ed565b610dca565b005b3480156103b857600080fd5b506103c1610e65565b6040516103ce9190614329565b60405180910390f35b3480156103e357600080fd5b506103fe60048036038101906103f99190614344565b610e72565b005b34801561040c57600080fd5b5061042760048036038101906104229190614125565b610fb5565b6040516104349190614329565b60405180910390f35b34801561044957600080fd5b5061045261107e565b60405161045f9190614193565b60405180910390f35b34801561047457600080fd5b5061048f600480360381019061048a9190614207565b6110a4565b60405161049c9190614329565b60405180910390f35b3480156104b157600080fd5b506104cc60048036038101906104c79190614125565b611149565b005b3480156104da57600080fd5b506104e36111cf565b005b3480156104f157600080fd5b506104fa61129b565b6040516105079190614329565b60405180910390f35b34801561051c57600080fd5b5061053760048036038101906105329190614344565b6112a5565b005b34801561054557600080fd5b5061054e6112c5565b60405161055b91906143b4565b60405180910390f35b34801561057057600080fd5b5061058b60048036038101906105869190614125565b6112d9565b6040516105989190614329565b60405180910390f35b3480156105ad57600080fd5b506105b661134a565b6040516105c39190614019565b60405180910390f35b3480156105d857600080fd5b506105f360048036038101906105ee9190614125565b611361565b6040516106009190614193565b60405180910390f35b610623600480360381019061061e91906143cf565b611413565b005b34801561063157600080fd5b5061064c6004803603810190610647919061444d565b611c90565b005b34801561065a57600080fd5b50610675600480360381019061067091906141da565b611d50565b6040516106829190614329565b60405180910390f35b34801561069757600080fd5b506106a0611e08565b6040516106ad919061449b565b60405180910390f35b3480156106c257600080fd5b506106cb611e2e565b6040516106d89190614193565b60405180910390f35b3480156106ed57600080fd5b5061070860048036038101906107039190614125565b611e58565b6040516107159190614598565b60405180910390f35b34801561072a57600080fd5b50610733611f89565b60405161074091906140cd565b60405180910390f35b34801561075557600080fd5b5061075e61201b565b60405161076b91906145d5565b60405180910390f35b34801561078057600080fd5b5061079b600480360381019061079691906141da565b612041565b005b3480156107a957600080fd5b506107c460048036038101906107bf9190614125565b612101565b6040516107d19190614329565b60405180910390f35b3480156107e657600080fd5b5061080160048036038101906107fc91906145f0565b612119565b005b34801561080f57600080fd5b5061082a60048036038101906108259190614125565b61229a565b005b34801561083857600080fd5b50610853600480360381019061084e9190614765565b612320565b005b34801561086157600080fd5b5061086a612381565b6040516108779190614329565b60405180910390f35b34801561088c57600080fd5b50610895612387565b6040516108a29190614329565b60405180910390f35b3480156108b757600080fd5b506108d260048036038101906108cd9190614125565b61238d565b6040516108df91906140cd565b60405180910390f35b3480156108f457600080fd5b5061090f600480360381019061090a9190614826565b61247f565b005b34801561091d57600080fd5b5061093860048036038101906109339190614125565b61253f565b60405161094d99989796959493929190614862565b60405180910390f35b34801561096257600080fd5b5061096b612602565b6040516109789190614910565b60405180910390f35b34801561098d57600080fd5b506109a860048036038101906109a3919061492b565b612628565b6040516109b59190614019565b60405180910390f35b3480156109ca57600080fd5b506109e560048036038101906109e0919061496b565b6126bc565b005b3480156109f357600080fd5b50610a0e6004803603810190610a0991906141da565b612950565b005b348015610a1c57600080fd5b50610a25612a48565b604051610a329190614329565b60405180910390f35b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610aae5750610aad82612a6c565b5b9050919050565b606060008054610ac4906149ed565b80601f0160208091040260200160405190810160405280929190818152602001828054610af0906149ed565b8015610b3d5780601f10610b1257610100808354040283529160200191610b3d565b820191906000526020600020905b815481529060010190602001808311610b2057829003601f168201915b5050505050905090565b6000610b5282612b4e565b610b91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8890614a91565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b610bd4612bba565b73ffffffffffffffffffffffffffffffffffffffff16610bf2611e2e565b73ffffffffffffffffffffffffffffffffffffffff1614610c48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3f90614afd565b60405180910390fd5b80601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610c9782611361565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cff90614b8f565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610d27612bba565b73ffffffffffffffffffffffffffffffffffffffff161480610d565750610d5581610d50612bba565b612628565b5b610d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8c90614c21565b60405180910390fd5b610d9f8383612bc2565b505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610dd2612bba565b73ffffffffffffffffffffffffffffffffffffffff16610df0611e2e565b73ffffffffffffffffffffffffffffffffffffffff1614610e46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3d90614afd565b60405180910390fd5b8015610e5957610e54612c7b565b610e62565b610e61612d1e565b5b50565b6000600880549050905090565b601360149054906101000a900460ff1615610ec2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb990614c8d565b60405180910390fd5b6001601360146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f1e612bba565b73ffffffffffffffffffffffffffffffffffffffff1614610f8a57610f4a610f44612bba565b82612dc0565b610f89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f8090614d1f565b60405180910390fd5b5b610f95838383612e9e565b6000601360146101000a81548160ff021916908315150217905550505050565b6000600c548211610fc95760009050611079565b600560027f0000000000000000000000000000000000000000000000000000000000000000610ff89190614d6e565b6110029190614df7565b821161101a5769043c33c19375648000009050611079565b600560047f00000000000000000000000000000000000000000000000000000000000000006110499190614d6e565b6110539190614df7565b821161106b57690878678326eac90000009050611079565b690cb49b44ba602d80000090505b919050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006110af83611d50565b82106110f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110e790614e9a565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b611151612bba565b73ffffffffffffffffffffffffffffffffffffffff1661116f611e2e565b73ffffffffffffffffffffffffffffffffffffffff16146111c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111bc90614afd565b60405180910390fd5b80600c8190555050565b6111d7612bba565b73ffffffffffffffffffffffffffffffffffffffff166111f5611e2e565b73ffffffffffffffffffffffffffffffffffffffff161461124b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124290614afd565b60405180910390fd5b611253611e2e565b73ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015611298573d6000803e3d6000fd5b50565b6000600c54905090565b6112c083838360405180602001604052806000815250612320565b505050565b600d60009054906101000a900461ffff1681565b60006112e3610e65565b8210611324576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131b90614f2c565b60405180910390fd5b6008828154811061133857611337614f4c565b5b90600052602060002001549050919050565b6000600a60149054906101000a900460ff16905090565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561140a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140190614fed565b60405180910390fd5b80915050919050565b601360149054906101000a900460ff1615611463576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161145a90614c8d565b60405180910390fd5b6001601360146101000a81548160ff02191690831515021790555061148661134a565b156114c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114bd90615059565b60405180910390fd5b6114ce612bba565b73ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff161461153b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611532906150c5565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000082600d60009054906101000a900461ffff1661ffff1661157c91906150e5565b11156115bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115b490615187565b60405180910390fd5b6000821180156115ce5750601e8211155b61160d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611604906151f3565b60405180910390fd5b600c54600d60009054906101000a900461ffff1661ffff1610156116e357600c5482600d60009054906101000a900461ffff1661ffff1661164e91906150e5565b111561168f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116869061525f565b60405180910390fd5b34600b548361169e9190614d6e565b146116de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116d5906152cb565b60405180910390fd5b6116f1565b600034146116f057600080fd5b5b6000808367ffffffffffffffff81111561170e5761170d61463a565b5b60405190808252806020026020018201604052801561173c5781602001602082028036833780820191505090505b50905060008467ffffffffffffffff81111561175b5761175a61463a565b5b6040519080825280602002602001820160405280156117895781602001602082028036833780820191505090505b509050600080600d60009054906101000a900461ffff1661ffff16905060005b87811015611a6d57600d600081819054906101000a900461ffff16809291906117d1906152eb565b91906101000a81548161ffff021916908361ffff16021790555050611809600d60009054906101000a900461ffff1661ffff166130fa565b9250601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166382ab890a84600d60009054906101000a900461ffff1661ffff16186040518263ffffffff1660e01b815260040161187c9190614329565b6020604051808303816000875af115801561189b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118bf919061532b565b506118de600d60009054906101000a900461ffff1661ffff16846131d2565b5060006118ea84613389565b9050611909600d60009054906101000a900461ffff1661ffff16610fb5565b8761191491906150e5565b96508715806119565750611926612bba565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b156119ae578085838151811061196f5761196e614f4c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611a59565b600d60009054906101000a900461ffff168683815181106119d2576119d1614f4c565b5b602002602001019061ffff16908161ffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16858381518110611a1e57611a1d614f4c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b508080611a6590615358565b9150506117a9565b506000851115611b0e57601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639dc29fac611abd612bba565b876040518363ffffffff1660e01b8152600401611adb9291906153a1565b600060405180830381600087803b158015611af557600080fd5b505af1158015611b09573d6000803e3d6000fd5b505050505b60005b8351811015611bce57600060018284611b2a91906150e5565b611b3491906150e5565b9050871580611b905750611b46612bba565b73ffffffffffffffffffffffffffffffffffffffff16858381518110611b6f57611b6e614f4c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b15611bba57611bb9858381518110611bab57611baa614f4c565b5b6020026020010151826134c8565b5b508080611bc690615358565b915050611b11565b508515611c6c57601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635b519142611c1b612bba565b866040518363ffffffff1660e01b8152600401611c39929190615488565b600060405180830381600087803b158015611c5357600080fd5b505af1158015611c67573d6000803e3d6000fd5b505050505b50505050506000601360146101000a81548160ff0219169083151502179055505050565b611c98612bba565b73ffffffffffffffffffffffffffffffffffffffff16611cb6611e2e565b73ffffffffffffffffffffffffffffffffffffffff1614611d0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d0390614afd565b60405180910390fd5b80601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611dc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db89061552a565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611e60613eff565b600e6000838152602001908152602001600020604051806101200160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900460ff1660ff1660ff1681526020016000820160029054906101000a900460ff1660ff1660ff1681526020016000820160039054906101000a900460ff1660ff1660ff1681526020016000820160049054906101000a900460ff1660ff1660ff1681526020016000820160059054906101000a900460ff1660ff1660ff1681526020016000820160069054906101000a900460ff1660ff1660ff1681526020016000820160079054906101000a900460ff1660ff1660ff1681526020016000820160089054906101000a900460ff1660ff1660ff16815250509050919050565b606060018054611f98906149ed565b80601f0160208091040260200160405190810160405280929190818152602001828054611fc4906149ed565b80156120115780601f10611fe657610100808354040283529160200191612011565b820191906000526020600020905b815481529060010190602001808311611ff457829003601f168201915b5050505050905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b612049612bba565b73ffffffffffffffffffffffffffffffffffffffff16612067611e2e565b73ffffffffffffffffffffffffffffffffffffffff16146120bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120b490614afd565b60405180910390fd5b80601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600f6020528060005260406000206000915090505481565b612121612bba565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561218f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218690615596565b60405180910390fd5b806005600061219c612bba565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16612249612bba565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161228e9190614019565b60405180910390a35050565b6122a2612bba565b73ffffffffffffffffffffffffffffffffffffffff166122c0611e2e565b73ffffffffffffffffffffffffffffffffffffffff1614612316576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161230d90614afd565b60405180910390fd5b80600b8190555050565b61233161232b612bba565b83612dc0565b612370576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161236790614d1f565b60405180910390fd5b61237b848484610e72565b50505050565b600b5481565b600c5481565b606061239882612b4e565b6123d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123ce90615628565b60405180910390fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c87b56dd836040518263ffffffff1660e01b81526004016124329190614329565b600060405180830381865afa15801561244f573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061247891906156e9565b9050919050565b612487612bba565b73ffffffffffffffffffffffffffffffffffffffff166124a5611e2e565b73ffffffffffffffffffffffffffffffffffffffff16146124fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f290614afd565b60405180910390fd5b80601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600e6020528060005260406000206000915090508060000160009054906101000a900460ff16908060000160019054906101000a900460ff16908060000160029054906101000a900460ff16908060000160039054906101000a900460ff16908060000160049054906101000a900460ff16908060000160059054906101000a900460ff16908060000160069054906101000a900460ff16908060000160079054906101000a900460ff16908060000160089054906101000a900460ff16905089565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461274c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127439061577e565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff166394e56847836040518263ffffffff1660e01b81526004016127859190614329565b61012060405180830381865afa1580156127a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127c791906158c4565b600e600084815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a08201518160000160056101000a81548160ff021916908360ff16021790555060c08201518160000160066101000a81548160ff021916908360ff16021790555060e08201518160000160076101000a81548160ff021916908360ff1602179055506101008201518160000160086101000a81548160ff021916908360ff160217905550905050600d600081819054906101000a900461ffff1680929190612926906152eb565b91906101000a81548161ffff021916908361ffff1602179055505061294b81836134c8565b505050565b612958612bba565b73ffffffffffffffffffffffffffffffffffffffff16612976611e2e565b73ffffffffffffffffffffffffffffffffffffffff16146129cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129c390614afd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612a3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a3390615964565b60405180910390fd5b612a45816134e6565b50565b7f000000000000000000000000000000000000000000000000000000000000000081565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480612b3757507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80612b475750612b46826135ac565b5b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16612c3583611361565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b612c8361134a565b15612cc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cba90615059565b60405180910390fd5b6001600a60146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612d07612bba565b604051612d149190614193565b60405180910390a1565b612d2661134a565b612d65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5c906159d0565b60405180910390fd5b6000600a60146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612da9612bba565b604051612db69190614193565b60405180910390a1565b6000612dcb82612b4e565b612e0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0190615a62565b60405180910390fd5b6000612e1583611361565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480612e8457508373ffffffffffffffffffffffffffffffffffffffff16612e6c84610b47565b73ffffffffffffffffffffffffffffffffffffffff16145b80612e955750612e948185612628565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16612ebe82611361565b73ffffffffffffffffffffffffffffffffffffffff1614612f14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f0b90615af4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612f84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f7b90615b86565b60405180910390fd5b612f8f838383613616565b612f9a600082612bc2565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612fea9190615ba6565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461304191906150e5565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637d94792a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613169573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061318d919061532b565b3260014361319b9190615ba6565b4042856040516020016131b19493929190615c6e565b6040516020818303038152906040528051906020012060001c189050919050565b6131da613eff565b6131e38261372a565b90506000600f60006131f484613907565b815260200190815260200160002054141561336e5780600e600085815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a08201518160000160056101000a81548160ff021916908360ff16021790555060c08201518160000160066101000a81548160ff021916908360ff16021790555060e08201518160000160076101000a81548160ff021916908360ff1602179055506101008201518160000160086101000a81548160ff021916908360ff16021790555090505082600f600061335784613907565b815260200190815260200160002081905550613383565b6133808361337b846130fa565b6131d2565b90505b92915050565b6000600c54600d60009054906101000a900461ffff1661ffff161115806133c157506000600a60f584901c6133be9190615cbc565b14155b156133d5576133ce612bba565b90506134c3565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639e6dee4a609085901c6040518263ffffffff1660e01b81526004016134369190614329565b602060405180830381865afa158015613453573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134779190615d02565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156134be576134b6612bba565b9150506134c3565b809150505b919050565b6134e282826040518060200160405280600081525061396f565b5050565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b61362183838361397e565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156136645761365f81613983565b6136a3565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146136a2576136a183826139cc565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156136e6576136e181613b39565b613725565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614613724576137238282613c0a565b5b5b505050565b613732613eff565b6000600a61ffff84166137459190615cbc565b14158160000190151590811515815250506000816000015161376857600a61376b565b60005b9050601083901c925061378e61ffff84168260006137899190615d2f565b613c89565b826020019060ff16908160ff1681525050601083901c92506137c061ffff84168260016137bb9190615d2f565b613c89565b826040019060ff16908160ff1681525050601083901c92506137f261ffff84168260026137ed9190615d2f565b613c89565b826080019060ff16908160ff1681525050601083901c925061382461ffff841682600361381f9190615d2f565b613c89565b826060019060ff16908160ff1681525050601083901c925061385661ffff84168260046138519190615d2f565b613c89565b8260e0019060ff16908160ff1681525050601083901c925061388861ffff84168260056138839190615d2f565b613c89565b8260a0019060ff16908160ff1681525050601083901c92508160000151613901576138c361ffff84168260066138be9190615d2f565b613c89565b8260c0019060ff16908160ff16815250506138ee61ffff84168260076138e99190615d2f565b613c89565b82610100019060ff16908160ff16815250505b50919050565b6000816000015182602001518360400151846080015185606001518660a001518760e001518860c0015189610100015160405160200161394f99989796959493929190615dc5565b6040516020818303038152906040528051906020012060001c9050919050565b6139798383613d31565b505050565b505050565b6008805490506009600083815260200190815260200160002081905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550565b600060016139d984611d50565b6139e39190615ba6565b9050600060076000848152602001908152602001600020549050818114613ac8576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816007600083815260200190815260200160002081905550505b6007600084815260200190815260200160002060009055600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b60006001600880549050613b4d9190615ba6565b9050600060096000848152602001908152602001600020549050600060088381548110613b7d57613b7c614f4c565b5b906000526020600020015490508060088381548110613b9f57613b9e614f4c565b5b906000526020600020018190555081600960008381526020019081526020016000208190555060096000858152602001908152602001600020600090556008805480613bee57613bed615e68565b5b6001900381819060005260206000200160009055905550505050565b6000613c1583611d50565b905081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806007600084815260200190815260200160002081905550505050565b6000601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a6b0969284846040518363ffffffff1660e01b8152600401613ce8929190615e97565b602060405180830381865afa158015613d05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d299190615ec0565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613da1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613d9890615f39565b60405180910390fd5b613daa81612b4e565b15613dea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613de190615fa5565b60405180910390fd5b613df660008383613616565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613e4691906150e5565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b604051806101200160405280600015158152602001600060ff168152602001600060ff168152602001600060ff168152602001600060ff168152602001600060ff168152602001600060ff168152602001600060ff168152602001600060ff1681525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b613fae81613f79565b8114613fb957600080fd5b50565b600081359050613fcb81613fa5565b92915050565b600060208284031215613fe757613fe6613f6f565b5b6000613ff584828501613fbc565b91505092915050565b60008115159050919050565b61401381613ffe565b82525050565b600060208201905061402e600083018461400a565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561406e578082015181840152602081019050614053565b8381111561407d576000848401525b50505050565b6000601f19601f8301169050919050565b600061409f82614034565b6140a9818561403f565b93506140b9818560208601614050565b6140c281614083565b840191505092915050565b600060208201905081810360008301526140e78184614094565b905092915050565b6000819050919050565b614102816140ef565b811461410d57600080fd5b50565b60008135905061411f816140f9565b92915050565b60006020828403121561413b5761413a613f6f565b5b600061414984828501614110565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061417d82614152565b9050919050565b61418d81614172565b82525050565b60006020820190506141a86000830184614184565b92915050565b6141b781614172565b81146141c257600080fd5b50565b6000813590506141d4816141ae565b92915050565b6000602082840312156141f0576141ef613f6f565b5b60006141fe848285016141c5565b91505092915050565b6000806040838503121561421e5761421d613f6f565b5b600061422c858286016141c5565b925050602061423d85828601614110565b9150509250929050565b6000819050919050565b600061426c61426761426284614152565b614247565b614152565b9050919050565b600061427e82614251565b9050919050565b600061429082614273565b9050919050565b6142a081614285565b82525050565b60006020820190506142bb6000830184614297565b92915050565b6142ca81613ffe565b81146142d557600080fd5b50565b6000813590506142e7816142c1565b92915050565b60006020828403121561430357614302613f6f565b5b6000614311848285016142d8565b91505092915050565b614323816140ef565b82525050565b600060208201905061433e600083018461431a565b92915050565b60008060006060848603121561435d5761435c613f6f565b5b600061436b868287016141c5565b935050602061437c868287016141c5565b925050604061438d86828701614110565b9150509250925092565b600061ffff82169050919050565b6143ae81614397565b82525050565b60006020820190506143c960008301846143a5565b92915050565b600080604083850312156143e6576143e5613f6f565b5b60006143f485828601614110565b9250506020614405858286016142d8565b9150509250929050565b600061441a82614172565b9050919050565b61442a8161440f565b811461443557600080fd5b50565b60008135905061444781614421565b92915050565b60006020828403121561446357614462613f6f565b5b600061447184828501614438565b91505092915050565b600061448582614273565b9050919050565b6144958161447a565b82525050565b60006020820190506144b0600083018461448c565b92915050565b6144bf81613ffe565b82525050565b600060ff82169050919050565b6144db816144c5565b82525050565b610120820160008201516144f860008501826144b6565b50602082015161450b60208501826144d2565b50604082015161451e60408501826144d2565b50606082015161453160608501826144d2565b50608082015161454460808501826144d2565b5060a082015161455760a08501826144d2565b5060c082015161456a60c08501826144d2565b5060e082015161457d60e08501826144d2565b506101008201516145926101008501826144d2565b50505050565b6000610120820190506145ae60008301846144e1565b92915050565b60006145bf82614273565b9050919050565b6145cf816145b4565b82525050565b60006020820190506145ea60008301846145c6565b92915050565b6000806040838503121561460757614606613f6f565b5b6000614615858286016141c5565b9250506020614626858286016142d8565b9150509250929050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61467282614083565b810181811067ffffffffffffffff821117156146915761469061463a565b5b80604052505050565b60006146a4613f65565b90506146b08282614669565b919050565b600067ffffffffffffffff8211156146d0576146cf61463a565b5b6146d982614083565b9050602081019050919050565b82818337600083830152505050565b6000614708614703846146b5565b61469a565b90508281526020810184848401111561472457614723614635565b5b61472f8482856146e6565b509392505050565b600082601f83011261474c5761474b614630565b5b813561475c8482602086016146f5565b91505092915050565b6000806000806080858703121561477f5761477e613f6f565b5b600061478d878288016141c5565b945050602061479e878288016141c5565b93505060406147af87828801614110565b925050606085013567ffffffffffffffff8111156147d0576147cf613f74565b5b6147dc87828801614737565b91505092959194509250565b60006147f382614172565b9050919050565b614803816147e8565b811461480e57600080fd5b50565b600081359050614820816147fa565b92915050565b60006020828403121561483c5761483b613f6f565b5b600061484a84828501614811565b91505092915050565b61485c816144c5565b82525050565b600061012082019050614878600083018c61400a565b614885602083018b614853565b614892604083018a614853565b61489f6060830189614853565b6148ac6080830188614853565b6148b960a0830187614853565b6148c660c0830186614853565b6148d360e0830185614853565b6148e1610100830184614853565b9a9950505050505050505050565b60006148fa82614273565b9050919050565b61490a816148ef565b82525050565b60006020820190506149256000830184614901565b92915050565b6000806040838503121561494257614941613f6f565b5b6000614950858286016141c5565b9250506020614961858286016141c5565b9150509250929050565b60008060006060848603121561498457614983613f6f565b5b6000614992868287016141c5565b93505060206149a386828701614110565b92505060406149b4868287016141c5565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680614a0557607f821691505b60208210811415614a1957614a186149be565b5b50919050565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b6000614a7b602c8361403f565b9150614a8682614a1f565b604082019050919050565b60006020820190508181036000830152614aaa81614a6e565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000614ae760208361403f565b9150614af282614ab1565b602082019050919050565b60006020820190508181036000830152614b1681614ada565b9050919050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b6000614b7960218361403f565b9150614b8482614b1d565b604082019050919050565b60006020820190508181036000830152614ba881614b6c565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b6000614c0b60388361403f565b9150614c1682614baf565b604082019050919050565b60006020820190508181036000830152614c3a81614bfe565b9050919050565b7f4e6f207265656e7472616e637900000000000000000000000000000000000000600082015250565b6000614c77600d8361403f565b9150614c8282614c41565b602082019050919050565b60006020820190508181036000830152614ca681614c6a565b9050919050565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b6000614d0960318361403f565b9150614d1482614cad565b604082019050919050565b60006020820190508181036000830152614d3881614cfc565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614d79826140ef565b9150614d84836140ef565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614dbd57614dbc614d3f565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000614e02826140ef565b9150614e0d836140ef565b925082614e1d57614e1c614dc8565b5b828204905092915050565b7f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008201527f74206f6620626f756e6473000000000000000000000000000000000000000000602082015250565b6000614e84602b8361403f565b9150614e8f82614e28565b604082019050919050565b60006020820190508181036000830152614eb381614e77565b9050919050565b7f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008201527f7574206f6620626f756e64730000000000000000000000000000000000000000602082015250565b6000614f16602c8361403f565b9150614f2182614eba565b604082019050919050565b60006020820190508181036000830152614f4581614f09565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b6000614fd760298361403f565b9150614fe282614f7b565b604082019050919050565b6000602082019050818103600083015261500681614fca565b9050919050565b7f506175736561626c653a20706175736564000000000000000000000000000000600082015250565b600061504360118361403f565b915061504e8261500d565b602082019050919050565b6000602082019050818103600083015261507281615036565b9050919050565b7f4f6e6c7920454f41000000000000000000000000000000000000000000000000600082015250565b60006150af60088361403f565b91506150ba82615079565b602082019050919050565b600060208201905081810360008301526150de816150a2565b9050919050565b60006150f0826140ef565b91506150fb836140ef565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156151305761512f614d3f565b5b828201905092915050565b7f416c6c20746f6b656e73206d696e746564000000000000000000000000000000600082015250565b600061517160118361403f565b915061517c8261513b565b602082019050919050565b600060208201905081810360008301526151a081615164565b9050919050565b7f496e76616c6964206d696e7420616d6f756e7400000000000000000000000000600082015250565b60006151dd60138361403f565b91506151e8826151a7565b602082019050919050565b6000602082019050818103600083015261520c816151d0565b9050919050565b7f416c6c20746f6b656e73206f6e2d73616c6520616c726561647920736f6c6400600082015250565b6000615249601f8361403f565b915061525482615213565b602082019050919050565b600060208201905081810360008301526152788161523c565b9050919050565b7f496e76616c6964207061796d656e7420616d6f756e7400000000000000000000600082015250565b60006152b560168361403f565b91506152c08261527f565b602082019050919050565b600060208201905081810360008301526152e4816152a8565b9050919050565b60006152f682614397565b915061ffff82141561530b5761530a614d3f565b5b600182019050919050565b600081519050615325816140f9565b92915050565b60006020828403121561534157615340613f6f565b5b600061534f84828501615316565b91505092915050565b6000615363826140ef565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561539657615395614d3f565b5b600182019050919050565b60006040820190506153b66000830185614184565b6153c3602083018461431a565b9392505050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6153ff81614397565b82525050565b600061541183836153f6565b60208301905092915050565b6000602082019050919050565b6000615435826153ca565b61543f81856153d5565b935061544a836153e6565b8060005b8381101561547b5781516154628882615405565b975061546d8361541d565b92505060018101905061544e565b5085935050505092915050565b600060408201905061549d6000830185614184565b81810360208301526154af818461542a565b90509392505050565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b6000615514602a8361403f565b915061551f826154b8565b604082019050919050565b6000602082019050818103600083015261554381615507565b9050919050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b600061558060198361403f565b915061558b8261554a565b602082019050919050565b600060208201905081810360008301526155af81615573565b9050919050565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b6000615612602f8361403f565b915061561d826155b6565b604082019050919050565b6000602082019050818103600083015261564181615605565b9050919050565b600067ffffffffffffffff8211156156635761566261463a565b5b61566c82614083565b9050602081019050919050565b600061568c61568784615648565b61469a565b9050828152602081018484840111156156a8576156a7614635565b5b6156b3848285614050565b509392505050565b600082601f8301126156d0576156cf614630565b5b81516156e0848260208601615679565b91505092915050565b6000602082840312156156ff576156fe613f6f565b5b600082015167ffffffffffffffff81111561571d5761571c613f74565b5b615729848285016156bb565b91505092915050565b7f4f6e6c7920737761707065720000000000000000000000000000000000000000600082015250565b6000615768600c8361403f565b915061577382615732565b602082019050919050565b600060208201905081810360008301526157978161575b565b9050919050565b600080fd5b6000815190506157b2816142c1565b92915050565b6157c1816144c5565b81146157cc57600080fd5b50565b6000815190506157de816157b8565b92915050565b600061012082840312156157fb576157fa61579e565b5b61580661012061469a565b90506000615816848285016157a3565b600083015250602061582a848285016157cf565b602083015250604061583e848285016157cf565b6040830152506060615852848285016157cf565b6060830152506080615866848285016157cf565b60808301525060a061587a848285016157cf565b60a08301525060c061588e848285016157cf565b60c08301525060e06158a2848285016157cf565b60e0830152506101006158b7848285016157cf565b6101008301525092915050565b600061012082840312156158db576158da613f6f565b5b60006158e9848285016157e4565b91505092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061594e60268361403f565b9150615959826158f2565b604082019050919050565b6000602082019050818103600083015261597d81615941565b9050919050565b7f506175736561626c653a206e6f74207061757365640000000000000000000000600082015250565b60006159ba60158361403f565b91506159c582615984565b602082019050919050565b600060208201905081810360008301526159e9816159ad565b9050919050565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b6000615a4c602c8361403f565b9150615a57826159f0565b604082019050919050565b60006020820190508181036000830152615a7b81615a3f565b9050919050565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008201527f73206e6f74206f776e0000000000000000000000000000000000000000000000602082015250565b6000615ade60298361403f565b9150615ae982615a82565b604082019050919050565b60006020820190508181036000830152615b0d81615ad1565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000615b7060248361403f565b9150615b7b82615b14565b604082019050919050565b60006020820190508181036000830152615b9f81615b63565b9050919050565b6000615bb1826140ef565b9150615bbc836140ef565b925082821015615bcf57615bce614d3f565b5b828203905092915050565b60008160601b9050919050565b6000615bf282615bda565b9050919050565b6000615c0482615be7565b9050919050565b615c1c615c1782614172565b615bf9565b82525050565b6000819050919050565b6000819050919050565b615c47615c4282615c22565b615c2c565b82525050565b6000819050919050565b615c68615c63826140ef565b615c4d565b82525050565b6000615c7a8287615c0b565b601482019150615c8a8286615c36565b602082019150615c9a8285615c57565b602082019150615caa8284615c57565b60208201915081905095945050505050565b6000615cc7826140ef565b9150615cd2836140ef565b925082615ce257615ce1614dc8565b5b828206905092915050565b600081519050615cfc816141ae565b92915050565b600060208284031215615d1857615d17613f6f565b5b6000615d2684828501615ced565b91505092915050565b6000615d3a826144c5565b9150615d45836144c5565b92508260ff03821115615d5b57615d5a614d3f565b5b828201905092915050565b60008160f81b9050919050565b6000615d7e82615d66565b9050919050565b6000615d9082615d73565b9050919050565b615da8615da382613ffe565b615d85565b82525050565b615dbf615dba826144c5565b615d73565b82525050565b6000615dd1828c615d97565b600182019150615de1828b615dae565b600182019150615df1828a615dae565b600182019150615e018289615dae565b600182019150615e118288615dae565b600182019150615e218287615dae565b600182019150615e318286615dae565b600182019150615e418285615dae565b600182019150615e518284615dae565b6001820191508190509a9950505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6000604082019050615eac60008301856143a5565b615eb96020830184614853565b9392505050565b600060208284031215615ed657615ed5613f6f565b5b6000615ee4848285016157cf565b91505092915050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b6000615f2360208361403f565b9150615f2e82615eed565b602082019050919050565b60006020820190508181036000830152615f5281615f16565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b6000615f8f601c8361403f565b9150615f9a82615f59565b602082019050919050565b60006020820190508181036000830152615fbe81615f82565b905091905056fea26469706673582212201771e72c671735575fb67b2d845a707876842de4d3749a81a1db1fe414251c7864736f6c634300080a00330000000000000000000000007f041ce89a2079873693207653b24c15b5e6a29300000000000000000000000087cbe78985a3d87bb9e0b3e856787ecff2209475000000000000000000000000000000000000000000000000000000000000c350

Deployed Bytecode

0x60806040526004361061025c5760003560e01c80636f4f736611610144578063b88d4fde116100b6578063e05c57bf1161007a578063e05c57bf14610911578063e1fc334f14610956578063e985e9c514610981578063eb0b4453146109be578063f2fde38b146109e7578063f47c84c514610a105761025c565b8063b88d4fde1461082c578063c002d23d14610855578063c084f54014610880578063c87b56dd146108ab578063d773826d146108e85761025c565b806395d89b411161010857806395d89b411461071e5780639b7b2ab0146107495780639c82f2a414610774578063a1b8f3741461079d578063a22cb465146107da578063a2b40d19146108035761025c565b80636f4f73661461062557806370a082311461064e57806376cdb03b1461068b5780638da5cb5b146106b657806394e56847146106e15761025c565b80632b3297f9116101dd57806342842e0e116101a157806342842e0e146105105780634f02c420146105395780634f6ccce7146105645780635c975abb146105a15780636352211e146105cc57806367f68fac146106095761025c565b80632b3297f91461043d5780632f745c59146104685780633431a753146104a55780633ccfd60b146104ce5780634018b1f8146104e55761025c565b80630c89b766116102245780630c89b7661461035857806316c38b3c1461038357806318160ddd146103ac57806323b872dd146103d757806327de8f27146104005761025c565b806301ffc9a71461026157806306fdde031461029e578063081812fc146102c9578063090d23b914610306578063095ea7b31461032f575b600080fd5b34801561026d57600080fd5b5061028860048036038101906102839190613fd1565b610a3b565b6040516102959190614019565b60405180910390f35b3480156102aa57600080fd5b506102b3610ab5565b6040516102c091906140cd565b60405180910390f35b3480156102d557600080fd5b506102f060048036038101906102eb9190614125565b610b47565b6040516102fd9190614193565b60405180910390f35b34801561031257600080fd5b5061032d600480360381019061032891906141da565b610bcc565b005b34801561033b57600080fd5b5061035660048036038101906103519190614207565b610c8c565b005b34801561036457600080fd5b5061036d610da4565b60405161037a91906142a6565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a591906142ed565b610dca565b005b3480156103b857600080fd5b506103c1610e65565b6040516103ce9190614329565b60405180910390f35b3480156103e357600080fd5b506103fe60048036038101906103f99190614344565b610e72565b005b34801561040c57600080fd5b5061042760048036038101906104229190614125565b610fb5565b6040516104349190614329565b60405180910390f35b34801561044957600080fd5b5061045261107e565b60405161045f9190614193565b60405180910390f35b34801561047457600080fd5b5061048f600480360381019061048a9190614207565b6110a4565b60405161049c9190614329565b60405180910390f35b3480156104b157600080fd5b506104cc60048036038101906104c79190614125565b611149565b005b3480156104da57600080fd5b506104e36111cf565b005b3480156104f157600080fd5b506104fa61129b565b6040516105079190614329565b60405180910390f35b34801561051c57600080fd5b5061053760048036038101906105329190614344565b6112a5565b005b34801561054557600080fd5b5061054e6112c5565b60405161055b91906143b4565b60405180910390f35b34801561057057600080fd5b5061058b60048036038101906105869190614125565b6112d9565b6040516105989190614329565b60405180910390f35b3480156105ad57600080fd5b506105b661134a565b6040516105c39190614019565b60405180910390f35b3480156105d857600080fd5b506105f360048036038101906105ee9190614125565b611361565b6040516106009190614193565b60405180910390f35b610623600480360381019061061e91906143cf565b611413565b005b34801561063157600080fd5b5061064c6004803603810190610647919061444d565b611c90565b005b34801561065a57600080fd5b50610675600480360381019061067091906141da565b611d50565b6040516106829190614329565b60405180910390f35b34801561069757600080fd5b506106a0611e08565b6040516106ad919061449b565b60405180910390f35b3480156106c257600080fd5b506106cb611e2e565b6040516106d89190614193565b60405180910390f35b3480156106ed57600080fd5b5061070860048036038101906107039190614125565b611e58565b6040516107159190614598565b60405180910390f35b34801561072a57600080fd5b50610733611f89565b60405161074091906140cd565b60405180910390f35b34801561075557600080fd5b5061075e61201b565b60405161076b91906145d5565b60405180910390f35b34801561078057600080fd5b5061079b600480360381019061079691906141da565b612041565b005b3480156107a957600080fd5b506107c460048036038101906107bf9190614125565b612101565b6040516107d19190614329565b60405180910390f35b3480156107e657600080fd5b5061080160048036038101906107fc91906145f0565b612119565b005b34801561080f57600080fd5b5061082a60048036038101906108259190614125565b61229a565b005b34801561083857600080fd5b50610853600480360381019061084e9190614765565b612320565b005b34801561086157600080fd5b5061086a612381565b6040516108779190614329565b60405180910390f35b34801561088c57600080fd5b50610895612387565b6040516108a29190614329565b60405180910390f35b3480156108b757600080fd5b506108d260048036038101906108cd9190614125565b61238d565b6040516108df91906140cd565b60405180910390f35b3480156108f457600080fd5b5061090f600480360381019061090a9190614826565b61247f565b005b34801561091d57600080fd5b5061093860048036038101906109339190614125565b61253f565b60405161094d99989796959493929190614862565b60405180910390f35b34801561096257600080fd5b5061096b612602565b6040516109789190614910565b60405180910390f35b34801561098d57600080fd5b506109a860048036038101906109a3919061492b565b612628565b6040516109b59190614019565b60405180910390f35b3480156109ca57600080fd5b506109e560048036038101906109e0919061496b565b6126bc565b005b3480156109f357600080fd5b50610a0e6004803603810190610a0991906141da565b612950565b005b348015610a1c57600080fd5b50610a25612a48565b604051610a329190614329565b60405180910390f35b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610aae5750610aad82612a6c565b5b9050919050565b606060008054610ac4906149ed565b80601f0160208091040260200160405190810160405280929190818152602001828054610af0906149ed565b8015610b3d5780601f10610b1257610100808354040283529160200191610b3d565b820191906000526020600020905b815481529060010190602001808311610b2057829003601f168201915b5050505050905090565b6000610b5282612b4e565b610b91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8890614a91565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b610bd4612bba565b73ffffffffffffffffffffffffffffffffffffffff16610bf2611e2e565b73ffffffffffffffffffffffffffffffffffffffff1614610c48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3f90614afd565b60405180910390fd5b80601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610c9782611361565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cff90614b8f565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610d27612bba565b73ffffffffffffffffffffffffffffffffffffffff161480610d565750610d5581610d50612bba565b612628565b5b610d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8c90614c21565b60405180910390fd5b610d9f8383612bc2565b505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610dd2612bba565b73ffffffffffffffffffffffffffffffffffffffff16610df0611e2e565b73ffffffffffffffffffffffffffffffffffffffff1614610e46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3d90614afd565b60405180910390fd5b8015610e5957610e54612c7b565b610e62565b610e61612d1e565b5b50565b6000600880549050905090565b601360149054906101000a900460ff1615610ec2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb990614c8d565b60405180910390fd5b6001601360146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f1e612bba565b73ffffffffffffffffffffffffffffffffffffffff1614610f8a57610f4a610f44612bba565b82612dc0565b610f89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f8090614d1f565b60405180910390fd5b5b610f95838383612e9e565b6000601360146101000a81548160ff021916908315150217905550505050565b6000600c548211610fc95760009050611079565b600560027f000000000000000000000000000000000000000000000000000000000000c350610ff89190614d6e565b6110029190614df7565b821161101a5769043c33c19375648000009050611079565b600560047f000000000000000000000000000000000000000000000000000000000000c3506110499190614d6e565b6110539190614df7565b821161106b57690878678326eac90000009050611079565b690cb49b44ba602d80000090505b919050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006110af83611d50565b82106110f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110e790614e9a565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b611151612bba565b73ffffffffffffffffffffffffffffffffffffffff1661116f611e2e565b73ffffffffffffffffffffffffffffffffffffffff16146111c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111bc90614afd565b60405180910390fd5b80600c8190555050565b6111d7612bba565b73ffffffffffffffffffffffffffffffffffffffff166111f5611e2e565b73ffffffffffffffffffffffffffffffffffffffff161461124b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124290614afd565b60405180910390fd5b611253611e2e565b73ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015611298573d6000803e3d6000fd5b50565b6000600c54905090565b6112c083838360405180602001604052806000815250612320565b505050565b600d60009054906101000a900461ffff1681565b60006112e3610e65565b8210611324576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131b90614f2c565b60405180910390fd5b6008828154811061133857611337614f4c565b5b90600052602060002001549050919050565b6000600a60149054906101000a900460ff16905090565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561140a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140190614fed565b60405180910390fd5b80915050919050565b601360149054906101000a900460ff1615611463576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161145a90614c8d565b60405180910390fd5b6001601360146101000a81548160ff02191690831515021790555061148661134a565b156114c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114bd90615059565b60405180910390fd5b6114ce612bba565b73ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff161461153b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611532906150c5565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000c35082600d60009054906101000a900461ffff1661ffff1661157c91906150e5565b11156115bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115b490615187565b60405180910390fd5b6000821180156115ce5750601e8211155b61160d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611604906151f3565b60405180910390fd5b600c54600d60009054906101000a900461ffff1661ffff1610156116e357600c5482600d60009054906101000a900461ffff1661ffff1661164e91906150e5565b111561168f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116869061525f565b60405180910390fd5b34600b548361169e9190614d6e565b146116de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116d5906152cb565b60405180910390fd5b6116f1565b600034146116f057600080fd5b5b6000808367ffffffffffffffff81111561170e5761170d61463a565b5b60405190808252806020026020018201604052801561173c5781602001602082028036833780820191505090505b50905060008467ffffffffffffffff81111561175b5761175a61463a565b5b6040519080825280602002602001820160405280156117895781602001602082028036833780820191505090505b509050600080600d60009054906101000a900461ffff1661ffff16905060005b87811015611a6d57600d600081819054906101000a900461ffff16809291906117d1906152eb565b91906101000a81548161ffff021916908361ffff16021790555050611809600d60009054906101000a900461ffff1661ffff166130fa565b9250601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166382ab890a84600d60009054906101000a900461ffff1661ffff16186040518263ffffffff1660e01b815260040161187c9190614329565b6020604051808303816000875af115801561189b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118bf919061532b565b506118de600d60009054906101000a900461ffff1661ffff16846131d2565b5060006118ea84613389565b9050611909600d60009054906101000a900461ffff1661ffff16610fb5565b8761191491906150e5565b96508715806119565750611926612bba565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b156119ae578085838151811061196f5761196e614f4c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611a59565b600d60009054906101000a900461ffff168683815181106119d2576119d1614f4c565b5b602002602001019061ffff16908161ffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16858381518110611a1e57611a1d614f4c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b508080611a6590615358565b9150506117a9565b506000851115611b0e57601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639dc29fac611abd612bba565b876040518363ffffffff1660e01b8152600401611adb9291906153a1565b600060405180830381600087803b158015611af557600080fd5b505af1158015611b09573d6000803e3d6000fd5b505050505b60005b8351811015611bce57600060018284611b2a91906150e5565b611b3491906150e5565b9050871580611b905750611b46612bba565b73ffffffffffffffffffffffffffffffffffffffff16858381518110611b6f57611b6e614f4c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b15611bba57611bb9858381518110611bab57611baa614f4c565b5b6020026020010151826134c8565b5b508080611bc690615358565b915050611b11565b508515611c6c57601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635b519142611c1b612bba565b866040518363ffffffff1660e01b8152600401611c39929190615488565b600060405180830381600087803b158015611c5357600080fd5b505af1158015611c67573d6000803e3d6000fd5b505050505b50505050506000601360146101000a81548160ff0219169083151502179055505050565b611c98612bba565b73ffffffffffffffffffffffffffffffffffffffff16611cb6611e2e565b73ffffffffffffffffffffffffffffffffffffffff1614611d0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d0390614afd565b60405180910390fd5b80601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611dc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db89061552a565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611e60613eff565b600e6000838152602001908152602001600020604051806101200160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900460ff1660ff1660ff1681526020016000820160029054906101000a900460ff1660ff1660ff1681526020016000820160039054906101000a900460ff1660ff1660ff1681526020016000820160049054906101000a900460ff1660ff1660ff1681526020016000820160059054906101000a900460ff1660ff1660ff1681526020016000820160069054906101000a900460ff1660ff1660ff1681526020016000820160079054906101000a900460ff1660ff1660ff1681526020016000820160089054906101000a900460ff1660ff1660ff16815250509050919050565b606060018054611f98906149ed565b80601f0160208091040260200160405190810160405280929190818152602001828054611fc4906149ed565b80156120115780601f10611fe657610100808354040283529160200191612011565b820191906000526020600020905b815481529060010190602001808311611ff457829003601f168201915b5050505050905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b612049612bba565b73ffffffffffffffffffffffffffffffffffffffff16612067611e2e565b73ffffffffffffffffffffffffffffffffffffffff16146120bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120b490614afd565b60405180910390fd5b80601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600f6020528060005260406000206000915090505481565b612121612bba565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561218f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218690615596565b60405180910390fd5b806005600061219c612bba565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16612249612bba565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161228e9190614019565b60405180910390a35050565b6122a2612bba565b73ffffffffffffffffffffffffffffffffffffffff166122c0611e2e565b73ffffffffffffffffffffffffffffffffffffffff1614612316576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161230d90614afd565b60405180910390fd5b80600b8190555050565b61233161232b612bba565b83612dc0565b612370576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161236790614d1f565b60405180910390fd5b61237b848484610e72565b50505050565b600b5481565b600c5481565b606061239882612b4e565b6123d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123ce90615628565b60405180910390fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c87b56dd836040518263ffffffff1660e01b81526004016124329190614329565b600060405180830381865afa15801561244f573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061247891906156e9565b9050919050565b612487612bba565b73ffffffffffffffffffffffffffffffffffffffff166124a5611e2e565b73ffffffffffffffffffffffffffffffffffffffff16146124fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f290614afd565b60405180910390fd5b80601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600e6020528060005260406000206000915090508060000160009054906101000a900460ff16908060000160019054906101000a900460ff16908060000160029054906101000a900460ff16908060000160039054906101000a900460ff16908060000160049054906101000a900460ff16908060000160059054906101000a900460ff16908060000160069054906101000a900460ff16908060000160079054906101000a900460ff16908060000160089054906101000a900460ff16905089565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461274c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127439061577e565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff166394e56847836040518263ffffffff1660e01b81526004016127859190614329565b61012060405180830381865afa1580156127a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127c791906158c4565b600e600084815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a08201518160000160056101000a81548160ff021916908360ff16021790555060c08201518160000160066101000a81548160ff021916908360ff16021790555060e08201518160000160076101000a81548160ff021916908360ff1602179055506101008201518160000160086101000a81548160ff021916908360ff160217905550905050600d600081819054906101000a900461ffff1680929190612926906152eb565b91906101000a81548161ffff021916908361ffff1602179055505061294b81836134c8565b505050565b612958612bba565b73ffffffffffffffffffffffffffffffffffffffff16612976611e2e565b73ffffffffffffffffffffffffffffffffffffffff16146129cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129c390614afd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612a3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a3390615964565b60405180910390fd5b612a45816134e6565b50565b7f000000000000000000000000000000000000000000000000000000000000c35081565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480612b3757507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80612b475750612b46826135ac565b5b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16612c3583611361565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b612c8361134a565b15612cc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cba90615059565b60405180910390fd5b6001600a60146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612d07612bba565b604051612d149190614193565b60405180910390a1565b612d2661134a565b612d65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5c906159d0565b60405180910390fd5b6000600a60146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612da9612bba565b604051612db69190614193565b60405180910390a1565b6000612dcb82612b4e565b612e0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0190615a62565b60405180910390fd5b6000612e1583611361565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480612e8457508373ffffffffffffffffffffffffffffffffffffffff16612e6c84610b47565b73ffffffffffffffffffffffffffffffffffffffff16145b80612e955750612e948185612628565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16612ebe82611361565b73ffffffffffffffffffffffffffffffffffffffff1614612f14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f0b90615af4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612f84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f7b90615b86565b60405180910390fd5b612f8f838383613616565b612f9a600082612bc2565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612fea9190615ba6565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461304191906150e5565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637d94792a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613169573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061318d919061532b565b3260014361319b9190615ba6565b4042856040516020016131b19493929190615c6e565b6040516020818303038152906040528051906020012060001c189050919050565b6131da613eff565b6131e38261372a565b90506000600f60006131f484613907565b815260200190815260200160002054141561336e5780600e600085815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a08201518160000160056101000a81548160ff021916908360ff16021790555060c08201518160000160066101000a81548160ff021916908360ff16021790555060e08201518160000160076101000a81548160ff021916908360ff1602179055506101008201518160000160086101000a81548160ff021916908360ff16021790555090505082600f600061335784613907565b815260200190815260200160002081905550613383565b6133808361337b846130fa565b6131d2565b90505b92915050565b6000600c54600d60009054906101000a900461ffff1661ffff161115806133c157506000600a60f584901c6133be9190615cbc565b14155b156133d5576133ce612bba565b90506134c3565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639e6dee4a609085901c6040518263ffffffff1660e01b81526004016134369190614329565b602060405180830381865afa158015613453573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134779190615d02565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156134be576134b6612bba565b9150506134c3565b809150505b919050565b6134e282826040518060200160405280600081525061396f565b5050565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b61362183838361397e565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156136645761365f81613983565b6136a3565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146136a2576136a183826139cc565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156136e6576136e181613b39565b613725565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614613724576137238282613c0a565b5b5b505050565b613732613eff565b6000600a61ffff84166137459190615cbc565b14158160000190151590811515815250506000816000015161376857600a61376b565b60005b9050601083901c925061378e61ffff84168260006137899190615d2f565b613c89565b826020019060ff16908160ff1681525050601083901c92506137c061ffff84168260016137bb9190615d2f565b613c89565b826040019060ff16908160ff1681525050601083901c92506137f261ffff84168260026137ed9190615d2f565b613c89565b826080019060ff16908160ff1681525050601083901c925061382461ffff841682600361381f9190615d2f565b613c89565b826060019060ff16908160ff1681525050601083901c925061385661ffff84168260046138519190615d2f565b613c89565b8260e0019060ff16908160ff1681525050601083901c925061388861ffff84168260056138839190615d2f565b613c89565b8260a0019060ff16908160ff1681525050601083901c92508160000151613901576138c361ffff84168260066138be9190615d2f565b613c89565b8260c0019060ff16908160ff16815250506138ee61ffff84168260076138e99190615d2f565b613c89565b82610100019060ff16908160ff16815250505b50919050565b6000816000015182602001518360400151846080015185606001518660a001518760e001518860c0015189610100015160405160200161394f99989796959493929190615dc5565b6040516020818303038152906040528051906020012060001c9050919050565b6139798383613d31565b505050565b505050565b6008805490506009600083815260200190815260200160002081905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550565b600060016139d984611d50565b6139e39190615ba6565b9050600060076000848152602001908152602001600020549050818114613ac8576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816007600083815260200190815260200160002081905550505b6007600084815260200190815260200160002060009055600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b60006001600880549050613b4d9190615ba6565b9050600060096000848152602001908152602001600020549050600060088381548110613b7d57613b7c614f4c565b5b906000526020600020015490508060088381548110613b9f57613b9e614f4c565b5b906000526020600020018190555081600960008381526020019081526020016000208190555060096000858152602001908152602001600020600090556008805480613bee57613bed615e68565b5b6001900381819060005260206000200160009055905550505050565b6000613c1583611d50565b905081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806007600084815260200190815260200160002081905550505050565b6000601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a6b0969284846040518363ffffffff1660e01b8152600401613ce8929190615e97565b602060405180830381865afa158015613d05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d299190615ec0565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613da1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613d9890615f39565b60405180910390fd5b613daa81612b4e565b15613dea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613de190615fa5565b60405180910390fd5b613df660008383613616565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613e4691906150e5565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b604051806101200160405280600015158152602001600060ff168152602001600060ff168152602001600060ff168152602001600060ff168152602001600060ff168152602001600060ff168152602001600060ff168152602001600060ff1681525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b613fae81613f79565b8114613fb957600080fd5b50565b600081359050613fcb81613fa5565b92915050565b600060208284031215613fe757613fe6613f6f565b5b6000613ff584828501613fbc565b91505092915050565b60008115159050919050565b61401381613ffe565b82525050565b600060208201905061402e600083018461400a565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561406e578082015181840152602081019050614053565b8381111561407d576000848401525b50505050565b6000601f19601f8301169050919050565b600061409f82614034565b6140a9818561403f565b93506140b9818560208601614050565b6140c281614083565b840191505092915050565b600060208201905081810360008301526140e78184614094565b905092915050565b6000819050919050565b614102816140ef565b811461410d57600080fd5b50565b60008135905061411f816140f9565b92915050565b60006020828403121561413b5761413a613f6f565b5b600061414984828501614110565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061417d82614152565b9050919050565b61418d81614172565b82525050565b60006020820190506141a86000830184614184565b92915050565b6141b781614172565b81146141c257600080fd5b50565b6000813590506141d4816141ae565b92915050565b6000602082840312156141f0576141ef613f6f565b5b60006141fe848285016141c5565b91505092915050565b6000806040838503121561421e5761421d613f6f565b5b600061422c858286016141c5565b925050602061423d85828601614110565b9150509250929050565b6000819050919050565b600061426c61426761426284614152565b614247565b614152565b9050919050565b600061427e82614251565b9050919050565b600061429082614273565b9050919050565b6142a081614285565b82525050565b60006020820190506142bb6000830184614297565b92915050565b6142ca81613ffe565b81146142d557600080fd5b50565b6000813590506142e7816142c1565b92915050565b60006020828403121561430357614302613f6f565b5b6000614311848285016142d8565b91505092915050565b614323816140ef565b82525050565b600060208201905061433e600083018461431a565b92915050565b60008060006060848603121561435d5761435c613f6f565b5b600061436b868287016141c5565b935050602061437c868287016141c5565b925050604061438d86828701614110565b9150509250925092565b600061ffff82169050919050565b6143ae81614397565b82525050565b60006020820190506143c960008301846143a5565b92915050565b600080604083850312156143e6576143e5613f6f565b5b60006143f485828601614110565b9250506020614405858286016142d8565b9150509250929050565b600061441a82614172565b9050919050565b61442a8161440f565b811461443557600080fd5b50565b60008135905061444781614421565b92915050565b60006020828403121561446357614462613f6f565b5b600061447184828501614438565b91505092915050565b600061448582614273565b9050919050565b6144958161447a565b82525050565b60006020820190506144b0600083018461448c565b92915050565b6144bf81613ffe565b82525050565b600060ff82169050919050565b6144db816144c5565b82525050565b610120820160008201516144f860008501826144b6565b50602082015161450b60208501826144d2565b50604082015161451e60408501826144d2565b50606082015161453160608501826144d2565b50608082015161454460808501826144d2565b5060a082015161455760a08501826144d2565b5060c082015161456a60c08501826144d2565b5060e082015161457d60e08501826144d2565b506101008201516145926101008501826144d2565b50505050565b6000610120820190506145ae60008301846144e1565b92915050565b60006145bf82614273565b9050919050565b6145cf816145b4565b82525050565b60006020820190506145ea60008301846145c6565b92915050565b6000806040838503121561460757614606613f6f565b5b6000614615858286016141c5565b9250506020614626858286016142d8565b9150509250929050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61467282614083565b810181811067ffffffffffffffff821117156146915761469061463a565b5b80604052505050565b60006146a4613f65565b90506146b08282614669565b919050565b600067ffffffffffffffff8211156146d0576146cf61463a565b5b6146d982614083565b9050602081019050919050565b82818337600083830152505050565b6000614708614703846146b5565b61469a565b90508281526020810184848401111561472457614723614635565b5b61472f8482856146e6565b509392505050565b600082601f83011261474c5761474b614630565b5b813561475c8482602086016146f5565b91505092915050565b6000806000806080858703121561477f5761477e613f6f565b5b600061478d878288016141c5565b945050602061479e878288016141c5565b93505060406147af87828801614110565b925050606085013567ffffffffffffffff8111156147d0576147cf613f74565b5b6147dc87828801614737565b91505092959194509250565b60006147f382614172565b9050919050565b614803816147e8565b811461480e57600080fd5b50565b600081359050614820816147fa565b92915050565b60006020828403121561483c5761483b613f6f565b5b600061484a84828501614811565b91505092915050565b61485c816144c5565b82525050565b600061012082019050614878600083018c61400a565b614885602083018b614853565b614892604083018a614853565b61489f6060830189614853565b6148ac6080830188614853565b6148b960a0830187614853565b6148c660c0830186614853565b6148d360e0830185614853565b6148e1610100830184614853565b9a9950505050505050505050565b60006148fa82614273565b9050919050565b61490a816148ef565b82525050565b60006020820190506149256000830184614901565b92915050565b6000806040838503121561494257614941613f6f565b5b6000614950858286016141c5565b9250506020614961858286016141c5565b9150509250929050565b60008060006060848603121561498457614983613f6f565b5b6000614992868287016141c5565b93505060206149a386828701614110565b92505060406149b4868287016141c5565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680614a0557607f821691505b60208210811415614a1957614a186149be565b5b50919050565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b6000614a7b602c8361403f565b9150614a8682614a1f565b604082019050919050565b60006020820190508181036000830152614aaa81614a6e565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000614ae760208361403f565b9150614af282614ab1565b602082019050919050565b60006020820190508181036000830152614b1681614ada565b9050919050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b6000614b7960218361403f565b9150614b8482614b1d565b604082019050919050565b60006020820190508181036000830152614ba881614b6c565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b6000614c0b60388361403f565b9150614c1682614baf565b604082019050919050565b60006020820190508181036000830152614c3a81614bfe565b9050919050565b7f4e6f207265656e7472616e637900000000000000000000000000000000000000600082015250565b6000614c77600d8361403f565b9150614c8282614c41565b602082019050919050565b60006020820190508181036000830152614ca681614c6a565b9050919050565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b6000614d0960318361403f565b9150614d1482614cad565b604082019050919050565b60006020820190508181036000830152614d3881614cfc565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614d79826140ef565b9150614d84836140ef565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614dbd57614dbc614d3f565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000614e02826140ef565b9150614e0d836140ef565b925082614e1d57614e1c614dc8565b5b828204905092915050565b7f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008201527f74206f6620626f756e6473000000000000000000000000000000000000000000602082015250565b6000614e84602b8361403f565b9150614e8f82614e28565b604082019050919050565b60006020820190508181036000830152614eb381614e77565b9050919050565b7f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008201527f7574206f6620626f756e64730000000000000000000000000000000000000000602082015250565b6000614f16602c8361403f565b9150614f2182614eba565b604082019050919050565b60006020820190508181036000830152614f4581614f09565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b6000614fd760298361403f565b9150614fe282614f7b565b604082019050919050565b6000602082019050818103600083015261500681614fca565b9050919050565b7f506175736561626c653a20706175736564000000000000000000000000000000600082015250565b600061504360118361403f565b915061504e8261500d565b602082019050919050565b6000602082019050818103600083015261507281615036565b9050919050565b7f4f6e6c7920454f41000000000000000000000000000000000000000000000000600082015250565b60006150af60088361403f565b91506150ba82615079565b602082019050919050565b600060208201905081810360008301526150de816150a2565b9050919050565b60006150f0826140ef565b91506150fb836140ef565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156151305761512f614d3f565b5b828201905092915050565b7f416c6c20746f6b656e73206d696e746564000000000000000000000000000000600082015250565b600061517160118361403f565b915061517c8261513b565b602082019050919050565b600060208201905081810360008301526151a081615164565b9050919050565b7f496e76616c6964206d696e7420616d6f756e7400000000000000000000000000600082015250565b60006151dd60138361403f565b91506151e8826151a7565b602082019050919050565b6000602082019050818103600083015261520c816151d0565b9050919050565b7f416c6c20746f6b656e73206f6e2d73616c6520616c726561647920736f6c6400600082015250565b6000615249601f8361403f565b915061525482615213565b602082019050919050565b600060208201905081810360008301526152788161523c565b9050919050565b7f496e76616c6964207061796d656e7420616d6f756e7400000000000000000000600082015250565b60006152b560168361403f565b91506152c08261527f565b602082019050919050565b600060208201905081810360008301526152e4816152a8565b9050919050565b60006152f682614397565b915061ffff82141561530b5761530a614d3f565b5b600182019050919050565b600081519050615325816140f9565b92915050565b60006020828403121561534157615340613f6f565b5b600061534f84828501615316565b91505092915050565b6000615363826140ef565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561539657615395614d3f565b5b600182019050919050565b60006040820190506153b66000830185614184565b6153c3602083018461431a565b9392505050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6153ff81614397565b82525050565b600061541183836153f6565b60208301905092915050565b6000602082019050919050565b6000615435826153ca565b61543f81856153d5565b935061544a836153e6565b8060005b8381101561547b5781516154628882615405565b975061546d8361541d565b92505060018101905061544e565b5085935050505092915050565b600060408201905061549d6000830185614184565b81810360208301526154af818461542a565b90509392505050565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b6000615514602a8361403f565b915061551f826154b8565b604082019050919050565b6000602082019050818103600083015261554381615507565b9050919050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b600061558060198361403f565b915061558b8261554a565b602082019050919050565b600060208201905081810360008301526155af81615573565b9050919050565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b6000615612602f8361403f565b915061561d826155b6565b604082019050919050565b6000602082019050818103600083015261564181615605565b9050919050565b600067ffffffffffffffff8211156156635761566261463a565b5b61566c82614083565b9050602081019050919050565b600061568c61568784615648565b61469a565b9050828152602081018484840111156156a8576156a7614635565b5b6156b3848285614050565b509392505050565b600082601f8301126156d0576156cf614630565b5b81516156e0848260208601615679565b91505092915050565b6000602082840312156156ff576156fe613f6f565b5b600082015167ffffffffffffffff81111561571d5761571c613f74565b5b615729848285016156bb565b91505092915050565b7f4f6e6c7920737761707065720000000000000000000000000000000000000000600082015250565b6000615768600c8361403f565b915061577382615732565b602082019050919050565b600060208201905081810360008301526157978161575b565b9050919050565b600080fd5b6000815190506157b2816142c1565b92915050565b6157c1816144c5565b81146157cc57600080fd5b50565b6000815190506157de816157b8565b92915050565b600061012082840312156157fb576157fa61579e565b5b61580661012061469a565b90506000615816848285016157a3565b600083015250602061582a848285016157cf565b602083015250604061583e848285016157cf565b6040830152506060615852848285016157cf565b6060830152506080615866848285016157cf565b60808301525060a061587a848285016157cf565b60a08301525060c061588e848285016157cf565b60c08301525060e06158a2848285016157cf565b60e0830152506101006158b7848285016157cf565b6101008301525092915050565b600061012082840312156158db576158da613f6f565b5b60006158e9848285016157e4565b91505092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061594e60268361403f565b9150615959826158f2565b604082019050919050565b6000602082019050818103600083015261597d81615941565b9050919050565b7f506175736561626c653a206e6f74207061757365640000000000000000000000600082015250565b60006159ba60158361403f565b91506159c582615984565b602082019050919050565b600060208201905081810360008301526159e9816159ad565b9050919050565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b6000615a4c602c8361403f565b9150615a57826159f0565b604082019050919050565b60006020820190508181036000830152615a7b81615a3f565b9050919050565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008201527f73206e6f74206f776e0000000000000000000000000000000000000000000000602082015250565b6000615ade60298361403f565b9150615ae982615a82565b604082019050919050565b60006020820190508181036000830152615b0d81615ad1565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000615b7060248361403f565b9150615b7b82615b14565b604082019050919050565b60006020820190508181036000830152615b9f81615b63565b9050919050565b6000615bb1826140ef565b9150615bbc836140ef565b925082821015615bcf57615bce614d3f565b5b828203905092915050565b60008160601b9050919050565b6000615bf282615bda565b9050919050565b6000615c0482615be7565b9050919050565b615c1c615c1782614172565b615bf9565b82525050565b6000819050919050565b6000819050919050565b615c47615c4282615c22565b615c2c565b82525050565b6000819050919050565b615c68615c63826140ef565b615c4d565b82525050565b6000615c7a8287615c0b565b601482019150615c8a8286615c36565b602082019150615c9a8285615c57565b602082019150615caa8284615c57565b60208201915081905095945050505050565b6000615cc7826140ef565b9150615cd2836140ef565b925082615ce257615ce1614dc8565b5b828206905092915050565b600081519050615cfc816141ae565b92915050565b600060208284031215615d1857615d17613f6f565b5b6000615d2684828501615ced565b91505092915050565b6000615d3a826144c5565b9150615d45836144c5565b92508260ff03821115615d5b57615d5a614d3f565b5b828201905092915050565b60008160f81b9050919050565b6000615d7e82615d66565b9050919050565b6000615d9082615d73565b9050919050565b615da8615da382613ffe565b615d85565b82525050565b615dbf615dba826144c5565b615d73565b82525050565b6000615dd1828c615d97565b600182019150615de1828b615dae565b600182019150615df1828a615dae565b600182019150615e018289615dae565b600182019150615e118288615dae565b600182019150615e218287615dae565b600182019150615e318286615dae565b600182019150615e418285615dae565b600182019150615e518284615dae565b6001820191508190509a9950505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6000604082019050615eac60008301856143a5565b615eb96020830184614853565b9392505050565b600060208284031215615ed657615ed5613f6f565b5b6000615ee4848285016157cf565b91505092915050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b6000615f2360208361403f565b9150615f2e82615eed565b602082019050919050565b60006020820190508181036000830152615f5281615f16565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b6000615f8f601c8361403f565b9150615f9a82615f59565b602082019050919050565b60006020820190508181036000830152615fbe81615f82565b905091905056fea26469706673582212201771e72c671735575fb67b2d845a707876842de4d3749a81a1db1fe414251c7864736f6c634300080a0033

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

0000000000000000000000007f041ce89a2079873693207653b24c15b5e6a29300000000000000000000000087cbe78985a3d87bb9e0b3e856787ecff2209475000000000000000000000000000000000000000000000000000000000000c350

-----Decoded View---------------
Arg [0] : _loot (address): 0x7f041ce89A2079873693207653b24C15B5e6A293
Arg [1] : _traits (address): 0x87CbE78985A3d87bB9E0b3e856787ecFF2209475
Arg [2] : _maxTokens (uint256): 50000

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000007f041ce89a2079873693207653b24c15b5e6a293
Arg [1] : 00000000000000000000000087cbe78985a3d87bb9e0b3e856787ecff2209475
Arg [2] : 000000000000000000000000000000000000000000000000000000000000c350


Block Transaction Gas Used Reward
view all blocks ##produced##

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.