ETH Price: $3,333.62 (-0.80%)

Contract

0xFf424B641053F55cFB15A9eE066Bd593f9aeCc9c
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw197152692024-04-23 2:59:59248 days ago1713841199IN
0xFf424B64...3f9aeCc9c
0 ETH0.000332016.02234626
Transfer Dragon ...195161252024-03-26 4:05:23276 days ago1711425923IN
0xFf424B64...3f9aeCc9c
0 ETH0.001094619.74970283
Mint A195113502024-03-25 11:59:23277 days ago1711367963IN
0xFf424B64...3f9aeCc9c
0 ETH0.0037282416.78646974
Mint A195113422024-03-25 11:57:47277 days ago1711367867IN
0xFf424B64...3f9aeCc9c
0 ETH0.0039588117.82559135
Mint A195112982024-03-25 11:48:47277 days ago1711367327IN
0xFf424B64...3f9aeCc9c
0 ETH0.00320416.80147338
Mint A195112922024-03-25 11:47:23277 days ago1711367243IN
0xFf424B64...3f9aeCc9c
0 ETH0.0040184818.09329386
Mint A195112882024-03-25 11:46:35277 days ago1711367195IN
0xFf424B64...3f9aeCc9c
0 ETH0.0040348218.16686441
Mint A195112802024-03-25 11:44:59277 days ago1711367099IN
0xFf424B64...3f9aeCc9c
0 ETH0.0039882719.19526136
Mint A195112712024-03-25 11:43:11277 days ago1711366991IN
0xFf424B64...3f9aeCc9c
0 ETH0.004429719.94482919
Mint A195112692024-03-25 11:42:47277 days ago1711366967IN
0xFf424B64...3f9aeCc9c
0 ETH0.0045068620.29444317
Mint A195112642024-03-25 11:41:47277 days ago1711366907IN
0xFf424B64...3f9aeCc9c
0 ETH0.0045694920.5753286
Set White List B...195112602024-03-25 11:40:59277 days ago1711366859IN
0xFf424B64...3f9aeCc9c
0 ETH0.0007488322.88965663
Set White List A...195112592024-03-25 11:40:47277 days ago1711366847IN
0xFf424B64...3f9aeCc9c
0 ETH0.0008261225.26927148
Set White List B...195112562024-03-25 11:40:11277 days ago1711366811IN
0xFf424B64...3f9aeCc9c
0 ETH0.0010901621.88417244
Mint A195112552024-03-25 11:39:59277 days ago1711366799IN
0xFf424B64...3f9aeCc9c
0 ETH0.0039379317.7306143
Set White List A...195112552024-03-25 11:39:59277 days ago1711366799IN
0xFf424B64...3f9aeCc9c
0 ETH0.0009824419.7306143
Mint A195112442024-03-25 11:37:35277 days ago1711366655IN
0xFf424B64...3f9aeCc9c
0 ETH0.0040340418.16333939
Mint A195112372024-03-25 11:36:11277 days ago1711366571IN
0xFf424B64...3f9aeCc9c
0 ETH0.0040310318.15078864
Mint A195112312024-03-25 11:34:59277 days ago1711366499IN
0xFf424B64...3f9aeCc9c
0 ETH0.0039836817.93758171
Mint A195112272024-03-25 11:34:11277 days ago1711366451IN
0xFf424B64...3f9aeCc9c
0 ETH0.0039870817.95191864
Mint A195112182024-03-25 11:32:23277 days ago1711366343IN
0xFf424B64...3f9aeCc9c
0 ETH0.0043315819.50305681
Mint A195112042024-03-25 11:29:35277 days ago1711366175IN
0xFf424B64...3f9aeCc9c
0 ETH0.0038806617.47368136
Mint A195111922024-03-25 11:27:11277 days ago1711366031IN
0xFf424B64...3f9aeCc9c
0 ETH0.0040195318.1
Mint A195111902024-03-25 11:26:47277 days ago1711366007IN
0xFf424B64...3f9aeCc9c
0 ETH0.00427319.23925786
Set White List B...195111842024-03-25 11:25:35277 days ago1711365935IN
0xFf424B64...3f9aeCc9c
0 ETH0.0015657620.98146903
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DragonDistributor

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 23 : DragonDistributor.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import { IDragonDistributor } from './interfaces/IDragonDistributor.sol';
import { IDragonOG } from './interfaces/IDragonOG.sol';
import { DistributorBase } from './DistributorBase.sol';
import { SimpleInitializable } from './SimpleInitializable.sol';
import { IWETH} from './interfaces/IWETH.sol';

import { IERC721Metadata } from '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol';
import { Ownable, Ownable2Step } from '@openzeppelin/contracts/access/Ownable2Step.sol';
import { Math } from '@openzeppelin/contracts/utils/math/Math.sol';


