ETH Price: $3,003.89 (-1.86%)
Gas: 15 Gwei

Contract

0x12B7b9e21Ad9D7E8992e0c129ED0bccEaC185c3E
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Emergency Withdr...122006282021-04-08 17:51:131105 days ago1617904273IN
0x12B7b9e2...EaC185c3E
0 ETH0.01336753104
Emergency Withdr...121989212021-04-08 11:38:581105 days ago1617881938IN
0x12B7b9e2...EaC185c3E
0 ETH0.01446145102
Emergency Withdr...121897042021-04-07 1:31:061107 days ago1617759066IN
0x12B7b9e2...EaC185c3E
0 ETH0.01375313107
Emergency Withdr...121896682021-04-07 1:23:061107 days ago1617758586IN
0x12B7b9e2...EaC185c3E
0 ETH0.02030874117.00000134
Withdraw121890572021-04-06 23:04:221107 days ago1617750262IN
0x12B7b9e2...EaC185c3E
0 ETH0.00823633117
Deposit121819602021-04-05 21:00:141108 days ago1617656414IN
0x12B7b9e2...EaC185c3E
0 ETH0.03666393163.98207613
Deposit121762582021-04-04 23:50:431109 days ago1617580243IN
0x12B7b9e2...EaC185c3E
0 ETH0.0189068989
Deposit121762072021-04-04 23:40:201109 days ago1617579620IN
0x12B7b9e2...EaC185c3E
0 ETH0.0211107686
Update Victim In...121705442021-04-04 2:57:091110 days ago1617505029IN
0x12B7b9e2...EaC185c3E
0 ETH0.0031133599
Update Victim In...121705422021-04-04 2:56:441110 days ago1617505004IN
0x12B7b9e2...EaC185c3E
0 ETH0.0031133599
Update Victim In...121705402021-04-04 2:56:271110 days ago1617504987IN
0x12B7b9e2...EaC185c3E
0 ETH0.0031448100
Update Victim In...121705362021-04-04 2:55:401110 days ago1617504940IN
0x12B7b9e2...EaC185c3E
0 ETH0.0031448100
Update Victim In...121705352021-04-04 2:55:201110 days ago1617504920IN
0x12B7b9e2...EaC185c3E
0 ETH0.0031448100
Update Victim In...121705312021-04-04 2:54:361110 days ago1617504876IN
0x12B7b9e2...EaC185c3E
0 ETH0.00317624101.00000145
Update Victim In...121705292021-04-04 2:54:201110 days ago1617504860IN
0x12B7b9e2...EaC185c3E
0 ETH0.00320769102.00000145
Update Victim In...121705262021-04-04 2:53:511110 days ago1617504831IN
0x12B7b9e2...EaC185c3E
0 ETH0.0030795598
Deposit121696702021-04-03 23:42:421110 days ago1617493362IN
0x12B7b9e2...EaC185c3E
0 ETH0.0230462100
Add121634132021-04-03 0:44:411111 days ago1617410681IN
0x12B7b9e2...EaC185c3E
0 ETH0.01543036166
Add121634132021-04-03 0:44:411111 days ago1617410681IN
0x12B7b9e2...EaC185c3E
0 ETH0.01543036166
Add121634132021-04-03 0:44:411111 days ago1617410681IN
0x12B7b9e2...EaC185c3E
0 ETH0.01543036166
Add121634132021-04-03 0:44:411111 days ago1617410681IN
0x12B7b9e2...EaC185c3E
0 ETH0.01543036166
Add121634132021-04-03 0:44:411111 days ago1617410681IN
0x12B7b9e2...EaC185c3E
0 ETH0.01543036166
Add121634102021-04-03 0:44:001111 days ago1617410640IN
0x12B7b9e2...EaC185c3E
0 ETH0.01473117166
0x60a06040121252932021-03-28 3:53:081117 days ago1616903588IN
 Create: MasterVampire
0 ETH0.2983156784.00000134

Latest 8 internal transactions

Advanced mode:
Parent Transaction Hash Block From To Value
121889482021-04-06 22:42:321107 days ago1617748952
0x12B7b9e2...EaC185c3E
0.00184592 ETH
121889482021-04-06 22:42:321107 days ago1617748952
0x12B7b9e2...EaC185c3E
0.00184592 ETH
121889482021-04-06 22:42:321107 days ago1617748952
0x12B7b9e2...EaC185c3E
0.00086297 ETH
121889482021-04-06 22:42:321107 days ago1617748952
0x12B7b9e2...EaC185c3E
0.00086297 ETH
121889312021-04-06 22:38:521107 days ago1617748732
0x12B7b9e2...EaC185c3E
0.00184377 ETH
121889312021-04-06 22:38:521107 days ago1617748732
0x12B7b9e2...EaC185c3E
0.00184377 ETH
121889312021-04-06 22:38:521107 days ago1617748732
0x12B7b9e2...EaC185c3E
0.00086143 ETH
121889312021-04-06 22:38:521107 days ago1617748732
0x12B7b9e2...EaC185c3E
0.00086143 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MasterVampire

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 9999 runs

Other Settings:
default evmVersion
File 1 of 14 : MasterVampire.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.6;

import "./IMasterVampire.sol";
import "./IIBVEth.sol";

