false
true
0

Contract Address Details

0xAD8077417a6bb6cA4CD546E8f65aC4A7Fa4C4414

Contract Name
Miner
Creator
0x253bb2–2a1149 at 0xbff8be–0100ff
Balance
0 PLS ( )
Tokens
Fetching tokens...
Transactions
16,167 Transactions
Transfers
8,631 Transfers
Gas Used
1,399,123,996
Last Balance Update
26041051
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
Miner




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




EVM Version
paris




Verified at
2024-05-29T13:41:16.925729Z

contracts/Miner.sol

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

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IRouter} from "./IRouter.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

contract Miner is Ownable(msg.sender), ReentrancyGuard {
    using SafeERC20 for IERC20;

    uint256 public constant TREATS_TO_SPAWN_1TRAINER = 864_000;
    uint256 private constant PSN = 10_000;
    uint256 private constant PSNH = 5_000;
    bool public initialized = false;

    IERC20 public immutable token;
    IRouter public immutable routerDex;

    address public protocolAddress;
    address public burnAddress;

    mapping(address => uint256) public trainers;
    mapping(address => uint256) public claimedTokens;
    mapping(address => uint256) public lastTraining;
    mapping(address => uint256) public lastWithdraw;
    mapping(address => address) public referrals;

    mapping(address => uint256) public referralRewards;
    mapping(address => uint256) public myEarnings;

    uint256 private constant TRAINING_STEP = 1 days;
    uint256 private constant TRAINING_STEP_MODIFIER = 0.1e18;
    uint256 private constant BASE_PERCENTAGE = 0.5e18;

    uint256 public marketToken;

    constructor() {
        token = IERC20(0x2fa878Ab3F87CC1C9737Fc071108F904c0B0C95d); // set token token address
        routerDex = IRouter(0x165C3410fC91EF562C50559f7d2289fEbed552d9); // set router address 
        protocolAddress = 0xD9970eCd7175DA9A82F93643A13C25c7aBA9aFA7; // set protocol address
        burnAddress = 0xD9970eCd7175DA9A82F93643A13C25c7aBA9aFA7; // set burn address
    }

    /**  Public/External call **/

    function calculateTrade(uint256 rt, uint256 rs, uint256 bs) public pure returns (uint256) {
        return (PSN * bs) / (PSNH + ((PSN * rs + PSNH * rt) / rt));
    }

    function calculateTreatBuy(uint256 amount, uint256 contractBalance) public view returns (uint256) {
        return calculateTrade(amount, contractBalance, marketToken);
    }

    function calculateTreatBuySimple(uint256 amount) external view returns (uint256) {
        return calculateTreatBuy(amount, getBalance());
    }

    function calculateTreatSell(uint256 treats) public view returns (uint256) {
        if (treats > 0) {
            return calculateTrade(treats, marketToken, getBalance());
        }
        return 0;
    }

    function getHalvingPercentage() external view returns (uint256) {
        uint256 steps = (block.timestamp - lastWithdraw[msg.sender]) / TRAINING_STEP;
        return _min(1e18, BASE_PERCENTAGE + steps * TRAINING_STEP_MODIFIER);
    }

    function getBalance() public view returns (uint256) {
        return token.balanceOf(address(this));
    }

    function getMyTreats() public view returns (uint256) {
        return claimedTokens[msg.sender] + getTreatsSinceLastHatch(msg.sender);
    }

    function getTreatsSinceLastHatch(address adr) public view returns (uint256) {
        uint256 steps = (block.timestamp - lastWithdraw[msg.sender]) / TRAINING_STEP;

        // the percentage is capped at 100%
        // it takes 5 day to reach 100% after a withdrawal
        uint256 percentage = _min(
            1e18,
            BASE_PERCENTAGE + steps * TRAINING_STEP_MODIFIER
        );

        uint256 secondsPassed = _min(
            TREATS_TO_SPAWN_1TRAINER,
            block.timestamp - lastTraining[adr]
        );

        return ((secondsPassed * trainers[adr]) * percentage) / 1e18;
    }

    /**  Public/External TX **/

    event Compound(
        address indexed sender,
        uint256 treatsUsed,
        uint256 newTrainers,
        address indexed ref,
        uint256 referrerTreatsUsed
    );

    function compound(address ref) public {
        require(initialized, "ERROR_NOT_INITIALIZED");

        uint256 treatsUsed = getMyTreats();
        uint256 newTrainers = treatsUsed / TREATS_TO_SPAWN_1TRAINER;
        uint256 referrerTreatsUsed;

        if (referrals[msg.sender] == address(0) && ref != address(0) && ref != msg.sender) {
            referrals[msg.sender] = ref; // set ref if not set
            referrerTreatsUsed = treatsUsed / 10; 
            claimedTokens[ref] += referrerTreatsUsed; // give referrer 10% of the treats used
            referralRewards[ref] += referrerTreatsUsed;
        }

        trainers[msg.sender] += newTrainers; // add new trainers
        claimedTokens[msg.sender] = 0; // reset available
        lastTraining[msg.sender] = block.timestamp; // reset last training

        marketToken += treatsUsed / 2;

        emit Compound(msg.sender, treatsUsed, newTrainers, ref, referrerTreatsUsed);
    }

    event DepositPls(
        address indexed sender,
        uint256 amountToSpend,
        address protocolAddress,
        uint256 protocolFeePlsValue,
        uint256 minTokenAmount,
        uint256 tokenAmountOut,
        address indexed ref
    );

    function depositPLS(uint256 minTokenAmount, address ref) external payable nonReentrant {
        require(initialized, "ERROR_NOT_INITIALIZED");
        require(msg.value > 0, "ERROR_INVALID_AMOUNT");

        uint256 amountToSpend = msg.value;
        uint256 protocolFeePlsValue = _protocolFee(amountToSpend, true);

        (bool sendProtocolPls, ) = protocolAddress.call{value: protocolFeePlsValue}("");
        require(sendProtocolPls, "ERROR_PLS_PROTOCOL_FEE_SEND");

        amountToSpend -= protocolFeePlsValue;

        uint256 tokenAmountOut = _swap(minTokenAmount, amountToSpend);

        emit DepositPls(
            msg.sender,
            amountToSpend,
            protocolAddress,
            protocolFeePlsValue,
            minTokenAmount,
            tokenAmountOut,
            ref
        );

        _deposit(tokenAmountOut, ref, true);
    }

    event DepositToken(
        address indexed sender,
        uint256 amount,
        address indexed ref
    );

    function depositToken(uint256 amount, address ref) external nonReentrant {
        require(initialized, "ERROR_NOT_INITIALIZED");
        require(amount > 0, "ERROR_INVALID_AMOUNT");

        emit DepositToken(msg.sender, amount, ref);

        token.safeTransferFrom(msg.sender, address(this), amount);
        _deposit(amount, ref, false);
    }

    event Withdraw(
        address indexed sender,
        uint256 senderTreatValue,
        address indexed protocolAddress,
        uint256 protocolFee,
        address indexed burnAddress,
        uint256 burnFee
    );

    function withdraw() external nonReentrant{
        require(initialized, "ERROR_NOT_INITIALIZED");

        uint256 hasTreats = getMyTreats();
        require(hasTreats > 0, "ERROR_NO_KEYCATS");

        uint256 treatValue = calculateTreatSell(hasTreats);

        uint256 protocolFee = _protocolFee(treatValue, false);
        uint256 burnFee = _burnFee(treatValue);

        uint256 senderTreatValue = treatValue - protocolFee - burnFee;

        claimedTokens[msg.sender] = 0; // reset available
        lastTraining[msg.sender] = block.timestamp; // reset last training
        lastWithdraw[msg.sender] = block.timestamp; // set last withdraw

        marketToken += hasTreats;

        emit Withdraw(
            msg.sender,
            senderTreatValue,
            protocolAddress,
            protocolFee,
            burnAddress,
            burnFee
        );

        myEarnings[msg.sender] +=  senderTreatValue;

        token.safeTransfer(msg.sender, senderTreatValue);
        token.safeTransfer(protocolAddress, protocolFee);
        token.safeTransfer(burnAddress, burnFee);
    }

    /**  Public/External TX:Admin **/

    event SeedMarket(bool initialized, uint256 marketToken);

    function seedMarket() external payable onlyOwner {
        require(marketToken == 0, "ERROR_MARKET_ALREADY_SEEDED");
        initialized = true;
        marketToken = 86_400_000_000;
        emit SeedMarket(initialized, marketToken);
    }

    /** Private call **/

    function _protocolFee(uint256 amount, bool pls) private pure returns (uint256) {
        return pls ? (amount * 3_000) / 100_000 : (amount * 3_000) / 100_000;
    }

    function _burnFee(uint256 amount) private pure returns (uint256) {
        return (amount * 1_000) / 100_000;
    }

    function _min(uint256 a, uint256 b) private pure returns (uint256) {
        return a < b ? a : b;
    }

    /** Private TX **/

    function _deposit(uint256 amount, address ref, bool pls) private {
        uint256 protocolFee = _protocolFee(amount, pls);
        uint256 burnFee = _burnFee(amount);

        amount -= protocolFee + burnFee; // remove fees from 

        uint256 tokensBought = calculateTreatBuy(amount, getBalance() - amount); // calculate miners to buy

        claimedTokens[msg.sender] += tokensBought;

        compound(ref);

        token.safeTransfer(protocolAddress, protocolFee);
        token.safeTransfer(burnAddress, burnFee);
    }

    function _swap(uint256 minTokenOut, uint256 amountToSpend) private returns (uint256) {
        uint256 initialBalance = getBalance();

        address[] memory path = new address[](2);
        path[0] = routerDex.WPLS();
        path[1] = address(token);

        routerDex.swapExactETHForTokens{value: amountToSpend}(
            minTokenOut,
            path,
            address(this),
            block.timestamp
        );

        uint256 finalBalance = getBalance();
        require(finalBalance > initialBalance, "ERROR_SWAP_AMOUNTS");

        return finalBalance - initialBalance;
    }
}
        

