false

Contract Address Details

0x42d175a498Cb517Ad29d055ea7DcFD3D99045404

Contract Name
StableArswStaking
Creator
0x32c2b2–e25fd3 at 0x5c2718–793a4e
Balance
0 ASTR ( )
Tokens
Fetching tokens...
Transactions
16,019 Transactions
Transfers
26,887 Transfers
Gas Used
1,266,411,192
Last Balance Update
2841131
Contract name:
StableArswStaking




Optimization enabled
true
Compiler version
v0.8.9+commit.e5eed63a




Optimization runs
999999
Verified at
2022-06-28T08:26:44.206348Z

Constructor Arguments

000000000000000000000000de2578edec4669ba7f41c5d5d2386300bcea4678000000000000000000000000de2578edec4669ba7f41c5d5d2386300bcea4678000000000000000000000000aaeeba12c2d241be5688725bf346770070f0a62f000000000000000000000000000000000000000000000000002386f26fc10000

Arg [0] (address) : 0xde2578edec4669ba7f41c5d5d2386300bcea4678
Arg [1] (address) : 0xde2578edec4669ba7f41c5d5d2386300bcea4678
Arg [2] (address) : 0xaaeeba12c2d241be5688725bf346770070f0a62f
Arg [3] (uint256) : 10000000000000000

              

contracts/StableArswStaking.sol

Sol2uml
new
// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;

import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

/**
 * @title Stable ARSW Staking
 * @notice StableArswStaking is a contract that allows ARSW deposits and receives stablecoins sent by MoneyMaker's daily
 * harvests. Users deposit ARSW and receive a share of what has been sent by MoneyMaker based on their participation of
 * the total deposited ARSW. It is similar to a MasterChef, but we allow for claiming of different reward tokens
 * (in case at some point we wish to change the stablecoin rewarded).
 * Every time `updateReward(token)` is called, We distribute the balance of that tokens as rewards to users that are
 * currently staking inside this contract, and they can claim it using `withdraw(0)`
 */