contract DragonDistributor is IDragonDistributor, SimpleInitializable, Ownable2Step, DistributorBase{
    bytes32 private constant MINT_A_TYPEHASH = 
        keccak256('MintA(address user,uint256 nonce,uint256 deadline)');
    bytes32 private constant MINT_B_TYPEHASH =
        keccak256('MintB(address user,uint256 nonce,uint256 deadline)');
    bytes32 private constant PUBLIC_MINT_TYPEHASH =
        keccak256('PublicMint(address user,uint256 nonce,uint256 deadline)');

    uint256 private constant B_PRICE = 15 ether / 1000;
    uint256 private constant PUBLIC_PRICE = 50 ether / 1000;
    uint256 private constant MAX_PUBLIC_SUPPLY = 800;
    uint256 private constant MAX_A_SUPPLY = 1500;
    uint256 private constant MAX_B_SUPPLY = 1500;
    
    address private _dragon;
    address private _weth;
    uint256 private _startTimeA;
    uint256 private _startTimeB;
    uint256 private _startTimePublic;
    uint256 private _endTimeA;
    uint256 private _endTimeB;
    uint256 private _endTimePublic;
    uint256 private _remainingPublicSupply = MAX_PUBLIC_SUPPLY;
    uint256 private _remainingASupply = MAX_A_SUPPLY;
    uint256 private _remainingBSupply = MAX_B_SUPPLY;

    mapping(address => uint256) private _whiteListA;
    mapping(address => uint256) private _whiteListB;
    mapping(address => uint256) private _mintedA;
    mapping(address => uint256) private _mintedB;
    mapping(address => bool) private _mintedPublic;

    constructor(address dragonAddress, address wethAddress) Ownable(msg.sender)
                                                            DistributorBase(IERC721Metadata(dragonAddress).name()) {
        if(dragonAddress == address(0)) {
            revert ZeroNFTAddress(address(this));
        }
        if(wethAddress == address(0)) {
            revert ZeroWETHAddress(address(this));
        }
        _dragon = dragonAddress;
        _weth = wethAddress;
    }

    function initialize(uint256 startA, uint256 endA, uint256 startB, uint256 endB, uint256 startPublic, uint256 endPublic) public onlyOwner initializer {
        _startTimeA = startA;
        _endTimeA = endA;
        _startTimeB = startB;
        _endTimeB = endB;
        _startTimePublic = startPublic;
        _endTimePublic = endPublic;
        Ownable2Step(_dragon).acceptOwnership();
        emit Initialize(_dragon, _startTimeA, _endTimeA, _startTimeB, _endTimeB, _startTimePublic, _endTimePublic);
    }

    function setStartTimeA(uint256 start) public onlyOwner {
        _startTimeA = start;
        emit StartTimeAChanged(_startTimeA);
    }

    function setEndTimeA(uint256 end) public onlyOwner {
        _endTimeA = end;
        emit EndTimeAChanged(_endTimeA);
    }

    function setStartTimeB(uint256 start) public onlyOwner {
        _startTimeB = start;
        emit StartTimeBChanged(_startTimeB);
    }

    function setEndTimeB(uint256 end) public onlyOwner {
        _endTimeB = end;
        emit EndTimeBChanged(_endTimeB);
    }

    function setStartTimePublic(uint256 start) public onlyOwner {
        _startTimePublic = start;
        emit StartTimePublicChanged(_startTimePublic);
    }

    function setEndTimePublic(uint256 end) public onlyOwner {
        _endTimePublic = end;
        emit EndTimePublicChanged(_endTimePublic);
    }

    function setWhiteListABatch(address [] memory users, uint256 [] memory counts) public onlyOwner {
        if(users.length != counts.length) {
            revert LengthNotMatch(address(this), users.length, counts.length);
        }
        for(uint256 i = 0; i < users.length; ++i) {
            _whiteListA[users[i]] = counts[i];
            if(counts[i] > 0){
                emit WhiteListAAdded(users[i], counts[i]);
            }
            else{
                emit WhiteListARemoved(users[i]);
            }
        }
    }

    function setWhiteListBBatch(address [] memory users, uint256[] memory counts) public onlyOwner {
        if(users.length != counts.length) {
            revert LengthNotMatch(address(this), users.length, counts.length);
        }
        for(uint256 i = 0; i < users.length; ++i) {
            _whiteListB[users[i]] = counts[i];
            if(counts[i] > 0){
                emit WhiteListBAdded(users[i], counts[i]);
            }
            else{
                emit WhiteListBRemoved(users[i]);
            }
        }
    }

    function mintA(address user, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public override {
        if(block.timestamp < _startTimeA) {
            revert NotStartedYet(address(this), _startTimeA);
        }
        if(block.timestamp > _endTimeA) {
            revert AlreadyEnded(address(this), _endTimeA);
        }
        if(_remainingASupply == 0) {
            revert NoMoreMintA(address(this));
        }
        
        _checkSignature(MINT_A_TYPEHASH, owner(), user, deadline, v, r, s);

        if(_whiteListA[user] == 0) {
            revert NotInWhiteListA(address(this), user);
        }
        if(_mintedA[user] >= _whiteListA[user]) {
            revert AlreadyMinted(address(this), user, _whiteListA[user]);
        }
        _mintedA[user] = _mintedA[user] + 1;
        _remainingASupply = _remainingASupply - 1;
        uint256 tokenId = IDragonOG(_dragon).mint(user);
        emit MintA(user, tokenId);
    }

    function mintB(address user, uint256 price, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public override {
        if(block.timestamp < _startTimeB) {
            revert NotStartedYet(address(this), _startTimeB);
        }
        if(block.timestamp > _endTimeB) {
            revert AlreadyEnded(address(this), _endTimeB);
        }
        if(_remainingBSupply == 0){
            revert NoMoreMintB(address(this));
        }
        
        _checkSignature(MINT_B_TYPEHASH, owner(), user, deadline, v, r, s);

        if(_whiteListB[user] == 0) {
            revert NotInWhiteListB(address(this), user);
        }
        if(_mintedB[user] >= _whiteListB[user]) {
            revert AlreadyMinted(address(this), user, _whiteListB[user]);
        }
        if(price < B_PRICE) {
            revert NotEnoughETH(address(this), price);
        }
        _mintedB[user] = _mintedB[user] + 1;
        _remainingBSupply = _remainingBSupply - 1;
        IWETH(_weth).transferFrom(msg.sender, address(this), price);

        uint256 tokenId = IDragonOG(_dragon).mint(user);
        emit MintB(user, tokenId);
    }

    function publicMint(address user, uint256 price, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public override {
        if(block.timestamp < _startTimePublic) {
            revert NotStartedYet(address(this), _startTimePublic);
        }
        if(block.timestamp > _endTimePublic) {
            revert AlreadyEnded(address(this), _endTimePublic);
        }
        if(_remainingPublicSupply == 0) {
            revert NoMorePublicMint(address(this));
        }
        
        _checkSignature(PUBLIC_MINT_TYPEHASH, owner(), user, deadline, v, r, s);

        if(_mintedPublic[user]) {
            revert AlreadyMinted(address(this), user, 1);
        }
        if(price < PUBLIC_PRICE) {
            revert NotEnoughETH(address(this), price);
        }
        _mintedPublic[user] = true;
        _remainingPublicSupply = _remainingPublicSupply - 1;
        IWETH(_weth).transferFrom(msg.sender, address(this), price);
        uint256 tokenId = IDragonOG(_dragon).mint(user);
        emit PublicMint(user, tokenId);
    }


    function transferDragonOwner(address newOwner) public override onlyOwner {
        if(newOwner == address(0)) {
            revert ZeroOwnerAddress(address(this));
        }
        Ownable2Step(_dragon).transferOwnership(newOwner);
    }

    function timeWindows() public view override returns(uint256, uint256, uint256, uint256, uint256, uint256) {
        return (_startTimeA, _endTimeA, _startTimeB, _endTimeB, _startTimePublic, _endTimePublic);
    }

    function remainingPublicSupply() public view override returns(uint256) {
        return _remainingPublicSupply;
    }

    function remainingASupply() public view override returns(uint256) {
        return _remainingASupply;
    }

    function remainingBSupply() public view override returns(uint256) {
        return _remainingBSupply;
    }

    function mintableDragons(address user) public view override returns(uint256, uint256, uint256) {
        return ( (_whiteListA[user] > _mintedA[user]) ? (_whiteListA[user] - _mintedA[user]) : 0, 
                 (_whiteListB[user] > _mintedB[user]) ? (_whiteListB[user] - _mintedB[user]) : 0,
                 _mintedPublic[user] ? 0 : 1);
    }

    function withdraw(address receiver) public onlyOwner {
        uint256 balance = IWETH(_weth).balanceOf(address(this));
        IWETH(_weth).transferFrom(address(this), receiver, balance);
    }

    function setBaseURI(string memory baseURI) public onlyOwner {
        IDragonOG(_dragon).setBaseURI(baseURI);
    }
}

File 2 of 23 : IDragonDistributor.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

interface IDragonDistributor {
    event Initialize(address indexed dragonOG, uint256 startTimeA, uint256 endTimeA, 
                     uint256 startTimeB, uint256 endTimeB, uint256 startTimePublic, uint256 endTimePublic);

    event UpdateBaseURI(string baseURI);

    event WhiteListAAdded(address indexed user, uint256 count);
    event WhiteListARemoved(address indexed user);

    event WhiteListBAdded(address indexed user, uint256 count);
    event WhiteListBRemoved(address indexed user);

    event MintA(address indexed user, uint256 indexed id);
    event MintB(address indexed user, uint256 indexed id);
    event PublicMint(address indexed user, uint256 indexed id);

    event StartTimeAChanged(uint256 startTimeA);
    event EndTimeAChanged(uint256 endTimeA);
    event StartTimeBChanged(uint256 startTimeB);
    event EndTimeBChanged(uint256 endTimeB);
    event StartTimePublicChanged(uint256 startTimePublic);
    event EndTimePublicChanged(uint256 endTimePublic);

    /**
     * @dev Mint a dragon for ``receiver``,
     * given ``owner()``'s signed approval.
     *
     * Requirements:
     *
     * - `receiver` 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 ``receiver``'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].
     *
     * CAUTION: See Security Considerations above.
     */
    function mintA(address receiver, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;
    function mintB(address receiver, uint256 price, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;
    function publicMint(address receiver, uint256 price, uint256 deadline, uint8 v, bytes32 r,  bytes32 s) external;

    function transferDragonOwner(address newOwner) external;
    function mintableDragons(address user) external view returns(uint256, uint256, uint256);
    function timeWindows() external view returns(uint256, uint256, uint256, uint256, uint256, uint256);
    function remainingPublicSupply() external view returns(uint256);
    function remainingASupply() external view returns(uint256);
    function remainingBSupply() external view returns(uint256);

    error ZeroWETHAddress(address thrower);
    error NotInWhiteListA(address thrower, address user);
    error NotInWhiteListB(address thrower, address user);
    error AlreadyMinted(address thrower, address user, uint256 count);
    error NoMorePublicMint(address thrower);
    error NoMoreMintA(address thrower);
    error NoMoreMintB(address thrower);
    error AlreadyEnded(address thrower, uint256 endTime);
    error NotEnoughETH(address thrower, uint256 amount);
}

File 3 of 23 : IDragonOG.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

interface IDragonOG {
    event UpdateBaseURI(string baseURI);

    function setBaseURI(string memory baseURI) external;
    function mint(address receiver) external returns(uint256);

    error OutOfStock(address thrower);
}

File 4 of 23 : DistributorBase.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import { IDistributorBase } from "./interfaces/IDistributorBase.sol";

import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import { EIP712 } from '@openzeppelin/contracts/utils/cryptography/EIP712.sol';
import { Nonces } from '@openzeppelin/contracts/utils/Nonces.sol';

contract DistributorBase is IDistributorBase, EIP712, Nonces {
    constructor(string memory name) EIP712(name, '1') {}

    function _checkSignature(bytes32 typeHash, address owner, address user, uint256 deadline, uint8 v, bytes32 r, bytes32 s) internal {
        if (block.timestamp > deadline) {
            revert ExpiredSignature(address(this), deadline);
        }
        bytes32 structHash = keccak256(abi.encode(typeHash, user, _useNonce(user), deadline));
        bytes32 hash = _hashTypedDataV4(structHash);

        address signer = ECDSA.recover(hash, v, r, s);
        if(signer != owner) {
            revert InvalidSigner(address(this), signer, owner);
        }
        
    }

    function nonces(address owner) public view virtual override(IDistributorBase, Nonces) returns(uint256) {
        return super.nonces(owner);
    }

    function DOMAIN_SEPARATOR() public view virtual override returns(bytes32) {
        return _domainSeparatorV4();
    }
}

File 5 of 23 : SimpleInitializable.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

abstract contract SimpleInitializable {
  bool internal _initialized = false;

  modifier initializer() {
    if (_initialized) {
      revert AlreadyInitialised(address(this));
    }
    _initialized = true;
    _;
  }

  error AlreadyInitialised(address target);
}

File 6 of 23 : IWETH.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.11;

interface IWETH {
    function deposit() external payable;

    function withdraw(uint256) external;

    function approve(address guy, uint256 wad) external returns (bool);

    function balanceOf(address user) external returns (uint256);

    function transferFrom(
        address src,
        address dst,
        uint256 wad
    ) external returns (bool);
}

File 7 of 23 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.20;

import {IERC721} from "../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 8 of 23 : Ownable2Step.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.20;

import {Ownable} from "./Ownable.sol";

/**
 * @dev Contract module which provides access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is specified at deployment time in the constructor for `Ownable`. This
 * can later be changed with {transferOwnership} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2Step is Ownable {
    address private _pendingOwner;

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

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

    /**
     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual override onlyOwner {
        _pendingOwner = newOwner;
        emit OwnershipTransferStarted(owner(), newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual override {
        delete _pendingOwner;
        super._transferOwnership(newOwner);
    }

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() public virtual {
        address sender = _msgSender();
        if (pendingOwner() != sender) {
            revert OwnableUnauthorizedAccount(sender);
        }
        _transferOwnership(sender);
    }
}

File 9 of 23 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Muldiv operation overflow.
     */
    error MathOverflowedMulDiv();

    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @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 towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // (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 = x * y; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                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.
            if (denominator <= prod1) {
                revert MathOverflowedMulDiv();
            }

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

            uint256 twos = denominator & (0 - denominator);
            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 (unsignedRoundsUp(rounding) && 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
     * towards zero.
     *
     * 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 + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * 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 + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10 of a positive value rounded towards zero.
     * 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 + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256 of a positive value rounded towards zero.
     * 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 + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
        }
    }

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

File 10 of 23 : IDistributorBase.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

interface IDistributorBase {

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

    error NotStartedYet(address thrower, uint256 startTimestamp);
    error ZeroNFTAddress(address thrower);
    error ZeroOwnerAddress(address thrower);
    error ExpiredSignature(address thrower, uint256 deadline);
    error InvalidSigner(address thrower, address signer, address owner);
    error LengthNotMatch(address thrower, uint256 lengthA, uint256 lengthB);
}

File 11 of 23 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.20;

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS
    }

    /**
     * @dev The signature derives the `address(0)`.
     */
    error ECDSAInvalidSignature();

    /**
     * @dev The signature has an invalid length.
     */
    error ECDSAInvalidSignatureLength(uint256 length);

    /**
     * @dev The signature has an S value that is in the upper half order.
     */
    error ECDSAInvalidSignatureS(bytes32 s);

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not
     * return address(0) without also returning an error description. Errors are documented using an enum (error type)
     * and a bytes32 providing additional information about the error.
     *
     * If no error is returned, then the address can be used for verification purposes.
     *
     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);
        _throwError(error, errorArg);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     */
    function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) {
        unchecked {
            bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
            // We do not check for an overflow here since the shift operation results in 0 or 1.
            uint8 v = uint8((uint256(vs) >> 255) + 27);
            return tryRecover(hash, v, r, s);
        }
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     */
    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);
        _throwError(error, errorArg);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError, bytes32) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS, s);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature, bytes32(0));
        }

        return (signer, RecoverError.NoError, bytes32(0));
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s);
        _throwError(error, errorArg);
        return recovered;
    }

    /**
     * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.
     */
    function _throwError(RecoverError error, bytes32 errorArg) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert ECDSAInvalidSignature();
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert ECDSAInvalidSignatureLength(uint256(errorArg));
        } else if (error == RecoverError.InvalidSignatureS) {
            revert ECDSAInvalidSignatureS(errorArg);
        }
    }
}

