ETH Price: $3,326.30 (+1.60%)
 
Transaction Hash
Method
Block
From
To
Claim189109652024-01-01 6:59:35390 days ago1704092375IN
0x3084ba03...A430976da
0 ETH0.002820218.97312042
Claim168190852023-03-13 12:30:59684 days ago1678710659IN
0x3084ba03...A430976da
0 ETH0.0279636421.86726617
Claim164934812023-01-26 20:48:47730 days ago1674766127IN
0x3084ba03...A430976da
0 ETH0.0197977123.85911337
Claim164395072023-01-19 7:57:35737 days ago1674115055IN
0x3084ba03...A430976da
0 ETH0.0052988915.98643236
Claim161796212022-12-14 1:21:59773 days ago1670980919IN
0x3084ba03...A430976da
0 ETH0.0047875614.32068486
Withdraw Usdm159490112022-11-11 19:58:59806 days ago1668196739IN
0x3084ba03...A430976da
0 ETH0.012964120.74425889
Withdraw Usdm155491642022-09-16 22:32:35862 days ago1663367555IN
0x3084ba03...A430976da
0 ETH0.002389687.65651193
Claim155491252022-09-16 22:24:47862 days ago1663367087IN
0x3084ba03...A430976da
0 ETH0.007312127.46692626
Withdraw Usdm151722332022-07-19 9:24:42921 days ago1658222682IN
0x3084ba03...A430976da
0 ETH0.0049749514.85624534
Claim151711592022-07-19 5:24:13921 days ago1658208253IN
0x3084ba03...A430976da
0 ETH0.0097525811.0582967
Withdraw Usdm151705202022-07-19 2:59:15921 days ago1658199555IN
0x3084ba03...A430976da
0 ETH0.0082360424.59452877
Withdraw Usdm151674072022-07-18 15:13:38922 days ago1658157218IN
0x3084ba03...A430976da
0 ETH0.0209992762.70817945
Withdraw Usdm151608982022-07-17 15:15:33923 days ago1658070933IN
0x3084ba03...A430976da
0 ETH0.0054021417
Claim151536922022-07-16 12:16:11924 days ago1657973771IN
0x3084ba03...A430976da
0 ETH0.0123002414.26982328
Withdraw Usdm151536842022-07-16 12:13:54924 days ago1657973634IN
0x3084ba03...A430976da
0 ETH0.0052982112.62198589
Claim151346482022-07-13 13:56:00927 days ago1657720560IN
0x3084ba03...A430976da
0 ETH0.0184348622.21667245
Claim151334692022-07-13 9:23:27927 days ago1657704207IN
0x3084ba03...A430976da
0 ETH0.0034394610.37666319
Withdraw Usdm151136162022-07-10 7:44:10930 days ago1657439050IN
0x3084ba03...A430976da
0 ETH0.0038132712
Claim151125992022-07-10 3:55:06930 days ago1657425306IN
0x3084ba03...A430976da
0 ETH0.009517079.74692198
Withdraw3Crv151125972022-07-10 3:54:30930 days ago1657425270IN
0x3084ba03...A430976da
0 ETH0.002929959.39867501
Withdraw Usdm151125932022-07-10 3:54:01930 days ago1657425241IN
0x3084ba03...A430976da
0 ETH0.0088787610.69538703
Claim151101432022-07-09 18:57:43931 days ago1657393063IN
0x3084ba03...A430976da
0 ETH0.0046012113.88156827
Withdraw Usdm151098542022-07-09 17:50:51931 days ago1657389051IN
0x3084ba03...A430976da
0 ETH0.0045106113.46963768
Withdraw Usdm151030872022-07-08 16:45:57932 days ago1657298757IN
0x3084ba03...A430976da
0 ETH0.0087886728.15764223
Claim151030852022-07-08 16:45:25932 days ago1657298725IN
0x3084ba03...A430976da
0 ETH0.0093594327.82970147
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PegRecoveryModule

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU AGPLv3 license
File 1 of 11 : PegRecoveryModule.sol
// SPDX-License-Identifier: AGPL-3.0

pragma solidity ^0.8.13;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { ICurveMetaPool, ICurvePool } from "../external/CurveInterfaces.sol";
import { IVotiumMerkleStash } from "../external/VotiumInterfaces.sol";
import { VotiumShare } from "./VotiumShare.sol";

// usdm3crv 0x5B3b5DF2BF2B6543f78e053bD91C4Bdd820929f1
// 3crv 0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7
// zap tx https://etherscan.io/tx/0x4a1c6582675b2582849b3947c63f53e209f320225aa501d0347bb8bae278d365
//BASE_COINS: constant(address[3]) = [
//    0x6B175474E89094C44Da98b954EedeAC495271d0F,  # DAI
//    0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48,  # USDC
//    0xdAC17F958D2ee523a2206206994597C13D831ec7,  # USDT
//]

contract PegRecoveryModule is VotiumShare{
    using SafeERC20 for IERC20;

    struct BaseCoins {
        uint256 dai;
        uint256 usdc;
        uint256 usdt;
    }

    // token addresses
    IERC20 public immutable usdm; // 0x31d4Eb09a216e181eC8a43ce79226A487D6F0BA9

    IERC20 public immutable crv3; // 0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490

    IERC20 public immutable dai; // 0x6B175474E89094C44Da98b954EedeAC495271d0F

    IERC20 public immutable usdc; // 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48

    IERC20 public immutable usdt; // 0xdAC17F958D2ee523a2206206994597C13D831ec7

    // curve addresses
    ICurveMetaPool public immutable usdm3crv; // 0x5B3b5DF2BF2B6543f78e053bD91C4Bdd820929f1

    ICurvePool public immutable crv3pool; // 0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7

    // usdm deposit info

    uint256 public totalUsdm;

    uint256 public usdmProvided;

    mapping(address => uint256) public usdmShare;

    // 3crv deposit info
    uint256 public totalCrv3;

    uint256 public crv3Provided;

    mapping(address => uint256) public crv3Share;

    // reward info

    constructor(
        IERC20 _usdm,
        IERC20 _crv3,
        IERC20 _dai,
        IERC20 _usdc, 
        IERC20 _usdt,
        ICurveMetaPool _usdm3crv,
        ICurvePool _crv3pool
    ) VotiumShare(){
        usdm = _usdm;
        crv3 = _crv3;
        dai = _dai;
        usdc = _usdc;
        usdt = _usdt;
        usdm3crv = _usdm3crv;
        crv3pool = _crv3pool;
    }

    // 3crv section

    function deposit3Crv(
        uint256 _deposit
    ) external updateReward(msg.sender) {
        totalCrv3 += _deposit;
        crv3Share[msg.sender] += _deposit;
        crv3.transferFrom(msg.sender, address(this), _deposit);
    }

    function withdraw3Crv(
        uint256 _withdraw
    ) external updateReward(msg.sender) {
        totalCrv3 -= _withdraw;
        crv3Share[msg.sender] -= _withdraw;
        crv3.transfer(msg.sender, _withdraw);
    }

    function depositStable(
        uint256[3] calldata _deposit,
        uint256 _min3crv
    ) external updateReward(msg.sender){
        // convert deposit to 3crv
        if(_deposit[0] > 0) {
            dai.safeTransferFrom(msg.sender, address(this), _deposit[0]);
            dai.safeApprove(address(crv3pool), _deposit[0]);
        }
        if(_deposit[1] > 0) {
            usdc.safeTransferFrom(msg.sender, address(this), _deposit[1]);
            usdc.safeApprove(address(crv3pool), _deposit[1]);
        }
        if(_deposit[2] > 0) {
            usdt.safeTransferFrom(msg.sender, address(this), _deposit[2]);
            usdt.safeApprove(address(crv3pool), _deposit[2]);
        }

        // add liquidity to 3pool right away and hold as 3crv
        uint256 balance = crv3.balanceOf(address(this));
        crv3pool.add_liquidity(
            _deposit,
            _min3crv
        );
        // **vague name to use only 1 variable
        balance = crv3.balanceOf(address(this)) - balance;

        // update storage variables
        totalCrv3 += balance;
        crv3Share[msg.sender] += balance;
    }

    function withdrawStable(
        uint256[3] calldata _withdraw,
        uint256 _3crv_max
    ) external updateReward(msg.sender) {
        // update storage variables
        uint256 balance = crv3.balanceOf(address(this));
        crv3pool.remove_liquidity_imbalance(
            _withdraw,
            _3crv_max
        );
        balance = balance - crv3.balanceOf(address(this));
        totalCrv3 -= balance;
        crv3Share[msg.sender] -= balance;
        if(_withdraw[0] > 0){
            dai.safeTransfer(msg.sender, _withdraw[0]);
        }
        if(_withdraw[1] > 0){
            usdc.safeTransfer(msg.sender, _withdraw[1]);
        }
        if(_withdraw[2] > 0){
            usdt.safeTransfer(msg.sender, _withdraw[2]);
        }
    }

    // usdm section
    function depositUsdm(
        uint256 _usdm
    ) external updateReward(msg.sender) {
        usdmShare[msg.sender] += _usdm;
        totalUsdm += _usdm;
        usdm.transferFrom(msg.sender, address(this), _usdm);
    }

    function withdrawUsdm(
        uint256 _usdm
    ) external updateReward(msg.sender){
        usdmShare[msg.sender] -= _usdm;
        totalUsdm -= _usdm;
        usdm.transfer(msg.sender, _usdm);
    }

    // peg recovery section
    function pairLiquidity(uint256 _amount, uint256 _min_liquidity) external onlyOwner {
        uint256[2] memory amounts = [_amount, _amount];
        usdm.safeApprove(address(usdm3crv), _amount);
        crv3.safeApprove(address(usdm3crv), _amount);
        usdmProvided += _amount;
        crv3Provided += _amount;
        usdm3crv.add_liquidity(amounts, _min_liquidity);
    }

    function removeLiquidity(uint256 _amount, uint256 _max_burn) external onlyOwner {
        uint256[2] memory amounts = [_amount, _amount];
        usdmProvided -= _amount;
        crv3Provided -= _amount;
        usdm3crv.remove_liquidity_imbalance(amounts, _max_burn);
    }

    function sweepTokens() external onlyOwner {
        uint256 usdmLeftover = usdm.balanceOf(address(this)) - (totalUsdm - usdmProvided);
        usdm.transfer(msg.sender, usdmLeftover);
        uint256 crv3Leftover = crv3.balanceOf(address(this)) - (totalCrv3 - crv3Provided);
        crv3.transfer(msg.sender, crv3Leftover);
    }

    // --- votium virtual functions ---
    function _balanceOf(address _user) internal view override returns(uint256) {
        return usdmShare[_user] + crv3Share[_user];
    }

    function _supply() internal view override returns(uint256) {
        return totalUsdm + totalCrv3;
    }

    function approvedReward(IERC20 _token) public view override returns(bool) {
        return address(_token) != address(usdm) && address(_token) != address(crv3) && address(_token) != address(usdm3crv);
    }
}

