ETH Price: $1,822.75 (-14.98%)
 

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...236852472025-10-29 19:50:3599 days ago1761767435IN
GalaxyFrens: GF Token
0 ETH0.000018640.76918938
Set Approval For...231617842025-08-17 15:50:59172 days ago1755445859IN
GalaxyFrens: GF Token
0 ETH0.000041280.89495932
Set Approval For...218577492025-02-16 8:23:59354 days ago1739694239IN
GalaxyFrens: GF Token
0 ETH0.000052471.13764173
Set Approval For...203824882024-07-25 8:51:59560 days ago1721897519IN
GalaxyFrens: GF Token
0 ETH0.00017943.88946884
Safe Transfer Fr...193082642024-02-26 0:47:35710 days ago1708908455IN
GalaxyFrens: GF Token
0 ETH0.0027815123.89490543
Safe Transfer Fr...193082592024-02-26 0:46:35710 days ago1708908395IN
GalaxyFrens: GF Token
0 ETH0.0028948124.86829645
Safe Transfer Fr...193082542024-02-26 0:45:35710 days ago1708908335IN
GalaxyFrens: GF Token
0 ETH0.0023620124.35190138
Safe Transfer Fr...193082502024-02-26 0:44:47710 days ago1708908287IN
GalaxyFrens: GF Token
0 ETH0.0026216927.02917894
Set Approval For...189682612024-01-09 8:37:11758 days ago1704789431IN
GalaxyFrens: GF Token
0 ETH0.0007971617.25501133
Set Approval For...189518872024-01-07 1:11:59760 days ago1704589919IN
GalaxyFrens: GF Token
0 ETH0.0008072517.50063635
Set Approval For...188687522023-12-26 8:43:11772 days ago1703580191IN
GalaxyFrens: GF Token
0 ETH0.0003020212.47274329
Safe Transfer Fr...188679772023-12-26 6:07:47772 days ago1703570867IN
GalaxyFrens: GF Token
0 ETH0.0009466317.38546505
Set Approval For...188570372023-12-24 17:13:23774 days ago1703438003IN
GalaxyFrens: GF Token
0 ETH0.0011152524.1779875
Set Approval For...187147992023-12-04 18:30:47794 days ago1701714647IN
GalaxyFrens: GF Token
0 ETH0.0022533948.852025
Set Approval For...186695602023-11-28 10:34:59800 days ago1701167699IN
GalaxyFrens: GF Token
0 ETH0.001129924.45100247
Set Approval For...182179452023-09-26 5:42:59863 days ago1695706979IN
GalaxyFrens: GF Token
0 ETH0.000301376.53362942
Safe Transfer Fr...178068662023-07-30 15:54:11921 days ago1690732451IN
GalaxyFrens: GF Token
0 ETH0.0010663919.37455786
Safe Transfer Fr...174919202023-06-16 10:51:11965 days ago1686912671IN
GalaxyFrens: GF Token
0 ETH0.0013615325.02908749
Set Approval For...170159552023-04-10 6:13:111032 days ago1681107191IN
GalaxyFrens: GF Token
0 ETH0.0009105119.72909099
Set Approval For...168307802023-03-15 3:57:471058 days ago1678852667IN
GalaxyFrens: GF Token
0 ETH0.0011035123.9233271
Set Approval For...167306052023-03-01 1:47:591072 days ago1677635279IN
GalaxyFrens: GF Token
0 ETH0.0008261517.90119828
Set Approval For...167246872023-02-28 5:49:471073 days ago1677563387IN
GalaxyFrens: GF Token
0 ETH0.0008628618.70634917
Set Approval For...166989012023-02-24 14:51:471077 days ago1677250307IN
GalaxyFrens: GF Token
0 ETH0.0013894330.10624071
Set Approval For...166634922023-02-19 15:21:231082 days ago1676820083IN
GalaxyFrens: GF Token
0 ETH0.001467131.7893382
Safe Transfer Fr...166581932023-02-18 21:29:471083 days ago1676755787IN
GalaxyFrens: GF Token
0 ETH0.0022485419.22082271
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:
GalaxyFrens

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 3000 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT

/*........................................................................................
..........................................................................................
.........................................::--:............................................
......................................:=+++++++=.................:-==-:...................
.....................................=++++++++++=..............-++++++++:.................
...................................:=++++++++++++............:=++++++++++.................
..................................:+++=--===+=++=...........-====--+=++++-................
.................................:+++-    ======:.........:====:   -====+-................
................................:===:     =====-.........:====.    :=====:................
...............................:===-     :=====.........-====.     =====-.................
...............................====     .=====.........-====.     -=====..................
..............................-===.    .=====.........-====.     -=====...................
..............................===-    .=====.........-====.     -=====....................
.............................-===     ====-.........:===-     .=====-.....................
.............................===:    -===-.........:===-     -====-.......................
............................:===    :===-.........:===:    .====-:........................
............................-===    ====..::::::.:===:    -===-:..........................
............................===:   :================.   .===-:............................
...........................:===. :-================.   -===:..............................
...........................:=======================:..====++=:............................
...........................-==============================++++=...........................
..........................-================================+++++:.........................
........................:================:....:=============+++++-........................
.......................:.:-.============  .+**=.-===========++++++:.......................
........................-##=.==========: .######.===========+++++++.......................
......................- *### ==========. -######=:==========+++++++-......................
......................- ####.==========  =######*:==========+++++++-......................
.....................:- #### ==:.:=====  =######*:==========+++++++-......................
.....................:- ###* =.....====  =######+:=========+++++++=:......................
......................- *##= . ==:  :==. =######=-=========++++=-.........................
.....................   :*+    .-     .  .#####*:==========--:............................
.....................        ::::::::      ---: .......     ..............................
.....................                                       ..............................
......................                                    ................................
.........................                               ..................................
...............................                     ......................................
....................................:=+=:::::::=##+-:.....................................
...................................*###%%#***#%%%%##*.....................................
...................................################*......................................
................................. :################-.....=#-..............................
.............................:*:.:=###############+::....###+.............................
............................:*#--:-==---:-:--:--==-:.:--+####*:...........................
............................*##-: .. ... . .. . .  ::::-######*...........................
...........................+###:. .. .. .. .. .. ......:#######+..........................
..........................-####: ... .. .. .. .. ... ..=########=.........................
...................................................................Author: @ryanycwEth, C& 
...............................................................Head of Project: @jstin.eth
.....................................................................PR Manager: @Swi Chen
...................................................................Collab Manager: @Ken Ke
............................................................Community Manager: @Hazel Tsai
...............................................................Web Developer: @Mosano Yang
...........................................................Art & Dev Manager: @javic.eth*/

pragma solidity 0.8.4;

import "./interfaces/IGalaxyFrens.sol";
import "erc721psi/contracts/ERC721Psi.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";

error ExceedAmount();
error NotEnoughQuota();
error InvalidSignature();
error Unauthorized();
error ZeroAddress();
error InvalidInput();
error InvalidToken();
error InvalidTime();
error TokenNotExist();

contract GalaxyFrensStorage {
    uint256 public constant maxGalaxyFrensAmount = 2000;
    uint256 public constant maxRPFHoldersReserve = 900;
    uint256 public constant maxWhitelistReserve = 1800;
    uint256 public constant maxGalaxyFrensPerTx = 10;

    mapping(address => uint256) public rpfHolderMinted;
    mapping(address => uint256) public whitelistMinted;
    mapping(uint256 => uint256) public dreamingStarted;

    /// set with #setAuthorized
    mapping(address => bool) public isAuthorized;
    /// set with #setTokenInvalid and #setTokenValid
    BitMaps.BitMap internal isTokenInvalid;
    /// set with #setMission
    address public mission;
    /// set with #setSignerRPF
    address public signerRPF;
    /// set with #setSignerGF
    address public signerGF;
    /// set with #setBaseURI
    string public baseURI;
    /// set with #setWhitelistMintPhase
    uint256 public rpfHoldersMintStartTime;
    uint256 public rpfHoldersMintEndTime;
    /// set with #setWhitelistMintPhase
    uint256 public whitelistMintStartTime;
    uint256 public whitelistMintEndTime;
    /// set with #setPublicMintPhase
    uint256 public publicMintStartTime;
    uint256 public publicMintEndTime;
    /// set with #setDreamingInitTime
    uint256 public dreamingInitTime;
}

