ETH Price: $3,431.38 (-2.40%)

Token

BabyDoge (BabyDoge)
 

Overview

Max Total Supply

10,000 BabyDoge

Holders

2,375

Market

Volume (24H)

0.9065 ETH

Min Price (24H)

$231.61 @ 0.067498 ETH

Max Price (24H)

$1,715.69 @ 0.500000 ETH
Balance
3 BabyDoge
0x67d98ae6ef1c3c4f6acef145c74a3d54e4d878e0
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
BabyDoge

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 26 : BabyDogeNft.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.4;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./uniswap/IUniswapV2Router02.sol";
import "./uniswap/IUniswapV2Factory.sol";
import "./uniswap/IUniswapV2Pair.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "./ERC721A.sol";

contract BabyDoge is
    VRFConsumerBase,
    ERC721A,
    Ownable,
    ReentrancyGuard
{
    using Counters for Counters.Counter;
    using SafeERC20 for IERC20;
    using Address for *;
    uint16 internal devTeamPercent;
    uint16 internal lotoPercent;
    bytes32 internal immutable keyHash;
    string private _baseTokenURI;
    address private constant FACTORY =
        0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;
    address private constant ROUTER =
        0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
    address internal babyDogeToken;
    uint256 public REVEAL_TIMESTAMP;
    uint256 internal startingIndexBlock;
    uint256 public dogePrice = 14e16; //0.1 ETH
    uint256 public maxDogePurchase = 2;
    uint256 internal immutable MAX_DOGES;
    uint256 internal constant ITERATION_PERIOD = 4 weeks;
    bool internal withdrawIsLocked;
    bool public ethPayout = true;
    uint256 internal immutable fee;
    uint256 public prizePool;
    uint256[] public winners;
    uint256[] private toClaimPrize;

    // Returns uint
    // Closed  - 0
    // Whitelist  - 1
    // Public - 2
    enum SaleStatus {
        Closed,
        Whitelist,
        Public
    }

    SaleStatus public saleStatus;

    /**
    Naming to change later -> DOGES, Doges, Doge
     */

    event LottoClaimed(uint256 _id, uint256 _prize);
    event WinnersPicked(uint256[] _ids);
    event SetSettings(
        uint256 _devTeamPercent,
        uint256 _lotoPercent,
        address _babydoge,
        string _URI
    );
    event FlipEthPayout(bool _ethPayout);
    event SaleStatusSet(uint256 _saleStatus);
    event MaxMintSet(uint256 _maxMint);
    event WithdrawAndLock(bool _withdrawAndLock);
    event ReserveDoges(uint256 _amount);
    event RevealTimeSet(uint256 _timestamp);
    event MerkleRootSet(bytes32 _merkleRoot);

    constructor(
        string memory name,
        string memory symbol,
        string memory baseTokenURI,
        uint256 maxNftSupply
    )
        ERC721A(name, symbol)
        VRFConsumerBase(
            0x271682DEB8C4E0901D1a1550aD2e64D568E69909,
            0x514910771AF9Ca656af840dff83E8264EcF986CA
        )
    {
        _baseTokenURI = baseTokenURI;
        MAX_DOGES = maxNftSupply;
        keyHash = 0x9fe0eebf5e446e3c998ec9bb19951541aee00bb90ea201ae456421a2ded86805;
        fee = 25e16; // 0.25 LINK 
    }

    /*
     * @param Iteration
     * @param NFT ID
     */
    mapping(uint256 => uint256) internal iterationTime;
    mapping(uint256 => uint256) internal iterationToClaim;

    Counters.Counter public currentIteration;

    receive() external payable {}

    function baseURI() public view returns (string memory) {
        return _baseURI();
    }

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

    function flipEthPayout() external onlyOwner {
        ethPayout = !ethPayout;
        nextRewardNonce();
        emit FlipEthPayout(ethPayout);
    }

    function setSettings(
        uint16 _devTeamPercent,
        uint16 _lotoPercent,
        address _babyDogeToken,
        string memory _baseURILink
    ) external onlyOwner {
        require(
            _babyDogeToken != address(0),
            "Error: Token can't be the zero address"
        );
        devTeamPercent = _devTeamPercent;
        lotoPercent = _lotoPercent;
        babyDogeToken = _babyDogeToken;
        _baseTokenURI = _baseURILink;
        emit SetSettings(
            devTeamPercent,
            lotoPercent,
            babyDogeToken,
            _baseTokenURI
        );
    }

    // Set uint
    // Closed  - 0
    // Whitelist  - 1
    // Public - 2
    function setSaleStatus(SaleStatus _saleStatus) external onlyOwner {
        saleStatus = _saleStatus;
        emit SaleStatusSet(uint256(saleStatus));
    }

    //in eth
    function setDogePrice(uint256 _price) external onlyOwner {
        dogePrice = _price;
    }

    function getSaleStatus() public view returns (uint256) {
        return uint256(saleStatus);
    }

    function setMaxMint(uint256 _maxDogePurchase) external onlyOwner {
        maxDogePurchase = _maxDogePurchase;
        emit MaxMintSet(maxDogePurchase);
    }

    function withdrawAndLock() external onlyOwner {
        require(!withdrawIsLocked, "Can only call this function once");
        withdrawIsLocked = true;
        payable(owner()).sendValue(address(this).balance);
        emit WithdrawAndLock(withdrawIsLocked);
    }

    function convertETHToBabyDoge() internal {
        _swapTokens(
            babyDogeToken,
            _getQuote(
                address(this).balance,
                IUniswapV2Router02(ROUTER).WETH(),
                babyDogeToken
            )
        );
    }

    function _getQuote(
        uint256 _amountIn,
        address _fromTokenAddress,
        address _toTokenAddress
    ) internal view returns (uint256 amountOut) {
        address pair = IUniswapV2Factory(FACTORY).getPair(
            _fromTokenAddress,
            _toTokenAddress
        );
        (uint256 reserve0, uint256 reserve1, ) = IUniswapV2Pair(pair)
            .getReserves();
        address token0 = IUniswapV2Pair(pair).token0();
        (uint256 reserveIn, uint256 reserveOut) = token0 == _fromTokenAddress
            ? (reserve0, reserve1)
            : (reserve1, reserve0);
        uint256 amountInWithFee = _amountIn * 997;
        uint256 numerator = amountInWithFee * reserveOut;
        uint256 denominator = reserveIn * 1000 + amountInWithFee;
        amountOut = numerator / denominator;
    }

    function _swapTokens(address _ToTokenContractAddress, uint256 amountOut)
        internal
    {
        uint256 balance = address(this).balance;
        address[] memory path = new address[](2);
        path[0] = IUniswapV2Router02(ROUTER).WETH();
        path[1] = _ToTokenContractAddress;

        IUniswapV2Router02(ROUTER).swapExactETHForTokens{value: balance}(
            amountOut,
            path,
            address(this),
            block.timestamp + 700
        )[path.length - 1];
    }

    /**
     * Set some DOGES aside
     */
    function reserveDoges(uint256 _amount) external onlyOwner {
      _safeMint(msg.sender, _amount);
        emit ReserveDoges(_amount);
    }

    function setRevealTimestamp(uint256 revealTimeStamp) external onlyOwner {
        REVEAL_TIMESTAMP = revealTimeStamp;
        emit RevealTimeSet(REVEAL_TIMESTAMP);
    }

    mapping(address => uint256) mintedDoges;

    /**
     * Mints DOGES
     */
    function mintDoge(uint256 numberOfTokens) external payable {
        require(
            saleStatus == SaleStatus.Public,
            "Public sale has not live"
        );
        require(
            numberOfTokens <= maxDogePurchase,
            "You can't mint that many doges"
        );
        require(
            totalSupply() + numberOfTokens <= MAX_DOGES,
            "Total supply has been reached"
        );
        require(
            dogePrice * numberOfTokens <= msg.value,
            "Check your balance, not enough ETH to complete mint"
        );
        require(
            mintedDoges[msg.sender] + numberOfTokens <= maxDogePurchase, 
            "Each user is only allowed to mint 2 doges, try adjusting your quantities"
        );
        mintedDoges[msg.sender] += numberOfTokens;
        _safeMint(msg.sender, numberOfTokens);


        if (
            startingIndexBlock == 0 &&
            (totalSupply() == MAX_DOGES || block.timestamp >= REVEAL_TIMESTAMP)
        ) {
            startingIndexBlock = block.number;
        }
    }

    function claimLotto(uint256 _id) external nonReentrant {
        require(
            ownerOf(_id) == msg.sender,
            "error: you dont own a winning doge"
        );
        uint256 prize;
        for (uint256 i = 0; i < toClaimPrize.length; i++) {
            if (toClaimPrize[i] == _id) {
                prize = prizePool / toClaimPrize.length;
                prizePool = prizePool - prize;
                for (uint256 a = i; a < toClaimPrize.length - 1; a++) {
                    toClaimPrize[a] = toClaimPrize[a + 1];
                }
                toClaimPrize.pop();
                if (ethPayout) {
                    payable(ownerOf(_id)).sendValue(prize);
                } else {
                    IERC20(babyDogeToken).safeTransfer(ownerOf(_id), prize);
                }
            }
        }
        require(prize > 0, "error: prize must be greater then 0");
        emit LottoClaimed(_id, prize);
    }

    function nextRewardNonce() public nonReentrant returns (bytes32 requestId) {
        require(
            withdrawIsLocked,
            "error: can't call nextRewardNonce before the sale is over"
        );
        uint256 teamPortion;
        require(
            block.timestamp >
                iterationTime[currentIteration.current()] + ITERATION_PERIOD,
            "error: iteration period has not passed"
        );
        require(
            LINK.balanceOf(address(this)) >= fee,
            "Not enough LINK - fill contract with Link"
        );
        currentIteration.increment();
        iterationTime[currentIteration.current()] = block.timestamp;
        iterationToClaim[currentIteration.current()] = totalSupply();
        uint256 balance;
        if (ethPayout) {
            balance = address(this).balance;
            teamPortion = (balance * devTeamPercent) / 10000;
            payable(owner()).sendValue(teamPortion);
            prizePool = (balance * lotoPercent) / 10000;
        } else {
            convertETHToBabyDoge();
            balance = IERC20(babyDogeToken).balanceOf(address(this));
            teamPortion = (balance * devTeamPercent) / 10000;
            IERC20(babyDogeToken).safeTransfer(owner(), teamPortion);
            prizePool = (balance * lotoPercent) / 10000;
        }
        return requestRandomness(keyHash, fee);
    }

    /**
     * Callback function used by VRF Coordinator
     */
    function fulfillRandomness(bytes32 requestId, uint256 randomness)
        internal
        override
    {
        uint256 randInt = (randomness % totalSupply()) - 500;
        winners = [randInt, randInt + 500, randInt + 400, randInt + 300];
        toClaimPrize = [randInt, randInt + 500, randInt + 400, randInt + 300];
        emit WinnersPicked(winners);
    }

    function getCurrentWinners() public view returns (uint256[] memory) {
        return winners;
    }

    bytes32 public merkleRoot;

    function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner {
        merkleRoot = _merkleRoot;
        emit MerkleRootSet(merkleRoot);
    }

    mapping(address => bool) whitelistClaimed;

    function mintWhitelistDoge(
        uint256 numberOfTokens,
        bytes32[] calldata _merkleProof
    ) external payable {
        require(
            saleStatus == SaleStatus.Whitelist,
            "Whitelist sale is not live"
        );
        require(
            !whitelistClaimed[msg.sender], 
            "Your whitelist entry has already been claimed");

        require(
            numberOfTokens <= maxDogePurchase,
            "You can't mint that many doges"
        );
        require(
            totalSupply() + numberOfTokens <= MAX_DOGES,
            "Total supply has been reached"
        );
        require(dogePrice * numberOfTokens <= msg.value, "Not enough ETH");
        bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
        require(
            MerkleProof.verify(_merkleProof, merkleRoot, leaf),
            "Oops, can't find you on the whitelist"
        );

        whitelistClaimed[msg.sender] = true;

        _safeMint(msg.sender, numberOfTokens);


        if (
            startingIndexBlock == 0 &&
            (totalSupply() == MAX_DOGES || block.timestamp >= REVEAL_TIMESTAMP)
        ) {
            startingIndexBlock = block.number;
        }
    }
}

