Contract 0xbB9F0c60D37eE6847aC90a6Aa046BBc4E2185704

Contract Overview

Balance:
0 MATIC

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x3e3caa870d59914df4534683ec67f603c027b97777c3b66f12dbfca6de60b7dfExecute Meta Tra...220743642021-11-29 20:21:216 days 15 mins ago0x327d372f9b1d7ada2565c777b51f6f73b7b9279a IN  0xbb9f0c60d37ee6847ac90a6aa046bbc4e21857040 MATIC0.01203442
0x731104486f3b95bf930382d9625a911b7090d6fb4971ce5dea3e978c578acaf6Safe Transfer Fr...220707392021-11-29 17:51:176 days 2 hrs ago0x542faad1179d57c0b5d88af0e7a3fba3ed15412b IN  0xbb9f0c60d37ee6847ac90a6aa046bbc4e21857040 MATIC0.000242137
0x7ec06166196bd8e30ada60675a7684eec9df11986f3b25075e4ea4e502c6dd00Execute Meta Tra...220705362021-11-29 17:44:196 days 2 hrs ago0x0a57012d1378a8a25e03dd1d66215557458bb241 IN  0xbb9f0c60d37ee6847ac90a6aa046bbc4e21857040 MATIC0.0065623
0x0e20ba90a7bac31a3559bff59d706a1252b2327295f745797926a74d9c687e25Execute Meta Tra...220510122021-11-29 4:21:056 days 16 hrs ago0xf0584bbeda83798a8680d145c1b5a805f9659df1 IN  0xbb9f0c60d37ee6847ac90a6aa046bbc4e21857040 MATIC0.00641402
0x904ce8f80b36e29456a6e5601057c56bed0a6e96ae72efec27282b217611b045Execute Meta Tra...220328582021-11-28 15:57:237 days 4 hrs ago0x677fc2a06675e3fff07631b824d7e1e6b5813a1f IN  0xbb9f0c60d37ee6847ac90a6aa046bbc4e21857040 MATIC0.01204762
0x571912b3af1e310e4ebd682338ac57657378939c7a988d026d16cb2182ca7c8dExecute Meta Tra...220261172021-11-28 12:05:417 days 8 hrs ago0x7b031f4da991b412734b46877486088a385c2912 IN  0xbb9f0c60d37ee6847ac90a6aa046bbc4e21857040 MATIC0.01204894
0xf25da4d19a9b1981a3436267186b95eb939b309cb069a4cd07bc22446b3b161fExecute Meta Tra...219260372021-11-26 0:18:329 days 20 hrs ago0x7208deb6f9e75dab52a6e8ecb872fc32d3afbde8 IN  0xbb9f0c60d37ee6847ac90a6aa046bbc4e21857040 MATIC0.0062706
0x4f29058ad03a265958e46352f124ca21431648a3501dec059f76dfc03ed81aeeSet Sale State219259942021-11-26 0:16:209 days 20 hrs ago0x542faad1179d57c0b5d88af0e7a3fba3ed15412b IN  0xbb9f0c60d37ee6847ac90a6aa046bbc4e21857040 MATIC0.000160888
0x6116b1c836cadf47bd10912e1b01c668860fa0b9a0c1d052ef2fa7ba1ae06dfa0x60806040219258782021-11-26 0:10:549 days 20 hrs ago0x542faad1179d57c0b5d88af0e7a3fba3ed15412b IN  Contract Creation0 MATIC0.0112821835
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Budheads

Compiler Version
v0.8.0+commit.c7dfd78e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 20 : Budheads.sol
// SPDX-License-Identifier: MIT

/*
                    ___          _____          ___           ___           ___          _____          ___     
     _____         /__/\        /  /::\        /__/\         /  /\         /  /\        /  /::\        /  /\    
    /  /::\        \  \:\      /  /:/\:\       \  \:\       /  /:/_       /  /::\      /  /:/\:\      /  /:/_   
   /  /:/\:\        \  \:\    /  /:/  \:\       \__\:\     /  /:/ /\     /  /:/\:\    /  /:/  \:\    /  /:/ /\  
  /  /:/~/::\   ___  \  \:\  /__/:/ \__\:|  ___ /  /::\   /  /:/ /:/_   /  /:/~/::\  /__/:/ \__\:|  /  /:/ /::\ 
 /__/:/ /:/\:| /__/\  \__\:\ \  \:\ /  /:/ /__/\  /:/\:\ /__/:/ /:/ /\ /__/:/ /:/\:\ \  \:\ /  /:/ /__/:/ /:/\:\
 \  \:\/:/~/:/ \  \:\ /  /:/  \  \:\  /:/  \  \:\/:/__\/ \  \:\/:/ /:/ \  \:\/:/__\/  \  \:\  /:/  \  \:\/:/~/:/
  \  \::/ /:/   \  \:\  /:/    \  \:\/:/    \  \::/       \  \::/ /:/   \  \::/        \  \:\/:/    \  \::/ /:/ 
   \  \:\/:/     \  \:\/:/      \  \::/      \  \:\        \  \:\/:/     \  \:\         \  \::/      \__\/ /:/  
    \  \::/       \  \::/        \__\/        \  \:\        \  \::/       \  \:\         \__\/         /__/:/   
     \__\/         \__\/                       \__\/         \__\/         \__\/                       \__\/    
*/

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";

import "./BudheadsStrainFactory.sol";
import "./EIP712MetaTransaction.sol";

