false
true
0

Contract Address Details

0xd22E78C22D7E77229d60cc9fC57b0E294F54488E

Token
Hocus Pocus Finance (HOC)
Creator
0xdc1ab8–2da979 at 0xda1f20–7bd3dc
Balance
0 PLS ( )
Tokens
Fetching tokens...
Transactions
3,462 Transactions
Transfers
0 Transfers
Gas Used
0
Last Balance Update
25918764
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
Dime




Optimization enabled
true
Compiler version
v0.8.9+commit.e5eed63a




Optimization runs
1000
EVM Version
default




Verified at
2023-07-20T08:56:46.112134Z

Constructor Arguments

0x000000000000000000000000f06dbb577faaa479f68429e65274944679af0bc1000000000000000000000000000000000000000063b528f7205b1d2fe03c0000

Arg [0] (address) : 0xf06dbb577faaa479f68429e65274944679af0bc1
Arg [1] (uint256) : 30858024999000000000000000000

              

contracts/HocusPocusAether.sol

// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.9;

/*                                                                                hhhhhhhhhhhhhhhhhp
                                                                                  aaaaaaaaaaaaaaaaaaap
                                                                                  f       haaaaaaaaaaap
                                                                                            iaaaaaaaaaah
                                                                                  aahhp        fhaaaaaaah
                                                                                  aaaaa           haaahfiau
                                                                                  aaaaap               aaaap
  aaap     pppp                                                                   aaaahf            ahaaaaaah
   hhp     ihh                        p                anfnp                      hhh             ihhpaaaaaaah
   hhh      hh    aaffhap      ahfff h  hhh    ihhp  phh                                         hhaaaaaaaaaaaap
   hhhp    ihh  phh     hhh  ihhh       hhh     hhh  hhh                                     apahaaaaaaaaaaaaaaah
   hhhffhhhhhh ihh      ihhp ihh        hhh     hhh   hhhhp                                 iaaaaaaaaaaaaaaaaaaaah
  ihhh     ihh hhh       hhp ihh        hhh     hhh     fhhhp                                iaaaaaaaaaaaaaaaaaaaah
  ihhp     ihh ihhp     ihh   hhh       ihh    ihhh p     fhhp                                haaaaaaaaaaaaaaaaaaaaap
  phhp     ihhp ffhhpcsahf     fhhhpp   fhhhenfihhhphp     hh                                  haaaaaaaaaaaaaaaaaaaahh
           ffff                    f  f          ffffffhnfff                             hhp    fhaaaaaaaaaaaaaaaaaahhh
                                                                                   a     haap      fhaaaaaaaaaaaaaaahhhf
               hhhhfffhhhp        s                                sanup          iaahp     fh        fhhfffhff       a
               ihhh     hhh   phf  fihp    aphfffhh hhhh   ihhhf shp                haahu                    apphhaahh
               ihhh     hhh ihh      ihh  hhh       ihh     hhp  ihh                                 ahhpaapaaaaaaaah
               ihhp    ahhf hh        hhpihh        ihh     ihp   hhhhp                   haaaaaa apaaaaaaaaaaaaaaah
               ihhppaphff   hhp       hhhihhp       ihh     ihp    ffhhhp                   fhaaaaaaaaaaaaaaaaaaaah
               ihhh         ihhp     ph   hhhp      ihh     hhp i     fhhh                     aaaaaaaaaaaaaaaaaah
               ihh           ffhhhhhf      fhhhp    fhhhpaefhhhpip     ph                      aaaaaaaaaaaaaaaah
               hhh                            f  fff         ffffhhhnfff                      iaaaaaaaaaaaaaaah
              ahhh                                                                          ahhaaaaaaaaaaaaaah
                                                                                        aphaaaaaaaaaaaaaaaaa
                                                                                     ahaaaaaaaaaaaaaaaaaaah
                                                                                   paaaaaaaaaaaaaaaaaaaaah
                                                                                  aaaaaaaaaaaaaaaaaaaaaah
                                                                                  aaaaaaaaaaaaaaaaaaaah
                                                                                  aaaaaaaaaaaaaaaaaaah
                                                                                  aaaaaaaaaaaaaaaaa*/

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/interfaces/IERC4906.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";

interface IUniswapV2Factory {
    function createPair(address tokenA, address tokenB)
        external
        returns (address pair);
}

interface IUniswapV2Router02 {
    function factory() external pure returns (address);

    function WPLS() external pure returns (address);

    function swapExactETHForTokens(
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external payable returns (uint256[] memory amounts);

    function getAmountsOut(uint256 amountIn, address[] calldata path)
        external
        view
        returns (uint256[] memory amounts);
}

interface IERC5192 {
    event Locked(uint256 tokenId);

    event Unlocked(uint256 tokenId);

