Contract 0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea 1

 

Contract Overview

Balance:
0 BNB

BNB Value:
$0.00

Token:
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x7b041fa38d82aa6cf6a5440f567e0ae8969391df29ca1887b2d5aa03ee84c1aaBuy Tokens93253062021-07-20 15:15:3658 days 13 hrs ago0x3c1be2442f6f1faa3f6cc87c0f96bf5ed1397c53 IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.000558026
0x85e83eae22a9a41c7c8748bd1d1adc71b4db279f4a9a745d718e33d137b0e883Withdraw All93251182021-07-20 15:06:1258 days 13 hrs agoTrustPad: Deployer IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.00016725
0x99c98235a13923c6493bf097073885e03ca47f3bccb23bbd6259862263cd4e40Buy Tokens93249902021-07-20 14:59:4858 days 13 hrs ago0x72aa368fd5c69ee0010da7b3419288339973aab1 IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.000579735
0xac6e271e210a5a5130278b82e2435eff83c051b59631249174bbc97156f93d33Buy Tokens93249902021-07-20 14:59:4858 days 13 hrs agoTrustPad: Deployer IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.000563185
0xfd6f90cf4808663e537ff584d1e3a6c7aac3334eef51efb6c064294027431c8fBuy Tokens93249882021-07-20 14:59:4258 days 13 hrs ago0x50be8021a105e2c99d16072f1975e9d75164ff54 IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.000571755
0x6f6ecaa3925a915e4695ccf23cbeefdb11ed4ae436bea4ccca6145c9bfb71731Buy Tokens93249842021-07-20 14:59:3058 days 13 hrs ago0xf91d70662eb900768e431c0124cfbcec89285d9a IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.000745425
0x4144eee8d26248b94473fcafa71d0aea7cb2f17a7dc465fb7965ba55b6315a64Buy Tokens93249842021-07-20 14:59:3058 days 13 hrs ago0x58ea0fdd11a1d0455f554e17f2dde2882e22f3e2 IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.000579795
0x3d332cd0185982d94180a1c7fa18a9c4121264ba51171ff26787f56628239b3dBuy Tokens93249822021-07-20 14:59:2458 days 13 hrs ago0x72aa368fd5c69ee0010da7b3419288339973aab1 IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.000579795
0x9d15253971d8c9e4497163505c2d92149ca58d1e7033b3bf80f8db374d4e0779Buy Tokens93249812021-07-20 14:59:2158 days 13 hrs ago0xd5c78809dc4db78bf82c38244c06f11f628b4657 IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.00076642
0x73d637223591abbccaa214b67bd0a5e8e45b5eb3aca556fd593d69e690bd687dBuy Tokens93249772021-07-20 14:59:0958 days 13 hrs ago0xac59b498fdf402a570e22795ad5b6b27e71923e9 IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.000740855
0x864c5b75ac1adda029783484c11bb0898f107c22d56bdd115f49373199cd5230Buy Tokens93249762021-07-20 14:59:0658 days 13 hrs ago0xc56203667aead20ff926d3984c39ab40bced3e52 IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.000766395
0x386331847f43f5083a5167de145c74b6a989cca58842e211f193c16240503e40Buy Tokens93249762021-07-20 14:59:0658 days 13 hrs ago0x9a1501107b66fd9995d525ab8956676552bf4fc2 IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.00075368
0xc9dc752583dcddc14fc599c4de633762d7132849cfe9575ba0a5ff6774335763Buy Tokens93249752021-07-20 14:59:0358 days 13 hrs ago0x64bcfa2bb7ba97448af5b3e594b02a90c8fb6e2f IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.00152467
0xa5023695b4bc55009ebabc3f4b5ffd2ccd27200b2eb7ecd20c6bda90c3cb8918Buy Tokens93249692021-07-20 14:58:4558 days 13 hrs ago0x4aa7e55e83186c936a8937386e2765ea2ad36bc1 IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.000762395
0x70e374329ef8d84ffcfa24bfa3115772f4c0b17246413f661b988c41266ab0e7Buy Tokens93249672021-07-20 14:58:3958 days 13 hrs ago0x7d1d672aea003d7bd551b56a82fd1462c08fc4c6 IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.000815675
0x13df172b3412a3971998f40d39a43c2e0031746c8127897314b94b4941e91a02Buy Tokens93249652021-07-20 14:58:3358 days 13 hrs ago0x1e40259740b3d5ae7b59fe3b48153a0f12227b66 IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.000740795
0xb918316ee4b98c98eae45760885e7627260b417ae7916619b22562a2afcef857Buy Tokens93249612021-07-20 14:58:2158 days 13 hrs ago0x8a53c7a940307225682f70880e7dbb827f3a3839 IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.000413065
0x01e0d77a6b3acee640d1d4c9f57020e8d3c57ff9e41cc13780dc364664268466Buy Tokens93249612021-07-20 14:58:2158 days 13 hrs ago0x72aa368fd5c69ee0010da7b3419288339973aab1 IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.000762455
0x19f75b488d2ffce9038dc67349b8c0b745ac4d7706b172b75c5eb0f75389e998Buy Tokens93249612021-07-20 14:58:2158 days 13 hrs ago0x1e40259740b3d5ae7b59fe3b48153a0f12227b66 IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.000740795
0x767de66ba0f39058434d8eb2fbdf9b8d7b2b3578bb599f65b9877e15de764b96Buy Tokens93249612021-07-20 14:58:2158 days 13 hrs ago0xe58058a98e439f8650c15ccad3fc3149953a7495 IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.00084154
0x5b8325d33db8e15e2b644e9f5fd28c3d610c3c410bc0d86332d0de650297b53cBuy Tokens93249612021-07-20 14:58:2158 days 13 hrs ago0x247e7453d64a0fd2bff6fce4dcd0f2d185d47f02 IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.000766455
0x39310cc00b1841e99e8cc152e361c3adc8a0fd4d613ae6e794167f7dfab5133aBuy Tokens93249572021-07-20 14:58:0958 days 13 hrs ago0x7e03cd211a00a82525b5182f30ea8088cbc78aa9 IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.000745425
0x8dc5230354c526f7856db7a99c3a7e4cd467bd436b603cbc75f51669b2bc0c8cBuy Tokens93249552021-07-20 14:58:0358 days 13 hrs ago0xd085fa32b276e8d2ba65908f52a484c121c775a7 IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.000762455
0x4fbac882ffd33acf10492f73a729b582e6652f2fd6b56eb66078a362dd1fc57fBuy Tokens93249522021-07-20 14:57:5458 days 13 hrs ago0xf1011216260e5a23f21cbdff7ae800f1668d049a IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.00298218
0x464839cea48801e5c3d02b75660c3c3a8bd41c5b120cc369a94b13cfb7dc3201Buy Tokens93249502021-07-20 14:57:4858 days 13 hrs ago0x3d3d6eee3c4d3fa72070ba311e7186130ae06b1f IN  0xb5c0422fa4fe116214c094b8d51f2ac5fa27d9ea0 BNB0.00076642
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Similar Match)
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0x1BA5d976C76D9B89612aB50f0C24CD9Af9A04A7f

Contract Name:
TrustPadIDO

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 14 : GeneralIDO.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "./Timed.sol";

abstract contract GeneralIDO is Ownable, Timed {
    // Actual rate is: rate / 1e6
    // 6.123456 actual rate = 6123456 specified rate
    uint256 public rate;
    uint256 public tokensForSale;

    event RateChanged(uint256 newRate);
    event CapChanged(uint256 newRate);

    constructor(uint256 _rate, uint256 _tokensForSale) {
        rate = _rate;
        tokensForSale = _tokensForSale;
    }

    function setTokensForSale(uint _tokensForSale) external onlyOwner {
        require(!isLive(), "Sale: Sale is live, cap change not allowed");
        tokensForSale = _tokensForSale;
        emit CapChanged(tokensForSale);
    }

    function calculatePurchaseAmount(uint purchaseAmountWei) public view returns (uint256) {
        return purchaseAmountWei * rate / 1e6;
    }

    function setRate(uint256 newRate) public onlyOwner {
        require(!isLive(), "Sale: Sale is live, rate change not allowed");
        rate = newRate;
        emit RateChanged(rate);
    }
}

File 2 of 14 : Timed.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";

abstract contract Timed is Ownable {
    uint public startTime;
    uint public duration;
    uint public registerTime;
    uint public registerDuration;

    event StartChanged(uint256 time);
    event DurationChanged(uint256 duration);
    event RegisterTimeChanged(uint256 time);
    event RegisterDurationChanged(uint256 duration);

    constructor(uint256 _startTime, uint256 _saleDuration) {
        startTime = _startTime;
        duration = _saleDuration;
    }

    modifier ongoingSale(){
        require(isLive(), "Sale: Not live");
        _;
    }

    modifier ongoingRegister(){
        require(isRegistering(), "Sale: Not open for registration");
        require(!isLive(), "Sale: Cannot register, sale is live");
        _;
    }

    function isLive() public view returns (bool) {
        return block.timestamp > startTime && block.timestamp < startTime + duration;
    }

    function isRegistering() public view returns (bool) {
        return block.timestamp > registerTime && block.timestamp < registerTime + registerDuration;
    }

    function setStartTime(uint256 newTime) public onlyOwner {
        require(newTime > registerTime, "Sale: start time must be after the register time");
        startTime = newTime;
        emit StartChanged(startTime);
    }

    function setDuration(uint256 newDuration) public onlyOwner {
        duration = newDuration;
        emit DurationChanged(duration);
    }

    function setRegisterTime(uint256 newTime) public onlyOwner {
        require(newTime < startTime, "Sale: register time must be before the start time");
        registerTime = newTime;
        emit RegisterTimeChanged(registerTime);
    }

    function setRegisterDuration(uint256 newDuration) public onlyOwner {
        require(registerTime + newDuration < startTime, "Sale: register end must be before the start time");
        registerDuration = newDuration;
        emit RegisterDurationChanged(registerDuration);
    }
}