contract Budheads is
    ERC721,
    Ownable,
    ERC721Enumerable,
    ERC721Burnable,
    EIP712MetaTransaction("Budheads", "1")
{
    using Counters for Counters.Counter;
    using SafeMath for uint256;
    using SafeMath for uint8;

    struct Bud {
        uint256 _id;
        string _tokenURI;
        bool _revealed;
    }

    uint256 internal totalBuds = 4200;
    uint256 internal budPrice = 42 * 10**14;
    bool internal isSaleActive = false;
    string public baseURI;
    address internal wethAddressMumbai =
        0xA6FA4fB5f76172d178d61B04b0ecd319C5d1C0aa;
    IERC20 public currencyToken = IERC20(wethAddressMumbai);
    BudheadsStrainFactory budheadsStrainFactory;
    mapping(uint256 => Bud) private idToBud;

    Counters.Counter private _tokenIdTracker;

    function contractURI() public pure returns (string memory) {
        return
            "https://ipfs.io/ipfs/Qmc91MYP6rLHNMUkDvL1D382yMxWuZw89vzebShe63cY8a";
    }

    constructor(
        string memory _defaultBaseURI,
        BudheadsStrainFactory _budheadsStrainFactory
    ) ERC721("Budheads", "BDH") {
        setBaseURI(_defaultBaseURI);
        budheadsStrainFactory = _budheadsStrainFactory;
    }

    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal override(ERC721, ERC721Enumerable) {
        super._beforeTokenTransfer(from, to, tokenId);
    }

    function isApprovedForAll(address _owner, address _operator)
        public
        view
        override
        returns (bool isOperator)
    {
        // if OpenSea's ERC721 Proxy Address is detected, auto-return true
        if (_operator == address(0xff7Ca10aF37178BdD056628eF42fD7F799fAc77c)) {
            return true;
        }
        /* if (_operator == address(0x58807baD0B376efc12F5AD86aAc70E78ed67deaE)) {
            return true;
        } */

        // otherwise, use the default ERC721.isApprovedForAll()
        return ERC721.isApprovedForAll(_owner, _operator);
    }

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

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

    function setBaseURI(string memory _newBaseURI) public onlyOwner {
        baseURI = _newBaseURI;
    }

    function tokenURI(uint256 _tokenId)
        public
        view
        virtual
        override
        returns (string memory)
    {
        require(
            _exists(_tokenId),
            "ERC721Metadata: URI query for nonexistent token"
        );
        string memory strain = idToBud[_tokenId]._tokenURI;
        return string(abi.encodePacked(_baseURI(), strain));
    }

    function setTokenStrain(uint256 itemId, string memory strain)
        public
        onlyOwner
    {
        idToBud[itemId]._tokenURI = strain;
    }

    function _burn(uint256 tokenId) internal override {
        super._burn(tokenId);
    }

    function tokensOfOwner(address _owner) public view returns (Bud[] memory) {
        uint256 tokenCount = balanceOf(_owner);
        if (tokenCount == 0) {
            return new Bud[](0);
        } else {
            Bud[] memory result = new Bud[](tokenCount);
            uint256 index;
            for (index = 0; index < tokenCount; index++) {
                result[index] = fetchBud(tokenOfOwnerByIndex(_owner, index));
            }
            return result;
        }
    }

    function fetchBud(uint256 itemId) public view returns (Bud memory) {
        Bud memory item = idToBud[itemId];
        return item;
    }

    function setSaleState(bool state) public onlyOwner {
        isSaleActive = state;
    }

    function getSaleState() public view returns (bool saleStatus) {
        return isSaleActive;
    }

    function setPrice(uint256 _price, uint256 _decimals) public onlyOwner {
        budPrice = _price * 10**_decimals;
    }

    function getPrice() public view returns (uint256) {
        return budPrice;
    }

    function getCounter() public view returns (uint256) {
        return _tokenIdTracker.current();
    }

    function getCurrencyTokenAddress() public view returns (address) {
        return address(currencyToken);
    }

    function setCurrencyTokenAddress(address _currencyToken) public onlyOwner {
        currencyToken = IERC20(_currencyToken);
    }

    function withdraw() public onlyOwner {
        uint256 balance = currencyToken.balanceOf(address(this));
        require(balance > 0, "No WETH to withdraw");
        currencyToken.transferFrom(address(this), owner(), balance);
    }

    function mintToken(
        address to,
        uint256 numberOfBuds,
        uint256 _salt
    ) public virtual {
        require(isSaleActive, "The sale is not active");
        require(
            numberOfBuds > 0,
            "The number of buds per sesh must be at least 1"
        );
        require(
            totalSupply().add(numberOfBuds) <= totalBuds,
            "We're out of bud, bud"
        );
        uint256 amount = budPrice * numberOfBuds;
        uint256 balance = currencyToken.balanceOf(msgSender());
        require(amount <= balance, "Not enough ETH in the reserve");
        require(currencyToken.transferFrom(msgSender(), address(this), amount));
        for (uint256 i = 0; i < numberOfBuds; i++) {
            require(totalSupply().add(1) <= totalBuds, "We're out of bud, bud");
            _safeMint(to, _tokenIdTracker.current());
            string memory strain = budheadsStrainFactory._getStrain(_salt);
            idToBud[_tokenIdTracker.current()] = Bud(
                _tokenIdTracker.current(),
                strain,
                false
            );
            _tokenIdTracker.increment();
        }
    }
}

File 2 of 20 : EIP712Base.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract EIP712Base {

    struct EIP712Domain {
        string name;
        string version;
        address verifyingContract;
        bytes32 salt;
    }

    bytes32 internal constant EIP712_DOMAIN_TYPEHASH = keccak256(bytes("EIP712Domain(string name,string version,address verifyingContract,bytes32 salt)"));

    bytes32 internal domainSeparator;

    constructor(string memory name, string memory version) public {
        domainSeparator = keccak256(abi.encode(
            EIP712_DOMAIN_TYPEHASH,
            keccak256(bytes(name)),
            keccak256(bytes(version)),
            address(this),
            bytes32(getChainID())
        ));
    }

    function getChainID() internal view returns (uint256 id) {
        assembly {
            id := chainid()
        }
    }

    function getDomainSeparator() private view returns(bytes32) {
        return domainSeparator;
    }

    /**
    * Accept message hash and returns hash message in EIP712 compatible form
    * So that it can be used to recover signer from signature signed using EIP712 formatted data
    * https://eips.ethereum.org/EIPS/eip-712
    * "\\x19" makes the encoding deterministic
    * "\\x01" is the version byte to make it compatible to EIP-191
    */
    function toTypedMessageHash(bytes32 messageHash) internal view returns(bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", getDomainSeparator(), messageHash));
    }

}

File 3 of 20 : EIP712MetaTransaction.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./lib/EIP712Base.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";

contract EIP712MetaTransaction is EIP712Base {
    using SafeMath for uint256;
    bytes32 private constant META_TRANSACTION_TYPEHASH = keccak256(bytes("MetaTransaction(uint256 nonce,address from,bytes functionSignature)"));

    event MetaTransactionExecuted(address userAddress, address payable relayerAddress, bytes functionSignature);
    mapping(address => uint256) private nonces;

    /*
     * Meta transaction structure.
     * No point of including value field here as if user is doing value transfer then he has the funds to pay for gas
     * He should call the desired function directly in that case.
     */
    struct MetaTransaction {
        uint256 nonce;
        address from;
        bytes functionSignature;
    }

    constructor(string memory name, string memory version) public EIP712Base(name, version) {}

    function convertBytesToBytes4(bytes memory inBytes) internal returns (bytes4 outBytes4) {
        if (inBytes.length == 0) {
            return 0x0;
        }

        assembly {
            outBytes4 := mload(add(inBytes, 32))
        }
    }

    function executeMetaTransaction(address userAddress,
        bytes memory functionSignature, bytes32 sigR, bytes32 sigS, uint8 sigV) public payable returns(bytes memory) {
        bytes4 destinationFunctionSig = convertBytesToBytes4(functionSignature);
        require(destinationFunctionSig != msg.sig, "functionSignature can not be of executeMetaTransaction method");
        MetaTransaction memory metaTx = MetaTransaction({
            nonce: nonces[userAddress],
            from: userAddress,
            functionSignature: functionSignature
        });
        require(verify(userAddress, metaTx, sigR, sigS, sigV), "Signer and signature do not match");
        nonces[userAddress] = nonces[userAddress].add(1);
        // Append userAddress at the end to extract it from calling context
        (bool success, bytes memory returnData) = address(this).call(abi.encodePacked(functionSignature, userAddress));

        require(success, "Function call not successful");
        emit MetaTransactionExecuted(userAddress, payable(msg.sender), functionSignature);
        return returnData;
    }

    function hashMetaTransaction(MetaTransaction memory metaTx) internal pure returns (bytes32) {
        return keccak256(abi.encode(
            META_TRANSACTION_TYPEHASH,
            metaTx.nonce,
            metaTx.from,
            keccak256(metaTx.functionSignature)
        ));
    }

    function getNonce(address user) external view returns(uint256 nonce) {
        nonce = nonces[user];
    }

    function verify(address user, MetaTransaction memory metaTx, bytes32 sigR, bytes32 sigS, uint8 sigV) internal view returns (bool) {
        address signer = ecrecover(toTypedMessageHash(hashMetaTransaction(metaTx)), sigV, sigR, sigS);
        require(signer != address(0), "Invalid signature");
        return signer == user;
    }

    function msgSender() internal view returns(address sender) {
        if(msg.sender == address(this)) {
            bytes memory array = msg.data;
            uint256 index = msg.data.length;
            assembly {
                // Load the 32 bytes word from memory with the address on the lower 20 bytes, and mask those.
                sender := and(mload(add(array, index)), 0xffffffffffffffffffffffffffffffffffffffff)
            }
        } else {
            sender = msg.sender;
        }
        return sender;
    }
}