    function locked(uint256 tokenId) external view returns (bool);
}

abstract contract Constants {
    uint256 internal constant SECONDS_PER_DAY = 86400;
    uint256 internal constant INVALID_TOKEN_ID = 2**256 - 1;

    uint256 internal constant INITIAL_SUPPLY = 555_500_000_000;
    address internal constant TREASURY_WALLET =
        0x1e18ed1bfCa02e59a43de32c60Ac0FD4923b64b5;

    uint256 internal constant BOOSTER_PRICE = 123456 ether;

    uint256 internal constant CLAIM_PERIOD = 92 * SECONDS_PER_DAY; // approximately 3 months

    uint256 internal constant BUY_AND_BURN_MINIMUM_BALANCE = 1 ether;
    uint256 internal constant BUY_AND_BURN_REWARD_PERCENTAGE = 369;
    uint256 internal constant BUY_AND_BURN_REWARD_PERCENTAGE_DIVIDER = 10000;
    uint256 internal constant BUY_AND_BURN_MAXIMUM_BALANCE = 100000000 ether; // PLS

    address internal constant ROUTER_ADDRESS =
        0x165C3410fC91EF562C50559f7d2289fEbed552d9; // PulseX v2 Router
}

abstract contract BaseContract {
    address public aetherAddress;

    modifier magicOnlyComesFromAether() {
        require(
            aetherAddress == msg.sender,
            "Method is callable only from Aether"
        );
        _;
    }

    constructor(address addr) {
        aetherAddress = addr;
    }
}

abstract contract NFTBaseContract is
    ERC721,
    ERC721Burnable,
    BaseContract,
    Constants
{
    uint256 internal nextTokenId = 0;
    uint256 public totalSupply = 0;
    mapping(address => uint256[]) private ownedTokens;

    constructor(string memory name, string memory symbol)
        ERC721(name, symbol)
    {}

    function _mintNew(address to) internal returns (uint256 tokenId) {
        tokenId = nextTokenId++;
        _safeMint(to, tokenId);
        ++totalSupply;
    }

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

    function tokenURI(uint256 tokenId)
        public
        view
        virtual
        override
        returns (string memory)
    {
        _requireMinted(tokenId);
        return
            string(
                abi.encodePacked(
                    _baseURI(),
                    Strings.toString(block.chainid),
                    "/",
                    Strings.toString(tokenId)
                )
            );
    }

    function getTokenIdsForOwner(address owner)
        public
        view
        returns (uint256[] memory tokenIds)
    {
        return ownedTokens[owner];
    }

    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual override {
        super._beforeTokenTransfer(from, to, firstTokenId, batchSize);
        require(batchSize == 1, "Only transfer of one NFT is supported");
        require(firstTokenId != INVALID_TOKEN_ID, "Invalid token ID");

        if (from != address(0)) {
            // remove firstTokenId from ownedTokens[from]
            uint256 length = ownedTokens[from].length;
            for (uint256 i = 0; i < length; ) {
                if (ownedTokens[from][i] == firstTokenId) {
                    if (i < length - 1)
                        ownedTokens[from][i] = ownedTokens[from][length - 1];
                    ownedTokens[from].pop();
                    break;
                }
                unchecked {
                    ++i;
                }
            }
            if (ownedTokens[from].length == 0) {
                delete ownedTokens[from];
            }
        }

        if (to != address(0)) {
            ownedTokens[to].push(firstTokenId);
        }
    }
}

/**
    Hocus Pocus Booster NFT contract whose token can be used (locked) when starting
    brewing to boost its rate. Each Booster NFT has specific brewing rate bonus.

    Booster NFT can be acquired in 2 ways:
    - Holders of Hocus Pocus Sacrifice Spell NFT will get copy of their Spell NFT token
      preserving it's bonus.
    - Anybody can mint 10% Booster NFT forever for fixed fee.
*/
contract Booster is NFTBaseContract, IERC4906, IERC5192 {
    uint256 constant public price = BOOSTER_PRICE;

    struct Attributes {
        uint8 boosterBonus;
        uint8 gender;
        bytes30 name;
        uint64 summonTimestamp;
        /** Total number of brewings performed since birth. This values is preserved during forge process. */
        uint64 brewingsPerformed;
        /** Number of brewings performed on the current level. This value resets during forge process. */
        uint64 brewingsPerformedAtCurrentLevel;
        /** Total amount of HOC conjured. */
        uint256 conjuredTokens;
        /** If other than INVALID_TOKEN_ID it means that this Booster is locked in active brewing. */
        uint256 currentCauldronTokenId;
    }

    mapping(uint256 => Attributes) public attributes;

    /**
        Determines if copies of WIZ Spell NFTs were already minted. This should happen
        right after contract deployment.
    */
    bool public spellsMinted = false;

    constructor()
        NFTBaseContract("Hocus Pocus Booster", unicode"HOC🧙")
        BaseContract(msg.sender)
    {}

    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(ERC721, IERC165)
        returns (bool)
    {
        return
            interfaceId == type(IERC5192).interfaceId ||
            interfaceId == bytes4(0x49064906) || /*IERC4906*/
            super.supportsInterface(interfaceId);
    }

    function _baseURI() internal pure override returns (string memory) {
        return "https://nft.hocuspocus.finance/booster/";
    }

    function getSummonCost(uint256 amount)
        public
        view
        returns (uint256 cost, uint256 firstTokenId)
    {
        firstTokenId = nextTokenId;
        cost = amount * price;
    }

    function _mintNewWithBonus(address to, Attributes memory newAttributes)
        private
        returns (uint256 tokenId)
    {
        tokenId = _mintNew(to);
        attributes[tokenId] = newAttributes;
        emit Unlocked(tokenId);
    }

    /**
        Summon (mint) specified amount of Booster NFTs with 10% Bonus.
    */
    function summon(
        address to,
        uint256 amount,
        uint8 gender
    ) public payable {
        if (amount > 0) {
            require(spellsMinted, "Spell NFT copies are not minted yet");

            uint256 cost;
            uint256 firstTokenId;
            // Check if enough funds are provided considering current price
            (cost, firstTokenId) = getSummonCost(amount);
            require(msg.value >= cost, "Not enough funds for minting");

            // Do minting
            while (amount > 0) {
                _mintNewWithBonus(
                    to,
                    Attributes({
                        boosterBonus: 10,
                        gender: gender,
                        name: bytes30(0),
                        summonTimestamp: uint64(block.timestamp),
                        brewingsPerformed: 0,
                        brewingsPerformedAtCurrentLevel: 0,
                        conjuredTokens: 0,
                        currentCauldronTokenId: INVALID_TOKEN_ID
                    })
                );
                unchecked {
                    --amount;
                }
            }

            // Return remaining funds
            uint256 remainingBalance = msg.value - cost;
            if (remainingBalance > 0) {
                payable(msg.sender).transfer(remainingBalance);
            }
        }
    }

    function _burn(uint256 tokenId) internal virtual override {
        super._burn(tokenId);
        delete attributes[tokenId];
    }

    /** Forge 2 NFTS into new one with higher Bonus. */
    function forge(
        address to,
        uint256 tokenId1,
        uint256 tokenId2
    ) public returns (uint256 newTokenId1, uint256 newTokenId2) {
        require(
            ownerOf(tokenId1) == msg.sender,
            "You are not owner of 1st Booster NFT"
        );
        require(
            ownerOf(tokenId2) == msg.sender,
            "You are not owner of 2nd Booster NFT"
        );

        Attributes memory attributes1 = attributes[tokenId1];
        require(
            attributes1.currentCauldronTokenId == INVALID_TOKEN_ID,
            "Cannot forge 1st Booster NFT while it is used in brewing"
        );
        require(
            attributes1.brewingsPerformedAtCurrentLevel > 0,
            "1st Booster NFT has no brewing experience at its current level"
        );

        Attributes memory attributes2 = attributes[tokenId2];
        require(
            attributes2.currentCauldronTokenId == INVALID_TOKEN_ID,
            "Cannot forge 2nd Booster NFT while it is used in brewing"
        );
        require(
            attributes2.brewingsPerformedAtCurrentLevel > 0,
            "2nd Booster NFT has no brewing experience at its current level"
        );

        require(
            attributes1.gender == attributes2.gender,
            "Only Booster NFTs of same gender can be forged together"
        );

        // merge bonuses
        uint8 bonus1 = attributes1.boosterBonus;
        require(bonus1 <= 90, "1st NFTs has already highest Bonus");
        uint8 bonus2 = attributes2.boosterBonus;
        require(bonus2 <= 90, "2nd NFTs has already highest Bonus");
        bonus1 += bonus2;
        bonus2 = 0;
        if (bonus1 > 100) {
            bonus2 = bonus1 - 100;
            bonus1 = 100;
        }
        attributes1.boosterBonus = bonus1;
        // merge statistics for 1st

        attributes1.brewingsPerformed += attributes2.brewingsPerformed;
        attributes1.brewingsPerformedAtCurrentLevel = 0;
        attributes1.conjuredTokens += attributes2.conjuredTokens;

        // burn old and mint new NFTs
        _burn(tokenId1);
        _burn(tokenId2);
        newTokenId1 = _mintNewWithBonus(to, attributes1);
        newTokenId2 = 0;

        if (bonus2 > 0) {
            // reset statistics for 2nd
            attributes2.boosterBonus = bonus2;
            attributes2.brewingsPerformed = 0;
            attributes2.brewingsPerformedAtCurrentLevel = 0;
            attributes2.conjuredTokens = 0;
            newTokenId2 = _mintNewWithBonus(to, attributes2);
        }
    }

    function setName(uint256 tokenId, bytes30 name) public {
        require(
            ownerOf(tokenId) == msg.sender,
            "You are not owner of this NFT"
        );
        attributes[tokenId].name = name;
        emit MetadataUpdate(tokenId);
    }

    function getBoosterBonus(uint256 tokenId) public view returns (uint8) {
        return attributes[tokenId].boosterBonus;
    }

    function _lockForBrewing(uint256 tokenId, uint256 cauldronTokenId)
        public
        magicOnlyComesFromAether
    {
        require(
            attributes[tokenId].currentCauldronTokenId == INVALID_TOKEN_ID,
            "Cannot reused Booster while it is used in other brewing"
        );
        attributes[tokenId].currentCauldronTokenId = cauldronTokenId;
        emit Locked(tokenId);
        emit MetadataUpdate(tokenId);
    }

    function _unlockForBrewing(
        uint256 tokenId,
        uint256 conjuredTokens,
        bool finished
    ) public magicOnlyComesFromAether {
        if (finished) {
            attributes[tokenId].brewingsPerformed++;
            attributes[tokenId].brewingsPerformedAtCurrentLevel++;
        }
        attributes[tokenId].conjuredTokens += conjuredTokens;
        attributes[tokenId].currentCauldronTokenId = INVALID_TOKEN_ID;
        emit Unlocked(tokenId);
        emit MetadataUpdate(tokenId);
    }

    function locked(uint256 tokenId) external view returns (bool) {
        return attributes[tokenId].currentCauldronTokenId != INVALID_TOKEN_ID;
    }

    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual override {
        if (from != address(0)) {
            require(
                attributes[firstTokenId].currentCauldronTokenId ==
                    INVALID_TOKEN_ID,
                "Cannot transfer Booster while it is used in brewing"
            );
        }
        super._beforeTokenTransfer(from, to, firstTokenId, batchSize);
    }

    /** Helper structure for passing data to mintSpells(). */
    struct SpellNFTToken {
        address owner;
        uint8 bonus;
    }

    /**
        Creates copies for Spell NFT tokens
        This function is publicly callable, but can be called only once.
        After this is called, then mint() is unlocked.
    */
    function mintSpells(SpellNFTToken[] calldata tokens, bool finishMinting)
        public
    {
        require(!spellsMinted, "Spell NFT copies were already minted");

        for (uint256 tokenId = 0; tokenId < tokens.length; ) {
            SpellNFTToken memory token = tokens[tokenId];
            _mintNewWithBonus(
                token.owner,
                Attributes({
                    boosterBonus: token.bonus,
                    gender: 0,
                    name: bytes30(0),
                    summonTimestamp: uint64(block.timestamp),
                    brewingsPerformed: 0,
                    brewingsPerformedAtCurrentLevel: 0,
                    conjuredTokens: 0,
                    currentCauldronTokenId: INVALID_TOKEN_ID
                })
            );
            unchecked {
                tokenId++;
            }
        }

        spellsMinted = finishMinting;
    }

    function _withdraw() public magicOnlyComesFromAether {
        uint256 balance = address(this).balance;
        payable(msg.sender).transfer(balance);
    }
}

contract Dime is ERC20, ERC20Burnable, BaseContract, Constants {
    constructor(address poolAddress, uint256 poolAllocation)
        ERC20("Hocus Pocus Finance", "HOC")
        BaseContract(msg.sender)
    {
        _mint(msg.sender, INITIAL_SUPPLY * 10**decimals());
        _transfer(msg.sender, poolAddress, poolAllocation);
    }

    function _ignite(address from, uint256 amount)
        public
        magicOnlyComesFromAether
    {
        _burn(from, amount);
    }

    function _conjure(address to, uint256 amount)
        public
        magicOnlyComesFromAether
    {
        _mint(to, amount);
    }
}

contract Cauldron is NFTBaseContract {
    struct Attributes {
        uint256 amount; // 32
        uint256 boosterTokenId; // 32
        uint64 startTimestamp; // 8
        uint32 periodDays; // 4
    }

    struct Progress {
        /** Original HOC base amount when brewing started. */
        uint256 baseAmountFull;
        /** Restored part of original HOC base amount. */
        uint256 baseAmountCurrent;
        /** Collectaeble HOC from brewing bonus rate at the end of brewing. */
        uint256 boosterBonusAmountFull;
        /** So far collected HOC from brewing bonus rate. */
        uint256 boosterBonusAmountCurrent;
        /** Collectable HOC from long bonus rate at the end of brewing. */
        uint256 longBonusAmountFull;
        /** So far collected HOC from long bonus rate. */
        uint256 longBonusAmountCurrent;
        /** Number of seconds this brewing is running. */
        uint64 servedSeconds;
        /** Number of days this brewing is running. */
        uint32 servedDays;
        /** Brewing rate bonus = base rate + booster rate (stored as nominator par of fraction with constant denominator). */
        uint32 boosterBonusRate;
        /** Brewing rate bonus based on length of brewing (stored as nominitor par of fraction with constant denominator). */
        uint32 longBonusRate;
        /** True if brewing is finished. */
        bool finished;
    }

    /** Mapping of tokenId to Attributes record. */
    mapping(uint256 => Attributes) public attributes;

    Booster private boosterContract;

    constructor(Booster _boosterContract)
        NFTBaseContract("Hocus Pocus Cauldron", unicode"HOC🍯")
        BaseContract(msg.sender)
    {
        boosterContract = _boosterContract;
    }

    function _baseURI() internal pure override returns (string memory) {
        return "https://nft.hocuspocus.finance/cauldron/";
    }

    function _conjure(
        Attributes memory record,
        address sender,
        uint8 boosterBonus
    ) public magicOnlyComesFromAether returns (uint256 tokenId) {
        // check minimum period
        require(
            record.periodDays >= getMinimumPeriod(boosterBonus),
            "Too short period"
        );

        tokenId = NFTBaseContract._mintNew(sender);
        attributes[tokenId] = record;
    }

    function _ignite(uint256 tokenId) public magicOnlyComesFromAether {
        _burn(tokenId);
        delete attributes[tokenId];
    }

    /**
        Computes statistics of brewing progress.
    */
    function _getProgress(Attributes storage record, bool assumeFullFinish)
        private
        view
        returns (Progress memory progress)
    {
        progress.servedSeconds = uint64(
            block.timestamp - record.startTimestamp
        );
        progress.servedDays = uint32(progress.servedSeconds / SECONDS_PER_DAY);

        uint32 periodDays = record.periodDays;
        uint256 periodSeconds = uint256(periodDays) * SECONDS_PER_DAY;

        uint256 denominator = 10000000 * 365; // 365 means that % values below are per year

        // 3.69% as fraction with denominator
        progress.boosterBonusRate = 369000;
        if (record.boosterTokenId != INVALID_TOKEN_ID) {
            uint8 boosterBonus = boosterContract.getBoosterBonus(
                record.boosterTokenId
            );
            progress.boosterBonusRate +=
                (progress.boosterBonusRate * uint32(boosterBonus)) /
                100;
        }

        uint256 servedSecondsCapped = progress.servedSeconds;
        if (servedSecondsCapped > periodSeconds) {
            servedSecondsCapped = periodSeconds;
            progress.finished = true;
        } else if (assumeFullFinish) {
            progress.finished = true;
        }

        // 0.01845% nominator part of fraction with denominator
        progress.longBonusRate = progress.finished ? periodDays * 1845 : 0;

        uint256 amount = record.amount;
        progress.baseAmountFull = amount;
        progress.baseAmountCurrent =
            (progress.baseAmountFull * servedSecondsCapped) /
            periodSeconds;

        progress.boosterBonusAmountFull =
            (amount * progress.boosterBonusRate * periodDays) /
            denominator;
        progress.boosterBonusAmountCurrent =
            (progress.boosterBonusAmountFull * servedSecondsCapped) /
            periodSeconds;

        progress.longBonusAmountFull =
            (amount * progress.longBonusRate * periodDays) /
            denominator;
        progress.longBonusAmountCurrent =
            (progress.longBonusAmountFull * servedSecondsCapped) /
            periodSeconds;
    }

    /** Public version of _getProgress(). */
    function getProgress(uint256 tokenId, bool assumeFullFinish)
        public
        view
        returns (Progress memory progress)
    {
        Attributes storage record = attributes[tokenId];
        return _getProgress(record, assumeFullFinish);
    }

    /**
        Computes minimum period based on Booster Bonus.
        - Bonus 100%:  7 days
        - Bonus  90%:  8 days
        - ...
        - Bonus  20%: 15 days
        - Bonus  10%: 16 days
        - Bonus   0%: 30 days
    */
    function getMinimumPeriod(uint8 boosterBonus)
        public
        pure
        returns (uint32 periodDays)
    {
        require(boosterBonus <= 100, "Bonus must be in range from 0 to 100");
        if (boosterBonus == 0) return 30;
        return 17 - boosterBonus / 10;
    }

    function _finish(uint256 tokenId, address sender)
        public
        view
        magicOnlyComesFromAether
        returns (
            uint256 conjuredTokens,
            uint256 boosterTokenId,
            Progress memory progress
        )
    {
        require(_exists(tokenId), "Cauldron does not exist");
        address owner = ownerOf(tokenId);
        require(owner == sender, "Only Cauldron owner can finish it");
        Attributes storage record = attributes[tokenId];
        progress = _getProgress(record, false);
        conjuredTokens =
            progress.baseAmountCurrent +
            progress.boosterBonusAmountCurrent +
            progress.longBonusAmountCurrent;
        boosterTokenId = record.boosterTokenId;
    }
}

contract Aether is IERC721Receiver, Constants {
    Dime public dimeContract;
    Booster public boosterContract;
    Cauldron public cauldronContract;

    bytes32 private merkleRoot;

    receive() external payable {}

    constructor(
        address poolAddress,
        uint256 poolAllocation,
        bytes32 _merkleRoot
    ) {
        dimeContract = new Dime(poolAddress, poolAllocation);
        boosterContract = new Booster();
        cauldronContract = new Cauldron(boosterContract);
        merkleRoot = _merkleRoot;

        IUniswapV2Router02 dexRouter = IUniswapV2Router02(ROUTER_ADDRESS);

        IUniswapV2Factory(dexRouter.factory()).createPair(
            dexRouter.WPLS(),
            address(dimeContract)
        );
    }

    /** Timestamp when claim period is over - approximately 6 months after deployment. */
    uint256 public claimEndTimestamp = block.timestamp + CLAIM_PERIOD;

    /**
        Public function to claim tokens for sender.
    */
    function wizClaimDimes(bytes32[] memory proof, uint256 amount) public {
        require(block.timestamp <= claimEndTimestamp, "Claim period is over");
        _wizClaimDimes(proof, msg.sender, amount);
    }

    mapping(address => uint256) public dimesClaimed;

    /**
        Unrestricted claim function which does not check right to claim for provided address.
    */
    function _wizClaimDimes(
        bytes32[] memory proof,
        address addr,
        uint256 amount
    ) private {
        bytes32 leaf = keccak256(
            bytes.concat(keccak256(abi.encode(addr, amount)))
        );
        require(MerkleProof.verify(proof, merkleRoot, leaf), "Invalid proof");
        require(dimesClaimed[addr] == 0, "Already claimed");
        dimeContract.transfer(addr, amount);
        dimesClaimed[addr] = amount;
    }

    /**
        After claimEndTimestamp allows anybody to burn unclaimed HOC.
    */
    function burnUnclaimedDimes() public {
        require(
            block.timestamp > claimEndTimestamp,
            "Claim period is not over yet"
        );
        uint256 amount = dimeContract.balanceOf(address(this));
        if (amount > 0) {
            dimeContract._ignite(address(this), amount);
        }
    }

    event BrewingStarted(
        address indexed cauldronOwner,
        uint256 cauldronTokenId,
        uint256 boosterTokenId,
        uint256 amount,
        uint32 periodDays,
        uint8 boosterBonus
    );

    /**
        Starts Brewing process:
        - Provided amount of HOC tokens get ignited (burnt) to start brewing.
        - If valid Booster NFT is provided, use it's bonus to speead up brewing rate.
        - Mints Cauldron NFT which holds all necessary information to track Cauldron's progress.
    */
    function startBrewing(
        uint256 amount,
        uint32 periodDays,
        uint256 boosterTokenId
    ) public returns (uint256 cauldronTokenId) {
        require(amount > 0, "Amount must be greater than zero");
        require(periodDays <= 3690, "Maximum period if 3690 days");
        require(
            dimeContract.balanceOf(msg.sender) >= amount,
            "Insufficient balance"
        );

        // Burn provided HOC amount, as it was thrown into Cauldron
        dimeContract._ignite(msg.sender, amount);

        // Resolve booster bonus, if provided
        uint8 boosterBonus = 0;
        if (boosterTokenId != INVALID_TOKEN_ID) {
            // check if Booster NFT is associated with sender
            require(
                boosterContract.ownerOf(boosterTokenId) == msg.sender,
                "Cannot start brewing with somebody else's booster"
            );
            boosterBonus = boosterContract.getBoosterBonus(boosterTokenId);
        }

        // Mint Cauldron NFT
        cauldronTokenId = cauldronContract._conjure(
            Cauldron.Attributes({
                amount: amount,
                startTimestamp: uint64(block.timestamp),
                periodDays: periodDays,
                boosterTokenId: boosterTokenId
            }),
            msg.sender,
            boosterBonus
        );

        if (boosterTokenId != INVALID_TOKEN_ID) {
            boosterContract._lockForBrewing(boosterTokenId, cauldronTokenId);
        }

        emit BrewingStarted(
            msg.sender,
            cauldronTokenId,
            boosterTokenId,
            amount,
            periodDays,
            boosterBonus
        );
    }

    event BrewingFinished(
        address indexed cauldronOwner,
        uint256 cauldronTokenId,
        uint256 boosterTokenId,
        uint256 baseAmount,
        uint256 boosterBonusAmount,
        uint256 longBonusAmount,
        uint64 servedSeconds,
        uint32 servedDays,
        bool finished
    );

    /**
        Finished brewing process:
        - Conjures (mints) amount of HOC tokens based on Progress
          (this includes calculation in case of finishing brewing too early).
        - Ignites (burns) Cauldron NFT.
    */
    function finishBrewing(uint256 tokenId) public {
        (
            uint256 conjuredTokens,
            uint256 boosterTokenId,
            Cauldron.Progress memory progress
        ) = cauldronContract._finish(tokenId, msg.sender);
        // Conjure tokens for owner
        dimeContract._conjure(msg.sender, conjuredTokens);

        // Return Booster NFT to its original owner, not to current NFT owner
        if (boosterTokenId != INVALID_TOKEN_ID) {
            boosterContract._unlockForBrewing(
                boosterTokenId,
                conjuredTokens,
                progress.finished
            );
        }

        emit BrewingFinished(
            msg.sender,
            tokenId,
            boosterTokenId,
            progress.baseAmountCurrent,
            progress.boosterBonusAmountCurrent,
            progress.longBonusAmountCurrent,
            progress.servedSeconds,
            progress.servedDays,
            progress.finished
        );

        // finally burn this Cauldron NFT token
        cauldronContract._ignite(tokenId);
    }

    event BuyAndBurn(
        uint256 funds,
        uint256 fundsForReward,
        uint256 fundsForTreasury,
        uint256 fundsForBuy,
        uint256 amountBurnt
    );

    /**
        Public function to perform Buy & Burn feature:
        - Withdraws funds collected for minting Booster NFT contract.
        - Sender of transaction receives reward to incentivize doing it.
        - 75% of remaining funds goes to Treasury Wallet.
        - Rest of funds is used to buy HOC tokens from main HOC/PLS pool and burn it.
    */
    function buyAndBurn() public {
        // Ather can withdraw() funds from Booster NFT contract
        boosterContract._withdraw();
        uint256 funds = address(this).balance;
        require(funds >= BUY_AND_BURN_MINIMUM_BALANCE, "Not enough PLS");
        if (funds > BUY_AND_BURN_MAXIMUM_BALANCE)
            funds = BUY_AND_BURN_MAXIMUM_BALANCE;

        IUniswapV2Router02 dexRouter = IUniswapV2Router02(ROUTER_ADDRESS);

        uint256 fundsForReward = (funds * BUY_AND_BURN_REWARD_PERCENTAGE) /
            BUY_AND_BURN_REWARD_PERCENTAGE_DIVIDER;

        funds -= fundsForReward;

        // 25% of remaining funds used to buy and burn
        uint256 fundsForBuy = funds / 4;

        address[] memory path = new address[](2);
        path[0] = dexRouter.WPLS();
        path[1] = address(dimeContract);
        uint256[] memory amounts = dexRouter.swapExactETHForTokens{
            value: fundsForBuy
        }(
            0, // accept any amount of tokens
            path,
            address(this), // send tokens to this contract
            block.timestamp
        );
        uint256 amountBurnt = amounts[1]; // HOC
        // Burn tokens which were bought
        dimeContract._ignite(address(this), amountBurnt);

        // 75% of funds go to Treasury Wallet
        uint256 fundsForTreasury = funds - fundsForBuy;
        payable(TREASURY_WALLET).transfer(fundsForTreasury);

        payable(msg.sender).transfer(fundsForReward);

        emit BuyAndBurn(
            funds,
            fundsForReward,
            fundsForTreasury,
            fundsForBuy,
            amountBurnt
        );
    }

    function onERC721Received(
        address,
        address,
        uint256,
        bytes memory
    ) external pure override returns (bytes4) {
        return IERC721Receiver.onERC721Received.selector;
    }
}
        

@openzeppelin/contracts/interfaces/IERC165.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)

