Contract 0x789597a72aff54fadea196c13fa1011c2e3c2a1e

 
Txn Hash
Block
From
To
Value [Txn Fee]
0xf19671f2b4c32063ed8e60b05ba0b804aa709ff6f10fa738e0e739304fb6862a85590572021-06-23 22:29:318 hrs 8 mins ago0x23447267c497162be9b4cf3658e65f54cda0d1ca IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00012482
0x798b3b7f99c84e484da31cb6e4f92c56f63c907548427009e36dfed3c91cbe6d85420212021-06-23 8:14:5922 hrs 23 mins ago0x9d45ff1408441a1e67e9b3e504b47c5b32a40ecd IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00022118
0xb9938f8712bb380b68b1a3082f062b2ff6bf13321204526cabffb7c937e2e9c785380142021-06-23 4:53:111 day 1 hr ago0xa3671b04f78f5b10c706ec5208d65f98eed038f2 IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00012482
0xe6fb9e95c7895b43a19d42fab715e1bf84f79262df7008857924fbe2ea1fc14e84983072021-06-21 19:34:072 days 11 hrs ago0x4c15ce4cd15816bcd3866e49c4d3f8531502ade8 IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00012482
0xd50112939aa0e88f3d8ffb0bb1c6cbd299d50f0821b2d16b366afd7b0f6c4ec884982602021-06-21 19:31:412 days 11 hrs ago0x4c15ce4cd15816bcd3866e49c4d3f8531502ade8 IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00012482
0x489fd331541316898e8356a39a78af201e6061b2767d6a103911d4608d48ff3c84944132021-06-21 16:18:252 days 14 hrs ago0xbf880676579b9ebe7efb8af356c940013692f13a IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00012482
0xd998c0adef3a980682f16c6c3ea69a075a38f0b811d315c90cdec0d2329223bc84843492021-06-21 7:54:062 days 22 hrs ago0x9dd1e2016470a23ecdb1574a0dd005ad683ad1e8 IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00012482
0x574d7c05cbca318aa033018875fc173588d890020b284343f40a6da91aaa3fa584661662021-06-20 16:44:233 days 13 hrs ago0x99fd45cd45fd79180223d6c89b7d9560f13f8a4c IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00012482
0xb002ac22fbab63cf3c066e299ecf1c13d778c1e3043a6248cc621dce2a46565284421552021-06-19 20:42:224 days 9 hrs ago0x3be536efda88c618aaf500df064a2bfb920b66e4 IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00012482
0xf9a21e6e8dff791fa50e7151d00ade2300804ea9755508301600ce1e42aca38d84091142021-06-18 16:53:385 days 13 hrs ago0x62045e4ca87ef92821aff7b29bd3e28a5c80903f IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00022136
0x138bd92e0727f34aed0f05dd0ba78fed7a00fdec3f1a53d8c7d0feaa5980761384090792021-06-18 16:51:535 days 13 hrs ago0x62045e4ca87ef92821aff7b29bd3e28a5c80903f IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00039542
0xb3e8b03ea434dfb65aed45ae404752d64c8f12990e070e0d82edb0590288eba384027372021-06-18 11:32:055 days 19 hrs ago0xe82c06290bce9e6db0f9716dc15ed0af247c7653 IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00012482
0x66de11088cec88aae4b03ff20ec4f8129b9ba378771c39638fc9c30fd374474783735252021-06-17 10:58:106 days 19 hrs ago0xb6a94d8384b8e8f7c40f45e95ab66d4ac10377b7 IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00012482
0x68dbcf44c6dffc30119219de351c037aa9150b71ff952feb7e67e57285fd1aa783734692021-06-17 10:55:226 days 19 hrs ago0xb6a94d8384b8e8f7c40f45e95ab66d4ac10377b7 IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00012482
0x75146a6b642076bec90b37dc0770fd67a784434025092a4e83e4512b854d7e2583725122021-06-17 10:06:526 days 20 hrs ago0xa4fbbd66c733c9f576699f9715253f231ea1bb80 IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00012482
0x939ec445026ea65c5de8f74f15393fb1ffb0970bbd4eea172d08340eb5ee884383386812021-06-16 5:43:128 days 55 mins ago0xe956fac49aec0bc31ad255c42ba04f2e0c79a565 IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00012482
0xb7b009b32c07ceeffdc63aa070f6504214e8b0b5e66a73d0d60b5b6111044e5983359872021-06-16 3:26:598 days 3 hrs ago0x0c1442a542625173e9f472c330ee8d00ac012125 IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00012482
0x53baad68c324439533c58f1b8fadaad79ef81dfb45e9262df20cadbcd9596e3183221982021-06-15 15:52:268 days 14 hrs ago0x46d132fbb899dacdbb4d2704ebbd964c6d4a2974 IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00012482
0x4f92d6b282478d158d5c077bd199ebc1e3bfd0630f8dbbdff30a6bd4f3996f9083083312021-06-15 4:04:459 days 2 hrs ago0xc9156f69dc83b73c99f04f008c5c2b88d9f14d8e IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00012482
0xc1c0a31f10f0bd4f39896951a85d928cbb289726afb8c3c94738185440df78ba82943332021-06-14 16:15:419 days 14 hrs ago0x631d54d41ccb7f2461120ebe25c2587f8e49ada9 IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00007291
0xe924e3c1a31ee8f1f67abfb42fe7c03ba8f3dae28eb8b18915b3d5cce9d6614d82794302021-06-14 3:42:0610 days 2 hrs ago0x5c8a72cc0548c73927559d29f3404e90d8eca76f IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00012482
0xe4af7255d29ca925390cd1eea936d454ce4977fe14cc8551203fc62e74a4947882702512021-06-13 19:55:3210 days 10 hrs ago0x1762a6e43c3a022282ff1af4ba38290d599f4af3 IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.0002213
0xa5877c37546975f95fbcc5275cdf2052fab0fef12a78359bed5b1d2d486f66ca82307042021-06-12 10:41:2211 days 19 hrs ago0x1762c3ea9fce6cce7b6b2a24e0e2b5f5c84d8fcb IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00012482
0xa9f1eb15d097d4c02c0729a4b7f16170fc92bfcd5e012198ae493db305cc481d81957482021-06-11 5:27:2513 days 1 hr ago0x3bc98d5e8bd8fb5036d7c4c408fe2d16c9d9286f IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00022136
0xb6bb2002bac6e54a21ff9c94841f81a7f0828875edc4802ea442e3cc0166126b81956452021-06-11 5:22:1613 days 1 hr ago0x3bc98d5e8bd8fb5036d7c4c408fe2d16c9d9286f IN  0x789597a72aff54fadea196c13fa1011c2e3c2a1e0 BNB0.00039554
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0xf9926d2b4f505921713446d33c71759fab790dbdec7797dd8cfc815311b11db568456352021-04-24 13:53:1560 days 16 hrs ago 0xdbea85ce8d2bffaa292e6def9b22a5daa40d716e  Contract Creation0 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SeedzToken

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 : 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 2 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 { }
}

