ETH Price: $3,843.36 (+3.96%)

Contract

0xa53919EEB03C9201c327081e01655C2fC35961c8
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Safe Transfer Fr...203493012024-07-20 17:41:47137 days ago1721497307IN
0xa53919EE...fC35961c8
0 ETH0.000286573.30588924
Set Approval For...179471702023-08-19 6:54:59473 days ago1692428099IN
0xa53919EE...fC35961c8
0 ETH0.0005867212.69796106
Approve179115172023-08-14 7:13:11478 days ago1691997191IN
0xa53919EE...fC35961c8
0 ETH0.0003182411.94311637
Set Approval For...175533702023-06-25 1:55:11529 days ago1687658111IN
0xa53919EE...fC35961c8
0 ETH0.0006041713.05874094
Set Approval For...174407142023-06-09 5:49:47545 days ago1686289787IN
0xa53919EE...fC35961c8
0 ETH0.0008872919.17820665
Set Approval For...167538342023-03-04 8:16:23641 days ago1677917783IN
0xa53919EE...fC35961c8
0 ETH0.0008219917.77129523
Set Approval For...165998842023-02-10 17:35:47663 days ago1676050547IN
0xa53919EE...fC35961c8
0 ETH0.0012570327.21911993
Transfer From160411252022-11-24 16:46:59741 days ago1669308419IN
0xa53919EE...fC35961c8
0 ETH0.0006851322.87306122
Approve160411242022-11-24 16:46:47741 days ago1669308407IN
0xa53919EE...fC35961c8
0 ETH0.001115922.87306122
Set Approval For...157105362022-10-09 12:27:59787 days ago1665318479IN
0xa53919EE...fC35961c8
0 ETH0.0004800119.77813114
Set Approval For...154152202022-08-26 11:59:07831 days ago1661515147IN
0xa53919EE...fC35961c8
0 ETH0.000373378.07022136
Set Approval For...152950402022-08-07 12:01:10850 days ago1659873670IN
0xa53919EE...fC35961c8
0 ETH0.000293676.35912951
Set Approval For...152609322022-08-02 4:22:01856 days ago1659414121IN
0xa53919EE...fC35961c8
0 ETH0.0005979212.92355513
Set Approval For...152589302022-08-01 20:51:49856 days ago1659387109IN
0xa53919EE...fC35961c8
0 ETH0.0008033217.39466252
Set Approval For...152519872022-07-31 18:57:09857 days ago1659293829IN
0xa53919EE...fC35961c8
0 ETH0.000433159.37923765
Set Approval For...152293152022-07-28 6:14:11861 days ago1658988851IN
0xa53919EE...fC35961c8
0 ETH0.00044469.60969511
Set Allowlist Su...152187722022-07-26 14:56:19862 days ago1658847379IN
0xa53919EE...fC35961c8
0 ETH0.0003491814.62971285
Set Mint Phase152187592022-07-26 14:53:39862 days ago1658847219IN
0xa53919EE...fC35961c8
0 ETH0.0004488115.62065343
Set Approval For...152115312022-07-25 12:01:50863 days ago1658750510IN
0xa53919EE...fC35961c8
0 ETH0.0009044919.58534346
Set Approval For...152041532022-07-24 8:07:06864 days ago1658650026IN
0xa53919EE...fC35961c8
0 ETH0.000374398.10691661
Set Approval For...151979892022-07-23 8:58:29865 days ago1658566709IN
0xa53919EE...fC35961c8
0 ETH0.000367947.96722158
Allowlist Mint151978912022-07-23 8:39:56865 days ago1658565596IN
0xa53919EE...fC35961c8
0 ETH0.0019851410.09427499
Set Approval For...151928642022-07-22 14:19:18866 days ago1658499558IN
0xa53919EE...fC35961c8
0 ETH0.0014079930.48790681
Set Approval For...151907562022-07-22 6:24:04866 days ago1658471044IN
0xa53919EE...fC35961c8
0 ETH0.0003203812.16237392
Set Approval For...151907372022-07-22 6:18:44866 days ago1658470724IN
0xa53919EE...fC35961c8
0 ETH0.0005016710.84885912
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SAD

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 17 : SAD.sol
// SPDX-License-Identifier: MIT

//       _______  _______  ______             _
//      (  ____ \(  ___  )(  __  \           / )
//      | (    \/| (   ) || (  \  )      _  / /
//      | (_____ | (___) || |   ) |     (_)( (
//      (_____  )|  ___  || |   | |        | |
//            ) || (   ) || |   ) |      _ ( (
//      /\____) || )   ( || (__/  )     (_) \ \
//      \_______)|/     \|(______/           \_)

pragma solidity ^0.8.0;

import "ERC721.sol";
import "IERC721Receiver.sol";
import "Ownable.sol";
import "ERC721Enumerable.sol";
import "ERC721Royalty.sol";
import "ECDSA.sol";

