ETH Price: $3,710.07 (+4.15%)

Contract

0x9dbB5e6E543c84cdf5C1d79A9379962ab3A44568
 

Overview

ETH Balance

0.0416 ETH

Eth Value

$154.34 (@ $3,710.07/ETH)

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Mint210246122024-10-23 0:10:4738 days ago1729642247IN
0x9dbB5e6E...ab3A44568
0.009 ETH0.003061247.73582976
Withdraw Funds199171412024-05-21 8:38:23192 days ago1716280703IN
0x9dbB5e6E...ab3A44568
0 ETH0.000433219.79762309
Mint199171242024-05-21 8:34:59192 days ago1716280499IN
0x9dbB5e6E...ab3A44568
0.006 ETH0.0029655510.65993787
Withdraw Funds195057042024-03-24 16:52:47250 days ago1711299167IN
0x9dbB5e6E...ab3A44568
0 ETH0.0010895524.64166229
Mint194724632024-03-20 0:50:47255 days ago1710895847IN
0x9dbB5e6E...ab3A44568
0.003 ETH0.0052174529.349641
Mint194723552024-03-20 0:28:59255 days ago1710894539IN
0x9dbB5e6E...ab3A44568
0.003 ETH0.0065245433.4816978
Withdraw Funds194648882024-03-18 23:18:11256 days ago1710803891IN
0x9dbB5e6E...ab3A44568
0 ETH0.0016688327.21688738
Mint194611332024-03-18 10:37:35256 days ago1710758255IN
0x9dbB5e6E...ab3A44568
0.012 ETH0.0131761824.8443134
Create Collectio...194610742024-03-18 10:25:47256 days ago1710757547IN
0x9dbB5e6E...ab3A44568
0 ETH0.0075394222.58205525
Create Collectio...194477112024-03-16 13:19:47258 days ago1710595187IN
0x9dbB5e6E...ab3A44568
0 ETH0.0121317136.62426615
Withdraw Funds193500842024-03-02 21:11:11272 days ago1709413871IN
0x9dbB5e6E...ab3A44568
0 ETH0.0018829242.58472837
Mint192443262024-02-17 1:29:47287 days ago1708133387IN
0x9dbB5e6E...ab3A44568
0.0002 ETH0.0033390518.78609407
Create Collectio...192249022024-02-14 8:05:11289 days ago1707897911IN
0x9dbB5e6E...ab3A44568
0 ETH0.0071785421.6727947
Mint191237672024-01-31 3:23:11304 days ago1706671391IN
0x9dbB5e6E...ab3A44568
0.0002 ETH0.003264618.36717952
Mint190679262024-01-23 7:35:59311 days ago1705995359IN
0x9dbB5e6E...ab3A44568
0.0002 ETH0.0030023715.4093399
Mint190678142024-01-23 7:13:11311 days ago1705993991IN
0x9dbB5e6E...ab3A44568
0.0002 ETH0.0022283111.43658672
Mint190677062024-01-23 6:51:11311 days ago1705992671IN
0x9dbB5e6E...ab3A44568
0.0002 ETH0.0023789312.21035861
Mint190676782024-01-23 6:45:23311 days ago1705992323IN
0x9dbB5e6E...ab3A44568
0.0002 ETH0.0021599312.15214597
Mint190670332024-01-23 4:34:35312 days ago1705984475IN
0x9dbB5e6E...ab3A44568
0.0002 ETH0.0023223211.91907686
Mint190670092024-01-23 4:29:47312 days ago1705984187IN
0x9dbB5e6E...ab3A44568
0.0002 ETH0.0022263410.50457312
Set Price190669972024-01-23 4:27:23312 days ago1705984043IN
0x9dbB5e6E...ab3A44568
0 ETH0.0003165510.63902724
Set Status190669822024-01-23 4:24:23312 days ago1705983863IN
0x9dbB5e6E...ab3A44568
0 ETH0.000351611.79734744
Create Collectio...190669762024-01-23 4:23:11312 days ago1705983791IN
0x9dbB5e6E...ab3A44568
0 ETH0.0035066410.58655878
Create Collectio...190669352024-01-23 4:14:59312 days ago1705983299IN
0x9dbB5e6E...ab3A44568
0 ETH0.0035816210.81331389
Withdraw Funds190583982024-01-21 23:20:59313 days ago1705879259IN
0x9dbB5e6E...ab3A44568
0 ETH0.000860514.0338905
View all transactions

Latest 19 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
199171412024-05-21 8:38:23192 days ago1716280703
0x9dbB5e6E...ab3A44568
0.012 ETH
195057042024-03-24 16:52:47250 days ago1711299167
0x9dbB5e6E...ab3A44568
0.025 ETH
194648882024-03-18 23:18:11256 days ago1710803891
0x9dbB5e6E...ab3A44568
0.012 ETH
193500842024-03-02 21:11:11272 days ago1709413871
0x9dbB5e6E...ab3A44568
0.14 ETH
190583982024-01-21 23:20:59313 days ago1705879259
0x9dbB5e6E...ab3A44568
0.125 ETH
187071232023-12-03 16:42:35362 days ago1701621755
0x9dbB5e6E...ab3A44568
0.006 ETH
186854752023-11-30 16:01:23365 days ago1701360083
0x9dbB5e6E...ab3A44568
0.08 ETH
186814902023-11-30 2:37:59366 days ago1701311879
0x9dbB5e6E...ab3A44568
0.12 ETH
186691522023-11-28 9:12:35367 days ago1701162755
0x9dbB5e6E...ab3A44568
0.012 ETH
186676452023-11-28 4:08:23368 days ago1701144503
0x9dbB5e6E...ab3A44568
0.2 ETH
186074682023-11-19 17:52:59376 days ago1700416379
0x9dbB5e6E...ab3A44568
0.025 ETH
186073492023-11-19 17:29:11376 days ago1700414951
0x9dbB5e6E...ab3A44568
0.11 ETH
186044502023-11-19 7:44:59376 days ago1700379899
0x9dbB5e6E...ab3A44568
2.555 ETH
185994772023-11-18 15:00:11377 days ago1700319611
0x9dbB5e6E...ab3A44568
0.08 ETH
185994712023-11-18 14:58:59377 days ago1700319539
0x9dbB5e6E...ab3A44568
0.08 ETH
185994612023-11-18 14:56:59377 days ago1700319419
0x9dbB5e6E...ab3A44568
0.08 ETH
185994512023-11-18 14:54:59377 days ago1700319299
0x9dbB5e6E...ab3A44568
0.08 ETH
185962772023-11-18 4:11:23378 days ago1700280683
0x9dbB5e6E...ab3A44568
1.795 ETH
185934362023-11-17 18:38:23378 days ago1700246303
0x9dbB5e6E...ab3A44568
0.65 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
EmpropsCollectionContract

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
No with 200 runs

Other Settings:
paris EvmVersion
File 1 of 21 : collection-contract.sol
// SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/access/Ownable2Step.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./token-contract.sol";
pragma solidity 0.8.18;

contract EmpropsCollectionContract is Ownable2Step, ReentrancyGuard, Pausable {
    bool public creatorsOnly;
    uint256 private constant ONE_MILLION = 1e6;
    uint256 public collectionIdCount;
    address[] public creators;
    Origen public origen = Origen.CURATED;
    PlatformConfig public platformConfig;

    enum MintMode {
        PUBLIC,
        ALLOWLIST,
        FREELIST
    }

    enum Origen {
        OPEN,
        CURATED
    }

    constructor(
        bool isCreatorsOnly,
        address[] memory listCreators,
        Origen _origen,
        uint256 initialCollectionId,
        PlatformConfig memory config
    ) {
        creatorsOnly = isCreatorsOnly;
        creators = listCreators;
        origen = _origen;
        platformConfig = config;
        collectionIdCount = initialCollectionId;
    }

    struct Collection {
        address author;
        uint256 price;
        uint64 editions;
        address royaltyAddress;
        uint16 royalty;
        address freeMinter;
        uint8 status;
        string metadata;
        MintMode mintMode;
        bytes32 allowlist;
        bytes32 freelist;
        address tokenContractAddress;
    }

    struct PlatformConfig {
        uint32 maxCollectionSize;
        uint256 minMintPrice;
        uint32 maxBatchMintSize;
    }

    struct CollectionConfig {
        bool enableBatchMint;
        uint64 maxBatchMintAllowed;
        uint256 startDate;
        uint256 endDate;
    }

    struct FundReceiver {
        address addr;
        uint16 rate;
    }

    struct AccountInfo {
        uint32 allowlistCount;
        uint32 freelistCount;
        uint256 fundsClaimed;
        uint16 rate;
    }

    event CollectionCreated(
        uint256 id,
        address author,
        uint256 price,
        uint64 editions,
        uint16 royalty,
        address freeMinter,
        uint8 status,
        string metadata,
        address tokenContractAddress
    );

    mapping(uint256 => Collection) public collections;
    mapping(uint256 => CollectionConfig) public collectionsConfig;
    mapping(uint256 => uint256) public mintCount;
    mapping(uint256 => uint256) public fundsCollected;
    mapping(uint256 => mapping(address => AccountInfo)) public accounts;

    // MODIFIERS
    function _onlyAdmin(uint256 collectionId) internal view {
        require(
            collections[collectionId].author == _msgSender() ||
                owner() == _msgSender(),
            "Only admin"
        );
    }

    function _existCollection(uint256 collectionId) internal view {
        require(
            collections[collectionId].author != address(0x0),
            "Collection does not exists"
        );
    }

    function _verifyMint(
        uint256 collectionId,
        uint64 quantityToMint
    ) internal view {
        CollectionConfig memory config = collectionsConfig[collectionId];

        require(
            collections[collectionId].author != address(0x0),
            "Collection does not exists"
        );

        // Status check
        require(collections[collectionId].status == 1, "Mint disabled");

        // Supply checks
        require(
            collections[collectionId].editions >=
                mintCount[collectionId] + quantityToMint,
            "Collection minted out"
        );
        if (config.enableBatchMint) {
            require(
                quantityToMint <= config.maxBatchMintAllowed,
                "Quantity to mint is execeeded"
            );
        } else {
            require(quantityToMint == 1, "Batch mint is disabled");
        }

        // Dates checks
        require(block.timestamp > config.startDate, "Mint disabled");

        if (config.endDate != 0) {
            require(block.timestamp < config.endDate, "Mint finished");
        }
    }

    // MESSAGES
    function setPaused(bool paused) external onlyOwner {
        if (paused == true) {
            _pause();
        } else {
            _unpause();
        }
    }

    function setPlatformConfig(
        PlatformConfig calldata config
    ) external onlyOwner {
        platformConfig = config;
    }

    function setCreators(address[] memory newCreators) external onlyOwner {
        creators = newCreators;
    }

    function createCollection(
        Collection memory collection,
        CollectionConfig memory collectionConfig,
        FundReceiver[] memory primarySaleReceivers
    ) external {
        _requireNotPaused();
        require(
            collection.royalty <= 10000,
            "royalty overflows max percentage"
        );
        require(collection.author != address(0x0), "Invalid author address");
        require(
            collection.editions < platformConfig.maxCollectionSize + 1,
            "Invalid editions"
        );
        require(
            collection.price > platformConfig.minMintPrice - 1,
            "Invalid price"
        );
        if (collectionConfig.enableBatchMint == true) {
            require(
                collectionConfig.maxBatchMintAllowed > 1 &&
                    collectionConfig.maxBatchMintAllowed <
                    platformConfig.maxBatchMintSize + 1,
                "Invalid batch size"
            );
        }

        if (collection.royaltyAddress == address(0x0)) {
            collection.royaltyAddress = collection.author;
        }

        if (collectionConfig.startDate == 0) {
            collectionConfig.startDate = block.timestamp;
        }

        if (collectionConfig.endDate != 0) {
            require(
                collectionConfig.endDate > collectionConfig.startDate,
                "Invalid endDate"
            );
        }

        if (creatorsOnly) {
            bool isCreator = false;
            uint256 cl = creators.length;
            for (uint256 i = 0; i < cl; ) {
                if (creators[i] == _msgSender()) {
                    isCreator = true;
                }
                unchecked {
                    ++i;
                }
            }
            require(isCreator, "Only creators allowed");
        }

        // Make sure total rates are equal to 10_000
        uint256 collector = 0;
        uint256 rl = primarySaleReceivers.length;
        for (uint256 i = 0; i < rl; ) {
            FundReceiver memory receiver = primarySaleReceivers[i];
            collector = collector + receiver.rate;

            accounts[collectionIdCount][receiver.addr].rate = receiver.rate;

            unchecked {
                ++i;
            }
        }

        require(collector == 10000, "Primary sales must be 100%");

        collections[collectionIdCount] = collection;
        collectionsConfig[collectionIdCount] = collectionConfig;
        mintCount[collectionIdCount] = 0;

        emit CollectionCreated(
            collectionIdCount,
            collection.author,
            collection.price,
            collection.editions,
            collection.royalty,
            collection.freeMinter,
            collection.status,
            collection.metadata,
            collection.tokenContractAddress
        );

        collectionIdCount = collectionIdCount + 1;
    }

    function setStatus(uint256 collectionId, uint8 status) external {
        _onlyAdmin(collectionId);
        _existCollection(collectionId);
        collections[collectionId].status = status;
    }

    function setTotalEditions(
        uint256 collectionId,
        uint64 newEditions
    ) external {
        _onlyAdmin(collectionId);
        _existCollection(collectionId);
        require(
            newEditions < collections[collectionId].editions,
            "Cannot increase supply"
        );
        require(
            newEditions >= mintCount[collectionId],
            "Invalid editions number"
        );

        collections[collectionId].editions = newEditions;
    }

    function setPrice(uint256 collectionId, uint256 price) external {
        _onlyAdmin(collectionId);
        _existCollection(collectionId);
        collections[collectionId].price = price;
    }

    function setMode(uint256 collectionId, MintMode mode) external {
        _onlyAdmin(collectionId);
        _existCollection(collectionId);
        collections[collectionId].mintMode = mode;
    }

    function setAllowlist(uint256 collectionId, bytes32 allowlist) external {
        _onlyAdmin(collectionId);
        _existCollection(collectionId);
        collections[collectionId].allowlist = allowlist;
    }

    function setFreelist(uint256 collectionId, bytes32 freelist) external {
        _onlyAdmin(collectionId);
        _existCollection(collectionId);
        collections[collectionId].freelist = freelist;
    }

    function setFreeMinter(uint256 collectionId, address freeMinter) external {
        _onlyAdmin(collectionId);
        _existCollection(collectionId);
        collections[collectionId].freeMinter = freeMinter;
    }

    function mint(
        uint256 collectionId,
        address owner,
        bytes32[] calldata proof,
        uint32 quantityToMint,
        uint32 maxQuantityAllowed
    ) external payable nonReentrant {
        _verifyMint(collectionId, quantityToMint);
        require(
            msg.value == (collections[collectionId].price * quantityToMint),
            "Insufficient funds"
        );
        require(
            collections[collectionId].mintMode != MintMode.FREELIST,
            "Invalid mint mode"
        );

        if (collections[collectionId].mintMode == MintMode.ALLOWLIST) {
            bytes32 leaf = keccak256(
                abi.encodePacked(owner, maxQuantityAllowed)
            );
            require(
                MerkleProof.verify(
                    proof,
                    collections[collectionId].allowlist,
                    leaf
                ),
                "Invalid proof"
            );
            uint32 count = accounts[collectionId][owner].allowlistCount +
                quantityToMint;
            // Checks sender has mints remaining
            require(count <= maxQuantityAllowed, "User supply minted out");

            // Increase sender's count
            accounts[collectionId][owner].allowlistCount = count;
        }

        _mintTokens(collectionId, owner, quantityToMint);

        fundsCollected[collectionId] = fundsCollected[collectionId] + msg.value;
    }

    function freeMint(
        uint256 collectionId,
        address owner,
        bytes32[] calldata proof,
        uint32 quantityToMint,
        uint32 maxQuantityAllowed
    ) external nonReentrant {
        _verifyMint(collectionId, quantityToMint);

        if (collections[collectionId].freeMinter != _msgSender()) {
            require(
                collections[collectionId].mintMode == MintMode.FREELIST,
                "Invalid mint mode"
            );

            bytes32 leaf = keccak256(
                abi.encodePacked(msg.sender, maxQuantityAllowed)
            );
            require(
                MerkleProof.verify(
                    proof,
                    collections[collectionId].freelist,
                    leaf
                ),
                "Invalid proof"
            );
            uint32 minted = accounts[collectionId][msg.sender].freelistCount;
            uint32 count = minted + quantityToMint;
            // Checks sender has mints remaining
            require(count <= maxQuantityAllowed, "User supply minted out");

            // Increase sender's count
            accounts[collectionId][msg.sender].freelistCount =
                minted +
                quantityToMint;
        }

        _mintTokens(collectionId, owner, quantityToMint);
    }

    function _mintTokens(
        uint256 collectionId,
        address owner,
        uint32 quantity
    ) internal {
        uint256 collectionMintCount = mintCount[collectionId];

        EmpropsTokenContract token = EmpropsTokenContract(
            collections[collectionId].tokenContractAddress
        );
        for (
            uint256 i = collectionMintCount + 1;
            i <= collectionMintCount + quantity;

        ) {
            uint256 thisTokenId = (collectionId * ONE_MILLION) + i;
            token.mint(
                owner,
                thisTokenId,
                collections[collectionId].royaltyAddress,
                collections[collectionId].royalty
            );

            unchecked {
                ++i;
            }
        }

        mintCount[collectionId] = collectionMintCount + uint256(quantity);
    }

    function withdrawFunds(uint256 collectionId) external nonReentrant {
        _existCollection(collectionId);
        uint16 rate = accounts[collectionId][msg.sender].rate;

        require(rate != 0, "invalid rate");

        // Verify there are funds to split
        uint256 funds = fundsCollected[collectionId];
        uint256 claimed = accounts[collectionId][msg.sender].fundsClaimed;
        uint256 amount = ((funds * rate) / 10000) - claimed;

        require(amount != 0, "No funds collected yet");
        // Send ether to receiver's address
        (bool success, ) = payable(msg.sender).call{value: amount}("");
        require(success, "Transfer failed");

        accounts[collectionId][msg.sender].fundsClaimed = claimed + amount;
    }
}

