ETH Price: $2,707.93 (-5.13%)

Contract

0x74Fe984Ab121A09B904d152D6c6dF19cF828bAf1
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw216310822025-01-15 16:29:3522 days ago1736958575IN
0x74Fe984A...cF828bAf1
0 ETH0.0015562312.33441251
Withdraw214889232024-12-26 20:07:2342 days ago1735243643IN
0x74Fe984A...cF828bAf1
0 ETH0.000749365.97187506
Withdraw214735412024-12-24 16:32:5944 days ago1735057979IN
0x74Fe984A...cF828bAf1
0 ETH0.0013441210.65327478
Withdraw214044342024-12-15 0:47:3554 days ago1734223655IN
0x74Fe984A...cF828bAf1
0 ETH0.000735326.74179689
Withdraw211704732024-11-12 8:41:3586 days ago1731400895IN
0x74Fe984A...cF828bAf1
0 ETH0.0031649725.22257951
Withdraw211510312024-11-09 15:36:1189 days ago1731166571IN
0x74Fe984A...cF828bAf1
0 ETH0.0022000212.44483684
Withdraw210578442024-10-27 15:25:23102 days ago1730042723IN
0x74Fe984A...cF828bAf1
0 ETH0.000813736.44955015
Withdraw208787682024-10-02 15:39:35127 days ago1727883575IN
0x74Fe984A...cF828bAf1
0 ETH0.0017389914.82819898
Withdraw208453112024-09-27 23:41:11132 days ago1727480471IN
0x74Fe984A...cF828bAf1
0 ETH0.001507529.11474732
Withdraw208000192024-09-21 16:02:59138 days ago1726934579IN
0x74Fe984A...cF828bAf1
0 ETH0.0015791912.51641029
Withdraw207807412024-09-18 23:24:47141 days ago1726701887IN
0x74Fe984A...cF828bAf1
0 ETH0.000205663.81662351
Withdraw207807412024-09-18 23:24:47141 days ago1726701887IN
0x74Fe984A...cF828bAf1
0 ETH0.000486593.85662351
Withdraw207789532024-09-18 17:24:47141 days ago1726680287IN
0x74Fe984A...cF828bAf1
0 ETH0.001381599.6433152
Withdraw206940212024-09-06 20:44:35153 days ago1725655475IN
0x74Fe984A...cF828bAf1
0 ETH0.000742676.8091751
Withdraw206577212024-09-01 19:10:35158 days ago1725217835IN
0x74Fe984A...cF828bAf1
0 ETH0.000259692.05830812
Withdraw205790732024-08-21 19:26:23169 days ago1724268383IN
0x74Fe984A...cF828bAf1
0 ETH0.000215931.97982164
Withdraw205401642024-08-16 9:01:47174 days ago1723798907IN
0x74Fe984A...cF828bAf1
0 ETH0.000397723.39133767
Withdraw204715812024-08-06 19:21:11184 days ago1722972071IN
0x74Fe984A...cF828bAf1
0 ETH0.000335063.0720014
Withdraw204289722024-07-31 20:38:47190 days ago1722458327IN
0x74Fe984A...cF828bAf1
0 ETH0.0021311512.27624042
Withdraw203568082024-07-21 18:49:35200 days ago1721587775IN
0x74Fe984A...cF828bAf1
0 ETH0.0025825520.46885313
Withdraw201562312024-06-23 18:38:47228 days ago1719167927IN
0x74Fe984A...cF828bAf1
0 ETH0.000350032.77427848
Withdraw201163922024-06-18 4:53:23234 days ago1718686403IN
0x74Fe984A...cF828bAf1
0 ETH0.00078575.51056946
Withdraw200812922024-06-13 7:03:59238 days ago1718262239IN
0x74Fe984A...cF828bAf1
0 ETH0.0016859514.37592807
Withdraw199265362024-05-22 16:12:59260 days ago1716394379IN
0x74Fe984A...cF828bAf1
0 ETH0.0022869418.12586272
Withdraw198682692024-05-14 12:33:35268 days ago1715690015IN
0x74Fe984A...cF828bAf1
0 ETH0.0012247110.01401591
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:
Presale

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 1337 runs

Other Settings:
default evmVersion
File 1 of 17 : Presale.sol
// SPDX-License-Identifier: UNLICENCED
pragma solidity 0.8.11;

import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";

import "./JoyToken.sol";
import "./xJoyToken.sol";
import "./interfaces/IUSDT.sol";

import "./interfaces/IUniswapV2Pair.sol";
import "./libraries/UniswapV2Library.sol";

error SALE_NOT_LIVE();
error STILL_VESTING();
error WRONG_VESTING_TYPE();
error NOTHING_TO_WITHDRAW();
error COINS_NOT_SET();
error ONLY_OWNER();
error WRONG_ADDRESS();
error PAIR_NOT_SET();
error MIN_ONE_CENT();

