ETH Price: $2,680.91 (+0.46%)

Token

Onchain Block Invaders (OBI)
 

Overview

Max Total Supply

5,400 OBI

Holders

2,413

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
1 OBI
0x8fbb9b294ff2264d0ca8b76ca809485544facebd
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

Onchain Block Invaders (OBI) is a 100% generated and stored on-chain evolvable pfp collection with swappable skins and color palettes. The custom contracts support uploading future assets, directly on-chain, that collectors can use to change their skins and palettes without...

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
BlockInvaders

Compiler Version
v0.8.6+commit.11564f7e

Optimization Enabled:
Yes with 2000 runs

Other Settings:
default evmVersion
File 1 of 12 : BlockInvaders.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;

import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./ERC721OBI.sol";

//
//
//                              ///                                      
//                           ////////                                    
//                         /////////////                                 
//                     //////////////////                               
//                   ///////////////////////                            
//                ////////////////////////////                          
//    &&&&&&&&&     ////////////////////////     &&&&&&&&&&             
//                     ///////////////////                              
//      &&&&&&&&&&&      //////////////      &&&&&&&&&&&&               
//      &&&&&&&&&&&&&&      /////////     &&&&&&&&&&&&&&&               
//                &&&&&&      ////      &&&&&&&                         
//                  &&&&&&&          &&&&&&&                            
//            &&&&&    &&&&&&      &&&&&&&   &&&&&                      
//               &&&&&   &&&&&&&&&&&&&&    &&&&&                        
//                 &&&&&    &&&&&&&&&   &&&&&                           
//                    &&&&&   &&&&    &&&&&                             
//                      &&&&&      &&&&&                                
//                         &&&&& &&&&&                                  
//                           &&&&&&                                     
//                             &&                                       
//                                                                      
//                                                                      
//                      &&&     &&&&&    &&                             
//                    &&   &&   &&   &&  &&                             
//                   &&     &&  &&&&&&&  &&                             
//                    &&   &&   &&&   && &&                             
//                      &&&     &&&& &&  &&            
//
//========================================================================
//  ONCHAIN BLOCK INVADERS - Mint contract



interface IMotherShip  {
    function isMotherShip() external pure returns (bool);
    function launchPad(uint256 tokenId,uint8 idx1,uint8 idx2,uint8 cnt1,uint8 cnt2 ) external view returns (string memory);
}

contract BlockInvaders is ERC721OBI, Ownable, ReentrancyGuard {
    
    struct globalConfigStruct {
        uint8  skinIndex;
        uint8  colorIndex;
    }

    globalConfigStruct globalConfig;
    
    //Mint Related
    uint256 public constant MAX_PER_TX                   = 1;
    uint256 public FOUNDERS_RESERVE_AMOUNT               = 250;
    uint256 public constant MAX_SUPPLY                   = 9750;
    uint256 private isMintPaused = 0;


    //Accountability 
    //Future Skin and color Morph Mint
    uint256 public MORPH_MINT_PRICE;
    address obiAccount;
    address artistAccount;
    uint256 artistPercentage;
    uint256 private morphMintPhase = 0;
   
    //white List
    bytes32 public whiteListRoot;
    mapping(address => uint256) private _addressToMinted; 
        
    
    //Mapping from token index to Address
    //this will give the Token Owner the ability to switch betwen upgradable Contracts
    mapping(uint256 =>address) private _tokenIndexToAddress;
    
    //Events 
    event ConnectedToMotherShip(address motherShipAddress);
    event ContractPaused();
    event ContractUnpaused();
    event MintNewSkinPaused();
    event MintNewSkinUnpaused();
    event whiteListRootSet();
    event mintPriceSet();


//Implementation
    constructor() ERC721OBI("Onchain Block Invaders", "OBI") {
        //initialize the collection
        _mint(_msgSender(),0);
    } 

// deployment related 
//===============================   
    //Acknowledge contract is `BlockInvaders` :always true
    function isBlockInvaders() external pure returns (bool) {return true;}
    
    
    function setTeleporterAddress(address _motherShipAddress,uint8 _skinIndex,uint8 _indexColor) public onlyOwner {
        
        IMotherShip  motherShip = IMotherShip (_motherShipAddress);
        // Verify that we have the appropriate address
        require( motherShip.isMotherShip() );

        //prepare the new skin and/or color pallete for morph mint
        globalConfig.skinIndex    =  _skinIndex;
        globalConfig.colorIndex   =  _indexColor;

        //store the address of the mothership contract per skin
        _tokenIndexToAddress[globalConfig.skinIndex] =  _motherShipAddress;

        emit ConnectedToMotherShip(_tokenIndexToAddress[globalConfig.skinIndex]);
    } 

    function getRenderingContract(uint256 skinIdx) public view returns (address) {
        if (_tokenIndexToAddress[skinIdx] == address(0)) {
            return address(0);
        }
        return _tokenIndexToAddress[skinIdx];
    }

    function getGlobalConfig() public view returns (address,uint8,uint8) {
        return (_tokenIndexToAddress[globalConfig.skinIndex],globalConfig.skinIndex,globalConfig.colorIndex);
    }

// ERC721 related
//===============================   

    function tokenOfOwnerByIndex(address owner, uint256 index) public view  returns (uint256 tokenId) {
        require(index < balanceOf(owner), "ERC721: owner index out of bounds");
        uint count;
        for(uint i; i < _owners.length; i++){
            if(owner == _owners[i].account){
                if(count == index) return i;
                else count++;
            }
        }
        revert("ERC721: owner index out of bounds");
    }
    
    function isOwnerOf(address account, uint256[] calldata _tokenIds) external view returns (bool){
        for(uint256 i; i < _tokenIds.length; ++i ){
            if(_owners[_tokenIds[i]].account != account)
                return false;
        }

        return true;
    }
    
    function getOwnerTokens(address owner) public view  returns (uint256[] memory) {
        uint256 tokenCount = balanceOf(owner);
        if (tokenCount == 0) return new uint256[](0);
  
        uint256[] memory tokensId = new uint256[](tokenCount);
     
        uint k;
        for(uint i; i < _owners.length; i++){
            if(owner == _owners[i].account){
                tokensId[k]=i;
                k++;
            }
        }
        return tokensId;
    }

    function totalSupply() public view  returns (uint256) {
        return _owners.length;
    }

// Contract Actions
//===============================   
   
    function unpauseMint(uint256 _mintType) public onlyOwner {
        isMintPaused = _mintType;
        emit ContractUnpaused();
    }

    function getMintPhase() public view returns (uint256) {
        return isMintPaused;
    }
    
    function unpauseMorph(uint256 _morphType) public onlyOwner {
        morphMintPhase = _morphType;
    }

    function getMorphPhase() public view returns (uint256) {
        return morphMintPhase;
    }

// merkleTree 
//===============================       
    function _leaf(string memory allowance, string memory payload) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked(payload, allowance));
    }
    
    function _verify(bytes32 leaf, bytes32[] memory proof) internal view returns (bool) {
        return MerkleProof.verify(proof, whiteListRoot, leaf);
    }

    function getAllowance(string memory allowance, bytes32[] calldata proof) public view returns (string memory) {
        string memory payload = string(abi.encodePacked(_msgSender()));
        require(_verify(_leaf(allowance, payload), proof), "OBI: Merkle Tree proof supplied.");
        return allowance;
    }

    function setWhiteListRoot(bytes32 _whiteListRoot) external onlyOwner {
        whiteListRoot = _whiteListRoot;
        emit whiteListRootSet();
    }

// skins and chromas related
//===============================   
      
    //1.returns the total number of skins or color for a given skin or color index [flag = 0 - skin, 1 - color]
    function getMorphTotalSupply(uint8 id,uint256 flag) public view returns (uint256) {
        require((id >=0) && (id<32), "OBI: invalid ID.Should be [0-31].");
        uint256 k=0;
        for(uint256 tknID = 0; tknID < _owners.length; tknID++){
            uint32 bitmap = _owners[tknID].bitmap1;
            if (flag == 1){
                bitmap = _owners[tknID].bitmap2;
            }
            if( isBitSet(bitmap,id)==true ){
                k++;
            }
        }
        return k;
    }
    
    //2.returns the active index for skins or color for a token, [flag = 0 - skin, 1 - color]
    function getActiveMorphIdxByToken(uint256 tokenId,uint256 flag) public view returns (uint8){
        require(tokenId < _owners.length, "OBI: invalid token ID.");
        uint8 idx = _owners[tokenId].idx1;
        if (flag == 1){
                idx = _owners[tokenId].idx2;
        }
        return idx;
    }
    
    //3.returns a list of active index for skins or color for a token list, [flag = 0 - skin, 1 - color]
    function getActiveMorphIdxByTokenLst(uint256[] calldata tokensIdList,uint256 flag) public view returns (uint8[] memory){
        uint8[] memory activeIdxList = new uint8[](tokensIdList.length);
        for(uint256 id = 0; id < tokensIdList.length; id++){
            uint256 tokenId = tokensIdList[id];
            require(tokenId < _owners.length, "OBI: invalid token ID.");
            activeIdxList[id] =  _owners[tokenId].idx1;
            if (flag == 1){
                activeIdxList[id] =  _owners[tokenId].idx2;
            }
        }
        return activeIdxList;
    }
    
    //4.returns the map of skins or color for a token, [flag = 0 - skin, 1 - color]
    function getMorphMapByToken(uint256 tokenId,uint256 flag) public view returns (uint32){
        require(tokenId < _owners.length, "OBI: invalid token ID.");
        if (flag == 0){
        return _owners[tokenId].bitmap1;
        }
        else{
            return _owners[tokenId].bitmap2;
        }
    }
    
    //5.returns a list of tokens that have the selected skin or color for a token list, [flag = 0 - skin, 1 - color]
    function getOBIforIdx(uint256[] calldata tokensIdList,uint8 idx,uint256 flag) public view returns (uint256[] memory) {
        require((idx >=0) && (idx<32), "OBI: invalid IDX.Should be [0-31].");
        uint256 count=0;
        for(uint256 id = 0; id < tokensIdList.length; id++)
        {
            uint256 tokenID = tokensIdList[id];
            uint32 bitmap = _owners[tokenID].bitmap1;
            if (flag == 1){
                bitmap = _owners[tokenID].bitmap2;
            }
            if ( isBitSet(bitmap,idx) == true )
            {
                count ++;
            }
        }
        uint256 k=0;
        uint256[] memory tokenList = new uint256[](count);
        for(uint256 id = 0; id < tokensIdList.length; id++){
           uint256 tokenID = tokensIdList[id];
           uint32 bitmap = _owners[tokenID].bitmap1;
           if (flag == 1){
                bitmap = _owners[tokenID].bitmap2;
            }
           if(isBitSet(bitmap,idx) ){
                tokenList[k] = tokenID;
                k++;
           }
        }
        return tokenList;
    }

    //6.returns the list skins owned by token 
    function getOBISkinListByToken(uint256 tokenId) public view returns (uint8[] memory) {
        require(tokenId < _owners.length, "OBI: invalid token id.");
        uint32 count=countSetBits(_owners[tokenId].bitmap1);
        uint8[] memory skinList = new uint8[](count);
        uint8 k = 0;
        for(uint8 i=0; i <32; i++) {
            if(isBitSet(_owners[tokenId].bitmap1,i)){
                skinList[k] = i;
                k++;
            }
        }
        return skinList;
    }

    //7.returns the list of colors owned by token 
    function getOBIColorListByToken(uint256 tokenId) public view returns (uint8[] memory) {
        require(tokenId < _owners.length, "OBI: invalid token id.");
        uint32 count=countSetBits(_owners[tokenId].bitmap2);
        uint8[] memory colorList = new uint8[](count);
        uint8 k = 0;
        for(uint8 i=0; i <32; i++) {
            if(isBitSet(_owners[tokenId].bitmap2,i)){
                colorList[k] = i;
                k++;
            }
        }
        return colorList;
    }

    //Strict Validation for payed Mint
    function _validateMorphList(uint256[] calldata tokensIdList) internal view  {
        for(uint256 id; id < tokensIdList.length; id++){
            uint256 tokenID = tokensIdList[id];
            require(tokenID < _owners.length, "OBI: invalid token id");
            require(msg.sender == _owners[tokenID].account, "OBI: You are not the owner of one of the OBI.");
            
            bool hasSkin = isBitSet(_owners[tokenID].bitmap1,globalConfig.skinIndex);
            bool hasColor= isBitSet(_owners[tokenID].bitmap2,globalConfig.colorIndex);
            require( ( hasSkin == false) || (hasColor == false), "OBI: One of the OBI is already Morph Minted.");
        }
    }
    //Light Validation for free Mint,morph transform
    function _validateLightMorphList(uint256[] calldata tokensIdList) internal view  {
        uint256 count = 0;
        for(uint256 id; id < tokensIdList.length; id++){
            uint256 tokenID = tokensIdList[id];
            require(tokenID < _owners.length, "OBI: invalid token id");
            require(msg.sender == _owners[tokenID].account, "OBI: You are not the owner of one of the OBI.");

            bool hasSkin = isBitSet(_owners[tokenID].bitmap1,globalConfig.skinIndex);
            bool hasColor= isBitSet(_owners[tokenID].bitmap2,globalConfig.colorIndex);
            if ( ( hasSkin == true) && (hasColor == true))
            {
                count++;
            }
        }
        require(  count < tokensIdList.length , "OBI: All the OBIs are up to date");
    }

    function _updateMorphList(uint256[] calldata tokensIdList) internal   {
        for(uint256 id; id < tokensIdList.length; id++){
            uint256 tokenID = tokensIdList[id];
            //update skin if owner does not have it already
            if ( isBitSet(_owners[tokenID].bitmap1,globalConfig.skinIndex) == false ){
                _owners[tokenID].cnt1 ++;
                _owners[tokenID].bitmap1 = setBit(_owners[tokenID].bitmap1, globalConfig.skinIndex);
            }
                _owners[tokenID].idx1 =  globalConfig.skinIndex;
            //update skin if owner does not have it already
            if ( isBitSet(_owners[tokenID].bitmap2,globalConfig.colorIndex) == false ){
                _owners[tokenID].cnt2 ++;
                _owners[tokenID].bitmap2 = setBit(_owners[tokenID].bitmap2, globalConfig.colorIndex);
            }
               _owners[tokenID].idx2 = globalConfig.colorIndex;
        }
    }
   
    //change the owned Skins or owned Colors for OBI
    function morphOBI(uint256[] calldata tokensIdList,uint8 skinNr,uint8 colorNr) public {
       //validation
       require((skinNr >=0) && (skinNr<32), "OBI: invalid skinNr.Value must be between [0-31]");
       require((colorNr >=0) && (colorNr<32), "OBI: invalid colorNr.Value must be between [0-31]");
       
       //Validate Morph
       for(uint256 id; id < tokensIdList.length; id++){
        uint256 tokenID = tokensIdList[id];
        require(tokenID < _owners.length, "OBI: invalid token id");
        require(msg.sender == _owners[tokenID].account, "OBI: You ar e not the owner of one of the OBI");
       } 
       //Morph the OBIS
       for(uint256 id; id < tokensIdList.length; id++){
            uint256 tokenID = tokensIdList[id];
            //update skin if you own it
            if ( isBitSet(_owners[tokenID].bitmap1,skinNr) == true ){
                if ( _owners[tokenID].idx1 != skinNr){ //check if not already set,maybe save some gas
                  _owners[tokenID].idx1 =skinNr;
                }
            }
            //update color if you own it
            if ( isBitSet(_owners[tokenID].bitmap2,colorNr) == true ){
                if ( _owners[tokenID].idx2 != colorNr){ //check if not already set,maybe save some gas
                _owners[tokenID].idx2 = colorNr;
                }
            }
       }
    }
