false
true

Contract Address Details

0x4aAa2b52b482A01BCCEAb0FB8a18fb255f9196Cb

Contract Name
EthTrendBet
Creator
0x8687d8–47bc82 at 0xbd5e1e–5c952c
Balance
0
Tokens
Fetching tokens...
Transactions
790 Transactions
Transfers
755 Transfers
Gas Used
108,756,551
Last Balance Update
19735569
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
EthTrendBet




Optimization enabled
true
Compiler version
v0.8.20+commit.a1b79de6




Optimization runs
100000
EVM Version
paris




Verified at
2025-05-12T12:38:17.906720Z

Constructor Arguments

0x000000000000000000000000abccefb00528c9c792ac7c46997f0f6ee5dcdddd0000000000000000000000002b6a10fd3e7f8bd87aa16b20a501f0ded14d51f00000000000000000000000000000000000000000000000000000000000000e10000000000000000000000000000000000000000000000000000000000000038400000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000003200000000000000000000000000eabf561f9a6c611caa9c0b766b9224d7467ef1b

Arg [0] (address) : 0xabccefb00528c9c792ac7c46997f0f6ee5dcdddd
Arg [1] (address) : 0x2b6a10fd3e7f8bd87aa16b20a501f0ded14d51f0
Arg [2] (uint256) : 3600
Arg [3] (uint256) : 900
Arg [4] (uint256) : 200
Arg [5] (uint256) : 800
Arg [6] (address) : 0x0eabf561f9a6c611caa9c0b766b9224d7467ef1b

              

contracts/factory/EthTrendBet.sol

Sol2uml
new
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";

// Custom interface for burnable ERC20 token
interface IERC20Burnable is IERC20 {
    function burn(uint256 amount) external;
    function decimals() external view returns (uint8);
}

