ETH Price: $2,744.04 (+1.25%)
Gas: 0.77 Gwei

Contract

0x7B1E1A841afE589F1b5337a2Eec41A18a58475Be
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer Fees127682992021-07-05 15:29:171326 days ago1625498957IN
0x7B1E1A84...8a58475Be
0 ETH0.0029283511
Setup124340422021-05-14 18:04:401378 days ago1621015480IN
0x7B1E1A84...8a58475Be
0 ETH0.02424991135

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CreamProvider

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 9999 runs

Other Settings:
default evmVersion
File 1 of 13 : CreamProvider.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.7.6;
pragma abicoder v2;

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

import "./../lib/math/MathUtils.sol";

import "./../external-interfaces/cream-finance/ICrCToken.sol";
import "./../external-interfaces/cream-finance/ICrComptroller.sol";

import "./../IController.sol";
import "./../IProvider.sol";

import "./ICreamCumulator.sol";

contract CreamProvider is IProvider {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    uint256 public constant MAX_UINT256 = uint256(-1);
    uint256 public constant EXP_SCALE = 1e18;

    address public override smartYield;

    address public override controller;

    // fees colected in underlying
    uint256 public override underlyingFees;

    // underlying token (ie. DAI)
    address public uToken; // IERC20

    // claim token (ie. cDAI)
    address public cToken;

    // cToken.balanceOf(this) measuring only deposits by users (excludes direct cToken transfers to pool)
    uint256 public cTokenBalance;

    uint256 public exchangeRateCurrentCached;
    uint256 public exchangeRateCurrentCachedAt;

    bool public _setup;

    event TransferFees(address indexed caller, address indexed feesOwner, uint256 fees);

    modifier onlySmartYield {
      require(
        msg.sender == smartYield,
        "CrP: only smartYield"
      );
      _;
    }

    modifier onlyController {
      require(
        msg.sender == controller,
        "CrP: only controller"
      );
      _;
    }

    modifier onlySmartYieldOrController {
      require(
        msg.sender == smartYield || msg.sender == controller,
        "CrP: only smartYield/controller"
      );
      _;
    }

    modifier onlyControllerOrDao {
      require(
        msg.sender == controller || msg.sender == IController(controller).dao(),
        "CrP: only controller/DAO"
      );
      _;
    }

    constructor(address cToken_)
    {
        cToken = cToken_;
        uToken = ICrCToken(cToken_).underlying();
    }

    function setup(
        address smartYield_,
        address controller_
    )
      external
    {
        require(
          false == _setup,
          "CrP: already setup"
        );

        smartYield = smartYield_;
        controller = controller_;

        _enterMarket();

        _setup = true;
    }

    function setController(address newController_)
      external override
      onlyControllerOrDao
    {
      controller = newController_;
    }

  // externals

    // take underlyingAmount_ from from_
    function _takeUnderlying(address from_, uint256 underlyingAmount_)
      external override
      onlySmartYieldOrController
    {
        uint256 balanceBefore = IERC20(uToken).balanceOf(address(this));
        IERC20(uToken).safeTransferFrom(from_, address(this), underlyingAmount_);
        uint256 balanceAfter = IERC20(uToken).balanceOf(address(this));
        require(
          0 == (balanceAfter - balanceBefore - underlyingAmount_),
          "CrP: _takeUnderlying amount"
        );
    }

    // transfer away underlyingAmount_ to to_
    function _sendUnderlying(address to_, uint256 underlyingAmount_)
      external override
      onlySmartYield
    {
        uint256 balanceBefore = IERC20(uToken).balanceOf(to_);
        IERC20(uToken).safeTransfer(to_, underlyingAmount_);
        uint256 balanceAfter = IERC20(uToken).balanceOf(to_);
        require(
          0 == (balanceAfter - balanceBefore - underlyingAmount_),
          "CrP: _sendUnderlying amount"
        );
    }

    // deposit underlyingAmount_ with the liquidity provider, callable by smartYield or controller
    function _depositProvider(uint256 underlyingAmount_, uint256 takeFees_)
      external override
      onlySmartYieldOrController
    {
        _depositProviderInternal(underlyingAmount_, takeFees_);
    }

    // deposit underlyingAmount_ with the liquidity provider, store resulting cToken balance in cTokenBalance
    function _depositProviderInternal(uint256 underlyingAmount_, uint256 takeFees_)
      internal
    {
        // underlyingFees += takeFees_
        underlyingFees = underlyingFees.add(takeFees_);

        ICreamCumulator(controller)._beforeCTokenBalanceChange();
        IERC20(uToken).safeApprove(address(cToken), underlyingAmount_);
        uint256 err = ICrCToken(cToken).mint(underlyingAmount_);
        require(0 == err, "CrP: _depositProvider mint");
        ICreamCumulator(controller)._afterCTokenBalanceChange(cTokenBalance);

        // cTokenBalance is used to compute the pool yield, make sure no one interferes with the computations between deposits/withdrawls
        cTokenBalance = IERC20(cToken).balanceOf(address(this));
    }

    // withdraw underlyingAmount_ from the liquidity provider, callable by smartYield
    function _withdrawProvider(uint256 underlyingAmount_, uint256 takeFees_)
      external override
      onlySmartYield
    {
      _withdrawProviderInternal(underlyingAmount_, takeFees_);
    }

    // withdraw underlyingAmount_ from the liquidity provider, store resulting cToken balance in cTokenBalance
    function _withdrawProviderInternal(uint256 underlyingAmount_, uint256 takeFees_)
      internal
    {
        // underlyingFees += takeFees_;
        underlyingFees = underlyingFees.add(takeFees_);

        ICreamCumulator(controller)._beforeCTokenBalanceChange();
        uint256 err = ICrCToken(cToken).redeemUnderlying(underlyingAmount_);
        require(0 == err, "CrP: _withdrawProvider redeemUnderlying");
        ICreamCumulator(controller)._afterCTokenBalanceChange(cTokenBalance);

        // cTokenBalance is used to compute the pool yield, make sure no one interferes with the computations between deposits/withdrawls
        cTokenBalance = IERC20(cToken).balanceOf(address(this));
    }

    // claims rewards we have accumulated and sends them to "to" address
    // only callable by controller
    function claimRewardsTo(uint256 amount, address to)
      external
      onlyController
      returns (uint256)
    {
      address[] memory holders = new address[](1);
      holders[0] = address(this);

      address[] memory cTokens = new address[](1);
      cTokens[0] = cToken;

      ICrComptroller comptroller = ICrComptroller(ICrCToken(cToken).comptroller());
      IERC20 Comp = IERC20(comptroller.getCompAddress());

      comptroller.claimComp(
        holders,
        cTokens,
        false,
        true
      );

      amount = MathUtils.min(amount, Comp.balanceOf(address(this)));

      Comp.safeTransfer(to, amount);

      return amount;
    }

    function transferFees()
      external
      override
    {
      _withdrawProviderInternal(underlyingFees, 0);
      underlyingFees = 0;

      uint256 fees = IERC20(uToken).balanceOf(address(this));
      address to = IController(controller).feesOwner();

      IERC20(uToken).safeTransfer(to, fees);

      emit TransferFees(msg.sender, to, fees);
    }

    // current total underlying balance, as measured by pool, without fees
    function underlyingBalance()
      external virtual override
    returns (uint256)
    {
        // https://compound.finance/docs#protocol-math
        // (total balance in underlying) - underlyingFees
        // cTokenBalance * exchangeRateCurrent() / EXP_SCALE - underlyingFees;
        return cTokenBalance.mul(exchangeRateCurrent()).div(EXP_SCALE).sub(underlyingFees);
    }
  // /externals

  // public
    // get exchangeRateCurrent from cream and cache it for the current block
    function exchangeRateCurrent()
      public virtual
    returns (uint256)
    {
      // only once per block
      if (block.timestamp > exchangeRateCurrentCachedAt) {
        exchangeRateCurrentCachedAt = block.timestamp;
        exchangeRateCurrentCached = ICrCToken(cToken).exchangeRateCurrent();
      }
      return exchangeRateCurrentCached;
    }
  // /public

  // internals

    // call comptroller.enterMarkets()
    // needs to be called only once BUT before any interactions with the provider
    function _enterMarket()
      internal
    {
        address[] memory markets = new address[](1);
        markets[0] = cToken;
        uint256[] memory err = ICrComptroller(ICrCToken(cToken).comptroller()).enterMarkets(markets);
        require(err[0] == 0, "CrP: _enterMarket");
    }

    // /internals

}