File 2 of 11 : 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);
    }
}

File 3 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 4 of 11 : 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");
        }
    }
}

File 5 of 11 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

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

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

        (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);
            }
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

File 7 of 11 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/Math.sol)

pragma solidity ^0.8.0;

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

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

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

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

File 8 of 11 : CurveInterfaces.sol
// SPDX-License-Identifier: AGPL-3.0

pragma solidity ^0.8.11;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface ICurveMetaPool is IERC20{
    function add_liquidity(uint256[2] calldata _amounts, uint256 _min_mint_amount) external;
    function remove_liquidity(uint256 _burning_amount, uint256[2] calldata _min_amounts) external;
    function remove_liquidity_imbalance(uint256[2] calldata _amounts, uint256 _maxBurningAmount) external;
}

interface ICurvePool {
    function add_liquidity(uint256[3] calldata _amounts, uint256 _min_mint_amount) external;
    function remove_liquidity(uint256 _burning_amount, uint256[3] calldata _min_amounts) external;
    function remove_liquidity_imbalance(uint256[3] calldata _amounts, uint256 _maxBurningAmount) external;
    function remove_liquidity_one_coin(uint256 _3crv_token_amount, int128 i, uint256 _min_amount) external;
    function calc_token_amount(uint256[3] calldata _amounts, bool _deposit) external view returns(uint256);
    function calc_withdraw_one_coin(uint256 _token_amount, int128 _i) external view returns(uint256);
}

File 9 of 11 : VotiumInterfaces.sol
// SPDX-License-Identifier: AGPL-3.0

pragma solidity ^0.8.13;

interface IVotiumMerkleStash {
    function claim(
        address token,
        uint256 index,
        address account,
        uint256 amount,
        bytes32[] calldata merkleProof
    ) external;
}

File 10 of 11 : VotiumShare.sol
// SPDX-License-Identifier: AGPL-3.0

pragma solidity ^0.8.13;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { Math } from "@openzeppelin/contracts/utils/math/Math.sol";
import { BoringMath } from "./library/BoringMath.sol";
import { IVotiumMerkleStash } from "../external/VotiumInterfaces.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";


abstract contract VotiumShare is Ownable {
    using BoringMath for uint256;
    using SafeERC20 for IERC20;
    // reward section
    struct Reward {
        uint256 rewardLeft;
        uint40 periodFinish;
        uint208 rewardRate;
        uint40 lastUpdateTime;
        uint208 rewardPerTokenStored;
    }

    // claim section
    struct ClaimParam {
        address token;
        uint256 index;
        uint256 amount;
        bytes32[]  merkleProof;
    }
    
    // earned reward section
    struct EarnedData {
        address token;
        uint256 amount;
    }

    // votium = https://etherscan.io/address/0x378ba9b73309be80bf4c2c027aad799766a7ed5a#writeContract

    IERC20[] public rewardTokens;

    mapping(IERC20 => Reward) public rewardData;

    mapping(IERC20 => uint256) public rewardIndex;

    uint256 public constant rewardsDuration = 86400 * 14;

    address public team;

    // user -> reward token -> amount
    mapping(address => mapping(IERC20 => uint256)) public userRewardPerTokenPaid;

    mapping(address => mapping(IERC20 => uint256)) public rewards;

    constructor() {
        team = msg.sender;
    }

    modifier updateReward(address _account) {
        for (uint i = 0; i < rewardTokens.length; i++) {
            IERC20 token = rewardTokens[i];
            rewardData[token].rewardPerTokenStored = _rewardPerToken(token).to208();
            rewardData[token].lastUpdateTime = _lastTimeRewardApplicable(rewardData[token].periodFinish).to40();
            if (_account != address(0)) {
                rewards[_account][token] = _earned(_account, token, _balanceOf(_account));
                userRewardPerTokenPaid[_account][token] = rewardData[token].rewardPerTokenStored;
            }
        }
        _;
    }

    function changeTeam(address _team) external onlyOwner {
        team = _team;
    }

    function syncRewards(IERC20[] memory _tokens) external {
        for(uint256 i = 0; i<_tokens.length; i++){
            IERC20 token = _tokens[i];
            require(approvedReward(token), "!approvedReward");
            uint256 increasedToken = token.balanceOf(address(this)) - rewardData[token].rewardLeft;
            _notifyReward(
                token,
                increasedToken * 8 / 10
            );

            rewardData[token].rewardLeft += increasedToken;
            token.transfer(team, increasedToken * 2 / 10);

            if(rewardIndex[token] == 0) {
                rewardTokens.push(token);
                rewardIndex[token] = rewardTokens.length;
            }
        }
    }
    
    // Address and claimable amount of all reward tokens for the given account
    function claimableAmount(address _account) external view returns(EarnedData[] memory userRewards) {
        userRewards = new EarnedData[](rewardTokens.length);
        for (uint256 i = 0; i < userRewards.length; i++) {
            IERC20 token = rewardTokens[i];
            userRewards[i].token = address(token);
            userRewards[i].amount = _earned(_account, token, _balanceOf(_account));
        }
        return userRewards;
    }


    function claim() external updateReward(msg.sender) {
        for (uint i; i < rewardTokens.length; i++) {
            IERC20 _rewardsToken = IERC20(rewardTokens[i]);
            uint256 reward = rewards[msg.sender][_rewardsToken];
            if (reward > 0) {
                rewards[msg.sender][_rewardsToken] = 0;
                rewardData[_rewardsToken].rewardLeft -= reward;
                _rewardsToken.safeTransfer(msg.sender, reward);
            }
        }
    }

    // --- internal functions ---

    function _notifyReward(IERC20 _rewardsToken, uint256 _reward) internal {
        Reward storage rdata = rewardData[_rewardsToken];

        if (block.timestamp >= rdata.periodFinish) {
            rdata.rewardRate = _reward.div(rewardsDuration).to208();
        } else {
            uint256 remaining = uint256(rdata.periodFinish).sub(block.timestamp);
            uint256 leftover = remaining.mul(rdata.rewardRate);
            rdata.rewardRate = _reward.add(leftover).div(rewardsDuration).to208();
        }

        rdata.lastUpdateTime = block.timestamp.to40();
        rdata.periodFinish = block.timestamp.add(rewardsDuration).to40();
    }

    function _rewardPerToken(IERC20 _rewardsToken) internal view returns(uint256) {
        if (_supply() == 0) {
            return rewardData[_rewardsToken].rewardPerTokenStored;
        }
        return
        uint256(rewardData[_rewardsToken].rewardPerTokenStored).add(
            _lastTimeRewardApplicable(rewardData[_rewardsToken].periodFinish).sub(
                rewardData[_rewardsToken].lastUpdateTime).mul(
                rewardData[_rewardsToken].rewardRate).mul(1e18).div(_supply())
        );

    }

    function _lastTimeRewardApplicable(uint256 _finishTime) internal view returns(uint256) {
        return Math.min(block.timestamp, _finishTime);
    }

    function _earned(
        address _user,
        IERC20 _rewardsToken,
        uint256 _balance
    ) internal view returns(uint256) {
        return _balance.mul(
            _rewardPerToken(_rewardsToken).sub(userRewardPerTokenPaid[_user][_rewardsToken])
        ).div(1e18).add(rewards[_user][_rewardsToken]);
    }

    // --- virtual internal functions ---
    function _balanceOf(address _user) internal view virtual returns(uint256);

    function _supply() internal view virtual returns(uint256);

    function approvedReward(IERC20 _token) public view virtual returns(bool);
}