contract MasterVampire is IMasterVampire, ChiGasSaver {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;
    using VampireAdapter for Victim;
    //     (_                   _)
    //      /\                 /\
    //     / \'._   (\_/)   _.'/ \
    //    /_.''._'--('.')--'_.''._\
    //    | \_ / `;=/ " \=;` \ _/ |
    //     \/ `\__|`\___/`|__/`  \/
    //   jgs`      \(/|\)/       `
    //              " ` "
    event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);

    IWETH immutable weth;

    modifier onlyDev() {
        require(devAddress == msg.sender, "not dev");
        _;
    }

    modifier onlyRewardUpdater() {
        require(poolRewardUpdater == msg.sender, "not reward updater");
        _;
    }

    constructor(
        address _drainAddress,
        address _drainController,
        address _IBVETH,
        address _weth
    ) {
        drainAddress = _drainAddress;
        drainController = _drainController;
        devAddress = msg.sender;
        poolRewardUpdater = msg.sender;
        IBVETH = _IBVETH;
        weth = IWETH(_weth);
    }

    /**
     * @notice Allow depositing ether to the contract
     */
    receive() external payable {}

    function poolLength() external view returns (uint256) {
        return poolInfo.length;
    }

    function add(Victim _victim, uint256 _victimPoolId) external onlyOwner {
        poolInfo.push(PoolInfo({
            victim: _victim,
            victimPoolId: _victimPoolId,
            lastRewardBlock: block.number,
            accWethPerShare: 0,
            wethAccumulator: 0,
            basePoolShares: 0,
            baseDeposits: 0
        }));
    }

    function updateDistributionPeriod(uint256 _distributionPeriod) external onlyRewardUpdater {
        distributionPeriod = _distributionPeriod;
    }

    function updateWithdrawPenalty(uint256 _withdrawalPenalty) external onlyRewardUpdater {
        withdrawalPenalty = _withdrawalPenalty;
    }

    function updateVictimInfo(uint256 _pid, address _victim, uint256 _victimPoolId) external onlyOwner {
        poolInfo[_pid].victim = Victim(_victim);
        poolInfo[_pid].victimPoolId = _victimPoolId;
    }

    function updatePoolDrain(uint256 _wethDrainModifier) external onlyOwner {
        wethDrainModifier = _wethDrainModifier;
    }

    function updateDevAddress(address _devAddress) external onlyDev {
        devAddress = _devAddress;
    }

    function updateDrainAddress(address _drainAddress) external onlyOwner {
        drainAddress = _drainAddress;
    }

    function updateIBEthStrategy(address _ibveth) external onlyOwner {
        IBVETH = _ibveth;
        (bool success,) = address(IBVETH).delegatecall(abi.encodeWithSignature("migrate()"));
        require(success, "migrate() delegatecall failed.");
    }

    function updateDrainController(address _drainController) external onlyOwner {
        drainController = _drainController;
    }

    function updateRewardUpdaterAddress(address _poolRewardUpdater) external onlyOwner {
        poolRewardUpdater = _poolRewardUpdater;
    }

    function pendingWeth(uint256 _pid, address _user) public view returns (uint256) {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        uint256 accWethPerShare = pool.accWethPerShare;
        uint256 lpSupply = pool.victim.lockedAmount(pool.victimPoolId);
        if (block.number > pool.lastRewardBlock && lpSupply != 0) {
            uint256 blocksToReward = block.number.sub(pool.lastRewardBlock);
            uint256 wethReward = blocksToReward.mul(pool.wethAccumulator).div(distributionPeriod);
            accWethPerShare = accWethPerShare.add(wethReward.mul(1e12).div(lpSupply));
        }

        return user.amount.mul(accWethPerShare).div(1e12).sub(user.rewardDebt);
    }

    event ETHValue(uint256 amount);

    function pendingWethReal(uint256 _pid, address _user) external returns (uint256) {
        uint256 ibETH = pendingWeth(_pid, _user);
        uint256 ethVal = IIBVEth(IBVETH).ibETHValue(ibETH);
        emit ETHValue(ethVal);
        return ethVal;
    }

    function pendingVictimReward(uint256 pid) external view returns (uint256) {
        PoolInfo storage pool = poolInfo[pid];
        return pool.victim.pendingReward(pid, pool.victimPoolId);
    }

    function poolAccWeth(uint256 pid) external view returns (uint256) {
        PoolInfo storage pool = poolInfo[pid];
        return pool.wethAccumulator;
    }

    function massUpdatePools() external {
        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            updatePool(pid);
        }
    }

    function updatePool(uint256 pid) public {
        PoolInfo storage pool = poolInfo[pid];
        if (block.number <= pool.lastRewardBlock) {
            return;
        }
        uint256 lpSupply = pool.victim.lockedAmount(pool.victimPoolId);
        if (lpSupply == 0) {
            pool.lastRewardBlock = block.number;
            return;
        }

        uint256 blocksToReward = block.number.sub(pool.lastRewardBlock);
        uint256 wethReward = blocksToReward.mul(pool.wethAccumulator).div(distributionPeriod);
        pool.accWethPerShare = pool.accWethPerShare.add(wethReward.mul(1e12).div(lpSupply));
        pool.lastRewardBlock = block.number;
        pool.wethAccumulator = pool.wethAccumulator.sub(wethReward);
    }

    function deposit(uint256 pid, uint256 amount, uint8 flag) external nonReentrant saveGas(flag) {
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][msg.sender];
        user.coolOffTime = block.timestamp + 24 hours;

        updatePool(pid);
        if (user.amount > 0) {
            _claim(pid, false, flag);
        }

        if (amount > 0) {
            pool.victim.lockableToken(pool.victimPoolId).safeTransferFrom(address(msg.sender), address(this), amount);
            uint256 shares = pool.victim.deposit(pool.victimPoolId, amount);
            if (shares > 0) {
                pool.basePoolShares = pool.basePoolShares.add(shares);
                pool.baseDeposits = pool.baseDeposits.add(amount);
                user.poolShares = user.poolShares.add(shares);
            }
            user.amount = user.amount.add(amount);
        }

        user.rewardDebt = user.amount.mul(pool.accWethPerShare).div(1e12);
        emit Deposit(msg.sender, pid, amount);
    }

    function withdraw(uint256 pid, uint256 amount, uint8 flag) external nonReentrant saveGas(flag) {
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][msg.sender];
        require(user.amount >= amount, "withdraw: not good");
        updatePool(pid);
        _claim(pid, true, flag);

        if (amount > 0) {
            user.amount = user.amount.sub(amount);
            uint256 shares = pool.victim.withdraw(pool.victimPoolId, amount);
            if (shares > 0) {
                pool.basePoolShares = pool.basePoolShares.sub(shares);
                pool.baseDeposits = pool.baseDeposits.sub(amount);
                user.poolShares = user.poolShares.sub(shares);
            }
            pool.victim.lockableToken(pool.victimPoolId).safeTransfer(address(msg.sender), amount);
        }

        user.rewardDebt = user.amount.mul(pool.accWethPerShare).div(1e12);
        emit Withdraw(msg.sender, pid, amount);
    }

    function claim(uint256 pid, uint8 flag) external nonReentrant saveGas(flag) {
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][msg.sender];
        updatePool(pid);
        _claim(pid, false, flag);
        user.rewardDebt = user.amount.mul(pool.accWethPerShare).div(1e12);
    }

    function emergencyWithdraw(uint256 pid) external nonReentrant {
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][msg.sender];
        pool.victim.withdraw(pool.victimPoolId, user.amount);
        pool.victim.lockableToken(pool.victimPoolId).safeTransfer(address(msg.sender), user.amount);
        emit EmergencyWithdraw(msg.sender, pid, user.amount);
        user.amount = 0;
        user.rewardDebt = 0;
        user.poolShares = 0;
    }

    /// Can only be called by DrainController
    function drain(uint256 pid) external {
        require(drainController == msg.sender, "not drainctrl");
        PoolInfo storage pool = poolInfo[pid];
        Victim victim = pool.victim;
        uint256 victimPoolId = pool.victimPoolId;
        victim.claimReward(pid, victimPoolId);
        IERC20 rewardToken = victim.rewardToken(pid);
        uint256 claimedReward = rewardToken.balanceOf(address(this));

        if (claimedReward == 0) {
            return;
        }

        uint256 wethReward = victim.sellRewardForWeth(pid, claimedReward, address(this));
        // Take a % of the drained reward to be redistributed to other contracts
        uint256 wethDrainAmount = wethReward.mul(wethDrainModifier).div(1000);
        if (wethDrainAmount > 0) {
            weth.transfer(drainAddress, wethDrainAmount);
            wethReward = wethReward.sub(wethDrainAmount);
        }

        // Remainder of rewards go to users of the drained pool as interest-bearing ETH
        uint256 ibethBefore = IIBVEth(IBVETH).balance(address(this));
        (bool success,) = IBVETH.delegatecall(abi.encodeWithSignature("handleDrainedWETH(uint256)", wethReward));
        require(success, "handleDrainedWETH(uint256 amount) delegatecall failed.");
        uint256 ibethAfter = IIBVEth(IBVETH).balance(address(this));

        pool.wethAccumulator = pool.wethAccumulator.add(ibethAfter.sub(ibethBefore));
    }

    /// This function allows owner to take unsupported tokens out of the contract.
    /// It also allows for removal of airdropped tokens.
    function recoverUnsupported(IERC20 token, uint256 amount, address to) external onlyOwner {
        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            PoolInfo storage pool = poolInfo[pid];
            IERC20 lpToken = pool.victim.lockableToken(pool.victimPoolId);
            // cant take staked asset
            require(token != lpToken, "!pool.lpToken");
        }
        // transfer to
        token.safeTransfer(to, amount);
    }

    /// Claim rewards from pool
    function _claim(uint256 pid, bool withdrawing, uint8 flag) internal {
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][msg.sender];
        uint256 pending = user.amount.mul(pool.accWethPerShare).div(1e12).sub(user.rewardDebt);
        if (pending > 0) {
            if (withdrawing && withdrawalPenalty > 0 && block.timestamp < user.coolOffTime) {
                uint256 fee = pending.mul(withdrawalPenalty).div(1000);
                pending = pending.sub(fee);
                pool.wethAccumulator = pool.wethAccumulator.add(fee);
            }

            (bool success,) = address(IBVETH).delegatecall(abi.encodeWithSignature("handleClaim(uint256,uint8)", pending, flag));
            require(success, "handleClaim(uint256 pending, uint8 flag) delegatecall failed.");
        }
    }

    function _safeWethTransfer(address to, uint256 amount) internal {
        uint256 balance = weth.balanceOf(address(this));
        if (amount > balance) {
            weth.transfer(to, balance);
        } else {
            weth.transfer(to, amount);
        }
    }
}

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

pragma solidity ^0.7.6;

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

/**
* @title Interface for MV and adapters that follows the `Inherited Storage` pattern
* This allows adapters to add storage variables locally without causing collisions.
* Adapters simply need to inherit this interface so that new variables are appended.
*/
abstract contract IMasterVampire is Ownable, ReentrancyGuard {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;
    using VampireAdapter for Victim;

    struct UserInfo {
        uint256 amount;
        uint256 rewardDebt;
        uint256 coolOffTime;
        uint256 poolShares;
    }

    struct PoolInfo {
        Victim victim;
        uint256 victimPoolId;
        uint256 lastRewardBlock;
        uint256 accWethPerShare;
        uint256 wethAccumulator;
        // Base amount of shares from user deposits for victims that return shares for the pool.
        uint256 basePoolShares;
        uint256 baseDeposits;
    }

    address public IBVETH;

    address public drainController;
    address public drainAddress;
    address public poolRewardUpdater;
    address public devAddress;
    uint256 public distributionPeriod = 6519; // Blocks in 24 hour period
    uint256 public withdrawalPenalty = 10;
    uint256 public wethDrainModifier = 150;

    // Info of each pool
    PoolInfo[] public poolInfo;
    // Info of each user that stakes LP tokens
    mapping (uint256 => mapping (address => UserInfo)) public userInfo;
}

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

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./interfaces/IWETH.sol";

/**
* @title Interface for interest bearing ETH strategies
*/
abstract contract IIBVEth  {

    IWETH immutable WETH;

    constructor(address weth) {
        WETH = IWETH(weth);
    }

    function handleDrainedWETH(uint256 amount) external virtual;
    function handleClaim(uint256 pending, uint8 flag) external virtual;
    function migrate() external virtual;
    function ibToken() external view virtual returns(IERC20);
    function balance(address account) external view virtual returns(uint256);
    function ethBalance(address account) external virtual returns(uint256);
    function ibETHValue(uint256 amount) external virtual returns (uint256);

    function _safeETHTransfer(address payable to, uint256 amount) internal virtual {
        uint256 _balance = address(this).balance;
        if (amount > _balance) {
            to.transfer(_balance);
        } else {
            to.transfer(amount);
        }
    }
}

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

pragma solidity ^0.7.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 6 of 14 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

import "./IERC20.sol";
import "../../math/SafeMath.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 SafeMath for uint256;
    using Address for address;

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

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

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

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

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

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

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

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

pragma solidity ^0.7.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.7.0;

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

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

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

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

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