File 2 of 13 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.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 3 of 13 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

File 4 of 13 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.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 5 of 13 : MathUtils.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.7.6;

import "@openzeppelin/contracts/math/SafeMath.sol";

library MathUtils {

    using SafeMath for uint256;

    uint256 public constant EXP_SCALE = 1e18;

    function min(uint256 x, uint256 y) internal pure returns (uint256 z) {
        z = x < y ? x : y;
    }

    function max(uint256 x, uint256 y) internal pure returns (uint256 z) {
        z = x > y ? x : y;
    }

    function compound(
        // in wei
        uint256 principal,
        // rate is * EXP_SCALE
        uint256 ratePerPeriod,
        uint16 periods
    ) internal pure returns (uint256) {
      if (0 == ratePerPeriod) {
        return principal;
      }

      while (periods > 0) {
          // principal += principal * ratePerPeriod / EXP_SCALE;
          principal = principal.add(principal.mul(ratePerPeriod).div(EXP_SCALE));
          periods -= 1;
      }

      return principal;
    }

    function compound2(
      uint256 principal,
      uint256 ratePerPeriod,
      uint16 periods
    ) internal pure returns (uint256) {
      if (0 == ratePerPeriod) {
        return principal;
      }

      while (periods > 0) {
        if (periods % 2 == 1) {
          //principal += principal * ratePerPeriod / EXP_SCALE;
          principal = principal.add(principal.mul(ratePerPeriod).div(EXP_SCALE));
          periods -= 1;
        } else {
          //ratePerPeriod = ((2 * ratePerPeriod * EXP_SCALE) + (ratePerPeriod * ratePerPeriod)) / EXP_SCALE;
          ratePerPeriod = ((uint256(2).mul(ratePerPeriod).mul(EXP_SCALE)).add(ratePerPeriod.mul(ratePerPeriod))).div(EXP_SCALE);
          periods /= 2;
        }
      }

      return principal;
    }

    function linearGain(
      uint256 principal,
      uint256 ratePerPeriod,
      uint16 periods
    ) internal pure returns (uint256) {
      return principal.add(
        fractionOf(principal, ratePerPeriod.mul(periods))
      );
    }

    // computes a * f / EXP_SCALE
    function fractionOf(uint256 a, uint256 f) internal pure returns (uint256) {
      return a.mul(f).div(EXP_SCALE);
    }

}

File 6 of 13 : ICrCToken.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.7.6;

interface ICrCToken {
    function mint(uint mintAmount) external returns (uint256);
    function redeemUnderlying(uint redeemAmount) external returns (uint256);
    function accrueInterest() external returns (uint256);
    function exchangeRateStored() external view returns (uint256);
    function exchangeRateCurrent() external returns (uint256);
    function supplyRatePerBlock() external view returns (uint256);
    function totalBorrows() external view returns (uint256);
    function getCash() external view returns (uint256);
    function underlying() external view returns (address);
    function comptroller() external view returns (address);
}

File 7 of 13 : ICrComptroller.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.7.6;

interface ICrComptroller {
    struct CompMarketState {
        uint224 index;
        uint32 block;
    }

    function enterMarkets(address[] memory cTokens) external returns (uint256[] memory);
    function claimComp(address[] memory holders, address[] memory cTokens, bool borrowers, bool suppliers) external;
    function mintAllowed(address cToken, address minter, uint256 mintAmount) external returns (uint256);