contract Presale is AccessControl {
    /**
     * VESTING TYPES
     * Initialy there will be 5 vesting levels defined by the constructor
     * 0 - SEED
     * 1 - PRESALE
     * 2 - TEAM
     * 3 - PARTNERS
     * 4 - STAR
     *
     * It's not becoming an enum to allow users to set different vesting  level after the release
     */

    struct VestingInfo {
        uint256 releasePercentBasisPoints; // Release percent basis points (1% = 100, 100% = 10000)
        uint256 cliff; // Cliff for release start time
        uint256 releaseStep; // How often percent step is applied
        uint256 vestingCloseTimeline; // How much time has to pass to finish vesting
    }

    struct DepositInfo {
        uint256 vestingType; // Tier of the type of vesting
        uint256 depositedAmount; // How many Coins amount the user has deposited.
        uint256 purchasedAmount; // How many JOY tokens the user has purchased.
        uint256 depositTime; // Deposited time
    }

    struct PurchaserInfo {
        uint256 firstDepositTime; // When user made his first deposit
        uint256 firstUnlockTime; // Timestamp when unlock will start
        uint256 vestingTimeFinish; // Timestamp when vesting for the purchaser will be closed
        uint256 withdrawnAmount; // Amount of JOY tokens already withdrawn by the purchaser
        DepositInfo[] deposits; // List of all deposits of the purchaser
    }

    JoyToken public joyToken;
    XJoyToken public xJoyToken;

    VestingInfo[] public vestingList;
    uint256 public currentVestingType;
    uint256 public totalPurchasers;
    address public treasuryAddress;
    address public USDC_Address = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
    address public USDT_Address = 0xdAC17F958D2ee523a2206206994597C13D831ec7;
    address public owner;
    bool public sale;

    mapping(uint256 => address) public purchaserAddress;
    mapping(address => PurchaserInfo) public purchaserList;

    event TokensPurchased(address indexed purchaser, uint256 coinAmount, uint256 tokenAmount);
    event TokensWithdrawn(address indexed purchaser, uint256 tokenAmount);
    event VestingTypeAdded(uint256 indexed level);
    event VestingTypeChanged(uint256 indexed level);

    modifier onSale() {
        if (!sale) revert SALE_NOT_LIVE();
        _;
    }

    modifier notVested(address userAddr) {
        if (!checkVestingPeriod(userAddr)) revert STILL_VESTING();
        _;
    }

    modifier onlyAdmin() {
        _checkRole(DEFAULT_ADMIN_ROLE);
        _;
    }

    modifier onlyOwner() {
        if (owner != _msgSender()) revert ONLY_OWNER();
        _;
    }

    constructor(
        JoyToken _joyToken,
        XJoyToken _xJoyToken,
        VestingInfo[] memory _vestingInfo,
        uint256 _initialVestingType,
        address _treasuryAddress
    ) {
        joyToken = _joyToken;
        xJoyToken = _xJoyToken;
        treasuryAddress = _treasuryAddress;
        owner = msg.sender;
        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
        for (uint256 i; i < _vestingInfo.length;) {
            vestingList.push(_vestingInfo[i]);
            unchecked {
                i++;
            }
        }

        currentVestingType = _initialVestingType;
        startSale(false);
    }

    /**
     * Adding new admin to the contract
     * @param _admin - New admin to be added to administrator list
     */
    function addAdmin(address _admin) external onlyAdmin {
        _grantRole(DEFAULT_ADMIN_ROLE, _admin);
    }

    /**
     * Removing admin from token administrators list
     * @param _admin - Admin to be removed from admin list
     */
    function removeAdmin(address _admin) external onlyAdmin {
        if (_admin == owner) revert ONLY_OWNER();
        _revokeRole(DEFAULT_ADMIN_ROLE, _admin);
    }

    /**
     * Team Multisig Safe Vault
     * @param _newOwner - Contract owner address
     */
    function changeOwnership(address _newOwner) public onlyOwner {
        if (owner == _newOwner || _newOwner == address(0)) revert WRONG_ADDRESS();
        _revokeRole(DEFAULT_ADMIN_ROLE, owner);
        owner = _newOwner;
        _grantRole(DEFAULT_ADMIN_ROLE, _newOwner);
    }

    /**
     * Update Treasury
     * @param _treasuryAddress - New treasury multisig
     */
    function updateTreasury(address _treasuryAddress) public onlyOwner {
        treasuryAddress = _treasuryAddress;
    }

    /**
     * Start (or stop) the sale from happening
     * @param _start - Flag if sale should be started.
     */
    function startSale(bool _start) public onlyAdmin {
        sale = _start;
    }

    /**
     * Checks if given address has finished vesting.
     * @param _address - Address of the account being checked
     * @return True if given address is still locked. False otherwise.
     */
    function isLocked(address _address) public view returns (bool) {
        return block.timestamp < purchaserList[_address].vestingTimeFinish;
    }

    /**
     * Checks if given address is still being vested.
     * @param _address - Address of the account being checked.
     * @return True if given account is being vested anymore. False otherwise.
     */
    function checkVestingPeriod(address _address) public view returns (bool) {
        return block.timestamp > purchaserList[_address].firstUnlockTime;
    }

    /**
     * Adding new vesting type for vesting list.
     *
     * @param _vestingType - Struct defining new vesting level
     */

    function addVestingType(VestingInfo memory _vestingType) external onlyAdmin {
        uint256 index = vestingList.length;

        vestingList.push(_vestingType);

        emit VestingTypeAdded(index);
    }

    /**
     * Change vesting type.
     *
     * Switching vesting type to new level.
     * ATTENTION!: Vesting type can be only moved FORWARD so no going back to previous vestings
     *
     * @param _vestingType - Index of vesting to be switched to
     */
    function switchVesting(uint256 _vestingType) external onlyAdmin {
        if (_vestingType >= vestingList.length || _vestingType <= currentVestingType) {
            revert WRONG_VESTING_TYPE();
        }

        currentVestingType = _vestingType;
        emit VestingTypeChanged(_vestingType);
    }

    /**
     * Sets purchase and vesting information of given purchaser.
     *
     * Addresses added to this list will be blacklisted from moving XJoy tokens.
     * This is done to block trading these and use them only as a vesting token to retrieve Joy tokens after vesting period.
     * This contract will be listed as whitelisted contract to move tokens back at the end of the vesting season.
     * @param _addr - Address matched to information being set
     * @param _vestingIndex - Index of a vested address
     * @param _depositedTime - Timestamp of the deposit
     * @param _purchasedAmount - Amount of tokens purchased
     * @param _withdrawnAmount - Amount of tokens already withdrawn by the user
     */
    function addPurchase(
        address _addr,
        uint256 _vestingIndex,
        uint256 _depositedTime,
        uint256 _depositedAmount,
        uint256 _purchasedAmount,
        uint256 _withdrawnAmount
    ) external onlyAdmin {
        internalAddPurchase(_addr, _vestingIndex, _depositedTime, _depositedAmount, _purchasedAmount, _withdrawnAmount);
    }

    /**
     * Deliver vested tokens to list of users
     * @param _purchaserAddress - Addresses that should be vested
     * @param _purchaserList  - List of purchasers
     * @param _transferToken - Should addresses receive tokens on top of being marked as vested
     */
    function addPurchasers(address[] memory _purchaserAddress, DepositInfo[] memory _purchaserList, bool _transferToken)
        public
        onlyAdmin
    {
        for (uint256 i; i < _purchaserAddress.length;) {
            addPurchaser(
                _purchaserAddress[i],
                _purchaserList[i].vestingType,
                _purchaserList[i].depositTime,
                _purchaserList[i].depositedAmount,
                _purchaserList[i].purchasedAmount,
                _transferToken
            );
            unchecked {
                i++;
            }
        }
    }

    /**
     * Add purchaser vesting schedule
     * @param _purchaserAddr - Address of the user to be vested
     * @param _vestingIndex - Index of the vested user
     * @param _depositedTime - Time of the deposit
     * @param _depositedAmount - Amount of the deposit
     * @param _purchasedAmount - Amount of tokens purchased
     * @param _transferToken - Should tokens be transfered
     */
    function addPurchaser(
        address _purchaserAddr,
        uint256 _vestingIndex,
        uint256 _depositedTime,
        uint256 _depositedAmount,
        uint256 _purchasedAmount,
        bool _transferToken
    ) public onlyAdmin {
        internalAddPurchase(_purchaserAddr, _vestingIndex, _depositedTime, _depositedAmount, _purchasedAmount, 0);
        if (_transferToken) {
            xJoyToken.transfer(_purchaserAddr, _purchasedAmount);
        }
    }

    /**
     * Lists all deposit history for given user
     * @param _address - purchaser to get deposit history of
     * @return An array of all deposit structures for given purchaser
     */
    function depositHistory(address _address) external view returns (DepositInfo[] memory) {
        return purchaserList[_address].deposits;
    }

    /**
     * Depositing a coin for xJoy token.
     * @param _coinAmount - Amount of tokens being deposited
     * @param _coinIndex  - Index of the coin in contracts list
     */
    function deposit(uint256 _coinAmount, uint256 _coinIndex) external onSale {
        internalDeposit(_msgSender(), _coinAmount, _coinIndex, currentVestingType, block.timestamp);
    }

    /**
     * Withdrawing Joy tokens after vesting.
     * Amounts are automatically calculated based on current vesting plan and time.
     */
    function withdraw() external notVested(_msgSender()) {
        uint256 withdrawalAmount = calcWithdrawalAmount(_msgSender());
        uint256 xJoyTokenAmount = xJoyToken.balanceOf(address(_msgSender()));
        uint256 withdrawAmount = withdrawalAmount;

        if (withdrawAmount > xJoyTokenAmount) {
            withdrawAmount = xJoyTokenAmount;
        }

        if (withdrawAmount <= 0) revert NOTHING_TO_WITHDRAW();

        xJoyToken.transferFrom(_msgSender(), address(this), withdrawAmount);
        joyToken.transfer(_msgSender(), withdrawAmount);

        purchaserList[_msgSender()].withdrawnAmount += withdrawAmount;

        emit TokensWithdrawn(_msgSender(), withdrawAmount);
    }

    /**
     * Checks withdrawal limit for the address
     * @param _userAddr - Address that is checked for current limit
     * @return The amount of tokens address can currently withdraw
     */
    function calcWithdrawalAmount(address _userAddr) public view returns (uint256) {
        PurchaserInfo storage purchaserInfo = purchaserList[_userAddr];

        uint256 allowedAmount = 0;
        for (uint256 i = 0; i < purchaserInfo.deposits.length;) {
            DepositInfo storage theDeposit = purchaserInfo.deposits[i];
            VestingInfo storage vesting = vestingList[theDeposit.vestingType];
            uint256 cliff = theDeposit.depositTime + vesting.cliff;
            if (block.timestamp > cliff) {
                if (block.timestamp > cliff + vesting.vestingCloseTimeline) {
                    allowedAmount += theDeposit.purchasedAmount;
                } else {
                    uint256 stepSize = (theDeposit.purchasedAmount * vesting.releasePercentBasisPoints) / 100000;
                    uint256 stepsElapsed = (block.timestamp - cliff) / vesting.releaseStep + 1;
                    uint256 value = stepsElapsed * stepSize;
                    if (value > theDeposit.purchasedAmount) {
                        value = theDeposit.purchasedAmount;
                    }
                    allowedAmount += value;
                }
            }
            unchecked {
                i++;
            }
        }

        return allowedAmount - purchaserInfo.withdrawnAmount;
    }

    /**
     * Withdraws all coins transfered as deposits to owner.
     * @param _treasury - Treasury address to move all coins to.
     */
    function withdrawAllCoins(address _treasury) public onlyOwner {
        IERC20Metadata USDC = IERC20Metadata(USDC_Address);
        IUSDT USDT = IUSDT(USDT_Address);
        uint256 usdcAmount = USDC.balanceOf(address(this));
        uint256 usdtAmount = USDT.balanceOf(address(this));
        if (usdcAmount > 0) USDC.transfer(_treasury, usdcAmount);
        if (usdtAmount > 0) USDT.transfer(_treasury, usdtAmount);
    }

    /**
     * Withdraws all XJoy tokens to owner.
     * @param _treasury - Treasury address that should receive all xJoy tokens.
     */
    function withdrawAllxJoyTokens(address _treasury) public onlyOwner {
        uint256 tokenAmount = xJoyToken.balanceOf(address(this));
        xJoyToken.transfer(_treasury, tokenAmount);
    }

    /**
     * Withdraws all Joy tokens to owner.
     * @param _treasury - Treasury address that should receive all Joy tokens.
     */
    function withdrawAllJoyTokens(address _treasury) public onlyOwner {
        uint256 tokenAmount = joyToken.balanceOf(address(this));
        joyToken.transfer(_treasury, tokenAmount);
    }

    /**
     * Performs real deposit in the contract.
     * @param _address - An address of the depositor
     * @param _coinAmount - Amount of coins being deposited
     * @param _coinIndex - Index of the coin being deposited
     * @param _vestingIndex - Index of the vesting
     * @param _depositTime - Time when deposit took place
     */
    function internalDeposit(
        address _address,
        uint256 _coinAmount,
        uint256 _coinIndex,
        uint256 _vestingIndex,
        uint256 _depositTime
    ) internal {
        if (_vestingIndex >= vestingList.length) {
            revert WRONG_VESTING_TYPE();
        }
        if (_coinIndex > 1) revert COINS_NOT_SET();

        if (_coinIndex == 0) {
            IERC20Metadata USDC = IERC20Metadata(USDC_Address);
            USDC.transferFrom(_address, treasuryAddress, _coinAmount);
        } else if (_coinIndex == 1) {
            IUSDT USDT = IUSDT(USDT_Address);
            USDT.transferFrom(_address, treasuryAddress, _coinAmount);
        }

        uint256 joyAmountStar = pairInfo(_coinAmount);
        xJoyToken.transfer(_address, joyAmountStar);

        internalAddPurchase(_address, _vestingIndex, _depositTime, _coinAmount, joyAmountStar, 0);
        emit TokensPurchased(_address, _coinAmount, joyAmountStar);
    }

    function internalAddPurchase(
        address _addr,
        uint256 _vestingIndex,
        uint256 _depositedTime,
        uint256 _depositedAmount,
        uint256 _purchasedAmount,
        uint256 _withdrawnAmount
    ) internal {
        if (_vestingIndex >= vestingList.length) {
            revert WRONG_VESTING_TYPE();
        }
        PurchaserInfo storage purchaserInfo = purchaserList[_addr];
        if (purchaserInfo.firstDepositTime == 0) {
            purchaserInfo.firstDepositTime = _depositedTime;
            purchaserAddress[totalPurchasers] = _addr;
            totalPurchasers += 1;
            xJoyToken.addToBlacklist(_addr);
        }

        // Get information about this vesting type
        VestingInfo storage vInfo = vestingList[uint256(_vestingIndex)];

        // calculate when vesting will finish
        uint256 vestingFinish = _depositedTime + vInfo.cliff + vInfo.vestingCloseTimeline;
        if (purchaserInfo.vestingTimeFinish < vestingFinish) {
            purchaserInfo.vestingTimeFinish = vestingFinish;
        }

        // Calculate new vestings cliff date
        uint256 unlockTime = _depositedTime + vInfo.cliff;
        if (purchaserInfo.firstUnlockTime > unlockTime || purchaserInfo.firstUnlockTime == 0) {
            purchaserInfo.firstUnlockTime = unlockTime;
        }

        // Update global amount of withdrawn amount by purchaser
        purchaserInfo.withdrawnAmount += _withdrawnAmount;

        // Last but not least - we need to add history of purchase
        purchaserInfo.deposits.push(DepositInfo(_vestingIndex, _depositedAmount, _purchasedAmount, _depositedTime));
    }

    function pairInfo(uint256 _joyAmount) public view returns (uint256 joyAmountStar) {
        if (_joyAmount < 1e4) revert MIN_ONE_CENT();
        address FACTORY_ADDRESS = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;
        IUniswapV2Pair pair = IUniswapV2Pair(UniswapV2Library.pairFor(FACTORY_ADDRESS, address(joyToken), USDC_Address));
        if (address(pair) == address(0)) revert PAIR_NOT_SET();
        (uint256 reserves0, uint256 reserves1,) = pair.getReserves();
        (uint256 reserveA, uint256 reserveB) =
            USDC_Address == pair.token0() ? (reserves1, reserves0) : (reserves0, reserves1);
        uint256 numerator = 1e6 * reserveA; // Joy Reserve
        uint256 denominator = reserveB; // USDC Reserve
        uint256 amountOutCents = (numerator / denominator) / 1e2; // 1 cent of USDC
        uint256 joyAmountInJoy = _joyAmount / 1e4; // 1 cent of JOY
        uint256 joyAmountInCalcInCents = joyAmountInJoy * amountOutCents; // Total Joy in cents
        joyAmountStar = joyAmountInCalcInCents + ((joyAmountInCalcInCents / 100) * 55); // 55% Discount
    }
}

