ETH Price: $3,486.87 (+2.30%)
Gas: 3.47 Gwei

Token

Rabbit (RBT)
 

Overview

Max Total Supply

0 RBT

Holders

62

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Filtered by Token Holder
gimmeyourbags.eth
Balance
3 RBT
0x2c339b8ad2147c2f63cff0f5b6e144810c2b1119
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:
Rabbit

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 21 : Rabbit.sol
//SPDX License Identifier: MIT
pragma solidity ^0.8.19;

/**
                             ,
                            /|      __
                           / |   ,-~ /
                          Y :|  //  /
                          | jj /( .^
                          >-"~"-v"
                         /       Y
                        jo  o    |
                       ( ~T~     j
                        >._-' _./
                       /   "~"  |
                      Y     _,  |
                     /| ;-"~ _  l
                    / l/ ,-"~    \
                    \//\/      .- \
                     Y        /    Y   
                     l       I     !
                     ]\      _\    /"\
                    (" ~----( ~   Y.  )
                ~~~~~~~~~~~~~~~~~~~~~~~~~~

 _______          _       ______   ______   _____  _________  
|_   __ \        / \     |_   _ \ |_   _ \ |_   _||  _   _  | 
  | |__) |      / _ \      | |_) |  | |_) |  | |  |_/ | | \_| 
  |  __ /      / ___ \     |  __'.  |  __'.  | |      | |     
 _| |  \ \_  _/ /   \ \_  _| |__) |_| |__) |_| |_    _| |_    
|____| |___||____| |____||_______/|_______/|_____|  |_____|   
                                                              
    https://twitter.com/Karrot_gg 

 */

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./interfaces/IConfig.sol";
import "./interfaces/IKarrotsToken.sol";
import "./interfaces/IStolenPool.sol";
import "./interfaces/IRandomizer.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

/**
Rabbit: destroyer of $KARROT
- Non-transferrable ERC721
- Mintable by burning $KARROT
- Minted as one of 3 tiers: white, gold, diamond, which have different reward rates per attack for karrots in the stolen pool
- Each rabbit has 5 HP (can fail 5 attacks, each failed attack is -1 HP), and has a 50/50 chance of attack success
- When a rabbit loses all HP, it is burned
- Rabbits cannot be burned by the owner, but can be rerolled for the same price in karrots paid to mint
- 
 */

contract Rabbit is ERC721, Ownable, ReentrancyGuard {
    //================================================================================================
    // SETUP
    //================================================================================================
    using SafeERC20 for IERC20;

    string public baseURI = "https://bafybeicblns3rjbuqytxlh6rj6vv6isevkowtyoa7h6fitazvz5js4uxwy.ipfs.nftstorage.link/";

    IConfig public config;

    bool private isInitialized;
    bool public rabbitMintIsOpen;
    bool public rabbitAttackIsOpen;

    uint16 public constant PERCENTAGE_DENOMINATOR = 10000;
    uint32 public amountMinted;
    uint32 public startTimestamp;
    uint16 public rabbitBatchSize = 50;
    uint32 public rabbitMintSecondsBetweenBatches = 1 days;
    uint8 public rabbitMaxPerWallet = 3;
    uint32 public rabbitAttackCooldownSeconds = 8 hours;
    uint8 public rabbitAttackHpDeductionAmount = 1;

    uint128 public rabbitMintPriceInKarrots = 1500000000 * 1e18; //1.5B Karrot

    uint16 public rabbitMintKarrotFeePercentageToBurn = 2000; //20%
    uint16 public rabbitMintKarrotFeePercentageToStolenPool = 8000; //80%
    uint16 public rabbitMintTier1Threshold = 6000; //60%
    uint16 public rabbitMintTier2Threshold = 3000; //30%, used as chance > tier1, chance <= tier1+tier2
    uint8 public rabbitHP = 5; //number of survivable attacks
    uint16 public rabbitHitRate = 5000; //50%

    uint16 public rabbitAttackHpDeductionThreshold = 7500; //75%

    uint24 public requestNonce;
    uint32 public constant claimRequestTimeout = 15 minutes; 

    struct RabbitEntry {
        uint16 healthPoints;
        uint8 tier;
        uint32 lastAttackTimestamp;
        string tokenURI;
        bool hasAttacked;
    }
    mapping(uint256 => RabbitEntry) public rabbits;
    mapping(address => uint256[]) public ownerToRabbitIds;
    mapping(uint256 => uint256) public batchNumberToAmountMinted;
    mapping(uint256 => uint256) public batchNumberToNumRerolls; // used to expand number minted per batch for rerolls since one is being burned, i.e. mintable0 = 50, reroll, mintable1 = 51, but there are still 50 since 1 was burned. just so that rerolls can't be used to drain the batch.
    
    event RabbitMint(uint256 rabbitId, uint256 tier, uint256 healthPoints, address owner);
    event RabbitReroll(address owner, uint256 rabbitId);
    event RabbitHealthPointsUpdated(uint256 rabbitId, uint256 healthPoints);
    event AttackResult(uint256 rabbitId, address attackSender, string attackResult);

    error ForwardFailed();
    error RabbitsPerWalletLimitReached();
    error TisSoulbound();
    error EOAsOnly(address sender);
    error InsufficientKarrotsForRabbitMint();
    error MaxRabbitsMinted();
    error NoRabbitsOwned();
    error InvalidAttackVerdict(uint256 verdict);
    error CallerIsNotConfig();
    error AttackOnCooldown();
    error MintIsClosed();
    error AttacksAreClosed();
    error NotOwnerOfRabbit();
    error CantRerollRabbitThatHasAttacked();

    constructor(address _configManagerAddress) ERC721("Rabbit", "RBT") {
        config = IConfig(_configManagerAddress);
        startTimestamp = uint32(block.timestamp);
    }

    //================================================================================================
    // MINT + REROLL LOGIC
    //================================================================================================

    /**
        @dev requestToMintRabbits - mints rabbits after necessary checks
        @notice requires prior approval of this contract to spend user's $KARROT!
            3 Args:
                _amount: number of rabbits to mint
                _isReroll: true if this is a reroll, false if it's a new mint
                _idToBurn: if _isReroll is true, this is the rabbitId to burn
        @notice checks rabbit mint is open
        @notice if reroll, calls _burnRabbit, and negates effect on total mintable rabbits this batch
        @notice checks if max rabbits have been minted within this batch
        @notice checks if user has enough $KARROT to mint
        @notice checks if user has reached max rabbits per wallet
        @notice checks if user is an EOA
        @notice karrots "sent" to the stolen pool are burned here and "virtually deposited" to the stolen pool via depositFromRabbit()
     */

    function requestToMintRabbits(uint8 _amount, bool _isReroll, uint256 _idToBurn) public payable nonReentrant returns (uint256) {

        IERC20 karrots = IERC20(config.karrotsAddress());
        
        uint256 mintTransactionKarrotsTotal = rabbitMintPriceInKarrots * _amount;
        uint256 amountToBurn = Math.mulDiv(
            mintTransactionKarrotsTotal,
            rabbitMintKarrotFeePercentageToBurn,
            PERCENTAGE_DENOMINATOR
        );
        uint256 amountToStolenPool = Math.mulDiv(
            mintTransactionKarrotsTotal,
            rabbitMintKarrotFeePercentageToStolenPool,
            PERCENTAGE_DENOMINATOR
        );

        if (msg.sender != tx.origin && msg.sender != address(this)) {
            revert EOAsOnly(msg.sender);
        }

        if (!rabbitMintIsOpen) {
            revert MintIsClosed();
        }

        if (karrots.balanceOf(msg.sender) < mintTransactionKarrotsTotal) {
            revert InsufficientKarrotsForRabbitMint();
        }

        if (balanceOf(msg.sender) + _amount > rabbitMaxPerWallet && !_isReroll) {
            revert RabbitsPerWalletLimitReached();
        }

        if(_isReroll){
            if(ownerOf(_idToBurn) != msg.sender){
                revert NotOwnerOfRabbit();
            }
            if(rabbits[_idToBurn].hasAttacked){
                revert CantRerollRabbitThatHasAttacked();
            }
            ++batchNumberToNumRerolls[getBatchNumber()];
            _burnRabbit(_idToBurn);
            emit RabbitReroll(msg.sender, _idToBurn);
        }

        uint256 thisBatchNumber = getBatchNumber();
        if (batchNumberToAmountMinted[thisBatchNumber] + _amount > rabbitBatchSize + batchNumberToNumRerolls[thisBatchNumber]) {
            revert MaxRabbitsMinted();
        }

        if(karrots.allowance(msg.sender, config.karrotStolenPoolAddress()) < mintTransactionKarrotsTotal){
            karrots.forceApprove(address(this), mintTransactionKarrotsTotal);
        }

        karrots.safeTransferFrom(msg.sender, address(this), mintTransactionKarrotsTotal);
        IKarrotsToken(address(karrots)).burn(mintTransactionKarrotsTotal);

        IStolenPool(config.karrotStolenPoolAddress()).virtualDeposit(amountToStolenPool);

        uint256 randomNumber = IRandomizer(config.randomizerAddress()).getRandomNumber(
            msg.sender, 
            block.timestamp, 
            requestNonce
        );

        batchNumberToAmountMinted[thisBatchNumber] += _amount;
        ++requestNonce;

        _mintNRabbits(randomNumber, _amount);
    }

    //------------------------------------------------------------------------------------------------
    // MINT / REROLL - RELATED INTERNAL FUNCTIONS
    //------------------------------------------------------------------------------------------------
    /**
        @dev wrapper to call _mintRabbit multiple times
        @notice uses first random to generate more by hashing that number and the iterator value
     */
    function _mintNRabbits(uint256 _randomNumber, uint256 _amount) private {
        for (uint256 i = 0; i < _amount; i++) {
            uint256 newRandom = uint256(keccak256(abi.encode(_randomNumber, i)));
            _mintRabbit(newRandom);
        }
    }

    /**
        @dev mints a rabbit using rng to determine tier. 
        @notice important that ++amountMinted happens before anything that depends on amountMinted,
            this is the token ID.
        @notice sets tokenURI to the baseURI + tier + .json
        @notice pushes latest tokenId to the ownerToRabbitIds mapping
     */
    function _mintRabbit(uint256 _randomNumber) private {
        address recipient = msg.sender;
        uint256 randValMod = _randomNumber % PERCENTAGE_DENOMINATOR;
        
        ++amountMinted;
        
        RabbitEntry storage rabbit = rabbits[amountMinted];
        rabbit.healthPoints = rabbitHP;

        if (randValMod <= rabbitMintTier1Threshold) {
            rabbit.tier = 1;
        } else if (randValMod > rabbitMintTier1Threshold && randValMod <= rabbitMintTier1Threshold + rabbitMintTier2Threshold) {
            rabbit.tier = 2;
        } else {
            rabbit.tier = 3;
        }
        
        string memory thisTokenURI = string(
            abi.encodePacked(baseURI, Strings.toString(rabbit.tier), ".json")
        );

        rabbit.tokenURI = thisTokenURI;
        ownerToRabbitIds[recipient].push(amountMinted);

        _safeMint(recipient, amountMinted);

        emit RabbitMint(amountMinted, rabbit.tier, rabbit.healthPoints, recipient);
    }

    /**
        @dev burns rabbit nft, and removes it's corresponding entries in all related mappings and from the owner's array of owned rabbit ids...
        ...finds index in owned rabbit ids array corresponding to desired rabbit id, and replaces it with the last element in the array, then pops the last element
    */
    function _burnRabbit(uint256 _id) private {
        //remove rabbit ownerToRabbitIds mapping

        address rabbitOwner = ownerOf(_id);
        uint256[] storage rabbitIds = ownerToRabbitIds[rabbitOwner];

        if(rabbitIds.length == 0){
            revert NoRabbitsOwned();
        }

        if (rabbitIds.length == 1) {
            delete ownerToRabbitIds[rabbitOwner];
        } else {
            uint256 rabbitIdIndex = 0;
            for (uint256 i = 0; i < rabbitIds.length; i++) {
                if (rabbitIds[i] == _id) {
                    rabbitIdIndex = i;
                    break;
                }
            }

            rabbitIds[rabbitIdIndex] = rabbitIds[rabbitIds.length - 1];
            rabbitIds.pop();
        }

        delete rabbits[_id];

        _burn(_id);
    }

    //================================================================================================
    // ATTACK LOGIC
    //================================================================================================

    
    /**
        @dev called by user to request an attack on a rabbit
        @notice requires that the caller is the owner of the rabbit
        @notice requires that the rabbit is not on cooldown
        @notice requires that the caller is an EOA (not a contract)
        @notice generates random number and calls _completeAttack
     */
    function requestAttack(uint32 _rabbitId) external payable nonReentrant returns (uint256) {
        // cant call if request is already pending
        // needs to have one rabbit in wallet to attack

        if(ownerOf(_rabbitId) != msg.sender){
            revert NotOwnerOfRabbit();
        }

        if (!rabbitAttackIsOpen) {
            revert AttacksAreClosed();
        }

        // [!] check if caller is an EOA (optional - review)
        if (msg.sender != tx.origin) {
            revert EOAsOnly(msg.sender);
        }

        //enforce cooldown, set last attack timestamp at end of function with other mappings...
        if (
            getRabbitCooldownSecondsRemaining(_rabbitId) > 0
        ) {
            revert AttackOnCooldown();
        }

        //set that the rabbit has attempted an attack
        rabbits[_rabbitId].hasAttacked = true;

        //set new last attack timestamp
        rabbits[_rabbitId].lastAttackTimestamp = uint32(block.timestamp);

        uint256 randomNumber = IRandomizer(config.randomizerAddress()).getRandomNumber(
            msg.sender,
            block.timestamp,
            requestNonce
        );

        _completeAttack(_rabbitId, randomNumber);
        ++requestNonce;

    }

    //------------------------------------------------------------------------------------------------
    // ATTACK-RELATED PRIVATE FUNCTIONS
    //------------------------------------------------------------------------------------------------

    function _completeAttack(uint256 _rabbitId, uint256 _randomNumber) private {
        //reveal random number and perform attack

        //perform attack
        RabbitEntry storage rabbit = rabbits[_rabbitId];

        uint256 verdict = _getAttackVerdict(_randomNumber);
        address attackSender = msg.sender;

        //carry out actions based on attackVerdict / values defined above
        if (verdict == 1) {
            IStolenPool(config.karrotStolenPoolAddress()).attack(attackSender, rabbit.tier, _rabbitId); //input what stolen pool needs to calculate attack size
            emit AttackResult(_rabbitId, attackSender, "Attack succeeded. No HP Lost.");
        } else if (verdict == 2) {
            //subtract health points
            _manageRabbitHealthPoints(_rabbitId);
            emit AttackResult(_rabbitId, attackSender, "Attack failed. 1 HP Lost.");
        } else {
            revert InvalidAttackVerdict(verdict);
        }
    }

    /**
     *  @dev subtracts health points from rabbit, and burns it if it reaches 0 health points
     */
    function _manageRabbitHealthPoints(uint256 _rabbitId) private {
        RabbitEntry storage rabbit = rabbits[_rabbitId];
        rabbit.healthPoints -= rabbitAttackHpDeductionAmount;
        emit RabbitHealthPointsUpdated(_rabbitId, rabbit.healthPoints);
        if (rabbit.healthPoints == 0) {
            _burnRabbit(_rabbitId);
        }
    }

    /**
     * @dev outputs a verdict based on the random number and rabbit hit rate
     */
    function _getAttackVerdict(uint256 _randomNumber) private view returns (uint256) {
        uint256 verdict;
        uint256 randValModAttackSuccess = _randomNumber % PERCENTAGE_DENOMINATOR;
        if (randValModAttackSuccess <= rabbitHitRate) {
            verdict = 1;
        } else {
            verdict = 2;
        }
        return verdict;
    }

    //================================================================================================
    // PUBLIC GET FUNCTIONS FOR FRONTEND, ETC.
    //================================================================================================

    function rabbitIdToTier(uint256 _rabbitId) public view returns (uint256) {
        return rabbits[_rabbitId].tier;
    }

    function rabbitIdToHealthPoints(uint256 _rabbitId) public view returns (uint256) {
        return rabbits[_rabbitId].healthPoints;
    }
    
    function rabbitIdToLastAttackTimestamp(uint256 _rabbitId) public view returns (uint256) {
        return rabbits[_rabbitId].lastAttackTimestamp;
    }

    function getRabbitIdsByOwner(address _rabbitOwner) public view returns (uint256[] memory) {
        return ownerToRabbitIds[_rabbitOwner];
    }

    function getRabbitHealthPoints(uint256 _rabbitId) public view returns (uint256) {
        return rabbits[_rabbitId].healthPoints;
    }

    function getRabbitHasAttacked(uint256 _rabbitId) public view returns (bool) {
        return rabbits[_rabbitId].hasAttacked;
    }

    function getRabbitCooldownSecondsRemaining(uint256 _rabbitId) public view returns (uint256) {
        RabbitEntry storage rabbit = rabbits[_rabbitId];
        if(rabbit.lastAttackTimestamp == 0){
            return 0;
        } else {
            //this should never revert. if it does, it means the rabbitIdToLastAttackTimestamp[_rabbitId] is somehow in the future, which should be impossible
            return rabbitAttackCooldownSeconds > (block.timestamp - rabbit.lastAttackTimestamp) ? 
            rabbitAttackCooldownSeconds - (block.timestamp - rabbit.lastAttackTimestamp) : 
            0;
        }
    }

    function getSecondsUntilNextBatchStarts() public view returns (uint256) {
        //number of batches since start time
        uint256 numBatchesSincestartTimestamp = Math.mulDiv(
            (block.timestamp - startTimestamp),
            1,
            rabbitMintSecondsBetweenBatches
        );

        // get the number of seconds that have passed since the start of the last batch, then seconds until next batch starts
        uint256 secondsSinceLastBatchEnded = (block.timestamp - startTimestamp) -
            Math.mulDiv(numBatchesSincestartTimestamp, rabbitMintSecondsBetweenBatches, 1);
        uint256 secondsUntilNextBatchStarts = rabbitMintSecondsBetweenBatches - secondsSinceLastBatchEnded;

        return secondsUntilNextBatchStarts;
    }

    function getNumberOfRemainingMintableRabbits() public view returns (uint256) {
        uint256 batchNumber = getBatchNumber();
        return batchNumberToNumRerolls[batchNumber] + rabbitBatchSize - batchNumberToAmountMinted[batchNumber];
    }

    function getBatchNumber() public view returns (uint256) {
        // get number of batches that have passed since the first batch
        uint256 numBatchesSincestartTimestamp = Math.mulDiv(
            (block.timestamp - startTimestamp),
            1,
            rabbitMintSecondsBetweenBatches
        );

        return numBatchesSincestartTimestamp;
    }

    //================================================================================================
    // SETTERS (those not handled by the config manager contract via structs)
    //================================================================================================

    function setBaseUri(string memory _baseUri) external onlyOwner {
        baseURI = _baseUri;
    }

    function setConfigManagerAddress(address _configManagerAddress) external onlyOwner {
        config = IConfig(_configManagerAddress);
    }


    modifier onlyConfig() {
        if (msg.sender != address(config)) {
            revert CallerIsNotConfig();
        }
        _;
    }

    function setRabbitMintIsOpen(bool _rabbitMintIsOpen) external onlyConfig {
        rabbitMintIsOpen = _rabbitMintIsOpen;
    }

    function setRabbitBatchSize(uint16 _rabbitBatchSize) external onlyConfig{
        rabbitBatchSize = _rabbitBatchSize;
    }

    function setRabbitMintSecondsBetweenBatches(uint32 _rabbitMintSecondsBetweenBatches) external onlyConfig{
        rabbitMintSecondsBetweenBatches = _rabbitMintSecondsBetweenBatches;
    }

    function setRabbitMaxPerWallet(uint8 _rabbitMaxPerWallet) external onlyConfig {
        rabbitMaxPerWallet = _rabbitMaxPerWallet;
    }

    function setRabbitMintPriceInKarrots(uint128 _rabbitMintPriceInKarrots) external onlyConfig {
        rabbitMintPriceInKarrots = _rabbitMintPriceInKarrots;
    }

    function setRabbitMintKarrotFeePercentageToBurn(uint16 _rabbitMintKarrotFeePercentageToBurn) external onlyConfig {
        rabbitMintKarrotFeePercentageToBurn = _rabbitMintKarrotFeePercentageToBurn;
    }

    function setRabbitMintKarrotFeePercentageToStolenPool(uint16 _rabbitMintKarrotFeePercentageToStolenPool) external onlyConfig {
        rabbitMintKarrotFeePercentageToStolenPool = _rabbitMintKarrotFeePercentageToStolenPool;
    }

    function setRabbitMintTier1Threshold(uint16 _rabbitMintTier1Threshold) external onlyConfig {
        rabbitMintTier1Threshold = _rabbitMintTier1Threshold;
    }

    function setRabbitMintTier2Threshold(uint16 _rabbitMintTier2Threshold) external onlyConfig {
        rabbitMintTier2Threshold = _rabbitMintTier2Threshold;
    }

    function setRabbitHP(uint8 _rabbitHP) external onlyConfig {
        rabbitHP = _rabbitHP;
    }

    function setRabbitHitRate(uint16 _rabbitHitRate) external onlyConfig {
        rabbitHitRate = _rabbitHitRate;
    }

    function setRabbitAttackIsOpen(bool _rabbitAttackIsOpen) external onlyConfig {
        rabbitAttackIsOpen = _rabbitAttackIsOpen;
    }

    function setAttackCooldownSeconds(uint32 _attackCooldownSeconds) external onlyConfig {
        rabbitAttackCooldownSeconds = _attackCooldownSeconds;
    }

    function setAttackHPDeductionAmount(uint8 _attackHPDeductionAmount) external onlyConfig {
        rabbitAttackHpDeductionAmount = _attackHPDeductionAmount;
    }

    function setAttackHPDeductionThreshold(uint16 _attackHPDeductionThreshold) external onlyConfig {
        rabbitAttackHpDeductionThreshold = _attackHPDeductionThreshold;
    }

    //================================================================================================
    // ERC721 OVERRIDES
    //================================================================================================

    //erc721 overrides
    function safeTransferFrom(address from, address to, uint256 tokenId) public override {
        revert TisSoulbound();
    }

    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public override {
        revert TisSoulbound();
    }

    function transferFrom(address from, address to, uint256 tokenId) public override {
        revert TisSoulbound();
    }
    
    //"just in case lol"
    function _transfer(address from, address to, uint256 tokenId) internal override {
        revert TisSoulbound();
    }

    // overrides with uri assigned based on tier
    function tokenURI(uint256 _id) public view override returns (string memory) {
        return rabbits[_id].tokenURI;
    }

    //=========================================================================
    // WITHDRAWALS
    //=========================================================================

    function withdrawERC20FromContract(address _to, address _token) external onlyOwner {
        bool os = IERC20(_token).transfer(_to, IERC20(_token).balanceOf(address(this)));
        if (!os) {
            revert ForwardFailed();
        }
    }

    function withdrawEthFromContract() external onlyOwner {
        address out = config.treasuryAddress();
        require(out != address(0));
        (bool os, ) = payable(out).call{value: address(this).balance}("");
        if (!os) {
            revert ForwardFailed();
        }
    }
}

