ETH Price: $2,168.80 (+9.62%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

TokenTracker

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Approval For...203825102024-07-25 8:56:23587 days ago1721897783IN
RPFStoryPaper: RPFP Token
0 ETH0.000148753.22325209
Set Approval For...167438602023-03-02 22:33:471097 days ago1677796427IN
RPFStoryPaper: RPFP Token
0 ETH0.0011465924.8443269
Claim RPF Paper159398952022-11-10 13:23:471210 days ago1668086627IN
RPFStoryPaper: RPFP Token
0 ETH0.0051285743.21926355
Set Approval For...152736102022-08-04 3:55:391308 days ago1659585339IN
RPFStoryPaper: RPFP Token
0 ETH0.0005861912.70167985
Claim RPF Paper152193022022-07-26 16:59:391317 days ago1658854779IN
RPFStoryPaper: RPFP Token
0 ETH0.0032307327.2259401
Write Paper Phas...151902962022-07-22 4:34:311321 days ago1658464471IN
RPFStoryPaper: RPFP Token
0 ETH0.000591697.25236342
Transfer From151902302022-07-22 4:18:221321 days ago1658463502IN
RPFStoryPaper: RPFP Token
0 ETH0.000609148.29966603
Claim RPF Paper150793482022-07-05 0:45:121338 days ago1656981912IN
RPFStoryPaper: RPFP Token
0 ETH0.0015881113.1368201
Set Approval For...150608632022-07-02 4:19:131341 days ago1656735553IN
RPFStoryPaper: RPFP Token
0 ETH0.0007167415.50226448
Claim RPF Paper148622662022-05-28 20:08:131376 days ago1653768493IN
RPFStoryPaper: RPFP Token
0 ETH0.0018683315.74899862
Claim RPF Paper148461982022-05-26 5:21:451378 days ago1653542505IN
RPFStoryPaper: RPFP Token
0 ETH0.0041131234.66192421
Set Approval For...148175942022-05-21 13:45:071383 days ago1653140707IN
RPFStoryPaper: RPFP Token
0 ETH0.0006546514.15937774
Set Approval For...148167262022-05-21 10:33:141383 days ago1653129194IN
RPFStoryPaper: RPFP Token
0 ETH0.0006328913.68868337
Set Approval For...147426432022-05-09 13:18:441395 days ago1652102324IN
RPFStoryPaper: RPFP Token
0 ETH0.0013870530
Claim RPF Paper147286262022-05-07 8:07:161397 days ago1651910836IN
RPFStoryPaper: RPFP Token
0 ETH0.0037651531.73492002
Claim RPF Paper147281492022-05-07 6:18:241397 days ago1651904304IN
RPFStoryPaper: RPFP Token
0 ETH0.0043114633.21777332
Claim RPF Paper147280002022-05-07 5:40:211397 days ago1651902021IN
RPFStoryPaper: RPFP Token
0 ETH0.0036350930.63352716
Claim RPF Paper147277242022-05-07 4:30:301397 days ago1651897830IN
RPFStoryPaper: RPFP Token
0 ETH0.0049400740.86424068
Claim RPF Paper147247662022-05-06 17:07:471398 days ago1651856867IN
RPFStoryPaper: RPFP Token
0 ETH0.0049700441.89043037
Write Paper Phas...147164102022-05-05 9:17:491399 days ago1651742269IN
RPFStoryPaper: RPFP Token
0 ETH0.0117268728.60737039
Set Approval For...147092192022-05-04 5:59:491400 days ago1651643989IN
RPFStoryPaper: RPFP Token
0 ETH0.0021015745.45424279
Write Paper Phas...147092042022-05-04 5:55:191400 days ago1651643719IN
RPFStoryPaper: RPFP Token
0 ETH0.0116401732.00770295
Claim RPF Paper147086652022-05-04 3:47:491400 days ago1651636069IN
RPFStoryPaper: RPFP Token
0 ETH0.004671639.3789256
Write Paper Phas...147050102022-05-03 13:53:461401 days ago1651586026IN
RPFStoryPaper: RPFP Token
0 ETH0.0026901972.5375419
Write Paper Phas...147050042022-05-03 13:52:401401 days ago1651585960IN
RPFStoryPaper: RPFP Token
0 ETH0.0248037460.50800444
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RPFStoryPaper

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import './ERC721A.sol';
import "./IRPFStoryPaper.sol";
import "./IRPF.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";

contract RPFStoryPaperStorage {
    mapping(uint256 => bool) public writtenRPFStoryPaper;
    mapping(uint256 => string) public RPFName;
    mapping(uint256 => string) public tokenStory;
    mapping(address => uint256) public claimedAmt;

    bool public writeEnable;
    uint256 public writeTimestamp;
    address public RPFAddr;

    uint256 public MAX_RPFSTORYPAPER;

	uint256 public totalGiveaway;
    uint256 public totalClaim;
    
    uint256 public claimTimestamp;
	bool public claimEnable;

	string public _baseTokenURI;
    address public treasury;
}

contract RPFStoryPaper is IRPFStoryPaper, RPFStoryPaperStorage, Ownable, EIP712, ERC721A {

    using SafeMath for uint256;
	using Strings for uint256;

    constructor()
    EIP712("RPFStoryPaper", "1.0.0")
    ERC721A("RPFStoryPaper", "RPFP")
    {
        writeEnable = false;
        RPFAddr = 0xc9E3Ca32CAaA6ee67476C5d35d4B8ec64F58D4Ad;

        MAX_RPFSTORYPAPER = 3333;
        claimEnable = false;

        _baseTokenURI = "https://api.rugpullfrens.art/paper/metadata/";
    }

    /**
     * Modifiers
     */
    modifier onlyTokenOwner(uint256 tokenId) {
        require(ownershipOf(tokenId).addr == msg.sender, "NOT_PP_OWNER");
        _;
    }

    modifier paperWritten(uint256 tokenId) {
        require(writtenRPFStoryPaper[tokenId] == false, "PP_WRITTEN");
        _;
    }

    modifier writeActive() {
        require(writeEnable, "CANT_WRITE");
        require(block.timestamp >= writeTimestamp, "NOT_IN_WRITE_TIME");
        _;
    }

    modifier claimActive() {
		require(claimEnable == true, "CLAIM_NOT_ACTIVE");
        require(block.timestamp >= claimTimestamp, "NOT_IN_CLAIM_TIME");
        _;
    }
    
    /**
     * Verify Functions
     */
    function verify(
        uint256 maxQuantity, 
        bytes memory SIGNATURE
    ) 
        public 
        override 
        view 
        returns(bool)
    {
        address recoveredAddr = ECDSA.recover(_hashTypedDataV4(keccak256(abi.encode(keccak256("NFT(address addressForClaim,uint256 maxQuantity)"), _msgSender(), maxQuantity))), SIGNATURE);
        return owner() == recoveredAddr;
    }

    /**
     * Mint Functions
     */
    function mintGiveawayPaper(
        address _to, 
        uint256 quantity
    ) 
        external
        override
        onlyOwner
    {   
        require(totalSupply().add(quantity) <= MAX_RPFSTORYPAPER, "EXCEED_MAX_RPFSTORYPAPER");

		_safeMint(_to, quantity);

		totalGiveaway = totalGiveaway.add(quantity);
		emit mintEvent(_to, quantity, totalSupply());
    }

    function claimRPFPaper(
        uint256 quantity, 
        uint256 maxClaimNum, 
        bytes memory SIGNATURE
    ) 
        external 
        override
        claimActive
    {
        require(verify(maxClaimNum, SIGNATURE), "NOT_ELIGIBLE_CLAIM");
        require(totalSupply().add(quantity) <= MAX_RPFSTORYPAPER, "EXCEED_MAX_RPFSTORYPAPER");
        require(quantity > 0 && claimedAmt[msg.sender].add(quantity) <= maxClaimNum, "EXCEED_MAX_CLAIMABLE");
        _safeMint(msg.sender, quantity);

        totalClaim = totalClaim.add(quantity);
		claimedAmt[msg.sender] = claimedAmt[msg.sender].add(quantity);

        emit mintEvent(msg.sender, quantity, totalSupply());
    }

    /**
     * Write Functions
     */
    /**
     * @dev
     * @param tokenId ChapterId, the page users want to write
     * @param name Name, the name of the corresponding RPF
     * @param story Story, the story that users write
     */
    function writePaperPhase1(
        uint256 tokenId,
        uint256 rpfTokenId,
        string memory name,
        string memory story
    ) 
        external 
        override
        writeActive
        onlyTokenOwner(tokenId)
        paperWritten(tokenId)
    {
        require(IRPF(RPFAddr).ownerOf(rpfTokenId) == msg.sender, "NOT_RPF_OWNER");
        writtenRPFStoryPaper[tokenId] = true;
        RPFName[rpfTokenId] = name;
        tokenStory[rpfTokenId] = story;
        emit phaseOneWritten(tokenId, rpfTokenId, name, story);
    }

    /**
     * Token Functions
     */
	function tokenURI(uint256 tokenId) 
        public 
        view 
        override 
        returns (string memory) 
    {
		require(_exists(tokenId), "TOKEN_NOT_EXISTS");
		return string(abi.encodePacked(_baseTokenURI, tokenId.toString()));
	}

    /**
     * Getter Functions 
     */
    function getRPFName(uint256 tokenId)
        public
        view
        override
        returns (string memory name)
    {
        return RPFName[tokenId];
    }

    function getStory(uint256 tokenId)
        public
        view
        override
        returns (string memory story)
    {
        return tokenStory[tokenId];
    }

    function getPaperStatus(address owner) 
        public 
        view 
        override
        returns (bool[] memory)
    {
        uint256 tokenCount = balanceOf(owner);
        if (tokenCount == 0) {
            // Return an empty array
            return new bool[](0);
        } else {
            bool[] memory result = new bool[](tokenCount);
            uint256 index;
            for (index = 0; index < tokenCount; index++) {
                uint256 token = tokenOfOwnerByIndex(owner, index);
                result[index] = writtenRPFStoryPaper[token];
            }
            return result;
        }
    }

    function tokensOfOwner(address owner) 
        external 
        view 
        override
        returns(uint256[] memory ) 
    {
        uint256 tokenCount = balanceOf(owner);
        if (tokenCount == 0) {
            // Return an empty array
            return new uint256[](0);
        } else {
            uint256[] memory result = new uint256[](tokenCount);
            uint256 index;
            for (index = 0; index < tokenCount; index++) {
                result[index] = tokenOfOwnerByIndex(owner, index);
            }
            return result;
        }
    }

    /**
     * Setter Functions 
     */
    function setRPFAddress(address _RPF) 
        override 
        external 
        onlyOwner 
    {
        RPFAddr = _RPF;
    }

    function setWritePhase(
        bool _hasWriteStarted, 
        uint256 _writeTimestamp
    ) 
        override 
        external 
        onlyOwner 
    {
        writeEnable = _hasWriteStarted;
        writeTimestamp = _writeTimestamp;
    }

    function setClaim(
        bool _hasClaimStarted, 
        uint256 _claimTimestamp
    ) 
        override 
        external 
        onlyOwner 
    {
        claimEnable = _hasClaimStarted;
        claimTimestamp = _claimTimestamp;
    }

    function setURI(
        string calldata _tokenURI) 
        override 
        external 
        onlyOwner 
    {
		_baseTokenURI = _tokenURI;
	}

    function setTreasury(address _treasury) 
        override 
        external 
        onlyOwner 
    {
        require(_treasury != address(0), "SETTING_ZERO_ADDRESS");
        treasury = _treasury;
    }

    /**
     * Withdrawal Functions
     */
	function withdrawAll() 
        override 
        external 
        payable 
        onlyOwner 
    {
		payable(treasury).transfer(address(this).balance);
	}
}

// SPDX-License-Identifier: MIT
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol';
import '@openzeppelin/contracts/utils/Address.sol';
import '@openzeppelin/contracts/utils/Context.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/utils/introspection/ERC165.sol';

error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error ApproveToCaller();
error ApprovalToCurrentOwner();
error BalanceQueryForZeroAddress();
error MintedQueryForZeroAddress();
error BurnedQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerIndexOutOfBounds();
error OwnerQueryForNonexistentToken();
error TokenIndexOutOfBounds();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints.
 *
 * Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..).
 *
 * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 *
 * Assumes that the maximum token id cannot exceed 2**128 - 1 (max value of uint128).
 */
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
    using Address for address;
    using Strings for uint256;

    // Compiler will pack this into a single 256bit word.
    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Keeps track of the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
    }

    // Compiler will pack this into a single 256bit word.
    struct AddressData {
        // Realistically, 2**64-1 is more than enough.
        uint64 balance;
        // Keeps track of mint count with minimal overhead for tokenomics.
        uint64 numberMinted;
        // Keeps track of burn count with minimal overhead for tokenomics.
        uint64 numberBurned;
    }

    // Compiler will pack the following 
    // _currentIndex and _burnCounter into a single 256bit word.
    
    // The tokenId of the next token to be minted.
    uint128 internal _currentIndex;

    // The number of tokens burned.
    uint128 internal _burnCounter;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to ownership details
    // An empty struct value does not necessarily mean the token is unowned. See ownershipOf implementation for details.
    mapping(uint256 => TokenOwnership) internal _ownerships;

    // Mapping owner address to address data
    mapping(address => AddressData) private _addressData;

    // 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;

    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view override returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than _currentIndex times
        unchecked {
            return _currentIndex - _burnCounter;    
        }
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first.
     * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case.
     */
    function tokenByIndex(uint256 index) public view override returns (uint256) {
        uint256 numMintedSoFar = _currentIndex;
        uint256 tokenIdsIdx;

        // Counter overflow is impossible as the loop breaks when
        // uint256 i is equal to another uint256 numMintedSoFar.
        unchecked {
            for (uint256 i; i < numMintedSoFar; i++) {
                TokenOwnership memory ownership = _ownerships[i];
                if (!ownership.burned) {
                    if (tokenIdsIdx == index) {
                        return i;
                    }
                    tokenIdsIdx++;
                }
            }
        }
        revert TokenIndexOutOfBounds();
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first.
     * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) {
        if (index >= balanceOf(owner)) revert OwnerIndexOutOfBounds();
        uint256 numMintedSoFar = _currentIndex;
        uint256 tokenIdsIdx;
        address currOwnershipAddr;

        // Counter overflow is impossible as the loop breaks when
        // uint256 i is equal to another uint256 numMintedSoFar.
        unchecked {
            for (uint256 i; i < numMintedSoFar; i++) {
                TokenOwnership memory ownership = _ownerships[i];
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    if (tokenIdsIdx == index) {
                        return i;
                    }
                    tokenIdsIdx++;
                }
            }
        }

        // Execution should never reach this point.
        revert();
    }

    /**
     * @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 ||
            interfaceId == type(IERC721Enumerable).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return uint256(_addressData[owner].balance);
    }

    function _numberMinted(address owner) internal view returns (uint256) {
        if (owner == address(0)) revert MintedQueryForZeroAddress();
        return uint256(_addressData[owner].numberMinted);
    }

    function _numberBurned(address owner) internal view returns (uint256) {
        if (owner == address(0)) revert BurnedQueryForZeroAddress();
        return uint256(_addressData[owner].numberBurned);
    }

    /**
     * Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around in the collection over time.
     */
    function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
        uint256 curr = tokenId;

        unchecked {
            if (curr < _currentIndex) {
                TokenOwnership memory ownership = _ownerships[curr];
                if (!ownership.burned) {
                    if (ownership.addr != address(0)) {
                        return ownership;
                    }
                    // Invariant: 
                    // There will always be an ownership that has an address and is not burned 
                    // before an ownership that does not have an address and is not burned.
                    // Hence, curr will not underflow.
                    while (true) {
                        curr--;
                        ownership = _ownerships[curr];
                        if (ownership.addr != address(0)) {
                            return ownership;
                        }
                    }
                }
            }
        }
        revert OwnerQueryForNonexistentToken();
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view override returns (address) {
        return ownershipOf(tokenId).addr;
    }

    /**
     * @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) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

        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 override {
        address owner = ERC721A.ownerOf(tokenId);
        if (to == owner) revert ApprovalToCurrentOwner();

        if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) {
            revert ApprovalCallerNotOwnerNorApproved();
        }

        _approve(to, tokenId, owner);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view override returns (address) {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public override {
        if (operator == _msgSender()) revert ApproveToCaller();

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        _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 {
        _transfer(from, to, tokenId);
        if (!_checkOnERC721Received(from, to, tokenId, _data)) {
            revert TransferToNonERC721ReceiverImplementer();
        }
    }

    /**
     * @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`),
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        return tokenId < _currentIndex && !_ownerships[tokenId].burned;
    }

    function _safeMint(address to, uint256 quantity) internal {
        _safeMint(to, quantity, '');
    }

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal {
        _mint(to, quantity, _data, true);
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _mint(
        address to,
        uint256 quantity,
        bytes memory _data,
        bool safe
    ) internal {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // balance or numberMinted overflow if current value of either + quantity > 3.4e38 (2**128) - 1
        // updatedIndex overflows if _currentIndex + quantity > 3.4e38 (2**128) - 1
        unchecked {
            _addressData[to].balance += uint64(quantity);
            _addressData[to].numberMinted += uint64(quantity);

            _ownerships[startTokenId].addr = to;
            _ownerships[startTokenId].startTimestamp = uint64(block.timestamp);

            uint256 updatedIndex = startTokenId;

            for (uint256 i; i < quantity; i++) {
                emit Transfer(address(0), to, updatedIndex);
                if (safe && !_checkOnERC721Received(address(0), to, updatedIndex, _data)) {
                    revert TransferToNonERC721ReceiverImplementer();
                }
                updatedIndex++;
            }

            _currentIndex = uint128(updatedIndex);
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * 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
    ) private {
        TokenOwnership memory prevOwnership = ownershipOf(tokenId);

        bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr ||
            isApprovedForAll(prevOwnership.addr, _msgSender()) ||
            getApproved(tokenId) == _msgSender());

        if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
        if (prevOwnership.addr != from) revert TransferFromIncorrectOwner();
        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

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

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as tokenId would have to be 2**128.
        unchecked {
            _addressData[from].balance -= 1;
            _addressData[to].balance += 1;

            _ownerships[tokenId].addr = to;
            _ownerships[tokenId].startTimestamp = uint64(block.timestamp);

            // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it.
            // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
            uint256 nextTokenId = tokenId + 1;
            if (_ownerships[nextTokenId].addr == address(0)) {
                // This will suffice for checking _exists(nextTokenId),
                // as a burned slot cannot contain the zero address.
                if (nextTokenId < _currentIndex) {
                    _ownerships[nextTokenId].addr = prevOwnership.addr;
                    _ownerships[nextTokenId].startTimestamp = prevOwnership.startTimestamp;
                }
            }
        }

        emit Transfer(from, to, tokenId);
        _afterTokenTransfers(from, to, tokenId, 1);
    }

    /**
     * @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 {
        TokenOwnership memory prevOwnership = ownershipOf(tokenId);

        _beforeTokenTransfers(prevOwnership.addr, address(0), tokenId, 1);

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

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as tokenId would have to be 2**128.
        unchecked {
            _addressData[prevOwnership.addr].balance -= 1;
            _addressData[prevOwnership.addr].numberBurned += 1;

            // Keep track of who burned the token, and the timestamp of burning.
            _ownerships[tokenId].addr = prevOwnership.addr;
            _ownerships[tokenId].startTimestamp = uint64(block.timestamp);
            _ownerships[tokenId].burned = true;

            // If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it.
            // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
            uint256 nextTokenId = tokenId + 1;
            if (_ownerships[nextTokenId].addr == address(0)) {
                // This will suffice for checking _exists(nextTokenId),
                // as a burned slot cannot contain the zero address.
                if (nextTokenId < _currentIndex) {
                    _ownerships[nextTokenId].addr = prevOwnership.addr;
                    _ownerships[nextTokenId].startTimestamp = prevOwnership.startTimestamp;
                }
            }
        }

        emit Transfer(prevOwnership.addr, address(0), tokenId);
        _afterTokenTransfers(prevOwnership.addr, address(0), tokenId, 1);

        // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
        unchecked { 
            _burnCounter++;
        }
    }

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

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

    /**
     * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
     * And also called before burning one token.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * 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, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes
     * minting.
     * And also called after one token has been burned.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
     * transferred to `to`.
     * - When `from` is zero, `tokenId` has been minted for `to`.
     * - When `to` is zero, `tokenId` has been burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface IRPFStoryPaper {

    event mintEvent(address owner, uint256 quantity, uint256 totalSupply);

    event phaseOneWritten(uint256 tokenId, uint256 rpfTokenId, string name, string story);

    function verify(uint256 maxQuantity, bytes memory SIGNATURE) external view returns(bool);

    function mintGiveawayPaper(address _to, uint256 quantity) external;

    function claimRPFPaper(uint256 quantity, uint256 maxClaimNum, bytes memory SIGNATURE) external;

    function writePaperPhase1(uint256 tokenId, uint256 rpfTokenId, string memory name, string memory story) external;

    function getRPFName(uint256 tokenId) external view returns(string memory);

    function getStory(uint256 tokenId) external view returns(string memory);

    function getPaperStatus(address owner) external view returns(bool[] memory);

    function tokensOfOwner(address _owner) external view returns(uint256[] memory );

    function setRPFAddress(address _RPF) external;

    function setWritePhase(bool _hasPhaseOneStarted, uint256 _phaseOneTimestamp) external;

    function setClaim(bool _hasClaimStarted, uint256 _claimTimestamp) external;

    function setURI(string calldata _tokenURI) external;

    function setTreasury(address _treasury) external;

    function withdrawAll() external payable;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface IRPF {
    event BaseTokenURIChanged(string baseTokenURI);

    event URIChanged(string contractURI, string tokenURI);
    
    event IsBurnEnabledChanged(bool newIsBurnEnabled);
    
    event priceChanged(uint256 newTokenPrice);
    
    event supplyChanged(uint256 totalSupply, uint256 maxMintLimitPerTX);
    
    event FRENSMinted(address owner, uint256 numMint, uint256 totalSupply);
    
    function setSupply(uint256 _MAX_FRENS, uint256 _MAX_MINT_PER_TX) external;
    
    function setPrice(uint256 _FREN_PRICE) external;
    
    function isPresaleEligible(uint256 _MAX_CLAIM_FRENS_ON_PRESALE, uint256 _START_PRESALE_MINT_TIMESTAMP, bytes memory _SIGNATURE) external view returns (bool);
    
    function setPresaleStatus(bool _isPreSaleActive) external;
    
    function setPublicSale(bool _isPublicSaleActive, uint256 _publicSaleStartTimestamp) external;
    
    function setMintedReservedFrens(uint256 _MINTED_RESERVED_FRENS) external;
    
    function claimReservedFrens(uint256 quantity, address addr) external;
    
    function mintPresaleFrens(uint256 quantity, uint256 _MAX_CLAIM_FRENS_ON_PRESALE, uint256 _START_PRESALE_MINT_TIMESTAMP, bytes memory _SIGNATURE) external payable;
    
    function mintFrens(uint256 quantity) external payable;
    
    function ownerClaimFrens(uint256 quantity, address addr) external;
    
    function ownerClaimFrensId(uint256[] memory id, address addr) external;
    
    function setIsBurnEnabled(bool _isBurnEnabled) external;
    
    function burn(uint256 tokenId) external;
    
    function setURI(string calldata __contractURI, string calldata __tokenURI) external;
    
    function contractURI() external view returns (string memory);
    
    function tokenURI(uint256 tokenId) external view returns (string memory);
    
    function tokensOfOwner(address _owner) external view returns(uint256[] memory );
    
    function setTreasury(address treasury) external;
    
    function withdraw() external;
    
    function ownerOf(uint256 tokenId) external view returns (address owner);
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol)

pragma solidity ^0.8.0;

import "./ECDSA.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
 * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
 * they need in their contracts using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * _Available since v3.4._
 */