File 2 of 17 : JoyToken.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.11;

import "./extensions/SecureToken.sol";

error DISABLED();
error ALLOWED_WHITELISTED_FROM();
error ALLOWED_WHITELISTED_TO(); 
error SWAP_IS_COOLING_DOWN();

contract JoyToken is SecureToken {

    enum TransferMode {
        DISABLED,
        ALLOWED_ALL,
        ALLOWED_WHITELISTED_FROM,
        ALLOWED_WHITELISTED_TO,
        ALLOWED_WHITELISTED_FROM_TO
    }

    TransferMode public transferMode;
    
    mapping (address => uint256) private swapBlock;

    bool public swapGuarded;

    /**
      * Joy Token constructor
      * @param _whitelist - Initial list of whitelisted receivers
      * @param _blacklist - Initial list of blacklisted addresses
      * @param _admins - Initial list of all administrators of the token
      */
    constructor(
        address[] memory _whitelist, 
        address[] memory _blacklist, 
        address[] memory _admins
    )
        SecureToken(_whitelist, _blacklist, _admins, "Joystick", "JOY") 
    {
            transferMode = TransferMode.ALLOWED_ALL;
    }

    /**
      * Setting new transfer mode for the token
      * @param _mode - New transfer mode to be set
      */
    function setTransferMode(TransferMode _mode) public onlyAdmin {
        transferMode = _mode;
    }

    /**
      * Checking transfer status
      * @param from - Transfer sender
      * @param to - Transfer recipient
      */
    function _checkTransferStatus(address from, address to) private view {
        if(transferMode == TransferMode.DISABLED) revert DISABLED();
        
        if(transferMode == TransferMode.ALLOWED_WHITELISTED_FROM_TO) {
            if(blacklisted[from] || !whitelisted[from]) revert ALLOWED_WHITELISTED_FROM(); 
            if(blacklisted[to] || !whitelisted[to]) revert ALLOWED_WHITELISTED_TO();
            return;
        }

        if(transferMode == TransferMode.ALLOWED_WHITELISTED_FROM) {
            if(blacklisted[from] || !whitelisted[from]) revert ALLOWED_WHITELISTED_FROM(); 
            return;
        }

        if (transferMode == TransferMode.ALLOWED_WHITELISTED_TO) {
            if(blacklisted[to] || !whitelisted[to]) revert ALLOWED_WHITELISTED_TO();
            return;
        }
    }

    /**
      * Prevent MEV Bots from doing Sandwich Attacks and Arbitrage
      * Enforces a single JOY Transfer per transaction
      * @param _swapGuardStatus - True or false
      */
    function setProtectedSwaps(bool _swapGuardStatus) external onlyOwner {
        swapGuarded = _swapGuardStatus;
    }

    /**
      * Enforces atleast 1 block gap for swaps and transfers
      * This prevents MEV Bots (Maximal Extractable Value)
      * @param from - Address of sender
      * @param to - Address of recipient
      */
    function _checkSwapCooldown(address from, address to) private {
        if(swapGuarded) {
            if(swapBlock[from] == block.number) revert SWAP_IS_COOLING_DOWN();
            swapBlock[to] = block.number;
        }
    }

    function _beforeTokenTransfer(address from, address to, uint256) override internal virtual {
        _checkTransferStatus(from, to);
        _checkSwapCooldown(from, to);
    }
}

File 3 of 17 : xJoyToken.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.11;

import "./extensions/SecureToken.sol";

contract XJoyToken is SecureToken {
    /**
     * Flag indicating if contract is guarding transfers from blacklisted sources and sniper attacks
     */
    bool public guarding;

    event Guarding(bool _status);

    /**
     * Tokens constructor
     *
     * @param _whitelist - Initial list of whitelisted receivers
     * @param _blacklist - Initial list of blacklisted addresses
     * @param _admins - Initial list of all administrators of the token
     * @param _guarding - If SecureToken is guarding the transfers from the constructor moment
     */
    constructor(
        address[] memory _whitelist,
        address[] memory _blacklist,
        address[] memory _admins,
        bool _guarding,
        uint256 _initialSupply
    )
        SecureToken(
            _whitelist,
            _blacklist,
            _admins,
            "xJOY Token",
            "xJOY"
        )
    {
        guarding = _guarding;
        mint(_msgSender(), _initialSupply);
    }

    /**
     * Turning on or off guarding mechanism of the contract
     *
     * @param _guard - Flag if guarding mechanism should be turned on or off
     */
    function setGuard(bool _guard) external onlyAdmin {
        if (guarding != _guard) {
            guarding = _guard;
            emit Guarding(_guard);
        }
    }

    function _beforeTokenTransfer(
        address from,
        address to,
        uint256
    ) internal virtual override {
        if (guarding) {
            require(!blacklisted[from] || whitelisted[to], "SecureToken: This address is forbidden from making any transfers");
        }
    }
    
}

File 4 of 17 : IUniswapV2Pair.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

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

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

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

    function decimals() external pure returns (uint8);

    function totalSupply() external view returns (uint256);

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

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

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

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

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

    function DOMAIN_SEPARATOR() external view returns (bytes32);

    function PERMIT_TYPEHASH() external pure returns (bytes32);

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

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

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

    function MINIMUM_LIQUIDITY() external pure returns (uint256);

    function factory() external view returns (address);

    function token0() external view returns (address);

    function token1() external view returns (address);

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

    function price0CumulativeLast() external view returns (uint256);

    function price1CumulativeLast() external view returns (uint256);

    function kLast() external view returns (uint256);

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

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

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

    function skim(address to) external;

    function sync() external;

    function initialize(address, address) external;
}

File 5 of 17 : IUSDT.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;

interface IUSDT {
    function balanceOf(address account) external view returns (uint256);
    function transfer(address to, uint256 amount) external;
    function approve(address spender, uint value) external;
    function transferFrom(address from, address to, uint value) external;
    function allowance(address owner, address spender) external view returns (uint);
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);
}

File 6 of 17 : UniswapV2Library.sol
// SPDX-License-Identifier: UNLICENCED
pragma solidity =0.8.11;

import '../interfaces/IUniswapV2Pair.sol';

library UniswapV2Library {
    // returns sorted token addresses, used to handle return values from pairs sorted in this order
    function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
        require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES');
        (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
        require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS');
    }

    // calculates the CREATE2 address for a pair without making any external calls
    function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
        (address token0, address token1) = sortTokens(tokenA, tokenB);
        bytes32 tmp = keccak256(abi.encodePacked(
                hex'ff',
                factory,
                keccak256(abi.encodePacked(token0, token1)),
                hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
            ));
        pair = address(uint160(uint256(tmp)));
    }

    // fetches and sorts the reserves for a pair
    function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
        (address token0,) = sortTokens(tokenA, tokenB);
        (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
        (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
    }

    // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
    function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
        require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT');
        require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
        amountB = (amountA * reserveB) / reserveA;
    }

    // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
        require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT');
        require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
        uint amountInWithFee = amountIn * 997;
        uint numerator = amountInWithFee * reserveOut;
        uint denominator = (reserveIn * 1000) + amountInWithFee;
        amountOut = numerator / denominator;
    }

    // given an output amount of an asset and pair reserves, returns a required input amount of the other asset
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) {
        require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT');
        require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
        uint numerator = (reserveIn * amountOut) * 1000;
        uint denominator = (reserveOut -amountOut) * 997;
        amountIn = (numerator / denominator) + 1;
    }

    // performs chained getAmountOut calculations on any number of pairs
    function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
        require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
        amounts = new uint[](path.length);
        amounts[0] = amountIn;
        for (uint i; i < path.length - 1; i++) {
            (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]);
            amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
        }
    }

    // performs chained getAmountIn calculations on any number of pairs
    function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) {
        require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
        amounts = new uint[](path.length);
        amounts[amounts.length - 1] = amountOut;
        for (uint i = path.length - 1; i > 0; i--) {
            (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]);
            amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
        }
    }
}

File 7 of 17 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

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

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

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

pragma solidity ^0.8.0;

import "../IERC20.sol";

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

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

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

File 9 of 17 : SecureToken.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.11;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

error NOT_AUTHORIZED();
error MAX_TOTAL_SUPPLY();