contract EthTrendBet is Ownable, ReentrancyGuard, Pausable {
    enum Direction { Up, Down }
    enum RoundStatus { Active, Settled, Voided }

    // Data structure for each betting round
    struct Round {
        uint256 id; // Round ID, auto-incremented
        uint256 startTime; // Start timestamp, user can place bet before this time
        uint256 endTime; // End timestamp, oracle can submit close price before this time + priceSubmissionWindow
        uint256 openPrice; // Opening price
        uint256 closePrice; // Closing price
        uint256 upAmount; // Total amount bet on upward direction
        uint256 downAmount; // Total amount bet on downward direction
        uint256 winnerPool; // Total reward pool for winners (including principal)
        RoundStatus status; // Current status of the round
        Direction finalDirection; // Final price direction result
        uint256 ups; // Number of participants betting Up
        uint256 downs; // Number of participants betting Down
    }

    // User's bet information
    struct Bet {
        uint256 amount; // Bet amount
        Direction direction; // Bet direction
        bool claimed; // Whether rewards have been claimed
    }

    uint256 public constant BASE_RATE = 10000;
    
    uint256 public minBetAmount; // minimum bet amount
    uint256 public maxBetAmount; // maximum bet amount

    IERC20Burnable public immutable token; // Burnable ERC20 token used for betting
    address public oracle; // Oracle address for submitting price data

    uint256 public latestRoundId; // Current latest round ID
    uint256 public roundDuration; // Duration of each round (in seconds)
    uint256 public priceSubmissionWindow; // Time window for submitting closing price
    uint256 public commissionRate; // Commission rate (e.g., 100 = 1%)
    uint256 public burnRate; // Token burn rate
    address public commissionRecipient; // Recipient address for commission

    uint256 public constant MAX_RATE = 1000;  // set max rate to 10%

    mapping(uint256 => Round) public rounds; // roundId => Round
    mapping(uint256 => mapping(address => Bet)) public userBets; // roundId => user => Bet

    event RoundCreated(uint256 indexed roundId, uint256 startTime, uint256 endTime);
    event BetPlaced(uint256 indexed roundId, address indexed user, Direction direction, uint256 amount);
    event RoundSettled(uint256 indexed roundId, Direction result, uint256 winnerPool);
    event WinningsClaimed(uint256 indexed roundId, address indexed user, uint256 amount);
    event RoundVoided(uint256 indexed roundId);
    event BetLimitsUpdated(uint256 minAmount, uint256 maxAmount);


    modifier onlyOracle() {
        require(msg.sender == oracle, "Not oracle");
        _;
    }

    constructor(
        address _token,
        address _oracle,
        uint256 _roundDuration,
        uint256 _priceSubmissionWindow,
        uint256 _commissionRate,
        uint256 _burnRate,
        address _commissionRecipient
    ) {
        require(_token != address(0), "Token address cannot be zero");
        require(_oracle != address(0), "Oracle address cannot be zero");
        require(_commissionRecipient != address(0), "Commission recipient cannot be zero");
        require(_roundDuration > 0, "Round duration must be positive");
        require(_priceSubmissionWindow > 0, "Price submission window must be positive");
        require(_commissionRate <= MAX_RATE, "Commission rate too high");
        require(_burnRate <= MAX_RATE, "Burn rate too high");

        token = IERC20Burnable(_token);
        oracle = _oracle;
        roundDuration = _roundDuration;
        priceSubmissionWindow = _priceSubmissionWindow;
        commissionRate = _commissionRate;
        burnRate = _burnRate;
        commissionRecipient = _commissionRecipient;
        
        uint8 tokenDecimals = token.decimals();
        
        // compute min and max bet amount based on token decimals
        minBetAmount = 100000 * (10 ** tokenDecimals);
        maxBetAmount = 10000000 * (10 ** tokenDecimals);
    }

    // Create a new betting round and set the opening price
    function createRound(uint256 openPrice, uint256 startTime) external onlyOracle whenNotPaused {
        require(openPrice > 0, "Opening price must be positive");
        require(startTime > block.timestamp, "Start time must be in the future");
        
        latestRoundId++;
        uint256 start = startTime;
        uint256 end = start + roundDuration;

        rounds[latestRoundId] = Round({
            id: latestRoundId,
            startTime: start,
            endTime: end,
            openPrice: openPrice,
            closePrice: 0,
            upAmount: 0,
            downAmount: 0,
            winnerPool: 0, // Initialize reward pool to 0
            status: RoundStatus.Active,
            finalDirection: Direction.Up, // Default placeholder direction
            ups: 0, // Initialize participants count
            downs: 0
        });

        emit RoundCreated(latestRoundId, start, end);
    }

    // Place a bet in a specific round
    function placeBet(uint256 roundId, Direction direction, uint256 amount) external nonReentrant whenNotPaused {
        require(amount >= minBetAmount, "Bet amount too small");
        require(amount <= maxBetAmount, "Bet amount too large");
        require(roundId > 0 && roundId <= latestRoundId, "Invalid round ID");
        
        Round storage r = rounds[roundId];
        require(block.timestamp < r.startTime, "Not active"); // place bet before round start
        require(userBets[roundId][msg.sender].amount == 0, "Already bet");

        // Transfer tokens before state changes to prevent reentrancy
        bool success = token.transferFrom(msg.sender, address(this), amount);
        require(success, "Token transfer failed");

        userBets[roundId][msg.sender] = Bet(amount, direction, false);

        if (direction == Direction.Up) {
            r.upAmount += amount;
            r.ups += 1;
        } else {
            r.downAmount += amount;
            r.downs += 1;
        }

        emit BetPlaced(roundId, msg.sender, direction, amount);
    }

    // Submit closing price for a round by the oracle
    function submitClosePrice(uint256 roundId, uint256 closePrice) external onlyOracle nonReentrant {
        require(closePrice > 0, "Closing price must be positive");
        require(roundId > 0 && roundId <= latestRoundId, "Invalid round ID");
        
        Round storage r = rounds[roundId];
        require(block.timestamp > r.endTime, "Too early");
        require(block.timestamp <= r.endTime + priceSubmissionWindow, "Too late");
        require(r.status == RoundStatus.Active, "Not active");

        r.closePrice = closePrice;
        r.status = RoundStatus.Settled;
        r.finalDirection = (closePrice > r.openPrice) ? Direction.Up : Direction.Down;

        // Determine winner and loser amounts
        uint256 winnerAmount = (r.finalDirection == Direction.Up) ? r.upAmount : r.downAmount;
        uint256 loserAmount = (r.finalDirection == Direction.Up) ? r.downAmount : r.upAmount;
        
        // Verify that winner amount is not zero to prevent division by zero
        // If no one bet on the winning side, the round is voided
        if (winnerAmount == 0) {
            r.status = RoundStatus.Voided;
            emit RoundSettled(roundId, r.finalDirection, r.winnerPool);
            return;
        }
        
        // Calculate commission and burn amounts
        uint256 commissionAmount = loserAmount * commissionRate / BASE_RATE;
        uint256 burnAmount = loserAmount * burnRate / BASE_RATE;
    
        uint256 remainingLoserAmount = loserAmount - commissionAmount - burnAmount;
        
        // Winner reward pool = winner principal + remaining loser amount
        r.winnerPool = winnerAmount + remainingLoserAmount;

        // Execute commission transfer and token burning
        if (commissionAmount > 0) {
            bool success = token.transfer(commissionRecipient, commissionAmount);
            require(success, "Commission transfer failed");
        }
        
        if (burnAmount > 0) {
            token.burn(burnAmount);
        }

        emit RoundSettled(roundId, r.finalDirection, r.winnerPool);
    }

    // Check round status and return the actual status, including auto-detection of voided rounds
    function checkRoundStatus(uint256 roundId) public view returns (RoundStatus) {
        require(roundId > 0 && roundId <= latestRoundId, "Invalid round ID");
        
        Round storage r = rounds[roundId];
        
        // If round has timed out but still in Active status, consider it Voided
        if (block.timestamp > r.endTime + priceSubmissionWindow && r.status == RoundStatus.Active) {
            return RoundStatus.Voided;
        }
        
        return r.status;
    }

    // Claim winnings for winners, distributing rewards proportionally
    // If user address is provided, claim on behalf of that user
    function claimWinnings(uint256 roundId, address user) external nonReentrant {
        require(roundId > 0 && roundId <= latestRoundId, "Invalid round ID");
        
        address bettor = user == address(0) ? msg.sender : user;
        require(bettor != address(0), "Invalid bettor address");
        
        Round storage r = rounds[roundId];
        Bet storage b = userBets[roundId][bettor];
        
        // Use checkRoundStatus to verify current round status
        RoundStatus currentStatus = checkRoundStatus(roundId);
        require(currentStatus == RoundStatus.Settled, "Not settled");
        
        // 

        require(b.amount > 0, "No bet found");
        require(!b.claimed, "Already claimed");
        require(b.direction == r.finalDirection, "Wrong guess");

        // Use the pre-calculated winner pool
        uint256 totalWinningAmount = (r.finalDirection == Direction.Up) ? r.upAmount : r.downAmount;
        uint256 reward = b.amount * r.winnerPool / totalWinningAmount;

        // save state before external calls
        b.claimed = true;
        
        // execute transfer and check result
        bool success = token.transfer(bettor, reward);
        require(success, "Reward transfer failed");

        emit WinningsClaimed(roundId, bettor, reward);
    }

    // Refund bets for voided rounds
    // If user address is provided, refund on behalf of that user
    function refundVoided(uint256 roundId, address user) external nonReentrant {
        require(roundId > 0 && roundId <= latestRoundId, "Invalid round ID");
        
        address bettor = user == address(0) ? msg.sender : user;
        require(bettor != address(0), "Invalid bettor address");
        
        Round storage r = rounds[roundId];
        Bet storage b = userBets[roundId][bettor];
        
        // Use checkRoundStatus to automatically check if round is voided
        RoundStatus currentStatus = checkRoundStatus(roundId);
        
        // Update status and trigger event only if status actually changes
        if (currentStatus == RoundStatus.Voided && r.status != RoundStatus.Voided) {
            r.status = RoundStatus.Voided;
            emit RoundVoided(roundId);
        }
        
        require(r.status == RoundStatus.Voided, "Not voided");
        require(b.amount > 0, "No bet found");
        require(!b.claimed, "Already claimed");

        // Update state before external calls
        b.claimed = true;
        
        // Transfer refund
        bool success = token.transfer(bettor, b.amount);
        require(success, "Refund transfer failed");
    }

    // Update bet amount limits
    function setBetLimits(uint256 _minBetAmount, uint256 _maxBetAmount) external onlyOwner {
        require(_minBetAmount > 0, "Min bet amount must be positive");
        require(_maxBetAmount > _minBetAmount, "Max bet amount must exceed min bet amount");
        
        minBetAmount = _minBetAmount;
        maxBetAmount = _maxBetAmount;
        
        emit BetLimitsUpdated(_minBetAmount, _maxBetAmount);
    }

    // Get the current latest round information
    function getCurrentRound() external view returns (Round memory) {
        require(latestRoundId > 0, "No rounds created yet");
        return rounds[latestRoundId];
    }

    // Update oracle address
    function setOracle(address _oracle) external onlyOwner {
        require(_oracle != address(0), "Oracle address cannot be zero");
        oracle = _oracle;
    }

    // Update commission rate
    function setCommissionRate(uint256 rate) external onlyOwner {
        require(rate <= MAX_RATE, "Rate too high");
        commissionRate = rate;
    }

    // Set commission recipient address
    function setCommissionRecipient(address recipient) external onlyOwner {
        require(recipient != address(0), "Recipient address cannot be zero");
        commissionRecipient = recipient;
    }

    // Set token burn rate
    function setBurnRate(uint256 rate) external onlyOwner {
        require(rate <= MAX_RATE, "Rate too high");
        burnRate = rate;
    }

    // set roundDuration by oracle
    function setRoundDuration(uint256 duration) external onlyOracle {
        require(duration > 0 && duration <= 86400, "Duration must be positive and less than 86400");
        roundDuration = duration;
    }

    // set priceSubmissionWindow by oracle
    function setPriceSubmissionWindow(uint256 window) external onlyOracle {
        require(window > 0 && window <= 900, "Window must be positive and less than 900");
        priceSubmissionWindow = window;
    }

    // Pause contract functionality
    function pause() external onlyOwner {
        _pause();
    }

    // Unpause contract functionality
    function unpause() external onlyOwner {
        _unpause();
    }
}
        