pragma solidity ^0.8.0;

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

@openzeppelin/contracts/interfaces/IERC4906.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC4906.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";
import "./IERC721.sol";

/// @title EIP-721 Metadata Update Extension
interface IERC4906 is IERC165, IERC721 {
    /// @dev This event emits when the metadata of a token is changed.
    /// So that the third-party platforms such as NFT market could
    /// timely update the images and related attributes of the NFT.
    event MetadataUpdate(uint256 _tokenId);

    /// @dev This event emits when the metadata of a range of tokens is changed.
    /// So that the third-party platforms such as NFT market could
    /// timely update the images and related attributes of the NFTs.
    event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);
}
          

@openzeppelin/contracts/interfaces/IERC721.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol)

pragma solidity ^0.8.0;

import "../token/ERC721/IERC721.sol";
          

@openzeppelin/contracts/token/ERC20/ERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.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.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * The default value of {decimals} is 18. To change this, you should override
 * this function so it returns a different value.
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead 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, IERC20Metadata {
    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}.
     *
     * All two 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 override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override 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 default value returned by this function, unless
     * it's overridden.
     *
     * 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 override 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:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, 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}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, 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}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, 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) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, 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) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * This 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:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(address from, address to, uint256 amount) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _balances[to] += amount;
        }

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, 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:
     *
     * - `account` 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;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _balances[account] += amount;
        }
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(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");
        unchecked {
            _balances[account] = accountBalance - amount;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _totalSupply -= amount;
        }

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

        _afterTokenTransfer(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 Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - 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 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 {}

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

@openzeppelin/contracts/token/ERC20/IERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool);
}
          