contract SecureToken is AccessControl, ERC20, Ownable {
    /**
     * Maximum totalSupply 
     */
    uint256 public maxTotalSupply;

    /**
     * A map of all blacklisted addresses
     */
    mapping(address => bool) public blacklisted;

    /**
     * A map of whitelisted receivers.
     */
    mapping(address => bool) public whitelisted;

    event WhitelistedMany(address[] _users);
    event Whitelisted(address _user);
    event RemovedFromWhitelist(address _user);

    event BlacklistedMany(address[] _users);
    event Blacklisted(address _user);
    event RemovedFromBlacklist(address _user);

    modifier onlyAdmin() {
        _checkRole(DEFAULT_ADMIN_ROLE);
        _;
    }

    /**
     * Constructor of SecureToken contract
     * @param _whitelist - List of addresses to be whitelisted as always allowed token transfering
     * @param _blacklist  - Initial blacklisted addresses to forbid any token transfers
     * @param _admins    - List of administrators that can change this contract settings
     */
    constructor(
        address[] memory _whitelist,
        address[] memory _blacklist,
        address[] memory _admins,
        string memory _name,
        string memory _symbol
    ) ERC20(_name, _symbol) {
        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);

        maxTotalSupply = 5000000000 * 1e18; // 5B Joy & xJoy

        if (_admins.length > 0) {
            for (uint i; i < _admins.length; ) {
                _grantRole(DEFAULT_ADMIN_ROLE, _admins[i]);
                unchecked { i++; }
            }
        }

        if (_whitelist.length > 0) {
            addManyToWhitelist(_whitelist);
        }
        if (_blacklist.length > 0) {
            addManyToBlacklist(_blacklist);
        }
    }

    /**
     * Adding new admin to the contract
     * @param _admin - New admin to be added to administrator list
     */
    function addAdmin(address _admin) external onlyAdmin {
        _grantRole(DEFAULT_ADMIN_ROLE, _admin);
    }

    /**
     * Removing admin from token administrators list
     * @param _admin - Admin to be removed from admin list
     */
    function removeAdmin(address _admin) external onlyAdmin {
        if (_admin == owner()) revert NOT_AUTHORIZED();
        _revokeRole(DEFAULT_ADMIN_ROLE, _admin);
    }
    
    /**
     * Minting tokens for many addressess
     * @param _addrs - Address to mint new tokens to
     * @param _amounts - Amount new tokens to be minted
     */
    function mintMany(address[] memory _addrs, uint256[] memory _amounts) external onlyOwner {
        uint256 totalMinted;
        for (uint i=0; i<_addrs.length; i++) {
            _mint(_addrs[i], _amounts[i]);
            totalMinted += _amounts[i];
        }
        if(totalSupply() > maxTotalSupply) revert MAX_TOTAL_SUPPLY();
    }

    /**
     * Minting new tokens
     * @param _to - Address to mint new tokens to
     * @param _amount - Amount new tokens to be minted
     */
    function mint(address _to, uint256 _amount) public onlyOwner {
        if(totalSupply() + _amount > maxTotalSupply) revert MAX_TOTAL_SUPPLY();
        _mint(_to, _amount);
    }

    /**
     * Burning existing tokens
     * @param _from - Address to burn tokens from
     * @param _amount - Amount of tokens to be burned
     */
    function burn(address _from, uint256 _amount) public onlyOwner {
        _burn(_from, _amount);
    }

    /**
     * Adding new address to the blacklist
     * @param _blacklisted - New address to be added to the blacklist
     */
    function addToBlacklist(address _blacklisted) public onlyAdmin {
        blacklisted[_blacklisted] = true;
        emit Blacklisted(_blacklisted);
    }

    /**
     * Adding many addresses to the blacklist
     * @param _blacklisted - An array of addresses to be added to the blacklist
     */
    function addManyToBlacklist(address[] memory _blacklisted) public onlyAdmin {
        for (uint i; i < _blacklisted.length; ) {
            blacklisted[_blacklisted[i]] = true;
            unchecked { i++; }
        }
        emit BlacklistedMany(_blacklisted);
    }

    /**
     * Removing address from the blacklist
     * @param _address - Address to be removed from the blacklist
     */
    function removeFromBlacklist(address _address) public onlyAdmin {
        blacklisted[_address] = false;
        emit RemovedFromBlacklist(_address);
    }

    /**
     * Adding an address to contracts whitelist
     * @param _whitelisted - Address to be added to the whitelist
     */
    function addToWhitelist(address _whitelisted) public onlyAdmin {
        whitelisted[_whitelisted] = true;
        emit Whitelisted(_whitelisted);
    }

    /**
     * Adding many addresses to the whitelist
     * @param _whitelisted - An array of addresses to be added to the whitelist
     */
    function addManyToWhitelist(address[] memory _whitelisted) public onlyAdmin {
        for (uint i; i < _whitelisted.length; ) {
            whitelisted[_whitelisted[i]] = true;
            unchecked { i++; }
        }
        emit WhitelistedMany(_whitelisted);
    }

    /**
     * Removing an address from the whitelist
     * @param _address - Address to be removed from the whitelist
     */
    function removeFromWhitelist(address _address) public onlyAdmin {
        whitelisted[_address] = false;
        emit RemovedFromWhitelist(_address);
    }

}

File 10 of 17 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

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

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
        }
        _balances[to] += amount;

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

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

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

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

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

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 11 of 17 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

File 13 of 17 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 14 of 17 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 15 of 17 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract JoyToken","name":"_joyToken","type":"address"},{"internalType":"contract XJoyToken","name":"_xJoyToken","type":"address"},{"components":[{"internalType":"uint256","name":"releasePercentBasisPoints","type":"uint256"},{"internalType":"uint256","name":"cliff","type":"uint256"},{"internalType":"uint256","name":"releaseStep","type":"uint256"},{"internalType":"uint256","name":"vestingCloseTimeline","type":"uint256"}],"internalType":"struct Presale.VestingInfo[]","name":"_vestingInfo","type":"tuple[]"},{"internalType":"uint256","name":"_initialVestingType","type":"uint256"},{"internalType":"address","name":"_treasuryAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"COINS_NOT_SET","type":"error"},{"inputs":[],"name":"MIN_ONE_CENT","type":"error"},{"inputs":[],"name":"NOTHING_TO_WITHDRAW","type":"error"},{"inputs":[],"name":"ONLY_OWNER","type":"error"},{"inputs":[],"name":"PAIR_NOT_SET","type":"error"},{"inputs":[],"name":"SALE_NOT_LIVE","type":"error"},{"inputs":[],"name":"STILL_VESTING","type":"error"},{"inputs":[],"name":"WRONG_ADDRESS","type":"error"},{"inputs":[],"name":"WRONG_VESTING_TYPE","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"purchaser","type":"address"},{"indexed":false,"internalType":"uint256","name":"coinAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"TokensPurchased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"purchaser","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"TokensWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"level","type":"uint256"}],"name":"VestingTypeAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"level","type":"uint256"}],"name":"VestingTypeChanged","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDC_Address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDT_Address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"name":"addAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"},{"internalType":"uint256","name":"_vestingIndex","type":"uint256"},{"internalType":"uint256","name":"_depositedTime","type":"uint256"},{"internalType":"uint256","name":"_depositedAmount","type":"uint256"},{"internalType":"uint256","name":"_purchasedAmount","type":"uint256"},{"internalType":"uint256","name":"_withdrawnAmount","type":"uint256"}],"name":"addPurchase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_purchaserAddr","type":"address"},{"internalType":"uint256","name":"_vestingIndex","type":"uint256"},{"internalType":"uint256","name":"_depositedTime","type":"uint256"},{"internalType":"uint256","name":"_depositedAmount","type":"uint256"},{"internalType":"uint256","name":"_purchasedAmount","type":"uint256"},{"internalType":"bool","name":"_transferToken","type":"bool"}],"name":"addPurchaser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_purchaserAddress","type":"address[]"},{"components":[{"internalType":"uint256","name":"vestingType","type":"uint256"},{"internalType":"uint256","name":"depositedAmount","type":"uint256"},{"internalType":"uint256","name":"purchasedAmount","type":"uint256"},{"internalType":"uint256","name":"depositTime","type":"uint256"}],"internalType":"struct Presale.DepositInfo[]","name":"_purchaserList","type":"tuple[]"},{"internalType":"bool","name":"_transferToken","type":"bool"}],"name":"addPurchasers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"releasePercentBasisPoints","type":"uint256"},{"internalType":"uint256","name":"cliff","type":"uint256"},{"internalType":"uint256","name":"releaseStep","type":"uint256"},{"internalType":"uint256","name":"vestingCloseTimeline","type":"uint256"}],"internalType":"struct Presale.VestingInfo","name":"_vestingType","type":"tuple"}],"name":"addVestingType","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_userAddr","type":"address"}],"name":"calcWithdrawalAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"changeOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"checkVestingPeriod","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentVestingType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_coinAmount","type":"uint256"},{"internalType":"uint256","name":"_coinIndex","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"depositHistory","outputs":[{"components":[{"internalType":"uint256","name":"vestingType","type":"uint256"},{"internalType":"uint256","name":"depositedAmount","type":"uint256"},{"internalType":"uint256","name":"purchasedAmount","type":"uint256"},{"internalType":"uint256","name":"depositTime","type":"uint256"}],"internalType":"struct Presale.DepositInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"isLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"joyToken","outputs":[{"internalType":"contract JoyToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_joyAmount","type":"uint256"}],"name":"pairInfo","outputs":[{"internalType":"uint256","name":"joyAmountStar","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"purchaserAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"purchaserList","outputs":[{"internalType":"uint256","name":"firstDepositTime","type":"uint256"},{"internalType":"uint256","name":"firstUnlockTime","type":"uint256"},{"internalType":"uint256","name":"vestingTimeFinish","type":"uint256"},{"internalType":"uint256","name":"withdrawnAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"name":"removeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sale","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_start","type":"bool"}],"name":"startSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_vestingType","type":"uint256"}],"name":"switchVesting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalPurchasers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasuryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_treasuryAddress","type":"address"}],"name":"updateTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"vestingList","outputs":[{"internalType":"uint256","name":"releasePercentBasisPoints","type":"uint256"},{"internalType":"uint256","name":"cliff","type":"uint256"},{"internalType":"uint256","name":"releaseStep","type":"uint256"},{"internalType":"uint256","name":"vestingCloseTimeline","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"withdrawAllCoins","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"withdrawAllJoyTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"withdrawAllxJoyTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"xJoyToken","outputs":[{"internalType":"contract XJoyToken","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