//OBI Mint
//=============================== 
    
    function mintWhitelist(uint256 _count, uint256 allowance, bytes32[] calldata proof) external nonReentrant {
        require(isMintPaused == 1, "OBI List Mint is not active");
        string memory payload = string(abi.encodePacked(_msgSender()));
        uint256 _totalSupply = totalSupply();
        require(_totalSupply + _count <= MAX_SUPPLY, "OBI: All OBIs have been minted.");
        require(_verify(_leaf(Strings.toString(allowance), payload), proof), "OBI:Your are not on the OBI List.");
        require(_count > 0 && _addressToMinted[_msgSender()] + _count <= allowance, "OBI:Exceeds OBIList supply"); 
        require(msg.sender == tx.origin);
        
        _addressToMinted[_msgSender()] += _count;

        for(uint i=0; i < _count; i++) { 
            _mint(_msgSender(), _totalSupply + i);
        }
    }
    
    //mint only 1 OBI per Wallet on Public Mint
    function mintPublic() external nonReentrant   {
        
        require(isMintPaused == 2, "OBI: Public Mint is not active");
        uint256 _totalSupply = totalSupply();
        require(_totalSupply + 1 <= MAX_SUPPLY, "OBI: All OBIs have been minted.");
        require(msg.sender == tx.origin);
        
        uint256 _ownedCount = balanceOf(_msgSender());
        require(_ownedCount < ( _addressToMinted[_msgSender()]+ 1 ), "OBI: Exceeds max OBIs per wallet.");
             
        _mint(_msgSender(), _totalSupply);
        
    }

    //only allowed for OBI Founders to mint according to the FOUNDERS_RESERVE_AMOUNT
    //this supply will be allocated equaly to each OBI Founder
    //or some part of the supply will be used for giveaways
    function mintDev(uint256 tknQuantity)  external onlyOwner nonReentrant {
            require(tknQuantity <= FOUNDERS_RESERVE_AMOUNT, "OBI:more tokens requested than founders reserve");
            uint256 _totalSupply = totalSupply();
            FOUNDERS_RESERVE_AMOUNT -= tknQuantity;
            for(uint256 i=0; i < tknQuantity; i++)
                _mint(_msgSender(),_totalSupply + i);
    }

    
    //------------------------------------
    //The Mint and Morph can be called only by the owner of the token
    //------------------------------------
    
    //OBI 0 will be minted only by OBI Team.
    //And it is used to show case future skins and color palettes.
    function mintOBIZeroMorph() public onlyOwner {
            
            //update skin
            if ( isBitSet(_owners[0].bitmap1,globalConfig.skinIndex) == false ){
                _owners[0].cnt1 ++;
                _owners[0].bitmap1 = setBit(_owners[0].bitmap1, globalConfig.skinIndex);
            }
            _owners[0].idx1 = globalConfig.skinIndex;
            //update color 
            if ( isBitSet(_owners[0].bitmap1,globalConfig.colorIndex) == false ){
                _owners[0].cnt2 ++;
                _owners[0].bitmap2 = setBit(_owners[0].bitmap2, globalConfig.colorIndex);
            }
            _owners[0].idx2 = globalConfig.colorIndex;
    }
  
    //free Mint
    function mintFreeOBIMorph(uint256[] calldata tokenIdList) public  {
        require(msg.sender == tx.origin);
        require(morphMintPhase == 1, "OBI: Free OBI Morph is not active");

        _validateLightMorphList(tokenIdList);
        _updateMorphList(tokenIdList);
    }

    function mintFreeOBIListMorph(uint256[] calldata tokenIdList,bytes32[] calldata proof) public  {
        require(msg.sender == tx.origin);
        require(morphMintPhase == 2, "OBI: Free OBIList Morph is not active");
        bytes memory payload = abi.encodePacked(_msgSender());
        require(_verify(keccak256(payload), proof), "OBI: Your are not on the OBIList.");

        _validateLightMorphList(tokenIdList);
        _updateMorphList(tokenIdList);
    }

    function mintOBIMorph(uint256[] calldata tokenIdList) public payable  {
        require(msg.sender == tx.origin);
        require(morphMintPhase == 3, "OBI: OBI Morph is not active");
        require(tokenIdList.length * MORPH_MINT_PRICE == msg.value, "OBI: Invalid funds provided.");
         
         //avoid to pay in case Obi already minted 
        _validateMorphList(tokenIdList);    
        _updateMorphList(tokenIdList);
    }
    
    function mintOBIListMorph(uint256[] calldata tokenIdList,bytes32[] calldata proof) public payable  {
        require(msg.sender == tx.origin);
        require(morphMintPhase == 4, "OBI: OBILIST Morph is not active");
        require(tokenIdList.length * MORPH_MINT_PRICE == msg.value, "OBI: Invalid funds provided.");
        bytes memory payload = abi.encodePacked(_msgSender());
        require(_verify(keccak256(payload), proof), "OBI: Your are not on the OBIList.");
        
        //avoid to pay in case Obi already minted 
        _validateMorphList(tokenIdList);    
        _updateMorphList(tokenIdList);
    }
    
    //give a skin or pallete to a friend
    function mintGiveawayMorph(uint256[] calldata tokenIdList) public payable  {
        require(msg.sender == tx.origin);
        require(morphMintPhase == 5 , "OBI: OBI Giveaway Morph is not active");
        require(tokenIdList.length * MORPH_MINT_PRICE == msg.value, "OBI: Invalid funds provided.");
         
         //avoid to pay in case Obi already minted 
        for(uint256 id; id < tokenIdList.length; id++){
            uint256 tokenID = tokenIdList[id];
            require(tokenID < _owners.length, "OBI: invalid token id");

            bool hasSkin = isBitSet(_owners[tokenID].bitmap1,globalConfig.skinIndex);
            bool hasColor= isBitSet(_owners[tokenID].bitmap2,globalConfig.colorIndex);
            require( ( hasSkin == false) || (hasColor == false), "OBI: One of the OBI is already Morph Minted");
        }    
        
        for(uint256 id; id < tokenIdList.length; id++){
            uint256 tokenID = tokenIdList[id];
            //update skin if owner does not have it already
            if ( isBitSet(_owners[tokenID].bitmap1,globalConfig.skinIndex) == false ){
                _owners[tokenID].cnt1 ++;
                _owners[tokenID].bitmap1 = setBit(_owners[tokenID].bitmap1, globalConfig.skinIndex);
            }
            //update skin if owner does not have it already
            if ( isBitSet(_owners[tokenID].bitmap2,globalConfig.colorIndex) == false ){
                _owners[tokenID].cnt2 ++;
                _owners[tokenID].bitmap2 = setBit(_owners[tokenID].bitmap2, globalConfig.colorIndex);
            }
        }
    }

  //=============================== 
    receive() external payable {}
    
    function setupMorphMint(uint256 _price,address account1,address account2,uint256 percentage) public onlyOwner {
        obiAccount = account1;
        artistAccount = account2;
        artistPercentage = percentage;
        MORPH_MINT_PRICE = _price;
    }
    
    function getMorphMintConfig() public view onlyOwner returns (uint256,address,address,uint256){
        return (MORPH_MINT_PRICE,obiAccount,artistAccount,artistPercentage);
    }
    
    //function to return the price
    function getMintPrice() public view returns (uint256) {
        return MORPH_MINT_PRICE;
    }
   
    
    function withdrawAllAdmin() public payable onlyOwner {
        require(payable(msg.sender).send(address(this).balance));
    }

    function withdrawAll() public payable onlyOwner {
        uint256 totalBalance  = address(this).balance;
        uint256 _artistBalance = totalBalance * artistPercentage/100;
        uint256 _obiBalance = totalBalance - _artistBalance;
        require(payable(artistAccount).send(_artistBalance));
        require(payable(obiAccount).send(_obiBalance));
    }

//===============================   
    function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
        require(_exists(_tokenId), "OBI:URI query for nonexistent OBI.");
        if (_tokenIndexToAddress[_owners[_tokenId].idx1] == address(0)) {
            return '';
        }
        IMotherShip  motherShip = IMotherShip (_tokenIndexToAddress[_owners[_tokenId].idx1]);
        return motherShip.launchPad(_tokenId,_owners[_tokenId].idx1,_owners[_tokenId].idx2,_owners[_tokenId].cnt1,_owners[_tokenId].cnt2);     
    }
}

File 2 of 12 : ERC721OBI.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;

library Address {
    function isContract(address account) internal view returns (bool) {
        uint size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }
}
pragma solidity ^0.8.6;

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

//The ERC721OBI Contract is a modification of the ERC721 standard contract.
//Added features to the ERC721 contract :
//Support for upgradable and modular mint/render contracts
//Gas optimization for minting,skin mint,color pallets mint,color,pallets change

contract ERC721OBI is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;
    
   struct _contractStruct {
        uint8 idx1;
        uint8 idx2;
        uint8 cnt1;
        uint8 cnt2;
        uint32 bitmap1;
        uint32 bitmap2;
        address account;
    }
    
    string private _name;
    string private _symbol;

    

    //OBI: Mapping from token ID to owner address
    _contractStruct[] internal _owners;

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

    // util
//===============================   

    function isBitSet( uint32 _packedBits,uint8 _bitPos) internal pure  returns (bool){
        uint32 flag = (_packedBits >> _bitPos) & uint32(1);
        return (flag == 1 ? true : false);
    }
    
    function setBit( uint32 _packedBits,uint8 _bitPos)  internal pure  returns (uint32){
        return _packedBits | uint32(1) << _bitPos;
    }

    function  countSetBits(uint32 _num)  internal pure  returns (uint32)
    {
     uint32 count = 0;
     while (_num > 0) {
            count = count + (_num & 1); // num&1 => it gives either 0 or 1
            _num = _num >> 1;	// bitwise rightshift 
        }
    return count;
}
    
    
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(ERC165, IERC165)
        returns (bool)
    {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            super.supportsInterface(interfaceId);
    }

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

        uint count;
        for( uint i; i < _owners.length; ++i ){
          if( owner == _owners[i].account )
            ++count;
        }
        return count;
    }

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

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

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

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

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

        _contractStruct memory tokenData;
        tokenData.account = to;
        tokenData.idx1 = 0;
        tokenData.idx2 = 0;
        tokenData.bitmap1 = 1;
        tokenData.bitmap2 = 1;
        tokenData.cnt1 = 1;
        tokenData.cnt2 = 1;
        _owners.push(tokenData);

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

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

        // Clear approvals
        _approve(address(0), tokenId);
        _owners[tokenId].account = address(0);
         delete _owners[tokenId];

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

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

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);
        _owners[tokenId].account = to;

        emit Transfer(from, to, tokenId);
    }

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

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

    
}

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 5 of 12 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Trees proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the merkle tree could be reinterpreted as a leaf value.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

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

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 6 of 12 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

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

pragma solidity ^0.8.0;

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