/// @title SAD Society official contract
contract SAD is ERC721, IERC721Receiver, Ownable, ERC721Enumerable, ERC721Royalty {

    // ******************** //
    // *** GENERAL INFO *** //
    // ******************** //

    using ECDSA for bytes32;

    enum MintPhase {OFF, ALLOWLIST, PUBLIC}

    /// @dev How many tokens are left for breeding
    uint256 public availableForBreed = TOTAL_SADS - _RESERVE;

    /// @dev How many times a token has been staked for breeding and finished the process
    mapping(uint256 => uint256) public bredCount;

    /// @dev How many tokens have been bred
    uint256 public bred;

    uint256 public allowlistSupply;

    uint256 public allowlistMinted;

    address public allowlistSigner;

    string internal _baseURIInternal;

    MintPhase public currentMintPhase = MintPhase.OFF;

    /// @dev To prevent wallets from minting more than once
    mapping(address => bool) public hasMinted;

    mapping(uint256 => uint256) private _parents;

    string public constant PROVENANCE = "948c53a9e992089e7fda8770f18ffa4ae1f18bca1a4ae2c0871cc42f95608a07";

    uint256 public publicMinted;

    uint256 private constant _RESERVE = 20;

    address public royaltyAddress;

    uint256 private _sadFemaleMintIndex;

    uint256 private _sadMaleMintIndex;

    uint256 public constant SPEED_UP_PRICE_SEC = 34722222222;

    /// @dev Mapping of address to int array to keep track of what address has staked what tokens
    mapping(address => uint256[]) private _stakerToTokens;

    /// @dev Mapping to keep track of when each staker has staked 2 tokens to breed together
    mapping(uint256 => mapping(address => uint256)) private _stakeTimes;

    bool public stakingIsActive = false;

    uint256 public constant TOTAL_SADS = 7777;

    uint256 public constant TOTAL_SADS_FOR_MINT = 4444;

    /// @dev Enable ERC-721 token receiving for the staking process
    function onERC721Received(
        address _operator,
        address _from,
        uint256 _tokenId,
        bytes calldata _data
    ) external view override returns (bytes4) {
        return this.onERC721Received.selector;
    }

    /// @dev Returns royalty price of a token for marketplaces supporting the EIP-2981 royalty standard.
    function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) {
        uint256 royaltyAmount = (_salePrice * 750) / _feeDenominator();
        return (royaltyAddress, royaltyAmount);
    }

    function supportsInterface(bytes4 _interfaceId) public view virtual override(ERC721, ERC721Enumerable, ERC721Royalty) returns (bool) {
        return super.supportsInterface(_interfaceId);
    }

    // ******************** //
    // **** INITIALIZE **** //
    // ******************** //

    constructor() ERC721("SAD Society", "SAD") {}

    // ******************** //
    // **** CONDITIONS **** //
    // ******************** //

    function allowlistSaleActive() public view returns (bool) {
        return (currentMintPhase == MintPhase.ALLOWLIST || currentMintPhase == MintPhase.PUBLIC);
    }

    modifier isSignatureValid(bytes memory _signature, address _msgSender) {
        bytes32 messageHash = keccak256(abi.encodePacked(address(this), _msgSender));
        address signer = messageHash.toEthSignedMessageHash().recover(_signature);
        require(signer == allowlistSigner, "You are not in allowlist");
        _;
    }

    function publicSaleActive() public view returns (bool) {
        return currentMintPhase == MintPhase.PUBLIC;
    }

    // ******************** //
    // ***** ALLOWLIST **** //
    // ******************** //

    function allowlistMint(bytes memory _signature) public isSignatureValid(_signature, msg.sender) {
        require(allowlistSaleActive(), "Sale in not active");
        require(
            allowlistMinted + 1 <= allowlistSupply,
            "Purchase would exceed supply of allowlist tokens"
        );
        require(!hasMinted[msg.sender], "You have already minted your free SAD");

        allowlistMinted++;
        availableForBreed--;
        hasMinted[msg.sender] = true;
        _safeMintSad(msg.sender);
    }

    // ******************** //
    // **** PUBLIC SALE *** //
    // ******************** //

    function publicMint() public {
        require(publicSaleActive(), "Public sale in not active");
        require(
            TOTAL_SADS_FOR_MINT - allowlistSupply - publicMinted - 1 >= 0,
            "Purchase would exceed supply of public sale tokens"
        );
        require(!hasMinted[msg.sender], "You have already minted your free SAD");

        publicMinted++;
        availableForBreed--;
        hasMinted[msg.sender] = true;
        _safeMintSad(msg.sender);

    }

    // ******************** //
    // ***** BREEDING ***** //
    // ******************** //

    /// @dev Staker cancels breeding of 2 tokens and gets their tokens back
    function cancelStake(uint256 _tokenId1, uint256 _tokenId2) external {
        uint256 concat;
        if (_tokenId1 > _tokenId2) {
            concat = _tokenId1 * 10000 + _tokenId2;
        } else {
            concat = _tokenId2 * 10000 + _tokenId1;
        }
        require(_stakeTimes[concat][msg.sender] != 0, "Selected tokens are not staked or you are not the staker");
        _safeTransfer(address(this), msg.sender, _tokenId1, "");
        _safeTransfer(address(this), msg.sender, _tokenId2, "");
        delete _stakeTimes[concat][msg.sender];
        _removeTokenIdFromArray(_stakerToTokens[msg.sender], _tokenId1, _tokenId2);
        availableForBreed++;
    }

    /// @dev Checks conditions for breeding 2 tokens together. The conditions are as follows:
    ///      1. The supply for breeding a new token has not finished
    ///      2. The 2 tokens are of opposite sexes
    ///      3. Transaction sender is owner of both tokens
    ///      4. The 2 tokens are not related (siblings, half-siblings, parent or child of each other
    ///      If all requirements are met, returns how much time it takes for the breeding to complete and the price
    ///      to instantly finish the process
    function checkForBreed(uint256 _tokenId1, uint256 _tokenId2) public view returns (uint256 time, uint256 cost) {
        uint256 concat;
        if (_tokenId1 > _tokenId2) {
            concat = _tokenId1 * 10000 + _tokenId2;
        } else {
            concat = _tokenId2 * 10000 + _tokenId1;
        }
        uint256 parents1 = _parents[_tokenId1];
        uint256 parents2 = _parents[_tokenId2];
        require(availableForBreed > 0, "There are currently no more available tokens left. That might change if a staker cancels their stake");
        require(((_tokenId1 < 3889 && _tokenId2 >= 3889) || (_tokenId1 >= 3889 && _tokenId2 < 3889)), "You can only breed a male and a female SAD together");
        require(ownerOf(_tokenId1) == msg.sender && ownerOf(_tokenId2) == msg.sender, "You are not the owner of the requested tokens");
        if (!(parents1 / 10000 == 0 && parents2 / 10000 == 0)) {
            require(
                parents1 / 10000 != parents2 / 10000 &&
                parents1 % 10000 != parents2 % 10000 &&
                _tokenId1 != parents2 / 10000 &&
                _tokenId1 != parents2 % 10000 &&
                _tokenId2 != parents1 / 10000 &&
                _tokenId2 != parents1 % 10000,
                "You cannot breed siblings/half-siblings together or children with their parents"
            );
        }
        uint256 bredCount1 = bredCount[_tokenId1];
        uint256 bredCount2 = bredCount[_tokenId2];
        uint256 maxCount;
        if (bredCount1 > bredCount2) {
            maxCount = bredCount1;
        } else {
            maxCount = bredCount2;
        }
        uint256 breedTime = 200;
        for (uint256 i = 1; i < maxCount + 1; i++) {
            breedTime = breedTime * 161;
        }
        breedTime = breedTime / (100 ** (maxCount + 1));
        breedTime = breedTime * (1 weeks);
        uint256 price = breedTime * SPEED_UP_PRICE_SEC;
        return (breedTime, price);
    }

    function claimBreed(uint256 _tokenId1, uint256 _tokenId2) external {
        bool senderIsStaker = false;
        uint256 concat;
        if (_tokenId1 > _tokenId2) {
            concat = _tokenId1 * 10000 + _tokenId2;
        } else {
            concat = _tokenId2 * 10000 + _tokenId1;
        }
        for (uint256 i = 0; i < _stakerToTokens[msg.sender].length; i++) {
            if (_stakerToTokens[msg.sender][i] == concat) {
                senderIsStaker = true;
                break;
            }
        }
        require(senderIsStaker, "Selected tokens are not staked or you are not the staker");
        require(getRemainingBreedTime(_tokenId1, _tokenId2) == 0, "Breed time has not finished yet");
        _safeTransfer(address(this), msg.sender, _tokenId1, "");
        _safeTransfer(address(this), msg.sender, _tokenId2, "");
        uint256 bredToken = _safeMintSad(msg.sender);
        bred++;
        bredCount[_tokenId1]++;
        bredCount[_tokenId2]++;
        _parents[bredToken] = concat;
        delete _stakeTimes[concat][msg.sender];
        _removeTokenIdFromArray(_stakerToTokens[msg.sender], _tokenId1, _tokenId2);
    }

    /// @dev Returns token IDs for the parents of a selected token. Returns 0 for both if selected token is Gen0
    function getParents(uint256 _tokenId) public view returns (uint256, uint256) {
        uint256 parents_ = _parents[_tokenId];
        uint256 mother = parents_ / 10000;
        uint256 father = parents_ % 10000;
        return (mother, father);
    }

    /// @dev Returns the currently remaining time in seconds for the breeding process of 2 tokens to finish,
    ///      returns 0 if the process has completed
    function getRemainingBreedTime(uint256 _tokenId1, uint256 _tokenId2) public view returns (uint256) {
        uint256 concat;
        if (_tokenId1 > _tokenId2) {
            concat = _tokenId1 * 10000 + _tokenId2;
        } else {
            concat = _tokenId2 * 10000 + _tokenId1;
        }
        require(_stakeTimes[concat][msg.sender] != 0, "Selected tokens are not staked or you are not the staker");
        uint256 bredCount1 = bredCount[_tokenId1];
        uint256 bredCount2 = bredCount[_tokenId2];
        uint256 maxCount;
        if (bredCount1 > bredCount2) {
            maxCount = bredCount1;
        } else {
            maxCount = bredCount2;
        }
        uint256 breedTime = 200;
        for (uint256 i = 1; i < maxCount + 1; i++) {
            breedTime = breedTime * 161;
        }
        breedTime = breedTime / (100 ** (maxCount + 1));
        breedTime = breedTime * (1 weeks);
        uint256 stakedAt = _stakeTimes[concat][msg.sender];
        uint256 dueTime = stakedAt + breedTime;
        if (dueTime > block.timestamp) {
            return dueTime - block.timestamp;
        } else {
            return 0;
        }
    }

    /// @dev Get the current cost of instantly finishing the breeding process of 2 tokens
    function getSpeedUpPrice(uint256 _tokenId1, uint256 _tokenId2) public view returns (uint256) {
        uint256 remainingTime = getRemainingBreedTime(_tokenId1, _tokenId2);
        uint256 price = remainingTime * SPEED_UP_PRICE_SEC;
        return price;
    }

    /// @dev Returns token IDs of tokens a wallet address has staked for breeding
    function getStakedTokens() public view returns (uint256[] memory) {
        uint256 stakedCount = _stakerToTokens[msg.sender].length;
        uint256[] memory stakedTokens = new uint256[](stakedCount * 2);
        for (uint256 i = 0; i < stakedCount; i++) {
            stakedTokens[i * 2] = (_stakerToTokens[msg.sender][i] / 10000);
            stakedTokens[(i * 2) + 1] = (_stakerToTokens[msg.sender][i] % 10000);
        }
        return stakedTokens;
    }

    /// @dev Instantly completes the breeding process at a cost determined by the remaining breeding time.
    function instantBreed(uint256 _tokenId1, uint256 _tokenId2) public payable {
        bool senderIsStaker = false;
        uint256 concat;
        if (_tokenId1 > _tokenId2) {
            concat = _tokenId1 * 10000 + _tokenId2;
        } else {
            concat = _tokenId2 * 10000 + _tokenId1;
        }
        for (uint256 i = 0; i < _stakerToTokens[msg.sender].length; i++) {
            if (_stakerToTokens[msg.sender][i] == concat) {
                senderIsStaker = true;
                break;
            }
        }
        require(senderIsStaker, "Selected tokens are not staked or you are not the staker");
        uint256 price = getSpeedUpPrice(_tokenId1, _tokenId2);
        require(msg.value >= price, "Ether value sent is not correct");
        _safeTransfer(address(this), msg.sender, _tokenId1, "");
        _safeTransfer(address(this), msg.sender, _tokenId2, "");
        uint256 bredToken = _safeMintSad(msg.sender);
        bred++;
        bredCount[_tokenId1]++;
        bredCount[_tokenId2]++;
        _parents[bredToken] = concat;
        delete _stakeTimes[concat][msg.sender];
        _removeTokenIdFromArray(_stakerToTokens[msg.sender], _tokenId1, _tokenId2);
    }

    /// @dev Stake 2 tokens to breed together
    function stakeForBreed(uint256 _tokenId1, uint256 _tokenId2) external {
        require(stakingIsActive, "Staking is not active");
        uint256 concat;
        if (_tokenId1 > _tokenId2) {
            concat = _tokenId1 * 10000 + _tokenId2;
        } else {
            concat = _tokenId2 * 10000 + _tokenId1;
        }
        uint256 parents1 = _parents[_tokenId1];
        uint256 parents2 = _parents[_tokenId2];
        require(availableForBreed > 0, "There are currently no more available tokens left. That might change if a staker cancels their stake");
        require(((_tokenId1 < 3889 && _tokenId2 >= 3889) || (_tokenId1 >= 3889 && _tokenId2 < 3889)), "You can only breed a male and a female SAD together");
        require(ownerOf(_tokenId1) == msg.sender && ownerOf(_tokenId2) == msg.sender, "You are not the owner of the requested tokens");
        if (!(parents1 / 10000 == 0 && parents2 / 10000 == 0)) {
            require(
                parents1 / 10000 != parents2 / 10000 &&
                parents1 % 10000 != parents2 % 10000 &&
                _tokenId1 != parents2 / 10000 &&
                _tokenId1 != parents2 % 10000 &&
                _tokenId2 != parents1 / 10000 &&
                _tokenId2 != parents1 % 10000,
                "You cannot breed siblings/half-siblings together or children with their parents"
            );
        }
        _safeTransfer(msg.sender, address(this), _tokenId1, "");
        _safeTransfer(msg.sender, address(this), _tokenId2, "");
        _stakeTimes[concat][msg.sender] = block.timestamp;
        _stakerToTokens[msg.sender].push(concat);
        availableForBreed--;
    }

    // ******************** //
    // ***** CLAIMING ***** //
    // ******************** //

    address public badContractAddress;

    function burnSads(uint256[5] memory _tokenIdList)
    external returns (bool) {
        require(msg.sender == badContractAddress, "Sender is not BAD contract");
        _burn(_tokenIdList[0]);
        _burn(_tokenIdList[1]);
        _burn(_tokenIdList[2]);
        _burn(_tokenIdList[3]);
        _burn(_tokenIdList[4]);
        return true;
    }

    // ******************** //
    // ******* ADMIN ****** //
    // ******************** //

    function flipStakeState() public onlyOwner {
        stakingIsActive = !stakingIsActive;
    }

    /// @dev Mint the reserved tokens to contract owner
    function reserveSads() public onlyOwner {
        for (uint256 i = 0; i < _RESERVE / 2; i++) {
            _safeMint(msg.sender, i);
            _safeMint(msg.sender, (TOTAL_SADS / 2) + 1 + i);
        }
    }

    function setAllowlistSigner(address _address) public onlyOwner {
        allowlistSigner = _address;
    }

    function setAllowlistSupply(uint256 _supply) public onlyOwner {
        allowlistSupply = _supply;
    }

    function setBadContractAddress(address _address) public onlyOwner {
        badContractAddress = _address;
    }

    function setBaseURI(string memory _baseURIToSet) public onlyOwner {
        _baseURIInternal = _baseURIToSet;
    }

    function setMintPhase(MintPhase phase) public onlyOwner {
        currentMintPhase = phase;
    }

    function setRoyaltyAddress(address _royaltyAddress) public onlyOwner {
        royaltyAddress = _royaltyAddress;
    }

    function withdraw() public onlyOwner {
        uint256 balance = address(this).balance;
        payable(msg.sender).transfer(balance);
    }

    // ******************** //
    // ****** UTILITY ***** //
    // ******************** //

    function _baseURI() internal view override returns (string memory) {
        return _baseURIInternal;
    }

    function _beforeTokenTransfer(address _from, address _to, uint256 _tokenId) internal override(ERC721, ERC721Enumerable) {
        super._beforeTokenTransfer(_from, _to, _tokenId);
    }

    function _burn(uint256 _tokenId) internal virtual override(ERC721, ERC721Royalty) {
        super._burn(_tokenId);
        _resetTokenRoyalty(_tokenId);
    }

    function _removeTokenIdFromArray(uint256[] storage _array, uint256 _tokenId1, uint256 _tokenId2) internal {
        uint256 concat;
        if (_tokenId1 > _tokenId2) {
            concat = _tokenId1 * 10000 + _tokenId2;
        } else {
            concat = _tokenId2 * 10000 + _tokenId1;
        }
        uint256 length = _array.length;
        for (uint256 i = 0; i < length; i++) {
            if (_array[i] == concat) {
                length--;
                if (i < length) {
                    _array[i] = _array[length];
                }
                _array.pop();
                break;
            }
        }
    }

    function _safeMintSad(address _to) internal returns (uint256) {
        uint8 randomNumber = uint8(
            uint256(
                keccak256(
                    abi.encodePacked(
                        block.timestamp,
                        block.difficulty,
                        msg.sender,
                        _sadMaleMintIndex + _sadFemaleMintIndex
                    )
                )
            ) % 2
        );
        if (randomNumber == 0) {
            if (_sadMaleMintIndex < TOTAL_SADS / 2 - _RESERVE / 2 + 1) {
                _safeMint(_to, _sadMaleMintIndex + _RESERVE / 2);
                _sadMaleMintIndex = _sadMaleMintIndex + 1;
                return _sadMaleMintIndex + _RESERVE / 2 - 1;

            } else {
                _safeMint(
                    _to,
                    _sadFemaleMintIndex + 1 + TOTAL_SADS / 2 + _RESERVE / 2
                );
                _sadFemaleMintIndex = _sadFemaleMintIndex + 1;
                return _sadFemaleMintIndex + 1 + TOTAL_SADS / 2 + _RESERVE / 2 - 1;
            }
        } else {
            if (_sadFemaleMintIndex < TOTAL_SADS / 2 - _RESERVE / 2) {
                _safeMint(
                    _to,
                    _sadFemaleMintIndex + 1 + TOTAL_SADS / 2 + _RESERVE / 2
                );
                _sadFemaleMintIndex = _sadFemaleMintIndex + 1;
                return _sadFemaleMintIndex + 1 + TOTAL_SADS / 2 + _RESERVE / 2 - 1;
            } else {
                _safeMint(_to, _sadMaleMintIndex + _RESERVE / 2);
                _sadMaleMintIndex = _sadMaleMintIndex + 1;
                return _sadMaleMintIndex + _RESERVE / 2 - 1;
            }
        }
    }
}