pragma solidity ^0.7.0;

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

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

    uint256 private _status;

    constructor () {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

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

pragma solidity ^0.7.6;

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

contract Victim {}

library VampireAdapter {
    // Victim info
    function rewardToken(Victim victim, uint256 poolId) external view returns (IERC20) {
        (bool success, bytes memory result) = address(victim).staticcall(abi.encodeWithSignature("rewardToken(uint256)", poolId));
        require(success, "rewardToken(uint256) staticcall failed.");
        return abi.decode(result, (IERC20));
    }

    function rewardValue(Victim victim, uint256 poolId, uint256 amount) external view returns (uint256) {
        (bool success, bytes memory result) = address(victim).staticcall(abi.encodeWithSignature("rewardValue(uint256,uint256)", poolId, amount));
        require(success, "rewardValue(uint256,uint256) staticcall failed.");
        return abi.decode(result, (uint256));
    }

    function poolCount(Victim victim) external view returns (uint256) {
        (bool success, bytes memory result) = address(victim).staticcall(abi.encodeWithSignature("poolCount()"));
        require(success, "poolCount() staticcall failed.");
        return abi.decode(result, (uint256));
    }

    function sellableRewardAmount(Victim victim, uint256 poolId) external view returns (uint256) {
        (bool success, bytes memory result) = address(victim).staticcall(abi.encodeWithSignature("sellableRewardAmount(uint256)", poolId));
        require(success, "sellableRewardAmount(uint256) staticcall failed.");
        return abi.decode(result, (uint256));
    }

    // Victim actions
    function sellRewardForWeth(Victim victim, uint256 poolId, uint256 rewardAmount, address to) external returns(uint256) {
        (bool success, bytes memory result) = address(victim).delegatecall(abi.encodeWithSignature("sellRewardForWeth(address,uint256,uint256,address)", address(victim), poolId, rewardAmount, to));
        require(success, "sellRewardForWeth(uint256,address) delegatecall failed.");
        return abi.decode(result, (uint256));
    }

    // Pool info
    function lockableToken(Victim victim, uint256 poolId) external view returns (IERC20) {
        (bool success, bytes memory result) = address(victim).staticcall(abi.encodeWithSignature("lockableToken(uint256)", poolId));
        require(success, "lockableToken(uint256) staticcall failed.");
        return abi.decode(result, (IERC20));
    }

    function lockedAmount(Victim victim, uint256 poolId) external view returns (uint256) {
        // note the impersonation
        (bool success, bytes memory result) = address(victim).staticcall(abi.encodeWithSignature("lockedAmount(address,uint256)", address(this), poolId));
        require(success, "lockedAmount(uint256) staticcall failed.");
        return abi.decode(result, (uint256));
    }

    function pendingReward(Victim victim, uint256 poolId, uint256 victimPoolId) external view returns (uint256) {
        // note the impersonation
        (bool success, bytes memory result) = address(victim).staticcall(abi.encodeWithSignature("pendingReward(address,uint256,uint256)", address(victim), poolId, victimPoolId));
        require(success, "pendingReward(address,uint256,uint256) staticcall failed.");
        return abi.decode(result, (uint256));
    }

    // Pool actions
    function deposit(Victim victim, uint256 poolId, uint256 amount) external returns (uint256) {
        (bool success, bytes memory result) = address(victim).delegatecall(abi.encodeWithSignature("deposit(address,uint256,uint256)", address(victim), poolId, amount));
        require(success, "deposit(uint256,uint256) delegatecall failed.");
        return abi.decode(result, (uint256));
    }

    function withdraw(Victim victim, uint256 poolId, uint256 amount) external returns (uint256) {
        (bool success, bytes memory result) = address(victim).delegatecall(abi.encodeWithSignature("withdraw(address,uint256,uint256)", address(victim), poolId, amount));
        require(success, "withdraw(uint256,uint256) delegatecall failed.");
        return abi.decode(result, (uint256));
    }

    function claimReward(Victim victim, uint256 poolId, uint256 victimPoolId) external {
        (bool success,) = address(victim).delegatecall(abi.encodeWithSignature("claimReward(address,uint256,uint256)", address(victim), poolId, victimPoolId));
        require(success, "claimReward(uint256,uint256) delegatecall failed.");
    }

    function emergencyWithdraw(Victim victim, uint256 poolId) external {
        (bool success,) = address(victim).delegatecall(abi.encodeWithSignature("emergencyWithdraw(address,uint256)", address(victim), poolId));
        require(success, "emergencyWithdraw(uint256) delegatecall failed.");
    }

    // Service methods
    function poolAddress(Victim victim, uint256 poolId) external view returns (address) {
        (bool success, bytes memory result) = address(victim).staticcall(abi.encodeWithSignature("poolAddress(uint256)", poolId));
        require(success, "poolAddress(uint256) staticcall failed.");
        return abi.decode(result, (address));
    }

    function rewardToWethPool(Victim victim) external view returns (address) {
        (bool success, bytes memory result) = address(victim).staticcall(abi.encodeWithSignature("rewardToWethPool()"));
        require(success, "rewardToWethPool() staticcall failed.");
        return abi.decode(result, (address));
    }
}

File 11 of 14 : ChiGasSaver.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

import "./interfaces/IChiToken.sol";

/**
* @title Inheritable contract to enable optional gas savings on functions via a modifier
*/
abstract contract ChiGasSaver {

    modifier saveGas(uint8 flag) {
        if ((flag & 0x1) == 0) {
            _;
        } else {
            uint256 gasStart = gasleft();
            _;
            uint256 gasSpent = 21000 + gasStart - gasleft() + 16 * msg.data.length;

            IChiToken chi = IChiToken(0x0000000000004946c0e9F43F4Dee607b0eF1fA1c);
            chi.freeFromUpTo(msg.sender, (gasSpent + 14154) / 41947);
        }
    }
}

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

pragma solidity ^0.7.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity >=0.6.0 <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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 14 of 14 : IChiToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

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

interface IChiToken is IERC20 {
    function mint(uint256 value) external;
    function freeFromUpTo(address from, uint256 value) external returns(uint256 freed);
}

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

pragma solidity >=0.5.0;

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

interface IWETH is IERC20 {
    function deposit() external payable;
    function withdraw(uint) external;
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 9999
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {
    "contracts/VampireAdapter.sol": {
      "VampireAdapter": "0xc22c12d1a327c1bfe5782bca429a3f7828bc068a"
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_drainAddress","type":"address"},{"internalType":"address","name":"_drainController","type":"address"},{"internalType":"address","name":"_IBVETH","type":"address"},{"internalType":"address","name":"_weth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ETHValue","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"IBVETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract Victim","name":"_victim","type":"address"},{"internalType":"uint256","name":"_victimPoolId","type":"uint256"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"uint8","name":"flag","type":"uint8"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint8","name":"flag","type":"uint8"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"devAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"distributionPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"drain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drainAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"drainController","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"pendingVictimReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingWeth","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingWethReal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"poolAccWeth","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract Victim","name":"victim","type":"address"},{"internalType":"uint256","name":"victimPoolId","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accWethPerShare","type":"uint256"},{"internalType":"uint256","name":"wethAccumulator","type":"uint256"},{"internalType":"uint256","name":"basePoolShares","type":"uint256"},{"internalType":"uint256","name":"baseDeposits","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolRewardUpdater","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"recoverUnsupported","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_devAddress","type":"address"}],"name":"updateDevAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_distributionPeriod","type":"uint256"}],"name":"updateDistributionPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_drainAddress","type":"address"}],"name":"updateDrainAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_drainController","type":"address"}],"name":"updateDrainController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_ibveth","type":"address"}],"name":"updateIBEthStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_wethDrainModifier","type":"uint256"}],"name":"updatePoolDrain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_poolRewardUpdater","type":"address"}],"name":"updateRewardUpdaterAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_victim","type":"address"},{"internalType":"uint256","name":"_victimPoolId","type":"uint256"}],"name":"updateVictimInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_withdrawalPenalty","type":"uint256"}],"name":"updateWithdrawPenalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"},{"internalType":"uint256","name":"coolOffTime","type":"uint256"},{"internalType":"uint256","name":"poolShares","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wethDrainModifier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint8","name":"flag","type":"uint8"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawalPenalty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a0604052611977600755600a60085560966009553480156200002157600080fd5b5060405162003cea38038062003cea833981810160405260808110156200004757600080fd5b508051602082015160408301516060909301519192909160006200006a62000123565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35060018055600480546001600160a01b03199081166001600160a01b039687161790915560038054821694861694909417909355600680543390851681179091556005805485169091179055600280549093169190931617905560601b6001600160601b03191660805262000127565b3390565b60805160601c613ba56200014560003980612d5e5250613ba56000f3fe6080604052600436106102535760003560e01c806389c70e7911610138578063d17f2a59116100b0578063ede2302e1161007f578063f5d82b6b11610064578063f5d82b6b14610814578063f6b19c741461084d578063feab1592146108775761025a565b8063ede2302e146107a2578063f2fde38b146107e15761025a565b8063d17f2a591461071b578063e0a9b09d14610745578063e10f8f061461075a578063e22fae061461076f5761025a565b80639b50172311610107578063a2468c19116100ec578063a2468c191461069a578063b6f525a7146106af578063cbb4e2e1146106e85761025a565b80639b50172314610642578063a081ddbd146106575761025a565b806389c70e791461058f5780638da5cb5b146105b957806392f2cff0146105ce57806393f1a40b146105e35761025a565b8063431de007116101cb578063592e7def1161019a57806368cdd86e1161017f57806368cdd86e14610532578063715018a614610547578063850337621461055c5761025a565b8063592e7def14610508578063630b5ba11461051d5761025a565b8063431de0071461045757806351eb05a61461048a5780635312ea8e146104b4578063577fbd5f146104de5761025a565b806317f0088d116102225780632faf3ea6116102075780632faf3ea6146103c957806333fc552e146103fc5780633ad10ef6146104265761025a565b806317f0088d1461035757806319ba83a5146103905761025a565b8063017e29b41461025f5780630661cefb1461028b578063081e3eda146102d65780631526fe27146102eb5761025a565b3661025a57005b600080fd5b34801561026b57600080fd5b506102896004803603602081101561028257600080fd5b50356108aa565b005b34801561029757600080fd5b506102c4600480360360408110156102ae57600080fd5b50803590602001356001600160a01b031661090e565b60408051918252519081900360200190f35b3480156102e257600080fd5b506102c46109f4565b3480156102f757600080fd5b506103156004803603602081101561030e57600080fd5b50356109fa565b604080516001600160a01b0390981688526020880196909652868601949094526060860192909252608085015260a084015260c0830152519081900360e00190f35b34801561036357600080fd5b506102896004803603606081101561037a57600080fd5b508035906020810135906040013560ff16610a53565b34801561039c57600080fd5b50610289600480360360608110156103b357600080fd5b508035906020810135906040013560ff166110f0565b3480156103d557600080fd5b50610289600480360360408110156103ec57600080fd5b508035906020013560ff16611685565b34801561040857600080fd5b506102c46004803603602081101561041f57600080fd5b5035611885565b34801561043257600080fd5b5061043b6118b0565b604080516001600160a01b039092168252519081900360200190f35b34801561046357600080fd5b506102896004803603602081101561047a57600080fd5b50356001600160a01b03166118bf565b34801561049657600080fd5b50610289600480360360208110156104ad57600080fd5b503561196d565b3480156104c057600080fd5b50610289600480360360208110156104d757600080fd5b5035611aea565b3480156104ea57600080fd5b506102896004803603602081101561050157600080fd5b5035611d13565b34801561051457600080fd5b5061043b611d77565b34801561052957600080fd5b50610289611d86565b34801561053e57600080fd5b5061043b611da9565b34801561055357600080fd5b50610289611db8565b34801561056857600080fd5b506102896004803603602081101561057f57600080fd5b50356001600160a01b0316611e8e565b34801561059b57600080fd5b506102c4600480360360208110156105b257600080fd5b5035611f27565b3480156105c557600080fd5b5061043b612002565b3480156105da57600080fd5b5061043b612011565b3480156105ef57600080fd5b5061061c6004803603604081101561060657600080fd5b50803590602001356001600160a01b0316612020565b604080519485526020850193909352838301919091526060830152519081900360800190f35b34801561064e57600080fd5b506102c4612052565b34801561066357600080fd5b506102896004803603606081101561067a57600080fd5b506001600160a01b03813581169160208101359160409091013516612058565b3480156106a657600080fd5b506102c461222f565b3480156106bb57600080fd5b506102c4600480360360408110156106d257600080fd5b50803590602001356001600160a01b0316612235565b3480156106f457600080fd5b506102896004803603602081101561070b57600080fd5b50356001600160a01b03166123d8565b34801561072757600080fd5b506102896004803603602081101561073e57600080fd5b5035612486565b34801561075157600080fd5b5061043b6124ff565b34801561076657600080fd5b506102c461250e565b34801561077b57600080fd5b506102896004803603602081101561079257600080fd5b50356001600160a01b0316612514565b3480156107ae57600080fd5b50610289600480360360608110156107c557600080fd5b508035906001600160a01b0360208201351690604001356125c2565b3480156107ed57600080fd5b506102896004803603602081101561080457600080fd5b50356001600160a01b03166126a1565b34801561082057600080fd5b506102896004803603604081101561083757600080fd5b506001600160a01b0381351690602001356127cd565b34801561085957600080fd5b506102896004803603602081101561087057600080fd5b50356129cd565b34801561088357600080fd5b506102896004803603602081101561089a57600080fd5b50356001600160a01b031661309c565b6005546001600160a01b03163314610909576040805162461bcd60e51b815260206004820152601260248201527f6e6f742072657761726420757064617465720000000000000000000000000000604482015290519081900360640190fd5b600855565b60008061091b8484612235565b600254604080517f9d3f50390000000000000000000000000000000000000000000000000000000081526004810184905290519293506000926001600160a01b0390921691639d3f50399160248082019260209290919082900301818787803b15801561098757600080fd5b505af115801561099b573d6000803e3d6000fd5b505050506040513d60208110156109b157600080fd5b50516040805182815290519192507fb37961da3972b7b5f62cae2d8c10d43840dbe99529a868d75b318ad6f2c09c0e919081900360200190a19150505b92915050565b600a5490565b600a8181548110610a0a57600080fd5b600091825260209091206007909102018054600182015460028301546003840154600485015460058601546006909601546001600160a01b039095169650929491939092919087565b60026001541415610aab576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600190815581908116610d9b576000600a8581548110610ac957fe5b60009182526020808320888452600b825260408085203386529092529220805460079092029092019250851115610b47576040805162461bcd60e51b815260206004820152601260248201527f77697468647261773a206e6f7420676f6f640000000000000000000000000000604482015290519081900360640190fd5b610b508661196d565b610b5c866001866132af565b8415610d37578054610b6e90866134f6565b815581546001830154604080517fa2c16fe70000000000000000000000000000000000000000000000000000000081526001600160a01b0390931660048401526024830191909152604482018790525160009173c22c12d1a327c1bfe5782bca429a3f7828bc068a9163a2c16fe791606480820192602092909190829003018186803b158015610bfd57600080fd5b505af4158015610c11573d6000803e3d6000fd5b505050506040513d6020811015610c2757600080fd5b505190508015610c6e576005830154610c4090826134f6565b60058401556006830154610c5490876134f6565b60068401556003820154610c6890826134f6565b60038301555b82546001840154604080517f9f7433410000000000000000000000000000000000000000000000000000000081526001600160a01b039093166004840152602483019190915251610d35913391899173c22c12d1a327c1bfe5782bca429a3f7828bc068a91639f74334191604480820192602092909190829003018186803b158015610cf957600080fd5b505af4158015610d0d573d6000803e3d6000fd5b505050506040513d6020811015610d2357600080fd5b50516001600160a01b03169190613553565b505b60038201548154610d589164e8d4a5100091610d52916135d8565b90613638565b6001820155604080518681529051879133917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a350506110e6565b60005a90506000600a8681548110610daf57fe5b60009182526020808320898452600b825260408085203386529092529220805460079092029092019250861115610e2d576040805162461bcd60e51b815260206004820152601260248201527f77697468647261773a206e6f7420676f6f640000000000000000000000000000604482015290519081900360640190fd5b610e368761196d565b610e42876001876132af565b8515610fe1578054610e5490876134f6565b815581546001830154604080517fa2c16fe70000000000000000000000000000000000000000000000000000000081526001600160a01b0390931660048401526024830191909152604482018890525160009173c22c12d1a327c1bfe5782bca429a3f7828bc068a9163a2c16fe791606480820192602092909190829003018186803b158015610ee357600080fd5b505af4158015610ef7573d6000803e3d6000fd5b505050506040513d6020811015610f0d57600080fd5b505190508015610f54576005830154610f2690826134f6565b60058401556006830154610f3a90886134f6565b60068401556003820154610f4e90826134f6565b60038301555b82546001840154604080517f9f7433410000000000000000000000000000000000000000000000000000000081526001600160a01b039093166004840152602483019190915251610fdf9133918a9173c22c12d1a327c1bfe5782bca429a3f7828bc068a91639f74334191604480820192602092909190829003018186803b158015610cf957600080fd5b505b60038201548154610ffc9164e8d4a5100091610d52916135d8565b6001820155604080518781529051889133917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a35060009050601036025a830301615208810191506d4946c0e9f43f4dee607b0ef1fa1c90819063079d229f90339061a3db90618952015b046040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156110b657600080fd5b505af11580156110ca573d6000803e3d6000fd5b505050506040513d60208110156110e057600080fd5b50505050505b5050600180555050565b60026001541415611148576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001908155819081166113f0576000600a858154811061116657fe5b60009182526020808320888452600b8252604080852033865290925292206201518042016002820155600790910290910191506111a28661196d565b8054156111b5576111b5866000866132af565b84156113925781546001830154604080517f9f7433410000000000000000000000000000000000000000000000000000000081526001600160a01b0390931660048401526024830191909152516112849133913091899173c22c12d1a327c1bfe5782bca429a3f7828bc068a91639f743341916044808301926020929190829003018186803b15801561124757600080fd5b505af415801561125b573d6000803e3d6000fd5b505050506040513d602081101561127157600080fd5b50516001600160a01b031692919061369f565b81546001830154604080517ff8c35b370000000000000000000000000000000000000000000000000000000081526001600160a01b0390931660048401526024830191909152604482018790525160009173c22c12d1a327c1bfe5782bca429a3f7828bc068a9163f8c35b3791606480820192602092909190829003018186803b15801561131157600080fd5b505af4158015611325573d6000803e3d6000fd5b505050506040513d602081101561133b57600080fd5b5051905080156113825760058301546113549082613727565b600584015560068301546113689087613727565b6006840155600382015461137c9082613727565b60038301555b815461138e9087613727565b8255505b600382015481546113ad9164e8d4a5100091610d52916135d8565b6001820155604080518681529051879133917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a350506110e6565b60005a90506000600a868154811061140457fe5b60009182526020808320898452600b8252604080852033865290925292206201518042016002820155600790910290910191506114408761196d565b80541561145357611453876000876132af565b85156115f35781546001830154604080517f9f7433410000000000000000000000000000000000000000000000000000000081526001600160a01b0390931660048401526024830191909152516114e591339130918a9173c22c12d1a327c1bfe5782bca429a3f7828bc068a91639f743341916044808301926020929190829003018186803b15801561124757600080fd5b81546001830154604080517ff8c35b370000000000000000000000000000000000000000000000000000000081526001600160a01b0390931660048401526024830191909152604482018890525160009173c22c12d1a327c1bfe5782bca429a3f7828bc068a9163f8c35b3791606480820192602092909190829003018186803b15801561157257600080fd5b505af4158015611586573d6000803e3d6000fd5b505050506040513d602081101561159c57600080fd5b5051905080156115e35760058301546115b59082613727565b600584015560068301546115c99088613727565b600684015560038201546115dd9082613727565b60038301555b81546115ef9088613727565b8255505b6003820154815461160e9164e8d4a5100091610d52916135d8565b6001820155604080518781529051889133917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a35060009050601036025a830301615208810191506d4946c0e9f43f4dee607b0ef1fa1c90819063079d229f90339061a3db906189520161106f565b600260015414156116dd576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260019081558190811661175f576000600a84815481106116fb57fe5b60009182526020808320878452600b8252604080852033865290925292206007909102909101915061172c8561196d565b611738856000866132af565b600382015481546117539164e8d4a5100091610d52916135d8565b6001909101555061187c565b60005a90506000600a858154811061177357fe5b60009182526020808320888452600b825260408085203386529092529220600790910290910191506117a48661196d565b6117b0866000876132af565b600382015481546117cb9164e8d4a5100091610d52916135d8565b600190910155506000601036025a830301615208810191506d4946c0e9f43f4dee607b0ef1fa1c90819063079d229f90339061a3db9061895201046040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561184c57600080fd5b505af1158015611860573d6000803e3d6000fd5b505050506040513d602081101561187657600080fd5b50505050505b50506001805550565b600080600a838154811061189557fe5b60009182526020909120600460079092020101549392505050565b6006546001600160a01b031681565b6118c7613781565b6001600160a01b03166118d8612002565b6001600160a01b031614611933576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600480547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6000600a828154811061197c57fe5b906000526020600020906007020190508060020154431161199d5750611ae7565b80546001820154604080517f1e95069c0000000000000000000000000000000000000000000000000000000081526001600160a01b03909316600484015260248301919091525160009173c22c12d1a327c1bfe5782bca429a3f7828bc068a91631e95069c91604480820192602092909190829003018186803b158015611a2357600080fd5b505af4158015611a37573d6000803e3d6000fd5b505050506040513d6020811015611a4d57600080fd5b5051905080611a63575043600290910155611ae7565b6000611a7c8360020154436134f690919063ffffffff16565b90506000611a9d600754610d528660040154856135d890919063ffffffff16565b9050611ac0611ab584610d528464e8d4a510006135d8565b600386015490613727565b60038501554360028501556004840154611ada90826134f6565b8460040181905550505050505b50565b60026001541415611b42576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001819055506000600a8281548110611b5957fe5b60009182526020808320858452600b8252604080852033865283529384902060079093020180546001820154845486517fa2c16fe70000000000000000000000000000000000000000000000000000000081526001600160a01b03939093166004840152602483019190915260448201529351909450919273c22c12d1a327c1bfe5782bca429a3f7828bc068a9263a2c16fe792606480840193919291829003018186803b158015611c0a57600080fd5b505af4158015611c1e573d6000803e3d6000fd5b505050506040513d6020811015611c3457600080fd5b5050805482546001840154604080517f9f7433410000000000000000000000000000000000000000000000000000000081526001600160a01b039093166004840152602483019190915251611cc2923392909173c22c12d1a327c1bfe5782bca429a3f7828bc068a91639f743341916044808301926020929190829003018186803b158015610cf957600080fd5b80546040805191825251849133917fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959181900360200190a36000808255600180830182905560039092015580555050565b6005546001600160a01b03163314611d72576040805162461bcd60e51b815260206004820152601260248201527f6e6f742072657761726420757064617465720000000000000000000000000000604482015290519081900360640190fd5b600755565b6002546001600160a01b031681565b600a5460005b81811015611da557611d9d8161196d565b600101611d8c565b5050565b6005546001600160a01b031681565b611dc0613781565b6001600160a01b0316611dd1612002565b6001600160a01b031614611e2c576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b6006546001600160a01b03163314611eed576040805162461bcd60e51b815260206004820152600760248201527f6e6f742064657600000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600680547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b600080600a8381548110611f3757fe5b600091825260209182902060079091020180546001820154604080517f3d0dfc3b0000000000000000000000000000000000000000000000000000000081526001600160a01b0390931660048401526024830188905260448301919091525191935073c22c12d1a327c1bfe5782bca429a3f7828bc068a92633d0dfc3b92606480840193829003018186803b158015611fcf57600080fd5b505af4158015611fe3573d6000803e3d6000fd5b505050506040513d6020811015611ff957600080fd5b50519392505050565b6000546001600160a01b031690565b6004546001600160a01b031681565b600b60209081526000928352604080842090915290825290208054600182015460028301546003909301549192909184565b60075481565b612060613781565b6001600160a01b0316612071612002565b6001600160a01b0316146120cc576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600a5460005b81811015612214576000600a82815481106120e957fe5b60009182526020808320600790920290910180546001820154604080517f9f7433410000000000000000000000000000000000000000000000000000000081526001600160a01b03909316600484015260248301919091525191945073c22c12d1a327c1bfe5782bca429a3f7828bc068a92639f74334192604480840193829003018186803b15801561217b57600080fd5b505af415801561218f573d6000803e3d6000fd5b505050506040513d60208110156121a557600080fd5b505190506001600160a01b03878116908216141561220a576040805162461bcd60e51b815260206004820152600d60248201527f21706f6f6c2e6c70546f6b656e00000000000000000000000000000000000000604482015290519081900360640190fd5b50506001016120d2565b506122296001600160a01b0385168385613553565b50505050565b60085481565b600080600a848154811061224557fe5b60009182526020808320878452600b825260408085206001600160a01b03808a16875290845281862060036007909602909301948501548554600187015484517f1e95069c0000000000000000000000000000000000000000000000000000000081529190931660048201526024810192909252915194965091949093909273c22c12d1a327c1bfe5782bca429a3f7828bc068a92631e95069c9260448083019392829003018186803b1580156122fb57600080fd5b505af415801561230f573d6000803e3d6000fd5b505050506040513d602081101561232557600080fd5b505160028501549091504311801561233c57508015155b1561239f57600061235a8560020154436134f690919063ffffffff16565b9050600061237b600754610d528860040154856135d890919063ffffffff16565b905061239a61239384610d528464e8d4a510006135d8565b8590613727565b935050505b6123cd83600101546123c764e8d4a51000610d528688600001546135d890919063ffffffff16565b906134f6565b979650505050505050565b6123e0613781565b6001600160a01b03166123f1612002565b6001600160a01b03161461244c576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b61248e613781565b6001600160a01b031661249f612002565b6001600160a01b0316146124fa576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600955565b6003546001600160a01b031681565b60095481565b61251c613781565b6001600160a01b031661252d612002565b6001600160a01b031614612588576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600580547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6125ca613781565b6001600160a01b03166125db612002565b6001600160a01b031614612636576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b81600a848154811061264457fe5b906000526020600020906007020160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080600a848154811061268757fe5b906000526020600020906007020160010181905550505050565b6126a9613781565b6001600160a01b03166126ba612002565b6001600160a01b031614612715576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811661275a5760405162461bcd60e51b8152600401808060200182810382526026815260200180613a666026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6127d5613781565b6001600160a01b03166127e6612002565b6001600160a01b031614612841576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6040805160e0810182526001600160a01b03938416815260208101928352439181019182526000606082018181526080830182815260a0840183815260c08501848152600a8054600181018255955294517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8600790950294850180547fffffffffffffffffffffffff000000000000000000000000000000000000000016919099161790975594517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a983015592517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2aa82015591517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2ab83015591517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2ac82015591517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2ad830155517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2ae90910155565b6003546001600160a01b03163314612a2c576040805162461bcd60e51b815260206004820152600d60248201527f6e6f7420647261696e6374726c00000000000000000000000000000000000000604482015290519081900360640190fd5b6000600a8281548110612a3b57fe5b60009182526020822060079091020180546001820154604080517f53d6afd40000000000000000000000000000000000000000000000000000000081526001600160a01b03909316600484018190526024840188905260448401839052905193955093909273c22c12d1a327c1bfe5782bca429a3f7828bc068a926353d6afd4926064808301939192829003018186803b158015612ad857600080fd5b505af4158015612aec573d6000803e3d6000fd5b5050604080517fb50c4fb60000000000000000000000000000000000000000000000000000000081526001600160a01b03861660048201526024810188905290516000935073c22c12d1a327c1bfe5782bca429a3f7828bc068a925063b50c4fb691604480820192602092909190829003018186803b158015612b6e57600080fd5b505af4158015612b82573d6000803e3d6000fd5b505050506040513d6020811015612b9857600080fd5b5051604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290519192506000916001600160a01b038416916370a08231916024808301926020929190829003018186803b158015612bff57600080fd5b505afa158015612c13573d6000803e3d6000fd5b505050506040513d6020811015612c2957600080fd5b5051905080612c3c575050505050611ae7565b604080517ff35294550000000000000000000000000000000000000000000000000000000081526001600160a01b03861660048201526024810188905260448101839052306064820152905160009173c22c12d1a327c1bfe5782bca429a3f7828bc068a9163f352945591608480820192602092909190829003018186803b158015612cc757600080fd5b505af4158015612cdb573d6000803e3d6000fd5b505050506040513d6020811015612cf157600080fd5b5051600954909150600090612d0f906103e890610d529085906135d8565b90508015612de25760048054604080517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b039283169381019390935260248301849052517f00000000000000000000000000000000000000000000000000000000000000009091169163a9059cbb9160448083019260209291908290030181600087803b158015612da857600080fd5b505af1158015612dbc573d6000803e3d6000fd5b505050506040513d6020811015612dd257600080fd5b50612ddf905082826134f6565b91505b600254604080517fe3d670d700000000000000000000000000000000000000000000000000000000815230600482015290516000926001600160a01b03169163e3d670d7916024808301926020929190829003018186803b158015612e4657600080fd5b505afa158015612e5a573d6000803e3d6000fd5b505050506040513d6020811015612e7057600080fd5b505160025460408051602480820188905282518083039091018152604490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f104f823c00000000000000000000000000000000000000000000000000000000178152915181519495506000946001600160a01b0390941693919290918291908083835b60208310612f3857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101612efb565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114612f98576040519150601f19603f3d011682016040523d82523d6000602084013e612f9d565b606091505b5050905080612fdd5760405162461bcd60e51b8152600401808060200182810382526036815260200180613ad36036913960400191505060405180910390fd5b600254604080517fe3d670d700000000000000000000000000000000000000000000000000000000815230600482015290516000926001600160a01b03169163e3d670d7916024808301926020929190829003018186803b15801561304157600080fd5b505afa158015613055573d6000803e3d6000fd5b505050506040513d602081101561306b57600080fd5b5051905061308761307c82856134f6565b60048c015490613727565b8a600401819055505050505050505050505050565b6130a4613781565b6001600160a01b03166130b5612002565b6001600160a01b031614613110576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600280546001600160a01b038084167fffffffffffffffffffffffff0000000000000000000000000000000000000000909216919091179182905560408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f8fd3ab80000000000000000000000000000000000000000000000000000000001781529151815160009590941693919290918291908083835b602083106131f457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016131b7565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114613254576040519150601f19603f3d011682016040523d82523d6000602084013e613259565b606091505b5050905080611da5576040805162461bcd60e51b815260206004820152601e60248201527f6d69677261746528292064656c656761746563616c6c206661696c65642e0000604482015290519081900360640190fd5b6000600a84815481106132be57fe5b60009182526020808320878452600b8252604080852033865290925290832060018101546003600790940290920192830154815493955090939261331292916123c79164e8d4a5100091610d5291906135d8565b905080156134ee5784801561332957506000600854115b80156133385750816002015442105b1561337f57600061335a6103e8610d52600854856135d890919063ffffffff16565b905061336682826134f6565b60048501549092506133789082613727565b6004850155505b600254604080516024810184905260ff871660448083019190915282518083039091018152606490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f61e5b72200000000000000000000000000000000000000000000000000000000178152915181516000946001600160a01b03169382918083835b6020831061344757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161340a565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d80600081146134a7576040519150601f19603f3d011682016040523d82523d6000602084013e6134ac565b606091505b50509050806134ec5760405162461bcd60e51b815260040180806020018281038252603d815260200180613b09603d913960400191505060405180910390fd5b505b505050505050565b60008282111561354d576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526135d3908490613785565b505050565b6000826135e7575060006109ee565b828202828482816135f457fe5b04146136315760405162461bcd60e51b8152600401808060200182810382526021815260200180613ab26021913960400191505060405180910390fd5b9392505050565b600080821161368e576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161369757fe5b049392505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052612229908590613785565b600082820183811015613631576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b3390565b60006137da826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166138369092919063ffffffff16565b8051909150156135d3578080602001905160208110156137f957600080fd5b50516135d35760405162461bcd60e51b815260040180806020018281038252602a815260200180613b46602a913960400191505060405180910390fd5b6060613845848460008561384d565b949350505050565b60608247101561388e5760405162461bcd60e51b8152600401808060200182810382526026815260200180613a8c6026913960400191505060405180910390fd5b613897856139bb565b6138e8576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b6020831061394457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101613907565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146139a6576040519150601f19603f3d011682016040523d82523d6000602084013e6139ab565b606091505b50915091506123cd8282866139c1565b3b151590565b606083156139d0575081613631565b8251156139e05782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613a2a578181015183820152602001613a12565b50505050905090810190601f168015613a575780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7768616e646c65447261696e6564574554482875696e7432353620616d6f756e74292064656c656761746563616c6c206661696c65642e68616e646c65436c61696d2875696e743235362070656e64696e672c2075696e743820666c6167292064656c656761746563616c6c206661696c65642e5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220898fbe9779ae00318bf6f49027eb9db9921e73e71cb8d9bafb36f22a5a3ec48264736f6c63430007060033000000000000000000000000e4ce241d367b48c4c70719e0a634f1fd16b77b6e0000000000000000000000001c5d3785ac5a03be0505421fd36e38862635fd54000000000000000000000000c2a1b9d197e1e93dfd628876ee01fddbcd7b947b000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

Deployed Bytecode

0x6080604052600436106102535760003560e01c806389c70e7911610138578063d17f2a59116100b0578063ede2302e1161007f578063f5d82b6b11610064578063f5d82b6b14610814578063f6b19c741461084d578063feab1592146108775761025a565b8063ede2302e146107a2578063f2fde38b146107e15761025a565b8063d17f2a591461071b578063e0a9b09d14610745578063e10f8f061461075a578063e22fae061461076f5761025a565b80639b50172311610107578063a2468c19116100ec578063a2468c191461069a578063b6f525a7146106af578063cbb4e2e1146106e85761025a565b80639b50172314610642578063a081ddbd146106575761025a565b806389c70e791461058f5780638da5cb5b146105b957806392f2cff0146105ce57806393f1a40b146105e35761025a565b8063431de007116101cb578063592e7def1161019a57806368cdd86e1161017f57806368cdd86e14610532578063715018a614610547578063850337621461055c5761025a565b8063592e7def14610508578063630b5ba11461051d5761025a565b8063431de0071461045757806351eb05a61461048a5780635312ea8e146104b4578063577fbd5f146104de5761025a565b806317f0088d116102225780632faf3ea6116102075780632faf3ea6146103c957806333fc552e146103fc5780633ad10ef6146104265761025a565b806317f0088d1461035757806319ba83a5146103905761025a565b8063017e29b41461025f5780630661cefb1461028b578063081e3eda146102d65780631526fe27146102eb5761025a565b3661025a57005b600080fd5b34801561026b57600080fd5b506102896004803603602081101561028257600080fd5b50356108aa565b005b34801561029757600080fd5b506102c4600480360360408110156102ae57600080fd5b50803590602001356001600160a01b031661090e565b60408051918252519081900360200190f35b3480156102e257600080fd5b506102c46109f4565b3480156102f757600080fd5b506103156004803603602081101561030e57600080fd5b50356109fa565b604080516001600160a01b0390981688526020880196909652868601949094526060860192909252608085015260a084015260c0830152519081900360e00190f35b34801561036357600080fd5b506102896004803603606081101561037a57600080fd5b508035906020810135906040013560ff16610a53565b34801561039c57600080fd5b50610289600480360360608110156103b357600080fd5b508035906020810135906040013560ff166110f0565b3480156103d557600080fd5b50610289600480360360408110156103ec57600080fd5b508035906020013560ff16611685565b34801561040857600080fd5b506102c46004803603602081101561041f57600080fd5b5035611885565b34801561043257600080fd5b5061043b6118b0565b604080516001600160a01b039092168252519081900360200190f35b34801561046357600080fd5b506102896004803603602081101561047a57600080fd5b50356001600160a01b03166118bf565b34801561049657600080fd5b50610289600480360360208110156104ad57600080fd5b503561196d565b3480156104c057600080fd5b50610289600480360360208110156104d757600080fd5b5035611aea565b3480156104ea57600080fd5b506102896004803603602081101561050157600080fd5b5035611d13565b34801561051457600080fd5b5061043b611d77565b34801561052957600080fd5b50610289611d86565b34801561053e57600080fd5b5061043b611da9565b34801561055357600080fd5b50610289611db8565b34801561056857600080fd5b506102896004803603602081101561057f57600080fd5b50356001600160a01b0316611e8e565b34801561059b57600080fd5b506102c4600480360360208110156105b257600080fd5b5035611f27565b3480156105c557600080fd5b5061043b612002565b3480156105da57600080fd5b5061043b612011565b3480156105ef57600080fd5b5061061c6004803603604081101561060657600080fd5b50803590602001356001600160a01b0316612020565b604080519485526020850193909352838301919091526060830152519081900360800190f35b34801561064e57600080fd5b506102c4612052565b34801561066357600080fd5b506102896004803603606081101561067a57600080fd5b506001600160a01b03813581169160208101359160409091013516612058565b3480156106a657600080fd5b506102c461222f565b3480156106bb57600080fd5b506102c4600480360360408110156106d257600080fd5b50803590602001356001600160a01b0316612235565b3480156106f457600080fd5b506102896004803603602081101561070b57600080fd5b50356001600160a01b03166123d8565b34801561072757600080fd5b506102896004803603602081101561073e57600080fd5b5035612486565b34801561075157600080fd5b5061043b6124ff565b34801561076657600080fd5b506102c461250e565b34801561077b57600080fd5b506102896004803603602081101561079257600080fd5b50356001600160a01b0316612514565b3480156107ae57600080fd5b50610289600480360360608110156107c557600080fd5b508035906001600160a01b0360208201351690604001356125c2565b3480156107ed57600080fd5b506102896004803603602081101561080457600080fd5b50356001600160a01b03166126a1565b34801561082057600080fd5b506102896004803603604081101561083757600080fd5b506001600160a01b0381351690602001356127cd565b34801561085957600080fd5b506102896004803603602081101561087057600080fd5b50356129cd565b34801561088357600080fd5b506102896004803603602081101561089a57600080fd5b50356001600160a01b031661309c565b6005546001600160a01b03163314610909576040805162461bcd60e51b815260206004820152601260248201527f6e6f742072657761726420757064617465720000000000000000000000000000604482015290519081900360640190fd5b600855565b60008061091b8484612235565b600254604080517f9d3f50390000000000000000000000000000000000000000000000000000000081526004810184905290519293506000926001600160a01b0390921691639d3f50399160248082019260209290919082900301818787803b15801561098757600080fd5b505af115801561099b573d6000803e3d6000fd5b505050506040513d60208110156109b157600080fd5b50516040805182815290519192507fb37961da3972b7b5f62cae2d8c10d43840dbe99529a868d75b318ad6f2c09c0e919081900360200190a19150505b92915050565b600a5490565b600a8181548110610a0a57600080fd5b600091825260209091206007909102018054600182015460028301546003840154600485015460058601546006909601546001600160a01b039095169650929491939092919087565b60026001541415610aab576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600190815581908116610d9b576000600a8581548110610ac957fe5b60009182526020808320888452600b825260408085203386529092529220805460079092029092019250851115610b47576040805162461bcd60e51b815260206004820152601260248201527f77697468647261773a206e6f7420676f6f640000000000000000000000000000604482015290519081900360640190fd5b610b508661196d565b610b5c866001866132af565b8415610d37578054610b6e90866134f6565b815581546001830154604080517fa2c16fe70000000000000000000000000000000000000000000000000000000081526001600160a01b0390931660048401526024830191909152604482018790525160009173c22c12d1a327c1bfe5782bca429a3f7828bc068a9163a2c16fe791606480820192602092909190829003018186803b158015610bfd57600080fd5b505af4158015610c11573d6000803e3d6000fd5b505050506040513d6020811015610c2757600080fd5b505190508015610c6e576005830154610c4090826134f6565b60058401556006830154610c5490876134f6565b60068401556003820154610c6890826134f6565b60038301555b82546001840154604080517f9f7433410000000000000000000000000000000000000000000000000000000081526001600160a01b039093166004840152602483019190915251610d35913391899173c22c12d1a327c1bfe5782bca429a3f7828bc068a91639f74334191604480820192602092909190829003018186803b158015610cf957600080fd5b505af4158015610d0d573d6000803e3d6000fd5b505050506040513d6020811015610d2357600080fd5b50516001600160a01b03169190613553565b505b60038201548154610d589164e8d4a5100091610d52916135d8565b90613638565b6001820155604080518681529051879133917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a350506110e6565b60005a90506000600a8681548110610daf57fe5b60009182526020808320898452600b825260408085203386529092529220805460079092029092019250861115610e2d576040805162461bcd60e51b815260206004820152601260248201527f77697468647261773a206e6f7420676f6f640000000000000000000000000000604482015290519081900360640190fd5b610e368761196d565b610e42876001876132af565b8515610fe1578054610e5490876134f6565b815581546001830154604080517fa2c16fe70000000000000000000000000000000000000000000000000000000081526001600160a01b0390931660048401526024830191909152604482018890525160009173c22c12d1a327c1bfe5782bca429a3f7828bc068a9163a2c16fe791606480820192602092909190829003018186803b158015610ee357600080fd5b505af4158015610ef7573d6000803e3d6000fd5b505050506040513d6020811015610f0d57600080fd5b505190508015610f54576005830154610f2690826134f6565b60058401556006830154610f3a90886134f6565b60068401556003820154610f4e90826134f6565b60038301555b82546001840154604080517f9f7433410000000000000000000000000000000000000000000000000000000081526001600160a01b039093166004840152602483019190915251610fdf9133918a9173c22c12d1a327c1bfe5782bca429a3f7828bc068a91639f74334191604480820192602092909190829003018186803b158015610cf957600080fd5b505b60038201548154610ffc9164e8d4a5100091610d52916135d8565b6001820155604080518781529051889133917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a35060009050601036025a830301615208810191506d4946c0e9f43f4dee607b0ef1fa1c90819063079d229f90339061a3db90618952015b046040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156110b657600080fd5b505af11580156110ca573d6000803e3d6000fd5b505050506040513d60208110156110e057600080fd5b50505050505b5050600180555050565b60026001541415611148576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001908155819081166113f0576000600a858154811061116657fe5b60009182526020808320888452600b8252604080852033865290925292206201518042016002820155600790910290910191506111a28661196d565b8054156111b5576111b5866000866132af565b84156113925781546001830154604080517f9f7433410000000000000000000000000000000000000000000000000000000081526001600160a01b0390931660048401526024830191909152516112849133913091899173c22c12d1a327c1bfe5782bca429a3f7828bc068a91639f743341916044808301926020929190829003018186803b15801561124757600080fd5b505af415801561125b573d6000803e3d6000fd5b505050506040513d602081101561127157600080fd5b50516001600160a01b031692919061369f565b81546001830154604080517ff8c35b370000000000000000000000000000000000000000000000000000000081526001600160a01b0390931660048401526024830191909152604482018790525160009173c22c12d1a327c1bfe5782bca429a3f7828bc068a9163f8c35b3791606480820192602092909190829003018186803b15801561131157600080fd5b505af4158015611325573d6000803e3d6000fd5b505050506040513d602081101561133b57600080fd5b5051905080156113825760058301546113549082613727565b600584015560068301546113689087613727565b6006840155600382015461137c9082613727565b60038301555b815461138e9087613727565b8255505b600382015481546113ad9164e8d4a5100091610d52916135d8565b6001820155604080518681529051879133917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a350506110e6565b60005a90506000600a868154811061140457fe5b60009182526020808320898452600b8252604080852033865290925292206201518042016002820155600790910290910191506114408761196d565b80541561145357611453876000876132af565b85156115f35781546001830154604080517f9f7433410000000000000000000000000000000000000000000000000000000081526001600160a01b0390931660048401526024830191909152516114e591339130918a9173c22c12d1a327c1bfe5782bca429a3f7828bc068a91639f743341916044808301926020929190829003018186803b15801561124757600080fd5b81546001830154604080517ff8c35b370000000000000000000000000000000000000000000000000000000081526001600160a01b0390931660048401526024830191909152604482018890525160009173c22c12d1a327c1bfe5782bca429a3f7828bc068a9163f8c35b3791606480820192602092909190829003018186803b15801561157257600080fd5b505af4158015611586573d6000803e3d6000fd5b505050506040513d602081101561159c57600080fd5b5051905080156115e35760058301546115b59082613727565b600584015560068301546115c99088613727565b600684015560038201546115dd9082613727565b60038301555b81546115ef9088613727565b8255505b6003820154815461160e9164e8d4a5100091610d52916135d8565b6001820155604080518781529051889133917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a35060009050601036025a830301615208810191506d4946c0e9f43f4dee607b0ef1fa1c90819063079d229f90339061a3db906189520161106f565b600260015414156116dd576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260019081558190811661175f576000600a84815481106116fb57fe5b60009182526020808320878452600b8252604080852033865290925292206007909102909101915061172c8561196d565b611738856000866132af565b600382015481546117539164e8d4a5100091610d52916135d8565b6001909101555061187c565b60005a90506000600a858154811061177357fe5b60009182526020808320888452600b825260408085203386529092529220600790910290910191506117a48661196d565b6117b0866000876132af565b600382015481546117cb9164e8d4a5100091610d52916135d8565b600190910155506000601036025a830301615208810191506d4946c0e9f43f4dee607b0ef1fa1c90819063079d229f90339061a3db9061895201046040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561184c57600080fd5b505af1158015611860573d6000803e3d6000fd5b505050506040513d602081101561187657600080fd5b50505050505b50506001805550565b600080600a838154811061189557fe5b60009182526020909120600460079092020101549392505050565b6006546001600160a01b031681565b6118c7613781565b6001600160a01b03166118d8612002565b6001600160a01b031614611933576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600480547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6000600a828154811061197c57fe5b906000526020600020906007020190508060020154431161199d5750611ae7565b80546001820154604080517f1e95069c0000000000000000000000000000000000000000000000000000000081526001600160a01b03909316600484015260248301919091525160009173c22c12d1a327c1bfe5782bca429a3f7828bc068a91631e95069c91604480820192602092909190829003018186803b158015611a2357600080fd5b505af4158015611a37573d6000803e3d6000fd5b505050506040513d6020811015611a4d57600080fd5b5051905080611a63575043600290910155611ae7565b6000611a7c8360020154436134f690919063ffffffff16565b90506000611a9d600754610d528660040154856135d890919063ffffffff16565b9050611ac0611ab584610d528464e8d4a510006135d8565b600386015490613727565b60038501554360028501556004840154611ada90826134f6565b8460040181905550505050505b50565b60026001541415611b42576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001819055506000600a8281548110611b5957fe5b60009182526020808320858452600b8252604080852033865283529384902060079093020180546001820154845486517fa2c16fe70000000000000000000000000000000000000000000000000000000081526001600160a01b03939093166004840152602483019190915260448201529351909450919273c22c12d1a327c1bfe5782bca429a3f7828bc068a9263a2c16fe792606480840193919291829003018186803b158015611c0a57600080fd5b505af4158015611c1e573d6000803e3d6000fd5b505050506040513d6020811015611c3457600080fd5b5050805482546001840154604080517f9f7433410000000000000000000000000000000000000000000000000000000081526001600160a01b039093166004840152602483019190915251611cc2923392909173c22c12d1a327c1bfe5782bca429a3f7828bc068a91639f743341916044808301926020929190829003018186803b158015610cf957600080fd5b80546040805191825251849133917fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959181900360200190a36000808255600180830182905560039092015580555050565b6005546001600160a01b03163314611d72576040805162461bcd60e51b815260206004820152601260248201527f6e6f742072657761726420757064617465720000000000000000000000000000604482015290519081900360640190fd5b600755565b6002546001600160a01b031681565b600a5460005b81811015611da557611d9d8161196d565b600101611d8c565b5050565b6005546001600160a01b031681565b611dc0613781565b6001600160a01b0316611dd1612002565b6001600160a01b031614611e2c576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b6006546001600160a01b03163314611eed576040805162461bcd60e51b815260206004820152600760248201527f6e6f742064657600000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600680547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b600080600a8381548110611f3757fe5b600091825260209182902060079091020180546001820154604080517f3d0dfc3b0000000000000000000000000000000000000000000000000000000081526001600160a01b0390931660048401526024830188905260448301919091525191935073c22c12d1a327c1bfe5782bca429a3f7828bc068a92633d0dfc3b92606480840193829003018186803b158015611fcf57600080fd5b505af4158015611fe3573d6000803e3d6000fd5b505050506040513d6020811015611ff957600080fd5b50519392505050565b6000546001600160a01b031690565b6004546001600160a01b031681565b600b60209081526000928352604080842090915290825290208054600182015460028301546003909301549192909184565b60075481565b612060613781565b6001600160a01b0316612071612002565b6001600160a01b0316146120cc576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600a5460005b81811015612214576000600a82815481106120e957fe5b60009182526020808320600790920290910180546001820154604080517f9f7433410000000000000000000000000000000000000000000000000000000081526001600160a01b03909316600484015260248301919091525191945073c22c12d1a327c1bfe5782bca429a3f7828bc068a92639f74334192604480840193829003018186803b15801561217b57600080fd5b505af415801561218f573d6000803e3d6000fd5b505050506040513d60208110156121a557600080fd5b505190506001600160a01b03878116908216141561220a576040805162461bcd60e51b815260206004820152600d60248201527f21706f6f6c2e6c70546f6b656e00000000000000000000000000000000000000604482015290519081900360640190fd5b50506001016120d2565b506122296001600160a01b0385168385613553565b50505050565b60085481565b600080600a848154811061224557fe5b60009182526020808320878452600b825260408085206001600160a01b03808a16875290845281862060036007909602909301948501548554600187015484517f1e95069c0000000000000000000000000000000000000000000000000000000081529190931660048201526024810192909252915194965091949093909273c22c12d1a327c1bfe5782bca429a3f7828bc068a92631e95069c9260448083019392829003018186803b1580156122fb57600080fd5b505af415801561230f573d6000803e3d6000fd5b505050506040513d602081101561232557600080fd5b505160028501549091504311801561233c57508015155b1561239f57600061235a8560020154436134f690919063ffffffff16565b9050600061237b600754610d528860040154856135d890919063ffffffff16565b905061239a61239384610d528464e8d4a510006135d8565b8590613727565b935050505b6123cd83600101546123c764e8d4a51000610d528688600001546135d890919063ffffffff16565b906134f6565b979650505050505050565b6123e0613781565b6001600160a01b03166123f1612002565b6001600160a01b03161461244c576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b61248e613781565b6001600160a01b031661249f612002565b6001600160a01b0316146124fa576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600955565b6003546001600160a01b031681565b60095481565b61251c613781565b6001600160a01b031661252d612002565b6001600160a01b031614612588576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600580547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6125ca613781565b6001600160a01b03166125db612002565b6001600160a01b031614612636576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b81600a848154811061264457fe5b906000526020600020906007020160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080600a848154811061268757fe5b906000526020600020906007020160010181905550505050565b6126a9613781565b6001600160a01b03166126ba612002565b6001600160a01b031614612715576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811661275a5760405162461bcd60e51b8152600401808060200182810382526026815260200180613a666026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6127d5613781565b6001600160a01b03166127e6612002565b6001600160a01b031614612841576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6040805160e0810182526001600160a01b03938416815260208101928352439181019182526000606082018181526080830182815260a0840183815260c08501848152600a8054600181018255955294517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8600790950294850180547fffffffffffffffffffffffff000000000000000000000000000000000000000016919099161790975594517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a983015592517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2aa82015591517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2ab83015591517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2ac82015591517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2ad830155517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2ae90910155565b6003546001600160a01b03163314612a2c576040805162461bcd60e51b815260206004820152600d60248201527f6e6f7420647261696e6374726c00000000000000000000000000000000000000604482015290519081900360640190fd5b6000600a8281548110612a3b57fe5b60009182526020822060079091020180546001820154604080517f53d6afd40000000000000000000000000000000000000000000000000000000081526001600160a01b03909316600484018190526024840188905260448401839052905193955093909273c22c12d1a327c1bfe5782bca429a3f7828bc068a926353d6afd4926064808301939192829003018186803b158015612ad857600080fd5b505af4158015612aec573d6000803e3d6000fd5b5050604080517fb50c4fb60000000000000000000000000000000000000000000000000000000081526001600160a01b03861660048201526024810188905290516000935073c22c12d1a327c1bfe5782bca429a3f7828bc068a925063b50c4fb691604480820192602092909190829003018186803b158015612b6e57600080fd5b505af4158015612b82573d6000803e3d6000fd5b505050506040513d6020811015612b9857600080fd5b5051604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290519192506000916001600160a01b038416916370a08231916024808301926020929190829003018186803b158015612bff57600080fd5b505afa158015612c13573d6000803e3d6000fd5b505050506040513d6020811015612c2957600080fd5b5051905080612c3c575050505050611ae7565b604080517ff35294550000000000000000000000000000000000000000000000000000000081526001600160a01b03861660048201526024810188905260448101839052306064820152905160009173c22c12d1a327c1bfe5782bca429a3f7828bc068a9163f352945591608480820192602092909190829003018186803b158015612cc757600080fd5b505af4158015612cdb573d6000803e3d6000fd5b505050506040513d6020811015612cf157600080fd5b5051600954909150600090612d0f906103e890610d529085906135d8565b90508015612de25760048054604080517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b039283169381019390935260248301849052517f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc29091169163a9059cbb9160448083019260209291908290030181600087803b158015612da857600080fd5b505af1158015612dbc573d6000803e3d6000fd5b505050506040513d6020811015612dd257600080fd5b50612ddf905082826134f6565b91505b600254604080517fe3d670d700000000000000000000000000000000000000000000000000000000815230600482015290516000926001600160a01b03169163e3d670d7916024808301926020929190829003018186803b158015612e4657600080fd5b505afa158015612e5a573d6000803e3d6000fd5b505050506040513d6020811015612e7057600080fd5b505160025460408051602480820188905282518083039091018152604490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f104f823c00000000000000000000000000000000000000000000000000000000178152915181519495506000946001600160a01b0390941693919290918291908083835b60208310612f3857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101612efb565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114612f98576040519150601f19603f3d011682016040523d82523d6000602084013e612f9d565b606091505b5050905080612fdd5760405162461bcd60e51b8152600401808060200182810382526036815260200180613ad36036913960400191505060405180910390fd5b600254604080517fe3d670d700000000000000000000000000000000000000000000000000000000815230600482015290516000926001600160a01b03169163e3d670d7916024808301926020929190829003018186803b15801561304157600080fd5b505afa158015613055573d6000803e3d6000fd5b505050506040513d602081101561306b57600080fd5b5051905061308761307c82856134f6565b60048c015490613727565b8a600401819055505050505050505050505050565b6130a4613781565b6001600160a01b03166130b5612002565b6001600160a01b031614613110576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600280546001600160a01b038084167fffffffffffffffffffffffff0000000000000000000000000000000000000000909216919091179182905560408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f8fd3ab80000000000000000000000000000000000000000000000000000000001781529151815160009590941693919290918291908083835b602083106131f457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016131b7565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114613254576040519150601f19603f3d011682016040523d82523d6000602084013e613259565b606091505b5050905080611da5576040805162461bcd60e51b815260206004820152601e60248201527f6d69677261746528292064656c656761746563616c6c206661696c65642e0000604482015290519081900360640190fd5b6000600a84815481106132be57fe5b60009182526020808320878452600b8252604080852033865290925290832060018101546003600790940290920192830154815493955090939261331292916123c79164e8d4a5100091610d5291906135d8565b905080156134ee5784801561332957506000600854115b80156133385750816002015442105b1561337f57600061335a6103e8610d52600854856135d890919063ffffffff16565b905061336682826134f6565b60048501549092506133789082613727565b6004850155505b600254604080516024810184905260ff871660448083019190915282518083039091018152606490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f61e5b72200000000000000000000000000000000000000000000000000000000178152915181516000946001600160a01b03169382918083835b6020831061344757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161340a565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d80600081146134a7576040519150601f19603f3d011682016040523d82523d6000602084013e6134ac565b606091505b50509050806134ec5760405162461bcd60e51b815260040180806020018281038252603d815260200180613b09603d913960400191505060405180910390fd5b505b505050505050565b60008282111561354d576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526135d3908490613785565b505050565b6000826135e7575060006109ee565b828202828482816135f457fe5b04146136315760405162461bcd60e51b8152600401808060200182810382526021815260200180613ab26021913960400191505060405180910390fd5b9392505050565b600080821161368e576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161369757fe5b049392505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052612229908590613785565b600082820183811015613631576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b3390565b60006137da826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166138369092919063ffffffff16565b8051909150156135d3578080602001905160208110156137f957600080fd5b50516135d35760405162461bcd60e51b815260040180806020018281038252602a815260200180613b46602a913960400191505060405180910390fd5b6060613845848460008561384d565b949350505050565b60608247101561388e5760405162461bcd60e51b8152600401808060200182810382526026815260200180613a8c6026913960400191505060405180910390fd5b613897856139bb565b6138e8576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b6020831061394457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101613907565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146139a6576040519150601f19603f3d011682016040523d82523d6000602084013e6139ab565b606091505b50915091506123cd8282866139c1565b3b151590565b606083156139d0575081613631565b8251156139e05782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613a2a578181015183820152602001613a12565b50505050905090810190601f168015613a575780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7768616e646c65447261696e6564574554482875696e7432353620616d6f756e74292064656c656761746563616c6c206661696c65642e68616e646c65436c61696d2875696e743235362070656e64696e672c2075696e743820666c6167292064656c656761746563616c6c206661696c65642e5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220898fbe9779ae00318bf6f49027eb9db9921e73e71cb8d9bafb36f22a5a3ec48264736f6c63430007060033

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

000000000000000000000000e4ce241d367b48c4c70719e0a634f1fd16b77b6e0000000000000000000000001c5d3785ac5a03be0505421fd36e38862635fd54000000000000000000000000c2a1b9d197e1e93dfd628876ee01fddbcd7b947b000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

-----Decoded View---------------
Arg [0] : _drainAddress (address): 0xE4CE241D367b48c4C70719E0A634F1fD16b77b6E
Arg [1] : _drainController (address): 0x1C5D3785Ac5A03be0505421fD36E38862635FD54
Arg [2] : _IBVETH (address): 0xc2a1B9D197e1e93DFd628876eE01fDDBcD7b947b
Arg [3] : _weth (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000e4ce241d367b48c4c70719e0a634f1fd16b77b6e
Arg [1] : 0000000000000000000000001c5d3785ac5a03be0505421fd36e38862635fd54
Arg [2] : 000000000000000000000000c2a1b9d197e1e93dfd628876ee01fddbcd7b947b
Arg [3] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2


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
[ Download: CSV Export  ]
[ 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.