File 2 of 26 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

File 4 of 26 : Counters.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

File 5 of 26 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 6 of 26 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Moves `amount` tokens from the caller's account to `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);

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

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

File 7 of 26 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Trees proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

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

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

File 8 of 26 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 9 of 26 : IUniswapV2Router02.sol
//SPDX-License-Identifier:
pragma solidity 0.8.4;

import "./IUniswapV2Router01.sol";

interface IUniswapV2Router02 is IUniswapV2Router01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountETH);

    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint256 amountETH);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;

    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external payable;

    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;
}

File 10 of 26 : IUniswapV2Factory.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;

interface IUniswapV2Factory {
    event PairCreated(
        address indexed token0,
        address indexed token1,
        address pair,
        uint256
    );

    function feeTo() external view returns (address);

    function feeToSetter() external view returns (address);

    function getPair(address tokenA, address tokenB)
        external
        view
        returns (address pair);

    function allPairs(uint256) external view returns (address pair);

    function allPairsLength() external view returns (uint256);

    function createPair(address tokenA, address tokenB)
        external
        returns (address pair);

    function setFeeTo(address) external;

    function setFeeToSetter(address) external;
}

File 11 of 26 : IUniswapV2Pair.sol
//SPDX-License-Identifier:
pragma solidity 0.8.4;

interface IUniswapV2Pair {
    event Approval(
        address indexed owner,
        address indexed spender,
        uint256 value
    );
    event Transfer(address indexed from, address indexed to, uint256 value);

    function name() external pure returns (string memory);

    function symbol() external pure returns (string memory);

    function decimals() external pure returns (uint8);

    function totalSupply() external view returns (uint256);

    function balanceOf(address owner) external view returns (uint256);

    function allowance(address owner, address spender)
        external
        view
        returns (uint256);

    function approve(address spender, uint256 value) external returns (bool);

    function transfer(address to, uint256 value) external returns (bool);

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);

    function PERMIT_TYPEHASH() external pure returns (bytes32);

    function nonces(address owner) external view returns (uint256);

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    event Mint(address indexed sender, uint256 amount0, uint256 amount1);
    event Burn(
        address indexed sender,
        uint256 amount0,
        uint256 amount1,
        address indexed to
    );
    event Swap(
        address indexed sender,
        uint256 amount0In,
        uint256 amount1In,
        uint256 amount0Out,
        uint256 amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint256);

    function factory() external view returns (address);

    function token0() external view returns (address);

    function token1() external view returns (address);

    function getReserves()
        external
        view
        returns (
            uint112 reserve0,
            uint112 reserve1,
            uint32 blockTimestampLast
        );

    function price0CumulativeLast() external view returns (uint256);

    function price1CumulativeLast() external view returns (uint256);

    function kLast() external view returns (uint256);

    function mint(address to) external returns (uint256 liquidity);

    function burn(address to)
        external
        returns (uint256 amount0, uint256 amount1);

    function swap(
        uint256 amount0Out,
        uint256 amount1Out,
        address to,
        bytes calldata data
    ) external;

    function skim(address to) external;

    function sync() external;

    function initialize(address, address) external;
}

File 12 of 26 : VRFConsumerBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./interfaces/LinkTokenInterface.sol";

import "./VRFRequestIDBase.sol";

/** ****************************************************************************
 * @notice Interface for contracts using VRF randomness
 * *****************************************************************************
 * @dev PURPOSE
 *
 * @dev Reggie the Random Oracle (not his real job) wants to provide randomness
 * @dev to Vera the verifier in such a way that Vera can be sure he's not
 * @dev making his output up to suit himself. Reggie provides Vera a public key
 * @dev to which he knows the secret key. Each time Vera provides a seed to
 * @dev Reggie, he gives back a value which is computed completely
 * @dev deterministically from the seed and the secret key.
 *
 * @dev Reggie provides a proof by which Vera can verify that the output was
 * @dev correctly computed once Reggie tells it to her, but without that proof,
 * @dev the output is indistinguishable to her from a uniform random sample
 * @dev from the output space.
 *
 * @dev The purpose of this contract is to make it easy for unrelated contracts
 * @dev to talk to Vera the verifier about the work Reggie is doing, to provide
 * @dev simple access to a verifiable source of randomness.
 * *****************************************************************************
 * @dev USAGE
 *
 * @dev Calling contracts must inherit from VRFConsumerBase, and can
 * @dev initialize VRFConsumerBase's attributes in their constructor as
 * @dev shown:
 *
 * @dev   contract VRFConsumer {
 * @dev     constuctor(<other arguments>, address _vrfCoordinator, address _link)
 * @dev       VRFConsumerBase(_vrfCoordinator, _link) public {
 * @dev         <initialization with other arguments goes here>
 * @dev       }
 * @dev   }
 *
 * @dev The oracle will have given you an ID for the VRF keypair they have
 * @dev committed to (let's call it keyHash), and have told you the minimum LINK
 * @dev price for VRF service. Make sure your contract has sufficient LINK, and
 * @dev call requestRandomness(keyHash, fee, seed), where seed is the input you
 * @dev want to generate randomness from.
 *
 * @dev Once the VRFCoordinator has received and validated the oracle's response
 * @dev to your request, it will call your contract's fulfillRandomness method.
 *
 * @dev The randomness argument to fulfillRandomness is the actual random value
 * @dev generated from your seed.
 *
 * @dev The requestId argument is generated from the keyHash and the seed by
 * @dev makeRequestId(keyHash, seed). If your contract could have concurrent
 * @dev requests open, you can use the requestId to track which seed is
 * @dev associated with which randomness. See VRFRequestIDBase.sol for more
 * @dev details. (See "SECURITY CONSIDERATIONS" for principles to keep in mind,
 * @dev if your contract could have multiple requests in flight simultaneously.)
 *
 * @dev Colliding `requestId`s are cryptographically impossible as long as seeds
 * @dev differ. (Which is critical to making unpredictable randomness! See the
 * @dev next section.)
 *
 * *****************************************************************************
 * @dev SECURITY CONSIDERATIONS
 *
 * @dev A method with the ability to call your fulfillRandomness method directly
 * @dev could spoof a VRF response with any random value, so it's critical that
 * @dev it cannot be directly called by anything other than this base contract
 * @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method).
 *
 * @dev For your users to trust that your contract's random behavior is free
 * @dev from malicious interference, it's best if you can write it so that all
 * @dev behaviors implied by a VRF response are executed *during* your
 * @dev fulfillRandomness method. If your contract must store the response (or
 * @dev anything derived from it) and use it later, you must ensure that any
 * @dev user-significant behavior which depends on that stored value cannot be
 * @dev manipulated by a subsequent VRF request.
 *
 * @dev Similarly, both miners and the VRF oracle itself have some influence
 * @dev over the order in which VRF responses appear on the blockchain, so if
 * @dev your contract could have multiple VRF requests in flight simultaneously,
 * @dev you must ensure that the order in which the VRF responses arrive cannot
 * @dev be used to manipulate your contract's user-significant behavior.
 *
 * @dev Since the ultimate input to the VRF is mixed with the block hash of the
 * @dev block in which the request is made, user-provided seeds have no impact
 * @dev on its economic security properties. They are only included for API
 * @dev compatability with previous versions of this contract.
 *
 * @dev Since the block hash of the block which contains the requestRandomness
 * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful
 * @dev miner could, in principle, fork the blockchain to evict the block
 * @dev containing the request, forcing the request to be included in a
 * @dev different block with a different hash, and therefore a different input
 * @dev to the VRF. However, such an attack would incur a substantial economic
 * @dev cost. This cost scales with the number of blocks the VRF oracle waits
 * @dev until it calls responds to a request.
 */
abstract contract VRFConsumerBase is VRFRequestIDBase {
  /**
   * @notice fulfillRandomness handles the VRF response. Your contract must
   * @notice implement it. See "SECURITY CONSIDERATIONS" above for important
   * @notice principles to keep in mind when implementing your fulfillRandomness
   * @notice method.
   *
   * @dev VRFConsumerBase expects its subcontracts to have a method with this
   * @dev signature, and will call it once it has verified the proof
   * @dev associated with the randomness. (It is triggered via a call to
   * @dev rawFulfillRandomness, below.)
   *
   * @param requestId The Id initially returned by requestRandomness
   * @param randomness the VRF output
   */
  function fulfillRandomness(bytes32 requestId, uint256 randomness) internal virtual;

  /**
   * @dev In order to keep backwards compatibility we have kept the user
   * seed field around. We remove the use of it because given that the blockhash
   * enters later, it overrides whatever randomness the used seed provides.
   * Given that it adds no security, and can easily lead to misunderstandings,
   * we have removed it from usage and can now provide a simpler API.
   */
  uint256 private constant USER_SEED_PLACEHOLDER = 0;

  /**
   * @notice requestRandomness initiates a request for VRF output given _seed
   *
   * @dev The fulfillRandomness method receives the output, once it's provided
   * @dev by the Oracle, and verified by the vrfCoordinator.
   *
   * @dev The _keyHash must already be registered with the VRFCoordinator, and
   * @dev the _fee must exceed the fee specified during registration of the
   * @dev _keyHash.
   *
   * @dev The _seed parameter is vestigial, and is kept only for API
   * @dev compatibility with older versions. It can't *hurt* to mix in some of
   * @dev your own randomness, here, but it's not necessary because the VRF
   * @dev oracle will mix the hash of the block containing your request into the
   * @dev VRF seed it ultimately uses.
   *
   * @param _keyHash ID of public key against which randomness is generated
   * @param _fee The amount of LINK to send with the request
   *
   * @return requestId unique ID for this request
   *
   * @dev The returned requestId can be used to distinguish responses to
   * @dev concurrent requests. It is passed as the first argument to
   * @dev fulfillRandomness.
   */
  function requestRandomness(bytes32 _keyHash, uint256 _fee) internal returns (bytes32 requestId) {
    LINK.transferAndCall(vrfCoordinator, _fee, abi.encode(_keyHash, USER_SEED_PLACEHOLDER));
    // This is the seed passed to VRFCoordinator. The oracle will mix this with
    // the hash of the block containing this request to obtain the seed/input
    // which is finally passed to the VRF cryptographic machinery.
    uint256 vRFSeed = makeVRFInputSeed(_keyHash, USER_SEED_PLACEHOLDER, address(this), nonces[_keyHash]);
    // nonces[_keyHash] must stay in sync with
    // VRFCoordinator.nonces[_keyHash][this], which was incremented by the above
    // successful LINK.transferAndCall (in VRFCoordinator.randomnessRequest).
    // This provides protection against the user repeating their input seed,
    // which would result in a predictable/duplicate output, if multiple such
    // requests appeared in the same block.
    nonces[_keyHash] = nonces[_keyHash] + 1;
    return makeRequestId(_keyHash, vRFSeed);
  }

  LinkTokenInterface internal immutable LINK;
  address private immutable vrfCoordinator;

  // Nonces for each VRF key from which randomness has been requested.
  //
  // Must stay in sync with VRFCoordinator[_keyHash][this]
  mapping(bytes32 => uint256) /* keyHash */ /* nonce */
    private nonces;

  /**
   * @param _vrfCoordinator address of VRFCoordinator contract
   * @param _link address of LINK token contract
   *
   * @dev https://docs.chain.link/docs/link-token-contracts
   */
  constructor(address _vrfCoordinator, address _link) {
    vrfCoordinator = _vrfCoordinator;
    LINK = LinkTokenInterface(_link);
  }

  // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF
  // proof. rawFulfillRandomness then calls fulfillRandomness, after validating
  // the origin of the call
  function rawFulfillRandomness(bytes32 requestId, uint256 randomness) external {
    require(msg.sender == vrfCoordinator, "Only VRFCoordinator can fulfill");
    fulfillRandomness(requestId, randomness);
  }
}