File 2 of 21 : token-contract.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable2Step.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@manifoldxyz/royalty-registry-solidity/contracts/overrides/RoyaltyOverrideCore.sol";

interface IConduitController {
    function getKey(address conduit) external view returns (bytes32);
}

contract EmpropsTokenContract is
    ERC721,
    Ownable2Step,
    EIP2981RoyaltyOverrideCore
{
    address[] private _seaports = [0x00000000006c3852cbEf3e08E8dF289169EdE581];
    address[] private _conduitControllers = [
        0x00000000F9490004C11Cef243f5400493c00Ad63
    ];

    bool public enableBlockOpenSea = true;
    uint256 public _mintCount;
    string public baseTokenURI;
    address public minter;
    uint64 public maxSupply;
    mapping(uint256 => string) public dm;

    struct LockTokenMetadata {
        uint256 tokenId;
        string metadataLink;
    }

    constructor(
        string memory name,
        string memory symbol,
        uint64 newMaxSupply
    ) ERC721(name, symbol) {
        maxSupply = newMaxSupply;
    }

    function _requireNotOpenSea(address to) internal view {
        if (enableBlockOpenSea) {
            for (uint256 i = 0; i < _seaports.length; ) {
                // Check spender isn't Seaport.
                require(to != _seaports[i], "OPENSEA NOT ALLOWED");

                unchecked {
                    ++i;
                }
            }

            for (uint256 i = 0; i < _conduitControllers.length; ) {
                // Check spender isn't a conduit.
                // First we call the controller for the corresponding key:
                // - if(success) -> the address is a valid conduit
                // - else        -> the address isn't a conduit
                (bool success, ) = _conduitControllers[i].staticcall(
                    abi.encodeWithSelector(
                        IConduitController.getKey.selector,
                        to
                    )
                );
                require(!success, "OPENSEA NOT ALLOWED");

                unchecked {
                    ++i;
                }
            }
        }
    }

    // OVERRIDES
    function _baseURI() internal view virtual override returns (string memory) {
        return baseTokenURI;
    }

    function tokenURI(
        uint256 tokenId
    ) public view virtual override returns (string memory) {
        _requireMinted(tokenId);

        string memory baseURI = _baseURI();
        if (bytes(dm[tokenId]).length != 0) {
            return dm[tokenId];
        }

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

    function approve(address to, uint256 tokenId) public virtual override {
        _requireNotOpenSea(to);
        super.approve(to, tokenId);
    }

    function setApprovalForAll(
        address operator,
        bool approved
    ) public virtual override {
        _requireNotOpenSea(operator);
        super.setApprovalForAll(operator, approved);
    }

    // MESSAGES
    function setOpenSeaports(address[] calldata addresses) external onlyOwner {
        _seaports = addresses;
    }

    function setCoduitControllers(
        address[] calldata addresses
    ) external onlyOwner {
        _conduitControllers = addresses;
    }

    function setBlockOpenSea(bool blockOpenSea) external onlyOwner {
        enableBlockOpenSea = blockOpenSea;
    }

    function lockMetadata(
        uint256 tokenId,
        string memory metadataLink
    ) external {
        require(
            _ownerOf(tokenId) == msg.sender,
            "ERC721: sender is not the owner"
        );
        dm[tokenId] = metadataLink;
    }

    function batchLockMetadata(LockTokenMetadata[] calldata tokens) external {
        uint256 length = tokens.length;
        for (uint256 i = 0; i < length; ) {
            uint256 tokenId = tokens[i].tokenId;
            require(
                _ownerOf(tokenId) == msg.sender,
                "ERC721: sender is not the owner"
            );
            dm[tokenId] = tokens[i].metadataLink;

            unchecked {
                ++i;
            }
        }
    }

    function updateMaxSupply(uint64 newMaxSupply) external onlyOwner {
        maxSupply = newMaxSupply;
    }

    function setBaseTokenURI(string memory newBaseUri) external onlyOwner {
        baseTokenURI = newBaseUri;
    }

    function setMinter(address newMinter) external onlyOwner {
        minter = newMinter;
    }

    function mint(
        address owner,
        uint256 tokenId,
        address author,
        uint16 bps
    ) external {
        require(msg.sender == minter, "Sender not minter");
        require(_mintCount < maxSupply, "Max supply exceeded");
        _safeMint(owner, tokenId);

        // Increment counter
        _mintCount = _mintCount + 1;

        // Set royalties
        TokenRoyaltyConfig[] memory royaltyConfigs = new TokenRoyaltyConfig[](
            1
        );
        royaltyConfigs[0] = TokenRoyaltyConfig(tokenId, author, bps);
        _setTokenRoyalties(royaltyConfigs);
    }

    // ROYALTIES
    function setTokenRoyalties(
        TokenRoyaltyConfig[] calldata royaltyConfigs
    ) external override onlyOwner {
        _setTokenRoyalties(royaltyConfigs);
    }

    function setDefaultRoyalty(
        TokenRoyalty calldata royalty
    ) external override onlyOwner {
        _setDefaultRoyalty(royalty);
    }

    function supportsInterface(
        bytes4 interfaceId
    )
        public
        view
        virtual
        override(ERC721, EIP2981RoyaltyOverrideCore)
        returns (bool)
    {
        return
            ERC721.supportsInterface(interfaceId) ||
            EIP2981RoyaltyOverrideCore.supportsInterface(interfaceId);
    }

    // Queries
    function getTokensOf(
        address _owner,
        uint256 _collectionId,
        uint256 _maxSupply
    ) public view returns (uint256[] memory) {
        uint256 m = 1e6;

        uint256 ownerTokenCount = balanceOf(_owner);
        uint256[] memory ownerTokens = new uint256[](ownerTokenCount);

        uint256 ownerTokenIdx = 0;
        uint256 maxTokenAvailable = (_collectionId * m) + _maxSupply;
        for (
            uint256 tokenIdx = _collectionId * m;
            tokenIdx <= maxTokenAvailable;

        ) {
            if (_ownerOf(tokenIdx) == _owner) {
                ownerTokens[ownerTokenIdx] = tokenIdx;
                unchecked {
                    ++ownerTokenIdx;
                }
            }

            unchecked {
                ++tokenIdx;
            }
        }
        return ownerTokens;
    }
}

File 3 of 21 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

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

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

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

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

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

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

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

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

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

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

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

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

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

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

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

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

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

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

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

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

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

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

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

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

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

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

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

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

        return result;
    }
}

File 4 of 21 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 7 of 21 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The tree and the proofs can be generated using our
 * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
 * You will find a quickstart guide in the readme.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the merkle tree could be reinterpreted as a leaf value.
 * OpenZeppelin's JavaScript library generates merkle trees that are safe
 * against this attack out of the box.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

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

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

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

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

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

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

        // Check proof validity.
        require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");

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

        if (totalHashes > 0) {
            return hashes[totalHashes - 1];
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

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

        // Check proof validity.
        require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");

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

        if (totalHashes > 0) {
            return hashes[totalHashes - 1];
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
        return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 8 of 21 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @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] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

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

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 10 of 21 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or 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 {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 12 of 21 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

File 13 of 21 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must 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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

File 14 of 21 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _ownerOf(tokenId);
        require(owner != address(0), "ERC721: invalid token ID");
        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) {
        _requireMinted(tokenId);

        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 overridden 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 token owner or approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        return _tokenApprovals[tokenId];
    }

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

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or 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: caller is not token owner or approved");
        _safeTransfer(from, to, tokenId, data);
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

    /**
     * @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 _ownerOf(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) {
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
    }

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

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

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

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

        // Check that tokenId was not minted by `_beforeTokenTransfer` hook
        require(!_exists(tokenId), "ERC721: token already minted");

        unchecked {
            // Will not overflow unless all 2**256 token ids are minted to the same owner.
            // Given that tokens are minted one by one, it is impossible in practice that
            // this ever happens. Might change if we allow batch minting.
            // The ERC fails to describe this case.
            _balances[to] += 1;
        }

        _owners[tokenId] = to;

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

        _afterTokenTransfer(address(0), to, tokenId, 1);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

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

        // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
        owner = ERC721.ownerOf(tokenId);

        // Clear approvals
        delete _tokenApprovals[tokenId];

        unchecked {
            // Cannot overflow, as that would require more tokens to be burned/transferred
            // out than the owner initially received through minting and transferring in.
            _balances[owner] -= 1;
        }
        delete _owners[tokenId];

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

        _afterTokenTransfer(owner, address(0), tokenId, 1);
    }

    /**
     * @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 from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId, 1);

        // Check that tokenId was not transferred by `_beforeTokenTransfer` hook
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");

        // Clear approvals from the previous owner
        delete _tokenApprovals[tokenId];

        unchecked {
            // `_balances[from]` cannot overflow for the same reason as described in `_burn`:
            // `from`'s balance is the number of token held, which is at least one before the current
            // transfer.
            // `_balances[to]` could overflow in the conditions described in `_mint`. That would require
            // all 2**256 token ids to be minted, which in practice is impossible.
            _balances[from] -= 1;
            _balances[to] += 1;
        }
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId, 1);
    }

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

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

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

    /**
     * @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 {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
     * - When `from` is zero, the tokens will be minted for `to`.
     * - When `to` is zero, ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256, /* firstTokenId */
        uint256 batchSize
    ) internal virtual {
        if (batchSize > 1) {
            if (from != address(0)) {
                _balances[from] -= batchSize;
            }
            if (to != address(0)) {
                _balances[to] += batchSize;
            }
        }
    }

    /**
     * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
     * - When `from` is zero, the tokens were minted for `to`.
     * - When `to` is zero, ``from``'s tokens were burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual {}
}

File 15 of 21 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

File 16 of 21 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @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 unpaused state.
     */
    constructor() {
        _paused = false;
    }

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

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

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

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: 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 17 of 21 : Ownable2Step.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.0;