contract GalaxyFrens is 
    IGalaxyFrens, 
    GalaxyFrensStorage,
    ReentrancyGuard,
    Ownable,
    ERC721Psi,
    ERC2981
{
    using Strings for uint256;
    using BitMaps for BitMaps.BitMap;

    constructor(
        uint96 _royaltyFee,
        string memory _baseURI
    ) 
        ERC721Psi("GalaxyFrens", "GF")
    {
        signerRPF = address(0x3D34F69AeD7e3Bb13754a05ED1d95a25968C0C73);
        signerGF = owner();
        isAuthorized[owner()] = true;

        _setDefaultRoyalty(0x19c74DEfdEBB12D37Ab667dA4ADeE3e5D73C82Db, _royaltyFee);

        baseURI = _baseURI;
    }

      ///////////////
     // Modifiers //
    ///////////////

    modifier onlyAuthorized() {
        // Check if the address is in the authorized address array
        if (!isAuthorized[msg.sender]) {
            revert Unauthorized();
        }
        _;
    }

    modifier rpfHoldersMintActive() {
        // Check if it's not yet mint time or after mint time
        if (block.timestamp <= rpfHoldersMintStartTime || block.timestamp >= rpfHoldersMintEndTime) {
            revert InvalidTime();
        }
        _;
    }

    modifier whitelistMintActive() {
        // Check if it's not yet mint time or after mint time
        if (block.timestamp <= whitelistMintStartTime || block.timestamp >= whitelistMintEndTime) {
            revert InvalidTime();
        }
        _;
    }

    modifier publicMintActive() {
        // Check if it's not yet mint time or after mint time
        if (block.timestamp <= publicMintStartTime || block.timestamp >= publicMintEndTime) {
            revert InvalidTime();
        }
        _;
    }

    modifier setTimeCheck(uint256 _startTime, uint256 _endTime) {
        // If we set the start time before end time
        if (_startTime > _endTime) {
            revert InvalidInput();
        }
        _;
    }

    modifier addressCheck(address _address) {
        // If the new address is zero
        if (_address == address(0)) {
            revert ZeroAddress();
        }
        _;
    }

    /** 
     * @dev Override same interface function in different inheritance.
     * @param interfaceId Id of an interface to check whether the contract support
     */
    function supportsInterface(bytes4 interfaceId)
        public
        view
        override(ERC721Psi, ERC2981)
        returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }

      //////////////////////////////
     // User Execution Functions //
    //////////////////////////////

    /**
     * @dev Check whether an address is in the list
     * @dev Check whether the signature generation process is abnormal
     * @param _maxMintableQuantity Maximum Quantity of tokens that an address can mint
     * @param _signature Signature used to verify the address is in the list
     */
    function verify(
        uint256 _maxMintableQuantity, 
        address _signer,
        bytes calldata _signature
    ) 
        public
        override
        view
        returns(bool _whitelisted)
    {
        bytes32 hash = ECDSA.toEthSignedMessageHash(
            keccak256(
                abi.encodePacked(msg.sender, _maxMintableQuantity)
            )
        );

        return _signer == ECDSA.recover(hash, _signature);
    }

    /** 
     * @dev Mint designated amount of the Galaxy Frens to an address as owner
     * @param _to Address to transfer the tokens
     * @param _quantity Designated amount of tokens
     */
    function mintGiveawayFrens(
        address _to, 
        uint256 _quantity
    )
        external
        override
        onlyAuthorized
    {
        _safeMint(_to, _quantity);
    }

    /** 
     * @dev Mint the Galaxy Frens as RPF holders
     * @param _quantity Amount of the Galaxy Frens that the caller wants to mint
     * @param _maxQuantity Maximum amount of the Galaxy Frens that the caller can mint
     * @param _signature Signature used to verify the minter address and claimable amount
     */
    function mintRPFHoldersFrens(
        uint256 _quantity,
        uint256 _maxQuantity,
        bytes calldata _signature
    ) 
        external
        override
        rpfHoldersMintActive
    {
        // Check if the mint amount will exceed the maximum tier token supply
        if (totalSupply() + _quantity > maxRPFHoldersReserve) {
            revert ExceedAmount();
        }

        // If this signature is from a valid signer
        if (!verify(_maxQuantity, signerRPF, _signature)) {
            revert InvalidSignature();
        }

        rpfHolderMinted[msg.sender] += _quantity;

        // Check if the whitelist mint amount will exceed the maximum mintable amount
        if (rpfHolderMinted[msg.sender] > _maxQuantity) {
            revert NotEnoughQuota();
        }

        _safeMint(msg.sender, _quantity);
    }

    /** 
     * @dev Mint the Galaxy Frens as whitelisted addresses
     * @param _quantity Amount of the Galaxy Frens that the caller wants to mint
     * @param _maxQuantity Maximum amount of the Galaxy Frens that the caller can mint
     * @param _signature Signature used to verify the minter address and claimable amount
     */
    function mintWhitelistFrens(
        uint256 _quantity,
        uint256 _maxQuantity,
        bytes calldata _signature
    ) 
        external
        override
        whitelistMintActive
    {
        // Check if the mint amount will exceed the maximum tier token supply
        if (totalSupply() + _quantity > maxWhitelistReserve) {
            revert ExceedAmount();
        }

        // If this signature is from a valid signer
        if (!verify(_maxQuantity, signerGF, _signature)) {
            revert InvalidSignature();
        }

        whitelistMinted[msg.sender] += _quantity;

        // Check if the whitelist mint amount will exceed the maximum mintable amount
        if (whitelistMinted[msg.sender] > _maxQuantity) {
            revert NotEnoughQuota();
        }

        _safeMint(msg.sender, _quantity);
    }

    /** 
     * @dev Mint the Galaxy Frens during public sale
     * @param _quantity Amount of the Galaxy Frens the caller wants to mint
     */
    function mintPublicFrens(uint256 _quantity) 
        external
        override
        publicMintActive
    {
        // Check if the mint amount exceed the maximum quantity per tx
        if (_quantity > maxGalaxyFrensPerTx) {
            revert ExceedAmount();
        }

        // Check if the mint amount will exceed the maximum tier token supply
        if (totalSupply() + _quantity > maxWhitelistReserve) {
            revert ExceedAmount();
        }

        _safeMint(msg.sender, _quantity);
    }

    function _safeMint(
        address _to, 
        uint256 _quantity
    ) 
        internal
        override
        nonReentrant
    {
        // Check if the mint amount will exceed the maximum tier token supply
        if (totalSupply() + _quantity > maxGalaxyFrensAmount) {
            revert ExceedAmount();
        }

        super._safeMint(_to, _quantity);
        emit MintGalaxyFrens(_to, _quantity, totalSupply());
    }

      ////////////////////////////
     // Info Getters Functions //
    ////////////////////////////

    /** 
     * @dev Retrieve all tokenIds of a given address
     * @param _owner Address which caller wants to get all of its tokenIds
     */
    function tokensOfOwner(
        address _owner,
        uint256 _start,
        uint256 _end
    )
        public
        view
        override
        returns(uint256[] memory _tokenIds)
    {
        uint256 tokenCount = balanceOf(_owner);
        if (tokenCount == 0) {
            // Return an empty array
            return new uint256[](0);
        } else {
            uint256 amount = _end - _start + 1;
            uint256[] memory result = new uint256[](amount);
            for (uint256 index = 0; index < amount; index++) {
                result[index] = tokenOfOwnerByIndex(_owner, index + _start);
            }
            return result;
        }
    }

    /** 
     * @dev Retrieve the status of whether a token is set to invalid
     * @param _tokenId TokenId which caller wants to get its valid status
     */
    function getTokenValidStatus(uint256 _tokenId)
        public
        view
        override
        returns(bool _status)
    {
        return isTokenInvalid.get(_tokenId);
    }

    /** @dev Retrieve the dreaming period (How long owners hold a token) of a token
     * @param _tokenId TokenId which caller wants to get its dreaming period
     */
    function getDreamingPeriod(uint256 _tokenId) 
        public
        view
        override
        returns(uint256 _dreamingTime)
    {
        if (dreamingInitTime == 0 || dreamingInitTime > block.timestamp) {
            // If it's not yet the initial dreaming time or it is unset, return zero
            return 0;
        } else if (dreamingStarted[_tokenId] == 0) {
            // If the token haven't been transferred, return current time - the initial dreaming time
            return block.timestamp - dreamingInitTime;
        } else {
            // If the token have been transfered, return current time - the dreaming starting time
            // Which is reset when the token is transferred
            return block.timestamp - dreamingStarted[_tokenId];
        }
    }

    /** 
     * @dev Retrieve all the dreaming period (How long owners hold a token) of the tokens of a giving address.
     * @param _owner Address which caller wants to get all the dreaming period (How long owners hold a token) of its token
     */
    function getDreamingPeriodByOwner(address _owner) 
        public
        view
        override
        returns(uint256[] memory _dreamingTimeList)
    {
        uint256 tokenCount = balanceOf(_owner);
        if (tokenCount == 0) {
            return new uint256[](0);
        } else {
            uint256[] memory result = new uint256[](tokenCount);
            for (uint256 index = 0; index < tokenCount; index++) {
                uint256 tokenId = tokenOfOwnerByIndex(_owner, index);
                result[index] = getDreamingPeriod(tokenId);
            }
            return result;
        }
    }

    /** 
     * @dev Retrieve token URI to get the metadata of a token
     * @param _tokenId TokenId which caller wants to get the metadata of
     */
	function tokenURI(uint256 _tokenId) 
        public 
        view 
        override 
        returns (string memory _tokenURI) 
    {
        // Check the token is minted
        if (!_exists(_tokenId)) {
            revert TokenNotExist();
        }
		return string(abi.encodePacked(baseURI, _tokenId.toString()));
	}

      /////////////////////////
     // Set Phase Functions //
    /////////////////////////

    /** 
     * @dev Set the status, starting time, and ending time of the rpf holders mint phase
     * @param _startTime After this timestamp the rpf holders mint phase will be enabled
     * @param _endTime After this timestamp the rpf holders mint phase will be disabled
     * @notice Start time must be smaller than end time
     */
    function setRPFHoldersMintPhase(
        uint256 _startTime, 
        uint256 _endTime
    )
        external
        override
        onlyAuthorized
        setTimeCheck(_startTime, _endTime)
    {
        rpfHoldersMintStartTime = _startTime;
        rpfHoldersMintEndTime = _endTime;

        emit PhaseSet(_startTime, _endTime, "RPFHolders");
    }

    /** 
     * @dev Set the status, starting time, and ending time of the whitelist mint phase
     * @param _startTime After this timestamp the whitelist mint phase will be enabled
     * @param _endTime After this timestamp the whitelist mint phase will be disabled
     * @notice Start time must be smaller than end time
     */
    function setWhitelistMintPhase(
        uint256 _startTime, 
        uint256 _endTime
    )
        external
        override
        onlyAuthorized
        setTimeCheck(_startTime, _endTime)
    {
        whitelistMintStartTime = _startTime;
        whitelistMintEndTime = _endTime;

        emit PhaseSet(_startTime, _endTime, "Whitelist");
    }

    /** 
     * @dev Set the status, starting time, and ending time of the public mint phase
     * @param _startTime After this timestamp the public mint phase will be enabled
     * @param _endTime After this timestamp the public mint phase will be disabled
     * @notice Start time must be smaller than end time
     */
    function setPublicMintPhase(
        uint256 _startTime, 
        uint256 _endTime
    )
        external
        override
        onlyAuthorized
        setTimeCheck(_startTime, _endTime)
    {
        publicMintStartTime = _startTime;
        publicMintEndTime = _endTime;

        emit PhaseSet(_startTime, _endTime, "Public");
    }

      ////////////////////////////////////////
     // Set Roles & Token Status Functions //
    ////////////////////////////////////////

    /** 
     * @dev Set the status of whether an address is authorized
     * @param _authorizer Address to change its authorized status
     * @param _status New status to assign to the authorizedAddress
     */
    function setAuthorizer(
        address _authorizer, 
        bool _status
    )
        external
        override
        onlyOwner
    {
        isAuthorized[_authorizer] = _status;

        emit StatusChange(_authorizer, _status);
    }

    /** 
     * @dev Set the status of whether an address is signer
     * @param _signer Address to change its status as a signer
     */
    function setSignerRPF(address _signer)
        external
        override
        onlyOwner
        addressCheck(_signer)
    {
        signerRPF = _signer;

        emit AddressSet(_signer, "SignRPF");
    }

    /** 
     * @dev Set the status of whether an address is signer
     * @param _signer Address to change its status as a signer
     */
    function setSignerGF(address _signer)
        external
        override
        onlyOwner
        addressCheck(_signer)
    {
        signerGF = _signer;

        emit AddressSet(_signer, "SignGF");
    }

    /** 
     * @dev Set the specific token to invalid, to revert the transfering transaction
     * @param _tokenId Token Id that owner wants to set to invalid
     */
    function setTokenInvalid(uint256 _tokenId)
        external
        override
        onlyOwner
    {
        isTokenInvalid.set(_tokenId);

        emit TokenStatusChange(_tokenId, true);
    }

    /** 
     * @dev Set the specific token to valid, to revert the transfering transaction 
     * @param _tokenId Token Id that owner wants to set to valid
     */
    function setTokenValid(uint256 _tokenId)
        external
        override
        onlyOwner
    {
        isTokenInvalid.unset(_tokenId);

        emit TokenStatusChange(_tokenId, false);
    }

      //////////////////////////
     // Set Params Functions //
    //////////////////////////

    /** 
     * @dev Set the royalties information for platforms that support ERC2981, LooksRare & X2Y2
     * @param _receiver Address that should receive royalties
     * @param _feeNumerator Amount of royalties that collection creator wants to receive
     */
    function setDefaultRoyalty(
        address _receiver, 
        uint96 _feeNumerator
    )
        external
        override
        onlyOwner
    {
        _setDefaultRoyalty(_receiver, _feeNumerator);
    }

    /** 
     * @dev Set the royalties information for platforms that support ERC2981, LooksRare & X2Y2
     * @param _receiver Address that should receive royalties
     * @param _feeNumerator Amount of royalties that collection creator wants to receive
     */
    function setTokenRoyalty(
        uint256 _tokenId,
        address _receiver,
        uint96 _feeNumerator
    ) 
        external 
        override
        onlyOwner 
    {
        _setTokenRoyalty(_tokenId, _receiver, _feeNumerator);
    }

    /** 
     * @dev Set the URI for tokenURI, which returns the metadata of the token
     * @param _baseURI New URI that caller wants to set as the tokenURI
     */
    function setBaseURI(string memory _baseURI)
        external
        override
        onlyOwner
    {
        baseURI = _baseURI;

        emit BaseURISet(_baseURI);
    }

    /** 
     * @dev Set the init time for the dreaming period
     * @param _initTime The new timestamp for the dreaming init time
     * @notice Before the dreamingInitTime is set, all dreaming period will be zero
     */
    function setDreamingInitTime(uint256 _initTime)
        external
        override
        onlyOwner
    {
        dreamingInitTime = _initTime;

        emit NumberSet(_initTime, "Dream");
    }

    /** @dev Set the address that act as treasury and recieve all the fund from token contract
     * @param _mission New address that caller wants to set as the treasury address
     */
    function setMission(address _mission)
        external
        override
        onlyOwner
        addressCheck(_mission)
    {
        mission = _mission;

        emit AddressSet(_mission, "Mission");
    }

    /** @dev Checker before token transfer
     * @param _from Address to transfer the token from
     * @param _to Address to recieve the token
     * @param _startTokenId Init Id to start to transfer the tokens
     * @param _quantity Amount of tokens that will be transferred
     * @notice If the token is set to Invalid, then the transfer will be reverted
     * @notice Every time the token is transferred, the dreaming starting time of the token will be resetted.
     */
    function _beforeTokenTransfers(
        address _from,
        address _to,
        uint256 _startTokenId,
        uint256 _quantity
    ) 
        internal
        override
    {
        // If it's mint or burn, no action require
        if (_from == address(0)) {
            return;
        }

        for (
            uint256 tokenId = _startTokenId;
            tokenId < _startTokenId + _quantity;
            ++tokenId
        ) {
            // If the token has any issue, it will be set to invalid and transfer is paused
            if (isTokenInvalid.get(tokenId)) {
                revert InvalidToken();
            }

            // Tokens being transferred to joined missions is permitted
            if (_to != mission) {
                dreamingStarted[tokenId] = block.timestamp;
            }
        }
    }
}

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

interface IGalaxyFrens {  
    //////////////////////////////
   // User Execution Functions //
  //////////////////////////////