File 12 of 23 : EIP712.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/EIP712.sol)

pragma solidity ^0.8.20;

import {MessageHashUtils} from "./MessageHashUtils.sol";
import {ShortStrings, ShortString} from "../ShortStrings.sol";
import {IERC5267} from "../../interfaces/IERC5267.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose
 * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract
 * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to
 * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain
 * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the
 * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.
 *
 * @custom:oz-upgrades-unsafe-allow state-variable-immutable
 */
abstract contract EIP712 is IERC5267 {
    using ShortStrings for *;

    bytes32 private constant TYPE_HASH =
        keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");

    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
    // invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _cachedDomainSeparator;
    uint256 private immutable _cachedChainId;
    address private immutable _cachedThis;

    bytes32 private immutable _hashedName;
    bytes32 private immutable _hashedVersion;

    ShortString private immutable _name;
    ShortString private immutable _version;
    string private _nameFallback;
    string private _versionFallback;

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    constructor(string memory name, string memory version) {
        _name = name.toShortStringWithFallback(_nameFallback);
        _version = version.toShortStringWithFallback(_versionFallback);
        _hashedName = keccak256(bytes(name));
        _hashedVersion = keccak256(bytes(version));

        _cachedChainId = block.chainid;
        _cachedDomainSeparator = _buildDomainSeparator();
        _cachedThis = address(this);
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (address(this) == _cachedThis && block.chainid == _cachedChainId) {
            return _cachedDomainSeparator;
        } else {
            return _buildDomainSeparator();
        }
    }

    function _buildDomainSeparator() private view returns (bytes32) {
        return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));
    }

    /**
     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
     * function returns the hash of the fully encoded EIP712 message for this domain.
     *
     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
     *
     * ```solidity
     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
     *     keccak256("Mail(address to,string contents)"),
     *     mailTo,
     *     keccak256(bytes(mailContents))
     * )));
     * address signer = ECDSA.recover(digest, signature);
     * ```
     */
    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
        return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);
    }

    /**
     * @dev See {IERC-5267}.
     */
    function eip712Domain()
        public
        view
        virtual
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        )
    {
        return (
            hex"0f", // 01111
            _EIP712Name(),
            _EIP712Version(),
            block.chainid,
            address(this),
            bytes32(0),
            new uint256[](0)
        );
    }

    /**
     * @dev The name parameter for the EIP712 domain.
     *
     * NOTE: By default this function reads _name which is an immutable value.
     * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
     */
    // solhint-disable-next-line func-name-mixedcase
    function _EIP712Name() internal view returns (string memory) {
        return _name.toStringWithFallback(_nameFallback);
    }

    /**
     * @dev The version parameter for the EIP712 domain.
     *
     * NOTE: By default this function reads _version which is an immutable value.
     * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
     */
    // solhint-disable-next-line func-name-mixedcase
    function _EIP712Version() internal view returns (string memory) {
        return _version.toStringWithFallback(_versionFallback);
    }
}

File 13 of 23 : Nonces.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)
pragma solidity ^0.8.20;

/**
 * @dev Provides tracking nonces for addresses. Nonces will only increment.
 */
abstract contract Nonces {
    /**
     * @dev The nonce used for an `account` is not the expected current nonce.
     */
    error InvalidAccountNonce(address account, uint256 currentNonce);

    mapping(address account => uint256) private _nonces;

    /**
     * @dev Returns the next unused nonce for an address.
     */
    function nonces(address owner) public view virtual returns (uint256) {
        return _nonces[owner];
    }

    /**
     * @dev Consumes a nonce.
     *
     * Returns the current value and increments nonce.
     */
    function _useNonce(address owner) internal virtual returns (uint256) {
        // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be
        // decremented or reset. This guarantees that the nonce never overflows.
        unchecked {
            // It is important to do x++ and not ++x here.
            return _nonces[owner]++;
        }
    }

    /**
     * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.
     */
    function _useCheckedNonce(address owner, uint256 nonce) internal virtual {
        uint256 current = _useNonce(owner);
        if (nonce != current) {
            revert InvalidAccountNonce(owner, current);
        }
    }
}