abstract contract EIP712 {
    /* solhint-disable var-name-mixedcase */
    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
    // invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;
    uint256 private immutable _CACHED_CHAIN_ID;
    address private immutable _CACHED_THIS;

    bytes32 private immutable _HASHED_NAME;
    bytes32 private immutable _HASHED_VERSION;
    bytes32 private immutable _TYPE_HASH;

    /* solhint-enable var-name-mixedcase */

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    constructor(string memory name, string memory version) {
        bytes32 hashedName = keccak256(bytes(name));
        bytes32 hashedVersion = keccak256(bytes(version));
        bytes32 typeHash = keccak256(
            "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
        );
        _HASHED_NAME = hashedName;
        _HASHED_VERSION = hashedVersion;
        _CACHED_CHAIN_ID = block.chainid;
        _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);
        _CACHED_THIS = address(this);
        _TYPE_HASH = typeHash;
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {
            return _CACHED_DOMAIN_SEPARATOR;
        } else {
            return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);
        }
    }

    function _buildDomainSeparator(
        bytes32 typeHash,
        bytes32 nameHash,
        bytes32 versionHash
    ) private view returns (bytes32) {
        return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));
    }

    /**
     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
     * function returns the hash of the fully encoded EIP712 message for this domain.
     *
     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
     *
     * ```solidity
     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
     *     keccak256("Mail(address to,string contents)"),
     *     mailTo,
     *     keccak256(bytes(mailContents))
     * )));
     * address signer = ECDSA.recover(digest, signature);
     * ```
     */
    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
        return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);
    }
}

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 11 of 19 : 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);
}

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

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

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

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

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

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

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