File 13 of 26 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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
     * ====
     *
     * [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://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 14 of 26 : ERC721A.sol
// SPDX-License-Identifier: MIT
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";

error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error ApproveToCaller();
error ApprovalToCurrentOwner();
error BalanceQueryForZeroAddress();
error MintedQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerIndexOutOfBounds();
error OwnerQueryForNonexistentToken();
error TokenIndexOutOfBounds();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error UnableDetermineTokenOwner();
error URIQueryForNonexistentToken();

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints.
 *
 * Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..).
 *
 * Does not support burning tokens to address(0).
 *
 * Assumes that an owner cannot have more than the 2**128 - 1 (max value of uint128) of supply
 */
contract ERC721A is
    Context,
    ERC165,
    IERC721,
    IERC721Metadata,
    IERC721Enumerable
{
    using Address for address;
    using Strings for uint256;

    struct TokenOwnership {
        address addr;
        uint64 startTimestamp;
    }

    struct AddressData {
        uint128 balance;
        uint128 numberMinted;
    }

    uint256 internal _currentIndex;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to ownership details
    // An empty struct value does not necessarily mean the token is unowned. See ownershipOf implementation for details.
    mapping(uint256 => TokenOwnership) internal _ownerships;

    // Mapping owner address to address data
    mapping(address => AddressData) private _addressData;

    // 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;

    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index)
        public
        view
        override
        returns (uint256)
    {
        if (index >= totalSupply()) revert TokenIndexOutOfBounds();
        return index;
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first.
     * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index)
        public
        view
        override
        returns (uint256)
    {
        if (index >= balanceOf(owner)) revert OwnerIndexOutOfBounds();
        uint256 numMintedSoFar = totalSupply();
        uint256 tokenIdsIdx;
        address currOwnershipAddr;

        // Counter overflow is impossible as the loop breaks when uint256 i is equal to another uint256 numMintedSoFar.
        unchecked {
            for (uint256 i; i < numMintedSoFar; i++) {
                TokenOwnership memory ownership = _ownerships[i];
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    if (tokenIdsIdx == index) {
                        return i;
                    }
                    tokenIdsIdx++;
                }
            }
        }

        // Execution should never reach this point.
        assert(false);
    }

    /**
     * @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 ||
            interfaceId == type(IERC721Enumerable).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return uint256(_addressData[owner].balance);
    }

    function _numberMinted(address owner) internal view returns (uint256) {
        if (owner == address(0)) revert MintedQueryForZeroAddress();
        return uint256(_addressData[owner].numberMinted);
    }

    /**
     * Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around in the collection over time.
     */
    function ownershipOf(uint256 tokenId)
        internal
        view
        returns (TokenOwnership memory)
    {
        if (!_exists(tokenId)) revert OwnerQueryForNonexistentToken();

        unchecked {
            for (uint256 curr = tokenId; ; curr--) {
                TokenOwnership memory ownership = _ownerships[curr];
                if (ownership.addr != address(0)) {
                    return ownership;
                }
            }
        }
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view override returns (address) {
        return ownershipOf(tokenId).addr;
    }

    /**
     * @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)
    {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

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

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

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public override {
        address owner = ERC721A.ownerOf(tokenId);
        if (to == owner) revert ApprovalToCurrentOwner();

        if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender()))
            revert ApprovalCallerNotOwnerNorApproved();

        _approve(to, tokenId, owner);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId)
        public
        view
        override
        returns (address)
    {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved)
        public
        override
    {
        if (operator == _msgSender()) revert ApproveToCaller();

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

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        _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 override {
        _transfer(from, to, tokenId);
        if (!_checkOnERC721Received(from, to, tokenId, _data))
            revert TransferToNonERC721ReceiverImplementer();
    }

    /**
     * @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`),
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        return tokenId < _currentIndex;
    }

    function _safeMint(address to, uint256 quantity) internal {
        _safeMint(to, quantity, "");
    }

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal {
        _mint(to, quantity, _data, true);
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _mint(
        address to,
        uint256 quantity,
        bytes memory _data,
        bool safe
    ) internal {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // balance or numberMinted overflow if current value of either + quantity > 3.4e38 (2**128) - 1
        // updatedIndex overflows if _currentIndex + quantity > 1.56e77 (2**256) - 1
        unchecked {
            _addressData[to].balance += uint128(quantity);
            _addressData[to].numberMinted += uint128(quantity);

            _ownerships[startTokenId].addr = to;
            _ownerships[startTokenId].startTimestamp = uint64(block.timestamp);

            uint256 updatedIndex = startTokenId;

            for (uint256 i; i < quantity; i++) {
                emit Transfer(address(0), to, updatedIndex);
                if (
                    safe &&
                    !_checkOnERC721Received(address(0), to, updatedIndex, _data)
                ) {
                    revert TransferToNonERC721ReceiverImplementer();
                }

                updatedIndex++;
            }

            _currentIndex = updatedIndex;
        }

        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * 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
    ) private {
        TokenOwnership memory prevOwnership = ownershipOf(tokenId);

        bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr ||
            getApproved(tokenId) == _msgSender() ||
            isApprovedForAll(prevOwnership.addr, _msgSender()));

        if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
        if (prevOwnership.addr != from) revert TransferFromIncorrectOwner();
        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

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

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
        unchecked {
            _addressData[from].balance -= 1;
            _addressData[to].balance += 1;

            _ownerships[tokenId].addr = to;
            _ownerships[tokenId].startTimestamp = uint64(block.timestamp);

            // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it.
            // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
            uint256 nextTokenId = tokenId + 1;
            if (_ownerships[nextTokenId].addr == address(0)) {
                if (_exists(nextTokenId)) {
                    _ownerships[nextTokenId].addr = prevOwnership.addr;
                    _ownerships[nextTokenId].startTimestamp = prevOwnership
                        .startTimestamp;
                }
            }
        }

        emit Transfer(from, to, tokenId);
        _afterTokenTransfers(from, to, tokenId, 1);
    }

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

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

    /**
     * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes
     * minting.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}
}

File 15 of 26 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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: balance query for the zero address");
        return _balances[owner];
    }

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

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _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: transfer caller is not owner nor approved");

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

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

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

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

    /**
     * @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.
     * - `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 tokenId
    ) internal virtual {}
}

File 16 of 26 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 17 of 26 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

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

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

File 18 of 26 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

File 24 of 26 : IUniswapV2Router01.sol
//SPDX-License-Identifier:
pragma solidity 0.8.4;

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

    function WETH() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint256 amountADesired,
        uint256 amountBDesired,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
    )
        external
        returns (
            uint256 amountA,
            uint256 amountB,
            uint256 liquidity
        );

    function addLiquidityETH(
        address token,
        uint256 amountTokenDesired,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    )
        external
        payable
        returns (
            uint256 amountToken,
            uint256 amountETH,
            uint256 liquidity
        );

    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountA, uint256 amountB);

    function removeLiquidityETH(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountToken, uint256 amountETH);

    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint256 amountA, uint256 amountB);

    function removeLiquidityETHWithPermit(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint256 amountToken, uint256 amountETH);

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

    function swapTokensForExactTokens(
        uint256 amountOut,
        uint256 amountInMax,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

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

    function swapTokensForExactETH(
        uint256 amountOut,
        uint256 amountInMax,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

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

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

    function quote(
        uint256 amountA,
        uint256 reserveA,
        uint256 reserveB
    ) external pure returns (uint256 amountB);

    function getAmountOut(
        uint256 amountIn,
        uint256 reserveIn,
        uint256 reserveOut
    ) external pure returns (uint256 amountOut);

    function getAmountIn(
        uint256 amountOut,
        uint256 reserveIn,
        uint256 reserveOut
    ) external pure returns (uint256 amountIn);

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

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

File 25 of 26 : LinkTokenInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface LinkTokenInterface {
  function allowance(address owner, address spender) external view returns (uint256 remaining);

  function approve(address spender, uint256 value) external returns (bool success);

  function balanceOf(address owner) external view returns (uint256 balance);

  function decimals() external view returns (uint8 decimalPlaces);

  function decreaseApproval(address spender, uint256 addedValue) external returns (bool success);

  function increaseApproval(address spender, uint256 subtractedValue) external;

  function name() external view returns (string memory tokenName);

  function symbol() external view returns (string memory tokenSymbol);

  function totalSupply() external view returns (uint256 totalTokensIssued);

  function transfer(address to, uint256 value) external returns (bool success);

  function transferAndCall(
    address to,
    uint256 value,
    bytes calldata data
  ) external returns (bool success);

  function transferFrom(
    address from,
    address to,
    uint256 value
  ) external returns (bool success);
}

File 26 of 26 : VRFRequestIDBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract VRFRequestIDBase {
  /**
   * @notice returns the seed which is actually input to the VRF coordinator
   *
   * @dev To prevent repetition of VRF output due to repetition of the
   * @dev user-supplied seed, that seed is combined in a hash with the
   * @dev user-specific nonce, and the address of the consuming contract. The
   * @dev risk of repetition is mostly mitigated by inclusion of a blockhash in
   * @dev the final seed, but the nonce does protect against repetition in
   * @dev requests which are included in a single block.
   *
   * @param _userSeed VRF seed input provided by user
   * @param _requester Address of the requesting contract
   * @param _nonce User-specific nonce at the time of the request
   */
  function makeVRFInputSeed(
    bytes32 _keyHash,
    uint256 _userSeed,
    address _requester,
    uint256 _nonce
  ) internal pure returns (uint256) {
    return uint256(keccak256(abi.encode(_keyHash, _userSeed, _requester, _nonce)));
  }

  /**
   * @notice Returns the id for this request
   * @param _keyHash The serviceAgreement ID to be used for this request
   * @param _vRFInputSeed The seed to be passed directly to the VRF
   * @return The id for this request
   *
   * @dev Note that _vRFInputSeed is not the seed passed by the consuming
   * @dev contract, but the one generated by makeVRFInputSeed
   */
  function makeRequestId(bytes32 _keyHash, uint256 _vRFInputSeed) internal pure returns (bytes32) {
    return keccak256(abi.encodePacked(_keyHash, _vRFInputSeed));
  }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"baseTokenURI","type":"string"},{"internalType":"uint256","name":"maxNftSupply","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerIndexOutOfBounds","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"TokenIndexOutOfBounds","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"_ethPayout","type":"bool"}],"name":"FlipEthPayout","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_prize","type":"uint256"}],"name":"LottoClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_maxMint","type":"uint256"}],"name":"MaxMintSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"MerkleRootSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"ReserveDoges","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"RevealTimeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_saleStatus","type":"uint256"}],"name":"SaleStatusSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_devTeamPercent","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_lotoPercent","type":"uint256"},{"indexed":false,"internalType":"address","name":"_babydoge","type":"address"},{"indexed":false,"internalType":"string","name":"_URI","type":"string"}],"name":"SetSettings","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"_ids","type":"uint256[]"}],"name":"WinnersPicked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"_withdrawAndLock","type":"bool"}],"name":"WithdrawAndLock","type":"event"},{"inputs":[],"name":"REVEAL_TIMESTAMP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"claimLotto","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentIteration","outputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dogePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ethPayout","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"flipEthPayout","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentWinners","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSaleStatus","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxDogePurchase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"numberOfTokens","type":"uint256"}],"name":"mintDoge","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"numberOfTokens","type":"uint256"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"mintWhitelistDoge","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextRewardNonce","outputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizePool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"},{"internalType":"uint256","name":"randomness","type":"uint256"}],"name":"rawFulfillRandomness","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"reserveDoges","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saleStatus","outputs":[{"internalType":"enum BabyDoge.SaleStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setDogePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxDogePurchase","type":"uint256"}],"name":"setMaxMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"revealTimeStamp","type":"uint256"}],"name":"setRevealTimestamp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum BabyDoge.SaleStatus","name":"_saleStatus","type":"uint8"}],"name":"setSaleStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_devTeamPercent","type":"uint16"},{"internalType":"uint16","name":"_lotoPercent","type":"uint16"},{"internalType":"address","name":"_babyDogeToken","type":"address"},{"internalType":"string","name":"_baseURILink","type":"string"}],"name":"setSettings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"winners","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawAndLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