@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Extension of {ERC20} that allows token holders to destroy both their own
 * tokens and those that they have an allowance for, in a way that can be
 * recognized off-chain (via event analysis).
 */
abstract contract ERC20Burnable is Context, ERC20 {
    /**
     * @dev Destroys `amount` tokens from the caller.
     *
     * See {ERC20-_burn}.
     */
    function burn(uint256 amount) public virtual {
        _burn(_msgSender(), amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, deducting from the caller's
     * allowance.
     *
     * See {ERC20-_burn} and {ERC20-allowance}.
     *
     * Requirements:
     *
     * - the caller must have allowance for ``accounts``'s tokens of at least
     * `amount`.
     */
    function burnFrom(address account, uint256 amount) public virtual {
        _spendAllowance(account, _msgSender(), amount);
        _burn(account, amount);
    }
}
          

@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}
          

@openzeppelin/contracts/token/ERC721/ERC721.sol

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

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _ownerOf(tokenId);
        require(owner != address(0), "ERC721: invalid token ID");
        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) {
        _requireMinted(tokenId);

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

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

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

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

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_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: caller is not token owner or 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: caller is not token owner or 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 the owner of the `tokenId`. Does NOT revert if token doesn't exist
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

    /**
     * @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 _ownerOf(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) {
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == 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, 1);

        // Check that tokenId was not minted by `_beforeTokenTransfer` hook
        require(!_exists(tokenId), "ERC721: token already minted");

        unchecked {
            // Will not overflow unless all 2**256 token ids are minted to the same owner.
            // Given that tokens are minted one by one, it is impossible in practice that
            // this ever happens. Might change if we allow batch minting.
            // The ERC fails to describe this case.
            _balances[to] += 1;
        }

        _owners[tokenId] = to;

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

        _afterTokenTransfer(address(0), to, tokenId, 1);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

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

        // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
        owner = ERC721.ownerOf(tokenId);

        // Clear approvals
        delete _tokenApprovals[tokenId];

        unchecked {
            // Cannot overflow, as that would require more tokens to be burned/transferred
            // out than the owner initially received through minting and transferring in.
            _balances[owner] -= 1;
        }
        delete _owners[tokenId];

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

        _afterTokenTransfer(owner, address(0), tokenId, 1);
    }

    /**
     * @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 from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId, 1);

        // Check that tokenId was not transferred by `_beforeTokenTransfer` hook
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");

        // Clear approvals from the previous owner
        delete _tokenApprovals[tokenId];

        unchecked {
            // `_balances[from]` cannot overflow for the same reason as described in `_burn`:
            // `from`'s balance is the number of token held, which is at least one before the current
            // transfer.
            // `_balances[to]` could overflow in the conditions described in `_mint`. That would require
            // all 2**256 token ids to be minted, which in practice is impossible.
            _balances[from] -= 1;
            _balances[to] += 1;
        }
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

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

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

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    /// @solidity memory-safe-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. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
     * - When `from` is zero, the tokens will be minted for `to`.
     * - When `to` is zero, ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}

    /**
     * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
     * - When `from` is zero, the tokens were minted for `to`.
     * - When `to` is zero, ``from``'s tokens were burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}

    /**
     * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
     *
     * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant
     * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such
     * that `ownerOf(tokenId)` is `a`.
     */
    // solhint-disable-next-line func-name-mixedcase
    function __unsafe_increaseBalance(address account, uint256 amount) internal {
        _balances[account] += amount;
    }
}
          