import "./Ownable.sol";

/**
 * @dev Contract module which provides 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} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2Step is Ownable {
    address private _pendingOwner;

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

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

    /**
     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual override onlyOwner {
        _pendingOwner = newOwner;
        emit OwnershipTransferStarted(owner(), newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual override {
        delete _pendingOwner;
        super._transferOwnership(newOwner);
    }

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() external {
        address sender = _msgSender();
        require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner");
        _transferOwnership(sender);
    }
}

File 18 of 21 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

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

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

File 19 of 21 : IEIP2981.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * EIP-2981
 */
interface IEIP2981 {
    /**
     * bytes4(keccak256("royaltyInfo(uint256,uint256)")) == 0x2a55205a
     *
     * => 0x2a55205a = 0x2a55205a
     */
    function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address, uint256);
}

File 20 of 21 : RoyaltyOverrideCore.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

import "./IRoyaltyOverride.sol";
import "../specs/IEIP2981.sol";

/**
 * Simple EIP2981 reference override implementation
 */
abstract contract EIP2981RoyaltyOverrideCore is IEIP2981, IEIP2981RoyaltyOverride, ERC165 {
    using EnumerableSet for EnumerableSet.UintSet;

    TokenRoyalty public defaultRoyalty;
    mapping(uint256 => TokenRoyalty) private _tokenRoyalties;
    EnumerableSet.UintSet private _tokensWithRoyalties;

    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return interfaceId == type(IEIP2981).interfaceId || interfaceId == type(IEIP2981RoyaltyOverride).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Sets token royalties. When you override this in the implementation contract
     * ensure that you access restrict it to the contract owner or admin
     */
    function _setTokenRoyalties(TokenRoyaltyConfig[] memory royaltyConfigs) internal {
        for (uint i = 0; i < royaltyConfigs.length; i++) {
            TokenRoyaltyConfig memory royaltyConfig = royaltyConfigs[i];
            require(royaltyConfig.bps < 10000, "Invalid bps");
            if (royaltyConfig.recipient == address(0)) {
                delete _tokenRoyalties[royaltyConfig.tokenId];
                _tokensWithRoyalties.remove(royaltyConfig.tokenId);
                emit TokenRoyaltyRemoved(royaltyConfig.tokenId);
            } else {
                _tokenRoyalties[royaltyConfig.tokenId] = TokenRoyalty(royaltyConfig.recipient, royaltyConfig.bps);
                _tokensWithRoyalties.add(royaltyConfig.tokenId);
                emit TokenRoyaltySet(royaltyConfig.tokenId, royaltyConfig.recipient, royaltyConfig.bps);
            }
        }
    }

    /**
     * @dev Sets default royalty. When you override this in the implementation contract
     * ensure that you access restrict it to the contract owner or admin
     */
    function _setDefaultRoyalty(TokenRoyalty memory royalty) internal {
        require(royalty.bps < 10000, "Invalid bps");
        defaultRoyalty = TokenRoyalty(royalty.recipient, royalty.bps);
        emit DefaultRoyaltySet(royalty.recipient, royalty.bps);
    }

    /**
     * @dev See {IEIP2981RoyaltyOverride-getTokenRoyaltiesCount}.
     */
    function getTokenRoyaltiesCount() external override view returns(uint256) {
        return _tokensWithRoyalties.length();
    }

    /**
     * @dev See {IEIP2981RoyaltyOverride-getTokenRoyaltyByIndex}.
     */
    function getTokenRoyaltyByIndex(uint256 index) external override view returns(TokenRoyaltyConfig memory) {
        uint256 tokenId = _tokensWithRoyalties.at(index);
        TokenRoyalty memory royalty = _tokenRoyalties[tokenId];
        return TokenRoyaltyConfig(tokenId, royalty.recipient, royalty.bps);
    }

    /**
     * @dev See {IEIP2981RoyaltyOverride-royaltyInfo}.
     */
    function royaltyInfo(uint256 tokenId, uint256 value) public override view returns (address, uint256) {
        if (_tokenRoyalties[tokenId].recipient != address(0)) {
            return (_tokenRoyalties[tokenId].recipient, value*_tokenRoyalties[tokenId].bps/10000);
        }
        if (defaultRoyalty.recipient != address(0) && defaultRoyalty.bps != 0) {
            return (defaultRoyalty.recipient, value*defaultRoyalty.bps/10000);
        }
        return (address(0), 0);
    }
}

File 21 of 21 : IRoyaltyOverride.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/**
 * Simple EIP2981 reference override implementation
 */
interface IEIP2981RoyaltyOverride is IERC165 {

    event TokenRoyaltyRemoved(uint256 tokenId);
    event TokenRoyaltySet(uint256 tokenId, address recipient, uint16 bps);
    event DefaultRoyaltySet(address recipient, uint16 bps);

    struct TokenRoyalty {
        address recipient;
        uint16 bps;
    }

    struct TokenRoyaltyConfig {
        uint256 tokenId;
        address recipient;
        uint16 bps;
    }

    /**
     * @dev Set per token royalties.  Passing a recipient of address(0) will delete any existing configuration
     */
    function setTokenRoyalties(TokenRoyaltyConfig[] calldata royalties) external;

    /**
     * @dev Get the number of token specific overrides.  Used to enumerate over all configurations
     */
    function getTokenRoyaltiesCount() external view returns(uint256);

    /**
     * @dev Get a token royalty configuration by index.  Use in conjunction with getTokenRoyaltiesCount to get all per token configurations
     */
    function getTokenRoyaltyByIndex(uint256 index) external view returns(TokenRoyaltyConfig memory);