@openzeppelin/contracts/access/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() {
        _setOwner(_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 {
        _setOwner(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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
          

@openzeppelin/contracts/security/Pausable.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}
          

@openzeppelin/contracts/security/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;
    }
}
          

@openzeppelin/contracts/token/ERC20/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);
}
          

@openzeppelin/contracts/utils/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) {
        return msg.data;
    }
}
          

@openzeppelin/contracts/utils/math/Math.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

Compiler Settings

{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata"],"":["ast"]}},"optimizer":{"runs":100000,"enabled":true},"libraries":{},"evmVersion":"paris"}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_token","internalType":"address"},{"type":"address","name":"_oracle","internalType":"address"},{"type":"uint256","name":"_roundDuration","internalType":"uint256"},{"type":"uint256","name":"_priceSubmissionWindow","internalType":"uint256"},{"type":"uint256","name":"_commissionRate","internalType":"uint256"},{"type":"uint256","name":"_burnRate","internalType":"uint256"},{"type":"address","name":"_commissionRecipient","internalType":"address"}]},{"type":"event","name":"BetLimitsUpdated","inputs":[{"type":"uint256","name":"minAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"maxAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"BetPlaced","inputs":[{"type":"uint256","name":"roundId","internalType":"uint256","indexed":true},{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint8","name":"direction","internalType":"enum EthTrendBet.Direction","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"RoundCreated","inputs":[{"type":"uint256","name":"roundId","internalType":"uint256","indexed":true},{"type":"uint256","name":"startTime","internalType":"uint256","indexed":false},{"type":"uint256","name":"endTime","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RoundSettled","inputs":[{"type":"uint256","name":"roundId","internalType":"uint256","indexed":true},{"type":"uint8","name":"result","internalType":"enum EthTrendBet.Direction","indexed":false},{"type":"uint256","name":"winnerPool","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RoundVoided","inputs":[{"type":"uint256","name":"roundId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"WinningsClaimed","inputs":[{"type":"uint256","name":"roundId","internalType":"uint256","indexed":true},{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"BASE_RATE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MAX_RATE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"burnRate","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"enum EthTrendBet.RoundStatus"}],"name":"checkRoundStatus","inputs":[{"type":"uint256","name":"roundId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"claimWinnings","inputs":[{"type":"uint256","name":"roundId","internalType":"uint256"},{"type":"address","name":"user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"commissionRate","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"commissionRecipient","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"createRound","inputs":[{"type":"uint256","name":"openPrice","internalType":"uint256"},{"type":"uint256","name":"startTime","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct EthTrendBet.Round","components":[{"type":"uint256","name":"id","internalType":"uint256"},{"type":"uint256","name":"startTime","internalType":"uint256"},{"type":"uint256","name":"endTime","internalType":"uint256"},{"type":"uint256","name":"openPrice","internalType":"uint256"},{"type":"uint256","name":"closePrice","internalType":"uint256"},{"type":"uint256","name":"upAmount","internalType":"uint256"},{"type":"uint256","name":"downAmount","internalType":"uint256"},{"type":"uint256","name":"winnerPool","internalType":"uint256"},{"type":"uint8","name":"status","internalType":"enum EthTrendBet.RoundStatus"},{"type":"uint8","name":"finalDirection","internalType":"enum EthTrendBet.Direction"},{"type":"uint256","name":"ups","internalType":"uint256"},{"type":"uint256","name":"downs","internalType":"uint256"}]}],"name":"getCurrentRound","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"latestRoundId","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"maxBetAmount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"minBetAmount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"oracle","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"placeBet","inputs":[{"type":"uint256","name":"roundId","internalType":"uint256"},{"type":"uint8","name":"direction","internalType":"enum EthTrendBet.Direction"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"priceSubmissionWindow","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"refundVoided","inputs":[{"type":"uint256","name":"roundId","internalType":"uint256"},{"type":"address","name":"user","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"roundDuration","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"id","internalType":"uint256"},{"type":"uint256","name":"startTime","internalType":"uint256"},{"type":"uint256","name":"endTime","internalType":"uint256"},{"type":"uint256","name":"openPrice","internalType":"uint256"},{"type":"uint256","name":"closePrice","internalType":"uint256"},{"type":"uint256","name":"upAmount","internalType":"uint256"},{"type":"uint256","name":"downAmount","internalType":"uint256"},{"type":"uint256","name":"winnerPool","internalType":"uint256"},{"type":"uint8","name":"status","internalType":"enum EthTrendBet.RoundStatus"},{"type":"uint8","name":"finalDirection","internalType":"enum EthTrendBet.Direction"},{"type":"uint256","name":"ups","internalType":"uint256"},{"type":"uint256","name":"downs","internalType":"uint256"}],"name":"rounds","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setBetLimits","inputs":[{"type":"uint256","name":"_minBetAmount","internalType":"uint256"},{"type":"uint256","name":"_maxBetAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setBurnRate","inputs":[{"type":"uint256","name":"rate","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setCommissionRate","inputs":[{"type":"uint256","name":"rate","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setCommissionRecipient","inputs":[{"type":"address","name":"recipient","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setOracle","inputs":[{"type":"address","name":"_oracle","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPriceSubmissionWindow","inputs":[{"type":"uint256","name":"window","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setRoundDuration","inputs":[{"type":"uint256","name":"duration","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"submitClosePrice","inputs":[{"type":"uint256","name":"roundId","internalType":"uint256"},{"type":"uint256","name":"closePrice","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20Burnable"}],"name":"token","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint8","name":"direction","internalType":"enum EthTrendBet.Direction"},{"type":"bool","name":"claimed","internalType":"bool"}],"name":"userBets","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"address","name":"","internalType":"address"}]}]
              

Contract Creation Code

0x60a06040523480156200001157600080fd5b5060405162003b9c38038062003b9c833981016040819052620000349162000424565b6200003f33620003b7565b600180556002805460ff191690556001600160a01b038716620000a95760405162461bcd60e51b815260206004820152601c60248201527f546f6b656e20616464726573732063616e6e6f74206265207a65726f0000000060448201526064015b60405180910390fd5b6001600160a01b038616620001015760405162461bcd60e51b815260206004820152601d60248201527f4f7261636c6520616464726573732063616e6e6f74206265207a65726f0000006044820152606401620000a0565b6001600160a01b038116620001655760405162461bcd60e51b815260206004820152602360248201527f436f6d6d697373696f6e20726563697069656e742063616e6e6f74206265207a60448201526265726f60e81b6064820152608401620000a0565b60008511620001b75760405162461bcd60e51b815260206004820152601f60248201527f526f756e64206475726174696f6e206d75737420626520706f736974697665006044820152606401620000a0565b600084116200021a5760405162461bcd60e51b815260206004820152602860248201527f5072696365207375626d697373696f6e2077696e646f77206d75737420626520604482015267706f73697469766560c01b6064820152608401620000a0565b6103e88311156200026e5760405162461bcd60e51b815260206004820152601860248201527f436f6d6d697373696f6e207261746520746f6f206869676800000000000000006044820152606401620000a0565b6103e8821115620002b75760405162461bcd60e51b8152602060048201526012602482015271084eae4dc40e4c2e8ca40e8dede40d0d2ced60731b6044820152606401620000a0565b6001600160a01b038781166080819052600580546001600160a01b03199081168a851617909155600788905560088790556009869055600a859055600b8054909116928416929092179091556040805163313ce56760e01b815290516000929163313ce5679160048083019260209291908290030181865afa15801562000342573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000368919062000495565b90506200037781600a620005d6565b6200038690620186a0620005e7565b6003556200039681600a620005d6565b620003a59062989680620005e7565b60045550620006019650505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200041f57600080fd5b919050565b600080600080600080600060e0888a0312156200044057600080fd5b6200044b8862000407565b96506200045b6020890162000407565b955060408801519450606088015193506080880151925060a088015191506200048760c0890162000407565b905092959891949750929550565b600060208284031215620004a857600080fd5b815160ff81168114620004ba57600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111562000518578160001904821115620004fc57620004fc620004c1565b808516156200050a57918102915b93841c9390800290620004dc565b509250929050565b6000826200053157506001620005d0565b816200054057506000620005d0565b8160018114620005595760028114620005645762000584565b6001915050620005d0565b60ff841115620005785762000578620004c1565b50506001821b620005d0565b5060208310610133831016604e8410600b8410161715620005a9575081810a620005d0565b620005b58383620004d7565b8060001904821115620005cc57620005cc620004c1565b0290505b92915050565b6000620004ba60ff84168362000520565b8082028115828204841417620005d057620005d0620004c1565b60805161355c620006406000396000818161054b0152818161183701528181611db801528181612478015281816125850152612b33015261355c6000f3fe608060405234801561001057600080fd5b50600436106102265760003560e01c80637dc0d1d01161012a578063a32bf597116100bd578063da866c481161008c578063f7cb789a11610071578063f7cb789a14610534578063fa968eea1461053d578063fc0c546a1461054657600080fd5b8063da866c481461050e578063f2fde38b1461052157600080fd5b8063a32bf597146104de578063bed99850146104f3578063c24dbebd146104fc578063cab11d5d1461050557600080fd5b80638da5cb5b116100f95780638da5cb5b14610487578063992a310f146104a5578063992c9079146104b8578063a2a3537e146104cb57600080fd5b80637dc0d1d0146103c15780638456cb59146103e1578063848ee75f146103e95780638c65c81f146103fc57600080fd5b806341910f90116101bd5780636b58caaf1161018c5780637687dd49116101715780637687dd491461034e5780637adbf973146103615780637d06a8e11461037457600080fd5b80636b58caaf14610326578063715018a61461034657600080fd5b806341910f90146102eb57806344d0360d146102f45780635c975abb146103075780635ea1d6f81461031d57600080fd5b80631d1b13c6116101f95780631d1b13c6146102b4578063284fd8e5146102bd57806336c92c3f146102d05780633f4ba83a146102e357600080fd5b806306fd154a1461022b57806311a8f41314610275578063189d165e1461028c57806319fac8fd146102a1575b600080fd5b600b5461024b9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61027e60065481565b60405190815260200161026c565b61029f61029a366004613189565b61056d565b005b61029f6102af366004613189565b610664565b61027e60085481565b61029f6102cb3660046131cb565b610756565b61029f6102de366004613189565b61089b565b61029f6109c0565b61027e61271081565b61029f610302366004613189565b610a4b565b60025460ff16604051901515815260200161026c565b61027e60095481565b610339610334366004613189565b610b6f565b60405161026c9190613230565b61029f610c49565b61029f61035c366004613244565b610cd4565b61029f61036f3660046131cb565b610e95565b6103b2610382366004613266565b600d6020908152600092835260408084209091529082529020805460019091015460ff8082169161010090041683565b60405161026c939291906132a2565b60055461024b9073ffffffffffffffffffffffffffffffffffffffff1681565b61029f610fda565b61029f6103f7366004613244565b611063565b61046f61040a366004613189565b600c60205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007880154600889015460098a0154600a909a01549899979896979596949593949293919260ff808316936101009093041691908c565b60405161026c9c9b9a999897969594939291906132c6565b60005473ffffffffffffffffffffffffffffffffffffffff1661024b565b61029f6104b3366004613266565b6113f1565b61029f6104c6366004613266565b61191a565b61029f6104d9366004613244565b611eee565b6104e6612655565b60405161026c9190613334565b61027e600a5481565b61027e6103e881565b61027e60045481565b61029f61051c3660046133ce565b6127c5565b61029f61052f3660046131cb565b612dd1565b61027e60075481565b61027e60035481565b61024b7f000000000000000000000000000000000000000000000000000000000000000081565b60005473ffffffffffffffffffffffffffffffffffffffff1633146105f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6103e881111561065f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f5261746520746f6f20686967680000000000000000000000000000000000000060448201526064016105ea565b600a55565b60005473ffffffffffffffffffffffffffffffffffffffff1633146106e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ea565b6103e8811115610751576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f5261746520746f6f20686967680000000000000000000000000000000000000060448201526064016105ea565b600955565b60005473ffffffffffffffffffffffffffffffffffffffff1633146107d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ea565b73ffffffffffffffffffffffffffffffffffffffff8116610854576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f526563697069656e7420616464726573732063616e6e6f74206265207a65726f60448201526064016105ea565b600b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60055473ffffffffffffffffffffffffffffffffffffffff16331461091c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e6f74206f7261636c650000000000000000000000000000000000000000000060448201526064016105ea565b60008111801561092f5750620151808111155b6109bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4475726174696f6e206d75737420626520706f73697469766520616e64206c6560448201527f7373207468616e2038363430300000000000000000000000000000000000000060648201526084016105ea565b600755565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a41576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ea565b610a49612f01565b565b60055473ffffffffffffffffffffffffffffffffffffffff163314610acc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e6f74206f7261636c650000000000000000000000000000000000000000000060448201526064016105ea565b600081118015610ade57506103848111155b610b6a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f57696e646f77206d75737420626520706f73697469766520616e64206c65737360448201527f207468616e20393030000000000000000000000000000000000000000000000060648201526084016105ea565b600855565b60008082118015610b8257506006548211155b610be8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c696420726f756e642049440000000000000000000000000000000060448201526064016105ea565b6000828152600c602052604090206008546002820154610c089190613439565b42118015610c2e57506000600882015460ff166002811115610c2c57610c2c6131ed565b145b15610c3c5750600292915050565b6008015460ff1692915050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610cca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ea565b610a496000612fe2565b60005473ffffffffffffffffffffffffffffffffffffffff163314610d55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ea565b60008211610dbf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4d696e2062657420616d6f756e74206d75737420626520706f7369746976650060448201526064016105ea565b818111610e4e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4d61782062657420616d6f756e74206d75737420657863656564206d696e206260448201527f657420616d6f756e74000000000000000000000000000000000000000000000060648201526084016105ea565b6003829055600481905560408051838152602081018390527ff483a8cf66fadba78e10f404e5f1639eb2a336535936e1af01f333d1215378d1910160405180910390a15050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610f16576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ea565b73ffffffffffffffffffffffffffffffffffffffff8116610f93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4f7261636c6520616464726573732063616e6e6f74206265207a65726f00000060448201526064016105ea565b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461105b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ea565b610a49613057565b60055473ffffffffffffffffffffffffffffffffffffffff1633146110e4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e6f74206f7261636c650000000000000000000000000000000000000000000060448201526064016105ea565b60025460ff1615611151576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016105ea565b600082116111bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f70656e696e67207072696365206d75737420626520706f736974697665000060448201526064016105ea565b428111611224576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f53746172742074696d65206d75737420626520696e207468652066757475726560448201526064016105ea565b600680549060006112348361344c565b9091555050600754819060009061124b9083613439565b9050604051806101800160405280600654815260200183815260200182815260200185815260200160008152602001600081526020016000815260200160008152602001600060028111156112a2576112a26131ed565b815260200160008152602001600081526020016000815250600c60006006548152602001908152602001600020600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e082015181600701556101008201518160080160006101000a81548160ff0219169083600281111561134a5761134a6131ed565b02179055506101208201516008820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100836001811115611392576113926131ed565b0217905550610140820151600982015561016090910151600a9091015560065460408051848152602081018490527f68e7b09ec44e876e76ff05157850e3261aa63a8680fe21a2ba93dcbb2b09f58f910160405180910390a250505050565b60026001540361145d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105ea565b6002600155811580159061147357506006548211155b6114d9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c696420726f756e642049440000000000000000000000000000000060448201526064016105ea565b600073ffffffffffffffffffffffffffffffffffffffff8216156114fd57816114ff565b335b905073ffffffffffffffffffffffffffffffffffffffff811661157e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c696420626574746f7220616464726573730000000000000000000060448201526064016105ea565b6000838152600c60209081526040808320600d835281842073ffffffffffffffffffffffffffffffffffffffff86168552909252822090916115bf86610b6f565b905060028160028111156115d5576115d56131ed565b1480156115fb57506002600884015460ff1660028111156115f8576115f86131ed565b14155b15611659576008830180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600217905560405186907f4ecb450e70bc0e982eb52ddf0e0308fd4ff61efc2fc0d26d8169a6f860e244cc90600090a25b6002600884015460ff166002811115611674576116746131ed565b146116db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e6f7420766f696465640000000000000000000000000000000000000000000060448201526064016105ea565b8154611743576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4e6f2062657420666f756e64000000000000000000000000000000000000000060448201526064016105ea565b6001820154610100900460ff16156117b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f416c726561647920636c61696d6564000000000000000000000000000000000060448201526064016105ea565b6001820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1661010017905581546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff868116600483015260248201929092526000917f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015611880573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118a49190613484565b90508061190d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f526566756e64207472616e73666572206661696c65640000000000000000000060448201526064016105ea565b5050600180555050505050565b600260015403611986576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105ea565b6002600155811580159061199c57506006548211155b611a02576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c696420726f756e642049440000000000000000000000000000000060448201526064016105ea565b600073ffffffffffffffffffffffffffffffffffffffff821615611a265781611a28565b335b905073ffffffffffffffffffffffffffffffffffffffff8116611aa7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c696420626574746f7220616464726573730000000000000000000060448201526064016105ea565b6000838152600c60209081526040808320600d835281842073ffffffffffffffffffffffffffffffffffffffff8616855290925282209091611ae886610b6f565b90506001816002811115611afe57611afe6131ed565b14611b65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f4e6f7420736574746c656400000000000000000000000000000000000000000060448201526064016105ea565b8154611bcd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4e6f2062657420666f756e64000000000000000000000000000000000000000060448201526064016105ea565b6001820154610100900460ff1615611c41576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f416c726561647920636c61696d6564000000000000000000000000000000000060448201526064016105ea565b6008830154610100900460ff166001811115611c5f57611c5f6131ed565b60018084015460ff1690811115611c7857611c786131ed565b14611cdf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f57726f6e6720677565737300000000000000000000000000000000000000000060448201526064016105ea565b6000806008850154610100900460ff166001811115611d0057611d006131ed565b14611d0f578360060154611d15565b83600501545b905060008185600701548560000154611d2e91906134a6565b611d3891906134bd565b6001850180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790556040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152602482018390529192506000917f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015611e01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e259190613484565b905080611e8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f526577617264207472616e73666572206661696c65640000000000000000000060448201526064016105ea565b8673ffffffffffffffffffffffffffffffffffffffff16897f5380cf6fe903b40c6d5a9e0dfbca2f3a423f0a21520b4d5947ed5169bdba946d84604051611ed791815260200190565b60405180910390a350506001805550505050505050565b60055473ffffffffffffffffffffffffffffffffffffffff163314611f6f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e6f74206f7261636c650000000000000000000000000000000000000000000060448201526064016105ea565b600260015403611fdb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105ea565b600260015580612047576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f436c6f73696e67207072696365206d75737420626520706f736974697665000060448201526064016105ea565b60008211801561205957506006548211155b6120bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c696420726f756e642049440000000000000000000000000000000060448201526064016105ea565b6000828152600c602052604090206002810154421161213a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f546f6f206561726c79000000000000000000000000000000000000000000000060448201526064016105ea565b600854816002015461214c9190613439565b4211156121b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600860248201527f546f6f206c61746500000000000000000000000000000000000000000000000060448201526064016105ea565b6000600882015460ff1660028111156121d0576121d06131ed565b14612237576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e6f74206163746976650000000000000000000000000000000000000000000060448201526064016105ea565b600481018290556008810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556003810154821161227d576001612280565b60005b6008820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101008360018111156122bd576122bd6131ed565b02179055506000806008830154610100900460ff1660018111156122e3576122e36131ed565b146122f25781600601546122f8565b81600501545b90506000806008840154610100900460ff16600181111561231b5761231b6131ed565b1461232a578260050154612330565b82600601545b9050816000036123ba5760088301805460027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009091161790819055600784015460405187927f5dde9027f8f0377b1fa9c9940178dc74b62d725373ea8ba371525b260697aa71926123aa9261010090920460ff16916134f8565b60405180910390a250505061264d565b6000612710600954836123cd91906134a6565b6123d791906134bd565b90506000612710600a54846123ec91906134a6565b6123f691906134bd565b90506000816124058486613513565b61240f9190613513565b905061241b8186613439565b6007870155821561255057600b546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152602481018590526000917f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af11580156124c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124e59190613484565b90508061254e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f436f6d6d697373696f6e207472616e73666572206661696c656400000000000060448201526064016105ea565b505b81156125f7576040517f42966c68000000000000000000000000000000000000000000000000000000008152600481018390527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906342966c6890602401600060405180830381600087803b1580156125de57600080fd5b505af11580156125f2573d6000803e3d6000fd5b505050505b877f5dde9027f8f0377b1fa9c9940178dc74b62d725373ea8ba371525b260697aa718760080160019054906101000a900460ff16886007015460405161263e9291906134f8565b60405180910390a25050505050505b505060018055565b61265d613117565b6000600654116126c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4e6f20726f756e6473206372656174656420796574000000000000000000000060448201526064016105ea565b600c600060065481526020019081526020016000206040518061018001604052908160008201548152602001600182015481526020016002820154815260200160038201548152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820160009054906101000a900460ff16600281111561275e5761275e6131ed565b600281111561276f5761276f6131ed565b81526020016008820160019054906101000a900460ff166001811115612797576127976131ed565b60018111156127a8576127a86131ed565b815260200160098201548152602001600a82015481525050905090565b600260015403612831576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105ea565b600260015561284260025460ff1690565b156128a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016105ea565b600354811015612915576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f42657420616d6f756e7420746f6f20736d616c6c00000000000000000000000060448201526064016105ea565b600454811115612981576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f42657420616d6f756e7420746f6f206c6172676500000000000000000000000060448201526064016105ea565b60008311801561299357506006548311155b6129f9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c696420726f756e642049440000000000000000000000000000000060448201526064016105ea565b6000838152600c6020526040902060018101544210612a74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e6f74206163746976650000000000000000000000000000000000000000000060448201526064016105ea565b6000848152600d6020908152604080832033845290915290205415612af5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f416c72656164792062657400000000000000000000000000000000000000000060448201526064016105ea565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018390526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906323b872dd906064016020604051808303816000875af1158015612b91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bb59190613484565b905080612c1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f546f6b656e207472616e73666572206661696c6564000000000000000000000060448201526064016105ea565b6040518060600160405280848152602001856001811115612c4157612c416131ed565b815260006020918201819052878152600d825260408082203383528352902082518155908201516001828101805490917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00909116908381811115612ca757612ca76131ed565b02179055506040919091015160019091018054911515610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff9092169190911790556000846001811115612cff57612cff6131ed565b03612d3f5782826005016000828254612d189190613439565b925050819055506001826009016000828254612d349190613439565b90915550612d759050565b82826006016000828254612d539190613439565b92505081905550600182600a016000828254612d6f9190613439565b90915550505b3373ffffffffffffffffffffffffffffffffffffffff16857f4f1eed5e863a822b0f9eb960dfdab2cc5a99beec4b191f2a7a9c7e28e5a155248686604051612dbe9291906134f8565b60405180910390a3505060018055505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314612e52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ea565b73ffffffffffffffffffffffffffffffffffffffff8116612ef5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016105ea565b612efe81612fe2565b50565b60025460ff16612f6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016105ea565b600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60025460ff16156130c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016105ea565b600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612fb83390565b60405180610180016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000600281111561316e5761316e6131ed565b81526020016000815260200160008152602001600081525090565b60006020828403121561319b57600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff811681146131c657600080fd5b919050565b6000602082840312156131dd57600080fd5b6131e6826131a2565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6003811061322c5761322c6131ed565b9052565b6020810161323e828461321c565b92915050565b6000806040838503121561325757600080fd5b50508035926020909101359150565b6000806040838503121561327957600080fd5b82359150613289602084016131a2565b90509250929050565b6002811061322c5761322c6131ed565b838152606081016132b66020830185613292565b8215156040830152949350505050565b6000610180820190508d82528c60208301528b60408301528a60608301528960808301528860a08301528760c08301528660e083015261330a61010083018761321c565b613318610120830186613292565b61014082019390935261016001529a9950505050505050505050565b600061018082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e08301526101008084015161339a8285018261321c565b5050610120808401516133af82850182613292565b5050610140838101519083015261016092830151929091019190915290565b6000806000606084860312156133e357600080fd5b833592506020840135600281106133f957600080fd5b929592945050506040919091013590565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561323e5761323e61340a565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361347d5761347d61340a565b5060010190565b60006020828403121561349657600080fd5b815180151581146131e657600080fd5b808202811582820484141761323e5761323e61340a565b6000826134f3577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b604081016135068285613292565b8260208301529392505050565b8181038181111561323e5761323e61340a56fea2646970667358221220bdac09d2629108bc8e992ea31c7e8515fc6e7315d6b63a83670127945e93fe5a64736f6c63430008140033000000000000000000000000abccefb00528c9c792ac7c46997f0f6ee5dcdddd0000000000000000000000002b6a10fd3e7f8bd87aa16b20a501f0ded14d51f00000000000000000000000000000000000000000000000000000000000000e10000000000000000000000000000000000000000000000000000000000000038400000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000003200000000000000000000000000eabf561f9a6c611caa9c0b766b9224d7467ef1b

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106102265760003560e01c80637dc0d1d01161012a578063a32bf597116100bd578063da866c481161008c578063f7cb789a11610071578063f7cb789a14610534578063fa968eea1461053d578063fc0c546a1461054657600080fd5b8063da866c481461050e578063f2fde38b1461052157600080fd5b8063a32bf597146104de578063bed99850146104f3578063c24dbebd146104fc578063cab11d5d1461050557600080fd5b80638da5cb5b116100f95780638da5cb5b14610487578063992a310f146104a5578063992c9079146104b8578063a2a3537e146104cb57600080fd5b80637dc0d1d0146103c15780638456cb59146103e1578063848ee75f146103e95780638c65c81f146103fc57600080fd5b806341910f90116101bd5780636b58caaf1161018c5780637687dd49116101715780637687dd491461034e5780637adbf973146103615780637d06a8e11461037457600080fd5b80636b58caaf14610326578063715018a61461034657600080fd5b806341910f90146102eb57806344d0360d146102f45780635c975abb146103075780635ea1d6f81461031d57600080fd5b80631d1b13c6116101f95780631d1b13c6146102b4578063284fd8e5146102bd57806336c92c3f146102d05780633f4ba83a146102e357600080fd5b806306fd154a1461022b57806311a8f41314610275578063189d165e1461028c57806319fac8fd146102a1575b600080fd5b600b5461024b9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61027e60065481565b60405190815260200161026c565b61029f61029a366004613189565b61056d565b005b61029f6102af366004613189565b610664565b61027e60085481565b61029f6102cb3660046131cb565b610756565b61029f6102de366004613189565b61089b565b61029f6109c0565b61027e61271081565b61029f610302366004613189565b610a4b565b60025460ff16604051901515815260200161026c565b61027e60095481565b610339610334366004613189565b610b6f565b60405161026c9190613230565b61029f610c49565b61029f61035c366004613244565b610cd4565b61029f61036f3660046131cb565b610e95565b6103b2610382366004613266565b600d6020908152600092835260408084209091529082529020805460019091015460ff8082169161010090041683565b60405161026c939291906132a2565b60055461024b9073ffffffffffffffffffffffffffffffffffffffff1681565b61029f610fda565b61029f6103f7366004613244565b611063565b61046f61040a366004613189565b600c60205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007880154600889015460098a0154600a909a01549899979896979596949593949293919260ff808316936101009093041691908c565b60405161026c9c9b9a999897969594939291906132c6565b60005473ffffffffffffffffffffffffffffffffffffffff1661024b565b61029f6104b3366004613266565b6113f1565b61029f6104c6366004613266565b61191a565b61029f6104d9366004613244565b611eee565b6104e6612655565b60405161026c9190613334565b61027e600a5481565b61027e6103e881565b61027e60045481565b61029f61051c3660046133ce565b6127c5565b61029f61052f3660046131cb565b612dd1565b61027e60075481565b61027e60035481565b61024b7f000000000000000000000000abccefb00528c9c792ac7c46997f0f6ee5dcdddd81565b60005473ffffffffffffffffffffffffffffffffffffffff1633146105f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6103e881111561065f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f5261746520746f6f20686967680000000000000000000000000000000000000060448201526064016105ea565b600a55565b60005473ffffffffffffffffffffffffffffffffffffffff1633146106e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ea565b6103e8811115610751576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f5261746520746f6f20686967680000000000000000000000000000000000000060448201526064016105ea565b600955565b60005473ffffffffffffffffffffffffffffffffffffffff1633146107d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ea565b73ffffffffffffffffffffffffffffffffffffffff8116610854576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f526563697069656e7420616464726573732063616e6e6f74206265207a65726f60448201526064016105ea565b600b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60055473ffffffffffffffffffffffffffffffffffffffff16331461091c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e6f74206f7261636c650000000000000000000000000000000000000000000060448201526064016105ea565b60008111801561092f5750620151808111155b6109bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4475726174696f6e206d75737420626520706f73697469766520616e64206c6560448201527f7373207468616e2038363430300000000000000000000000000000000000000060648201526084016105ea565b600755565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a41576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ea565b610a49612f01565b565b60055473ffffffffffffffffffffffffffffffffffffffff163314610acc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e6f74206f7261636c650000000000000000000000000000000000000000000060448201526064016105ea565b600081118015610ade57506103848111155b610b6a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f57696e646f77206d75737420626520706f73697469766520616e64206c65737360448201527f207468616e20393030000000000000000000000000000000000000000000000060648201526084016105ea565b600855565b60008082118015610b8257506006548211155b610be8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c696420726f756e642049440000000000000000000000000000000060448201526064016105ea565b6000828152600c602052604090206008546002820154610c089190613439565b42118015610c2e57506000600882015460ff166002811115610c2c57610c2c6131ed565b145b15610c3c5750600292915050565b6008015460ff1692915050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610cca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ea565b610a496000612fe2565b60005473ffffffffffffffffffffffffffffffffffffffff163314610d55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ea565b60008211610dbf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4d696e2062657420616d6f756e74206d75737420626520706f7369746976650060448201526064016105ea565b818111610e4e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4d61782062657420616d6f756e74206d75737420657863656564206d696e206260448201527f657420616d6f756e74000000000000000000000000000000000000000000000060648201526084016105ea565b6003829055600481905560408051838152602081018390527ff483a8cf66fadba78e10f404e5f1639eb2a336535936e1af01f333d1215378d1910160405180910390a15050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610f16576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ea565b73ffffffffffffffffffffffffffffffffffffffff8116610f93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4f7261636c6520616464726573732063616e6e6f74206265207a65726f00000060448201526064016105ea565b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461105b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ea565b610a49613057565b60055473ffffffffffffffffffffffffffffffffffffffff1633146110e4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e6f74206f7261636c650000000000000000000000000000000000000000000060448201526064016105ea565b60025460ff1615611151576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016105ea565b600082116111bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f70656e696e67207072696365206d75737420626520706f736974697665000060448201526064016105ea565b428111611224576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f53746172742074696d65206d75737420626520696e207468652066757475726560448201526064016105ea565b600680549060006112348361344c565b9091555050600754819060009061124b9083613439565b9050604051806101800160405280600654815260200183815260200182815260200185815260200160008152602001600081526020016000815260200160008152602001600060028111156112a2576112a26131ed565b815260200160008152602001600081526020016000815250600c60006006548152602001908152602001600020600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e082015181600701556101008201518160080160006101000a81548160ff0219169083600281111561134a5761134a6131ed565b02179055506101208201516008820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100836001811115611392576113926131ed565b0217905550610140820151600982015561016090910151600a9091015560065460408051848152602081018490527f68e7b09ec44e876e76ff05157850e3261aa63a8680fe21a2ba93dcbb2b09f58f910160405180910390a250505050565b60026001540361145d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105ea565b6002600155811580159061147357506006548211155b6114d9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c696420726f756e642049440000000000000000000000000000000060448201526064016105ea565b600073ffffffffffffffffffffffffffffffffffffffff8216156114fd57816114ff565b335b905073ffffffffffffffffffffffffffffffffffffffff811661157e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c696420626574746f7220616464726573730000000000000000000060448201526064016105ea565b6000838152600c60209081526040808320600d835281842073ffffffffffffffffffffffffffffffffffffffff86168552909252822090916115bf86610b6f565b905060028160028111156115d5576115d56131ed565b1480156115fb57506002600884015460ff1660028111156115f8576115f86131ed565b14155b15611659576008830180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600217905560405186907f4ecb450e70bc0e982eb52ddf0e0308fd4ff61efc2fc0d26d8169a6f860e244cc90600090a25b6002600884015460ff166002811115611674576116746131ed565b146116db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e6f7420766f696465640000000000000000000000000000000000000000000060448201526064016105ea565b8154611743576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4e6f2062657420666f756e64000000000000000000000000000000000000000060448201526064016105ea565b6001820154610100900460ff16156117b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f416c726561647920636c61696d6564000000000000000000000000000000000060448201526064016105ea565b6001820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1661010017905581546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff868116600483015260248201929092526000917f000000000000000000000000abccefb00528c9c792ac7c46997f0f6ee5dcdddd169063a9059cbb906044016020604051808303816000875af1158015611880573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118a49190613484565b90508061190d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f526566756e64207472616e73666572206661696c65640000000000000000000060448201526064016105ea565b5050600180555050505050565b600260015403611986576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105ea565b6002600155811580159061199c57506006548211155b611a02576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c696420726f756e642049440000000000000000000000000000000060448201526064016105ea565b600073ffffffffffffffffffffffffffffffffffffffff821615611a265781611a28565b335b905073ffffffffffffffffffffffffffffffffffffffff8116611aa7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c696420626574746f7220616464726573730000000000000000000060448201526064016105ea565b6000838152600c60209081526040808320600d835281842073ffffffffffffffffffffffffffffffffffffffff8616855290925282209091611ae886610b6f565b90506001816002811115611afe57611afe6131ed565b14611b65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f4e6f7420736574746c656400000000000000000000000000000000000000000060448201526064016105ea565b8154611bcd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4e6f2062657420666f756e64000000000000000000000000000000000000000060448201526064016105ea565b6001820154610100900460ff1615611c41576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f416c726561647920636c61696d6564000000000000000000000000000000000060448201526064016105ea565b6008830154610100900460ff166001811115611c5f57611c5f6131ed565b60018084015460ff1690811115611c7857611c786131ed565b14611cdf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f57726f6e6720677565737300000000000000000000000000000000000000000060448201526064016105ea565b6000806008850154610100900460ff166001811115611d0057611d006131ed565b14611d0f578360060154611d15565b83600501545b905060008185600701548560000154611d2e91906134a6565b611d3891906134bd565b6001850180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790556040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152602482018390529192506000917f000000000000000000000000abccefb00528c9c792ac7c46997f0f6ee5dcdddd169063a9059cbb906044016020604051808303816000875af1158015611e01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e259190613484565b905080611e8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f526577617264207472616e73666572206661696c65640000000000000000000060448201526064016105ea565b8673ffffffffffffffffffffffffffffffffffffffff16897f5380cf6fe903b40c6d5a9e0dfbca2f3a423f0a21520b4d5947ed5169bdba946d84604051611ed791815260200190565b60405180910390a350506001805550505050505050565b60055473ffffffffffffffffffffffffffffffffffffffff163314611f6f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e6f74206f7261636c650000000000000000000000000000000000000000000060448201526064016105ea565b600260015403611fdb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105ea565b600260015580612047576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f436c6f73696e67207072696365206d75737420626520706f736974697665000060448201526064016105ea565b60008211801561205957506006548211155b6120bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c696420726f756e642049440000000000000000000000000000000060448201526064016105ea565b6000828152600c602052604090206002810154421161213a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f546f6f206561726c79000000000000000000000000000000000000000000000060448201526064016105ea565b600854816002015461214c9190613439565b4211156121b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600860248201527f546f6f206c61746500000000000000000000000000000000000000000000000060448201526064016105ea565b6000600882015460ff1660028111156121d0576121d06131ed565b14612237576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e6f74206163746976650000000000000000000000000000000000000000000060448201526064016105ea565b600481018290556008810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556003810154821161227d576001612280565b60005b6008820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101008360018111156122bd576122bd6131ed565b02179055506000806008830154610100900460ff1660018111156122e3576122e36131ed565b146122f25781600601546122f8565b81600501545b90506000806008840154610100900460ff16600181111561231b5761231b6131ed565b1461232a578260050154612330565b82600601545b9050816000036123ba5760088301805460027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009091161790819055600784015460405187927f5dde9027f8f0377b1fa9c9940178dc74b62d725373ea8ba371525b260697aa71926123aa9261010090920460ff16916134f8565b60405180910390a250505061264d565b6000612710600954836123cd91906134a6565b6123d791906134bd565b90506000612710600a54846123ec91906134a6565b6123f691906134bd565b90506000816124058486613513565b61240f9190613513565b905061241b8186613439565b6007870155821561255057600b546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152602481018590526000917f000000000000000000000000abccefb00528c9c792ac7c46997f0f6ee5dcdddd169063a9059cbb906044016020604051808303816000875af11580156124c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124e59190613484565b90508061254e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f436f6d6d697373696f6e207472616e73666572206661696c656400000000000060448201526064016105ea565b505b81156125f7576040517f42966c68000000000000000000000000000000000000000000000000000000008152600481018390527f000000000000000000000000abccefb00528c9c792ac7c46997f0f6ee5dcdddd73ffffffffffffffffffffffffffffffffffffffff16906342966c6890602401600060405180830381600087803b1580156125de57600080fd5b505af11580156125f2573d6000803e3d6000fd5b505050505b877f5dde9027f8f0377b1fa9c9940178dc74b62d725373ea8ba371525b260697aa718760080160019054906101000a900460ff16886007015460405161263e9291906134f8565b60405180910390a25050505050505b505060018055565b61265d613117565b6000600654116126c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4e6f20726f756e6473206372656174656420796574000000000000000000000060448201526064016105ea565b600c600060065481526020019081526020016000206040518061018001604052908160008201548152602001600182015481526020016002820154815260200160038201548152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820160009054906101000a900460ff16600281111561275e5761275e6131ed565b600281111561276f5761276f6131ed565b81526020016008820160019054906101000a900460ff166001811115612797576127976131ed565b60018111156127a8576127a86131ed565b815260200160098201548152602001600a82015481525050905090565b600260015403612831576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105ea565b600260015561284260025460ff1690565b156128a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016105ea565b600354811015612915576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f42657420616d6f756e7420746f6f20736d616c6c00000000000000000000000060448201526064016105ea565b600454811115612981576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f42657420616d6f756e7420746f6f206c6172676500000000000000000000000060448201526064016105ea565b60008311801561299357506006548311155b6129f9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c696420726f756e642049440000000000000000000000000000000060448201526064016105ea565b6000838152600c6020526040902060018101544210612a74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e6f74206163746976650000000000000000000000000000000000000000000060448201526064016105ea565b6000848152600d6020908152604080832033845290915290205415612af5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f416c72656164792062657400000000000000000000000000000000000000000060448201526064016105ea565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018390526000907f000000000000000000000000abccefb00528c9c792ac7c46997f0f6ee5dcdddd73ffffffffffffffffffffffffffffffffffffffff16906323b872dd906064016020604051808303816000875af1158015612b91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bb59190613484565b905080612c1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f546f6b656e207472616e73666572206661696c6564000000000000000000000060448201526064016105ea565b6040518060600160405280848152602001856001811115612c4157612c416131ed565b815260006020918201819052878152600d825260408082203383528352902082518155908201516001828101805490917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00909116908381811115612ca757612ca76131ed565b02179055506040919091015160019091018054911515610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff9092169190911790556000846001811115612cff57612cff6131ed565b03612d3f5782826005016000828254612d189190613439565b925050819055506001826009016000828254612d349190613439565b90915550612d759050565b82826006016000828254612d539190613439565b92505081905550600182600a016000828254612d6f9190613439565b90915550505b3373ffffffffffffffffffffffffffffffffffffffff16857f4f1eed5e863a822b0f9eb960dfdab2cc5a99beec4b191f2a7a9c7e28e5a155248686604051612dbe9291906134f8565b60405180910390a3505060018055505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314612e52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ea565b73ffffffffffffffffffffffffffffffffffffffff8116612ef5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016105ea565b612efe81612fe2565b50565b60025460ff16612f6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016105ea565b600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60025460ff16156130c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016105ea565b600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612fb83390565b60405180610180016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000600281111561316e5761316e6131ed565b81526020016000815260200160008152602001600081525090565b60006020828403121561319b57600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff811681146131c657600080fd5b919050565b6000602082840312156131dd57600080fd5b6131e6826131a2565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6003811061322c5761322c6131ed565b9052565b6020810161323e828461321c565b92915050565b6000806040838503121561325757600080fd5b50508035926020909101359150565b6000806040838503121561327957600080fd5b82359150613289602084016131a2565b90509250929050565b6002811061322c5761322c6131ed565b838152606081016132b66020830185613292565b8215156040830152949350505050565b6000610180820190508d82528c60208301528b60408301528a60608301528960808301528860a08301528760c08301528660e083015261330a61010083018761321c565b613318610120830186613292565b61014082019390935261016001529a9950505050505050505050565b600061018082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e08301526101008084015161339a8285018261321c565b5050610120808401516133af82850182613292565b5050610140838101519083015261016092830151929091019190915290565b6000806000606084860312156133e357600080fd5b833592506020840135600281106133f957600080fd5b929592945050506040919091013590565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561323e5761323e61340a565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361347d5761347d61340a565b5060010190565b60006020828403121561349657600080fd5b815180151581146131e657600080fd5b808202811582820484141761323e5761323e61340a565b6000826134f3577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b604081016135068285613292565b8260208301529392505050565b8181038181111561323e5761323e61340a56fea2646970667358221220bdac09d2629108bc8e992ea31c7e8515fc6e7315d6b63a83670127945e93fe5a64736f6c63430008140033