File 4 of 20 : BudheadsStrainFactory.sol
// SPDX-License-Identifier: MIT
// This code is originally from TheDudes collection. Straigth up 'bippity boppity your code is now my property'ed. Just wanted to make that diclaimer clear
// https://etherscan.io/address/0xb0cf7da8dc482997525be8488b9cad4f44315422#code

/*
                    ___          _____          ___           ___           ___          _____          ___     
     _____         /__/\        /  /::\        /__/\         /  /\         /  /\        /  /::\        /  /\    
    /  /::\        \  \:\      /  /:/\:\       \  \:\       /  /:/_       /  /::\      /  /:/\:\      /  /:/_   
   /  /:/\:\        \  \:\    /  /:/  \:\       \__\:\     /  /:/ /\     /  /:/\:\    /  /:/  \:\    /  /:/ /\  
  /  /:/~/::\   ___  \  \:\  /__/:/ \__\:|  ___ /  /::\   /  /:/ /:/_   /  /:/~/::\  /__/:/ \__\:|  /  /:/ /::\ 
 /__/:/ /:/\:| /__/\  \__\:\ \  \:\ /  /:/ /__/\  /:/\:\ /__/:/ /:/ /\ /__/:/ /:/\:\ \  \:\ /  /:/ /__/:/ /:/\:\
 \  \:\/:/~/:/ \  \:\ /  /:/  \  \:\  /:/  \  \:\/:/__\/ \  \:\/:/ /:/ \  \:\/:/__\/  \  \:\  /:/  \  \:\/:/~/:/
  \  \::/ /:/   \  \:\  /:/    \  \:\/:/    \  \::/       \  \::/ /:/   \  \::/        \  \:\/:/    \  \::/ /:/ 
   \  \:\/:/     \  \:\/:/      \  \::/      \  \:\        \  \:\/:/     \  \:\         \  \::/      \__\/ /:/  
    \  \::/       \  \::/        \__\/        \  \:\        \  \::/       \  \:\         \__\/         /__/:/   
     \__\/         \__\/                       \__\/         \__\/         \__\/                       \__\/    
*/

pragma solidity ^0.8.0;
pragma experimental ABIEncoderV2;