6080604052600780546001600160a01b031990811673a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48179091556008805490911673dac17f958d2ee523a2206206994597c13d831ec71790553480156200005957600080fd5b506040516200309a3803806200309a8339810160408190526200007c916200053a565b600180546001600160a01b03199081166001600160a01b0388811691909117909255600280548216878416179055600680548216928416929092179091556009805433921682179055620000d39060009062000160565b60005b835181101562000143576003848281518110620000f757620000f762000674565b60209081029190910181015182546001818101855560009485529383902082516004909202019081559181015182840155604081015160028301556060015160039091015501620000d6565b50600482905562000155600062000201565b5050505050620007d8565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620001fd576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001bc3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6200020d60006200022b565b60098054911515600160a01b0260ff60a01b19909216919091179055565b6200023781336200023a565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620001fd5762000284816001600160a01b03166014620002de60201b620017ad1760201c565b6200029a836020620017ad620002de821b17811c565b604051602001620002ad929190620006bd565b60408051601f198184030181529082905262461bcd60e51b8252620002d59160040162000736565b60405180910390fd5b60606000620002ef83600262000781565b620002fc906002620007a3565b6001600160401b03811115620003165762000316620004b4565b6040519080825280601f01601f19166020018201604052801562000341576020820181803683370190505b509050600360fc1b816000815181106200035f576200035f62000674565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811062000391576200039162000674565b60200101906001600160f81b031916908160001a9053506000620003b784600262000781565b620003c4906001620007a3565b90505b600181111562000446576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110620003fc57620003fc62000674565b1a60f81b82828151811062000415576200041562000674565b60200101906001600160f81b031916908160001a90535060049490941c936200043e81620007be565b9050620003c7565b508315620004975760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401620002d5565b9392505050565b6001600160a01b03811681146200023757600080fd5b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b0381118282101715620004ef57620004ef620004b4565b60405290565b604051601f8201601f191681016001600160401b0381118282101715620005205762000520620004b4565b604052919050565b805162000535816200049e565b919050565b600080600080600060a086880312156200055357600080fd5b855162000560816200049e565b8095505060208087015162000575816200049e565b604088810151919650906001600160401b03808211156200059557600080fd5b818a0191508a601f830112620005aa57600080fd5b815181811115620005bf57620005bf620004b4565b620005cf858260051b01620004f5565b818152858101925060079190911b83018501908c821115620005f057600080fd5b928501925b818410156200064a576080848e031215620006105760008081fd5b6200061a620004ca565b845181528685015187820152858501518682015260608086015190820152835260809093019291850191620005f5565b80985050505050505060608601519150620006686080870162000528565b90509295509295909350565b634e487b7160e01b600052603260045260246000fd5b60005b83811015620006a75781810151838201526020016200068d565b83811115620006b7576000848401525b50505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351620006f78160178501602088016200068a565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516200072a8160288401602088016200068a565b01602801949350505050565b6020815260008251806020840152620007578160408501602087016200068a565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156200079e576200079e6200076b565b500290565b60008219821115620007b957620007b96200076b565b500190565b600081620007d057620007d06200076b565b506000190190565b6128b280620007e86000396000f3fe608060405234801561001057600080fd5b50600436106102ad5760003560e01c80636ad1fe021161017b578063a217fddf116100d8578063d515e81c1161008c578063e2bbb15811610071578063e2bbb15814610641578063e654210b14610654578063f328aa401461066757600080fd5b8063d515e81c1461061b578063d547741f1461062e57600080fd5b8063a89faabc116100bd578063a89faabc146105d5578063b26b3374146105f5578063c5f956af1461060857600080fd5b8063a217fddf146105ba578063a64968ac146105c257600080fd5b80638da5cb5b1161012f57806391d148541161011457806391d14854146105425780639a48ab2e146105795780639c4c557c146105a757600080fd5b80638da5cb5b1461051c57806390ae8d5e1461052f57600080fd5b8063767de7c411610160578063767de7c4146104cd57806377dae21f146104f65780637f51bb1f1461050957600080fd5b80636ad1fe02146104a657806370480275146104ba57600080fd5b80632f2ff15d116102295780634a4fbeec116101dd5780634fa62d47116101c25780634fa62d4714610477578063607a81d51461048a57806360c9e5b81461049357600080fd5b80634a4fbeec146104365780634d2f6dae1461046457600080fd5b806336568abe1161020e57806336568abe146103e65780633ccfd60b146103f95780633eb809ee1461040157600080fd5b80632f2ff15d146103c05780633122d339146103d357600080fd5b80631785f53c11610280578063203d2cef11610265578063203d2cef14610377578063248a9ca31461038a5780632af4c31e146103ad57600080fd5b80631785f53c1461034f5780631e13ea0d1461036457600080fd5b806301ffc9a7146102b25780630e139133146102da57806314d5f6e81461030d578063155b53e314610324575b600080fd5b6102c56102c03660046121e5565b61067a565b60405190151581526020015b60405180910390f35b6102ed6102e836600461220f565b6106e3565b6040805194855260208501939093529183015260608201526080016102d1565b61031660055481565b6040519081526020016102d1565b600754610337906001600160a01b031681565b6040516001600160a01b0390911681526020016102d1565b61036261035d36600461223d565b61071d565b005b61031661037236600461220f565b610764565b61036261038536600461223d565b6109a9565b61031661039836600461220f565b60009081526020819052604090206001015490565b6103626103bb36600461223d565b610ac0565b6103626103ce36600461225a565b610b90565b600254610337906001600160a01b031681565b6103626103f436600461225a565b610bb5565b610362610c46565b6102ed61040f36600461223d565b600b6020526000908152604090208054600182015460028301546003909301549192909184565b6102c561044436600461223d565b6001600160a01b03166000908152600b6020526040902060020154421090565b61036261047236600461223d565b610ed4565b6103626104853660046123ed565b6110d2565b61031660045481565b6103626104a13660046124bf565b611191565b6009546102c590600160a01b900460ff1681565b6103626104c836600461223d565b611231565b6103376104db36600461220f565b600a602052600090815260409020546001600160a01b031681565b61036261050436600461220f565b611246565b61036261051736600461223d565b6112b4565b600954610337906001600160a01b031681565b61036261053d36600461223d565b61130e565b6102c561055036600461225a565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6102c561058736600461223d565b6001600160a01b03166000908152600b6020526040902060010154421190565b6103626105b536600461251d565b6113e1565b610316600081565b600154610337906001600160a01b031681565b6105e86105e336600461223d565b611424565b6040516102d1919061253a565b61036261060336600461259e565b6114c4565b600654610337906001600160a01b031681565b6103626106293660046125ba565b6115b7565b61036261063c36600461225a565b6115cf565b61036261064f366004612606565b6115f4565b600854610337906001600160a01b031681565b61031661067536600461223d565b611646565b60006001600160e01b031982167f7965db0b0000000000000000000000000000000000000000000000000000000014806106dd57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b600381815481106106f357600080fd5b60009182526020909120600490910201805460018201546002830154600390930154919350919084565b61072760006119dd565b6009546001600160a01b03828116911614156107565760405163d238ed5960e01b815260040160405180910390fd5b6107616000826119e7565b50565b60006127108210156107a2576040517f9f27f0b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600154600754735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f916000916107d99184916001600160a01b039182169116611a66565b90506001600160a01b03811661081b576040517fb541aaf300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080826001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa15801561085c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108809190612646565b506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff169150600080846001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090a9190612696565b6007546001600160a01b03908116911614610926578383610929565b82845b9092509050600061093d83620f42406126c9565b9050816000606461094e83856126e8565b61095891906126e8565b905060006109686127108d6126e8565b9050600061097683836126c9565b90506109836064826126e8565b61098e9060376126c9565b610998908261270a565b9d9c50505050505050505050505050565b6009546001600160a01b031633146109d45760405163d238ed5960e01b815260040160405180910390fd5b6002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610a1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a419190612722565b60025460405163a9059cbb60e01b81526001600160a01b0385811660048301526024820184905292935091169063a9059cbb906044015b6020604051808303816000875af1158015610a97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abb919061273b565b505050565b6009546001600160a01b03163314610aeb5760405163d238ed5960e01b815260040160405180910390fd5b6009546001600160a01b0382811691161480610b0e57506001600160a01b038116155b15610b45576040517f2140ecfb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600954610b5d906000906001600160a01b03166119e7565b6009805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038316179055610761600082611b5b565b600082815260208190526040902060010154610bab816119dd565b610abb8383611b5b565b6001600160a01b0381163314610c385760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b610c4282826119e7565b5050565b336000818152600b60205260409020600101544211610c91576040517f1239acf000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610c9c33611646565b6002549091506000906001600160a01b03166370a08231336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610cf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1c9190612722565b90508181811115610d2a5750805b60008111610d64576040517f6c01d14c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002546001600160a01b03166323b872dd336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604481018490526064016020604051808303816000875af1158015610dc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ded919061273b565b506001546001600160a01b031663a9059cbb336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061273b565b50336000908152600b602052604081206003018054839290610e9490849061270a565b909155505060405181815233907f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b9060200160405180910390a250505050565b6009546001600160a01b03163314610eff5760405163d238ed5960e01b815260040160405180910390fd5b6007546008546040516370a0823160e01b81523060048201526001600160a01b03928316929091169060009083906370a0823190602401602060405180830381865afa158015610f53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f779190612722565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038416906370a0823190602401602060405180830381865afa158015610fc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe59190612722565b905081156110625760405163a9059cbb60e01b81526001600160a01b0386811660048301526024820184905285169063a9059cbb906044016020604051808303816000875af115801561103c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611060919061273b565b505b80156110cb5760405163a9059cbb60e01b81526001600160a01b0386811660048301526024820183905284169063a9059cbb90604401600060405180830381600087803b1580156110b257600080fd5b505af11580156110c6573d6000803e3d6000fd5b505050505b5050505050565b6110dc60006119dd565b60005b835181101561118b576111838482815181106110fd576110fd612758565b602002602001015184838151811061111757611117612758565b60200260200101516000015185848151811061113557611135612758565b60200260200101516060015186858151811061115357611153612758565b60200260200101516020015187868151811061117157611171612758565b60200260200101516040015187611191565b6001016110df565b50505050565b61119b60006119dd565b6111aa86868686866000611bf9565b80156112295760025460405163a9059cbb60e01b81526001600160a01b038881166004830152602482018590529091169063a9059cbb906044016020604051808303816000875af1158015611203573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611227919061273b565b505b505050505050565b61123b60006119dd565b610761600082611b5b565b61125060006119dd565b6003548110158061126357506004548111155b15611281576040516335cc609760e11b815260040160405180910390fd5b600481905560405181907f7ecb0bec2da887ee9b08bcbc217bd6f2f439944981ac5b9dd0f10fa5039ac7bc90600090a250565b6009546001600160a01b031633146112df5760405163d238ed5960e01b815260040160405180910390fd5b6006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6009546001600160a01b031633146113395760405163d238ed5960e01b815260040160405180910390fd5b6001546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015611382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a69190612722565b60015460405163a9059cbb60e01b81526001600160a01b0385811660048301526024820184905292935091169063a9059cbb90604401610a78565b6113eb60006119dd565b60098054911515600160a01b027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b6001600160a01b0381166000908152600b60209081526040808320600401805482518185028101850190935280835260609492939192909184015b828210156114b957838290600052602060002090600402016040518060800160405290816000820154815260200160018201548152602001600282015481526020016003820154815250508152602001906001019061145f565b505050509050919050565b6114ce60006119dd565b6003805460018101825560009182528251600482027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b81019190915560208401517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c8201556040808501517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d83015560608501517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85e9092019190915551909182917f04b067df9278f78eb168729f37880451bad6202350319f44fdf216f9896e5c009190a25050565b6115c160006119dd565b611229868686868686611bf9565b6000828152602081905260409020600101546115ea816119dd565b610abb83836119e7565b600954600160a01b900460ff16611637576040517f0c3e755900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c4233838360045442611e0e565b6001600160a01b0381166000908152600b6020526040812081805b600483015481101561179557600083600401828154811061168457611684612758565b90600052602060002090600402019050600060038260000154815481106116ad576116ad612758565b906000526020600020906004020190506000816001015483600301546116d3919061270a565b90508042111561178a5760038201546116ec908261270a565b421115611709576002830154611702908661270a565b945061178a565b6000620186a08360000154856002015461172391906126c9565b61172d91906126e8565b9050600083600201548342611742919061276e565b61174c91906126e8565b61175790600161270a565b9050600061176583836126c9565b9050856002015481111561177a575060028501545b611784818961270a565b97505050505b505050600101611661565b5060038201546117a5908261276e565b949350505050565b606060006117bc8360026126c9565b6117c790600261270a565b67ffffffffffffffff8111156117df576117df61228a565b6040519080825280601f01601f191660200182016040528015611809576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061184057611840612758565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106118a3576118a3612758565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006118df8460026126c9565b6118ea90600161270a565b90505b6001811115611987577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061192b5761192b612758565b1a60f81b82828151811061194157611941612758565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c9361198081612785565b90506118ed565b5083156119d65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c2f565b9392505050565b6107618133612057565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610c42576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000806000611a7585856120d5565b6040516bffffffffffffffffffffffff19606084811b8216602084015283901b1660348201529193509150600090879060480160405160208183030381529060405280519060200120604051602001611b389291907fff00000000000000000000000000000000000000000000000000000000000000815260609290921b6bffffffffffffffffffffffff1916600183015260158201527f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f603582015260550190565b60408051601f198184030181529190528051602090910120979650505050505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610c42576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055611bb53390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6003548510611c1b576040516335cc609760e11b815260040160405180910390fd5b6001600160a01b0386166000908152600b602052604090208054611d0457848155600580546000908152600a60205260408120805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038b1617905581546001929190611c8690849061270a565b90915550506002546040517f44337ea10000000000000000000000000000000000000000000000000000000081526001600160a01b038981166004830152909116906344337ea190602401600060405180830381600087803b158015611ceb57600080fd5b505af1158015611cff573d6000803e3d6000fd5b505050505b600060038781548110611d1957611d19612758565b9060005260206000209060040201905060008160030154826001015488611d40919061270a565b611d4a919061270a565b90508083600201541015611d6057600283018190555b6000826001015488611d72919061270a565b90508084600101541180611d8857506001840154155b15611d9557600184018190555b84846003016000828254611da9919061270a565b909155505060408051608081018252998a526020808b01988952908a0196875260608a0198895260049485018054600181810183556000928352929091209a519502909901938455505093519581019590955550516002840155505160039091015550565b6003548210611e30576040516335cc609760e11b815260040160405180910390fd5b6001831115611e6b576040517fb1554c3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82611efa576007546006546040516323b872dd60e01b81526001600160a01b03888116600483015291821660248201526044810187905291169081906323b872dd906064016020604051808303816000875af1158015611ecf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ef3919061273b565b5050611f77565b8260011415611f77576008546006546040516323b872dd60e01b81526001600160a01b03888116600483015291821660248201526044810187905291169081906323b872dd90606401600060405180830381600087803b158015611f5d57600080fd5b505af1158015611f71573d6000803e3d6000fd5b50505050505b6000611f8285610764565b60025460405163a9059cbb60e01b81526001600160a01b0389811660048301526024820184905292935091169063a9059cbb906044016020604051808303816000875af1158015611fd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ffb919061273b565b5061200b86848488856000611bf9565b60408051868152602081018390526001600160a01b038816917f8fafebcaf9d154343dad25669bfa277f4fbacd7ac6b0c4fed522580e040a0f33910160405180910390a2505050505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610c4257612093816001600160a01b031660146117ad565b61209e8360206117ad565b6040516020016120af9291906127c8565b60408051601f198184030181529082905262461bcd60e51b8252610c2f91600401612849565b600080826001600160a01b0316846001600160a01b031614156121605760405162461bcd60e51b815260206004820152602560248201527f556e697377617056324c6962726172793a204944454e544943414c5f4144445260448201527f45535345530000000000000000000000000000000000000000000000000000006064820152608401610c2f565b826001600160a01b0316846001600160a01b031610612180578284612183565b83835b90925090506001600160a01b0382166121de5760405162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f4144445245535300006044820152606401610c2f565b9250929050565b6000602082840312156121f757600080fd5b81356001600160e01b0319811681146119d657600080fd5b60006020828403121561222157600080fd5b5035919050565b6001600160a01b038116811461076157600080fd5b60006020828403121561224f57600080fd5b81356119d681612228565b6000806040838503121561226d57600080fd5b82359150602083013561227f81612228565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156122c9576122c961228a565b604052919050565b600067ffffffffffffffff8211156122eb576122eb61228a565b5060051b60200190565b60006080828403121561230757600080fd5b6040516080810181811067ffffffffffffffff8211171561232a5761232a61228a565b8060405250809150823581526020830135602082015260408301356040820152606083013560608201525092915050565b600082601f83011261236c57600080fd5b8135602061238161237c836122d1565b6122a0565b82815260079290921b840181019181810190868411156123a057600080fd5b8286015b848110156123c4576123b688826122f5565b8352918301916080016123a4565b509695505050505050565b801515811461076157600080fd5b80356123e8816123cf565b919050565b60008060006060848603121561240257600080fd5b833567ffffffffffffffff8082111561241a57600080fd5b818601915086601f83011261242e57600080fd5b8135602061243e61237c836122d1565b82815260059290921b8401810191818101908a84111561245d57600080fd5b948201945b8386101561248457853561247581612228565b82529482019490820190612462565b9750508701359250508082111561249a57600080fd5b506124a78682870161235b565b9250506124b6604085016123dd565b90509250925092565b60008060008060008060c087890312156124d857600080fd5b86356124e381612228565b95506020870135945060408701359350606087013592506080870135915060a087013561250f816123cf565b809150509295509295509295565b60006020828403121561252f57600080fd5b81356119d6816123cf565b602080825282518282018190526000919060409081850190868401855b8281101561259157815180518552868101518786015285810151868601526060908101519085015260809093019290850190600101612557565b5091979650505050505050565b6000608082840312156125b057600080fd5b6119d683836122f5565b60008060008060008060c087890312156125d357600080fd5b86356125de81612228565b9860208801359850604088013597606081013597506080810135965060a00135945092505050565b6000806040838503121561261957600080fd5b50508035926020909101359150565b80516dffffffffffffffffffffffffffff811681146123e857600080fd5b60008060006060848603121561265b57600080fd5b61266484612628565b925061267260208501612628565b9150604084015163ffffffff8116811461268b57600080fd5b809150509250925092565b6000602082840312156126a857600080fd5b81516119d681612228565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156126e3576126e36126b3565b500290565b60008261270557634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561271d5761271d6126b3565b500190565b60006020828403121561273457600080fd5b5051919050565b60006020828403121561274d57600080fd5b81516119d6816123cf565b634e487b7160e01b600052603260045260246000fd5b600082821015612780576127806126b3565b500390565b600081612794576127946126b3565b506000190190565b60005b838110156127b757818101518382015260200161279f565b8381111561118b5750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161280081601785016020880161279c565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000601791840191820152835161283d81602884016020880161279c565b01602801949350505050565b602081526000825180602084015261286881604085016020870161279c565b601f01601f1916919091016040019291505056fea26469706673582212200dddf9093b332b16e917d70d964a6dfab5b4c2ce6fba3456f0db19f10e0a619d64736f6c634300080b00330000000000000000000000004e114d405b9ba2f59524941733e505ae03fb1fb5000000000000000000000000592a74d0228999ea06010fdc4f954374289bc95200000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000004000000000000000000000000e24ab7ebe787a5077b8bbc344c70ff0b57545263000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000009c400000000000000000000000000000000000000000000000000000000013c68000000000000000000000000000000000000000000000000000000000000278d0000000000000000000000000000000000000000000000000000000000062e080000000000000000000000000000000000000000000000000000000000000009c400000000000000000000000000000000000000000000000000000000013c68000000000000000000000000000000000000000000000000000000000000278d0000000000000000000000000000000000000000000000000000000000062e080000000000000000000000000000000000000000000000000000000000000009c400000000000000000000000000000000000000000000000000000000018b82000000000000000000000000000000000000000000000000000000000000278d0000000000000000000000000000000000000000000000000000000000062e080000000000000000000000000000000000000000000000000000000000000009c40000000000000000000000000000000000000000000000000000000001da9c000000000000000000000000000000000000000000000000000000000000278d0000000000000000000000000000000000000000000000000000000000062e080000000000000000000000000000000000000000000000000000000000000000890000000000000000000000000000000000000000000000000000000001da9c0000000000000000000000000000000000000000000000000000000000000151800000000000000000000000000000000000000000000000000000000003c26700

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102ad5760003560e01c80636ad1fe021161017b578063a217fddf116100d8578063d515e81c1161008c578063e2bbb15811610071578063e2bbb15814610641578063e654210b14610654578063f328aa401461066757600080fd5b8063d515e81c1461061b578063d547741f1461062e57600080fd5b8063a89faabc116100bd578063a89faabc146105d5578063b26b3374146105f5578063c5f956af1461060857600080fd5b8063a217fddf146105ba578063a64968ac146105c257600080fd5b80638da5cb5b1161012f57806391d148541161011457806391d14854146105425780639a48ab2e146105795780639c4c557c146105a757600080fd5b80638da5cb5b1461051c57806390ae8d5e1461052f57600080fd5b8063767de7c411610160578063767de7c4146104cd57806377dae21f146104f65780637f51bb1f1461050957600080fd5b80636ad1fe02146104a657806370480275146104ba57600080fd5b80632f2ff15d116102295780634a4fbeec116101dd5780634fa62d47116101c25780634fa62d4714610477578063607a81d51461048a57806360c9e5b81461049357600080fd5b80634a4fbeec146104365780634d2f6dae1461046457600080fd5b806336568abe1161020e57806336568abe146103e65780633ccfd60b146103f95780633eb809ee1461040157600080fd5b80632f2ff15d146103c05780633122d339146103d357600080fd5b80631785f53c11610280578063203d2cef11610265578063203d2cef14610377578063248a9ca31461038a5780632af4c31e146103ad57600080fd5b80631785f53c1461034f5780631e13ea0d1461036457600080fd5b806301ffc9a7146102b25780630e139133146102da57806314d5f6e81461030d578063155b53e314610324575b600080fd5b6102c56102c03660046121e5565b61067a565b60405190151581526020015b60405180910390f35b6102ed6102e836600461220f565b6106e3565b6040805194855260208501939093529183015260608201526080016102d1565b61031660055481565b6040519081526020016102d1565b600754610337906001600160a01b031681565b6040516001600160a01b0390911681526020016102d1565b61036261035d36600461223d565b61071d565b005b61031661037236600461220f565b610764565b61036261038536600461223d565b6109a9565b61031661039836600461220f565b60009081526020819052604090206001015490565b6103626103bb36600461223d565b610ac0565b6103626103ce36600461225a565b610b90565b600254610337906001600160a01b031681565b6103626103f436600461225a565b610bb5565b610362610c46565b6102ed61040f36600461223d565b600b6020526000908152604090208054600182015460028301546003909301549192909184565b6102c561044436600461223d565b6001600160a01b03166000908152600b6020526040902060020154421090565b61036261047236600461223d565b610ed4565b6103626104853660046123ed565b6110d2565b61031660045481565b6103626104a13660046124bf565b611191565b6009546102c590600160a01b900460ff1681565b6103626104c836600461223d565b611231565b6103376104db36600461220f565b600a602052600090815260409020546001600160a01b031681565b61036261050436600461220f565b611246565b61036261051736600461223d565b6112b4565b600954610337906001600160a01b031681565b61036261053d36600461223d565b61130e565b6102c561055036600461225a565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6102c561058736600461223d565b6001600160a01b03166000908152600b6020526040902060010154421190565b6103626105b536600461251d565b6113e1565b610316600081565b600154610337906001600160a01b031681565b6105e86105e336600461223d565b611424565b6040516102d1919061253a565b61036261060336600461259e565b6114c4565b600654610337906001600160a01b031681565b6103626106293660046125ba565b6115b7565b61036261063c36600461225a565b6115cf565b61036261064f366004612606565b6115f4565b600854610337906001600160a01b031681565b61031661067536600461223d565b611646565b60006001600160e01b031982167f7965db0b0000000000000000000000000000000000000000000000000000000014806106dd57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b600381815481106106f357600080fd5b60009182526020909120600490910201805460018201546002830154600390930154919350919084565b61072760006119dd565b6009546001600160a01b03828116911614156107565760405163d238ed5960e01b815260040160405180910390fd5b6107616000826119e7565b50565b60006127108210156107a2576040517f9f27f0b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600154600754735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f916000916107d99184916001600160a01b039182169116611a66565b90506001600160a01b03811661081b576040517fb541aaf300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080826001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa15801561085c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108809190612646565b506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff169150600080846001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090a9190612696565b6007546001600160a01b03908116911614610926578383610929565b82845b9092509050600061093d83620f42406126c9565b9050816000606461094e83856126e8565b61095891906126e8565b905060006109686127108d6126e8565b9050600061097683836126c9565b90506109836064826126e8565b61098e9060376126c9565b610998908261270a565b9d9c50505050505050505050505050565b6009546001600160a01b031633146109d45760405163d238ed5960e01b815260040160405180910390fd5b6002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610a1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a419190612722565b60025460405163a9059cbb60e01b81526001600160a01b0385811660048301526024820184905292935091169063a9059cbb906044015b6020604051808303816000875af1158015610a97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abb919061273b565b505050565b6009546001600160a01b03163314610aeb5760405163d238ed5960e01b815260040160405180910390fd5b6009546001600160a01b0382811691161480610b0e57506001600160a01b038116155b15610b45576040517f2140ecfb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600954610b5d906000906001600160a01b03166119e7565b6009805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038316179055610761600082611b5b565b600082815260208190526040902060010154610bab816119dd565b610abb8383611b5b565b6001600160a01b0381163314610c385760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b610c4282826119e7565b5050565b336000818152600b60205260409020600101544211610c91576040517f1239acf000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610c9c33611646565b6002549091506000906001600160a01b03166370a08231336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610cf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1c9190612722565b90508181811115610d2a5750805b60008111610d64576040517f6c01d14c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002546001600160a01b03166323b872dd336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604481018490526064016020604051808303816000875af1158015610dc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ded919061273b565b506001546001600160a01b031663a9059cbb336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061273b565b50336000908152600b602052604081206003018054839290610e9490849061270a565b909155505060405181815233907f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b9060200160405180910390a250505050565b6009546001600160a01b03163314610eff5760405163d238ed5960e01b815260040160405180910390fd5b6007546008546040516370a0823160e01b81523060048201526001600160a01b03928316929091169060009083906370a0823190602401602060405180830381865afa158015610f53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f779190612722565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038416906370a0823190602401602060405180830381865afa158015610fc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe59190612722565b905081156110625760405163a9059cbb60e01b81526001600160a01b0386811660048301526024820184905285169063a9059cbb906044016020604051808303816000875af115801561103c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611060919061273b565b505b80156110cb5760405163a9059cbb60e01b81526001600160a01b0386811660048301526024820183905284169063a9059cbb90604401600060405180830381600087803b1580156110b257600080fd5b505af11580156110c6573d6000803e3d6000fd5b505050505b5050505050565b6110dc60006119dd565b60005b835181101561118b576111838482815181106110fd576110fd612758565b602002602001015184838151811061111757611117612758565b60200260200101516000015185848151811061113557611135612758565b60200260200101516060015186858151811061115357611153612758565b60200260200101516020015187868151811061117157611171612758565b60200260200101516040015187611191565b6001016110df565b50505050565b61119b60006119dd565b6111aa86868686866000611bf9565b80156112295760025460405163a9059cbb60e01b81526001600160a01b038881166004830152602482018590529091169063a9059cbb906044016020604051808303816000875af1158015611203573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611227919061273b565b505b505050505050565b61123b60006119dd565b610761600082611b5b565b61125060006119dd565b6003548110158061126357506004548111155b15611281576040516335cc609760e11b815260040160405180910390fd5b600481905560405181907f7ecb0bec2da887ee9b08bcbc217bd6f2f439944981ac5b9dd0f10fa5039ac7bc90600090a250565b6009546001600160a01b031633146112df5760405163d238ed5960e01b815260040160405180910390fd5b6006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6009546001600160a01b031633146113395760405163d238ed5960e01b815260040160405180910390fd5b6001546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015611382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a69190612722565b60015460405163a9059cbb60e01b81526001600160a01b0385811660048301526024820184905292935091169063a9059cbb90604401610a78565b6113eb60006119dd565b60098054911515600160a01b027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b6001600160a01b0381166000908152600b60209081526040808320600401805482518185028101850190935280835260609492939192909184015b828210156114b957838290600052602060002090600402016040518060800160405290816000820154815260200160018201548152602001600282015481526020016003820154815250508152602001906001019061145f565b505050509050919050565b6114ce60006119dd565b6003805460018101825560009182528251600482027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b81019190915560208401517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c8201556040808501517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d83015560608501517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85e9092019190915551909182917f04b067df9278f78eb168729f37880451bad6202350319f44fdf216f9896e5c009190a25050565b6115c160006119dd565b611229868686868686611bf9565b6000828152602081905260409020600101546115ea816119dd565b610abb83836119e7565b600954600160a01b900460ff16611637576040517f0c3e755900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c4233838360045442611e0e565b6001600160a01b0381166000908152600b6020526040812081805b600483015481101561179557600083600401828154811061168457611684612758565b90600052602060002090600402019050600060038260000154815481106116ad576116ad612758565b906000526020600020906004020190506000816001015483600301546116d3919061270a565b90508042111561178a5760038201546116ec908261270a565b421115611709576002830154611702908661270a565b945061178a565b6000620186a08360000154856002015461172391906126c9565b61172d91906126e8565b9050600083600201548342611742919061276e565b61174c91906126e8565b61175790600161270a565b9050600061176583836126c9565b9050856002015481111561177a575060028501545b611784818961270a565b97505050505b505050600101611661565b5060038201546117a5908261276e565b949350505050565b606060006117bc8360026126c9565b6117c790600261270a565b67ffffffffffffffff8111156117df576117df61228a565b6040519080825280601f01601f191660200182016040528015611809576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061184057611840612758565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106118a3576118a3612758565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006118df8460026126c9565b6118ea90600161270a565b90505b6001811115611987577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061192b5761192b612758565b1a60f81b82828151811061194157611941612758565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c9361198081612785565b90506118ed565b5083156119d65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c2f565b9392505050565b6107618133612057565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610c42576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000806000611a7585856120d5565b6040516bffffffffffffffffffffffff19606084811b8216602084015283901b1660348201529193509150600090879060480160405160208183030381529060405280519060200120604051602001611b389291907fff00000000000000000000000000000000000000000000000000000000000000815260609290921b6bffffffffffffffffffffffff1916600183015260158201527f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f603582015260550190565b60408051601f198184030181529190528051602090910120979650505050505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610c42576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055611bb53390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6003548510611c1b576040516335cc609760e11b815260040160405180910390fd5b6001600160a01b0386166000908152600b602052604090208054611d0457848155600580546000908152600a60205260408120805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038b1617905581546001929190611c8690849061270a565b90915550506002546040517f44337ea10000000000000000000000000000000000000000000000000000000081526001600160a01b038981166004830152909116906344337ea190602401600060405180830381600087803b158015611ceb57600080fd5b505af1158015611cff573d6000803e3d6000fd5b505050505b600060038781548110611d1957611d19612758565b9060005260206000209060040201905060008160030154826001015488611d40919061270a565b611d4a919061270a565b90508083600201541015611d6057600283018190555b6000826001015488611d72919061270a565b90508084600101541180611d8857506001840154155b15611d9557600184018190555b84846003016000828254611da9919061270a565b909155505060408051608081018252998a526020808b01988952908a0196875260608a0198895260049485018054600181810183556000928352929091209a519502909901938455505093519581019590955550516002840155505160039091015550565b6003548210611e30576040516335cc609760e11b815260040160405180910390fd5b6001831115611e6b576040517fb1554c3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82611efa576007546006546040516323b872dd60e01b81526001600160a01b03888116600483015291821660248201526044810187905291169081906323b872dd906064016020604051808303816000875af1158015611ecf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ef3919061273b565b5050611f77565b8260011415611f77576008546006546040516323b872dd60e01b81526001600160a01b03888116600483015291821660248201526044810187905291169081906323b872dd90606401600060405180830381600087803b158015611f5d57600080fd5b505af1158015611f71573d6000803e3d6000fd5b50505050505b6000611f8285610764565b60025460405163a9059cbb60e01b81526001600160a01b0389811660048301526024820184905292935091169063a9059cbb906044016020604051808303816000875af1158015611fd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ffb919061273b565b5061200b86848488856000611bf9565b60408051868152602081018390526001600160a01b038816917f8fafebcaf9d154343dad25669bfa277f4fbacd7ac6b0c4fed522580e040a0f33910160405180910390a2505050505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610c4257612093816001600160a01b031660146117ad565b61209e8360206117ad565b6040516020016120af9291906127c8565b60408051601f198184030181529082905262461bcd60e51b8252610c2f91600401612849565b600080826001600160a01b0316846001600160a01b031614156121605760405162461bcd60e51b815260206004820152602560248201527f556e697377617056324c6962726172793a204944454e544943414c5f4144445260448201527f45535345530000000000000000000000000000000000000000000000000000006064820152608401610c2f565b826001600160a01b0316846001600160a01b031610612180578284612183565b83835b90925090506001600160a01b0382166121de5760405162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f4144445245535300006044820152606401610c2f565b9250929050565b6000602082840312156121f757600080fd5b81356001600160e01b0319811681146119d657600080fd5b60006020828403121561222157600080fd5b5035919050565b6001600160a01b038116811461076157600080fd5b60006020828403121561224f57600080fd5b81356119d681612228565b6000806040838503121561226d57600080fd5b82359150602083013561227f81612228565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156122c9576122c961228a565b604052919050565b600067ffffffffffffffff8211156122eb576122eb61228a565b5060051b60200190565b60006080828403121561230757600080fd5b6040516080810181811067ffffffffffffffff8211171561232a5761232a61228a565b8060405250809150823581526020830135602082015260408301356040820152606083013560608201525092915050565b600082601f83011261236c57600080fd5b8135602061238161237c836122d1565b6122a0565b82815260079290921b840181019181810190868411156123a057600080fd5b8286015b848110156123c4576123b688826122f5565b8352918301916080016123a4565b509695505050505050565b801515811461076157600080fd5b80356123e8816123cf565b919050565b60008060006060848603121561240257600080fd5b833567ffffffffffffffff8082111561241a57600080fd5b818601915086601f83011261242e57600080fd5b8135602061243e61237c836122d1565b82815260059290921b8401810191818101908a84111561245d57600080fd5b948201945b8386101561248457853561247581612228565b82529482019490820190612462565b9750508701359250508082111561249a57600080fd5b506124a78682870161235b565b9250506124b6604085016123dd565b90509250925092565b60008060008060008060c087890312156124d857600080fd5b86356124e381612228565b95506020870135945060408701359350606087013592506080870135915060a087013561250f816123cf565b809150509295509295509295565b60006020828403121561252f57600080fd5b81356119d6816123cf565b602080825282518282018190526000919060409081850190868401855b8281101561259157815180518552868101518786015285810151868601526060908101519085015260809093019290850190600101612557565b5091979650505050505050565b6000608082840312156125b057600080fd5b6119d683836122f5565b60008060008060008060c087890312156125d357600080fd5b86356125de81612228565b9860208801359850604088013597606081013597506080810135965060a00135945092505050565b6000806040838503121561261957600080fd5b50508035926020909101359150565b80516dffffffffffffffffffffffffffff811681146123e857600080fd5b60008060006060848603121561265b57600080fd5b61266484612628565b925061267260208501612628565b9150604084015163ffffffff8116811461268b57600080fd5b809150509250925092565b6000602082840312156126a857600080fd5b81516119d681612228565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156126e3576126e36126b3565b500290565b60008261270557634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561271d5761271d6126b3565b500190565b60006020828403121561273457600080fd5b5051919050565b60006020828403121561274d57600080fd5b81516119d6816123cf565b634e487b7160e01b600052603260045260246000fd5b600082821015612780576127806126b3565b500390565b600081612794576127946126b3565b506000190190565b60005b838110156127b757818101518382015260200161279f565b8381111561118b5750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161280081601785016020880161279c565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000601791840191820152835161283d81602884016020880161279c565b01602801949350505050565b602081526000825180602084015261286881604085016020870161279c565b601f01601f1916919091016040019291505056fea26469706673582212200dddf9093b332b16e917d70d964a6dfab5b4c2ce6fba3456f0db19f10e0a619d64736f6c634300080b0033

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

