Contract 0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db5

 

Contract Overview

Balance:
0 BNB

BNB Value:
$0.00

Token:
Txn Hash
Block
From
To
Value [Txn Fee]
0x3f6c04e15762977ee7d9a981ceeb6b9d1e2a639a0644871434791727d3c64f3584390932021-06-19 18:09:0344 mins ago0x9c030d313ebb721790d5734281f9d5a3a29ba7e3 IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.00012867
0x16346b12cae1752cfff49159472080900f11f04f06a0f3a351c17b8058af328e84388012021-06-19 17:54:2759 mins ago0x9c030d313ebb721790d5734281f9d5a3a29ba7e3 IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.00022467
0x7c7aaac56c0e85ca48712fba8dbbf33cc002d60575470a065ade9e924da3f5ba84132002021-06-18 20:19:1422 hrs 34 mins ago0xb749d79ad75205996b34918cfb6872f55f9213a8 IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.00012867
0x8dcbbff49c4e24db6d8c9bb09852c169601ebf1e50c4e94c1a2d6a959462dd6484087312021-06-18 16:34:291 day 2 hrs ago0x62045e4ca87ef92821aff7b29bd3e28a5c80903f IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.00012867
0xa4b8648ebc37a5cebd15cee31546729c43c4c2b2dea4e90d635fc40a31d4f03f84084682021-06-18 16:20:571 day 2 hrs ago0x62045e4ca87ef92821aff7b29bd3e28a5c80903f IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.00022467
0xa97aedd585609bde8c8eb9d867e8275913e9a55c2848a521552a34882d5decf084027172021-06-18 11:31:051 day 7 hrs ago0xe82c06290bce9e6db0f9716dc15ed0af247c7653 IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.00012867
0xa7f0accc1351a21a4b552e1391ecebd57f5dd74d94c06695982aa7699195ebc583954462021-06-18 5:25:121 day 13 hrs ago0x6dcf6ecff0f2ae1584b5e4ee6a2ecaacc16e7ee2 IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.00022467
0x44b09bdf4ee192c4d4073e4286ef0566459fe67a879218d4ceaf5747f57d50a083781532021-06-17 14:52:482 days 4 hrs ago0x36668cc81dcddd69ce681dd88ebf3f24a394510a IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.00022467
0x9a4f88506bf116cbf92cf73c3969f09ad13a1e726c075eb372d0991762adea3a83649502021-06-17 3:44:102 days 15 hrs ago0xb8cae1b33816f92559b0d082fe0724556e00fa32 IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.00022467
0xcf361882e79503b2b13ca6addb5255391d543e0b67f4b6a817b919613ca249b183449992021-06-16 11:01:303 days 7 hrs ago0x097b70cfe0007915249d31df96a5b582bab96d75 IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.000145515
0x3e7639a8b3ff8b68be537dc0f998466c8020e974c5106558a75e86afa836a50383386302021-06-16 5:40:383 days 13 hrs ago0xe956fac49aec0bc31ad255c42ba04f2e0c79a565 IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.00012867
0xa5b7eab7b6c746df4ab70c660140ceb637a31ad8f78ecc7c86f5c66a09bdaee283386152021-06-16 5:39:533 days 13 hrs ago0xe956fac49aec0bc31ad255c42ba04f2e0c79a565 IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.000145515
0x3aa3a1e12cfc037235466eea59fbdbe5ce94a823718406096bba6cd0b82418e383385942021-06-16 5:38:503 days 13 hrs ago0xe956fac49aec0bc31ad255c42ba04f2e0c79a565 IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.000145515
0x78f30607f6571b2f9f0613f9cb4545080642911e288c1e71267a2fd65cf8b68783359322021-06-16 3:24:143 days 15 hrs ago0x0c1442a542625173e9f472c330ee8d00ac012125 IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.0001114
0x39eac8b2aac64dd902168c3d68d780fb29dec1ef560fc9662e527bce97fcca9083279432021-06-15 20:40:513 days 22 hrs ago0x097b70cfe0007915249d31df96a5b582bab96d75 IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.000145515
0x065e7b6d3c7fdedecf7090c27a907b73cc801f62d9810ef163fbbdc8e107c98083152732021-06-15 9:56:414 days 8 hrs ago0x0c1442a542625173e9f472c330ee8d00ac012125 IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.0001114
0x0fc646cd36487aedfb249b6101df340049bda0c10237abc0e1fae64c9c2c47b683152562021-06-15 9:55:474 days 8 hrs ago0x0c1442a542625173e9f472c330ee8d00ac012125 IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.0001114
0xf01075aa63da05586836e79dff13ec2677af5d84af8d730acb8be8d6ef3b63d683083172021-06-15 4:04:034 days 14 hrs ago0xc9156f69dc83b73c99f04f008c5c2b88d9f14d8e IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.00022467
0xdaf336421dd89dca7322a3d4b1064f7958197687c452998db1787c12ec280d9082932562021-06-14 15:21:505 days 3 hrs ago0x75bb394f62c815925c9cf875af57962f6dca8d47 IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.000145515
0xfff90f60d59dc3931d1bb5c4d22cf69306adcd680d2f5785b75cde05dc5c4d9c82794022021-06-14 3:40:415 days 15 hrs ago0x5c8a72cc0548c73927559d29f3404e90d8eca76f IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.000269604
0x2e4911bf4e1e57c47ad4c8d5132764e6c50b3529dd37b526921a03b75cf100c382664062021-06-13 16:40:276 days 2 hrs ago0x03db04e56edddf7cb4ce8d6030168ce7af9e5d5c IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.00012867
0xf2de95ef37ca1876ed7889cabe13d558e35671ae34463f34e4f826e07c0dbad982306742021-06-12 10:39:527 days 8 hrs ago0x1762c3ea9fce6cce7b6b2a24e0e2b5f5c84d8fcb IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.00022467
0xc33245309eba0e613c43635f1b7c7bfe375649f866d722af2e34b7703a3e544682268312021-06-12 7:26:527 days 11 hrs ago0x7c50027bb6da667379e9f7f32f2d73249190d4d9 IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.00012867
0xfa5ca77f27bbf301ef59b620f4bdc4e3a611ebb708401c5db14a1617074a324681863522021-06-10 21:36:528 days 21 hrs ago0x8f79270ea81b7e6d622617a40b72138ace56a281 IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.00012867
0xa4e15ae56c78fadbde049bfa5392eb8ae82d6b834f851ee6fe53f75866f3c84d81862742021-06-10 21:32:588 days 21 hrs ago0x8f79270ea81b7e6d622617a40b72138ace56a281 IN  0x196546f21c30f1b4b5846ed6a1bd2f7c6c2f6db50 BNB0.000145515
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0xf9926d2b4f505921713446d33c71759fab790dbdec7797dd8cfc815311b11db568456352021-04-24 13:53:1556 days 5 hrs ago 0xdbea85ce8d2bffaa292e6def9b22a5daa40d716e  Contract Creation0 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StrainzNFT

Compiler Version
v0.8.2+commit.661d1103

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 24 : StrainzNFT.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./StrainzDNA.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "../StrainzMaster.sol";
import "../v1/IStrainzV1.sol";
import "./StrainMetadata.sol";