// 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 "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

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

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

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

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

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

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

        _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 {}
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerIndexOutOfBounds","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"TokenIndexOutOfBounds","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalSupply","type":"uint256"}],"name":"mintEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rpfTokenId","type":"uint256"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"story","type":"string"}],"name":"phaseOneWritten","type":"event"},{"inputs":[],"name":"MAX_RPFSTORYPAPER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RPFAddr","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"RPFName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_baseTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimEnable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"maxClaimNum","type":"uint256"},{"internalType":"bytes","name":"SIGNATURE","type":"bytes"}],"name":"claimRPFPaper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimedAmt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"getPaperStatus","outputs":[{"internalType":"bool[]","name":"","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRPFName","outputs":[{"internalType":"string","name":"name","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getStory","outputs":[{"internalType":"string","name":"story","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mintGiveawayPaper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_hasClaimStarted","type":"bool"},{"internalType":"uint256","name":"_claimTimestamp","type":"uint256"}],"name":"setClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_RPF","type":"address"}],"name":"setRPFAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"setURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_hasWriteStarted","type":"bool"},{"internalType":"uint256","name":"_writeTimestamp","type":"uint256"}],"name":"setWritePhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenStory","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalClaim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalGiveaway","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxQuantity","type":"uint256"},{"internalType":"bytes","name":"SIGNATURE","type":"bytes"}],"name":"verify","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"writeEnable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"rpfTokenId","type":"uint256"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"story","type":"string"}],"name":"writePaperPhase1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"writeTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"writtenRPFStoryPaper","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