File 3 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 4 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 5 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 6 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 7 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 8 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 9 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 10 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 11 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 12 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 13 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 14 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 15 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 16 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 17 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 18 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 19 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 20 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 21 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 22 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 23 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 24 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);
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"plantId","type":"uint256"}],"name":"FertilizerBought","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"contract IERC20","name":"_lpToken","type":"address"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"breedBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"plantId","type":"uint256"}],"name":"buyGrowFertilizer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"compostMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"strainId","type":"uint256"},{"internalType":"uint256","name":"lastHarvest","type":"uint256"}],"name":"getHarvestableFertilizerAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"growFertilizerBoost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"growFertilizerCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"lastTimeGrowFertilizerUsedOnPlant","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingSeedz","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20","name":"lpToken","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accSeedzPerShare","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"seedzPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newCost","type":"uint256"},{"internalType":"uint256","name":"newBoost","type":"uint256"}],"name":"setGrowFertilizerDetails","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_seedzPerBlock","type":"uint256"}],"name":"setSeedzPerBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052681b1ae4d6e2ef50000060075560646008556706f05b59d3b200006009556000600c553480156200003457600080fd5b50604051620020f0380380620020f0833981016040819052620000579162000281565b6040518060400160405280600581526020016429b2b2b23d60d91b8152506040518060400160405280600581526020016429a2a2a22d60d91b8152508160039080519060200190620000ab929190620001db565b508051620000c1906004906020840190620001db565b5050600580546001600160a01b0319163317905550620000ec81691a784379d99db4200000620000f3565b5062000313565b6001600160a01b0382166200014e5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b8060026000828254620001629190620002b1565b90915550506001600160a01b0382166000908152602081905260408120805483929062000191908490620002b1565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b828054620001e990620002d6565b90600052602060002090601f0160209004810192826200020d576000855562000258565b82601f106200022857805160ff191683800117855562000258565b8280016001018555821562000258579182015b82811115620002585782518255916020019190600101906200023b565b50620002669291506200026a565b5090565b5b808211156200026657600081556001016200026b565b60006020828403121562000293578081fd5b81516001600160a01b0381168114620002aa578182fd5b9392505050565b60008219821115620002d157634e487b7160e01b81526011600452602481fd5b500190565b600281046001821680620002eb57607f821691505b602082108114156200030d57634e487b7160e01b600052602260045260246000fd5b50919050565b611dcd80620003236000396000f3fe608060405234801561001057600080fd5b506004361061020b5760003560e01c8063441a3e701161012a57806393f1a40b116100bd578063dd62ed3e1161008c578063e2bbb15811610071578063e2bbb158146104d4578063ea292400146104e7578063f772459b146104f05761020b565b8063dd62ed3e14610488578063df23e160146104c15761020b565b806393f1a40b1461041357806395d89b411461045a578063a457c2d714610462578063a9059cbb146104755761020b565b806364482f79116100f957806364482f79146103bb57806364bce6db146103ce57806370a08231146103e1578063912db8141461040a5761020b565b8063441a3e701461037a57806351eb05a61461038d5780635312ea8e146103a0578063630b5ba1146103b35761020b565b806318160ddd116101a2578063313ce56711610171578063313ce5671461033257806339509351146103415780633dc1d7921461035457806342c304b5146103675761020b565b806318160ddd146102f15780631eaaa045146102f957806323b872dd1461030c578063251b57701461031f5761020b565b80630d20c266116101de5780630d20c266146102765780630fa4b111146102965780631526fe27146102ab57806317caf6f1146102e85761020b565b806302ca671d1461021057806306fdde0314610236578063081e3eda1461024b578063095ea7b314610253575b600080fd5b61022361021e366004611bf9565b6104f9565b6040519081526020015b60405180910390f35b61023e61056e565b60405161022d9190611c47565b600a54610223565b610266610261366004611b01565b610600565b604051901515815260200161022d565b610223610284366004611b64565b60066020526000908152604090205481565b6102a96102a4366004611b01565b610616565b005b6102be6102b9366004611b64565b6106c7565b604080516001600160a01b039095168552602085019390935291830152606082015260800161022d565b610223600c5481565b600254610223565b6102a9610307366004611bb8565b61070b565b61026661031a366004611ac1565b61084d565b6102a961032d366004611b64565b610918565b6040516012815260200161022d565b61026661034f366004611b01565b6109b8565b6102a9610362366004611b64565b6109ef565b6102a9610375366004611b01565b610a13565b6102a9610388366004611bf9565b610ac0565b6102a961039b366004611b64565b610ca7565b6102a96103ae366004611b64565b610e09565b6102a9610f27565b6102a96103c9366004611c1a565b610f4e565b6102a96103dc366004611bf9565b611000565b6102236103ef366004611a66565b6001600160a01b031660009081526020819052604090205490565b61022360095481565b610445610421366004611b94565b600b6020908152600092835260408084209091529082529020805460019091015482565b6040805192835260208301919091520161022d565b61023e611022565b610266610470366004611b01565b611031565b610266610483366004611b01565b6110e4565b610223610496366004611a89565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6102236104cf366004611b94565b6110f1565b6102a96104e2366004611bf9565b611280565b61022360075481565b61022360085481565b6000828152600660205260408120548190801561056457600061051c8286611434565b905060006105366105308362093a80611c9a565b4261144c565b905062015180600854838361054b9190611cf1565b6105559190611cd2565b61055f9190611cb2565b935050505b5090505b92915050565b60606003805461057d90611d08565b80601f01602080910402602001604051908101604052809291908181526020018280546105a990611d08565b80156105f65780601f106105cb576101008083540402835291602001916105f6565b820191906000526020600020905b8154815290600101906020018083116105d957829003601f168201915b5050505050905090565b600061060d33848461145d565b50600192915050565b600560009054906101000a90046001600160a01b03166001600160a01b031663706908ff6040518163ffffffff1660e01b815260040160206040518083038186803b15801561066457600080fd5b505afa158015610678573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069c9190611b48565b6001600160a01b0316336001600160a01b0316146106b957600080fd5b6106c382826115b6565b5050565b600a81815481106106d757600080fd5b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169350919084565b6005546001600160a01b0316331461072257600080fd5b801561073057610730610f27565b82600c60008282546107429190611c9a565b9091555050604080516080810182526001600160a01b0393841681526020810194855243918101918252600060608201818152600a8054600181018255925291517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8600490920291820180547fffffffffffffffffffffffff000000000000000000000000000000000000000016919096161790945593517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a9840155517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2aa8301555090517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2ab90910155565b600061085a84848461173c565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156108f95760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e636500000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61090d85336109088685611cf1565b61145d565b506001949350505050565b6007543360009081526020819052604090205481111561093757600080fd5b60008281526006602052604090205442906109559062093a80611c9a565b1061095f57600080fd5b61096933826115b6565b60008281526006602090815260409182902042905581513381529081018490527f4a57d801306de4358c54a2cb591d90ce72db18f2476014e9307f2144eb62928f910160405180910390a15050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161060d918590610908908690611c9a565b6005546001600160a01b03163314610a0657600080fd5b610a0e610f27565b600955565b600560009054906101000a90046001600160a01b03166001600160a01b031663706908ff6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6157600080fd5b505afa158015610a75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a999190611b48565b6001600160a01b0316336001600160a01b031614610ab657600080fd5b6106c3828261194f565b6000600a8381548110610ae357634e487b7160e01b600052603260045260246000fd5b60009182526020808320868452600b825260408085203386529092529220805460049092029092019250831115610b5c5760405162461bcd60e51b815260206004820152601260248201527f77697468647261773a206e6f7420676f6f64000000000000000000000000000060448201526064016108f0565b610b6584610ca7565b6000816001015464e8d4a5100084600301548460000154610b869190611cd2565b610b909190611cb2565b610b9a9190611cf1565b9050610ba63382611a2e565b83826000016000828254610bba9190611cf1565b90915550506003830154825464e8d4a5100091610bd691611cd2565b610be09190611cb2565b6001830155825460405163a9059cbb60e01b8152336004820152602481018690526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b158015610c3057600080fd5b505af1158015610c44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c689190611b2c565b50604051848152859033907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689060200160405180910390a35050505050565b6000600a8281548110610cca57634e487b7160e01b600052603260045260246000fd5b9060005260206000209060040201905080600201544311610ceb5750610e06565b80546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b158015610d2e57600080fd5b505afa158015610d42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d669190611b7c565b905080610d7a575043600290910155610e06565b6000826002015443610d8c9190611cf1565b90506000600c54846001015460095484610da69190611cd2565b610db09190611cd2565b610dba9190611cb2565b9050610dc6308261194f565b82610dd68264e8d4a51000611cd2565b610de09190611cb2565b846003016000828254610df39190611c9a565b9091555050436002909401939093555050505b50565b6000600a8281548110610e2c57634e487b7160e01b600052603260045260246000fd5b60009182526020808320858452600b825260408085203380875293528085208054868255600182019690965560049485029092018054915163a9059cbb60e01b8152948501939093526024840185905291945092916001600160a01b039091169063a9059cbb90604401602060405180830381600087803b158015610eb057600080fd5b505af1158015610ec4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee89190611b2c565b50604051818152849033907fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae0595906020015b60405180910390a350505050565b600a5460005b818110156106c357610f3e81610ca7565b610f4781611d43565b9050610f2d565b6005546001600160a01b03163314610f6557600080fd5b8015610f7357610f73610f27565b81600a8481548110610f9557634e487b7160e01b600052603260045260246000fd5b906000526020600020906004020160010154600c54610fb49190611cf1565b610fbe9190611c9a565b600c8190555081600a8481548110610fe657634e487b7160e01b600052603260045260246000fd5b906000526020600020906004020160010181905550505050565b6005546001600160a01b0316331461101757600080fd5b600791909155600855565b60606004805461057d90611d08565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156110cb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084016108f0565b6110da33856109088685611cf1565b5060019392505050565b600061060d33848461173c565b600080600a848154811061111557634e487b7160e01b600052603260045260246000fd5b60009182526020808320878452600b825260408085206001600160a01b038981168752935280852060049485029092016003810154815492516370a0823160e01b8152309681019690965290965091949193919216906370a082319060240160206040518083038186803b15801561118c57600080fd5b505afa1580156111a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c49190611b7c565b90508360020154431180156111d857508015155b156112485760008460020154436111ef9190611cf1565b90506000600c548660010154600954846112099190611cd2565b6112139190611cd2565b61121d9190611cb2565b90508261122f8264e8d4a51000611cd2565b6112399190611cb2565b6112439085611c9a565b935050505b6001830154835464e8d4a5100090611261908590611cd2565b61126b9190611cb2565b6112759190611cf1565b979650505050505050565b6000600a83815481106112a357634e487b7160e01b600052603260045260246000fd5b60009182526020808320868452600b825260408085203386529092529220600490910290910191506112d484610ca7565b80541561131e576000816001015464e8d4a51000846003015484600001546112fc9190611cd2565b6113069190611cb2565b6113109190611cf1565b905061131c3382611a2e565b505b81546040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590526001600160a01b03909116906323b872dd90606401602060405180830381600087803b15801561138857600080fd5b505af115801561139c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c09190611b2c565b50828160000160008282546113d59190611c9a565b90915550506003820154815464e8d4a51000916113f191611cd2565b6113fb9190611cb2565b6001820155604051838152849033907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a1590602001610f19565b600081831115611445575081610568565b5080610568565b600081831015611445575081610568565b6001600160a01b0383166114d85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016108f0565b6001600160a01b0382166115545760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016108f0565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0382166116325760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084016108f0565b6001600160a01b038216600090815260208190526040902054818110156116c15760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f636500000000000000000000000000000000000000000000000000000000000060648201526084016108f0565b6116cb8282611cf1565b6001600160a01b038416600090815260208190526040812091909155600280548492906116f9908490611cf1565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016115a9565b6001600160a01b0383166117b85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016108f0565b6001600160a01b0382166118345760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016108f0565b6001600160a01b038316600090815260208190526040902054818110156118c35760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016108f0565b6118cd8282611cf1565b6001600160a01b038086166000908152602081905260408082209390935590851681529081208054849290611903908490611c9a565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610f1991815260200190565b6001600160a01b0382166119a55760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016108f0565b80600260008282546119b79190611c9a565b90915550506001600160a01b038216600090815260208190526040812080548392906119e4908490611c9a565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b3060009081526020819052604090205480821115611a5657611a5130848361173c565b611a61565b611a6130848461173c565b505050565b600060208284031215611a77578081fd5b8135611a8281611d74565b9392505050565b60008060408385031215611a9b578081fd5b8235611aa681611d74565b91506020830135611ab681611d74565b809150509250929050565b600080600060608486031215611ad5578081fd5b8335611ae081611d74565b92506020840135611af081611d74565b929592945050506040919091013590565b60008060408385031215611b13578182fd5b8235611b1e81611d74565b946020939093013593505050565b600060208284031215611b3d578081fd5b8151611a8281611d89565b600060208284031215611b59578081fd5b8151611a8281611d74565b600060208284031215611b75578081fd5b5035919050565b600060208284031215611b8d578081fd5b5051919050565b60008060408385031215611ba6578182fd5b823591506020830135611ab681611d74565b600080600060608486031215611bcc578283fd5b833592506020840135611bde81611d74565b91506040840135611bee81611d89565b809150509250925092565b60008060408385031215611c0b578182fd5b50508035926020909101359150565b600080600060608486031215611c2e578283fd5b83359250602084013591506040840135611bee81611d89565b6000602080835283518082850152825b81811015611c7357858101830151858201604001528201611c57565b81811115611c845783604083870101525b50601f01601f1916929092016040019392505050565b60008219821115611cad57611cad611d5e565b500190565b600082611ccd57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611cec57611cec611d5e565b500290565b600082821015611d0357611d03611d5e565b500390565b600281046001821680611d1c57607f821691505b60208210811415611d3d57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415611d5757611d57611d5e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114610e0657600080fd5b8015158114610e0657600080fdfea26469706673582212201706d28a255e88181b4b6118569459520c077d72e556e3796922e6bc1531565a64736f6c6343000802003300000000000000000000000006fb92c5adcdc9c42b5be8c5dd5eebe3182aecbc

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

00000000000000000000000006fb92c5adcdc9c42b5be8c5dd5eebe3182aecbc

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000006fb92c5adcdc9c42b5be8c5dd5eebe3182aecbc


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.