File 10 of 12 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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 be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

    /**
     * @dev 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 11 of 12 : 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;
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"motherShipAddress","type":"address"}],"name":"ConnectedToMotherShip","type":"event"},{"anonymous":false,"inputs":[],"name":"ContractPaused","type":"event"},{"anonymous":false,"inputs":[],"name":"ContractUnpaused","type":"event"},{"anonymous":false,"inputs":[],"name":"MintNewSkinPaused","type":"event"},{"anonymous":false,"inputs":[],"name":"MintNewSkinUnpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[],"name":"mintPriceSet","type":"event"},{"anonymous":false,"inputs":[],"name":"whiteListRootSet","type":"event"},{"inputs":[],"name":"FOUNDERS_RESERVE_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PER_TX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MORPH_MINT_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"flag","type":"uint256"}],"name":"getActiveMorphIdxByToken","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokensIdList","type":"uint256[]"},{"internalType":"uint256","name":"flag","type":"uint256"}],"name":"getActiveMorphIdxByTokenLst","outputs":[{"internalType":"uint8[]","name":"","type":"uint8[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"allowance","type":"string"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"getAllowance","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGlobalConfig","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint8","name":"","type":"uint8"},{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMintPhase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"flag","type":"uint256"}],"name":"getMorphMapByToken","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMorphMintConfig","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMorphPhase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"id","type":"uint8"},{"internalType":"uint256","name":"flag","type":"uint256"}],"name":"getMorphTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getOBIColorListByToken","outputs":[{"internalType":"uint8[]","name":"","type":"uint8[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getOBISkinListByToken","outputs":[{"internalType":"uint8[]","name":"","type":"uint8[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokensIdList","type":"uint256[]"},{"internalType":"uint8","name":"idx","type":"uint8"},{"internalType":"uint256","name":"flag","type":"uint256"}],"name":"getOBIforIdx","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"getOwnerTokens","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"skinIdx","type":"uint256"}],"name":"getRenderingContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isBlockInvaders","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"isOwnerOf","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tknQuantity","type":"uint256"}],"name":"mintDev","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIdList","type":"uint256[]"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"mintFreeOBIListMorph","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIdList","type":"uint256[]"}],"name":"mintFreeOBIMorph","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIdList","type":"uint256[]"}],"name":"mintGiveawayMorph","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIdList","type":"uint256[]"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"mintOBIListMorph","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIdList","type":"uint256[]"}],"name":"mintOBIMorph","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintOBIZeroMorph","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintPublic","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_count","type":"uint256"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"mintWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokensIdList","type":"uint256[]"},{"internalType":"uint8","name":"skinNr","type":"uint8"},{"internalType":"uint8","name":"colorNr","type":"uint8"}],"name":"morphOBI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_motherShipAddress","type":"address"},{"internalType":"uint8","name":"_skinIndex","type":"uint8"},{"internalType":"uint8","name":"_indexColor","type":"uint8"}],"name":"setTeleporterAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_whiteListRoot","type":"bytes32"}],"name":"setWhiteListRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"address","name":"account1","type":"address"},{"internalType":"address","name":"account2","type":"address"},{"internalType":"uint256","name":"percentage","type":"uint256"}],"name":"setupMorphMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"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":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintType","type":"uint256"}],"name":"unpauseMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_morphType","type":"uint256"}],"name":"unpauseMorph","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"whiteListRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"withdrawAllAdmin","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405260fa60085560006009556000600e553480156200002057600080fd5b50604080518082018252601681527f4f6e636861696e20426c6f636b20496e766164657273000000000000000000006020808301918252835180850190945260038452624f424960e81b908401528151919291620000819160009162000397565b5080516200009790600190602084019062000397565b505050620000b4620000ae620000cc60201b60201c565b620000d0565b6001600655620000c633600062000122565b62000490565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166200017e5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064015b60405180910390fd5b620001898162000338565b15620001d85760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640162000175565b6040805160e0810182526000808252602082018181526001600160a01b0386811660c0850181815260016080870181815260a08801828152888a0183815260608a018481526002805495860181558a528a517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace909501805499519251915194519351965160ff96871661ffff19909b169a909a17610100938716939093029290921763ffff00001916620100009186169190910263ff0000001916176301000000949093169390930291909117600160201b600160601b03191664010000000063ffffffff9283160263ffffffff60401b191617680100000000000000009190931602919091176001600160601b03166c010000000000000000000000009490931693909302919091179091559251919284929091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4505050565b6002546000908210801562000391575060006001600160a01b0316600283815481106200036957620003696200047a565b6000918252602090912001546c0100000000000000000000000090046001600160a01b031614155b92915050565b828054620003a5906200043d565b90600052602060002090601f016020900481019282620003c9576000855562000414565b82601f10620003e457805160ff191683800117855562000414565b8280016001018555821562000414579182015b8281111562000414578251825591602001919060010190620003f7565b506200042292915062000426565b5090565b5b8082111562000422576000815560010162000427565b600181811c908216806200045257607f821691505b602082108114156200047457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b61583f80620004a06000396000f3fe6080604052600436106103795760003560e01c80637353b879116101d1578063abdd95ad11610102578063e8ad3a53116100a0578063f2fde38b1161006f578063f2fde38b14610a4e578063f43a22dc14610a6e578063fba7d7cb14610a83578063fe803ca514610aa357600080fd5b8063e8ad3a53146109b2578063e985e9c5146109c5578063eab45a1b14610a0e578063ee49382414610a2e57600080fd5b8063c87b56dd116100dc578063c87b56dd146108f2578063cda92be414610912578063d63d4af014610972578063e5c4ca011461099257600080fd5b8063abdd95ad14610878578063b88d4fde146108bd578063c52766c6146108dd57600080fd5b8063924081781161016f5780639949f862116101495780639949f8621461080e578063a22cb4651461082e578063a3ef55521461084e578063a7f93ebd1461086357600080fd5b806392408178146107d157806393dfc286146107d957806395d89b41146107f957600080fd5b8063853828b6116101ab578063853828b6146107765780638c874ebd1461077e5780638da5cb5b146107935780638f7c17c0146107b157600080fd5b80637353b8791461072c578063792d91f1146107405780637e83591f1461076057600080fd5b806332cb6b0c116102ab5780636352211e1161024957806366fddfa91161022357806366fddfa9146106c4578063709d03c1146106e457806370a08231146106f7578063715018a61461071757600080fd5b80636352211e1461067957806363990f841461069957806365f4fd12146106ae57600080fd5b806345149bb31161028557806345149bb3146106035780634cb372ba146106235780634d44660c146106435780635b439f0e1461066357600080fd5b806332cb6b0c146105ad5780633ac4895b146105c357806342842e0e146105e357600080fd5b806314cf97bf116103185780632acc6db8116102f25780632acc6db8146105205780632f745c591461054057806331bac43414610560578063323c663e1461058057600080fd5b806314cf97bf146104ce57806318160ddd146104e157806323b872dd1461050057600080fd5b8063081812fc11610354578063081812fc1461040d578063095ea7b3146104455780630d920125146104675780630e0a41fe1461049957600080fd5b80626f2d1a1461038557806301ffc9a7146103bb57806306fdde03146103eb57600080fd5b3661038057005b600080fd5b34801561039157600080fd5b506103a56103a03660046151d8565b610ac3565b6040516103b29190615553565b60405180910390f35b3480156103c757600080fd5b506103db6103d63660046152cf565b610d4e565b60405190151581526020016103b2565b3480156103f757600080fd5b50610400610e33565b6040516103b291906155d2565b34801561041957600080fd5b5061042d6104283660046152b6565b610ec5565b6040516001600160a01b0390911681526020016103b2565b34801561045157600080fd5b50610465610460366004615071565b610f5e565b005b34801561047357600080fd5b50610487610482366004615437565b611090565b60405160ff90911681526020016103b2565b3480156104a557600080fd5b506104b96104b4366004615437565b611144565b60405163ffffffff90911681526020016103b2565b6104656104dc366004615120565b611209565b3480156104ed57600080fd5b506002545b6040519081526020016103b2565b34801561050c57600080fd5b5061046561051b366004614f2f565b6113aa565b34801561052c57600080fd5b5061046561053b366004615234565b611431565b34801561054c57600080fd5b506104f261055b366004615071565b6117dc565b34801561056c57600080fd5b5061046561057b3660046152b6565b611942565b34801561058c57600080fd5b506105a061059b3660046152b6565b6119cd565b6040516103b29190615597565b3480156105b957600080fd5b506104f261261681565b3480156105cf57600080fd5b506104656105de36600461509b565b611b4c565b3480156105ef57600080fd5b506104656105fe366004614f2f565b611cc7565b34801561060f57600080fd5b5061046561061e3660046152b6565b611ce2565b34801561062f57600080fd5b5061046561063e3660046152b6565b611d6d565b34801561064f57600080fd5b506103db61065e366004614fe7565b611dcc565b34801561066f57600080fd5b506104f260085481565b34801561068557600080fd5b5061042d6106943660046152b6565b611e53565b3480156106a557600080fd5b50610465611efa565b3480156106ba57600080fd5b506104f2600f5481565b3480156106d057600080fd5b506104006106df366004615380565b612214565b6104656106f23660046150de565b6122ed565b34801561070357600080fd5b506104f2610712366004614ee1565b6126f7565b34801561072357600080fd5b506104656127df565b34801561073857600080fd5b5060016103db565b34801561074c57600080fd5b506105a061075b36600461518c565b612845565b34801561076c57600080fd5b506104f2600a5481565b6104656129d1565b34801561078a57600080fd5b50610465612abd565b34801561079f57600080fd5b506005546001600160a01b031661042d565b3480156107bd57600080fd5b506104656107cc3660046150de565b612c70565b610465612d0c565b3480156107e557600080fd5b506105a06107f43660046152b6565b612d8a565b34801561080557600080fd5b50610400612ef7565b34801561081a57600080fd5b5061042d6108293660046152b6565b612f06565b34801561083a57600080fd5b5061046561084936600461503a565b612f46565b34801561085a57600080fd5b50600e546104f2565b34801561086f57600080fd5b50600a546104f2565b34801561088457600080fd5b5061088d61300b565b6040516103b294939291909384526001600160a01b03928316602085015291166040830152606082015260800190565b3480156108c957600080fd5b506104656108d8366004614f6b565b6130a5565b3480156108e957600080fd5b506009546104f2565b3480156108fe57600080fd5b5061040061090d3660046152b6565b613133565b34801561091e57600080fd5b5060075460ff8082166000818152601160205260409020546001600160a01b031692909161010090910416604080516001600160a01b03909416845260ff92831660208501529116908201526060016103b2565b34801561097e57600080fd5b506103a561098d366004614ee1565b6133b6565b34801561099e57600080fd5b506104656109ad3660046153f3565b6134b0565b6104656109c03660046150de565b61354f565b3480156109d157600080fd5b506103db6109e0366004614efc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205460ff1690565b348015610a1a57600080fd5b50610465610a29366004615120565b613613565b348015610a3a57600080fd5b50610465610a49366004615459565b61376d565b348015610a5a57600080fd5b50610465610a69366004614ee1565b6139f5565b348015610a7a57600080fd5b506104f2600181565b348015610a8f57600080fd5b50610465610a9e3660046152b6565b613ad7565b348015610aaf57600080fd5b506104f2610abe3660046154a0565b613c56565b606060208360ff1610610b435760405162461bcd60e51b815260206004820152602260248201527f4f42493a20696e76616c6964204944582e53686f756c64206265205b302d333160448201527f5d2e00000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000805b85811015610c11576000878783818110610b6357610b636157a1565b905060200201359050600060028281548110610b8157610b816157a1565b600091825260209091200154640100000000900463ffffffff1690506001861415610bda5760028281548110610bb957610bb96157a1565b60009182526020909120015468010000000000000000900463ffffffff1690505b610be48188613d66565b151560011415610bfc5783610bf881615726565b9450505b50508080610c0990615726565b915050610b47565b506000808267ffffffffffffffff811115610c2e57610c2e6157b7565b604051908082528060200260200182016040528015610c57578160200160208202803683370190505b50905060005b87811015610d40576000898983818110610c7957610c796157a1565b905060200201359050600060028281548110610c9757610c976157a1565b600091825260209091200154640100000000900463ffffffff1690506001881415610cf05760028281548110610ccf57610ccf6157a1565b60009182526020909120015468010000000000000000900463ffffffff1690505b610cfa818a613d66565b15610d2b5781848681518110610d1257610d126157a1565b602090810291909101015284610d2781615726565b9550505b50508080610d3890615726565b915050610c5d565b50925050505b949350505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd000000000000000000000000000000000000000000000000000000001480610de157507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610e2d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b606060008054610e42906156eb565b80601f0160208091040260200160405190810160405280929190818152602001828054610e6e906156eb565b8015610ebb5780601f10610e9057610100808354040283529160200191610ebb565b820191906000526020600020905b815481529060010190602001808311610e9e57829003601f168201915b5050505050905090565b6000610ed082613d90565b610f425760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e00000000000000000000000000000000000000006064820152608401610b3a565b506000908152600360205260409020546001600160a01b031690565b6000610f6982611e53565b9050806001600160a01b0316836001600160a01b03161415610ff35760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610b3a565b336001600160a01b038216148061100f575061100f81336109e0565b6110815760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610b3a565b61108b8383613de1565b505050565b60025460009083106110e45760405162461bcd60e51b815260206004820152601660248201527f4f42493a20696e76616c696420746f6b656e2049442e000000000000000000006044820152606401610b3a565b6000600284815481106110f9576110f96157a1565b60009182526020909120015460ff169050600183141561113d5760028481548110611126576111266157a1565b600091825260209091200154610100900460ff1690505b9392505050565b60025460009083106111985760405162461bcd60e51b815260206004820152601660248201527f4f42493a20696e76616c696420746f6b656e2049442e000000000000000000006044820152606401610b3a565b816111d157600283815481106111b0576111b06157a1565b600091825260209091200154640100000000900463ffffffff169050610e2d565b600283815481106111e4576111e46157a1565b60009182526020909120015468010000000000000000900463ffffffff169050610e2d565b33321461121557600080fd5b600e546004146112675760405162461bcd60e51b815260206004820181905260248201527f4f42493a204f42494c495354204d6f727068206973206e6f74206163746976656044820152606401610b3a565b600a5434906112769085615689565b146112c35760405162461bcd60e51b815260206004820152601c60248201527f4f42493a20496e76616c69642066756e64732070726f76696465642e000000006044820152606401610b3a565b6040516bffffffffffffffffffffffff193360601b16602082015260009060340160405160208183030381529060405290506113398180519060200120848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250613e5c92505050565b61138f5760405162461bcd60e51b815260206004820152602160248201527f4f42493a20596f757220617265206e6f74206f6e20746865204f42494c6973746044820152601760f91b6064820152608401610b3a565b6113998585613e6b565b6113a38585614051565b5050505050565b6113b433826142b0565b6114265760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610b3a565b61108b8383836143a7565b60208260ff16106114aa5760405162461bcd60e51b815260206004820152603060248201527f4f42493a20696e76616c696420736b696e4e722e56616c7565206d757374206260448201527f65206265747765656e205b302d33315d000000000000000000000000000000006064820152608401610b3a565b60208160ff16106115235760405162461bcd60e51b815260206004820152603160248201527f4f42493a20696e76616c696420636f6c6f724e722e56616c7565206d7573742060448201527f6265206265747765656e205b302d33315d0000000000000000000000000000006064820152608401610b3a565b60005b83811015611655576000858583818110611542576115426157a1565b905060200201359050600280549050811061159f5760405162461bcd60e51b815260206004820152601560248201527f4f42493a20696e76616c696420746f6b656e20696400000000000000000000006044820152606401610b3a565b600281815481106115b2576115b26157a1565b600091825260209091200154600160601b90046001600160a01b031633146116425760405162461bcd60e51b815260206004820152602d60248201527f4f42493a20596f752061722065206e6f7420746865206f776e6572206f66206f60448201527f6e65206f6620746865204f4249000000000000000000000000000000000000006064820152608401610b3a565b508061164d81615726565b915050611526565b5060005b838110156113a3576000858583818110611675576116756157a1565b9050602002013590506116b460028281548110611694576116946157a1565b600091825260209091200154640100000000900463ffffffff1685613d66565b15156001141561171b578360ff16600282815481106116d5576116d56157a1565b60009182526020909120015460ff161461171b5783600282815481106116fd576116fd6157a1565b6000918252602090912001805460ff191660ff929092169190911790555b61175560028281548110611731576117316157a1565b60009182526020909120015468010000000000000000900463ffffffff1684613d66565b1515600114156117c9578260ff1660028281548110611776576117766157a1565b600091825260209091200154610100900460ff16146117c95782600282815481106117a3576117a36157a1565b9060005260206000200160000160016101000a81548160ff021916908360ff1602179055505b50806117d481615726565b915050611659565b60006117e7836126f7565b821061185b5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a206f776e657220696e646578206f7574206f6620626f756e6460448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610b3a565b6000805b6002548110156118d3576002818154811061187c5761187c6157a1565b6000918252602090912001546001600160a01b03868116600160601b9092041614156118c157838214156118b3579150610e2d9050565b816118bd81615726565b9250505b806118cb81615726565b91505061185f565b5060405162461bcd60e51b815260206004820152602160248201527f4552433732313a206f776e657220696e646578206f7574206f6620626f756e6460448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610b3a565b6005546001600160a01b0316331461199c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b60098190556040517f0e5e3b3fb504c22cf5c42fa07d521225937514c654007e1f12646f89768d6f9490600090a150565b6002546060908210611a215760405162461bcd60e51b815260206004820152601660248201527f4f42493a20696e76616c696420746f6b656e2069642e000000000000000000006044820152606401610b3a565b6000611a5c60028481548110611a3957611a396157a1565b60009182526020909120015468010000000000000000900463ffffffff16614534565b905060008163ffffffff1667ffffffffffffffff811115611a7f57611a7f6157b7565b604051908082528060200260200182016040528015611aa8578160200160208202803683370190505b5090506000805b60208160ff161015611b4257611af560028781548110611ad157611ad16157a1565b60009182526020909120015468010000000000000000900463ffffffff1682613d66565b15611b305780838360ff1681518110611b1057611b106157a1565b60ff9092166020928302919091019091015281611b2c81615741565b9250505b80611b3a81615741565b915050611aaf565b5090949350505050565b6005546001600160a01b03163314611ba65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b6000839050806001600160a01b03166328ad77826040518163ffffffff1660e01b815260040160206040518083038186803b158015611be457600080fd5b505afa158015611bf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c1c9190615299565b611c2557600080fd5b6007805460ff85811661ffff1990921691909117610100858316021780835581166000908152601160209081526040808320805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038b81169190911790915594549093168252908290205491519190921681527f7c95f34022749bf8c6eb91ba0ae89dce02b8ca51f6c4aefb2b1d3c66ac696661910160405180910390a150505050565b61108b838383604051806020016040528060008152506130a5565b6005546001600160a01b03163314611d3c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b600f8190556040517ff5a75bda40e990f8cd279d9bfaa8aa5f2d2051ad6d8150d5ceecb96841d9799f90600090a150565b6005546001600160a01b03163314611dc75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b600e55565b6000805b82811015611e4857846001600160a01b03166002858584818110611df657611df66157a1565b9050602002013581548110611e0d57611e0d6157a1565b600091825260209091200154600160601b90046001600160a01b031614611e3857600091505061113d565b611e4181615726565b9050611dd0565b506001949350505050565b60008060028381548110611e6957611e696157a1565b600091825260209091200154600160601b90046001600160a01b0316905080610e2d5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610b3a565b6005546001600160a01b03163314611f545760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b611f926002600081548110611f6b57611f6b6157a1565b60009182526020909120015460075464010000000090910463ffffffff169060ff16613d66565b612069576002600081548110611faa57611faa6157a1565b6000918252602090912001805462010000900460ff16906002611fcc83615741565b91906101000a81548160ff021916908360ff160217905550506120296002600081548110611ffc57611ffc6157a1565b600091825260209091200154600754600160ff9091161b63ffffffff640100000000909204919091161790565b600260008154811061203d5761203d6157a1565b9060005260206000200160000160046101000a81548163ffffffff021916908363ffffffff1602179055505b6007546002805460ff90921691600090612085576120856157a1565b60009182526020822001805460ff191660ff9390931692909217909155600280546120e392906120b7576120b76157a1565b60009182526020909120015460075464010000000090910463ffffffff1690610100900460ff16613d66565b6121c65760026000815481106120fb576120fb6157a1565b600091825260209091200180546301000000900460ff1690600361211e83615741565b91906101000a81548160ff021916908360ff16021790555050612186600260008154811061214e5761214e6157a1565b6000918252602090912001546007546801000000000000000090910463ffffffff1690610100900460ff16600160ff919091161b1790565b600260008154811061219a5761219a6157a1565b9060005260206000200160000160086101000a81548163ffffffff021916908363ffffffff1602179055505b600760000160019054906101000a900460ff1660026000815481106121ed576121ed6157a1565b9060005260206000200160000160016101000a81548160ff021916908360ff160217905550565b6060600033604051602001612241919060609190911b6bffffffffffffffffffffffff1916815260140190565b604051602081830303815290604052905061229861225f8683614565565b858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250613e5c92505050565b6122e45760405162461bcd60e51b815260206004820181905260248201527f4f42493a204d65726b6c6520547265652070726f6f6620737570706c6965642e6044820152606401610b3a565b50929392505050565b3332146122f957600080fd5b600e546005146123715760405162461bcd60e51b815260206004820152602560248201527f4f42493a204f4249204769766561776179204d6f727068206973206e6f74206160448201527f63746976650000000000000000000000000000000000000000000000000000006064820152608401610b3a565b600a5434906123809083615689565b146123cd5760405162461bcd60e51b815260206004820152601c60248201527f4f42493a20496e76616c69642066756e64732070726f76696465642e000000006044820152606401610b3a565b60005b818110156125405760008383838181106123ec576123ec6157a1565b90506020020135905060028054905081106124495760405162461bcd60e51b815260206004820152601560248201527f4f42493a20696e76616c696420746f6b656e20696400000000000000000000006044820152606401610b3a565b600061246160028381548110611f6b57611f6b6157a1565b905060006124ab6002848154811061247b5761247b6157a1565b6000918252602090912001546007546801000000000000000090910463ffffffff1690610100900460ff16613d66565b90508115806124b8575080155b61252a5760405162461bcd60e51b815260206004820152602b60248201527f4f42493a204f6e65206f6620746865204f424920697320616c7265616479204d60448201527f6f727068204d696e7465640000000000000000000000000000000000000000006064820152608401610b3a565b505050808061253890615726565b9150506123d0565b5060005b8181101561108b576000838383818110612560576125606157a1565b90506020020135905061257f60028281548110611f6b57611f6b6157a1565b6126265760028181548110612596576125966157a1565b6000918252602090912001805462010000900460ff169060026125b883615741565b91906101000a81548160ff021916908360ff160217905550506125e760028281548110611ffc57611ffc6157a1565b600282815481106125fa576125fa6157a1565b9060005260206000200160000160046101000a81548163ffffffff021916908363ffffffff1602179055505b61263c6002828154811061247b5761247b6157a1565b6126e45760028181548110612653576126536157a1565b600091825260209091200180546301000000900460ff1690600361267683615741565b91906101000a81548160ff021916908360ff160217905550506126a56002828154811061214e5761214e6157a1565b600282815481106126b8576126b86157a1565b9060005260206000200160000160086101000a81548163ffffffff021916908363ffffffff1602179055505b50806126ef81615726565b915050612544565b60006001600160a01b0382166127755760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610b3a565b6000805b6002548110156127d85760028181548110612796576127966157a1565b6000918252602090912001546001600160a01b03858116600160601b9092041614156127c8576127c582615726565b91505b6127d181615726565b9050612779565b5092915050565b6005546001600160a01b031633146128395760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b6128436000614598565b565b606060008367ffffffffffffffff811115612862576128626157b7565b60405190808252806020026020018201604052801561288b578160200160208202803683370190505b50905060005b848110156129c85760008686838181106128ad576128ad6157a1565b905060200201359050600280549050811061290a5760405162461bcd60e51b815260206004820152601660248201527f4f42493a20696e76616c696420746f6b656e2049442e000000000000000000006044820152606401610b3a565b6002818154811061291d5761291d6157a1565b600091825260209091200154835160ff90911690849084908110612943576129436157a1565b602002602001019060ff16908160ff168152505084600114156129b55760028181548110612973576129736157a1565b9060005260206000200160000160019054906101000a900460ff168383815181106129a0576129a06157a1565b602002602001019060ff16908160ff16815250505b50806129c081615726565b915050612891565b50949350505050565b6005546001600160a01b03163314612a2b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b600d544790600090606490612a409084615689565b612a4a9190615675565b90506000612a5882846156a8565b600c546040519192506001600160a01b03169083156108fc029084906000818181858888f19350505050612a8b57600080fd5b600b546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505061108b57600080fd5b60026006541415612b105760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b3a565b6002600681905560095414612b675760405162461bcd60e51b815260206004820152601e60248201527f4f42493a205075626c6963204d696e74206973206e6f742061637469766500006044820152606401610b3a565b6000612b7260025490565b9050612616612b8282600161563e565b1115612bd05760405162461bcd60e51b815260206004820152601f60248201527f4f42493a20416c6c204f4249732068617665206265656e206d696e7465642e006044820152606401610b3a565b333214612bdc57600080fd5b6000612be7336126f7565b33600090815260106020526040902054909150612c0590600161563e565b8110612c5d5760405162461bcd60e51b815260206004820152602160248201527f4f42493a2045786365656473206d6178204f424973207065722077616c6c65746044820152601760f91b6064820152608401610b3a565b612c6733836145f7565b50506001600655565b333214612c7c57600080fd5b600e54600114612cf45760405162461bcd60e51b815260206004820152602160248201527f4f42493a2046726565204f4249204d6f727068206973206e6f7420616374697660448201527f65000000000000000000000000000000000000000000000000000000000000006064820152608401610b3a565b612cfe8282614862565b612d088282614051565b5050565b6005546001600160a01b03163314612d665760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b60405133904780156108fc02916000818181858888f1935050505061284357600080fd5b6002546060908210612dde5760405162461bcd60e51b815260206004820152601660248201527f4f42493a20696e76616c696420746f6b656e2069642e000000000000000000006044820152606401610b3a565b6000612e1560028481548110612df657612df66157a1565b600091825260209091200154640100000000900463ffffffff16614534565b905060008163ffffffff1667ffffffffffffffff811115612e3857612e386157b7565b604051908082528060200260200182016040528015612e61578160200160208202803683370190505b5090506000805b60208160ff161015611b4257612eaa60028781548110612e8a57612e8a6157a1565b600091825260209091200154640100000000900463ffffffff1682613d66565b15612ee55780838360ff1681518110612ec557612ec56157a1565b60ff9092166020928302919091019091015281612ee181615741565b9250505b80612eef81615741565b915050612e68565b606060018054610e42906156eb565b6000818152601160205260408120546001600160a01b0316612f2a57506000919050565b506000908152601160205260409020546001600160a01b031690565b6001600160a01b038216331415612f9f5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610b3a565b3360008181526004602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6000808080336001600160a01b031661302c6005546001600160a01b031690565b6001600160a01b0316146130825760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b5050600a54600b54600c54600d5492956001600160a01b03928316955091169250565b6130af33836142b0565b6131215760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610b3a565b61312d84848484614a43565b50505050565b606061313e82613d90565b6131b05760405162461bcd60e51b815260206004820152602260248201527f4f42493a55524920717565727920666f72206e6f6e6578697374656e74204f4260448201527f492e0000000000000000000000000000000000000000000000000000000000006064820152608401610b3a565b60006001600160a01b031660116000600285815481106131d2576131d26157a1565b600091825260208083209091015460ff1683528201929092526040019020546001600160a01b0316141561321457505060408051602081019091526000815290565b6000601160006002858154811061322d5761322d6157a1565b600091825260208083209091015460ff168352820192909252604001902054600280546001600160a01b0390921692508291634bf51bcd91869182908110613277576132776157a1565b6000918252602090912001546002805460ff909216918890811061329d5761329d6157a1565b9060005260206000200160000160019054906101000a900460ff16600288815481106132cb576132cb6157a1565b9060005260206000200160000160029054906101000a900460ff16600289815481106132f9576132f96157a1565b60009182526020909120015460405160e087901b7fffffffff00000000000000000000000000000000000000000000000000000000168152600481019590955260ff93841660248601529183166044850152821660648401526301000000900416608482015260a40160006040518083038186803b15801561337a57600080fd5b505afa15801561338e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261113d9190810190615309565b606060006133c3836126f7565b9050806133e45760408051600080825260208201909252905b509392505050565b60008167ffffffffffffffff8111156133ff576133ff6157b7565b604051908082528060200260200182016040528015613428578160200160208202803683370190505b5090506000805b600254811015611b42576002818154811061344c5761344c6157a1565b6000918252602090912001546001600160a01b03878116600160601b90920416141561349e5780838381518110613485576134856157a1565b60209081029190910101528161349a81615726565b9250505b806134a881615726565b91505061342f565b6005546001600160a01b0316331461350a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b600b80546001600160a01b0394851673ffffffffffffffffffffffffffffffffffffffff1991821617909155600c805493909416921691909117909155600d55600a55565b33321461355b57600080fd5b600e546003146135ad5760405162461bcd60e51b815260206004820152601c60248201527f4f42493a204f4249204d6f727068206973206e6f7420616374697665000000006044820152606401610b3a565b600a5434906135bc9083615689565b146136095760405162461bcd60e51b815260206004820152601c60248201527f4f42493a20496e76616c69642066756e64732070726f76696465642e000000006044820152606401610b3a565b612cfe8282613e6b565b33321461361f57600080fd5b600e546002146136975760405162461bcd60e51b815260206004820152602560248201527f4f42493a2046726565204f42494c697374204d6f727068206973206e6f74206160448201527f63746976650000000000000000000000000000000000000000000000000000006064820152608401610b3a565b6040516bffffffffffffffffffffffff193360601b166020820152600090603401604051602081830303815290604052905061370d8180519060200120848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250613e5c92505050565b6137635760405162461bcd60e51b815260206004820152602160248201527f4f42493a20596f757220617265206e6f74206f6e20746865204f42494c6973746044820152601760f91b6064820152608401610b3a565b6113998585614862565b600260065414156137c05760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b3a565b60026006556009546001146138175760405162461bcd60e51b815260206004820152601b60248201527f4f4249204c697374204d696e74206973206e6f742061637469766500000000006044820152606401610b3a565b604080513360601b6bffffffffffffffffffffffff19166020820152815160148183030181526034909101909152600254612616613855878361563e565b11156138a35760405162461bcd60e51b815260206004820152601f60248201527f4f42493a20416c6c204f4249732068617665206265656e206d696e7465642e006044820152606401610b3a565b6138b861225f6138b287614acc565b84614565565b61390e5760405162461bcd60e51b815260206004820152602160248201527f4f42493a596f757220617265206e6f74206f6e20746865204f4249204c6973746044820152601760f91b6064820152608401610b3a565b600086118015613939575033600090815260106020526040902054859061393690889061563e565b11155b6139855760405162461bcd60e51b815260206004820152601a60248201527f4f42493a45786365656473204f42494c69737420737570706c790000000000006044820152606401610b3a565b33321461399157600080fd5b33600090815260106020526040812080548892906139b090849061563e565b90915550600090505b868110156139e7576139d5335b6139d0838561563e565b6145f7565b806139df81615726565b9150506139b9565b505060016006555050505050565b6005546001600160a01b03163314613a4f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b6001600160a01b038116613acb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610b3a565b613ad481614598565b50565b6005546001600160a01b03163314613b315760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b60026006541415613b845760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b3a565b6002600655600854811115613c015760405162461bcd60e51b815260206004820152602f60248201527f4f42493a6d6f726520746f6b656e7320726571756573746564207468616e206660448201527f6f756e64657273207265736572766500000000000000000000000000000000006064820152608401610b3a565b6000613c0c60025490565b90508160086000828254613c2091906156a8565b90915550600090505b82811015613c4c57613c3a336139c6565b80613c4481615726565b915050613c29565b5050600160065550565b600060208360ff1610613cb55760405162461bcd60e51b815260206004820152602160248201527f4f42493a20696e76616c69642049442e53686f756c64206265205b302d33315d6044820152601760f91b6064820152608401610b3a565b6000805b6002548110156133dc57600060028281548110613cd857613cd86157a1565b600091825260209091200154640100000000900463ffffffff1690506001851415613d315760028281548110613d1057613d106157a1565b60009182526020909120015468010000000000000000900463ffffffff1690505b613d3b8187613d66565b151560011415613d535782613d4f81615726565b9350505b5080613d5e81615726565b915050613cb9565b6000600163ffffffff841660ff84161c8116908114613d86576000610d46565b6001949350505050565b60025460009082108015610e2d575060006001600160a01b031660028381548110613dbd57613dbd6157a1565b600091825260209091200154600160601b90046001600160a01b0316141592915050565b6000818152600360205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091558190613e2382611e53565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061113d82600f5485614bfe565b60005b8181101561108b576000838383818110613e8a57613e8a6157a1565b9050602002013590506002805490508110613ee75760405162461bcd60e51b815260206004820152601560248201527f4f42493a20696e76616c696420746f6b656e20696400000000000000000000006044820152606401610b3a565b60028181548110613efa57613efa6157a1565b600091825260209091200154600160601b90046001600160a01b03163314613f8a5760405162461bcd60e51b815260206004820152602d60248201527f4f42493a20596f7520617265206e6f7420746865206f776e6572206f66206f6e60448201527f65206f6620746865204f42492e000000000000000000000000000000000000006064820152608401610b3a565b6000613fa260028381548110611f6b57611f6b6157a1565b90506000613fbc6002848154811061247b5761247b6157a1565b9050811580613fc9575080155b61403b5760405162461bcd60e51b815260206004820152602c60248201527f4f42493a204f6e65206f6620746865204f424920697320616c7265616479204d60448201527f6f727068204d696e7465642e00000000000000000000000000000000000000006064820152608401610b3a565b505050808061404990615726565b915050613e6e565b60005b8181101561108b576000838383818110614070576140706157a1565b90506020020135905061408f60028281548110611f6b57611f6b6157a1565b61413657600281815481106140a6576140a66157a1565b6000918252602090912001805462010000900460ff169060026140c883615741565b91906101000a81548160ff021916908360ff160217905550506140f760028281548110611ffc57611ffc6157a1565b6002828154811061410a5761410a6157a1565b9060005260206000200160000160046101000a81548163ffffffff021916908363ffffffff1602179055505b6007546002805460ff9092169183908110614153576141536157a1565b9060005260206000200160000160006101000a81548160ff021916908360ff16021790555061418e6002828154811061247b5761247b6157a1565b61423657600281815481106141a5576141a56157a1565b600091825260209091200180546301000000900460ff169060036141c883615741565b91906101000a81548160ff021916908360ff160217905550506141f76002828154811061214e5761214e6157a1565b6002828154811061420a5761420a6157a1565b9060005260206000200160000160086101000a81548163ffffffff021916908363ffffffff1602179055505b600760000160019054906101000a900460ff166002828154811061425c5761425c6157a1565b6000918252602090912001805460ff92909216610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff90921691909117905550806142a881615726565b915050614054565b60006142bb82613d90565b61432d5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e00000000000000000000000000000000000000006064820152608401610b3a565b600061433883611e53565b9050806001600160a01b0316846001600160a01b031614806143735750836001600160a01b031661436884610ec5565b6001600160a01b0316145b80610d4657506001600160a01b0380821660009081526004602090815260408083209388168352929052205460ff16610d46565b826001600160a01b03166143ba82611e53565b6001600160a01b0316146144365760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610b3a565b6001600160a01b0382166144b15760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610b3a565b6144bc600082613de1565b81600282815481106144d0576144d06157a1565b6000918252602082200180546bffffffffffffffffffffffff16600160601b6001600160a01b0394851602179055604051839285811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a4505050565b6000805b63ffffffff831615610e2d576145516001841682615656565b905060018363ffffffff16901c9250614538565b6000818360405160200161457a9291906154e8565b60405160208183030381529060405280519060200120905092915050565b600580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03821661464d5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610b3a565b61465681613d90565b156146a35760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610b3a565b6040805160e0810182526000808252602082018181526001600160a01b0386811660c0850181815260016080870181815260a08801828152888a0183815260608a018481526002805495860181558a528a517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace909501805499519251915194519351965160ff96871661ffff19909b169a909a1761010093871693909302929092177fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffff1662010000918616919091027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffff161763010000009490931693909302919091177fffffffffffffffffffffffffffffffffffffffff0000000000000000ffffffff1664010000000063ffffffff928316027fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff1617680100000000000000009190931602919091176bffffffffffffffffffffffff16600160601b9490931693909302919091179091559251919284929091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4505050565b6000805b828110156149f3576000848483818110614882576148826157a1565b90506020020135905060028054905081106148df5760405162461bcd60e51b815260206004820152601560248201527f4f42493a20696e76616c696420746f6b656e20696400000000000000000000006044820152606401610b3a565b600281815481106148f2576148f26157a1565b600091825260209091200154600160601b90046001600160a01b031633146149825760405162461bcd60e51b815260206004820152602d60248201527f4f42493a20596f7520617265206e6f7420746865206f776e6572206f66206f6e60448201527f65206f6620746865204f42492e000000000000000000000000000000000000006064820152608401610b3a565b600061499a60028381548110611f6b57611f6b6157a1565b905060006149b46002848154811061247b5761247b6157a1565b905060018215151480156149ca57506001811515145b156149dd57846149d981615726565b9550505b50505080806149eb90615726565b915050614866565b5081811061108b5760405162461bcd60e51b815260206004820181905260248201527f4f42493a20416c6c20746865204f4249732061726520757020746f20646174656044820152606401610b3a565b614a4e8484846143a7565b614a5a84848484614c14565b61312d5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610b3a565b606081614b0c57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115614b365780614b2081615726565b9150614b2f9050600a83615675565b9150614b10565b60008167ffffffffffffffff811115614b5157614b516157b7565b6040519080825280601f01601f191660200182016040528015614b7b576020820181803683370190505b5090505b8415610d4657614b906001836156a8565b9150614b9d600a86615761565b614ba890603061563e565b60f81b818381518110614bbd57614bbd6157a1565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350614bf7600a86615675565b9450614b7f565b600082614c0b8584614dbe565b14949350505050565b60006001600160a01b0384163b15614db6576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063150b7a0290614c71903390899088908890600401615517565b602060405180830381600087803b158015614c8b57600080fd5b505af1925050508015614cbb575060408051601f3d908101601f19168201909252614cb8918101906152ec565b60015b614d6b573d808015614ce9576040519150601f19603f3d011682016040523d82523d6000602084013e614cee565b606091505b508051614d635760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610b3a565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050610d46565b506001610d46565b600081815b84518110156133dc576000858281518110614de057614de06157a1565b60200260200101519050808311614e065760008381526020829052604090209250614e17565b600081815260208490526040902092505b5080614e2281615726565b915050614dc3565b6000614e3d614e3884615616565b6155e5565b9050828152838383011115614e5157600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b0381168114614e7f57600080fd5b919050565b60008083601f840112614e9657600080fd5b50813567ffffffffffffffff811115614eae57600080fd5b6020830191508360208260051b8501011115614ec957600080fd5b9250929050565b803560ff81168114614e7f57600080fd5b600060208284031215614ef357600080fd5b61113d82614e68565b60008060408385031215614f0f57600080fd5b614f1883614e68565b9150614f2660208401614e68565b90509250929050565b600080600060608486031215614f4457600080fd5b614f4d84614e68565b9250614f5b60208501614e68565b9150604084013590509250925092565b60008060008060808587031215614f8157600080fd5b614f8a85614e68565b9350614f9860208601614e68565b925060408501359150606085013567ffffffffffffffff811115614fbb57600080fd5b8501601f81018713614fcc57600080fd5b614fdb87823560208401614e2a565b91505092959194509250565b600080600060408486031215614ffc57600080fd5b61500584614e68565b9250602084013567ffffffffffffffff81111561502157600080fd5b61502d86828701614e84565b9497909650939450505050565b6000806040838503121561504d57600080fd5b61505683614e68565b91506020830135615066816157cd565b809150509250929050565b6000806040838503121561508457600080fd5b61508d83614e68565b946020939093013593505050565b6000806000606084860312156150b057600080fd5b6150b984614e68565b92506150c760208501614ed0565b91506150d560408501614ed0565b90509250925092565b600080602083850312156150f157600080fd5b823567ffffffffffffffff81111561510857600080fd5b61511485828601614e84565b90969095509350505050565b6000806000806040858703121561513657600080fd5b843567ffffffffffffffff8082111561514e57600080fd5b61515a88838901614e84565b9096509450602087013591508082111561517357600080fd5b5061518087828801614e84565b95989497509550505050565b6000806000604084860312156151a157600080fd5b833567ffffffffffffffff8111156151b857600080fd5b6151c486828701614e84565b909790965060209590950135949350505050565b600080600080606085870312156151ee57600080fd5b843567ffffffffffffffff81111561520557600080fd5b61521187828801614e84565b9095509350615224905060208601614ed0565b9396929550929360400135925050565b6000806000806060858703121561524a57600080fd5b843567ffffffffffffffff81111561526157600080fd5b61526d87828801614e84565b9095509350615280905060208601614ed0565b915061528e60408601614ed0565b905092959194509250565b6000602082840312156152ab57600080fd5b815161113d816157cd565b6000602082840312156152c857600080fd5b5035919050565b6000602082840312156152e157600080fd5b813561113d816157db565b6000602082840312156152fe57600080fd5b815161113d816157db565b60006020828403121561531b57600080fd5b815167ffffffffffffffff81111561533257600080fd5b8201601f8101841361534357600080fd5b8051615351614e3882615616565b81815285602083850101111561536657600080fd5b6153778260208301602086016156bf565b95945050505050565b60008060006040848603121561539557600080fd5b833567ffffffffffffffff808211156153ad57600080fd5b818601915086601f8301126153c157600080fd5b6153d087833560208501614e2a565b945060208601359150808211156153e657600080fd5b5061502d86828701614e84565b6000806000806080858703121561540957600080fd5b8435935061541960208601614e68565b925061542760408601614e68565b9396929550929360600135925050565b6000806040838503121561544a57600080fd5b50508035926020909101359150565b6000806000806060858703121561546f57600080fd5b8435935060208501359250604085013567ffffffffffffffff81111561549457600080fd5b61518087828801614e84565b600080604083850312156154b357600080fd5b61508d83614ed0565b600081518084526154d48160208601602086016156bf565b601f01601f19169290920160200192915050565b600083516154fa8184602088016156bf565b83519083019061550e8183602088016156bf565b01949350505050565b60006001600160a01b0380871683528086166020840152508360408301526080606083015261554960808301846154bc565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561558b5783518352928401929184019160010161556f565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561558b57835160ff16835292840192918401916001016155b3565b60208152600061113d60208301846154bc565b604051601f8201601f1916810167ffffffffffffffff8111828210171561560e5761560e6157b7565b604052919050565b600067ffffffffffffffff821115615630576156306157b7565b50601f01601f191660200190565b6000821982111561565157615651615775565b500190565b600063ffffffff80831681851680830382111561550e5761550e615775565b6000826156845761568461578b565b500490565b60008160001904831182151516156156a3576156a3615775565b500290565b6000828210156156ba576156ba615775565b500390565b60005b838110156156da5781810151838201526020016156c2565b8381111561312d5750506000910152565b600181811c908216806156ff57607f821691505b6020821081141561572057634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561573a5761573a615775565b5060010190565b600060ff821660ff81141561575857615758615775565b60010192915050565b6000826157705761577061578b565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114613ad457600080fd5b7fffffffff0000000000000000000000000000000000000000000000000000000081168114613ad457600080fdfea2646970667358221220474e4f3eb4291713f9466632ef0e86ad6f72c7f7718e0ed04eeb3cfdc6619bc564736f6c63430008060033

Deployed Bytecode

0x6080604052600436106103795760003560e01c80637353b879116101d1578063abdd95ad11610102578063e8ad3a53116100a0578063f2fde38b1161006f578063f2fde38b14610a4e578063f43a22dc14610a6e578063fba7d7cb14610a83578063fe803ca514610aa357600080fd5b8063e8ad3a53146109b2578063e985e9c5146109c5578063eab45a1b14610a0e578063ee49382414610a2e57600080fd5b8063c87b56dd116100dc578063c87b56dd146108f2578063cda92be414610912578063d63d4af014610972578063e5c4ca011461099257600080fd5b8063abdd95ad14610878578063b88d4fde146108bd578063c52766c6146108dd57600080fd5b8063924081781161016f5780639949f862116101495780639949f8621461080e578063a22cb4651461082e578063a3ef55521461084e578063a7f93ebd1461086357600080fd5b806392408178146107d157806393dfc286146107d957806395d89b41146107f957600080fd5b8063853828b6116101ab578063853828b6146107765780638c874ebd1461077e5780638da5cb5b146107935780638f7c17c0146107b157600080fd5b80637353b8791461072c578063792d91f1146107405780637e83591f1461076057600080fd5b806332cb6b0c116102ab5780636352211e1161024957806366fddfa91161022357806366fddfa9146106c4578063709d03c1146106e457806370a08231146106f7578063715018a61461071757600080fd5b80636352211e1461067957806363990f841461069957806365f4fd12146106ae57600080fd5b806345149bb31161028557806345149bb3146106035780634cb372ba146106235780634d44660c146106435780635b439f0e1461066357600080fd5b806332cb6b0c146105ad5780633ac4895b146105c357806342842e0e146105e357600080fd5b806314cf97bf116103185780632acc6db8116102f25780632acc6db8146105205780632f745c591461054057806331bac43414610560578063323c663e1461058057600080fd5b806314cf97bf146104ce57806318160ddd146104e157806323b872dd1461050057600080fd5b8063081812fc11610354578063081812fc1461040d578063095ea7b3146104455780630d920125146104675780630e0a41fe1461049957600080fd5b80626f2d1a1461038557806301ffc9a7146103bb57806306fdde03146103eb57600080fd5b3661038057005b600080fd5b34801561039157600080fd5b506103a56103a03660046151d8565b610ac3565b6040516103b29190615553565b60405180910390f35b3480156103c757600080fd5b506103db6103d63660046152cf565b610d4e565b60405190151581526020016103b2565b3480156103f757600080fd5b50610400610e33565b6040516103b291906155d2565b34801561041957600080fd5b5061042d6104283660046152b6565b610ec5565b6040516001600160a01b0390911681526020016103b2565b34801561045157600080fd5b50610465610460366004615071565b610f5e565b005b34801561047357600080fd5b50610487610482366004615437565b611090565b60405160ff90911681526020016103b2565b3480156104a557600080fd5b506104b96104b4366004615437565b611144565b60405163ffffffff90911681526020016103b2565b6104656104dc366004615120565b611209565b3480156104ed57600080fd5b506002545b6040519081526020016103b2565b34801561050c57600080fd5b5061046561051b366004614f2f565b6113aa565b34801561052c57600080fd5b5061046561053b366004615234565b611431565b34801561054c57600080fd5b506104f261055b366004615071565b6117dc565b34801561056c57600080fd5b5061046561057b3660046152b6565b611942565b34801561058c57600080fd5b506105a061059b3660046152b6565b6119cd565b6040516103b29190615597565b3480156105b957600080fd5b506104f261261681565b3480156105cf57600080fd5b506104656105de36600461509b565b611b4c565b3480156105ef57600080fd5b506104656105fe366004614f2f565b611cc7565b34801561060f57600080fd5b5061046561061e3660046152b6565b611ce2565b34801561062f57600080fd5b5061046561063e3660046152b6565b611d6d565b34801561064f57600080fd5b506103db61065e366004614fe7565b611dcc565b34801561066f57600080fd5b506104f260085481565b34801561068557600080fd5b5061042d6106943660046152b6565b611e53565b3480156106a557600080fd5b50610465611efa565b3480156106ba57600080fd5b506104f2600f5481565b3480156106d057600080fd5b506104006106df366004615380565b612214565b6104656106f23660046150de565b6122ed565b34801561070357600080fd5b506104f2610712366004614ee1565b6126f7565b34801561072357600080fd5b506104656127df565b34801561073857600080fd5b5060016103db565b34801561074c57600080fd5b506105a061075b36600461518c565b612845565b34801561076c57600080fd5b506104f2600a5481565b6104656129d1565b34801561078a57600080fd5b50610465612abd565b34801561079f57600080fd5b506005546001600160a01b031661042d565b3480156107bd57600080fd5b506104656107cc3660046150de565b612c70565b610465612d0c565b3480156107e557600080fd5b506105a06107f43660046152b6565b612d8a565b34801561080557600080fd5b50610400612ef7565b34801561081a57600080fd5b5061042d6108293660046152b6565b612f06565b34801561083a57600080fd5b5061046561084936600461503a565b612f46565b34801561085a57600080fd5b50600e546104f2565b34801561086f57600080fd5b50600a546104f2565b34801561088457600080fd5b5061088d61300b565b6040516103b294939291909384526001600160a01b03928316602085015291166040830152606082015260800190565b3480156108c957600080fd5b506104656108d8366004614f6b565b6130a5565b3480156108e957600080fd5b506009546104f2565b3480156108fe57600080fd5b5061040061090d3660046152b6565b613133565b34801561091e57600080fd5b5060075460ff8082166000818152601160205260409020546001600160a01b031692909161010090910416604080516001600160a01b03909416845260ff92831660208501529116908201526060016103b2565b34801561097e57600080fd5b506103a561098d366004614ee1565b6133b6565b34801561099e57600080fd5b506104656109ad3660046153f3565b6134b0565b6104656109c03660046150de565b61354f565b3480156109d157600080fd5b506103db6109e0366004614efc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205460ff1690565b348015610a1a57600080fd5b50610465610a29366004615120565b613613565b348015610a3a57600080fd5b50610465610a49366004615459565b61376d565b348015610a5a57600080fd5b50610465610a69366004614ee1565b6139f5565b348015610a7a57600080fd5b506104f2600181565b348015610a8f57600080fd5b50610465610a9e3660046152b6565b613ad7565b348015610aaf57600080fd5b506104f2610abe3660046154a0565b613c56565b606060208360ff1610610b435760405162461bcd60e51b815260206004820152602260248201527f4f42493a20696e76616c6964204944582e53686f756c64206265205b302d333160448201527f5d2e00000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000805b85811015610c11576000878783818110610b6357610b636157a1565b905060200201359050600060028281548110610b8157610b816157a1565b600091825260209091200154640100000000900463ffffffff1690506001861415610bda5760028281548110610bb957610bb96157a1565b60009182526020909120015468010000000000000000900463ffffffff1690505b610be48188613d66565b151560011415610bfc5783610bf881615726565b9450505b50508080610c0990615726565b915050610b47565b506000808267ffffffffffffffff811115610c2e57610c2e6157b7565b604051908082528060200260200182016040528015610c57578160200160208202803683370190505b50905060005b87811015610d40576000898983818110610c7957610c796157a1565b905060200201359050600060028281548110610c9757610c976157a1565b600091825260209091200154640100000000900463ffffffff1690506001881415610cf05760028281548110610ccf57610ccf6157a1565b60009182526020909120015468010000000000000000900463ffffffff1690505b610cfa818a613d66565b15610d2b5781848681518110610d1257610d126157a1565b602090810291909101015284610d2781615726565b9550505b50508080610d3890615726565b915050610c5d565b50925050505b949350505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd000000000000000000000000000000000000000000000000000000001480610de157507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610e2d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b606060008054610e42906156eb565b80601f0160208091040260200160405190810160405280929190818152602001828054610e6e906156eb565b8015610ebb5780601f10610e9057610100808354040283529160200191610ebb565b820191906000526020600020905b815481529060010190602001808311610e9e57829003601f168201915b5050505050905090565b6000610ed082613d90565b610f425760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e00000000000000000000000000000000000000006064820152608401610b3a565b506000908152600360205260409020546001600160a01b031690565b6000610f6982611e53565b9050806001600160a01b0316836001600160a01b03161415610ff35760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610b3a565b336001600160a01b038216148061100f575061100f81336109e0565b6110815760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610b3a565b61108b8383613de1565b505050565b60025460009083106110e45760405162461bcd60e51b815260206004820152601660248201527f4f42493a20696e76616c696420746f6b656e2049442e000000000000000000006044820152606401610b3a565b6000600284815481106110f9576110f96157a1565b60009182526020909120015460ff169050600183141561113d5760028481548110611126576111266157a1565b600091825260209091200154610100900460ff1690505b9392505050565b60025460009083106111985760405162461bcd60e51b815260206004820152601660248201527f4f42493a20696e76616c696420746f6b656e2049442e000000000000000000006044820152606401610b3a565b816111d157600283815481106111b0576111b06157a1565b600091825260209091200154640100000000900463ffffffff169050610e2d565b600283815481106111e4576111e46157a1565b60009182526020909120015468010000000000000000900463ffffffff169050610e2d565b33321461121557600080fd5b600e546004146112675760405162461bcd60e51b815260206004820181905260248201527f4f42493a204f42494c495354204d6f727068206973206e6f74206163746976656044820152606401610b3a565b600a5434906112769085615689565b146112c35760405162461bcd60e51b815260206004820152601c60248201527f4f42493a20496e76616c69642066756e64732070726f76696465642e000000006044820152606401610b3a565b6040516bffffffffffffffffffffffff193360601b16602082015260009060340160405160208183030381529060405290506113398180519060200120848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250613e5c92505050565b61138f5760405162461bcd60e51b815260206004820152602160248201527f4f42493a20596f757220617265206e6f74206f6e20746865204f42494c6973746044820152601760f91b6064820152608401610b3a565b6113998585613e6b565b6113a38585614051565b5050505050565b6113b433826142b0565b6114265760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610b3a565b61108b8383836143a7565b60208260ff16106114aa5760405162461bcd60e51b815260206004820152603060248201527f4f42493a20696e76616c696420736b696e4e722e56616c7565206d757374206260448201527f65206265747765656e205b302d33315d000000000000000000000000000000006064820152608401610b3a565b60208160ff16106115235760405162461bcd60e51b815260206004820152603160248201527f4f42493a20696e76616c696420636f6c6f724e722e56616c7565206d7573742060448201527f6265206265747765656e205b302d33315d0000000000000000000000000000006064820152608401610b3a565b60005b83811015611655576000858583818110611542576115426157a1565b905060200201359050600280549050811061159f5760405162461bcd60e51b815260206004820152601560248201527f4f42493a20696e76616c696420746f6b656e20696400000000000000000000006044820152606401610b3a565b600281815481106115b2576115b26157a1565b600091825260209091200154600160601b90046001600160a01b031633146116425760405162461bcd60e51b815260206004820152602d60248201527f4f42493a20596f752061722065206e6f7420746865206f776e6572206f66206f60448201527f6e65206f6620746865204f4249000000000000000000000000000000000000006064820152608401610b3a565b508061164d81615726565b915050611526565b5060005b838110156113a3576000858583818110611675576116756157a1565b9050602002013590506116b460028281548110611694576116946157a1565b600091825260209091200154640100000000900463ffffffff1685613d66565b15156001141561171b578360ff16600282815481106116d5576116d56157a1565b60009182526020909120015460ff161461171b5783600282815481106116fd576116fd6157a1565b6000918252602090912001805460ff191660ff929092169190911790555b61175560028281548110611731576117316157a1565b60009182526020909120015468010000000000000000900463ffffffff1684613d66565b1515600114156117c9578260ff1660028281548110611776576117766157a1565b600091825260209091200154610100900460ff16146117c95782600282815481106117a3576117a36157a1565b9060005260206000200160000160016101000a81548160ff021916908360ff1602179055505b50806117d481615726565b915050611659565b60006117e7836126f7565b821061185b5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a206f776e657220696e646578206f7574206f6620626f756e6460448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610b3a565b6000805b6002548110156118d3576002818154811061187c5761187c6157a1565b6000918252602090912001546001600160a01b03868116600160601b9092041614156118c157838214156118b3579150610e2d9050565b816118bd81615726565b9250505b806118cb81615726565b91505061185f565b5060405162461bcd60e51b815260206004820152602160248201527f4552433732313a206f776e657220696e646578206f7574206f6620626f756e6460448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610b3a565b6005546001600160a01b0316331461199c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b60098190556040517f0e5e3b3fb504c22cf5c42fa07d521225937514c654007e1f12646f89768d6f9490600090a150565b6002546060908210611a215760405162461bcd60e51b815260206004820152601660248201527f4f42493a20696e76616c696420746f6b656e2069642e000000000000000000006044820152606401610b3a565b6000611a5c60028481548110611a3957611a396157a1565b60009182526020909120015468010000000000000000900463ffffffff16614534565b905060008163ffffffff1667ffffffffffffffff811115611a7f57611a7f6157b7565b604051908082528060200260200182016040528015611aa8578160200160208202803683370190505b5090506000805b60208160ff161015611b4257611af560028781548110611ad157611ad16157a1565b60009182526020909120015468010000000000000000900463ffffffff1682613d66565b15611b305780838360ff1681518110611b1057611b106157a1565b60ff9092166020928302919091019091015281611b2c81615741565b9250505b80611b3a81615741565b915050611aaf565b5090949350505050565b6005546001600160a01b03163314611ba65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b6000839050806001600160a01b03166328ad77826040518163ffffffff1660e01b815260040160206040518083038186803b158015611be457600080fd5b505afa158015611bf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c1c9190615299565b611c2557600080fd5b6007805460ff85811661ffff1990921691909117610100858316021780835581166000908152601160209081526040808320805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038b81169190911790915594549093168252908290205491519190921681527f7c95f34022749bf8c6eb91ba0ae89dce02b8ca51f6c4aefb2b1d3c66ac696661910160405180910390a150505050565b61108b838383604051806020016040528060008152506130a5565b6005546001600160a01b03163314611d3c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b600f8190556040517ff5a75bda40e990f8cd279d9bfaa8aa5f2d2051ad6d8150d5ceecb96841d9799f90600090a150565b6005546001600160a01b03163314611dc75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b600e55565b6000805b82811015611e4857846001600160a01b03166002858584818110611df657611df66157a1565b9050602002013581548110611e0d57611e0d6157a1565b600091825260209091200154600160601b90046001600160a01b031614611e3857600091505061113d565b611e4181615726565b9050611dd0565b506001949350505050565b60008060028381548110611e6957611e696157a1565b600091825260209091200154600160601b90046001600160a01b0316905080610e2d5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610b3a565b6005546001600160a01b03163314611f545760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b611f926002600081548110611f6b57611f6b6157a1565b60009182526020909120015460075464010000000090910463ffffffff169060ff16613d66565b612069576002600081548110611faa57611faa6157a1565b6000918252602090912001805462010000900460ff16906002611fcc83615741565b91906101000a81548160ff021916908360ff160217905550506120296002600081548110611ffc57611ffc6157a1565b600091825260209091200154600754600160ff9091161b63ffffffff640100000000909204919091161790565b600260008154811061203d5761203d6157a1565b9060005260206000200160000160046101000a81548163ffffffff021916908363ffffffff1602179055505b6007546002805460ff90921691600090612085576120856157a1565b60009182526020822001805460ff191660ff9390931692909217909155600280546120e392906120b7576120b76157a1565b60009182526020909120015460075464010000000090910463ffffffff1690610100900460ff16613d66565b6121c65760026000815481106120fb576120fb6157a1565b600091825260209091200180546301000000900460ff1690600361211e83615741565b91906101000a81548160ff021916908360ff16021790555050612186600260008154811061214e5761214e6157a1565b6000918252602090912001546007546801000000000000000090910463ffffffff1690610100900460ff16600160ff919091161b1790565b600260008154811061219a5761219a6157a1565b9060005260206000200160000160086101000a81548163ffffffff021916908363ffffffff1602179055505b600760000160019054906101000a900460ff1660026000815481106121ed576121ed6157a1565b9060005260206000200160000160016101000a81548160ff021916908360ff160217905550565b6060600033604051602001612241919060609190911b6bffffffffffffffffffffffff1916815260140190565b604051602081830303815290604052905061229861225f8683614565565b858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250613e5c92505050565b6122e45760405162461bcd60e51b815260206004820181905260248201527f4f42493a204d65726b6c6520547265652070726f6f6620737570706c6965642e6044820152606401610b3a565b50929392505050565b3332146122f957600080fd5b600e546005146123715760405162461bcd60e51b815260206004820152602560248201527f4f42493a204f4249204769766561776179204d6f727068206973206e6f74206160448201527f63746976650000000000000000000000000000000000000000000000000000006064820152608401610b3a565b600a5434906123809083615689565b146123cd5760405162461bcd60e51b815260206004820152601c60248201527f4f42493a20496e76616c69642066756e64732070726f76696465642e000000006044820152606401610b3a565b60005b818110156125405760008383838181106123ec576123ec6157a1565b90506020020135905060028054905081106124495760405162461bcd60e51b815260206004820152601560248201527f4f42493a20696e76616c696420746f6b656e20696400000000000000000000006044820152606401610b3a565b600061246160028381548110611f6b57611f6b6157a1565b905060006124ab6002848154811061247b5761247b6157a1565b6000918252602090912001546007546801000000000000000090910463ffffffff1690610100900460ff16613d66565b90508115806124b8575080155b61252a5760405162461bcd60e51b815260206004820152602b60248201527f4f42493a204f6e65206f6620746865204f424920697320616c7265616479204d60448201527f6f727068204d696e7465640000000000000000000000000000000000000000006064820152608401610b3a565b505050808061253890615726565b9150506123d0565b5060005b8181101561108b576000838383818110612560576125606157a1565b90506020020135905061257f60028281548110611f6b57611f6b6157a1565b6126265760028181548110612596576125966157a1565b6000918252602090912001805462010000900460ff169060026125b883615741565b91906101000a81548160ff021916908360ff160217905550506125e760028281548110611ffc57611ffc6157a1565b600282815481106125fa576125fa6157a1565b9060005260206000200160000160046101000a81548163ffffffff021916908363ffffffff1602179055505b61263c6002828154811061247b5761247b6157a1565b6126e45760028181548110612653576126536157a1565b600091825260209091200180546301000000900460ff1690600361267683615741565b91906101000a81548160ff021916908360ff160217905550506126a56002828154811061214e5761214e6157a1565b600282815481106126b8576126b86157a1565b9060005260206000200160000160086101000a81548163ffffffff021916908363ffffffff1602179055505b50806126ef81615726565b915050612544565b60006001600160a01b0382166127755760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610b3a565b6000805b6002548110156127d85760028181548110612796576127966157a1565b6000918252602090912001546001600160a01b03858116600160601b9092041614156127c8576127c582615726565b91505b6127d181615726565b9050612779565b5092915050565b6005546001600160a01b031633146128395760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b6128436000614598565b565b606060008367ffffffffffffffff811115612862576128626157b7565b60405190808252806020026020018201604052801561288b578160200160208202803683370190505b50905060005b848110156129c85760008686838181106128ad576128ad6157a1565b905060200201359050600280549050811061290a5760405162461bcd60e51b815260206004820152601660248201527f4f42493a20696e76616c696420746f6b656e2049442e000000000000000000006044820152606401610b3a565b6002818154811061291d5761291d6157a1565b600091825260209091200154835160ff90911690849084908110612943576129436157a1565b602002602001019060ff16908160ff168152505084600114156129b55760028181548110612973576129736157a1565b9060005260206000200160000160019054906101000a900460ff168383815181106129a0576129a06157a1565b602002602001019060ff16908160ff16815250505b50806129c081615726565b915050612891565b50949350505050565b6005546001600160a01b03163314612a2b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b600d544790600090606490612a409084615689565b612a4a9190615675565b90506000612a5882846156a8565b600c546040519192506001600160a01b03169083156108fc029084906000818181858888f19350505050612a8b57600080fd5b600b546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505061108b57600080fd5b60026006541415612b105760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b3a565b6002600681905560095414612b675760405162461bcd60e51b815260206004820152601e60248201527f4f42493a205075626c6963204d696e74206973206e6f742061637469766500006044820152606401610b3a565b6000612b7260025490565b9050612616612b8282600161563e565b1115612bd05760405162461bcd60e51b815260206004820152601f60248201527f4f42493a20416c6c204f4249732068617665206265656e206d696e7465642e006044820152606401610b3a565b333214612bdc57600080fd5b6000612be7336126f7565b33600090815260106020526040902054909150612c0590600161563e565b8110612c5d5760405162461bcd60e51b815260206004820152602160248201527f4f42493a2045786365656473206d6178204f424973207065722077616c6c65746044820152601760f91b6064820152608401610b3a565b612c6733836145f7565b50506001600655565b333214612c7c57600080fd5b600e54600114612cf45760405162461bcd60e51b815260206004820152602160248201527f4f42493a2046726565204f4249204d6f727068206973206e6f7420616374697660448201527f65000000000000000000000000000000000000000000000000000000000000006064820152608401610b3a565b612cfe8282614862565b612d088282614051565b5050565b6005546001600160a01b03163314612d665760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b60405133904780156108fc02916000818181858888f1935050505061284357600080fd5b6002546060908210612dde5760405162461bcd60e51b815260206004820152601660248201527f4f42493a20696e76616c696420746f6b656e2069642e000000000000000000006044820152606401610b3a565b6000612e1560028481548110612df657612df66157a1565b600091825260209091200154640100000000900463ffffffff16614534565b905060008163ffffffff1667ffffffffffffffff811115612e3857612e386157b7565b604051908082528060200260200182016040528015612e61578160200160208202803683370190505b5090506000805b60208160ff161015611b4257612eaa60028781548110612e8a57612e8a6157a1565b600091825260209091200154640100000000900463ffffffff1682613d66565b15612ee55780838360ff1681518110612ec557612ec56157a1565b60ff9092166020928302919091019091015281612ee181615741565b9250505b80612eef81615741565b915050612e68565b606060018054610e42906156eb565b6000818152601160205260408120546001600160a01b0316612f2a57506000919050565b506000908152601160205260409020546001600160a01b031690565b6001600160a01b038216331415612f9f5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610b3a565b3360008181526004602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6000808080336001600160a01b031661302c6005546001600160a01b031690565b6001600160a01b0316146130825760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b5050600a54600b54600c54600d5492956001600160a01b03928316955091169250565b6130af33836142b0565b6131215760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610b3a565b61312d84848484614a43565b50505050565b606061313e82613d90565b6131b05760405162461bcd60e51b815260206004820152602260248201527f4f42493a55524920717565727920666f72206e6f6e6578697374656e74204f4260448201527f492e0000000000000000000000000000000000000000000000000000000000006064820152608401610b3a565b60006001600160a01b031660116000600285815481106131d2576131d26157a1565b600091825260208083209091015460ff1683528201929092526040019020546001600160a01b0316141561321457505060408051602081019091526000815290565b6000601160006002858154811061322d5761322d6157a1565b600091825260208083209091015460ff168352820192909252604001902054600280546001600160a01b0390921692508291634bf51bcd91869182908110613277576132776157a1565b6000918252602090912001546002805460ff909216918890811061329d5761329d6157a1565b9060005260206000200160000160019054906101000a900460ff16600288815481106132cb576132cb6157a1565b9060005260206000200160000160029054906101000a900460ff16600289815481106132f9576132f96157a1565b60009182526020909120015460405160e087901b7fffffffff00000000000000000000000000000000000000000000000000000000168152600481019590955260ff93841660248601529183166044850152821660648401526301000000900416608482015260a40160006040518083038186803b15801561337a57600080fd5b505afa15801561338e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261113d9190810190615309565b606060006133c3836126f7565b9050806133e45760408051600080825260208201909252905b509392505050565b60008167ffffffffffffffff8111156133ff576133ff6157b7565b604051908082528060200260200182016040528015613428578160200160208202803683370190505b5090506000805b600254811015611b42576002818154811061344c5761344c6157a1565b6000918252602090912001546001600160a01b03878116600160601b90920416141561349e5780838381518110613485576134856157a1565b60209081029190910101528161349a81615726565b9250505b806134a881615726565b91505061342f565b6005546001600160a01b0316331461350a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b600b80546001600160a01b0394851673ffffffffffffffffffffffffffffffffffffffff1991821617909155600c805493909416921691909117909155600d55600a55565b33321461355b57600080fd5b600e546003146135ad5760405162461bcd60e51b815260206004820152601c60248201527f4f42493a204f4249204d6f727068206973206e6f7420616374697665000000006044820152606401610b3a565b600a5434906135bc9083615689565b146136095760405162461bcd60e51b815260206004820152601c60248201527f4f42493a20496e76616c69642066756e64732070726f76696465642e000000006044820152606401610b3a565b612cfe8282613e6b565b33321461361f57600080fd5b600e546002146136975760405162461bcd60e51b815260206004820152602560248201527f4f42493a2046726565204f42494c697374204d6f727068206973206e6f74206160448201527f63746976650000000000000000000000000000000000000000000000000000006064820152608401610b3a565b6040516bffffffffffffffffffffffff193360601b166020820152600090603401604051602081830303815290604052905061370d8180519060200120848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250613e5c92505050565b6137635760405162461bcd60e51b815260206004820152602160248201527f4f42493a20596f757220617265206e6f74206f6e20746865204f42494c6973746044820152601760f91b6064820152608401610b3a565b6113998585614862565b600260065414156137c05760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b3a565b60026006556009546001146138175760405162461bcd60e51b815260206004820152601b60248201527f4f4249204c697374204d696e74206973206e6f742061637469766500000000006044820152606401610b3a565b604080513360601b6bffffffffffffffffffffffff19166020820152815160148183030181526034909101909152600254612616613855878361563e565b11156138a35760405162461bcd60e51b815260206004820152601f60248201527f4f42493a20416c6c204f4249732068617665206265656e206d696e7465642e006044820152606401610b3a565b6138b861225f6138b287614acc565b84614565565b61390e5760405162461bcd60e51b815260206004820152602160248201527f4f42493a596f757220617265206e6f74206f6e20746865204f4249204c6973746044820152601760f91b6064820152608401610b3a565b600086118015613939575033600090815260106020526040902054859061393690889061563e565b11155b6139855760405162461bcd60e51b815260206004820152601a60248201527f4f42493a45786365656473204f42494c69737420737570706c790000000000006044820152606401610b3a565b33321461399157600080fd5b33600090815260106020526040812080548892906139b090849061563e565b90915550600090505b868110156139e7576139d5335b6139d0838561563e565b6145f7565b806139df81615726565b9150506139b9565b505060016006555050505050565b6005546001600160a01b03163314613a4f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b6001600160a01b038116613acb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610b3a565b613ad481614598565b50565b6005546001600160a01b03163314613b315760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b3a565b60026006541415613b845760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b3a565b6002600655600854811115613c015760405162461bcd60e51b815260206004820152602f60248201527f4f42493a6d6f726520746f6b656e7320726571756573746564207468616e206660448201527f6f756e64657273207265736572766500000000000000000000000000000000006064820152608401610b3a565b6000613c0c60025490565b90508160086000828254613c2091906156a8565b90915550600090505b82811015613c4c57613c3a336139c6565b80613c4481615726565b915050613c29565b5050600160065550565b600060208360ff1610613cb55760405162461bcd60e51b815260206004820152602160248201527f4f42493a20696e76616c69642049442e53686f756c64206265205b302d33315d6044820152601760f91b6064820152608401610b3a565b6000805b6002548110156133dc57600060028281548110613cd857613cd86157a1565b600091825260209091200154640100000000900463ffffffff1690506001851415613d315760028281548110613d1057613d106157a1565b60009182526020909120015468010000000000000000900463ffffffff1690505b613d3b8187613d66565b151560011415613d535782613d4f81615726565b9350505b5080613d5e81615726565b915050613cb9565b6000600163ffffffff841660ff84161c8116908114613d86576000610d46565b6001949350505050565b60025460009082108015610e2d575060006001600160a01b031660028381548110613dbd57613dbd6157a1565b600091825260209091200154600160601b90046001600160a01b0316141592915050565b6000818152600360205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091558190613e2382611e53565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061113d82600f5485614bfe565b60005b8181101561108b576000838383818110613e8a57613e8a6157a1565b9050602002013590506002805490508110613ee75760405162461bcd60e51b815260206004820152601560248201527f4f42493a20696e76616c696420746f6b656e20696400000000000000000000006044820152606401610b3a565b60028181548110613efa57613efa6157a1565b600091825260209091200154600160601b90046001600160a01b03163314613f8a5760405162461bcd60e51b815260206004820152602d60248201527f4f42493a20596f7520617265206e6f7420746865206f776e6572206f66206f6e60448201527f65206f6620746865204f42492e000000000000000000000000000000000000006064820152608401610b3a565b6000613fa260028381548110611f6b57611f6b6157a1565b90506000613fbc6002848154811061247b5761247b6157a1565b9050811580613fc9575080155b61403b5760405162461bcd60e51b815260206004820152602c60248201527f4f42493a204f6e65206f6620746865204f424920697320616c7265616479204d60448201527f6f727068204d696e7465642e00000000000000000000000000000000000000006064820152608401610b3a565b505050808061404990615726565b915050613e6e565b60005b8181101561108b576000838383818110614070576140706157a1565b90506020020135905061408f60028281548110611f6b57611f6b6157a1565b61413657600281815481106140a6576140a66157a1565b6000918252602090912001805462010000900460ff169060026140c883615741565b91906101000a81548160ff021916908360ff160217905550506140f760028281548110611ffc57611ffc6157a1565b6002828154811061410a5761410a6157a1565b9060005260206000200160000160046101000a81548163ffffffff021916908363ffffffff1602179055505b6007546002805460ff9092169183908110614153576141536157a1565b9060005260206000200160000160006101000a81548160ff021916908360ff16021790555061418e6002828154811061247b5761247b6157a1565b61423657600281815481106141a5576141a56157a1565b600091825260209091200180546301000000900460ff169060036141c883615741565b91906101000a81548160ff021916908360ff160217905550506141f76002828154811061214e5761214e6157a1565b6002828154811061420a5761420a6157a1565b9060005260206000200160000160086101000a81548163ffffffff021916908363ffffffff1602179055505b600760000160019054906101000a900460ff166002828154811061425c5761425c6157a1565b6000918252602090912001805460ff92909216610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff90921691909117905550806142a881615726565b915050614054565b60006142bb82613d90565b61432d5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e00000000000000000000000000000000000000006064820152608401610b3a565b600061433883611e53565b9050806001600160a01b0316846001600160a01b031614806143735750836001600160a01b031661436884610ec5565b6001600160a01b0316145b80610d4657506001600160a01b0380821660009081526004602090815260408083209388168352929052205460ff16610d46565b826001600160a01b03166143ba82611e53565b6001600160a01b0316146144365760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610b3a565b6001600160a01b0382166144b15760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610b3a565b6144bc600082613de1565b81600282815481106144d0576144d06157a1565b6000918252602082200180546bffffffffffffffffffffffff16600160601b6001600160a01b0394851602179055604051839285811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a4505050565b6000805b63ffffffff831615610e2d576145516001841682615656565b905060018363ffffffff16901c9250614538565b6000818360405160200161457a9291906154e8565b60405160208183030381529060405280519060200120905092915050565b600580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03821661464d5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610b3a565b61465681613d90565b156146a35760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610b3a565b6040805160e0810182526000808252602082018181526001600160a01b0386811660c0850181815260016080870181815260a08801828152888a0183815260608a018481526002805495860181558a528a517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace909501805499519251915194519351965160ff96871661ffff19909b169a909a1761010093871693909302929092177fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffff1662010000918616919091027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffff161763010000009490931693909302919091177fffffffffffffffffffffffffffffffffffffffff0000000000000000ffffffff1664010000000063ffffffff928316027fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff1617680100000000000000009190931602919091176bffffffffffffffffffffffff16600160601b9490931693909302919091179091559251919284929091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4505050565b6000805b828110156149f3576000848483818110614882576148826157a1565b90506020020135905060028054905081106148df5760405162461bcd60e51b815260206004820152601560248201527f4f42493a20696e76616c696420746f6b656e20696400000000000000000000006044820152606401610b3a565b600281815481106148f2576148f26157a1565b600091825260209091200154600160601b90046001600160a01b031633146149825760405162461bcd60e51b815260206004820152602d60248201527f4f42493a20596f7520617265206e6f7420746865206f776e6572206f66206f6e60448201527f65206f6620746865204f42492e000000000000000000000000000000000000006064820152608401610b3a565b600061499a60028381548110611f6b57611f6b6157a1565b905060006149b46002848154811061247b5761247b6157a1565b905060018215151480156149ca57506001811515145b156149dd57846149d981615726565b9550505b50505080806149eb90615726565b915050614866565b5081811061108b5760405162461bcd60e51b815260206004820181905260248201527f4f42493a20416c6c20746865204f4249732061726520757020746f20646174656044820152606401610b3a565b614a4e8484846143a7565b614a5a84848484614c14565b61312d5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610b3a565b606081614b0c57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115614b365780614b2081615726565b9150614b2f9050600a83615675565b9150614b10565b60008167ffffffffffffffff811115614b5157614b516157b7565b6040519080825280601f01601f191660200182016040528015614b7b576020820181803683370190505b5090505b8415610d4657614b906001836156a8565b9150614b9d600a86615761565b614ba890603061563e565b60f81b818381518110614bbd57614bbd6157a1565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350614bf7600a86615675565b9450614b7f565b600082614c0b8584614dbe565b14949350505050565b60006001600160a01b0384163b15614db6576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063150b7a0290614c71903390899088908890600401615517565b602060405180830381600087803b158015614c8b57600080fd5b505af1925050508015614cbb575060408051601f3d908101601f19168201909252614cb8918101906152ec565b60015b614d6b573d808015614ce9576040519150601f19603f3d011682016040523d82523d6000602084013e614cee565b606091505b508051614d635760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610b3a565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050610d46565b506001610d46565b600081815b84518110156133dc576000858281518110614de057614de06157a1565b60200260200101519050808311614e065760008381526020829052604090209250614e17565b600081815260208490526040902092505b5080614e2281615726565b915050614dc3565b6000614e3d614e3884615616565b6155e5565b9050828152838383011115614e5157600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b0381168114614e7f57600080fd5b919050565b60008083601f840112614e9657600080fd5b50813567ffffffffffffffff811115614eae57600080fd5b6020830191508360208260051b8501011115614ec957600080fd5b9250929050565b803560ff81168114614e7f57600080fd5b600060208284031215614ef357600080fd5b61113d82614e68565b60008060408385031215614f0f57600080fd5b614f1883614e68565b9150614f2660208401614e68565b90509250929050565b600080600060608486031215614f4457600080fd5b614f4d84614e68565b9250614f5b60208501614e68565b9150604084013590509250925092565b60008060008060808587031215614f8157600080fd5b614f8a85614e68565b9350614f9860208601614e68565b925060408501359150606085013567ffffffffffffffff811115614fbb57600080fd5b8501601f81018713614fcc57600080fd5b614fdb87823560208401614e2a565b91505092959194509250565b600080600060408486031215614ffc57600080fd5b61500584614e68565b9250602084013567ffffffffffffffff81111561502157600080fd5b61502d86828701614e84565b9497909650939450505050565b6000806040838503121561504d57600080fd5b61505683614e68565b91506020830135615066816157cd565b809150509250929050565b6000806040838503121561508457600080fd5b61508d83614e68565b946020939093013593505050565b6000806000606084860312156150b057600080fd5b6150b984614e68565b92506150c760208501614ed0565b91506150d560408501614ed0565b90509250925092565b600080602083850312156150f157600080fd5b823567ffffffffffffffff81111561510857600080fd5b61511485828601614e84565b90969095509350505050565b6000806000806040858703121561513657600080fd5b843567ffffffffffffffff8082111561514e57600080fd5b61515a88838901614e84565b9096509450602087013591508082111561517357600080fd5b5061518087828801614e84565b95989497509550505050565b6000806000604084860312156151a157600080fd5b833567ffffffffffffffff8111156151b857600080fd5b6151c486828701614e84565b909790965060209590950135949350505050565b600080600080606085870312156151ee57600080fd5b843567ffffffffffffffff81111561520557600080fd5b61521187828801614e84565b9095509350615224905060208601614ed0565b9396929550929360400135925050565b6000806000806060858703121561524a57600080fd5b843567ffffffffffffffff81111561526157600080fd5b61526d87828801614e84565b9095509350615280905060208601614ed0565b915061528e60408601614ed0565b905092959194509250565b6000602082840312156152ab57600080fd5b815161113d816157cd565b6000602082840312156152c857600080fd5b5035919050565b6000602082840312156152e157600080fd5b813561113d816157db565b6000602082840312156152fe57600080fd5b815161113d816157db565b60006020828403121561531b57600080fd5b815167ffffffffffffffff81111561533257600080fd5b8201601f8101841361534357600080fd5b8051615351614e3882615616565b81815285602083850101111561536657600080fd5b6153778260208301602086016156bf565b95945050505050565b60008060006040848603121561539557600080fd5b833567ffffffffffffffff808211156153ad57600080fd5b818601915086601f8301126153c157600080fd5b6153d087833560208501614e2a565b945060208601359150808211156153e657600080fd5b5061502d86828701614e84565b6000806000806080858703121561540957600080fd5b8435935061541960208601614e68565b925061542760408601614e68565b9396929550929360600135925050565b6000806040838503121561544a57600080fd5b50508035926020909101359150565b6000806000806060858703121561546f57600080fd5b8435935060208501359250604085013567ffffffffffffffff81111561549457600080fd5b61518087828801614e84565b600080604083850312156154b357600080fd5b61508d83614ed0565b600081518084526154d48160208601602086016156bf565b601f01601f19169290920160200192915050565b600083516154fa8184602088016156bf565b83519083019061550e8183602088016156bf565b01949350505050565b60006001600160a01b0380871683528086166020840152508360408301526080606083015261554960808301846154bc565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561558b5783518352928401929184019160010161556f565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561558b57835160ff16835292840192918401916001016155b3565b60208152600061113d60208301846154bc565b604051601f8201601f1916810167ffffffffffffffff8111828210171561560e5761560e6157b7565b604052919050565b600067ffffffffffffffff821115615630576156306157b7565b50601f01601f191660200190565b6000821982111561565157615651615775565b500190565b600063ffffffff80831681851680830382111561550e5761550e615775565b6000826156845761568461578b565b500490565b60008160001904831182151516156156a3576156a3615775565b500290565b6000828210156156ba576156ba615775565b500390565b60005b838110156156da5781810151838201526020016156c2565b8381111561312d5750506000910152565b600181811c908216806156ff57607f821691505b6020821081141561572057634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561573a5761573a615775565b5060010190565b600060ff821660ff81141561575857615758615775565b60010192915050565b6000826157705761577061578b565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114613ad457600080fd5b7fffffffff0000000000000000000000000000000000000000000000000000000081168114613ad457600080fdfea2646970667358221220474e4f3eb4291713f9466632ef0e86ad6f72c7f7718e0ed04eeb3cfdc6619bc564736f6c63430008060033

Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.