contract StrainzNFT is ERC721Enumerable, StrainzDNA, IStrainMetadata {


    using Counters for Counters.Counter;
    Counters.Counter private _tokenIdCounter;

    event Minted(uint tokenId);
    event Breed(uint parent1, uint parent2, uint child);
    event Composted(uint tokenId);


    uint public wateringPenaltyPerDay = 10; // %
    uint public growFactor = 255;
    uint public compostFactor = 100;
    uint public breedingCostFactor = 5;
    uint public breedFertilizerCost = 1000e18;


    mapping(uint => StrainMetadata) public strainData;

    StrainzMaster master;

    modifier onlyMaster {
        require(msg.sender == address(master));
        _;
    }

    constructor() ERC721("Strainz", "STRAINZ") {
        master = StrainzMaster(msg.sender);
    }
    function _baseURI() internal pure override returns (string memory) {
        return "https://api.v2.strainz.tech/strain/";
    }

    function mintTo(address receiver, string memory prefix, string memory postfix, uint dna, uint generation, uint growRate) private returns (uint) {
        _tokenIdCounter.increment();
        uint tokenId = _tokenIdCounter.current();
        _mint(receiver, tokenId);
        strainData[tokenId] = StrainMetadata(tokenId, prefix, postfix, dna, generation, growRate, block.timestamp, growRate * breedingCostFactor);
        emit Minted(tokenId);
        return tokenId;
    }

    // mint promotional unique strainz (will get custom images)
    function mintPromotion(address receiver, string memory prefix, string memory postfix, uint dna) public onlyMaster {
        mintTo(receiver, prefix, postfix, dna, 0, 255);
    }

    // breed two strainz
    function breed(uint _first, uint _second, bool breedFertilizer) public {
        require(ownerOf(_first) == msg.sender && ownerOf(_second) == msg.sender);
        StrainMetadata storage strain1 = strainData[_first];
        StrainMetadata storage strain2 = strainData[_second];

        uint strainzCost = (strain1.breedingCost + strain2.breedingCost) / 2;

        // Burn cost
        master.strainzToken().breedBurn(msg.sender, strainzCost);

        uint newStrainId = mixBreedMint(strain1, strain2, breedFertilizer);
        uint averageGrowRate = (strain1.growRate + strain2.growRate) / 2;
        // Burn fertilizer cost
        if (breedFertilizer && averageGrowRate >= 128) {
            master.seedzToken().breedBurn(msg.sender, breedFertilizerCost);
            master.strainzAccessory().breedAccessories(strain1.id, strain2.id, newStrainId);
        }


        emit Breed(strain1.id, strain2.id, newStrainId);

    }

    function mixBreedMint(StrainMetadata storage strain1, StrainMetadata storage strain2, bool breedFertilizer) private returns (uint) {
        uint newDNA = mixDNA(strain1.dna, strain2.dna);
        uint generation = max(strain1.generation, strain2.generation) + 1;

        bool mix = block.number % 2 == 0;

        strain1.breedingCost = strain1.breedingCost + strain1.growRate * breedingCostFactor;
        strain2.breedingCost = strain2.breedingCost + strain2.growRate * breedingCostFactor;

        return mintTo(
            msg.sender,
            mix ? strain1.prefix : strain2.prefix,
            mix ? strain2.postfix : strain1.postfix,
            newDNA, generation,
            mixStat(strain1.growRate, strain2.growRate, breedFertilizer)
        );
    }


    function compost(uint strainId) public {
        require(ownerOf(strainId) == msg.sender);
        StrainMetadata storage strain = strainData[strainId];
        master.strainzAccessory().detachAll(strainId);
        _burn(strainId);
        master.seedzToken().compostMint(msg.sender, strain.growRate * 1e18 * compostFactor / 100);
        emit Composted(strainId);
    }

    function getWateringCost(uint tokenId) public view returns (uint) {
        StrainMetadata storage strain = strainData[tokenId];
        uint currentGrowRate = getCurrentGrowRateForPlant(tokenId);

        uint diff = strain.growRate - currentGrowRate;

        uint amountOfPlants = balanceOf(ownerOf(tokenId));
        uint penalty = 1;
        if (amountOfPlants > 250) {
            penalty = 9;
        } else if (amountOfPlants > 200) {
            penalty = 8;
        } else if (amountOfPlants > 100) {
            penalty = 7;
        } else if (amountOfPlants > 50) {
            penalty = 5;
        } else if (amountOfPlants > 10) {
            penalty = 3;
        } else if (amountOfPlants > 5) {
            penalty = 2;
        }

        return penalty * diff;
    }

    function harvestAndWaterAll() public {
        uint numberOfTokens = balanceOf(msg.sender);
        require(numberOfTokens > 0);
        uint sum = 0;
        for (uint i = 0; i < numberOfTokens; i++) {
            StrainMetadata storage strain = strainData[tokenOfOwnerByIndex(msg.sender, i)];
            sum += harvestableAmount(strain.id) - getWateringCost(strain.id);
            strain.lastHarvest = block.timestamp;
        }
        master.strainzToken().harvestMint(msg.sender, sum);
    }


    function harvestableAmount(uint tokenId) public view returns (uint) {
        StrainMetadata storage strain = strainData[tokenId];
        uint timeSinceLastHarvest = block.timestamp - strain.lastHarvest;

        uint fertilizerBonus = master.seedzToken().getHarvestableFertilizerAmount(tokenId, strain.lastHarvest);

        uint accessoryBonus = master.strainzAccessory().getHarvestableAccessoryAmount(tokenId, timeSinceLastHarvest);

        uint accumulatedAmount = getAccumulatedHarvestAmount(strain);

        return accumulatedAmount + fertilizerBonus + accessoryBonus;
    }

    function getAccumulatedHarvestAmount(StrainMetadata storage strain) private view returns (uint) {
        uint wateringRange = min(block.timestamp - strain.lastHarvest, 9 days);

        uint growRate = strain.growRate * 1647058824;

        uint harvestableSum = (((20 * growRate * wateringRange * 1 days) - (growRate * wateringRange * wateringRange))) / (20 * 1 days * 1 days) / 1000000000;

        uint stagnationSum = 0;
        if (block.timestamp - strain.lastHarvest > 9 days) {
            stagnationSum = (block.timestamp - strain.lastHarvest + 9 days) * growRate * 10 / 100000000000 days;
        }
        return harvestableSum + stagnationSum;
    }

    function getCurrentGrowRateForPlant(uint plantId) public view returns (uint) {
        StrainMetadata storage strain = strainData[plantId];
        uint timeSinceLastWatering = min(block.timestamp - strain.lastHarvest, 9 days);
        return max(16, strain.growRate - (strain.growRate * wateringPenaltyPerDay * timeSinceLastWatering / 100 days));
    }


    function max(uint a, uint b) private pure returns (uint) {
        if (a > b) {
            return a;
        } else return b;
    }

    function min(uint a, uint b) private pure returns (uint) {
        if (a < b) {
            return a;
        } else return b;
    }

    function mixStat(uint rate1, uint rate2, bool breedFertilizer) private pure returns (uint) {
        uint average = (rate1 + rate2) / 2;
        return breedFertilizer ? min(average + 10, 255) : (average > (25 + 16) ? average - 25 : 16);
    }

    mapping(uint => bool) blacklist; // tokenId -> blacklisted
    mapping(address => bool) blacklistedUser; // address -> blacklisted

    function blacklistCheaters(uint[] calldata tokens, address[] calldata users) public onlyMaster {
        for (uint i = 0; i < tokens.length; i++) {
            blacklist[tokens[i]] = true;
        }
        for (uint i = 0; i < users.length; i++) {
            blacklistedUser[users[i]] = true;
        }
    }

    IStrainzV1 strainzV1NFT = IStrainzV1(0x59516426a8BB328d2F546B05421CBc047042e38f);
    IERC20 strainzV1Token = IERC20(0x7F1AddbB144363730a433A21ACDaB7b36F988252);

    function migrate(address user) public onlyMaster returns (uint) {


        uint numberOfStrainz = min(50, strainzV1NFT.balanceOf(user));

        uint sumToHarvest = 0;
        bool userBlacklisted = blacklistedUser[user];
        //migrate NFT
        if (numberOfStrainz > 0) {
            for (uint i = 0; i < numberOfStrainz; i++) {
                uint id = strainzV1NFT.tokenOfOwnerByIndex(user, 0); // always the first token, because it gets transferred
                StrainMetadata memory strain = getV1Strain(id);
                strainzV1NFT.transferFrom(user, address(this), id); // burn v1


                if (!blacklist[id] && !userBlacklisted) {
                    uint timeSinceLastHarvest = block.timestamp - strain.lastHarvest;
                    uint amountToHarvest = (strain.growRate * 255 * timeSinceLastHarvest) / 24 weeks;
                    // old formular
                    sumToHarvest += amountToHarvest;
                    uint migratedId = mintTo(user, strain.prefix, strain.postfix, strain.dna, strain.generation, max(16, strain.growRate));
                    strainData[migratedId].breedingCost = getNewBreedingCost(strain);

                    // accessories
                    bool hasJoint = getGene(strain.dna, 4) == 1;
                    bool hasSunglasses = getGene(strain.dna, 5) == 1;
                    bool hasEarring = getGene(strain.dna, 6) == 1;
                    if (hasJoint || hasSunglasses || hasEarring) {
                        master.strainzAccessory().migrateMint(migratedId, hasJoint, hasSunglasses, hasEarring);
                    }

                }
            }
        }


        uint amountOfStrainzV1Tokens = strainzV1Token.balanceOf(user);
        strainzV1Token.transferFrom(user, address(this), amountOfStrainzV1Tokens);
        sumToHarvest += amountOfStrainzV1Tokens;

        return userBlacklisted ? 0 : sumToHarvest;
    }

    function getV1Strain(uint strainId) private view returns (StrainMetadata memory) {
        (uint id,
        string memory prefix,
        string memory postfix,
        uint dna,
        uint generation,
        uint growRate, // 0-255
        uint lastHarvest,
        uint breedingCost) = strainzV1NFT.strainData(strainId);

        return StrainMetadata(id, prefix, postfix, dna, generation, max(16, growRate), lastHarvest, breedingCost);
    }

    function getNewBreedingCost(StrainMetadata memory strain) private pure returns (uint) {
        if (strain.breedingCost == 1000) {
            return strain.growRate * 5;
        } else if (strain.breedingCost == 2000) {
            return strain.growRate * 5 * 2;
        } else if (strain.breedingCost == 4000) {
            return strain.growRate * 5 * 3;
        } else if (strain.breedingCost == 8000) {
            return strain.growRate * 5 * 4;
        } else if (strain.breedingCost == 16000) {
            return strain.growRate * 5 * 5;
        } else if (strain.breedingCost == 32000) {
            return strain.growRate * 5 * 6;
        } else {
            return strain.growRate * 5 * 7;
        }
    }

    function setWateringPenalty(uint newPenalty) public onlyMaster {
        wateringPenaltyPerDay = newPenalty;
    }

    function setGrowFactor(uint newGrowFactor) public onlyMaster {
        growFactor = newGrowFactor;
    }

    function setCompostFactor(uint newCompostFactor) public onlyMaster {
        compostFactor = newCompostFactor;
    }

    function setBreedFertilizerCost(uint newBreedFertilizerCost) public onlyMaster {
        breedFertilizerCost = newBreedFertilizerCost;
    }

    function setBreedingCostFactor(uint newBreedingCostFactor) public onlyMaster {
        breedingCostFactor = newBreedingCostFactor;
    }

}

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