6101406040523480156200001257600080fd5b506040518060400160405280600d81526020016c29282329ba37b93ca830b832b960991b815250604051806040016040528060048152602001630525046560e41b8152506040518060400160405280600d81526020016c29282329ba37b93ca830b832b960991b815250604051806040016040528060058152602001640312e302e360dc1b815250620000b4620000ae620001ee60201b60201c565b620001f2565b815160208084019190912082518383012060e08290526101008190524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81880181905281830187905260608201869052608082019490945230818401528151808203909301835260c00190528051940193909320919290916080523060601b60c05261012052505083516200015d925060109150602085019062000244565b5080516200017390601190602084019062000244565b50506004805460ff19908116909155600680546001600160a01b03191673c9e3ca32caaa6ee67476c5d35d4b8ec64f58d4ad179055610d05600755600b80549091169055506040805160608101909152602c8082526200391460208301398051620001e791600c9160209091019062000244565b5062000327565b3390565b600e80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8280546200025290620002ea565b90600052602060002090601f016020900481019282620002765760008555620002c1565b82601f106200029157805160ff1916838001178555620002c1565b82800160010185558215620002c1579182015b82811115620002c1578251825591602001919060010190620002a4565b50620002cf929150620002d3565b5090565b5b80821115620002cf5760008155600101620002d4565b600181811c90821680620002ff57607f821691505b602082108114156200032157634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160601c60e051610100516101205161359a6200037a600039600061271801526000612767015260006127420152600061269b015260006126c5015260006126ef015261359a6000f3fe6080604052600436106103065760003560e01c80636352211e1161019a578063ae288894116100e1578063d13287771161008a578063ef54da5f11610064578063ef54da5f146108b7578063f0f44260146108e4578063f2fde38b1461090457600080fd5b8063d132877714610838578063e985e9c514610858578063ee96c89e146108a157600080fd5b8063c5551faf116100bb578063c5551faf146107ed578063c87b56dd14610803578063cfc86f7b1461082357600080fd5b8063ae2888941461077d578063b88d4fde146107ad578063bd2e5a83146107cd57600080fd5b806385852ce41161014357806395d89b411161011d57806395d89b4114610728578063a10abaa81461073d578063a22cb4651461075d57600080fd5b806385852ce4146106d05780638da5cb5b146106f057806395d0f6201461070e57600080fd5b8063715018a611610174578063715018a6146106865780638462151c1461069b578063853828b6146106c857600080fd5b80636352211e14610626578063682634181461064657806370a082311461066657600080fd5b806323b872dd1161025e578063459738e611610207578063547d1864116101e1578063547d1864146105c35780635a5cced6146105d957806361d027b31461060657600080fd5b8063459738e6146105735780634f6ccce714610589578063533687af146105a957600080fd5b80633b620191116102385780633b6201911461051357806340d679a81461053357806342842e0e1461055357600080fd5b806323b872dd146104b35780632f745c59146104d35780633050d420146104f357600080fd5b806303cf950f116102c0578063095ea7b31161029a578063095ea7b314610444578063145b43da1461046457806318160ddd1461048457600080fd5b806303cf950f146103d757806306fdde03146103f7578063081812fc1461040c57600080fd5b806301ffc9a7116102f157806301ffc9a714610363578063022e34681461039357806302fe5305146103b757600080fd5b806206d4621461030b5780628d066114610341575b600080fd5b34801561031757600080fd5b5061032b6103263660046130e5565b610924565b60405161033891906133a9565b60405180910390f35b34801561034d57600080fd5b5061036161035c366004612ff1565b6109c6565b005b34801561036f57600080fd5b5061038361037e366004613039565b610b2d565b6040519015158152602001610338565b34801561039f57600080fd5b506103a9600a5481565b604051908152602001610338565b3480156103c357600080fd5b506103616103d2366004613073565b610bfe565b3480156103e357600080fd5b5061032b6103f23660046130e5565b610c69565b34801561040357600080fd5b5061032b610c86565b34801561041857600080fd5b5061042c6104273660046130e5565b610d18565b6040516001600160a01b039091168152602001610338565b34801561045057600080fd5b5061036161045f366004612ff1565b610d75565b34801561047057600080fd5b5061036161047f366004612e9c565b610e30565b34801561049057600080fd5b506103a9600f546001600160801b03600160801b82048116918116919091031690565b3480156104bf57600080fd5b506103616104ce366004612f0f565b610eb9565b3480156104df57600080fd5b506103a96104ee366004612ff1565b610ec4565b3480156104ff57600080fd5b5061036161050e366004613195565b610fda565b34801561051f57600080fd5b5061032b61052e3660046130e5565b6112c5565b34801561053f57600080fd5b5061036161054e36600461301d565b61135f565b34801561055f57600080fd5b5061036161056e366004612f0f565b6113d0565b34801561057f57600080fd5b506103a960075481565b34801561059557600080fd5b506103a96105a43660046130e5565b6113eb565b3480156105b557600080fd5b50600b546103839060ff1681565b3480156105cf57600080fd5b506103a960095481565b3480156105e557600080fd5b506103a96105f4366004612e9c565b60036020526000908152604090205481565b34801561061257600080fd5b50600d5461042c906001600160a01b031681565b34801561063257600080fd5b5061042c6106413660046130e5565b6114b1565b34801561065257600080fd5b5061032b6106613660046130e5565b6114c3565b34801561067257600080fd5b506103a9610681366004612e9c565b6114dc565b34801561069257600080fd5b50610361611544565b3480156106a757600080fd5b506106bb6106b6366004612e9c565b6115aa565b6040516103389190613371565b610361611683565b3480156106dc57600080fd5b506103836106eb3660046130fe565b611719565b3480156106fc57600080fd5b50600e546001600160a01b031661042c565b34801561071a57600080fd5b506004546103839060ff1681565b34801561073457600080fd5b5061032b6117ba565b34801561074957600080fd5b5060065461042c906001600160a01b031681565b34801561076957600080fd5b50610361610778366004612fbc565b6117c9565b34801561078957600080fd5b506103836107983660046130e5565b60006020819052908152604090205460ff1681565b3480156107b957600080fd5b506103616107c8366004612f50565b611878565b3480156107d957600080fd5b506103616107e836600461301d565b6118b2565b3480156107f957600080fd5b506103a960085481565b34801561080f57600080fd5b5061032b61081e3660046130e5565b611923565b34801561082f57600080fd5b5061032b6119ac565b34801561084457600080fd5b50610361610853366004613145565b6119b9565b34801561086457600080fd5b50610383610873366004612ed6565b6001600160a01b03918216600090815260156020908152604080832093909416825291909152205460ff1690565b3480156108ad57600080fd5b506103a960055481565b3480156108c357600080fd5b506108d76108d2366004612e9c565b611c5e565b604051610338919061332b565b3480156108f057600080fd5b506103616108ff366004612e9c565b611d24565b34801561091057600080fd5b5061036161091f366004612e9c565b611e03565b600081815260016020526040902080546060919061094190613467565b80601f016020809104026020016040519081016040528092919081815260200182805461096d90613467565b80156109ba5780601f1061098f576101008083540402835291602001916109ba565b820191906000526020600020905b81548152906001019060200180831161099d57829003601f168201915b50505050509050919050565b600e546001600160a01b03163314610a255760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b600754610a5482610a4e600f546001600160801b03600160801b82048116918116919091031690565b90611ee2565b1115610aa25760405162461bcd60e51b815260206004820152601860248201527f4558434545445f4d41585f52504653544f5259504150455200000000000000006044820152606401610a1c565b610aac8282611ef5565b600854610ab99082611ee2565b6008557f9670c8b300c38cd3db8d3f9429dd902e67f418c4dd193e2497f06d20efc795608282610b01600f546001600160801b03600160801b82048116918116919091031690565b604080516001600160a01b03909416845260208401929092529082015260600160405180910390a15050565b60006001600160e01b031982167f80ac58cd000000000000000000000000000000000000000000000000000000001480610b9057506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610bc457506001600160e01b031982167f780e9d6300000000000000000000000000000000000000000000000000000000145b80610bf857507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b600e546001600160a01b03163314610c585760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1c565b610c64600c8383612ced565b505050565b600081815260026020526040902080546060919061094190613467565b606060108054610c9590613467565b80601f0160208091040260200160405190810160405280929190818152602001828054610cc190613467565b8015610d0e5780601f10610ce357610100808354040283529160200191610d0e565b820191906000526020600020905b815481529060010190602001808311610cf157829003601f168201915b5050505050905090565b6000610d2382611f13565b610d59576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000908152601460205260409020546001600160a01b031690565b6000610d80826114b1565b9050806001600160a01b0316836001600160a01b03161415610dce576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614801590610dee5750610dec8133610873565b155b15610e25576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c64838383611f49565b600e546001600160a01b03163314610e8a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1c565b6006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b610c64838383611fb2565b6000610ecf836114dc565b8210610f07576040517f0ddac30e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600f546001600160801b0316600080805b83811015610fd457600081815260126020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff161580159282019290925290610f805750610fcc565b80516001600160a01b031615610f9557805192505b876001600160a01b0316836001600160a01b03161415610fca5786841415610fc357509350610bf892505050565b6001909301925b505b600101610f18565b50600080fd5b60045460ff1661102c5760405162461bcd60e51b815260206004820152600a60248201527f43414e545f5752495445000000000000000000000000000000000000000000006044820152606401610a1c565b60055442101561107e5760405162461bcd60e51b815260206004820152601160248201527f4e4f545f494e5f57524954455f54494d450000000000000000000000000000006044820152606401610a1c565b83336110898261221d565b516001600160a01b0316146110e05760405162461bcd60e51b815260206004820152600c60248201527f4e4f545f50505f4f574e455200000000000000000000000000000000000000006044820152606401610a1c565b600085815260208190526040902054859060ff16156111415760405162461bcd60e51b815260206004820152600a60248201527f50505f5752495454454e000000000000000000000000000000000000000000006044820152606401610a1c565b6006546040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810187905233916001600160a01b031690636352211e9060240160206040518083038186803b15801561119e57600080fd5b505afa1580156111b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d69190612eb9565b6001600160a01b03161461122c5760405162461bcd60e51b815260206004820152600d60248201527f4e4f545f5250465f4f574e4552000000000000000000000000000000000000006044820152606401610a1c565b600086815260208181526040808320805460ff191660019081179091558884528252909120855161125f92870190612d71565b506000858152600260209081526040909120845161127f92860190612d71565b507f425816acf5c88faaa4378f40130b499dece634f288f4e46dfef5987fd5b18e9c868686866040516112b594939291906133bc565b60405180910390a1505050505050565b600160205260009081526040902080546112de90613467565b80601f016020809104026020016040519081016040528092919081815260200182805461130a90613467565b80156113575780601f1061132c57610100808354040283529160200191611357565b820191906000526020600020905b81548152906001019060200180831161133a57829003601f168201915b505050505081565b600e546001600160a01b031633146113b95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1c565b6004805460ff191692151592909217909155600555565b610c6483838360405180602001604052806000815250611878565b600f546000906001600160801b031681805b8281101561147e57600081815260126020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff16151591810182905290611475578583141561146e5750949350505050565b6001909201915b506001016113fd565b506040517fa723001c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006114bc8261221d565b5192915050565b600260205260009081526040902080546112de90613467565b60006001600160a01b03821661151e576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b031660009081526013602052604090205467ffffffffffffffff1690565b600e546001600160a01b0316331461159e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1c565b6115a8600061235c565b565b606060006115b7836114dc565b9050806115f25760005b6040519080825280602002602001820160405280156115ea578160200160208202803683370190505b509392505050565b60008167ffffffffffffffff81111561160d5761160d613523565b604051908082528060200260200182016040528015611636578160200160208202803683370190505b50905060005b828110156115ea5761164e8582610ec4565b8282815181106116605761166061350d565b6020908102919091010152806116758161349c565b91505061163c565b50919050565b600e546001600160a01b031633146116dd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1c565b600d546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015611716573d6000803e3d6000fd5b50565b60008061178a6117847f182854de6a51f3818344a7eb784b9d55c1e6d2d20c9f9aea309f5daaaaddfec1336040805160208101939093526001600160a01b039091169082015260608101879052608001604051602081830303815290604052805190602001206123bb565b84612424565b9050806001600160a01b03166117a8600e546001600160a01b031690565b6001600160a01b031614949350505050565b606060118054610c9590613467565b6001600160a01b03821633141561180c576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360008181526015602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611883848484611fb2565b61188f84848484612440565b6118ac576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b600e546001600160a01b0316331461190c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1c565b600b805460ff191692151592909217909155600a55565b606061192e82611f13565b61197a5760405162461bcd60e51b815260206004820152601060248201527f544f4b454e5f4e4f545f455849535453000000000000000000000000000000006044820152606401610a1c565b600c6119858361254f565b604051602001611996929190613248565b6040516020818303038152906040529050919050565b600c80546112de90613467565b600b5460ff161515600114611a105760405162461bcd60e51b815260206004820152601060248201527f434c41494d5f4e4f545f414354495645000000000000000000000000000000006044820152606401610a1c565b600a54421015611a625760405162461bcd60e51b815260206004820152601160248201527f4e4f545f494e5f434c41494d5f54494d450000000000000000000000000000006044820152606401610a1c565b611a6c8282611719565b611ab85760405162461bcd60e51b815260206004820152601260248201527f4e4f545f454c494749424c455f434c41494d00000000000000000000000000006044820152606401610a1c565b600754611ae184610a4e600f546001600160801b03600160801b82048116918116919091031690565b1115611b2f5760405162461bcd60e51b815260206004820152601860248201527f4558434545445f4d41585f52504653544f5259504150455200000000000000006044820152606401610a1c565b600083118015611b595750336000908152600360205260409020548290611b569085611ee2565b11155b611ba55760405162461bcd60e51b815260206004820152601460248201527f4558434545445f4d41585f434c41494d41424c450000000000000000000000006044820152606401610a1c565b611baf3384611ef5565b600954611bbc9084611ee2565b60095533600090815260036020526040902054611bd99084611ee2565b336000818152600360205260409020919091557f9670c8b300c38cd3db8d3f9429dd902e67f418c4dd193e2497f06d20efc795609084611c31600f546001600160801b03600160801b82048116918116919091031690565b604080516001600160a01b03909416845260208401929092529082015260600160405180910390a1505050565b60606000611c6b836114dc565b905080611c795760006115c1565b60008167ffffffffffffffff811115611c9457611c94613523565b604051908082528060200260200182016040528015611cbd578160200160208202803683370190505b50905060005b828110156115ea576000611cd78683610ec4565b600081815260208190526040902054845191925060ff1690849084908110611d0157611d0161350d565b911515602092830291909101909101525080611d1c8161349c565b915050611cc3565b600e546001600160a01b03163314611d7e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1c565b6001600160a01b038116611dd45760405162461bcd60e51b815260206004820152601460248201527f53455454494e475f5a45524f5f414444524553530000000000000000000000006044820152606401610a1c565b600d805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b600e546001600160a01b03163314611e5d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1c565b6001600160a01b038116611ed95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610a1c565b6117168161235c565b6000611eee82846133f8565b9392505050565b611f0f828260405180602001604052806000815250612681565b5050565b600f546000906001600160801b031682108015610bf8575050600090815260126020526040902054600160e01b900460ff161590565b600082815260146020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000611fbd8261221d565b80519091506000906001600160a01b0316336001600160a01b03161480611feb57508151611feb9033610873565b80612006575033611ffb84610d18565b6001600160a01b0316145b90508061203f576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b846001600160a01b031682600001516001600160a01b03161461208e576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0384166120ce576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6120de6000848460000151611f49565b6001600160a01b038581166000908152601360209081526040808320805467ffffffffffffffff1980821667ffffffffffffffff92831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652601290945282852080546001600160e01b031916909417600160a01b4290921691909102179092559086018083529120549091166121d357600f546001600160801b03168110156121d3578251600082815260126020908152604090912080549186015167ffffffffffffffff16600160a01b026001600160e01b03199092166001600160a01b03909316929092171790555b5082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b6040805160608101825260008082526020820181905291810191909152600f5482906001600160801b031681101561232a57600081815260126020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff161515918101829052906123285780516001600160a01b0316156122be579392505050565b5060001901600081815260126020908152604091829020825160608101845290546001600160a01b038116808352600160a01b820467ffffffffffffffff1693830193909352600160e01b900460ff1615159281019290925215612323579392505050565b6122be565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600e80546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000610bf86123c861268e565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b600080600061243385856127b5565b915091506115ea81612825565b60006001600160a01b0384163b1561254357604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906124849033908990889088906004016132ef565b602060405180830381600087803b15801561249e57600080fd5b505af19250505080156124ce575060408051601f3d908101601f191682019092526124cb91810190613056565b60015b612529573d8080156124fc576040519150601f19603f3d011682016040523d82523d6000602084013e612501565b606091505b508051612521576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612547565b5060015b949350505050565b60608161258f57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156125b957806125a38161349c565b91506125b29050600a83613410565b9150612593565b60008167ffffffffffffffff8111156125d4576125d4613523565b6040519080825280601f01601f1916602001820160405280156125fe576020820181803683370190505b5090505b841561254757612613600183613424565b9150612620600a866134b7565b61262b9060306133f8565b60f81b8183815181106126405761264061350d565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061267a600a86613410565b9450612602565b610c6483838360016129e0565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156126e757507f000000000000000000000000000000000000000000000000000000000000000046145b1561271157507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000808251604114156127ec5760208301516040840151606085015160001a6127e087828585612bae565b9450945050505061281e565b825160401415612816576020830151604084015161280b868383612c9b565b93509350505061281e565b506000905060025b9250929050565b6000816004811115612839576128396134f7565b14156128425750565b6001816004811115612856576128566134f7565b14156128a45760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610a1c565b60028160048111156128b8576128b86134f7565b14156129065760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a1c565b600381600481111561291a5761291a6134f7565b14156129735760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610a1c565b6004816004811115612987576129876134f7565b14156117165760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610a1c565b600f546001600160801b03166001600160a01b038516612a2c576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83612a63576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516600081815260136020908152604080832080546fffffffffffffffffffffffffffffffff19811667ffffffffffffffff8083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c018116909202179091558584526012909252822080546001600160e01b031916909317600160a01b42909216919091021790915581905b85811015612b7f5760405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4838015612b555750612b536000888488612440565b155b15612b73576040516368d2bf6b60e11b815260040160405180910390fd5b60019182019101612afe565b50600f80546fffffffffffffffffffffffffffffffff19166001600160801b0392909216919091179055612216565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612be55750600090506003612c92565b8460ff16601b14158015612bfd57508460ff16601c14155b15612c0e5750600090506004612c92565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612c62573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612c8b57600060019250925050612c92565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831681612cd160ff86901c601b6133f8565b9050612cdf87828885612bae565b935093505050935093915050565b828054612cf990613467565b90600052602060002090601f016020900481019282612d1b5760008555612d61565b82601f10612d345782800160ff19823516178555612d61565b82800160010185558215612d61579182015b82811115612d61578235825591602001919060010190612d46565b50612d6d929150612de5565b5090565b828054612d7d90613467565b90600052602060002090601f016020900481019282612d9f5760008555612d61565b82601f10612db857805160ff1916838001178555612d61565b82800160010185558215612d61579182015b82811115612d61578251825591602001919060010190612dca565b5b80821115612d6d5760008155600101612de6565b80358015158114612e0a57600080fd5b919050565b600082601f830112612e2057600080fd5b813567ffffffffffffffff80821115612e3b57612e3b613523565b604051601f8301601f19908116603f01168101908282118183101715612e6357612e63613523565b81604052838152866020858801011115612e7c57600080fd5b836020870160208301376000602085830101528094505050505092915050565b600060208284031215612eae57600080fd5b8135611eee81613539565b600060208284031215612ecb57600080fd5b8151611eee81613539565b60008060408385031215612ee957600080fd5b8235612ef481613539565b91506020830135612f0481613539565b809150509250929050565b600080600060608486031215612f2457600080fd5b8335612f2f81613539565b92506020840135612f3f81613539565b929592945050506040919091013590565b60008060008060808587031215612f6657600080fd5b8435612f7181613539565b93506020850135612f8181613539565b925060408501359150606085013567ffffffffffffffff811115612fa457600080fd5b612fb087828801612e0f565b91505092959194509250565b60008060408385031215612fcf57600080fd5b8235612fda81613539565b9150612fe860208401612dfa565b90509250929050565b6000806040838503121561300457600080fd5b823561300f81613539565b946020939093013593505050565b6000806040838503121561303057600080fd5b61300f83612dfa565b60006020828403121561304b57600080fd5b8135611eee8161354e565b60006020828403121561306857600080fd5b8151611eee8161354e565b6000806020838503121561308657600080fd5b823567ffffffffffffffff8082111561309e57600080fd5b818501915085601f8301126130b257600080fd5b8135818111156130c157600080fd5b8660208285010111156130d357600080fd5b60209290920196919550909350505050565b6000602082840312156130f757600080fd5b5035919050565b6000806040838503121561311157600080fd5b82359150602083013567ffffffffffffffff81111561312f57600080fd5b61313b85828601612e0f565b9150509250929050565b60008060006060848603121561315a57600080fd5b8335925060208401359150604084013567ffffffffffffffff81111561317f57600080fd5b61318b86828701612e0f565b9150509250925092565b600080600080608085870312156131ab57600080fd5b8435935060208501359250604085013567ffffffffffffffff808211156131d157600080fd5b6131dd88838901612e0f565b935060608701359150808211156131f357600080fd5b50612fb087828801612e0f565b6000815180845261321881602086016020860161343b565b601f01601f19169290920160200192915050565b6000815161323e81856020860161343b565b9290920192915050565b600080845481600182811c91508083168061326457607f831692505b602080841082141561328457634e487b7160e01b86526022600452602486fd5b81801561329857600181146132a9576132d6565b60ff198616895284890196506132d6565b60008b81526020902060005b868110156132ce5781548b8201529085019083016132b5565b505084890196505b5050505050506132e6818561322c565b95945050505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526133216080830184613200565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015613365578351151583529284019291840191600101613347565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156133655783518352928401929184019160010161338d565b602081526000611eee6020830184613200565b8481528360208201526080604082015260006133db6080830185613200565b82810360608401526133ed8185613200565b979650505050505050565b6000821982111561340b5761340b6134cb565b500190565b60008261341f5761341f6134e1565b500490565b600082821015613436576134366134cb565b500390565b60005b8381101561345657818101518382015260200161343e565b838111156118ac5750506000910152565b600181811c9082168061347b57607f821691505b6020821081141561167d57634e487b7160e01b600052602260045260246000fd5b60006000198214156134b0576134b06134cb565b5060010190565b6000826134c6576134c66134e1565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461171657600080fd5b6001600160e01b03198116811461171657600080fdfea264697066735822122028afbb2193b9f420dd683b150dd3ce4ae7407a1fe1da255b64a966a8ded73c0e64736f6c6343000807003368747470733a2f2f6170692e72756770756c6c6672656e732e6172742f70617065722f6d657461646174612f