    function getCompAddress() external view returns(address);
    function compSupplyState(address cToken) external view returns (uint224, uint32);
    function compSpeeds(address cToken) external view returns (uint256);
    function oracle() external view returns (address);
}

File 8 of 13 : IController.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.7.6;
pragma abicoder v2;

import "./Governed.sol";
import "./IProvider.sol";
import "./ISmartYield.sol";

abstract contract IController is Governed {

    uint256 public constant EXP_SCALE = 1e18;

    address public pool; // compound provider pool

    address public smartYield; // smartYield

    address public oracle; // IYieldOracle

    address public bondModel; // IBondModel

    address public feesOwner; // fees are sent here

    // max accepted cost of harvest when converting COMP -> underlying,
    // if harvest gets less than (COMP to underlying at spot price) - HARVEST_COST%, it will revert.
    // if it gets more, the difference goes to the harvest caller
    uint256 public HARVEST_COST = 40 * 1e15; // 4%

    // fee for buying jTokens
    uint256 public FEE_BUY_JUNIOR_TOKEN = 3 * 1e15; // 0.3%

    // fee for redeeming a sBond
    uint256 public FEE_REDEEM_SENIOR_BOND = 100 * 1e15; // 10%

    // max rate per day for sBonds
    uint256 public BOND_MAX_RATE_PER_DAY = 719065000000000; // APY 30% / year

    // max duration of a purchased sBond
    uint16 public BOND_LIFE_MAX = 90; // in days

    bool public PAUSED_BUY_JUNIOR_TOKEN = false;

    bool public PAUSED_BUY_SENIOR_BOND = false;

    function setHarvestCost(uint256 newValue_)
      public
      onlyDao
    {
        require(
          HARVEST_COST < EXP_SCALE,
          "IController: HARVEST_COST too large"
        );
        HARVEST_COST = newValue_;
    }

    function setBondMaxRatePerDay(uint256 newVal_)
      public
      onlyDao
    {
      BOND_MAX_RATE_PER_DAY = newVal_;
    }

    function setBondLifeMax(uint16 newVal_)
      public
      onlyDao
    {
      BOND_LIFE_MAX = newVal_;
    }

    function setFeeBuyJuniorToken(uint256 newVal_)
      public
      onlyDao
    {
      FEE_BUY_JUNIOR_TOKEN = newVal_;
    }

    function setFeeRedeemSeniorBond(uint256 newVal_)
      public
      onlyDao
    {
      FEE_REDEEM_SENIOR_BOND = newVal_;
    }

    function setPaused(bool buyJToken_, bool buySBond_)
      public
      onlyDaoOrGuardian
    {
      PAUSED_BUY_JUNIOR_TOKEN = buyJToken_;
      PAUSED_BUY_SENIOR_BOND = buySBond_;
    }

    function setOracle(address newVal_)
      public
      onlyDao
    {
      oracle = newVal_;
    }

    function setBondModel(address newVal_)
      public
      onlyDao
    {
      bondModel = newVal_;
    }

    function setFeesOwner(address newVal_)
      public
      onlyDao
    {
      feesOwner = newVal_;
    }

    function yieldControllTo(address newController_)
      public
      onlyDao
    {
      IProvider(pool).setController(newController_);
      ISmartYield(smartYield).setController(newController_);
    }

    function providerRatePerDay() external virtual returns (uint256);
}

File 9 of 13 : IProvider.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.7.6;
pragma abicoder v2;

interface IProvider {

    function smartYield() external view returns (address);

    function controller() external view returns (address);

    function underlyingFees() external view returns (uint256);

    // deposit underlyingAmount_ into provider, add takeFees_ to fees
    function _depositProvider(uint256 underlyingAmount_, uint256 takeFees_) external;

    // withdraw underlyingAmount_ from provider, add takeFees_ to fees
    function _withdrawProvider(uint256 underlyingAmount_, uint256 takeFees_) external;

    function _takeUnderlying(address from_, uint256 amount_) external;

    function _sendUnderlying(address to_, uint256 amount_) external;

    function transferFees() external;

    // current total underlying balance as measured by the provider pool, without fees
    function underlyingBalance() external returns (uint256);

    function setController(address newController_) external;
}

File 10 of 13 : ICreamCumulator.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.7.6;
pragma abicoder v2;

interface ICreamCumulator {
  function _beforeCTokenBalanceChange() external;

  function _afterCTokenBalanceChange(uint256 prevCTokenBalance_) external;
}

File 11 of 13 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

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

        uint256 size;
        // 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 12 of 13 : Governed.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.7.6;
pragma abicoder v2;

abstract contract Governed {

  address public dao;
  address public guardian;

  modifier onlyDao {
    require(
        dao == msg.sender,
        "GOV: not dao"
      );
    _;
  }

  modifier onlyDaoOrGuardian {
    require(
      msg.sender == dao || msg.sender == guardian,
      "GOV: not dao/guardian"
    );
    _;
  }

  constructor()
  {
    dao = msg.sender;
    guardian = msg.sender;
  }

  function setDao(address dao_)
    external
    onlyDao
  {
    dao = dao_;
  }

  function setGuardian(address guardian_)
    external
    onlyDao
  {
    guardian = guardian_;
  }

}

File 13 of 13 : ISmartYield.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.7.6;
pragma abicoder v2;

interface ISmartYield {

    // a senior BOND (metadata for NFT)
    struct SeniorBond {
        // amount seniors put in
        uint256 principal;
        // amount yielded at the end. total = principal + gain
        uint256 gain;
        // bond was issued at timestamp
        uint256 issuedAt;
        // bond matures at timestamp
        uint256 maturesAt;
        // was it liquidated yet
        bool liquidated;
    }

    // a junior BOND (metadata for NFT)
    struct JuniorBond {
        // amount of tokens (jTokens) junior put in
        uint256 tokens;
        // bond matures at timestamp
        uint256 maturesAt;
    }