@openzeppelin/contracts/token/ERC721/IERC721.sol

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

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

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

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

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

@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol

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

pragma solidity ^0.8.0;

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

@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Burnable.sol)

pragma solidity ^0.8.0;

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

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

@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

@openzeppelin/contracts/utils/Address.sol

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

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/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.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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

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

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}
          

@openzeppelin/contracts/utils/Context.sol

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

pragma solidity ^0.8.0;

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

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

@openzeppelin/contracts/utils/Strings.sol

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

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.sol";

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

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @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] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

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

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}
          

@openzeppelin/contracts/utils/cryptography/MerkleProof.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.2) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The tree and the proofs can be generated using our
 * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
 * You will find a quickstart guide in the readme.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the merkle tree could be reinterpreted as a leaf value.
 * OpenZeppelin's JavaScript library generates merkle trees that are safe
 * against this attack out of the box.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Calldata version of {verify}
     *
     * _Available since v4.7._
     */
    function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
        return processProofCalldata(proof, leaf) == root;
    }

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

    /**
     * @dev Calldata version of {processProof}
     *
     * _Available since v4.7._
     */
    function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function multiProofVerify(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProof(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Calldata version of {multiProofVerify}
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function multiProofVerifyCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProofCalldata(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
     * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
     * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
     * respectively.
     *
     * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
     * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
     * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
     *
     * _Available since v4.7._
     */
    function processMultiProof(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 proofLen = proof.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i]
                ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
                : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            require(proofPos == proofLen, "MerkleProof: invalid multiproof");
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    /**
     * @dev Calldata version of {processMultiProof}.
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function processMultiProofCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 proofLen = proof.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i]
                ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
                : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            require(proofPos == proofLen, "MerkleProof: invalid multiproof");
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
        return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}
          

@openzeppelin/contracts/utils/introspection/ERC165.sol

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

@openzeppelin/contracts/utils/introspection/IERC165.sol

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

pragma solidity ^0.8.0;

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

@openzeppelin/contracts/utils/math/Math.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}
          

@openzeppelin/contracts/utils/math/SignedMath.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}
          

Compiler Settings

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

Contract ABI

[{"type":"constructor","inputs":[{"type":"address","name":"poolAddress","internalType":"address"},{"type":"uint256","name":"poolAllocation","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"_conjure","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"_ignite","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"aetherAddress","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burn","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burnFrom","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"decreaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"subtractedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"increaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"addedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"address","name":"spender","indexed":true},{"type":"uint256","name":"value","indexed":false}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","indexed":true},{"type":"address","name":"to","indexed":true},{"type":"uint256","name":"value","indexed":false}],"anonymous":false}]
              

Contract Creation Code

0x60806040523480156200001157600080fd5b506040516200135f3803806200135f83398101604081905262000034916200040d565b604080518082018252601381527f486f63757320506f6375732046696e616e63650000000000000000000000000060208083019182528351808501909452600380855262484f4360e81b91850191909152825133949262000096929162000367565b508051620000ac90600490602084019062000367565b5050600580546001600160a01b0319166001600160a01b039390931692909217909155506200010233620000de601290565b620000eb90600a6200055e565b620000fc9064815661530062000576565b62000117565b6200010f338383620001cd565b5050620005f0565b6001600160a01b038216620001735760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064015b60405180910390fd5b806002600082825462000187919062000598565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481526000805160206200133f833981519152910160405180910390a35050565b6001600160a01b038316620002335760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016200016a565b6001600160a01b038216620002975760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016200016a565b6001600160a01b03831660009081526020819052604090205481811015620003115760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016200016a565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290926000805160206200133f833981519152910160405180910390a350505050565b8280546200037590620005b3565b90600052602060002090601f016020900481019282620003995760008555620003e4565b82601f10620003b457805160ff1916838001178555620003e4565b82800160010185558215620003e4579182015b82811115620003e4578251825591602001919060010190620003c7565b50620003f2929150620003f6565b5090565b5b80821115620003f25760008155600101620003f7565b600080604083850312156200042157600080fd5b82516001600160a01b03811681146200043957600080fd5b6020939093015192949293505050565b634e487b7160e01b600052601160045260246000fd5b600181815b80851115620004a057816000190482111562000484576200048462000449565b808516156200049257918102915b93841c939080029062000464565b509250929050565b600082620004b95750600162000558565b81620004c85750600062000558565b8160018114620004e15760028114620004ec576200050c565b600191505062000558565b60ff84111562000500576200050062000449565b50506001821b62000558565b5060208310610133831016604e8410600b841016171562000531575081810a62000558565b6200053d83836200045f565b806000190482111562000554576200055462000449565b0290505b92915050565b60006200056f60ff841683620004a8565b9392505050565b600081600019048311821515161562000593576200059362000449565b500290565b60008219821115620005ae57620005ae62000449565b500190565b600181811c90821680620005c857607f821691505b60208210811415620005ea57634e487b7160e01b600052602260045260246000fd5b50919050565b610d3f80620006006000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c8063475e54741161009757806395d89b411161006657806395d89b411461022f578063a457c2d714610237578063a9059cbb1461024a578063dd62ed3e1461025d57600080fd5b8063475e5474146101cd5780635a95c793146101e057806370a08231146101f357806379cc67901461021c57600080fd5b8063313ce567116100d3578063313ce5671461016b578063395093511461017a57806342966c681461018d57806345a78ec4146101a257600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014657806323b872dd14610158575b600080fd5b61010d610296565b60405161011a9190610b63565b60405180910390f35b610136610131366004610bd4565b610328565b604051901515815260200161011a565b6002545b60405190815260200161011a565b610136610166366004610bfe565b610340565b6040516012815260200161011a565b610136610188366004610bd4565b610364565b6101a061019b366004610c3a565b6103a3565b005b6005546101b5906001600160a01b031681565b6040516001600160a01b03909116815260200161011a565b6101a06101db366004610bd4565b6103b0565b6101a06101ee366004610bd4565b610429565b61014a610201366004610c53565b6001600160a01b031660009081526020819052604090205490565b6101a061022a366004610bd4565b610499565b61010d6104a4565b610136610245366004610bd4565b6104b3565b610136610258366004610bd4565b61055d565b61014a61026b366004610c75565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6060600380546102a590610ca8565b80601f01602080910402602001604051908101604052809291908181526020018280546102d190610ca8565b801561031e5780601f106102f35761010080835404028352916020019161031e565b820191906000526020600020905b81548152906001019060200180831161030157829003601f168201915b5050505050905090565b60003361033681858561056b565b5060019392505050565b60003361034e8582856106c4565b610359858585610756565b506001949350505050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190610336908290869061039e908790610ce3565b61056b565b6103ad3382610943565b50565b6005546001600160a01b0316331461041b5760405162461bcd60e51b815260206004820152602360248201527f4d6574686f642069732063616c6c61626c65206f6e6c792066726f6d204165746044820152623432b960e91b60648201526084015b60405180910390fd5b6104258282610943565b5050565b6005546001600160a01b0316331461048f5760405162461bcd60e51b815260206004820152602360248201527f4d6574686f642069732063616c6c61626c65206f6e6c792066726f6d204165746044820152623432b960e91b6064820152608401610412565b6104258282610aa4565b61041b8233836106c4565b6060600480546102a590610ca8565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156105505760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610412565b610359828686840361056b565b600033610336818585610756565b6001600160a01b0383166105e65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610412565b6001600160a01b0382166106625760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610412565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b03838116600090815260016020908152604080832093861683529290522054600019811461075057818110156107435760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610412565b610750848484840361056b565b50505050565b6001600160a01b0383166107d25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610412565b6001600160a01b03821661084e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610412565b6001600160a01b038316600090815260208190526040902054818110156108dd5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610412565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610750565b6001600160a01b0382166109bf5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610412565b6001600160a01b03821660009081526020819052604090205481811015610a4e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610412565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91016106b7565b6001600160a01b038216610afa5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610412565b8060026000828254610b0c9190610ce3565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600060208083528351808285015260005b81811015610b9057858101830151858201604001528201610b74565b81811115610ba2576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114610bcf57600080fd5b919050565b60008060408385031215610be757600080fd5b610bf083610bb8565b946020939093013593505050565b600080600060608486031215610c1357600080fd5b610c1c84610bb8565b9250610c2a60208501610bb8565b9150604084013590509250925092565b600060208284031215610c4c57600080fd5b5035919050565b600060208284031215610c6557600080fd5b610c6e82610bb8565b9392505050565b60008060408385031215610c8857600080fd5b610c9183610bb8565b9150610c9f60208401610bb8565b90509250929050565b600181811c90821680610cbc57607f821691505b60208210811415610cdd57634e487b7160e01b600052602260045260246000fd5b50919050565b60008219821115610d0457634e487b7160e01b600052601160045260246000fd5b50019056fea26469706673582212204cdcb8fcf0acae18a0f881966c735b41cdc9ee1d9c4d7ff0ec82540b105f383564736f6c63430008090033ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef000000000000000000000000f06dbb577faaa479f68429e65274944679af0bc1000000000000000000000000000000000000000063b528f7205b1d2fe03c0000

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063475e54741161009757806395d89b411161006657806395d89b411461022f578063a457c2d714610237578063a9059cbb1461024a578063dd62ed3e1461025d57600080fd5b8063475e5474146101cd5780635a95c793146101e057806370a08231146101f357806379cc67901461021c57600080fd5b8063313ce567116100d3578063313ce5671461016b578063395093511461017a57806342966c681461018d57806345a78ec4146101a257600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014657806323b872dd14610158575b600080fd5b61010d610296565b60405161011a9190610b63565b60405180910390f35b610136610131366004610bd4565b610328565b604051901515815260200161011a565b6002545b60405190815260200161011a565b610136610166366004610bfe565b610340565b6040516012815260200161011a565b610136610188366004610bd4565b610364565b6101a061019b366004610c3a565b6103a3565b005b6005546101b5906001600160a01b031681565b6040516001600160a01b03909116815260200161011a565b6101a06101db366004610bd4565b6103b0565b6101a06101ee366004610bd4565b610429565b61014a610201366004610c53565b6001600160a01b031660009081526020819052604090205490565b6101a061022a366004610bd4565b610499565b61010d6104a4565b610136610245366004610bd4565b6104b3565b610136610258366004610bd4565b61055d565b61014a61026b366004610c75565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6060600380546102a590610ca8565b80601f01602080910402602001604051908101604052809291908181526020018280546102d190610ca8565b801561031e5780601f106102f35761010080835404028352916020019161031e565b820191906000526020600020905b81548152906001019060200180831161030157829003601f168201915b5050505050905090565b60003361033681858561056b565b5060019392505050565b60003361034e8582856106c4565b610359858585610756565b506001949350505050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190610336908290869061039e908790610ce3565b61056b565b6103ad3382610943565b50565b6005546001600160a01b0316331461041b5760405162461bcd60e51b815260206004820152602360248201527f4d6574686f642069732063616c6c61626c65206f6e6c792066726f6d204165746044820152623432b960e91b60648201526084015b60405180910390fd5b6104258282610943565b5050565b6005546001600160a01b0316331461048f5760405162461bcd60e51b815260206004820152602360248201527f4d6574686f642069732063616c6c61626c65206f6e6c792066726f6d204165746044820152623432b960e91b6064820152608401610412565b6104258282610aa4565b61041b8233836106c4565b6060600480546102a590610ca8565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156105505760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610412565b610359828686840361056b565b600033610336818585610756565b6001600160a01b0383166105e65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610412565b6001600160a01b0382166106625760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610412565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b03838116600090815260016020908152604080832093861683529290522054600019811461075057818110156107435760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610412565b610750848484840361056b565b50505050565b6001600160a01b0383166107d25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610412565b6001600160a01b03821661084e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610412565b6001600160a01b038316600090815260208190526040902054818110156108dd5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610412565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610750565b6001600160a01b0382166109bf5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610412565b6001600160a01b03821660009081526020819052604090205481811015610a4e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610412565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91016106b7565b6001600160a01b038216610afa5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610412565b8060026000828254610b0c9190610ce3565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600060208083528351808285015260005b81811015610b9057858101830151858201604001528201610b74565b81811115610ba2576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114610bcf57600080fd5b919050565b60008060408385031215610be757600080fd5b610bf083610bb8565b946020939093013593505050565b600080600060608486031215610c1357600080fd5b610c1c84610bb8565b9250610c2a60208501610bb8565b9150604084013590509250925092565b600060208284031215610c4c57600080fd5b5035919050565b600060208284031215610c6557600080fd5b610c6e82610bb8565b9392505050565b60008060408385031215610c8857600080fd5b610c9183610bb8565b9150610c9f60208401610bb8565b90509250929050565b600181811c90821680610cbc57607f821691505b60208210811415610cdd57634e487b7160e01b600052602260045260246000fd5b50919050565b60008219821115610d0457634e487b7160e01b600052601160045260246000fd5b50019056fea26469706673582212204cdcb8fcf0acae18a0f881966c735b41cdc9ee1d9c4d7ff0ec82540b105f383564736f6c63430008090033