File 14 of 23 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../../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 address zero.
     *
     * 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 15 of 23 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../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.
 *
 * The initial owner is set to the address provided by the deployer. 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;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @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 {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @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 {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _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 16 of 23 : MessageHashUtils.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MessageHashUtils.sol)

pragma solidity ^0.8.20;

import {Strings} from "../Strings.sol";

/**
 * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.
 *
 * The library provides methods for generating a hash of a message that conforms to the
 * https://eips.ethereum.org/EIPS/eip-191[EIP 191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]
 * specifications.
 */
library MessageHashUtils {
    /**
     * @dev Returns the keccak256 digest of an EIP-191 signed data with version
     * `0x45` (`personal_sign` messages).
     *
     * The digest is calculated by prefixing a bytes32 `messageHash` with
     * `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the
     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
     *
     * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with
     * keccak256, although any bytes32 value can be safely used because the final digest will
     * be re-hashed.
     *
     * See {ECDSA-recover}.
     */
    function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash
            mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix
            digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)
        }
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-191 signed data with version
     * `0x45` (`personal_sign` messages).
     *
     * The digest is calculated by prefixing an arbitrary `message` with
     * `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the
     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
     *
     * See {ECDSA-recover}.
     */
    function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {
        return
            keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message));
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-191 signed data with version
     * `0x00` (data with intended validator).
     *
     * The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended
     * `validator` address. Then hashing the result.
     *
     * See {ECDSA-recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked(hex"19_00", validator, data));
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-712 typed data (EIP-191 version `0x01`).
     *
     * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with
     * `\x19\x01` and hashing the result. It corresponds to the hash signed by the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.
     *
     * See {ECDSA-recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, hex"19_01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            digest := keccak256(ptr, 0x42)
        }
    }
}

File 17 of 23 : ShortStrings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ShortStrings.sol)

pragma solidity ^0.8.20;

import {StorageSlot} from "./StorageSlot.sol";

// | string  | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA   |
// | length  | 0x                                                              BB |
type ShortString is bytes32;

/**
 * @dev This library provides functions to convert short memory strings
 * into a `ShortString` type that can be used as an immutable variable.
 *
 * Strings of arbitrary length can be optimized using this library if
 * they are short enough (up to 31 bytes) by packing them with their
 * length (1 byte) in a single EVM word (32 bytes). Additionally, a
 * fallback mechanism can be used for every other case.
 *
 * Usage example:
 *
 * ```solidity
 * contract Named {
 *     using ShortStrings for *;
 *
 *     ShortString private immutable _name;
 *     string private _nameFallback;
 *
 *     constructor(string memory contractName) {
 *         _name = contractName.toShortStringWithFallback(_nameFallback);
 *     }
 *
 *     function name() external view returns (string memory) {
 *         return _name.toStringWithFallback(_nameFallback);
 *     }
 * }
 * ```
 */
library ShortStrings {
    // Used as an identifier for strings longer than 31 bytes.
    bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;

    error StringTooLong(string str);
    error InvalidShortString();

    /**
     * @dev Encode a string of at most 31 chars into a `ShortString`.
     *
     * This will trigger a `StringTooLong` error is the input string is too long.
     */
    function toShortString(string memory str) internal pure returns (ShortString) {
        bytes memory bstr = bytes(str);
        if (bstr.length > 31) {
            revert StringTooLong(str);
        }
        return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));
    }

    /**
     * @dev Decode a `ShortString` back to a "normal" string.
     */
    function toString(ShortString sstr) internal pure returns (string memory) {
        uint256 len = byteLength(sstr);
        // using `new string(len)` would work locally but is not memory safe.
        string memory str = new string(32);
        /// @solidity memory-safe-assembly
        assembly {
            mstore(str, len)
            mstore(add(str, 0x20), sstr)
        }
        return str;
    }

    /**
     * @dev Return the length of a `ShortString`.
     */
    function byteLength(ShortString sstr) internal pure returns (uint256) {
        uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;
        if (result > 31) {
            revert InvalidShortString();
        }
        return result;
    }

    /**
     * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.
     */
    function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {
        if (bytes(value).length < 32) {
            return toShortString(value);
        } else {
            StorageSlot.getStringSlot(store).value = value;
            return ShortString.wrap(FALLBACK_SENTINEL);
        }
    }

    /**
     * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
     */
    function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {
        if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
            return toString(value);
        } else {
            return store;
        }
    }

    /**
     * @dev Return the length of a string that was encoded to `ShortString` or written to storage using
     * {setWithFallback}.
     *
     * WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of
     * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.
     */
    function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {
        if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
            return byteLength(value);
        } else {
            return bytes(store).length;
        }
    }
}

File 18 of 23 : IERC5267.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)

pragma solidity ^0.8.20;

interface IERC5267 {
    /**
     * @dev MAY be emitted to signal that the domain could have changed.
     */
    event EIP712DomainChanged();

    /**
     * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
     * signature.
     */
    function eip712Domain()
        external
        view
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        );
}

File 19 of 23 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

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

File 20 of 23 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @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;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

File 21 of 23 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)

pragma solidity ^0.8.20;

import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";

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

    /**
     * @dev The `value` string doesn't fit in the specified `length`.
     */
    error StringsInsufficientHexLength(uint256 value, uint256 length);

    /**
     * @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), HEX_DIGITS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toStringSigned(int256 value) internal pure returns (string memory) {
        return string.concat(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) {
        uint256 localValue = value;
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = HEX_DIGITS[localValue & 0xf];
            localValue >>= 4;
        }
        if (localValue != 0) {
            revert StringsInsufficientHexLength(value, length);
        }
        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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 22 of 23 : StorageSlot.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

pragma solidity ^0.8.20;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(newImplementation.code.length > 0);
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}

File 23 of 23 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.20;

/**
 * @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);
        }
    }
}

Settings
{
  "remappings": [
    "@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/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"dragonAddress","type":"address"},{"internalType":"address","name":"wethAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"thrower","type":"address"},{"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"AlreadyEnded","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AlreadyInitialised","type":"error"},{"inputs":[{"internalType":"address","name":"thrower","type":"address"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"count","type":"uint256"}],"name":"AlreadyMinted","type":"error"},{"inputs":[],"name":"ECDSAInvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"name":"ECDSAInvalidSignatureLength","type":"error"},{"inputs":[{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"ECDSAInvalidSignatureS","type":"error"},{"inputs":[{"internalType":"address","name":"thrower","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"ExpiredSignature","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"currentNonce","type":"uint256"}],"name":"InvalidAccountNonce","type":"error"},{"inputs":[],"name":"InvalidShortString","type":"error"},{"inputs":[{"internalType":"address","name":"thrower","type":"address"},{"internalType":"address","name":"signer","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"InvalidSigner","type":"error"},{"inputs":[{"internalType":"address","name":"thrower","type":"address"},{"internalType":"uint256","name":"lengthA","type":"uint256"},{"internalType":"uint256","name":"lengthB","type":"uint256"}],"name":"LengthNotMatch","type":"error"},{"inputs":[{"internalType":"address","name":"thrower","type":"address"}],"name":"NoMoreMintA","type":"error"},{"inputs":[{"internalType":"address","name":"thrower","type":"address"}],"name":"NoMoreMintB","type":"error"},{"inputs":[{"internalType":"address","name":"thrower","type":"address"}],"name":"NoMorePublicMint","type":"error"},{"inputs":[{"internalType":"address","name":"thrower","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"NotEnoughETH","type":"error"},{"inputs":[{"internalType":"address","name":"thrower","type":"address"},{"internalType":"address","name":"user","type":"address"}],"name":"NotInWhiteListA","type":"error"},{"inputs":[{"internalType":"address","name":"thrower","type":"address"},{"internalType":"address","name":"user","type":"address"}],"name":"NotInWhiteListB","type":"error"},{"inputs":[{"internalType":"address","name":"thrower","type":"address"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"}],"name":"NotStartedYet","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"inputs":[{"internalType":"address","name":"thrower","type":"address"}],"name":"ZeroNFTAddress","type":"error"},{"inputs":[{"internalType":"address","name":"thrower","type":"address"}],"name":"ZeroOwnerAddress","type":"error"},{"inputs":[{"internalType":"address","name":"thrower","type":"address"}],"name":"ZeroWETHAddress","type":"error"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"endTimeA","type":"uint256"}],"name":"EndTimeAChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"endTimeB","type":"uint256"}],"name":"EndTimeBChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"endTimePublic","type":"uint256"}],"name":"EndTimePublicChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"dragonOG","type":"address"},{"indexed":false,"internalType":"uint256","name":"startTimeA","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTimeA","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startTimeB","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTimeB","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startTimePublic","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTimePublic","type":"uint256"}],"name":"Initialize","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"MintA","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"MintB","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","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":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"PublicMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startTimeA","type":"uint256"}],"name":"StartTimeAChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startTimeB","type":"uint256"}],"name":"StartTimeBChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startTimePublic","type":"uint256"}],"name":"StartTimePublicChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"baseURI","type":"string"}],"name":"UpdateBaseURI","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"count","type":"uint256"}],"name":"WhiteListAAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"WhiteListARemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"count","type":"uint256"}],"name":"WhiteListBAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"WhiteListBRemoved","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"startA","type":"uint256"},{"internalType":"uint256","name":"endA","type":"uint256"},{"internalType":"uint256","name":"startB","type":"uint256"},{"internalType":"uint256","name":"endB","type":"uint256"},{"internalType":"uint256","name":"startPublic","type":"uint256"},{"internalType":"uint256","name":"endPublic","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"mintA","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"mintB","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"mintableDragons","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"publicMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"remainingASupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"remainingBSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"remainingPublicSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"end","type":"uint256"}],"name":"setEndTimeA","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"end","type":"uint256"}],"name":"setEndTimeB","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"end","type":"uint256"}],"name":"setEndTimePublic","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"start","type":"uint256"}],"name":"setStartTimeA","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"start","type":"uint256"}],"name":"setStartTimeB","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"start","type":"uint256"}],"name":"setStartTimePublic","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"users","type":"address[]"},{"internalType":"uint256[]","name":"counts","type":"uint256[]"}],"name":"setWhiteListABatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"users","type":"address[]"},{"internalType":"uint256[]","name":"counts","type":"uint256[]"}],"name":"setWhiteListBBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timeWindows","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferDragonOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101606040526000805460ff19169055610320600d556105dc600e819055600f553480156200002d57600080fd5b50604051620028aa380380620028aa833981016040819052620000509162000355565b816001600160a01b03166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa1580156200008f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620000b99190810190620003c9565b6040805180820190915260018152603160f81b602082015281903380620000fb57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b620001068162000245565b506200011482600262000263565b610120526200012581600362000263565b61014052815160208084019190912060e052815190820120610100524660a052620001b360e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c052506001600160a01b038216620001e857604051634cbca1db60e01b8152306004820152602401620000f2565b6001600160a01b0381166200021357604051635185bcfd60e11b8152306004820152602401620000f2565b600580546001600160a01b039384166001600160a01b0319918216179091556006805492909316911617905562000636565b600180546001600160a01b031916905562000260816200029c565b50565b600060208351101562000283576200027b83620002f5565b905062000296565b8162000290848262000510565b5060ff90505b92915050565b600080546001600160a01b03838116610100818102610100600160a81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600080829050601f8151111562000323578260405163305a27a960e01b8152600401620000f29190620005dc565b8051620003308262000611565b179392505050565b80516001600160a01b03811681146200035057600080fd5b919050565b600080604083850312156200036957600080fd5b620003748362000338565b9150620003846020840162000338565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620003c0578181015183820152602001620003a6565b50506000910152565b600060208284031215620003dc57600080fd5b81516001600160401b0380821115620003f457600080fd5b818401915084601f8301126200040957600080fd5b8151818111156200041e576200041e6200038d565b604051601f8201601f19908116603f011681019083821181831017156200044957620004496200038d565b816040528281528760208487010111156200046357600080fd5b62000476836020830160208801620003a3565b979650505050505050565b600181811c908216806200049657607f821691505b602082108103620004b757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200050b57600081815260208120601f850160051c81016020861015620004e65750805b601f850160051c820191505b818110156200050757828155600101620004f2565b5050505b505050565b81516001600160401b038111156200052c576200052c6200038d565b62000544816200053d845462000481565b84620004bd565b602080601f8311600181146200057c5760008415620005635750858301515b600019600386901b1c1916600185901b17855562000507565b600085815260208120601f198616915b82811015620005ad578886015182559484019460019091019084016200058c565b5085821015620005cc5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020815260008251806020840152620005fd816040850160208701620003a3565b601f01601f19169190910160400192915050565b80516020808301519190811015620004b75760001960209190910360031b1b16919050565b60805160a05160c05160e0516101005161012051610140516122196200069160003960006118e5015260006118b8015260006117330152600061170b0152600061166601526000611690015260006116ba01526122196000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c8063715018a6116100f9578063d26b30b511610097578063e30c397811610071578063e30c39781461039a578063e46f5b25146103ab578063f0cc625b146103be578063f2fde38b146103fd57600080fd5b8063d26b30b514610351578063d4c7fea814610359578063e16f4c911461036c57600080fd5b806384b0196e116100d357806384b0196e146102e6578063853ab251146103015780638da5cb5b1461031457806393a756511461033e57600080fd5b8063715018a6146102c357806379ba5097146102cb5780637ecebe00146102d357600080fd5b80632eab69c11161016657806351cff8d91161014057806351cff8d91461027757806351eb3ac91461028a57806355f804b31461029d5780636a0d2ebf146102b057600080fd5b80632eab69c1146102495780633644e5151461025c57806347a205781461026457600080fd5b80631bc3ed93116101a25780631bc3ed9314610208578063200374ba146102105780632496228b146102235780632d7aa82b1461023657600080fd5b806304d961f6146101c95780630ab8ec87146101de57806310042e10146101f1575b600080fd5b6101dc6101d7366004611d50565b610410565b005b6101dc6101ec366004611d50565b6105bb565b600d545b6040519081526020015b60405180910390f35b600f546101f5565b6101dc61021e366004611e10565b61075c565b6101dc610231366004611e32565b6107f0565b6101dc610244366004611e4b565b610834565b6101dc610257366004611e32565b610960565b6101f561099d565b6101dc610272366004611e9f565b6109ac565b6101dc610285366004611e10565b610c4a565b6101dc610298366004611e32565b610d39565b6101dc6102ab366004611ef7565b610d76565b6101dc6102be366004611e32565b610dae565b6101dc610deb565b6101dc610dff565b6101f56102e1366004611e10565b610e43565b6102ee610e63565b6040516101ff9796959493929190611fd2565b6101dc61030f366004611e9f565b610ea9565b60005461010090046001600160a01b03165b6040516001600160a01b0390911681526020016101ff565b6101dc61034c366004611e32565b6111c0565b600e546101f5565b6101dc610367366004612068565b6111fd565b61037f61037a366004611e10565b611474565b604080519384526020840192909252908201526060016101ff565b6001546001600160a01b0316610326565b6101dc6103b9366004611e32565b611572565b600754600a54600854600b54600954600c54604080519687526020870195909552938501929092526060840152608083015260a082015260c0016101ff565b6101dc61040b366004611e10565b6115af565b610418611626565b805182511461045257815181516040516378d4aff360e01b8152306004820152602481019290925260448201526064015b60405180910390fd5b60005b82518110156105b657818181518110610470576104706120b6565b60200260200101516010600085848151811061048e5761048e6120b6565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000208190555060008282815181106104ce576104ce6120b6565b60200260200101511115610556578281815181106104ee576104ee6120b6565b60200260200101516001600160a01b03167f151a1792460174827cd437b2fcd90608380af06350b816c8f3374b2458b09968838381518110610532576105326120b6565b602002602001015160405161054991815260200190565b60405180910390a26105a6565b828181518110610568576105686120b6565b60200260200101516001600160a01b03167f46d4fb935e7086447c6e4f9222922858280905c4347f05146b6bd15ce65bc2bc60405160405180910390a25b6105af816120e2565b9050610455565b505050565b6105c3611626565b80518251146105f857815181516040516378d4aff360e01b815230600482015260248101929092526044820152606401610449565b60005b82518110156105b657818181518110610616576106166120b6565b602002602001015160116000858481518110610634576106346120b6565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055506000828281518110610674576106746120b6565b602002602001015111156106fc57828181518110610694576106946120b6565b60200260200101516001600160a01b03167fcc92299a7938d3b6c564ca3855565ffa74222a93e07838c7109f81c26fa23c238383815181106106d8576106d86120b6565b60200260200101516040516106ef91815260200190565b60405180910390a261074c565b82818151811061070e5761070e6120b6565b60200260200101516001600160a01b03167f67fd13de8df0a2db287368efb6279b5093a8b664c965dc8c2cae3f896802c01060405160405180910390a25b610755816120e2565b90506105fb565b610764611626565b6001600160a01b03811661078d576040516307fc150360e41b8152306004820152602401610449565b60055460405163f2fde38b60e01b81526001600160a01b0383811660048301529091169063f2fde38b906024015b600060405180830381600087803b1580156107d557600080fd5b505af11580156107e9573d6000803e3d6000fd5b5050505050565b6107f8611626565b60098190556040518181527f7abd1de0f816f14b9a32e2e502285710a5d9d570b5f4b1fd58887e14de50b4b0906020015b60405180910390a150565b61083c611626565b60005460ff16156108625760405163161b906f60e01b8152306004820152602401610449565b6000805460ff191660011781556007879055600a8690556008859055600b8490556009839055600c829055600554604080516379ba509760e01b815290516001600160a01b03909216926379ba50979260048084019382900301818387803b1580156108cd57600080fd5b505af11580156108e1573d6000803e3d6000fd5b5050600554600754600a54600854600b54600954600c54604080519687526020870195909552938501929092526060840152608083015260a08201526001600160a01b0390911692507fbd1add6764702d70588312e4646554ae5c849fe9322f243a0e6e068e9b95b425915060c00160405180910390a2505050505050565b610968611626565b60078190556040518181527fd4031294256e709e3e9fdc8476ee41268f53079fb8df473d2dbaed4af174eb6490602001610829565b60006109a7611659565b905090565b6009544210156109dc57600954604051630875cde560e31b81523060048201526024810191909152604401610449565b600c54421115610a0c57600c54604051631bdf30c360e21b81523060048201526024810191909152604401610449565b600d54600003610a315760405163cb9124f160e01b8152306004820152602401610449565b610a777f52b4e78d922891850994fe8552ca29e7e2a8d82524d2ec129928a640d25bff79610a6d6000546001600160a01b036101009091041690565b8887878787611784565b6001600160a01b03861660009081526014602052604090205460ff1615610ab857308660016040516304c4f0af60e11b8152600401610449939291906120fb565b66b1a2bc2ec50000851015610ae95760405163e956165360e01b815230600482015260248101869052604401610449565b6001600160a01b0386166000908152601460205260409020805460ff19166001908117909155600d54610b1c919061211f565b600d556006546040516323b872dd60e01b81526001600160a01b03909116906323b872dd90610b5390339030908a906004016120fb565b6020604051808303816000875af1158015610b72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b969190612132565b506005546040516335313c2160e11b81526001600160a01b0388811660048301526000921690636a627842906024016020604051808303816000875af1158015610be4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c089190612154565b905080876001600160a01b03167f748a2986091c2034d6e93b6f44f771a79f0e1d6acd8a60c68c17d4e1e2feaed260405160405180910390a350505050505050565b610c52611626565b6006546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a08231906024016020604051808303816000875af1158015610c9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc19190612154565b6006546040516323b872dd60e01b81529192506001600160a01b0316906323b872dd90610cf6903090869086906004016120fb565b6020604051808303816000875af1158015610d15573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b69190612132565b610d41611626565b600a8190556040518181527fd88332c8080f9cfe23f7766181cf113b4597846866d8814094bb6802e64f634190602001610829565b610d7e611626565b6005546040516355f804b360e01b81526001600160a01b03909116906355f804b3906107bb90849060040161216d565b610db6611626565b60088190556040518181527fa2d65690c3d7b7747471f430003bea493ee880dab5f4c0c2bc36d53bd3b0664190602001610829565b610df3611626565b610dfd6000611898565b565b60015433906001600160a01b03168114610e375760405163118cdaa760e01b81526001600160a01b0382166004820152602401610449565b610e4081611898565b50565b6001600160a01b0381166000908152600460205260408120545b92915050565b600060608060008060006060610e776118b1565b610e7f6118de565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b600854421015610ed957600854604051630875cde560e31b81523060048201526024810191909152604401610449565b600b54421115610f0957600b54604051631bdf30c360e21b81523060048201526024810191909152604401610449565b600f54600003610f2e57604051634ed7544360e11b8152306004820152602401610449565b610f6a7fe301559e14964592f8c536a348edd85312641b5f2c77d6174ec9974acc835f9c610a6d6000546001600160a01b036101009091041690565b6001600160a01b0386166000908152601160205260408120549003610fb35760405163deb2dcad60e01b81523060048201526001600160a01b0387166024820152604401610449565b6001600160a01b03861660009081526011602090815260408083205460139092529091205410611015576001600160a01b038616600090815260116020526040908190205490516304c4f0af60e11b81526104499130918991906004016120fb565b66354a6ba7a180008510156110465760405163e956165360e01b815230600482015260248101869052604401610449565b6001600160a01b03861660009081526013602052604090205461106a906001612180565b6001600160a01b038716600090815260136020526040902055600f546110929060019061211f565b600f556006546040516323b872dd60e01b81526001600160a01b03909116906323b872dd906110c990339030908a906004016120fb565b6020604051808303816000875af11580156110e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110c9190612132565b506005546040516335313c2160e11b81526001600160a01b0388811660048301526000921690636a627842906024016020604051808303816000875af115801561115a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117e9190612154565b905080876001600160a01b03167f07079ba8383885d2224e12a080264f20daee8c335e8933982ab3724e81a3522660405160405180910390a350505050505050565b6111c8611626565b600b8190556040518181527f20a0c9277e0162254d5cb83e180ac546fbea08942b908427fd0e347af304776290602001610829565b60075442101561122d57600754604051630875cde560e31b81523060048201526024810191909152604401610449565b600a5442111561125d57600a54604051631bdf30c360e21b81523060048201526024810191909152604401610449565b600e54600003611282576040516324d04f7160e11b8152306004820152602401610449565b6112c87f8ab93fa6e80af50aed9d4f7fd49b35fc7e7807c23cc213163fecd8a9fb6ef2856112be6000546001600160a01b036101009091041690565b8787878787611784565b6001600160a01b038516600090815260106020526040812054900361131157604051634786f5bb60e01b81523060048201526001600160a01b0386166024820152604401610449565b6001600160a01b03851660009081526010602090815260408083205460129092529091205410611373576001600160a01b038516600090815260106020526040908190205490516304c4f0af60e11b81526104499130918891906004016120fb565b6001600160a01b038516600090815260126020526040902054611397906001612180565b6001600160a01b038616600090815260126020526040902055600e546113bf9060019061211f565b600e556005546040516335313c2160e11b81526001600160a01b0387811660048301526000921690636a627842906024016020604051808303816000875af115801561140f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114339190612154565b905080866001600160a01b03167f1b58987b8177e68846274475660e5668f5ba399d643c5bdc4705f2555d7c183f60405160405180910390a3505050505050565b6001600160a01b038116600090815260126020908152604080832054601090925282205482918291116114a85760006114d7565b6001600160a01b0384166000908152601260209081526040808320546010909252909120546114d7919061211f565b6001600160a01b03851660009081526013602090815260408083205460119092529091205411611508576000611537565b6001600160a01b038516600090815260136020908152604080832054601190925290912054611537919061211f565b6001600160a01b03861660009081526014602052604090205460ff1661155e576001611561565b60005b919450925060ff1690509193909250565b61157a611626565b600c8190556040518181527f0d472d8a1df5fe4e86097f8d3729795383ce81fa92b42d41d6f6db9bb2afcbc790602001610829565b6115b7611626565b600180546001600160a01b0383166001600160a01b031990911681179091556115ee6000546001600160a01b036101009091041690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6000546001600160a01b03610100909104163314610dfd5760405163118cdaa760e01b8152336004820152602401610449565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156116b257507f000000000000000000000000000000000000000000000000000000000000000046145b156116dc57507f000000000000000000000000000000000000000000000000000000000000000090565b6109a7604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b834211156117ae5760405163e8024d8960e01b815230600482015260248101859052604401610449565b600087866117d9886001600160a01b0316600090815260046020526040902080546001810190915590565b8760405160200161180c94939291909384526001600160a01b039290921660208401526040830152606082015260800190565b604051602081830303815290604052805190602001209050600061182f8261190b565b9050600061183f82878787611938565b9050886001600160a01b0316816001600160a01b03161461188c57604051631b38591960e11b81523060048201526001600160a01b0380831660248301528a166044820152606401610449565b50505050505050505050565b600180546001600160a01b0319169055610e4081611966565b60606109a77f000000000000000000000000000000000000000000000000000000000000000060026119bf565b60606109a77f000000000000000000000000000000000000000000000000000000000000000060036119bf565b6000610e5d611918611659565b8360405161190160f01b8152600281019290925260228201526042902090565b60008060008061194a88888888611a6b565b92509250925061195a8282611b3a565b50909695505050505050565b600080546001600160a01b03838116610100818102610100600160a81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b606060ff83146119d9576119d283611bf7565b9050610e5d565b8180546119e590612193565b80601f0160208091040260200160405190810160405280929190818152602001828054611a1190612193565b8015611a5e5780601f10611a3357610100808354040283529160200191611a5e565b820191906000526020600020905b815481529060010190602001808311611a4157829003601f168201915b5050505050905092915050565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115611aa65750600091506003905082611b30565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015611afa573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611b2657506000925060019150829050611b30565b9250600091508190505b9450945094915050565b6000826003811115611b4e57611b4e6121cd565b03611b57575050565b6001826003811115611b6b57611b6b6121cd565b03611b895760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115611b9d57611b9d6121cd565b03611bbe5760405163fce698f760e01b815260048101829052602401610449565b6003826003811115611bd257611bd26121cd565b03611bf3576040516335e2f38360e21b815260048101829052602401610449565b5050565b60606000611c0483611c36565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600060ff8216601f811115610e5d57604051632cd44ac360e21b815260040160405180910390fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611c9d57611c9d611c5e565b604052919050565b600067ffffffffffffffff821115611cbf57611cbf611c5e565b5060051b60200190565b80356001600160a01b0381168114611ce057600080fd5b919050565b600082601f830112611cf657600080fd5b81356020611d0b611d0683611ca5565b611c74565b82815260059290921b84018101918181019086841115611d2a57600080fd5b8286015b84811015611d455780358352918301918301611d2e565b509695505050505050565b60008060408385031215611d6357600080fd5b823567ffffffffffffffff80821115611d7b57600080fd5b818501915085601f830112611d8f57600080fd5b81356020611d9f611d0683611ca5565b82815260059290921b84018101918181019089841115611dbe57600080fd5b948201945b83861015611de357611dd486611cc9565b82529482019490820190611dc3565b96505086013592505080821115611df957600080fd5b50611e0685828601611ce5565b9150509250929050565b600060208284031215611e2257600080fd5b611e2b82611cc9565b9392505050565b600060208284031215611e4457600080fd5b5035919050565b60008060008060008060c08789031215611e6457600080fd5b505084359660208601359650604086013595606081013595506080810135945060a0013592509050565b803560ff81168114611ce057600080fd5b60008060008060008060c08789031215611eb857600080fd5b611ec187611cc9565b95506020870135945060408701359350611edd60608801611e8e565b92506080870135915060a087013590509295509295509295565b60006020808385031215611f0a57600080fd5b823567ffffffffffffffff80821115611f2257600080fd5b818501915085601f830112611f3657600080fd5b813581811115611f4857611f48611c5e565b611f5a601f8201601f19168501611c74565b91508082528684828501011115611f7057600080fd5b8084840185840137600090820190930192909252509392505050565b6000815180845260005b81811015611fb257602081850181015186830182015201611f96565b506000602082860101526020601f19601f83011685010191505092915050565b60ff60f81b881681526000602060e081840152611ff260e084018a611f8c565b8381036040850152612004818a611f8c565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b818110156120565783518352928401929184019160010161203a565b50909c9b505050505050505050505050565b600080600080600060a0868803121561208057600080fd5b61208986611cc9565b94506020860135935061209e60408701611e8e565b94979396509394606081013594506080013592915050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016120f4576120f46120cc565b5060010190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b81810381811115610e5d57610e5d6120cc565b60006020828403121561214457600080fd5b81518015158114611e2b57600080fd5b60006020828403121561216657600080fd5b5051919050565b602081526000611e2b6020830184611f8c565b80820180821115610e5d57610e5d6120cc565b600181811c908216806121a757607f821691505b6020821081036121c757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220bc297a5639a197ace5c4259a93963eb1a6a928f2369af73dea86a5d06e10443a64736f6c63430008150033000000000000000000000000e0e126ce63becbecd72bee4f7673b4e50d5a9965000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101c45760003560e01c8063715018a6116100f9578063d26b30b511610097578063e30c397811610071578063e30c39781461039a578063e46f5b25146103ab578063f0cc625b146103be578063f2fde38b146103fd57600080fd5b8063d26b30b514610351578063d4c7fea814610359578063e16f4c911461036c57600080fd5b806384b0196e116100d357806384b0196e146102e6578063853ab251146103015780638da5cb5b1461031457806393a756511461033e57600080fd5b8063715018a6146102c357806379ba5097146102cb5780637ecebe00146102d357600080fd5b80632eab69c11161016657806351cff8d91161014057806351cff8d91461027757806351eb3ac91461028a57806355f804b31461029d5780636a0d2ebf146102b057600080fd5b80632eab69c1146102495780633644e5151461025c57806347a205781461026457600080fd5b80631bc3ed93116101a25780631bc3ed9314610208578063200374ba146102105780632496228b146102235780632d7aa82b1461023657600080fd5b806304d961f6146101c95780630ab8ec87146101de57806310042e10146101f1575b600080fd5b6101dc6101d7366004611d50565b610410565b005b6101dc6101ec366004611d50565b6105bb565b600d545b6040519081526020015b60405180910390f35b600f546101f5565b6101dc61021e366004611e10565b61075c565b6101dc610231366004611e32565b6107f0565b6101dc610244366004611e4b565b610834565b6101dc610257366004611e32565b610960565b6101f561099d565b6101dc610272366004611e9f565b6109ac565b6101dc610285366004611e10565b610c4a565b6101dc610298366004611e32565b610d39565b6101dc6102ab366004611ef7565b610d76565b6101dc6102be366004611e32565b610dae565b6101dc610deb565b6101dc610dff565b6101f56102e1366004611e10565b610e43565b6102ee610e63565b6040516101ff9796959493929190611fd2565b6101dc61030f366004611e9f565b610ea9565b60005461010090046001600160a01b03165b6040516001600160a01b0390911681526020016101ff565b6101dc61034c366004611e32565b6111c0565b600e546101f5565b6101dc610367366004612068565b6111fd565b61037f61037a366004611e10565b611474565b604080519384526020840192909252908201526060016101ff565b6001546001600160a01b0316610326565b6101dc6103b9366004611e32565b611572565b600754600a54600854600b54600954600c54604080519687526020870195909552938501929092526060840152608083015260a082015260c0016101ff565b6101dc61040b366004611e10565b6115af565b610418611626565b805182511461045257815181516040516378d4aff360e01b8152306004820152602481019290925260448201526064015b60405180910390fd5b60005b82518110156105b657818181518110610470576104706120b6565b60200260200101516010600085848151811061048e5761048e6120b6565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000208190555060008282815181106104ce576104ce6120b6565b60200260200101511115610556578281815181106104ee576104ee6120b6565b60200260200101516001600160a01b03167f151a1792460174827cd437b2fcd90608380af06350b816c8f3374b2458b09968838381518110610532576105326120b6565b602002602001015160405161054991815260200190565b60405180910390a26105a6565b828181518110610568576105686120b6565b60200260200101516001600160a01b03167f46d4fb935e7086447c6e4f9222922858280905c4347f05146b6bd15ce65bc2bc60405160405180910390a25b6105af816120e2565b9050610455565b505050565b6105c3611626565b80518251146105f857815181516040516378d4aff360e01b815230600482015260248101929092526044820152606401610449565b60005b82518110156105b657818181518110610616576106166120b6565b602002602001015160116000858481518110610634576106346120b6565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055506000828281518110610674576106746120b6565b602002602001015111156106fc57828181518110610694576106946120b6565b60200260200101516001600160a01b03167fcc92299a7938d3b6c564ca3855565ffa74222a93e07838c7109f81c26fa23c238383815181106106d8576106d86120b6565b60200260200101516040516106ef91815260200190565b60405180910390a261074c565b82818151811061070e5761070e6120b6565b60200260200101516001600160a01b03167f67fd13de8df0a2db287368efb6279b5093a8b664c965dc8c2cae3f896802c01060405160405180910390a25b610755816120e2565b90506105fb565b610764611626565b6001600160a01b03811661078d576040516307fc150360e41b8152306004820152602401610449565b60055460405163f2fde38b60e01b81526001600160a01b0383811660048301529091169063f2fde38b906024015b600060405180830381600087803b1580156107d557600080fd5b505af11580156107e9573d6000803e3d6000fd5b5050505050565b6107f8611626565b60098190556040518181527f7abd1de0f816f14b9a32e2e502285710a5d9d570b5f4b1fd58887e14de50b4b0906020015b60405180910390a150565b61083c611626565b60005460ff16156108625760405163161b906f60e01b8152306004820152602401610449565b6000805460ff191660011781556007879055600a8690556008859055600b8490556009839055600c829055600554604080516379ba509760e01b815290516001600160a01b03909216926379ba50979260048084019382900301818387803b1580156108cd57600080fd5b505af11580156108e1573d6000803e3d6000fd5b5050600554600754600a54600854600b54600954600c54604080519687526020870195909552938501929092526060840152608083015260a08201526001600160a01b0390911692507fbd1add6764702d70588312e4646554ae5c849fe9322f243a0e6e068e9b95b425915060c00160405180910390a2505050505050565b610968611626565b60078190556040518181527fd4031294256e709e3e9fdc8476ee41268f53079fb8df473d2dbaed4af174eb6490602001610829565b60006109a7611659565b905090565b6009544210156109dc57600954604051630875cde560e31b81523060048201526024810191909152604401610449565b600c54421115610a0c57600c54604051631bdf30c360e21b81523060048201526024810191909152604401610449565b600d54600003610a315760405163cb9124f160e01b8152306004820152602401610449565b610a777f52b4e78d922891850994fe8552ca29e7e2a8d82524d2ec129928a640d25bff79610a6d6000546001600160a01b036101009091041690565b8887878787611784565b6001600160a01b03861660009081526014602052604090205460ff1615610ab857308660016040516304c4f0af60e11b8152600401610449939291906120fb565b66b1a2bc2ec50000851015610ae95760405163e956165360e01b815230600482015260248101869052604401610449565b6001600160a01b0386166000908152601460205260409020805460ff19166001908117909155600d54610b1c919061211f565b600d556006546040516323b872dd60e01b81526001600160a01b03909116906323b872dd90610b5390339030908a906004016120fb565b6020604051808303816000875af1158015610b72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b969190612132565b506005546040516335313c2160e11b81526001600160a01b0388811660048301526000921690636a627842906024016020604051808303816000875af1158015610be4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c089190612154565b905080876001600160a01b03167f748a2986091c2034d6e93b6f44f771a79f0e1d6acd8a60c68c17d4e1e2feaed260405160405180910390a350505050505050565b610c52611626565b6006546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a08231906024016020604051808303816000875af1158015610c9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc19190612154565b6006546040516323b872dd60e01b81529192506001600160a01b0316906323b872dd90610cf6903090869086906004016120fb565b6020604051808303816000875af1158015610d15573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b69190612132565b610d41611626565b600a8190556040518181527fd88332c8080f9cfe23f7766181cf113b4597846866d8814094bb6802e64f634190602001610829565b610d7e611626565b6005546040516355f804b360e01b81526001600160a01b03909116906355f804b3906107bb90849060040161216d565b610db6611626565b60088190556040518181527fa2d65690c3d7b7747471f430003bea493ee880dab5f4c0c2bc36d53bd3b0664190602001610829565b610df3611626565b610dfd6000611898565b565b60015433906001600160a01b03168114610e375760405163118cdaa760e01b81526001600160a01b0382166004820152602401610449565b610e4081611898565b50565b6001600160a01b0381166000908152600460205260408120545b92915050565b600060608060008060006060610e776118b1565b610e7f6118de565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b600854421015610ed957600854604051630875cde560e31b81523060048201526024810191909152604401610449565b600b54421115610f0957600b54604051631bdf30c360e21b81523060048201526024810191909152604401610449565b600f54600003610f2e57604051634ed7544360e11b8152306004820152602401610449565b610f6a7fe301559e14964592f8c536a348edd85312641b5f2c77d6174ec9974acc835f9c610a6d6000546001600160a01b036101009091041690565b6001600160a01b0386166000908152601160205260408120549003610fb35760405163deb2dcad60e01b81523060048201526001600160a01b0387166024820152604401610449565b6001600160a01b03861660009081526011602090815260408083205460139092529091205410611015576001600160a01b038616600090815260116020526040908190205490516304c4f0af60e11b81526104499130918991906004016120fb565b66354a6ba7a180008510156110465760405163e956165360e01b815230600482015260248101869052604401610449565b6001600160a01b03861660009081526013602052604090205461106a906001612180565b6001600160a01b038716600090815260136020526040902055600f546110929060019061211f565b600f556006546040516323b872dd60e01b81526001600160a01b03909116906323b872dd906110c990339030908a906004016120fb565b6020604051808303816000875af11580156110e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110c9190612132565b506005546040516335313c2160e11b81526001600160a01b0388811660048301526000921690636a627842906024016020604051808303816000875af115801561115a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117e9190612154565b905080876001600160a01b03167f07079ba8383885d2224e12a080264f20daee8c335e8933982ab3724e81a3522660405160405180910390a350505050505050565b6111c8611626565b600b8190556040518181527f20a0c9277e0162254d5cb83e180ac546fbea08942b908427fd0e347af304776290602001610829565b60075442101561122d57600754604051630875cde560e31b81523060048201526024810191909152604401610449565b600a5442111561125d57600a54604051631bdf30c360e21b81523060048201526024810191909152604401610449565b600e54600003611282576040516324d04f7160e11b8152306004820152602401610449565b6112c87f8ab93fa6e80af50aed9d4f7fd49b35fc7e7807c23cc213163fecd8a9fb6ef2856112be6000546001600160a01b036101009091041690565b8787878787611784565b6001600160a01b038516600090815260106020526040812054900361131157604051634786f5bb60e01b81523060048201526001600160a01b0386166024820152604401610449565b6001600160a01b03851660009081526010602090815260408083205460129092529091205410611373576001600160a01b038516600090815260106020526040908190205490516304c4f0af60e11b81526104499130918891906004016120fb565b6001600160a01b038516600090815260126020526040902054611397906001612180565b6001600160a01b038616600090815260126020526040902055600e546113bf9060019061211f565b600e556005546040516335313c2160e11b81526001600160a01b0387811660048301526000921690636a627842906024016020604051808303816000875af115801561140f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114339190612154565b905080866001600160a01b03167f1b58987b8177e68846274475660e5668f5ba399d643c5bdc4705f2555d7c183f60405160405180910390a3505050505050565b6001600160a01b038116600090815260126020908152604080832054601090925282205482918291116114a85760006114d7565b6001600160a01b0384166000908152601260209081526040808320546010909252909120546114d7919061211f565b6001600160a01b03851660009081526013602090815260408083205460119092529091205411611508576000611537565b6001600160a01b038516600090815260136020908152604080832054601190925290912054611537919061211f565b6001600160a01b03861660009081526014602052604090205460ff1661155e576001611561565b60005b919450925060ff1690509193909250565b61157a611626565b600c8190556040518181527f0d472d8a1df5fe4e86097f8d3729795383ce81fa92b42d41d6f6db9bb2afcbc790602001610829565b6115b7611626565b600180546001600160a01b0383166001600160a01b031990911681179091556115ee6000546001600160a01b036101009091041690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6000546001600160a01b03610100909104163314610dfd5760405163118cdaa760e01b8152336004820152602401610449565b6000306001600160a01b037f000000000000000000000000ff424b641053f55cfb15a9ee066bd593f9aecc9c161480156116b257507f000000000000000000000000000000000000000000000000000000000000000146145b156116dc57507f02ef7aaac2756aef21ed380406e1a887c0664f06d49c829beb9f385e5809910f90565b6109a7604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527fc1f9138c987a97e1975efaab56354b6f853ecb3a90ba42fb4909bfe5f82c9f62918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b834211156117ae5760405163e8024d8960e01b815230600482015260248101859052604401610449565b600087866117d9886001600160a01b0316600090815260046020526040902080546001810190915590565b8760405160200161180c94939291909384526001600160a01b039290921660208401526040830152606082015260800190565b604051602081830303815290604052805190602001209050600061182f8261190b565b9050600061183f82878787611938565b9050886001600160a01b0316816001600160a01b03161461188c57604051631b38591960e11b81523060048201526001600160a01b0380831660248301528a166044820152606401610449565b50505050505050505050565b600180546001600160a01b0319169055610e4081611966565b60606109a77f547275737461204f4720447261676f6e0000000000000000000000000000001060026119bf565b60606109a77f310000000000000000000000000000000000000000000000000000000000000160036119bf565b6000610e5d611918611659565b8360405161190160f01b8152600281019290925260228201526042902090565b60008060008061194a88888888611a6b565b92509250925061195a8282611b3a565b50909695505050505050565b600080546001600160a01b03838116610100818102610100600160a81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b606060ff83146119d9576119d283611bf7565b9050610e5d565b8180546119e590612193565b80601f0160208091040260200160405190810160405280929190818152602001828054611a1190612193565b8015611a5e5780601f10611a3357610100808354040283529160200191611a5e565b820191906000526020600020905b815481529060010190602001808311611a4157829003601f168201915b5050505050905092915050565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115611aa65750600091506003905082611b30565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015611afa573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611b2657506000925060019150829050611b30565b9250600091508190505b9450945094915050565b6000826003811115611b4e57611b4e6121cd565b03611b57575050565b6001826003811115611b6b57611b6b6121cd565b03611b895760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115611b9d57611b9d6121cd565b03611bbe5760405163fce698f760e01b815260048101829052602401610449565b6003826003811115611bd257611bd26121cd565b03611bf3576040516335e2f38360e21b815260048101829052602401610449565b5050565b60606000611c0483611c36565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600060ff8216601f811115610e5d57604051632cd44ac360e21b815260040160405180910390fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611c9d57611c9d611c5e565b604052919050565b600067ffffffffffffffff821115611cbf57611cbf611c5e565b5060051b60200190565b80356001600160a01b0381168114611ce057600080fd5b919050565b600082601f830112611cf657600080fd5b81356020611d0b611d0683611ca5565b611c74565b82815260059290921b84018101918181019086841115611d2a57600080fd5b8286015b84811015611d455780358352918301918301611d2e565b509695505050505050565b60008060408385031215611d6357600080fd5b823567ffffffffffffffff80821115611d7b57600080fd5b818501915085601f830112611d8f57600080fd5b81356020611d9f611d0683611ca5565b82815260059290921b84018101918181019089841115611dbe57600080fd5b948201945b83861015611de357611dd486611cc9565b82529482019490820190611dc3565b96505086013592505080821115611df957600080fd5b50611e0685828601611ce5565b9150509250929050565b600060208284031215611e2257600080fd5b611e2b82611cc9565b9392505050565b600060208284031215611e4457600080fd5b5035919050565b60008060008060008060c08789031215611e6457600080fd5b505084359660208601359650604086013595606081013595506080810135945060a0013592509050565b803560ff81168114611ce057600080fd5b60008060008060008060c08789031215611eb857600080fd5b611ec187611cc9565b95506020870135945060408701359350611edd60608801611e8e565b92506080870135915060a087013590509295509295509295565b60006020808385031215611f0a57600080fd5b823567ffffffffffffffff80821115611f2257600080fd5b818501915085601f830112611f3657600080fd5b813581811115611f4857611f48611c5e565b611f5a601f8201601f19168501611c74565b91508082528684828501011115611f7057600080fd5b8084840185840137600090820190930192909252509392505050565b6000815180845260005b81811015611fb257602081850181015186830182015201611f96565b506000602082860101526020601f19601f83011685010191505092915050565b60ff60f81b881681526000602060e081840152611ff260e084018a611f8c565b8381036040850152612004818a611f8c565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b818110156120565783518352928401929184019160010161203a565b50909c9b505050505050505050505050565b600080600080600060a0868803121561208057600080fd5b61208986611cc9565b94506020860135935061209e60408701611e8e565b94979396509394606081013594506080013592915050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016120f4576120f46120cc565b5060010190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b81810381811115610e5d57610e5d6120cc565b60006020828403121561214457600080fd5b81518015158114611e2b57600080fd5b60006020828403121561216657600080fd5b5051919050565b602081526000611e2b6020830184611f8c565b80820180821115610e5d57610e5d6120cc565b600181811c908216806121a757607f821691505b6020821081036121c757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220bc297a5639a197ace5c4259a93963eb1a6a928f2369af73dea86a5d06e10443a64736f6c63430008150033

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

000000000000000000000000e0e126ce63becbecd72bee4f7673b4e50d5a9965000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

-----Decoded View---------------
Arg [0] : dragonAddress (address): 0xE0e126CE63becbECd72bEE4f7673b4e50D5A9965
Arg [1] : wethAddress (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000e0e126ce63becbecd72bee4f7673b4e50d5a9965
Arg [1] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.