0000000000000000000000004e114d405b9ba2f59524941733e505ae03fb1fb5000000000000000000000000592a74d0228999ea06010fdc4f954374289bc95200000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000004000000000000000000000000e24ab7ebe787a5077b8bbc344c70ff0b57545263000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000009c400000000000000000000000000000000000000000000000000000000013c68000000000000000000000000000000000000000000000000000000000000278d0000000000000000000000000000000000000000000000000000000000062e080000000000000000000000000000000000000000000000000000000000000009c400000000000000000000000000000000000000000000000000000000013c68000000000000000000000000000000000000000000000000000000000000278d0000000000000000000000000000000000000000000000000000000000062e080000000000000000000000000000000000000000000000000000000000000009c400000000000000000000000000000000000000000000000000000000018b82000000000000000000000000000000000000000000000000000000000000278d0000000000000000000000000000000000000000000000000000000000062e080000000000000000000000000000000000000000000000000000000000000009c40000000000000000000000000000000000000000000000000000000001da9c000000000000000000000000000000000000000000000000000000000000278d0000000000000000000000000000000000000000000000000000000000062e080000000000000000000000000000000000000000000000000000000000000000890000000000000000000000000000000000000000000000000000000001da9c0000000000000000000000000000000000000000000000000000000000000151800000000000000000000000000000000000000000000000000000000003c26700