File 3 of 14 : TrustPadIDO.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "../staking/ILevelsStaking.sol";
import "./WithLimits.sol";
import "./Timed.sol";
import "./WithWhitelist.sol";
import "./WithLevelsSale.sol";
import "./Withdrawable.sol";
import "./GeneralIDO.sol";

contract TrustPadIDO is
Ownable,
ReentrancyGuard,
Timed,
GeneralIDO,
Withdrawable,
WithLimits,
WithWhitelist,
WithLevelsSale {
    using SafeERC20 for IERC20;

    string public id;
    uint256 public tokensSold;
    uint256 public raised;
    uint256 public participants;
    mapping(address => uint256) public balances;

    event TokensPurchased(address indexed beneficiary, uint256 value, uint256 amount);

    constructor(
        string memory _id,
        uint256 _startTime,
        uint256 _duration,
        uint256 _rate,
        uint256 _tokensForSale,
        address _fundToken
    )
    GeneralIDO(_rate, _tokensForSale)
    Timed(_startTime, _duration)
    Withdrawable(_fundToken) {
        id = _id;
    }

    function balanceOf(address account) external view returns (uint256) {
        return balances[account];
    }

    receive() external payable {
        require(!fundByTokens, "Sale: This presale is funded by tokens, use buyTokens(value)");
        buyTokens();
    }

    fallback() external {
        revert("Sale: Cannot buy, use the 'buyTokens' function");
    }

    function buyTokens() public payable ongoingSale nonReentrant {
        require(!fundByTokens, "Sale: presale is funded by tokens but value is missing");

        internalBuyTokens(msg.value);
    }

    /**
    * The fund token must be first approved to be transferred by presale contract for the given "value".
    */
    function buyTokens(uint256 value) public ongoingSale nonReentrant {
        require(fundByTokens, "Sale: funding by tokens is not allowed");
        require(fundToken.allowance(msg.sender, address(this)) >= value, 'Sale: fund token not approved');

        internalBuyTokens(value);

        fundToken.safeTransferFrom(msg.sender, address(this), value);
    }

    function internalBuyTokens(uint256 value) private {
        uint maxAllocation = checkAccountAllowedToBuy();

        address account = _msgSender();
        uint256 amount = calculatePurchaseAmount(value);
        tokensSold += amount;
        balances[account] += amount;

        require(amount > 0, "Sale: amount is 0");
        require(value >= minSell, "Sale: amount is too small");
        require(maxAllocation == 0 || balances[account] <= maxAllocation, "Sale: amount exceeds max allocation");
        require(tokensSold <= tokensForSale, "Sale: cap reached");

        raised = raised + value;
        participants = participants + 1;

        emit TokensPurchased(account, value, amount);
    }

    function checkAccountAllowedToBuy() private view returns (uint) {
        address account = _msgSender();
        uint levelAllocation = getUserLevelAllocation(account);
        uint maxAllocation = calculatePurchaseAmount(maxSell);

        // Public sale with no whitelist or levels
        if (!whitelistEnabled && !levelsEnabled) {
            return maxAllocation;
        }

        // User whitelisted, consider his level allocation too
        if (whitelistEnabled && whitelisted[msg.sender]) {
            if (levelsOpenAll()) {
                maxAllocation += maxAllocation;
                levelAllocation += levelAllocation / 2;
            }

            return max(maxAllocation, levelAllocation);
        }
        if (whitelistEnabled && !levelsEnabled) {
            revert('Sale: not in the whitelist');
        }

        // Check user level if levels enabled and user was not whitelisted
        if (levelsEnabled) {
            require(baseAllocation > 0, "Sale: levels are enabled but baseAllocation is not set");

            // If opened for all levels, just return the level allocation without checking user weight
            if (levelsOpenAll()) {
                (,,uint fcfsAllocation,) = getUserLevelState(account);
                return fcfsAllocation;
            }

            bytes memory levelBytes = bytes(userLevel[account]);
            require(levelBytes.length > 0, "Sale: user level is not registered");
            require(levelAllocation > 0, "Sale: user has no level allocation, not registered, lost lottery or level is too low");

            return levelAllocation;
        }

        revert('Sale: unreachable state');
    }

    function max(uint a, uint b) private pure returns (uint) {
        return a > b ? a : b;
    }
}

File 4 of 14 : WithLevelsSale.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "../staking/ILevelsStaking.sol";
import "./Timed.sol";
import "./GeneralIDO.sol";
import "./WithWhitelist.sol";
import "./WithLimits.sol";