File 11 of 11 : BoringMath.sol
// SPDX-License-Identifier: AGPL-3.0

pragma solidity ^0.8.13;

/// @notice A library for performing overflow-/underflow-safe math,
/// updated with awesomeness from of DappHub (https://github.com/dapphub/ds-math).
library BoringMath {
    function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
        unchecked { 
            require((c = a + b) >= b, "BoringMath: Add Overflow");
        }
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
        unchecked { 
            require((c = a - b) <= a, "BoringMath: Underflow");
        }
    }

    function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
        unchecked { 
            require(b == 0 || (c = a * b) / b == a, "BoringMath: Mul Overflow");
        }
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        unchecked { 
            require(b > 0, "BoringMath: division by zero");
            return a / b;
        }
    }

    function to128(uint256 a) internal pure returns (uint128 c) {
        unchecked { 
            require(a <= type(uint128).max, "BoringMath: uint128 Overflow");
            c = uint128(a);
        }
    }

    function to64(uint256 a) internal pure returns (uint64 c) {
        unchecked { 
            require(a <= type(uint64).max, "BoringMath: uint64 Overflow");
            c = uint64(a);
        }
    }

    function to32(uint256 a) internal pure returns (uint32 c) {
        unchecked { 
            require(a <= type(uint32).max, "BoringMath: uint32 Overflow");
            c = uint32(a);
        }
    }

    function to40(uint256 a) internal pure returns (uint40 c) {
        unchecked { 
            require(a <= type(uint40).max, "BoringMath: uint40 Overflow");
            c = uint40(a);
        }
    }

    function to112(uint256 a) internal pure returns (uint112 c) {
        unchecked { 
            require(a <= type(uint112).max, "BoringMath: uint112 Overflow");
            c = uint112(a);
        }
    }

    function to224(uint256 a) internal pure returns (uint224 c) {
        unchecked { 
            require(a <= type(uint224).max, "BoringMath: uint224 Overflow");
            c = uint224(a);
        }
    }

    function to208(uint256 a) internal pure returns (uint208 c) {
        unchecked { 
            require(a <= type(uint208).max, "BoringMath: uint208 Overflow");
            c = uint208(a);
        }
    }

    function to216(uint256 a) internal pure returns (uint216 c) {
        unchecked { 
            require(a <= type(uint216).max, "BoringMath: uint216 Overflow");
            c = uint216(a);
        }
    }
}