contract StrainzDNA {

    struct DNAData {
        uint potGene;
        uint headGene;
        uint bodyGene;
        uint faceGene;
        uint jointGene;
        uint sunglassesGene;
        uint earringGene;
        uint redGene;
        uint greenGene;
        uint blueGene;
    }

    function getGene(uint dna, uint n) public pure returns (uint) {
        return (dna / (10 ** (15 - n))) % 10;
    }


    function getBlueGene(uint dna) public pure returns (uint){
        return dna % 1000;
    }

    function getGreenGene(uint dna) public pure returns (uint) {
        return (dna % 1000000 - (dna % 1000)) / 1000;
    }

    function getRedGene(uint dna) public pure returns (uint) {
        return (dna % 1000000000 - (dna % 1000000)) / 1000000;
    }

    function mixDNA(uint dna1, uint dna2) public view returns (uint) {
        uint randomValue = random(256);
        DNAData memory data = DNAData(
            ((getGene(dna1, 0) * getGene(dna2, 0) * randomValue) % 7) + 1, // pot
            ((getGene(dna1, 1) * getGene(dna2, 1) * randomValue) % 7) + 1, // head
            ((getGene(dna1, 2) * getGene(dna2, 2) * randomValue) % 6) + 1, // body
            ((getGene(dna1, 3) * getGene(dna2, 3) * randomValue) % 5) + 1, // face
            0, // joint (not used)
            0, // sunglass (not used)
            0, // earring (not used)
            (getRedGene(dna1) * getRedGene(dna2) + randomValue) % 256, // red
            (getGreenGene(dna1) * getGreenGene(dna2) + randomValue) % 256, // green
            (getBlueGene(dna1) * getBlueGene(dna2) + randomValue) % 256 // blue
        );


        uint newDNA = ((10 ** 15) * data.potGene) + ((10 ** 14) * data.headGene) + ((10 ** 13) * data.bodyGene)
        + ((10 ** 12) * data.faceGene) + ((10 ** 11) * data.jointGene) + ((10 ** 10) * data.sunglassesGene) + ((10 ** 9) * data.earringGene)
        + ((10 ** 6) * data.redGene) + ((10 ** 3) * data.greenGene) + (data.blueGene % 256);

        return newDNA;
    }


    function clamp(uint value, uint min, uint max) public pure returns (uint) {
        return (value < min) ? min : (value > max) ? max : value;
    }

    function random(uint range) internal view returns (uint) {
        return uint(keccak256(abi.encodePacked(block.difficulty, block.timestamp))) % range;
    }

}

File 3 of 24 : 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 or decremented by one. 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;
        }
    }
}

File 4 of 24 : 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 5 of 24 : 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 6 of 24 : StrainzMaster.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./StrainzNFT/StrainzNFT.sol";
import "./StrainzTokens/StrainzToken.sol";
import "./StrainzTokens/SeedzToken.sol";
import "./StrainzAccessory.sol";
import "./StrainzMarketplace.sol";
import "@openzeppelin/contracts/access/Ownable.sol";


contract StrainzMaster is Ownable {

    StrainzNFT public strainzNFT = new StrainzNFT();
    StrainzToken public strainzToken = new StrainzToken();
    SeedzToken public seedzToken = new SeedzToken(msg.sender);
    StrainzAccessory public strainzAccessory = new StrainzAccessory(msg.sender);
    StrainzMarketplace public strainzMarketplace = new StrainzMarketplace();
    constructor() {

    }

    bool migrationActive = true;

    function migrate() public {
        require(migrationActive);
        uint amountToHarvest = strainzNFT.migrate(msg.sender);
        strainzToken.migrateMint(msg.sender, amountToHarvest);
    }

    function setMigration(bool active) public onlyOwner {
        migrationActive = active;
    }

    function setGrowFertilizerDetails(uint newCost, uint newBoost) public onlyOwner {
        seedzToken.setGrowFertilizerDetails(newCost, newBoost);
    }

    function setBreedFertilizerCost(uint newBreedFertilizerCost) public onlyOwner {
        strainzNFT.setBreedFertilizerCost(newBreedFertilizerCost);
    }
    function setBreedingCostFactor(uint newBreedingCostFactor) public onlyOwner {
        strainzNFT.setBreedingCostFactor(newBreedingCostFactor);
    }

    function createNewAccessory(uint bonus) public onlyOwner {
        strainzAccessory.createNewAccessory(bonus, msg.sender);
    }

    function setAccessoryBonus(uint accessoryType, uint bonus) public onlyOwner {
        strainzAccessory.setAccessoryBonus(accessoryType, bonus);
    }

    function setWateringPenalty(uint newPenalty) public onlyOwner {
        strainzNFT.setWateringPenalty(newPenalty);
    }

    function setGrowFactor(uint newGrowFactor) public onlyOwner {
        strainzNFT.setGrowFactor(newGrowFactor);
    }

    function setCompostFactor(uint newCompostFactor) public onlyOwner {
        strainzNFT.setCompostFactor(newCompostFactor);
    }

    function blacklistCheaters(uint[] calldata tokens, address[] calldata users) public onlyOwner {
        strainzNFT.blacklistCheaters(tokens, users);
    }

    function addSeedzPool(uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate) public onlyOwner {
        seedzToken.add(_allocPoint, _lpToken, _withUpdate);
    }
    function setSeedzPool(uint256 _pid, uint256 _allocPoint, bool _withUpdate) public onlyOwner {
        seedzToken.set(_pid, _allocPoint, _withUpdate);
    }

    function setSeedzPerBlock(uint _seedzPerBlock) public onlyOwner {
        seedzToken.setSeedzPerBlock(_seedzPerBlock);
    }
    function mintPromotion(address receiver, string memory prefix, string memory postfix, uint dna) public onlyOwner {
        strainzNFT.mintPromotion(receiver, prefix, postfix, dna);
    }

    function setMarketplaceFee(uint newFee) public onlyOwner {
        strainzMarketplace.setMarketplaceFee(newFee);
    }
}

File 7 of 24 : IStrainzV1.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "../StrainzNFT/StrainMetadata.sol";

abstract contract IStrainzV1 is IERC721Enumerable, IStrainMetadata {
    function harvestAll() public virtual;
    mapping(uint => StrainMetadata) public strainData;
}

File 8 of 24 : StrainMetadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IStrainMetadata {
    struct StrainMetadata {
        uint id;
        string prefix;
        string postfix;
        uint dna;
        uint generation;
        uint growRate; // 0-255
        uint lastHarvest;
        uint breedingCost;
    }
}