    // a checkpoint for all JuniorBonds with same maturity date JuniorBond.maturesAt
    struct JuniorBondsAt {
        // sum of JuniorBond.tokens for JuniorBonds with the same JuniorBond.maturesAt
        uint256 tokens;
        // price at which JuniorBonds will be paid. Initially 0 -> unliquidated (price is in the future or not yet liquidated)
        uint256 price;
    }

    function controller() external view returns (address);

    function buyBond(uint256 principalAmount_, uint256 minGain_, uint256 deadline_, uint16 forDays_) external returns (uint256);

    function redeemBond(uint256 bondId_) external;

    function unaccountBonds(uint256[] memory bondIds_) external;

    function buyTokens(uint256 underlyingAmount_, uint256 minTokens_, uint256 deadline_) external;

    /**
     * sell all tokens instantly
     */
    function sellTokens(uint256 tokens_, uint256 minUnderlying_, uint256 deadline_) external;

    function buyJuniorBond(uint256 tokenAmount_, uint256 maxMaturesAt_, uint256 deadline_) external;

    function redeemJuniorBond(uint256 jBondId_) external;

    function liquidateJuniorBonds(uint256 upUntilTimestamp_) external;

    /**
     * token purchase price
     */
    function price() external returns (uint256);

    function abondPaid() external view returns (uint256);

    function abondDebt() external view returns (uint256);

    function abondGain() external view returns (uint256);

    /**
     * @notice current total underlying balance, without accruing interest
     */
    function underlyingTotal() external returns (uint256);

    /**
     * @notice current underlying loanable, without accruing interest
     */
    function underlyingLoanable() external returns (uint256);

    function underlyingJuniors() external returns (uint256);

    function bondGain(uint256 principalAmount_, uint16 forDays_) external returns (uint256);

    function maxBondDailyRate() external returns (uint256);