File 2 of 17 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "IERC721.sol";
import "IERC721Receiver.sol";
import "IERC721Metadata.sol";
import "Address.sol";
import "Context.sol";
import "Strings.sol";
import "ERC165.sol";

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

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

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

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

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

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}

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

pragma solidity ^0.8.0;

import "IERC165.sol";

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

File 6 of 17 : 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 7 of 17 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

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

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

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

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

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

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

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

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

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

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

File 8 of 17 : 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 9 of 17 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

File 10 of 17 : 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 11 of 17 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "Context.sol";

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

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

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

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

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

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

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

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

File 12 of 17 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "IERC721.sol";

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

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

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

File 14 of 17 : ERC721Royalty.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/ERC721Royalty.sol)

pragma solidity ^0.8.0;

import "ERC721.sol";
import "ERC2981.sol";
import "ERC165.sol";

/**
 * @dev Extension of ERC721 with the ERC2981 NFT Royalty Standard, a standardized way to retrieve royalty payment
 * information.
 *
 * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
 * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
 *
 * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
 * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
 * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
 *
 * _Available since v4.5._
 */
abstract contract ERC721Royalty is ERC2981, ERC721 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC2981) returns (bool) {
        return super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {ERC721-_burn}. This override additionally clears the royalty information for the token.
     */
    function _burn(uint256 tokenId) internal virtual override {
        super._burn(tokenId);
        _resetTokenRoyalty(tokenId);
    }
}

File 15 of 17 : ERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/common/ERC2981.sol)

pragma solidity ^0.8.0;

import "IERC2981.sol";
import "ERC165.sol";

/**
 * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
 *
 * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
 * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
 *
 * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
 * fee is specified in basis points by default.
 *
 * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
 * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
 * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
 *
 * _Available since v4.5._
 */
abstract contract ERC2981 is IERC2981, ERC165 {
    struct RoyaltyInfo {
        address receiver;
        uint96 royaltyFraction;
    }

    RoyaltyInfo private _defaultRoyaltyInfo;
    mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;

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

    /**
     * @inheritdoc IERC2981
     */
    function royaltyInfo(uint256 _tokenId, uint256 _salePrice)
        external
        view
        virtual
        override
        returns (address, uint256)
    {
        RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId];

        if (royalty.receiver == address(0)) {
            royalty = _defaultRoyaltyInfo;
        }

        uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator();

        return (royalty.receiver, royaltyAmount);
    }

    /**
     * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
     * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
     * override.
     */
    function _feeDenominator() internal pure virtual returns (uint96) {
        return 10000;
    }

    /**
     * @dev Sets the royalty information that all ids in this contract will default to.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: invalid receiver");

        _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Removes default royalty information.
     */
    function _deleteDefaultRoyalty() internal virtual {
        delete _defaultRoyaltyInfo;
    }

    /**
     * @dev Sets the royalty information for a specific token id, overriding the global default.
     *
     * Requirements:
     *
     * - `tokenId` must be already minted.
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setTokenRoyalty(
        uint256 tokenId,
        address receiver,
        uint96 feeNumerator
    ) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: Invalid parameters");

        _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Resets royalty information for the token id back to the global default.
     */
    function _resetTokenRoyalty(uint256 tokenId) internal virtual {
        delete _tokenRoyaltyInfo[tokenId];
    }
}

File 16 of 17 : IERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

import "IERC165.sol";

/**
 * @dev Interface for the NFT Royalty Standard.
 *
 * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
 * support for royalty payments across all NFT marketplaces and ecosystem participants.
 *
 * _Available since v4.5._
 */