@openzeppelin/contracts/utils/Context.sol

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

pragma solidity ^0.8.20;

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

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

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

@openzeppelin/contracts/access/Ownable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

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

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

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

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

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

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

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

@openzeppelin/contracts/token/ERC20/IERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

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

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

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

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

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

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

@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

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

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

@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";

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

    /**
     * @dev An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

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

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

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

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

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

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

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

        bytes memory returndata = address(token).functionCall(data);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

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

@openzeppelin/contracts/utils/Address.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

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

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

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

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

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

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

@openzeppelin/contracts/utils/ReentrancyGuard.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

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

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

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

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

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

contracts/IRouter.sol

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;

interface IRouter {
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
    returns (uint[] memory amounts);

    function WPLS() external returns (address);
}
          

Compiler Settings

{"outputSelection":{"*":{"*":["*"],"":["*"]}},"optimizer":{"runs":200,"enabled":false},"libraries":{},"evmVersion":"paris"}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"error","name":"AddressEmptyCode","inputs":[{"type":"address","name":"target","internalType":"address"}]},{"type":"error","name":"AddressInsufficientBalance","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"error","name":"FailedInnerCall","inputs":[]},{"type":"error","name":"OwnableInvalidOwner","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"error","name":"OwnableUnauthorizedAccount","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"error","name":"ReentrancyGuardReentrantCall","inputs":[]},{"type":"error","name":"SafeERC20FailedOperation","inputs":[{"type":"address","name":"token","internalType":"address"}]},{"type":"event","name":"Compound","inputs":[{"type":"address","name":"sender","internalType":"address","indexed":true},{"type":"uint256","name":"treatsUsed","internalType":"uint256","indexed":false},{"type":"uint256","name":"newTrainers","internalType":"uint256","indexed":false},{"type":"address","name":"ref","internalType":"address","indexed":true},{"type":"uint256","name":"referrerTreatsUsed","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"DepositPls","inputs":[{"type":"address","name":"sender","internalType":"address","indexed":true},{"type":"uint256","name":"amountToSpend","internalType":"uint256","indexed":false},{"type":"address","name":"protocolAddress","internalType":"address","indexed":false},{"type":"uint256","name":"protocolFeePlsValue","internalType":"uint256","indexed":false},{"type":"uint256","name":"minTokenAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"tokenAmountOut","internalType":"uint256","indexed":false},{"type":"address","name":"ref","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"DepositToken","inputs":[{"type":"address","name":"sender","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"address","name":"ref","internalType":"address","indexed":true}],"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":"SeedMarket","inputs":[{"type":"bool","name":"initialized","internalType":"bool","indexed":false},{"type":"uint256","name":"marketToken","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Withdraw","inputs":[{"type":"address","name":"sender","internalType":"address","indexed":true},{"type":"uint256","name":"senderTreatValue","internalType":"uint256","indexed":false},{"type":"address","name":"protocolAddress","internalType":"address","indexed":true},{"type":"uint256","name":"protocolFee","internalType":"uint256","indexed":false},{"type":"address","name":"burnAddress","internalType":"address","indexed":true},{"type":"uint256","name":"burnFee","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"TREATS_TO_SPAWN_1TRAINER","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"burnAddress","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"calculateTrade","inputs":[{"type":"uint256","name":"rt","internalType":"uint256"},{"type":"uint256","name":"rs","internalType":"uint256"},{"type":"uint256","name":"bs","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"calculateTreatBuy","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"contractBalance","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"calculateTreatBuySimple","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"calculateTreatSell","inputs":[{"type":"uint256","name":"treats","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"claimedTokens","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"compound","inputs":[{"type":"address","name":"ref","internalType":"address"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"depositPLS","inputs":[{"type":"uint256","name":"minTokenAmount","internalType":"uint256"},{"type":"address","name":"ref","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"depositToken","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"ref","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getBalance","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getHalvingPercentage","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getMyTreats","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getTreatsSinceLastHatch","inputs":[{"type":"address","name":"adr","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"initialized","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastTraining","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastWithdraw","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"marketToken","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"myEarnings","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"protocolAddress","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"referralRewards","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"referrals","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IRouter"}],"name":"routerDex","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"seedMarket","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"token","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"trainers","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[]}]
              

Contract Creation Code

0x60c06040526000600260006101000a81548160ff0219169083151502179055503480156200002c57600080fd5b5033600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603620000a35760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016200009a919062000305565b60405180910390fd5b620000b481620001fc60201b60201c565b5060018081905550732fa878ab3f87cc1c9737fc071108f904c0b0c95d73ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff168152505073165c3410fc91ef562c50559f7d2289febed552d973ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff168152505073d9970ecd7175da9a82f93643a13c25c7aba9afa7600260016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555073d9970ecd7175da9a82f93643a13c25c7aba9afa7600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555062000322565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620002ed82620002c0565b9050919050565b620002ff81620002e0565b82525050565b60006020820190506200031c6000830184620002f4565b92915050565b60805160a0516130696200038e6000396000818161164f01528181611cf70152611e45015260008181610780015281816111fd0152818161126a015281816112d70152818161183b015281816119d401528181611dd60152818161202d015261209a01526130696000f3fe6080604052600436106101cd5760003560e01c806370d5ae05116100f75780639ca423b311610095578063d34bfc2811610064578063d34bfc281461069a578063e9ba55b2146106c5578063f2fde38b14610702578063fc0c546a1461072b576101cd565b80639ca423b3146105cc578063a960c65f14610609578063ad48d61114610646578063c310b88414610671576101cd565b806390aff8b5116100d157806390aff8b51461051d57806393808fe214610539578063958ad1191461056457806399d43a99146105a1576101cd565b806370d5ae05146104b0578063715018a6146104db5780638da5cb5b146104f2576101cd565b80633b62848d1161016f57806343eeac6c1161013e57806343eeac6c146103ce57806353aaa63b1461040b578063624d7b72146104485780636c441ed214610485576101cd565b80633b62848d146103335780633c5f07cb146103705780633ccfd60b1461037a5780633dea04af14610391576101cd565b8063229824c4116101ab578063229824c414610253578063284dac23146102905780632cd92f97146102b95780632f5b36bb146102f6576101cd565b80630676c1b7146101d257806312065fe0146101fd578063158ef93e14610228575b600080fd5b3480156101de57600080fd5b506101e7610756565b6040516101f491906123ff565b60405180910390f35b34801561020957600080fd5b5061021261077c565b60405161021f9190612433565b60405180910390f35b34801561023457600080fd5b5061023d61081d565b60405161024a9190612469565b60405180910390f35b34801561025f57600080fd5b5061027a600480360381019061027591906124c4565b610830565b6040516102879190612433565b60405180910390f35b34801561029c57600080fd5b506102b760048036038101906102b29190612543565b610891565b005b3480156102c557600080fd5b506102e060048036038101906102db9190612543565b610cb2565b6040516102ed9190612433565b60405180910390f35b34801561030257600080fd5b5061031d60048036038101906103189190612543565b610cca565b60405161032a9190612433565b60405180910390f35b34801561033f57600080fd5b5061035a60048036038101906103559190612570565b610e32565b6040516103679190612433565b60405180910390f35b610378610e4c565b005b34801561038657600080fd5b5061038f610f0c565b005b34801561039d57600080fd5b506103b860048036038101906103b39190612570565b61132a565b6040516103c59190612433565b60405180910390f35b3480156103da57600080fd5b506103f560048036038101906103f0919061259d565b611359565b6040516104029190612433565b60405180910390f35b34801561041757600080fd5b50610432600480360381019061042d9190612543565b611370565b60405161043f9190612433565b60405180910390f35b34801561045457600080fd5b5061046f600480360381019061046a9190612543565b611388565b60405161047c9190612433565b60405180910390f35b34801561049157600080fd5b5061049a6113a0565b6040516104a79190612433565b60405180910390f35b3480156104bc57600080fd5b506104c56113a7565b6040516104d291906123ff565b60405180910390f35b3480156104e757600080fd5b506104f06113cd565b005b3480156104fe57600080fd5b506105076113e1565b60405161051491906123ff565b60405180910390f35b610537600480360381019061053291906125dd565b61140a565b005b34801561054557600080fd5b5061054e61164d565b60405161055b919061267c565b60405180910390f35b34801561057057600080fd5b5061058b60048036038101906105869190612543565b611671565b6040516105989190612433565b60405180910390f35b3480156105ad57600080fd5b506105b6611689565b6040516105c39190612433565b60405180910390f35b3480156105d857600080fd5b506105f360048036038101906105ee9190612543565b6116e3565b60405161060091906123ff565b60405180910390f35b34801561061557600080fd5b50610630600480360381019061062b9190612543565b611716565b60405161063d9190612433565b60405180910390f35b34801561065257600080fd5b5061065b61172e565b6040516106689190612433565b60405180910390f35b34801561067d57600080fd5b50610698600480360381019061069391906125dd565b611734565b005b3480156106a657600080fd5b506106af611898565b6040516106bc9190612433565b60405180910390f35b3480156106d157600080fd5b506106ec60048036038101906106e79190612543565b611934565b6040516106f99190612433565b60405180910390f35b34801561070e57600080fd5b5061072960048036038101906107249190612543565b61194c565b005b34801561073757600080fd5b506107406119d2565b60405161074d91906126b8565b60405180910390f35b600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016107d791906123ff565b602060405180830381865afa1580156107f4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081891906126e8565b905090565b600260009054906101000a900460ff1681565b600083846113886108419190612744565b8461271061084f9190612744565b6108599190612786565b61086391906127e9565b6113886108709190612786565b8261271061087e9190612744565b61088891906127e9565b90509392505050565b600260009054906101000a900460ff166108e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d790612877565b60405180910390fd5b60006108ea611689565b90506000620d2f00826108fd91906127e9565b905060008073ffffffffffffffffffffffffffffffffffffffff16600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156109c85750600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015610a0057503373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15610b3f5783600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a83610a9091906127e9565b905080600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ae19190612786565b9250508190555080600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b379190612786565b925050819055505b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b8e9190612786565b925050819055506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600283610c2b91906127e9565b600b6000828254610c3c9190612786565b925050819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f248d32c5893569b95b2456762347aba3446d8168b38becf5e3b0f93cc5596d52858585604051610ca493929190612897565b60405180910390a350505050565b60046020528060005260406000206000915090505481565b60008062015180600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442610d1c91906128ce565b610d2691906127e9565b90506000610d62670de0b6b3a764000067016345785d8a000084610d4a9190612744565b6706f05b59d3b20000610d5d9190612786565b6119f6565b90506000610dbd620d2f00600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442610db891906128ce565b6119f6565b9050670de0b6b3a764000082600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610e149190612744565b610e1e9190612744565b610e2891906127e9565b9350505050919050565b6000610e4582610e4061077c565b611359565b9050919050565b610e54611a0f565b6000600b5414610e99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e909061294e565b60405180910390fd5b6001600260006101000a81548160ff02191690831515021790555064141dd76000600b819055507fcc48ac39a472c75fe3886f46d596129a5f4a98be24ad73eb95888b7edc4d58d4600260009054906101000a900460ff16600b54604051610f0292919061296e565b60405180910390a1565b610f14611a96565b600260009054906101000a900460ff16610f63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5a90612877565b60405180910390fd5b6000610f6d611689565b905060008111610fb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa9906129e3565b60405180910390fd5b6000610fbd8261132a565b90506000610fcc826000611adc565b90506000610fd983611b29565b90506000818385610fea91906128ce565b610ff491906128ce565b90506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600b60008282546110d59190612786565b92505081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fa8af84333a074f5fddf18891494ce9f815b72cf90139f9a5822a120e4777759584878760405161119893929190612897565b60405180910390a480600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111ef9190612786565b9250508190555061124133827f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611b4e9092919063ffffffff16565b6112ae600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16847f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611b4e9092919063ffffffff16565b61131b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16837f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611b4e9092919063ffffffff16565b5050505050611328611bcd565b565b60008082111561134f5761134882600b5461134361077c565b610830565b9050611354565b600090505b919050565b60006113688383600b54610830565b905092915050565b60096020528060005260406000206000915090505481565b60076020528060005260406000206000915090505481565b620d2f0081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6113d5611a0f565b6113df6000611bd6565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611412611a96565b600260009054906101000a900460ff16611461576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161145890612877565b60405180910390fd5b600034116114a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149b90612a4f565b60405180910390fd5b600034905060006114b6826001611adc565b90506000600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260405161150090612aa0565b60006040518083038185875af1925050503d806000811461153d576040519150601f19603f3d011682016040523d82523d6000602084013e611542565b606091505b5050905080611586576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157d90612b01565b60405180910390fd5b818361159291906128ce565b925060006115a08685611c9a565b90508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167ffc01cd19dc03945c24627671a33dcaf9355618f0f1fae6fdf6361ea68ca826af86600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16878b87604051611629959493929190612b21565b60405180910390a361163d81866001611f51565b50505050611649611bcd565b5050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60066020528060005260406000206000915090505481565b600061169433610cca565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116de9190612786565b905090565b60086020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60056020528060005260406000206000915090505481565b600b5481565b61173c611a96565b600260009054906101000a900460ff1661178b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178290612877565b60405180910390fd5b600082116117ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c590612a4f565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f82a03d1c25e6b6e6d74ee931ac9043f24e8d854bbc70cea5966bbcdd1ed8744e8460405161182b9190612433565b60405180910390a36118803330847f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166120e6909392919063ffffffff16565b61188c82826000611f51565b611894611bcd565b5050565b60008062015180600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054426118ea91906128ce565b6118f491906127e9565b905061192e670de0b6b3a764000067016345785d8a0000836119169190612744565b6706f05b59d3b200006119299190612786565b6119f6565b91505090565b600a6020528060005260406000206000915090505481565b611954611a0f565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036119c65760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016119bd91906123ff565b60405180910390fd5b6119cf81611bd6565b50565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000818310611a055781611a07565b825b905092915050565b611a17612168565b73ffffffffffffffffffffffffffffffffffffffff16611a356113e1565b73ffffffffffffffffffffffffffffffffffffffff1614611a9457611a58612168565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401611a8b91906123ff565b60405180910390fd5b565b600260015403611ad2576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600181905550565b600081611b0457620186a0610bb884611af59190612744565b611aff91906127e9565b611b21565b620186a0610bb884611b169190612744565b611b2091906127e9565b5b905092915050565b6000620186a06103e883611b3d9190612744565b611b4791906127e9565b9050919050565b611bc8838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401611b81929190612b74565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612170565b505050565b60018081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080611ca561077c565b90506000600267ffffffffffffffff811115611cc457611cc3612b9d565b5b604051908082528060200260200182016040528015611cf25781602001602082028036833780820191505090505b5090507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663ef8ef56f6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611d62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d869190612be1565b81600081518110611d9a57611d99612c0e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250507f000000000000000000000000000000000000000000000000000000000000000081600181518110611e0957611e08612c0e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16637ff36ab585878430426040518663ffffffff1660e01b8152600401611ea39493929190612cfb565b60006040518083038185885af1158015611ec1573d6000803e3d6000fd5b50505050506040513d6000823e3d601f19601f82011682018060405250810190611eeb9190612e71565b506000611ef661077c565b9050828111611f3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f3190612f06565b60405180910390fd5b8281611f4691906128ce565b935050505092915050565b6000611f5d8483611adc565b90506000611f6a85611b29565b90508082611f789190612786565b85611f8391906128ce565b94506000611fa38687611f9461077c565b611f9e91906128ce565b611359565b905080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611ff49190612786565b9250508190555061200485610891565b612071600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16847f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611b4e9092919063ffffffff16565b6120de600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16837f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611b4e9092919063ffffffff16565b505050505050565b612162848573ffffffffffffffffffffffffffffffffffffffff166323b872dd86868660405160240161211b93929190612f26565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612170565b50505050565b600033905090565b600061219b828473ffffffffffffffffffffffffffffffffffffffff1661220790919063ffffffff16565b905060008151141580156121c05750808060200190518101906121be9190612f89565b155b1561220257826040517f5274afe70000000000000000000000000000000000000000000000000000000081526004016121f991906123ff565b60405180910390fd5b505050565b60606122158383600061221d565b905092915050565b60608147101561226457306040517fcd78605900000000000000000000000000000000000000000000000000000000815260040161225b91906123ff565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16848660405161228d919061301c565b60006040518083038185875af1925050503d80600081146122ca576040519150601f19603f3d011682016040523d82523d6000602084013e6122cf565b606091505b50915091506122df8683836122ea565b925050509392505050565b6060826122ff576122fa82612379565b612371565b60008251148015612327575060008473ffffffffffffffffffffffffffffffffffffffff163b145b1561236957836040517f9996b31500000000000000000000000000000000000000000000000000000000815260040161236091906123ff565b60405180910390fd5b819050612372565b5b9392505050565b60008151111561238c5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006123e9826123be565b9050919050565b6123f9816123de565b82525050565b600060208201905061241460008301846123f0565b92915050565b6000819050919050565b61242d8161241a565b82525050565b60006020820190506124486000830184612424565b92915050565b60008115159050919050565b6124638161244e565b82525050565b600060208201905061247e600083018461245a565b92915050565b6000604051905090565b600080fd5b600080fd5b6124a18161241a565b81146124ac57600080fd5b50565b6000813590506124be81612498565b92915050565b6000806000606084860312156124dd576124dc61248e565b5b60006124eb868287016124af565b93505060206124fc868287016124af565b925050604061250d868287016124af565b9150509250925092565b612520816123de565b811461252b57600080fd5b50565b60008135905061253d81612517565b92915050565b6000602082840312156125595761255861248e565b5b60006125678482850161252e565b91505092915050565b6000602082840312156125865761258561248e565b5b6000612594848285016124af565b91505092915050565b600080604083850312156125b4576125b361248e565b5b60006125c2858286016124af565b92505060206125d3858286016124af565b9150509250929050565b600080604083850312156125f4576125f361248e565b5b6000612602858286016124af565b92505060206126138582860161252e565b9150509250929050565b6000819050919050565b600061264261263d612638846123be565b61261d565b6123be565b9050919050565b600061265482612627565b9050919050565b600061266682612649565b9050919050565b6126768161265b565b82525050565b6000602082019050612691600083018461266d565b92915050565b60006126a282612649565b9050919050565b6126b281612697565b82525050565b60006020820190506126cd60008301846126a9565b92915050565b6000815190506126e281612498565b92915050565b6000602082840312156126fe576126fd61248e565b5b600061270c848285016126d3565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061274f8261241a565b915061275a8361241a565b92508282026127688161241a565b9150828204841483151761277f5761277e612715565b5b5092915050565b60006127918261241a565b915061279c8361241a565b92508282019050808211156127b4576127b3612715565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006127f48261241a565b91506127ff8361241a565b92508261280f5761280e6127ba565b5b828204905092915050565b600082825260208201905092915050565b7f4552524f525f4e4f545f494e495449414c495a45440000000000000000000000600082015250565b600061286160158361281a565b915061286c8261282b565b602082019050919050565b6000602082019050818103600083015261289081612854565b9050919050565b60006060820190506128ac6000830186612424565b6128b96020830185612424565b6128c66040830184612424565b949350505050565b60006128d98261241a565b91506128e48361241a565b92508282039050818111156128fc576128fb612715565b5b92915050565b7f4552524f525f4d41524b45545f414c52454144595f5345454445440000000000600082015250565b6000612938601b8361281a565b915061294382612902565b602082019050919050565b600060208201905081810360008301526129678161292b565b9050919050565b6000604082019050612983600083018561245a565b6129906020830184612424565b9392505050565b7f4552524f525f4e4f5f4b45594341545300000000000000000000000000000000600082015250565b60006129cd60108361281a565b91506129d882612997565b602082019050919050565b600060208201905081810360008301526129fc816129c0565b9050919050565b7f4552524f525f494e56414c49445f414d4f554e54000000000000000000000000600082015250565b6000612a3960148361281a565b9150612a4482612a03565b602082019050919050565b60006020820190508181036000830152612a6881612a2c565b9050919050565b600081905092915050565b50565b6000612a8a600083612a6f565b9150612a9582612a7a565b600082019050919050565b6000612aab82612a7d565b9150819050919050565b7f4552524f525f504c535f50524f544f434f4c5f4645455f53454e440000000000600082015250565b6000612aeb601b8361281a565b9150612af682612ab5565b602082019050919050565b60006020820190508181036000830152612b1a81612ade565b9050919050565b600060a082019050612b366000830188612424565b612b4360208301876123f0565b612b506040830186612424565b612b5d6060830185612424565b612b6a6080830184612424565b9695505050505050565b6000604082019050612b8960008301856123f0565b612b966020830184612424565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600081519050612bdb81612517565b92915050565b600060208284031215612bf757612bf661248e565b5b6000612c0584828501612bcc565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612c72816123de565b82525050565b6000612c848383612c69565b60208301905092915050565b6000602082019050919050565b6000612ca882612c3d565b612cb28185612c48565b9350612cbd83612c59565b8060005b83811015612cee578151612cd58882612c78565b9750612ce083612c90565b925050600181019050612cc1565b5085935050505092915050565b6000608082019050612d106000830187612424565b8181036020830152612d228186612c9d565b9050612d3160408301856123f0565b612d3e6060830184612424565b95945050505050565b600080fd5b6000601f19601f8301169050919050565b612d6682612d4c565b810181811067ffffffffffffffff82111715612d8557612d84612b9d565b5b80604052505050565b6000612d98612484565b9050612da48282612d5d565b919050565b600067ffffffffffffffff821115612dc457612dc3612b9d565b5b602082029050602081019050919050565b600080fd5b6000612ded612de884612da9565b612d8e565b90508083825260208201905060208402830185811115612e1057612e0f612dd5565b5b835b81811015612e395780612e2588826126d3565b845260208401935050602081019050612e12565b5050509392505050565b600082601f830112612e5857612e57612d47565b5b8151612e68848260208601612dda565b91505092915050565b600060208284031215612e8757612e8661248e565b5b600082015167ffffffffffffffff811115612ea557612ea4612493565b5b612eb184828501612e43565b91505092915050565b7f4552524f525f535741505f414d4f554e54530000000000000000000000000000600082015250565b6000612ef060128361281a565b9150612efb82612eba565b602082019050919050565b60006020820190508181036000830152612f1f81612ee3565b9050919050565b6000606082019050612f3b60008301866123f0565b612f4860208301856123f0565b612f556040830184612424565b949350505050565b612f668161244e565b8114612f7157600080fd5b50565b600081519050612f8381612f5d565b92915050565b600060208284031215612f9f57612f9e61248e565b5b6000612fad84828501612f74565b91505092915050565b600081519050919050565b60005b83811015612fdf578082015181840152602081019050612fc4565b60008484015250505050565b6000612ff682612fb6565b6130008185612a6f565b9350613010818560208601612fc1565b80840191505092915050565b60006130288284612feb565b91508190509291505056fea26469706673582212207df6a9e77e49e94f1c065ea7d26879c782e2c5646b773b1303a56d587a0bdd2b64736f6c63430008140033

Deployed ByteCode

0x6080604052600436106101cd5760003560e01c806370d5ae05116100f75780639ca423b311610095578063d34bfc2811610064578063d34bfc281461069a578063e9ba55b2146106c5578063f2fde38b14610702578063fc0c546a1461072b576101cd565b80639ca423b3146105cc578063a960c65f14610609578063ad48d61114610646578063c310b88414610671576101cd565b806390aff8b5116100d157806390aff8b51461051d57806393808fe214610539578063958ad1191461056457806399d43a99146105a1576101cd565b806370d5ae05146104b0578063715018a6146104db5780638da5cb5b146104f2576101cd565b80633b62848d1161016f57806343eeac6c1161013e57806343eeac6c146103ce57806353aaa63b1461040b578063624d7b72146104485780636c441ed214610485576101cd565b80633b62848d146103335780633c5f07cb146103705780633ccfd60b1461037a5780633dea04af14610391576101cd565b8063229824c4116101ab578063229824c414610253578063284dac23146102905780632cd92f97146102b95780632f5b36bb146102f6576101cd565b80630676c1b7146101d257806312065fe0146101fd578063158ef93e14610228575b600080fd5b3480156101de57600080fd5b506101e7610756565b6040516101f491906123ff565b60405180910390f35b34801561020957600080fd5b5061021261077c565b60405161021f9190612433565b60405180910390f35b34801561023457600080fd5b5061023d61081d565b60405161024a9190612469565b60405180910390f35b34801561025f57600080fd5b5061027a600480360381019061027591906124c4565b610830565b6040516102879190612433565b60405180910390f35b34801561029c57600080fd5b506102b760048036038101906102b29190612543565b610891565b005b3480156102c557600080fd5b506102e060048036038101906102db9190612543565b610cb2565b6040516102ed9190612433565b60405180910390f35b34801561030257600080fd5b5061031d60048036038101906103189190612543565b610cca565b60405161032a9190612433565b60405180910390f35b34801561033f57600080fd5b5061035a60048036038101906103559190612570565b610e32565b6040516103679190612433565b60405180910390f35b610378610e4c565b005b34801561038657600080fd5b5061038f610f0c565b005b34801561039d57600080fd5b506103b860048036038101906103b39190612570565b61132a565b6040516103c59190612433565b60405180910390f35b3480156103da57600080fd5b506103f560048036038101906103f0919061259d565b611359565b6040516104029190612433565b60405180910390f35b34801561041757600080fd5b50610432600480360381019061042d9190612543565b611370565b60405161043f9190612433565b60405180910390f35b34801561045457600080fd5b5061046f600480360381019061046a9190612543565b611388565b60405161047c9190612433565b60405180910390f35b34801561049157600080fd5b5061049a6113a0565b6040516104a79190612433565b60405180910390f35b3480156104bc57600080fd5b506104c56113a7565b6040516104d291906123ff565b60405180910390f35b3480156104e757600080fd5b506104f06113cd565b005b3480156104fe57600080fd5b506105076113e1565b60405161051491906123ff565b60405180910390f35b610537600480360381019061053291906125dd565b61140a565b005b34801561054557600080fd5b5061054e61164d565b60405161055b919061267c565b60405180910390f35b34801561057057600080fd5b5061058b60048036038101906105869190612543565b611671565b6040516105989190612433565b60405180910390f35b3480156105ad57600080fd5b506105b6611689565b6040516105c39190612433565b60405180910390f35b3480156105d857600080fd5b506105f360048036038101906105ee9190612543565b6116e3565b60405161060091906123ff565b60405180910390f35b34801561061557600080fd5b50610630600480360381019061062b9190612543565b611716565b60405161063d9190612433565b60405180910390f35b34801561065257600080fd5b5061065b61172e565b6040516106689190612433565b60405180910390f35b34801561067d57600080fd5b50610698600480360381019061069391906125dd565b611734565b005b3480156106a657600080fd5b506106af611898565b6040516106bc9190612433565b60405180910390f35b3480156106d157600080fd5b506106ec60048036038101906106e79190612543565b611934565b6040516106f99190612433565b60405180910390f35b34801561070e57600080fd5b5061072960048036038101906107249190612543565b61194c565b005b34801561073757600080fd5b506107406119d2565b60405161074d91906126b8565b60405180910390f35b600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60007f0000000000000000000000002fa878ab3f87cc1c9737fc071108f904c0b0c95d73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016107d791906123ff565b602060405180830381865afa1580156107f4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081891906126e8565b905090565b600260009054906101000a900460ff1681565b600083846113886108419190612744565b8461271061084f9190612744565b6108599190612786565b61086391906127e9565b6113886108709190612786565b8261271061087e9190612744565b61088891906127e9565b90509392505050565b600260009054906101000a900460ff166108e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d790612877565b60405180910390fd5b60006108ea611689565b90506000620d2f00826108fd91906127e9565b905060008073ffffffffffffffffffffffffffffffffffffffff16600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156109c85750600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015610a0057503373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15610b3f5783600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a83610a9091906127e9565b905080600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ae19190612786565b9250508190555080600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b379190612786565b925050819055505b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b8e9190612786565b925050819055506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600283610c2b91906127e9565b600b6000828254610c3c9190612786565b925050819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f248d32c5893569b95b2456762347aba3446d8168b38becf5e3b0f93cc5596d52858585604051610ca493929190612897565b60405180910390a350505050565b60046020528060005260406000206000915090505481565b60008062015180600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442610d1c91906128ce565b610d2691906127e9565b90506000610d62670de0b6b3a764000067016345785d8a000084610d4a9190612744565b6706f05b59d3b20000610d5d9190612786565b6119f6565b90506000610dbd620d2f00600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442610db891906128ce565b6119f6565b9050670de0b6b3a764000082600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610e149190612744565b610e1e9190612744565b610e2891906127e9565b9350505050919050565b6000610e4582610e4061077c565b611359565b9050919050565b610e54611a0f565b6000600b5414610e99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e909061294e565b60405180910390fd5b6001600260006101000a81548160ff02191690831515021790555064141dd76000600b819055507fcc48ac39a472c75fe3886f46d596129a5f4a98be24ad73eb95888b7edc4d58d4600260009054906101000a900460ff16600b54604051610f0292919061296e565b60405180910390a1565b610f14611a96565b600260009054906101000a900460ff16610f63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5a90612877565b60405180910390fd5b6000610f6d611689565b905060008111610fb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa9906129e3565b60405180910390fd5b6000610fbd8261132a565b90506000610fcc826000611adc565b90506000610fd983611b29565b90506000818385610fea91906128ce565b610ff491906128ce565b90506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600b60008282546110d59190612786565b92505081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fa8af84333a074f5fddf18891494ce9f815b72cf90139f9a5822a120e4777759584878760405161119893929190612897565b60405180910390a480600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111ef9190612786565b9250508190555061124133827f0000000000000000000000002fa878ab3f87cc1c9737fc071108f904c0b0c95d73ffffffffffffffffffffffffffffffffffffffff16611b4e9092919063ffffffff16565b6112ae600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16847f0000000000000000000000002fa878ab3f87cc1c9737fc071108f904c0b0c95d73ffffffffffffffffffffffffffffffffffffffff16611b4e9092919063ffffffff16565b61131b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16837f0000000000000000000000002fa878ab3f87cc1c9737fc071108f904c0b0c95d73ffffffffffffffffffffffffffffffffffffffff16611b4e9092919063ffffffff16565b5050505050611328611bcd565b565b60008082111561134f5761134882600b5461134361077c565b610830565b9050611354565b600090505b919050565b60006113688383600b54610830565b905092915050565b60096020528060005260406000206000915090505481565b60076020528060005260406000206000915090505481565b620d2f0081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6113d5611a0f565b6113df6000611bd6565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611412611a96565b600260009054906101000a900460ff16611461576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161145890612877565b60405180910390fd5b600034116114a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149b90612a4f565b60405180910390fd5b600034905060006114b6826001611adc565b90506000600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260405161150090612aa0565b60006040518083038185875af1925050503d806000811461153d576040519150601f19603f3d011682016040523d82523d6000602084013e611542565b606091505b5050905080611586576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157d90612b01565b60405180910390fd5b818361159291906128ce565b925060006115a08685611c9a565b90508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167ffc01cd19dc03945c24627671a33dcaf9355618f0f1fae6fdf6361ea68ca826af86600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16878b87604051611629959493929190612b21565b60405180910390a361163d81866001611f51565b50505050611649611bcd565b5050565b7f000000000000000000000000165c3410fc91ef562c50559f7d2289febed552d981565b60066020528060005260406000206000915090505481565b600061169433610cca565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116de9190612786565b905090565b60086020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60056020528060005260406000206000915090505481565b600b5481565b61173c611a96565b600260009054906101000a900460ff1661178b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178290612877565b60405180910390fd5b600082116117ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c590612a4f565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f82a03d1c25e6b6e6d74ee931ac9043f24e8d854bbc70cea5966bbcdd1ed8744e8460405161182b9190612433565b60405180910390a36118803330847f0000000000000000000000002fa878ab3f87cc1c9737fc071108f904c0b0c95d73ffffffffffffffffffffffffffffffffffffffff166120e6909392919063ffffffff16565b61188c82826000611f51565b611894611bcd565b5050565b60008062015180600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054426118ea91906128ce565b6118f491906127e9565b905061192e670de0b6b3a764000067016345785d8a0000836119169190612744565b6706f05b59d3b200006119299190612786565b6119f6565b91505090565b600a6020528060005260406000206000915090505481565b611954611a0f565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036119c65760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016119bd91906123ff565b60405180910390fd5b6119cf81611bd6565b50565b7f0000000000000000000000002fa878ab3f87cc1c9737fc071108f904c0b0c95d81565b6000818310611a055781611a07565b825b905092915050565b611a17612168565b73ffffffffffffffffffffffffffffffffffffffff16611a356113e1565b73ffffffffffffffffffffffffffffffffffffffff1614611a9457611a58612168565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401611a8b91906123ff565b60405180910390fd5b565b600260015403611ad2576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600181905550565b600081611b0457620186a0610bb884611af59190612744565b611aff91906127e9565b611b21565b620186a0610bb884611b169190612744565b611b2091906127e9565b5b905092915050565b6000620186a06103e883611b3d9190612744565b611b4791906127e9565b9050919050565b611bc8838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401611b81929190612b74565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612170565b505050565b60018081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080611ca561077c565b90506000600267ffffffffffffffff811115611cc457611cc3612b9d565b5b604051908082528060200260200182016040528015611cf25781602001602082028036833780820191505090505b5090507f000000000000000000000000165c3410fc91ef562c50559f7d2289febed552d973ffffffffffffffffffffffffffffffffffffffff1663ef8ef56f6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611d62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d869190612be1565b81600081518110611d9a57611d99612c0e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250507f0000000000000000000000002fa878ab3f87cc1c9737fc071108f904c0b0c95d81600181518110611e0957611e08612c0e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250507f000000000000000000000000165c3410fc91ef562c50559f7d2289febed552d973ffffffffffffffffffffffffffffffffffffffff16637ff36ab585878430426040518663ffffffff1660e01b8152600401611ea39493929190612cfb565b60006040518083038185885af1158015611ec1573d6000803e3d6000fd5b50505050506040513d6000823e3d601f19601f82011682018060405250810190611eeb9190612e71565b506000611ef661077c565b9050828111611f3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f3190612f06565b60405180910390fd5b8281611f4691906128ce565b935050505092915050565b6000611f5d8483611adc565b90506000611f6a85611b29565b90508082611f789190612786565b85611f8391906128ce565b94506000611fa38687611f9461077c565b611f9e91906128ce565b611359565b905080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611ff49190612786565b9250508190555061200485610891565b612071600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16847f0000000000000000000000002fa878ab3f87cc1c9737fc071108f904c0b0c95d73ffffffffffffffffffffffffffffffffffffffff16611b4e9092919063ffffffff16565b6120de600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16837f0000000000000000000000002fa878ab3f87cc1c9737fc071108f904c0b0c95d73ffffffffffffffffffffffffffffffffffffffff16611b4e9092919063ffffffff16565b505050505050565b612162848573ffffffffffffffffffffffffffffffffffffffff166323b872dd86868660405160240161211b93929190612f26565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612170565b50505050565b600033905090565b600061219b828473ffffffffffffffffffffffffffffffffffffffff1661220790919063ffffffff16565b905060008151141580156121c05750808060200190518101906121be9190612f89565b155b1561220257826040517f5274afe70000000000000000000000000000000000000000000000000000000081526004016121f991906123ff565b60405180910390fd5b505050565b60606122158383600061221d565b905092915050565b60608147101561226457306040517fcd78605900000000000000000000000000000000000000000000000000000000815260040161225b91906123ff565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16848660405161228d919061301c565b60006040518083038185875af1925050503d80600081146122ca576040519150601f19603f3d011682016040523d82523d6000602084013e6122cf565b606091505b50915091506122df8683836122ea565b925050509392505050565b6060826122ff576122fa82612379565b612371565b60008251148015612327575060008473ffffffffffffffffffffffffffffffffffffffff163b145b1561236957836040517f9996b31500000000000000000000000000000000000000000000000000000000815260040161236091906123ff565b60405180910390fd5b819050612372565b5b9392505050565b60008151111561238c5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006123e9826123be565b9050919050565b6123f9816123de565b82525050565b600060208201905061241460008301846123f0565b92915050565b6000819050919050565b61242d8161241a565b82525050565b60006020820190506124486000830184612424565b92915050565b60008115159050919050565b6124638161244e565b82525050565b600060208201905061247e600083018461245a565b92915050565b6000604051905090565b600080fd5b600080fd5b6124a18161241a565b81146124ac57600080fd5b50565b6000813590506124be81612498565b92915050565b6000806000606084860312156124dd576124dc61248e565b5b60006124eb868287016124af565b93505060206124fc868287016124af565b925050604061250d868287016124af565b9150509250925092565b612520816123de565b811461252b57600080fd5b50565b60008135905061253d81612517565b92915050565b6000602082840312156125595761255861248e565b5b60006125678482850161252e565b91505092915050565b6000602082840312156125865761258561248e565b5b6000612594848285016124af565b91505092915050565b600080604083850312156125b4576125b361248e565b5b60006125c2858286016124af565b92505060206125d3858286016124af565b9150509250929050565b600080604083850312156125f4576125f361248e565b5b6000612602858286016124af565b92505060206126138582860161252e565b9150509250929050565b6000819050919050565b600061264261263d612638846123be565b61261d565b6123be565b9050919050565b600061265482612627565b9050919050565b600061266682612649565b9050919050565b6126768161265b565b82525050565b6000602082019050612691600083018461266d565b92915050565b60006126a282612649565b9050919050565b6126b281612697565b82525050565b60006020820190506126cd60008301846126a9565b92915050565b6000815190506126e281612498565b92915050565b6000602082840312156126fe576126fd61248e565b5b600061270c848285016126d3565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061274f8261241a565b915061275a8361241a565b92508282026127688161241a565b9150828204841483151761277f5761277e612715565b5b5092915050565b60006127918261241a565b915061279c8361241a565b92508282019050808211156127b4576127b3612715565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006127f48261241a565b91506127ff8361241a565b92508261280f5761280e6127ba565b5b828204905092915050565b600082825260208201905092915050565b7f4552524f525f4e4f545f494e495449414c495a45440000000000000000000000600082015250565b600061286160158361281a565b915061286c8261282b565b602082019050919050565b6000602082019050818103600083015261289081612854565b9050919050565b60006060820190506128ac6000830186612424565b6128b96020830185612424565b6128c66040830184612424565b949350505050565b60006128d98261241a565b91506128e48361241a565b92508282039050818111156128fc576128fb612715565b5b92915050565b7f4552524f525f4d41524b45545f414c52454144595f5345454445440000000000600082015250565b6000612938601b8361281a565b915061294382612902565b602082019050919050565b600060208201905081810360008301526129678161292b565b9050919050565b6000604082019050612983600083018561245a565b6129906020830184612424565b9392505050565b7f4552524f525f4e4f5f4b45594341545300000000000000000000000000000000600082015250565b60006129cd60108361281a565b91506129d882612997565b602082019050919050565b600060208201905081810360008301526129fc816129c0565b9050919050565b7f4552524f525f494e56414c49445f414d4f554e54000000000000000000000000600082015250565b6000612a3960148361281a565b9150612a4482612a03565b602082019050919050565b60006020820190508181036000830152612a6881612a2c565b9050919050565b600081905092915050565b50565b6000612a8a600083612a6f565b9150612a9582612a7a565b600082019050919050565b6000612aab82612a7d565b9150819050919050565b7f4552524f525f504c535f50524f544f434f4c5f4645455f53454e440000000000600082015250565b6000612aeb601b8361281a565b9150612af682612ab5565b602082019050919050565b60006020820190508181036000830152612b1a81612ade565b9050919050565b600060a082019050612b366000830188612424565b612b4360208301876123f0565b612b506040830186612424565b612b5d6060830185612424565b612b6a6080830184612424565b9695505050505050565b6000604082019050612b8960008301856123f0565b612b966020830184612424565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600081519050612bdb81612517565b92915050565b600060208284031215612bf757612bf661248e565b5b6000612c0584828501612bcc565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612c72816123de565b82525050565b6000612c848383612c69565b60208301905092915050565b6000602082019050919050565b6000612ca882612c3d565b612cb28185612c48565b9350612cbd83612c59565b8060005b83811015612cee578151612cd58882612c78565b9750612ce083612c90565b925050600181019050612cc1565b5085935050505092915050565b6000608082019050612d106000830187612424565b8181036020830152612d228186612c9d565b9050612d3160408301856123f0565b612d3e6060830184612424565b95945050505050565b600080fd5b6000601f19601f8301169050919050565b612d6682612d4c565b810181811067ffffffffffffffff82111715612d8557612d84612b9d565b5b80604052505050565b6000612d98612484565b9050612da48282612d5d565b919050565b600067ffffffffffffffff821115612dc457612dc3612b9d565b5b602082029050602081019050919050565b600080fd5b6000612ded612de884612da9565b612d8e565b90508083825260208201905060208402830185811115612e1057612e0f612dd5565b5b835b81811015612e395780612e2588826126d3565b845260208401935050602081019050612e12565b5050509392505050565b600082601f830112612e5857612e57612d47565b5b8151612e68848260208601612dda565b91505092915050565b600060208284031215612e8757612e8661248e565b5b600082015167ffffffffffffffff811115612ea557612ea4612493565b5b612eb184828501612e43565b91505092915050565b7f4552524f525f535741505f414d4f554e54530000000000000000000000000000600082015250565b6000612ef060128361281a565b9150612efb82612eba565b602082019050919050565b60006020820190508181036000830152612f1f81612ee3565b9050919050565b6000606082019050612f3b60008301866123f0565b612f4860208301856123f0565b612f556040830184612424565b949350505050565b612f668161244e565b8114612f7157600080fd5b50565b600081519050612f8381612f5d565b92915050565b600060208284031215612f9f57612f9e61248e565b5b6000612fad84828501612f74565b91505092915050565b600081519050919050565b60005b83811015612fdf578082015181840152602081019050612fc4565b60008484015250505050565b6000612ff682612fb6565b6130008185612a6f565b9350613010818560208601612fc1565b80840191505092915050565b60006130288284612feb565b91508190509291505056fea26469706673582212207df6a9e77e49e94f1c065ea7d26879c782e2c5646b773b1303a56d587a0bdd2b64736f6c63430008140033