  // Verify whether an address is in the whitelist;
  function verify(uint256 _maxMintableQuantity, address _signer, bytes calldata _signature) external view returns(bool _whitelisted);
  // Mint giveaway Galaxy Frens to an address by owner.
  function mintGiveawayFrens(address _to, uint256 _quantity) external;
  // RPF holders mint specific amount of the Galaxy Frens with signature & maximum mintable amount to verify.
  function mintRPFHoldersFrens(uint256 _quantity, uint256 _maxQuantity, bytes calldata _signature) external;
  // Whitelisted addresses mint specific amount of the Galaxy Frens with signature & maximum mintable amount to verify.
  function mintWhitelistFrens(uint256 _quantity, uint256 _maxQuantity, bytes calldata _signature) external;
  // Public addresses mint specific amount of tokens in public sale.
  function mintPublicFrens(uint256 _quantity) external;

    ////////////////////////////
   // Info Getters Functions //
  ////////////////////////////

  // Get all the tokenIds of an address.
  function tokensOfOwner(address _owner, uint256 _start, uint256 _end) external view returns(uint256[] memory _tokenIds);
  // Get the status of whether a token is set to invalid.
  function getTokenValidStatus(uint256 _tokenId) external view returns(bool _status);
  // Get the dreaming period (How long owners hold a token) of a token.
  function getDreamingPeriod(uint256 _tokenId) external view returns(uint256 _dreamingTime);
  // Get all the dreaming period (How long owners hold a token) of a token of a owner's address.
  function getDreamingPeriodByOwner(address _owner) external view returns(uint256[] memory _dreamingTimeList);

    /////////////////////////
   // Set Phase Functions //
  /////////////////////////

  // Set the variables to enable the whitelist mint phase by owner.
  function setRPFHoldersMintPhase(uint256 _startTime, uint256 _endTime) external;
  // Set the variables to enable the whitelist mint phase by owner.
  function setWhitelistMintPhase(uint256 _startTime, uint256 _endTime) external;
  // Set the variables to enable the public mint phase by owner.
  function setPublicMintPhase(uint256 _startTime, uint256 _endTime) external;

    ////////////////////////////////////////
   // Set Roles & Token Status Functions //
  ////////////////////////////////////////

  // Set the authorized status of an address, true to have authorized access, false otherwise.
  function setAuthorizer(address _authorizer, bool _status) external;
  // Set the address to generate and validate the signature for RPF holders.
  function setSignerRPF(address _signer) external;
  // Set the address to generate and validate the signature for whitelist address.
  function setSignerGF(address _signer) external;
  // Set token invalid, so that the token cannot be transferred.
  function setTokenInvalid(uint256 _tokenId) external;
  // Set token valid, so that the token can be transferred.
  function setTokenValid(uint256 _tokenId) external;

    //////////////////////////
   // Set Params Functions //
  //////////////////////////

  // Set collection royalties with platforms that support ERC2981.
  function setDefaultRoyalty(address _receiver, uint96 _feeNumerator) external;
  // Set royalties of specific token with platforms that support ERC2981.
  function setTokenRoyalty(uint256 _tokenId, address _receiver, uint96 _feeNumerator) external;
  // Set the URI to return the tokens metadata.
  function setBaseURI(string memory _baseURI) external;
  // Set the init time of dreaming.
  function setDreamingInitTime(uint256 _initTime) external;
  // Set the address to transfer the contract fund to.
  function setMission(address _mission) external;

  // This event is triggered whenever a call to #mintGiveawayFrens, #mintRPFHoldersFrens, #mintWhitelistFrens and #mintPublicFrens succeeds.
  event MintGalaxyFrens(address _owner, uint256 _quantity, uint256 _totalSupply);
  // This event is triggered whenever a call to #setRPFHoldersMintPhase, #setWhitelistMintPhase and #setPublicMintPhase succeeds.
  event PhaseSet(uint256 _startTime, uint256 _endTime, string _type);
  // This event is triggered whenever a call to #setAuthorizer.
  event StatusChange(address _change, bool _status);
  // This event is triggered whenever a call to #setTokenInvalid, #setTokenInvalidInBatch, #setTokenValid, and #setTokenValidInBatch succeeds,
  event TokenStatusChange(uint256 _tokenId, bool _status);
  // This event is triggered whenever a call to #setBaseURI succeeds.
  event BaseURISet(string _baseURI);
  // This event is triggered whenever a call to #setDreamingInitTime succeeds.
  event NumberSet(uint256 _amount, string _type);
  // This event is triggered whenever a call to #setSignerRPF, #setSignerGF, and #setMission succeeds.
  event AddressSet(address _address, string _type);
}

// SPDX-License-Identifier: MIT
/**
  ______ _____   _____ ______ ___  __ _  _  _ 
 |  ____|  __ \ / ____|____  |__ \/_ | || || |
 | |__  | |__) | |        / /   ) || | \| |/ |
 |  __| |  _  /| |       / /   / / | |\_   _/ 
 | |____| | \ \| |____  / /   / /_ | |  | |   
 |______|_|  \_\\_____|/_/   |____||_|  |_|   
                                              
                                            
 */

pragma solidity ^0.8.0;

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/Context.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/StorageSlot.sol";
import "solidity-bits/contracts/BitMaps.sol";