interface IERC2981 is IERC165 {
    /**
     * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
     * exchange. The royalty amount is denominated and should be payed in that same unit of exchange.
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        external
        view
        returns (address receiver, uint256 royaltyAmount);
}

File 17 of 17 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"PROVENANCE","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SPEED_UP_PRICE_SEC","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOTAL_SADS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOTAL_SADS_FOR_MINT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"allowlistMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"allowlistMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowlistSaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowlistSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowlistSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"availableForBreed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"badContractAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bred","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"bredCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[5]","name":"_tokenIdList","type":"uint256[5]"}],"name":"burnSads","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId1","type":"uint256"},{"internalType":"uint256","name":"_tokenId2","type":"uint256"}],"name":"cancelStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId1","type":"uint256"},{"internalType":"uint256","name":"_tokenId2","type":"uint256"}],"name":"checkForBreed","outputs":[{"internalType":"uint256","name":"time","type":"uint256"},{"internalType":"uint256","name":"cost","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId1","type":"uint256"},{"internalType":"uint256","name":"_tokenId2","type":"uint256"}],"name":"claimBreed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentMintPhase","outputs":[{"internalType":"enum SAD.MintPhase","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"flipStakeState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getParents","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId1","type":"uint256"},{"internalType":"uint256","name":"_tokenId2","type":"uint256"}],"name":"getRemainingBreedTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId1","type":"uint256"},{"internalType":"uint256","name":"_tokenId2","type":"uint256"}],"name":"getSpeedUpPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStakedTokens","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"hasMinted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId1","type":"uint256"},{"internalType":"uint256","name":"_tokenId2","type":"uint256"}],"name":"instantBreed","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"publicMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicSaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reserveSads","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royaltyAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setAllowlistSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_supply","type":"uint256"}],"name":"setAllowlistSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setBadContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_baseURIToSet","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum SAD.MintPhase","name":"phase","type":"uint8"}],"name":"setMintPhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_royaltyAddress","type":"address"}],"name":"setRoyaltyAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId1","type":"uint256"},{"internalType":"uint256","name":"_tokenId2","type":"uint256"}],"name":"stakeForBreed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingIsActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052620000136014611e61620001bd565b600d556014805460ff19908116909155601d805490911690553480156200003957600080fd5b50604080518082018252600b81526a53414420536f636965747960a81b60208083019182528351808501909452600384526214d05160ea1b908401528151919291620000889160029162000117565b5080516200009e90600390602084019062000117565b505050620000bb620000b5620000c160201b60201c565b620000c5565b6200021f565b3390565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8280546200012590620001e3565b90600052602060002090601f01602090048101928262000149576000855562000194565b82601f106200016457805160ff191683800117855562000194565b8280016001018555821562000194579182015b828111156200019457825182559160200191906001019062000177565b50620001a2929150620001a6565b5090565b5b80821115620001a25760008155600101620001a7565b600082821015620001de57634e487b7160e01b600052601160045260246000fd5b500390565b600181811c90821680620001f857607f821691505b6020821081036200021957634e487b7160e01b600052602260045260246000fd5b50919050565b614555806200022f6000396000f3fe6080604052600436106103975760003560e01c80636352211e116101dc578063a6cdae6a11610102578063d55e69b9116100a0578063e985e9c51161006f578063e985e9c514610aa3578063f2fde38b14610aec578063f6e5481814610b0c578063fd49af1314610b2257600080fd5b8063d55e69b914610a30578063db68d5c414610a55578063e474def414610a6a578063e64deaeb14610a8a57600080fd5b8063bc8893b4116100dc578063bc8893b4146109c6578063c28449b3146109db578063c32fe11b146109f0578063c87b56dd14610a1057600080fd5b8063a6cdae6a14610966578063ad2f852a14610986578063b88d4fde146109a657600080fd5b80638dd07fc61161017a57806395fc164f1161014957806395fc164f146108f05780639a2203a314610910578063a22cb46514610930578063a4f4f8af1461095057600080fd5b80638dd07fc6146108865780638ee82613146108a65780638f893372146108c657806395d89b41146108db57600080fd5b8063715018a6116101b6578063715018a6146108135780637933bac6146108285780638bab534d146108485780638da5cb5b1461086857600080fd5b80636352211e146107be5780636373a6b1146107de57806370a08231146107f357600080fd5b806326092b83116102c15780633ccfd60b1161025f5780634f6ccce71161022e5780634f6ccce71461075257806355f804b31461077257806360b537a51461079257806361ef1793146107a857600080fd5b80633ccfd60b146106dd5780633fc551d6146106f257806342842e0e1461071257806345d4b3141461073257600080fd5b806331c07bbf1161029b57806331c07bbf1461065d57806332d6f0321461067d57806338e21cce146106935780633c02ee32146106c357600080fd5b806326092b83146105e95780632a55205a146105fe5780632f745c591461063d57600080fd5b80630e469a7c116103395780632065b036116103085780632065b0361461055e5780632277aaa31461057457806323b872dd14610594578063242a0087146105b457600080fd5b80630e469a7c146104cf578063150b7a02146104f157806317667bc51461053657806318160ddd1461054957600080fd5b8063081812fc11610375578063081812fc14610415578063095ea7b31461044d5780630ab3f27f1461046d5780630dd250e1146104a857600080fd5b806301ffc9a71461039c57806306d254da146103d157806306fdde03146103f3575b600080fd5b3480156103a857600080fd5b506103bc6103b73660046139f8565b610b38565b60405190151581526020015b60405180910390f35b3480156103dd57600080fd5b506103f16103ec366004613a31565b610b49565b005b3480156103ff57600080fd5b50610408610b9e565b6040516103c89190613aa4565b34801561042157600080fd5b50610435610430366004613ab7565b610c30565b6040516001600160a01b0390911681526020016103c8565b34801561045957600080fd5b506103f1610468366004613ad0565b610cc5565b34801561047957600080fd5b5061049a610488366004613ab7565b600e6020526000908152604090205481565b6040519081526020016103c8565b3480156104b457600080fd5b506014546104c29060ff1681565b6040516103c89190613b10565b3480156104db57600080fd5b506104e4610dda565b6040516103c89190613b38565b3480156104fd57600080fd5b5061051d61050c366004613b7c565b630a85bd0160e11b95945050505050565b6040516001600160e01b031990911681526020016103c8565b6103f1610544366004613c17565b610f43565b34801561055557600080fd5b50600b5461049a565b34801561056a57600080fd5b5061049a611e6181565b34801561058057600080fd5b506103f161058f366004613c17565b611144565b3480156105a057600080fd5b506103f16105af366004613c39565b61123c565b3480156105c057600080fd5b506105d46105cf366004613ab7565b61126d565b604080519283526020830191909152016103c8565b3480156105f557600080fd5b506103f16112a8565b34801561060a57600080fd5b5061061e610619366004613c17565b611410565b604080516001600160a01b0390931683526020830191909152016103c8565b34801561064957600080fd5b5061049a610658366004613ad0565b611446565b34801561066957600080fd5b506103f1610678366004613c75565b6114dc565b34801561068957600080fd5b5061049a60115481565b34801561069f57600080fd5b506103bc6106ae366004613a31565b60156020526000908152604090205460ff1681565b3480156106cf57600080fd5b50601d546103bc9060ff1681565b3480156106e957600080fd5b506103f161152d565b3480156106fe57600080fd5b506103f161070d366004613c17565b61158a565b34801561071e57600080fd5b506103f161072d366004613c39565b61183d565b34801561073e57600080fd5b506103f161074d366004613c17565b611858565b34801561075e57600080fd5b5061049a61076d366004613ab7565b611a51565b34801561077e57600080fd5b506103f161078d366004613d22565b611ae4565b34801561079e57600080fd5b5061049a600d5481565b3480156107b457600080fd5b5061049a600f5481565b3480156107ca57600080fd5b506104356107d9366004613ab7565b611b21565b3480156107ea57600080fd5b50610408611b98565b3480156107ff57600080fd5b5061049a61080e366004613a31565b611bb4565b34801561081f57600080fd5b506103f1611c3b565b34801561083457600080fd5b5061049a610843366004613c17565b611c71565b34801561085457600080fd5b506103f1610863366004613ab7565b611dd6565b34801561087457600080fd5b506008546001600160a01b0316610435565b34801561089257600080fd5b506103f16108a1366004613a31565b611e05565b3480156108b257600080fd5b506103bc6108c1366004613d6b565b611e57565b3480156108d257600080fd5b506103f1611efe565b3480156108e757600080fd5b50610408611f86565b3480156108fc57600080fd5b506103f161090b366004613e09565b611f95565b34801561091c57600080fd5b5061049a61092b366004613c17565b6121e0565b34801561093c57600080fd5b506103f161094b366004613e3e565b612209565b34801561095c57600080fd5b5061049a60175481565b34801561097257600080fd5b506105d4610981366004613c17565b612214565b34801561099257600080fd5b50601854610435906001600160a01b031681565b3480156109b257600080fd5b506103f16109c1366004613e7a565b6124b3565b3480156109d257600080fd5b506103bc6124eb565b3480156109e757600080fd5b506103f161250d565b3480156109fc57600080fd5b50601254610435906001600160a01b031681565b348015610a1c57600080fd5b50610408610a2b366004613ab7565b61254b565b348015610a3c57600080fd5b50601d546104359061010090046001600160a01b031681565b348015610a6157600080fd5b506103bc612626565b348015610a7657600080fd5b506103f1610a85366004613a31565b612654565b348015610a9657600080fd5b5061049a6408159b108e81565b348015610aaf57600080fd5b506103bc610abe366004613ee2565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610af857600080fd5b506103f1610b07366004613a31565b6126a0565b348015610b1857600080fd5b5061049a61115c81565b348015610b2e57600080fd5b5061049a60105481565b6000610b4382612738565b92915050565b6008546001600160a01b03163314610b7c5760405162461bcd60e51b8152600401610b7390613f15565b60405180910390fd5b601880546001600160a01b0319166001600160a01b0392909216919091179055565b606060028054610bad90613f4a565b80601f0160208091040260200160405190810160405280929190818152602001828054610bd990613f4a565b8015610c265780601f10610bfb57610100808354040283529160200191610c26565b820191906000526020600020905b815481529060010190602001808311610c0957829003601f168201915b5050505050905090565b6000818152600460205260408120546001600160a01b0316610ca95760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b73565b506000908152600660205260409020546001600160a01b031690565b6000610cd082611b21565b9050806001600160a01b0316836001600160a01b031603610d3d5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610b73565b336001600160a01b0382161480610d595750610d598133610abe565b610dcb5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610b73565b610dd58383612743565b505050565b336000908152601b6020526040812054606091610df8826002613f94565b67ffffffffffffffff811115610e1057610e10613c96565b604051908082528060200260200182016040528015610e39578160200160208202803683370190505b50905060005b82811015610f3c57336000908152601b602052604090208054612710919083908110610e6d57610e6d613fb3565b9060005260206000200154610e829190613fdf565b82610e8e836002613f94565b81518110610e9e57610e9e613fb3565b602002602001018181525050612710601b6000336001600160a01b03166001600160a01b031681526020019081526020016000208281548110610ee357610ee3613fb3565b9060005260206000200154610ef89190613ff3565b82610f04836002613f94565b610f0f906001614007565b81518110610f1f57610f1f613fb3565b602090810291909101015280610f348161401f565b915050610e3f565b5092915050565b60008082841115610f6c5782610f5b85612710613f94565b610f659190614007565b9050610f86565b83610f7984612710613f94565b610f839190614007565b90505b60005b336000908152601b6020526040902054811015610fef57336000908152601b60205260409020805483919083908110610fc457610fc4613fb3565b906000526020600020015403610fdd5760019250610fef565b80610fe78161401f565b915050610f89565b508161100d5760405162461bcd60e51b8152600401610b7390614038565b600061101985856121e0565b90508034101561106b5760405162461bcd60e51b815260206004820152601f60248201527f45746865722076616c75652073656e74206973206e6f7420636f7272656374006044820152606401610b73565b611086303387604051806020016040528060008152506127b1565b6110a1303386604051806020016040528060008152506127b1565b60006110ac336127e4565b600f805491925060006110be8361401f565b90915550506000868152600e602052604081208054916110dd8361401f565b90915550506000858152600e602052604081208054916110fc8361401f565b90915550506000818152601660209081526040808320869055858352601c82528083203384528252808320839055601b909152902061113c9087876129bd565b505050505050565b60008183111561116c578161115b84612710613f94565b6111659190614007565b9050611186565b8261117983612710613f94565b6111839190614007565b90505b6000818152601c6020908152604080832033845290915281205490036111be5760405162461bcd60e51b8152600401610b7390614038565b6111d9303385604051806020016040528060008152506127b1565b6111f4303384604051806020016040528060008152506127b1565b6000818152601c602090815260408083203384528252808320839055601b90915290206112229084846129bd565b600d80549060006112328361401f565b9190505550505050565b6112463382612abd565b6112625760405162461bcd60e51b8152600401610b7390614095565b610dd5838383612bb4565b60008181526016602052604081205481908161128b61271083613fdf565b9050600061129b61271084613ff3565b9196919550909350505050565b6112b06124eb565b6112fc5760405162461bcd60e51b815260206004820152601960248201527f5075626c69632073616c6520696e206e6f7420616374697665000000000000006044820152606401610b73565b6000600160175460105461115c61131391906140e6565b61131d91906140e6565b61132791906140e6565b10156113905760405162461bcd60e51b815260206004820152603260248201527f507572636861736520776f756c642065786365656420737570706c79206f66206044820152717075626c69632073616c6520746f6b656e7360701b6064820152608401610b73565b3360009081526015602052604090205460ff16156113c05760405162461bcd60e51b8152600401610b73906140fd565b601780549060006113d08361401f565b9091555050600d80549060006113e583614142565b9091555050336000818152601560205260409020805460ff1916600117905561140d906127e4565b50565b60008080612710611423856102ee613f94565b61142d9190613fdf565b6018546001600160a01b031693509150505b9250929050565b600061145183611bb4565b82106114b35760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610b73565b506001600160a01b03919091166000908152600960209081526040808320938352929052205490565b6008546001600160a01b031633146115065760405162461bcd60e51b8152600401610b7390613f15565b6014805482919060ff1916600183600281111561152557611525613afa565b021790555050565b6008546001600160a01b031633146115575760405162461bcd60e51b8152600401610b7390613f15565b6040514790339082156108fc029083906000818181858888f19350505050158015611586573d6000803e3d6000fd5b5050565b601d5460ff166115d45760405162461bcd60e51b81526020600482015260156024820152745374616b696e67206973206e6f742061637469766560581b6044820152606401610b73565b6000818311156115fc57816115eb84612710613f94565b6115f59190614007565b9050611616565b8261160983612710613f94565b6116139190614007565b90505b60008381526016602052604080822054848352912054600d5461164b5760405162461bcd60e51b8152600401610b7390614159565b610f318510801561165e5750610f318410155b806116775750610f3185101580156116775750610f3184105b6116935760405162461bcd60e51b8152600401610b73906141e9565b3361169d86611b21565b6001600160a01b03161480156116c35750336116b885611b21565b6001600160a01b0316145b6116df5760405162461bcd60e51b8152600401610b739061423c565b6116eb61271083613fdf565b15801561170157506116ff61271082613fdf565b155b6117b95761171161271082613fdf565b61171d61271084613fdf565b14158015611741575061173261271082613ff3565b61173e61271084613ff3565b14155b8015611758575061175461271082613fdf565b8514155b801561176f575061176b61271082613ff3565b8514155b8015611786575061178261271083613fdf565b8414155b801561179d575061179961271083613ff3565b8414155b6117b95760405162461bcd60e51b8152600401610b7390614289565b6117d4333087604051806020016040528060008152506127b1565b6117ef333086604051806020016040528060008152506127b1565b6000838152601c602090815260408083203384528252808320429055601b82528220805460018101825590835290822001849055600d80549161183183614142565b91905055505050505050565b610dd5838383604051806020016040528060008152506124b3565b60008082841115611881578261187085612710613f94565b61187a9190614007565b905061189b565b8361188e84612710613f94565b6118989190614007565b90505b60005b336000908152601b602052604090205481101561190457336000908152601b602052604090208054839190839081106118d9576118d9613fb3565b9060005260206000200154036118f25760019250611904565b806118fc8161401f565b91505061189e565b50816119225760405162461bcd60e51b8152600401610b7390614038565b61192c8484611c71565b156119795760405162461bcd60e51b815260206004820152601f60248201527f42726565642074696d6520686173206e6f742066696e697368656420796574006044820152606401610b73565b611994303386604051806020016040528060008152506127b1565b6119af303385604051806020016040528060008152506127b1565b60006119ba336127e4565b600f805491925060006119cc8361401f565b90915550506000858152600e602052604081208054916119eb8361401f565b90915550506000848152600e60205260408120805491611a0a8361401f565b90915550506000818152601660209081526040808320859055848352601c82528083203384528252808320839055601b9091529020611a4a9086866129bd565b5050505050565b6000611a5c600b5490565b8210611abf5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610b73565b600b8281548110611ad257611ad2613fb3565b90600052602060002001549050919050565b6008546001600160a01b03163314611b0e5760405162461bcd60e51b8152600401610b7390613f15565b8051611586906013906020840190613949565b6000818152600460205260408120546001600160a01b031680610b435760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610b73565b6040518060600160405280604081526020016144e06040913981565b60006001600160a01b038216611c1f5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610b73565b506001600160a01b031660009081526005602052604090205490565b6008546001600160a01b03163314611c655760405162461bcd60e51b8152600401610b7390613f15565b611c6f6000612d5b565b565b60008082841115611c9a5782611c8985612710613f94565b611c939190614007565b9050611cb4565b83611ca784612710613f94565b611cb19190614007565b90505b6000818152601c602090815260408083203384529091528120549003611cec5760405162461bcd60e51b8152600401610b7390614038565b6000848152600e60205260408082205485835290822054909181831115611d14575081611d17565b50805b60c860015b611d27836001614007565b811015611d4d57611d398260a1613f94565b915080611d458161401f565b915050611d1c565b50611d59826001614007565b611d649060646143e2565b611d6e9082613fdf565b9050611d7d8162093a80613f94565b6000868152601c60209081526040808320338452909152812054919250611da48383614007565b905042811115611dc657611db842826140e6565b975050505050505050610b43565b6000975050505050505050610b43565b6008546001600160a01b03163314611e005760405162461bcd60e51b8152600401610b7390613f15565b601055565b6008546001600160a01b03163314611e2f5760405162461bcd60e51b8152600401610b7390613f15565b601d80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b601d5460009061010090046001600160a01b03163314611eb95760405162461bcd60e51b815260206004820152601a60248201527f53656e646572206973206e6f742042414420636f6e74726163740000000000006044820152606401610b73565b611eca8260005b6020020151612dad565b611ed5826001611ec0565b611ee0826002611ec0565b611eeb826003611ec0565b611ef6826004611ec0565b506001919050565b6008546001600160a01b03163314611f285760405162461bcd60e51b8152600401610b7390613f15565b60005b611f3760026014613fdf565b81101561140d57611f483382612dc7565b611f743382611f5a6002611e61613fdf565b611f65906001614007565b611f6f9190614007565b612dc7565b80611f7e8161401f565b915050611f2b565b606060038054610bad90613f4a565b60405130606090811b6bffffffffffffffffffffffff199081166020840152339182901b166034830152829160009060480160405160208183030381529060405280519060200120905060006120428461203c846040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90612de1565b6012549091506001600160a01b038083169116146120a25760405162461bcd60e51b815260206004820152601860248201527f596f7520617265206e6f7420696e20616c6c6f776c69737400000000000000006044820152606401610b73565b6120aa612626565b6120eb5760405162461bcd60e51b815260206004820152601260248201527153616c6520696e206e6f742061637469766560701b6044820152606401610b73565b6010546011546120fc906001614007565b11156121635760405162461bcd60e51b815260206004820152603060248201527f507572636861736520776f756c642065786365656420737570706c79206f662060448201526f616c6c6f776c69737420746f6b656e7360801b6064820152608401610b73565b3360009081526015602052604090205460ff16156121935760405162461bcd60e51b8152600401610b73906140fd565b601180549060006121a38361401f565b9091555050600d80549060006121b883614142565b9091555050336000818152601560205260409020805460ff1916600117905561113c906127e4565b6000806121ed8484611c71565b905060006122006408159b108e83613f94565b95945050505050565b611586338383612e05565b60008060008385111561223f578361222e86612710613f94565b6122389190614007565b9050612259565b8461224c85612710613f94565b6122569190614007565b90505b60008581526016602052604080822054868352912054600d5461228e5760405162461bcd60e51b8152600401610b7390614159565b610f31871080156122a15750610f318610155b806122ba5750610f3187101580156122ba5750610f3186105b6122d65760405162461bcd60e51b8152600401610b73906141e9565b336122e088611b21565b6001600160a01b03161480156123065750336122fb87611b21565b6001600160a01b0316145b6123225760405162461bcd60e51b8152600401610b739061423c565b61232e61271083613fdf565b158015612344575061234261271082613fdf565b155b6123fc5761235461271082613fdf565b61236061271084613fdf565b14158015612384575061237561271082613ff3565b61238161271084613ff3565b14155b801561239b575061239761271082613fdf565b8714155b80156123b257506123ae61271082613ff3565b8714155b80156123c957506123c561271083613fdf565b8614155b80156123e057506123dc61271083613ff3565b8614155b6123fc5760405162461bcd60e51b8152600401610b7390614289565b6000878152600e60205260408082205488835290822054909181831115612424575081612427565b50805b60c860015b612437836001614007565b81101561245d576124498260a1613f94565b9150806124558161401f565b91505061242c565b50612469826001614007565b6124749060646143e2565b61247e9082613fdf565b905061248d8162093a80613f94565b905060006124a06408159b108e83613f94565b919c919b50909950505050505050505050565b6124bd3383612abd565b6124d95760405162461bcd60e51b8152600401610b7390614095565b6124e5848484846127b1565b50505050565b600060025b60145460ff16600281111561250757612507613afa565b14905090565b6008546001600160a01b031633146125375760405162461bcd60e51b8152600401610b7390613f15565b601d805460ff19811660ff90911615179055565b6000818152600460205260409020546060906001600160a01b03166125ca5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610b73565b60006125d4612ed3565b905060008151116125f4576040518060200160405280600081525061261f565b806125fe84612ee2565b60405160200161260f9291906143ee565b6040516020818303038152906040525b9392505050565b6000600160145460ff16600281111561264157612641613afa565b148061264f575060026124f0565b905090565b6008546001600160a01b0316331461267e5760405162461bcd60e51b8152600401610b7390613f15565b601280546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b031633146126ca5760405162461bcd60e51b8152600401610b7390613f15565b6001600160a01b03811661272f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b73565b61140d81612d5b565b6000610b4382612fe3565b600081815260066020526040902080546001600160a01b0319166001600160a01b038416908117909155819061277882611b21565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6127bc848484612bb4565b6127c884848484613008565b6124e55760405162461bcd60e51b8152600401610b739061441d565b6000806002424433601954601a546127fc9190614007565b6040805160208101959095528401929092526bffffffffffffffffffffffff19606091821b169083015260748201526094016040516020818303038152906040528051906020012060001c6128519190613ff3565b90508060ff1660000361296b5761286a60026014613fdf565b6128776002611e61613fdf565b61288191906140e6565b61288c906001614007565b601a5410156128e8576128b2836128a560026014613fdf565b601a54611f6f9190614007565b601a546128c0906001614007565b601a5560016128d160026014613fdf565b601a546128de9190614007565b61261f91906140e6565b61291d836128f860026014613fdf565b6129056002611e61613fdf565b601954612913906001614007565b611f659190614007565b60195461292b906001614007565b601955600161293c60026014613fdf565b6129496002611e61613fdf565b601954612957906001614007565b6129619190614007565b6128de9190614007565b61297760026014613fdf565b6129846002611e61613fdf565b61298e91906140e6565b60195410156129a75761291d836128f860026014613fdf565b6128b2836128a560026014613fdf565b50919050565b6000818311156129e557816129d484612710613f94565b6129de9190614007565b90506129ff565b826129f283612710613f94565b6129fc9190614007565b90505b835460005b8181101561113c5782868281548110612a1f57612a1f613fb3565b906000526020600020015403612aab5781612a3981614142565b92505081811015612a8057858281548110612a5657612a56613fb3565b9060005260206000200154868281548110612a7357612a73613fb3565b6000918252602090912001555b85805480612a9057612a9061446f565b6001900381819060005260206000200160009055905561113c565b80612ab58161401f565b915050612a04565b6000818152600460205260408120546001600160a01b0316612b365760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b73565b6000612b4183611b21565b9050806001600160a01b0316846001600160a01b03161480612b7c5750836001600160a01b0316612b7184610c30565b6001600160a01b0316145b80612bac57506001600160a01b0380821660009081526007602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316612bc782611b21565b6001600160a01b031614612c2b5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610b73565b6001600160a01b038216612c8d5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610b73565b612c98838383613109565b612ca3600082612743565b6001600160a01b0383166000908152600560205260408120805460019290612ccc9084906140e6565b90915550506001600160a01b0382166000908152600560205260408120805460019290612cfa908490614007565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612db681613114565b600090815260016020526040812055565b61158682826040518060200160405280600081525061311d565b6000806000612df08585613150565b91509150612dfd816131bb565b509392505050565b816001600160a01b0316836001600160a01b031603612e665760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610b73565b6001600160a01b03838116600081815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b606060138054610bad90613f4a565b606081600003612f095750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612f335780612f1d8161401f565b9150612f2c9050600a83613fdf565b9150612f0d565b60008167ffffffffffffffff811115612f4e57612f4e613c96565b6040519080825280601f01601f191660200182016040528015612f78576020820181803683370190505b5090505b8415612bac57612f8d6001836140e6565b9150612f9a600a86613ff3565b612fa5906030614007565b60f81b818381518110612fba57612fba613fb3565b60200101906001600160f81b031916908160001a905350612fdc600a86613fdf565b9450612f7c565b60006001600160e01b0319821663780e9d6360e01b1480610b435750610b4382613371565b60006001600160a01b0384163b156130fe57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061304c903390899088908890600401614485565b6020604051808303816000875af1925050508015613087575060408051601f3d908101601f19168201909252613084918101906144c2565b60015b6130e4573d8080156130b5576040519150601f19603f3d011682016040523d82523d6000602084013e6130ba565b606091505b5080516000036130dc5760405162461bcd60e51b8152600401610b739061441d565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612bac565b506001949350505050565b610dd58383836133b1565b612db681613469565b6131278383613510565b6131346000848484613008565b610dd55760405162461bcd60e51b8152600401610b739061441d565b60008082516041036131865760208301516040840151606085015160001a61317a8782858561365e565b9450945050505061143f565b82516040036131af57602083015160408401516131a486838361374b565b93509350505061143f565b5060009050600261143f565b60008160048111156131cf576131cf613afa565b036131d75750565b60018160048111156131eb576131eb613afa565b036132385760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610b73565b600281600481111561324c5761324c613afa565b036132995760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b73565b60038160048111156132ad576132ad613afa565b036133055760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610b73565b600481600481111561331957613319613afa565b0361140d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610b73565b60006001600160e01b031982166380ac58cd60e01b14806133a257506001600160e01b03198216635b5e139f60e01b145b80610b435750610b4382613784565b6001600160a01b03831661340c5761340781600b80546000838152600c60205260408120829055600182018355919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90155565b61342f565b816001600160a01b0316836001600160a01b03161461342f5761342f83826137b9565b6001600160a01b03821661344657610dd581613856565b826001600160a01b0316826001600160a01b031614610dd557610dd58282613905565b600061347482611b21565b905061348281600084613109565b61348d600083612743565b6001600160a01b03811660009081526005602052604081208054600192906134b69084906140e6565b909155505060008281526004602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6001600160a01b0382166135665760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610b73565b6000818152600460205260409020546001600160a01b0316156135cb5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610b73565b6135d760008383613109565b6001600160a01b0382166000908152600560205260408120805460019290613600908490614007565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156136955750600090506003613742565b8460ff16601b141580156136ad57508460ff16601c14155b156136be5750600090506004613742565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613712573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661373b57600060019250925050613742565b9150600090505b94509492505050565b6000806001600160ff1b0383168161376860ff86901c601b614007565b90506137768782888561365e565b935093505050935093915050565b60006001600160e01b0319821663152a902d60e11b1480610b4357506301ffc9a760e01b6001600160e01b0319831614610b43565b600060016137c684611bb4565b6137d091906140e6565b6000838152600a6020526040902054909150808214613823576001600160a01b03841660009081526009602090815260408083208584528252808320548484528184208190558352600a90915290208190555b506000918252600a602090815260408084208490556001600160a01b039094168352600981528383209183525290812055565b600b54600090613868906001906140e6565b6000838152600c6020526040812054600b805493945090928490811061389057613890613fb3565b9060005260206000200154905080600b83815481106138b1576138b1613fb3565b6000918252602080832090910192909255828152600c9091526040808220849055858252812055600b8054806138e9576138e961446f565b6001900381819060005260206000200160009055905550505050565b600061391083611bb4565b6001600160a01b0390931660009081526009602090815260408083208684528252808320859055938252600a9052919091209190915550565b82805461395590613f4a565b90600052602060002090601f01602090048101928261397757600085556139bd565b82601f1061399057805160ff19168380011785556139bd565b828001600101855582156139bd579182015b828111156139bd5782518255916020019190600101906139a2565b506139c99291506139cd565b5090565b5b808211156139c957600081556001016139ce565b6001600160e01b03198116811461140d57600080fd5b600060208284031215613a0a57600080fd5b813561261f816139e2565b80356001600160a01b0381168114613a2c57600080fd5b919050565b600060208284031215613a4357600080fd5b61261f82613a15565b60005b83811015613a67578181015183820152602001613a4f565b838111156124e55750506000910152565b60008151808452613a90816020860160208601613a4c565b601f01601f19169290920160200192915050565b60208152600061261f6020830184613a78565b600060208284031215613ac957600080fd5b5035919050565b60008060408385031215613ae357600080fd5b613aec83613a15565b946020939093013593505050565b634e487b7160e01b600052602160045260246000fd5b6020810160038310613b3257634e487b7160e01b600052602160045260246000fd5b91905290565b6020808252825182820181905260009190848201906040850190845b81811015613b7057835183529284019291840191600101613b54565b50909695505050505050565b600080600080600060808688031215613b9457600080fd5b613b9d86613a15565b9450613bab60208701613a15565b935060408601359250606086013567ffffffffffffffff80821115613bcf57600080fd5b818801915088601f830112613be357600080fd5b813581811115613bf257600080fd5b896020828501011115613c0457600080fd5b9699959850939650602001949392505050565b60008060408385031215613c2a57600080fd5b50508035926020909101359150565b600080600060608486031215613c4e57600080fd5b613c5784613a15565b9250613c6560208501613a15565b9150604084013590509250925092565b600060208284031215613c8757600080fd5b81356003811061261f57600080fd5b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115613cc757613cc7613c96565b604051601f8501601f19908116603f01168101908282118183101715613cef57613cef613c96565b81604052809350858152868686011115613d0857600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215613d3457600080fd5b813567ffffffffffffffff811115613d4b57600080fd5b8201601f81018413613d5c57600080fd5b612bac84823560208401613cac565b600060a08284031215613d7d57600080fd5b82601f830112613d8c57600080fd5b60405160a0810181811067ffffffffffffffff82111715613daf57613daf613c96565b6040528060a0840185811115613dc457600080fd5b845b81811015613dde578035835260209283019201613dc6565b509195945050505050565b600082601f830112613dfa57600080fd5b61261f83833560208501613cac565b600060208284031215613e1b57600080fd5b813567ffffffffffffffff811115613e3257600080fd5b612bac84828501613de9565b60008060408385031215613e5157600080fd5b613e5a83613a15565b915060208301358015158114613e6f57600080fd5b809150509250929050565b60008060008060808587031215613e9057600080fd5b613e9985613a15565b9350613ea760208601613a15565b925060408501359150606085013567ffffffffffffffff811115613eca57600080fd5b613ed687828801613de9565b91505092959194509250565b60008060408385031215613ef557600080fd5b613efe83613a15565b9150613f0c60208401613a15565b90509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c90821680613f5e57607f821691505b6020821081036129b757634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615613fae57613fae613f7e565b500290565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600082613fee57613fee613fc9565b500490565b60008261400257614002613fc9565b500690565b6000821982111561401a5761401a613f7e565b500190565b60006001820161403157614031613f7e565b5060010190565b60208082526038908201527f53656c656374656420746f6b656e7320617265206e6f74207374616b6564206f60408201527f7220796f7520617265206e6f7420746865207374616b65720000000000000000606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6000828210156140f8576140f8613f7e565b500390565b60208082526025908201527f596f75206861766520616c7265616479206d696e74656420796f757220667265604082015264194814d05160da1b606082015260800190565b60008161415157614151613f7e565b506000190190565b60208082526064908201527f5468657265206172652063757272656e746c79206e6f206d6f7265206176616960408201527f6c61626c6520746f6b656e73206c6566742e2054686174206d6967687420636860608201527f616e67652069662061207374616b65722063616e63656c73207468656972207360808201526374616b6560e01b60a082015260c00190565b60208082526033908201527f596f752063616e206f6e6c792062726565642061206d616c6520616e642061206040820152723332b6b0b6329029a0a2103a37b3b2ba3432b960691b606082015260800190565b6020808252602d908201527f596f7520617265206e6f7420746865206f776e6572206f66207468652072657160408201526c75657374656420746f6b656e7360981b606082015260800190565b6020808252604f908201527f596f752063616e6e6f74206272656564207369626c696e67732f68616c662d7360408201527f69626c696e677320746f676574686572206f72206368696c6472656e2077697460608201526e6820746865697220706172656e747360881b608082015260a00190565b600181815b8085111561433957816000190482111561431f5761431f613f7e565b8085161561432c57918102915b93841c9390800290614303565b509250929050565b60008261435057506001610b43565b8161435d57506000610b43565b8160018114614373576002811461437d57614399565b6001915050610b43565b60ff84111561438e5761438e613f7e565b50506001821b610b43565b5060208310610133831016604e8410600b84101617156143bc575081810a610b43565b6143c683836142fe565b80600019048211156143da576143da613f7e565b029392505050565b600061261f8383614341565b60008351614400818460208801613a4c565b835190830190614414818360208801613a4c565b01949350505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906144b890830184613a78565b9695505050505050565b6000602082840312156144d457600080fd5b815161261f816139e256fe39343863353361396539393230383965376664613837373066313866666134616531663138626361316134616532633038373163633432663935363038613037a2646970667358221220523a0fcba695798173abdbc3b1a0596f34e7060940e9555e74fa774e089a5c7664736f6c634300080d0033

Deployed Bytecode

0x6080604052600436106103975760003560e01c80636352211e116101dc578063a6cdae6a11610102578063d55e69b9116100a0578063e985e9c51161006f578063e985e9c514610aa3578063f2fde38b14610aec578063f6e5481814610b0c578063fd49af1314610b2257600080fd5b8063d55e69b914610a30578063db68d5c414610a55578063e474def414610a6a578063e64deaeb14610a8a57600080fd5b8063bc8893b4116100dc578063bc8893b4146109c6578063c28449b3146109db578063c32fe11b146109f0578063c87b56dd14610a1057600080fd5b8063a6cdae6a14610966578063ad2f852a14610986578063b88d4fde146109a657600080fd5b80638dd07fc61161017a57806395fc164f1161014957806395fc164f146108f05780639a2203a314610910578063a22cb46514610930578063a4f4f8af1461095057600080fd5b80638dd07fc6146108865780638ee82613146108a65780638f893372146108c657806395d89b41146108db57600080fd5b8063715018a6116101b6578063715018a6146108135780637933bac6146108285780638bab534d146108485780638da5cb5b1461086857600080fd5b80636352211e146107be5780636373a6b1146107de57806370a08231146107f357600080fd5b806326092b83116102c15780633ccfd60b1161025f5780634f6ccce71161022e5780634f6ccce71461075257806355f804b31461077257806360b537a51461079257806361ef1793146107a857600080fd5b80633ccfd60b146106dd5780633fc551d6146106f257806342842e0e1461071257806345d4b3141461073257600080fd5b806331c07bbf1161029b57806331c07bbf1461065d57806332d6f0321461067d57806338e21cce146106935780633c02ee32146106c357600080fd5b806326092b83146105e95780632a55205a146105fe5780632f745c591461063d57600080fd5b80630e469a7c116103395780632065b036116103085780632065b0361461055e5780632277aaa31461057457806323b872dd14610594578063242a0087146105b457600080fd5b80630e469a7c146104cf578063150b7a02146104f157806317667bc51461053657806318160ddd1461054957600080fd5b8063081812fc11610375578063081812fc14610415578063095ea7b31461044d5780630ab3f27f1461046d5780630dd250e1146104a857600080fd5b806301ffc9a71461039c57806306d254da146103d157806306fdde03146103f3575b600080fd5b3480156103a857600080fd5b506103bc6103b73660046139f8565b610b38565b60405190151581526020015b60405180910390f35b3480156103dd57600080fd5b506103f16103ec366004613a31565b610b49565b005b3480156103ff57600080fd5b50610408610b9e565b6040516103c89190613aa4565b34801561042157600080fd5b50610435610430366004613ab7565b610c30565b6040516001600160a01b0390911681526020016103c8565b34801561045957600080fd5b506103f1610468366004613ad0565b610cc5565b34801561047957600080fd5b5061049a610488366004613ab7565b600e6020526000908152604090205481565b6040519081526020016103c8565b3480156104b457600080fd5b506014546104c29060ff1681565b6040516103c89190613b10565b3480156104db57600080fd5b506104e4610dda565b6040516103c89190613b38565b3480156104fd57600080fd5b5061051d61050c366004613b7c565b630a85bd0160e11b95945050505050565b6040516001600160e01b031990911681526020016103c8565b6103f1610544366004613c17565b610f43565b34801561055557600080fd5b50600b5461049a565b34801561056a57600080fd5b5061049a611e6181565b34801561058057600080fd5b506103f161058f366004613c17565b611144565b3480156105a057600080fd5b506103f16105af366004613c39565b61123c565b3480156105c057600080fd5b506105d46105cf366004613ab7565b61126d565b604080519283526020830191909152016103c8565b3480156105f557600080fd5b506103f16112a8565b34801561060a57600080fd5b5061061e610619366004613c17565b611410565b604080516001600160a01b0390931683526020830191909152016103c8565b34801561064957600080fd5b5061049a610658366004613ad0565b611446565b34801561066957600080fd5b506103f1610678366004613c75565b6114dc565b34801561068957600080fd5b5061049a60115481565b34801561069f57600080fd5b506103bc6106ae366004613a31565b60156020526000908152604090205460ff1681565b3480156106cf57600080fd5b50601d546103bc9060ff1681565b3480156106e957600080fd5b506103f161152d565b3480156106fe57600080fd5b506103f161070d366004613c17565b61158a565b34801561071e57600080fd5b506103f161072d366004613c39565b61183d565b34801561073e57600080fd5b506103f161074d366004613c17565b611858565b34801561075e57600080fd5b5061049a61076d366004613ab7565b611a51565b34801561077e57600080fd5b506103f161078d366004613d22565b611ae4565b34801561079e57600080fd5b5061049a600d5481565b3480156107b457600080fd5b5061049a600f5481565b3480156107ca57600080fd5b506104356107d9366004613ab7565b611b21565b3480156107ea57600080fd5b50610408611b98565b3480156107ff57600080fd5b5061049a61080e366004613a31565b611bb4565b34801561081f57600080fd5b506103f1611c3b565b34801561083457600080fd5b5061049a610843366004613c17565b611c71565b34801561085457600080fd5b506103f1610863366004613ab7565b611dd6565b34801561087457600080fd5b506008546001600160a01b0316610435565b34801561089257600080fd5b506103f16108a1366004613a31565b611e05565b3480156108b257600080fd5b506103bc6108c1366004613d6b565b611e57565b3480156108d257600080fd5b506103f1611efe565b3480156108e757600080fd5b50610408611f86565b3480156108fc57600080fd5b506103f161090b366004613e09565b611f95565b34801561091c57600080fd5b5061049a61092b366004613c17565b6121e0565b34801561093c57600080fd5b506103f161094b366004613e3e565b612209565b34801561095c57600080fd5b5061049a60175481565b34801561097257600080fd5b506105d4610981366004613c17565b612214565b34801561099257600080fd5b50601854610435906001600160a01b031681565b3480156109b257600080fd5b506103f16109c1366004613e7a565b6124b3565b3480156109d257600080fd5b506103bc6124eb565b3480156109e757600080fd5b506103f161250d565b3480156109fc57600080fd5b50601254610435906001600160a01b031681565b348015610a1c57600080fd5b50610408610a2b366004613ab7565b61254b565b348015610a3c57600080fd5b50601d546104359061010090046001600160a01b031681565b348015610a6157600080fd5b506103bc612626565b348015610a7657600080fd5b506103f1610a85366004613a31565b612654565b348015610a9657600080fd5b5061049a6408159b108e81565b348015610aaf57600080fd5b506103bc610abe366004613ee2565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610af857600080fd5b506103f1610b07366004613a31565b6126a0565b348015610b1857600080fd5b5061049a61115c81565b348015610b2e57600080fd5b5061049a60105481565b6000610b4382612738565b92915050565b6008546001600160a01b03163314610b7c5760405162461bcd60e51b8152600401610b7390613f15565b60405180910390fd5b601880546001600160a01b0319166001600160a01b0392909216919091179055565b606060028054610bad90613f4a565b80601f0160208091040260200160405190810160405280929190818152602001828054610bd990613f4a565b8015610c265780601f10610bfb57610100808354040283529160200191610c26565b820191906000526020600020905b815481529060010190602001808311610c0957829003601f168201915b5050505050905090565b6000818152600460205260408120546001600160a01b0316610ca95760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b73565b506000908152600660205260409020546001600160a01b031690565b6000610cd082611b21565b9050806001600160a01b0316836001600160a01b031603610d3d5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610b73565b336001600160a01b0382161480610d595750610d598133610abe565b610dcb5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610b73565b610dd58383612743565b505050565b336000908152601b6020526040812054606091610df8826002613f94565b67ffffffffffffffff811115610e1057610e10613c96565b604051908082528060200260200182016040528015610e39578160200160208202803683370190505b50905060005b82811015610f3c57336000908152601b602052604090208054612710919083908110610e6d57610e6d613fb3565b9060005260206000200154610e829190613fdf565b82610e8e836002613f94565b81518110610e9e57610e9e613fb3565b602002602001018181525050612710601b6000336001600160a01b03166001600160a01b031681526020019081526020016000208281548110610ee357610ee3613fb3565b9060005260206000200154610ef89190613ff3565b82610f04836002613f94565b610f0f906001614007565b81518110610f1f57610f1f613fb3565b602090810291909101015280610f348161401f565b915050610e3f565b5092915050565b60008082841115610f6c5782610f5b85612710613f94565b610f659190614007565b9050610f86565b83610f7984612710613f94565b610f839190614007565b90505b60005b336000908152601b6020526040902054811015610fef57336000908152601b60205260409020805483919083908110610fc457610fc4613fb3565b906000526020600020015403610fdd5760019250610fef565b80610fe78161401f565b915050610f89565b508161100d5760405162461bcd60e51b8152600401610b7390614038565b600061101985856121e0565b90508034101561106b5760405162461bcd60e51b815260206004820152601f60248201527f45746865722076616c75652073656e74206973206e6f7420636f7272656374006044820152606401610b73565b611086303387604051806020016040528060008152506127b1565b6110a1303386604051806020016040528060008152506127b1565b60006110ac336127e4565b600f805491925060006110be8361401f565b90915550506000868152600e602052604081208054916110dd8361401f565b90915550506000858152600e602052604081208054916110fc8361401f565b90915550506000818152601660209081526040808320869055858352601c82528083203384528252808320839055601b909152902061113c9087876129bd565b505050505050565b60008183111561116c578161115b84612710613f94565b6111659190614007565b9050611186565b8261117983612710613f94565b6111839190614007565b90505b6000818152601c6020908152604080832033845290915281205490036111be5760405162461bcd60e51b8152600401610b7390614038565b6111d9303385604051806020016040528060008152506127b1565b6111f4303384604051806020016040528060008152506127b1565b6000818152601c602090815260408083203384528252808320839055601b90915290206112229084846129bd565b600d80549060006112328361401f565b9190505550505050565b6112463382612abd565b6112625760405162461bcd60e51b8152600401610b7390614095565b610dd5838383612bb4565b60008181526016602052604081205481908161128b61271083613fdf565b9050600061129b61271084613ff3565b9196919550909350505050565b6112b06124eb565b6112fc5760405162461bcd60e51b815260206004820152601960248201527f5075626c69632073616c6520696e206e6f7420616374697665000000000000006044820152606401610b73565b6000600160175460105461115c61131391906140e6565b61131d91906140e6565b61132791906140e6565b10156113905760405162461bcd60e51b815260206004820152603260248201527f507572636861736520776f756c642065786365656420737570706c79206f66206044820152717075626c69632073616c6520746f6b656e7360701b6064820152608401610b73565b3360009081526015602052604090205460ff16156113c05760405162461bcd60e51b8152600401610b73906140fd565b601780549060006113d08361401f565b9091555050600d80549060006113e583614142565b9091555050336000818152601560205260409020805460ff1916600117905561140d906127e4565b50565b60008080612710611423856102ee613f94565b61142d9190613fdf565b6018546001600160a01b031693509150505b9250929050565b600061145183611bb4565b82106114b35760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610b73565b506001600160a01b03919091166000908152600960209081526040808320938352929052205490565b6008546001600160a01b031633146115065760405162461bcd60e51b8152600401610b7390613f15565b6014805482919060ff1916600183600281111561152557611525613afa565b021790555050565b6008546001600160a01b031633146115575760405162461bcd60e51b8152600401610b7390613f15565b6040514790339082156108fc029083906000818181858888f19350505050158015611586573d6000803e3d6000fd5b5050565b601d5460ff166115d45760405162461bcd60e51b81526020600482015260156024820152745374616b696e67206973206e6f742061637469766560581b6044820152606401610b73565b6000818311156115fc57816115eb84612710613f94565b6115f59190614007565b9050611616565b8261160983612710613f94565b6116139190614007565b90505b60008381526016602052604080822054848352912054600d5461164b5760405162461bcd60e51b8152600401610b7390614159565b610f318510801561165e5750610f318410155b806116775750610f3185101580156116775750610f3184105b6116935760405162461bcd60e51b8152600401610b73906141e9565b3361169d86611b21565b6001600160a01b03161480156116c35750336116b885611b21565b6001600160a01b0316145b6116df5760405162461bcd60e51b8152600401610b739061423c565b6116eb61271083613fdf565b15801561170157506116ff61271082613fdf565b155b6117b95761171161271082613fdf565b61171d61271084613fdf565b14158015611741575061173261271082613ff3565b61173e61271084613ff3565b14155b8015611758575061175461271082613fdf565b8514155b801561176f575061176b61271082613ff3565b8514155b8015611786575061178261271083613fdf565b8414155b801561179d575061179961271083613ff3565b8414155b6117b95760405162461bcd60e51b8152600401610b7390614289565b6117d4333087604051806020016040528060008152506127b1565b6117ef333086604051806020016040528060008152506127b1565b6000838152601c602090815260408083203384528252808320429055601b82528220805460018101825590835290822001849055600d80549161183183614142565b91905055505050505050565b610dd5838383604051806020016040528060008152506124b3565b60008082841115611881578261187085612710613f94565b61187a9190614007565b905061189b565b8361188e84612710613f94565b6118989190614007565b90505b60005b336000908152601b602052604090205481101561190457336000908152601b602052604090208054839190839081106118d9576118d9613fb3565b9060005260206000200154036118f25760019250611904565b806118fc8161401f565b91505061189e565b50816119225760405162461bcd60e51b8152600401610b7390614038565b61192c8484611c71565b156119795760405162461bcd60e51b815260206004820152601f60248201527f42726565642074696d6520686173206e6f742066696e697368656420796574006044820152606401610b73565b611994303386604051806020016040528060008152506127b1565b6119af303385604051806020016040528060008152506127b1565b60006119ba336127e4565b600f805491925060006119cc8361401f565b90915550506000858152600e602052604081208054916119eb8361401f565b90915550506000848152600e60205260408120805491611a0a8361401f565b90915550506000818152601660209081526040808320859055848352601c82528083203384528252808320839055601b9091529020611a4a9086866129bd565b5050505050565b6000611a5c600b5490565b8210611abf5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610b73565b600b8281548110611ad257611ad2613fb3565b90600052602060002001549050919050565b6008546001600160a01b03163314611b0e5760405162461bcd60e51b8152600401610b7390613f15565b8051611586906013906020840190613949565b6000818152600460205260408120546001600160a01b031680610b435760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610b73565b6040518060600160405280604081526020016144e06040913981565b60006001600160a01b038216611c1f5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610b73565b506001600160a01b031660009081526005602052604090205490565b6008546001600160a01b03163314611c655760405162461bcd60e51b8152600401610b7390613f15565b611c6f6000612d5b565b565b60008082841115611c9a5782611c8985612710613f94565b611c939190614007565b9050611cb4565b83611ca784612710613f94565b611cb19190614007565b90505b6000818152601c602090815260408083203384529091528120549003611cec5760405162461bcd60e51b8152600401610b7390614038565b6000848152600e60205260408082205485835290822054909181831115611d14575081611d17565b50805b60c860015b611d27836001614007565b811015611d4d57611d398260a1613f94565b915080611d458161401f565b915050611d1c565b50611d59826001614007565b611d649060646143e2565b611d6e9082613fdf565b9050611d7d8162093a80613f94565b6000868152601c60209081526040808320338452909152812054919250611da48383614007565b905042811115611dc657611db842826140e6565b975050505050505050610b43565b6000975050505050505050610b43565b6008546001600160a01b03163314611e005760405162461bcd60e51b8152600401610b7390613f15565b601055565b6008546001600160a01b03163314611e2f5760405162461bcd60e51b8152600401610b7390613f15565b601d80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b601d5460009061010090046001600160a01b03163314611eb95760405162461bcd60e51b815260206004820152601a60248201527f53656e646572206973206e6f742042414420636f6e74726163740000000000006044820152606401610b73565b611eca8260005b6020020151612dad565b611ed5826001611ec0565b611ee0826002611ec0565b611eeb826003611ec0565b611ef6826004611ec0565b506001919050565b6008546001600160a01b03163314611f285760405162461bcd60e51b8152600401610b7390613f15565b60005b611f3760026014613fdf565b81101561140d57611f483382612dc7565b611f743382611f5a6002611e61613fdf565b611f65906001614007565b611f6f9190614007565b612dc7565b80611f7e8161401f565b915050611f2b565b606060038054610bad90613f4a565b60405130606090811b6bffffffffffffffffffffffff199081166020840152339182901b166034830152829160009060480160405160208183030381529060405280519060200120905060006120428461203c846040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90612de1565b6012549091506001600160a01b038083169116146120a25760405162461bcd60e51b815260206004820152601860248201527f596f7520617265206e6f7420696e20616c6c6f776c69737400000000000000006044820152606401610b73565b6120aa612626565b6120eb5760405162461bcd60e51b815260206004820152601260248201527153616c6520696e206e6f742061637469766560701b6044820152606401610b73565b6010546011546120fc906001614007565b11156121635760405162461bcd60e51b815260206004820152603060248201527f507572636861736520776f756c642065786365656420737570706c79206f662060448201526f616c6c6f776c69737420746f6b656e7360801b6064820152608401610b73565b3360009081526015602052604090205460ff16156121935760405162461bcd60e51b8152600401610b73906140fd565b601180549060006121a38361401f565b9091555050600d80549060006121b883614142565b9091555050336000818152601560205260409020805460ff1916600117905561113c906127e4565b6000806121ed8484611c71565b905060006122006408159b108e83613f94565b95945050505050565b611586338383612e05565b60008060008385111561223f578361222e86612710613f94565b6122389190614007565b9050612259565b8461224c85612710613f94565b6122569190614007565b90505b60008581526016602052604080822054868352912054600d5461228e5760405162461bcd60e51b8152600401610b7390614159565b610f31871080156122a15750610f318610155b806122ba5750610f3187101580156122ba5750610f3186105b6122d65760405162461bcd60e51b8152600401610b73906141e9565b336122e088611b21565b6001600160a01b03161480156123065750336122fb87611b21565b6001600160a01b0316145b6123225760405162461bcd60e51b8152600401610b739061423c565b61232e61271083613fdf565b158015612344575061234261271082613fdf565b155b6123fc5761235461271082613fdf565b61236061271084613fdf565b14158015612384575061237561271082613ff3565b61238161271084613ff3565b14155b801561239b575061239761271082613fdf565b8714155b80156123b257506123ae61271082613ff3565b8714155b80156123c957506123c561271083613fdf565b8614155b80156123e057506123dc61271083613ff3565b8614155b6123fc5760405162461bcd60e51b8152600401610b7390614289565b6000878152600e60205260408082205488835290822054909181831115612424575081612427565b50805b60c860015b612437836001614007565b81101561245d576124498260a1613f94565b9150806124558161401f565b91505061242c565b50612469826001614007565b6124749060646143e2565b61247e9082613fdf565b905061248d8162093a80613f94565b905060006124a06408159b108e83613f94565b919c919b50909950505050505050505050565b6124bd3383612abd565b6124d95760405162461bcd60e51b8152600401610b7390614095565b6124e5848484846127b1565b50505050565b600060025b60145460ff16600281111561250757612507613afa565b14905090565b6008546001600160a01b031633146125375760405162461bcd60e51b8152600401610b7390613f15565b601d805460ff19811660ff90911615179055565b6000818152600460205260409020546060906001600160a01b03166125ca5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610b73565b60006125d4612ed3565b905060008151116125f4576040518060200160405280600081525061261f565b806125fe84612ee2565b60405160200161260f9291906143ee565b6040516020818303038152906040525b9392505050565b6000600160145460ff16600281111561264157612641613afa565b148061264f575060026124f0565b905090565b6008546001600160a01b0316331461267e5760405162461bcd60e51b8152600401610b7390613f15565b601280546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b031633146126ca5760405162461bcd60e51b8152600401610b7390613f15565b6001600160a01b03811661272f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b73565b61140d81612d5b565b6000610b4382612fe3565b600081815260066020526040902080546001600160a01b0319166001600160a01b038416908117909155819061277882611b21565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6127bc848484612bb4565b6127c884848484613008565b6124e55760405162461bcd60e51b8152600401610b739061441d565b6000806002424433601954601a546127fc9190614007565b6040805160208101959095528401929092526bffffffffffffffffffffffff19606091821b169083015260748201526094016040516020818303038152906040528051906020012060001c6128519190613ff3565b90508060ff1660000361296b5761286a60026014613fdf565b6128776002611e61613fdf565b61288191906140e6565b61288c906001614007565b601a5410156128e8576128b2836128a560026014613fdf565b601a54611f6f9190614007565b601a546128c0906001614007565b601a5560016128d160026014613fdf565b601a546128de9190614007565b61261f91906140e6565b61291d836128f860026014613fdf565b6129056002611e61613fdf565b601954612913906001614007565b611f659190614007565b60195461292b906001614007565b601955600161293c60026014613fdf565b6129496002611e61613fdf565b601954612957906001614007565b6129619190614007565b6128de9190614007565b61297760026014613fdf565b6129846002611e61613fdf565b61298e91906140e6565b60195410156129a75761291d836128f860026014613fdf565b6128b2836128a560026014613fdf565b50919050565b6000818311156129e557816129d484612710613f94565b6129de9190614007565b90506129ff565b826129f283612710613f94565b6129fc9190614007565b90505b835460005b8181101561113c5782868281548110612a1f57612a1f613fb3565b906000526020600020015403612aab5781612a3981614142565b92505081811015612a8057858281548110612a5657612a56613fb3565b9060005260206000200154868281548110612a7357612a73613fb3565b6000918252602090912001555b85805480612a9057612a9061446f565b6001900381819060005260206000200160009055905561113c565b80612ab58161401f565b915050612a04565b6000818152600460205260408120546001600160a01b0316612b365760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b73565b6000612b4183611b21565b9050806001600160a01b0316846001600160a01b03161480612b7c5750836001600160a01b0316612b7184610c30565b6001600160a01b0316145b80612bac57506001600160a01b0380821660009081526007602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316612bc782611b21565b6001600160a01b031614612c2b5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610b73565b6001600160a01b038216612c8d5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610b73565b612c98838383613109565b612ca3600082612743565b6001600160a01b0383166000908152600560205260408120805460019290612ccc9084906140e6565b90915550506001600160a01b0382166000908152600560205260408120805460019290612cfa908490614007565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612db681613114565b600090815260016020526040812055565b61158682826040518060200160405280600081525061311d565b6000806000612df08585613150565b91509150612dfd816131bb565b509392505050565b816001600160a01b0316836001600160a01b031603612e665760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610b73565b6001600160a01b03838116600081815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b606060138054610bad90613f4a565b606081600003612f095750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612f335780612f1d8161401f565b9150612f2c9050600a83613fdf565b9150612f0d565b60008167ffffffffffffffff811115612f4e57612f4e613c96565b6040519080825280601f01601f191660200182016040528015612f78576020820181803683370190505b5090505b8415612bac57612f8d6001836140e6565b9150612f9a600a86613ff3565b612fa5906030614007565b60f81b818381518110612fba57612fba613fb3565b60200101906001600160f81b031916908160001a905350612fdc600a86613fdf565b9450612f7c565b60006001600160e01b0319821663780e9d6360e01b1480610b435750610b4382613371565b60006001600160a01b0384163b156130fe57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061304c903390899088908890600401614485565b6020604051808303816000875af1925050508015613087575060408051601f3d908101601f19168201909252613084918101906144c2565b60015b6130e4573d8080156130b5576040519150601f19603f3d011682016040523d82523d6000602084013e6130ba565b606091505b5080516000036130dc5760405162461bcd60e51b8152600401610b739061441d565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612bac565b506001949350505050565b610dd58383836133b1565b612db681613469565b6131278383613510565b6131346000848484613008565b610dd55760405162461bcd60e51b8152600401610b739061441d565b60008082516041036131865760208301516040840151606085015160001a61317a8782858561365e565b9450945050505061143f565b82516040036131af57602083015160408401516131a486838361374b565b93509350505061143f565b5060009050600261143f565b60008160048111156131cf576131cf613afa565b036131d75750565b60018160048111156131eb576131eb613afa565b036132385760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610b73565b600281600481111561324c5761324c613afa565b036132995760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b73565b60038160048111156132ad576132ad613afa565b036133055760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610b73565b600481600481111561331957613319613afa565b0361140d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610b73565b60006001600160e01b031982166380ac58cd60e01b14806133a257506001600160e01b03198216635b5e139f60e01b145b80610b435750610b4382613784565b6001600160a01b03831661340c5761340781600b80546000838152600c60205260408120829055600182018355919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90155565b61342f565b816001600160a01b0316836001600160a01b03161461342f5761342f83826137b9565b6001600160a01b03821661344657610dd581613856565b826001600160a01b0316826001600160a01b031614610dd557610dd58282613905565b600061347482611b21565b905061348281600084613109565b61348d600083612743565b6001600160a01b03811660009081526005602052604081208054600192906134b69084906140e6565b909155505060008281526004602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6001600160a01b0382166135665760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610b73565b6000818152600460205260409020546001600160a01b0316156135cb5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610b73565b6135d760008383613109565b6001600160a01b0382166000908152600560205260408120805460019290613600908490614007565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156136955750600090506003613742565b8460ff16601b141580156136ad57508460ff16601c14155b156136be5750600090506004613742565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613712573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661373b57600060019250925050613742565b9150600090505b94509492505050565b6000806001600160ff1b0383168161376860ff86901c601b614007565b90506137768782888561365e565b935093505050935093915050565b60006001600160e01b0319821663152a902d60e11b1480610b4357506301ffc9a760e01b6001600160e01b0319831614610b43565b600060016137c684611bb4565b6137d091906140e6565b6000838152600a6020526040902054909150808214613823576001600160a01b03841660009081526009602090815260408083208584528252808320548484528184208190558352600a90915290208190555b506000918252600a602090815260408084208490556001600160a01b039094168352600981528383209183525290812055565b600b54600090613868906001906140e6565b6000838152600c6020526040812054600b805493945090928490811061389057613890613fb3565b9060005260206000200154905080600b83815481106138b1576138b1613fb3565b6000918252602080832090910192909255828152600c9091526040808220849055858252812055600b8054806138e9576138e961446f565b6001900381819060005260206000200160009055905550505050565b600061391083611bb4565b6001600160a01b0390931660009081526009602090815260408083208684528252808320859055938252600a9052919091209190915550565b82805461395590613f4a565b90600052602060002090601f01602090048101928261397757600085556139bd565b82601f1061399057805160ff19168380011785556139bd565b828001600101855582156139bd579182015b828111156139bd5782518255916020019190600101906139a2565b506139c99291506139cd565b5090565b5b808211156139c957600081556001016139ce565b6001600160e01b03198116811461140d57600080fd5b600060208284031215613a0a57600080fd5b813561261f816139e2565b80356001600160a01b0381168114613a2c57600080fd5b919050565b600060208284031215613a4357600080fd5b61261f82613a15565b60005b83811015613a67578181015183820152602001613a4f565b838111156124e55750506000910152565b60008151808452613a90816020860160208601613a4c565b601f01601f19169290920160200192915050565b60208152600061261f6020830184613a78565b600060208284031215613ac957600080fd5b5035919050565b60008060408385031215613ae357600080fd5b613aec83613a15565b946020939093013593505050565b634e487b7160e01b600052602160045260246000fd5b6020810160038310613b3257634e487b7160e01b600052602160045260246000fd5b91905290565b6020808252825182820181905260009190848201906040850190845b81811015613b7057835183529284019291840191600101613b54565b50909695505050505050565b600080600080600060808688031215613b9457600080fd5b613b9d86613a15565b9450613bab60208701613a15565b935060408601359250606086013567ffffffffffffffff80821115613bcf57600080fd5b818801915088601f830112613be357600080fd5b813581811115613bf257600080fd5b896020828501011115613c0457600080fd5b9699959850939650602001949392505050565b60008060408385031215613c2a57600080fd5b50508035926020909101359150565b600080600060608486031215613c4e57600080fd5b613c5784613a15565b9250613c6560208501613a15565b9150604084013590509250925092565b600060208284031215613c8757600080fd5b81356003811061261f57600080fd5b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115613cc757613cc7613c96565b604051601f8501601f19908116603f01168101908282118183101715613cef57613cef613c96565b81604052809350858152868686011115613d0857600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215613d3457600080fd5b813567ffffffffffffffff811115613d4b57600080fd5b8201601f81018413613d5c57600080fd5b612bac84823560208401613cac565b600060a08284031215613d7d57600080fd5b82601f830112613d8c57600080fd5b60405160a0810181811067ffffffffffffffff82111715613daf57613daf613c96565b6040528060a0840185811115613dc457600080fd5b845b81811015613dde578035835260209283019201613dc6565b509195945050505050565b600082601f830112613dfa57600080fd5b61261f83833560208501613cac565b600060208284031215613e1b57600080fd5b813567ffffffffffffffff811115613e3257600080fd5b612bac84828501613de9565b60008060408385031215613e5157600080fd5b613e5a83613a15565b915060208301358015158114613e6f57600080fd5b809150509250929050565b60008060008060808587031215613e9057600080fd5b613e9985613a15565b9350613ea760208601613a15565b925060408501359150606085013567ffffffffffffffff811115613eca57600080fd5b613ed687828801613de9565b91505092959194509250565b60008060408385031215613ef557600080fd5b613efe83613a15565b9150613f0c60208401613a15565b90509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c90821680613f5e57607f821691505b6020821081036129b757634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615613fae57613fae613f7e565b500290565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600082613fee57613fee613fc9565b500490565b60008261400257614002613fc9565b500690565b6000821982111561401a5761401a613f7e565b500190565b60006001820161403157614031613f7e565b5060010190565b60208082526038908201527f53656c656374656420746f6b656e7320617265206e6f74207374616b6564206f60408201527f7220796f7520617265206e6f7420746865207374616b65720000000000000000606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6000828210156140f8576140f8613f7e565b500390565b60208082526025908201527f596f75206861766520616c7265616479206d696e74656420796f757220667265604082015264194814d05160da1b606082015260800190565b60008161415157614151613f7e565b506000190190565b60208082526064908201527f5468657265206172652063757272656e746c79206e6f206d6f7265206176616960408201527f6c61626c6520746f6b656e73206c6566742e2054686174206d6967687420636860608201527f616e67652069662061207374616b65722063616e63656c73207468656972207360808201526374616b6560e01b60a082015260c00190565b60208082526033908201527f596f752063616e206f6e6c792062726565642061206d616c6520616e642061206040820152723332b6b0b6329029a0a2103a37b3b2ba3432b960691b606082015260800190565b6020808252602d908201527f596f7520617265206e6f7420746865206f776e6572206f66207468652072657160408201526c75657374656420746f6b656e7360981b606082015260800190565b6020808252604f908201527f596f752063616e6e6f74206272656564207369626c696e67732f68616c662d7360408201527f69626c696e677320746f676574686572206f72206368696c6472656e2077697460608201526e6820746865697220706172656e747360881b608082015260a00190565b600181815b8085111561433957816000190482111561431f5761431f613f7e565b8085161561432c57918102915b93841c9390800290614303565b509250929050565b60008261435057506001610b43565b8161435d57506000610b43565b8160018114614373576002811461437d57614399565b6001915050610b43565b60ff84111561438e5761438e613f7e565b50506001821b610b43565b5060208310610133831016604e8410600b84101617156143bc575081810a610b43565b6143c683836142fe565b80600019048211156143da576143da613f7e565b029392505050565b600061261f8383614341565b60008351614400818460208801613a4c565b835190830190614414818360208801613a4c565b01949350505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906144b890830184613a78565b9695505050505050565b6000602082840312156144d457600080fd5b815161261f816139e256fe39343863353361396539393230383965376664613837373066313866666134616531663138626361316134616532633038373163633432663935363038613037a2646970667358221220523a0fcba695798173abdbc3b1a0596f34e7060940e9555e74fa774e089a5c7664736f6c634300080d0033

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  ]

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.