abstract contract WithLevelsSale is Ownable, Timed, GeneralIDO, WithLimits, WithWhitelist {
    ILevelsStaking public levelsStaking;
    bool public levelsEnabled = true;
    bool public forceLevelsOpenAll = false;
    bool public lockOnRegister = true;

    // sale end - fcfsDuration = levelsOpenAll
    uint public fcfsDuration;

    // Sum of weights (lottery losers are subtracted when picking winners) for base allocation calculation
    uint public totalWeights;
    uint public baseAllocation;

    mapping(string => address[]) public levelAddresses;
    // Whether (and how many) winners were picked for a lottery level
    mapping(string => uint8) public winnersPicked;
    // Needed for user allocation calculation = baseAllocation * userWeight
    // If user lost lottery, his weight resets to 0 - means user can't participate in sale
    mapping(address => uint8) public userWeight;
    mapping(address => string) public userLevel;

    event BaseAllocationCalculated(uint256 baseAllocation, uint256 levelsAllocation);
    event BaseAllocationChanged(uint256 baseAllocation);
    event LevelsStakingChanged(address staking);
    event LevelsEnabled(bool status);
    event SaleOpenedForAllLevels(bool status);
    event LockOnRegisterEnabled(bool status);
    event FCFSDurationChanged(uint256 duration);
    event WinnersPicked(string tierId, uint totalN, uint winnersN, address[] winners);
    event Registered(address indexed account, string levelId, uint weight, bool tokensLocked);

    function levelsOpenAll() view public returns (bool) {
        return forceLevelsOpenAll || block.timestamp + fcfsDuration > startTime + duration;
    }

    /**
     * Return: id, multiplier, allocation, isWinner.
     *
     * User is a winner when:
     * - winners were picked for the level
     * - user has non-zero weight (i.e. registered and not excluded as loser)
     * - the level is a lottery level
     */
    function getUserLevelState(address account) view public returns (string memory, uint, uint, bool) {
        bytes memory levelBytes = bytes(userLevel[account]);
        string memory level;
        Structs.Tier memory tier;
        uint8 weight;

        bool levelsOpen = levelsOpenAll();
        if (levelsOpen) {
            tier = levelsStaking.getUserTier(account);
            weight = tier.multiplier;
            level = tier.id;
        } else {
            level = levelBytes.length == 0 ? 'none' : userLevel[account];
            tier = levelsStaking.getTierById(level);
            weight = userWeight[account];
        }

        uint allocation = weight * baseAllocation;
        if (levelsOpen && userWeight[account] > 0) {
            // If user wasn't registered/picked, he already got the full allocation (above),
            // add only a half to ones who were able to participate
            allocation += allocation / 2;
        }

        bool isWinner = levelBytes.length == 0
        ? false
        : tier.random && (levelsOpen || whitelisted[account] || (winnersPicked[level] > 0 && userWeight[account] > 0));

        return (level, weight, allocation, isWinner);
    }

    function getUserLevelAllocation(address account) view public returns (uint) {
        return userWeight[account] * baseAllocation;
    }

    function getLevelAddresses(string calldata id) view external returns (address[] memory) {
        return levelAddresses[id];
    }

    function getLevelWinners(string calldata id) view external returns (address[] memory) {
        address[] memory winners = new address[](winnersPicked[id]);

        if (winnersPicked[id] == 0) {
            return winners;
        }

        uint j = 0;
        for (uint256 i = 0; i < levelAddresses[id].length; i++) {
            address addr = levelAddresses[id][i];
            if (userWeight[addr] > 0) {
                winners[j] = addr;
                j++;
            }
        }

        return winners;
    }

    function getLevelNumbers() view external returns (string[] memory, uint[] memory) {
        string[] memory ids = levelsStaking.getTierIds();
        uint[] memory counts = new uint[](ids.length);
        for (uint i = 0; i < ids.length; i++) {
            counts[i] = levelAddresses[ids[i]].length;
        }
        return (ids, counts);
    }

    function getLevelNumber(string calldata id) view external returns (uint) {
        return levelAddresses[id].length;
    }

    function toggleLevels(bool status) external onlyOwner {
        levelsEnabled = status;
        emit LevelsEnabled(status);
    }

    function openForAllLevels(bool status) external onlyOwner {
        forceLevelsOpenAll = status;
        emit SaleOpenedForAllLevels(status);
    }

    function setFCFSDuration(uint256 newDuration) public onlyOwner {
        fcfsDuration = newDuration;
        emit FCFSDurationChanged(duration);
    }

    function toggleLockOnRegister(bool status) external onlyOwner {
        lockOnRegister = status;
        emit LockOnRegisterEnabled(status);
    }

    function setBaseAllocation(uint256 _baseAllocation) external onlyOwner {
        baseAllocation = _baseAllocation;
        emit BaseAllocationChanged(baseAllocation);
    }

    function setLevelsStaking(ILevelsStaking _staking) external onlyOwner {
        require(address(levelsStaking) == address(0), 'Sale: Staking contract is already set');
        levelsStaking = _staking;
        emit LevelsStakingChanged(address(levelsStaking));
    }

    /**
     * Find the new base allocation based on total weights of all levels, # of whitelisted accounts and their max buy.
     * Should be called after winners are picked.
     */
    function updateBaseAllocation() external onlyOwner {
        uint levelsAlloc = tokensForSale - whitelistAllocation();
        baseAllocation = levelsAlloc / totalWeights;

        emit BaseAllocationCalculated(baseAllocation, levelsAlloc);
    }

    /**
     * Register a user with his current level multiplier.
     * Level multiplier is added to total weights, which later is used to calculate the base allocation.
     * Address is stored, so we can see all registered people.
     *
     * Later, when picking winners, loser weight is removed from total weights for correct base allocation calculation.
     */
    function register() external ongoingRegister {
        require(levelsEnabled, 'Sale: Cannot register, levels disabled');
        require(address(levelsStaking) != address(0), 'Sale: Levels staking address is not specified');

        address account = _msgSender();
        require(userWeight[account] == 0, 'Sale: Already registered');

        Structs.Tier memory tier = levelsStaking.getUserTier(account);
        require(tier.multiplier > 0, 'Sale: Your level is too low to register');

        // Lock the staked tokens based on the current user level
        if (lockOnRegister) {
            levelsStaking.lock(account);
        }

        userLevel[account] = tier.id;
        userWeight[account] = tier.multiplier;
        totalWeights += tier.multiplier;
        levelAddresses[tier.id].push(account);

        emit Registered(account, tier.id, tier.multiplier, lockOnRegister);
    }

    function setWinners(string calldata id, address[] calldata winners) external onlyOwner {
        uint8 weight = levelsStaking.getTierById(id).multiplier;

        for (uint i = 0; i < levelAddresses[id].length; i++) {
            totalWeights -= userWeight[levelAddresses[id][i]];
            userWeight[levelAddresses[id][i]] = 0;
        }

        for (uint i = 0; i < winners.length; i++) {
            totalWeights += weight;
            userWeight[winners[i]] = weight;
            userLevel[winners[i]] = id;
        }
        winnersPicked[id] = uint8(winners.length);

        emit WinnersPicked(id, levelAddresses[id].length, winners.length, winners);
    }

    function pickWinners(string calldata id) external onlyOwner {
        Structs.Tier memory tier = levelsStaking.getTierById(id);
        require(tier.random, "Sale: Only lottery tiers are allowed to pick winners");

        uint8 odds = tier.odds;
        uint totalParticipants = levelAddresses[id].length;
        require(totalParticipants > 0, 'Sale: Participants number should be more than 0. Are there registered users in this level?');
        uint winnersCount = totalParticipants / odds;
        if (winnersCount == 0) {
            winnersCount = 1;
        }
        winnersPicked[id] = uint8(winnersCount);

        // Pick people with non-zero weight and mark them as losers, deducting the weight from total weights
        uint losersToPick = totalParticipants - winnersCount;
        uint attempts = 0;
        while (losersToPick > 0) {
            uint idx = randomNumber(attempts) % totalParticipants;
            attempts++;

            address loser = levelAddresses[id][idx];
            uint8 weight = userWeight[loser];

            // Was already excluded, skipping
            if (weight == 0) {
                continue;
            }

            totalWeights -= weight;
            userWeight[loser] = 0;
            losersToPick--;
        }

        // Collect and publish the list of winners
        address[] memory winners = new address[](winnersCount);
        for (uint256 i = 0; i < levelAddresses[id].length; i++) {
            address addr = levelAddresses[id][i];
            if (userWeight[addr] > 0) {
                winners[winners.length] = addr;
            }
        }
        emit WinnersPicked(id, totalParticipants, winners.length, winners);
    }

    function randomNumber(uint seed) private view returns (uint) {
        return uint(keccak256(abi.encodePacked(block.difficulty, block.timestamp, seed)));
    }

    function batchRegisterLevel(string memory tierId, uint weight, address[] calldata addresses) external onlyOwner {
        for (uint i = 0; i < addresses.length; i++) {
            address account = addresses[i];

            userLevel[account] = tierId;
            userWeight[account] = uint8(weight);
            totalWeights += weight;
            levelAddresses[tierId].push(account);
        }

        winnersPicked[tierId] = uint8(addresses.length);
    }
}

File 5 of 14 : WithLimits.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";

abstract contract WithLimits is Ownable {
    // Max sell per user in currency
    uint256 public maxSell;
    // Min contribution per TX in currency
    uint256 public minSell;

    event MinChanged(uint256 value);
    event MaxChanged(uint256 value);

    function getMinMaxLimits() external view returns (uint256, uint256) {
        return (minSell, maxSell);
    }

    function setMin(uint256 value) public onlyOwner {
        require(maxSell == 0 || value <= maxSell, "Must be smaller than max");
        minSell = value;
        emit MinChanged(value);
    }

    function setMax(uint256 value) public onlyOwner {
        require(minSell == 0 || value >= minSell, "Must be bigger than min");
        maxSell = value;
        emit MaxChanged(value);
    }
}

File 6 of 14 : WithWhitelist.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "./GeneralIDO.sol";
import "./WithLimits.sol";

abstract contract WithWhitelist is Ownable, GeneralIDO, WithLimits {
    bool public whitelistEnabled = true;
    mapping(address => bool) public whitelisted;
    uint internal whitelistedCount;

    event WhitelistEnabled(bool status);

    constructor() {
        whitelisted[msg.sender] = true;
    }

    function whitelistAllocation() public view returns (uint) {
        uint whitelistAlloc = calculatePurchaseAmount(maxSell);
        return whitelistAlloc * whitelistedCount;
    }

    function toggleWhitelist(bool status) public onlyOwner {
        whitelistEnabled = status;
        emit WhitelistEnabled(status);
    }

    function batchAddWhitelisted(address[] calldata addresses) external onlyOwner {
        for (uint i = 0; i < addresses.length; i++) {
            if (!whitelisted[addresses[i]]) {
                whitelisted[addresses[i]] = true;
                whitelistedCount += 1;
            }
        }
    }

    function batchRemoveWhitelisted(address[] calldata addresses) external onlyOwner {
        for (uint i = 0; i < addresses.length; i++) {
            if (whitelisted[addresses[i]]) {
                whitelisted[addresses[i]] = false;
                whitelistedCount -= 1;
            }
        }
    }
}

File 7 of 14 : Withdrawable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

abstract contract Withdrawable is Ownable {
    using SafeERC20 for IERC20;

    bool public fundByTokens = false;
    IERC20 public fundToken;

    event FundTokenChanged(address tokenAddress);

    constructor(address _fundToken) {
        fundByTokens = _fundToken != address(0);
        if (fundByTokens) {
            fundToken = IERC20(_fundToken);
        }
    }

    function setFundToken(address tokenAddress) external onlyOwner {
        fundByTokens = tokenAddress != address(0);
        fundToken = IERC20(tokenAddress);
        emit FundTokenChanged(tokenAddress);
    }

    /**
     * Withdraw ALL both BNB and the currency token if specified
     */
    function withdrawAll() external onlyOwner {
        uint256 balance = address(this).balance;
        if (balance > 0) {
            payable(owner()).transfer(balance);
        }

        if (fundByTokens && fundToken.balanceOf(address(this)) > 0) {
            fundToken.transfer(owner(), fundToken.balanceOf(address(this)));
        }
    }

    /**
     * Withdraw the specified amount of BNB or currency token
     */
    function withdrawBalance(uint256 amount) external onlyOwner {
        if (fundByTokens) {
            fundToken.transfer(owner(), amount);
        } else {
            payable(owner()).transfer(amount);
        }
    }

    /**
     * When tokens are sent to the sale by mistake: withdraw the specified token.
     */
    function withdrawToken(address token, uint256 amount) external onlyOwner {
        IERC20(token).transfer(owner(), amount);
    }
}

File 8 of 14 : ILevelsStaking.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