-----Decoded View---------------
Arg [0] : _joyToken (address): 0x4E114d405b9Ba2F59524941733e505Ae03Fb1FB5
Arg [1] : _xJoyToken (address): 0x592a74d0228999Ea06010fDc4F954374289bC952
Arg [2] : _vestingInfo (tuple[]): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput],System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput],System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput],System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput],System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
Arg [3] : _initialVestingType (uint256): 4
Arg [4] : _treasuryAddress (address): 0xe24aB7eBE787A5077B8BBC344C70ff0b57545263

-----Encoded View---------------
26 Constructor Arguments found :
Arg [0] : 0000000000000000000000004e114d405b9ba2f59524941733e505ae03fb1fb5
Arg [1] : 000000000000000000000000592a74d0228999ea06010fdc4f954374289bc952
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [4] : 000000000000000000000000e24ab7ebe787a5077b8bbc344c70ff0b57545263
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [6] : 00000000000000000000000000000000000000000000000000000000000009c4
Arg [7] : 00000000000000000000000000000000000000000000000000000000013c6800
Arg [8] : 0000000000000000000000000000000000000000000000000000000000278d00
Arg [9] : 00000000000000000000000000000000000000000000000000000000062e0800
Arg [10] : 00000000000000000000000000000000000000000000000000000000000009c4
Arg [11] : 00000000000000000000000000000000000000000000000000000000013c6800
Arg [12] : 0000000000000000000000000000000000000000000000000000000000278d00
Arg [13] : 00000000000000000000000000000000000000000000000000000000062e0800
Arg [14] : 00000000000000000000000000000000000000000000000000000000000009c4
Arg [15] : 00000000000000000000000000000000000000000000000000000000018b8200
Arg [16] : 0000000000000000000000000000000000000000000000000000000000278d00
Arg [17] : 00000000000000000000000000000000000000000000000000000000062e0800
Arg [18] : 00000000000000000000000000000000000000000000000000000000000009c4
Arg [19] : 0000000000000000000000000000000000000000000000000000000001da9c00
Arg [20] : 0000000000000000000000000000000000000000000000000000000000278d00
Arg [21] : 00000000000000000000000000000000000000000000000000000000062e0800
Arg [22] : 0000000000000000000000000000000000000000000000000000000000000089
Arg [23] : 0000000000000000000000000000000000000000000000000000000001da9c00
Arg [24] : 0000000000000000000000000000000000000000000000000000000000015180
Arg [25] : 0000000000000000000000000000000000000000000000000000000003c26700


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.