File 9 of 24 : ERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "./extensions/IERC721Enumerable.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}. 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 || ERC721.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 || ERC721.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(to).onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    // solhint-disable-next-line no-inline-assembly
                    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` 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 { }
}

File 10 of 24 : 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 11 of 24 : 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 12 of 24 : 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 13 of 24 : 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 14 of 24 : 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;
        // solhint-disable-next-line no-inline-assembly
        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");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 15 of 24 : 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) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 16 of 24 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant alphabet = "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] = alphabet[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

}

File 17 of 24 : 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 18 of 24 : 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 19 of 24 : StrainzToken.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;


import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "../StrainzNFT/StrainzNFT.sol";

contract StrainzToken is ERC20 {
    StrainzMaster master;


    constructor()  ERC20("Strainz", "STRAINZ") {
        master = StrainzMaster(msg.sender);
    }
    modifier onlyMaster() {
        require(msg.sender == address(master));
        _;
    }
    modifier onlyStrainzNFT {
        require(msg.sender == address(master.strainzNFT()));
        _;
    }

    modifier onlyMarketplace {
        require(msg.sender == address(master.strainzMarketplace()));
        _;
    }

    function decimals() public pure override returns(uint8) {
        return 0;
    }

    function harvestMint(address receiver, uint amount) public onlyStrainzNFT {
        _mint(receiver, amount);
    }

    function migrateMint(address receiver, uint amount) public onlyMaster {
        _mint(receiver, amount);
    }

    function breedBurn(address account, uint amount) public onlyStrainzNFT {
        _burn(account, amount);
    }

    function waterBurn(address account, uint amount) public onlyStrainzNFT {
        _burn(account, amount);
    }

    function marketPlaceBurn(address account, uint amount) public onlyMarketplace {
        _burn(account, amount);
    }

    function burn(uint amount) public {
        _burn(msg.sender, amount);
    }



}

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

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

import "../StrainzMaster.sol";

contract SeedzToken is ERC20 {

    StrainzMaster master;
    modifier onlyMaster() {
        require(msg.sender == address(master));
        _;
    }
    modifier onlyStrainzNFT() {
        require(msg.sender == address(master.strainzNFT()));
        _;
    }

    mapping(uint => uint) public lastTimeGrowFertilizerUsedOnPlant;

    event FertilizerBought(address buyer, uint plantId);

    uint public growFertilizerCost = 500e18;
    uint public growFertilizerBoost = 100;

    function buyGrowFertilizer(uint plantId) public {
        uint cost = growFertilizerCost;

        require(balanceOf(msg.sender) >= cost);
        require(lastTimeGrowFertilizerUsedOnPlant[plantId] + 1 weeks < block.timestamp);
        _burn(msg.sender, cost);
        lastTimeGrowFertilizerUsedOnPlant[plantId] = block.timestamp;
        emit FertilizerBought(msg.sender, plantId);
    }

    function setGrowFertilizerDetails(uint newCost, uint newBoost) public onlyMaster {
        growFertilizerCost = newCost;
        growFertilizerBoost = newBoost;
    }
    // LP Pools by Sushiswap: https://etherscan.io/address/0xc2edad668740f1aa35e4d8f227fb8e17dca888cd#code
    // Info of each user.
    struct UserInfo {
        uint256 amount;     // How many LP tokens the user has provided.
        uint256 rewardDebt; // Reward debt. See explanation below.
        //
        // We do some fancy math here. Basically, any point in time, the amount of SEEDZ
        // entitled to a user but is pending to be distributed is:
        //
        //   pending reward = (user.amount * pool.accSeedzPerShare) - user.rewardDebt
        //
        // Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens:
        //   1. The pool's `accSeedzPerShare` (and `lastRewardBlock`) gets updated.
        //   2. User receives the pending reward sent to his/her address.
        //   3. User's `amount` gets updated.
        //   4. User's `rewardDebt` gets updated.
    }

    // Info of each pool.
    struct PoolInfo {
        IERC20 lpToken;           // Address of LP token contract.
        uint256 allocPoint;       // How many allocation points assigned to this pool. SEEDZ to distribute per block.
        uint256 lastRewardBlock;  // Last block number that SEEDZ distribution occurs.
        uint256 accSeedzPerShare; // Accumulated SEEDZ per share, times 1e12. See below.
    }

    // SEEDZ tokens created per block.
    uint256 public seedzPerBlock = 5e17;

    function setSeedzPerBlock(uint _seedzPerBlock) public onlyMaster {
        massUpdatePools();
        seedzPerBlock = _seedzPerBlock;

    }

    // Info of each pool.
    PoolInfo[] public poolInfo;
    // Info of each user that stakes LP tokens.
    mapping(uint256 => mapping(address => UserInfo)) public userInfo;
    // Total allocation poitns. Must be the sum of all allocation points in all pools.
    uint256 public totalAllocPoint = 0;


    event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);


    constructor(address owner) ERC20("Seedz", "SEEDZ") {
        master = StrainzMaster(msg.sender);
        _mint(owner, 125000 * 1e18); // initial liquidity
    }

    function poolLength() external view returns (uint256) {
        return poolInfo.length;
    }

    // Add a new lp to the pool. Can only be called by the owner.
    // XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
    function add(uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate) public onlyMaster {
        if (_withUpdate) {
            massUpdatePools();
        }
        totalAllocPoint += _allocPoint;
        poolInfo.push(PoolInfo({
        lpToken : _lpToken,
        allocPoint : _allocPoint,
        lastRewardBlock : block.number,
        accSeedzPerShare : 0
        }));
    }

    // Update the given pool's SEEDZ allocation point. Can only be called by the owner.
    function set(uint256 _pid, uint256 _allocPoint, bool _withUpdate) public onlyMaster {
        if (_withUpdate) {
            massUpdatePools();
        }
        totalAllocPoint = totalAllocPoint - poolInfo[_pid].allocPoint + _allocPoint;
        poolInfo[_pid].allocPoint = _allocPoint;
    }

    // View function to see pending SEEDZ on frontend.
    function pendingSeedz(uint256 _pid, address _user) external view returns (uint256) {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        uint256 accSeedzPerShare = pool.accSeedzPerShare;
        uint256 lpSupply = pool.lpToken.balanceOf(address(this));
        if (block.number > pool.lastRewardBlock && lpSupply != 0) {
            uint256 multiplier = block.number - pool.lastRewardBlock;
            uint256 seedzReward = multiplier * seedzPerBlock * pool.allocPoint / totalAllocPoint;
            accSeedzPerShare += seedzReward * 1e12 / lpSupply;
        }
        return (user.amount * accSeedzPerShare / 1e12) - user.rewardDebt;
    }

    // Update reward vairables for all pools. Be careful of gas spending!
    function massUpdatePools() public {
        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            updatePool(pid);
        }
    }

    // Update reward variables of the given pool to be up-to-date.
    function updatePool(uint256 _pid) public {
        PoolInfo storage pool = poolInfo[_pid];
        if (block.number <= pool.lastRewardBlock) {
            return;
        }
        uint256 lpSupply = pool.lpToken.balanceOf(address(this));
        if (lpSupply == 0) {
            pool.lastRewardBlock = block.number;
            return;
        }
        uint256 multiplier = block.number - pool.lastRewardBlock;
        uint256 seedzReward = multiplier * seedzPerBlock * pool.allocPoint / totalAllocPoint;
        _mint(address(this), seedzReward);
        pool.accSeedzPerShare += seedzReward * 1e12 / lpSupply;
        pool.lastRewardBlock = block.number;
    }

    // Deposit LP tokens to MasterChef for SEEDZ allocation.
    function deposit(uint256 _pid, uint256 _amount) public {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        updatePool(_pid);
        if (user.amount > 0) {
            uint256 pending = (user.amount * pool.accSeedzPerShare / 1e12) - user.rewardDebt;
            safeSeedzTransfer(msg.sender, pending);
        }
        pool.lpToken.transferFrom(address(msg.sender), address(this), _amount);
        user.amount += _amount;
        user.rewardDebt = user.amount * pool.accSeedzPerShare / 1e12;
        emit Deposit(msg.sender, _pid, _amount);
    }

    // Withdraw LP tokens from MasterChef.
    function withdraw(uint256 _pid, uint256 _amount) public {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        require(user.amount >= _amount, "withdraw: not good");
        updatePool(_pid);
        uint256 pending = (user.amount * pool.accSeedzPerShare / 1e12) - user.rewardDebt;
        safeSeedzTransfer(msg.sender, pending);
        user.amount -= _amount;
        user.rewardDebt = user.amount * pool.accSeedzPerShare / 1e12;

        pool.lpToken.transfer(address(msg.sender), _amount);

        emit Withdraw(msg.sender, _pid, _amount);
    }

    // Withdraw without caring about rewards. EMERGENCY ONLY.
    function emergencyWithdraw(uint256 _pid) public {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        uint amount = user.amount;
        user.amount = 0;
        user.rewardDebt = 0;
        pool.lpToken.transfer(address(msg.sender), amount);
        emit EmergencyWithdraw(msg.sender, _pid, amount);
    }

    // Safe SEEDZ transfer function, just in case if rounding error causes pool to not have enough SEEDZ.
    function safeSeedzTransfer(address _to, uint256 _amount) internal {
        uint256 seedzBal = balanceOf(address(this));
        if (_amount > seedzBal) {
            _transfer(address(this), _to, seedzBal);
        } else {
            _transfer(address(this), _to, _amount);
        }
    }


    function compostMint(address receiver, uint amount) public onlyStrainzNFT {
        _mint(receiver, amount);
    }

    function getHarvestableFertilizerAmount(uint strainId, uint lastHarvest) public view returns (uint) {
        uint fertilizerBonus = 0;
        uint fertilizerAttachTime = lastTimeGrowFertilizerUsedOnPlant[strainId];
        if (fertilizerAttachTime > 0) {
            uint start = max(fertilizerAttachTime, lastHarvest);

            uint end = min(start + 1 weeks, block.timestamp);

            fertilizerBonus = (end - start) * growFertilizerBoost / 1 days;
        }
        return fertilizerBonus;
    }

    function breedBurn(address account, uint amount) public onlyStrainzNFT {
        _burn(account, amount);
    }


    function max(uint a, uint b) private pure returns (uint) {
        if (a > b) {
            return a;
        } else return b;
    }

    function min(uint a, uint b) private pure returns (uint) {
        if (a < b) {
            return a;
        } else return b;
    }


    function decimals() public pure override returns (uint8) {
        return 18;
    }

}

File 21 of 24 : StrainzAccessory.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "./StrainzMaster.sol";


contract StrainzAccessory is ERC721Enumerable, IERC721Receiver {
    using Counters for Counters.Counter;
    Counters.Counter private _tokenIdCounter;
    // accessoryId -> accessoryType (Joint, Sunglasses, Earring, ...)
    mapping(uint => uint) public accessoryTypeByTokenId;
    // accessoryId -> time
    mapping(uint => uint) public timeOfLastAttachment;

    // strainzNFT -> tokenIds
    mapping(uint => uint[]) public accessoriesByStrainId;
    function getAccessoriesByStrainId(uint strainId) public view returns (uint[] memory) {
        return accessoriesByStrainId[strainId];
    }


    uint numberOfAccessoryTypes = 0;
    mapping(uint => uint) public growBonusForType;

    event AccessoryAttached(uint accessoryId, uint strainId);

    StrainzMaster master;
    modifier onlyMaster {
        require(msg.sender == address(master));
        _;
    }

    modifier onlyStrainzNFT {
        require(msg.sender == address(master.strainzNFT()));
        _;
    }

    constructor(address owner) ERC721("Strainz Accessory", "ACCESSORY") {
        master = StrainzMaster(msg.sender);
        createNewAccessory(10, owner);
        createNewAccessory(25, owner);
        createNewAccessory(50, owner);
    }

    // creates new accessory (breeding)
    function mintAccessory(uint typeId, uint strainId) private {
        uint accessoryId = mint(typeId, address(this));
        accessoriesByStrainId[strainId].push(accessoryId);
        timeOfLastAttachment[accessoryId] = block.timestamp;
    }

    // creates new accessory (migration)
    function migrateMint(uint strainId, bool hasJoint, bool hasSunglasses, bool hasEarring) public onlyStrainzNFT {
        if (hasJoint) {
            mintAccessory(3, strainId);
        }
        if (hasSunglasses) {
            mintAccessory(2, strainId);
        }
        if (hasEarring) {
            mintAccessory(1, strainId);
        }

    }

    // initial accessories
    function mint(uint typeId, address receiver) private returns (uint){
        require(typeId <= numberOfAccessoryTypes && typeId > 0);
        _tokenIdCounter.increment();
        uint accessoryId = _tokenIdCounter.current();
        _mint(receiver, accessoryId);
        accessoryTypeByTokenId[accessoryId] = typeId;
        return accessoryId;
    }

    // attach accessory on plant
    function attachAccessory(uint accessoryId, uint strainId) public {
        require(ownerOf(accessoryId) == msg.sender);
        require(master.strainzNFT().ownerOf(strainId) == msg.sender);
        // no double accessories
        require(!sameTypeAlreadyAttached(accessoriesByStrainId[strainId], accessoryTypeByTokenId[accessoryId]));

        transferFrom(msg.sender, address(this), accessoryId);
        accessoriesByStrainId[strainId].push(accessoryId);
        timeOfLastAttachment[accessoryId] = block.timestamp;
        emit AccessoryAttached(accessoryId, strainId);
    }

    // detach accessory (compost)
    function detachAccessory(uint accessoryId, uint strainId) private {
        uint[] storage accessories = accessoriesByStrainId[strainId];
        int index = indexOf(accessories, accessoryId);
        require(index >= 0);
        remove(accessories, uint(index));
        _transfer(address(this), master.strainzNFT().ownerOf(strainId), accessoryId);
    }

    function getHarvestableAccessoryAmount(uint strainId, uint timeSinceLastHarvest) public view returns (uint) {
        uint[] memory accessoryIds = getAccessoriesByStrainId(strainId);

        uint accessoryBonus = 0;
        for (uint i = 0; i < accessoryIds.length; i++) {
            uint accessoryType = accessoryTypeByTokenId[accessoryIds[i]];
            uint boost = growBonusForType[accessoryType];
            uint timeOfAttachment = timeOfLastAttachment[accessoryIds[i]];
            if (timeOfAttachment == 0) {
                continue;
            }
            uint attachTime = min(block.timestamp - timeOfAttachment, timeSinceLastHarvest);

            accessoryBonus += attachTime * boost / 1 days;
        }
        return accessoryBonus;
    }


    // detach all (compost)
    function detachAll(uint strainId) public onlyStrainzNFT {
        uint[] memory accessoryIds = accessoriesByStrainId[strainId];
        for (uint i = 0; i < accessoryIds.length; i++) {
            detachAccessory(accessoryIds[i], strainId);
        }
    }


    function sameTypeAlreadyAttached(uint[] storage array, uint newType) private view returns (bool) {
        for (uint i = 0; i < array.length; i++) {
            uint existingType = accessoryTypeByTokenId[array[i]];
            if (existingType == newType) {
                return true;
            }
        }
        return false;
    }

    // generates accessories based on parents/fertilizer
    function breedAccessories(uint strain1Id, uint strain2Id, uint newStrainId) public onlyStrainzNFT {
        uint[] storage strain1Accessories = accessoriesByStrainId[strain1Id];
        uint[] storage strain2Accessories = accessoriesByStrainId[strain2Id];

        for (uint i = 1; i <= numberOfAccessoryTypes; i++) {
            bool hasParent1 = sameTypeAlreadyAttached(strain1Accessories, i);
            bool hasParent2 = sameTypeAlreadyAttached(strain2Accessories, i);
            if (hasParent1 && hasParent2){
                mintAccessory(i, newStrainId);
            }

        }

    }

    function createNewAccessory(uint bonus, address owner) public onlyMaster {
        require(numberOfAccessoryTypes < 10);
        numberOfAccessoryTypes++;
        growBonusForType[numberOfAccessoryTypes] = bonus;
        for (uint i = 0; i < 20; i++) {
            mint(numberOfAccessoryTypes, owner);
        }
    }

    function setAccessoryBonus(uint accessoryType, uint bonus) public onlyMaster {
        growBonusForType[accessoryType] = bonus;
    }


    function max(uint a, uint b) private pure returns (uint) {
        if (a > b) {
            return a;
        } else return b;
    }

    function min(uint a, uint b) private pure returns (uint) {
        if (a < b) {
            return a;
        } else return b;
    }

    function remove(uint[] storage array, uint index) private {
        if (index >= array.length) {
            return;
        }
        array[index] = array[array.length - 1];
        array.pop();
    }

    function indexOf(uint[] storage array, uint tokenId) private view returns (int) {
        for (uint i = 0; i < array.length; i++) {
            if (array[i] == tokenId) {
                return int(i);
            }
        }
        return - 1;
    }

    bytes4 constant ERC721_RECEIVED = 0xf0b9e5ba;

    function onERC721Received(address, address, uint256, bytes calldata) public pure override returns (bytes4) {
        return ERC721_RECEIVED;
    }
}

File 22 of 24 : StrainzMarketplace.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "./StrainzTokens/StrainzToken.sol";
import "./StrainzMaster.sol";

contract StrainzMarketplace is IERC721Receiver {
    using Counters for Counters.Counter;
    Counters.Counter private _tradeCounter;
    enum TradeStatus {
        Open, Closed, Cancelled
    }
    struct ERC721Trade {
        uint id;
        address poster;
        address nftContractAddress;
        uint tokenId;
        uint strainzTokenPrice;
        TradeStatus status;
        address buyer;
    }

    event ERC721TradeStatusChange(uint tradeId, TradeStatus status);

    mapping(uint => ERC721Trade) public erc721Trades;
    uint public marketplaceFee = 10;

    StrainzMaster master;
    modifier onlyMaster {
        require(msg.sender == address(master));
        _;
    }
    constructor() {
        master = StrainzMaster(msg.sender);
    }

    function setMarketplaceFee(uint newFee) public onlyMaster {
        marketplaceFee = newFee;
    }

    function getTradeCount() public view returns (uint) {
        return _tradeCounter.current();
    }

    function openERC721Trade(address nftContractAddress, uint tokenId, uint price) public {
        IERC721 nftContract = IERC721(nftContractAddress);
        require(nftContract.ownerOf(tokenId) == msg.sender);
        _tradeCounter.increment();
        nftContract.transferFrom(msg.sender, address(this), tokenId);
        uint id = _tradeCounter.current();
        erc721Trades[id] = ERC721Trade(id, msg.sender, nftContractAddress, tokenId, price, TradeStatus.Open, address(0));

        emit ERC721TradeStatusChange(id, TradeStatus.Open);
    }

    function executeERC721Trade(uint tradeId) public {
        ERC721Trade memory trade = erc721Trades[tradeId];
        require(trade.status == TradeStatus.Open);
        uint marketPlaceShare = trade.strainzTokenPrice * marketplaceFee / 100;

        master.strainzToken().marketPlaceBurn(msg.sender, marketPlaceShare);

        master.strainzToken().transferFrom(msg.sender, trade.poster, trade.strainzTokenPrice - marketPlaceShare);
        IERC721 nftContract = IERC721(trade.nftContractAddress);
        nftContract.safeTransferFrom(address(this), msg.sender, trade.tokenId);

        erc721Trades[tradeId].status = TradeStatus.Closed;
        erc721Trades[tradeId].buyer = msg.sender;
        emit ERC721TradeStatusChange(tradeId, TradeStatus.Closed);
    }

    function cancelERC721Trade(uint tradeId) public {
        ERC721Trade memory trade = erc721Trades[tradeId];
        require(msg.sender == trade.poster);
        require(trade.status == TradeStatus.Open);
        IERC721 nftContract = IERC721(trade.nftContractAddress);
        nftContract.transferFrom(address(this), trade.poster, trade.tokenId);

        erc721Trades[tradeId].status = TradeStatus.Cancelled;
        emit ERC721TradeStatusChange(tradeId, TradeStatus.Cancelled);
    }


    bytes4 constant ERC721_RECEIVED = 0xf0b9e5ba;

    function onERC721Received(address, address, uint256, bytes calldata) public pure override returns (bytes4) {
        return ERC721_RECEIVED;
    }


}

File 23 of 24 : 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 () {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), 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 {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 24 of 24 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20 {
    mapping (address => uint256) private _balances;

    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The defaut value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overloaded;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual returns (uint8) {
        return 18;
    }

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

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        _approve(sender, _msgSender(), currentAllowance - amount);

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        _approve(_msgSender(), spender, currentAllowance - subtractedValue);

        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        _balances[sender] = senderBalance - amount;
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        _balances[account] = accountBalance - amount;
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens 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 amount) internal virtual { }
}

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

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"parent1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"parent2","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"child","type":"uint256"}],"name":"Breed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Composted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Minted","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":[{"internalType":"uint256[]","name":"tokens","type":"uint256[]"},{"internalType":"address[]","name":"users","type":"address[]"}],"name":"blacklistCheaters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_first","type":"uint256"},{"internalType":"uint256","name":"_second","type":"uint256"},{"internalType":"bool","name":"breedFertilizer","type":"bool"}],"name":"breed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"breedFertilizerCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"breedingCostFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"clamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"strainId","type":"uint256"}],"name":"compost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"compostFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dna","type":"uint256"}],"name":"getBlueGene","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"plantId","type":"uint256"}],"name":"getCurrentGrowRateForPlant","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dna","type":"uint256"},{"internalType":"uint256","name":"n","type":"uint256"}],"name":"getGene","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"dna","type":"uint256"}],"name":"getGreenGene","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"dna","type":"uint256"}],"name":"getRedGene","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getWateringCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"growFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"harvestAndWaterAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"harvestableAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"migrate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"string","name":"prefix","type":"string"},{"internalType":"string","name":"postfix","type":"string"},{"internalType":"uint256","name":"dna","type":"uint256"}],"name":"mintPromotion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"dna1","type":"uint256"},{"internalType":"uint256","name":"dna2","type":"uint256"}],"name":"mixDNA","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newBreedFertilizerCost","type":"uint256"}],"name":"setBreedFertilizerCost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newBreedingCostFactor","type":"uint256"}],"name":"setBreedingCostFactor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newCompostFactor","type":"uint256"}],"name":"setCompostFactor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newGrowFactor","type":"uint256"}],"name":"setGrowFactor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPenalty","type":"uint256"}],"name":"setWateringPenalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"strainData","outputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"string","name":"prefix","type":"string"},{"internalType":"string","name":"postfix","type":"string"},{"internalType":"uint256","name":"dna","type":"uint256"},{"internalType":"uint256","name":"generation","type":"uint256"},{"internalType":"uint256","name":"growRate","type":"uint256"},{"internalType":"uint256","name":"lastHarvest","type":"uint256"},{"internalType":"uint256","name":"breedingCost","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wateringPenaltyPerDay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

6080604052600a600b5560ff600c556064600d556005600e55683635c9adc5dea00000600f55601480546001600160a01b03199081167359516426a8bb328d2f546b05421cbc047042e38f1790915560158054909116737f1addbb144363730a433a21acdab7b36f9882521790553480156200007a57600080fd5b506040518060400160405280600781526020016629ba3930b4b73d60c91b8152506040518060400160405280600781526020016629aa2920a4a72d60c91b8152508160009080519060200190620000d392919062000104565b508051620000e990600190602084019062000104565b5050601180546001600160a01b0319163317905550620001e7565b8280546200011290620001aa565b90600052602060002090601f01602090048101928262000136576000855562000181565b82601f106200015157805160ff191683800117855562000181565b8280016001018555821562000181579182015b828111156200018157825182559160200191906001019062000164565b506200018f92915062000193565b5090565b5b808211156200018f576000815560010162000194565b600281046001821680620001bf57607f821691505b60208210811415620001e157634e487b7160e01b600052602260045260246000fd5b50919050565b61432180620001f76000396000f3fe608060405234801561001057600080fd5b50600436106102de5760003560e01c80635b6988cb11610186578063a0f26c69116100e3578063ce5494bb11610097578063e1bb725711610071578063e1bb7257146105dc578063e985e9c5146105e5578063fb3576fa14610621576102de565b8063ce5494bb1461059a578063df9eaecb146105ad578063e14285bb146105b5576102de565b8063a2f6031f116100c8578063a2f6031f14610561578063b88d4fde14610574578063c87b56dd14610587576102de565b8063a0f26c691461053b578063a22cb4651461054e576102de565b80636cf683da1161013a578063714cb50f1161011f578063714cb50f1461050d57806395d89b41146105205780639e42244714610528576102de565b80636cf683da146104e757806370a08231146104fa576102de565b8063629b7d731161016b578063629b7d73146104ae5780636352211e146104c1578063663a2d6d146104d4576102de565b80635b6988cb146104885780636145dc171461049b576102de565b806320603fed1161023f5780632f745c59116101f357806342842e0e116101cd57806342842e0e1461044f5780634f6ccce71461046257806354314d7c14610475576102de565b80632f745c59146104165780633538339f14610429578063410b49d41461043c576102de565b806323b872dd1161022457806323b872dd146103e75780632883cc1f146103fa5780632a8757bf1461040d576102de565b806320603fed146103c157806322fcdcf7146103d4576102de565b8063095ea7b3116102965780631424494d1161027b5780631424494d1461039357806316ed2ec0146103a657806318160ddd146103b9576102de565b8063095ea7b314610375578063130223941461038a576102de565b806304976ba6116102c757806304976ba61461032257806306fdde0314610335578063081812fc1461034a576102de565b806301ffc9a7146102e3578063037e37251461030b575b600080fd5b6102f66102f1366004613d48565b61062a565b60405190151581526020015b60405180910390f35b610314600c5481565b604051908152602001610302565b610314610330366004613d9c565b610670565b61033d6106ea565b6040516103029190613f78565b61035d610358366004613d9c565b61077c565b6040516001600160a01b039091168152602001610302565b610388610383366004613c98565b610816565b005b610314600e5481565b6103886103a1366004613d9c565b610948565b6103886103b4366004613d9c565b610bd0565b600854610314565b6103146103cf366004613d9c565b610bec565b6103886103e2366004613e88565b610ca3565b6103886103f5366004613b33565b61108d565b610388610408366004613d9c565b611114565b610314600f5481565b610314610424366004613c98565b611130565b610314610437366004613d9c565b6111db565b61038861044a366004613c1d565b6111e9565b61038861045d366004613b33565b611217565b610314610470366004613d9c565b611232565b610314610483366004613d9c565b6112e4565b610388610496366004613d9c565b611314565b6103886104a9366004613d9c565b611330565b6103146104bc366004613e67565b61134c565b61035d6104cf366004613d9c565b611381565b6103886104e2366004613d9c565b61140c565b6103146104f5366004613e67565b611428565b610314610508366004613adf565b61174b565b61031461051b366004613d9c565b6117e5565b61033d611a60565b610314610536366004613ec0565b611a6f565b610388610549366004613cc3565b611a94565b61038861055c366004613bf0565b611b9c565b61031461056f366004613d9c565b611c6e565b610388610582366004613b73565b611c8c565b61033d610595366004613d9c565b611d1a565b6103146105a8366004613adf565b611e02565b61038861236a565b6105c86105c3366004613d9c565b612500565b604051610302989796959493929190613f8b565b610314600b5481565b6102f66105f3366004613afb565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b610314600d5481565b60006001600160e01b031982167f780e9d63000000000000000000000000000000000000000000000000000000001480610668575061066882612651565b90505b919050565b60008181526010602052604081206006810154829061069c90610693904261419d565b620bdd806126ec565b90506106e260106283d60083600b5486600501546106ba919061417e565b6106c4919061417e565b6106ce9190614056565b84600501546106dd919061419d565b612704565b949350505050565b6060600080546106f9906141e0565b80601f0160208091040260200160405190810160405280929190818152602001828054610725906141e0565b80156107725780601f1061074757610100808354040283529160200191610772565b820191906000526020600020905b81548152906001019060200180831161075557829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b03166107fa5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b600061082182611381565b9050806001600160a01b0316836001600160a01b031614156108ab5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084016107f1565b336001600160a01b03821614806108c757506108c781336105f3565b6109395760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016107f1565b6109438383612715565b505050565b3361095282611381565b6001600160a01b03161461096557600080fd5b60008181526010602090815260409182902060115483517fdaf585b2000000000000000000000000000000000000000000000000000000008152935191936001600160a01b039091169263daf585b292600480840193829003018186803b1580156109cf57600080fd5b505afa1580156109e3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a079190613d80565b6001600160a01b0316639d0cd89e836040518263ffffffff1660e01b8152600401610a3491815260200190565b600060405180830381600087803b158015610a4e57600080fd5b505af1158015610a62573d6000803e3d6000fd5b50505050610a6f82612790565b601160009054906101000a90046001600160a01b03166001600160a01b03166355cc86276040518163ffffffff1660e01b815260040160206040518083038186803b158015610abd57600080fd5b505afa158015610ad1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610af59190613d80565b6001600160a01b03166342c304b5336064600d548560050154670de0b6b3a7640000610b21919061417e565b610b2b919061417e565b610b359190614056565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b158015610b7b57600080fd5b505af1158015610b8f573d6000803e3d6000fd5b505050507f30f6ee1c7b8eb7349c887acbbbd691fc92bd38eacc6341de20458431525e610c82604051610bc491815260200190565b60405180910390a15050565b6011546001600160a01b03163314610be757600080fd5b600d55565b600081815260106020526040812081610c0484610670565b90506000818360050154610c18919061419d565b90506000610c2861050887611381565b9050600160fa821115610c3d57506009610c8e565b60c8821115610c4e57506008610c8e565b6064821115610c5f57506007610c8e565b6032821115610c7057506005610c8e565b600a821115610c8157506003610c8e565b6005821115610c8e575060025b610c98838261417e565b979650505050505050565b33610cad84611381565b6001600160a01b0316148015610cd3575033610cc883611381565b6001600160a01b0316145b610cdc57600080fd5b6000838152601060205260408082208483529082206007808201549083015492939192600291610d0b9161403e565b610d159190614056565b9050601160009054906101000a90046001600160a01b03166001600160a01b031663fe43e58d6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d6557600080fd5b505afa158015610d79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9d9190613d80565b604051630fa4b11160e01b8152336004820152602481018390526001600160a01b039190911690630fa4b11190604401600060405180830381600087803b158015610de757600080fd5b505af1158015610dfb573d6000803e3d6000fd5b505050506000610e0c848487612844565b90506000600284600501548660050154610e26919061403e565b610e309190614056565b9050858015610e40575060808110155b1561103e57601160009054906101000a90046001600160a01b03166001600160a01b03166355cc86276040518163ffffffff1660e01b815260040160206040518083038186803b158015610e9357600080fd5b505afa158015610ea7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecb9190613d80565b600f54604051630fa4b11160e01b815233600482015260248101919091526001600160a01b039190911690630fa4b11190604401600060405180830381600087803b158015610f1957600080fd5b505af1158015610f2d573d6000803e3d6000fd5b50505050601160009054906101000a90046001600160a01b03166001600160a01b031663daf585b26040518163ffffffff1660e01b815260040160206040518083038186803b158015610f7f57600080fd5b505afa158015610f93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb79190613d80565b855485546040517f2b6d06a400000000000000000000000000000000000000000000000000000000815260048101929092526024820152604481018490526001600160a01b039190911690632b6d06a490606401600060405180830381600087803b15801561102557600080fd5b505af1158015611039573d6000803e3d6000fd5b505050505b8454845460408051928352602083019190915281018390527f9ca383290f66cf05e07fed022366cb0e56f67485387cbc0a5911e8c6fc8045539060600160405180910390a15050505050505050565b6110973382612a29565b6111095760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f76656400000000000000000000000000000060648201526084016107f1565b610943838383612b1c565b6011546001600160a01b0316331461112b57600080fd5b600f55565b600061113b8361174b565b82106111af5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e647300000000000000000000000000000000000000000060648201526084016107f1565b506001600160a01b03821660009081526006602090815260408083208484529091529020545b92915050565b60006106686103e883614236565b6011546001600160a01b0316331461120057600080fd5b61121084848484600060ff612d01565b5050505050565b61094383838360405180602001604052806000815250611c8c565b600061123d60085490565b82106112b15760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e6473000000000000000000000000000000000000000060648201526084016107f1565b600882815481106112d257634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b60006103e86112f38184614236565b611300620f424085614236565b61130a919061419d565b6106689190614056565b6011546001600160a01b0316331461132b57600080fd5b600c55565b6011546001600160a01b0316331461134757600080fd5b600b55565b6000600a61135b83600f61419d565b61136690600a6140b0565b6113709085614056565b61137a9190614236565b9392505050565b6000818152600260205260408120546001600160a01b0316806106685760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e000000000000000000000000000000000000000000000060648201526084016107f1565b6011546001600160a01b0316331461142357600080fd5b600e55565b600080611436610100612e2c565b9050600060405180610140016040528060078461145488600061134c565b61145f8a600061134c565b611469919061417e565b611473919061417e565b61147d9190614236565b61148890600161403e565b815260200160078461149b88600161134c565b6114a68a600161134c565b6114b0919061417e565b6114ba919061417e565b6114c49190614236565b6114cf90600161403e565b81526020016006846114e288600261134c565b6114ed8a600261134c565b6114f7919061417e565b611501919061417e565b61150b9190614236565b61151690600161403e565b815260200160058461152988600361134c565b6115348a600361134c565b61153e919061417e565b611548919061417e565b6115529190614236565b61155d90600161403e565b81526020016000815260200160008152602001600081526020016101008461158488611c6e565b61158d8a611c6e565b611597919061417e565b6115a1919061403e565b6115ab9190614236565b8152602001610100846115bd886112e4565b6115c68a6112e4565b6115d0919061417e565b6115da919061403e565b6115e49190614236565b8152602001610100846115f6886111db565b6115ff8a6111db565b611609919061417e565b611613919061403e565b61161d9190614236565b815250905060006101008261012001516116379190614236565b610100830151611649906103e861417e565b60e084015161165b90620f424061417e565b60c085015161166e90633b9aca0061417e565b60a0860151611682906402540be40061417e565b60808701516116969064174876e80061417e565b60608801516116aa9064e8d4a5100061417e565b60408901516116bf906509184e72a00061417e565b60208a01516116d490655af3107a400061417e565b8a516116e79066038d7ea4c6800061417e565b6116f1919061403e565b6116fb919061403e565b611705919061403e565b61170f919061403e565b611719919061403e565b611723919061403e565b61172d919061403e565b611737919061403e565b611741919061403e565b9695505050505050565b60006001600160a01b0382166117c95760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f20616464726573730000000000000000000000000000000000000000000060648201526084016107f1565b506001600160a01b031660009081526003602052604090205490565b600081815260106020526040812060068101548290611804904261419d565b90506000601160009054906101000a90046001600160a01b03166001600160a01b03166355cc86276040518163ffffffff1660e01b815260040160206040518083038186803b15801561185657600080fd5b505afa15801561186a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188e9190613d80565b6001600160a01b03166302ca671d8685600601546040518363ffffffff1660e01b81526004016118c8929190918252602082015260400190565b60206040518083038186803b1580156118e057600080fd5b505afa1580156118f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119189190613db4565b90506000601160009054906101000a90046001600160a01b03166001600160a01b031663daf585b26040518163ffffffff1660e01b815260040160206040518083038186803b15801561196a57600080fd5b505afa15801561197e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119a29190613d80565b6040517f5a22f03e00000000000000000000000000000000000000000000000000000000815260048101889052602481018590526001600160a01b039190911690635a22f03e9060440160206040518083038186803b158015611a0457600080fd5b505afa158015611a18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a3c9190613db4565b90506000611a4985612e6e565b905081611a56848361403e565b610c98919061403e565b6060600180546106f9906141e0565b6000828410611a8c57818411611a855783611a87565b815b6106e2565b509092915050565b6011546001600160a01b03163314611aab57600080fd5b60005b83811015611b1b57600160126000878785818110611adc57634e487b7160e01b600052603260045260246000fd5b90506020020135815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611b139061421b565b915050611aae565b5060005b8181101561121057600160136000858585818110611b4d57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190611b629190613adf565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580611b948161421b565b915050611b1f565b6001600160a01b038216331415611bf55760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016107f1565b3360008181526005602090815260408083206001600160a01b0387168085529252909120805460ff1916841515179055906001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611c62911515815260200190565b60405180910390a35050565b6000620f4240611c7e8184614236565b611300633b9aca0085614236565b611c963383612a29565b611d085760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f76656400000000000000000000000000000060648201526084016107f1565b611d1484848484612f71565b50505050565b6000818152600260205260409020546060906001600160a01b0316611da75760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e000000000000000000000000000000000060648201526084016107f1565b6000611db1612ffa565b90506000815111611dd1576040518060200160405280600081525061137a565b80611ddb8461301a565b604051602001611dec929190613f17565b6040516020818303038152906040529392505050565b6011546000906001600160a01b03163314611e1c57600080fd5b6014546040516370a0823160e01b81526001600160a01b038481166004830152600092611ea892603292909116906370a082319060240160206040518083038186803b158015611e6b57600080fd5b505afa158015611e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea39190613db4565b6126ec565b6001600160a01b0384166000908152601360205260408120549192509060ff16821561223a5760005b83811015612238576014546040517f2f745c590000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152600060248301819052921690632f745c599060440160206040518083038186803b158015611f3f57600080fd5b505afa158015611f53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f779190613db4565b90506000611f8482613169565b6014546040516323b872dd60e01b81526001600160a01b038b81166004830152306024830152604482018690529293509116906323b872dd90606401600060405180830381600087803b158015611fda57600080fd5b505af1158015611fee573d6000803e3d6000fd5b50505060008381526012602052604090205460ff161590508015612010575083155b156122235760008160c0015142612027919061419d565b9050600062dd7c00828460a0015160ff612041919061417e565b61204b919061417e565b6120559190614056565b9050612061818861403e565b965060006120918b856020015186604001518760600151886080015161208c60108b60a00151612704565b612d01565b905061209c846132bc565b60008281526010602052604081206007019190915560608501516120c190600461134c565b600114905060006120d78660600151600561134c565b600114905060006120ed8760600151600661134c565b600114905082806120fb5750815b806121035750805b1561221c57601160009054906101000a90046001600160a01b03166001600160a01b031663daf585b26040518163ffffffff1660e01b815260040160206040518083038186803b15801561215657600080fd5b505afa15801561216a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218e9190613d80565b6040517f1acf8acd000000000000000000000000000000000000000000000000000000008152600481018690528415156024820152831515604482015282151560648201526001600160a01b039190911690631acf8acd90608401600060405180830381600087803b15801561220357600080fd5b505af1158015612217573d6000803e3d6000fd5b505050505b5050505050505b505080806122309061421b565b915050611ed1565b505b6015546040516370a0823160e01b81526001600160a01b03878116600483015260009216906370a082319060240160206040518083038186803b15801561228057600080fd5b505afa158015612294573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122b89190613db4565b6015546040516323b872dd60e01b81526001600160a01b038981166004830152306024830152604482018490529293509116906323b872dd90606401602060405180830381600087803b15801561230e57600080fd5b505af1158015612322573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123469190613d2c565b50612351818461403e565b92508161235e5782611741565b60009695505050505050565b60006123753361174b565b90506000811161238457600080fd5b6000805b828110156123fa576000601060006123a03385611130565b815260200190815260200160002090506123bd8160000154610bec565b81546123c8906117e5565b6123d2919061419d565b6123dc908461403e565b426006909201919091559150806123f28161421b565b915050612388565b50601160009054906101000a90046001600160a01b03166001600160a01b031663fe43e58d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561244957600080fd5b505afa15801561245d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124819190613d80565b6040517fcd739bca000000000000000000000000000000000000000000000000000000008152336004820152602481018390526001600160a01b03919091169063cd739bca90604401600060405180830381600087803b1580156124e457600080fd5b505af11580156124f8573d6000803e3d6000fd5b505050505050565b60106020526000908152604090208054600182018054919291612522906141e0565b80601f016020809104026020016040519081016040528092919081815260200182805461254e906141e0565b801561259b5780601f106125705761010080835404028352916020019161259b565b820191906000526020600020905b81548152906001019060200180831161257e57829003601f168201915b5050505050908060020180546125b0906141e0565b80601f01602080910402602001604051908101604052809291908181526020018280546125dc906141e0565b80156126295780601f106125fe57610100808354040283529160200191612629565b820191906000526020600020905b81548152906001019060200180831161260c57829003601f168201915b5050505050908060030154908060040154908060050154908060060154908060070154905088565b60006001600160e01b031982167f80ac58cd0000000000000000000000000000000000000000000000000000000014806126b457506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b8061066857507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614610668565b6000818310156126fd5750816111d5565b50806111d5565b6000818311156126fd5750816111d5565b6000818152600460205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038416908117909155819061275782611381565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061279b82611381565b90506127a9816000846133cb565b6127b4600083612715565b6001600160a01b03811660009081526003602052604081208054600192906127dd90849061419d565b9091555050600082815260026020526040808220805473ffffffffffffffffffffffffffffffffffffffff19169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60008061285985600301548560030154611428565b9050600061286f86600401548660040154612704565b61287a90600161403e565b90506000612889600243614236565b600e5460058901549115925061289e9161417e565b87600701546128ad919061403e565b6007880155600e5460058701546128c4919061417e565b86600701546128d3919061403e565b6007870155610c9833826128ea57876001016128ef565b886001015b80546128fa906141e0565b80601f0160208091040260200160405190810160405280929190818152602001828054612926906141e0565b80156129735780601f1061294857610100808354040283529160200191612973565b820191906000526020600020905b81548152906001019060200180831161295657829003601f168201915b505050505083612986578960020161298b565b886002015b8054612996906141e0565b80601f01602080910402602001604051908101604052809291908181526020018280546129c2906141e0565b8015612a0f5780601f106129e457610100808354040283529160200191612a0f565b820191906000526020600020905b8154815290600101906020018083116129f257829003601f168201915b5050505050868661208c8d600501548d600501548d613488565b6000818152600260205260408120546001600160a01b0316612aa25760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016107f1565b6000612aad83611381565b9050806001600160a01b0316846001600160a01b03161480612ae85750836001600160a01b0316612add8461077c565b6001600160a01b0316145b806106e257506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff166106e2565b826001600160a01b0316612b2f82611381565b6001600160a01b031614612bab5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e000000000000000000000000000000000000000000000060648201526084016107f1565b6001600160a01b038216612c265760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016107f1565b612c318383836133cb565b612c3c600082612715565b6001600160a01b0383166000908152600360205260408120805460019290612c6590849061419d565b90915550506001600160a01b0382166000908152600360205260408120805460019290612c9390849061403e565b9091555050600081815260026020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000612d11600a80546001019055565b6000612d1c600a5490565b9050612d2888826134e5565b604051806101000160405280828152602001888152602001878152602001868152602001858152602001848152602001428152602001600e5485612d6c919061417e565b90526000828152601060209081526040909120825181558282015180519192612d9d9260018501929091019061395d565b5060408201518051612db991600284019160209091019061395d565b50606082015160038201556080820151600482015560a0820151600582015560c0820151600682015560e0909101516007909101556040518181527f176b02bb2d12439ff7a20b59f402cca16c76f50508b13ef3166a600eb719354a9060200160405180910390a1979650505050505050565b6000814442604051602001612e4b929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c6106689190614236565b600080612e84836006015442610693919061419d565b90506000836005015463622c1f88612e9c919061417e565b90506000633b9aca006422c2ed000084612eb6818661417e565b612ec0919061417e565b85612ecc86601461417e565b612ed6919061417e565b612ee3906201518061417e565b612eed919061419d565b612ef79190614056565b612f019190614056565b90506000620bdd80866006015442612f19919061419d565b1115612f6757661eb208c2dc000083876006015442612f38919061419d565b612f4590620bdd8061403e565b612f4f919061417e565b612f5a90600a61417e565b612f649190614056565b90505b611741818361403e565b612f7c848484612b1c565b612f8884848484613640565b611d145760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e746572000000000000000000000000000060648201526084016107f1565b60606040518060600160405280602381526020016142c960239139905090565b60608161305b575060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015261066b565b8160005b8115613085578061306f8161421b565b915061307e9050600a83614056565b915061305f565b60008167ffffffffffffffff8111156130ae57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156130d8576020820181803683370190505b5090505b84156106e2576130ed60018361419d565b91506130fa600a86614236565b61310590603061403e565b60f81b81838151811061312857634e487b7160e01b600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350613162600a86614056565b94506130dc565b6131b160405180610100016040528060008152602001606081526020016060815260200160008152602001600081526020016000815260200160008152602001600081525090565b6014546040517fe14285bb0000000000000000000000000000000000000000000000000000000081526004810184905260009182918291829182918291829182916001600160a01b039091169063e14285bb9060240160006040518083038186803b15801561321f57600080fd5b505afa158015613233573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261325b9190810190613dcc565b975097509750975097509750975097506040518061010001604052808981526020018881526020018781526020018681526020018581526020016132a0601086612704565b8152602081019390935260409092015298975050505050505050565b60008160e001516103e814156132e35760a08201516132dc90600561417e565b905061066b565b8160e001516107d0141561330c5760a082015161330190600561417e565b6132dc90600261417e565b8160e00151610fa014156133355760a082015161332a90600561417e565b6132dc90600361417e565b8160e00151611f40141561335e5760a082015161335390600561417e565b6132dc90600461417e565b8160e00151613e8014156133875760a082015161337c90600561417e565b6132dc90600561417e565b8160e00151617d0014156133b05760a08201516133a590600561417e565b6132dc90600661417e565b60a08201516133c090600561417e565b6132dc90600761417e565b6001600160a01b0383166134265761342181600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b613449565b816001600160a01b0316836001600160a01b0316146134495761344983826137a3565b6001600160a01b0382166134655761346081613840565b610943565b826001600160a01b0316826001600160a01b031614610943576109438282613919565b6000806002613497858761403e565b6134a19190614056565b9050826134c757602981116134b75760106134c2565b6134c260198261419d565b6134dc565b6134dc6134d582600a61403e565b60ff6126ec565b95945050505050565b6001600160a01b03821661353b5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016107f1565b6000818152600260205260409020546001600160a01b0316156135a05760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016107f1565b6135ac600083836133cb565b6001600160a01b03821660009081526003602052604081208054600192906135d590849061403e565b9091555050600081815260026020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160a01b0384163b1561379857604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613684903390899088908890600401613f46565b602060405180830381600087803b15801561369e57600080fd5b505af19250505080156136ce575060408051601f3d908101601f191682019092526136cb91810190613d64565b60015b61377e573d8080156136fc576040519150601f19603f3d011682016040523d82523d6000602084013e613701565b606091505b5080516137765760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e746572000000000000000000000000000060648201526084016107f1565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506106e2565b506001949350505050565b600060016137b08461174b565b6137ba919061419d565b60008381526007602052604090205490915080821461380d576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b6008546000906138529060019061419d565b6000838152600960205260408120546008805493945090928490811061388857634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080600883815481106138b757634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806138fd57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b60006139248361174b565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b828054613969906141e0565b90600052602060002090601f01602090048101928261398b57600085556139d1565b82601f106139a457805160ff19168380011785556139d1565b828001600101855582156139d1579182015b828111156139d15782518255916020019190600101906139b6565b506139dd9291506139e1565b5090565b5b808211156139dd57600081556001016139e2565b6000613a09613a0484614016565b613fe5565b9050828152838383011115613a1d57600080fd5b828260208301376000602084830101529392505050565b60008083601f840112613a45578182fd5b50813567ffffffffffffffff811115613a5c578182fd5b6020830191508360208083028501011115613a7657600080fd5b9250929050565b600082601f830112613a8d578081fd5b61137a838335602085016139f6565b600082601f830112613aac578081fd5b8151613aba613a0482614016565b818152846020838601011115613ace578283fd5b6106e28260208301602087016141b4565b600060208284031215613af0578081fd5b813561137a8161428c565b60008060408385031215613b0d578081fd5b8235613b188161428c565b91506020830135613b288161428c565b809150509250929050565b600080600060608486031215613b47578081fd5b8335613b528161428c565b92506020840135613b628161428c565b929592945050506040919091013590565b60008060008060808587031215613b88578081fd5b8435613b938161428c565b93506020850135613ba38161428c565b925060408501359150606085013567ffffffffffffffff811115613bc5578182fd5b8501601f81018713613bd5578182fd5b613be4878235602084016139f6565b91505092959194509250565b60008060408385031215613c02578182fd5b8235613c0d8161428c565b91506020830135613b28816142a4565b60008060008060808587031215613c32578384fd5b8435613c3d8161428c565b9350602085013567ffffffffffffffff80821115613c59578485fd5b613c6588838901613a7d565b94506040870135915080821115613c7a578384fd5b50613c8787828801613a7d565b949793965093946060013593505050565b60008060408385031215613caa578182fd5b8235613cb58161428c565b946020939093013593505050565b60008060008060408587031215613cd8578182fd5b843567ffffffffffffffff80821115613cef578384fd5b613cfb88838901613a34565b90965094506020870135915080821115613d13578384fd5b50613d2087828801613a34565b95989497509550505050565b600060208284031215613d3d578081fd5b815161137a816142a4565b600060208284031215613d59578081fd5b813561137a816142b2565b600060208284031215613d75578081fd5b815161137a816142b2565b600060208284031215613d91578081fd5b815161137a8161428c565b600060208284031215613dad578081fd5b5035919050565b600060208284031215613dc5578081fd5b5051919050565b600080600080600080600080610100898b031215613de8578586fd5b88519750602089015167ffffffffffffffff80821115613e06578788fd5b613e128c838d01613a9c565b985060408b0151915080821115613e27578788fd5b50613e348b828c01613a9c565b965050606089015194506080890151935060a0890151925060c0890151915060e089015190509295985092959890939650565b60008060408385031215613e79578182fd5b50508035926020909101359150565b600080600060608486031215613e9c578081fd5b83359250602084013591506040840135613eb5816142a4565b809150509250925092565b600080600060608486031215613ed4578081fd5b505081359360208301359350604090920135919050565b60008151808452613f038160208601602086016141b4565b601f01601f19169290920160200192915050565b60008351613f298184602088016141b4565b835190830190613f3d8183602088016141b4565b01949350505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526117416080830184613eeb565b60006020825261137a6020830184613eeb565b60006101008a8352806020840152613fa58184018b613eeb565b90508281036040840152613fb9818a613eeb565b60608401989098525050608081019490945260a084019290925260c083015260e0909101529392505050565b604051601f8201601f1916810167ffffffffffffffff8111828210171561400e5761400e614276565b604052919050565b600067ffffffffffffffff82111561403057614030614276565b50601f01601f191660200190565b600082198211156140515761405161424a565b500190565b60008261406557614065614260565b500490565b80825b600180861161407c57506140a7565b81870482111561408e5761408e61424a565b8086161561409b57918102915b9490941c93800261406d565b94509492505050565b600061137a60001984846000826140c95750600161137a565b816140d65750600061137a565b81600181146140ec57600281146140f657614123565b600191505061137a565b60ff8411156141075761410761424a565b6001841b91508482111561411d5761411d61424a565b5061137a565b5060208310610133831016604e8410600b8410161715614156575081810a838111156141515761415161424a565b61137a565b614163848484600161406a565b8086048211156141755761417561424a565b02949350505050565b60008160001904831182151516156141985761419861424a565b500290565b6000828210156141af576141af61424a565b500390565b60005b838110156141cf5781810151838201526020016141b7565b83811115611d145750506000910152565b6002810460018216806141f457607f821691505b6020821081141561421557634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561422f5761422f61424a565b5060010190565b60008261424557614245614260565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146142a157600080fd5b50565b80151581146142a157600080fd5b6001600160e01b0319811681146142a157600080fdfe68747470733a2f2f6170692e76322e73747261696e7a2e746563682f73747261696e2fa264697066735822122013ae36bdc8cc8e80e91b84c0d802729b1e2b518bbc4c9f1c4970e41ad42920be64736f6c63430008020033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.