library Structs {
    struct UserInfo {
        uint256 amount;
        uint256 rewardDebt;
        uint256 pendingRewards;
        uint256 unlocksAt;
    }

    struct Tier {
        string id;
        uint8 multiplier;
        uint256 lockingPeriod; // in seconds
        uint256 minAmount; // tier is applied when userAmount >= minAmount
        bool random;
        uint8 odds; // divider: 2 = 50%, 4 = 25%, 10 = 10%
    }
}

interface ILevelsStaking {
    function getTierById(string calldata id) external view returns (Structs.Tier memory);
    function getUserTier(address account) external view returns (Structs.Tier memory);
    function getTierIds() external view returns (string[] memory);
    function lock(address account) external;
}

File 9 of 14 : Ownable.sol
// SPDX-License-Identifier: MIT

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 () {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 10 of 14 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor () {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 11 of 14 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

File 12 of 14 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

File 13 of 14 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

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

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 14 of 14 : Context.sol
// SPDX-License-Identifier: MIT

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) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "istanbul",
  "libraries": {
    "": {}
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"_id","type":"string"},{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_duration","type":"uint256"},{"internalType":"uint256","name":"_rate","type":"uint256"},{"internalType":"uint256","name":"_tokensForSale","type":"uint256"},{"internalType":"address","name":"_fundToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"baseAllocation","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"levelsAllocation","type":"uint256"}],"name":"BaseAllocationCalculated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"baseAllocation","type":"uint256"}],"name":"BaseAllocationChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newRate","type":"uint256"}],"name":"CapChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"}],"name":"DurationChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"}],"name":"FCFSDurationChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"}],"name":"FundTokenChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"LevelsEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"staking","type":"address"}],"name":"LevelsStakingChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"LockOnRegisterEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"MaxChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"MinChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newRate","type":"uint256"}],"name":"RateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"}],"name":"RegisterDurationChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"RegisterTimeChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"string","name":"levelId","type":"string"},{"indexed":false,"internalType":"uint256","name":"weight","type":"uint256"},{"indexed":false,"internalType":"bool","name":"tokensLocked","type":"bool"}],"name":"Registered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"SaleOpenedForAllLevels","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"StartChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensPurchased","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"WhitelistEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"tierId","type":"string"},{"indexed":false,"internalType":"uint256","name":"totalN","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"winnersN","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"winners","type":"address[]"}],"name":"WinnersPicked","type":"event"},{"stateMutability":"nonpayable","type":"fallback"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseAllocation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"addresses","type":"address[]"}],"name":"batchAddWhitelisted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"tierId","type":"string"},{"internalType":"uint256","name":"weight","type":"uint256"},{"internalType":"address[]","name":"addresses","type":"address[]"}],"name":"batchRegisterLevel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"addresses","type":"address[]"}],"name":"batchRemoveWhitelisted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"buyTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"buyTokens","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"purchaseAmountWei","type":"uint256"}],"name":"calculatePurchaseAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"duration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fcfsDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"forceLevelsOpenAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fundByTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fundToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"id","type":"string"}],"name":"getLevelAddresses","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"id","type":"string"}],"name":"getLevelNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLevelNumbers","outputs":[{"internalType":"string[]","name":"","type":"string[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"id","type":"string"}],"name":"getLevelWinners","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMinMaxLimits","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getUserLevelAllocation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getUserLevelState","outputs":[{"internalType":"string","name":"","type":"string"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"id","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isLive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRegistering","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"levelAddresses","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"levelsEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"levelsOpenAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"levelsStaking","outputs":[{"internalType":"contract ILevelsStaking","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockOnRegister","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSell","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minSell","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"openForAllLevels","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"participants","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"id","type":"string"}],"name":"pickWinners","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"raised","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"register","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"registerDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registerTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_baseAllocation","type":"uint256"}],"name":"setBaseAllocation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newDuration","type":"uint256"}],"name":"setDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newDuration","type":"uint256"}],"name":"setFCFSDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"setFundToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ILevelsStaking","name":"_staking","type":"address"}],"name":"setLevelsStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setMax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setMin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newRate","type":"uint256"}],"name":"setRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newDuration","type":"uint256"}],"name":"setRegisterDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newTime","type":"uint256"}],"name":"setRegisterTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newTime","type":"uint256"}],"name":"setStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokensForSale","type":"uint256"}],"name":"setTokensForSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"id","type":"string"},{"internalType":"address[]","name":"winners","type":"address[]"}],"name":"setWinners","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"toggleLevels","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"toggleLockOnRegister","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"toggleWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokensForSale","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensSold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalWeights","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateBaseAllocation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userLevel","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userWeight","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistAllocation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"winnersPicked","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040526008805460ff19908116909155600b80549091166001179055600e805462ffffff60a01b19166201000160a01b1790553480156200004157600080fd5b506040516200520038038062005200833981016040819052620000649162000212565b8083838787600033600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600180556002919091556003556006919091556007556008805460ff19166001600160a01b038316151590811790915560ff1615620001105760088054610100600160a81b0319166101006001600160a01b038416021790555b50336000908152600c60209081526040909120805460ff1916600117905586516200014291601691908901906200014f565b5050505050505062000376565b8280546200015d9062000323565b90600052602060002090601f016020900481019282620001815760008555620001cc565b82601f106200019c57805160ff1916838001178555620001cc565b82800160010185558215620001cc579182015b82811115620001cc578251825591602001919060010190620001af565b50620001da929150620001de565b5090565b5b80821115620001da5760008155600101620001df565b80516001600160a01b03811681146200020d57600080fd5b919050565b60008060008060008060c087890312156200022b578182fd5b86516001600160401b038082111562000242578384fd5b818901915089601f83011262000256578384fd5b8151818111156200026b576200026b62000360565b604051601f8201601f19908116603f0116810190838211818310171562000296576200029662000360565b81604052828152602093508c84848701011115620002b2578687fd5b8691505b82821015620002d55784820184015181830185015290830190620002b6565b82821115620002e657868484830101525b809a5050505080890151965050506040870151935060608701519250608087015191506200031760a08801620001f5565b90509295509295509295565b600181811c908216806200033857607f821691505b602082108114156200035a57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b614e7a80620003866000396000f3fe60806040526004361061041e5760003560e01c80637afc56f51161021e578063c96c813711610123578063e797d002116100ab578063f3a467471161007a578063f3a4674714610d58578063f6be71d114610d6d578063f733a16c14610d8d578063fefca77c14610da2578063ff0e562c14610dc2576104ab565b8063e797d00214610ce2578063eea6221714610d02578063f0ea4bfc14610d22578063f2fde38b14610d38576104ab565b8063d6e8b9b1116100f2578063d6e8b9b114610c3c578063d936547e14610c51578063da00734914610c81578063da76d5cd14610ca1578063e1b318c214610cc1576104ab565b8063c96c813714610bc1578063d0febe4c146104a1578063d2ab6be314610be1578063d3527bd614610c1c576104ab565b8063af640d0f116101a6578063bd30992411610175578063bd30992414610b23578063be40a32714610b43578063c138353714610b63578063c3816f6314610b8b578063c4bfce1814610bab576104ab565b8063af640d0f14610ac2578063b2b215b514610ad7578063b8eb354614610af8578063b8f7a66514610b0e576104ab565b8063926323d5116101ed578063926323d514610a2857806393b9400d14610a3e5780639e281a9814610a61578063a6b02bc314610a81578063ae0ffad214610aa1576104ab565b80637afc56f5146109b557806380e3f1ad146109d5578063853828b6146109f55780638da5cb5b14610a0a576104ab565b8063491ce4d011610324578063637c92ff116102ac578063715018a61161027b578063715018a614610934578063738fa94b1461094957806375a5b1ab14610969578063766daf7b1461097f57806378e979251461099f576104ab565b8063637c92ff1461089857806364661e4b146108b85780636c4470fb146108e857806370a08231146108fe576104ab565b806351fb012d116102f357806351fb012d146107da578063538a13f3146107f45780635666cd7814610821578063577174e914610836578063589d7c5414610856576104ab565b8063491ce4d01461074757806350adcdb71461076757806350ba7598146107a4578063518ab2a8146107c4576104ab565b8063280e31cc116103a75780633610724e116103765780633610724e146106b15780633b6d03ca146106d15780633d7faab9146106f15780633e0a322d1461070757806345dc3dd814610727576104ab565b8063280e31cc146106385780632c4e722e1461066557806334dadad51461067b57806334fcf43714610691576104ab565b80631302973a116103ee5780631302973a146105a057806318c08810146105b65780631aa3a008146105d65780631fe9eabc146105eb57806327e235e31461060b576104ab565b8062fed7001461051757806307ebef70146105465780630fb5a6b41461056657806312aef8c31461058a576104ab565b366104ab5760085460ff16156104a15760405162461bcd60e51b815260206004820152603c60248201527f53616c653a20546869732070726573616c652069732066756e6465642062792060448201527f746f6b656e732c2075736520627579546f6b656e732876616c7565290000000060648201526084015b60405180910390fd5b6104a9610de2565b005b3480156104b757600080fd5b5060405162461bcd60e51b815260206004820152602e60248201527f53616c653a2043616e6e6f74206275792c20757365207468652027627579546f60448201526d35b2b7399390333ab731ba34b7b760911b6064820152608401610498565b34801561052357600080fd5b506008546105319060ff1681565b60405190151581526020015b60405180910390f35b34801561055257600080fd5b506104a9610561366004614737565b610f00565b34801561057257600080fd5b5061057c60035481565b60405190815260200161053d565b34801561059657600080fd5b5061057c60075481565b3480156105ac57600080fd5b5061057c600a5481565b3480156105c257600080fd5b506104a96105d1366004614948565b6113d1565b3480156105e257600080fd5b506104a961143a565b3480156105f757600080fd5b506104a9610606366004614948565b611899565b34801561061757600080fd5b5061057c6106263660046145b8565b601a6020526000908152604090205481565b34801561064457600080fd5b506106586106533660046145b8565b611955565b60405161053d9190614bab565b34801561067157600080fd5b5061057c60065481565b34801561068757600080fd5b5061057c60045481565b34801561069d57600080fd5b506104a96106ac366004614948565b6119ef565b3480156106bd57600080fd5b506104a96106cc366004614948565b611ab7565b3480156106dd57600080fd5b506104a96106ec3660046146ff565b611cb6565b3480156106fd57600080fd5b5061057c600f5481565b34801561071357600080fd5b506104a9610722366004614948565b611d2d565b34801561073357600080fd5b506104a9610742366004614948565b611df6565b34801561075357600080fd5b506104a96107623660046145b8565b611eb2565b34801561077357600080fd5b5060085461078c9061010090046001600160a01b031681565b6040516001600160a01b03909116815260200161053d565b3480156107b057600080fd5b506104a96107bf366004614846565b611f3f565b3480156107d057600080fd5b5061057c60175481565b3480156107e657600080fd5b50600b546105319060ff1681565b34801561080057600080fd5b5061081461080f366004614737565b6120b5565b60405161053d9190614a3c565b34801561082d57600080fd5b5061057c612263565b34801561084257600080fd5b506104a961085136600461476a565b612287565b34801561086257600080fd5b506108866108713660046145b8565b60146020526000908152604090205460ff1681565b60405160ff909116815260200161053d565b3480156108a457600080fd5b506104a96108b3366004614948565b61262a565b3480156108c457600080fd5b506108d86108d33660046145b8565b6126f4565b60405161053d9493929190614bbe565b3480156108f457600080fd5b5061057c60195481565b34801561090a57600080fd5b5061057c6109193660046145b8565b6001600160a01b03166000908152601a602052604090205490565b34801561094057600080fd5b506104a9612b05565b34801561095557600080fd5b506104a9610964366004614948565b612b79565b34801561097557600080fd5b5061057c60055481565b34801561098b57600080fd5b506104a961099a3660046145ff565b612c4f565b3480156109ab57600080fd5b5061057c60025481565b3480156109c157600080fd5b506108146109d0366004614737565b612d81565b3480156109e157600080fd5b506104a96109f03660046146ff565b612dfe565b348015610a0157600080fd5b506104a9612e69565b348015610a1657600080fd5b506000546001600160a01b031661078c565b348015610a3457600080fd5b5061057c60105481565b348015610a4a57600080fd5b50610a53613096565b60405161053d929190614a4f565b348015610a6d57600080fd5b506104a9610a7c3660046145d4565b613218565b348015610a8d57600080fd5b5061057c610a9c366004614948565b6132e3565b348015610aad57600080fd5b50600e5461053190600160a81b900460ff1681565b348015610ace57600080fd5b50610658613301565b348015610ae357600080fd5b50600e5461053190600160b01b900460ff1681565b348015610b0457600080fd5b5061057c60095481565b348015610b1a57600080fd5b5061053161330e565b348015610b2f57600080fd5b5061057c610b3e3660046145b8565b613334565b348015610b4f57600080fd5b506104a9610b5e3660046146ff565b61335e565b348015610b6f57600080fd5b50600a546009546040805192835260208301919091520161053d565b348015610b9757600080fd5b5061078c610ba6366004614804565b6133d5565b348015610bb757600080fd5b5061057c60115481565b348015610bcd57600080fd5b506104a9610bdc366004614948565b61341c565b348015610bed57600080fd5b50610886610bfc3660046147d2565b805160208183018101805160138252928201919093012091525460ff1681565b348015610c2857600080fd5b506104a9610c373660046145ff565b61347b565b348015610c4857600080fd5b506104a96135a7565b348015610c5d57600080fd5b50610531610c6c3660046145b8565b600c6020526000908152604090205460ff1681565b348015610c8d57600080fd5b5061057c610c9c366004614737565b613633565b348015610cad57600080fd5b506104a9610cbc366004614948565b61365f565b348015610ccd57600080fd5b50600e5461053190600160a01b900460ff1681565b348015610cee57600080fd5b506104a9610cfd3660046145b8565b613729565b348015610d0e57600080fd5b506104a9610d1d366004614948565b613808565b348015610d2e57600080fd5b5061057c60185481565b348015610d4457600080fd5b506104a9610d533660046145b8565b6138cf565b348015610d6457600080fd5b506105316139b9565b348015610d7957600080fd5b506104a9610d88366004614948565b6139f2565b348015610d9957600080fd5b50610531613a51565b348015610dae57600080fd5b506104a9610dbd3660046146ff565b613a6f565b348015610dce57600080fd5b50600e5461078c906001600160a01b031681565b610dea61330e565b610e275760405162461bcd60e51b815260206004820152600e60248201526d53616c653a204e6f74206c69766560901b6044820152606401610498565b60026001541415610e7a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610498565b600260015560085460ff1615610ef15760405162461bcd60e51b815260206004820152603660248201527f53616c653a2070726573616c652069732066756e64656420627920746f6b656e60448201527573206275742076616c7565206973206d697373696e6760501b6064820152608401610498565b610efa34613ae6565b60018055565b6000546001600160a01b03163314610f2a5760405162461bcd60e51b815260040161049890614c1c565b600e5460405163d5a162bd60e01b81526000916001600160a01b03169063d5a162bd90610f5d9086908690600401614ae8565b60006040518083038186803b158015610f7557600080fd5b505afa158015610f89573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fb19190810190614899565b905080608001516110215760405162461bcd60e51b815260206004820152603460248201527f53616c653a204f6e6c79206c6f74746572792074696572732061726520616c6c6044820152736f77656420746f207069636b2077696e6e65727360601b6064820152608401610498565b60a081015160405160009060129061103c9087908790614a2c565b908152604051908190036020019020549050806110e75760405162461bcd60e51b815260206004820152605a60248201527f53616c653a205061727469636970616e7473206e756d6265722073686f756c6460448201527f206265206d6f7265207468616e20302e2041726520746865726520726567697360648201527f746572656420757365727320696e2074686973206c6576656c3f000000000000608482015260a401610498565b60006110f660ff841683614ce8565b905080611101575060015b8060138787604051611114929190614a2c565b908152604051908190036020019020805460ff9290921660ff1990921691909117905560006111438284614d1b565b905060005b811561126557604080514460208083019190915242828401526060808301859052835180840390910181526080909201909252805191012060009061118e908690614dcb565b90508161119a81614db0565b925050600060128a8a6040516111b1929190614a2c565b908152602001604051809103902082815481106111de57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b0316808352601490915260409091205490915060ff168061121657505050611148565b8060ff166010600082825461122b9190614d1b565b90915550506001600160a01b0382166000908152601460205260409020805460ff191690558461125a81614d5e565b955050505050611148565b6000836001600160401b0381111561128d57634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156112b6578160200160208202803683370190505b50905060005b60128a8a6040516112ce929190614a2c565b9081526040519081900360200190205481101561138557600060128b8b6040516112f9929190614a2c565b9081526020016040518091039020828154811061132657634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b0316808352601490915260409091205490915060ff161561137257825181908490634e487b7160e01b600052603260045260246000fd5b508061137d81614db0565b9150506112bc565b507f1384e026e8cb5a62c4b4038979dd91ae8a2e68f61772d6079c3b7e7384b89c1b8989878451856040516113be959493929190614b6d565b60405180910390a1505050505050505050565b6000546001600160a01b031633146113fb5760405162461bcd60e51b815260040161049890614c1c565b600f8190556003546040519081527fff9eb67881f60bf89c804c5f5baf096fc4011374504513568b2825aa85c60860906020015b60405180910390a150565b611442613a51565b61148e5760405162461bcd60e51b815260206004820152601f60248201527f53616c653a204e6f74206f70656e20666f7220726567697374726174696f6e006044820152606401610498565b61149661330e565b156114ef5760405162461bcd60e51b815260206004820152602360248201527f53616c653a2043616e6e6f742072656769737465722c2073616c65206973206c60448201526269766560e81b6064820152608401610498565b600e54600160a01b900460ff166115575760405162461bcd60e51b815260206004820152602660248201527f53616c653a2043616e6e6f742072656769737465722c206c6576656c732064696044820152651cd8589b195960d21b6064820152608401610498565b600e546001600160a01b03166115c55760405162461bcd60e51b815260206004820152602d60248201527f53616c653a204c6576656c73207374616b696e6720616464726573732069732060448201526c1b9bdd081cdc1958da599a5959609a1b6064820152608401610498565b3360008181526014602052604090205460ff16156116255760405162461bcd60e51b815260206004820152601860248201527f53616c653a20416c7265616479207265676973746572656400000000000000006044820152606401610498565b600e54604051637269310760e11b81526001600160a01b038381166004830152600092169063e4d2620e9060240160006040518083038186803b15801561166b57600080fd5b505afa15801561167f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526116a79190810190614899565b90506000816020015160ff16116117105760405162461bcd60e51b815260206004820152602760248201527f53616c653a20596f7572206c6576656c20697320746f6f206c6f7720746f207260448201526632b3b4b9ba32b960c91b6064820152608401610498565b600e54600160b01b900460ff161561178257600e5460405163f435f5a760e01b81526001600160a01b0384811660048301529091169063f435f5a790602401600060405180830381600087803b15801561176957600080fd5b505af115801561177d573d6000803e3d6000fd5b505050505b80516001600160a01b038316600090815260156020908152604090912082516117b09391929091019061436e565b50602081810180516001600160a01b0385166000908152601490935260408320805460ff191660ff9283161790559051601080549190921692906117f5908490614cd0565b9091555050805160405160129161180b91614a10565b9081526040516020918190038201812080546001810182556000918252908390200180546001600160a01b0319166001600160a01b038616908117909155835192840151600e5491937f2c4f034e06930af56f941f70cd4d8a322e62777b01e1db02013de59b1a626d189361188d93919291600160b01b900460ff1690614bef565b60405180910390a25050565b6000546001600160a01b031633146118c35760405162461bcd60e51b815260040161049890614c1c565b600a5415806118d45750600a548110155b6119205760405162461bcd60e51b815260206004820152601760248201527f4d75737420626520626967676572207468616e206d696e0000000000000000006044820152606401610498565b60098190556040518181527f770427b1be4e1c22afadce4780c0ad65c0cbdd9b12543bea5a992f5bda0255079060200161142f565b6015602052600090815260409020805461196e90614d75565b80601f016020809104026020016040519081016040528092919081815260200182805461199a90614d75565b80156119e75780601f106119bc576101008083540402835291602001916119e7565b820191906000526020600020905b8154815290600101906020018083116119ca57829003601f168201915b505050505081565b6000546001600160a01b03163314611a195760405162461bcd60e51b815260040161049890614c1c565b611a2161330e565b15611a825760405162461bcd60e51b815260206004820152602b60248201527f53616c653a2053616c65206973206c6976652c2072617465206368616e67652060448201526a1b9bdd08185b1b1bddd95960aa1b6064820152608401610498565b60068190556040518181527f595a30f13a69b616c4d568e2a2b7875fdfe86e4300a049953c76ee278f8f3f109060200161142f565b611abf61330e565b611afc5760405162461bcd60e51b815260206004820152600e60248201526d53616c653a204e6f74206c69766560901b6044820152606401610498565b60026001541415611b4f5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610498565b600260015560085460ff16611bb55760405162461bcd60e51b815260206004820152602660248201527f53616c653a2066756e64696e6720627920746f6b656e73206973206e6f7420616044820152651b1b1bddd95960d21b6064820152608401610498565b600854604051636eb1769f60e11b8152336004820152306024820152829161010090046001600160a01b03169063dd62ed3e9060440160206040518083038186803b158015611c0357600080fd5b505afa158015611c17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3b9190614960565b1015611c895760405162461bcd60e51b815260206004820152601d60248201527f53616c653a2066756e6420746f6b656e206e6f7420617070726f7665640000006044820152606401610498565b611c9281613ae6565b600854611caf9061010090046001600160a01b0316333084613d08565b5060018055565b6000546001600160a01b03163314611ce05760405162461bcd60e51b815260040161049890614c1c565b600e8054821515600160a81b0260ff60a81b199091161790556040517f2f82dda56001bd3e8726092bb940912a2b44c3994cde91f6946ec09e36870aff9061142f90831515815260200190565b6000546001600160a01b03163314611d575760405162461bcd60e51b815260040161049890614c1c565b6004548111611dc15760405162461bcd60e51b815260206004820152603060248201527f53616c653a2073746172742074696d65206d757374206265206166746572207460448201526f68652072656769737465722074696d6560801b6064820152608401610498565b60028190556040518181527fb40bc62c7614c21c292641d79509c0572ffdcf912e874169cf69162e026146c99060200161142f565b6000546001600160a01b03163314611e205760405162461bcd60e51b815260040161049890614c1c565b6009541580611e3157506009548111155b611e7d5760405162461bcd60e51b815260206004820152601860248201527f4d75737420626520736d616c6c6572207468616e206d617800000000000000006044820152606401610498565b600a8190556040518181527f46077927d83541de01a449629a0bb1dbeb03e03fd6ee2e3ba4bf2952e39433509060200161142f565b6000546001600160a01b03163314611edc5760405162461bcd60e51b815260040161049890614c1c565b600880546001600160a81b0319166001600160a01b038316801515610100600160a81b031916919091176101008202179091556040519081527f212b2eba76cc5f9d7a0ee5363b517577da12e63f1231d6329ed6ff838b9973c49060200161142f565b6000546001600160a01b03163314611f695760405162461bcd60e51b815260040161049890614c1c565b60005b81811015612078576000838383818110611f9657634e487b7160e01b600052603260045260246000fd5b9050602002016020810190611fab91906145b8565b6001600160a01b03811660009081526015602090815260409091208851929350611fd992909189019061436e565b506001600160a01b0381166000908152601460205260408120805460ff191660ff881617905560108054879290612011908490614cd0565b9091555050604051601290612027908890614a10565b90815260405160209181900382019020805460018101825560009182529190200180546001600160a01b0319166001600160a01b03929092169190911790558061207081614db0565b915050611f6c565b50604051819060139061208c908790614a10565b908152604051908190036020019020805460ff9290921660ff1990921691909117905550505050565b60606000601384846040516120cb929190614a2c565b9081526040519081900360200190205460ff166001600160401b0381111561210357634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561212c578160200160208202803683370190505b50905060138484604051612141929190614a2c565b9081526040519081900360200190205460ff1661215f57905061225d565b6000805b60128686604051612175929190614a2c565b90815260405190819003602001902054811015612257576000601287876040516121a0929190614a2c565b908152602001604051809103902082815481106121cd57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b0316808352601490915260409091205490915060ff1615612244578084848151811061221e57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03909216602092830291909101909101528261224081614db0565b9350505b508061224f81614db0565b915050612163565b50909150505b92915050565b6000806122716009546132e3565b9050600d54816122819190614cfc565b91505090565b6000546001600160a01b031633146122b15760405162461bcd60e51b815260040161049890614c1c565b600e5460405163d5a162bd60e01b81526000916001600160a01b03169063d5a162bd906122e49088908890600401614ae8565b60006040518083038186803b1580156122fc57600080fd5b505afa158015612310573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526123389190810190614899565b60200151905060005b60128686604051612353929190614a2c565b9081526040519081900360200190205481101561247e576014600060128888604051612380929190614a2c565b908152602001604051809103902083815481106123ad57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040018120546010805460ff9092169290916123e9908490614d1b565b9250508190555060006014600060128989604051612408929190614a2c565b9081526020016040518091039020848154811061243557634e487b7160e01b600052603260045260246000fd5b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff191660ff929092169190911790558061247681614db0565b915050612341565b5060005b82811015612589578160ff166010600082825461249f9190614cd0565b90915550829050601460008686858181106124ca57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906124df91906145b8565b6001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908360ff16021790555085856015600087878681811061253d57634e487b7160e01b600052603260045260246000fd5b905060200201602081019061255291906145b8565b6001600160a01b0316815260208101919091526040016000206125769290916143f2565b508061258181614db0565b915050612482565b50604051829060139061259f9088908890614a2c565b908152602001604051809103902060006101000a81548160ff021916908360ff1602179055507f1384e026e8cb5a62c4b4038979dd91ae8a2e68f61772d6079c3b7e7384b89c1b8585601288886040516125fa929190614a2c565b9081526040519081900360200181205461261b939291879089908290614afc565b60405180910390a15050505050565b6000546001600160a01b031633146126545760405162461bcd60e51b815260040161049890614c1c565b60025481106126bf5760405162461bcd60e51b815260206004820152603160248201527f53616c653a2072656769737465722074696d65206d757374206265206265666f6044820152707265207468652073746172742074696d6560781b6064820152608401610498565b60048190556040518181527f90d3be8da38886a5f029d2f1188aa8d57c6826b16cbc7abdcf22d883f6605acc9060200161142f565b6001600160a01b038116600090815260156020526040812080546060929182918291829161272190614d75565b80601f016020809104026020016040519081016040528092919081815260200182805461274d90614d75565b801561279a5780601f1061276f5761010080835404028352916020019161279a565b820191906000526020600020905b81548152906001019060200180831161277d57829003601f168201915b5050505050905060606127e46040518060c0016040528060608152602001600060ff1681526020016000815260200160008152602001600015158152602001600060ff1681525090565b6000806127ef6139b9565b9050801561288b57600e54604051637269310760e11b81526001600160a01b038c811660048301529091169063e4d2620e9060240160006040518083038186803b15801561283c57600080fd5b505afa158015612850573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526128789190810190614899565b60208101518151955090935091506129fd565b845115612938576001600160a01b038a16600090815260156020526040902080546128b590614d75565b80601f01602080910402602001604051908101604052809291908181526020018280546128e190614d75565b801561292e5780601f106129035761010080835404028352916020019161292e565b820191906000526020600020905b81548152906001019060200180831161291157829003601f168201915b5050505050612956565b604051806040016040528060048152602001636e6f6e6560e01b8152505b600e5460405163d5a162bd60e01b81529195506001600160a01b03169063d5a162bd90612987908790600401614bab565b60006040518083038186803b15801561299f57600080fd5b505afa1580156129b3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526129db9190810190614899565b6001600160a01b038b1660009081526014602052604090205490935060ff1691505b60006011548360ff16612a109190614cfc565b9050818015612a3957506001600160a01b038b1660009081526014602052604090205460ff1615155b15612a5657612a49600282614ce8565b612a539082614cd0565b90505b60008651600014612ae85784608001518015612ae357508280612a9157506001600160a01b038c166000908152600c602052604090205460ff165b80612ae357506000601387604051612aa99190614a10565b9081526040519081900360200190205460ff16118015612ae357506001600160a01b038c1660009081526014602052604090205460ff1615155b612aeb565b60005b959c60ff949094169b509099509397509095505050505050565b6000546001600160a01b03163314612b2f5760405162461bcd60e51b815260040161049890614c1c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314612ba35760405162461bcd60e51b815260040161049890614c1c565b60025481600454612bb49190614cd0565b10612c1a5760405162461bcd60e51b815260206004820152603060248201527f53616c653a20726567697374657220656e64206d757374206265206265666f7260448201526f65207468652073746172742074696d6560801b6064820152608401610498565b60058190556040518181527f0427e7ba04df00e564e2a87324ce9927680ca725fde43516ad6055c9d3c6b6ad9060200161142f565b6000546001600160a01b03163314612c795760405162461bcd60e51b815260040161049890614c1c565b60005b81811015612d7c57600c6000848484818110612ca857634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612cbd91906145b8565b6001600160a01b0316815260208101919091526040016000205460ff1615612d6a576000600c6000858585818110612d0557634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612d1a91906145b8565b6001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600d6000828254612d649190614d1b565b90915550505b80612d7481614db0565b915050612c7c565b505050565b606060128383604051612d95929190614a2c565b9081526040805191829003602090810183208054808302850183019093528284529190830182828015612df157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612dd3575b5050505050905092915050565b6000546001600160a01b03163314612e285760405162461bcd60e51b815260040161049890614c1c565b600b805460ff19168215159081179091556040519081527f9bea0dd3cae4438dc4c54c3110002aedc380f4075b6edae73ae0536105a2008a9060200161142f565b6000546001600160a01b03163314612e935760405162461bcd60e51b815260040161049890614c1c565b478015612ed557600080546040516001600160a01b039091169183156108fc02918491818181858888f19350505050158015612ed3573d6000803e3d6000fd5b505b60085460ff168015612f6557506008546040516370a0823160e01b815230600482015260009161010090046001600160a01b0316906370a082319060240160206040518083038186803b158015612f2b57600080fd5b505afa158015612f3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f639190614960565b115b15613093576008546001600160a01b036101009091041663a9059cbb612f936000546001600160a01b031690565b6008546040516370a0823160e01b81523060048201526101009091046001600160a01b0316906370a082319060240160206040518083038186803b158015612fda57600080fd5b505afa158015612fee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130129190614960565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044015b602060405180830381600087803b15801561305957600080fd5b505af115801561306d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613091919061471b565b505b50565b6060806000600e60009054906101000a90046001600160a01b03166001600160a01b031663d8cde1c66040518163ffffffff1660e01b815260040160006040518083038186803b1580156130e957600080fd5b505afa1580156130fd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613125919081019061463e565b9050600081516001600160401b0381111561315057634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015613179578160200160208202803683370190505b50905060005b825181101561320e5760128382815181106131aa57634e487b7160e01b600052603260045260246000fd5b60200260200101516040516131bf9190614a10565b9081526020016040518091039020805490508282815181106131f157634e487b7160e01b600052603260045260246000fd5b60209081029190910101528061320681614db0565b91505061317f565b5090939092509050565b6000546001600160a01b031633146132425760405162461bcd60e51b815260040161049890614c1c565b816001600160a01b031663a9059cbb6132636000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b1580156132ab57600080fd5b505af11580156132bf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d7c919061471b565b6000620f4240600654836132f79190614cfc565b61225d9190614ce8565b6016805461196e90614d75565b60006002544211801561332f575060035460025461332c9190614cd0565b42105b905090565b6011546001600160a01b038216600090815260146020526040812054909161225d9160ff16614cfc565b6000546001600160a01b031633146133885760405162461bcd60e51b815260040161049890614c1c565b600e8054821515600160b01b0260ff60b01b199091161790556040517f0615d623d485097ea27091190b1b298ccd7557f48c9f963a477f18185af6b8999061142f90831515815260200190565b8151602081840181018051601282529282019185019190912091905280548290811061340057600080fd5b6000918252602090912001546001600160a01b03169150829050565b6000546001600160a01b031633146134465760405162461bcd60e51b815260040161049890614c1c565b60118190556040518181527fde564456246ca1697b6573255d45061d65b3e9ee5a2577854152bbd6b80ad3a49060200161142f565b6000546001600160a01b031633146134a55760405162461bcd60e51b815260040161049890614c1c565b60005b81811015612d7c57600c60008484848181106134d457634e487b7160e01b600052603260045260246000fd5b90506020020160208101906134e991906145b8565b6001600160a01b0316815260208101919091526040016000205460ff16613595576001600c600085858581811061353057634e487b7160e01b600052603260045260246000fd5b905060200201602081019061354591906145b8565b6001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600d600082825461358f9190614cd0565b90915550505b8061359f81614db0565b9150506134a8565b6000546001600160a01b031633146135d15760405162461bcd60e51b815260040161049890614c1c565b60006135db612263565b6007546135e89190614d1b565b9050601054816135f89190614ce8565b601181905560408051918252602082018390527fc5aaa53d8a53bcc079422d70f3e62fa174bef2a1ce91dbef53ecc73f3e4956cf910161142f565b600060128383604051613647929190614a2c565b90815260405190819003602001902054905092915050565b6000546001600160a01b031633146136895760405162461bcd60e51b815260040161049890614c1c565b60085460ff16156136f0576008546001600160a01b036101009091041663a9059cbb6136bd6000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024810184905260440161303f565b600080546040516001600160a01b039091169183156108fc02918491818181858888f19350505050158015613091573d6000803e3d6000fd5b6000546001600160a01b031633146137535760405162461bcd60e51b815260040161049890614c1c565b600e546001600160a01b0316156137ba5760405162461bcd60e51b815260206004820152602560248201527f53616c653a205374616b696e6720636f6e747261637420697320616c726561646044820152641e481cd95d60da1b6064820152608401610498565b600e80546001600160a01b0319166001600160a01b0383169081179091556040519081527fe4e32051fe8e9eb36a875f8ce993530de8409e2baeca6a55638b8e1185aecade9060200161142f565b6000546001600160a01b031633146138325760405162461bcd60e51b815260040161049890614c1c565b61383a61330e565b1561389a5760405162461bcd60e51b815260206004820152602a60248201527f53616c653a2053616c65206973206c6976652c20636170206368616e6765206e6044820152691bdd08185b1b1bddd95960b21b6064820152608401610498565b60078190556040518181527f162238f20a51a0fd11d4e4e9ea154917f3776b59af9fedaeaf42676ad580a2c79060200161142f565b6000546001600160a01b031633146138f95760405162461bcd60e51b815260040161049890614c1c565b6001600160a01b03811661395e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610498565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600e54600090600160a81b900460ff168061332f57506003546002546139df9190614cd0565b600f546139ec9042614cd0565b11905090565b6000546001600160a01b03163314613a1c5760405162461bcd60e51b815260040161049890614c1c565b60038190556040518181527f9bb10695bde7db94333a5404f0767118f3965fd73217e45f96529c3d368285af9060200161142f565b60006004544211801561332f575060055460045461332c9190614cd0565b6000546001600160a01b03163314613a995760405162461bcd60e51b815260040161049890614c1c565b600e8054821515600160a01b0260ff60a01b199091161790556040517f5a93387354333593ee4e928f4c1050f3f43ca3f370542ce5de543ca1b71092889061142f90831515815260200190565b6000613af0613d68565b9050336000613afe846132e3565b90508060176000828254613b129190614cd0565b90915550506001600160a01b0382166000908152601a602052604081208054839290613b3f908490614cd0565b909155505080613b855760405162461bcd60e51b8152602060048201526011602482015270053616c653a20616d6f756e74206973203607c1b6044820152606401610498565b600a54841015613bd75760405162461bcd60e51b815260206004820152601960248201527f53616c653a20616d6f756e7420697320746f6f20736d616c6c000000000000006044820152606401610498565b821580613bfc57506001600160a01b0382166000908152601a60205260409020548310155b613c545760405162461bcd60e51b815260206004820152602360248201527f53616c653a20616d6f756e742065786365656473206d617820616c6c6f63617460448201526234b7b760e91b6064820152608401610498565b6007546017541115613c9c5760405162461bcd60e51b815260206004820152601160248201527014d85b194e8818d85c081c995858da1959607a1b6044820152606401610498565b83601854613caa9190614cd0565b601855601954613cbb906001614cd0565b60195560408051858152602081018390526001600160a01b038416917f8fafebcaf9d154343dad25669bfa277f4fbacd7ac6b0c4fed522580e040a0f33910160405180910390a250505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052613d6290859061410c565b50505050565b60003381613d7582613334565b90506000613d846009546132e3565b600b5490915060ff16158015613da45750600e54600160a01b900460ff16155b15613db0579392505050565b600b5460ff168015613dd15750336000908152600c602052604090205460ff165b15613e1957613dde6139b9565b15613e0757613ded8180614cd0565b9050613dfa600283614ce8565b613e049083614cd0565b91505b613e1181836141de565b935050505090565b600b5460ff168015613e355750600e54600160a01b900460ff16155b15613e825760405162461bcd60e51b815260206004820152601a60248201527f53616c653a206e6f7420696e207468652077686974656c6973740000000000006044820152606401610498565b600e54600160a01b900460ff16156140c457600060115411613f055760405162461bcd60e51b815260206004820152603660248201527f53616c653a206c6576656c732061726520656e61626c6564206275742062617360448201527519505b1b1bd8d85d1a5bdb881a5cc81b9bdd081cd95d60521b6064820152608401610498565b613f0d6139b9565b15613f29576000613f1d846126f4565b50979650505050505050565b6001600160a01b03831660009081526015602052604081208054613f4c90614d75565b80601f0160208091040260200160405190810160405280929190818152602001828054613f7890614d75565b8015613fc55780601f10613f9a57610100808354040283529160200191613fc5565b820191906000526020600020905b815481529060010190602001808311613fa857829003601f168201915b5050505050905060008151116140285760405162461bcd60e51b815260206004820152602260248201527f53616c653a2075736572206c6576656c206973206e6f74207265676973746572604482015261195960f21b6064820152608401610498565b600083116140bb5760405162461bcd60e51b815260206004820152605460248201527f53616c653a207573657220686173206e6f206c6576656c20616c6c6f6361746960448201527f6f6e2c206e6f7420726567697374657265642c206c6f7374206c6f7474657279606482015273206f72206c6576656c20697320746f6f206c6f7760601b608482015260a401610498565b50909392505050565b60405162461bcd60e51b815260206004820152601760248201527f53616c653a20756e726561636861626c652073746174650000000000000000006044820152606401610498565b6000614161826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166141f69092919063ffffffff16565b805190915015612d7c578080602001905181019061417f919061471b565b612d7c5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610498565b60008183116141ed57816141ef565b825b9392505050565b6060614205848460008561420d565b949350505050565b60608247101561426e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610498565b843b6142bc5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610498565b600080866001600160a01b031685876040516142d89190614a10565b60006040518083038185875af1925050503d8060008114614315576040519150601f19603f3d011682016040523d82523d6000602084013e61431a565b606091505b509150915061432a828286614335565b979650505050505050565b606083156143445750816141ef565b8251156143545782518084602001fd5b8160405162461bcd60e51b81526004016104989190614bab565b82805461437a90614d75565b90600052602060002090601f01602090048101928261439c57600085556143e2565b82601f106143b557805160ff19168380011785556143e2565b828001600101855582156143e2579182015b828111156143e25782518255916020019190600101906143c7565b506143ee929150614466565b5090565b8280546143fe90614d75565b90600052602060002090601f01602090048101928261442057600085556143e2565b82601f106144395782800160ff198235161785556143e2565b828001600101855582156143e2579182015b828111156143e257823582559160200191906001019061444b565b5b808211156143ee5760008155600101614467565b60008083601f84011261448c578182fd5b5081356001600160401b038111156144a2578182fd5b6020830191508360208260051b85010111156144bd57600080fd5b9250929050565b80516144cf81614e36565b919050565b60008083601f8401126144e5578182fd5b5081356001600160401b038111156144fb578182fd5b6020830191508360208285010111156144bd57600080fd5b600082601f830112614523578081fd5b813561453661453182614ca9565b614c79565b81815284602083860101111561454a578283fd5b816020850160208301379081016020019190915292915050565b600082601f830112614574578081fd5b815161458261453182614ca9565b818152846020838601011115614596578283fd5b614205826020830160208701614d32565b805160ff811681146144cf57600080fd5b6000602082840312156145c9578081fd5b81356141ef81614e21565b600080604083850312156145e6578081fd5b82356145f181614e21565b946020939093013593505050565b60008060208385031215614611578182fd5b82356001600160401b03811115614626578283fd5b6146328582860161447b565b90969095509350505050565b60006020808385031215614650578182fd5b82516001600160401b0380821115614666578384fd5b818501915085601f830112614679578384fd5b81518181111561468b5761468b614e0b565b8060051b61469a858201614c79565b8281528581019085870183870188018b10156146b4578889fd5b8893505b848410156146f1578051868111156146ce57898afd5b6146dc8c8a838b0101614564565b845250600193909301929187019187016146b8565b509998505050505050505050565b600060208284031215614710578081fd5b81356141ef81614e36565b60006020828403121561472c578081fd5b81516141ef81614e36565b60008060208385031215614749578182fd5b82356001600160401b0381111561475e578283fd5b614632858286016144d4565b6000806000806040858703121561477f578182fd5b84356001600160401b0380821115614795578384fd5b6147a1888389016144d4565b909650945060208701359150808211156147b9578384fd5b506147c68782880161447b565b95989497509550505050565b6000602082840312156147e3578081fd5b81356001600160401b038111156147f8578182fd5b61420584828501614513565b60008060408385031215614816578182fd5b82356001600160401b0381111561482b578283fd5b61483785828601614513565b95602094909401359450505050565b6000806000806060858703121561485b578182fd5b84356001600160401b0380821115614871578384fd5b61487d88838901614513565b95506020870135945060408701359150808211156147b9578384fd5b6000602082840312156148aa578081fd5b81516001600160401b03808211156148c0578283fd5b9083019060c082860312156148d3578283fd5b6148db614c51565b8251828111156148e9578485fd5b6148f587828601614564565b825250614904602084016145a7565b60208201526040830151604082015260608301516060820152614929608084016144c4565b608082015261493a60a084016145a7565b60a082015295945050505050565b600060208284031215614959578081fd5b5035919050565b600060208284031215614971578081fd5b5051919050565b6000815180845260208085019450808401835b838110156149b05781516001600160a01b03168752958201959082019060010161498b565b509495945050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600081518084526149fc816020860160208601614d32565b601f01601f19169290920160200192915050565b60008251614a22818460208701614d32565b9190910192915050565b8183823760009101908152919050565b6020815260006141ef6020830184614978565b6000604082016040835280855180835260608501915060608160051b86010192506020808801855b83811015614aa557605f19888703018552614a938683516149e4565b95509382019390820190600101614a77565b505085840381870152865180855287820194820193509150845b82811015614adb57845184529381019392810192600101614abf565b5091979650505050505050565b6020815260006142056020830184866149bb565b608081526000614b1060808301888a6149bb565b602083810188905260408401879052838203606085015284825285918101835b86811015614b5e578335614b4381614e21565b6001600160a01b031682529282019290820190600101614b30565b509a9950505050505050505050565b608081526000614b816080830187896149bb565b8560208401528460408401528281036060840152614b9f8185614978565b98975050505050505050565b6020815260006141ef60208301846149e4565b608081526000614bd160808301876149e4565b60208301959095525060408101929092521515606090910152919050565b606081526000614c0260608301866149e4565b60ff94909416602083015250901515604090910152919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60405160c081016001600160401b0381118282101715614c7357614c73614e0b565b60405290565b604051601f8201601f191681016001600160401b0381118282101715614ca157614ca1614e0b565b604052919050565b60006001600160401b03821115614cc257614cc2614e0b565b50601f01601f191660200190565b60008219821115614ce357614ce3614ddf565b500190565b600082614cf757614cf7614df5565b500490565b6000816000190483118215151615614d1657614d16614ddf565b500290565b600082821015614d2d57614d2d614ddf565b500390565b60005b83811015614d4d578181015183820152602001614d35565b83811115613d625750506000910152565b600081614d6d57614d6d614ddf565b506000190190565b600181811c90821680614d8957607f821691505b60208210811415614daa57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415614dc457614dc4614ddf565b5060010190565b600082614dda57614dda614df5565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461309357600080fd5b801515811461309357600080fdfea26469706673582212204ddf7872f4f299ed1104c6b105bdcabb9a15e6c69f4dbeb8ab7c7940dc2d835064736f6c6343000804003300000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000060e55f000000000000000000000000000000000000000000000000000000000000004650000000000000000000000000000000000000000000000000000000000054c56300000000000000000000000000000000000000000000943b1377290cbd800000000000000000000000000000cde404438d58421bf79e4b9c86f992af1a087b87000000000000000000000000000000000000000000000000000000000000000478696f6e00000000000000000000000000000000000000000000000000000000

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.