Settings
{
  "evmVersion": "london",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "none",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"_usdm","type":"address"},{"internalType":"contract IERC20","name":"_crv3","type":"address"},{"internalType":"contract IERC20","name":"_dai","type":"address"},{"internalType":"contract IERC20","name":"_usdc","type":"address"},{"internalType":"contract IERC20","name":"_usdt","type":"address"},{"internalType":"contract ICurveMetaPool","name":"_usdm3crv","type":"address"},{"internalType":"contract ICurvePool","name":"_crv3pool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"}],"name":"approvedReward","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_team","type":"address"}],"name":"changeTeam","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"claimableAmount","outputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct VotiumShare.EarnedData[]","name":"userRewards","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"crv3","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"crv3Provided","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"crv3Share","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"crv3pool","outputs":[{"internalType":"contract ICurvePool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dai","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_deposit","type":"uint256"}],"name":"deposit3Crv","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[3]","name":"_deposit","type":"uint256[3]"},{"internalType":"uint256","name":"_min3crv","type":"uint256"}],"name":"depositStable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_usdm","type":"uint256"}],"name":"depositUsdm","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_min_liquidity","type":"uint256"}],"name":"pairLiquidity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_max_burn","type":"uint256"}],"name":"removeLiquidity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"name":"rewardData","outputs":[{"internalType":"uint256","name":"rewardLeft","type":"uint256"},{"internalType":"uint40","name":"periodFinish","type":"uint40"},{"internalType":"uint208","name":"rewardRate","type":"uint208"},{"internalType":"uint40","name":"lastUpdateTime","type":"uint40"},{"internalType":"uint208","name":"rewardPerTokenStored","type":"uint208"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"name":"rewardIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rewardTokens","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"contract IERC20","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sweepTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"_tokens","type":"address[]"}],"name":"syncRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"team","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalCrv3","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalUsdm","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"usdc","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"usdm","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"usdm3crv","outputs":[{"internalType":"contract ICurveMetaPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"usdmProvided","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"usdmShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"usdt","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"contract IERC20","name":"","type":"address"}],"name":"userRewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_withdraw","type":"uint256"}],"name":"withdraw3Crv","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[3]","name":"_withdraw","type":"uint256[3]"},{"internalType":"uint256","name":"_3crv_max","type":"uint256"}],"name":"withdrawStable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_usdm","type":"uint256"}],"name":"withdrawUsdm","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101606040523480156200001257600080fd5b5060405162003426380380620034268339810160408190526200003591620000f2565b620000403362000089565b600480546001600160a01b031916331790556001600160a01b0396871660805294861660a05292851660c05290841660e05283166101005282166101205216610140526200019d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381168114620000ef57600080fd5b50565b600080600080600080600060e0888a0312156200010e57600080fd5b87516200011b81620000d9565b60208901519097506200012e81620000d9565b60408901519096506200014181620000d9565b60608901519095506200015481620000d9565b60808901519094506200016781620000d9565b60a08901519093506200017a81620000d9565b60c08901519092506200018d81620000d9565b8091505092959891949750929550565b60805160a05160c05160e051610100516101205161014051613139620002ed6000396000818161041f01528181610a9401528181611bca01528181611c6201528181611cfd0152611dcb01526000818161056a015281816113f501528181611f950152818161226b015281816122bf015261232b01526000818161029801528181610c6101528181611ca20152611cdb01526000818161031901528181610c1f01528181611c070152611c4001526000818161061c01528181610be001528181611b720152611ba80152600081816104460152818161080f01528181610a0701528181610b10015281816113b70152818161164c0152818161180d015281816118a901528181611d3e01528181611e4a015261229d0152600081816105e20152818161133f0152818161137a015281816116d401528181611770015281816121c7015261224901526131396000f3fe608060405234801561001057600080fd5b50600436106102265760003560e01c8063715018a611610130578063b3cf99ef116100b8578063e70b9e271161007c578063e70b9e271461059f578063e85809a6146105ca578063ee138d0f146105dd578063f2fde38b14610604578063f4b9fa751461061757600080fd5b8063b3cf99ef14610533578063b3e321141461053c578063cca99dea1461055c578063d05a236d14610565578063da977ec91461058c57600080fd5b80638925dbcc116100ff5780638925dbcc146104d457806389885049146104dc5780638da5cb5b146104fc5780638ea1e9a41461050d5780639d7de6b31461052057600080fd5b8063715018a6146104935780637bb7bed11461049b57806385f2aef2146104ae578063874fde0d146104c157600080fd5b80633e413bee116101b357806356ba3feb1161018257806356ba3feb146103e4578063640ba0ba146103f75780636b21d9051461041a5780636dca5abe146104415780637035ab981461046857600080fd5b80633e413bee1461031457806348e5d9f81461033b5780634e71d92d146103c95780635355e221146103d157600080fd5b806331779c02116101fa57806331779c02146102d257806332712788146102db57806334d4f8cd146102ee578063386a9525146103015780633e3995301461030b57600080fd5b8062f0434c1461022b57806315b1f7a51461025e57806324a636f21461027e5780632f48ab7d14610293575b600080fd5b61024b610239366004612d26565b600c6020526000908152604090205481565b6040519081526020015b60405180910390f35b61024b61026c366004612d26565b60096020526000908152604090205481565b61029161028c366004612d43565b61063e565b005b6102ba7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610255565b61024b600b5481565b6102916102e9366004612d5c565b61088a565b6102916102fc366004612db0565b610c92565b61024b6212750081565b61024b600a5481565b6102ba7f000000000000000000000000000000000000000000000000000000000000000081565b610390610349366004612d26565b600260208190526000918252604090912080546001820154919092015464ffffffffff808316926001600160d01b03600160281b9182900481169392831692919091041685565b6040805195865264ffffffffff94851660208701526001600160d01b03938416908601529216606084015216608082015260a001610255565b610291610f0a565b6102916103df366004612d26565b611135565b6102916103f2366004612d43565b611181565b61040a610405366004612d26565b611376565b6040519015158152602001610255565b6102ba7f000000000000000000000000000000000000000000000000000000000000000081565b6102ba7f000000000000000000000000000000000000000000000000000000000000000081565b61024b610476366004612e75565b600560209081526000928352604080842090915290825290205481565b610291611430565b6102ba6104a9366004612d43565b611466565b6004546102ba906001600160a01b031681565b6102916104cf366004612d43565b611490565b610291611683565b6104ef6104ea366004612d26565b6118e0565b6040516102559190612eae565b6000546001600160a01b03166102ba565b61029161051b366004612d5c565b6119f9565b61029161052e366004612f06565b611f0b565b61024b60085481565b61024b61054a366004612d26565b60036020526000908152604090205481565b61024b60075481565b6102ba7f000000000000000000000000000000000000000000000000000000000000000081565b61029161059a366004612d43565b612003565b61024b6105ad366004612e75565b600660209081526000928352604080842090915290825290205481565b6102916105d8366004612f06565b6121fe565b6102ba7f000000000000000000000000000000000000000000000000000000000000000081565b610291610612366004612d26565b612362565b6102ba7f000000000000000000000000000000000000000000000000000000000000000081565b3360005b6001548110156107b15760006001828154811061066157610661612f28565b6000918252602090912001546001600160a01b03169050610689610684826123fd565b6124ed565b6001600160a01b038216600090815260026020819052604090912090810180546001600160d01b0393909316600160281b02600160281b600160f81b031990931692909217909155600101546106ee906106e99064ffffffffff1661254a565b612556565b6001600160a01b03828116600090815260026020819052604090912001805464ffffffffff191664ffffffffff939093169290921790915583161561079e57610740838261073b866125ad565b6125db565b6001600160a01b03848116600081815260066020908152604080832094871680845294825280832095909555600280825285832001549282526005815284822093825292909252919020600160281b9091046001600160d01b031690555b50806107a981612f54565b915050610642565b5081600a60008282546107c49190612f6d565b9091555050336000908152600c6020526040812080548492906107e8908490612f6d565b90915550506040516323b872dd60e01b8152336004820152306024820152604481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064015b6020604051808303816000875af1158015610861573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108859190612f85565b505050565b3360005b6001548110156109ee576000600182815481106108ad576108ad612f28565b6000918252602090912001546001600160a01b031690506108d0610684826123fd565b6001600160a01b038216600090815260026020819052604090912090810180546001600160d01b0393909316600160281b02600160281b600160f81b03199093169290921790915560010154610930906106e99064ffffffffff1661254a565b6001600160a01b03828116600090815260026020819052604090912001805464ffffffffff191664ffffffffff93909316929092179091558316156109db5761097d838261073b866125ad565b6001600160a01b03848116600081815260066020908152604080832094871680845294825280832095909555600280825285832001549282526005815284822093825292909252919020600160281b9091046001600160d01b031690555b50806109e681612f54565b91505061088e565b506040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610a56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7a9190612fa7565b6040516327f6ba8360e21b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690639fdaea0c90610acb9087908790600401612fc0565b600060405180830381600087803b158015610ae557600080fd5b505af1158015610af9573d6000803e3d6000fd5b50506040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031692506370a082319150602401602060405180830381865afa158015610b61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b859190612fa7565b610b8f9082612fd6565b905080600a6000828254610ba39190612fd6565b9091555050336000908152600c602052604081208054839290610bc7908490612fd6565b9091555050833515610c0857610c086001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016338635612653565b602084013515610c4a57610c4a6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016336020870135612653565b604084013515610c8c57610c8c6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016336040870135612653565b50505050565b60005b8151811015610f06576000828281518110610cb257610cb2612f28565b60200260200101519050610cc581611376565b610d085760405162461bcd60e51b815260206004820152600f60248201526e08585c1c1c9bdd995914995dd85c99608a1b60448201526064015b60405180910390fd5b6001600160a01b0381166000818152600260205260408082205490516370a0823160e01b8152306004820152919290916370a0823190602401602060405180830381865afa158015610d5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d829190612fa7565b610d8c9190612fd6565b9050610dae82600a610d9f846008612fed565b610da99190613022565b6126b6565b6001600160a01b03821660009081526002602052604081208054839290610dd6908490612f6d565b90915550506004546001600160a01b038084169163a9059cbb9116600a610dfe856002612fed565b610e089190613022565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e779190612f85565b506001600160a01b0382166000908152600360205260408120549003610ef1576001805480820182557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60180546001600160a01b0319166001600160a01b0385169081179091559054600091825260036020526040909120555b50508080610efe90612f54565b915050610c95565b5050565b3360005b60015481101561106e57600060018281548110610f2d57610f2d612f28565b6000918252602090912001546001600160a01b03169050610f50610684826123fd565b6001600160a01b038216600090815260026020819052604090912090810180546001600160d01b0393909316600160281b02600160281b600160f81b03199093169290921790915560010154610fb0906106e99064ffffffffff1661254a565b6001600160a01b03828116600090815260026020819052604090912001805464ffffffffff191664ffffffffff939093169290921790915583161561105b57610ffd838261073b866125ad565b6001600160a01b03848116600081815260066020908152604080832094871680845294825280832095909555600280825285832001549282526005815284822093825292909252919020600160281b9091046001600160d01b031690555b508061106681612f54565b915050610f0e565b5060005b600154811015610f065760006001828154811061109157611091612f28565b60009182526020808320909101543383526006825260408084206001600160a01b03909216808552919092529120549091508015611120573360009081526006602090815260408083206001600160a01b03861684528252808320839055600290915281208054839290611106908490612fd6565b9091555061112090506001600160a01b0383163383612653565b5050808061112d90612f54565b915050611072565b6000546001600160a01b0316331461115f5760405162461bcd60e51b8152600401610cff90613044565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b3360005b6001548110156112e5576000600182815481106111a4576111a4612f28565b6000918252602090912001546001600160a01b031690506111c7610684826123fd565b6001600160a01b038216600090815260026020819052604090912090810180546001600160d01b0393909316600160281b02600160281b600160f81b03199093169290921790915560010154611227906106e99064ffffffffff1661254a565b6001600160a01b03828116600090815260026020819052604090912001805464ffffffffff191664ffffffffff93909316929092179091558316156112d257611274838261073b866125ad565b6001600160a01b03848116600081815260066020908152604080832094871680845294825280832095909555600280825285832001549282526005815284822093825292909252919020600160281b9091046001600160d01b031690555b50806112dd81612f54565b915050611185565b503360009081526009602052604081208054849290611305908490612fd6565b92505081905550816007600082825461131e9190612fd6565b909155505060405163a9059cbb60e01b8152336004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb90604401610842565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141580156113ec57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614155b801561142a57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614155b92915050565b6000546001600160a01b0316331461145a5760405162461bcd60e51b8152600401610cff90613044565b61146460006127f7565b565b6001818154811061147657600080fd5b6000918252602090912001546001600160a01b0316905081565b3360005b6001548110156115f4576000600182815481106114b3576114b3612f28565b6000918252602090912001546001600160a01b031690506114d6610684826123fd565b6001600160a01b038216600090815260026020819052604090912090810180546001600160d01b0393909316600160281b02600160281b600160f81b03199093169290921790915560010154611536906106e99064ffffffffff1661254a565b6001600160a01b03828116600090815260026020819052604090912001805464ffffffffff191664ffffffffff93909316929092179091558316156115e157611583838261073b866125ad565b6001600160a01b03848116600081815260066020908152604080832094871680845294825280832095909555600280825285832001549282526005815284822093825292909252919020600160281b9091046001600160d01b031690555b50806115ec81612f54565b915050611494565b5081600a60008282546116079190612fd6565b9091555050336000908152600c60205260408120805484929061162b908490612fd6565b909155505060405163a9059cbb60e01b8152336004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb90604401610842565b6000546001600160a01b031633146116ad5760405162461bcd60e51b8152600401610cff90613044565b60006008546007546116bf9190612fd6565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611723573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117479190612fa7565b6117519190612fd6565b60405163a9059cbb60e01b8152336004820152602481018290529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb906044016020604051808303816000875af11580156117c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e59190612f85565b506000600b54600a546117f89190612fd6565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561185c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118809190612fa7565b61188a9190612fd6565b60405163a9059cbb60e01b8152336004820152602481018290529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb90604401610842565b60015460609067ffffffffffffffff8111156118fe576118fe612d8a565b60405190808252806020026020018201604052801561194357816020015b604080518082019091526000808252602082015281526020019060019003908161191c5790505b50905060005b81518110156119f35760006001828154811061196757611967612f28565b9060005260206000200160009054906101000a90046001600160a01b031690508083838151811061199a5761199a612f28565b60209081029190910101516001600160a01b0390911690526119c0848261073b826125ad565b8383815181106119d2576119d2612f28565b602090810291909101810151015250806119eb81612f54565b915050611949565b50919050565b3360005b600154811015611b5d57600060018281548110611a1c57611a1c612f28565b6000918252602090912001546001600160a01b03169050611a3f610684826123fd565b6001600160a01b038216600090815260026020819052604090912090810180546001600160d01b0393909316600160281b02600160281b600160f81b03199093169290921790915560010154611a9f906106e99064ffffffffff1661254a565b6001600160a01b03828116600090815260026020819052604090912001805464ffffffffff191664ffffffffff9390931692909217909155831615611b4a57611aec838261073b866125ad565b6001600160a01b03848116600081815260066020908152604080832094871680845294825280832095909555600280825285832001549282526005815284822093825292909252919020600160281b9091046001600160d01b031690555b5080611b5581612f54565b9150506119fd565b50823515611bf057611b9b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308635612847565b611bf06001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f0000000000000000000000000000000000000000000000000000000000000000853561287f565b602083013515611c8b57611c336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633306020870135612847565b611c8b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f0000000000000000000000000000000000000000000000000000000000000000602086013561287f565b604083013515611d2657611cce6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633306040870135612847565b611d266001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f0000000000000000000000000000000000000000000000000000000000000000604086013561287f565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611d8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611db19190612fa7565b604051634515cef360e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690634515cef390611e029087908790600401612fc0565b600060405180830381600087803b158015611e1c57600080fd5b505af1158015611e30573d6000803e3d6000fd5b50506040516370a0823160e01b81523060048201528392507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031691506370a0823190602401602060405180830381865afa158015611e9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ebe9190612fa7565b611ec89190612fd6565b905080600a6000828254611edc9190612f6d565b9091555050336000908152600c602052604081208054839290611f00908490612f6d565b909155505050505050565b6000546001600160a01b03163314611f355760405162461bcd60e51b8152600401610cff90613044565b600060405180604001604052808481526020018481525090508260086000828254611f609190612fd6565b9250508190555082600b6000828254611f799190612fd6565b909155505060405163e310327360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e310327390611fcc9084908690600401613079565b600060405180830381600087803b158015611fe657600080fd5b505af1158015611ffa573d6000803e3d6000fd5b50505050505050565b3360005b6001548110156121675760006001828154811061202657612026612f28565b6000918252602090912001546001600160a01b03169050612049610684826123fd565b6001600160a01b038216600090815260026020819052604090912090810180546001600160d01b0393909316600160281b02600160281b600160f81b031990931692909217909155600101546120a9906106e99064ffffffffff1661254a565b6001600160a01b03828116600090815260026020819052604090912001805464ffffffffff191664ffffffffff9390931692909217909155831615612154576120f6838261073b866125ad565b6001600160a01b03848116600081815260066020908152604080832094871680845294825280832095909555600280825285832001549282526005815284822093825292909252919020600160281b9091046001600160d01b031690555b508061215f81612f54565b915050612007565b503360009081526009602052604081208054849290612187908490612f6d565b9250508190555081600760008282546121a09190612f6d565b90915550506040516323b872dd60e01b8152336004820152306024820152604481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd90606401610842565b6000546001600160a01b031633146122285760405162461bcd60e51b8152600401610cff90613044565b60408051808201909152828152602081018390526122906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f00000000000000000000000000000000000000000000000000000000000000008561287f565b6122e46001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f00000000000000000000000000000000000000000000000000000000000000008561287f565b82600860008282546122f69190612f6d565b9250508190555082600b600082825461230f9190612f6d565b9091555050604051630b4c7e4d60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690630b4c7e4d90611fcc9084908690600401613079565b6000546001600160a01b0316331461238c5760405162461bcd60e51b8152600401610cff90613044565b6001600160a01b0381166123f15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610cff565b6123fa816127f7565b50565b6000612407612994565b60000361243e57506001600160a01b031660009081526002602081905260409091200154600160281b90046001600160d01b031690565b61142a6124ba61244c612994565b6001600160a01b038516600090815260026020819052604090912060018101549101546124b491670de0b6b3a7640000916124ae916001600160d01b03600160281b82041691839164ffffffffff918216916124a8911661254a565b906129ab565b906129f6565b90612a63565b6001600160a01b03841660009081526002602081905260409091200154600160281b90046001600160d01b031690612acb565b60006001600160d01b038211156125465760405162461bcd60e51b815260206004820152601c60248201527f426f72696e674d6174683a2075696e74323038204f766572666c6f77000000006044820152606401610cff565b5090565b600061142a4283612b1e565b600064ffffffffff8211156125465760405162461bcd60e51b815260206004820152601b60248201527f426f72696e674d6174683a2075696e743430204f766572666c6f7700000000006044820152606401610cff565b6001600160a01b0381166000908152600c6020908152604080832054600990925282205461142a9190612f6d565b6001600160a01b038084166000818152600660209081526040808320948716808452948252808320549383526005825280832094835293905291822054612649919061264390670de0b6b3a7640000906124b49061263c906124a88a6123fd565b87906129f6565b90612acb565b90505b9392505050565b6040516001600160a01b03831660248201526044810182905261088590849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612b34565b6001600160a01b0382166000908152600260205260409020600181015464ffffffffff16421061271d576126f06106848362127500612a63565b8160010160056101000a8154816001600160d01b0302191690836001600160d01b0316021790555061279d565b60018101546000906127369064ffffffffff16426129ab565b600183015490915060009061275c908390600160281b90046001600160d01b03166129f6565b9050612772610684621275006124b48785612acb565b8360010160056101000a8154816001600160d01b0302191690836001600160d01b0316021790555050505b6127a642612556565b60028201805464ffffffffff191664ffffffffff929092169190911790556127d46106e94262127500612acb565b600191909101805464ffffffffff191664ffffffffff9092169190911790555050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b0380851660248301528316604482015260648101829052610c8c9085906323b872dd60e01b9060840161267f565b8015806128f95750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa1580156128d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128f79190612fa7565b155b6129645760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610cff565b6040516001600160a01b03831660248201526044810182905261088590849063095ea7b360e01b9060640161267f565b6000600a546007546129a69190612f6d565b905090565b8082038281111561142a5760405162461bcd60e51b8152602060048201526015602482015274426f72696e674d6174683a20556e646572666c6f7760581b6044820152606401610cff565b6000811580612a1757505080820282828281612a1457612a1461300c565b04145b61142a5760405162461bcd60e51b815260206004820152601860248201527f426f72696e674d6174683a204d756c204f766572666c6f7700000000000000006044820152606401610cff565b6000808211612ab45760405162461bcd60e51b815260206004820152601c60248201527f426f72696e674d6174683a206469766973696f6e206279207a65726f000000006044820152606401610cff565b818381612ac357612ac361300c565b049392505050565b8181018181101561142a5760405162461bcd60e51b815260206004820152601860248201527f426f72696e674d6174683a20416464204f766572666c6f7700000000000000006044820152606401610cff565b6000818310612b2d578161264c565b5090919050565b6000612b89826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612c069092919063ffffffff16565b8051909150156108855780806020019051810190612ba79190612f85565b6108855760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610cff565b6060612649848460008585843b612c5f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610cff565b600080866001600160a01b03168587604051612c7b91906130dd565b60006040518083038185875af1925050503d8060008114612cb8576040519150601f19603f3d011682016040523d82523d6000602084013e612cbd565b606091505b5091509150612ccd828286612cd8565b979650505050505050565b60608315612ce757508161264c565b825115612cf75782518084602001fd5b8160405162461bcd60e51b8152600401610cff91906130f9565b6001600160a01b03811681146123fa57600080fd5b600060208284031215612d3857600080fd5b813561264c81612d11565b600060208284031215612d5557600080fd5b5035919050565b60008060808385031215612d6f57600080fd5b6060830184811115612d8057600080fd5b9294923593505050565b634e487b7160e01b600052604160045260246000fd5b8035612dab81612d11565b919050565b60006020808385031215612dc357600080fd5b823567ffffffffffffffff80821115612ddb57600080fd5b818501915085601f830112612def57600080fd5b813581811115612e0157612e01612d8a565b8060051b604051601f19603f83011681018181108582111715612e2657612e26612d8a565b604052918252848201925083810185019188831115612e4457600080fd5b938501935b82851015612e6957612e5a85612da0565b84529385019392850192612e49565b98975050505050505050565b60008060408385031215612e8857600080fd5b8235612e9381612d11565b91506020830135612ea381612d11565b809150509250929050565b602080825282518282018190526000919060409081850190868401855b82811015612ef957815180516001600160a01b03168552860151868501529284019290850190600101612ecb565b5091979650505050505050565b60008060408385031215612f1957600080fd5b50508035926020909101359150565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612f6657612f66612f3e565b5060010190565b60008219821115612f8057612f80612f3e565b500190565b600060208284031215612f9757600080fd5b8151801515811461264c57600080fd5b600060208284031215612fb957600080fd5b5051919050565b6080810160608483378260608301529392505050565b600082821015612fe857612fe8612f3e565b500390565b600081600019048311821515161561300757613007612f3e565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261303f57634e487b7160e01b600052601260045260246000fd5b500490565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60608101818460005b60028110156130a1578151835260209283019290910190600101613082565b5050508260408301529392505050565b60005b838110156130cc5781810151838201526020016130b4565b83811115610c8c5750506000910152565b600082516130ef8184602087016130b1565b9190910192915050565b60208152600082518060208401526131188160408501602087016130b1565b601f01601f1916919091016040019291505056fea164736f6c634300080d000a00000000000000000000000031d4eb09a216e181ec8a43ce79226a487d6f0ba90000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e4900000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000005b3b5df2bf2b6543f78e053bd91c4bdd820929f1000000000000000000000000bebc44782c7db0a1a60cb6fe97d0b483032ff1c7

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102265760003560e01c8063715018a611610130578063b3cf99ef116100b8578063e70b9e271161007c578063e70b9e271461059f578063e85809a6146105ca578063ee138d0f146105dd578063f2fde38b14610604578063f4b9fa751461061757600080fd5b8063b3cf99ef14610533578063b3e321141461053c578063cca99dea1461055c578063d05a236d14610565578063da977ec91461058c57600080fd5b80638925dbcc116100ff5780638925dbcc146104d457806389885049146104dc5780638da5cb5b146104fc5780638ea1e9a41461050d5780639d7de6b31461052057600080fd5b8063715018a6146104935780637bb7bed11461049b57806385f2aef2146104ae578063874fde0d146104c157600080fd5b80633e413bee116101b357806356ba3feb1161018257806356ba3feb146103e4578063640ba0ba146103f75780636b21d9051461041a5780636dca5abe146104415780637035ab981461046857600080fd5b80633e413bee1461031457806348e5d9f81461033b5780634e71d92d146103c95780635355e221146103d157600080fd5b806331779c02116101fa57806331779c02146102d257806332712788146102db57806334d4f8cd146102ee578063386a9525146103015780633e3995301461030b57600080fd5b8062f0434c1461022b57806315b1f7a51461025e57806324a636f21461027e5780632f48ab7d14610293575b600080fd5b61024b610239366004612d26565b600c6020526000908152604090205481565b6040519081526020015b60405180910390f35b61024b61026c366004612d26565b60096020526000908152604090205481565b61029161028c366004612d43565b61063e565b005b6102ba7f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec781565b6040516001600160a01b039091168152602001610255565b61024b600b5481565b6102916102e9366004612d5c565b61088a565b6102916102fc366004612db0565b610c92565b61024b6212750081565b61024b600a5481565b6102ba7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b610390610349366004612d26565b600260208190526000918252604090912080546001820154919092015464ffffffffff808316926001600160d01b03600160281b9182900481169392831692919091041685565b6040805195865264ffffffffff94851660208701526001600160d01b03938416908601529216606084015216608082015260a001610255565b610291610f0a565b6102916103df366004612d26565b611135565b6102916103f2366004612d43565b611181565b61040a610405366004612d26565b611376565b6040519015158152602001610255565b6102ba7f000000000000000000000000bebc44782c7db0a1a60cb6fe97d0b483032ff1c781565b6102ba7f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e49081565b61024b610476366004612e75565b600560209081526000928352604080842090915290825290205481565b610291611430565b6102ba6104a9366004612d43565b611466565b6004546102ba906001600160a01b031681565b6102916104cf366004612d43565b611490565b610291611683565b6104ef6104ea366004612d26565b6118e0565b6040516102559190612eae565b6000546001600160a01b03166102ba565b61029161051b366004612d5c565b6119f9565b61029161052e366004612f06565b611f0b565b61024b60085481565b61024b61054a366004612d26565b60036020526000908152604090205481565b61024b60075481565b6102ba7f0000000000000000000000005b3b5df2bf2b6543f78e053bd91c4bdd820929f181565b61029161059a366004612d43565b612003565b61024b6105ad366004612e75565b600660209081526000928352604080842090915290825290205481565b6102916105d8366004612f06565b6121fe565b6102ba7f00000000000000000000000031d4eb09a216e181ec8a43ce79226a487d6f0ba981565b610291610612366004612d26565b612362565b6102ba7f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f81565b3360005b6001548110156107b15760006001828154811061066157610661612f28565b6000918252602090912001546001600160a01b03169050610689610684826123fd565b6124ed565b6001600160a01b038216600090815260026020819052604090912090810180546001600160d01b0393909316600160281b02600160281b600160f81b031990931692909217909155600101546106ee906106e99064ffffffffff1661254a565b612556565b6001600160a01b03828116600090815260026020819052604090912001805464ffffffffff191664ffffffffff939093169290921790915583161561079e57610740838261073b866125ad565b6125db565b6001600160a01b03848116600081815260066020908152604080832094871680845294825280832095909555600280825285832001549282526005815284822093825292909252919020600160281b9091046001600160d01b031690555b50806107a981612f54565b915050610642565b5081600a60008282546107c49190612f6d565b9091555050336000908152600c6020526040812080548492906107e8908490612f6d565b90915550506040516323b872dd60e01b8152336004820152306024820152604481018390527f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e4906001600160a01b0316906323b872dd906064015b6020604051808303816000875af1158015610861573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108859190612f85565b505050565b3360005b6001548110156109ee576000600182815481106108ad576108ad612f28565b6000918252602090912001546001600160a01b031690506108d0610684826123fd565b6001600160a01b038216600090815260026020819052604090912090810180546001600160d01b0393909316600160281b02600160281b600160f81b03199093169290921790915560010154610930906106e99064ffffffffff1661254a565b6001600160a01b03828116600090815260026020819052604090912001805464ffffffffff191664ffffffffff93909316929092179091558316156109db5761097d838261073b866125ad565b6001600160a01b03848116600081815260066020908152604080832094871680845294825280832095909555600280825285832001549282526005815284822093825292909252919020600160281b9091046001600160d01b031690555b50806109e681612f54565b91505061088e565b506040516370a0823160e01b81523060048201526000907f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e4906001600160a01b0316906370a0823190602401602060405180830381865afa158015610a56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7a9190612fa7565b6040516327f6ba8360e21b81529091506001600160a01b037f000000000000000000000000bebc44782c7db0a1a60cb6fe97d0b483032ff1c71690639fdaea0c90610acb9087908790600401612fc0565b600060405180830381600087803b158015610ae557600080fd5b505af1158015610af9573d6000803e3d6000fd5b50506040516370a0823160e01b81523060048201527f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e4906001600160a01b031692506370a082319150602401602060405180830381865afa158015610b61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b859190612fa7565b610b8f9082612fd6565b905080600a6000828254610ba39190612fd6565b9091555050336000908152600c602052604081208054839290610bc7908490612fd6565b9091555050833515610c0857610c086001600160a01b037f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f16338635612653565b602084013515610c4a57610c4a6001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4816336020870135612653565b604084013515610c8c57610c8c6001600160a01b037f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec716336040870135612653565b50505050565b60005b8151811015610f06576000828281518110610cb257610cb2612f28565b60200260200101519050610cc581611376565b610d085760405162461bcd60e51b815260206004820152600f60248201526e08585c1c1c9bdd995914995dd85c99608a1b60448201526064015b60405180910390fd5b6001600160a01b0381166000818152600260205260408082205490516370a0823160e01b8152306004820152919290916370a0823190602401602060405180830381865afa158015610d5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d829190612fa7565b610d8c9190612fd6565b9050610dae82600a610d9f846008612fed565b610da99190613022565b6126b6565b6001600160a01b03821660009081526002602052604081208054839290610dd6908490612f6d565b90915550506004546001600160a01b038084169163a9059cbb9116600a610dfe856002612fed565b610e089190613022565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e779190612f85565b506001600160a01b0382166000908152600360205260408120549003610ef1576001805480820182557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60180546001600160a01b0319166001600160a01b0385169081179091559054600091825260036020526040909120555b50508080610efe90612f54565b915050610c95565b5050565b3360005b60015481101561106e57600060018281548110610f2d57610f2d612f28565b6000918252602090912001546001600160a01b03169050610f50610684826123fd565b6001600160a01b038216600090815260026020819052604090912090810180546001600160d01b0393909316600160281b02600160281b600160f81b03199093169290921790915560010154610fb0906106e99064ffffffffff1661254a565b6001600160a01b03828116600090815260026020819052604090912001805464ffffffffff191664ffffffffff939093169290921790915583161561105b57610ffd838261073b866125ad565b6001600160a01b03848116600081815260066020908152604080832094871680845294825280832095909555600280825285832001549282526005815284822093825292909252919020600160281b9091046001600160d01b031690555b508061106681612f54565b915050610f0e565b5060005b600154811015610f065760006001828154811061109157611091612f28565b60009182526020808320909101543383526006825260408084206001600160a01b03909216808552919092529120549091508015611120573360009081526006602090815260408083206001600160a01b03861684528252808320839055600290915281208054839290611106908490612fd6565b9091555061112090506001600160a01b0383163383612653565b5050808061112d90612f54565b915050611072565b6000546001600160a01b0316331461115f5760405162461bcd60e51b8152600401610cff90613044565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b3360005b6001548110156112e5576000600182815481106111a4576111a4612f28565b6000918252602090912001546001600160a01b031690506111c7610684826123fd565b6001600160a01b038216600090815260026020819052604090912090810180546001600160d01b0393909316600160281b02600160281b600160f81b03199093169290921790915560010154611227906106e99064ffffffffff1661254a565b6001600160a01b03828116600090815260026020819052604090912001805464ffffffffff191664ffffffffff93909316929092179091558316156112d257611274838261073b866125ad565b6001600160a01b03848116600081815260066020908152604080832094871680845294825280832095909555600280825285832001549282526005815284822093825292909252919020600160281b9091046001600160d01b031690555b50806112dd81612f54565b915050611185565b503360009081526009602052604081208054849290611305908490612fd6565b92505081905550816007600082825461131e9190612fd6565b909155505060405163a9059cbb60e01b8152336004820152602481018390527f00000000000000000000000031d4eb09a216e181ec8a43ce79226a487d6f0ba96001600160a01b03169063a9059cbb90604401610842565b60007f00000000000000000000000031d4eb09a216e181ec8a43ce79226a487d6f0ba96001600160a01b0316826001600160a01b0316141580156113ec57507f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e4906001600160a01b0316826001600160a01b031614155b801561142a57507f0000000000000000000000005b3b5df2bf2b6543f78e053bd91c4bdd820929f16001600160a01b0316826001600160a01b031614155b92915050565b6000546001600160a01b0316331461145a5760405162461bcd60e51b8152600401610cff90613044565b61146460006127f7565b565b6001818154811061147657600080fd5b6000918252602090912001546001600160a01b0316905081565b3360005b6001548110156115f4576000600182815481106114b3576114b3612f28565b6000918252602090912001546001600160a01b031690506114d6610684826123fd565b6001600160a01b038216600090815260026020819052604090912090810180546001600160d01b0393909316600160281b02600160281b600160f81b03199093169290921790915560010154611536906106e99064ffffffffff1661254a565b6001600160a01b03828116600090815260026020819052604090912001805464ffffffffff191664ffffffffff93909316929092179091558316156115e157611583838261073b866125ad565b6001600160a01b03848116600081815260066020908152604080832094871680845294825280832095909555600280825285832001549282526005815284822093825292909252919020600160281b9091046001600160d01b031690555b50806115ec81612f54565b915050611494565b5081600a60008282546116079190612fd6565b9091555050336000908152600c60205260408120805484929061162b908490612fd6565b909155505060405163a9059cbb60e01b8152336004820152602481018390527f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e4906001600160a01b03169063a9059cbb90604401610842565b6000546001600160a01b031633146116ad5760405162461bcd60e51b8152600401610cff90613044565b60006008546007546116bf9190612fd6565b6040516370a0823160e01b81523060048201527f00000000000000000000000031d4eb09a216e181ec8a43ce79226a487d6f0ba96001600160a01b0316906370a0823190602401602060405180830381865afa158015611723573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117479190612fa7565b6117519190612fd6565b60405163a9059cbb60e01b8152336004820152602481018290529091507f00000000000000000000000031d4eb09a216e181ec8a43ce79226a487d6f0ba96001600160a01b03169063a9059cbb906044016020604051808303816000875af11580156117c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e59190612f85565b506000600b54600a546117f89190612fd6565b6040516370a0823160e01b81523060048201527f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e4906001600160a01b0316906370a0823190602401602060405180830381865afa15801561185c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118809190612fa7565b61188a9190612fd6565b60405163a9059cbb60e01b8152336004820152602481018290529091507f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e4906001600160a01b03169063a9059cbb90604401610842565b60015460609067ffffffffffffffff8111156118fe576118fe612d8a565b60405190808252806020026020018201604052801561194357816020015b604080518082019091526000808252602082015281526020019060019003908161191c5790505b50905060005b81518110156119f35760006001828154811061196757611967612f28565b9060005260206000200160009054906101000a90046001600160a01b031690508083838151811061199a5761199a612f28565b60209081029190910101516001600160a01b0390911690526119c0848261073b826125ad565b8383815181106119d2576119d2612f28565b602090810291909101810151015250806119eb81612f54565b915050611949565b50919050565b3360005b600154811015611b5d57600060018281548110611a1c57611a1c612f28565b6000918252602090912001546001600160a01b03169050611a3f610684826123fd565b6001600160a01b038216600090815260026020819052604090912090810180546001600160d01b0393909316600160281b02600160281b600160f81b03199093169290921790915560010154611a9f906106e99064ffffffffff1661254a565b6001600160a01b03828116600090815260026020819052604090912001805464ffffffffff191664ffffffffff9390931692909217909155831615611b4a57611aec838261073b866125ad565b6001600160a01b03848116600081815260066020908152604080832094871680845294825280832095909555600280825285832001549282526005815284822093825292909252919020600160281b9091046001600160d01b031690555b5080611b5581612f54565b9150506119fd565b50823515611bf057611b9b6001600160a01b037f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f1633308635612847565b611bf06001600160a01b037f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f167f000000000000000000000000bebc44782c7db0a1a60cb6fe97d0b483032ff1c7853561287f565b602083013515611c8b57611c336001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb481633306020870135612847565b611c8b6001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48167f000000000000000000000000bebc44782c7db0a1a60cb6fe97d0b483032ff1c7602086013561287f565b604083013515611d2657611cce6001600160a01b037f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec71633306040870135612847565b611d266001600160a01b037f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7167f000000000000000000000000bebc44782c7db0a1a60cb6fe97d0b483032ff1c7604086013561287f565b6040516370a0823160e01b81523060048201526000907f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e4906001600160a01b0316906370a0823190602401602060405180830381865afa158015611d8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611db19190612fa7565b604051634515cef360e01b81529091506001600160a01b037f000000000000000000000000bebc44782c7db0a1a60cb6fe97d0b483032ff1c71690634515cef390611e029087908790600401612fc0565b600060405180830381600087803b158015611e1c57600080fd5b505af1158015611e30573d6000803e3d6000fd5b50506040516370a0823160e01b81523060048201528392507f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e4906001600160a01b031691506370a0823190602401602060405180830381865afa158015611e9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ebe9190612fa7565b611ec89190612fd6565b905080600a6000828254611edc9190612f6d565b9091555050336000908152600c602052604081208054839290611f00908490612f6d565b909155505050505050565b6000546001600160a01b03163314611f355760405162461bcd60e51b8152600401610cff90613044565b600060405180604001604052808481526020018481525090508260086000828254611f609190612fd6565b9250508190555082600b6000828254611f799190612fd6565b909155505060405163e310327360e01b81526001600160a01b037f0000000000000000000000005b3b5df2bf2b6543f78e053bd91c4bdd820929f1169063e310327390611fcc9084908690600401613079565b600060405180830381600087803b158015611fe657600080fd5b505af1158015611ffa573d6000803e3d6000fd5b50505050505050565b3360005b6001548110156121675760006001828154811061202657612026612f28565b6000918252602090912001546001600160a01b03169050612049610684826123fd565b6001600160a01b038216600090815260026020819052604090912090810180546001600160d01b0393909316600160281b02600160281b600160f81b031990931692909217909155600101546120a9906106e99064ffffffffff1661254a565b6001600160a01b03828116600090815260026020819052604090912001805464ffffffffff191664ffffffffff9390931692909217909155831615612154576120f6838261073b866125ad565b6001600160a01b03848116600081815260066020908152604080832094871680845294825280832095909555600280825285832001549282526005815284822093825292909252919020600160281b9091046001600160d01b031690555b508061215f81612f54565b915050612007565b503360009081526009602052604081208054849290612187908490612f6d565b9250508190555081600760008282546121a09190612f6d565b90915550506040516323b872dd60e01b8152336004820152306024820152604481018390527f00000000000000000000000031d4eb09a216e181ec8a43ce79226a487d6f0ba96001600160a01b0316906323b872dd90606401610842565b6000546001600160a01b031633146122285760405162461bcd60e51b8152600401610cff90613044565b60408051808201909152828152602081018390526122906001600160a01b037f00000000000000000000000031d4eb09a216e181ec8a43ce79226a487d6f0ba9167f0000000000000000000000005b3b5df2bf2b6543f78e053bd91c4bdd820929f18561287f565b6122e46001600160a01b037f0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e490167f0000000000000000000000005b3b5df2bf2b6543f78e053bd91c4bdd820929f18561287f565b82600860008282546122f69190612f6d565b9250508190555082600b600082825461230f9190612f6d565b9091555050604051630b4c7e4d60e01b81526001600160a01b037f0000000000000000000000005b3b5df2bf2b6543f78e053bd91c4bdd820929f11690630b4c7e4d90611fcc9084908690600401613079565b6000546001600160a01b0316331461238c5760405162461bcd60e51b8152600401610cff90613044565b6001600160a01b0381166123f15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610cff565b6123fa816127f7565b50565b6000612407612994565b60000361243e57506001600160a01b031660009081526002602081905260409091200154600160281b90046001600160d01b031690565b61142a6124ba61244c612994565b6001600160a01b038516600090815260026020819052604090912060018101549101546124b491670de0b6b3a7640000916124ae916001600160d01b03600160281b82041691839164ffffffffff918216916124a8911661254a565b906129ab565b906129f6565b90612a63565b6001600160a01b03841660009081526002602081905260409091200154600160281b90046001600160d01b031690612acb565b60006001600160d01b038211156125465760405162461bcd60e51b815260206004820152601c60248201527f426f72696e674d6174683a2075696e74323038204f766572666c6f77000000006044820152606401610cff565b5090565b600061142a4283612b1e565b600064ffffffffff8211156125465760405162461bcd60e51b815260206004820152601b60248201527f426f72696e674d6174683a2075696e743430204f766572666c6f7700000000006044820152606401610cff565b6001600160a01b0381166000908152600c6020908152604080832054600990925282205461142a9190612f6d565b6001600160a01b038084166000818152600660209081526040808320948716808452948252808320549383526005825280832094835293905291822054612649919061264390670de0b6b3a7640000906124b49061263c906124a88a6123fd565b87906129f6565b90612acb565b90505b9392505050565b6040516001600160a01b03831660248201526044810182905261088590849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612b34565b6001600160a01b0382166000908152600260205260409020600181015464ffffffffff16421061271d576126f06106848362127500612a63565b8160010160056101000a8154816001600160d01b0302191690836001600160d01b0316021790555061279d565b60018101546000906127369064ffffffffff16426129ab565b600183015490915060009061275c908390600160281b90046001600160d01b03166129f6565b9050612772610684621275006124b48785612acb565b8360010160056101000a8154816001600160d01b0302191690836001600160d01b0316021790555050505b6127a642612556565b60028201805464ffffffffff191664ffffffffff929092169190911790556127d46106e94262127500612acb565b600191909101805464ffffffffff191664ffffffffff9092169190911790555050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b0380851660248301528316604482015260648101829052610c8c9085906323b872dd60e01b9060840161267f565b8015806128f95750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa1580156128d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128f79190612fa7565b155b6129645760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610cff565b6040516001600160a01b03831660248201526044810182905261088590849063095ea7b360e01b9060640161267f565b6000600a546007546129a69190612f6d565b905090565b8082038281111561142a5760405162461bcd60e51b8152602060048201526015602482015274426f72696e674d6174683a20556e646572666c6f7760581b6044820152606401610cff565b6000811580612a1757505080820282828281612a1457612a1461300c565b04145b61142a5760405162461bcd60e51b815260206004820152601860248201527f426f72696e674d6174683a204d756c204f766572666c6f7700000000000000006044820152606401610cff565b6000808211612ab45760405162461bcd60e51b815260206004820152601c60248201527f426f72696e674d6174683a206469766973696f6e206279207a65726f000000006044820152606401610cff565b818381612ac357612ac361300c565b049392505050565b8181018181101561142a5760405162461bcd60e51b815260206004820152601860248201527f426f72696e674d6174683a20416464204f766572666c6f7700000000000000006044820152606401610cff565b6000818310612b2d578161264c565b5090919050565b6000612b89826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612c069092919063ffffffff16565b8051909150156108855780806020019051810190612ba79190612f85565b6108855760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610cff565b6060612649848460008585843b612c5f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610cff565b600080866001600160a01b03168587604051612c7b91906130dd565b60006040518083038185875af1925050503d8060008114612cb8576040519150601f19603f3d011682016040523d82523d6000602084013e612cbd565b606091505b5091509150612ccd828286612cd8565b979650505050505050565b60608315612ce757508161264c565b825115612cf75782518084602001fd5b8160405162461bcd60e51b8152600401610cff91906130f9565b6001600160a01b03811681146123fa57600080fd5b600060208284031215612d3857600080fd5b813561264c81612d11565b600060208284031215612d5557600080fd5b5035919050565b60008060808385031215612d6f57600080fd5b6060830184811115612d8057600080fd5b9294923593505050565b634e487b7160e01b600052604160045260246000fd5b8035612dab81612d11565b919050565b60006020808385031215612dc357600080fd5b823567ffffffffffffffff80821115612ddb57600080fd5b818501915085601f830112612def57600080fd5b813581811115612e0157612e01612d8a565b8060051b604051601f19603f83011681018181108582111715612e2657612e26612d8a565b604052918252848201925083810185019188831115612e4457600080fd5b938501935b82851015612e6957612e5a85612da0565b84529385019392850192612e49565b98975050505050505050565b60008060408385031215612e8857600080fd5b8235612e9381612d11565b91506020830135612ea381612d11565b809150509250929050565b602080825282518282018190526000919060409081850190868401855b82811015612ef957815180516001600160a01b03168552860151868501529284019290850190600101612ecb565b5091979650505050505050565b60008060408385031215612f1957600080fd5b50508035926020909101359150565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612f6657612f66612f3e565b5060010190565b60008219821115612f8057612f80612f3e565b500190565b600060208284031215612f9757600080fd5b8151801515811461264c57600080fd5b600060208284031215612fb957600080fd5b5051919050565b6080810160608483378260608301529392505050565b600082821015612fe857612fe8612f3e565b500390565b600081600019048311821515161561300757613007612f3e565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261303f57634e487b7160e01b600052601260045260246000fd5b500490565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60608101818460005b60028110156130a1578151835260209283019290910190600101613082565b5050508260408301529392505050565b60005b838110156130cc5781810151838201526020016130b4565b83811115610c8c5750506000910152565b600082516130ef8184602087016130b1565b9190910192915050565b60208152600082518060208401526131188160408501602087016130b1565b601f01601f1916919091016040019291505056fea164736f6c634300080d000a

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