contract StableArswStaking is Ownable, ReentrancyGuard {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    /// @notice Info of each user
    struct UserInfo {
        uint256 amount;
        mapping(IERC20 => uint256) rewardDebt;
        /**
         * @notice We do some fancy math here. Basically, any point in time, the amount of ARSWs
         * entitled to a user but is pending to be distributed is:
         *
         *   pending reward = (user.amount * accRewardPerShare) - user.rewardDebt[token]
         *
         * Whenever a user deposits or withdraws ARSW. Here's what happens:
         *   1. accRewardPerShare (and `lastRewardBalance`) gets updated
         *   2. User receives the pending reward sent to his/her address
         *   3. User's `amount` gets updated
         *   4. User's `rewardDebt[token]` gets updated
         */
    }

    IERC20 public immutable arsw;

    /// @dev Internal balance of ARSW, this gets updated on user deposits / withdrawals
    /// this allows to reward users with ARSW
    uint256 public internalArswBalance;
    /// @notice Array of tokens that users can claim
    IERC20[] public rewardTokens;
    mapping(IERC20 => bool) public isRewardToken;
    /// @notice Last reward balance of `token`
    mapping(IERC20 => uint256) public lastRewardBalance;

    address public feeCollector;

    /// @notice The deposit fee, scaled to `DEPOSIT_FEE_PERCENT_PRECISION`
    uint256 public depositFeePercent;
    /// @notice The precision of `depositFeePercent`
    uint256 public constant DEPOSIT_FEE_PERCENT_PRECISION = 1e18;

    /// @notice Accumulated `token` rewards per share, scaled to `ACC_REWARD_PER_SHARE_PRECISION`
    mapping(IERC20 => uint256) public accRewardPerShare;
    /// @notice The precision of `accRewardPerShare`
    uint256 public constant ACC_REWARD_PER_SHARE_PRECISION = 1e24;

    /// @dev Info of each user that stakes ARSW
    mapping(address => UserInfo) private userInfo;

    /// @notice Emitted when a user deposits ARSW
    event Deposit(address indexed user, uint256 amount, uint256 fee);

    /// @notice Emitted when owner changes the deposit fee percentage
    event DepositFeeChanged(uint256 newFee, uint256 oldFee);

    /// @notice Emitted when a user withdraws ARSW
    event Withdraw(address indexed user, uint256 amount);

    /// @notice Emitted when a user claims reward
    event ClaimReward(
        address indexed user,
        address indexed rewardToken,
        uint256 amount
    );

    /// @notice Emitted when a user emergency withdraws its ARSW
    event EmergencyWithdraw(address indexed user, uint256 amount);

    /// @notice Emitted when owner adds a token to the reward tokens list
    event RewardTokenAdded(address token);

    /// @notice Emitted when owner removes a token from the reward tokens list
    event RewardTokenRemoved(address token);

    /**
     * @notice Initialize a new StableArswStaking contract
     * @dev This contract needs to receive an ERC20 `_rewardToken` in order to distribute them
     * (with MoneyMaker in our case)
     * @param _rewardToken The address of the ERC20 reward token
     * @param _arsw The address of the ARSW token
     * @param _feeCollector The address where deposit fees will be sent
     * @param _depositFeePercent The deposit fee percent, scalled to 1e18, e.g. 3% is 3e16
     */
    constructor(
        IERC20 _rewardToken,
        IERC20 _arsw,
        address _feeCollector,
        uint256 _depositFeePercent
    ) {
        require(
            address(_rewardToken) != address(0),
            "StableArswStaking: reward token cannot be address(0)"
        );
        require(
            address(_arsw) != address(0),
            "StableArswStaking: arsw cannot be address(0)"
        );
        require(
            _feeCollector != address(0),
            "StableArswStaking: fee collector cannot be address(0)"
        );
        require(
            _depositFeePercent <= 5e17,
            "StableArswStaking: max deposit fee cannot be greater than 50%"
        );

        arsw = _arsw;
        depositFeePercent = _depositFeePercent;
        feeCollector = _feeCollector;

        isRewardToken[_rewardToken] = true;
        rewardTokens.push(_rewardToken);
    }

    function setFeeCollector(address _feeCollector) external onlyOwner {
        feeCollector = _feeCollector;
    }

    /**
     * @notice Deposit ARSW for reward token allocation
     * @param _amount The amount of ARSW to deposit
     */
    function deposit(uint256 _amount) external nonReentrant {
        UserInfo storage user = userInfo[_msgSender()];

        uint256 _fee = _amount.mul(depositFeePercent).div(
            DEPOSIT_FEE_PERCENT_PRECISION
        );
        uint256 _amountMinusFee = _amount.sub(_fee);

        uint256 _previousAmount = user.amount;
        uint256 _newAmount = user.amount.add(_amountMinusFee);
        user.amount = _newAmount;

        uint256 _len = rewardTokens.length;
        for (uint256 i; i < _len; i++) {
            IERC20 _token = rewardTokens[i];
            updateReward(_token);

            uint256 _previousRewardDebt = user.rewardDebt[_token];
            user.rewardDebt[_token] = _newAmount
                .mul(accRewardPerShare[_token])
                .div(ACC_REWARD_PER_SHARE_PRECISION);

            if (_previousAmount != 0) {
                uint256 _pending = _previousAmount
                    .mul(accRewardPerShare[_token])
                    .div(ACC_REWARD_PER_SHARE_PRECISION)
                    .sub(_previousRewardDebt);
                if (_pending != 0) {
                    safeTokenTransfer(_token, _msgSender(), _pending);
                    emit ClaimReward(_msgSender(), address(_token), _pending);
                }
            }
        }

        internalArswBalance = internalArswBalance.add(_amountMinusFee);
        arsw.safeTransferFrom(_msgSender(), feeCollector, _fee);
        arsw.safeTransferFrom(_msgSender(), address(this), _amountMinusFee);
        emit Deposit(_msgSender(), _amountMinusFee, _fee);
    }

    /**
     * @notice Get user info
     * @param _user The address of the user
     * @param _rewardToken The address of the reward token
     * @return The amount of ARSW user has deposited
     * @return The reward debt for the chosen token
     */
    function getUserInfo(address _user, IERC20 _rewardToken)
        external
        view
        returns (uint256, uint256)
    {
        UserInfo storage user = userInfo[_user];
        return (user.amount, user.rewardDebt[_rewardToken]);
    }

    /**
     * @notice Get the number of reward tokens
     * @return The length of the array
     */
    function rewardTokensLength() external view returns (uint256) {
        return rewardTokens.length;
    }

    /**
     * @notice Add a reward token
     * @param _rewardToken The address of the reward token
     */
    function addRewardToken(IERC20 _rewardToken) external onlyOwner {
        require(
            !isRewardToken[_rewardToken] && address(_rewardToken) != address(0),
            "StableArswStaking: token cannot be added"
        );
        require(
            rewardTokens.length < 25,
            "StableArswStaking: list of token too big"
        );
        rewardTokens.push(_rewardToken);
        isRewardToken[_rewardToken] = true;
        updateReward(_rewardToken);
        emit RewardTokenAdded(address(_rewardToken));
    }

    /**
     * @notice Remove a reward token
     * @param _rewardToken The address of the reward token
     */
    function removeRewardToken(IERC20 _rewardToken) external onlyOwner {
        require(
            isRewardToken[_rewardToken],
            "StableArswStaking: token cannot be removed"
        );
        updateReward(_rewardToken);
        isRewardToken[_rewardToken] = false;
        uint256 _len = rewardTokens.length;
        for (uint256 i; i < _len; i++) {
            if (rewardTokens[i] == _rewardToken) {
                rewardTokens[i] = rewardTokens[_len - 1];
                rewardTokens.pop();
                break;
            }
        }
        emit RewardTokenRemoved(address(_rewardToken));
    }

    /**
     * @notice Set the deposit fee percent
     * @param _depositFeePercent The new deposit fee percent
     */
    function setDepositFeePercent(uint256 _depositFeePercent)
        external
        onlyOwner
    {
        require(
            _depositFeePercent <= 5e17,
            "StableArswStaking: deposit fee cannot be greater than 50%"
        );
        uint256 oldFee = depositFeePercent;
        depositFeePercent = _depositFeePercent;
        emit DepositFeeChanged(_depositFeePercent, oldFee);
    }

    /**
     * @notice View function to see pending reward token on frontend
     * @param _user The address of the user
     * @param _token The address of the token
     * @return `_user`'s pending reward token
     */
    function pendingReward(address _user, IERC20 _token)
        external
        view
        returns (uint256)
    {
        require(isRewardToken[_token], "StableArswStaking: wrong reward token");
        UserInfo storage user = userInfo[_user];
        uint256 _totalArsw = internalArswBalance;
        uint256 _accRewardTokenPerShare = accRewardPerShare[_token];

        uint256 _currRewardBalance = _token.balanceOf(address(this));
        uint256 _rewardBalance = _token == arsw
            ? _currRewardBalance.sub(_totalArsw)
            : _currRewardBalance;

        if (_rewardBalance != lastRewardBalance[_token] && _totalArsw != 0) {
            uint256 _accruedReward = _rewardBalance.sub(
                lastRewardBalance[_token]
            );
            _accRewardTokenPerShare = _accRewardTokenPerShare.add(
                _accruedReward.mul(ACC_REWARD_PER_SHARE_PRECISION).div(
                    _totalArsw
                )
            );
        }
        return
            user
                .amount
                .mul(_accRewardTokenPerShare)
                .div(ACC_REWARD_PER_SHARE_PRECISION)
                .sub(user.rewardDebt[_token]);
    }

    /**
     * @notice Withdraw ARSW and harvest the rewards
     * @param _amount The amount of ARSW to withdraw
     */
    function withdraw(uint256 _amount) external nonReentrant {
        UserInfo storage user = userInfo[_msgSender()];
        uint256 _previousAmount = user.amount;
        require(
            _amount <= _previousAmount,
            "StableArswStaking: withdraw amount exceeds balance"
        );
        uint256 _newAmount = user.amount.sub(_amount);
        user.amount = _newAmount;

        uint256 _len = rewardTokens.length;
        if (_previousAmount != 0) {
            for (uint256 i; i < _len; i++) {
                IERC20 _token = rewardTokens[i];
                updateReward(_token);

                uint256 _pending = _previousAmount
                    .mul(accRewardPerShare[_token])
                    .div(ACC_REWARD_PER_SHARE_PRECISION)
                    .sub(user.rewardDebt[_token]);
                user.rewardDebt[_token] = _newAmount
                    .mul(accRewardPerShare[_token])
                    .div(ACC_REWARD_PER_SHARE_PRECISION);

                if (_pending != 0) {
                    safeTokenTransfer(_token, _msgSender(), _pending);
                    emit ClaimReward(_msgSender(), address(_token), _pending);
                }
            }
        }

        internalArswBalance = internalArswBalance.sub(_amount);
        arsw.safeTransfer(_msgSender(), _amount);
        emit Withdraw(_msgSender(), _amount);
    }

    /**
     * @notice Withdraw without caring about rewards. EMERGENCY ONLY
     */
    function emergencyWithdraw() external {
        UserInfo storage user = userInfo[_msgSender()];

        uint256 _amount = user.amount;
        user.amount = 0;
        uint256 _len = rewardTokens.length;
        for (uint256 i; i < _len; i++) {
            IERC20 _token = rewardTokens[i];
            user.rewardDebt[_token] = 0;
        }
        internalArswBalance = internalArswBalance.sub(_amount);
        arsw.safeTransfer(_msgSender(), _amount);
        emit EmergencyWithdraw(_msgSender(), _amount);
    }

    /**
     * @notice Update reward variables
     * @param _token The address of the reward token
     * @dev Needs to be called before any deposit or withdrawal
     */
    function updateReward(IERC20 _token) public {
        require(isRewardToken[_token], "StableArswStaking: wrong reward token");

        uint256 _totalArsw = internalArswBalance;

        uint256 _currRewardBalance = _token.balanceOf(address(this));
        uint256 _rewardBalance = _token == arsw
            ? _currRewardBalance.sub(_totalArsw)
            : _currRewardBalance;

        // Did StableArswStaking receive any token
        if (_rewardBalance == lastRewardBalance[_token] || _totalArsw == 0) {
            return;
        }

        uint256 _accruedReward = _rewardBalance.sub(lastRewardBalance[_token]);

        accRewardPerShare[_token] = accRewardPerShare[_token].add(
            _accruedReward.mul(ACC_REWARD_PER_SHARE_PRECISION).div(_totalArsw)
        );
        lastRewardBalance[_token] = _rewardBalance;
    }

    /**
     * @notice Safe token transfer function, just in case if rounding error
     * causes pool to not have enough reward tokens
     * @param _token The address of then token to transfer
     * @param _to The address that will receive `_amount` `rewardToken`
     * @param _amount The amount to send to `_to`
     */
    function safeTokenTransfer(
        IERC20 _token,
        address _to,
        uint256 _amount
    ) internal {
        uint256 _currRewardBalance = _token.balanceOf(address(this));
        uint256 _rewardBalance = _token == arsw
            ? _currRewardBalance.sub(internalArswBalance)
            : _currRewardBalance;

        if (_amount > _rewardBalance) {
            lastRewardBalance[_token] = lastRewardBalance[_token].sub(
                _rewardBalance
            );
            _token.safeTransfer(_to, _rewardBalance);
        } else {
            lastRewardBalance[_token] = lastRewardBalance[_token].sub(_amount);
            _token.safeTransfer(_to, _amount);
        }
    }
}
        