6101206040526701f161421c8e0000600f5560026010556011805461ff0019166101001790553480156200003257600080fd5b50604051620042c5380380620042c58339810160408190526200005591620002f0565b7f271682deb8c4e0901d1a1550ad2e64d568e6990900000000000000000000000060a0527f514910771af9ca656af840dff83e8264ecf986ca000000000000000000000000608052835184908490620000b690600290602085019062000197565b508051620000cc90600390602084019062000197565b505050620000e9620000e36200014160201b60201c565b62000145565b600160095581516200010390600b90602085019062000197565b5060e05250507f9fe0eebf5e446e3c998ec9bb19951541aee00bb90ea201ae456421a2ded8680560c052506703782dace9d9000061010052620003d8565b3390565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620001a59062000385565b90600052602060002090601f016020900481019282620001c9576000855562000214565b82601f10620001e457805160ff191683800117855562000214565b8280016001018555821562000214579182015b8281111562000214578251825591602001919060010190620001f7565b506200022292915062000226565b5090565b5b8082111562000222576000815560010162000227565b600082601f8301126200024e578081fd5b81516001600160401b03808211156200026b576200026b620003c2565b604051601f8301601f19908116603f01168101908282118183101715620002965762000296620003c2565b81604052838152602092508683858801011115620002b2578485fd5b8491505b83821015620002d55785820183015181830184015290820190620002b6565b83821115620002e657848385830101525b9695505050505050565b6000806000806080858703121562000306578384fd5b84516001600160401b03808211156200031d578586fd5b6200032b888389016200023d565b9550602087015191508082111562000341578485fd5b6200034f888389016200023d565b9450604087015191508082111562000365578384fd5b5062000374878288016200023d565b606096909601519497939650505050565b600181811c908216806200039a57607f821691505b60208210811415620003bc57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b60805160601c60a05160601c60c05160e05161010051613e786200044d60003960008181610b950152610e93015260008181611b2e01528181611d0201528181611ec5015261209e01526000610e72015260008181611745015261242b015260008181610bb701526123fc0152613e786000f3fe6080604052600436106102765760003560e01c8063715018a61161014f5780639d5719b1116100c1578063c87b56dd1161007a578063c87b56dd14610700578063cac4ee0514610720578063db57e74514610740578063e985e9c514610753578063f2fde38b1461079c578063f9020e33146107bc57600080fd5b80639d5719b114610656578063a22cb4651461066b578063a2fb11751461068b578063a3bc9336146106ab578063b88d4fde146106cd578063bcfa950e146106ed57600080fd5b806388c6abf81161011357806388c6abf8146105c15780638ad78f80146105d85780638c3c4b34146105ee5780638da5cb5b1461060357806394985ddd1461062157806395d89b411461064157600080fd5b8063715018a614610536578063719ce73e1461054b57806379d49bb0146105615780637cb647591461058157806385142339146105a157600080fd5b80632eb4a7ab116101e8578063513d29ce116101ac578063513d29ce1461048c578063547520fe146104ac5780636352211e146104cc5780636c0360eb146104ec5780636c62ef141461050157806370a082311461051657600080fd5b80632eb4a7ab146103f65780632f745c591461040c57806342842e0e1461042c5780634891ad881461044c5780634f6ccce71461046c57600080fd5b8063095ea7b31161023a578063095ea7b3146103575780630a213e0414610377578063107fb6421461039657806318160ddd146103ab57806318e20a38146103c057806323b872dd146103d657600080fd5b8063018a2c371461028257806301ffc9a7146102a457806306095f59146102d957806306fdde03146102fd578063081812fc1461031f57600080fd5b3661027d57005b600080fd5b34801561028e57600080fd5b506102a261029d3660046137cc565b6107e3565b005b3480156102b057600080fd5b506102c46102bf366004613805565b610852565b60405190151581526020015b60405180910390f35b3480156102e557600080fd5b506102ef600f5481565b6040519081526020016102d0565b34801561030957600080fd5b506103126108bf565b6040516102d09190613b1e565b34801561032b57600080fd5b5061033f61033a3660046137cc565b610951565b6040516001600160a01b0390911681526020016102d0565b34801561036357600080fd5b506102a26103723660046136dd565b610997565b34801561038357600080fd5b506011546102c490610100900460ff1681565b3480156103a257600080fd5b506102ef610a25565b3480156103b757600080fd5b506001546102ef565b3480156103cc57600080fd5b506102ef600d5481565b3480156103e257600080fd5b506102a26103f13660046135f3565b610ec3565b34801561040257600080fd5b506102ef601a5481565b34801561041857600080fd5b506102ef6104273660046136dd565b610ece565b34801561043857600080fd5b506102a26104473660046135f3565b610fb3565b34801561045857600080fd5b506102a261046736600461383d565b610fce565b34801561047857600080fd5b506102ef6104873660046137cc565b61107f565b34801561049857600080fd5b506102a26104a73660046138aa565b6110ad565b3480156104b857600080fd5b506102a26104c73660046137cc565b6111ec565b3480156104d857600080fd5b5061033f6104e73660046137cc565b61124b565b3480156104f857600080fd5b5061031261125d565b34801561050d57600080fd5b506102a261126c565b34801561052257600080fd5b506102ef610531366004613583565b6112fd565b34801561054257600080fd5b506102a261134b565b34801561055757600080fd5b506102ef60125481565b34801561056d57600080fd5b506102a261057c3660046137cc565b611381565b34801561058d57600080fd5b506102a261059c3660046137cc565b6113e5565b3480156105ad57600080fd5b506102a26105bc3660046137cc565b611444565b3480156105cd57600080fd5b506018546102ef9081565b3480156105e457600080fd5b506102ef60105481565b3480156105fa57600080fd5b506102ef611712565b34801561060f57600080fd5b506008546001600160a01b031661033f565b34801561062d57600080fd5b506102a261063c3660046137e4565b61173a565b34801561064d57600080fd5b506103126117c0565b34801561066257600080fd5b506102a26117cf565b34801561067757600080fd5b506102a26106863660046136b0565b6118a8565b34801561069757600080fd5b506102ef6106a63660046137cc565b61193e565b3480156106b757600080fd5b506106c061195f565b6040516102d09190613a77565b3480156106d957600080fd5b506102a26106e8366004613633565b6119b6565b6102a26106fb366004613919565b6119f0565b34801561070c57600080fd5b5061031261071b3660046137cc565b611d47565b34801561072c57600080fd5b506102a261073b3660046137cc565b611dce565b6102a261074e3660046137cc565b611dfd565b34801561075f57600080fd5b506102c461076e3660046135bb565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b3480156107a857600080fd5b506102a26107b7366004613583565b6120e1565b3480156107c857600080fd5b506015546107d69060ff1681565b6040516102d09190613af6565b6008546001600160a01b031633146108165760405162461bcd60e51b815260040161080d90613b31565b60405180910390fd5b600d8190556040518181527fd227248b3540871674d341a3d15918c6eaed5a6704bae91d238aa95b5edaab89906020015b60405180910390a150565b60006001600160e01b031982166380ac58cd60e01b148061088357506001600160e01b03198216635b5e139f60e01b145b8061089e57506001600160e01b0319821663780e9d6360e01b145b806108b957506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600280546108ce90613d5d565b80601f01602080910402602001604051908101604052809291908181526020018280546108fa90613d5d565b80156109475780601f1061091c57610100808354040283529160200191610947565b820191906000526020600020905b81548152906001019060200180831161092a57829003601f168201915b5050505050905090565b600061095e826001541190565b61097b576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b60006109a28261124b565b9050806001600160a01b0316836001600160a01b031614156109d75760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b038216148015906109f757506109f5813361076e565b155b15610a15576040516367d9dca160e11b815260040160405180910390fd5b610a20838383612179565b505050565b600060026009541415610a7a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161080d565b600260095560115460ff16610af75760405162461bcd60e51b815260206004820152603960248201527f6572726f723a2063616e27742063616c6c206e6578745265776172644e6f6e6360448201527f65206265666f7265207468652073616c65206973206f76657200000000000000606482015260840161080d565b60006224ea0060166000610b0a60185490565b815260200190815260200160002054610b239190613ccf565b4211610b805760405162461bcd60e51b815260206004820152602660248201527f6572726f723a20697465726174696f6e20706572696f6420686173206e6f74206044820152651c185cdcd95960d21b606482015260840161080d565b6040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015610c0157600080fd5b505afa158015610c15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c399190613901565b1015610c995760405162461bcd60e51b815260206004820152602960248201527f4e6f7420656e6f756768204c494e4b202d2066696c6c20636f6e74726163742060448201526877697468204c696e6b60b81b606482015260840161080d565b610ca7601880546001019055565b4260166000610cb560185490565b815260208101919091526040016000205560015460176000610cd660185490565b8152602001908152602001600020819055506000601160019054906101000a900460ff1615610d755750600a54479061271090610d179061ffff1683613cfb565b610d219190613ce7565b9150610d4882610d396008546001600160a01b031690565b6001600160a01b0316906121d5565b600a5461271090610d639062010000900461ffff1683613cfb565b610d6d9190613ce7565b601255610e6d565b610d7d6122ee565b600c546040516370a0823160e01b81523060048201526001600160a01b03909116906370a082319060240160206040518083038186803b158015610dc057600080fd5b505afa158015610dd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df89190613901565b600a5490915061271090610e109061ffff1683613cfb565b610e1a9190613ce7565b9150610e44610e316008546001600160a01b031690565b600c546001600160a01b031690846123a6565b600a5461271090610e5f9062010000900461ffff1683613cfb565b610e699190613ce7565b6012555b610eb77f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006123f8565b92505050600160095590565b610a20838383612582565b6000610ed9836112fd565b8210610ef8576040516306ed618760e11b815260040160405180910390fd5b6000610f0360015490565b905060008060005b83811015610f9c576000818152600460209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910467ffffffffffffffff169183019190915215610f5e57805192505b876001600160a01b0316836001600160a01b03161415610f935786841415610f8c575093506108b992505050565b6001909301925b50600101610f0b565b50634e487b7160e01b600052600160045260246000fd5b610a20838383604051806020016040528060008152506119b6565b6008546001600160a01b03163314610ff85760405162461bcd60e51b815260040161080d90613b31565b6015805482919060ff1916600183600281111561102557634e487b7160e01b600052602160045260246000fd5b02179055506015547f5f393514fe885345bf6ba49c7009fef8081ddf42042464e8dfe04a17f001cddf9060ff16600281111561107157634e487b7160e01b600052602160045260246000fd5b604051908152602001610847565b600061108a60015490565b82106110a9576040516329c8c00760e21b815260040160405180910390fd5b5090565b6008546001600160a01b031633146110d75760405162461bcd60e51b815260040161080d90613b31565b6001600160a01b03821661113c5760405162461bcd60e51b815260206004820152602660248201527f4572726f723a20546f6b656e2063616e277420626520746865207a65726f206160448201526564647265737360d01b606482015260840161080d565b600a805461ffff858116620100000263ffffffff1990921690871617179055600c80546001600160a01b0384166001600160a01b0319909116179055805161118b90600b90602084019061342e565b50600a54600c546040517e89f6d806b406160fe53ec387c78595e885ca4881db758f4e83ca7ddc069b88926111de9261ffff808316936201000090930416916001600160a01b0390911690600b90613b66565b60405180910390a150505050565b6008546001600160a01b031633146112165760405162461bcd60e51b815260040161080d90613b31565b60108190556040518181527f3b64f5d0ae4de41d36db0948fc83ffbba5d86eb79841008d6047a25f46ed2b7990602001610847565b6000611256826127a1565b5192915050565b6060611267612836565b905090565b6008546001600160a01b031633146112965760405162461bcd60e51b815260040161080d90613b31565b6011805461ff001981166101009182900460ff16159091021790556112b9610a25565b5060115460405161010090910460ff16151581527fa52383c36c234ecf24255806fe74d869b31d0a0d26073e975ddeb5f871886262906020015b60405180910390a1565b60006001600160a01b038216611326576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160801b031690565b6008546001600160a01b031633146113755760405162461bcd60e51b815260040161080d90613b31565b61137f6000612845565b565b6008546001600160a01b031633146113ab5760405162461bcd60e51b815260040161080d90613b31565b6113b53382612897565b6040518181527fffa76519d7df0608ca65c5af555ef0723f461afa7dadac8ccb5b3f7a8019e3ef90602001610847565b6008546001600160a01b0316331461140f5760405162461bcd60e51b815260040161080d90613b31565b601a8190556040518181527f42cbc405e4dbf1b691e85b9a34b08ecfcf7a9ad9078bf4d645ccfa1fac11c10b90602001610847565b600260095414156114975760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161080d565b6002600955336114a68261124b565b6001600160a01b0316146115075760405162461bcd60e51b815260206004820152602260248201527f6572726f723a20796f7520646f6e74206f776e20612077696e6e696e6720646f604482015261676560f01b606482015260840161080d565b6000805b60145481101561167357826014828154811061153757634e487b7160e01b600052603260045260246000fd5b90600052602060002001541415611661576014546012546115589190613ce7565b9150816012546115689190613d1a565b601255805b60145461157c90600190613d1a565b8110156115f8576014611590826001613ccf565b815481106115ae57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154601482815481106115da57634e487b7160e01b600052603260045260246000fd5b600091825260209091200155806115f081613d98565b91505061156d565b50601480548061161857634e487b7160e01b600052603160045260246000fd5b60019003818190600052602060002001600090559055601160019054906101000a900460ff16156116555761165082610d398561124b565b611661565b611661610e318461124b565b8061166b81613d98565b91505061150b565b50600081116116d05760405162461bcd60e51b815260206004820152602360248201527f6572726f723a207072697a65206d75737420626520677265617465722074686560448201526206e20360ec1b606482015260840161080d565b60408051838152602081018390527ff4338f56dc8b8e2b8c87ae4eb8008d2290a524a16c153183ef0b116ef4834d7d910160405180910390a150506001600955565b60155460009060ff16600281111561126757634e487b7160e01b600052602160045260246000fd5b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146117b25760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c00604482015260640161080d565b6117bc82826128b1565b5050565b6060600380546108ce90613d5d565b6008546001600160a01b031633146117f95760405162461bcd60e51b815260040161080d90613b31565b60115460ff161561184c5760405162461bcd60e51b815260206004820181905260248201527f43616e206f6e6c792063616c6c20746869732066756e6374696f6e206f6e6365604482015260640161080d565b6011805460ff1916600117905561186f47610d396008546001600160a01b031690565b60115460405160ff909116151581527fd5dc719472ee802e529d4afc3a953b5d8ea1790730213eafdcfce3433d2ea225906020016112f3565b6001600160a01b0382163314156118d25760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6013818154811061194e57600080fd5b600091825260209091200154905081565b6060601380548060200260200160405190810160405280929190818152602001828054801561094757602002820191906000526020600020905b815481526020019060010190808311611999575050505050905090565b6119c1848484612582565b6119cd848484846129b6565b6119ea576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b600160155460ff166002811115611a1757634e487b7160e01b600052602160045260246000fd5b14611a645760405162461bcd60e51b815260206004820152601a60248201527f57686974656c6973742073616c65206973206e6f74206c697665000000000000604482015260640161080d565b336000908152601b602052604090205460ff1615611ada5760405162461bcd60e51b815260206004820152602d60248201527f596f75722077686974656c69737420656e7472792068617320616c726561647960448201526c081899595b8818db185a5b5959609a1b606482015260840161080d565b601054831115611b2c5760405162461bcd60e51b815260206004820152601e60248201527f596f752063616e2774206d696e742074686174206d616e7920646f6765730000604482015260640161080d565b7f000000000000000000000000000000000000000000000000000000000000000083611b5760015490565b611b619190613ccf565b1115611baf5760405162461bcd60e51b815260206004820152601d60248201527f546f74616c20737570706c7920686173206265656e2072656163686564000000604482015260640161080d565b3483600f54611bbe9190613cfb565b1115611bfd5760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b604482015260640161080d565b6040516bffffffffffffffffffffffff193360601b166020820152600090603401604051602081830303815290604052805190602001209050611c7783838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050601a549150849050612ac4565b611cd15760405162461bcd60e51b815260206004820152602560248201527f4f6f70732c2063616e27742066696e6420796f75206f6e207468652077686974604482015264195b1a5cdd60da1b606482015260840161080d565b336000818152601b60205260409020805460ff19166001179055611cf59085612897565b600e54158015611d3857507f0000000000000000000000000000000000000000000000000000000000000000611d2a60015490565b1480611d385750600d544210155b156119ea5743600e5550505050565b6060611d54826001541190565b611d7157604051630a14c4b560e41b815260040160405180910390fd5b6000611d7b612836565b9050805160001415611d9c5760405180602001604052806000815250611dc7565b80611da684612ada565b604051602001611db79291906139db565b6040516020818303038152906040525b9392505050565b6008546001600160a01b03163314611df85760405162461bcd60e51b815260040161080d90613b31565b600f55565b600260155460ff166002811115611e2457634e487b7160e01b600052602160045260246000fd5b14611e715760405162461bcd60e51b815260206004820152601860248201527f5075626c69632073616c6520686173206e6f74206c6976650000000000000000604482015260640161080d565b601054811115611ec35760405162461bcd60e51b815260206004820152601e60248201527f596f752063616e2774206d696e742074686174206d616e7920646f6765730000604482015260640161080d565b7f000000000000000000000000000000000000000000000000000000000000000081611eee60015490565b611ef89190613ccf565b1115611f465760405162461bcd60e51b815260206004820152601d60248201527f546f74616c20737570706c7920686173206265656e2072656163686564000000604482015260640161080d565b3481600f54611f559190613cfb565b1115611fbf5760405162461bcd60e51b815260206004820152603360248201527f436865636b20796f75722062616c616e63652c206e6f7420656e6f75676820456044820152721512081d1bc818dbdb5c1b195d19481b5a5b9d606a1b606482015260840161080d565b60105433600090815260196020526040902054611fdd908390613ccf565b11156120625760405162461bcd60e51b815260206004820152604860248201527f456163682075736572206973206f6e6c7920616c6c6f77656420746f206d696e60448201527f74203220646f6765732c207472792061646a757374696e6720796f7572207175606482015267616e74697469657360c01b608482015260a40161080d565b3360009081526019602052604081208054839290612081908490613ccf565b9091555061209190503382612897565b600e541580156120d457507f00000000000000000000000000000000000000000000000000000000000000006120c660015490565b14806120d45750600d544210155b156120de5743600e555b50565b6008546001600160a01b0316331461210b5760405162461bcd60e51b815260040161080d90613b31565b6001600160a01b0381166121705760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161080d565b6120de81612845565b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b804710156122255760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161080d565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612272576040519150601f19603f3d011682016040523d82523d6000602084013e612277565b606091505b5050905080610a205760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161080d565b61137f600c60009054906101000a90046001600160a01b03166123a147737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561235857600080fd5b505afa15801561236c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612390919061359f565b600c546001600160a01b0316612bf4565b612e0d565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610a20908490613005565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f000000000000000000000000000000000000000000000000000000000000000084866000604051602001612468929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b815260040161249593929190613a47565b602060405180830381600087803b1580156124af57600080fd5b505af11580156124c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124e791906137b0565b5060008381526020818152604080832054815180840188905280830185905230606082015260808082018390528351808303909101815260a090910190925281519183019190912086845292909152612541906001613ccf565b60008581526020818152604091829020929092558051808301879052808201849052815180820383018152606090910190915280519101205b949350505050565b600061258d826127a1565b80519091506000906001600160a01b0316336001600160a01b031614806125c45750336125b984610951565b6001600160a01b0316145b806125d6575081516125d6903361076e565b9050806125f657604051632ce44b5f60e11b815260040160405180910390fd5b846001600160a01b031682600001516001600160a01b03161461262b5760405162a1148160e81b815260040160405180910390fd5b6001600160a01b03841661265257604051633a954ecd60e21b815260040160405180910390fd5b6126626000848460000151612179565b6001600160a01b03858116600090815260056020908152604080832080546001600160801b03198082166001600160801b03928316600019018316179092558986168086528386208054938416938316600190810190931693909317909255888552600490935281842080546001600160e01b031916909117600160a01b4267ffffffffffffffff16021790559086018083529120549091166127575761270a816001541190565b15612757578251600082815260046020908152604090912080549186015167ffffffffffffffff16600160a01b026001600160e01b03199092166001600160a01b03909316929092171790555b5082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b60408051808201909152600080825260208201526127c0826001541190565b6127dd57604051636f96cda160e11b815260040160405180910390fd5b815b6000818152600460209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910467ffffffffffffffff16918301919091521561282c579392505050565b50600019016127df565b6060600b80546108ce90613d5d565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6117bc8282604051806020016040528060008152506130d7565b60006101f46128bf60015490565b6128c99084613db3565b6128d39190613d1a565b90506040518060800160405280828152602001826101f46128f49190613ccf565b815260200161290583610190613ccf565b81526020016129168361012c613ccf565b90526129269060139060046134ae565b506040518060800160405280828152602001826101f46129469190613ccf565b815260200161295783610190613ccf565b81526020016129688361012c613ccf565b90526129789060149060046134ae565b507f11609bf0dfcab1cd8696cdc747ee705ba9c458e0b7e701b1ebd4e1dfb6b5fb2460136040516129a99190613abb565b60405180910390a1505050565b60006001600160a01b0384163b15612ab957604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906129fa903390899088908890600401613a0a565b602060405180830381600087803b158015612a1457600080fd5b505af1925050508015612a44575060408051601f3d908101601f19168201909252612a4191810190613821565b60015b612a9f573d808015612a72576040519150601f19603f3d011682016040523d82523d6000602084013e612a77565b606091505b508051612a97576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061257a565b506001949350505050565b600082612ad185846130e4565b14949350505050565b606081612afe5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612b285780612b1281613d98565b9150612b219050600a83613ce7565b9150612b02565b60008167ffffffffffffffff811115612b5157634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612b7b576020820181803683370190505b5090505b841561257a57612b90600183613d1a565b9150612b9d600a86613db3565b612ba8906030613ccf565b60f81b818381518110612bcb57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350612bed600a86613ce7565b9450612b7f565b60405163e6a4390560e01b81526001600160a01b038084166004830152821660248201526000908190735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9063e6a439059060440160206040518083038186803b158015612c5457600080fd5b505afa158015612c68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c8c919061359f565b9050600080826001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015612cca57600080fd5b505afa158015612cde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d02919061385c565b506001600160701b031691506001600160701b031691506000836001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015612d5457600080fd5b505afa158015612d68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d8c919061359f565b9050600080886001600160a01b0316836001600160a01b031614612db1578385612db4565b84845b90925090506000612dc78b6103e5613cfb565b90506000612dd58383613cfb565b9050600082612de6866103e8613cfb565b612df09190613ccf565b9050612dfc8183613ce7565b9d9c50505050505050505050505050565b60408051600280825260608201835247926000929190602083019080368337019050509050737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612e7f57600080fd5b505afa158015612e93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eb7919061359f565b81600081518110612ed857634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b0316815250508381600181518110612f1a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0390921660209283029190910190910152737a250d5630b4cf539739df2c5dacb4c659f2488d637ff36ab583858430612f5c426102bc613ccf565b6040518663ffffffff1660e01b8152600401612f7b9493929190613c35565b6000604051808303818588803b158015612f9457600080fd5b505af1158015612fa8573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f19168201604052612fd19190810190613708565b60018251612fdf9190613d1a565b81518110612ffd57634e487b7160e01b600052603260045260246000fd5b505050505050565b600061305a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166131669092919063ffffffff16565b805190915015610a20578080602001905181019061307891906137b0565b610a205760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161080d565b610a208383836001613175565b600081815b845181101561315e57600085828151811061311457634e487b7160e01b600052603260045260246000fd5b6020026020010151905080831161313a576000838152602082905260409020925061314b565b600081815260208490526040902092505b508061315681613d98565b9150506130e9565b509392505050565b606061257a84846000856132c4565b6001546001600160a01b03851661319e57604051622e076360e81b815260040160405180910390fd5b836131bc5760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03851660008181526005602090815260408083208054600160801b6001600160801b031982166001600160801b039283168c01831690811782900483168c01909216021790558483526004909152812080546001600160e01b031916909217600160a01b4267ffffffffffffffff16021790915581905b858110156132bb5760405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4838015613291575061328f60008884886129b6565b155b156132af576040516368d2bf6b60e11b815260040160405180910390fd5b6001918201910161323a565b5060015561279a565b6060824710156133255760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161080d565b6001600160a01b0385163b61337c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161080d565b600080866001600160a01b0316858760405161339891906139bf565b60006040518083038185875af1925050503d80600081146133d5576040519150601f19603f3d011682016040523d82523d6000602084013e6133da565b606091505b50915091506133ea8282866133f5565b979650505050505050565b60608315613404575081611dc7565b8251156134145782518084602001fd5b8160405162461bcd60e51b815260040161080d9190613b1e565b82805461343a90613d5d565b90600052602060002090601f01602090048101928261345c57600085556134a2565b82601f1061347557805160ff19168380011785556134a2565b828001600101855582156134a2579182015b828111156134a2578251825591602001919060010190613487565b506110a99291506134e8565b8280548282559060005260206000209081019282156134a257916020028201828111156134a2578251825591602001919060010190613487565b5b808211156110a957600081556001016134e9565b600067ffffffffffffffff83111561351757613517613df3565b61352a601f8401601f1916602001613c9e565b905082815283838301111561353e57600080fd5b828260208301376000602084830101529392505050565b80516001600160701b038116811461356c57600080fd5b919050565b803561ffff8116811461356c57600080fd5b600060208284031215613594578081fd5b8135611dc781613e09565b6000602082840312156135b0578081fd5b8151611dc781613e09565b600080604083850312156135cd578081fd5b82356135d881613e09565b915060208301356135e881613e09565b809150509250929050565b600080600060608486031215613607578081fd5b833561361281613e09565b9250602084013561362281613e09565b929592945050506040919091013590565b60008060008060808587031215613648578081fd5b843561365381613e09565b9350602085013561366381613e09565b925060408501359150606085013567ffffffffffffffff811115613685578182fd5b8501601f81018713613695578182fd5b6136a4878235602084016134fd565b91505092959194509250565b600080604083850312156136c2578182fd5b82356136cd81613e09565b915060208301356135e881613e1e565b600080604083850312156136ef578182fd5b82356136fa81613e09565b946020939093013593505050565b6000602080838503121561371a578182fd5b825167ffffffffffffffff80821115613731578384fd5b818501915085601f830112613744578384fd5b81518181111561375657613756613df3565b8060051b9150613767848301613c9e565b8181528481019084860184860187018a1015613781578788fd5b8795505b838610156137a3578051835260019590950194918601918601613785565b5098975050505050505050565b6000602082840312156137c1578081fd5b8151611dc781613e1e565b6000602082840312156137dd578081fd5b5035919050565b600080604083850312156137f6578182fd5b50508035926020909101359150565b600060208284031215613816578081fd5b8135611dc781613e2c565b600060208284031215613832578081fd5b8151611dc781613e2c565b60006020828403121561384e578081fd5b813560038110611dc7578182fd5b600080600060608486031215613870578081fd5b61387984613555565b925061388760208501613555565b9150604084015163ffffffff8116811461389f578182fd5b809150509250925092565b600080600080608085870312156138bf578182fd5b6138c885613571565b93506138d660208601613571565b925060408501356138e681613e09565b9150606085013567ffffffffffffffff811115613685578182fd5b600060208284031215613912578081fd5b5051919050565b60008060006040848603121561392d578081fd5b83359250602084013567ffffffffffffffff8082111561394b578283fd5b818601915086601f83011261395e578283fd5b81358181111561396c578384fd5b8760208260051b8501011115613980578384fd5b6020830194508093505050509250925092565b600081518084526139ab816020860160208601613d31565b601f01601f19169290920160200192915050565b600082516139d1818460208701613d31565b9190910192915050565b600083516139ed818460208801613d31565b835190830190613a01818360208801613d31565b01949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613a3d90830184613993565b9695505050505050565b60018060a01b0384168152826020820152606060408201526000613a6e6060830184613993565b95945050505050565b6020808252825182820181905260009190848201906040850190845b81811015613aaf57835183529284019291840191600101613a93565b50909695505050505050565b6020808252825482820181905260008481528281209092916040850190845b81811015613aaf57835483526001938401939285019201613ada565b6020810160038310613b1857634e487b7160e01b600052602160045260246000fd5b91905290565b602081526000611dc76020830184613993565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b61ffff858116825284166020808301919091526001600160a01b03841660408301526080606083015282546000918291600181811c9082811680613bab57607f831692505b848310811415613bc957634e487b7160e01b87526022600452602487fd5b6080880183905260a08801818015613be85760018114613bf957613c23565b60ff19861682528682019750613c23565b60008b815260209020895b86811015613c1d57815484820152908501908801613c04565b83019850505b50959c9b505050505050505050505050565b600060808201868352602060808185015281875180845260a0860191508289019350845b81811015613c7e5784516001600160a01b031683529383019391830191600101613c59565b50506001600160a01b039690961660408501525050506060015292915050565b604051601f8201601f1916810167ffffffffffffffff81118282101715613cc757613cc7613df3565b604052919050565b60008219821115613ce257613ce2613dc7565b500190565b600082613cf657613cf6613ddd565b500490565b6000816000190483118215151615613d1557613d15613dc7565b500290565b600082821015613d2c57613d2c613dc7565b500390565b60005b83811015613d4c578181015183820152602001613d34565b838111156119ea5750506000910152565b600181811c90821680613d7157607f821691505b60208210811415613d9257634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613dac57613dac613dc7565b5060010190565b600082613dc257613dc2613ddd565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146120de57600080fd5b80151581146120de57600080fd5b6001600160e01b0319811681146120de57600080fdfea2646970667358221220c2d4a626d703d48d2f5b3709dc3272a47e9549b19988da1b46c15c2a2fbe683664736f6c63430008040033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000000842616279446f6765000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000842616279446f6765000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004468747470733a2f2f697066732e696f2f697066732f516d515143545342686b6d42746a3233704e4c4a6b673972743745575074736d58635662447a33656671586875562f00000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106102765760003560e01c8063715018a61161014f5780639d5719b1116100c1578063c87b56dd1161007a578063c87b56dd14610700578063cac4ee0514610720578063db57e74514610740578063e985e9c514610753578063f2fde38b1461079c578063f9020e33146107bc57600080fd5b80639d5719b114610656578063a22cb4651461066b578063a2fb11751461068b578063a3bc9336146106ab578063b88d4fde146106cd578063bcfa950e146106ed57600080fd5b806388c6abf81161011357806388c6abf8146105c15780638ad78f80146105d85780638c3c4b34146105ee5780638da5cb5b1461060357806394985ddd1461062157806395d89b411461064157600080fd5b8063715018a614610536578063719ce73e1461054b57806379d49bb0146105615780637cb647591461058157806385142339146105a157600080fd5b80632eb4a7ab116101e8578063513d29ce116101ac578063513d29ce1461048c578063547520fe146104ac5780636352211e146104cc5780636c0360eb146104ec5780636c62ef141461050157806370a082311461051657600080fd5b80632eb4a7ab146103f65780632f745c591461040c57806342842e0e1461042c5780634891ad881461044c5780634f6ccce71461046c57600080fd5b8063095ea7b31161023a578063095ea7b3146103575780630a213e0414610377578063107fb6421461039657806318160ddd146103ab57806318e20a38146103c057806323b872dd146103d657600080fd5b8063018a2c371461028257806301ffc9a7146102a457806306095f59146102d957806306fdde03146102fd578063081812fc1461031f57600080fd5b3661027d57005b600080fd5b34801561028e57600080fd5b506102a261029d3660046137cc565b6107e3565b005b3480156102b057600080fd5b506102c46102bf366004613805565b610852565b60405190151581526020015b60405180910390f35b3480156102e557600080fd5b506102ef600f5481565b6040519081526020016102d0565b34801561030957600080fd5b506103126108bf565b6040516102d09190613b1e565b34801561032b57600080fd5b5061033f61033a3660046137cc565b610951565b6040516001600160a01b0390911681526020016102d0565b34801561036357600080fd5b506102a26103723660046136dd565b610997565b34801561038357600080fd5b506011546102c490610100900460ff1681565b3480156103a257600080fd5b506102ef610a25565b3480156103b757600080fd5b506001546102ef565b3480156103cc57600080fd5b506102ef600d5481565b3480156103e257600080fd5b506102a26103f13660046135f3565b610ec3565b34801561040257600080fd5b506102ef601a5481565b34801561041857600080fd5b506102ef6104273660046136dd565b610ece565b34801561043857600080fd5b506102a26104473660046135f3565b610fb3565b34801561045857600080fd5b506102a261046736600461383d565b610fce565b34801561047857600080fd5b506102ef6104873660046137cc565b61107f565b34801561049857600080fd5b506102a26104a73660046138aa565b6110ad565b3480156104b857600080fd5b506102a26104c73660046137cc565b6111ec565b3480156104d857600080fd5b5061033f6104e73660046137cc565b61124b565b3480156104f857600080fd5b5061031261125d565b34801561050d57600080fd5b506102a261126c565b34801561052257600080fd5b506102ef610531366004613583565b6112fd565b34801561054257600080fd5b506102a261134b565b34801561055757600080fd5b506102ef60125481565b34801561056d57600080fd5b506102a261057c3660046137cc565b611381565b34801561058d57600080fd5b506102a261059c3660046137cc565b6113e5565b3480156105ad57600080fd5b506102a26105bc3660046137cc565b611444565b3480156105cd57600080fd5b506018546102ef9081565b3480156105e457600080fd5b506102ef60105481565b3480156105fa57600080fd5b506102ef611712565b34801561060f57600080fd5b506008546001600160a01b031661033f565b34801561062d57600080fd5b506102a261063c3660046137e4565b61173a565b34801561064d57600080fd5b506103126117c0565b34801561066257600080fd5b506102a26117cf565b34801561067757600080fd5b506102a26106863660046136b0565b6118a8565b34801561069757600080fd5b506102ef6106a63660046137cc565b61193e565b3480156106b757600080fd5b506106c061195f565b6040516102d09190613a77565b3480156106d957600080fd5b506102a26106e8366004613633565b6119b6565b6102a26106fb366004613919565b6119f0565b34801561070c57600080fd5b5061031261071b3660046137cc565b611d47565b34801561072c57600080fd5b506102a261073b3660046137cc565b611dce565b6102a261074e3660046137cc565b611dfd565b34801561075f57600080fd5b506102c461076e3660046135bb565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b3480156107a857600080fd5b506102a26107b7366004613583565b6120e1565b3480156107c857600080fd5b506015546107d69060ff1681565b6040516102d09190613af6565b6008546001600160a01b031633146108165760405162461bcd60e51b815260040161080d90613b31565b60405180910390fd5b600d8190556040518181527fd227248b3540871674d341a3d15918c6eaed5a6704bae91d238aa95b5edaab89906020015b60405180910390a150565b60006001600160e01b031982166380ac58cd60e01b148061088357506001600160e01b03198216635b5e139f60e01b145b8061089e57506001600160e01b0319821663780e9d6360e01b145b806108b957506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600280546108ce90613d5d565b80601f01602080910402602001604051908101604052809291908181526020018280546108fa90613d5d565b80156109475780601f1061091c57610100808354040283529160200191610947565b820191906000526020600020905b81548152906001019060200180831161092a57829003601f168201915b5050505050905090565b600061095e826001541190565b61097b576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b60006109a28261124b565b9050806001600160a01b0316836001600160a01b031614156109d75760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b038216148015906109f757506109f5813361076e565b155b15610a15576040516367d9dca160e11b815260040160405180910390fd5b610a20838383612179565b505050565b600060026009541415610a7a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161080d565b600260095560115460ff16610af75760405162461bcd60e51b815260206004820152603960248201527f6572726f723a2063616e27742063616c6c206e6578745265776172644e6f6e6360448201527f65206265666f7265207468652073616c65206973206f76657200000000000000606482015260840161080d565b60006224ea0060166000610b0a60185490565b815260200190815260200160002054610b239190613ccf565b4211610b805760405162461bcd60e51b815260206004820152602660248201527f6572726f723a20697465726174696f6e20706572696f6420686173206e6f74206044820152651c185cdcd95960d21b606482015260840161080d565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000003782dace9d90000907f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316906370a082319060240160206040518083038186803b158015610c0157600080fd5b505afa158015610c15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c399190613901565b1015610c995760405162461bcd60e51b815260206004820152602960248201527f4e6f7420656e6f756768204c494e4b202d2066696c6c20636f6e74726163742060448201526877697468204c696e6b60b81b606482015260840161080d565b610ca7601880546001019055565b4260166000610cb560185490565b815260208101919091526040016000205560015460176000610cd660185490565b8152602001908152602001600020819055506000601160019054906101000a900460ff1615610d755750600a54479061271090610d179061ffff1683613cfb565b610d219190613ce7565b9150610d4882610d396008546001600160a01b031690565b6001600160a01b0316906121d5565b600a5461271090610d639062010000900461ffff1683613cfb565b610d6d9190613ce7565b601255610e6d565b610d7d6122ee565b600c546040516370a0823160e01b81523060048201526001600160a01b03909116906370a082319060240160206040518083038186803b158015610dc057600080fd5b505afa158015610dd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df89190613901565b600a5490915061271090610e109061ffff1683613cfb565b610e1a9190613ce7565b9150610e44610e316008546001600160a01b031690565b600c546001600160a01b031690846123a6565b600a5461271090610e5f9062010000900461ffff1683613cfb565b610e699190613ce7565b6012555b610eb77f9fe0eebf5e446e3c998ec9bb19951541aee00bb90ea201ae456421a2ded868057f00000000000000000000000000000000000000000000000003782dace9d900006123f8565b92505050600160095590565b610a20838383612582565b6000610ed9836112fd565b8210610ef8576040516306ed618760e11b815260040160405180910390fd5b6000610f0360015490565b905060008060005b83811015610f9c576000818152600460209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910467ffffffffffffffff169183019190915215610f5e57805192505b876001600160a01b0316836001600160a01b03161415610f935786841415610f8c575093506108b992505050565b6001909301925b50600101610f0b565b50634e487b7160e01b600052600160045260246000fd5b610a20838383604051806020016040528060008152506119b6565b6008546001600160a01b03163314610ff85760405162461bcd60e51b815260040161080d90613b31565b6015805482919060ff1916600183600281111561102557634e487b7160e01b600052602160045260246000fd5b02179055506015547f5f393514fe885345bf6ba49c7009fef8081ddf42042464e8dfe04a17f001cddf9060ff16600281111561107157634e487b7160e01b600052602160045260246000fd5b604051908152602001610847565b600061108a60015490565b82106110a9576040516329c8c00760e21b815260040160405180910390fd5b5090565b6008546001600160a01b031633146110d75760405162461bcd60e51b815260040161080d90613b31565b6001600160a01b03821661113c5760405162461bcd60e51b815260206004820152602660248201527f4572726f723a20546f6b656e2063616e277420626520746865207a65726f206160448201526564647265737360d01b606482015260840161080d565b600a805461ffff858116620100000263ffffffff1990921690871617179055600c80546001600160a01b0384166001600160a01b0319909116179055805161118b90600b90602084019061342e565b50600a54600c546040517e89f6d806b406160fe53ec387c78595e885ca4881db758f4e83ca7ddc069b88926111de9261ffff808316936201000090930416916001600160a01b0390911690600b90613b66565b60405180910390a150505050565b6008546001600160a01b031633146112165760405162461bcd60e51b815260040161080d90613b31565b60108190556040518181527f3b64f5d0ae4de41d36db0948fc83ffbba5d86eb79841008d6047a25f46ed2b7990602001610847565b6000611256826127a1565b5192915050565b6060611267612836565b905090565b6008546001600160a01b031633146112965760405162461bcd60e51b815260040161080d90613b31565b6011805461ff001981166101009182900460ff16159091021790556112b9610a25565b5060115460405161010090910460ff16151581527fa52383c36c234ecf24255806fe74d869b31d0a0d26073e975ddeb5f871886262906020015b60405180910390a1565b60006001600160a01b038216611326576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160801b031690565b6008546001600160a01b031633146113755760405162461bcd60e51b815260040161080d90613b31565b61137f6000612845565b565b6008546001600160a01b031633146113ab5760405162461bcd60e51b815260040161080d90613b31565b6113b53382612897565b6040518181527fffa76519d7df0608ca65c5af555ef0723f461afa7dadac8ccb5b3f7a8019e3ef90602001610847565b6008546001600160a01b0316331461140f5760405162461bcd60e51b815260040161080d90613b31565b601a8190556040518181527f42cbc405e4dbf1b691e85b9a34b08ecfcf7a9ad9078bf4d645ccfa1fac11c10b90602001610847565b600260095414156114975760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161080d565b6002600955336114a68261124b565b6001600160a01b0316146115075760405162461bcd60e51b815260206004820152602260248201527f6572726f723a20796f7520646f6e74206f776e20612077696e6e696e6720646f604482015261676560f01b606482015260840161080d565b6000805b60145481101561167357826014828154811061153757634e487b7160e01b600052603260045260246000fd5b90600052602060002001541415611661576014546012546115589190613ce7565b9150816012546115689190613d1a565b601255805b60145461157c90600190613d1a565b8110156115f8576014611590826001613ccf565b815481106115ae57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154601482815481106115da57634e487b7160e01b600052603260045260246000fd5b600091825260209091200155806115f081613d98565b91505061156d565b50601480548061161857634e487b7160e01b600052603160045260246000fd5b60019003818190600052602060002001600090559055601160019054906101000a900460ff16156116555761165082610d398561124b565b611661565b611661610e318461124b565b8061166b81613d98565b91505061150b565b50600081116116d05760405162461bcd60e51b815260206004820152602360248201527f6572726f723a207072697a65206d75737420626520677265617465722074686560448201526206e20360ec1b606482015260840161080d565b60408051838152602081018390527ff4338f56dc8b8e2b8c87ae4eb8008d2290a524a16c153183ef0b116ef4834d7d910160405180910390a150506001600955565b60155460009060ff16600281111561126757634e487b7160e01b600052602160045260246000fd5b336001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e6990916146117b25760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c00604482015260640161080d565b6117bc82826128b1565b5050565b6060600380546108ce90613d5d565b6008546001600160a01b031633146117f95760405162461bcd60e51b815260040161080d90613b31565b60115460ff161561184c5760405162461bcd60e51b815260206004820181905260248201527f43616e206f6e6c792063616c6c20746869732066756e6374696f6e206f6e6365604482015260640161080d565b6011805460ff1916600117905561186f47610d396008546001600160a01b031690565b60115460405160ff909116151581527fd5dc719472ee802e529d4afc3a953b5d8ea1790730213eafdcfce3433d2ea225906020016112f3565b6001600160a01b0382163314156118d25760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6013818154811061194e57600080fd5b600091825260209091200154905081565b6060601380548060200260200160405190810160405280929190818152602001828054801561094757602002820191906000526020600020905b815481526020019060010190808311611999575050505050905090565b6119c1848484612582565b6119cd848484846129b6565b6119ea576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b600160155460ff166002811115611a1757634e487b7160e01b600052602160045260246000fd5b14611a645760405162461bcd60e51b815260206004820152601a60248201527f57686974656c6973742073616c65206973206e6f74206c697665000000000000604482015260640161080d565b336000908152601b602052604090205460ff1615611ada5760405162461bcd60e51b815260206004820152602d60248201527f596f75722077686974656c69737420656e7472792068617320616c726561647960448201526c081899595b8818db185a5b5959609a1b606482015260840161080d565b601054831115611b2c5760405162461bcd60e51b815260206004820152601e60248201527f596f752063616e2774206d696e742074686174206d616e7920646f6765730000604482015260640161080d565b7f000000000000000000000000000000000000000000000000000000000000271083611b5760015490565b611b619190613ccf565b1115611baf5760405162461bcd60e51b815260206004820152601d60248201527f546f74616c20737570706c7920686173206265656e2072656163686564000000604482015260640161080d565b3483600f54611bbe9190613cfb565b1115611bfd5760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b604482015260640161080d565b6040516bffffffffffffffffffffffff193360601b166020820152600090603401604051602081830303815290604052805190602001209050611c7783838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050601a549150849050612ac4565b611cd15760405162461bcd60e51b815260206004820152602560248201527f4f6f70732c2063616e27742066696e6420796f75206f6e207468652077686974604482015264195b1a5cdd60da1b606482015260840161080d565b336000818152601b60205260409020805460ff19166001179055611cf59085612897565b600e54158015611d3857507f0000000000000000000000000000000000000000000000000000000000002710611d2a60015490565b1480611d385750600d544210155b156119ea5743600e5550505050565b6060611d54826001541190565b611d7157604051630a14c4b560e41b815260040160405180910390fd5b6000611d7b612836565b9050805160001415611d9c5760405180602001604052806000815250611dc7565b80611da684612ada565b604051602001611db79291906139db565b6040516020818303038152906040525b9392505050565b6008546001600160a01b03163314611df85760405162461bcd60e51b815260040161080d90613b31565b600f55565b600260155460ff166002811115611e2457634e487b7160e01b600052602160045260246000fd5b14611e715760405162461bcd60e51b815260206004820152601860248201527f5075626c69632073616c6520686173206e6f74206c6976650000000000000000604482015260640161080d565b601054811115611ec35760405162461bcd60e51b815260206004820152601e60248201527f596f752063616e2774206d696e742074686174206d616e7920646f6765730000604482015260640161080d565b7f000000000000000000000000000000000000000000000000000000000000271081611eee60015490565b611ef89190613ccf565b1115611f465760405162461bcd60e51b815260206004820152601d60248201527f546f74616c20737570706c7920686173206265656e2072656163686564000000604482015260640161080d565b3481600f54611f559190613cfb565b1115611fbf5760405162461bcd60e51b815260206004820152603360248201527f436865636b20796f75722062616c616e63652c206e6f7420656e6f75676820456044820152721512081d1bc818dbdb5c1b195d19481b5a5b9d606a1b606482015260840161080d565b60105433600090815260196020526040902054611fdd908390613ccf565b11156120625760405162461bcd60e51b815260206004820152604860248201527f456163682075736572206973206f6e6c7920616c6c6f77656420746f206d696e60448201527f74203220646f6765732c207472792061646a757374696e6720796f7572207175606482015267616e74697469657360c01b608482015260a40161080d565b3360009081526019602052604081208054839290612081908490613ccf565b9091555061209190503382612897565b600e541580156120d457507f00000000000000000000000000000000000000000000000000000000000027106120c660015490565b14806120d45750600d544210155b156120de5743600e555b50565b6008546001600160a01b0316331461210b5760405162461bcd60e51b815260040161080d90613b31565b6001600160a01b0381166121705760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161080d565b6120de81612845565b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b804710156122255760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161080d565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612272576040519150601f19603f3d011682016040523d82523d6000602084013e612277565b606091505b5050905080610a205760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161080d565b61137f600c60009054906101000a90046001600160a01b03166123a147737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561235857600080fd5b505afa15801561236c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612390919061359f565b600c546001600160a01b0316612bf4565b612e0d565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610a20908490613005565b60007f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316634000aea07f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e6990984866000604051602001612468929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b815260040161249593929190613a47565b602060405180830381600087803b1580156124af57600080fd5b505af11580156124c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124e791906137b0565b5060008381526020818152604080832054815180840188905280830185905230606082015260808082018390528351808303909101815260a090910190925281519183019190912086845292909152612541906001613ccf565b60008581526020818152604091829020929092558051808301879052808201849052815180820383018152606090910190915280519101205b949350505050565b600061258d826127a1565b80519091506000906001600160a01b0316336001600160a01b031614806125c45750336125b984610951565b6001600160a01b0316145b806125d6575081516125d6903361076e565b9050806125f657604051632ce44b5f60e11b815260040160405180910390fd5b846001600160a01b031682600001516001600160a01b03161461262b5760405162a1148160e81b815260040160405180910390fd5b6001600160a01b03841661265257604051633a954ecd60e21b815260040160405180910390fd5b6126626000848460000151612179565b6001600160a01b03858116600090815260056020908152604080832080546001600160801b03198082166001600160801b03928316600019018316179092558986168086528386208054938416938316600190810190931693909317909255888552600490935281842080546001600160e01b031916909117600160a01b4267ffffffffffffffff16021790559086018083529120549091166127575761270a816001541190565b15612757578251600082815260046020908152604090912080549186015167ffffffffffffffff16600160a01b026001600160e01b03199092166001600160a01b03909316929092171790555b5082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b60408051808201909152600080825260208201526127c0826001541190565b6127dd57604051636f96cda160e11b815260040160405180910390fd5b815b6000818152600460209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910467ffffffffffffffff16918301919091521561282c579392505050565b50600019016127df565b6060600b80546108ce90613d5d565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6117bc8282604051806020016040528060008152506130d7565b60006101f46128bf60015490565b6128c99084613db3565b6128d39190613d1a565b90506040518060800160405280828152602001826101f46128f49190613ccf565b815260200161290583610190613ccf565b81526020016129168361012c613ccf565b90526129269060139060046134ae565b506040518060800160405280828152602001826101f46129469190613ccf565b815260200161295783610190613ccf565b81526020016129688361012c613ccf565b90526129789060149060046134ae565b507f11609bf0dfcab1cd8696cdc747ee705ba9c458e0b7e701b1ebd4e1dfb6b5fb2460136040516129a99190613abb565b60405180910390a1505050565b60006001600160a01b0384163b15612ab957604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906129fa903390899088908890600401613a0a565b602060405180830381600087803b158015612a1457600080fd5b505af1925050508015612a44575060408051601f3d908101601f19168201909252612a4191810190613821565b60015b612a9f573d808015612a72576040519150601f19603f3d011682016040523d82523d6000602084013e612a77565b606091505b508051612a97576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061257a565b506001949350505050565b600082612ad185846130e4565b14949350505050565b606081612afe5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612b285780612b1281613d98565b9150612b219050600a83613ce7565b9150612b02565b60008167ffffffffffffffff811115612b5157634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612b7b576020820181803683370190505b5090505b841561257a57612b90600183613d1a565b9150612b9d600a86613db3565b612ba8906030613ccf565b60f81b818381518110612bcb57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350612bed600a86613ce7565b9450612b7f565b60405163e6a4390560e01b81526001600160a01b038084166004830152821660248201526000908190735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9063e6a439059060440160206040518083038186803b158015612c5457600080fd5b505afa158015612c68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c8c919061359f565b9050600080826001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015612cca57600080fd5b505afa158015612cde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d02919061385c565b506001600160701b031691506001600160701b031691506000836001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015612d5457600080fd5b505afa158015612d68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d8c919061359f565b9050600080886001600160a01b0316836001600160a01b031614612db1578385612db4565b84845b90925090506000612dc78b6103e5613cfb565b90506000612dd58383613cfb565b9050600082612de6866103e8613cfb565b612df09190613ccf565b9050612dfc8183613ce7565b9d9c50505050505050505050505050565b60408051600280825260608201835247926000929190602083019080368337019050509050737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612e7f57600080fd5b505afa158015612e93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eb7919061359f565b81600081518110612ed857634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b0316815250508381600181518110612f1a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0390921660209283029190910190910152737a250d5630b4cf539739df2c5dacb4c659f2488d637ff36ab583858430612f5c426102bc613ccf565b6040518663ffffffff1660e01b8152600401612f7b9493929190613c35565b6000604051808303818588803b158015612f9457600080fd5b505af1158015612fa8573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f19168201604052612fd19190810190613708565b60018251612fdf9190613d1a565b81518110612ffd57634e487b7160e01b600052603260045260246000fd5b505050505050565b600061305a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166131669092919063ffffffff16565b805190915015610a20578080602001905181019061307891906137b0565b610a205760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161080d565b610a208383836001613175565b600081815b845181101561315e57600085828151811061311457634e487b7160e01b600052603260045260246000fd5b6020026020010151905080831161313a576000838152602082905260409020925061314b565b600081815260208490526040902092505b508061315681613d98565b9150506130e9565b509392505050565b606061257a84846000856132c4565b6001546001600160a01b03851661319e57604051622e076360e81b815260040160405180910390fd5b836131bc5760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03851660008181526005602090815260408083208054600160801b6001600160801b031982166001600160801b039283168c01831690811782900483168c01909216021790558483526004909152812080546001600160e01b031916909217600160a01b4267ffffffffffffffff16021790915581905b858110156132bb5760405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4838015613291575061328f60008884886129b6565b155b156132af576040516368d2bf6b60e11b815260040160405180910390fd5b6001918201910161323a565b5060015561279a565b6060824710156133255760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161080d565b6001600160a01b0385163b61337c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161080d565b600080866001600160a01b0316858760405161339891906139bf565b60006040518083038185875af1925050503d80600081146133d5576040519150601f19603f3d011682016040523d82523d6000602084013e6133da565b606091505b50915091506133ea8282866133f5565b979650505050505050565b60608315613404575081611dc7565b8251156134145782518084602001fd5b8160405162461bcd60e51b815260040161080d9190613b1e565b82805461343a90613d5d565b90600052602060002090601f01602090048101928261345c57600085556134a2565b82601f1061347557805160ff19168380011785556134a2565b828001600101855582156134a2579182015b828111156134a2578251825591602001919060010190613487565b506110a99291506134e8565b8280548282559060005260206000209081019282156134a257916020028201828111156134a2578251825591602001919060010190613487565b5b808211156110a957600081556001016134e9565b600067ffffffffffffffff83111561351757613517613df3565b61352a601f8401601f1916602001613c9e565b905082815283838301111561353e57600080fd5b828260208301376000602084830101529392505050565b80516001600160701b038116811461356c57600080fd5b919050565b803561ffff8116811461356c57600080fd5b600060208284031215613594578081fd5b8135611dc781613e09565b6000602082840312156135b0578081fd5b8151611dc781613e09565b600080604083850312156135cd578081fd5b82356135d881613e09565b915060208301356135e881613e09565b809150509250929050565b600080600060608486031215613607578081fd5b833561361281613e09565b9250602084013561362281613e09565b929592945050506040919091013590565b60008060008060808587031215613648578081fd5b843561365381613e09565b9350602085013561366381613e09565b925060408501359150606085013567ffffffffffffffff811115613685578182fd5b8501601f81018713613695578182fd5b6136a4878235602084016134fd565b91505092959194509250565b600080604083850312156136c2578182fd5b82356136cd81613e09565b915060208301356135e881613e1e565b600080604083850312156136ef578182fd5b82356136fa81613e09565b946020939093013593505050565b6000602080838503121561371a578182fd5b825167ffffffffffffffff80821115613731578384fd5b818501915085601f830112613744578384fd5b81518181111561375657613756613df3565b8060051b9150613767848301613c9e565b8181528481019084860184860187018a1015613781578788fd5b8795505b838610156137a3578051835260019590950194918601918601613785565b5098975050505050505050565b6000602082840312156137c1578081fd5b8151611dc781613e1e565b6000602082840312156137dd578081fd5b5035919050565b600080604083850312156137f6578182fd5b50508035926020909101359150565b600060208284031215613816578081fd5b8135611dc781613e2c565b600060208284031215613832578081fd5b8151611dc781613e2c565b60006020828403121561384e578081fd5b813560038110611dc7578182fd5b600080600060608486031215613870578081fd5b61387984613555565b925061388760208501613555565b9150604084015163ffffffff8116811461389f578182fd5b809150509250925092565b600080600080608085870312156138bf578182fd5b6138c885613571565b93506138d660208601613571565b925060408501356138e681613e09565b9150606085013567ffffffffffffffff811115613685578182fd5b600060208284031215613912578081fd5b5051919050565b60008060006040848603121561392d578081fd5b83359250602084013567ffffffffffffffff8082111561394b578283fd5b818601915086601f83011261395e578283fd5b81358181111561396c578384fd5b8760208260051b8501011115613980578384fd5b6020830194508093505050509250925092565b600081518084526139ab816020860160208601613d31565b601f01601f19169290920160200192915050565b600082516139d1818460208701613d31565b9190910192915050565b600083516139ed818460208801613d31565b835190830190613a01818360208801613d31565b01949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613a3d90830184613993565b9695505050505050565b60018060a01b0384168152826020820152606060408201526000613a6e6060830184613993565b95945050505050565b6020808252825182820181905260009190848201906040850190845b81811015613aaf57835183529284019291840191600101613a93565b50909695505050505050565b6020808252825482820181905260008481528281209092916040850190845b81811015613aaf57835483526001938401939285019201613ada565b6020810160038310613b1857634e487b7160e01b600052602160045260246000fd5b91905290565b602081526000611dc76020830184613993565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b61ffff858116825284166020808301919091526001600160a01b03841660408301526080606083015282546000918291600181811c9082811680613bab57607f831692505b848310811415613bc957634e487b7160e01b87526022600452602487fd5b6080880183905260a08801818015613be85760018114613bf957613c23565b60ff19861682528682019750613c23565b60008b815260209020895b86811015613c1d57815484820152908501908801613c04565b83019850505b50959c9b505050505050505050505050565b600060808201868352602060808185015281875180845260a0860191508289019350845b81811015613c7e5784516001600160a01b031683529383019391830191600101613c59565b50506001600160a01b039690961660408501525050506060015292915050565b604051601f8201601f1916810167ffffffffffffffff81118282101715613cc757613cc7613df3565b604052919050565b60008219821115613ce257613ce2613dc7565b500190565b600082613cf657613cf6613ddd565b500490565b6000816000190483118215151615613d1557613d15613dc7565b500290565b600082821015613d2c57613d2c613dc7565b500390565b60005b83811015613d4c578181015183820152602001613d34565b838111156119ea5750506000910152565b600181811c90821680613d7157607f821691505b60208210811415613d9257634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613dac57613dac613dc7565b5060010190565b600082613dc257613dc2613ddd565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146120de57600080fd5b80151581146120de57600080fd5b6001600160e01b0319811681146120de57600080fdfea2646970667358221220c2d4a626d703d48d2f5b3709dc3272a47e9549b19988da1b46c15c2a2fbe683664736f6c63430008040033

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

000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000000842616279446f6765000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000842616279446f6765000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004468747470733a2f2f697066732e696f2f697066732f516d515143545342686b6d42746a3233704e4c4a6b673972743745575074736d58635662447a33656671586875562f00000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : name (string): BabyDoge
Arg [1] : symbol (string): BabyDoge
Arg [2] : baseTokenURI (string): https://ipfs.io/ipfs/QmQQCTSBhkmBtj23pNLJkg9rt7EWPtsmXcVbDz3efqXhuV/
Arg [3] : maxNftSupply (uint256): 10000

-----Encoded View---------------
12 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [3] : 0000000000000000000000000000000000000000000000000000000000002710
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [5] : 42616279446f6765000000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [7] : 42616279446f6765000000000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000044
Arg [9] : 68747470733a2f2f697066732e696f2f697066732f516d515143545342686b6d
Arg [10] : 42746a3233704e4c4a6b673972743745575074736d58635662447a3365667158
Arg [11] : 6875562f00000000000000000000000000000000000000000000000000000000


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

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