    /**
     * @dev Set a default royalty configuration.  Will be used if no token specific configuration is set
     */
    function setDefaultRoyalty(TokenRoyalty calldata royalty) external;

}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"bool","name":"isCreatorsOnly","type":"bool"},{"internalType":"address[]","name":"listCreators","type":"address[]"},{"internalType":"enum EmpropsCollectionContract.Origen","name":"_origen","type":"uint8"},{"internalType":"uint256","name":"initialCollectionId","type":"uint256"},{"components":[{"internalType":"uint32","name":"maxCollectionSize","type":"uint32"},{"internalType":"uint256","name":"minMintPrice","type":"uint256"},{"internalType":"uint32","name":"maxBatchMintSize","type":"uint32"}],"internalType":"struct EmpropsCollectionContract.PlatformConfig","name":"config","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"address","name":"author","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"editions","type":"uint64"},{"indexed":false,"internalType":"uint16","name":"royalty","type":"uint16"},{"indexed":false,"internalType":"address","name":"freeMinter","type":"address"},{"indexed":false,"internalType":"uint8","name":"status","type":"uint8"},{"indexed":false,"internalType":"string","name":"metadata","type":"string"},{"indexed":false,"internalType":"address","name":"tokenContractAddress","type":"address"}],"name":"CollectionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"accounts","outputs":[{"internalType":"uint32","name":"allowlistCount","type":"uint32"},{"internalType":"uint32","name":"freelistCount","type":"uint32"},{"internalType":"uint256","name":"fundsClaimed","type":"uint256"},{"internalType":"uint16","name":"rate","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collectionIdCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"collections","outputs":[{"internalType":"address","name":"author","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint64","name":"editions","type":"uint64"},{"internalType":"address","name":"royaltyAddress","type":"address"},{"internalType":"uint16","name":"royalty","type":"uint16"},{"internalType":"address","name":"freeMinter","type":"address"},{"internalType":"uint8","name":"status","type":"uint8"},{"internalType":"string","name":"metadata","type":"string"},{"internalType":"enum EmpropsCollectionContract.MintMode","name":"mintMode","type":"uint8"},{"internalType":"bytes32","name":"allowlist","type":"bytes32"},{"internalType":"bytes32","name":"freelist","type":"bytes32"},{"internalType":"address","name":"tokenContractAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"collectionsConfig","outputs":[{"internalType":"bool","name":"enableBatchMint","type":"bool"},{"internalType":"uint64","name":"maxBatchMintAllowed","type":"uint64"},{"internalType":"uint256","name":"startDate","type":"uint256"},{"internalType":"uint256","name":"endDate","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"author","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint64","name":"editions","type":"uint64"},{"internalType":"address","name":"royaltyAddress","type":"address"},{"internalType":"uint16","name":"royalty","type":"uint16"},{"internalType":"address","name":"freeMinter","type":"address"},{"internalType":"uint8","name":"status","type":"uint8"},{"internalType":"string","name":"metadata","type":"string"},{"internalType":"enum EmpropsCollectionContract.MintMode","name":"mintMode","type":"uint8"},{"internalType":"bytes32","name":"allowlist","type":"bytes32"},{"internalType":"bytes32","name":"freelist","type":"bytes32"},{"internalType":"address","name":"tokenContractAddress","type":"address"}],"internalType":"struct EmpropsCollectionContract.Collection","name":"collection","type":"tuple"},{"components":[{"internalType":"bool","name":"enableBatchMint","type":"bool"},{"internalType":"uint64","name":"maxBatchMintAllowed","type":"uint64"},{"internalType":"uint256","name":"startDate","type":"uint256"},{"internalType":"uint256","name":"endDate","type":"uint256"}],"internalType":"struct EmpropsCollectionContract.CollectionConfig","name":"collectionConfig","type":"tuple"},{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint16","name":"rate","type":"uint16"}],"internalType":"struct EmpropsCollectionContract.FundReceiver[]","name":"primarySaleReceivers","type":"tuple[]"}],"name":"createCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"creators","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"creatorsOnly","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"},{"internalType":"uint32","name":"quantityToMint","type":"uint32"},{"internalType":"uint32","name":"maxQuantityAllowed","type":"uint32"}],"name":"freeMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"fundsCollected","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"},{"internalType":"uint32","name":"quantityToMint","type":"uint32"},{"internalType":"uint32","name":"maxQuantityAllowed","type":"uint32"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"origen","outputs":[{"internalType":"enum EmpropsCollectionContract.Origen","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","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":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformConfig","outputs":[{"internalType":"uint32","name":"maxCollectionSize","type":"uint32"},{"internalType":"uint256","name":"minMintPrice","type":"uint256"},{"internalType":"uint32","name":"maxBatchMintSize","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"bytes32","name":"allowlist","type":"bytes32"}],"name":"setAllowlist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"newCreators","type":"address[]"}],"name":"setCreators","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"address","name":"freeMinter","type":"address"}],"name":"setFreeMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"bytes32","name":"freelist","type":"bytes32"}],"name":"setFreelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"enum EmpropsCollectionContract.MintMode","name":"mode","type":"uint8"}],"name":"setMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"maxCollectionSize","type":"uint32"},{"internalType":"uint256","name":"minMintPrice","type":"uint256"},{"internalType":"uint32","name":"maxBatchMintSize","type":"uint32"}],"internalType":"struct EmpropsCollectionContract.PlatformConfig","name":"config","type":"tuple"}],"name":"setPlatformConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"uint8","name":"status","type":"uint8"}],"name":"setStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"uint64","name":"newEditions","type":"uint64"}],"name":"setTotalEditions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"}],"name":"withdrawFunds","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526001600660006101000a81548160ff021916908360018111156200002d576200002c62000330565b5b02179055503480156200003f57600080fd5b5060405162005741380380620057418339818101604052810190620000659190620006a2565b62000085620000796200017860201b60201c565b6200018060201b60201c565b60016002819055506000600360006101000a81548160ff02191690831515021790555084600360016101000a81548160ff0219169083151502179055508360059080519060200190620000da92919062000282565b5082600660006101000a81548160ff0219169083600181111562000103576200010262000330565b5b021790555080600760008201518160000160006101000a81548163ffffffff021916908363ffffffff1602179055506020820151816001015560408201518160020160006101000a81548163ffffffff021916908363ffffffff16021790555090505081600481905550505050505062000749565b600033905090565b600160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055620001bb81620001be60201b620021251760201c565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b828054828255906000526020600020908101928215620002fe579160200282015b82811115620002fd5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190620002a3565b5b5090506200030d919062000311565b5090565b5b808211156200032c57600081600090555060010162000312565b5090565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6000604051905090565b600080fd5b600080fd5b60008115159050919050565b6200038a8162000373565b81146200039657600080fd5b50565b600081519050620003aa816200037f565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200040082620003b5565b810181811067ffffffffffffffff82111715620004225762000421620003c6565b5b80604052505050565b6000620004376200035f565b9050620004458282620003f5565b919050565b600067ffffffffffffffff821115620004685762000467620003c6565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620004ab826200047e565b9050919050565b620004bd816200049e565b8114620004c957600080fd5b50565b600081519050620004dd81620004b2565b92915050565b6000620004fa620004f4846200044a565b6200042b565b9050808382526020820190506020840283018581111562000520576200051f62000479565b5b835b818110156200054d5780620005388882620004cc565b84526020840193505060208101905062000522565b5050509392505050565b600082601f8301126200056f576200056e620003b0565b5b815162000581848260208601620004e3565b91505092915050565b600281106200059857600080fd5b50565b600081519050620005ac816200058a565b92915050565b6000819050919050565b620005c781620005b2565b8114620005d357600080fd5b50565b600081519050620005e781620005bc565b92915050565b600080fd5b600063ffffffff82169050919050565b6200060d81620005f2565b81146200061957600080fd5b50565b6000815190506200062d8162000602565b92915050565b6000606082840312156200064c576200064b620005ed565b5b6200065860606200042b565b905060006200066a848285016200061c565b60008301525060206200068084828501620005d6565b602083015250604062000696848285016200061c565b60408301525092915050565b600080600080600060e08688031215620006c157620006c062000369565b5b6000620006d18882890162000399565b955050602086015167ffffffffffffffff811115620006f557620006f46200036e565b5b620007038882890162000557565b945050604062000716888289016200059b565b93505060606200072988828901620005d6565b92505060806200073c8882890162000633565b9150509295509295909350565b614fe880620007596000396000f3fe6080604052600436106101cd5760003560e01c80635f81d989116100f7578063cd53d08e11610095578063f2fde38b11610064578063f2fde38b14610631578063f7d975771461065a578063fa1100f414610683578063fdbda0ec146106c0576101cd565b8063cd53d08e14610577578063d896dd64146105b4578063db54b6d1146105dd578063e30c397814610606576101cd565b806379ba5097116100d157806379ba5097146104cc5780638da5cb5b146104e3578063938a7c721461050e578063b38ab76e1461054e576101cd565b80635f81d989146104615780636d7294d91461048c578063715018a6146104b5576101cd565b80632d8e5b321161016f5780634d24e2361161013e5780634d24e2361461039e57806353b2df83146103cb57806358e271de146103f65780635c975abb14610436576101cd565b80632d8e5b32146102e45780632f27f19a1461030f578063325005271461034c5780634d02bf9214610375576101cd565b8063155dd5ee116101ab578063155dd5ee1461024d57806316c38b3c146102765780631e6e16bd1461029f5780632bba333f146102c8576101cd565b8063010dddc0146101d257806301500637146101fb5780630a402f3e14610224575b600080fd5b3480156101de57600080fd5b506101f960048036038101906101f49190612ca1565b610708565b005b34801561020757600080fd5b50610222600480360381019061021d91906132c6565b610725565b005b34801561023057600080fd5b5061024b60048036038101906102469190613351565b610f74565b005b34801561025957600080fd5b50610274600480360381019061026f9190613391565b610fc8565b005b34801561028257600080fd5b5061029d600480360381019061029891906133be565b611284565b005b3480156102ab57600080fd5b506102c660048036038101906102c191906133eb565b6112b1565b005b6102e260048036038101906102dd91906134c2565b6112e2565b005b3480156102f057600080fd5b506102f9611691565b60405161030691906135d3565b60405180910390f35b34801561031b57600080fd5b5061033660048036038101906103319190613391565b6116a4565b60405161034391906135fd565b60405180910390f35b34801561035857600080fd5b50610373600480360381019061036e91906134c2565b6116bc565b005b34801561038157600080fd5b5061039c600480360381019061039791906133eb565b6119fe565b005b3480156103aa57600080fd5b506103b3611a2f565b6040516103c293929190613627565b60405180910390f35b3480156103d757600080fd5b506103e0611a67565b6040516103ed91906135fd565b60405180910390f35b34801561040257600080fd5b5061041d6004803603810190610418919061365e565b611a6d565b60405161042d94939291906136ad565b60405180910390f35b34801561044257600080fd5b5061044b611ad8565b6040516104589190613701565b60405180910390f35b34801561046d57600080fd5b50610476611aef565b6040516104839190613701565b60405180910390f35b34801561049857600080fd5b506104b360048036038101906104ae91906137df565b611b02565b005b3480156104c157600080fd5b506104ca611b24565b005b3480156104d857600080fd5b506104e1611b38565b005b3480156104ef57600080fd5b506104f8611bc5565b6040516105059190613837565b60405180910390f35b34801561051a57600080fd5b5061053560048036038101906105309190613391565b611bee565b6040516105459493929190613861565b60405180910390f35b34801561055a57600080fd5b506105756004803603810190610570919061365e565b611c3f565b005b34801561058357600080fd5b5061059e60048036038101906105999190613391565b611caa565b6040516105ab9190613837565b60405180910390f35b3480156105c057600080fd5b506105db60048036038101906105d691906138a6565b611ce9565b005b3480156105e957600080fd5b5061060460048036038101906105ff91906138e6565b611d2e565b005b34801561061257600080fd5b5061061b611e61565b6040516106289190613837565b60405180910390f35b34801561063d57600080fd5b5061065860048036038101906106539190613926565b611e8b565b005b34801561066657600080fd5b50610681600480360381019061067c9190613953565b611f38565b005b34801561068f57600080fd5b506106aa60048036038101906106a59190613391565b611f69565b6040516106b791906135fd565b60405180910390f35b3480156106cc57600080fd5b506106e760048036038101906106e29190613391565b611f81565b6040516106ff9c9b9a99989796959493929190613a78565b60405180910390f35b6107106121e9565b806007818161071f9190613ce9565b90505050565b61072d612267565b612710836080015161ffff16111561077a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077190613d43565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16836000015173ffffffffffffffffffffffffffffffffffffffff16036107ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e490613daf565b60405180910390fd5b6001600760000160009054906101000a900463ffffffff1661080f9190613dfe565b63ffffffff16836040015167ffffffffffffffff1610610864576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085b90613e82565b60405180910390fd5b60016007600101546108769190613ea2565b8360200151116108bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b290613f22565b60405180910390fd5b60011515826000015115150361095d576001826020015167ffffffffffffffff1611801561091d57506001600760020160009054906101000a900463ffffffff166109069190613dfe565b63ffffffff16826020015167ffffffffffffffff16105b61095c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095390613f8e565b60405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff16836060015173ffffffffffffffffffffffffffffffffffffffff16036109d2578260000151836060019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b60008260400151036109e957428260400181815250505b6000826060015114610a40578160400151826060015111610a3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3690613ffa565b60405180910390fd5b5b600360019054906101000a900460ff1615610b3757600080600580549050905060005b81811015610af357610a736122b1565b73ffffffffffffffffffffffffffffffffffffffff1660058281548110610a9d57610a9c61401a565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610ae857600192505b806001019050610a63565b5081610b34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2b90614095565b60405180910390fd5b50505b6000808251905060005b81811015610c02576000848281518110610b5e57610b5d61401a565b5b60200260200101519050806020015161ffff1684610b7c91906140b5565b93508060200151600e600060045481526020019081526020016000206000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160006101000a81548161ffff021916908361ffff16021790555081600101915050610b41565b506127108214610c47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3e90614135565b60405180910390fd5b84600a6000600454815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060608201518160020160086101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550608082015181600201601c6101000a81548161ffff021916908361ffff16021790555060a08201518160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060c08201518160030160146101000a81548160ff021916908360ff16021790555060e0820151816004019081610dc4919061432b565b506101008201518160050160006101000a81548160ff02191690836002811115610df157610df061355c565b5b0217905550610120820151816006015561014082015181600701556101608201518160080160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555090505083600b6000600454815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160010155606082015181600201559050506000600c60006004548152602001908152602001600020819055507f422dfbdf1a1b63fbfa8d81658c0040263d15a83614136e98d4e9093f7c5d096f60045486600001518760200151886040015189608001518a60a001518b60c001518c60e001518d6101600151604051610f50999897969594939291906143fd565b60405180910390a16001600454610f6791906140b5565b6004819055505050505050565b610f7d826122b9565b610f86826123ab565b80600a600084815260200190815260200160002060050160006101000a81548160ff02191690836002811115610fbf57610fbe61355c565b5b02179055505050565b610fd0612453565b610fd9816123ab565b6000600e600083815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900461ffff16905060008161ffff1603611086576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107d906144dd565b60405180910390fd5b6000600d60008481526020019081526020016000205490506000600e600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015490506000816127108561ffff168561110c91906144fd565b611116919061456e565b6111209190613ea2565b905060008103611165576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115c906145eb565b60405180910390fd5b60003373ffffffffffffffffffffffffffffffffffffffff168260405161118b9061463c565b60006040518083038185875af1925050503d80600081146111c8576040519150601f19603f3d011682016040523d82523d6000602084013e6111cd565b606091505b5050905080611211576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112089061469d565b60405180910390fd5b818361121d91906140b5565b600e600088815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018190555050505050506112816124a0565b50565b61128c6121e9565b60011515811515036112a5576112a06124aa565b6112ae565b6112ad61250d565b5b50565b6112ba826122b9565b6112c3826123ab565b80600a6000848152602001908152602001600020600701819055505050565b6112ea612453565b6112fa868363ffffffff16612570565b8163ffffffff16600a60008881526020019081526020016000206001015461132291906144fd565b3414611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90614709565b60405180910390fd5b6002808111156113765761137561355c565b5b600a600088815260200190815260200160002060050160009054906101000a900460ff1660028111156113ac576113ab61355c565b5b036113ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e390614775565b60405180910390fd5b60016002811115611400576113ff61355c565b5b600a600088815260200190815260200160002060050160009054906101000a900460ff1660028111156114365761143561355c565b5b036116405760008582604051602001611450929190614813565b6040516020818303038152906040528051906020012090506114ca858580806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050600a60008a815260200190815260200160002060060154836128f6565b611509576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115009061488b565b60405180910390fd5b600083600e60008a815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1661157a9190613dfe565b90508263ffffffff168163ffffffff1611156115cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c2906148f7565b60405180910390fd5b80600e60008a815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548163ffffffff021916908363ffffffff16021790555050505b61164b86868461290d565b34600d60008881526020019081526020016000205461166a91906140b5565b600d6000888152602001908152602001600020819055506116896124a0565b505050505050565b600660009054906101000a900460ff1681565b600d6020528060005260406000206000915090505481565b6116c4612453565b6116d4868363ffffffff16612570565b6116dc6122b1565b73ffffffffffffffffffffffffffffffffffffffff16600a600088815260200190815260200160002060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119e3576002808111156117575761175661355c565b5b600a600088815260200190815260200160002060050160009054906101000a900460ff16600281111561178d5761178c61355c565b5b146117cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c490614775565b60405180910390fd5b600033826040516020016117e2929190614813565b60405160208183030381529060405280519060200120905061185c858580806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050600a60008a815260200190815260200160002060070154836128f6565b61189b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118929061488b565b60405180910390fd5b6000600e600089815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160049054906101000a900463ffffffff169050600084826119119190613dfe565b90508363ffffffff168163ffffffff161115611962576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611959906148f7565b60405180910390fd5b848261196e9190613dfe565b600e60008b815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160046101000a81548163ffffffff021916908363ffffffff1602179055505050505b6119ee86868461290d565b6119f66124a0565b505050505050565b611a07826122b9565b611a10826123ab565b80600a6000848152602001908152602001600020600601819055505050565b60078060000160009054906101000a900463ffffffff16908060010154908060020160009054906101000a900463ffffffff16905083565b60045481565b600e602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900463ffffffff16908060000160049054906101000a900463ffffffff16908060010154908060020160009054906101000a900461ffff16905084565b6000600360009054906101000a900460ff16905090565b600360019054906101000a900460ff1681565b611b0a6121e9565b8060059080519060200190611b20929190612bc2565b5050565b611b2c6121e9565b611b366000612ab0565b565b6000611b426122b1565b90508073ffffffffffffffffffffffffffffffffffffffff16611b63611e61565b73ffffffffffffffffffffffffffffffffffffffff1614611bb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb090614989565b60405180910390fd5b611bc281612ab0565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600b6020528060005260406000206000915090508060000160009054906101000a900460ff16908060000160019054906101000a900467ffffffffffffffff16908060010154908060020154905084565b611c48826122b9565b611c51826123ab565b80600a600084815260200190815260200160002060030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b60058181548110611cba57600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611cf2826122b9565b611cfb826123ab565b80600a600084815260200190815260200160002060030160146101000a81548160ff021916908360ff1602179055505050565b611d37826122b9565b611d40826123ab565b600a600083815260200190815260200160002060020160009054906101000a900467ffffffffffffffff1667ffffffffffffffff168167ffffffffffffffff1610611dc0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db7906149f5565b60405180910390fd5b600c6000838152602001908152602001600020548167ffffffffffffffff161015611e20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e1790614a61565b60405180910390fd5b80600a600084815260200190815260200160002060020160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611e936121e9565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16611ef3611bc5565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b611f41826122b9565b611f4a826123ab565b80600a6000848152602001908152602001600020600101819055505050565b600c6020528060005260406000206000915090505481565b600a6020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020160009054906101000a900467ffffffffffffffff16908060020160089054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600201601c9054906101000a900461ffff16908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030160149054906101000a900460ff169080600401805461205d90614184565b80601f016020809104026020016040519081016040528092919081815260200182805461208990614184565b80156120d65780601f106120ab576101008083540402835291602001916120d6565b820191906000526020600020905b8154815290600101906020018083116120b957829003601f168201915b5050505050908060050160009054906101000a900460ff16908060060154908060070154908060080160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508c565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6121f16122b1565b73ffffffffffffffffffffffffffffffffffffffff1661220f611bc5565b73ffffffffffffffffffffffffffffffffffffffff1614612265576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161225c90614acd565b60405180910390fd5b565b61226f611ad8565b156122af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122a690614b39565b60405180910390fd5b565b600033905090565b6122c16122b1565b73ffffffffffffffffffffffffffffffffffffffff16600a600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061236957506123336122b1565b73ffffffffffffffffffffffffffffffffffffffff16612351611bc5565b73ffffffffffffffffffffffffffffffffffffffff16145b6123a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239f90614ba5565b60405180910390fd5b50565b600073ffffffffffffffffffffffffffffffffffffffff16600a600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603612450576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161244790614c11565b60405180910390fd5b50565b6002805403612497576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248e90614c7d565b60405180910390fd5b60028081905550565b6001600281905550565b6124b2612267565b6001600360006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586124f66122b1565b6040516125039190613837565b60405180910390a1565b612515612ae1565b6000600360006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6125596122b1565b6040516125669190613837565b60405180910390a1565b6000600b60008481526020019081526020016000206040518060800160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff168152602001600182015481526020016002820154815250509050600073ffffffffffffffffffffffffffffffffffffffff16600a600085815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603612698576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161268f90614c11565b60405180910390fd5b6001600a600085815260200190815260200160002060030160149054906101000a900460ff1660ff1614612701576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126f890614ce9565b60405180910390fd5b8167ffffffffffffffff16600c60008581526020019081526020016000205461272a91906140b5565b600a600085815260200190815260200160002060020160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1610156127a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161279790614d55565b60405180910390fd5b80600001511561280a57806020015167ffffffffffffffff168267ffffffffffffffff161115612805576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127fc90614dc1565b60405180910390fd5b612858565b60018267ffffffffffffffff1614612857576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161284e90614e2d565b60405180910390fd5b5b8060400151421161289e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161289590614ce9565b60405180910390fd5b60008160600151146128f157806060015142106128f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128e790614e99565b60405180910390fd5b5b505050565b6000826129038584612b2a565b1490509392505050565b6000600c60008581526020019081526020016000205490506000600a600086815260200190815260200160002060080160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600060018361296f91906140b5565b90505b8363ffffffff168361298491906140b5565b8111612a7f57600081620f42408861299c91906144fd565b6129a691906140b5565b90508273ffffffffffffffffffffffffffffffffffffffff16632f6196b78783600a60008c815260200190815260200160002060020160089054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a60008d8152602001908152602001600020600201601c9054906101000a900461ffff166040518563ffffffff1660e01b8152600401612a419493929190614eb9565b600060405180830381600087803b158015612a5b57600080fd5b505af1158015612a6f573d6000803e3d6000fd5b5050505081600101915050612972565b508263ffffffff1682612a9291906140b5565b600c6000878152602001908152602001600020819055505050505050565b600160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055612ade81612125565b50565b612ae9611ad8565b612b28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b1f90614f4a565b60405180910390fd5b565b60008082905060005b8451811015612b7557612b6082868381518110612b5357612b5261401a565b5b6020026020010151612b80565b91508080612b6d90614f6a565b915050612b33565b508091505092915050565b6000818310612b9857612b938284612bab565b612ba3565b612ba28383612bab565b5b905092915050565b600082600052816020526040600020905092915050565b828054828255906000526020600020908101928215612c3b579160200282015b82811115612c3a5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190612be2565b5b509050612c489190612c4c565b5090565b5b80821115612c65576000816000905550600101612c4d565b5090565b6000604051905090565b600080fd5b600080fd5b600080fd5b600060608284031215612c9857612c97612c7d565b5b81905092915050565b600060608284031215612cb757612cb6612c73565b5b6000612cc584828501612c82565b91505092915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612d1c82612cd3565b810181811067ffffffffffffffff82111715612d3b57612d3a612ce4565b5b80604052505050565b6000612d4e612c69565b9050612d5a8282612d13565b919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612d8f82612d64565b9050919050565b612d9f81612d84565b8114612daa57600080fd5b50565b600081359050612dbc81612d96565b92915050565b6000819050919050565b612dd581612dc2565b8114612de057600080fd5b50565b600081359050612df281612dcc565b92915050565b600067ffffffffffffffff82169050919050565b612e1581612df8565b8114612e2057600080fd5b50565b600081359050612e3281612e0c565b92915050565b600061ffff82169050919050565b612e4f81612e38565b8114612e5a57600080fd5b50565b600081359050612e6c81612e46565b92915050565b600060ff82169050919050565b612e8881612e72565b8114612e9357600080fd5b50565b600081359050612ea581612e7f565b92915050565b600080fd5b600080fd5b600067ffffffffffffffff821115612ed057612ecf612ce4565b5b612ed982612cd3565b9050602081019050919050565b82818337600083830152505050565b6000612f08612f0384612eb5565b612d44565b905082815260208101848484011115612f2457612f23612eb0565b5b612f2f848285612ee6565b509392505050565b600082601f830112612f4c57612f4b612eab565b5b8135612f5c848260208601612ef5565b91505092915050565b60038110612f7257600080fd5b50565b600081359050612f8481612f65565b92915050565b6000819050919050565b612f9d81612f8a565b8114612fa857600080fd5b50565b600081359050612fba81612f94565b92915050565b60006101808284031215612fd757612fd6612cce565b5b612fe2610180612d44565b90506000612ff284828501612dad565b600083015250602061300684828501612de3565b602083015250604061301a84828501612e23565b604083015250606061302e84828501612dad565b606083015250608061304284828501612e5d565b60808301525060a061305684828501612dad565b60a08301525060c061306a84828501612e96565b60c08301525060e082013567ffffffffffffffff81111561308e5761308d612d5f565b5b61309a84828501612f37565b60e0830152506101006130af84828501612f75565b610100830152506101206130c584828501612fab565b610120830152506101406130db84828501612fab565b610140830152506101606130f184828501612dad565b6101608301525092915050565b60008115159050919050565b613113816130fe565b811461311e57600080fd5b50565b6000813590506131308161310a565b92915050565b60006080828403121561314c5761314b612cce565b5b6131566080612d44565b9050600061316684828501613121565b600083015250602061317a84828501612e23565b602083015250604061318e84828501612de3565b60408301525060606131a284828501612de3565b60608301525092915050565b600067ffffffffffffffff8211156131c9576131c8612ce4565b5b602082029050602081019050919050565b600080fd5b6000604082840312156131f5576131f4612cce565b5b6131ff6040612d44565b9050600061320f84828501612dad565b600083015250602061322384828501612e5d565b60208301525092915050565b600061324261323d846131ae565b612d44565b90508083825260208201905060408402830185811115613265576132646131da565b5b835b8181101561328e578061327a88826131df565b845260208401935050604081019050613267565b5050509392505050565b600082601f8301126132ad576132ac612eab565b5b81356132bd84826020860161322f565b91505092915050565b600080600060c084860312156132df576132de612c73565b5b600084013567ffffffffffffffff8111156132fd576132fc612c78565b5b61330986828701612fc0565b935050602061331a86828701613136565b92505060a084013567ffffffffffffffff81111561333b5761333a612c78565b5b61334786828701613298565b9150509250925092565b6000806040838503121561336857613367612c73565b5b600061337685828601612de3565b925050602061338785828601612f75565b9150509250929050565b6000602082840312156133a7576133a6612c73565b5b60006133b584828501612de3565b91505092915050565b6000602082840312156133d4576133d3612c73565b5b60006133e284828501613121565b91505092915050565b6000806040838503121561340257613401612c73565b5b600061341085828601612de3565b925050602061342185828601612fab565b9150509250929050565b600080fd5b60008083601f84011261344657613445612eab565b5b8235905067ffffffffffffffff8111156134635761346261342b565b5b60208301915083602082028301111561347f5761347e6131da565b5b9250929050565b600063ffffffff82169050919050565b61349f81613486565b81146134aa57600080fd5b50565b6000813590506134bc81613496565b92915050565b60008060008060008060a087890312156134df576134de612c73565b5b60006134ed89828a01612de3565b96505060206134fe89828a01612dad565b955050604087013567ffffffffffffffff81111561351f5761351e612c78565b5b61352b89828a01613430565b9450945050606061353e89828a016134ad565b925050608061354f89828a016134ad565b9150509295509295509295565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6002811061359c5761359b61355c565b5b50565b60008190506135ad8261358b565b919050565b60006135bd8261359f565b9050919050565b6135cd816135b2565b82525050565b60006020820190506135e860008301846135c4565b92915050565b6135f781612dc2565b82525050565b600060208201905061361260008301846135ee565b92915050565b61362181613486565b82525050565b600060608201905061363c6000830186613618565b61364960208301856135ee565b6136566040830184613618565b949350505050565b6000806040838503121561367557613674612c73565b5b600061368385828601612de3565b925050602061369485828601612dad565b9150509250929050565b6136a781612e38565b82525050565b60006080820190506136c26000830187613618565b6136cf6020830186613618565b6136dc60408301856135ee565b6136e9606083018461369e565b95945050505050565b6136fb816130fe565b82525050565b600060208201905061371660008301846136f2565b92915050565b600067ffffffffffffffff82111561373757613736612ce4565b5b602082029050602081019050919050565b600061375b6137568461371c565b612d44565b9050808382526020820190506020840283018581111561377e5761377d6131da565b5b835b818110156137a757806137938882612dad565b845260208401935050602081019050613780565b5050509392505050565b600082601f8301126137c6576137c5612eab565b5b81356137d6848260208601613748565b91505092915050565b6000602082840312156137f5576137f4612c73565b5b600082013567ffffffffffffffff81111561381357613812612c78565b5b61381f848285016137b1565b91505092915050565b61383181612d84565b82525050565b600060208201905061384c6000830184613828565b92915050565b61385b81612df8565b82525050565b600060808201905061387660008301876136f2565b6138836020830186613852565b61389060408301856135ee565b61389d60608301846135ee565b95945050505050565b600080604083850312156138bd576138bc612c73565b5b60006138cb85828601612de3565b92505060206138dc85828601612e96565b9150509250929050565b600080604083850312156138fd576138fc612c73565b5b600061390b85828601612de3565b925050602061391c85828601612e23565b9150509250929050565b60006020828403121561393c5761393b612c73565b5b600061394a84828501612dad565b91505092915050565b6000806040838503121561396a57613969612c73565b5b600061397885828601612de3565b925050602061398985828601612de3565b9150509250929050565b61399c81612e72565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b838110156139dc5780820151818401526020810190506139c1565b60008484015250505050565b60006139f3826139a2565b6139fd81856139ad565b9350613a0d8185602086016139be565b613a1681612cd3565b840191505092915050565b60038110613a3257613a3161355c565b5b50565b6000819050613a4382613a21565b919050565b6000613a5382613a35565b9050919050565b613a6381613a48565b82525050565b613a7281612f8a565b82525050565b600061018082019050613a8e600083018f613828565b613a9b602083018e6135ee565b613aa8604083018d613852565b613ab5606083018c613828565b613ac2608083018b61369e565b613acf60a083018a613828565b613adc60c0830189613993565b81810360e0830152613aee81886139e8565b9050613afe610100830187613a5a565b613b0c610120830186613a69565b613b1a610140830185613a69565b613b28610160830184613828565b9d9c50505050505050505050505050565b60008135613b4681613496565b80915050919050565b60008160001b9050919050565b600063ffffffff613b6c84613b4f565b9350801983169250808416831791505092915050565b6000819050919050565b6000613ba7613ba2613b9d84613486565b613b82565b613486565b9050919050565b6000819050919050565b613bc182613b8c565b613bd4613bcd82613bae565b8354613b5c565b8255505050565b60008135613be881612dcc565b80915050919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff613c1d84613b4f565b9350801983169250808416831791505092915050565b6000613c4e613c49613c4484612dc2565b613b82565b612dc2565b9050919050565b6000819050919050565b613c6882613c33565b613c7b613c7482613c55565b8354613bf1565b8255505050565b600081016000830180613c9481613b39565b9050613ca08184613bb8565b505050600181016020830180613cb581613bdb565b9050613cc18184613c5f565b505050600281016040830180613cd681613b39565b9050613ce28184613bb8565b5050505050565b613cf38282613c82565b5050565b7f726f79616c7479206f766572666c6f7773206d61782070657263656e74616765600082015250565b6000613d2d6020836139ad565b9150613d3882613cf7565b602082019050919050565b60006020820190508181036000830152613d5c81613d20565b9050919050565b7f496e76616c696420617574686f72206164647265737300000000000000000000600082015250565b6000613d996016836139ad565b9150613da482613d63565b602082019050919050565b60006020820190508181036000830152613dc881613d8c565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000613e0982613486565b9150613e1483613486565b9250828201905063ffffffff811115613e3057613e2f613dcf565b5b92915050565b7f496e76616c69642065646974696f6e7300000000000000000000000000000000600082015250565b6000613e6c6010836139ad565b9150613e7782613e36565b602082019050919050565b60006020820190508181036000830152613e9b81613e5f565b9050919050565b6000613ead82612dc2565b9150613eb883612dc2565b9250828203905081811115613ed057613ecf613dcf565b5b92915050565b7f496e76616c696420707269636500000000000000000000000000000000000000600082015250565b6000613f0c600d836139ad565b9150613f1782613ed6565b602082019050919050565b60006020820190508181036000830152613f3b81613eff565b9050919050565b7f496e76616c69642062617463682073697a650000000000000000000000000000600082015250565b6000613f786012836139ad565b9150613f8382613f42565b602082019050919050565b60006020820190508181036000830152613fa781613f6b565b9050919050565b7f496e76616c696420656e64446174650000000000000000000000000000000000600082015250565b6000613fe4600f836139ad565b9150613fef82613fae565b602082019050919050565b6000602082019050818103600083015261401381613fd7565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4f6e6c792063726561746f727320616c6c6f7765640000000000000000000000600082015250565b600061407f6015836139ad565b915061408a82614049565b602082019050919050565b600060208201905081810360008301526140ae81614072565b9050919050565b60006140c082612dc2565b91506140cb83612dc2565b92508282019050808211156140e3576140e2613dcf565b5b92915050565b7f5072696d6172792073616c6573206d7573742062652031303025000000000000600082015250565b600061411f601a836139ad565b915061412a826140e9565b602082019050919050565b6000602082019050818103600083015261414e81614112565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061419c57607f821691505b6020821081036141af576141ae614155565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026142177fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826141da565b61422186836141da565b95508019841693508086168417925050509392505050565b61424283613c33565b61425661424e82613c55565b8484546141e7565b825550505050565b600090565b61426b61425e565b614276818484614239565b505050565b5b8181101561429a5761428f600082614263565b60018101905061427c565b5050565b601f8211156142df576142b0816141b5565b6142b9846141ca565b810160208510156142c8578190505b6142dc6142d4856141ca565b83018261427b565b50505b505050565b600082821c905092915050565b6000614302600019846008026142e4565b1980831691505092915050565b600061431b83836142f1565b9150826002028217905092915050565b614334826139a2565b67ffffffffffffffff81111561434d5761434c612ce4565b5b6143578254614184565b61436282828561429e565b600060209050601f8311600181146143955760008415614383578287015190505b61438d858261430f565b8655506143f5565b601f1984166143a3866141b5565b60005b828110156143cb578489015182556001820191506020850194506020810190506143a6565b868310156143e857848901516143e4601f8916826142f1565b8355505b6001600288020188555050505b505050505050565b600061012082019050614413600083018c6135ee565b614420602083018b613828565b61442d604083018a6135ee565b61443a6060830189613852565b614447608083018861369e565b61445460a0830187613828565b61446160c0830186613993565b81810360e083015261447381856139e8565b9050614483610100830184613828565b9a9950505050505050505050565b7f696e76616c696420726174650000000000000000000000000000000000000000600082015250565b60006144c7600c836139ad565b91506144d282614491565b602082019050919050565b600060208201905081810360008301526144f6816144ba565b9050919050565b600061450882612dc2565b915061451383612dc2565b925082820261452181612dc2565b9150828204841483151761453857614537613dcf565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061457982612dc2565b915061458483612dc2565b9250826145945761459361453f565b5b828204905092915050565b7f4e6f2066756e647320636f6c6c65637465642079657400000000000000000000600082015250565b60006145d56016836139ad565b91506145e08261459f565b602082019050919050565b60006020820190508181036000830152614604816145c8565b9050919050565b600081905092915050565b50565b600061462660008361460b565b915061463182614616565b600082019050919050565b600061464782614619565b9150819050919050565b7f5472616e73666572206661696c65640000000000000000000000000000000000600082015250565b6000614687600f836139ad565b915061469282614651565b602082019050919050565b600060208201905081810360008301526146b68161467a565b9050919050565b7f496e73756666696369656e742066756e64730000000000000000000000000000600082015250565b60006146f36012836139ad565b91506146fe826146bd565b602082019050919050565b60006020820190508181036000830152614722816146e6565b9050919050565b7f496e76616c6964206d696e74206d6f6465000000000000000000000000000000600082015250565b600061475f6011836139ad565b915061476a82614729565b602082019050919050565b6000602082019050818103600083015261478e81614752565b9050919050565b60008160601b9050919050565b60006147ad82614795565b9050919050565b60006147bf826147a2565b9050919050565b6147d76147d282612d84565b6147b4565b82525050565b60008160e01b9050919050565b60006147f5826147dd565b9050919050565b61480d61480882613486565b6147ea565b82525050565b600061481f82856147c6565b60148201915061482f82846147fc565b6004820191508190509392505050565b7f496e76616c69642070726f6f6600000000000000000000000000000000000000600082015250565b6000614875600d836139ad565b91506148808261483f565b602082019050919050565b600060208201905081810360008301526148a481614868565b9050919050565b7f5573657220737570706c79206d696e746564206f757400000000000000000000600082015250565b60006148e16016836139ad565b91506148ec826148ab565b602082019050919050565b60006020820190508181036000830152614910816148d4565b9050919050565b7f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060008201527f6e6577206f776e65720000000000000000000000000000000000000000000000602082015250565b60006149736029836139ad565b915061497e82614917565b604082019050919050565b600060208201905081810360008301526149a281614966565b9050919050565b7f43616e6e6f7420696e63726561736520737570706c7900000000000000000000600082015250565b60006149df6016836139ad565b91506149ea826149a9565b602082019050919050565b60006020820190508181036000830152614a0e816149d2565b9050919050565b7f496e76616c69642065646974696f6e73206e756d626572000000000000000000600082015250565b6000614a4b6017836139ad565b9150614a5682614a15565b602082019050919050565b60006020820190508181036000830152614a7a81614a3e565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000614ab76020836139ad565b9150614ac282614a81565b602082019050919050565b60006020820190508181036000830152614ae681614aaa565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000614b236010836139ad565b9150614b2e82614aed565b602082019050919050565b60006020820190508181036000830152614b5281614b16565b9050919050565b7f4f6e6c792061646d696e00000000000000000000000000000000000000000000600082015250565b6000614b8f600a836139ad565b9150614b9a82614b59565b602082019050919050565b60006020820190508181036000830152614bbe81614b82565b9050919050565b7f436f6c6c656374696f6e20646f6573206e6f7420657869737473000000000000600082015250565b6000614bfb601a836139ad565b9150614c0682614bc5565b602082019050919050565b60006020820190508181036000830152614c2a81614bee565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000614c67601f836139ad565b9150614c7282614c31565b602082019050919050565b60006020820190508181036000830152614c9681614c5a565b9050919050565b7f4d696e742064697361626c656400000000000000000000000000000000000000600082015250565b6000614cd3600d836139ad565b9150614cde82614c9d565b602082019050919050565b60006020820190508181036000830152614d0281614cc6565b9050919050565b7f436f6c6c656374696f6e206d696e746564206f75740000000000000000000000600082015250565b6000614d3f6015836139ad565b9150614d4a82614d09565b602082019050919050565b60006020820190508181036000830152614d6e81614d32565b9050919050565b7f5175616e7469747920746f206d696e7420697320657865636565646564000000600082015250565b6000614dab601d836139ad565b9150614db682614d75565b602082019050919050565b60006020820190508181036000830152614dda81614d9e565b9050919050565b7f4261746368206d696e742069732064697361626c656400000000000000000000600082015250565b6000614e176016836139ad565b9150614e2282614de1565b602082019050919050565b60006020820190508181036000830152614e4681614e0a565b9050919050565b7f4d696e742066696e697368656400000000000000000000000000000000000000600082015250565b6000614e83600d836139ad565b9150614e8e82614e4d565b602082019050919050565b60006020820190508181036000830152614eb281614e76565b9050919050565b6000608082019050614ece6000830187613828565b614edb60208301866135ee565b614ee86040830185613828565b614ef5606083018461369e565b95945050505050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b6000614f346014836139ad565b9150614f3f82614efe565b602082019050919050565b60006020820190508181036000830152614f6381614f27565b9050919050565b6000614f7582612dc2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614fa757614fa6613dcf565b5b60018201905091905056fea2646970667358221220556952b3a673dca208b97aae863753d040fbdfe216291cf49b40ca0bdd01844a64736f6c63430008120033000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000038d7ea4c6800000000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106101cd5760003560e01c80635f81d989116100f7578063cd53d08e11610095578063f2fde38b11610064578063f2fde38b14610631578063f7d975771461065a578063fa1100f414610683578063fdbda0ec146106c0576101cd565b8063cd53d08e14610577578063d896dd64146105b4578063db54b6d1146105dd578063e30c397814610606576101cd565b806379ba5097116100d157806379ba5097146104cc5780638da5cb5b146104e3578063938a7c721461050e578063b38ab76e1461054e576101cd565b80635f81d989146104615780636d7294d91461048c578063715018a6146104b5576101cd565b80632d8e5b321161016f5780634d24e2361161013e5780634d24e2361461039e57806353b2df83146103cb57806358e271de146103f65780635c975abb14610436576101cd565b80632d8e5b32146102e45780632f27f19a1461030f578063325005271461034c5780634d02bf9214610375576101cd565b8063155dd5ee116101ab578063155dd5ee1461024d57806316c38b3c146102765780631e6e16bd1461029f5780632bba333f146102c8576101cd565b8063010dddc0146101d257806301500637146101fb5780630a402f3e14610224575b600080fd5b3480156101de57600080fd5b506101f960048036038101906101f49190612ca1565b610708565b005b34801561020757600080fd5b50610222600480360381019061021d91906132c6565b610725565b005b34801561023057600080fd5b5061024b60048036038101906102469190613351565b610f74565b005b34801561025957600080fd5b50610274600480360381019061026f9190613391565b610fc8565b005b34801561028257600080fd5b5061029d600480360381019061029891906133be565b611284565b005b3480156102ab57600080fd5b506102c660048036038101906102c191906133eb565b6112b1565b005b6102e260048036038101906102dd91906134c2565b6112e2565b005b3480156102f057600080fd5b506102f9611691565b60405161030691906135d3565b60405180910390f35b34801561031b57600080fd5b5061033660048036038101906103319190613391565b6116a4565b60405161034391906135fd565b60405180910390f35b34801561035857600080fd5b50610373600480360381019061036e91906134c2565b6116bc565b005b34801561038157600080fd5b5061039c600480360381019061039791906133eb565b6119fe565b005b3480156103aa57600080fd5b506103b3611a2f565b6040516103c293929190613627565b60405180910390f35b3480156103d757600080fd5b506103e0611a67565b6040516103ed91906135fd565b60405180910390f35b34801561040257600080fd5b5061041d6004803603810190610418919061365e565b611a6d565b60405161042d94939291906136ad565b60405180910390f35b34801561044257600080fd5b5061044b611ad8565b6040516104589190613701565b60405180910390f35b34801561046d57600080fd5b50610476611aef565b6040516104839190613701565b60405180910390f35b34801561049857600080fd5b506104b360048036038101906104ae91906137df565b611b02565b005b3480156104c157600080fd5b506104ca611b24565b005b3480156104d857600080fd5b506104e1611b38565b005b3480156104ef57600080fd5b506104f8611bc5565b6040516105059190613837565b60405180910390f35b34801561051a57600080fd5b5061053560048036038101906105309190613391565b611bee565b6040516105459493929190613861565b60405180910390f35b34801561055a57600080fd5b506105756004803603810190610570919061365e565b611c3f565b005b34801561058357600080fd5b5061059e60048036038101906105999190613391565b611caa565b6040516105ab9190613837565b60405180910390f35b3480156105c057600080fd5b506105db60048036038101906105d691906138a6565b611ce9565b005b3480156105e957600080fd5b5061060460048036038101906105ff91906138e6565b611d2e565b005b34801561061257600080fd5b5061061b611e61565b6040516106289190613837565b60405180910390f35b34801561063d57600080fd5b5061065860048036038101906106539190613926565b611e8b565b005b34801561066657600080fd5b50610681600480360381019061067c9190613953565b611f38565b005b34801561068f57600080fd5b506106aa60048036038101906106a59190613391565b611f69565b6040516106b791906135fd565b60405180910390f35b3480156106cc57600080fd5b506106e760048036038101906106e29190613391565b611f81565b6040516106ff9c9b9a99989796959493929190613a78565b60405180910390f35b6107106121e9565b806007818161071f9190613ce9565b90505050565b61072d612267565b612710836080015161ffff16111561077a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077190613d43565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16836000015173ffffffffffffffffffffffffffffffffffffffff16036107ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e490613daf565b60405180910390fd5b6001600760000160009054906101000a900463ffffffff1661080f9190613dfe565b63ffffffff16836040015167ffffffffffffffff1610610864576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085b90613e82565b60405180910390fd5b60016007600101546108769190613ea2565b8360200151116108bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b290613f22565b60405180910390fd5b60011515826000015115150361095d576001826020015167ffffffffffffffff1611801561091d57506001600760020160009054906101000a900463ffffffff166109069190613dfe565b63ffffffff16826020015167ffffffffffffffff16105b61095c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095390613f8e565b60405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff16836060015173ffffffffffffffffffffffffffffffffffffffff16036109d2578260000151836060019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b60008260400151036109e957428260400181815250505b6000826060015114610a40578160400151826060015111610a3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3690613ffa565b60405180910390fd5b5b600360019054906101000a900460ff1615610b3757600080600580549050905060005b81811015610af357610a736122b1565b73ffffffffffffffffffffffffffffffffffffffff1660058281548110610a9d57610a9c61401a565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610ae857600192505b806001019050610a63565b5081610b34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2b90614095565b60405180910390fd5b50505b6000808251905060005b81811015610c02576000848281518110610b5e57610b5d61401a565b5b60200260200101519050806020015161ffff1684610b7c91906140b5565b93508060200151600e600060045481526020019081526020016000206000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160006101000a81548161ffff021916908361ffff16021790555081600101915050610b41565b506127108214610c47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3e90614135565b60405180910390fd5b84600a6000600454815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060608201518160020160086101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550608082015181600201601c6101000a81548161ffff021916908361ffff16021790555060a08201518160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060c08201518160030160146101000a81548160ff021916908360ff16021790555060e0820151816004019081610dc4919061432b565b506101008201518160050160006101000a81548160ff02191690836002811115610df157610df061355c565b5b0217905550610120820151816006015561014082015181600701556101608201518160080160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555090505083600b6000600454815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160010155606082015181600201559050506000600c60006004548152602001908152602001600020819055507f422dfbdf1a1b63fbfa8d81658c0040263d15a83614136e98d4e9093f7c5d096f60045486600001518760200151886040015189608001518a60a001518b60c001518c60e001518d6101600151604051610f50999897969594939291906143fd565b60405180910390a16001600454610f6791906140b5565b6004819055505050505050565b610f7d826122b9565b610f86826123ab565b80600a600084815260200190815260200160002060050160006101000a81548160ff02191690836002811115610fbf57610fbe61355c565b5b02179055505050565b610fd0612453565b610fd9816123ab565b6000600e600083815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900461ffff16905060008161ffff1603611086576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107d906144dd565b60405180910390fd5b6000600d60008481526020019081526020016000205490506000600e600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015490506000816127108561ffff168561110c91906144fd565b611116919061456e565b6111209190613ea2565b905060008103611165576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115c906145eb565b60405180910390fd5b60003373ffffffffffffffffffffffffffffffffffffffff168260405161118b9061463c565b60006040518083038185875af1925050503d80600081146111c8576040519150601f19603f3d011682016040523d82523d6000602084013e6111cd565b606091505b5050905080611211576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112089061469d565b60405180910390fd5b818361121d91906140b5565b600e600088815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018190555050505050506112816124a0565b50565b61128c6121e9565b60011515811515036112a5576112a06124aa565b6112ae565b6112ad61250d565b5b50565b6112ba826122b9565b6112c3826123ab565b80600a6000848152602001908152602001600020600701819055505050565b6112ea612453565b6112fa868363ffffffff16612570565b8163ffffffff16600a60008881526020019081526020016000206001015461132291906144fd565b3414611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90614709565b60405180910390fd5b6002808111156113765761137561355c565b5b600a600088815260200190815260200160002060050160009054906101000a900460ff1660028111156113ac576113ab61355c565b5b036113ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e390614775565b60405180910390fd5b60016002811115611400576113ff61355c565b5b600a600088815260200190815260200160002060050160009054906101000a900460ff1660028111156114365761143561355c565b5b036116405760008582604051602001611450929190614813565b6040516020818303038152906040528051906020012090506114ca858580806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050600a60008a815260200190815260200160002060060154836128f6565b611509576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115009061488b565b60405180910390fd5b600083600e60008a815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1661157a9190613dfe565b90508263ffffffff168163ffffffff1611156115cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c2906148f7565b60405180910390fd5b80600e60008a815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548163ffffffff021916908363ffffffff16021790555050505b61164b86868461290d565b34600d60008881526020019081526020016000205461166a91906140b5565b600d6000888152602001908152602001600020819055506116896124a0565b505050505050565b600660009054906101000a900460ff1681565b600d6020528060005260406000206000915090505481565b6116c4612453565b6116d4868363ffffffff16612570565b6116dc6122b1565b73ffffffffffffffffffffffffffffffffffffffff16600a600088815260200190815260200160002060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119e3576002808111156117575761175661355c565b5b600a600088815260200190815260200160002060050160009054906101000a900460ff16600281111561178d5761178c61355c565b5b146117cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c490614775565b60405180910390fd5b600033826040516020016117e2929190614813565b60405160208183030381529060405280519060200120905061185c858580806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050600a60008a815260200190815260200160002060070154836128f6565b61189b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118929061488b565b60405180910390fd5b6000600e600089815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160049054906101000a900463ffffffff169050600084826119119190613dfe565b90508363ffffffff168163ffffffff161115611962576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611959906148f7565b60405180910390fd5b848261196e9190613dfe565b600e60008b815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160046101000a81548163ffffffff021916908363ffffffff1602179055505050505b6119ee86868461290d565b6119f66124a0565b505050505050565b611a07826122b9565b611a10826123ab565b80600a6000848152602001908152602001600020600601819055505050565b60078060000160009054906101000a900463ffffffff16908060010154908060020160009054906101000a900463ffffffff16905083565b60045481565b600e602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900463ffffffff16908060000160049054906101000a900463ffffffff16908060010154908060020160009054906101000a900461ffff16905084565b6000600360009054906101000a900460ff16905090565b600360019054906101000a900460ff1681565b611b0a6121e9565b8060059080519060200190611b20929190612bc2565b5050565b611b2c6121e9565b611b366000612ab0565b565b6000611b426122b1565b90508073ffffffffffffffffffffffffffffffffffffffff16611b63611e61565b73ffffffffffffffffffffffffffffffffffffffff1614611bb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb090614989565b60405180910390fd5b611bc281612ab0565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600b6020528060005260406000206000915090508060000160009054906101000a900460ff16908060000160019054906101000a900467ffffffffffffffff16908060010154908060020154905084565b611c48826122b9565b611c51826123ab565b80600a600084815260200190815260200160002060030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b60058181548110611cba57600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611cf2826122b9565b611cfb826123ab565b80600a600084815260200190815260200160002060030160146101000a81548160ff021916908360ff1602179055505050565b611d37826122b9565b611d40826123ab565b600a600083815260200190815260200160002060020160009054906101000a900467ffffffffffffffff1667ffffffffffffffff168167ffffffffffffffff1610611dc0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db7906149f5565b60405180910390fd5b600c6000838152602001908152602001600020548167ffffffffffffffff161015611e20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e1790614a61565b60405180910390fd5b80600a600084815260200190815260200160002060020160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611e936121e9565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16611ef3611bc5565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b611f41826122b9565b611f4a826123ab565b80600a6000848152602001908152602001600020600101819055505050565b600c6020528060005260406000206000915090505481565b600a6020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020160009054906101000a900467ffffffffffffffff16908060020160089054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600201601c9054906101000a900461ffff16908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030160149054906101000a900460ff169080600401805461205d90614184565b80601f016020809104026020016040519081016040528092919081815260200182805461208990614184565b80156120d65780601f106120ab576101008083540402835291602001916120d6565b820191906000526020600020905b8154815290600101906020018083116120b957829003601f168201915b5050505050908060050160009054906101000a900460ff16908060060154908060070154908060080160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508c565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6121f16122b1565b73ffffffffffffffffffffffffffffffffffffffff1661220f611bc5565b73ffffffffffffffffffffffffffffffffffffffff1614612265576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161225c90614acd565b60405180910390fd5b565b61226f611ad8565b156122af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122a690614b39565b60405180910390fd5b565b600033905090565b6122c16122b1565b73ffffffffffffffffffffffffffffffffffffffff16600a600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061236957506123336122b1565b73ffffffffffffffffffffffffffffffffffffffff16612351611bc5565b73ffffffffffffffffffffffffffffffffffffffff16145b6123a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239f90614ba5565b60405180910390fd5b50565b600073ffffffffffffffffffffffffffffffffffffffff16600a600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603612450576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161244790614c11565b60405180910390fd5b50565b6002805403612497576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248e90614c7d565b60405180910390fd5b60028081905550565b6001600281905550565b6124b2612267565b6001600360006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586124f66122b1565b6040516125039190613837565b60405180910390a1565b612515612ae1565b6000600360006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6125596122b1565b6040516125669190613837565b60405180910390a1565b6000600b60008481526020019081526020016000206040518060800160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff168152602001600182015481526020016002820154815250509050600073ffffffffffffffffffffffffffffffffffffffff16600a600085815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603612698576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161268f90614c11565b60405180910390fd5b6001600a600085815260200190815260200160002060030160149054906101000a900460ff1660ff1614612701576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126f890614ce9565b60405180910390fd5b8167ffffffffffffffff16600c60008581526020019081526020016000205461272a91906140b5565b600a600085815260200190815260200160002060020160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1610156127a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161279790614d55565b60405180910390fd5b80600001511561280a57806020015167ffffffffffffffff168267ffffffffffffffff161115612805576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127fc90614dc1565b60405180910390fd5b612858565b60018267ffffffffffffffff1614612857576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161284e90614e2d565b60405180910390fd5b5b8060400151421161289e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161289590614ce9565b60405180910390fd5b60008160600151146128f157806060015142106128f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128e790614e99565b60405180910390fd5b5b505050565b6000826129038584612b2a565b1490509392505050565b6000600c60008581526020019081526020016000205490506000600a600086815260200190815260200160002060080160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600060018361296f91906140b5565b90505b8363ffffffff168361298491906140b5565b8111612a7f57600081620f42408861299c91906144fd565b6129a691906140b5565b90508273ffffffffffffffffffffffffffffffffffffffff16632f6196b78783600a60008c815260200190815260200160002060020160089054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a60008d8152602001908152602001600020600201601c9054906101000a900461ffff166040518563ffffffff1660e01b8152600401612a419493929190614eb9565b600060405180830381600087803b158015612a5b57600080fd5b505af1158015612a6f573d6000803e3d6000fd5b5050505081600101915050612972565b508263ffffffff1682612a9291906140b5565b600c6000878152602001908152602001600020819055505050505050565b600160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055612ade81612125565b50565b612ae9611ad8565b612b28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b1f90614f4a565b60405180910390fd5b565b60008082905060005b8451811015612b7557612b6082868381518110612b5357612b5261401a565b5b6020026020010151612b80565b91508080612b6d90614f6a565b915050612b33565b508091505092915050565b6000818310612b9857612b938284612bab565b612ba3565b612ba28383612bab565b5b905092915050565b600082600052816020526040600020905092915050565b828054828255906000526020600020908101928215612c3b579160200282015b82811115612c3a5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190612be2565b5b509050612c489190612c4c565b5090565b5b80821115612c65576000816000905550600101612c4d565b5090565b6000604051905090565b600080fd5b600080fd5b600080fd5b600060608284031215612c9857612c97612c7d565b5b81905092915050565b600060608284031215612cb757612cb6612c73565b5b6000612cc584828501612c82565b91505092915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612d1c82612cd3565b810181811067ffffffffffffffff82111715612d3b57612d3a612ce4565b5b80604052505050565b6000612d4e612c69565b9050612d5a8282612d13565b919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612d8f82612d64565b9050919050565b612d9f81612d84565b8114612daa57600080fd5b50565b600081359050612dbc81612d96565b92915050565b6000819050919050565b612dd581612dc2565b8114612de057600080fd5b50565b600081359050612df281612dcc565b92915050565b600067ffffffffffffffff82169050919050565b612e1581612df8565b8114612e2057600080fd5b50565b600081359050612e3281612e0c565b92915050565b600061ffff82169050919050565b612e4f81612e38565b8114612e5a57600080fd5b50565b600081359050612e6c81612e46565b92915050565b600060ff82169050919050565b612e8881612e72565b8114612e9357600080fd5b50565b600081359050612ea581612e7f565b92915050565b600080fd5b600080fd5b600067ffffffffffffffff821115612ed057612ecf612ce4565b5b612ed982612cd3565b9050602081019050919050565b82818337600083830152505050565b6000612f08612f0384612eb5565b612d44565b905082815260208101848484011115612f2457612f23612eb0565b5b612f2f848285612ee6565b509392505050565b600082601f830112612f4c57612f4b612eab565b5b8135612f5c848260208601612ef5565b91505092915050565b60038110612f7257600080fd5b50565b600081359050612f8481612f65565b92915050565b6000819050919050565b612f9d81612f8a565b8114612fa857600080fd5b50565b600081359050612fba81612f94565b92915050565b60006101808284031215612fd757612fd6612cce565b5b612fe2610180612d44565b90506000612ff284828501612dad565b600083015250602061300684828501612de3565b602083015250604061301a84828501612e23565b604083015250606061302e84828501612dad565b606083015250608061304284828501612e5d565b60808301525060a061305684828501612dad565b60a08301525060c061306a84828501612e96565b60c08301525060e082013567ffffffffffffffff81111561308e5761308d612d5f565b5b61309a84828501612f37565b60e0830152506101006130af84828501612f75565b610100830152506101206130c584828501612fab565b610120830152506101406130db84828501612fab565b610140830152506101606130f184828501612dad565b6101608301525092915050565b60008115159050919050565b613113816130fe565b811461311e57600080fd5b50565b6000813590506131308161310a565b92915050565b60006080828403121561314c5761314b612cce565b5b6131566080612d44565b9050600061316684828501613121565b600083015250602061317a84828501612e23565b602083015250604061318e84828501612de3565b60408301525060606131a284828501612de3565b60608301525092915050565b600067ffffffffffffffff8211156131c9576131c8612ce4565b5b602082029050602081019050919050565b600080fd5b6000604082840312156131f5576131f4612cce565b5b6131ff6040612d44565b9050600061320f84828501612dad565b600083015250602061322384828501612e5d565b60208301525092915050565b600061324261323d846131ae565b612d44565b90508083825260208201905060408402830185811115613265576132646131da565b5b835b8181101561328e578061327a88826131df565b845260208401935050604081019050613267565b5050509392505050565b600082601f8301126132ad576132ac612eab565b5b81356132bd84826020860161322f565b91505092915050565b600080600060c084860312156132df576132de612c73565b5b600084013567ffffffffffffffff8111156132fd576132fc612c78565b5b61330986828701612fc0565b935050602061331a86828701613136565b92505060a084013567ffffffffffffffff81111561333b5761333a612c78565b5b61334786828701613298565b9150509250925092565b6000806040838503121561336857613367612c73565b5b600061337685828601612de3565b925050602061338785828601612f75565b9150509250929050565b6000602082840312156133a7576133a6612c73565b5b60006133b584828501612de3565b91505092915050565b6000602082840312156133d4576133d3612c73565b5b60006133e284828501613121565b91505092915050565b6000806040838503121561340257613401612c73565b5b600061341085828601612de3565b925050602061342185828601612fab565b9150509250929050565b600080fd5b60008083601f84011261344657613445612eab565b5b8235905067ffffffffffffffff8111156134635761346261342b565b5b60208301915083602082028301111561347f5761347e6131da565b5b9250929050565b600063ffffffff82169050919050565b61349f81613486565b81146134aa57600080fd5b50565b6000813590506134bc81613496565b92915050565b60008060008060008060a087890312156134df576134de612c73565b5b60006134ed89828a01612de3565b96505060206134fe89828a01612dad565b955050604087013567ffffffffffffffff81111561351f5761351e612c78565b5b61352b89828a01613430565b9450945050606061353e89828a016134ad565b925050608061354f89828a016134ad565b9150509295509295509295565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6002811061359c5761359b61355c565b5b50565b60008190506135ad8261358b565b919050565b60006135bd8261359f565b9050919050565b6135cd816135b2565b82525050565b60006020820190506135e860008301846135c4565b92915050565b6135f781612dc2565b82525050565b600060208201905061361260008301846135ee565b92915050565b61362181613486565b82525050565b600060608201905061363c6000830186613618565b61364960208301856135ee565b6136566040830184613618565b949350505050565b6000806040838503121561367557613674612c73565b5b600061368385828601612de3565b925050602061369485828601612dad565b9150509250929050565b6136a781612e38565b82525050565b60006080820190506136c26000830187613618565b6136cf6020830186613618565b6136dc60408301856135ee565b6136e9606083018461369e565b95945050505050565b6136fb816130fe565b82525050565b600060208201905061371660008301846136f2565b92915050565b600067ffffffffffffffff82111561373757613736612ce4565b5b602082029050602081019050919050565b600061375b6137568461371c565b612d44565b9050808382526020820190506020840283018581111561377e5761377d6131da565b5b835b818110156137a757806137938882612dad565b845260208401935050602081019050613780565b5050509392505050565b600082601f8301126137c6576137c5612eab565b5b81356137d6848260208601613748565b91505092915050565b6000602082840312156137f5576137f4612c73565b5b600082013567ffffffffffffffff81111561381357613812612c78565b5b61381f848285016137b1565b91505092915050565b61383181612d84565b82525050565b600060208201905061384c6000830184613828565b92915050565b61385b81612df8565b82525050565b600060808201905061387660008301876136f2565b6138836020830186613852565b61389060408301856135ee565b61389d60608301846135ee565b95945050505050565b600080604083850312156138bd576138bc612c73565b5b60006138cb85828601612de3565b92505060206138dc85828601612e96565b9150509250929050565b600080604083850312156138fd576138fc612c73565b5b600061390b85828601612de3565b925050602061391c85828601612e23565b9150509250929050565b60006020828403121561393c5761393b612c73565b5b600061394a84828501612dad565b91505092915050565b6000806040838503121561396a57613969612c73565b5b600061397885828601612de3565b925050602061398985828601612de3565b9150509250929050565b61399c81612e72565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b838110156139dc5780820151818401526020810190506139c1565b60008484015250505050565b60006139f3826139a2565b6139fd81856139ad565b9350613a0d8185602086016139be565b613a1681612cd3565b840191505092915050565b60038110613a3257613a3161355c565b5b50565b6000819050613a4382613a21565b919050565b6000613a5382613a35565b9050919050565b613a6381613a48565b82525050565b613a7281612f8a565b82525050565b600061018082019050613a8e600083018f613828565b613a9b602083018e6135ee565b613aa8604083018d613852565b613ab5606083018c613828565b613ac2608083018b61369e565b613acf60a083018a613828565b613adc60c0830189613993565b81810360e0830152613aee81886139e8565b9050613afe610100830187613a5a565b613b0c610120830186613a69565b613b1a610140830185613a69565b613b28610160830184613828565b9d9c50505050505050505050505050565b60008135613b4681613496565b80915050919050565b60008160001b9050919050565b600063ffffffff613b6c84613b4f565b9350801983169250808416831791505092915050565b6000819050919050565b6000613ba7613ba2613b9d84613486565b613b82565b613486565b9050919050565b6000819050919050565b613bc182613b8c565b613bd4613bcd82613bae565b8354613b5c565b8255505050565b60008135613be881612dcc565b80915050919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff613c1d84613b4f565b9350801983169250808416831791505092915050565b6000613c4e613c49613c4484612dc2565b613b82565b612dc2565b9050919050565b6000819050919050565b613c6882613c33565b613c7b613c7482613c55565b8354613bf1565b8255505050565b600081016000830180613c9481613b39565b9050613ca08184613bb8565b505050600181016020830180613cb581613bdb565b9050613cc18184613c5f565b505050600281016040830180613cd681613b39565b9050613ce28184613bb8565b5050505050565b613cf38282613c82565b5050565b7f726f79616c7479206f766572666c6f7773206d61782070657263656e74616765600082015250565b6000613d2d6020836139ad565b9150613d3882613cf7565b602082019050919050565b60006020820190508181036000830152613d5c81613d20565b9050919050565b7f496e76616c696420617574686f72206164647265737300000000000000000000600082015250565b6000613d996016836139ad565b9150613da482613d63565b602082019050919050565b60006020820190508181036000830152613dc881613d8c565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000613e0982613486565b9150613e1483613486565b9250828201905063ffffffff811115613e3057613e2f613dcf565b5b92915050565b7f496e76616c69642065646974696f6e7300000000000000000000000000000000600082015250565b6000613e6c6010836139ad565b9150613e7782613e36565b602082019050919050565b60006020820190508181036000830152613e9b81613e5f565b9050919050565b6000613ead82612dc2565b9150613eb883612dc2565b9250828203905081811115613ed057613ecf613dcf565b5b92915050565b7f496e76616c696420707269636500000000000000000000000000000000000000600082015250565b6000613f0c600d836139ad565b9150613f1782613ed6565b602082019050919050565b60006020820190508181036000830152613f3b81613eff565b9050919050565b7f496e76616c69642062617463682073697a650000000000000000000000000000600082015250565b6000613f786012836139ad565b9150613f8382613f42565b602082019050919050565b60006020820190508181036000830152613fa781613f6b565b9050919050565b7f496e76616c696420656e64446174650000000000000000000000000000000000600082015250565b6000613fe4600f836139ad565b9150613fef82613fae565b602082019050919050565b6000602082019050818103600083015261401381613fd7565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4f6e6c792063726561746f727320616c6c6f7765640000000000000000000000600082015250565b600061407f6015836139ad565b915061408a82614049565b602082019050919050565b600060208201905081810360008301526140ae81614072565b9050919050565b60006140c082612dc2565b91506140cb83612dc2565b92508282019050808211156140e3576140e2613dcf565b5b92915050565b7f5072696d6172792073616c6573206d7573742062652031303025000000000000600082015250565b600061411f601a836139ad565b915061412a826140e9565b602082019050919050565b6000602082019050818103600083015261414e81614112565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061419c57607f821691505b6020821081036141af576141ae614155565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026142177fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826141da565b61422186836141da565b95508019841693508086168417925050509392505050565b61424283613c33565b61425661424e82613c55565b8484546141e7565b825550505050565b600090565b61426b61425e565b614276818484614239565b505050565b5b8181101561429a5761428f600082614263565b60018101905061427c565b5050565b601f8211156142df576142b0816141b5565b6142b9846141ca565b810160208510156142c8578190505b6142dc6142d4856141ca565b83018261427b565b50505b505050565b600082821c905092915050565b6000614302600019846008026142e4565b1980831691505092915050565b600061431b83836142f1565b9150826002028217905092915050565b614334826139a2565b67ffffffffffffffff81111561434d5761434c612ce4565b5b6143578254614184565b61436282828561429e565b600060209050601f8311600181146143955760008415614383578287015190505b61438d858261430f565b8655506143f5565b601f1984166143a3866141b5565b60005b828110156143cb578489015182556001820191506020850194506020810190506143a6565b868310156143e857848901516143e4601f8916826142f1565b8355505b6001600288020188555050505b505050505050565b600061012082019050614413600083018c6135ee565b614420602083018b613828565b61442d604083018a6135ee565b61443a6060830189613852565b614447608083018861369e565b61445460a0830187613828565b61446160c0830186613993565b81810360e083015261447381856139e8565b9050614483610100830184613828565b9a9950505050505050505050565b7f696e76616c696420726174650000000000000000000000000000000000000000600082015250565b60006144c7600c836139ad565b91506144d282614491565b602082019050919050565b600060208201905081810360008301526144f6816144ba565b9050919050565b600061450882612dc2565b915061451383612dc2565b925082820261452181612dc2565b9150828204841483151761453857614537613dcf565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061457982612dc2565b915061458483612dc2565b9250826145945761459361453f565b5b828204905092915050565b7f4e6f2066756e647320636f6c6c65637465642079657400000000000000000000600082015250565b60006145d56016836139ad565b91506145e08261459f565b602082019050919050565b60006020820190508181036000830152614604816145c8565b9050919050565b600081905092915050565b50565b600061462660008361460b565b915061463182614616565b600082019050919050565b600061464782614619565b9150819050919050565b7f5472616e73666572206661696c65640000000000000000000000000000000000600082015250565b6000614687600f836139ad565b915061469282614651565b602082019050919050565b600060208201905081810360008301526146b68161467a565b9050919050565b7f496e73756666696369656e742066756e64730000000000000000000000000000600082015250565b60006146f36012836139ad565b91506146fe826146bd565b602082019050919050565b60006020820190508181036000830152614722816146e6565b9050919050565b7f496e76616c6964206d696e74206d6f6465000000000000000000000000000000600082015250565b600061475f6011836139ad565b915061476a82614729565b602082019050919050565b6000602082019050818103600083015261478e81614752565b9050919050565b60008160601b9050919050565b60006147ad82614795565b9050919050565b60006147bf826147a2565b9050919050565b6147d76147d282612d84565b6147b4565b82525050565b60008160e01b9050919050565b60006147f5826147dd565b9050919050565b61480d61480882613486565b6147ea565b82525050565b600061481f82856147c6565b60148201915061482f82846147fc565b6004820191508190509392505050565b7f496e76616c69642070726f6f6600000000000000000000000000000000000000600082015250565b6000614875600d836139ad565b91506148808261483f565b602082019050919050565b600060208201905081810360008301526148a481614868565b9050919050565b7f5573657220737570706c79206d696e746564206f757400000000000000000000600082015250565b60006148e16016836139ad565b91506148ec826148ab565b602082019050919050565b60006020820190508181036000830152614910816148d4565b9050919050565b7f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060008201527f6e6577206f776e65720000000000000000000000000000000000000000000000602082015250565b60006149736029836139ad565b915061497e82614917565b604082019050919050565b600060208201905081810360008301526149a281614966565b9050919050565b7f43616e6e6f7420696e63726561736520737570706c7900000000000000000000600082015250565b60006149df6016836139ad565b91506149ea826149a9565b602082019050919050565b60006020820190508181036000830152614a0e816149d2565b9050919050565b7f496e76616c69642065646974696f6e73206e756d626572000000000000000000600082015250565b6000614a4b6017836139ad565b9150614a5682614a15565b602082019050919050565b60006020820190508181036000830152614a7a81614a3e565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000614ab76020836139ad565b9150614ac282614a81565b602082019050919050565b60006020820190508181036000830152614ae681614aaa565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000614b236010836139ad565b9150614b2e82614aed565b602082019050919050565b60006020820190508181036000830152614b5281614b16565b9050919050565b7f4f6e6c792061646d696e00000000000000000000000000000000000000000000600082015250565b6000614b8f600a836139ad565b9150614b9a82614b59565b602082019050919050565b60006020820190508181036000830152614bbe81614b82565b9050919050565b7f436f6c6c656374696f6e20646f6573206e6f7420657869737473000000000000600082015250565b6000614bfb601a836139ad565b9150614c0682614bc5565b602082019050919050565b60006020820190508181036000830152614c2a81614bee565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000614c67601f836139ad565b9150614c7282614c31565b602082019050919050565b60006020820190508181036000830152614c9681614c5a565b9050919050565b7f4d696e742064697361626c656400000000000000000000000000000000000000600082015250565b6000614cd3600d836139ad565b9150614cde82614c9d565b602082019050919050565b60006020820190508181036000830152614d0281614cc6565b9050919050565b7f436f6c6c656374696f6e206d696e746564206f75740000000000000000000000600082015250565b6000614d3f6015836139ad565b9150614d4a82614d09565b602082019050919050565b60006020820190508181036000830152614d6e81614d32565b9050919050565b7f5175616e7469747920746f206d696e7420697320657865636565646564000000600082015250565b6000614dab601d836139ad565b9150614db682614d75565b602082019050919050565b60006020820190508181036000830152614dda81614d9e565b9050919050565b7f4261746368206d696e742069732064697361626c656400000000000000000000600082015250565b6000614e176016836139ad565b9150614e2282614de1565b602082019050919050565b60006020820190508181036000830152614e4681614e0a565b9050919050565b7f4d696e742066696e697368656400000000000000000000000000000000000000600082015250565b6000614e83600d836139ad565b9150614e8e82614e4d565b602082019050919050565b60006020820190508181036000830152614eb281614e76565b9050919050565b6000608082019050614ece6000830187613828565b614edb60208301866135ee565b614ee86040830185613828565b614ef5606083018461369e565b95945050505050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b6000614f346014836139ad565b9150614f3f82614efe565b602082019050919050565b60006020820190508181036000830152614f6381614f27565b9050919050565b6000614f7582612dc2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614fa757614fa6613dcf565b5b60018201905091905056fea2646970667358221220556952b3a673dca208b97aae863753d040fbdfe216291cf49b40ca0bdd01844a64736f6c63430008120033

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

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000038d7ea4c6800000000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : isCreatorsOnly (bool): False

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [4] : 00000000000000000000000000000000000000000000000000000000000003e8
Arg [5] : 00000000000000000000000000000000000000000000000000038d7ea4c68000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000019
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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