@openzeppelin/contracts/access/Ownable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

@openzeppelin/contracts/security/ReentrancyGuard.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

@openzeppelin/contracts/utils/Address.sol

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

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}
          

@openzeppelin/contracts/utils/Context.sol

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

pragma solidity ^0.8.0;

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

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

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

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

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

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}
          

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_rewardToken","internalType":"contract IERC20"},{"type":"address","name":"_arsw","internalType":"contract IERC20"},{"type":"address","name":"_feeCollector","internalType":"address"},{"type":"uint256","name":"_depositFeePercent","internalType":"uint256"}]},{"type":"event","name":"ClaimReward","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"address","name":"rewardToken","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Deposit","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"fee","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"DepositFeeChanged","inputs":[{"type":"uint256","name":"newFee","internalType":"uint256","indexed":false},{"type":"uint256","name":"oldFee","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"EmergencyWithdraw","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RewardTokenAdded","inputs":[{"type":"address","name":"token","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"RewardTokenRemoved","inputs":[{"type":"address","name":"token","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Withdraw","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ACC_REWARD_PER_SHARE_PRECISION","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"DEPOSIT_FEE_PERCENT_PRECISION","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"accRewardPerShare","inputs":[{"type":"address","name":"","internalType":"contract IERC20"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addRewardToken","inputs":[{"type":"address","name":"_rewardToken","internalType":"contract IERC20"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"arsw","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deposit","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"depositFeePercent","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"emergencyWithdraw","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"feeCollector","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}],"name":"getUserInfo","inputs":[{"type":"address","name":"_user","internalType":"address"},{"type":"address","name":"_rewardToken","internalType":"contract IERC20"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"internalArswBalance","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isRewardToken","inputs":[{"type":"address","name":"","internalType":"contract IERC20"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastRewardBalance","inputs":[{"type":"address","name":"","internalType":"contract IERC20"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pendingReward","inputs":[{"type":"address","name":"_user","internalType":"address"},{"type":"address","name":"_token","internalType":"contract IERC20"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeRewardToken","inputs":[{"type":"address","name":"_rewardToken","internalType":"contract IERC20"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"rewardTokens","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardTokensLength","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDepositFeePercent","inputs":[{"type":"uint256","name":"_depositFeePercent","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFeeCollector","inputs":[{"type":"address","name":"_feeCollector","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateReward","inputs":[{"type":"address","name":"_token","internalType":"contract IERC20"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]}]
              

Contract Creation Code

0x60a06040523480156200001157600080fd5b506040516200291f3803806200291f83398101604081905262000034916200031a565b6200003f33620002b1565b600180556001600160a01b038416620000c55760405162461bcd60e51b815260206004820152603460248201527f537461626c65417273775374616b696e673a2072657761726420746f6b656e2060448201527f63616e6e6f74206265206164647265737328302900000000000000000000000060648201526084015b60405180910390fd5b6001600160a01b038316620001325760405162461bcd60e51b815260206004820152602c60248201527f537461626c65417273775374616b696e673a20617273772063616e6e6f74206260448201526b65206164647265737328302960a01b6064820152608401620000bc565b6001600160a01b038216620001b05760405162461bcd60e51b815260206004820152603560248201527f537461626c65417273775374616b696e673a2066656520636f6c6c6563746f7260448201527f2063616e6e6f74206265206164647265737328302900000000000000000000006064820152608401620000bc565b6706f05b59d3b20000811115620002305760405162461bcd60e51b815260206004820152603d60248201527f537461626c65417273775374616b696e673a206d6178206465706f736974206660448201527f65652063616e6e6f742062652067726561746572207468616e203530250000006064820152608401620000bc565b6001600160a01b03928316608052600755600680549183166001600160a01b031992831617905591166000818152600460205260408120805460ff191660019081179091556003805491820181559091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01805490921617905562000374565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146200031757600080fd5b50565b600080600080608085870312156200033157600080fd5b84516200033e8162000301565b6020860151909450620003518162000301565b6040860151909350620003648162000301565b6060959095015193969295505050565b60805161255e620003c1600039600081816102f301528181610b370152818161105f015281816113f80152818161188a015281816118b9015281816119d20152611c49015261255e6000f3fe608060405234801561001057600080fd5b50600436106101975760003560e01c80639ced7e76116100e3578063bf199e621161008c578063db2e21bc11610066578063db2e21bc1461039b578063f2801fe7146103a3578063f2fde38b1461040657600080fd5b8063bf199e621461036a578063c415b95c14610372578063cc1252ae1461039257600080fd5b8063a610708a116100bd578063a610708a14610315578063b5fd73f814610324578063b6b55f251461035757600080fd5b80639ced7e76146102c8578063a42dce80146102db578063a57fb803146102ee57600080fd5b80635dcea4d411610145578063715018a61161011f578063715018a61461026a5780637bb7bed1146102725780638da5cb5b146102aa57600080fd5b80635dcea4d4146102175780635fc0d9e014610237578063632447c91461025757600080fd5b80632e1a7d4d116101765780632e1a7d4d146101e05780633c97d5ae146101f35780633d509c971461020457600080fd5b8062b4aa171461019c5780631c03e6cc146101b85780632052eb77146101cd575b600080fd5b6101a560025481565b6040519081526020015b60405180910390f35b6101cb6101c6366004612278565b610419565b005b6101cb6101db366004612295565b610703565b6101cb6101ee366004612295565b610862565b6101a569d3c21bcecceda100000081565b6101cb610212366004612278565b610bb3565b6101a5610225366004612278565b60086020526000908152604090205481565b6101a5610245366004612278565b60056020526000908152604090205481565b6101cb610265366004612278565b610f01565b6101cb6111b4565b610285610280366004612295565b611241565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101af565b60005473ffffffffffffffffffffffffffffffffffffffff16610285565b6101a56102d63660046122ae565b611278565b6101cb6102e9366004612278565b611543565b6102857f000000000000000000000000000000000000000000000000000000000000000081565b6101a5670de0b6b3a764000081565b610347610332366004612278565b60046020526000908152604090205460ff1681565b60405190151581526020016101af565b6101cb610365366004612295565b61160b565b6003546101a5565b6006546102859073ffffffffffffffffffffffffffffffffffffffff1681565b6101a560075481565b6101cb61193e565b6103f16103b13660046122ae565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600960209081526040808320805494861684526001019091529020549250929050565b604080519283526020830191909152016101af565b6101cb610414366004612278565b611a48565b60005473ffffffffffffffffffffffffffffffffffffffff16331461049f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081526004602052604090205460ff161580156104ea575073ffffffffffffffffffffffffffffffffffffffff811615155b610576576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f537461626c65417273775374616b696e673a20746f6b656e2063616e6e6f742060448201527f62652061646465640000000000000000000000000000000000000000000000006064820152608401610496565b600354601911610608576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f537461626c65417273775374616b696e673a206c697374206f6620746f6b656e60448201527f20746f6f206269670000000000000000000000000000000000000000000000006064820152608401610496565b6003805460018082019092557fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8416908117909155600090815260046020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690911790556106b781610f01565b60405173ffffffffffffffffffffffffffffffffffffffff821681527ff3e4c2c64e71e6ba2eaab9a599bced62f9eb91d2cda610bf41aa8c80ff2cf8269060200160405180910390a150565b60005473ffffffffffffffffffffffffffffffffffffffff163314610784576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610496565b6706f05b59d3b2000081111561081c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f537461626c65417273775374616b696e673a206465706f73697420666565206360448201527f616e6e6f742062652067726561746572207468616e20353025000000000000006064820152608401610496565b600780549082905560408051838152602081018390527f6be5411ea11f30380402ca68832d060d744cbc5f62d2344495c10256ba93904a91015b60405180910390a15050565b600260015414156108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610496565b6002600155336000908152600960205260409020805480831115610975576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f537461626c65417273775374616b696e673a20776974686472617720616d6f7560448201527f6e7420657863656564732062616c616e636500000000000000000000000000006064820152608401610496565b81546000906109849085611b78565b8084556003549091508215610b225760005b81811015610b20576000600382815481106109b3576109b36122e7565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1690506109e081610f01565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001870160209081526040808320546008909252822054610a3f9190610a399069d3c21bcecceda100000090610a33908b90611b8b565b90611b97565b90611b78565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260086020526040902054909150610a839069d3c21bcecceda100000090610a33908890611b8b565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001890160205260409020558015610b0b57610abd82335b83611ba3565b60405181815273ffffffffffffffffffffffffffffffffffffffff83169033907f7e77f685b38c861064cb08f2776eb5dfd3c82f652ed9f21221b8c53b75628e519060200160405180910390a35b50508080610b1890612345565b915050610996565b505b600254610b2f9086611b78565b600255610b737f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163387611d8c565b60405185815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a2505060018055505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610c34576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610496565b73ffffffffffffffffffffffffffffffffffffffff811660009081526004602052604090205460ff16610ce9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f537461626c65417273775374616b696e673a20746f6b656e2063616e6e6f742060448201527f62652072656d6f766564000000000000000000000000000000000000000000006064820152608401610496565b610cf281610f01565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260046020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055600354905b81811015610eba578273ffffffffffffffffffffffffffffffffffffffff1660038281548110610d7457610d746122e7565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff161415610ea8576003610da960018461237e565b81548110610db957610db96122e7565b6000918252602090912001546003805473ffffffffffffffffffffffffffffffffffffffff9092169183908110610df257610df26122e7565b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003805480610e4b57610e4b612395565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055019055610eba565b80610eb281612345565b915050610d42565b5060405173ffffffffffffffffffffffffffffffffffffffff831681527f66257bcef574219c04f7c05f7a1c78d599da10491294c92a5805c48b4cdf500990602001610856565b73ffffffffffffffffffffffffffffffffffffffff811660009081526004602052604090205460ff16610fb6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f537461626c65417273775374616b696e673a2077726f6e67207265776172642060448201527f746f6b656e0000000000000000000000000000000000000000000000000000006064820152608401610496565b6002546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8416906370a082319060240160206040518083038186803b15801561102157600080fd5b505afa158015611035573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105991906123c4565b905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146110b657816110c0565b6110c08284611b78565b73ffffffffffffffffffffffffffffffffffffffff85166000908152600560205260409020549091508114806110f4575082155b156110ff5750505050565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260056020526040812054611130908390611b78565b905061117961114d85610a338469d3c21bcecceda1000000611b8b565b73ffffffffffffffffffffffffffffffffffffffff871660009081526008602052604090205490611e65565b73ffffffffffffffffffffffffffffffffffffffff909516600090815260086020908152604080832097909755600590529490942055505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611235576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610496565b61123f6000611e71565b565b6003818154811061125157600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b73ffffffffffffffffffffffffffffffffffffffff811660009081526004602052604081205460ff1661132d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f537461626c65417273775374616b696e673a2077726f6e67207265776172642060448201527f746f6b656e0000000000000000000000000000000000000000000000000000006064820152608401610496565b73ffffffffffffffffffffffffffffffffffffffff838116600090815260096020908152604080832060025494871680855260089093528184205491517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529094939192906370a082319060240160206040518083038186803b1580156113ba57600080fd5b505afa1580156113ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f291906123c4565b905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff161461144f5781611459565b6114598285611b78565b73ffffffffffffffffffffffffffffffffffffffff8816600090815260056020526040902054909150811480159061149057508315155b156114ee5773ffffffffffffffffffffffffffffffffffffffff87166000908152600560205260408120546114c6908390611b78565b90506114ea6114e386610a338469d3c21bcecceda1000000611b8b565b8590611e65565b9350505b73ffffffffffffffffffffffffffffffffffffffff8716600090815260018601602052604090205485546115379190610a399069d3c21bcecceda100000090610a339088611b8b565b98975050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146115c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610496565b600680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60026001541415611678576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610496565b60026001553360009081526009602052604081206007549091906116ab90670de0b6b3a764000090610a33908690611b8b565b905060006116b98483611b78565b835490915060006116ca8284611e65565b80865560035490915060005b8181101561185b576000600382815481106116f3576116f36122e7565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905061172081610f01565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260018901602090815260408083205460089092529091205461176f9069d3c21bcecceda100000090610a33908890611b8b565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260018b01602052604090205585156118465773ffffffffffffffffffffffffffffffffffffffff82166000908152600860205260408120546117e4908390610a399069d3c21bcecceda100000090610a33908c90611b8b565b90508015611844576117f68333610ab7565b60405181815273ffffffffffffffffffffffffffffffffffffffff84169033907f7e77f685b38c861064cb08f2776eb5dfd3c82f652ed9f21221b8c53b75628e519060200160405180910390a35b505b5050808061185390612345565b9150506116d6565b506002546118699085611e65565b6002556118b43360065473ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811692911688611ee6565b6118f67f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16333087611ee6565b604080518581526020810187905233917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a15910160405180910390a25050600180555050505050565b336000908152600960205260408120805482825560035491929091905b818110156119bc57600060038281548110611978576119786122e7565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168252600187019052604081205550806119b481612345565b91505061195b565b506002546119ca9083611b78565b600255611a0e7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163384611d8c565b60405182815233907f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd96959060200160405180910390a2505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611ac9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610496565b73ffffffffffffffffffffffffffffffffffffffff8116611b6c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610496565b611b7581611e71565b50565b6000611b84828461237e565b9392505050565b6000611b8482846123dd565b6000611b84828461241a565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8516906370a082319060240160206040518083038186803b158015611c0b57600080fd5b505afa158015611c1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c4391906123c4565b905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614611ca05781611cae565b600254611cae908390611b78565b905080831115611d215773ffffffffffffffffffffffffffffffffffffffff8516600090815260056020526040902054611ce89082611b78565b73ffffffffffffffffffffffffffffffffffffffff8616600081815260056020526040902091909155611d1c908583611d8c565b611d85565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260056020526040902054611d519084611b78565b73ffffffffffffffffffffffffffffffffffffffff8616600081815260056020526040902091909155611d85908585611d8c565b5050505050565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052611e609084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611f4a565b505050565b6000611b848284612455565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052611f449085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611dde565b50505050565b6000611fac826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120569092919063ffffffff16565b805190915015611e605780806020019051810190611fca919061246d565b611e60576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610496565b6060612065848460008561206d565b949350505050565b6060824710156120ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610496565b73ffffffffffffffffffffffffffffffffffffffff85163b61217d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610496565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516121a691906124bb565b60006040518083038185875af1925050503d80600081146121e3576040519150601f19603f3d011682016040523d82523d6000602084013e6121e8565b606091505b50915091506121f8828286612203565b979650505050505050565b60608315612212575081611b84565b8251156122225782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161049691906124d7565b73ffffffffffffffffffffffffffffffffffffffff81168114611b7557600080fd5b60006020828403121561228a57600080fd5b8135611b8481612256565b6000602082840312156122a757600080fd5b5035919050565b600080604083850312156122c157600080fd5b82356122cc81612256565b915060208301356122dc81612256565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561237757612377612316565b5060010190565b60008282101561239057612390612316565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6000602082840312156123d657600080fd5b5051919050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561241557612415612316565b500290565b600082612450577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000821982111561246857612468612316565b500190565b60006020828403121561247f57600080fd5b81518015158114611b8457600080fd5b60005b838110156124aa578181015183820152602001612492565b83811115611f445750506000910152565b600082516124cd81846020870161248f565b9190910192915050565b60208152600082518060208401526124f681604085016020870161248f565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea2646970667358221220b709fa4599ed3b3af62b1a5be6ce18b729ccee95d1a37ef925672d3ed14f304a64736f6c63430008090033000000000000000000000000de2578edec4669ba7f41c5d5d2386300bcea4678000000000000000000000000de2578edec4669ba7f41c5d5d2386300bcea4678000000000000000000000000aaeeba12c2d241be5688725bf346770070f0a62f000000000000000000000000000000000000000000000000002386f26fc10000

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106101975760003560e01c80639ced7e76116100e3578063bf199e621161008c578063db2e21bc11610066578063db2e21bc1461039b578063f2801fe7146103a3578063f2fde38b1461040657600080fd5b8063bf199e621461036a578063c415b95c14610372578063cc1252ae1461039257600080fd5b8063a610708a116100bd578063a610708a14610315578063b5fd73f814610324578063b6b55f251461035757600080fd5b80639ced7e76146102c8578063a42dce80146102db578063a57fb803146102ee57600080fd5b80635dcea4d411610145578063715018a61161011f578063715018a61461026a5780637bb7bed1146102725780638da5cb5b146102aa57600080fd5b80635dcea4d4146102175780635fc0d9e014610237578063632447c91461025757600080fd5b80632e1a7d4d116101765780632e1a7d4d146101e05780633c97d5ae146101f35780633d509c971461020457600080fd5b8062b4aa171461019c5780631c03e6cc146101b85780632052eb77146101cd575b600080fd5b6101a560025481565b6040519081526020015b60405180910390f35b6101cb6101c6366004612278565b610419565b005b6101cb6101db366004612295565b610703565b6101cb6101ee366004612295565b610862565b6101a569d3c21bcecceda100000081565b6101cb610212366004612278565b610bb3565b6101a5610225366004612278565b60086020526000908152604090205481565b6101a5610245366004612278565b60056020526000908152604090205481565b6101cb610265366004612278565b610f01565b6101cb6111b4565b610285610280366004612295565b611241565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101af565b60005473ffffffffffffffffffffffffffffffffffffffff16610285565b6101a56102d63660046122ae565b611278565b6101cb6102e9366004612278565b611543565b6102857f000000000000000000000000de2578edec4669ba7f41c5d5d2386300bcea467881565b6101a5670de0b6b3a764000081565b610347610332366004612278565b60046020526000908152604090205460ff1681565b60405190151581526020016101af565b6101cb610365366004612295565b61160b565b6003546101a5565b6006546102859073ffffffffffffffffffffffffffffffffffffffff1681565b6101a560075481565b6101cb61193e565b6103f16103b13660046122ae565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600960209081526040808320805494861684526001019091529020549250929050565b604080519283526020830191909152016101af565b6101cb610414366004612278565b611a48565b60005473ffffffffffffffffffffffffffffffffffffffff16331461049f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081526004602052604090205460ff161580156104ea575073ffffffffffffffffffffffffffffffffffffffff811615155b610576576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f537461626c65417273775374616b696e673a20746f6b656e2063616e6e6f742060448201527f62652061646465640000000000000000000000000000000000000000000000006064820152608401610496565b600354601911610608576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f537461626c65417273775374616b696e673a206c697374206f6620746f6b656e60448201527f20746f6f206269670000000000000000000000000000000000000000000000006064820152608401610496565b6003805460018082019092557fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8416908117909155600090815260046020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690911790556106b781610f01565b60405173ffffffffffffffffffffffffffffffffffffffff821681527ff3e4c2c64e71e6ba2eaab9a599bced62f9eb91d2cda610bf41aa8c80ff2cf8269060200160405180910390a150565b60005473ffffffffffffffffffffffffffffffffffffffff163314610784576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610496565b6706f05b59d3b2000081111561081c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f537461626c65417273775374616b696e673a206465706f73697420666565206360448201527f616e6e6f742062652067726561746572207468616e20353025000000000000006064820152608401610496565b600780549082905560408051838152602081018390527f6be5411ea11f30380402ca68832d060d744cbc5f62d2344495c10256ba93904a91015b60405180910390a15050565b600260015414156108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610496565b6002600155336000908152600960205260409020805480831115610975576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f537461626c65417273775374616b696e673a20776974686472617720616d6f7560448201527f6e7420657863656564732062616c616e636500000000000000000000000000006064820152608401610496565b81546000906109849085611b78565b8084556003549091508215610b225760005b81811015610b20576000600382815481106109b3576109b36122e7565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1690506109e081610f01565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001870160209081526040808320546008909252822054610a3f9190610a399069d3c21bcecceda100000090610a33908b90611b8b565b90611b97565b90611b78565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260086020526040902054909150610a839069d3c21bcecceda100000090610a33908890611b8b565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001890160205260409020558015610b0b57610abd82335b83611ba3565b60405181815273ffffffffffffffffffffffffffffffffffffffff83169033907f7e77f685b38c861064cb08f2776eb5dfd3c82f652ed9f21221b8c53b75628e519060200160405180910390a35b50508080610b1890612345565b915050610996565b505b600254610b2f9086611b78565b600255610b737f000000000000000000000000de2578edec4669ba7f41c5d5d2386300bcea467873ffffffffffffffffffffffffffffffffffffffff163387611d8c565b60405185815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a2505060018055505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610c34576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610496565b73ffffffffffffffffffffffffffffffffffffffff811660009081526004602052604090205460ff16610ce9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f537461626c65417273775374616b696e673a20746f6b656e2063616e6e6f742060448201527f62652072656d6f766564000000000000000000000000000000000000000000006064820152608401610496565b610cf281610f01565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260046020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055600354905b81811015610eba578273ffffffffffffffffffffffffffffffffffffffff1660038281548110610d7457610d746122e7565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff161415610ea8576003610da960018461237e565b81548110610db957610db96122e7565b6000918252602090912001546003805473ffffffffffffffffffffffffffffffffffffffff9092169183908110610df257610df26122e7565b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003805480610e4b57610e4b612395565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055019055610eba565b80610eb281612345565b915050610d42565b5060405173ffffffffffffffffffffffffffffffffffffffff831681527f66257bcef574219c04f7c05f7a1c78d599da10491294c92a5805c48b4cdf500990602001610856565b73ffffffffffffffffffffffffffffffffffffffff811660009081526004602052604090205460ff16610fb6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f537461626c65417273775374616b696e673a2077726f6e67207265776172642060448201527f746f6b656e0000000000000000000000000000000000000000000000000000006064820152608401610496565b6002546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8416906370a082319060240160206040518083038186803b15801561102157600080fd5b505afa158015611035573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105991906123c4565b905060007f000000000000000000000000de2578edec4669ba7f41c5d5d2386300bcea467873ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146110b657816110c0565b6110c08284611b78565b73ffffffffffffffffffffffffffffffffffffffff85166000908152600560205260409020549091508114806110f4575082155b156110ff5750505050565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260056020526040812054611130908390611b78565b905061117961114d85610a338469d3c21bcecceda1000000611b8b565b73ffffffffffffffffffffffffffffffffffffffff871660009081526008602052604090205490611e65565b73ffffffffffffffffffffffffffffffffffffffff909516600090815260086020908152604080832097909755600590529490942055505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611235576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610496565b61123f6000611e71565b565b6003818154811061125157600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b73ffffffffffffffffffffffffffffffffffffffff811660009081526004602052604081205460ff1661132d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f537461626c65417273775374616b696e673a2077726f6e67207265776172642060448201527f746f6b656e0000000000000000000000000000000000000000000000000000006064820152608401610496565b73ffffffffffffffffffffffffffffffffffffffff838116600090815260096020908152604080832060025494871680855260089093528184205491517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529094939192906370a082319060240160206040518083038186803b1580156113ba57600080fd5b505afa1580156113ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f291906123c4565b905060007f000000000000000000000000de2578edec4669ba7f41c5d5d2386300bcea467873ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff161461144f5781611459565b6114598285611b78565b73ffffffffffffffffffffffffffffffffffffffff8816600090815260056020526040902054909150811480159061149057508315155b156114ee5773ffffffffffffffffffffffffffffffffffffffff87166000908152600560205260408120546114c6908390611b78565b90506114ea6114e386610a338469d3c21bcecceda1000000611b8b565b8590611e65565b9350505b73ffffffffffffffffffffffffffffffffffffffff8716600090815260018601602052604090205485546115379190610a399069d3c21bcecceda100000090610a339088611b8b565b98975050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146115c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610496565b600680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60026001541415611678576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610496565b60026001553360009081526009602052604081206007549091906116ab90670de0b6b3a764000090610a33908690611b8b565b905060006116b98483611b78565b835490915060006116ca8284611e65565b80865560035490915060005b8181101561185b576000600382815481106116f3576116f36122e7565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905061172081610f01565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260018901602090815260408083205460089092529091205461176f9069d3c21bcecceda100000090610a33908890611b8b565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260018b01602052604090205585156118465773ffffffffffffffffffffffffffffffffffffffff82166000908152600860205260408120546117e4908390610a399069d3c21bcecceda100000090610a33908c90611b8b565b90508015611844576117f68333610ab7565b60405181815273ffffffffffffffffffffffffffffffffffffffff84169033907f7e77f685b38c861064cb08f2776eb5dfd3c82f652ed9f21221b8c53b75628e519060200160405180910390a35b505b5050808061185390612345565b9150506116d6565b506002546118699085611e65565b6002556118b43360065473ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000de2578edec4669ba7f41c5d5d2386300bcea4678811692911688611ee6565b6118f67f000000000000000000000000de2578edec4669ba7f41c5d5d2386300bcea467873ffffffffffffffffffffffffffffffffffffffff16333087611ee6565b604080518581526020810187905233917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a15910160405180910390a25050600180555050505050565b336000908152600960205260408120805482825560035491929091905b818110156119bc57600060038281548110611978576119786122e7565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168252600187019052604081205550806119b481612345565b91505061195b565b506002546119ca9083611b78565b600255611a0e7f000000000000000000000000de2578edec4669ba7f41c5d5d2386300bcea467873ffffffffffffffffffffffffffffffffffffffff163384611d8c565b60405182815233907f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd96959060200160405180910390a2505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611ac9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610496565b73ffffffffffffffffffffffffffffffffffffffff8116611b6c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610496565b611b7581611e71565b50565b6000611b84828461237e565b9392505050565b6000611b8482846123dd565b6000611b84828461241a565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8516906370a082319060240160206040518083038186803b158015611c0b57600080fd5b505afa158015611c1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c4391906123c4565b905060007f000000000000000000000000de2578edec4669ba7f41c5d5d2386300bcea467873ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614611ca05781611cae565b600254611cae908390611b78565b905080831115611d215773ffffffffffffffffffffffffffffffffffffffff8516600090815260056020526040902054611ce89082611b78565b73ffffffffffffffffffffffffffffffffffffffff8616600081815260056020526040902091909155611d1c908583611d8c565b611d85565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260056020526040902054611d519084611b78565b73ffffffffffffffffffffffffffffffffffffffff8616600081815260056020526040902091909155611d85908585611d8c565b5050505050565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052611e609084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611f4a565b505050565b6000611b848284612455565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052611f449085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611dde565b50505050565b6000611fac826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120569092919063ffffffff16565b805190915015611e605780806020019051810190611fca919061246d565b611e60576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610496565b6060612065848460008561206d565b949350505050565b6060824710156120ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610496565b73ffffffffffffffffffffffffffffffffffffffff85163b61217d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610496565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516121a691906124bb565b60006040518083038185875af1925050503d80600081146121e3576040519150601f19603f3d011682016040523d82523d6000602084013e6121e8565b606091505b50915091506121f8828286612203565b979650505050505050565b60608315612212575081611b84565b8251156122225782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161049691906124d7565b73ffffffffffffffffffffffffffffffffffffffff81168114611b7557600080fd5b60006020828403121561228a57600080fd5b8135611b8481612256565b6000602082840312156122a757600080fd5b5035919050565b600080604083850312156122c157600080fd5b82356122cc81612256565b915060208301356122dc81612256565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561237757612377612316565b5060010190565b60008282101561239057612390612316565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6000602082840312156123d657600080fd5b5051919050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561241557612415612316565b500290565b600082612450577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000821982111561246857612468612316565b500190565b60006020828403121561247f57600080fd5b81518015158114611b8457600080fd5b60005b838110156124aa578181015183820152602001612492565b83811115611f445750506000910152565b600082516124cd81846020870161248f565b9190910192915050565b60208152600082518060208401526124f681604085016020870161248f565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea2646970667358221220b709fa4599ed3b3af62b1a5be6ce18b729ccee95d1a37ef925672d3ed14f304a64736f6c63430008090033