File 2 of 21 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (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() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

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

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        _requireMinted(tokenId);

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(address from, address to, uint256 tokenId) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");

        _transfer(from, to, tokenId);
    }

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

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

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

    /**
     * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

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

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

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

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

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

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

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

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

        _owners[tokenId] = to;

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

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

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

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

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

        // Clear approvals
        delete _tokenApprovals[tokenId];

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

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

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

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

        _beforeTokenTransfer(from, to, tokenId, 1);

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

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

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

        emit Transfer(from, to, tokenId);

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 5 of 21 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (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 Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling 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 6 of 21 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 7 of 21 : IConfig.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

interface IConfig {
    function dexInterfacerAddress() external view returns (address);
    function karrotsAddress() external view returns (address);
    function karrotChefAddress() external view returns (address);
    function karrotStolenPoolAddress() external view returns (address);
    function karrotFullProtecAddress() external view returns (address);
    function karrotsPoolAddress() external view returns (address);
    function rabbitAddress() external view returns (address);
    function randomizerAddress() external view returns (address);
    function uniswapRouterAddress() external view returns (address);
    function uniswapFactoryAddress() external view returns (address);
    function treasuryAddress() external view returns (address);
    function treasuryBAddress() external view returns (address);
    function teamSplitterAddress() external view returns (address);
    function presaleDistributorAddress() external view returns (address);
    function airdropDistributorAddress() external view returns (address);
    function attackRewardCalculatorAddress() external view returns (address);
}

File 8 of 21 : IKarrotsToken.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

interface IKarrotsToken {
    function approve(address spender, uint256 amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint256);
    function addDexAddress(address _dexAddress) external;
    function removeDexAddress(address _dexAddress) external;
    function mint(address to, uint256 amount) external;
    function burn(uint256 amount) external;
    function burnFrom(address account, uint256 amount) external;
    function rebase(uint256 epoch, uint256 indexDelta, bool positive) external returns (uint256);
    function balanceOf(address account) external view returns (uint256);
    function totalSupply() external view returns (uint256);
    function transfer(address recipient, uint256 amount) external returns (bool);
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
    function transferUnderlying(address to, uint256 value) external returns (bool);
    function fragmentToKarrots(uint256 value) external view returns (uint256);
    function karrotsToFragment(uint256 karrots) external view returns (uint256);
    function balanceOfUnderlying(address who) external view returns (uint256);
    function setSellTaxRate(uint16 _sellTaxRate) external;
    function setBuyTaxRate(uint16 _buyTaxRate) external;
    function setMaxScaleFactorDecreasePercentagePerDebase(uint256 _maxScaleFactorDecreasePercentagePerDebase) external;
    function setTaxSwapAmountThreshold(uint256 _taxSwapAmountThreshold) external;
    function setDivertTaxToStolenPoolRate(uint256 _divertRate) external;
}

File 9 of 21 : IStolenPool.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

interface IStolenPool {
    function virtualDeposit(uint256 _amount) external;
    function attack(address _sender, uint256 _rabbitTier, uint256 _rabbitId) external;
    function updateConfig() external;
    function setStolenPoolOpenTimestamp() external;
    function setStolenPoolAttackIsOpen(bool _isOpen) external;
    function setAttackBurnPercentage(uint16 _attackBurnPercentage) external;
    function setIsApprovedDepositor(address _depositor, bool _isApproved) external;
}

File 10 of 21 : IRandomizer.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

interface IRandomizer {
    function getRandomNumber(address input0, uint256 input1, uint256 input2) external returns (uint256 result);
}

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

File 12 of 21 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/IERC20Permit.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;

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    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));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    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");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to
     * 0 before setting it to a non-zero value.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }

    /**
     * @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).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // 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 cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

File 15 of 21 : 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 16 of 21 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

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

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

File 17 of 21 : 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 18 of 21 : 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 19 of 21 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

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

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

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

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

File 20 of 21 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 21 of 21 : 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);
}

Settings
{
  "remappings": [
    "@chainlink/contracts/=lib/chainlink/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "foundry-devops/=lib/foundry-devops/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin/=lib/openzeppelin-contracts/contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200,
    "details": {
      "constantOptimizer": true,
      "yul": true,
      "yulDetails": {
        "stackAllocation": true,
        "optimizerSteps": "dhfoDgvulfnTUtnIf"
      }
    }
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {
    "lib/foundry-devops/src/DevOpsTools.sol": {
      "DevOpsTools": "0x3fd2b64a587cc58117db334fbd51c58d256adac5"
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_configManagerAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AttackOnCooldown","type":"error"},{"inputs":[],"name":"AttacksAreClosed","type":"error"},{"inputs":[],"name":"CallerIsNotConfig","type":"error"},{"inputs":[],"name":"CantRerollRabbitThatHasAttacked","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"EOAsOnly","type":"error"},{"inputs":[],"name":"ForwardFailed","type":"error"},{"inputs":[],"name":"InsufficientKarrotsForRabbitMint","type":"error"},{"inputs":[{"internalType":"uint256","name":"verdict","type":"uint256"}],"name":"InvalidAttackVerdict","type":"error"},{"inputs":[],"name":"MaxRabbitsMinted","type":"error"},{"inputs":[],"name":"MintIsClosed","type":"error"},{"inputs":[],"name":"NoRabbitsOwned","type":"error"},{"inputs":[],"name":"NotOwnerOfRabbit","type":"error"},{"inputs":[],"name":"RabbitsPerWalletLimitReached","type":"error"},{"inputs":[],"name":"TisSoulbound","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":"uint256","name":"rabbitId","type":"uint256"},{"indexed":false,"internalType":"address","name":"attackSender","type":"address"},{"indexed":false,"internalType":"string","name":"attackResult","type":"string"}],"name":"AttackResult","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":"rabbitId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"healthPoints","type":"uint256"}],"name":"RabbitHealthPointsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rabbitId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tier","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"healthPoints","type":"uint256"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"RabbitMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"rabbitId","type":"uint256"}],"name":"RabbitReroll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"PERCENTAGE_DENOMINATOR","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"amountMinted","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"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":"","type":"uint256"}],"name":"batchNumberToAmountMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"batchNumberToNumRerolls","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimRequestTimeout","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"config","outputs":[{"internalType":"contract IConfig","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBatchNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNumberOfRemainingMintableRabbits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rabbitId","type":"uint256"}],"name":"getRabbitCooldownSecondsRemaining","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rabbitId","type":"uint256"}],"name":"getRabbitHasAttacked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rabbitId","type":"uint256"}],"name":"getRabbitHealthPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_rabbitOwner","type":"address"}],"name":"getRabbitIdsByOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSecondsUntilNextBatchStarts","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":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"ownerToRabbitIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rabbitAttackCooldownSeconds","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rabbitAttackHpDeductionAmount","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rabbitAttackHpDeductionThreshold","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rabbitAttackIsOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rabbitBatchSize","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rabbitHP","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rabbitHitRate","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rabbitId","type":"uint256"}],"name":"rabbitIdToHealthPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rabbitId","type":"uint256"}],"name":"rabbitIdToLastAttackTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rabbitId","type":"uint256"}],"name":"rabbitIdToTier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rabbitMaxPerWallet","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rabbitMintIsOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rabbitMintKarrotFeePercentageToBurn","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rabbitMintKarrotFeePercentageToStolenPool","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rabbitMintPriceInKarrots","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rabbitMintSecondsBetweenBatches","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rabbitMintTier1Threshold","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rabbitMintTier2Threshold","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rabbits","outputs":[{"internalType":"uint16","name":"healthPoints","type":"uint16"},{"internalType":"uint8","name":"tier","type":"uint8"},{"internalType":"uint32","name":"lastAttackTimestamp","type":"uint32"},{"internalType":"string","name":"tokenURI","type":"string"},{"internalType":"bool","name":"hasAttacked","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_rabbitId","type":"uint32"}],"name":"requestAttack","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"requestNonce","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_amount","type":"uint8"},{"internalType":"bool","name":"_isReroll","type":"bool"},{"internalType":"uint256","name":"_idToBurn","type":"uint256"}],"name":"requestToMintRabbits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_attackCooldownSeconds","type":"uint32"}],"name":"setAttackCooldownSeconds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_attackHPDeductionAmount","type":"uint8"}],"name":"setAttackHPDeductionAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_attackHPDeductionThreshold","type":"uint16"}],"name":"setAttackHPDeductionThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_baseUri","type":"string"}],"name":"setBaseUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_configManagerAddress","type":"address"}],"name":"setConfigManagerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_rabbitAttackIsOpen","type":"bool"}],"name":"setRabbitAttackIsOpen","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_rabbitBatchSize","type":"uint16"}],"name":"setRabbitBatchSize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_rabbitHP","type":"uint8"}],"name":"setRabbitHP","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_rabbitHitRate","type":"uint16"}],"name":"setRabbitHitRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_rabbitMaxPerWallet","type":"uint8"}],"name":"setRabbitMaxPerWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_rabbitMintIsOpen","type":"bool"}],"name":"setRabbitMintIsOpen","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_rabbitMintKarrotFeePercentageToBurn","type":"uint16"}],"name":"setRabbitMintKarrotFeePercentageToBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_rabbitMintKarrotFeePercentageToStolenPool","type":"uint16"}],"name":"setRabbitMintKarrotFeePercentageToStolenPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"_rabbitMintPriceInKarrots","type":"uint128"}],"name":"setRabbitMintPriceInKarrots","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_rabbitMintSecondsBetweenBatches","type":"uint32"}],"name":"setRabbitMintSecondsBetweenBatches","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_rabbitMintTier1Threshold","type":"uint16"}],"name":"setRabbitMintTier1Threshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_rabbitMintTier2Threshold","type":"uint16"}],"name":"setRabbitMintTier2Threshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTimestamp","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"address","name":"_to","type":"address"},{"internalType":"address","name":"_token","type":"address"}],"name":"withdrawERC20FromContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawEthFromContract","outputs":[],"stateMutability":"nonpayable","type":"function"}]

610100604052605960808181529062004c5c60a039600890620000239082620002c8565b507f1f4007d00000000004d8c55aefb8c05b5c000000010000708003000151800032600a55600b80546001600160481b031916681d4c1388050bb817701790553480156200007057600080fd5b5060405162004cb538038062004cb58339810160408190526200009391620003cd565b60405180604001604052806006815260200165149858989a5d60d21b8152506040518060400160405280600381526020016214909560ea1b8152508160009081620000df9190620002c8565b506001620000ee8282620002c8565b5050506200010b620001056200015e60201b60201c565b62000162565b6001600755600980546001600160a01b03929092167fff00000000ffffffffffffff000000000000000000000000000000000000000090921691909117600160d81b4263ffffffff1602179055620003fa565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052602260045260246000fd5b600281046001821680620001f557607f821691505b6020821081036200020a576200020a620001ca565b50919050565b6000620002216200021e8381565b90565b92915050565b620002328362000210565b815460001960089490940293841b1916921b91909117905550565b60006200025c81848462000227565b505050565b818110156200028057620002776000826200024d565b60010162000261565b5050565b601f8211156200025c576000818152602090206020601f85010481016020851015620002ad5750805b620002c16020601f86010483018262000261565b5050505050565b81516001600160401b03811115620002e457620002e4620001b4565b620002f08254620001e0565b620002fd82828562000284565b506020601f8211600181146200033557600083156200031c5750848201515b600019600885021c1981166002850217855550620002c1565b600084815260208120601f198516915b8281101562000367578785015182556020948501946001909201910162000345565b5084821015620003855783870151600019601f87166008021c191681555b50505050600202600101905550565b60006001600160a01b03821662000221565b620003b18162000394565b8114620003bd57600080fd5b50565b80516200022181620003a6565b600060208284031215620003e457620003e4600080fd5b6000620003f28484620003c0565b949350505050565b614852806200040a6000396000f3fe6080604052600436106104255760003560e01c80638a68030311610229578063aca90a791161012e578063dbc008d4116100b6578063f027b5d31161007a578063f027b5d314610d5f578063f29a66ed14610bc4578063f2fde38b14610d7f578063f6f0049614610d9f578063fa65b47014610dbf57600080fd5b8063dbc008d414610c9c578063dd8dc5de14610cbd578063e442b71a14610cdd578063e6fd48bc14610cf2578063e985e9c514610d1657600080fd5b8063b88d4fde116100fd578063b88d4fde14610c0b578063c68d5b6414610c26578063c87b56dd14610c41578063d0ca67e714610c61578063d4840aee14610c7c57600080fd5b8063aca90a7914610b91578063ae69417314610bb1578063b06f794714610bc4578063b3cd425414610bf557600080fd5b8063a1869670116101b1578063a825709811610180578063a825709814610ad9578063a8c1bef114610afa578063a940a06e14610b2e578063a9f5141214610b44578063ab8e861d14610b6457600080fd5b8063a186967014610a4f578063a22cb46514610a73578063a39f5d6b14610a93578063a6eea14214610ab757600080fd5b806395d89b41116101f857806395d89b41146109b8578063977782db146109cd5780639dcac5dc146109ee5780639e11c13414610a0f578063a0bcfc7f14610a2f57600080fd5b80638a680303146109255780638a78bf05146109475780638da5cb5b1461097a5780638f4aea701461099857600080fd5b80633995b5b51161032f57806365701b0d116102b757806370a082311161028657806370a082311461086f578063715018a61461088f57806379502c55146108a45780637af284d5146108d15780637c1a0302146108f557600080fd5b806365701b0d146108105780636c0360eb146108255780636d6516c01461083a5780636da008c01461084f57600080fd5b8063480d5c02116102fe578063480d5c021461074e57806349f905681461076e57806357f1c7bf1461079d57806359dc2eec146107bf5780636352211e146107f057600080fd5b80633995b5b5146106e057806341db47411461070057806342842e0e1461066057806346116c4b1461072e57600080fd5b80630e321ecc116103b257806320f0f6aa1161038157806320f0f6aa1461064b57806323b872dd146106605780632eb2210f146106805780632f151298146106ad578063336bdacc146106c057600080fd5b80630e321ecc146105bb57806312f7d82d146105eb578063141c23b71461060b578063176fbd8e1461062b57600080fd5b80630636de6d116103f95780630636de6d146104f657806306fdde031461052c578063081812fc1461054e578063086eebeb1461057b578063095ea7b31461059b57600080fd5b80627966911461042a57806301ffc9a71461046d57806305d3073a1461049a578063060b7592146104bc575b600080fd5b34801561043657600080fd5b50610457610445366004613626565b600e6020526000908152604090205481565b604051610464919061364f565b60405180910390f35b34801561047957600080fd5b5061048d610488366004613678565b610ddf565b60405161046491906136a1565b3480156104a657600080fd5b506104ba6104b53660046136c4565b610e31565b005b3480156104c857600080fd5b506104576104d7366004613626565b6000908152600c60205260409020546301000000900463ffffffff1690565b34801561050257600080fd5b50610457610511366004613626565b6000908152600c602052604090205462010000900460ff1690565b34801561053857600080fd5b50610541610e82565b604051610464919061373b565b34801561055a57600080fd5b5061056e610569366004613626565b610f14565b6040516104649190613766565b34801561058757600080fd5b50610457610596366004613626565b610f3b565b3480156105a757600080fd5b506104ba6105b6366004613788565b610fdc565b3480156105c757600080fd5b50600a546105de9062010000900463ffffffff1681565b60405161046491906137d1565b3480156105f757600080fd5b506104ba6106063660046136c4565b611088565b34801561061757600080fd5b506104ba6106263660046137f2565b6110cb565b34801561063757600080fd5b506104ba6106463660046136c4565b611114565b34801561065757600080fd5b50610457611162565b34801561066c57600080fd5b506104ba61067b366004613813565b6111ad565b34801561068c57600080fd5b506106a061069b366004613863565b6111c6565b60405161046491906138e2565b6104576106bb366004613907565b611232565b3480156106cc57600080fd5b506104ba6106db3660046136c4565b61195d565b3480156106ec57600080fd5b506104ba6106fb366004613953565b6119a8565b34801561070c57600080fd5b50600a5461072190600160301b900460ff1681565b604051610464919061397d565b34801561073a57600080fd5b506104ba6107493660046139a5565b6119f7565b34801561075a57600080fd5b506104ba6107693660046139c6565b611a57565b34801561077a57600080fd5b50600b5461079090600160381b900461ffff1681565b60405161046491906139f1565b3480156107a957600080fd5b50600a5461079090600160e01b900461ffff1681565b3480156107cb57600080fd5b506107df6107da366004613626565b611aa5565b6040516104649594939291906139ff565b3480156107fc57600080fd5b5061056e61080b366004613626565b611b70565b34801561081c57600080fd5b506104ba611ba5565b34801561083157600080fd5b50610541611ca8565b34801561084657600080fd5b50610457611d36565b34801561085b57600080fd5b506104ba61086a3660046139c6565b611d70565b34801561087b57600080fd5b5061045761088a366004613863565b611dbd565b34801561089b57600080fd5b506104ba611e01565b3480156108b057600080fd5b506009546108c4906001600160a01b031681565b6040516104649190613a94565b3480156108dd57600080fd5b506009546105de90600160b81b900463ffffffff1681565b34801561090157600080fd5b50600b5461091890600160481b900462ffffff1681565b6040516104649190613aad565b34801561093157600080fd5b50600b5461072190640100000000900460ff1681565b34801561095357600080fd5b5061048d610962366004613626565b6000908152600c602052604090206002015460ff1690565b34801561098657600080fd5b506006546001600160a01b031661056e565b3480156109a457600080fd5b506104ba6109b33660046139c6565b611e15565b3480156109c457600080fd5b50610541611e60565b3480156109d957600080fd5b5060095461048d90600160b01b900460ff1681565b3480156109fa57600080fd5b50600a5461072190600160581b900460ff1681565b348015610a1b57600080fd5b506104ba610a2a3660046136c4565b611e6f565b348015610a3b57600080fd5b506104ba610a4a366004613ba9565b611eb2565b348015610a5b57600080fd5b50600b546107909065010000000000900461ffff1681565b348015610a7f57600080fd5b506104ba610a8e366004613be4565b611ec6565b348015610a9f57600080fd5b50600a546105de90600160381b900463ffffffff1681565b348015610ac357600080fd5b50600a5461079090600160f01b900461ffff1681565b348015610ae557600080fd5b5060095461048d90600160a81b900460ff1681565b348015610b0657600080fd5b50600a54610b2190600160601b90046001600160801b031681565b6040516104649190613c26565b348015610b3a57600080fd5b506105de61038481565b348015610b5057600080fd5b506104ba610b5f3660046136c4565b611ed1565b348015610b7057600080fd5b50610457610b7f366004613626565b600f6020526000908152604090205481565b348015610b9d57600080fd5b506104ba610bac3660046137f2565b611f1e565b610457610bbf366004613953565b611f67565b348015610bd057600080fd5b50610457610bdf366004613626565b6000908152600c602052604090205461ffff1690565b348015610c0157600080fd5b5061079061271081565b348015610c1757600080fd5b506104ba61067b366004613c34565b348015610c3257600080fd5b50600a546107909061ffff1681565b348015610c4d57600080fd5b50610541610c5c366004613626565b6121b3565b348015610c6d57600080fd5b50600b546107909061ffff1681565b348015610c8857600080fd5b506104ba610c973660046136c4565b61224e565b348015610ca857600080fd5b50600b546107909062010000900461ffff1681565b348015610cc957600080fd5b506104ba610cd8366004613863565b61229f565b348015610ce957600080fd5b506104576122c9565b348015610cfe57600080fd5b506009546105de90600160d81b900463ffffffff1681565b348015610d2257600080fd5b5061048d610d31366004613cb3565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b348015610d6b57600080fd5b50610457610d7a366004613788565b61235a565b348015610d8b57600080fd5b506104ba610d9a366004613863565b61238b565b348015610dab57600080fd5b506104ba610dba366004613cb3565b6123c5565b348015610dcb57600080fd5b506104ba610dda366004613953565b6124cc565b60006001600160e01b031982166380ac58cd60e01b1480610e1057506001600160e01b03198216635b5e139f60e01b145b80610e2b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6009546001600160a01b03163314610e5c576040516340e2203b60e01b815260040160405180910390fd5b600b805461ffff909216650100000000000266ffff000000000019909216919091179055565b606060008054610e9190613cfc565b80601f0160208091040260200160405190810160405280929190818152602001828054610ebd90613cfc565b8015610f0a5780601f10610edf57610100808354040283529160200191610f0a565b820191906000526020600020905b815481529060010190602001808311610eed57829003601f168201915b5050505050905090565b6000610f1f82612521565b506000908152600460205260409020546001600160a01b031690565b6000818152600c6020526040812080546301000000900463ffffffff168203610f675750600092915050565b8054610f80906301000000900463ffffffff1642613d38565b600a54600160381b900463ffffffff1611610f9c576000610fcf565b8054610fb5906301000000900463ffffffff1642613d38565b600a54610fcf9190600160381b900463ffffffff16613d38565b9392505050565b50919050565b6000610fe782611b70565b9050806001600160a01b0316836001600160a01b0316036110235760405162461bcd60e51b815260040161101a90613d89565b60405180910390fd5b336001600160a01b038216148061105d57506001600160a01b038116600090815260056020908152604080832033845290915290205460ff165b6110795760405162461bcd60e51b815260040161101a90613df1565b6110838383612555565b505050565b6009546001600160a01b031633146110b3576040516340e2203b60e01b815260040160405180910390fd5b600b805461ffff191661ffff92909216919091179055565b6009546001600160a01b031633146110f6576040516340e2203b60e01b815260040160405180910390fd5b60098054911515600160b01b0260ff60b01b19909216919091179055565b6009546001600160a01b0316331461113f576040516340e2203b60e01b815260040160405180910390fd5b600a805461ffff909216600160f01b026001600160f01b03909216919091179055565b60008061116d611d36565b6000818152600e6020908152604080832054600a54600f909352922054929350909161119d9161ffff1690613e01565b6111a79190613d38565b91505090565b604051630495062560e31b815260040160405180910390fd5b6001600160a01b0381166000908152600d602090815260409182902080548351818402810184019094528084526060939283018282801561122657602002820191906000526020600020905b815481526020019060010190808311611212575b50505050509050919050565b600061123c6125c3565b60095460408051630a15a2e160e41b815290516000926001600160a01b03169163a15a2e109160048083019260209291908290030181865afa158015611286573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112aa9190613e1f565b600a549091506000906112d19060ff881690600160601b90046001600160801b0316613e40565b600a546001600160801b039190911691506000906112fe908390600160e01b900461ffff166127106125ec565b600a54909150600090611320908490600160f01b900461ffff166127106125ec565b90503332148015906113325750333014155b1561135257336040516339f72cd760e21b815260040161101a9190613766565b600954600160a81b900460ff1661137c576040516306ce844d60e01b815260040160405180910390fd5b6040516370a0823160e01b815283906001600160a01b038616906370a08231906113aa903390600401613766565b602060405180830381865afa1580156113c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113eb9190613e71565b101561140a57604051633335ee8f60e21b815260040160405180910390fd5b600a5460ff600160301b909104811690891661142533611dbd565b61142f9190613e01565b11801561143a575086155b1561145857604051630db76ce360e41b815260040160405180910390fd5b8615611530573361146887611b70565b6001600160a01b03161461148f5760405163351aac4b60e21b815260040160405180910390fd5b6000868152600c602052604090206002015460ff16156114c257604051637b54573360e11b815260040160405180910390fd5b600f60006114ce611d36565b8152602001908152602001600020600081546114e990613e92565b909155506114f6866126ae565b7f1265c71da424d404e23f1000d5e84a2e1bc62673a3a23db0b0e9bff305c6c2c13387604051611527929190613eab565b60405180910390a15b600061153a611d36565b6000818152600f6020526040902054600a5491925061155c9161ffff16613e01565b6000828152600e60205260409020546115799060ff8c1690613e01565b11156115985760405163cad02c4f60e01b815260040160405180910390fd5b83856001600160a01b031663dd62ed3e33600960009054906101000a90046001600160a01b03166001600160a01b031663dc80c2c86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156115fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116209190613e1f565b6040518363ffffffff1660e01b815260040161163d929190613ec6565b602060405180830381865afa15801561165a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061167e9190613e71565b1015611698576116986001600160a01b0386163086612822565b6116ad6001600160a01b0386163330876128e8565b604051630852cd8d60e31b81526001600160a01b038616906342966c68906116d990879060040161364f565b600060405180830381600087803b1580156116f357600080fd5b505af1158015611707573d6000803e3d6000fd5b50505050600960009054906101000a90046001600160a01b03166001600160a01b031663dc80c2c86040518163ffffffff1660e01b8152600401602060405180830381865afa15801561175e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117829190613e1f565b6001600160a01b0316632278a902836040518263ffffffff1660e01b81526004016117ad919061364f565b600060405180830381600087803b1580156117c757600080fd5b505af11580156117db573d6000803e3d6000fd5b505050506000600960009054906101000a90046001600160a01b03166001600160a01b03166369b5c8f96040518163ffffffff1660e01b8152600401602060405180830381865afa158015611834573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118589190613e1f565b6001600160a01b031663db3b390c3342600b60099054906101000a900462ffffff166040518463ffffffff1660e01b815260040161189893929190613efb565b6020604051808303816000875af11580156118b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118db9190613e71565b90508960ff16600e600084815260200190815260200160002060008282546119039190613e01565b9091555050600b805460099061192490600160481b900462ffffff16613f23565b91906101000a81548162ffffff021916908362ffffff16021790555061194d818b60ff16612909565b505050505050610fcf6001600755565b6009546001600160a01b03163314611988576040516340e2203b60e01b815260040160405180910390fd5b600b805461ffff909216620100000263ffff000019909216919091179055565b6009546001600160a01b031633146119d3576040516340e2203b60e01b815260040160405180910390fd5b600a805463ffffffff909216620100000265ffffffff000019909216919091179055565b6009546001600160a01b03163314611a22576040516340e2203b60e01b815260040160405180910390fd5b600a80546001600160801b03909216600160601b026fffffffffffffffffffffffffffffffff60601b19909216919091179055565b6009546001600160a01b03163314611a82576040516340e2203b60e01b815260040160405180910390fd5b600a805460ff909216600160301b0266ff00000000000019909216919091179055565b600c602052600090815260409020805460018201805461ffff83169362010000840460ff16936301000000900463ffffffff16929091611ae490613cfc565b80601f0160208091040260200160405190810160405280929190818152602001828054611b1090613cfc565b8015611b5d5780601f10611b3257610100808354040283529160200191611b5d565b820191906000526020600020905b815481529060010190602001808311611b4057829003601f168201915b5050506002909301549192505060ff1685565b6000818152600260205260408120546001600160a01b031680610e2b5760405162461bcd60e51b815260040161101a90613f6f565b611bad612960565b6009546040805163c5f956af60e01b815290516000926001600160a01b03169163c5f956af9160048083019260209291908290030181865afa158015611bf7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c1b9190613e1f565b90506001600160a01b038116611c3057600080fd5b6000816001600160a01b03164760405160006040518083038185875af1925050503d8060008114611c7d576040519150601f19603f3d011682016040523d82523d6000602084013e611c82565b606091505b5050905080611ca45760405163096dc0e160e01b815260040160405180910390fd5b5050565b60088054611cb590613cfc565b80601f0160208091040260200160405190810160405280929190818152602001828054611ce190613cfc565b8015611d2e5780601f10611d0357610100808354040283529160200191611d2e565b820191906000526020600020905b815481529060010190602001808311611d1157829003601f168201915b505050505081565b6009546000908190610e2b90611d5990600160d81b900463ffffffff1642613d38565b600a5460019062010000900463ffffffff166125ec565b6009546001600160a01b03163314611d9b576040516340e2203b60e01b815260040160405180910390fd5b600b805460ff9092166401000000000264ff0000000019909216919091179055565b60006001600160a01b038216611de55760405162461bcd60e51b815260040161101a90613fc3565b506001600160a01b031660009081526003602052604090205490565b611e09612960565b611e13600061298a565b565b6009546001600160a01b03163314611e40576040516340e2203b60e01b815260040160405180910390fd5b600a805460ff909216600160581b0260ff60581b19909216919091179055565b606060018054610e9190613cfc565b6009546001600160a01b03163314611e9a576040516340e2203b60e01b815260040160405180910390fd5b600a805461ffff191661ffff92909216919091179055565b611eba612960565b6008611ca48282614064565b611ca43383836129dc565b6009546001600160a01b03163314611efc576040516340e2203b60e01b815260040160405180910390fd5b600a805461ffff909216600160e01b0261ffff60e01b19909216919091179055565b6009546001600160a01b03163314611f49576040516340e2203b60e01b815260040160405180910390fd5b60098054911515600160a81b0260ff60a81b19909216919091179055565b6000611f716125c3565b33611f8163ffffffff8416611b70565b6001600160a01b031614611fa85760405163351aac4b60e21b815260040160405180910390fd5b600954600160b01b900460ff16611fd25760405163090fdd1360e41b815260040160405180910390fd5b333214611ff457336040516339f72cd760e21b815260040161101a9190613766565b60006120058363ffffffff16610f3b565b11156120245760405163c758cb1560e01b815260040160405180910390fd5b63ffffffff8083166000908152600c6020908152604080832060028101805460ff1916600117905580544290951663010000000266ffffffff000000199095169490941790935560095483516369b5c8f960e01b8152935192936001600160a01b03909116926369b5c8f9926004808401939192918290030181865afa1580156120b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120d69190613e1f565b6001600160a01b031663db3b390c3342600b60099054906101000a900462ffffff166040518463ffffffff1660e01b815260040161211693929190613efb565b6020604051808303816000875af1158015612135573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121599190613e71565b905061216b8363ffffffff1682612a7e565b600b805460099061218790600160481b900462ffffff16613f23565b91906101000a81548162ffffff021916908362ffffff160217905550506121ae6001600755565b919050565b6000818152600c602052604090206001018054606091906121d390613cfc565b80601f01602080910402602001604051908101604052809291908181526020018280546121ff90613cfc565b80156112265780601f1061222157610100808354040283529160200191611226565b820191906000526020600020905b81548152906001019060200180831161222f5750939695505050505050565b6009546001600160a01b03163314612279576040516340e2203b60e01b815260040160405180910390fd5b600b805461ffff909216600160381b0268ffff0000000000000019909216919091179055565b6122a7612960565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b60095460009081906122ec90611d5990600160d81b900463ffffffff1642613d38565b600a5490915060009061230e90839062010000900463ffffffff1660016125ec565b60095461232890600160d81b900463ffffffff1642613d38565b6123329190613d38565b600a5490915060009061235290839062010000900463ffffffff16613d38565b949350505050565b600d602052816000526040600020818154811061237657600080fd5b90600052602060002001600091509150505481565b612393612960565b6001600160a01b0381166123b95760405162461bcd60e51b815260040161101a90614165565b6123c28161298a565b50565b6123cd612960565b6000816001600160a01b031663a9059cbb84846001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161240b9190613766565b602060405180830381865afa158015612428573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061244c9190613e71565b6040518363ffffffff1660e01b8152600401612469929190613eab565b6020604051808303816000875af1158015612488573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124ac9190614180565b9050806110835760405163096dc0e160e01b815260040160405180910390fd5b6009546001600160a01b031633146124f7576040516340e2203b60e01b815260040160405180910390fd5b600a805463ffffffff909216600160381b026affffffff0000000000000019909216919091179055565b6000818152600260205260409020546001600160a01b03166123c25760405162461bcd60e51b815260040161101a90613f6f565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061258a82611b70565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6002600754036125e55760405162461bcd60e51b815260040161101a906141d3565b6002600755565b60008080600019858709858702925082811083820303915050806000036126265783828161261c5761261c6141e3565b0492505050610fcf565b8084116126455760405162461bcd60e51b815260040161101a90614223565b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b60006126b982611b70565b6001600160a01b0381166000908152600d6020526040812080549293509190036126f65760405163044c30fd60e11b815260040160405180910390fd5b8054600103612725576001600160a01b0382166000908152600d60205260408120612720916135a1565b6127e3565b6000805b825481101561276f578483828154811061274557612745614233565b90600052602060002001540361275d5780915061276f565b8061276781613e92565b915050612729565b508154829061278090600190613d38565b8154811061279057612790614233565b90600052602060002001548282815481106127ad576127ad614233565b9060005260206000200181905550818054806127cb576127cb614249565b60019003818190600052602060002001600090559055505b6000838152600c60205260408120805466ffffffffffffff191681559061280d60018301826135bf565b50600201805460ff1916905561108383612c29565b600063095ea7b360e01b838360405160240161283f929190613eab565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152905061287d8482612cbe565b6128e2576128d88463095ea7b360e01b8560006040516024016128a1929190614273565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612d65565b6128e28482612d65565b50505050565b6128e2846323b872dd60e01b8585856040516024016128a19392919061428e565b60005b8181101561108357600083826040516020016129299291906142b6565b6040516020818303038152906040528051906020012060001c905061294d81612df7565b508061295881613e92565b91505061290c565b6006546001600160a01b03163314611e135760405162461bcd60e51b815260040161101a906142f4565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031603612a0d5760405162461bcd60e51b815260040161101a90614336565b6001600160a01b0383811660008181526005602090815260408083209487168084529490915290819020805460ff1916851515179055517f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190612a719085906136a1565b60405180910390a3505050565b6000828152600c6020526040812090612a9683612ff2565b9050336001829003612bc557600960009054906101000a90046001600160a01b03166001600160a01b031663dc80c2c86040518163ffffffff1660e01b8152600401602060405180830381865afa158015612af5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b199190613e1f565b835460405163452ae33160e01b81526001600160a01b03929092169163452ae33191612b5591859162010000900460ff16908a9060040161435e565b600060405180830381600087803b158015612b6f57600080fd5b505af1158015612b83573d6000803e3d6000fd5b505050507fbc7a92ef3575fdd97a890226676196239f70060bf568370c890e2b94a64c352d8582604051612bb89291906143ab565b60405180910390a1612c22565b81600203612c0757612bd685613030565b7fbc7a92ef3575fdd97a890226676196239f70060bf568370c890e2b94a64c352d8582604051612bb8929190614409565b8160405163054585d760e21b815260040161101a919061364f565b5050505050565b6000612c3482611b70565b9050612c3f82611b70565b600083815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526003845282852080546000190190558785526002909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000806000846001600160a01b031684604051612cdb9190614457565b6000604051808303816000865af19150503d8060008114612d18576040519150601f19603f3d011682016040523d82523d6000602084013e612d1d565b606091505b5091509150818015612d47575080511580612d47575080806020019051810190612d479190614180565b8015612d5c57506001600160a01b0385163b15155b95945050505050565b6000612dba826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166130d19092919063ffffffff16565b9050805160001480612ddb575080806020019051810190612ddb9190614180565b6110835760405162461bcd60e51b815260040161101a906144a6565b336000612e06612710846144b6565b90506009601781819054906101000a900463ffffffff16612e26906144ca565b82546101009290920a63ffffffff818102199093169183160217909155600954600160b81b9004166000908152600c60205260409020600b8054825464010000000090910460ff1661ffff199091161782555461ffff168211612e9757805462ff0000191662010000178155612ef1565b600b5461ffff1682118015612ec85750600b54612ec09061ffff620100008204811691166144e6565b61ffff168211155b15612ee157805462ff0000191662020000178155612ef1565b805462ff00001916620300001781555b8054600090600890612f0b9062010000900460ff166130e0565b604051602001612f1c929190614576565b60408051601f19818403018152919052905060018201612f3c8282614064565b506001600160a01b0384166000908152600d6020908152604082206009805482546001810184559285529290932063ffffffff600160b81b93849004811691909201559154612f9092879290910416613174565b60095482546040517fd03c7336a0fe88dfe9eab2248b10ca6450df84c4042063ea112b7e7a4b4a4f6a92612fe392600160b81b90910463ffffffff169162010000820460ff169161ffff169089906145d6565b60405180910390a15050505050565b60008080613002612710856144b6565b600b5490915065010000000000900461ffff1681116130245760019150613029565b600291505b5092915050565b6000818152600c60205260408120600a5481549192600160581b90910460ff169183919061306390849061ffff1661460b565b82546101009290920a61ffff81810219909316918316021790915582546040517ff45a3e397ff82c6551216b8140383e7e6795430443c63ea4a305bf6ca589f56c93506130b39286921690614629565b60405180910390a1805461ffff16600003611ca457611ca4826126ae565b6060612352848460008561318e565b606060006130ed8361322a565b600101905060008167ffffffffffffffff81111561310d5761310d613abb565b6040519080825280601f01601f191660200182016040528015613137576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084613141575b509392505050565b611ca4828260405180602001604052806000815250613302565b6060824710156131b05760405162461bcd60e51b815260040161101a90614685565b600080866001600160a01b031685876040516131cc9190614457565b60006040518083038185875af1925050503d8060008114613209576040519150601f19603f3d011682016040523d82523d6000602084013e61320e565b606091505b509150915061321f87838387613335565b979650505050505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106132695772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613295576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106132b357662386f26fc10000830492506010015b6305f5e10083106132cb576305f5e100830492506008015b61271083106132df57612710830492506004015b606483106132f1576064830492506002015b600a8310610e2b5760010192915050565b61330c838361337e565b6133196000848484613479565b6110835760405162461bcd60e51b815260040161101a906146e2565b6060831561337457825160000361336d576001600160a01b0385163b61336d5760405162461bcd60e51b815260040161101a90614724565b5081612352565b6123528383613577565b6001600160a01b0382166133a45760405162461bcd60e51b815260040161101a90614764565b6000818152600260205260409020546001600160a01b0316156133d95760405162461bcd60e51b815260040161101a906147a6565b6000818152600260205260409020546001600160a01b03161561340e5760405162461bcd60e51b815260040161101a906147a6565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160a01b0384163b1561356f57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906134bd9033908990889088906004016147b6565b6020604051808303816000875af19250505080156134f8575060408051601f3d908101601f191682019092526134f5918101906147fb565b60015b613555573d808015613526576040519150601f19603f3d011682016040523d82523d6000602084013e61352b565b606091505b50805160000361354d5760405162461bcd60e51b815260040161101a906146e2565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612352565b506001612352565b8151156135875781518083602001fd5b8060405162461bcd60e51b815260040161101a919061373b565b50805460008255906000526020600020908101906123c291906135f5565b5080546135cb90613cfc565b6000825580601f106135db575050565b601f0160209004906000526020600020908101906123c291905b5b8082111561360a57600081556001016135f6565b5090565b805b81146123c257600080fd5b8035610e2b8161360e565b60006020828403121561363b5761363b600080fd5b6000612352848461361b565b805b82525050565b60208101610e2b8284613647565b6001600160e01b03198116613610565b8035610e2b8161365d565b60006020828403121561368d5761368d600080fd5b6000612352848461366d565b801515613649565b60208101610e2b8284613699565b61ffff8116613610565b8035610e2b816136af565b6000602082840312156136d9576136d9600080fd5b600061235284846136b9565b60005b838110156137005781810151838201526020016136e8565b50506000910152565b6000613713825190565b80845260208401935061372a8185602086016136e5565b601f01601f19169290920192915050565b60208082528101610fcf8184613709565b60006001600160a01b038216610e2b565b6136498161374c565b60208101610e2b828461375d565b6136108161374c565b8035610e2b81613774565b6000806040838503121561379e5761379e600080fd5b60006137aa858561377d565b92505060206137bb8582860161361b565b9150509250929050565b63ffffffff8116613649565b60208101610e2b82846137c5565b801515613610565b8035610e2b816137df565b60006020828403121561380757613807600080fd5b600061235284846137e7565b60008060006060848603121561382b5761382b600080fd5b6000613837868661377d565b93505060206138488682870161377d565b92505060406138598682870161361b565b9150509250925092565b60006020828403121561387857613878600080fd5b6000612352848461377d565b61388e8282613647565b5060200190565b60200190565b60006138a5825190565b808452602093840193830160005b828110156138d85781516138c78782613884565b9650506020820191506001016138b3565b5093949350505050565b60208082528101610fcf818461389b565b60ff8116613610565b8035610e2b816138f3565b60008060006060848603121561391f5761391f600080fd5b600061392b86866138fc565b9350506020613848868287016137e7565b63ffffffff8116613610565b8035610e2b8161393c565b60006020828403121561396857613968600080fd5b60006123528484613948565b60ff8116613649565b60208101610e2b8284613974565b6001600160801b038116613610565b8035610e2b8161398b565b6000602082840312156139ba576139ba600080fd5b6000612352848461399a565b6000602082840312156139db576139db600080fd5b600061235284846138fc565b61ffff8116613649565b60208101610e2b82846139e7565b60a08101613a0d82886139e7565b613a1a6020830187613974565b613a2760408301866137c5565b8181036060830152613a398185613709565b9050613a486080830184613699565b9695505050505050565b6000610e2b6001600160a01b038316613a69565b90565b6001600160a01b031690565b6000610e2b82613a52565b6000610e2b82613a75565b61364981613a80565b60208101610e2b8284613a8b565b62ffffff8116613649565b60208101610e2b8284613aa2565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715613af757613af7613abb565b6040525050565b6000613b0960405190565b90506121ae8282613ad1565b600067ffffffffffffffff821115613b2f57613b2f613abb565b601f19601f83011660200192915050565b82818337506000910152565b6000613b5f613b5a84613b15565b613afe565b905082815260208101848484011115613b7a57613b7a600080fd5b61316c848285613b40565b600082601f830112613b9957613b99600080fd5b8135612352848260208601613b4c565b600060208284031215613bbe57613bbe600080fd5b813567ffffffffffffffff811115613bd857613bd8600080fd5b61235284828501613b85565b60008060408385031215613bfa57613bfa600080fd5b6000613c06858561377d565b92505060206137bb858286016137e7565b6001600160801b038116613649565b60208101610e2b8284613c17565b60008060008060808587031215613c4d57613c4d600080fd5b6000613c59878761377d565b9450506020613c6a8782880161377d565b9350506040613c7b8782880161361b565b925050606085013567ffffffffffffffff811115613c9b57613c9b600080fd5b613ca787828801613b85565b91505092959194509250565b60008060408385031215613cc957613cc9600080fd5b6000613cd5858561377d565b92505060206137bb8582860161377d565b634e487b7160e01b600052602260045260246000fd5b600281046001821680613d1057607f821691505b602082108103610fd657610fd6613ce6565b634e487b7160e01b600052601160045260246000fd5b81810381811115610e2b57610e2b613d22565b60218152602081017f4552433732313a20617070726f76616c20746f2063757272656e74206f776e658152603960f91b602082015290505b60400190565b60208082528101610e2b81613d4b565b603d8152602081017f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f81527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060208201529050613d83565b60208082528101610e2b81613d99565b80820180821115610e2b57610e2b613d22565b8051610e2b81613774565b600060208284031215613e3457613e34600080fd5b60006123528484613e14565b6001600160801b0391821691908116908282029081169081811461302957613029613d22565b8051610e2b8161360e565b600060208284031215613e8657613e86600080fd5b60006123528484613e66565b600060018201613ea457613ea4613d22565b5060010190565b60408101613eb9828561375d565b610fcf6020830184613647565b60408101613ed4828561375d565b610fcf602083018461375d565b6000610e2b613a6662ffffff841681565b61364981613ee1565b60608101613f09828661375d565b613f166020830185613647565b6123526040830184613ef2565b62ffffff16600062fffffe198201613ea457613ea4613d22565b60188152602081017f4552433732313a20696e76616c696420746f6b656e204944000000000000000081529050613895565b60208082528101610e2b81613f3d565b60298152602081017f4552433732313a2061646472657373207a65726f206973206e6f7420612076618152683634b21037bbb732b960b91b60208201529050613d83565b60208082528101610e2b81613f7f565b6000610e2b613a668381565b613fe883613fd3565b815460001960089490940293841b1916921b91909117905550565b6000611083818484613fdf565b81811015611ca457614023600082614003565b600101614010565b601f821115611083576000818152602090206020601f850104810160208510156140525750805b612c226020601f860104830182614010565b815167ffffffffffffffff81111561407e5761407e613abb565b6140888254613cfc565b61409382828561402b565b506020601f8211600181146140c857600083156140b05750848201515b600019600885021c1981166002850217855550612c22565b600084815260208120601f198516915b828110156140f857878501518255602094850194600190920191016140d8565b50848210156141155783870151600019601f87166008021c191681555b50505050600202600101905550565b60268152602081017f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526564647265737360d01b60208201529050613d83565b60208082528101610e2b81614124565b8051610e2b816137df565b60006020828403121561419557614195600080fd5b60006123528484614175565b601f8152602081017f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081529050613895565b60208082528101610e2b816141a1565b634e487b7160e01b600052601260045260246000fd5b6015815260208101744d6174683a206d756c446976206f766572666c6f7760581b81529050613895565b60208082528101610e2b816141f9565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b600060ff8216610e2b565b6136498161425f565b60408101614281828561375d565b610fcf602083018461426a565b6060810161429c828661375d565b6142a9602083018561375d565b6123526040830184613647565b60408101613eb98285613647565b60208082527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65729101908152613895565b60208082528101610e2b816142c4565b60198152602081017f4552433732313a20617070726f766520746f2063616c6c65720000000000000081529050613895565b60208082528101610e2b81614304565b6000610e2b613a6660ff841681565b61364981614346565b6060810161436c828661375d565b6142a96020830185614355565b601d8152602081017f41747461636b207375636365656465642e204e6f204850204c6f73742e00000081529050613895565b606081016143b98285613647565b6143c6602083018461375d565b818103604083015261235281614379565b60198152602081017f41747461636b206661696c65642e2031204850204c6f73742e0000000000000081529050613895565b606081016144178285613647565b614424602083018461375d565b8181036040830152612352816143d7565b600061443f825190565b61444d8185602086016136e5565b9290920192915050565b610e2b8183614435565b602a8152602081017f5361666545524332303a204552433230206f7065726174696f6e20646964206e8152691bdd081cdd58d8d9595960b21b60208201529050613d83565b60208082528101610e2b81614461565b6000826144c5576144c56141e3565b500690565b63ffffffff16600063fffffffe198201613ea457613ea4613d22565b61ffff918216919081169082820190811115610e2b57610e2b613d22565b6000815461451181613cfc565b600182168015614528576001811461453d5761456d565b60ff198316865281151582028601935061456d565b60008581526020902060005b8381101561456557815488820152600190910190602001614549565b505081860193505b50505092915050565b6145808184614504565b905061458c8183614435565b64173539b7b760d91b8152905060058101610fcf565b6000610e2b613a6663ffffffff841681565b613649816145a2565b6000610e2b613a6661ffff841681565b613649816145bd565b608081016145e482876145b4565b6145f16020830186614355565b6145fe60408301856145cd565b612d5c606083018461375d565b61ffff918216919081169082820390811115610e2b57610e2b613d22565b604081016146378285613647565b610fcf60208301846145cd565b60268152602081017f416464726573733a20696e73756666696369656e742062616c616e636520666f8152651c8818d85b1b60d21b60208201529050613d83565b60208082528101610e2b81614644565b60328152602081017f4552433732313a207472616e7366657220746f206e6f6e20455243373231526581527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60208201529050613d83565b60208082528101610e2b81614695565b601d8152602081017f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081529050613895565b60208082528101610e2b816146f2565b60208082527f4552433732313a206d696e7420746f20746865207a65726f20616464726573739101908152613895565b60208082528101610e2b81614734565b601c8152602081017f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000081529050613895565b60208082528101610e2b81614774565b608081016147c4828761375d565b6147d1602083018661375d565b6147de6040830185613647565b8181036060830152613a488184613709565b8051610e2b8161365d565b60006020828403121561481057614810600080fd5b600061235284846147f056fea26469706673582212209f45f3421308e5bb3b07458c379e3a6c9db775f5d1b6131bcf63d9b7cfbcb3ff64736f6c6343000813003368747470733a2f2f6261667962656963626c6e7333726a6275717974786c6836726a36767636697365766b6f7774796f61376836666974617a767a356a7334757877792e697066732e6e667473746f726167652e6c696e6b2f0000000000000000000000001b7d040a501f19f1e28ed9fe58e307a9516ee733

Deployed Bytecode

0x6080604052600436106104255760003560e01c80638a68030311610229578063aca90a791161012e578063dbc008d4116100b6578063f027b5d31161007a578063f027b5d314610d5f578063f29a66ed14610bc4578063f2fde38b14610d7f578063f6f0049614610d9f578063fa65b47014610dbf57600080fd5b8063dbc008d414610c9c578063dd8dc5de14610cbd578063e442b71a14610cdd578063e6fd48bc14610cf2578063e985e9c514610d1657600080fd5b8063b88d4fde116100fd578063b88d4fde14610c0b578063c68d5b6414610c26578063c87b56dd14610c41578063d0ca67e714610c61578063d4840aee14610c7c57600080fd5b8063aca90a7914610b91578063ae69417314610bb1578063b06f794714610bc4578063b3cd425414610bf557600080fd5b8063a1869670116101b1578063a825709811610180578063a825709814610ad9578063a8c1bef114610afa578063a940a06e14610b2e578063a9f5141214610b44578063ab8e861d14610b6457600080fd5b8063a186967014610a4f578063a22cb46514610a73578063a39f5d6b14610a93578063a6eea14214610ab757600080fd5b806395d89b41116101f857806395d89b41146109b8578063977782db146109cd5780639dcac5dc146109ee5780639e11c13414610a0f578063a0bcfc7f14610a2f57600080fd5b80638a680303146109255780638a78bf05146109475780638da5cb5b1461097a5780638f4aea701461099857600080fd5b80633995b5b51161032f57806365701b0d116102b757806370a082311161028657806370a082311461086f578063715018a61461088f57806379502c55146108a45780637af284d5146108d15780637c1a0302146108f557600080fd5b806365701b0d146108105780636c0360eb146108255780636d6516c01461083a5780636da008c01461084f57600080fd5b8063480d5c02116102fe578063480d5c021461074e57806349f905681461076e57806357f1c7bf1461079d57806359dc2eec146107bf5780636352211e146107f057600080fd5b80633995b5b5146106e057806341db47411461070057806342842e0e1461066057806346116c4b1461072e57600080fd5b80630e321ecc116103b257806320f0f6aa1161038157806320f0f6aa1461064b57806323b872dd146106605780632eb2210f146106805780632f151298146106ad578063336bdacc146106c057600080fd5b80630e321ecc146105bb57806312f7d82d146105eb578063141c23b71461060b578063176fbd8e1461062b57600080fd5b80630636de6d116103f95780630636de6d146104f657806306fdde031461052c578063081812fc1461054e578063086eebeb1461057b578063095ea7b31461059b57600080fd5b80627966911461042a57806301ffc9a71461046d57806305d3073a1461049a578063060b7592146104bc575b600080fd5b34801561043657600080fd5b50610457610445366004613626565b600e6020526000908152604090205481565b604051610464919061364f565b60405180910390f35b34801561047957600080fd5b5061048d610488366004613678565b610ddf565b60405161046491906136a1565b3480156104a657600080fd5b506104ba6104b53660046136c4565b610e31565b005b3480156104c857600080fd5b506104576104d7366004613626565b6000908152600c60205260409020546301000000900463ffffffff1690565b34801561050257600080fd5b50610457610511366004613626565b6000908152600c602052604090205462010000900460ff1690565b34801561053857600080fd5b50610541610e82565b604051610464919061373b565b34801561055a57600080fd5b5061056e610569366004613626565b610f14565b6040516104649190613766565b34801561058757600080fd5b50610457610596366004613626565b610f3b565b3480156105a757600080fd5b506104ba6105b6366004613788565b610fdc565b3480156105c757600080fd5b50600a546105de9062010000900463ffffffff1681565b60405161046491906137d1565b3480156105f757600080fd5b506104ba6106063660046136c4565b611088565b34801561061757600080fd5b506104ba6106263660046137f2565b6110cb565b34801561063757600080fd5b506104ba6106463660046136c4565b611114565b34801561065757600080fd5b50610457611162565b34801561066c57600080fd5b506104ba61067b366004613813565b6111ad565b34801561068c57600080fd5b506106a061069b366004613863565b6111c6565b60405161046491906138e2565b6104576106bb366004613907565b611232565b3480156106cc57600080fd5b506104ba6106db3660046136c4565b61195d565b3480156106ec57600080fd5b506104ba6106fb366004613953565b6119a8565b34801561070c57600080fd5b50600a5461072190600160301b900460ff1681565b604051610464919061397d565b34801561073a57600080fd5b506104ba6107493660046139a5565b6119f7565b34801561075a57600080fd5b506104ba6107693660046139c6565b611a57565b34801561077a57600080fd5b50600b5461079090600160381b900461ffff1681565b60405161046491906139f1565b3480156107a957600080fd5b50600a5461079090600160e01b900461ffff1681565b3480156107cb57600080fd5b506107df6107da366004613626565b611aa5565b6040516104649594939291906139ff565b3480156107fc57600080fd5b5061056e61080b366004613626565b611b70565b34801561081c57600080fd5b506104ba611ba5565b34801561083157600080fd5b50610541611ca8565b34801561084657600080fd5b50610457611d36565b34801561085b57600080fd5b506104ba61086a3660046139c6565b611d70565b34801561087b57600080fd5b5061045761088a366004613863565b611dbd565b34801561089b57600080fd5b506104ba611e01565b3480156108b057600080fd5b506009546108c4906001600160a01b031681565b6040516104649190613a94565b3480156108dd57600080fd5b506009546105de90600160b81b900463ffffffff1681565b34801561090157600080fd5b50600b5461091890600160481b900462ffffff1681565b6040516104649190613aad565b34801561093157600080fd5b50600b5461072190640100000000900460ff1681565b34801561095357600080fd5b5061048d610962366004613626565b6000908152600c602052604090206002015460ff1690565b34801561098657600080fd5b506006546001600160a01b031661056e565b3480156109a457600080fd5b506104ba6109b33660046139c6565b611e15565b3480156109c457600080fd5b50610541611e60565b3480156109d957600080fd5b5060095461048d90600160b01b900460ff1681565b3480156109fa57600080fd5b50600a5461072190600160581b900460ff1681565b348015610a1b57600080fd5b506104ba610a2a3660046136c4565b611e6f565b348015610a3b57600080fd5b506104ba610a4a366004613ba9565b611eb2565b348015610a5b57600080fd5b50600b546107909065010000000000900461ffff1681565b348015610a7f57600080fd5b506104ba610a8e366004613be4565b611ec6565b348015610a9f57600080fd5b50600a546105de90600160381b900463ffffffff1681565b348015610ac357600080fd5b50600a5461079090600160f01b900461ffff1681565b348015610ae557600080fd5b5060095461048d90600160a81b900460ff1681565b348015610b0657600080fd5b50600a54610b2190600160601b90046001600160801b031681565b6040516104649190613c26565b348015610b3a57600080fd5b506105de61038481565b348015610b5057600080fd5b506104ba610b5f3660046136c4565b611ed1565b348015610b7057600080fd5b50610457610b7f366004613626565b600f6020526000908152604090205481565b348015610b9d57600080fd5b506104ba610bac3660046137f2565b611f1e565b610457610bbf366004613953565b611f67565b348015610bd057600080fd5b50610457610bdf366004613626565b6000908152600c602052604090205461ffff1690565b348015610c0157600080fd5b5061079061271081565b348015610c1757600080fd5b506104ba61067b366004613c34565b348015610c3257600080fd5b50600a546107909061ffff1681565b348015610c4d57600080fd5b50610541610c5c366004613626565b6121b3565b348015610c6d57600080fd5b50600b546107909061ffff1681565b348015610c8857600080fd5b506104ba610c973660046136c4565b61224e565b348015610ca857600080fd5b50600b546107909062010000900461ffff1681565b348015610cc957600080fd5b506104ba610cd8366004613863565b61229f565b348015610ce957600080fd5b506104576122c9565b348015610cfe57600080fd5b506009546105de90600160d81b900463ffffffff1681565b348015610d2257600080fd5b5061048d610d31366004613cb3565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b348015610d6b57600080fd5b50610457610d7a366004613788565b61235a565b348015610d8b57600080fd5b506104ba610d9a366004613863565b61238b565b348015610dab57600080fd5b506104ba610dba366004613cb3565b6123c5565b348015610dcb57600080fd5b506104ba610dda366004613953565b6124cc565b60006001600160e01b031982166380ac58cd60e01b1480610e1057506001600160e01b03198216635b5e139f60e01b145b80610e2b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6009546001600160a01b03163314610e5c576040516340e2203b60e01b815260040160405180910390fd5b600b805461ffff909216650100000000000266ffff000000000019909216919091179055565b606060008054610e9190613cfc565b80601f0160208091040260200160405190810160405280929190818152602001828054610ebd90613cfc565b8015610f0a5780601f10610edf57610100808354040283529160200191610f0a565b820191906000526020600020905b815481529060010190602001808311610eed57829003601f168201915b5050505050905090565b6000610f1f82612521565b506000908152600460205260409020546001600160a01b031690565b6000818152600c6020526040812080546301000000900463ffffffff168203610f675750600092915050565b8054610f80906301000000900463ffffffff1642613d38565b600a54600160381b900463ffffffff1611610f9c576000610fcf565b8054610fb5906301000000900463ffffffff1642613d38565b600a54610fcf9190600160381b900463ffffffff16613d38565b9392505050565b50919050565b6000610fe782611b70565b9050806001600160a01b0316836001600160a01b0316036110235760405162461bcd60e51b815260040161101a90613d89565b60405180910390fd5b336001600160a01b038216148061105d57506001600160a01b038116600090815260056020908152604080832033845290915290205460ff165b6110795760405162461bcd60e51b815260040161101a90613df1565b6110838383612555565b505050565b6009546001600160a01b031633146110b3576040516340e2203b60e01b815260040160405180910390fd5b600b805461ffff191661ffff92909216919091179055565b6009546001600160a01b031633146110f6576040516340e2203b60e01b815260040160405180910390fd5b60098054911515600160b01b0260ff60b01b19909216919091179055565b6009546001600160a01b0316331461113f576040516340e2203b60e01b815260040160405180910390fd5b600a805461ffff909216600160f01b026001600160f01b03909216919091179055565b60008061116d611d36565b6000818152600e6020908152604080832054600a54600f909352922054929350909161119d9161ffff1690613e01565b6111a79190613d38565b91505090565b604051630495062560e31b815260040160405180910390fd5b6001600160a01b0381166000908152600d602090815260409182902080548351818402810184019094528084526060939283018282801561122657602002820191906000526020600020905b815481526020019060010190808311611212575b50505050509050919050565b600061123c6125c3565b60095460408051630a15a2e160e41b815290516000926001600160a01b03169163a15a2e109160048083019260209291908290030181865afa158015611286573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112aa9190613e1f565b600a549091506000906112d19060ff881690600160601b90046001600160801b0316613e40565b600a546001600160801b039190911691506000906112fe908390600160e01b900461ffff166127106125ec565b600a54909150600090611320908490600160f01b900461ffff166127106125ec565b90503332148015906113325750333014155b1561135257336040516339f72cd760e21b815260040161101a9190613766565b600954600160a81b900460ff1661137c576040516306ce844d60e01b815260040160405180910390fd5b6040516370a0823160e01b815283906001600160a01b038616906370a08231906113aa903390600401613766565b602060405180830381865afa1580156113c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113eb9190613e71565b101561140a57604051633335ee8f60e21b815260040160405180910390fd5b600a5460ff600160301b909104811690891661142533611dbd565b61142f9190613e01565b11801561143a575086155b1561145857604051630db76ce360e41b815260040160405180910390fd5b8615611530573361146887611b70565b6001600160a01b03161461148f5760405163351aac4b60e21b815260040160405180910390fd5b6000868152600c602052604090206002015460ff16156114c257604051637b54573360e11b815260040160405180910390fd5b600f60006114ce611d36565b8152602001908152602001600020600081546114e990613e92565b909155506114f6866126ae565b7f1265c71da424d404e23f1000d5e84a2e1bc62673a3a23db0b0e9bff305c6c2c13387604051611527929190613eab565b60405180910390a15b600061153a611d36565b6000818152600f6020526040902054600a5491925061155c9161ffff16613e01565b6000828152600e60205260409020546115799060ff8c1690613e01565b11156115985760405163cad02c4f60e01b815260040160405180910390fd5b83856001600160a01b031663dd62ed3e33600960009054906101000a90046001600160a01b03166001600160a01b031663dc80c2c86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156115fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116209190613e1f565b6040518363ffffffff1660e01b815260040161163d929190613ec6565b602060405180830381865afa15801561165a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061167e9190613e71565b1015611698576116986001600160a01b0386163086612822565b6116ad6001600160a01b0386163330876128e8565b604051630852cd8d60e31b81526001600160a01b038616906342966c68906116d990879060040161364f565b600060405180830381600087803b1580156116f357600080fd5b505af1158015611707573d6000803e3d6000fd5b50505050600960009054906101000a90046001600160a01b03166001600160a01b031663dc80c2c86040518163ffffffff1660e01b8152600401602060405180830381865afa15801561175e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117829190613e1f565b6001600160a01b0316632278a902836040518263ffffffff1660e01b81526004016117ad919061364f565b600060405180830381600087803b1580156117c757600080fd5b505af11580156117db573d6000803e3d6000fd5b505050506000600960009054906101000a90046001600160a01b03166001600160a01b03166369b5c8f96040518163ffffffff1660e01b8152600401602060405180830381865afa158015611834573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118589190613e1f565b6001600160a01b031663db3b390c3342600b60099054906101000a900462ffffff166040518463ffffffff1660e01b815260040161189893929190613efb565b6020604051808303816000875af11580156118b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118db9190613e71565b90508960ff16600e600084815260200190815260200160002060008282546119039190613e01565b9091555050600b805460099061192490600160481b900462ffffff16613f23565b91906101000a81548162ffffff021916908362ffffff16021790555061194d818b60ff16612909565b505050505050610fcf6001600755565b6009546001600160a01b03163314611988576040516340e2203b60e01b815260040160405180910390fd5b600b805461ffff909216620100000263ffff000019909216919091179055565b6009546001600160a01b031633146119d3576040516340e2203b60e01b815260040160405180910390fd5b600a805463ffffffff909216620100000265ffffffff000019909216919091179055565b6009546001600160a01b03163314611a22576040516340e2203b60e01b815260040160405180910390fd5b600a80546001600160801b03909216600160601b026fffffffffffffffffffffffffffffffff60601b19909216919091179055565b6009546001600160a01b03163314611a82576040516340e2203b60e01b815260040160405180910390fd5b600a805460ff909216600160301b0266ff00000000000019909216919091179055565b600c602052600090815260409020805460018201805461ffff83169362010000840460ff16936301000000900463ffffffff16929091611ae490613cfc565b80601f0160208091040260200160405190810160405280929190818152602001828054611b1090613cfc565b8015611b5d5780601f10611b3257610100808354040283529160200191611b5d565b820191906000526020600020905b815481529060010190602001808311611b4057829003601f168201915b5050506002909301549192505060ff1685565b6000818152600260205260408120546001600160a01b031680610e2b5760405162461bcd60e51b815260040161101a90613f6f565b611bad612960565b6009546040805163c5f956af60e01b815290516000926001600160a01b03169163c5f956af9160048083019260209291908290030181865afa158015611bf7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c1b9190613e1f565b90506001600160a01b038116611c3057600080fd5b6000816001600160a01b03164760405160006040518083038185875af1925050503d8060008114611c7d576040519150601f19603f3d011682016040523d82523d6000602084013e611c82565b606091505b5050905080611ca45760405163096dc0e160e01b815260040160405180910390fd5b5050565b60088054611cb590613cfc565b80601f0160208091040260200160405190810160405280929190818152602001828054611ce190613cfc565b8015611d2e5780601f10611d0357610100808354040283529160200191611d2e565b820191906000526020600020905b815481529060010190602001808311611d1157829003601f168201915b505050505081565b6009546000908190610e2b90611d5990600160d81b900463ffffffff1642613d38565b600a5460019062010000900463ffffffff166125ec565b6009546001600160a01b03163314611d9b576040516340e2203b60e01b815260040160405180910390fd5b600b805460ff9092166401000000000264ff0000000019909216919091179055565b60006001600160a01b038216611de55760405162461bcd60e51b815260040161101a90613fc3565b506001600160a01b031660009081526003602052604090205490565b611e09612960565b611e13600061298a565b565b6009546001600160a01b03163314611e40576040516340e2203b60e01b815260040160405180910390fd5b600a805460ff909216600160581b0260ff60581b19909216919091179055565b606060018054610e9190613cfc565b6009546001600160a01b03163314611e9a576040516340e2203b60e01b815260040160405180910390fd5b600a805461ffff191661ffff92909216919091179055565b611eba612960565b6008611ca48282614064565b611ca43383836129dc565b6009546001600160a01b03163314611efc576040516340e2203b60e01b815260040160405180910390fd5b600a805461ffff909216600160e01b0261ffff60e01b19909216919091179055565b6009546001600160a01b03163314611f49576040516340e2203b60e01b815260040160405180910390fd5b60098054911515600160a81b0260ff60a81b19909216919091179055565b6000611f716125c3565b33611f8163ffffffff8416611b70565b6001600160a01b031614611fa85760405163351aac4b60e21b815260040160405180910390fd5b600954600160b01b900460ff16611fd25760405163090fdd1360e41b815260040160405180910390fd5b333214611ff457336040516339f72cd760e21b815260040161101a9190613766565b60006120058363ffffffff16610f3b565b11156120245760405163c758cb1560e01b815260040160405180910390fd5b63ffffffff8083166000908152600c6020908152604080832060028101805460ff1916600117905580544290951663010000000266ffffffff000000199095169490941790935560095483516369b5c8f960e01b8152935192936001600160a01b03909116926369b5c8f9926004808401939192918290030181865afa1580156120b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120d69190613e1f565b6001600160a01b031663db3b390c3342600b60099054906101000a900462ffffff166040518463ffffffff1660e01b815260040161211693929190613efb565b6020604051808303816000875af1158015612135573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121599190613e71565b905061216b8363ffffffff1682612a7e565b600b805460099061218790600160481b900462ffffff16613f23565b91906101000a81548162ffffff021916908362ffffff160217905550506121ae6001600755565b919050565b6000818152600c602052604090206001018054606091906121d390613cfc565b80601f01602080910402602001604051908101604052809291908181526020018280546121ff90613cfc565b80156112265780601f1061222157610100808354040283529160200191611226565b820191906000526020600020905b81548152906001019060200180831161222f5750939695505050505050565b6009546001600160a01b03163314612279576040516340e2203b60e01b815260040160405180910390fd5b600b805461ffff909216600160381b0268ffff0000000000000019909216919091179055565b6122a7612960565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b60095460009081906122ec90611d5990600160d81b900463ffffffff1642613d38565b600a5490915060009061230e90839062010000900463ffffffff1660016125ec565b60095461232890600160d81b900463ffffffff1642613d38565b6123329190613d38565b600a5490915060009061235290839062010000900463ffffffff16613d38565b949350505050565b600d602052816000526040600020818154811061237657600080fd5b90600052602060002001600091509150505481565b612393612960565b6001600160a01b0381166123b95760405162461bcd60e51b815260040161101a90614165565b6123c28161298a565b50565b6123cd612960565b6000816001600160a01b031663a9059cbb84846001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161240b9190613766565b602060405180830381865afa158015612428573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061244c9190613e71565b6040518363ffffffff1660e01b8152600401612469929190613eab565b6020604051808303816000875af1158015612488573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124ac9190614180565b9050806110835760405163096dc0e160e01b815260040160405180910390fd5b6009546001600160a01b031633146124f7576040516340e2203b60e01b815260040160405180910390fd5b600a805463ffffffff909216600160381b026affffffff0000000000000019909216919091179055565b6000818152600260205260409020546001600160a01b03166123c25760405162461bcd60e51b815260040161101a90613f6f565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061258a82611b70565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6002600754036125e55760405162461bcd60e51b815260040161101a906141d3565b6002600755565b60008080600019858709858702925082811083820303915050806000036126265783828161261c5761261c6141e3565b0492505050610fcf565b8084116126455760405162461bcd60e51b815260040161101a90614223565b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b60006126b982611b70565b6001600160a01b0381166000908152600d6020526040812080549293509190036126f65760405163044c30fd60e11b815260040160405180910390fd5b8054600103612725576001600160a01b0382166000908152600d60205260408120612720916135a1565b6127e3565b6000805b825481101561276f578483828154811061274557612745614233565b90600052602060002001540361275d5780915061276f565b8061276781613e92565b915050612729565b508154829061278090600190613d38565b8154811061279057612790614233565b90600052602060002001548282815481106127ad576127ad614233565b9060005260206000200181905550818054806127cb576127cb614249565b60019003818190600052602060002001600090559055505b6000838152600c60205260408120805466ffffffffffffff191681559061280d60018301826135bf565b50600201805460ff1916905561108383612c29565b600063095ea7b360e01b838360405160240161283f929190613eab565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152905061287d8482612cbe565b6128e2576128d88463095ea7b360e01b8560006040516024016128a1929190614273565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612d65565b6128e28482612d65565b50505050565b6128e2846323b872dd60e01b8585856040516024016128a19392919061428e565b60005b8181101561108357600083826040516020016129299291906142b6565b6040516020818303038152906040528051906020012060001c905061294d81612df7565b508061295881613e92565b91505061290c565b6006546001600160a01b03163314611e135760405162461bcd60e51b815260040161101a906142f4565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031603612a0d5760405162461bcd60e51b815260040161101a90614336565b6001600160a01b0383811660008181526005602090815260408083209487168084529490915290819020805460ff1916851515179055517f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190612a719085906136a1565b60405180910390a3505050565b6000828152600c6020526040812090612a9683612ff2565b9050336001829003612bc557600960009054906101000a90046001600160a01b03166001600160a01b031663dc80c2c86040518163ffffffff1660e01b8152600401602060405180830381865afa158015612af5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b199190613e1f565b835460405163452ae33160e01b81526001600160a01b03929092169163452ae33191612b5591859162010000900460ff16908a9060040161435e565b600060405180830381600087803b158015612b6f57600080fd5b505af1158015612b83573d6000803e3d6000fd5b505050507fbc7a92ef3575fdd97a890226676196239f70060bf568370c890e2b94a64c352d8582604051612bb89291906143ab565b60405180910390a1612c22565b81600203612c0757612bd685613030565b7fbc7a92ef3575fdd97a890226676196239f70060bf568370c890e2b94a64c352d8582604051612bb8929190614409565b8160405163054585d760e21b815260040161101a919061364f565b5050505050565b6000612c3482611b70565b9050612c3f82611b70565b600083815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526003845282852080546000190190558785526002909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000806000846001600160a01b031684604051612cdb9190614457565b6000604051808303816000865af19150503d8060008114612d18576040519150601f19603f3d011682016040523d82523d6000602084013e612d1d565b606091505b5091509150818015612d47575080511580612d47575080806020019051810190612d479190614180565b8015612d5c57506001600160a01b0385163b15155b95945050505050565b6000612dba826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166130d19092919063ffffffff16565b9050805160001480612ddb575080806020019051810190612ddb9190614180565b6110835760405162461bcd60e51b815260040161101a906144a6565b336000612e06612710846144b6565b90506009601781819054906101000a900463ffffffff16612e26906144ca565b82546101009290920a63ffffffff818102199093169183160217909155600954600160b81b9004166000908152600c60205260409020600b8054825464010000000090910460ff1661ffff199091161782555461ffff168211612e9757805462ff0000191662010000178155612ef1565b600b5461ffff1682118015612ec85750600b54612ec09061ffff620100008204811691166144e6565b61ffff168211155b15612ee157805462ff0000191662020000178155612ef1565b805462ff00001916620300001781555b8054600090600890612f0b9062010000900460ff166130e0565b604051602001612f1c929190614576565b60408051601f19818403018152919052905060018201612f3c8282614064565b506001600160a01b0384166000908152600d6020908152604082206009805482546001810184559285529290932063ffffffff600160b81b93849004811691909201559154612f9092879290910416613174565b60095482546040517fd03c7336a0fe88dfe9eab2248b10ca6450df84c4042063ea112b7e7a4b4a4f6a92612fe392600160b81b90910463ffffffff169162010000820460ff169161ffff169089906145d6565b60405180910390a15050505050565b60008080613002612710856144b6565b600b5490915065010000000000900461ffff1681116130245760019150613029565b600291505b5092915050565b6000818152600c60205260408120600a5481549192600160581b90910460ff169183919061306390849061ffff1661460b565b82546101009290920a61ffff81810219909316918316021790915582546040517ff45a3e397ff82c6551216b8140383e7e6795430443c63ea4a305bf6ca589f56c93506130b39286921690614629565b60405180910390a1805461ffff16600003611ca457611ca4826126ae565b6060612352848460008561318e565b606060006130ed8361322a565b600101905060008167ffffffffffffffff81111561310d5761310d613abb565b6040519080825280601f01601f191660200182016040528015613137576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084613141575b509392505050565b611ca4828260405180602001604052806000815250613302565b6060824710156131b05760405162461bcd60e51b815260040161101a90614685565b600080866001600160a01b031685876040516131cc9190614457565b60006040518083038185875af1925050503d8060008114613209576040519150601f19603f3d011682016040523d82523d6000602084013e61320e565b606091505b509150915061321f87838387613335565b979650505050505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106132695772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613295576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106132b357662386f26fc10000830492506010015b6305f5e10083106132cb576305f5e100830492506008015b61271083106132df57612710830492506004015b606483106132f1576064830492506002015b600a8310610e2b5760010192915050565b61330c838361337e565b6133196000848484613479565b6110835760405162461bcd60e51b815260040161101a906146e2565b6060831561337457825160000361336d576001600160a01b0385163b61336d5760405162461bcd60e51b815260040161101a90614724565b5081612352565b6123528383613577565b6001600160a01b0382166133a45760405162461bcd60e51b815260040161101a90614764565b6000818152600260205260409020546001600160a01b0316156133d95760405162461bcd60e51b815260040161101a906147a6565b6000818152600260205260409020546001600160a01b03161561340e5760405162461bcd60e51b815260040161101a906147a6565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160a01b0384163b1561356f57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906134bd9033908990889088906004016147b6565b6020604051808303816000875af19250505080156134f8575060408051601f3d908101601f191682019092526134f5918101906147fb565b60015b613555573d808015613526576040519150601f19603f3d011682016040523d82523d6000602084013e61352b565b606091505b50805160000361354d5760405162461bcd60e51b815260040161101a906146e2565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612352565b506001612352565b8151156135875781518083602001fd5b8060405162461bcd60e51b815260040161101a919061373b565b50805460008255906000526020600020908101906123c291906135f5565b5080546135cb90613cfc565b6000825580601f106135db575050565b601f0160209004906000526020600020908101906123c291905b5b8082111561360a57600081556001016135f6565b5090565b805b81146123c257600080fd5b8035610e2b8161360e565b60006020828403121561363b5761363b600080fd5b6000612352848461361b565b805b82525050565b60208101610e2b8284613647565b6001600160e01b03198116613610565b8035610e2b8161365d565b60006020828403121561368d5761368d600080fd5b6000612352848461366d565b801515613649565b60208101610e2b8284613699565b61ffff8116613610565b8035610e2b816136af565b6000602082840312156136d9576136d9600080fd5b600061235284846136b9565b60005b838110156137005781810151838201526020016136e8565b50506000910152565b6000613713825190565b80845260208401935061372a8185602086016136e5565b601f01601f19169290920192915050565b60208082528101610fcf8184613709565b60006001600160a01b038216610e2b565b6136498161374c565b60208101610e2b828461375d565b6136108161374c565b8035610e2b81613774565b6000806040838503121561379e5761379e600080fd5b60006137aa858561377d565b92505060206137bb8582860161361b565b9150509250929050565b63ffffffff8116613649565b60208101610e2b82846137c5565b801515613610565b8035610e2b816137df565b60006020828403121561380757613807600080fd5b600061235284846137e7565b60008060006060848603121561382b5761382b600080fd5b6000613837868661377d565b93505060206138488682870161377d565b92505060406138598682870161361b565b9150509250925092565b60006020828403121561387857613878600080fd5b6000612352848461377d565b61388e8282613647565b5060200190565b60200190565b60006138a5825190565b808452602093840193830160005b828110156138d85781516138c78782613884565b9650506020820191506001016138b3565b5093949350505050565b60208082528101610fcf818461389b565b60ff8116613610565b8035610e2b816138f3565b60008060006060848603121561391f5761391f600080fd5b600061392b86866138fc565b9350506020613848868287016137e7565b63ffffffff8116613610565b8035610e2b8161393c565b60006020828403121561396857613968600080fd5b60006123528484613948565b60ff8116613649565b60208101610e2b8284613974565b6001600160801b038116613610565b8035610e2b8161398b565b6000602082840312156139ba576139ba600080fd5b6000612352848461399a565b6000602082840312156139db576139db600080fd5b600061235284846138fc565b61ffff8116613649565b60208101610e2b82846139e7565b60a08101613a0d82886139e7565b613a1a6020830187613974565b613a2760408301866137c5565b8181036060830152613a398185613709565b9050613a486080830184613699565b9695505050505050565b6000610e2b6001600160a01b038316613a69565b90565b6001600160a01b031690565b6000610e2b82613a52565b6000610e2b82613a75565b61364981613a80565b60208101610e2b8284613a8b565b62ffffff8116613649565b60208101610e2b8284613aa2565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715613af757613af7613abb565b6040525050565b6000613b0960405190565b90506121ae8282613ad1565b600067ffffffffffffffff821115613b2f57613b2f613abb565b601f19601f83011660200192915050565b82818337506000910152565b6000613b5f613b5a84613b15565b613afe565b905082815260208101848484011115613b7a57613b7a600080fd5b61316c848285613b40565b600082601f830112613b9957613b99600080fd5b8135612352848260208601613b4c565b600060208284031215613bbe57613bbe600080fd5b813567ffffffffffffffff811115613bd857613bd8600080fd5b61235284828501613b85565b60008060408385031215613bfa57613bfa600080fd5b6000613c06858561377d565b92505060206137bb858286016137e7565b6001600160801b038116613649565b60208101610e2b8284613c17565b60008060008060808587031215613c4d57613c4d600080fd5b6000613c59878761377d565b9450506020613c6a8782880161377d565b9350506040613c7b8782880161361b565b925050606085013567ffffffffffffffff811115613c9b57613c9b600080fd5b613ca787828801613b85565b91505092959194509250565b60008060408385031215613cc957613cc9600080fd5b6000613cd5858561377d565b92505060206137bb8582860161377d565b634e487b7160e01b600052602260045260246000fd5b600281046001821680613d1057607f821691505b602082108103610fd657610fd6613ce6565b634e487b7160e01b600052601160045260246000fd5b81810381811115610e2b57610e2b613d22565b60218152602081017f4552433732313a20617070726f76616c20746f2063757272656e74206f776e658152603960f91b602082015290505b60400190565b60208082528101610e2b81613d4b565b603d8152602081017f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f81527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060208201529050613d83565b60208082528101610e2b81613d99565b80820180821115610e2b57610e2b613d22565b8051610e2b81613774565b600060208284031215613e3457613e34600080fd5b60006123528484613e14565b6001600160801b0391821691908116908282029081169081811461302957613029613d22565b8051610e2b8161360e565b600060208284031215613e8657613e86600080fd5b60006123528484613e66565b600060018201613ea457613ea4613d22565b5060010190565b60408101613eb9828561375d565b610fcf6020830184613647565b60408101613ed4828561375d565b610fcf602083018461375d565b6000610e2b613a6662ffffff841681565b61364981613ee1565b60608101613f09828661375d565b613f166020830185613647565b6123526040830184613ef2565b62ffffff16600062fffffe198201613ea457613ea4613d22565b60188152602081017f4552433732313a20696e76616c696420746f6b656e204944000000000000000081529050613895565b60208082528101610e2b81613f3d565b60298152602081017f4552433732313a2061646472657373207a65726f206973206e6f7420612076618152683634b21037bbb732b960b91b60208201529050613d83565b60208082528101610e2b81613f7f565b6000610e2b613a668381565b613fe883613fd3565b815460001960089490940293841b1916921b91909117905550565b6000611083818484613fdf565b81811015611ca457614023600082614003565b600101614010565b601f821115611083576000818152602090206020601f850104810160208510156140525750805b612c226020601f860104830182614010565b815167ffffffffffffffff81111561407e5761407e613abb565b6140888254613cfc565b61409382828561402b565b506020601f8211600181146140c857600083156140b05750848201515b600019600885021c1981166002850217855550612c22565b600084815260208120601f198516915b828110156140f857878501518255602094850194600190920191016140d8565b50848210156141155783870151600019601f87166008021c191681555b50505050600202600101905550565b60268152602081017f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526564647265737360d01b60208201529050613d83565b60208082528101610e2b81614124565b8051610e2b816137df565b60006020828403121561419557614195600080fd5b60006123528484614175565b601f8152602081017f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081529050613895565b60208082528101610e2b816141a1565b634e487b7160e01b600052601260045260246000fd5b6015815260208101744d6174683a206d756c446976206f766572666c6f7760581b81529050613895565b60208082528101610e2b816141f9565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b600060ff8216610e2b565b6136498161425f565b60408101614281828561375d565b610fcf602083018461426a565b6060810161429c828661375d565b6142a9602083018561375d565b6123526040830184613647565b60408101613eb98285613647565b60208082527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65729101908152613895565b60208082528101610e2b816142c4565b60198152602081017f4552433732313a20617070726f766520746f2063616c6c65720000000000000081529050613895565b60208082528101610e2b81614304565b6000610e2b613a6660ff841681565b61364981614346565b6060810161436c828661375d565b6142a96020830185614355565b601d8152602081017f41747461636b207375636365656465642e204e6f204850204c6f73742e00000081529050613895565b606081016143b98285613647565b6143c6602083018461375d565b818103604083015261235281614379565b60198152602081017f41747461636b206661696c65642e2031204850204c6f73742e0000000000000081529050613895565b606081016144178285613647565b614424602083018461375d565b8181036040830152612352816143d7565b600061443f825190565b61444d8185602086016136e5565b9290920192915050565b610e2b8183614435565b602a8152602081017f5361666545524332303a204552433230206f7065726174696f6e20646964206e8152691bdd081cdd58d8d9595960b21b60208201529050613d83565b60208082528101610e2b81614461565b6000826144c5576144c56141e3565b500690565b63ffffffff16600063fffffffe198201613ea457613ea4613d22565b61ffff918216919081169082820190811115610e2b57610e2b613d22565b6000815461451181613cfc565b600182168015614528576001811461453d5761456d565b60ff198316865281151582028601935061456d565b60008581526020902060005b8381101561456557815488820152600190910190602001614549565b505081860193505b50505092915050565b6145808184614504565b905061458c8183614435565b64173539b7b760d91b8152905060058101610fcf565b6000610e2b613a6663ffffffff841681565b613649816145a2565b6000610e2b613a6661ffff841681565b613649816145bd565b608081016145e482876145b4565b6145f16020830186614355565b6145fe60408301856145cd565b612d5c606083018461375d565b61ffff918216919081169082820390811115610e2b57610e2b613d22565b604081016146378285613647565b610fcf60208301846145cd565b60268152602081017f416464726573733a20696e73756666696369656e742062616c616e636520666f8152651c8818d85b1b60d21b60208201529050613d83565b60208082528101610e2b81614644565b60328152602081017f4552433732313a207472616e7366657220746f206e6f6e20455243373231526581527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60208201529050613d83565b60208082528101610e2b81614695565b601d8152602081017f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081529050613895565b60208082528101610e2b816146f2565b60208082527f4552433732313a206d696e7420746f20746865207a65726f20616464726573739101908152613895565b60208082528101610e2b81614734565b601c8152602081017f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000081529050613895565b60208082528101610e2b81614774565b608081016147c4828761375d565b6147d1602083018661375d565b6147de6040830185613647565b8181036060830152613a488184613709565b8051610e2b8161365d565b60006020828403121561481057614810600080fd5b600061235284846147f056fea26469706673582212209f45f3421308e5bb3b07458c379e3a6c9db775f5d1b6131bcf63d9b7cfbcb3ff64736f6c63430008130033

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

0000000000000000000000001b7d040a501f19f1e28ed9fe58e307a9516ee733

-----Decoded View---------------
Arg [0] : _configManagerAddress (address): 0x1b7d040A501F19F1e28ed9fe58e307a9516EE733

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000001b7d040a501f19f1e28ed9fe58e307a9516ee733


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.