00000000000000000000000031d4eb09a216e181ec8a43ce79226a487d6f0ba90000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e4900000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000005b3b5df2bf2b6543f78e053bd91c4bdd820929f1000000000000000000000000bebc44782c7db0a1a60cb6fe97d0b483032ff1c7

-----Decoded View---------------
Arg [0] : _usdm (address): 0x31d4Eb09a216e181eC8a43ce79226A487D6F0BA9
Arg [1] : _crv3 (address): 0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490
Arg [2] : _dai (address): 0x6B175474E89094C44Da98b954EedeAC495271d0F
Arg [3] : _usdc (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [4] : _usdt (address): 0xdAC17F958D2ee523a2206206994597C13D831ec7
Arg [5] : _usdm3crv (address): 0x5B3b5DF2BF2B6543f78e053bD91C4Bdd820929f1
Arg [6] : _crv3pool (address): 0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 00000000000000000000000031d4eb09a216e181ec8a43ce79226a487d6f0ba9
Arg [1] : 0000000000000000000000006c3f90f043a72fa612cbac8115ee7e52bde6e490
Arg [2] : 0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f
Arg [3] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [4] : 000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7
Arg [5] : 0000000000000000000000005b3b5df2bf2b6543f78e053bd91c4bdd820929f1
Arg [6] : 000000000000000000000000bebc44782c7db0a1a60cb6fe97d0b483032ff1c7


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.