    function setController(address newController_) external;
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 9999
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"cToken_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"feesOwner","type":"address"},{"indexed":false,"internalType":"uint256","name":"fees","type":"uint256"}],"name":"TransferFees","type":"event"},{"inputs":[],"name":"EXP_SCALE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_UINT256","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"underlyingAmount_","type":"uint256"},{"internalType":"uint256","name":"takeFees_","type":"uint256"}],"name":"_depositProvider","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"underlyingAmount_","type":"uint256"}],"name":"_sendUnderlying","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"_setup","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from_","type":"address"},{"internalType":"uint256","name":"underlyingAmount_","type":"uint256"}],"name":"_takeUnderlying","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"underlyingAmount_","type":"uint256"},{"internalType":"uint256","name":"takeFees_","type":"uint256"}],"name":"_withdrawProvider","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cTokenBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"claimRewardsTo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exchangeRateCurrent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"exchangeRateCurrentCached","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exchangeRateCurrentCachedAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newController_","type":"address"}],"name":"setController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"smartYield_","type":"address"},{"internalType":"address","name":"controller_","type":"address"}],"name":"setup","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"smartYield","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"transferFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"underlyingBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"underlyingFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b5060405162002169380380620021698339810160408190526200003491620000e8565b600480546001600160a01b0319166001600160a01b038316908117825560408051636f307dc360e01b815290519192636f307dc3928282019260209290829003018186803b1580156200008657600080fd5b505afa1580156200009b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000c19190620000e8565b600380546001600160a01b0319166001600160a01b03929092169190911790555062000118565b600060208284031215620000fa578081fd5b81516001600160a01b038116811462000111578182fd5b9392505050565b61204180620001286000396000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c80638023a1db116100d8578063bbbf2df41161008c578063ef9f5d2711610066578063ef9f5d2714610275578063f147a80e14610288578063f77c47911461029b57610177565b8063bbbf2df414610252578063bd6d894d14610265578063c2fbe7bc1461026d57610177565b8063a11b4f2a116100bd578063a11b4f2a1461022f578063afe3bd8f14610242578063bbba205d1461024a57610177565b80638023a1db1461021457806392eefe9b1461021c57610177565b80635e1cc7121161012f57806369e527da1161011457806369e527da146101ef578063788c8f0a146101f75780637b3ee7fc146101ff57610177565b80635e1cc712146101c757806363315637146101da57610177565b80633cf6276b116101605780633cf6276b146101af57806359356c5c146101b75780635c20096d146101bf57610177565b80632d34ba791461017c57806333a581d214610191575b600080fd5b61018f61018a366004611ad6565b6102a3565b005b61019961034e565b6040516101a69190611f43565b60405180910390f35b610199610372565b610199610378565b6101996103b1565b6101996101d5366004611bff565b6103b7565b6101e26106b3565b6040516101a69190611c87565b6101e26106c2565b6101e26106d1565b6102076106e0565b6040516101a69190611cec565b6101996106e9565b61018f61022a366004611a9e565b6106ef565b61018f61023d366004611b0e565b6107f4565b6101996109ae565b6101996109b4565b61018f610260366004611c23565b6109c0565b610199610a0d565b61018f610abd565b61018f610283366004611c23565b610c5d565b61018f610296366004611b0e565b610c91565b6101e2610e2f565b60085460ff16156102cf5760405162461bcd60e51b81526004016102c690611dd3565b60405180910390fd5b600080546001600160a01b038085167fffffffffffffffffffffffff000000000000000000000000000000000000000092831617909255600180549284169290911691909117905561031f610e3e565b5050600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81565b60075481565b60006103ac6002546103a6670de0b6b3a76400006103a0610397610a0d565b60055490610ff7565b90611057565b906110be565b905090565b60025481565b6001546000906001600160a01b031633146103e45760405162461bcd60e51b81526004016102c690611d65565b60408051600180825281830190925260009160208083019080368337019050509050308160008151811061041457fe5b6001600160a01b039290921660209283029190910190910152604080516001808252818301909252600091816020016020820280368337505060045482519293506001600160a01b03169183915060009061046b57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250506000600460009054906101000a90046001600160a01b03166001600160a01b0316635fe3b5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156104db57600080fd5b505afa1580156104ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105139190611aba565b90506000816001600160a01b0316639d1b5a0a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561055057600080fd5b505afa158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190611aba565b6040517f6810dfa60000000000000000000000000000000000000000000000000000000081529091506001600160a01b03831690636810dfa6906105d89087908790600090600190600401611cae565b600060405180830381600087803b1580156105f257600080fd5b505af1158015610606573d6000803e3d6000fd5b5050505061068f87826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161063a9190611c87565b60206040518083038186803b15801561065257600080fd5b505afa158015610666573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068a9190611be7565b61111b565b96506106a56001600160a01b0382168789611131565b869450505050505b92915050565b6003546001600160a01b031681565b6004546001600160a01b031681565b6000546001600160a01b031681565b60085460ff1681565b60065481565b6001546001600160a01b031633148061079e5750600160009054906101000a90046001600160a01b03166001600160a01b0316634162169f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561075157600080fd5b505afa158015610765573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107899190611aba565b6001600160a01b0316336001600160a01b0316145b6107ba5760405162461bcd60e51b81526004016102c690611e0a565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6000546001600160a01b031633148061081757506001546001600160a01b031633145b6108335760405162461bcd60e51b81526004016102c690611cf7565b6003546040517f70a082310000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906370a082319061087d903090600401611c87565b60206040518083038186803b15801561089557600080fd5b505afa1580156108a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108cd9190611be7565b6003549091506108e8906001600160a01b03168430856111b6565b6003546040517f70a082310000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906370a0823190610932903090600401611c87565b60206040518083038186803b15801561094a57600080fd5b505afa15801561095e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109829190611be7565b905082828203036000146109a85760405162461bcd60e51b81526004016102c690611d2e565b50505050565b60055481565b670de0b6b3a764000081565b6000546001600160a01b03163314806109e357506001546001600160a01b031633145b6109ff5760405162461bcd60e51b81526004016102c690611cf7565b610a09828261123e565b5050565b6000600754421115610ab6574260075560048054604080517fbd6d894d00000000000000000000000000000000000000000000000000000000815290516001600160a01b039092169263bd6d894d9282820192602092908290030181600087803b158015610a7a57600080fd5b505af1158015610a8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab29190611be7565b6006555b5060065490565b610aca60025460006114bb565b600060028190556003546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b03909116906370a0823190610b1a903090600401611c87565b60206040518083038186803b158015610b3257600080fd5b505afa158015610b46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6a9190611be7565b90506000600160009054906101000a90046001600160a01b03166001600160a01b031663f0eff6456040518163ffffffff1660e01b815260040160206040518083038186803b158015610bbc57600080fd5b505afa158015610bd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf49190611aba565b600354909150610c0e906001600160a01b03168284611131565b806001600160a01b0316336001600160a01b03167f9f87918b63a7c3c287a77288ad6cb96549e9af160ef33eb03880fd127ed46deb84604051610c519190611f43565b60405180910390a35050565b6000546001600160a01b03163314610c875760405162461bcd60e51b81526004016102c690611e78565b610a0982826114bb565b6000546001600160a01b03163314610cbb5760405162461bcd60e51b81526004016102c690611e78565b6003546040517f70a082310000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906370a0823190610d05908690600401611c87565b60206040518083038186803b158015610d1d57600080fd5b505afa158015610d31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d559190611be7565b600354909150610d6f906001600160a01b03168484611131565b6003546040517f70a082310000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906370a0823190610db9908790600401611c87565b60206040518083038186803b158015610dd157600080fd5b505afa158015610de5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e099190611be7565b905082828203036000146109a85760405162461bcd60e51b81526004016102c690611f0c565b6001546001600160a01b031681565b60408051600180825281830190925260009160208083019080368337505060045482519293506001600160a01b031691839150600090610e7a57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250506000600460009054906101000a90046001600160a01b03166001600160a01b0316635fe3b5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610eea57600080fd5b505afa158015610efe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f229190611aba565b6001600160a01b031663c2998238836040518263ffffffff1660e01b8152600401610f4d9190611c9b565b600060405180830381600087803b158015610f6757600080fd5b505af1158015610f7b573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610fc19190810190611b39565b905080600081518110610fd057fe5b6020026020010151600014610a095760405162461bcd60e51b81526004016102c690611d9c565b600082611006575060006106ad565b8282028284828161101357fe5b04146110505760405162461bcd60e51b8152600401808060200182810382526021815260200180611f8b6021913960400191505060405180910390fd5b9392505050565b60008082116110ad576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816110b657fe5b049392505050565b600082821115611115576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600081831061112a5781611050565b5090919050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526111b19084906115ff565b505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790526109a89085906115ff565b60025461124b90826116b0565b600255600154604080517f5e0a5ba600000000000000000000000000000000000000000000000000000000815290516001600160a01b0390921691635e0a5ba69160048082019260009290919082900301818387803b1580156112ad57600080fd5b505af11580156112c1573d6000803e3d6000fd5b50506004546003546112e293506001600160a01b039081169250168461170a565b600480546040517fa0712d680000000000000000000000000000000000000000000000000000000081526000926001600160a01b039092169163a0712d689161132d91879101611f43565b602060405180830381600087803b15801561134757600080fd5b505af115801561135b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137f9190611be7565b9050801561139f5760405162461bcd60e51b81526004016102c690611e41565b6001546005546040517fb656c31c0000000000000000000000000000000000000000000000000000000081526001600160a01b039092169163b656c31c916113e991600401611f43565b600060405180830381600087803b15801561140357600080fd5b505af1158015611417573d6000803e3d6000fd5b5050600480546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0390911693506370a08231925061146391309101611c87565b60206040518083038186803b15801561147b57600080fd5b505afa15801561148f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b39190611be7565b600555505050565b6002546114c890826116b0565b600255600154604080517f5e0a5ba600000000000000000000000000000000000000000000000000000000815290516001600160a01b0390921691635e0a5ba69160048082019260009290919082900301818387803b15801561152a57600080fd5b505af115801561153e573d6000803e3d6000fd5b5050600480546040517f852a12e3000000000000000000000000000000000000000000000000000000008152600094506001600160a01b03909116925063852a12e39161158d91879101611f43565b602060405180830381600087803b1580156115a757600080fd5b505af11580156115bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115df9190611be7565b9050801561139f5760405162461bcd60e51b81526004016102c690611eaf565b6000611654826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166118649092919063ffffffff16565b8051909150156111b15780806020019051602081101561167357600080fd5b50516111b15760405162461bcd60e51b815260040180806020018281038252602a815260200180611fac602a913960400191505060405180910390fd5b600082820183811015611050576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b8015806117a95750604080517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b15801561177b57600080fd5b505afa15801561178f573d6000803e3d6000fd5b505050506040513d60208110156117a557600080fd5b5051155b6117e45760405162461bcd60e51b8152600401808060200182810382526036815260200180611fd66036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b3000000000000000000000000000000000000000000000000000000001790526111b19084906115ff565b6060611873848460008561187b565b949350505050565b6060824710156118bc5760405162461bcd60e51b8152600401808060200182810382526026815260200180611f656026913960400191505060405180910390fd5b6118c5856119f4565b611916576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b6020831061197257805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101611935565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146119d4576040519150601f19603f3d011682016040523d82523d6000602084013e6119d9565b606091505b50915091506119e98282866119fa565b979650505050505050565b3b151590565b60608315611a09575081611050565b825115611a195782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a63578181015183820152602001611a4b565b50505050905090810190601f168015611a905780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b600060208284031215611aaf578081fd5b813561105081611f4c565b600060208284031215611acb578081fd5b815161105081611f4c565b60008060408385031215611ae8578081fd5b8235611af381611f4c565b91506020830135611b0381611f4c565b809150509250929050565b60008060408385031215611b20578182fd5b8235611b2b81611f4c565b946020939093013593505050565b60006020808385031215611b4b578182fd5b825167ffffffffffffffff80821115611b62578384fd5b818501915085601f830112611b75578384fd5b815181811115611b8157fe5b83810260405185828201018181108582111715611b9a57fe5b604052828152858101935084860182860187018a1015611bb8578788fd5b8795505b83861015611bda578051855260019590950194938601938601611bbc565b5098975050505050505050565b600060208284031215611bf8578081fd5b5051919050565b60008060408385031215611c11578182fd5b823591506020830135611b0381611f4c565b60008060408385031215611c35578182fd5b50508035926020909101359150565b6000815180845260208085019450808401835b83811015611c7c5781516001600160a01b031687529582019590820190600101611c57565b509495945050505050565b6001600160a01b0391909116815260200190565b6000602082526110506020830184611c44565b600060808252611cc16080830187611c44565b8281036020840152611cd38187611c44565b9415156040840152505090151560609091015292915050565b901515815260200190565b6020808252601f908201527f4372503a206f6e6c7920736d6172745969656c642f636f6e74726f6c6c657200604082015260600190565b6020808252601b908201527f4372503a205f74616b65556e6465726c79696e6720616d6f756e740000000000604082015260600190565b60208082526014908201527f4372503a206f6e6c7920636f6e74726f6c6c6572000000000000000000000000604082015260600190565b60208082526011908201527f4372503a205f656e7465724d61726b6574000000000000000000000000000000604082015260600190565b60208082526012908201527f4372503a20616c72656164792073657475700000000000000000000000000000604082015260600190565b60208082526018908201527f4372503a206f6e6c7920636f6e74726f6c6c65722f44414f0000000000000000604082015260600190565b6020808252601a908201527f4372503a205f6465706f73697450726f7669646572206d696e74000000000000604082015260600190565b60208082526014908201527f4372503a206f6e6c7920736d6172745969656c64000000000000000000000000604082015260600190565b60208082526027908201527f4372503a205f776974686472617750726f76696465722072656465656d556e6460408201527f65726c79696e6700000000000000000000000000000000000000000000000000606082015260800190565b6020808252601b908201527f4372503a205f73656e64556e6465726c79696e6720616d6f756e740000000000604082015260600190565b90815260200190565b6001600160a01b0381168114611f6157600080fd5b5056fe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a2646970667358221220a2ade921f418f4181260d935cc2aa3eb1cab574d16c777c592087d0624ae668e64736f6c63430007060033000000000000000000000000797aab1ce7c01eb727ab980762ba88e7133d2157

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101775760003560e01c80638023a1db116100d8578063bbbf2df41161008c578063ef9f5d2711610066578063ef9f5d2714610275578063f147a80e14610288578063f77c47911461029b57610177565b8063bbbf2df414610252578063bd6d894d14610265578063c2fbe7bc1461026d57610177565b8063a11b4f2a116100bd578063a11b4f2a1461022f578063afe3bd8f14610242578063bbba205d1461024a57610177565b80638023a1db1461021457806392eefe9b1461021c57610177565b80635e1cc7121161012f57806369e527da1161011457806369e527da146101ef578063788c8f0a146101f75780637b3ee7fc146101ff57610177565b80635e1cc712146101c757806363315637146101da57610177565b80633cf6276b116101605780633cf6276b146101af57806359356c5c146101b75780635c20096d146101bf57610177565b80632d34ba791461017c57806333a581d214610191575b600080fd5b61018f61018a366004611ad6565b6102a3565b005b61019961034e565b6040516101a69190611f43565b60405180910390f35b610199610372565b610199610378565b6101996103b1565b6101996101d5366004611bff565b6103b7565b6101e26106b3565b6040516101a69190611c87565b6101e26106c2565b6101e26106d1565b6102076106e0565b6040516101a69190611cec565b6101996106e9565b61018f61022a366004611a9e565b6106ef565b61018f61023d366004611b0e565b6107f4565b6101996109ae565b6101996109b4565b61018f610260366004611c23565b6109c0565b610199610a0d565b61018f610abd565b61018f610283366004611c23565b610c5d565b61018f610296366004611b0e565b610c91565b6101e2610e2f565b60085460ff16156102cf5760405162461bcd60e51b81526004016102c690611dd3565b60405180910390fd5b600080546001600160a01b038085167fffffffffffffffffffffffff000000000000000000000000000000000000000092831617909255600180549284169290911691909117905561031f610e3e565b5050600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81565b60075481565b60006103ac6002546103a6670de0b6b3a76400006103a0610397610a0d565b60055490610ff7565b90611057565b906110be565b905090565b60025481565b6001546000906001600160a01b031633146103e45760405162461bcd60e51b81526004016102c690611d65565b60408051600180825281830190925260009160208083019080368337019050509050308160008151811061041457fe5b6001600160a01b039290921660209283029190910190910152604080516001808252818301909252600091816020016020820280368337505060045482519293506001600160a01b03169183915060009061046b57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250506000600460009054906101000a90046001600160a01b03166001600160a01b0316635fe3b5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156104db57600080fd5b505afa1580156104ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105139190611aba565b90506000816001600160a01b0316639d1b5a0a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561055057600080fd5b505afa158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190611aba565b6040517f6810dfa60000000000000000000000000000000000000000000000000000000081529091506001600160a01b03831690636810dfa6906105d89087908790600090600190600401611cae565b600060405180830381600087803b1580156105f257600080fd5b505af1158015610606573d6000803e3d6000fd5b5050505061068f87826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161063a9190611c87565b60206040518083038186803b15801561065257600080fd5b505afa158015610666573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068a9190611be7565b61111b565b96506106a56001600160a01b0382168789611131565b869450505050505b92915050565b6003546001600160a01b031681565b6004546001600160a01b031681565b6000546001600160a01b031681565b60085460ff1681565b60065481565b6001546001600160a01b031633148061079e5750600160009054906101000a90046001600160a01b03166001600160a01b0316634162169f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561075157600080fd5b505afa158015610765573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107899190611aba565b6001600160a01b0316336001600160a01b0316145b6107ba5760405162461bcd60e51b81526004016102c690611e0a565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6000546001600160a01b031633148061081757506001546001600160a01b031633145b6108335760405162461bcd60e51b81526004016102c690611cf7565b6003546040517f70a082310000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906370a082319061087d903090600401611c87565b60206040518083038186803b15801561089557600080fd5b505afa1580156108a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108cd9190611be7565b6003549091506108e8906001600160a01b03168430856111b6565b6003546040517f70a082310000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906370a0823190610932903090600401611c87565b60206040518083038186803b15801561094a57600080fd5b505afa15801561095e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109829190611be7565b905082828203036000146109a85760405162461bcd60e51b81526004016102c690611d2e565b50505050565b60055481565b670de0b6b3a764000081565b6000546001600160a01b03163314806109e357506001546001600160a01b031633145b6109ff5760405162461bcd60e51b81526004016102c690611cf7565b610a09828261123e565b5050565b6000600754421115610ab6574260075560048054604080517fbd6d894d00000000000000000000000000000000000000000000000000000000815290516001600160a01b039092169263bd6d894d9282820192602092908290030181600087803b158015610a7a57600080fd5b505af1158015610a8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab29190611be7565b6006555b5060065490565b610aca60025460006114bb565b600060028190556003546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b03909116906370a0823190610b1a903090600401611c87565b60206040518083038186803b158015610b3257600080fd5b505afa158015610b46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6a9190611be7565b90506000600160009054906101000a90046001600160a01b03166001600160a01b031663f0eff6456040518163ffffffff1660e01b815260040160206040518083038186803b158015610bbc57600080fd5b505afa158015610bd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf49190611aba565b600354909150610c0e906001600160a01b03168284611131565b806001600160a01b0316336001600160a01b03167f9f87918b63a7c3c287a77288ad6cb96549e9af160ef33eb03880fd127ed46deb84604051610c519190611f43565b60405180910390a35050565b6000546001600160a01b03163314610c875760405162461bcd60e51b81526004016102c690611e78565b610a0982826114bb565b6000546001600160a01b03163314610cbb5760405162461bcd60e51b81526004016102c690611e78565b6003546040517f70a082310000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906370a0823190610d05908690600401611c87565b60206040518083038186803b158015610d1d57600080fd5b505afa158015610d31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d559190611be7565b600354909150610d6f906001600160a01b03168484611131565b6003546040517f70a082310000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906370a0823190610db9908790600401611c87565b60206040518083038186803b158015610dd157600080fd5b505afa158015610de5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e099190611be7565b905082828203036000146109a85760405162461bcd60e51b81526004016102c690611f0c565b6001546001600160a01b031681565b60408051600180825281830190925260009160208083019080368337505060045482519293506001600160a01b031691839150600090610e7a57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250506000600460009054906101000a90046001600160a01b03166001600160a01b0316635fe3b5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610eea57600080fd5b505afa158015610efe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f229190611aba565b6001600160a01b031663c2998238836040518263ffffffff1660e01b8152600401610f4d9190611c9b565b600060405180830381600087803b158015610f6757600080fd5b505af1158015610f7b573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610fc19190810190611b39565b905080600081518110610fd057fe5b6020026020010151600014610a095760405162461bcd60e51b81526004016102c690611d9c565b600082611006575060006106ad565b8282028284828161101357fe5b04146110505760405162461bcd60e51b8152600401808060200182810382526021815260200180611f8b6021913960400191505060405180910390fd5b9392505050565b60008082116110ad576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816110b657fe5b049392505050565b600082821115611115576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600081831061112a5781611050565b5090919050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526111b19084906115ff565b505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790526109a89085906115ff565b60025461124b90826116b0565b600255600154604080517f5e0a5ba600000000000000000000000000000000000000000000000000000000815290516001600160a01b0390921691635e0a5ba69160048082019260009290919082900301818387803b1580156112ad57600080fd5b505af11580156112c1573d6000803e3d6000fd5b50506004546003546112e293506001600160a01b039081169250168461170a565b600480546040517fa0712d680000000000000000000000000000000000000000000000000000000081526000926001600160a01b039092169163a0712d689161132d91879101611f43565b602060405180830381600087803b15801561134757600080fd5b505af115801561135b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137f9190611be7565b9050801561139f5760405162461bcd60e51b81526004016102c690611e41565b6001546005546040517fb656c31c0000000000000000000000000000000000000000000000000000000081526001600160a01b039092169163b656c31c916113e991600401611f43565b600060405180830381600087803b15801561140357600080fd5b505af1158015611417573d6000803e3d6000fd5b5050600480546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0390911693506370a08231925061146391309101611c87565b60206040518083038186803b15801561147b57600080fd5b505afa15801561148f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b39190611be7565b600555505050565b6002546114c890826116b0565b600255600154604080517f5e0a5ba600000000000000000000000000000000000000000000000000000000815290516001600160a01b0390921691635e0a5ba69160048082019260009290919082900301818387803b15801561152a57600080fd5b505af115801561153e573d6000803e3d6000fd5b5050600480546040517f852a12e3000000000000000000000000000000000000000000000000000000008152600094506001600160a01b03909116925063852a12e39161158d91879101611f43565b602060405180830381600087803b1580156115a757600080fd5b505af11580156115bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115df9190611be7565b9050801561139f5760405162461bcd60e51b81526004016102c690611eaf565b6000611654826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166118649092919063ffffffff16565b8051909150156111b15780806020019051602081101561167357600080fd5b50516111b15760405162461bcd60e51b815260040180806020018281038252602a815260200180611fac602a913960400191505060405180910390fd5b600082820183811015611050576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b8015806117a95750604080517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b15801561177b57600080fd5b505afa15801561178f573d6000803e3d6000fd5b505050506040513d60208110156117a557600080fd5b5051155b6117e45760405162461bcd60e51b8152600401808060200182810382526036815260200180611fd66036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b3000000000000000000000000000000000000000000000000000000001790526111b19084906115ff565b6060611873848460008561187b565b949350505050565b6060824710156118bc5760405162461bcd60e51b8152600401808060200182810382526026815260200180611f656026913960400191505060405180910390fd5b6118c5856119f4565b611916576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b6020831061197257805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101611935565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146119d4576040519150601f19603f3d011682016040523d82523d6000602084013e6119d9565b606091505b50915091506119e98282866119fa565b979650505050505050565b3b151590565b60608315611a09575081611050565b825115611a195782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a63578181015183820152602001611a4b565b50505050905090810190601f168015611a905780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b600060208284031215611aaf578081fd5b813561105081611f4c565b600060208284031215611acb578081fd5b815161105081611f4c565b60008060408385031215611ae8578081fd5b8235611af381611f4c565b91506020830135611b0381611f4c565b809150509250929050565b60008060408385031215611b20578182fd5b8235611b2b81611f4c565b946020939093013593505050565b60006020808385031215611b4b578182fd5b825167ffffffffffffffff80821115611b62578384fd5b818501915085601f830112611b75578384fd5b815181811115611b8157fe5b83810260405185828201018181108582111715611b9a57fe5b604052828152858101935084860182860187018a1015611bb8578788fd5b8795505b83861015611bda578051855260019590950194938601938601611bbc565b5098975050505050505050565b600060208284031215611bf8578081fd5b5051919050565b60008060408385031215611c11578182fd5b823591506020830135611b0381611f4c565b60008060408385031215611c35578182fd5b50508035926020909101359150565b6000815180845260208085019450808401835b83811015611c7c5781516001600160a01b031687529582019590820190600101611c57565b509495945050505050565b6001600160a01b0391909116815260200190565b6000602082526110506020830184611c44565b600060808252611cc16080830187611c44565b8281036020840152611cd38187611c44565b9415156040840152505090151560609091015292915050565b901515815260200190565b6020808252601f908201527f4372503a206f6e6c7920736d6172745969656c642f636f6e74726f6c6c657200604082015260600190565b6020808252601b908201527f4372503a205f74616b65556e6465726c79696e6720616d6f756e740000000000604082015260600190565b60208082526014908201527f4372503a206f6e6c7920636f6e74726f6c6c6572000000000000000000000000604082015260600190565b60208082526011908201527f4372503a205f656e7465724d61726b6574000000000000000000000000000000604082015260600190565b60208082526012908201527f4372503a20616c72656164792073657475700000000000000000000000000000604082015260600190565b60208082526018908201527f4372503a206f6e6c7920636f6e74726f6c6c65722f44414f0000000000000000604082015260600190565b6020808252601a908201527f4372503a205f6465706f73697450726f7669646572206d696e74000000000000604082015260600190565b60208082526014908201527f4372503a206f6e6c7920736d6172745969656c64000000000000000000000000604082015260600190565b60208082526027908201527f4372503a205f776974686472617750726f76696465722072656465656d556e6460408201527f65726c79696e6700000000000000000000000000000000000000000000000000606082015260800190565b6020808252601b908201527f4372503a205f73656e64556e6465726c79696e6720616d6f756e740000000000604082015260600190565b90815260200190565b6001600160a01b0381168114611f6157600080fd5b5056fe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a2646970667358221220a2ade921f418f4181260d935cc2aa3eb1cab574d16c777c592087d0624ae668e64736f6c63430007060033

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

000000000000000000000000797aab1ce7c01eb727ab980762ba88e7133d2157

-----Decoded View---------------
Arg [0] : cToken_ (address): 0x797AAB1ce7c01eB727ab980762bA88e7133d2157

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000797aab1ce7c01eb727ab980762ba88e7133d2157


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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