Deployed Bytecode

0x6080604052600436106103065760003560e01c80636352211e1161019a578063ae288894116100e1578063d13287771161008a578063ef54da5f11610064578063ef54da5f146108b7578063f0f44260146108e4578063f2fde38b1461090457600080fd5b8063d132877714610838578063e985e9c514610858578063ee96c89e146108a157600080fd5b8063c5551faf116100bb578063c5551faf146107ed578063c87b56dd14610803578063cfc86f7b1461082357600080fd5b8063ae2888941461077d578063b88d4fde146107ad578063bd2e5a83146107cd57600080fd5b806385852ce41161014357806395d89b411161011d57806395d89b4114610728578063a10abaa81461073d578063a22cb4651461075d57600080fd5b806385852ce4146106d05780638da5cb5b146106f057806395d0f6201461070e57600080fd5b8063715018a611610174578063715018a6146106865780638462151c1461069b578063853828b6146106c857600080fd5b80636352211e14610626578063682634181461064657806370a082311461066657600080fd5b806323b872dd1161025e578063459738e611610207578063547d1864116101e1578063547d1864146105c35780635a5cced6146105d957806361d027b31461060657600080fd5b8063459738e6146105735780634f6ccce714610589578063533687af146105a957600080fd5b80633b620191116102385780633b6201911461051357806340d679a81461053357806342842e0e1461055357600080fd5b806323b872dd146104b35780632f745c59146104d35780633050d420146104f357600080fd5b806303cf950f116102c0578063095ea7b31161029a578063095ea7b314610444578063145b43da1461046457806318160ddd1461048457600080fd5b806303cf950f146103d757806306fdde03146103f7578063081812fc1461040c57600080fd5b806301ffc9a7116102f157806301ffc9a714610363578063022e34681461039357806302fe5305146103b757600080fd5b806206d4621461030b5780628d066114610341575b600080fd5b34801561031757600080fd5b5061032b6103263660046130e5565b610924565b60405161033891906133a9565b60405180910390f35b34801561034d57600080fd5b5061036161035c366004612ff1565b6109c6565b005b34801561036f57600080fd5b5061038361037e366004613039565b610b2d565b6040519015158152602001610338565b34801561039f57600080fd5b506103a9600a5481565b604051908152602001610338565b3480156103c357600080fd5b506103616103d2366004613073565b610bfe565b3480156103e357600080fd5b5061032b6103f23660046130e5565b610c69565b34801561040357600080fd5b5061032b610c86565b34801561041857600080fd5b5061042c6104273660046130e5565b610d18565b6040516001600160a01b039091168152602001610338565b34801561045057600080fd5b5061036161045f366004612ff1565b610d75565b34801561047057600080fd5b5061036161047f366004612e9c565b610e30565b34801561049057600080fd5b506103a9600f546001600160801b03600160801b82048116918116919091031690565b3480156104bf57600080fd5b506103616104ce366004612f0f565b610eb9565b3480156104df57600080fd5b506103a96104ee366004612ff1565b610ec4565b3480156104ff57600080fd5b5061036161050e366004613195565b610fda565b34801561051f57600080fd5b5061032b61052e3660046130e5565b6112c5565b34801561053f57600080fd5b5061036161054e36600461301d565b61135f565b34801561055f57600080fd5b5061036161056e366004612f0f565b6113d0565b34801561057f57600080fd5b506103a960075481565b34801561059557600080fd5b506103a96105a43660046130e5565b6113eb565b3480156105b557600080fd5b50600b546103839060ff1681565b3480156105cf57600080fd5b506103a960095481565b3480156105e557600080fd5b506103a96105f4366004612e9c565b60036020526000908152604090205481565b34801561061257600080fd5b50600d5461042c906001600160a01b031681565b34801561063257600080fd5b5061042c6106413660046130e5565b6114b1565b34801561065257600080fd5b5061032b6106613660046130e5565b6114c3565b34801561067257600080fd5b506103a9610681366004612e9c565b6114dc565b34801561069257600080fd5b50610361611544565b3480156106a757600080fd5b506106bb6106b6366004612e9c565b6115aa565b6040516103389190613371565b610361611683565b3480156106dc57600080fd5b506103836106eb3660046130fe565b611719565b3480156106fc57600080fd5b50600e546001600160a01b031661042c565b34801561071a57600080fd5b506004546103839060ff1681565b34801561073457600080fd5b5061032b6117ba565b34801561074957600080fd5b5060065461042c906001600160a01b031681565b34801561076957600080fd5b50610361610778366004612fbc565b6117c9565b34801561078957600080fd5b506103836107983660046130e5565b60006020819052908152604090205460ff1681565b3480156107b957600080fd5b506103616107c8366004612f50565b611878565b3480156107d957600080fd5b506103616107e836600461301d565b6118b2565b3480156107f957600080fd5b506103a960085481565b34801561080f57600080fd5b5061032b61081e3660046130e5565b611923565b34801561082f57600080fd5b5061032b6119ac565b34801561084457600080fd5b50610361610853366004613145565b6119b9565b34801561086457600080fd5b50610383610873366004612ed6565b6001600160a01b03918216600090815260156020908152604080832093909416825291909152205460ff1690565b3480156108ad57600080fd5b506103a960055481565b3480156108c357600080fd5b506108d76108d2366004612e9c565b611c5e565b604051610338919061332b565b3480156108f057600080fd5b506103616108ff366004612e9c565b611d24565b34801561091057600080fd5b5061036161091f366004612e9c565b611e03565b600081815260016020526040902080546060919061094190613467565b80601f016020809104026020016040519081016040528092919081815260200182805461096d90613467565b80156109ba5780601f1061098f576101008083540402835291602001916109ba565b820191906000526020600020905b81548152906001019060200180831161099d57829003601f168201915b50505050509050919050565b600e546001600160a01b03163314610a255760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b600754610a5482610a4e600f546001600160801b03600160801b82048116918116919091031690565b90611ee2565b1115610aa25760405162461bcd60e51b815260206004820152601860248201527f4558434545445f4d41585f52504653544f5259504150455200000000000000006044820152606401610a1c565b610aac8282611ef5565b600854610ab99082611ee2565b6008557f9670c8b300c38cd3db8d3f9429dd902e67f418c4dd193e2497f06d20efc795608282610b01600f546001600160801b03600160801b82048116918116919091031690565b604080516001600160a01b03909416845260208401929092529082015260600160405180910390a15050565b60006001600160e01b031982167f80ac58cd000000000000000000000000000000000000000000000000000000001480610b9057506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610bc457506001600160e01b031982167f780e9d6300000000000000000000000000000000000000000000000000000000145b80610bf857507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b600e546001600160a01b03163314610c585760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1c565b610c64600c8383612ced565b505050565b600081815260026020526040902080546060919061094190613467565b606060108054610c9590613467565b80601f0160208091040260200160405190810160405280929190818152602001828054610cc190613467565b8015610d0e5780601f10610ce357610100808354040283529160200191610d0e565b820191906000526020600020905b815481529060010190602001808311610cf157829003601f168201915b5050505050905090565b6000610d2382611f13565b610d59576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000908152601460205260409020546001600160a01b031690565b6000610d80826114b1565b9050806001600160a01b0316836001600160a01b03161415610dce576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614801590610dee5750610dec8133610873565b155b15610e25576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c64838383611f49565b600e546001600160a01b03163314610e8a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1c565b6006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b610c64838383611fb2565b6000610ecf836114dc565b8210610f07576040517f0ddac30e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600f546001600160801b0316600080805b83811015610fd457600081815260126020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff161580159282019290925290610f805750610fcc565b80516001600160a01b031615610f9557805192505b876001600160a01b0316836001600160a01b03161415610fca5786841415610fc357509350610bf892505050565b6001909301925b505b600101610f18565b50600080fd5b60045460ff1661102c5760405162461bcd60e51b815260206004820152600a60248201527f43414e545f5752495445000000000000000000000000000000000000000000006044820152606401610a1c565b60055442101561107e5760405162461bcd60e51b815260206004820152601160248201527f4e4f545f494e5f57524954455f54494d450000000000000000000000000000006044820152606401610a1c565b83336110898261221d565b516001600160a01b0316146110e05760405162461bcd60e51b815260206004820152600c60248201527f4e4f545f50505f4f574e455200000000000000000000000000000000000000006044820152606401610a1c565b600085815260208190526040902054859060ff16156111415760405162461bcd60e51b815260206004820152600a60248201527f50505f5752495454454e000000000000000000000000000000000000000000006044820152606401610a1c565b6006546040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810187905233916001600160a01b031690636352211e9060240160206040518083038186803b15801561119e57600080fd5b505afa1580156111b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d69190612eb9565b6001600160a01b03161461122c5760405162461bcd60e51b815260206004820152600d60248201527f4e4f545f5250465f4f574e4552000000000000000000000000000000000000006044820152606401610a1c565b600086815260208181526040808320805460ff191660019081179091558884528252909120855161125f92870190612d71565b506000858152600260209081526040909120845161127f92860190612d71565b507f425816acf5c88faaa4378f40130b499dece634f288f4e46dfef5987fd5b18e9c868686866040516112b594939291906133bc565b60405180910390a1505050505050565b600160205260009081526040902080546112de90613467565b80601f016020809104026020016040519081016040528092919081815260200182805461130a90613467565b80156113575780601f1061132c57610100808354040283529160200191611357565b820191906000526020600020905b81548152906001019060200180831161133a57829003601f168201915b505050505081565b600e546001600160a01b031633146113b95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1c565b6004805460ff191692151592909217909155600555565b610c6483838360405180602001604052806000815250611878565b600f546000906001600160801b031681805b8281101561147e57600081815260126020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff16151591810182905290611475578583141561146e5750949350505050565b6001909201915b506001016113fd565b506040517fa723001c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006114bc8261221d565b5192915050565b600260205260009081526040902080546112de90613467565b60006001600160a01b03821661151e576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b031660009081526013602052604090205467ffffffffffffffff1690565b600e546001600160a01b0316331461159e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1c565b6115a8600061235c565b565b606060006115b7836114dc565b9050806115f25760005b6040519080825280602002602001820160405280156115ea578160200160208202803683370190505b509392505050565b60008167ffffffffffffffff81111561160d5761160d613523565b604051908082528060200260200182016040528015611636578160200160208202803683370190505b50905060005b828110156115ea5761164e8582610ec4565b8282815181106116605761166061350d565b6020908102919091010152806116758161349c565b91505061163c565b50919050565b600e546001600160a01b031633146116dd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1c565b600d546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015611716573d6000803e3d6000fd5b50565b60008061178a6117847f182854de6a51f3818344a7eb784b9d55c1e6d2d20c9f9aea309f5daaaaddfec1336040805160208101939093526001600160a01b039091169082015260608101879052608001604051602081830303815290604052805190602001206123bb565b84612424565b9050806001600160a01b03166117a8600e546001600160a01b031690565b6001600160a01b031614949350505050565b606060118054610c9590613467565b6001600160a01b03821633141561180c576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360008181526015602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611883848484611fb2565b61188f84848484612440565b6118ac576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b600e546001600160a01b0316331461190c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1c565b600b805460ff191692151592909217909155600a55565b606061192e82611f13565b61197a5760405162461bcd60e51b815260206004820152601060248201527f544f4b454e5f4e4f545f455849535453000000000000000000000000000000006044820152606401610a1c565b600c6119858361254f565b604051602001611996929190613248565b6040516020818303038152906040529050919050565b600c80546112de90613467565b600b5460ff161515600114611a105760405162461bcd60e51b815260206004820152601060248201527f434c41494d5f4e4f545f414354495645000000000000000000000000000000006044820152606401610a1c565b600a54421015611a625760405162461bcd60e51b815260206004820152601160248201527f4e4f545f494e5f434c41494d5f54494d450000000000000000000000000000006044820152606401610a1c565b611a6c8282611719565b611ab85760405162461bcd60e51b815260206004820152601260248201527f4e4f545f454c494749424c455f434c41494d00000000000000000000000000006044820152606401610a1c565b600754611ae184610a4e600f546001600160801b03600160801b82048116918116919091031690565b1115611b2f5760405162461bcd60e51b815260206004820152601860248201527f4558434545445f4d41585f52504653544f5259504150455200000000000000006044820152606401610a1c565b600083118015611b595750336000908152600360205260409020548290611b569085611ee2565b11155b611ba55760405162461bcd60e51b815260206004820152601460248201527f4558434545445f4d41585f434c41494d41424c450000000000000000000000006044820152606401610a1c565b611baf3384611ef5565b600954611bbc9084611ee2565b60095533600090815260036020526040902054611bd99084611ee2565b336000818152600360205260409020919091557f9670c8b300c38cd3db8d3f9429dd902e67f418c4dd193e2497f06d20efc795609084611c31600f546001600160801b03600160801b82048116918116919091031690565b604080516001600160a01b03909416845260208401929092529082015260600160405180910390a1505050565b60606000611c6b836114dc565b905080611c795760006115c1565b60008167ffffffffffffffff811115611c9457611c94613523565b604051908082528060200260200182016040528015611cbd578160200160208202803683370190505b50905060005b828110156115ea576000611cd78683610ec4565b600081815260208190526040902054845191925060ff1690849084908110611d0157611d0161350d565b911515602092830291909101909101525080611d1c8161349c565b915050611cc3565b600e546001600160a01b03163314611d7e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1c565b6001600160a01b038116611dd45760405162461bcd60e51b815260206004820152601460248201527f53455454494e475f5a45524f5f414444524553530000000000000000000000006044820152606401610a1c565b600d805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b600e546001600160a01b03163314611e5d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1c565b6001600160a01b038116611ed95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610a1c565b6117168161235c565b6000611eee82846133f8565b9392505050565b611f0f828260405180602001604052806000815250612681565b5050565b600f546000906001600160801b031682108015610bf8575050600090815260126020526040902054600160e01b900460ff161590565b600082815260146020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000611fbd8261221d565b80519091506000906001600160a01b0316336001600160a01b03161480611feb57508151611feb9033610873565b80612006575033611ffb84610d18565b6001600160a01b0316145b90508061203f576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b846001600160a01b031682600001516001600160a01b03161461208e576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0384166120ce576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6120de6000848460000151611f49565b6001600160a01b038581166000908152601360209081526040808320805467ffffffffffffffff1980821667ffffffffffffffff92831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652601290945282852080546001600160e01b031916909417600160a01b4290921691909102179092559086018083529120549091166121d357600f546001600160801b03168110156121d3578251600082815260126020908152604090912080549186015167ffffffffffffffff16600160a01b026001600160e01b03199092166001600160a01b03909316929092171790555b5082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b6040805160608101825260008082526020820181905291810191909152600f5482906001600160801b031681101561232a57600081815260126020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff161515918101829052906123285780516001600160a01b0316156122be579392505050565b5060001901600081815260126020908152604091829020825160608101845290546001600160a01b038116808352600160a01b820467ffffffffffffffff1693830193909352600160e01b900460ff1615159281019290925215612323579392505050565b6122be565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600e80546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000610bf86123c861268e565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b600080600061243385856127b5565b915091506115ea81612825565b60006001600160a01b0384163b1561254357604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906124849033908990889088906004016132ef565b602060405180830381600087803b15801561249e57600080fd5b505af19250505080156124ce575060408051601f3d908101601f191682019092526124cb91810190613056565b60015b612529573d8080156124fc576040519150601f19603f3d011682016040523d82523d6000602084013e612501565b606091505b508051612521576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612547565b5060015b949350505050565b60608161258f57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156125b957806125a38161349c565b91506125b29050600a83613410565b9150612593565b60008167ffffffffffffffff8111156125d4576125d4613523565b6040519080825280601f01601f1916602001820160405280156125fe576020820181803683370190505b5090505b841561254757612613600183613424565b9150612620600a866134b7565b61262b9060306133f8565b60f81b8183815181106126405761264061350d565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061267a600a86613410565b9450612602565b610c6483838360016129e0565b6000306001600160a01b037f000000000000000000000000b6b9067d207fda8fcb36a93febcfee9f7ec43b5e161480156126e757507f000000000000000000000000000000000000000000000000000000000000000146145b1561271157507f526dd316f3c3fd08651e4448c277824b57a55e1551f7fb65b217d6a2abe7bbf790565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527fc661053dbfc26d2c9c0956e4e02a3f02bf80276dd749cf4260bdbf21f2e2ff9f828401527f06c015bd22b4c69690933c1058878ebdfef31f9aaae40bbe86d8a09fe1b2972c60608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000808251604114156127ec5760208301516040840151606085015160001a6127e087828585612bae565b9450945050505061281e565b825160401415612816576020830151604084015161280b868383612c9b565b93509350505061281e565b506000905060025b9250929050565b6000816004811115612839576128396134f7565b14156128425750565b6001816004811115612856576128566134f7565b14156128a45760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610a1c565b60028160048111156128b8576128b86134f7565b14156129065760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a1c565b600381600481111561291a5761291a6134f7565b14156129735760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610a1c565b6004816004811115612987576129876134f7565b14156117165760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610a1c565b600f546001600160801b03166001600160a01b038516612a2c576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83612a63576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516600081815260136020908152604080832080546fffffffffffffffffffffffffffffffff19811667ffffffffffffffff8083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c018116909202179091558584526012909252822080546001600160e01b031916909317600160a01b42909216919091021790915581905b85811015612b7f5760405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4838015612b555750612b536000888488612440565b155b15612b73576040516368d2bf6b60e11b815260040160405180910390fd5b60019182019101612afe565b50600f80546fffffffffffffffffffffffffffffffff19166001600160801b0392909216919091179055612216565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612be55750600090506003612c92565b8460ff16601b14158015612bfd57508460ff16601c14155b15612c0e5750600090506004612c92565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612c62573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612c8b57600060019250925050612c92565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831681612cd160ff86901c601b6133f8565b9050612cdf87828885612bae565b935093505050935093915050565b828054612cf990613467565b90600052602060002090601f016020900481019282612d1b5760008555612d61565b82601f10612d345782800160ff19823516178555612d61565b82800160010185558215612d61579182015b82811115612d61578235825591602001919060010190612d46565b50612d6d929150612de5565b5090565b828054612d7d90613467565b90600052602060002090601f016020900481019282612d9f5760008555612d61565b82601f10612db857805160ff1916838001178555612d61565b82800160010185558215612d61579182015b82811115612d61578251825591602001919060010190612dca565b5b80821115612d6d5760008155600101612de6565b80358015158114612e0a57600080fd5b919050565b600082601f830112612e2057600080fd5b813567ffffffffffffffff80821115612e3b57612e3b613523565b604051601f8301601f19908116603f01168101908282118183101715612e6357612e63613523565b81604052838152866020858801011115612e7c57600080fd5b836020870160208301376000602085830101528094505050505092915050565b600060208284031215612eae57600080fd5b8135611eee81613539565b600060208284031215612ecb57600080fd5b8151611eee81613539565b60008060408385031215612ee957600080fd5b8235612ef481613539565b91506020830135612f0481613539565b809150509250929050565b600080600060608486031215612f2457600080fd5b8335612f2f81613539565b92506020840135612f3f81613539565b929592945050506040919091013590565b60008060008060808587031215612f6657600080fd5b8435612f7181613539565b93506020850135612f8181613539565b925060408501359150606085013567ffffffffffffffff811115612fa457600080fd5b612fb087828801612e0f565b91505092959194509250565b60008060408385031215612fcf57600080fd5b8235612fda81613539565b9150612fe860208401612dfa565b90509250929050565b6000806040838503121561300457600080fd5b823561300f81613539565b946020939093013593505050565b6000806040838503121561303057600080fd5b61300f83612dfa565b60006020828403121561304b57600080fd5b8135611eee8161354e565b60006020828403121561306857600080fd5b8151611eee8161354e565b6000806020838503121561308657600080fd5b823567ffffffffffffffff8082111561309e57600080fd5b818501915085601f8301126130b257600080fd5b8135818111156130c157600080fd5b8660208285010111156130d357600080fd5b60209290920196919550909350505050565b6000602082840312156130f757600080fd5b5035919050565b6000806040838503121561311157600080fd5b82359150602083013567ffffffffffffffff81111561312f57600080fd5b61313b85828601612e0f565b9150509250929050565b60008060006060848603121561315a57600080fd5b8335925060208401359150604084013567ffffffffffffffff81111561317f57600080fd5b61318b86828701612e0f565b9150509250925092565b600080600080608085870312156131ab57600080fd5b8435935060208501359250604085013567ffffffffffffffff808211156131d157600080fd5b6131dd88838901612e0f565b935060608701359150808211156131f357600080fd5b50612fb087828801612e0f565b6000815180845261321881602086016020860161343b565b601f01601f19169290920160200192915050565b6000815161323e81856020860161343b565b9290920192915050565b600080845481600182811c91508083168061326457607f831692505b602080841082141561328457634e487b7160e01b86526022600452602486fd5b81801561329857600181146132a9576132d6565b60ff198616895284890196506132d6565b60008b81526020902060005b868110156132ce5781548b8201529085019083016132b5565b505084890196505b5050505050506132e6818561322c565b95945050505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526133216080830184613200565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015613365578351151583529284019291840191600101613347565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156133655783518352928401929184019160010161338d565b602081526000611eee6020830184613200565b8481528360208201526080604082015260006133db6080830185613200565b82810360608401526133ed8185613200565b979650505050505050565b6000821982111561340b5761340b6134cb565b500190565b60008261341f5761341f6134e1565b500490565b600082821015613436576134366134cb565b500390565b60005b8381101561345657818101518382015260200161343e565b838111156118ac5750506000910152565b600181811c9082168061347b57607f821691505b6020821081141561167d57634e487b7160e01b600052602260045260246000fd5b60006000198214156134b0576134b06134cb565b5060010190565b6000826134c6576134c66134e1565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461171657600080fd5b6001600160e01b03198116811461171657600080fdfea264697066735822122028afbb2193b9f420dd683b150dd3ce4ae7407a1fe1da255b64a966a8ded73c0e64736f6c63430008070033

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
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.