contract ERC721Psi is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
    using Address for address;
    using Strings for uint256;
    using BitMaps for BitMaps.BitMap;

    BitMaps.BitMap private _batchHead;

    string private _name;
    string private _symbol;

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

    mapping(uint256 => address) private _tokenApprovals;
    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 ||
            interfaceId == type(IERC721Enumerable).interfaceId ||
            super.supportsInterface(interfaceId);
    }

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

        uint count;
        for( uint i; i < _minted; ++i ){
            if(_exists(i)){
                if( owner == ownerOf(i)){
                    ++count;
                }
            }
        }
        return count;
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId)
        public
        view
        virtual
        override
        returns (address)
    {
        (address owner, ) = _ownerAndBatchHeadOf(tokenId);
        return owner;
    }

    function _ownerAndBatchHeadOf(uint256 tokenId) internal view returns (address owner, uint256 tokenIdBatchHead){
        require(_exists(tokenId), "ERC721Psi: owner query for nonexistent token");
        tokenIdBatchHead = _getBatchHead(tokenId);
        owner = _owners[tokenIdBatchHead];
    }

    /**
     * @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), "ERC721Psi: 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 = ownerOf(tokenId);
        require(to != owner, "ERC721Psi: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721Psi: 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),
            "ERC721Psi: approved query for nonexistent token"
        );

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved)
        public
        virtual
        override
    {
        require(operator != _msgSender(), "ERC721Psi: approve to caller");

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

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(
            _isApprovedOrOwner(_msgSender(), tokenId),
            "ERC721Psi: 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),
            "ERC721Psi: 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, 1,_data),
            "ERC721Psi: 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`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return tokenId < _minted;
    }

    /**
     * @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),
            "ERC721Psi: operator query for nonexistent token"
        );
        address owner = ownerOf(tokenId);
        return (spender == owner ||
            getApproved(tokenId) == spender ||
            isApprovedForAll(owner, spender));
    }

    /**
     * @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) internal virtual {
        _safeMint(to, quantity, "");
    }

    
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal virtual {
        uint256 startTokenId = _minted;
        _mint(to, quantity);
        require(
            _checkOnERC721Received(address(0), to, startTokenId, quantity, _data),
            "ERC721Psi: transfer to non ERC721Receiver implementer"
        );
    }


    function _mint(
        address to,
        uint256 quantity
    ) internal virtual {
        uint256 tokenIdBatchHead = _minted;
        
        require(quantity > 0, "ERC721Psi: quantity must be greater 0");
        require(to != address(0), "ERC721Psi: mint to the zero address");
        
        _beforeTokenTransfers(address(0), to, tokenIdBatchHead, quantity);
        _minted += quantity;
        _owners[tokenIdBatchHead] = to;
        _batchHead.set(tokenIdBatchHead);
        _afterTokenTransfers(address(0), to, tokenIdBatchHead, quantity);
        
        // Emit events
        for(uint256 tokenId=tokenIdBatchHead;tokenId < tokenIdBatchHead + quantity; tokenId++){
            emit Transfer(address(0), to, 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 {
        (address owner, uint256 tokenIdBatchHead) = _ownerAndBatchHeadOf(tokenId);

        require(
            owner == from,
            "ERC721Psi: transfer of token that is not own"
        );
        require(to != address(0), "ERC721Psi: transfer to the zero address");

        _beforeTokenTransfers(from, to, tokenId, 1);

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

        uint256 nextTokenId = tokenId + 1;

        if(!_batchHead.get(nextTokenId) &&  
            nextTokenId < _minted
        ) {
            _owners[nextTokenId] = from;
            _batchHead.set(nextTokenId);
        }

        _owners[tokenId] = to;
        if(tokenId != tokenIdBatchHead) {
            _batchHead.set(tokenId);
        }

        emit Transfer(from, to, tokenId);

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

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

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

    function _getBatchHead(uint256 tokenId) internal view returns (uint256 tokenIdBatchHead) {
        tokenIdBatchHead = _batchHead.scanForward(tokenId); 
    }

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

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256 tokenId) {
        require(index < totalSupply(), "ERC721Psi: global index out of bounds");
        
        uint count;
        for(uint i; i < _minted; i++){
            if(_exists(i)){
                if(count == index) return i;
                else count++;
            }
        }
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256 tokenId) {
        uint count;
        for(uint i; i < _minted; i++){
            if(_exists(i) && owner == ownerOf(i)){
                if(count == index) return i;
                else count++;
            }
        }

        revert("ERC721Psi: owner index out of bounds");
    }


    /**
     * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
     *
     * 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`.
     */
    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.
     *
     * 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` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

File 5 of 20 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.3) (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) {
        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.
            /// @solidity memory-safe-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 {
            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 (last updated v4.7.0) (token/common/ERC2981.sol)

pragma solidity ^0.8.0;

import "../../interfaces/IERC2981.sol";
import "../../utils/introspection/ERC165.sol";

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

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

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

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

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

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

        return (royalty.receiver, royaltyAmount);
    }

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

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

        _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
    }

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

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

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

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

// SPDX-License-Identifier: MIT
/**
   _____       ___     ___ __           ____  _ __      
  / ___/____  / (_)___/ (_) /___  __   / __ )(_) /______
  \__ \/ __ \/ / / __  / / __/ / / /  / __  / / __/ ___/
 ___/ / /_/ / / / /_/ / / /_/ /_/ /  / /_/ / / /_(__  ) 
/____/\____/_/_/\__,_/_/\__/\__, /  /_____/_/\__/____/  
                           /____/                        

- npm: https://www.npmjs.com/package/solidity-bits
- github: https://github.com/estarriolvetch/solidity-bits

 */
pragma solidity ^0.8.0;

import "./BitScan.sol";

/**
 * @dev This Library is a modified version of Openzeppelin's BitMaps library.
 * Functions of finding the index of the closest set bit from a given index are added.
 * The indexing of each bucket is modifed to count from the MSB to the LSB instead of from the LSB to the MSB.
 * The modification of indexing makes finding the closest previous set bit more efficient in gas usage.
*/

/**
 * @dev Library for managing uint256 to bool mapping in a compact and efficient way, providing the keys are sequential.
 * Largelly inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor].
 */

library BitMaps {
    using BitScan for uint256;
    uint256 private constant MASK_INDEX_ZERO = (1 << 255);
    uint256 private constant MASK_FULL = type(uint256).max;

    struct BitMap {
        mapping(uint256 => uint256) _data;
    }

    /**
     * @dev Returns whether the bit at `index` is set.
     */
    function get(BitMap storage bitmap, uint256 index) internal view returns (bool) {
        uint256 bucket = index >> 8;
        uint256 mask = MASK_INDEX_ZERO >> (index & 0xff);
        return bitmap._data[bucket] & mask != 0;
    }

    /**
     * @dev Sets the bit at `index` to the boolean `value`.
     */
    function setTo(
        BitMap storage bitmap,
        uint256 index,
        bool value
    ) internal {
        if (value) {
            set(bitmap, index);
        } else {
            unset(bitmap, index);
        }
    }

    /**
     * @dev Sets the bit at `index`.
     */
    function set(BitMap storage bitmap, uint256 index) internal {
        uint256 bucket = index >> 8;
        uint256 mask = MASK_INDEX_ZERO >> (index & 0xff);
        bitmap._data[bucket] |= mask;
    }

    /**
     * @dev Unsets the bit at `index`.
     */
    function unset(BitMap storage bitmap, uint256 index) internal {
        uint256 bucket = index >> 8;
        uint256 mask = MASK_INDEX_ZERO >> (index & 0xff);
        bitmap._data[bucket] &= ~mask;
    }


    /**
     * @dev Consecutively sets `amount` of bits starting from the bit at `startIndex`.
     */    
    function setBatch(BitMap storage bitmap, uint256 startIndex, uint256 amount) internal {
        uint256 bucket = startIndex >> 8;

        uint256 bucketStartIndex = (startIndex & 0xff);

        unchecked {
            if(bucketStartIndex + amount < 256) {
                bitmap._data[bucket] |= MASK_FULL << (256 - amount) >> bucketStartIndex;
            } else {
                bitmap._data[bucket] |= MASK_FULL >> bucketStartIndex;
                amount -= (256 - bucketStartIndex);
                bucket++;

                while(amount > 256) {
                    bitmap._data[bucket] = MASK_FULL;
                    amount -= 256;
                    bucket++;
                }

                bitmap._data[bucket] |= MASK_FULL << (256 - amount);
            }
        }
    }


    /**
     * @dev Consecutively unsets `amount` of bits starting from the bit at `startIndex`.
     */    
    function unsetBatch(BitMap storage bitmap, uint256 startIndex, uint256 amount) internal {
        uint256 bucket = startIndex >> 8;

        uint256 bucketStartIndex = (startIndex & 0xff);

        unchecked {
            if(bucketStartIndex + amount < 256) {
                bitmap._data[bucket] &= ~(MASK_FULL << (256 - amount) >> bucketStartIndex);
            } else {
                bitmap._data[bucket] &= ~(MASK_FULL >> bucketStartIndex);
                amount -= (256 - bucketStartIndex);
                bucket++;

                while(amount > 256) {
                    bitmap._data[bucket] = 0;
                    amount -= 256;
                    bucket++;
                }

                bitmap._data[bucket] &= ~(MASK_FULL << (256 - amount));
            }
        }
    }


    /**
     * @dev Find the closest index of the set bit before `index`.
     */
    function scanForward(BitMap storage bitmap, uint256 index) internal view returns (uint256 setBitIndex) {
        uint256 bucket = index >> 8;

        // index within the bucket
        uint256 bucketIndex = (index & 0xff);

        // load a bitboard from the bitmap.
        uint256 bb = bitmap._data[bucket];

        // offset the bitboard to scan from `bucketIndex`.
        bb = bb >> (0xff ^ bucketIndex); // bb >> (255 - bucketIndex)
        
        if(bb > 0) {
            unchecked {
                setBitIndex = (bucket << 8) | (bucketIndex -  bb.bitScanForward256());    
            }
        } else {
            while(true) {
                require(bucket > 0, "BitMaps: The set bit before the index doesn't exist.");
                unchecked {
                    bucket--;
                }
                // No offset. Always scan from the least significiant bit now.
                bb = bitmap._data[bucket];
                
                if(bb > 0) {
                    unchecked {
                        setBitIndex = (bucket << 8) | (255 -  bb.bitScanForward256());
                        break;
                    }
                } 
            }
        }
    }

    function getBucket(BitMap storage bitmap, uint256 bucket) internal view returns (uint256) {
        return bitmap._data[bucket];
    }
}

// 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 (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

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

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // 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);
    }

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: 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 Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

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

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

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

pragma solidity ^0.8.0;

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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
                /// @solidity memory-safe-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/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 (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
/**
   _____       ___     ___ __           ____  _ __      
  / ___/____  / (_)___/ (_) /___  __   / __ )(_) /______
  \__ \/ __ \/ / / __  / / __/ / / /  / __  / / __/ ___/
 ___/ / /_/ / / / /_/ / / /_/ /_/ /  / /_/ / / /_(__  ) 
/____/\____/_/_/\__,_/_/\__/\__, /  /_____/_/\__/____/  
                           /____/                        

- npm: https://www.npmjs.com/package/solidity-bits
- github: https://github.com/estarriolvetch/solidity-bits

 */

pragma solidity ^0.8.0;


library BitScan {
    uint256 constant private DEBRUIJN_256 = 0x818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff;
    bytes constant private LOOKUP_TABLE_256 = hex"0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8";

    /**
        @dev Isolate the least significant set bit.
     */ 
    function isolateLS1B256(uint256 bb) pure internal returns (uint256) {
        require(bb > 0);
        unchecked {
            return bb & (0 - bb);
        }
    } 

    /**
        @dev Isolate the most significant set bit.
     */ 
    function isolateMS1B256(uint256 bb) pure internal returns (uint256) {
        require(bb > 0);
        unchecked {
            bb |= bb >> 128;
            bb |= bb >> 64;
            bb |= bb >> 32;
            bb |= bb >> 16;
            bb |= bb >> 8;
            bb |= bb >> 4;
            bb |= bb >> 2;
            bb |= bb >> 1;
            
            return (bb >> 1) + 1;
        }
    } 

    /**
        @dev Find the index of the lest significant set bit. (trailing zero count)
     */ 
    function bitScanForward256(uint256 bb) pure internal returns (uint8) {
        unchecked {
            return uint8(LOOKUP_TABLE_256[(isolateLS1B256(bb) * DEBRUIJN_256) >> 248]);
        }   
    }

    /**
        @dev Find the index of the most significant set bit.
     */ 
    function bitScanReverse256(uint256 bb) pure internal returns (uint8) {
        unchecked {
            return 255 - uint8(LOOKUP_TABLE_256[((isolateMS1B256(bb) * DEBRUIJN_256) >> 248)]);
        }   
    }

    function log2(uint256 bb) pure internal returns (uint8) {
        unchecked {
            return uint8(LOOKUP_TABLE_256[(isolateMS1B256(bb) * DEBRUIJN_256) >> 248]);
        } 
    }
}

// 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.6.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

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

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

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"uint96","name":"_royaltyFee","type":"uint96"},{"internalType":"string","name":"_baseURI","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ExceedAmount","type":"error"},{"inputs":[],"name":"InvalidInput","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"InvalidTime","type":"error"},{"inputs":[],"name":"InvalidToken","type":"error"},{"inputs":[],"name":"NotEnoughQuota","type":"error"},{"inputs":[],"name":"TokenNotExist","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_address","type":"address"},{"indexed":false,"internalType":"string","name":"_type","type":"string"}],"name":"AddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_baseURI","type":"string"}],"name":"BaseURISet","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":"MintGalaxyFrens","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"_type","type":"string"}],"name":"NumberSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_endTime","type":"uint256"},{"indexed":false,"internalType":"string","name":"_type","type":"string"}],"name":"PhaseSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_change","type":"address"},{"indexed":false,"internalType":"bool","name":"_status","type":"bool"}],"name":"StatusChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"_status","type":"bool"}],"name":"TokenStatusChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"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":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dreamingInitTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"dreamingStarted","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":"uint256","name":"_tokenId","type":"uint256"}],"name":"getDreamingPeriod","outputs":[{"internalType":"uint256","name":"_dreamingTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"getDreamingPeriodByOwner","outputs":[{"internalType":"uint256[]","name":"_dreamingTimeList","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getTokenValidStatus","outputs":[{"internalType":"bool","name":"_status","type":"bool"}],"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":"","type":"address"}],"name":"isAuthorized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxGalaxyFrensAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxGalaxyFrensPerTx","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxRPFHoldersReserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxWhitelistReserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_quantity","type":"uint256"}],"name":"mintGiveawayFrens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_quantity","type":"uint256"}],"name":"mintPublicFrens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"uint256","name":"_maxQuantity","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"mintRPFHoldersFrens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"uint256","name":"_maxQuantity","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"mintWhitelistFrens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mission","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicMintEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicMintStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rpfHolderMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rpfHoldersMintEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rpfHoldersMintStartTime","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":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_authorizer","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"setAuthorizer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint96","name":"_feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_initTime","type":"uint256"}],"name":"setDreamingInitTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_mission","type":"address"}],"name":"setMission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_endTime","type":"uint256"}],"name":"setPublicMintPhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_endTime","type":"uint256"}],"name":"setRPFHoldersMintPhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"setSignerGF","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"setSignerRPF","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"setTokenInvalid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint96","name":"_feeNumerator","type":"uint96"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"setTokenValid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_endTime","type":"uint256"}],"name":"setWhitelistMintPhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signerGF","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"signerRPF","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"tokenId","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":"tokenId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"_tokenURI","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"_tokenIds","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":[{"internalType":"uint256","name":"_maxMintableQuantity","type":"uint256"},{"internalType":"address","name":"_signer","type":"address"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"verify","outputs":[{"internalType":"bool","name":"_whitelisted","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistMintEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistMintStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b50604051620043833803806200438383398101604081905262000034916200035b565b604080518082018252600b81526a47616c6178794672656e7360a81b6020808301919091528251808401909352600283526123a360f11b9083015260016010559062000080336200015e565b815162000095906013906020850190620002b5565b508051620000ab906014906020840190620002b5565b5050600680546001600160a01b031916733d34f69aed7e3bb13754a05ed1d95a25968c0c7317905550620000e76011546001600160a01b031690565b600780546001600160a01b0319166001600160a01b03928316179055601154166000908152600360205260409020805460ff19166001179055620001407319c74defdebb12d37ab667da4adee3e5d73c82db83620001b0565b805162000155906008906020840190620002b5565b505050620004a7565b601180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6127106001600160601b0382161115620002245760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b0382166200027c5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c69642072656365697665720000000000000060448201526064016200021b565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217601955565b828054620002c39062000454565b90600052602060002090601f016020900481019282620002e7576000855562000332565b82601f106200030257805160ff191683800117855562000332565b8280016001018555821562000332579182015b828111156200033257825182559160200191906001019062000315565b506200034092915062000344565b5090565b5b8082111562000340576000815560010162000345565b600080604083850312156200036e578182fd5b82516001600160601b038116811462000385578283fd5b602084810151919350906001600160401b0380821115620003a4578384fd5b818601915086601f830112620003b8578384fd5b815181811115620003cd57620003cd62000491565b604051601f8201601f19908116603f01168101908382118183101715620003f857620003f862000491565b81604052828152898684870101111562000410578687fd5b8693505b8284101562000433578484018601518185018701529285019262000414565b828411156200044457868684830101525b8096505050505050509250929050565b600181811c908216806200046957607f821691505b602082108114156200048b57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b613ecc80620004b76000396000f3fe608060405234801561001057600080fd5b50600436106103af5760003560e01c8063672d8326116101f4578063b61ed4bf1161011a578063d3cf00a3116100ad578063ed3425011161007c578063ed34250114610809578063f2fde38b1461081c578063f4262f5e1461082f578063fe9fbb801461084257600080fd5b8063d3cf00a31461079e578063df35c958146107a7578063e1932054146107ba578063e985e9c5146107cd57600080fd5b8063c605d1ca116100e9578063c605d1ca14610752578063c839fe9414610765578063c87b56dd14610778578063d1fa5dc21461078b57600080fd5b8063b61ed4bf14610710578063b7b9f7d514610723578063b88d4fde14610736578063bc0063fd1461074957600080fd5b80637b44053c1161019257806398a8cffe1161016157806398a8cffe146106c15780639ac21297146106e1578063a22cb465146106f4578063b0ec62a51461070757600080fd5b80637b44053c146106965780638da5cb5b1461069f57806395d89b41146106b057806398420acb146106b857600080fd5b80636ce232d4116101ce5780636ce232d41461065f57806370a0823114610668578063715018a61461067b578063733f38b11461068357600080fd5b8063672d8326146106315780636958b539146106445780636c0360eb1461065757600080fd5b80633ef58097116102d957806354be0a7d1161027757806359e67f8e1161024657806359e67f8e146105e25780635ae805ef146105f55780636352211e146105fe57806364e65ce01461061157600080fd5b806354be0a7d146105ab57806355f804b3146105b457806358f41ff8146105c75780635944c753146105cf57600080fd5b80634db42f76116102b35780634db42f761461055c5780634f6ccce71461056f578063524ce3db14610582578063549a6ed01461058b57600080fd5b80633ef580971461052357806342842e0e14610536578063477f1d571461054957600080fd5b806318160ddd116103515780632a55205a116103205780632a55205a146104c25780632bb1a91a146104f45780632f745c59146104fd5780633345e3ae1461051057600080fd5b806318160ddd1461047757806323b872dd1461048957806324cf5a091461049c578063275ec991146104af57600080fd5b8063081812fc1161038d578063081812fc14610406578063095ea7b3146104315780630a05c52f1461044457806317701ee61461046457600080fd5b806301ffc9a7146103b457806304634d8d146103dc57806306fdde03146103f1575b600080fd5b6103c76103c2366004613939565b610865565b60405190151581526020015b60405180910390f35b6103ef6103ea366004613910565b610876565b005b6103f961088c565b6040516103d39190613c21565b6104196104143660046139b7565b61091e565b6040516001600160a01b0390911681526020016103d3565b6103ef61043f3660046138b5565b6109be565b61045761045236600461377b565b610aef565b6040516103d39190613bdd565b600554610419906001600160a01b031681565b6016545b6040519081526020016103d3565b6103ef6104973660046137c7565b610bd8565b6103ef6104aa3660046138b5565b610c5f565b6103ef6104bd3660046139b7565b610c98565b6104d56104d0366004613a62565b610cff565b604080516001600160a01b0390931683526020830191909152016103d3565b61047b600b5481565b61047b61050b3660046138b5565b610dde565b6103ef61051e3660046139b7565b610ec2565b6103ef61053136600461377b565b610f71565b6103ef6105443660046137c7565b611051565b6103ef6105573660046139b7565b61106c565b6103ef61056a366004613a83565b6110cd565b61047b61057d3660046139b7565b611219565b61047b60095481565b61047b6105993660046139b7565b60026020526000908152604090205481565b61047b600e5481565b6103ef6105c2366004613971565b6112ec565b61047b600a81565b6103ef6105dd366004613a27565b611337565b6103ef6105f036600461377b565b61134a565b61047b600f5481565b61041961060c3660046139b7565b611422565b61047b61061f36600461377b565b60006020819052908152604090205481565b6103ef61063f36600461387b565b61142e565b6103c76106523660046139b7565b611492565b6103f96114b8565b61047b600a5481565b61047b61067636600461377b565b611546565b6103ef611627565b600754610419906001600160a01b031681565b61047b61038481565b6011546001600160a01b0316610419565b6103f961163b565b61047b600c5481565b61047b6106cf36600461377b565b60016020526000908152604090205481565b6103ef6106ef366004613a83565b61164a565b6103ef61070236600461387b565b611786565b61047b6107d081565b6103ef61071e366004613a62565b61184b565b6103c76107313660046139cf565b611937565b6103ef610744366004613802565b611a42565b61047b61070881565b6103ef610760366004613a62565b611aca565b6104576107733660046138de565b611baf565b6103f96107863660046139b7565b611caf565b6103ef6107993660046139b7565b611d24565b61047b600d5481565b600654610419906001600160a01b031681565b6103ef6107c836600461377b565b611d98565b6103c76107db366004613795565b6001600160a01b03918216600090815260186020908152604080832093909416825291909152205460ff1690565b6103ef610817366004613a62565b611e70565b6103ef61082a36600461377b565b611f55565b61047b61083d3660046139b7565b611fe2565b6103c761085036600461377b565b60036020526000908152604090205460ff1681565b600061087082612041565b92915050565b61087e612097565b61088882826120f1565b5050565b60606013805461089b90613cc2565b80601f01602080910402602001604051908101604052809291908181526020018280546108c790613cc2565b80156109145780601f106108e957610100808354040283529160200191610914565b820191906000526020600020905b8154815290600101906020018083116108f757829003601f168201915b5050505050905090565b600061092b826016541190565b6109a25760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a20617070726f76656420717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e000000000000000000000000000000000060648201526084015b60405180910390fd5b506000908152601760205260409020546001600160a01b031690565b60006109c982611422565b9050806001600160a01b0316836001600160a01b03161415610a525760405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a20617070726f76616c20746f2063757272656e74206f60448201527f776e6572000000000000000000000000000000000000000000000000000000006064820152608401610999565b336001600160a01b0382161480610a6e5750610a6e81336107db565b610ae05760405162461bcd60e51b815260206004820152603b60248201527f4552433732315073693a20617070726f76652063616c6c6572206973206e6f7460448201527f206f776e6572206e6f7220617070726f76656420666f7220616c6c00000000006064820152608401610999565b610aea838361221c565b505050565b60606000610afc83611546565b905080610b1d5760408051600080825260208201909252905b509392505050565b60008167ffffffffffffffff811115610b4657634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610b6f578160200160208202803683370190505b50905060005b82811015610b15576000610b898683610dde565b9050610b9481611fe2565b838381518110610bb457634e487b7160e01b600052603260045260246000fd5b60209081029190910101525080610bca81613cf7565b915050610b75565b50919050565b610be23382612297565b610c545760405162461bcd60e51b815260206004820152603460248201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f60448201527f74206f776e6572206e6f7220617070726f7665640000000000000000000000006064820152608401610999565b610aea838383612394565b3360009081526003602052604090205460ff16610c8e576040516282b42960e81b815260040160405180910390fd5b61088882826125fd565b610ca0612097565b600881901c60009081526004602052604090208054600160ff1b60ff84161c17905560408051828152600160208201527f5b6d33cc3c5c329781765731c245897be60ac3cc87b4a50ed07a697674c1bda791015b60405180910390a150565b6000828152601a602090815260408083208151808301909252546001600160a01b038116808352740100000000000000000000000000000000000000009091046bffffffffffffffffffffffff16928201929092528291610da05750604080518082019091526019546001600160a01b03811682527401000000000000000000000000000000000000000090046bffffffffffffffffffffffff1660208201525b602081015160009061271090610dc4906bffffffffffffffffffffffff1687613c60565b610dce9190613c4c565b91519350909150505b9250929050565b60008060005b601654811015610e5457610df9816016541190565b8015610e1e5750610e0981611422565b6001600160a01b0316856001600160a01b0316145b15610e425783821415610e345791506108709050565b81610e3e81613cf7565b9250505b80610e4c81613cf7565b915050610de4565b5060405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a206f776e657220696e646578206f7574206f6620626f60448201527f756e6473000000000000000000000000000000000000000000000000000000006064820152608401610999565b600d5442111580610ed55750600e544210155b15610f0c576040517f6f7eac2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600a811115610f2e57604051633a746c6960e21b815260040160405180910390fd5b61070881610f3b60165490565b610f459190613c34565b1115610f6457604051633a746c6960e21b815260040160405180910390fd5b610f6e33826125fd565b50565b610f79612097565b806001600160a01b038116610fba576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03841690811790915560408051918252602082018190526006908201527f5369676e4746000000000000000000000000000000000000000000000000000060608201527fff0500fd0200c9944150c5641906ff120bef6d95d50bafaca62702874ef5a3d5906080015b60405180910390a15050565b610aea83838360405180602001604052806000815250611a42565b611074612097565b600881901c60009081526004602052604090208054600160ff1b60ff84161c1916905560408051828152600060208201527f5b6d33cc3c5c329781765731c245897be60ac3cc87b4a50ed07a697674c1bda79101610cf4565b600b54421115806110e05750600c544210155b15611117576040517f6f7eac2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107088461112460165490565b61112e9190613c34565b111561114d57604051633a746c6960e21b815260040160405180910390fd5b6007546111669084906001600160a01b03168484611937565b61119c576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260016020526040812080548692906111bb908490613c34565b909155505033600090815260016020526040902054831015611209576040517f4f8fd3a500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61121333856125fd565b50505050565b600061122460165490565b82106112985760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a20676c6f62616c20696e646578206f7574206f66206260448201527f6f756e64730000000000000000000000000000000000000000000000000000006064820152608401610999565b6000805b6016548110156112e5576112b1816016541190565b156112d357838214156112c5579392505050565b816112cf81613cf7565b9250505b806112dd81613cf7565b91505061129c565b5050919050565b6112f4612097565b80516113079060089060208401906135f9565b507ff9c7803e94e0d3c02900d8a90893a6d5e90dd04d32a4cfe825520f82bf9f32f681604051610cf49190613c21565b61133f612097565b610aea8383836126f2565b611352612097565b806001600160a01b038116611393576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6005805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03841690811790915560408051918252602082018190526007908201527f4d697373696f6e0000000000000000000000000000000000000000000000000060608201527fff0500fd0200c9944150c5641906ff120bef6d95d50bafaca62702874ef5a3d590608001611045565b600080610b158361282e565b611436612097565b6001600160a01b038216600081815260036020908152604091829020805460ff19168515159081179091558251938452908301527fcd9cacdcc38c70cf8e604dd83e8b981d6c10784f09f1937d55bff39c5441092a9101611045565b600881901c600090815260046020526040812054600160ff1b60ff84161c161515610870565b600880546114c590613cc2565b80601f01602080910402602001604051908101604052809291908181526020018280546114f190613cc2565b801561153e5780601f106115135761010080835404028352916020019161153e565b820191906000526020600020905b81548152906001019060200180831161152157829003601f168201915b505050505081565b60006001600160a01b0382166115c45760405162461bcd60e51b815260206004820152602d60248201527f4552433732315073693a2062616c616e636520717565727920666f722074686560448201527f207a65726f2061646472657373000000000000000000000000000000000000006064820152608401610999565b6000805b601654811015611620576115dd816016541190565b15611610576115eb81611422565b6001600160a01b0316846001600160a01b031614156116105761160d82613cf7565b91505b61161981613cf7565b90506115c8565b5092915050565b61162f612097565b61163960006128d8565b565b60606014805461089b90613cc2565b6009544211158061165d5750600a544210155b15611694576040517f6f7eac2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610384846116a160165490565b6116ab9190613c34565b11156116ca57604051633a746c6960e21b815260040160405180910390fd5b6006546116e39084906001600160a01b03168484611937565b611719576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360009081526020819052604081208054869290611738908490613c34565b909155505033600090815260208190526040902054831015611209576040517f4f8fd3a500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0382163314156117df5760405162461bcd60e51b815260206004820152601c60248201527f4552433732315073693a20617070726f766520746f2063616c6c6572000000006044820152606401610999565b3360008181526018602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b3360009081526003602052604090205460ff1661187a576040516282b42960e81b815260040160405180910390fd5b8181808211156118b6576040517fb4fa3fb300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6009849055600a83815560408051868152602081018690526060918101829052908101919091527f525046486f6c646572730000000000000000000000000000000000000000000060808201527f4a09b8d9133b26914e8d8acf9ab35456f919c6513ded3d7fce2c88c4eb8bd0e99060a0015b60405180910390a150505050565b6040517fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003360601b1660208201526034810185905260009081906119e190605401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b9050611a238185858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061293792505050565b6001600160a01b0316856001600160a01b031614915050949350505050565b611a4c3383612297565b611abe5760405162461bcd60e51b815260206004820152603460248201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f60448201527f74206f776e6572206e6f7220617070726f7665640000000000000000000000006064820152608401610999565b61121384848484612953565b3360009081526003602052604090205460ff16611af9576040516282b42960e81b815260040160405180910390fd5b818180821115611b35576040517fb4fa3fb300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600d849055600e8390556040517f4a09b8d9133b26914e8d8acf9ab35456f919c6513ded3d7fce2c88c4eb8bd0e990611929908690869091825260208201526060604082018190526006908201527f5075626c69630000000000000000000000000000000000000000000000000000608082015260a00190565b60606000611bbc85611546565b905080611bd9575050604080516000815260208101909152611ca8565b6000611be58585613c7f565b611bf0906001613c34565b905060008167ffffffffffffffff811115611c1b57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611c44578160200160208202803683370190505b50905060005b82811015611c9d57611c608861050b8984613c34565b828281518110611c8057634e487b7160e01b600052603260045260246000fd5b602090810291909101015280611c9581613cf7565b915050611c4a565b509250611ca8915050565b9392505050565b6060611cbc826016541190565b611cf2576040517f4494362200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6008611cfd836129de565b604051602001611d0e929190613b04565b6040516020818303038152906040529050919050565b611d2c612097565b600f8190556040517fe5d2289ff8acc724c3994077a7dffa36cd7cac0891c44888115e811179293e7e90610cf4908381526040602082018190526005908201527f447265616d000000000000000000000000000000000000000000000000000000606082015260800190565b611da0612097565b806001600160a01b038116611de1576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03841690811790915560408051918252602082018190526007908201527f5369676e5250460000000000000000000000000000000000000000000000000060608201527fff0500fd0200c9944150c5641906ff120bef6d95d50bafaca62702874ef5a3d590608001611045565b3360009081526003602052604090205460ff16611e9f576040516282b42960e81b815260040160405180910390fd5b818180821115611edb576040517fb4fa3fb300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600b849055600c8390556040517f4a09b8d9133b26914e8d8acf9ab35456f919c6513ded3d7fce2c88c4eb8bd0e990611929908690869091825260208201526060604082018190526009908201527f57686974656c6973740000000000000000000000000000000000000000000000608082015260a00190565b611f5d612097565b6001600160a01b038116611fd95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610999565b610f6e816128d8565b6000600f5460001480611ff6575042600f54115b1561200357506000919050565b60008281526002602052604090205461202357600f546108709042613c7f565b6000828152600260205260409020546108709042613c7f565b919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f2a55205a000000000000000000000000000000000000000000000000000000001480610870575061087082612b2c565b6011546001600160a01b031633146116395760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610999565b6127106bffffffffffffffffffffffff821611156121775760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152608401610999565b6001600160a01b0382166121cd5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610999565b604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff90911660209092018290527401000000000000000000000000000000000000000090910217601955565b6000818152601760205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038416908117909155819061225e82611422565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006122a4826016541190565b6123165760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a206f70657261746f7220717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610999565b600061232183611422565b9050806001600160a01b0316846001600160a01b0316148061235c5750836001600160a01b03166123518461091e565b6001600160a01b0316145b8061238c57506001600160a01b0380821660009081526018602090815260408083209388168352929052205460ff165b949350505050565b6000806123a08361282e565b91509150846001600160a01b0316826001600160a01b03161461242b5760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a207472616e73666572206f6620746f6b656e2074686160448201527f74206973206e6f74206f776e00000000000000000000000000000000000000006064820152608401610999565b6001600160a01b0384166124a75760405162461bcd60e51b815260206004820152602760248201527f4552433732315073693a207472616e7366657220746f20746865207a65726f2060448201527f61646472657373000000000000000000000000000000000000000000000000006064820152608401610999565b6124b48585856001612c5b565b6124bf60008461221c565b60006124cc846001613c34565b600881901c600090815260126020526040902054909150600160ff1b60ff83161c161580156124fc575060165481105b15612556576000818152601560209081526040808320805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038b16179055600884901c8352601290915290208054600160ff1b60ff84161c1790555b6000848152601560205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387161790558184146125b457600884901c60009081526012602052604090208054600160ff1b60ff87161c1790555b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b600260105414156126505760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610999565b60026010556107d08161266260165490565b61266c9190613c34565b111561268b57604051633a746c6960e21b815260040160405180910390fd5b6126958282612d15565b7f2f74160e2feb4e95a7f8c8a07b09d745ef677c5a07cb82b0a3936c765587bb1682826126c160165490565b604080516001600160a01b03909416845260208401929092529082015260600160405180910390a150506001601055565b6127106bffffffffffffffffffffffff821611156127785760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152608401610999565b6001600160a01b0382166127ce5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606401610999565b6040805180820182526001600160a01b0393841681526bffffffffffffffffffffffff92831660208083019182526000968752601a9052919094209351905190911674010000000000000000000000000000000000000000029116179055565b60008061283c836016541190565b6128ae5760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e00000000000000000000000000000000000000006064820152608401610999565b6128b783612d2f565b6000818152601560205260409020546001600160a01b031694909350915050565b601180546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008060006129468585612d3c565b91509150610b1581612d7f565b61295e848484612394565b61296c848484600185612fb6565b6112135760405162461bcd60e51b815260206004820152603560248201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260448201527f31526563656976657220696d706c656d656e74657200000000000000000000006064820152608401610999565b606081612a1e57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115612a485780612a3281613cf7565b9150612a419050600a83613c4c565b9150612a22565b60008167ffffffffffffffff811115612a7157634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612a9b576020820181803683370190505b5090505b841561238c57612ab0600183613c7f565b9150612abd600a86613d12565b612ac8906030613c34565b60f81b818381518110612aeb57634e487b7160e01b600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612b25600a86613c4c565b9450612a9f565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd000000000000000000000000000000000000000000000000000000001480612bbf57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80612c0b57507fffffffff0000000000000000000000000000000000000000000000000000000082167f780e9d6300000000000000000000000000000000000000000000000000000000145b8061087057507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610870565b6001600160a01b038416612c6e57611213565b815b612c7a8284613c34565b811015612d0e57600881901c600090815260046020526040902054600160ff1b60ff83161c1615612cd7576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6005546001600160a01b03858116911614612cfe5760008181526002602052604090204290555b612d0781613cf7565b9050612c70565b5050505050565b610888828260405180602001604052806000815250613199565b60006108706012836131b4565b600080825160411415612d735760208301516040840151606085015160001a612d67878285856132b5565b94509450505050610dd7565b50600090506002610dd7565b6000816004811115612da157634e487b7160e01b600052602160045260246000fd5b1415612daa5750565b6001816004811115612dcc57634e487b7160e01b600052602160045260246000fd5b1415612e1a5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610999565b6002816004811115612e3c57634e487b7160e01b600052602160045260246000fd5b1415612e8a5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610999565b6003816004811115612eac57634e487b7160e01b600052602160045260246000fd5b1415612f205760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610999565b6004816004811115612f4257634e487b7160e01b600052602160045260246000fd5b1415610f6e5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610999565b60006001600160a01b0385163b1561318c57506001835b612fd78486613c34565b811015613186576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0387169063150b7a02906130299033908b9086908990600401613ba1565b602060405180830381600087803b15801561304357600080fd5b505af1925050508015613073575060408051601f3d908101601f1916820190925261307091810190613955565b60015b613123573d8080156130a1576040519150601f19603f3d011682016040523d82523d6000602084013e6130a6565b606091505b50805161311b5760405162461bcd60e51b815260206004820152603560248201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260448201527f31526563656976657220696d706c656d656e74657200000000000000000000006064820152608401610999565b805181602001fd5b82801561317157507fffffffff0000000000000000000000000000000000000000000000000000000081167f150b7a0200000000000000000000000000000000000000000000000000000000145b9250508061317e81613cf7565b915050612fcd565b50613190565b5060015b95945050505050565b6016546131a684846133a2565b61296c600085838686612fb6565b600881901c60008181526020849052604081205490919060ff808516919082181c80156131f6576131e481613569565b60ff168203600884901b1793506132ac565b6000831161326c5760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527f696e64657820646f65736e27742065786973742e0000000000000000000000006064820152608401610999565b5060001990910160008181526020869052604090205490919080156132a75761329481613569565b60ff0360ff16600884901b1793506132ac565b6131f6565b50505092915050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156132ec5750600090506003613399565b8460ff16601b1415801561330457508460ff16601c14155b156133155750600090506004613399565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613369573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661339257600060019250925050613399565b9150600090505b94509492505050565b601654816134185760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d757374206265206772656160448201527f74657220300000000000000000000000000000000000000000000000000000006064820152608401610999565b6001600160a01b0383166134945760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610999565b6134a16000848385612c5b565b81601660008282546134b39190613c34565b90915550506000818152601560209081526040808320805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038816179055600884901c8352601290915290208054600160ff1b60ff84161c179055805b6135188383613c34565b8110156112135760405181906001600160a01b038616906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a48061356181613cf7565b91505061350e565b60006040518061012001604052806101008152602001613d97610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff6135b2856135e1565b02901c815181106135d357634e487b7160e01b600052603260045260246000fd5b016020015160f81c92915050565b60008082116135ef57600080fd5b5060008190031690565b82805461360590613cc2565b90600052602060002090601f016020900481019282613627576000855561366d565b82601f1061364057805160ff191683800117855561366d565b8280016001018555821561366d579182015b8281111561366d578251825591602001919060010190613652565b5061367992915061367d565b5090565b5b80821115613679576000815560010161367e565b600067ffffffffffffffff808411156136ad576136ad613d52565b604051601f8501601f19908116603f011681019082821181831017156136d5576136d5613d52565b816040528093508581528686860111156136ee57600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b038116811461203c57600080fd5b60008083601f840112613730578182fd5b50813567ffffffffffffffff811115613747578182fd5b602083019150836020828501011115610dd757600080fd5b80356bffffffffffffffffffffffff8116811461203c57600080fd5b60006020828403121561378c578081fd5b611ca882613708565b600080604083850312156137a7578081fd5b6137b083613708565b91506137be60208401613708565b90509250929050565b6000806000606084860312156137db578081fd5b6137e484613708565b92506137f260208501613708565b9150604084013590509250925092565b60008060008060808587031215613817578081fd5b61382085613708565b935061382e60208601613708565b925060408501359150606085013567ffffffffffffffff811115613850578182fd5b8501601f81018713613860578182fd5b61386f87823560208401613692565b91505092959194509250565b6000806040838503121561388d578182fd5b61389683613708565b9150602083013580151581146138aa578182fd5b809150509250929050565b600080604083850312156138c7578182fd5b6138d083613708565b946020939093013593505050565b6000806000606084860312156138f2578283fd5b6138fb84613708565b95602085013595506040909401359392505050565b60008060408385031215613922578182fd5b61392b83613708565b91506137be6020840161375f565b60006020828403121561394a578081fd5b8135611ca881613d68565b600060208284031215613966578081fd5b8151611ca881613d68565b600060208284031215613982578081fd5b813567ffffffffffffffff811115613998578182fd5b8201601f810184136139a8578182fd5b61238c84823560208401613692565b6000602082840312156139c8578081fd5b5035919050565b600080600080606085870312156139e4578182fd5b843593506139f460208601613708565b9250604085013567ffffffffffffffff811115613a0f578283fd5b613a1b8782880161371f565b95989497509550505050565b600080600060608486031215613a3b578081fd5b83359250613a4b60208501613708565b9150613a596040850161375f565b90509250925092565b60008060408385031215613a74578182fd5b50508035926020909101359150565b60008060008060608587031215613a98578182fd5b8435935060208501359250604085013567ffffffffffffffff811115613a0f578283fd5b60008151808452613ad4816020860160208601613c96565b601f01601f19169290920160200192915050565b60008151613afa818560208601613c96565b9290920192915050565b600080845482600182811c915080831680613b2057607f831692505b6020808410821415613b4057634e487b7160e01b87526022600452602487fd5b818015613b545760018114613b6557613b91565b60ff19861689528489019650613b91565b60008b815260209020885b86811015613b895781548b820152908501908301613b70565b505084890196505b5050505050506131908185613ae8565b60006001600160a01b03808716835280861660208401525083604083015260806060830152613bd36080830184613abc565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015613c1557835183529284019291840191600101613bf9565b50909695505050505050565b602081526000611ca86020830184613abc565b60008219821115613c4757613c47613d26565b500190565b600082613c5b57613c5b613d3c565b500490565b6000816000190483118215151615613c7a57613c7a613d26565b500290565b600082821015613c9157613c91613d26565b500390565b60005b83811015613cb1578181015183820152602001613c99565b838111156112135750506000910152565b600181811c90821680613cd657607f821691505b60208210811415610bd257634e487b7160e01b600052602260045260246000fd5b6000600019821415613d0b57613d0b613d26565b5060010190565b600082613d2157613d21613d3c565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b7fffffffff0000000000000000000000000000000000000000000000000000000081168114610f6e57600080fdfe0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a26469706673582212203f00744a6f2f691f41141c3dc0b15db247d73ea3826a7167fe522d2772a7a14964736f6c63430008040033000000000000000000000000000000000000000000000000000000000000028a0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002568747470733a2f2f6170692e72616962626974686f6c652e78797a2f6d657461646174612f000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106103af5760003560e01c8063672d8326116101f4578063b61ed4bf1161011a578063d3cf00a3116100ad578063ed3425011161007c578063ed34250114610809578063f2fde38b1461081c578063f4262f5e1461082f578063fe9fbb801461084257600080fd5b8063d3cf00a31461079e578063df35c958146107a7578063e1932054146107ba578063e985e9c5146107cd57600080fd5b8063c605d1ca116100e9578063c605d1ca14610752578063c839fe9414610765578063c87b56dd14610778578063d1fa5dc21461078b57600080fd5b8063b61ed4bf14610710578063b7b9f7d514610723578063b88d4fde14610736578063bc0063fd1461074957600080fd5b80637b44053c1161019257806398a8cffe1161016157806398a8cffe146106c15780639ac21297146106e1578063a22cb465146106f4578063b0ec62a51461070757600080fd5b80637b44053c146106965780638da5cb5b1461069f57806395d89b41146106b057806398420acb146106b857600080fd5b80636ce232d4116101ce5780636ce232d41461065f57806370a0823114610668578063715018a61461067b578063733f38b11461068357600080fd5b8063672d8326146106315780636958b539146106445780636c0360eb1461065757600080fd5b80633ef58097116102d957806354be0a7d1161027757806359e67f8e1161024657806359e67f8e146105e25780635ae805ef146105f55780636352211e146105fe57806364e65ce01461061157600080fd5b806354be0a7d146105ab57806355f804b3146105b457806358f41ff8146105c75780635944c753146105cf57600080fd5b80634db42f76116102b35780634db42f761461055c5780634f6ccce71461056f578063524ce3db14610582578063549a6ed01461058b57600080fd5b80633ef580971461052357806342842e0e14610536578063477f1d571461054957600080fd5b806318160ddd116103515780632a55205a116103205780632a55205a146104c25780632bb1a91a146104f45780632f745c59146104fd5780633345e3ae1461051057600080fd5b806318160ddd1461047757806323b872dd1461048957806324cf5a091461049c578063275ec991146104af57600080fd5b8063081812fc1161038d578063081812fc14610406578063095ea7b3146104315780630a05c52f1461044457806317701ee61461046457600080fd5b806301ffc9a7146103b457806304634d8d146103dc57806306fdde03146103f1575b600080fd5b6103c76103c2366004613939565b610865565b60405190151581526020015b60405180910390f35b6103ef6103ea366004613910565b610876565b005b6103f961088c565b6040516103d39190613c21565b6104196104143660046139b7565b61091e565b6040516001600160a01b0390911681526020016103d3565b6103ef61043f3660046138b5565b6109be565b61045761045236600461377b565b610aef565b6040516103d39190613bdd565b600554610419906001600160a01b031681565b6016545b6040519081526020016103d3565b6103ef6104973660046137c7565b610bd8565b6103ef6104aa3660046138b5565b610c5f565b6103ef6104bd3660046139b7565b610c98565b6104d56104d0366004613a62565b610cff565b604080516001600160a01b0390931683526020830191909152016103d3565b61047b600b5481565b61047b61050b3660046138b5565b610dde565b6103ef61051e3660046139b7565b610ec2565b6103ef61053136600461377b565b610f71565b6103ef6105443660046137c7565b611051565b6103ef6105573660046139b7565b61106c565b6103ef61056a366004613a83565b6110cd565b61047b61057d3660046139b7565b611219565b61047b60095481565b61047b6105993660046139b7565b60026020526000908152604090205481565b61047b600e5481565b6103ef6105c2366004613971565b6112ec565b61047b600a81565b6103ef6105dd366004613a27565b611337565b6103ef6105f036600461377b565b61134a565b61047b600f5481565b61041961060c3660046139b7565b611422565b61047b61061f36600461377b565b60006020819052908152604090205481565b6103ef61063f36600461387b565b61142e565b6103c76106523660046139b7565b611492565b6103f96114b8565b61047b600a5481565b61047b61067636600461377b565b611546565b6103ef611627565b600754610419906001600160a01b031681565b61047b61038481565b6011546001600160a01b0316610419565b6103f961163b565b61047b600c5481565b61047b6106cf36600461377b565b60016020526000908152604090205481565b6103ef6106ef366004613a83565b61164a565b6103ef61070236600461387b565b611786565b61047b6107d081565b6103ef61071e366004613a62565b61184b565b6103c76107313660046139cf565b611937565b6103ef610744366004613802565b611a42565b61047b61070881565b6103ef610760366004613a62565b611aca565b6104576107733660046138de565b611baf565b6103f96107863660046139b7565b611caf565b6103ef6107993660046139b7565b611d24565b61047b600d5481565b600654610419906001600160a01b031681565b6103ef6107c836600461377b565b611d98565b6103c76107db366004613795565b6001600160a01b03918216600090815260186020908152604080832093909416825291909152205460ff1690565b6103ef610817366004613a62565b611e70565b6103ef61082a36600461377b565b611f55565b61047b61083d3660046139b7565b611fe2565b6103c761085036600461377b565b60036020526000908152604090205460ff1681565b600061087082612041565b92915050565b61087e612097565b61088882826120f1565b5050565b60606013805461089b90613cc2565b80601f01602080910402602001604051908101604052809291908181526020018280546108c790613cc2565b80156109145780601f106108e957610100808354040283529160200191610914565b820191906000526020600020905b8154815290600101906020018083116108f757829003601f168201915b5050505050905090565b600061092b826016541190565b6109a25760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a20617070726f76656420717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e000000000000000000000000000000000060648201526084015b60405180910390fd5b506000908152601760205260409020546001600160a01b031690565b60006109c982611422565b9050806001600160a01b0316836001600160a01b03161415610a525760405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a20617070726f76616c20746f2063757272656e74206f60448201527f776e6572000000000000000000000000000000000000000000000000000000006064820152608401610999565b336001600160a01b0382161480610a6e5750610a6e81336107db565b610ae05760405162461bcd60e51b815260206004820152603b60248201527f4552433732315073693a20617070726f76652063616c6c6572206973206e6f7460448201527f206f776e6572206e6f7220617070726f76656420666f7220616c6c00000000006064820152608401610999565b610aea838361221c565b505050565b60606000610afc83611546565b905080610b1d5760408051600080825260208201909252905b509392505050565b60008167ffffffffffffffff811115610b4657634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610b6f578160200160208202803683370190505b50905060005b82811015610b15576000610b898683610dde565b9050610b9481611fe2565b838381518110610bb457634e487b7160e01b600052603260045260246000fd5b60209081029190910101525080610bca81613cf7565b915050610b75565b50919050565b610be23382612297565b610c545760405162461bcd60e51b815260206004820152603460248201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f60448201527f74206f776e6572206e6f7220617070726f7665640000000000000000000000006064820152608401610999565b610aea838383612394565b3360009081526003602052604090205460ff16610c8e576040516282b42960e81b815260040160405180910390fd5b61088882826125fd565b610ca0612097565b600881901c60009081526004602052604090208054600160ff1b60ff84161c17905560408051828152600160208201527f5b6d33cc3c5c329781765731c245897be60ac3cc87b4a50ed07a697674c1bda791015b60405180910390a150565b6000828152601a602090815260408083208151808301909252546001600160a01b038116808352740100000000000000000000000000000000000000009091046bffffffffffffffffffffffff16928201929092528291610da05750604080518082019091526019546001600160a01b03811682527401000000000000000000000000000000000000000090046bffffffffffffffffffffffff1660208201525b602081015160009061271090610dc4906bffffffffffffffffffffffff1687613c60565b610dce9190613c4c565b91519350909150505b9250929050565b60008060005b601654811015610e5457610df9816016541190565b8015610e1e5750610e0981611422565b6001600160a01b0316856001600160a01b0316145b15610e425783821415610e345791506108709050565b81610e3e81613cf7565b9250505b80610e4c81613cf7565b915050610de4565b5060405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a206f776e657220696e646578206f7574206f6620626f60448201527f756e6473000000000000000000000000000000000000000000000000000000006064820152608401610999565b600d5442111580610ed55750600e544210155b15610f0c576040517f6f7eac2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600a811115610f2e57604051633a746c6960e21b815260040160405180910390fd5b61070881610f3b60165490565b610f459190613c34565b1115610f6457604051633a746c6960e21b815260040160405180910390fd5b610f6e33826125fd565b50565b610f79612097565b806001600160a01b038116610fba576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03841690811790915560408051918252602082018190526006908201527f5369676e4746000000000000000000000000000000000000000000000000000060608201527fff0500fd0200c9944150c5641906ff120bef6d95d50bafaca62702874ef5a3d5906080015b60405180910390a15050565b610aea83838360405180602001604052806000815250611a42565b611074612097565b600881901c60009081526004602052604090208054600160ff1b60ff84161c1916905560408051828152600060208201527f5b6d33cc3c5c329781765731c245897be60ac3cc87b4a50ed07a697674c1bda79101610cf4565b600b54421115806110e05750600c544210155b15611117576040517f6f7eac2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107088461112460165490565b61112e9190613c34565b111561114d57604051633a746c6960e21b815260040160405180910390fd5b6007546111669084906001600160a01b03168484611937565b61119c576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260016020526040812080548692906111bb908490613c34565b909155505033600090815260016020526040902054831015611209576040517f4f8fd3a500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61121333856125fd565b50505050565b600061122460165490565b82106112985760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a20676c6f62616c20696e646578206f7574206f66206260448201527f6f756e64730000000000000000000000000000000000000000000000000000006064820152608401610999565b6000805b6016548110156112e5576112b1816016541190565b156112d357838214156112c5579392505050565b816112cf81613cf7565b9250505b806112dd81613cf7565b91505061129c565b5050919050565b6112f4612097565b80516113079060089060208401906135f9565b507ff9c7803e94e0d3c02900d8a90893a6d5e90dd04d32a4cfe825520f82bf9f32f681604051610cf49190613c21565b61133f612097565b610aea8383836126f2565b611352612097565b806001600160a01b038116611393576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6005805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03841690811790915560408051918252602082018190526007908201527f4d697373696f6e0000000000000000000000000000000000000000000000000060608201527fff0500fd0200c9944150c5641906ff120bef6d95d50bafaca62702874ef5a3d590608001611045565b600080610b158361282e565b611436612097565b6001600160a01b038216600081815260036020908152604091829020805460ff19168515159081179091558251938452908301527fcd9cacdcc38c70cf8e604dd83e8b981d6c10784f09f1937d55bff39c5441092a9101611045565b600881901c600090815260046020526040812054600160ff1b60ff84161c161515610870565b600880546114c590613cc2565b80601f01602080910402602001604051908101604052809291908181526020018280546114f190613cc2565b801561153e5780601f106115135761010080835404028352916020019161153e565b820191906000526020600020905b81548152906001019060200180831161152157829003601f168201915b505050505081565b60006001600160a01b0382166115c45760405162461bcd60e51b815260206004820152602d60248201527f4552433732315073693a2062616c616e636520717565727920666f722074686560448201527f207a65726f2061646472657373000000000000000000000000000000000000006064820152608401610999565b6000805b601654811015611620576115dd816016541190565b15611610576115eb81611422565b6001600160a01b0316846001600160a01b031614156116105761160d82613cf7565b91505b61161981613cf7565b90506115c8565b5092915050565b61162f612097565b61163960006128d8565b565b60606014805461089b90613cc2565b6009544211158061165d5750600a544210155b15611694576040517f6f7eac2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610384846116a160165490565b6116ab9190613c34565b11156116ca57604051633a746c6960e21b815260040160405180910390fd5b6006546116e39084906001600160a01b03168484611937565b611719576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360009081526020819052604081208054869290611738908490613c34565b909155505033600090815260208190526040902054831015611209576040517f4f8fd3a500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0382163314156117df5760405162461bcd60e51b815260206004820152601c60248201527f4552433732315073693a20617070726f766520746f2063616c6c6572000000006044820152606401610999565b3360008181526018602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b3360009081526003602052604090205460ff1661187a576040516282b42960e81b815260040160405180910390fd5b8181808211156118b6576040517fb4fa3fb300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6009849055600a83815560408051868152602081018690526060918101829052908101919091527f525046486f6c646572730000000000000000000000000000000000000000000060808201527f4a09b8d9133b26914e8d8acf9ab35456f919c6513ded3d7fce2c88c4eb8bd0e99060a0015b60405180910390a150505050565b6040517fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003360601b1660208201526034810185905260009081906119e190605401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b9050611a238185858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061293792505050565b6001600160a01b0316856001600160a01b031614915050949350505050565b611a4c3383612297565b611abe5760405162461bcd60e51b815260206004820152603460248201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f60448201527f74206f776e6572206e6f7220617070726f7665640000000000000000000000006064820152608401610999565b61121384848484612953565b3360009081526003602052604090205460ff16611af9576040516282b42960e81b815260040160405180910390fd5b818180821115611b35576040517fb4fa3fb300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600d849055600e8390556040517f4a09b8d9133b26914e8d8acf9ab35456f919c6513ded3d7fce2c88c4eb8bd0e990611929908690869091825260208201526060604082018190526006908201527f5075626c69630000000000000000000000000000000000000000000000000000608082015260a00190565b60606000611bbc85611546565b905080611bd9575050604080516000815260208101909152611ca8565b6000611be58585613c7f565b611bf0906001613c34565b905060008167ffffffffffffffff811115611c1b57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611c44578160200160208202803683370190505b50905060005b82811015611c9d57611c608861050b8984613c34565b828281518110611c8057634e487b7160e01b600052603260045260246000fd5b602090810291909101015280611c9581613cf7565b915050611c4a565b509250611ca8915050565b9392505050565b6060611cbc826016541190565b611cf2576040517f4494362200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6008611cfd836129de565b604051602001611d0e929190613b04565b6040516020818303038152906040529050919050565b611d2c612097565b600f8190556040517fe5d2289ff8acc724c3994077a7dffa36cd7cac0891c44888115e811179293e7e90610cf4908381526040602082018190526005908201527f447265616d000000000000000000000000000000000000000000000000000000606082015260800190565b611da0612097565b806001600160a01b038116611de1576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03841690811790915560408051918252602082018190526007908201527f5369676e5250460000000000000000000000000000000000000000000000000060608201527fff0500fd0200c9944150c5641906ff120bef6d95d50bafaca62702874ef5a3d590608001611045565b3360009081526003602052604090205460ff16611e9f576040516282b42960e81b815260040160405180910390fd5b818180821115611edb576040517fb4fa3fb300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600b849055600c8390556040517f4a09b8d9133b26914e8d8acf9ab35456f919c6513ded3d7fce2c88c4eb8bd0e990611929908690869091825260208201526060604082018190526009908201527f57686974656c6973740000000000000000000000000000000000000000000000608082015260a00190565b611f5d612097565b6001600160a01b038116611fd95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610999565b610f6e816128d8565b6000600f5460001480611ff6575042600f54115b1561200357506000919050565b60008281526002602052604090205461202357600f546108709042613c7f565b6000828152600260205260409020546108709042613c7f565b919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f2a55205a000000000000000000000000000000000000000000000000000000001480610870575061087082612b2c565b6011546001600160a01b031633146116395760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610999565b6127106bffffffffffffffffffffffff821611156121775760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152608401610999565b6001600160a01b0382166121cd5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610999565b604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff90911660209092018290527401000000000000000000000000000000000000000090910217601955565b6000818152601760205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038416908117909155819061225e82611422565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006122a4826016541190565b6123165760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a206f70657261746f7220717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610999565b600061232183611422565b9050806001600160a01b0316846001600160a01b0316148061235c5750836001600160a01b03166123518461091e565b6001600160a01b0316145b8061238c57506001600160a01b0380821660009081526018602090815260408083209388168352929052205460ff165b949350505050565b6000806123a08361282e565b91509150846001600160a01b0316826001600160a01b03161461242b5760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a207472616e73666572206f6620746f6b656e2074686160448201527f74206973206e6f74206f776e00000000000000000000000000000000000000006064820152608401610999565b6001600160a01b0384166124a75760405162461bcd60e51b815260206004820152602760248201527f4552433732315073693a207472616e7366657220746f20746865207a65726f2060448201527f61646472657373000000000000000000000000000000000000000000000000006064820152608401610999565b6124b48585856001612c5b565b6124bf60008461221c565b60006124cc846001613c34565b600881901c600090815260126020526040902054909150600160ff1b60ff83161c161580156124fc575060165481105b15612556576000818152601560209081526040808320805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038b16179055600884901c8352601290915290208054600160ff1b60ff84161c1790555b6000848152601560205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387161790558184146125b457600884901c60009081526012602052604090208054600160ff1b60ff87161c1790555b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b600260105414156126505760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610999565b60026010556107d08161266260165490565b61266c9190613c34565b111561268b57604051633a746c6960e21b815260040160405180910390fd5b6126958282612d15565b7f2f74160e2feb4e95a7f8c8a07b09d745ef677c5a07cb82b0a3936c765587bb1682826126c160165490565b604080516001600160a01b03909416845260208401929092529082015260600160405180910390a150506001601055565b6127106bffffffffffffffffffffffff821611156127785760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152608401610999565b6001600160a01b0382166127ce5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606401610999565b6040805180820182526001600160a01b0393841681526bffffffffffffffffffffffff92831660208083019182526000968752601a9052919094209351905190911674010000000000000000000000000000000000000000029116179055565b60008061283c836016541190565b6128ae5760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e00000000000000000000000000000000000000006064820152608401610999565b6128b783612d2f565b6000818152601560205260409020546001600160a01b031694909350915050565b601180546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008060006129468585612d3c565b91509150610b1581612d7f565b61295e848484612394565b61296c848484600185612fb6565b6112135760405162461bcd60e51b815260206004820152603560248201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260448201527f31526563656976657220696d706c656d656e74657200000000000000000000006064820152608401610999565b606081612a1e57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115612a485780612a3281613cf7565b9150612a419050600a83613c4c565b9150612a22565b60008167ffffffffffffffff811115612a7157634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612a9b576020820181803683370190505b5090505b841561238c57612ab0600183613c7f565b9150612abd600a86613d12565b612ac8906030613c34565b60f81b818381518110612aeb57634e487b7160e01b600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612b25600a86613c4c565b9450612a9f565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd000000000000000000000000000000000000000000000000000000001480612bbf57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80612c0b57507fffffffff0000000000000000000000000000000000000000000000000000000082167f780e9d6300000000000000000000000000000000000000000000000000000000145b8061087057507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610870565b6001600160a01b038416612c6e57611213565b815b612c7a8284613c34565b811015612d0e57600881901c600090815260046020526040902054600160ff1b60ff83161c1615612cd7576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6005546001600160a01b03858116911614612cfe5760008181526002602052604090204290555b612d0781613cf7565b9050612c70565b5050505050565b610888828260405180602001604052806000815250613199565b60006108706012836131b4565b600080825160411415612d735760208301516040840151606085015160001a612d67878285856132b5565b94509450505050610dd7565b50600090506002610dd7565b6000816004811115612da157634e487b7160e01b600052602160045260246000fd5b1415612daa5750565b6001816004811115612dcc57634e487b7160e01b600052602160045260246000fd5b1415612e1a5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610999565b6002816004811115612e3c57634e487b7160e01b600052602160045260246000fd5b1415612e8a5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610999565b6003816004811115612eac57634e487b7160e01b600052602160045260246000fd5b1415612f205760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610999565b6004816004811115612f4257634e487b7160e01b600052602160045260246000fd5b1415610f6e5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610999565b60006001600160a01b0385163b1561318c57506001835b612fd78486613c34565b811015613186576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0387169063150b7a02906130299033908b9086908990600401613ba1565b602060405180830381600087803b15801561304357600080fd5b505af1925050508015613073575060408051601f3d908101601f1916820190925261307091810190613955565b60015b613123573d8080156130a1576040519150601f19603f3d011682016040523d82523d6000602084013e6130a6565b606091505b50805161311b5760405162461bcd60e51b815260206004820152603560248201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260448201527f31526563656976657220696d706c656d656e74657200000000000000000000006064820152608401610999565b805181602001fd5b82801561317157507fffffffff0000000000000000000000000000000000000000000000000000000081167f150b7a0200000000000000000000000000000000000000000000000000000000145b9250508061317e81613cf7565b915050612fcd565b50613190565b5060015b95945050505050565b6016546131a684846133a2565b61296c600085838686612fb6565b600881901c60008181526020849052604081205490919060ff808516919082181c80156131f6576131e481613569565b60ff168203600884901b1793506132ac565b6000831161326c5760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527f696e64657820646f65736e27742065786973742e0000000000000000000000006064820152608401610999565b5060001990910160008181526020869052604090205490919080156132a75761329481613569565b60ff0360ff16600884901b1793506132ac565b6131f6565b50505092915050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156132ec5750600090506003613399565b8460ff16601b1415801561330457508460ff16601c14155b156133155750600090506004613399565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613369573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661339257600060019250925050613399565b9150600090505b94509492505050565b601654816134185760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d757374206265206772656160448201527f74657220300000000000000000000000000000000000000000000000000000006064820152608401610999565b6001600160a01b0383166134945760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610999565b6134a16000848385612c5b565b81601660008282546134b39190613c34565b90915550506000818152601560209081526040808320805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038816179055600884901c8352601290915290208054600160ff1b60ff84161c179055805b6135188383613c34565b8110156112135760405181906001600160a01b038616906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a48061356181613cf7565b91505061350e565b60006040518061012001604052806101008152602001613d97610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff6135b2856135e1565b02901c815181106135d357634e487b7160e01b600052603260045260246000fd5b016020015160f81c92915050565b60008082116135ef57600080fd5b5060008190031690565b82805461360590613cc2565b90600052602060002090601f016020900481019282613627576000855561366d565b82601f1061364057805160ff191683800117855561366d565b8280016001018555821561366d579182015b8281111561366d578251825591602001919060010190613652565b5061367992915061367d565b5090565b5b80821115613679576000815560010161367e565b600067ffffffffffffffff808411156136ad576136ad613d52565b604051601f8501601f19908116603f011681019082821181831017156136d5576136d5613d52565b816040528093508581528686860111156136ee57600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b038116811461203c57600080fd5b60008083601f840112613730578182fd5b50813567ffffffffffffffff811115613747578182fd5b602083019150836020828501011115610dd757600080fd5b80356bffffffffffffffffffffffff8116811461203c57600080fd5b60006020828403121561378c578081fd5b611ca882613708565b600080604083850312156137a7578081fd5b6137b083613708565b91506137be60208401613708565b90509250929050565b6000806000606084860312156137db578081fd5b6137e484613708565b92506137f260208501613708565b9150604084013590509250925092565b60008060008060808587031215613817578081fd5b61382085613708565b935061382e60208601613708565b925060408501359150606085013567ffffffffffffffff811115613850578182fd5b8501601f81018713613860578182fd5b61386f87823560208401613692565b91505092959194509250565b6000806040838503121561388d578182fd5b61389683613708565b9150602083013580151581146138aa578182fd5b809150509250929050565b600080604083850312156138c7578182fd5b6138d083613708565b946020939093013593505050565b6000806000606084860312156138f2578283fd5b6138fb84613708565b95602085013595506040909401359392505050565b60008060408385031215613922578182fd5b61392b83613708565b91506137be6020840161375f565b60006020828403121561394a578081fd5b8135611ca881613d68565b600060208284031215613966578081fd5b8151611ca881613d68565b600060208284031215613982578081fd5b813567ffffffffffffffff811115613998578182fd5b8201601f810184136139a8578182fd5b61238c84823560208401613692565b6000602082840312156139c8578081fd5b5035919050565b600080600080606085870312156139e4578182fd5b843593506139f460208601613708565b9250604085013567ffffffffffffffff811115613a0f578283fd5b613a1b8782880161371f565b95989497509550505050565b600080600060608486031215613a3b578081fd5b83359250613a4b60208501613708565b9150613a596040850161375f565b90509250925092565b60008060408385031215613a74578182fd5b50508035926020909101359150565b60008060008060608587031215613a98578182fd5b8435935060208501359250604085013567ffffffffffffffff811115613a0f578283fd5b60008151808452613ad4816020860160208601613c96565b601f01601f19169290920160200192915050565b60008151613afa818560208601613c96565b9290920192915050565b600080845482600182811c915080831680613b2057607f831692505b6020808410821415613b4057634e487b7160e01b87526022600452602487fd5b818015613b545760018114613b6557613b91565b60ff19861689528489019650613b91565b60008b815260209020885b86811015613b895781548b820152908501908301613b70565b505084890196505b5050505050506131908185613ae8565b60006001600160a01b03808716835280861660208401525083604083015260806060830152613bd36080830184613abc565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015613c1557835183529284019291840191600101613bf9565b50909695505050505050565b602081526000611ca86020830184613abc565b60008219821115613c4757613c47613d26565b500190565b600082613c5b57613c5b613d3c565b500490565b6000816000190483118215151615613c7a57613c7a613d26565b500290565b600082821015613c9157613c91613d26565b500390565b60005b83811015613cb1578181015183820152602001613c99565b838111156112135750506000910152565b600181811c90821680613cd657607f821691505b60208210811415610bd257634e487b7160e01b600052602260045260246000fd5b6000600019821415613d0b57613d0b613d26565b5060010190565b600082613d2157613d21613d3c565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b7fffffffff0000000000000000000000000000000000000000000000000000000081168114610f6e57600080fdfe0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a26469706673582212203f00744a6f2f691f41141c3dc0b15db247d73ea3826a7167fe522d2772a7a14964736f6c63430008040033

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

000000000000000000000000000000000000000000000000000000000000028a0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002568747470733a2f2f6170692e72616962626974686f6c652e78797a2f6d657461646174612f000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _royaltyFee (uint96): 650
Arg [1] : _baseURI (string): https://api.raibbithole.xyz/metadata/

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000000000000000028a
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000025
Arg [3] : 68747470733a2f2f6170692e72616962626974686f6c652e78797a2f6d657461
Arg [4] : 646174612f000000000000000000000000000000000000000000000000000000


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.