contract BudheadsStrainFactory {
  struct Trait {
    string id;
    uint score;
  }

  uint constant internal maxRarityScore = 100;
  uint internal nonce = 42069;
  mapping (string => bool) internal foundStrains;

  Trait[][] internal traitTable;
  Trait[6]  internal colors;
  Trait[11]  internal eyes;
  Trait[11] internal mouths;
  Trait[10]  internal nose;
  Trait[14]  internal head;
  Trait[11]  internal smokes;

  constructor() {
    _setTraitTable();
  }

  function _getStrain(uint _salt) public returns (string memory) {
    while (true) {
      string memory id = "";
      for (uint i=0; i<traitTable.length; i++) {
        Trait[] memory traitPool = traitTable[i];
        string memory traitId = _pickFromTraits(traitPool, _salt);
        id = string(abi.encodePacked(id, traitId));
      }
      if (foundStrains[id] == false) {
        foundStrains[id] = true;
        return id;
      }
    }
  }

  function _pickFromTraits(Trait[] memory _traits, uint _salt) internal returns (string memory) {
    uint r = _random(_salt, maxRarityScore + 1);
    string memory foundTrait;
    for (uint i=0; i<_traits.length; i++) {
      if (_traits[i].score <= r) {
          foundTrait = _traits[i].id;
      }
    }
    return foundTrait;
  }

  function _setTraitTable() internal {
    colors[0] = Trait("00", 0); // applepie 0 <-> 19 ~ 20%
    colors[1] = Trait("01", 20); // lemonhaze 20 <-> 39 ~ 20%
    colors[2] = Trait("02", 40); // purplehaze 40 <-> 59 ~ 20%
    colors[3] = Trait("03", 60); // rainbowkush 60 <-> 69 ~ 10%
    colors[4] = Trait("04", 70); // tangerine 70 <-> 89 ~ 20%
    colors[5] = Trait("05", 90); // whitewidow 90 <-> 100 ~ 10%

    eyes[0] = Trait("00", 0); // all-the-way-mad 0 <-> 9 ~ 10%
    eyes[1] = Trait("01", 10); // black-eye 0 <-> 19 ~ 10%
    eyes[2] = Trait("02", 20); // bonkers 0 <-> 19 ~ 10%
    eyes[3] = Trait("03", 30); // fire-in-the-hole 0 <-> 19 ~ 10%
    eyes[4] = Trait("04", 40); // golden-glasses 0 <-> 19 ~ 5%
    eyes[5] = Trait("05", 45); // groonge 0 <-> 19 ~ 10%
    eyes[6] = Trait("06", 55); // mad-giant 0 <-> 19 ~ 10%
    eyes[7] = Trait("07", 65); // maddening 0 <-> 19 ~ 10%
    eyes[8] = Trait("08", 75); // nub-nub 0 <-> 19 ~ 10%
    eyes[9] = Trait("09", 85); // stoned 0 <-> 19 ~ 5%
    eyes[10] = Trait("10", 90); // vandal 0 <-> 19 ~ 10%

    mouths[0] = Trait("00", 0); // aaah! 90 <-> 100 ~ 5%
    mouths[1] = Trait("01", 5); // all-the-way-devil 90 <-> 100 ~ 5%
    mouths[2] = Trait("02", 10); // devilish 90 <-> 100 ~ 10%
    mouths[3] = Trait("03", 20); // munchie 90 <-> 100 ~ 10%
    mouths[4] = Trait("04", 30); // nhoc! 90 <-> 100 ~ 10%
    mouths[5] = Trait("05", 40); // nhom! 90 <-> 100 ~ 10%
    mouths[6] = Trait("06", 50); // old-sea-dog 90 <-> 100 ~ 10%
    mouths[7] = Trait("07", 60); // punch_d 90 <-> 100 ~ 10%
    mouths[8] = Trait("08", 70); // smirk 90 <-> 100 ~ 10%
    mouths[9] = Trait("09", 80); // the-drill-phase 90 <-> 100 ~ 10%
    mouths[10] = Trait("10", 90); // the-junk 90 <-> 100 ~ 10%

    nose[0] = Trait("00", 0); // fart-smeller 90 <-> 100 ~ 11%
    nose[1] = Trait("01", 11); // noseless 90 <-> 100 ~ 11%
    nose[2] = Trait("02", 22); // piggy- 90 <-> 100 ~ 11%
    nose[3] = Trait("03", 33); // potatoe 90 <-> 100 ~ 11%
    nose[4] = Trait("04", 44); // tawned 90 <-> 100 ~ 11%
    nose[5] = Trait("05", 55); // the-blue-one 90 <-> 100 ~ 11%
    nose[6] = Trait("06", 66); // the-frozen-king 90 <-> 100 ~ 6%
    nose[7] = Trait("07", 72); // the-gold-member 90 <-> 100 ~ 6%
    nose[8] = Trait("08", 78); // the-red-one 90 <-> 100 ~ 11%
    nose[9] = Trait("09", 89); // Ta whitchy 90 <-> 100 ~ 11%

    head[0] = Trait("00", 0); // 23_jordan 90 <-> 100 ~ 8%
    head[1] = Trait("01", 8); // 24 kobe 90 <-> 100 ~ 8%
    head[2] = Trait("02", 16); // ace-of-spades 90 <-> 100 ~ 2%
    head[3] = Trait("03", 18); // boohoo 90 <-> 100 ~ 8%
    head[4] = Trait("04", 26); // bottle-mac-fadden 90 <-> 100 ~ 8%
    head[5] = Trait("05", 34); // fumble 90 <-> 100 ~ 8%
    head[6] = Trait("06", 42); // handy 90 <-> 100 ~ 8%
    head[7] = Trait("07", 50); // last_draft 90 <-> 100 ~ 8%
    head[8] = Trait("08", 58); // mutation 90 <-> 100 ~ 2%
    head[9] = Trait("09", 60); // not-a-saint 90 <-> 100 ~ 8%
    head[10] = Trait("10", 68); // octodead 90 <-> 100 ~ 8%
    head[11] = Trait("11", 76); // radio-blaster 90 <-> 100 ~ 8%
    head[12] = Trait("12", 84); // shipwreck 90 <-> 100 ~ 8%
    head[13] = Trait("13", 92); // the-other-red-one 90 <-> 100 ~ 8%

    smokes[0] = Trait("00", 0); // artist-cigarette 90 <-> 100 ~ 10%
    smokes[1] = Trait("01", 10); // c_est-ne-se-pa-une-pipe 90 <-> 100 ~ 5%
    smokes[2] = Trait("02", 15); // da-bomb 90 <-> 100 ~ 10%
    smokes[3] = Trait("03", 25); // dagger 90 <-> 100 ~ 10%
    smokes[4] = Trait("04", 35); // half-a-boner 90 <-> 100 ~ 10%
    smokes[5] = Trait("05", 45); // light-up-my-bulb 90 <-> 100 ~ 10%
    smokes[6] = Trait("06", 55); // play-me-some-tunes 90 <-> 100 ~ 10%
    smokes[7] = Trait("07", 65); // puff-puff-pass 90 <-> 100 ~ 5%
    smokes[8] = Trait("08", 70); // smoking-hot 90 <-> 100 ~ 10%
    smokes[9] = Trait("09", 80); // stoggie 90 <-> 100 ~ 10%
    smokes[10] = Trait("10", 90); // the-other-blue-one 90 <-> 100 ~ 10%

    traitTable.push(colors);
    traitTable.push(eyes);
    traitTable.push(mouths);
    traitTable.push(nose);
    traitTable.push(head);
    traitTable.push(smokes);
  }

  function _random(uint _salt, uint _limit) internal returns (uint) {
    uint r = (uint(keccak256(abi.encodePacked(block.timestamp, msg.sender, nonce, _salt)))) % _limit;
    nonce++;
    return r;
  }
}

File 5 of 20 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 6 of 20 : IERC165.sol
// SPDX-License-Identifier: MIT

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 7 of 20 : ERC165.sol
// SPDX-License-Identifier: MIT

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 8 of 20 : Strings.sol
// SPDX-License-Identifier: MIT

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 9 of 20 : Counters.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 10 of 20 : Context.sol
// SPDX-License-Identifier: MIT

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 11 of 20 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 12 of 20 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT

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 13 of 20 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 14 of 20 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 15 of 20 : ERC721Burnable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

/**
 * @title ERC721 Burnable Token
 * @dev ERC721 Token that can be irreversibly burned (destroyed).
 */
abstract contract ERC721Burnable is Context, ERC721 {
    /**
     * @dev Burns `tokenId`. See {ERC721-_burn}.
     *
     * Requirements:
     *
     * - The caller must own `tokenId` or be an approved operator.
     */
    function burn(uint256 tokenId) public virtual {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved");
        _burn(tokenId);
    }
}

File 16 of 20 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

File 17 of 20 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 18 of 20 : ERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        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 _owners[tokenId] != address(0);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(from, to, tokenId);
    }

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

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

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

File 19 of 20 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

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

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() {
        _setOwner(_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 {
        _setOwner(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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "istanbul",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract ABI

[{"inputs":[{"internalType":"string","name":"_defaultBaseURI","type":"string"},{"internalType":"contract BudheadsStrainFactory","name":"_budheadsStrainFactory","type":"address"}],"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":"userAddress","type":"address"},{"indexed":false,"internalType":"address payable","name":"relayerAddress","type":"address"},{"indexed":false,"internalType":"bytes","name":"functionSignature","type":"bytes"}],"name":"MetaTransactionExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"currencyToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"},{"internalType":"bytes","name":"functionSignature","type":"bytes"},{"internalType":"bytes32","name":"sigR","type":"bytes32"},{"internalType":"bytes32","name":"sigS","type":"bytes32"},{"internalType":"uint8","name":"sigV","type":"uint8"}],"name":"executeMetaTransaction","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"itemId","type":"uint256"}],"name":"fetchBud","outputs":[{"components":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"},{"internalType":"bool","name":"_revealed","type":"bool"}],"internalType":"struct Budheads.Bud","name":"","type":"tuple"}],"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":"getCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrencyTokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getNonce","outputs":[{"internalType":"uint256","name":"nonce","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSaleState","outputs":[{"internalType":"bool","name":"saleStatus","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"isOperator","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"numberOfBuds","type":"uint256"},{"internalType":"uint256","name":"_salt","type":"uint256"}],"name":"mintToken","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":"string","name":"_newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_currencyToken","type":"address"}],"name":"setCurrencyTokenAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"uint256","name":"_decimals","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"state","type":"bool"}],"name":"setSaleState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"itemId","type":"uint256"},{"internalType":"string","name":"strain","type":"string"}],"name":"setTokenStrain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"components":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"},{"internalType":"bool","name":"_revealed","type":"bool"}],"internalType":"struct Budheads.Bud[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052611068600d55660eebe0b40e8000600e55600f805460ff19169055601180546001600160a01b031990811673a6fa4fb5f76172d178d61b04b0ecd319c5d1c0aa1791829055601280549091166001600160a01b03929092169190911790553480156200006f57600080fd5b5060405162003a5c38038062003a5c833981016040819052620000929162000396565b60405180604001604052806008815260200167427564686561647360c01b815250604051806040016040528060018152602001603160f81b815250818160405180604001604052806008815260200167427564686561647360c01b8152506040518060400160405280600381526020016208488960eb1b815250816000908051906020019062000124929190620002d3565b5080516200013a906001906020840190620002d3565b50505062000157620001516200020260201b60201c565b62000206565b6040518060800160405280604f815260200162003a0d604f9139805190602001208280519060200120828051906020012030620001996200025860201b60201c565b604051620001af9594939291906020016200047a565b60408051601f198184030181529190528051602090910120600b5550620001db9250849150506200025c565b601380546001600160a01b0319166001600160a01b0392909216919091179055506200052e565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b4690565b6200026662000202565b6001600160a01b031662000279620002c4565b6001600160a01b031614620002ab5760405162461bcd60e51b8152600401620002a290620004a6565b60405180910390fd5b8051620002c0906010906020840190620002d3565b5050565b6006546001600160a01b031690565b828054620002e190620004db565b90600052602060002090601f01602090048101928262000305576000855562000350565b82601f106200032057805160ff191683800117855562000350565b8280016001018555821562000350579182015b828111156200035057825182559160200191906001019062000333565b506200035e92915062000362565b5090565b5b808211156200035e576000815560010162000363565b80516001600160a01b03811681146200039157600080fd5b919050565b60008060408385031215620003a9578182fd5b82516001600160401b0380821115620003c0578384fd5b818501915085601f830112620003d4578384fd5b815181811115620003e957620003e962000518565b6040516020601f8301601f191682018101848111838210171562000411576200041162000518565b604052828252848301810189101562000428578687fd5b8693505b828410156200044b57848401810151828501820152928301926200042c565b828411156200045c57868184840101525b8196506200046c81890162000379565b955050505050509250929050565b948552602085019390935260408401919091526001600160a01b03166060830152608082015260a00190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600281046001821680620004f057607f821691505b602082108114156200051257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6134cf806200053e6000396000f3fe6080604052600436106102255760003560e01c80636c0360eb11610123578063a22cb465116100ab578063e46e99211161006f578063e46e992114610605578063e8a3d48514610632578063e985e9c514610647578063f2fde38b14610667578063f7d975771461068757610225565b8063a22cb46514610565578063ac8419eb14610585578063b88d4fde146105a5578063c4e37095146105c5578063c87b56dd146105e557610225565b80638462151c116100f25780638462151c146104e45780638ada066e146105115780638da5cb5b1461052657806395d89b411461053b57806398d5fdca1461055057610225565b80636c0360eb1461048557806370a082311461049a578063715018a6146104ba57806373774d27146104cf57610225565b806325bdb2a8116101b157806342966c681161017557806342966c68146103f05780634f6ccce71461041057806355f804b3146104305780636352211e146104505780636b2fa3741461047057610225565b806325bdb2a8146103665780632d0335ab1461037b5780632f745c591461039b5780633ccfd60b146103bb57806342842e0e146103d057610225565b80630c53c51c116101f85780630c53c51c146102d157806318160ddd146102e4578063233dadbd1461030657806323a36d2b1461032657806323b872dd1461034657610225565b806301ffc9a71461022a57806306fdde0314610260578063081812fc14610282578063095ea7b3146102af575b600080fd5b34801561023657600080fd5b5061024a610245366004612646565b6106a7565b60405161025791906129b9565b60405180910390f35b34801561026c57600080fd5b506102756106ba565b6040516102579190612a06565b34801561028e57600080fd5b506102a261029d366004612724565b61074d565b60405161025791906128b8565b3480156102bb57600080fd5b506102cf6102ca3660046125b3565b610799565b005b6102756102df36600461253a565b610831565b3480156102f057600080fd5b506102f96109e8565b604051610257919061318a565b34801561031257600080fd5b506102cf610321366004612754565b6109ee565b34801561033257600080fd5b506102cf6103413660046125dc565b610a52565b34801561035257600080fd5b506102cf610361366004612463565b610d92565b34801561037257600080fd5b5061024a610dca565b34801561038757600080fd5b506102f9610396366004612417565b610dd3565b3480156103a757600080fd5b506102f96103b63660046125b3565b610dee565b3480156103c757600080fd5b506102cf610e43565b3480156103dc57600080fd5b506102cf6103eb366004612463565b610fb4565b3480156103fc57600080fd5b506102cf61040b366004612724565b610fcf565b34801561041c57600080fd5b506102f961042b366004612724565b611002565b34801561043c57600080fd5b506102cf61044b36600461267e565b61105d565b34801561045c57600080fd5b506102a261046b366004612724565b6110af565b34801561047c57600080fd5b506102a26110e4565b34801561049157600080fd5b506102756110f3565b3480156104a657600080fd5b506102f96104b5366004612417565b611181565b3480156104c657600080fd5b506102cf6111c5565b3480156104db57600080fd5b506102a2611210565b3480156104f057600080fd5b506105046104ff366004612417565b61121f565b6040516102579190612959565b34801561051d57600080fd5b506102f9611338565b34801561053257600080fd5b506102a2611349565b34801561054757600080fd5b50610275611358565b34801561055c57600080fd5b506102f9611367565b34801561057157600080fd5b506102cf610580366004612504565b61136d565b34801561059157600080fd5b506102cf6105a0366004612417565b61143b565b3480156105b157600080fd5b506102cf6105c036600461249e565b61149c565b3480156105d157600080fd5b506102cf6105e036600461260e565b6114db565b3480156105f157600080fd5b50610275610600366004612724565b61152d565b34801561061157600080fd5b50610625610620366004612724565b611621565b6040516102579190613177565b34801561063e57600080fd5b506102756116fd565b34801561065357600080fd5b5061024a610662366004612431565b61171d565b34801561067357600080fd5b506102cf610682366004612417565b61175d565b34801561069357600080fd5b506102cf6106a2366004612799565b6117cb565b60006106b282611826565b90505b919050565b6060600080546106c990613373565b80601f01602080910402602001604051908101604052809291908181526020018280546106f590613373565b80156107425780601f1061071757610100808354040283529160200191610742565b820191906000526020600020905b81548152906001019060200180831161072557829003601f168201915b505050505090505b90565b60006107588261184b565b61077d5760405162461bcd60e51b815260040161077490612ec2565b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b60006107a4826110af565b9050806001600160a01b0316836001600160a01b031614156107d85760405162461bcd60e51b81526004016107749061301c565b806001600160a01b03166107ea611868565b6001600160a01b03161480610806575061080681610662611868565b6108225760405162461bcd60e51b815260040161077490612d6d565b61082c838361186c565b505050565b6060600061083e866118da565b90506000356001600160e01b031990811690821614156108705760405162461bcd60e51b815260040161077490612be7565b604080516060810182526001600160a01b0389166000818152600c6020908152908490205483528201529081018790526108ad88828888886118f6565b6108c95760405162461bcd60e51b815260040161077490612f8c565b6001600160a01b0388166000908152600c60205260409020546108ed9060016119a2565b6001600160a01b0389166000908152600c60209081526040808320939093559151909182913091610922918c918e9101612837565b60408051601f198184030181529082905261093c9161281b565b6000604051808303816000865af19150503d8060008114610979576040519150601f19603f3d011682016040523d82523d6000602084013e61097e565b606091505b5091509150816109a05760405162461bcd60e51b815260040161077490612b79565b7f5845892132946850460bff5a0083f71031bc5bf9aadcd40f1de79423eac9b10b8a338b6040516109d3939291906128cc565b60405180910390a19998505050505050505050565b60095490565b6109f6611868565b6001600160a01b0316610a07611349565b6001600160a01b031614610a2d5760405162461bcd60e51b815260040161077490612f0e565b6000828152601460209081526040909120825161082c926001909201918401906122f3565b600f5460ff16610a745760405162461bcd60e51b815260040161077490612e5d565b60008211610a945760405162461bcd60e51b815260040161077490612a19565b600d54610aa983610aa36109e8565b906119a2565b1115610ac75760405162461bcd60e51b815260040161077490612b04565b600082600e54610ad79190613311565b6012549091506000906001600160a01b03166370a08231610af66119ae565b6040518263ffffffff1660e01b8152600401610b1291906128b8565b60206040518083038186803b158015610b2a57600080fd5b505afa158015610b3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b62919061273c565b905080821115610b845760405162461bcd60e51b815260040161077490612c44565b6012546001600160a01b03166323b872dd610b9d6119ae565b30856040518463ffffffff1660e01b8152600401610bbd939291906128f8565b602060405180830381600087803b158015610bd757600080fd5b505af1158015610beb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0f919061262a565b610c1857600080fd5b60005b84811015610d8a57600d54610c336001610aa36109e8565b1115610c515760405162461bcd60e51b815260040161077490612b04565b610c6486610c5f6015611a0a565b611a0e565b601354604051633b46b2f960e01b81526000916001600160a01b031690633b46b2f990610c9590889060040161318a565b600060405180830381600087803b158015610caf57600080fd5b505af1158015610cc3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ceb91908101906126b1565b90506040518060600160405280610d026015611a0a565b81526020018281526020016000151581525060146000610d226015611a0a565b8152602080820192909252604001600020825181558282015180519192610d51926001850192909101906122f3565b50604091909101516002909101805460ff1916911515919091179055610d776015611a28565b5080610d82816133a8565b915050610c1b565b505050505050565b610da3610d9d611868565b82611a31565b610dbf5760405162461bcd60e51b81526004016107749061305d565b61082c838383611ab6565b600f5460ff1690565b6001600160a01b03166000908152600c602052604090205490565b6000610df983611181565b8210610e175760405162461bcd60e51b815260040161077490612a67565b506001600160a01b03821660009081526007602090815260408083208484529091529020545b92915050565b610e4b611868565b6001600160a01b0316610e5c611349565b6001600160a01b031614610e825760405162461bcd60e51b815260040161077490612f0e565b6012546040516370a0823160e01b81526000916001600160a01b0316906370a0823190610eb39030906004016128b8565b60206040518083038186803b158015610ecb57600080fd5b505afa158015610edf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f03919061273c565b905060008111610f255760405162461bcd60e51b81526004016107749061314a565b6012546001600160a01b03166323b872dd30610f3f611349565b846040518463ffffffff1660e01b8152600401610f5e939291906128f8565b602060405180830381600087803b158015610f7857600080fd5b505af1158015610f8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb0919061262a565b5050565b61082c8383836040518060200160405280600081525061149c565b610fda610d9d611868565b610ff65760405162461bcd60e51b8152600401610774906130fa565b610fff81611be3565b50565b600061100c6109e8565b821061102a5760405162461bcd60e51b8152600401610774906130ae565b6009828154811061104b57634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b611065611868565b6001600160a01b0316611076611349565b6001600160a01b03161461109c5760405162461bcd60e51b815260040161077490612f0e565b8051610fb09060109060208401906122f3565b6000818152600260205260408120546001600160a01b0316806106b25760405162461bcd60e51b815260040161077490612e14565b6012546001600160a01b031681565b6010805461110090613373565b80601f016020809104026020016040519081016040528092919081815260200182805461112c90613373565b80156111795780601f1061114e57610100808354040283529160200191611179565b820191906000526020600020905b81548152906001019060200180831161115c57829003601f168201915b505050505081565b60006001600160a01b0382166111a95760405162461bcd60e51b815260040161077490612dca565b506001600160a01b031660009081526003602052604090205490565b6111cd611868565b6001600160a01b03166111de611349565b6001600160a01b0316146112045760405162461bcd60e51b815260040161077490612f0e565b61120e6000611bec565b565b6012546001600160a01b031690565b6060600061122c83611181565b90508061126d576040805160008082526020820190925290611264565b611251612377565b8152602001906001900390816112495790505b509150506106b5565b60008167ffffffffffffffff81111561129657634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156112cf57816020015b6112bc612377565b8152602001906001900390816112b45790505b50905060005b82811015611328576112ea6106208683610dee565b82828151811061130a57634e487b7160e01b600052603260045260246000fd5b60200260200101819052508080611320906133a8565b9150506112d5565b5091506106b59050565b50919050565b60006113446015611a0a565b905090565b6006546001600160a01b031690565b6060600180546106c990613373565b600e5490565b611375611868565b6001600160a01b0316826001600160a01b031614156113a65760405162461bcd60e51b815260040161077490612cbf565b80600560006113b3611868565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff1916921515929092179091556113f7611868565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161142f91906129b9565b60405180910390a35050565b611443611868565b6001600160a01b0316611454611349565b6001600160a01b03161461147a5760405162461bcd60e51b815260040161077490612f0e565b601280546001600160a01b0319166001600160a01b0392909216919091179055565b6114ad6114a7611868565b83611a31565b6114c95760405162461bcd60e51b81526004016107749061305d565b6114d584848484611c3e565b50505050565b6114e3611868565b6001600160a01b03166114f4611349565b6001600160a01b03161461151a5760405162461bcd60e51b815260040161077490612f0e565b600f805460ff1916911515919091179055565b60606115388261184b565b6115545760405162461bcd60e51b815260040161077490612fcd565b6000828152601460205260408120600101805461157090613373565b80601f016020809104026020016040519081016040528092919081815260200182805461159c90613373565b80156115e95780601f106115be576101008083540402835291602001916115e9565b820191906000526020600020905b8154815290600101906020018083116115cc57829003601f168201915b505050505090506115f8611c71565b8160405160200161160a92919061286e565b604051602081830303815290604052915050919050565b611629612377565b6000601460008481526020019081526020016000206040518060600160405290816000820154815260200160018201805461166390613373565b80601f016020809104026020016040519081016040528092919081815260200182805461168f90613373565b80156116dc5780601f106116b1576101008083540402835291602001916116dc565b820191906000526020600020905b8154815290600101906020018083116116bf57829003601f168201915b50505091835250506002919091015460ff1615156020909101529392505050565b606060405180608001604052806043815260200161345760439139905090565b60006001600160a01b03821673ff7ca10af37178bdd056628ef42fd7f799fac77c141561174c57506001610e3d565b6117568383611c80565b9392505050565b611765611868565b6001600160a01b0316611776611349565b6001600160a01b03161461179c5760405162461bcd60e51b815260040161077490612f0e565b6001600160a01b0381166117c25760405162461bcd60e51b815260040161077490612b33565b610fff81611bec565b6117d3611868565b6001600160a01b03166117e4611349565b6001600160a01b03161461180a5760405162461bcd60e51b815260040161077490612f0e565b61181581600a613243565b61181f9083613311565b600e555050565b60006001600160e01b0319821663780e9d6360e01b14806106b257506106b282611cae565b6000908152600260205260409020546001600160a01b0316151590565b3390565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906118a1826110af565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008151600014156118ee575060006106b5565b506020015190565b600080600161190c61190788611cee565b611d4c565b8487876040516000815260200160405260405161192c94939291906129e8565b6020604051602081039080840390855afa15801561194e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166119815760405162461bcd60e51b815260040161077490612cf6565b866001600160a01b0316816001600160a01b03161491505095945050505050565b600061175682846131e5565b600033301415611a0557600080368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b0316915061074a9050565b503390565b5490565b610fb0828260405180602001604052806000815250611d68565b80546001019055565b6000611a3c8261184b565b611a585760405162461bcd60e51b815260040161077490612d21565b6000611a63836110af565b9050806001600160a01b0316846001600160a01b03161480611a9e5750836001600160a01b0316611a938461074d565b6001600160a01b0316145b80611aae5750611aae818561171d565b949350505050565b826001600160a01b0316611ac9826110af565b6001600160a01b031614611aef5760405162461bcd60e51b815260040161077490612f43565b6001600160a01b038216611b155760405162461bcd60e51b815260040161077490612c7b565b611b20838383611d9b565b611b2b60008261186c565b6001600160a01b0383166000908152600360205260408120805460019290611b54908490613330565b90915550506001600160a01b0382166000908152600360205260408120805460019290611b829084906131e5565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b610fff81611da6565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611c49848484611ab6565b611c5584848484611e4d565b6114d55760405162461bcd60e51b815260040161077490612ab2565b6060601080546106c990613373565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b60006001600160e01b031982166380ac58cd60e01b1480611cdf57506001600160e01b03198216635b5e139f60e01b145b806106b257506106b282611f68565b60006040518060800160405280604381526020016134146043913980516020918201208351848301516040808701518051908601209051611d2f95016129c4565b604051602081830303815290604052805190602001209050919050565b6000611d56611f81565b82604051602001611d2f92919061289d565b611d728383611f87565b611d7f6000848484611e4d565b61082c5760405162461bcd60e51b815260040161077490612ab2565b61082c838383612066565b6000611db1826110af565b9050611dbf81600084611d9b565b611dca60008361186c565b6001600160a01b0381166000908152600360205260408120805460019290611df3908490613330565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000611e61846001600160a01b03166120ef565b15611f5d57836001600160a01b031663150b7a02611e7d611868565b8786866040518563ffffffff1660e01b8152600401611e9f949392919061291c565b602060405180830381600087803b158015611eb957600080fd5b505af1925050508015611ee9575060408051601f3d908101601f19168201909252611ee691810190612662565b60015b611f43573d808015611f17576040519150601f19603f3d011682016040523d82523d6000602084013e611f1c565b606091505b508051611f3b5760405162461bcd60e51b815260040161077490612ab2565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611aae565b506001949350505050565b6001600160e01b031981166301ffc9a760e01b14919050565b600b5490565b6001600160a01b038216611fad5760405162461bcd60e51b815260040161077490612e8d565b611fb68161184b565b15611fd35760405162461bcd60e51b815260040161077490612bb0565b611fdf60008383611d9b565b6001600160a01b03821660009081526003602052604081208054600192906120089084906131e5565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b61207183838361082c565b6001600160a01b03831661208d57612088816120f5565b6120b0565b816001600160a01b0316836001600160a01b0316146120b0576120b08382612139565b6001600160a01b0382166120cc576120c7816121d6565b61082c565b826001600160a01b0316826001600160a01b03161461082c5761082c82826122af565b3b151590565b600980546000838152600a60205260408120829055600182018355919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0155565b6000600161214684611181565b6121509190613330565b6000838152600860205260409020549091508082146121a3576001600160a01b03841660009081526007602090815260408083208584528252808320548484528184208190558352600890915290208190555b5060009182526008602090815260408084208490556001600160a01b039094168352600781528383209183525290812055565b6009546000906121e890600190613330565b6000838152600a60205260408120546009805493945090928490811061221e57634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050806009838154811061224d57634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255828152600a9091526040808220849055858252812055600980548061229357634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b60006122ba83611181565b6001600160a01b039093166000908152600760209081526040808320868452825280832085905593825260089052919091209190915550565b8280546122ff90613373565b90600052602060002090601f0160209004810192826123215760008555612367565b82601f1061233a57805160ff1916838001178555612367565b82800160010185558215612367579182015b8281111561236757825182559160200191906001019061234c565b5061237392915061239a565b5090565b604051806060016040528060008152602001606081526020016000151581525090565b5b80821115612373576000815560010161239b565b80356001600160a01b03811681146106b557600080fd5b600082601f8301126123d6578081fd5b81356123e96123e4826131bd565b613193565b8181528460208386010111156123fd578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215612428578081fd5b611756826123af565b60008060408385031215612443578081fd5b61244c836123af565b915061245a602084016123af565b90509250929050565b600080600060608486031215612477578081fd5b612480846123af565b925061248e602085016123af565b9150604084013590509250925092565b600080600080608085870312156124b3578081fd5b6124bc856123af565b93506124ca602086016123af565b925060408501359150606085013567ffffffffffffffff8111156124ec578182fd5b6124f8878288016123c6565b91505092959194509250565b60008060408385031215612516578182fd5b61251f836123af565b9150602083013561252f816133ef565b809150509250929050565b600080600080600060a08688031215612551578081fd5b61255a866123af565b9450602086013567ffffffffffffffff811115612575578182fd5b612581888289016123c6565b9450506040860135925060608601359150608086013560ff811681146125a5578182fd5b809150509295509295909350565b600080604083850312156125c5578182fd5b6125ce836123af565b946020939093013593505050565b6000806000606084860312156125f0578283fd5b6125f9846123af565b95602085013595506040909401359392505050565b60006020828403121561261f578081fd5b8135611756816133ef565b60006020828403121561263b578081fd5b8151611756816133ef565b600060208284031215612657578081fd5b8135611756816133fd565b600060208284031215612673578081fd5b8151611756816133fd565b60006020828403121561268f578081fd5b813567ffffffffffffffff8111156126a5578182fd5b611aae848285016123c6565b6000602082840312156126c2578081fd5b815167ffffffffffffffff8111156126d8578182fd5b8201601f810184136126e8578182fd5b80516126f66123e4826131bd565b81815285602083850101111561270a578384fd5b61271b826020830160208601613347565b95945050505050565b600060208284031215612735578081fd5b5035919050565b60006020828403121561274d578081fd5b5051919050565b60008060408385031215612766578182fd5b82359150602083013567ffffffffffffffff811115612783578182fd5b61278f858286016123c6565b9150509250929050565b600080604083850312156127ab578182fd5b50508035926020909101359150565b600081518084526127d2816020860160208601613347565b601f01601f19169290920160200192915050565b60008151835260208201516060602085015261280560608501826127ba565b6040938401511515949093019390935250919050565b6000825161282d818460208701613347565b9190910192915050565b60008351612849818460208801613347565b60609390931b6bffffffffffffffffffffffff19169190920190815260140192915050565b60008351612880818460208801613347565b835190830190612894818360208801613347565b01949350505050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b0384811682528316602082015260606040820181905260009061271b908301846127ba565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061294f908301846127ba565b9695505050505050565b6000602080830181845280855180835260408601915060408482028701019250838701855b828110156129ac57603f1988860301845261299a8583516127e6565b9450928501929085019060010161297e565b5092979650505050505050565b901515815260200190565b93845260208401929092526001600160a01b03166040830152606082015260800190565b93845260ff9290921660208401526040830152606082015260800190565b60006020825261175660208301846127ba565b6020808252602e908201527f546865206e756d626572206f662062756473207065722073657368206d75737460408201526d206265206174206c65617374203160901b606082015260800190565b6020808252602b908201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560408201526a74206f6620626f756e647360a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526015908201527415d949dc99481bdd5d081bd988189d590b08189d59605a1b604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601c908201527f46756e6374696f6e2063616c6c206e6f74207375636365737366756c00000000604082015260600190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b6020808252603d908201527f66756e6374696f6e5369676e61747572652063616e206e6f74206265206f662060408201527f657865637574654d6574615472616e73616374696f6e206d6574686f64000000606082015260800190565b6020808252601d908201527f4e6f7420656e6f7567682045544820696e207468652072657365727665000000604082015260600190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b602080825260119082015270496e76616c6964207369676e617475726560781b604082015260600190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604082015269726f206164647265737360b01b606082015260800190565b60208082526029908201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460408201526832b73a103a37b5b2b760b91b606082015260800190565b6020808252601690820152755468652073616c65206973206e6f742061637469766560501b604082015260600190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526029908201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960408201526839903737ba1037bbb760b91b606082015260800190565b60208082526021908201527f5369676e657220616e64207369676e617475726520646f206e6f74206d6174636040820152600d60fb1b606082015260800190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602c908201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60408201526b7574206f6620626f756e647360a01b606082015260800190565b60208082526030908201527f4552433732314275726e61626c653a2063616c6c6572206973206e6f74206f7760408201526f1b995c881b9bdc88185c1c1c9bdd995960821b606082015260800190565b6020808252601390820152724e6f205745544820746f20776974686472617760681b604082015260600190565b60006020825261175660208301846127e6565b90815260200190565b60405181810167ffffffffffffffff811182821017156131b5576131b56133d9565b604052919050565b600067ffffffffffffffff8211156131d7576131d76133d9565b50601f01601f191660200190565b600082198211156131f8576131f86133c3565b500190565b80825b600180861161320f575061323a565b818704821115613221576132216133c3565b8086161561322e57918102915b9490941c938002613200565b94509492505050565b6000611756600019848460008261325c57506001611756565b8161326957506000611756565b816001811461327f5760028114613289576132b6565b6001915050611756565b60ff84111561329a5761329a6133c3565b6001841b9150848211156132b0576132b06133c3565b50611756565b5060208310610133831016604e8410600b84101617156132e9575081810a838111156132e4576132e46133c3565b611756565b6132f684848460016131fd565b808604821115613308576133086133c3565b02949350505050565b600081600019048311821515161561332b5761332b6133c3565b500290565b600082821015613342576133426133c3565b500390565b60005b8381101561336257818101518382015260200161334a565b838111156114d55750506000910152565b60028104600182168061338757607f821691505b6020821081141561133257634e487b7160e01b600052602260045260246000fd5b60006000198214156133bc576133bc6133c3565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114610fff57600080fd5b6001600160e01b031981168114610fff57600080fdfe4d6574615472616e73616374696f6e2875696e74323536206e6f6e63652c616464726573732066726f6d2c62797465732066756e6374696f6e5369676e61747572652968747470733a2f2f697066732e696f2f697066732f516d6339314d595036724c484e4d556b44764c3144333832794d7857755a773839767a6562536865363363593861a26469706673582212205d360f4f8234350c9a99f7d8812dbc94de7aa4d231703f3691a89356506f7b3964736f6c63430008000033454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c6164647265737320766572696679696e67436f6e74726163742c627974657333322073616c742900000000000000000000000000000000000000000000000000000000000000400000000000000000000000003cc859f401f75397687a1878028aaebf86af2d13000000000000000000000000000000000000000000000000000000000000001a687474703a2f2f6c6f63616c686f73743a353530302f6275642f000000000000

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

00000000000000000000000000000000000000000000000000000000000000400000000000000000000000003cc859f401f75397687a1878028aaebf86af2d13000000000000000000000000000000000000000000000000000000000000001a687474703a2f2f6c6f63616c686f73743a353530302f6275642f000000000000

-----Decoded View---------------
Arg [0] : _defaultBaseURI (string): http://localhost:5500/bud/
Arg [1] : _budheadsStrainFactory (address): 0x3cc859f401f75397687a1878028aaebf86af2d13

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [1] : 0000000000000000000000003cc859f401f75397687a1878028aaebf86af2d13
Arg [2] : 000000000000000000000000000000000000000000000000000000000000001a
Arg [3] : 687474703a2f2f6c6f63616c686f73743a353530302f6275642f000000000000


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading