ETH Price: $3,491.10 (+2.11%)
Gas: 12 Gwei

Contract

0x068af1Ec336344cd122b9811ef90D2384519005f
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

1 address found via
Transaction Hash
Method
Block
From
To
Value
Repay199750212024-05-29 10:47:3533 days ago1716979655IN
0x068af1Ec...84519005f
0 ETH0.0017015710.04908166
Repay190538222024-01-21 7:43:47162 days ago1705823027IN
0x068af1Ec...84519005f
0.156068 ETH0.002191729.83613598
Repay184952972023-11-04 1:06:47240 days ago1699060007IN
0x068af1Ec...84519005f
0.01021235 ETH0.0033953114.98440243
Repay183322612023-10-12 5:31:47263 days ago1697088707IN
0x068af1Ec...84519005f
0 ETH0.001103465.3520704
Repay183322612023-10-12 5:31:47263 days ago1697088707IN
0x068af1Ec...84519005f
0 ETH0.001360615.3520704
Repay183129672023-10-09 12:38:47266 days ago1696855127IN
0x068af1Ec...84519005f
0 ETH0.002218548.33830908
Borrow183095252023-10-09 1:06:23266 days ago1696813583IN
0x068af1Ec...84519005f
0 ETH0.003508596.32982214
Repay180748432023-09-06 3:49:35299 days ago1693972175IN
0x068af1Ec...84519005f
0 ETH0.0030678313.09043561
Repay180747662023-09-06 3:34:11299 days ago1693971251IN
0x068af1Ec...84519005f
0 ETH0.0018461313.10525271
Repay180632012023-09-04 12:45:35301 days ago1693831535IN
0x068af1Ec...84519005f
0 ETH0.0024363710.82535206
Repay180631952023-09-04 12:44:23301 days ago1693831463IN
0x068af1Ec...84519005f
0 ETH0.002684689.64352857
Repay179120942023-08-14 9:08:59322 days ago1692004139IN
0x068af1Ec...84519005f
0 ETH0.0017954612.74551376
Repay179120232023-08-14 8:54:47322 days ago1692003287IN
0x068af1Ec...84519005f
0 ETH0.0011984413.46809565
Repay175732842023-06-27 21:13:23369 days ago1687900403IN
0x068af1Ec...84519005f
0.0157112 ETH0.00381615.73303791
Repay173574662023-05-28 12:17:47400 days ago1685276267IN
0x068af1Ec...84519005f
0.00206963 ETH0.0058938124.58428671
Repay171550112023-04-29 23:29:35428 days ago1682810975IN
0x068af1Ec...84519005f
0 ETH0.0087331437.67388185
Repay171550092023-04-29 23:29:11428 days ago1682810951IN
0x068af1Ec...84519005f
0 ETH0.0088053935.37424758
Repay171531572023-04-29 17:14:47429 days ago1682788487IN
0x068af1Ec...84519005f
0 ETH0.0092096337
Repay171530902023-04-29 17:01:11429 days ago1682787671IN
0x068af1Ec...84519005f
0 ETH0.0097734942.16183023
Repay171530842023-04-29 16:59:59429 days ago1682787599IN
0x068af1Ec...84519005f
0 ETH0.0102129441.03084787
Repay171528342023-04-29 16:08:47429 days ago1682784527IN
0x068af1Ec...84519005f
0 ETH0.0098456742.47103441
Repay171528322023-04-29 16:08:11429 days ago1682784491IN
0x068af1Ec...84519005f
0 ETH0.0100712843.44647916
Repay171528292023-04-29 16:07:35429 days ago1682784455IN
0x068af1Ec...84519005f
0 ETH0.0107888743.34465341
Repay171527182023-04-29 15:44:35429 days ago1682783075IN
0x068af1Ec...84519005f
0 ETH0.0127436254.97185277
Repay171527122023-04-29 15:43:23429 days ago1682783003IN
0x068af1Ec...84519005f
0 ETH0.0130516448.54672931
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To Value
190538222024-01-21 7:43:47162 days ago1705823027
0x068af1Ec...84519005f
0.00000015 ETH
190538222024-01-21 7:43:47162 days ago1705823027
0x068af1Ec...84519005f
0.15606784 ETH
184952972023-11-04 1:06:47240 days ago1699060007
0x068af1Ec...84519005f
0 ETH
184952972023-11-04 1:06:47240 days ago1699060007
0x068af1Ec...84519005f
0.01021234 ETH
180748432023-09-06 3:49:35299 days ago1693972175
0x068af1Ec...84519005f
0.02526964 ETH
180748432023-09-06 3:49:35299 days ago1693972175
0x068af1Ec...84519005f
0.02526964 ETH
180632012023-09-04 12:45:35301 days ago1693831535
0x068af1Ec...84519005f
0.025 ETH
180632012023-09-04 12:45:35301 days ago1693831535
0x068af1Ec...84519005f
0.025 ETH
175732842023-06-27 21:13:23369 days ago1687900403
0x068af1Ec...84519005f
0.00000001 ETH
175732842023-06-27 21:13:23369 days ago1687900403
0x068af1Ec...84519005f
0.01571119 ETH
173574662023-05-28 12:17:47400 days ago1685276267
0x068af1Ec...84519005f
0 ETH
173574662023-05-28 12:17:47400 days ago1685276267
0x068af1Ec...84519005f
0.00206963 ETH
168342132023-03-15 15:34:23474 days ago1678894463
0x068af1Ec...84519005f
2 ETH
168342132023-03-15 15:34:23474 days ago1678894463
0x068af1Ec...84519005f
2 ETH
168163142023-03-13 3:12:23476 days ago1678677143
0x068af1Ec...84519005f
0 ETH
168163142023-03-13 3:12:23476 days ago1678677143
0x068af1Ec...84519005f
0.00219706 ETH
168117762023-03-12 11:53:47477 days ago1678622027
0x068af1Ec...84519005f
0 ETH
168117762023-03-12 11:53:47477 days ago1678622027
0x068af1Ec...84519005f
0.00257515 ETH
167236192023-02-28 2:13:23489 days ago1677550403
0x068af1Ec...84519005f
3 ETH
167236192023-02-28 2:13:23489 days ago1677550403
0x068af1Ec...84519005f
3 ETH
165389822023-02-02 5:17:47515 days ago1675315067
0x068af1Ec...84519005f
0 ETH
165389822023-02-02 5:17:47515 days ago1675315067
0x068af1Ec...84519005f
0.00352377 ETH
164831082023-01-25 10:01:59523 days ago1674640919
0x068af1Ec...84519005f
10 ETH
163836812023-01-11 12:50:59537 days ago1673441459
0x068af1Ec...84519005f
0.006 ETH
163836812023-01-11 12:50:59537 days ago1673441459
0x068af1Ec...84519005f
0.006 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BetaRunnerLending

Compiler Version
v0.8.6+commit.11564f7e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2021-08-11
*/

// SPDX-License-Identifier: BUSL-1.1

pragma solidity 0.8.6;



// Part: IBetaBank

interface IBetaBank {
  /// @dev Returns the address of BToken of the given underlying token, or 0 if not exists.
  function bTokens(address _underlying) external view returns (address);

  /// @dev Returns the address of the underlying of the given BToken, or 0 if not exists.
  function underlyings(address _bToken) external view returns (address);

  /// @dev Returns the address of the oracle contract.
  function oracle() external view returns (address);

  /// @dev Returns the address of the config contract.
  function config() external view returns (address);

  /// @dev Returns the interest rate model smart contract.
  function interestModel() external view returns (address);

  /// @dev Returns the position's collateral token and AmToken.
  function getPositionTokens(address _owner, uint _pid)
    external
    view
    returns (address _collateral, address _bToken);

  /// @dev Returns the debt of the given position. Can't be view as it needs to call accrue.
  function fetchPositionDebt(address _owner, uint _pid) external returns (uint);

  /// @dev Returns the LTV of the given position. Can't be view as it needs to call accrue.
  function fetchPositionLTV(address _owner, uint _pid) external returns (uint);

  /// @dev Opens a new position in the Beta smart contract.
  function open(
    address _owner,
    address _underlying,
    address _collateral
  ) external returns (uint pid);

  /// @dev Borrows tokens on the given position.
  function borrow(
    address _owner,
    uint _pid,
    uint _amount
  ) external;

  /// @dev Repays tokens on the given position.
  function repay(
    address _owner,
    uint _pid,
    uint _amount
  ) external;

  /// @dev Puts more collateral to the given position.
  function put(
    address _owner,
    uint _pid,
    uint _amount
  ) external;

  /// @dev Takes some collateral out of the position.
  function take(
    address _owner,
    uint _pid,
    uint _amount
  ) external;

  /// @dev Liquidates the given position.
  function liquidate(
    address _owner,
    uint _pid,
    uint _amount
  ) external;
}

// Part: IWETH

interface IWETH {
  function deposit() external payable;

  function withdraw(uint wad) external;

  function approve(address guy, uint wad) external returns (bool);
}

// Part: OpenZeppelin/[email protected]/Address

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    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

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

// Part: OpenZeppelin/[email protected]/Context

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

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

// Part: OpenZeppelin/[email protected]/IERC20

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

// Part: OpenZeppelin/[email protected]/Math

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

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

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

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

// Part: OpenZeppelin/[email protected]/SafeERC20

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

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

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

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

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

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

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

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

// Part: OpenZeppelin/[email protected]/Ownable

/**
 * @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() {
        _setOwner(_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 {
        _setOwner(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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// Part: BetaRunnerBase

contract BetaRunnerBase is Ownable {
  using SafeERC20 for IERC20;

  address public immutable betaBank;
  address public immutable weth;

  modifier onlyEOA() {
    require(msg.sender == tx.origin, 'BetaRunnerBase/not-eoa');
    _;
  }

  constructor(address _betaBank, address _weth) {
    address bweth = IBetaBank(_betaBank).bTokens(_weth);
    require(bweth != address(0), 'BetaRunnerBase/no-bweth');
    IERC20(_weth).safeApprove(_betaBank, type(uint).max);
    IERC20(_weth).safeApprove(bweth, type(uint).max);
    betaBank = _betaBank;
    weth = _weth;
  }

  function _borrow(
    address _owner,
    uint _pid,
    address _underlying,
    address _collateral,
    uint _amountBorrow,
    uint _amountCollateral
  ) internal {
    if (_pid == type(uint).max) {
      _pid = IBetaBank(betaBank).open(_owner, _underlying, _collateral);
    } else {
      (address collateral, address bToken) = IBetaBank(betaBank).getPositionTokens(_owner, _pid);
      require(_collateral == collateral, '_borrow/collateral-not-_collateral');
      require(_underlying == IBetaBank(betaBank).underlyings(bToken), '_borrow/bad-underlying');
    }
    _approve(_collateral, betaBank, _amountCollateral);
    IBetaBank(betaBank).put(_owner, _pid, _amountCollateral);
    IBetaBank(betaBank).borrow(_owner, _pid, _amountBorrow);
  }

  function _repay(
    address _owner,
    uint _pid,
    address _underlying,
    address _collateral,
    uint _amountRepay,
    uint _amountCollateral
  ) internal {
    (address collateral, address bToken) = IBetaBank(betaBank).getPositionTokens(_owner, _pid);
    require(_collateral == collateral, '_repay/collateral-not-_collateral');
    require(_underlying == IBetaBank(betaBank).underlyings(bToken), '_repay/bad-underlying');
    _approve(_underlying, bToken, _amountRepay);
    IBetaBank(betaBank).repay(_owner, _pid, _amountRepay);
    IBetaBank(betaBank).take(_owner, _pid, _amountCollateral);
  }

  function _transferIn(
    address _token,
    address _from,
    uint _amount
  ) internal {
    if (_token == weth) {
      require(_from == msg.sender, '_transferIn/not-from-sender');
      require(_amount <= msg.value, '_transferIn/insufficient-eth-amount');
      IWETH(weth).deposit{value: _amount}();
      if (msg.value > _amount) {
        (bool success, ) = _from.call{value: msg.value - _amount}(new bytes(0));
        require(success, '_transferIn/eth-transfer-failed');
      }
    } else {
      IERC20(_token).safeTransferFrom(_from, address(this), _amount);
    }
  }

  function _transferOut(
    address _token,
    address _to,
    uint _amount
  ) internal {
    if (_token == weth) {
      IWETH(weth).withdraw(_amount);
      (bool success, ) = _to.call{value: _amount}(new bytes(0));
      require(success, '_transferOut/eth-transfer-failed');
    } else {
      IERC20(_token).safeTransfer(_to, _amount);
    }
  }

  /// @dev Approves infinite on the given token for the given spender if current approval is insufficient.
  function _approve(
    address _token,
    address _spender,
    uint _minAmount
  ) internal {
    uint current = IERC20(_token).allowance(address(this), _spender);
    if (current < _minAmount) {
      if (current != 0) {
        IERC20(_token).safeApprove(_spender, 0);
      }
      IERC20(_token).safeApprove(_spender, type(uint).max);
    }
  }

  /// @dev Caps repay amount by current position's debt.
  function _capRepay(
    address _owner,
    uint _pid,
    uint _amountRepay
  ) internal returns (uint) {
    return Math.min(_amountRepay, IBetaBank(betaBank).fetchPositionDebt(_owner, _pid));
  }

  /// @dev Recovers lost tokens for whatever reason by the owner.
  function recover(address _token, uint _amount) external onlyOwner {
    if (_amount == type(uint).max) {
      _amount = IERC20(_token).balanceOf(address(this));
    }
    IERC20(_token).safeTransfer(msg.sender, _amount);
  }

  /// @dev Recovers lost ETH for whatever reason by the owner.
  function recoverETH(uint _amount) external onlyOwner {
    if (_amount == type(uint).max) {
      _amount = address(this).balance;
    }
    (bool success, ) = msg.sender.call{value: _amount}(new bytes(0));
    require(success, 'recoverETH/eth-transfer-failed');
  }

  /// @dev Override Ownable.sol renounceOwnership to prevent accidental call
  function renounceOwnership() public override onlyOwner {
    revert('renounceOwnership/disabled');
  }

  receive() external payable {
    require(msg.sender == weth, 'receive/not-weth');
  }
}

// File: BetaRunnerLending.sol

contract BetaRunnerLending is BetaRunnerBase {
  constructor(address _betaBank, address _weth) BetaRunnerBase(_betaBank, _weth) {}

  /// @dev Borrows the asset using the given collateral.
  function borrow(
    uint _pid,
    address _underlying,
    address _collateral,
    uint _amountBorrow,
    uint _amountPut
  ) external payable onlyEOA {
    _transferIn(_collateral, msg.sender, _amountPut);
    _borrow(msg.sender, _pid, _underlying, _collateral, _amountBorrow, _amountPut);
    _transferOut(_underlying, msg.sender, _amountBorrow);
  }

  /// @dev Repays the debt and takes collateral for owner.
  function repay(
    uint _pid,
    address _underlying,
    address _collateral,
    uint _amountRepay,
    uint _amountTake
  ) external payable onlyEOA {
    _amountRepay = _capRepay(msg.sender, _pid, _amountRepay);
    _transferIn(_underlying, msg.sender, _amountRepay);
    _repay(msg.sender, _pid, _underlying, _collateral, _amountRepay, _amountTake);
    _transferOut(_collateral, msg.sender, _amountTake);
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_betaBank","type":"address"},{"internalType":"address","name":"_weth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"betaBank","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_underlying","type":"address"},{"internalType":"address","name":"_collateral","type":"address"},{"internalType":"uint256","name":"_amountBorrow","type":"uint256"},{"internalType":"uint256","name":"_amountPut","type":"uint256"}],"name":"borrow","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"recover","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"recoverETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_underlying","type":"address"},{"internalType":"address","name":"_collateral","type":"address"},{"internalType":"uint256","name":"_amountRepay","type":"uint256"},{"internalType":"uint256","name":"_amountTake","type":"uint256"}],"name":"repay","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60c06040523480156200001157600080fd5b50604051620020b8380380620020b88339810160408190526200003491620005e5565b8181620000413362000191565b6040516328f528cd60e11b81526001600160a01b038281166004830152600091908416906351ea519a9060240160206040518083038186803b1580156200008757600080fd5b505afa1580156200009c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000c29190620005c7565b90506001600160a01b038116620001205760405162461bcd60e51b815260206004820152601760248201527f4265746152756e6e6572426173652f6e6f2d627765746800000000000000000060448201526064015b60405180910390fd5b6200014783600019846001600160a01b0316620001e160201b620005ed179092919060201c565b6200016e81600019846001600160a01b0316620001e160201b620005ed179092919060201c565b506001600160601b0319606092831b8116608052911b1660a05250620006e19050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8015806200026f5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b1580156200023257600080fd5b505afa15801562000247573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200026d919062000641565b155b620002e35760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e636500000000000000000000606482015260840162000117565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b179091526200033b9185916200034016565b505050565b60006200039c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166200041e60201b62000749179092919060201c565b8051909150156200033b5780806020019051810190620003bd91906200061d565b6200033b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840162000117565b60606200042f848460008562000439565b90505b9392505050565b6060824710156200049c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840162000117565b843b620004ec5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000117565b600080866001600160a01b031685876040516200050a91906200065b565b60006040518083038185875af1925050503d806000811462000549576040519150601f19603f3d011682016040523d82523d6000602084013e6200054e565b606091505b509092509050620005618282866200056c565b979650505050505050565b606083156200057d57508162000432565b8251156200058e5782518084602001fd5b8160405162461bcd60e51b815260040162000117919062000679565b80516001600160a01b0381168114620005c257600080fd5b919050565b600060208284031215620005da57600080fd5b6200043282620005aa565b60008060408385031215620005f957600080fd5b6200060483620005aa565b91506200061460208401620005aa565b90509250929050565b6000602082840312156200063057600080fd5b815180151581146200043257600080fd5b6000602082840312156200065457600080fd5b5051919050565b600082516200066f818460208701620006ae565b9190910192915050565b60208152600082518060208401526200069a816040850160208701620006ae565b601f01601f19169190910160400192915050565b60005b83811015620006cb578181015183820152602001620006b1565b83811115620006db576000848401525b50505050565b60805160601c60a05160601c61193c6200077c60003960008181609a0152818161013e015281816107640152818161085201528181610da70152610df501526000818161018e015281816109e201528181610a9001528181610b9801528181610c7401528181610cb001528181610d3001528181610f57015281816110040152818161110b015281816111ff015261127f015261193c6000f3fe60806040526004361061008a5760003560e01c80635705ae43116100595780635705ae43146101b0578063715018a6146101d05780638da5cb5b146101e5578063d333555314610203578063f2fde38b1461022357600080fd5b80632a6f30d8146101065780632d857141146101195780633fc8cef31461012c578063550ba3671461017c57600080fd5b3661010157336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146100ff5760405162461bcd60e51b815260206004820152601060248201526f0e4cac6cad2ecca5edcdee85aeecae8d60831b60448201526064015b60405180910390fd5b005b600080fd5b6100ff6101143660046117a9565b610243565b6100ff6101273660046117a9565b6102b6565b34801561013857600080fd5b506101607f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b34801561018857600080fd5b506101607f000000000000000000000000000000000000000000000000000000000000000081565b3480156101bc57600080fd5b506100ff6101cb366004611729565b61032f565b3480156101dc57600080fd5b506100ff6103f5565b3480156101f157600080fd5b506000546001600160a01b0316610160565b34801561020f57600080fd5b506100ff61021e366004611777565b610467565b34801561022f57600080fd5b506100ff61023e3660046116b5565b610552565b33321461028b5760405162461bcd60e51b81526020600482015260166024820152754265746152756e6e6572426173652f6e6f742d656f6160501b60448201526064016100f6565b610296833383610762565b6102a43386868686866109a9565b6102af843384610da5565b5050505050565b3332146102fe5760405162461bcd60e51b81526020600482015260166024820152754265746152756e6e6572426173652f6e6f742d656f6160501b60448201526064016100f6565b610309338684610f29565b9150610316843384610762565b610324338686868686610fd9565b6102af833383610da5565b6000546001600160a01b031633146103595760405162461bcd60e51b81526004016100f69061186b565b6000198114156103dd576040516370a0823160e01b81523060048201526001600160a01b038316906370a082319060240160206040518083038186803b1580156103a257600080fd5b505afa1580156103b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103da9190611790565b90505b6103f16001600160a01b03831633836112f6565b5050565b6000546001600160a01b0316331461041f5760405162461bcd60e51b81526004016100f69061186b565b60405162461bcd60e51b815260206004820152601a60248201527f72656e6f756e63654f776e6572736869702f64697361626c656400000000000060448201526064016100f6565b6000546001600160a01b031633146104915760405162461bcd60e51b81526004016100f69061186b565b60001981141561049e5750475b60408051600080825260208201909252339083906040516104bf91906117fb565b60006040518083038185875af1925050503d80600081146104fc576040519150601f19603f3d011682016040523d82523d6000602084013e610501565b606091505b50509050806103f15760405162461bcd60e51b815260206004820152601e60248201527f7265636f7665724554482f6574682d7472616e736665722d6661696c6564000060448201526064016100f6565b6000546001600160a01b0316331461057c5760405162461bcd60e51b81526004016100f69061186b565b6001600160a01b0381166105e15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100f6565b6105ea81611326565b50565b8015806106765750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561063c57600080fd5b505afa158015610650573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106749190611790565b155b6106e15760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016100f6565b6040516001600160a01b03831660248201526044810182905261074490849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611376565b505050565b60606107588484600085611448565b90505b9392505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b03161415610994576001600160a01b03821633146107f45760405162461bcd60e51b815260206004820152601b60248201527f5f7472616e73666572496e2f6e6f742d66726f6d2d73656e646572000000000060448201526064016100f6565b348111156108505760405162461bcd60e51b815260206004820152602360248201527f5f7472616e73666572496e2f696e73756666696369656e742d6574682d616d6f6044820152621d5b9d60ea1b60648201526084016100f6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156108ab57600080fd5b505af11580156108bf573d6000803e3d6000fd5b5050505050803411156107445760006001600160a01b0383166108e283346118a0565b604080516000815260208101918290526108fb916117fb565b60006040518083038185875af1925050503d8060008114610938576040519150601f19603f3d011682016040523d82523d6000602084013e61093d565b606091505b505090508061098e5760405162461bcd60e51b815260206004820152601f60248201527f5f7472616e73666572496e2f6574682d7472616e736665722d6661696c65640060448201526064016100f6565b50505050565b6107446001600160a01b038416833084611570565b600019851415610a6557604051637b8feacb60e11b81526001600160a01b038781166004830152858116602483015284811660448301527f0000000000000000000000000000000000000000000000000000000000000000169063f71fd59690606401602060405180830381600087803b158015610a2657600080fd5b505af1158015610a3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5e9190611790565b9450610c6e565b60405163e507470960e01b81526001600160a01b0387811660048301526024820187905260009182917f0000000000000000000000000000000000000000000000000000000000000000169063e507470990604401604080518083038186803b158015610ad157600080fd5b505afa158015610ae5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0991906116ef565b91509150816001600160a01b0316856001600160a01b031614610b795760405162461bcd60e51b815260206004820152602260248201527f5f626f72726f772f636f6c6c61746572616c2d6e6f742d5f636f6c6c61746572604482015261185b60f21b60648201526084016100f6565b604051630cf351b560e31b81526001600160a01b0382811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063679a8da89060240160206040518083038186803b158015610bda57600080fd5b505afa158015610bee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1291906116d2565b6001600160a01b0316866001600160a01b031614610c6b5760405162461bcd60e51b81526020600482015260166024820152755f626f72726f772f6261642d756e6465726c79696e6760501b60448201526064016100f6565b50505b610c99837f0000000000000000000000000000000000000000000000000000000000000000836115a8565b6040516315d21c8d60e11b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690632ba4391a90610ce990899089908690600401611817565b600060405180830381600087803b158015610d0357600080fd5b505af1158015610d17573d6000803e3d6000fd5b505060405163c1bce0b760e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016925063c1bce0b79150610d6b90899089908790600401611817565b600060405180830381600087803b158015610d8557600080fd5b505af1158015610d99573d6000803e3d6000fd5b50505050505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b03161415610f1557604051632e1a7d4d60e01b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015610e4157600080fd5b505af1158015610e55573d6000803e3d6000fd5b5050604080516000808252602082019283905293506001600160a01b03861692508491610e8291906117fb565b60006040518083038185875af1925050503d8060008114610ebf576040519150601f19603f3d011682016040523d82523d6000602084013e610ec4565b606091505b505090508061098e5760405162461bcd60e51b815260206004820181905260248201527f5f7472616e736665724f75742f6574682d7472616e736665722d6661696c656460448201526064016100f6565b6107446001600160a01b03841683836112f6565b604051620c3a4160e11b81526001600160a01b038481166004830152602482018490526000916107589184917f0000000000000000000000000000000000000000000000000000000000000000909116906218748290604401602060405180830381600087803b158015610f9c57600080fd5b505af1158015610fb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd49190611790565b611666565b60405163e507470960e01b81526001600160a01b0387811660048301526024820187905260009182917f0000000000000000000000000000000000000000000000000000000000000000169063e507470990604401604080518083038186803b15801561104557600080fd5b505afa158015611059573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107d91906116ef565b91509150816001600160a01b0316856001600160a01b0316146110ec5760405162461bcd60e51b815260206004820152602160248201527f5f72657061792f636f6c6c61746572616c2d6e6f742d5f636f6c6c61746572616044820152601b60fa1b60648201526084016100f6565b604051630cf351b560e31b81526001600160a01b0382811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063679a8da89060240160206040518083038186803b15801561114d57600080fd5b505afa158015611161573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118591906116d2565b6001600160a01b0316866001600160a01b0316146111dd5760405162461bcd60e51b81526020600482015260156024820152745f72657061792f6261642d756e6465726c79696e6760581b60448201526064016100f6565b6111e88682866115a8565b604051638cd2e0c760e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690638cd2e0c790611238908b908b908990600401611817565b600060405180830381600087803b15801561125257600080fd5b505af1158015611266573d6000803e3d6000fd5b505060405163c640e9bf60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016925063c640e9bf91506112ba908b908b908890600401611817565b600060405180830381600087803b1580156112d457600080fd5b505af11580156112e8573d6000803e3d6000fd5b505050505050505050505050565b6040516001600160a01b03831660248201526044810182905261074490849063a9059cbb60e01b9060640161070d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006113cb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166107499092919063ffffffff16565b80519091501561074457808060200190518101906113e99190611755565b6107445760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016100f6565b6060824710156114a95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016100f6565b843b6114f75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016100f6565b600080866001600160a01b0316858760405161151391906117fb565b60006040518083038185875af1925050503d8060008114611550576040519150601f19603f3d011682016040523d82523d6000602084013e611555565b606091505b509150915061156582828661167c565b979650505050505050565b6040516001600160a01b038085166024830152831660448201526064810182905261098e9085906323b872dd60e01b9060840161070d565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e9060440160206040518083038186803b1580156115f357600080fd5b505afa158015611607573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162b9190611790565b90508181101561098e578015611650576116506001600160a01b0385168460006105ed565b61098e6001600160a01b038516846000196105ed565b6000818310611675578161075b565b5090919050565b6060831561168b57508161075b565b82511561169b5782518084602001fd5b8160405162461bcd60e51b81526004016100f69190611838565b6000602082840312156116c757600080fd5b813561075b816118f1565b6000602082840312156116e457600080fd5b815161075b816118f1565b6000806040838503121561170257600080fd5b825161170d816118f1565b602084015190925061171e816118f1565b809150509250929050565b6000806040838503121561173c57600080fd5b8235611747816118f1565b946020939093013593505050565b60006020828403121561176757600080fd5b8151801515811461075b57600080fd5b60006020828403121561178957600080fd5b5035919050565b6000602082840312156117a257600080fd5b5051919050565b600080600080600060a086880312156117c157600080fd5b8535945060208601356117d3816118f1565b935060408601356117e3816118f1565b94979396509394606081013594506080013592915050565b6000825161180d8184602087016118c5565b9190910192915050565b6001600160a01b039390931683526020830191909152604082015260600190565b60208152600082518060208401526118578160408501602087016118c5565b601f01601f19169190910160400192915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000828210156118c057634e487b7160e01b600052601160045260246000fd5b500390565b60005b838110156118e05781810151838201526020016118c8565b8381111561098e5750506000910152565b6001600160a01b03811681146105ea57600080fdfea264697066735822122074973db380099455bd2e54ea948fd7df0b124b834c328e144d8e1658b470abe164736f6c63430008060033000000000000000000000000972a785b390d05123497169a04c72de652493be1000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

Deployed Bytecode

0x60806040526004361061008a5760003560e01c80635705ae43116100595780635705ae43146101b0578063715018a6146101d05780638da5cb5b146101e5578063d333555314610203578063f2fde38b1461022357600080fd5b80632a6f30d8146101065780632d857141146101195780633fc8cef31461012c578063550ba3671461017c57600080fd5b3661010157336001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216146100ff5760405162461bcd60e51b815260206004820152601060248201526f0e4cac6cad2ecca5edcdee85aeecae8d60831b60448201526064015b60405180910390fd5b005b600080fd5b6100ff6101143660046117a9565b610243565b6100ff6101273660046117a9565b6102b6565b34801561013857600080fd5b506101607f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6040516001600160a01b03909116815260200160405180910390f35b34801561018857600080fd5b506101607f000000000000000000000000972a785b390d05123497169a04c72de652493be181565b3480156101bc57600080fd5b506100ff6101cb366004611729565b61032f565b3480156101dc57600080fd5b506100ff6103f5565b3480156101f157600080fd5b506000546001600160a01b0316610160565b34801561020f57600080fd5b506100ff61021e366004611777565b610467565b34801561022f57600080fd5b506100ff61023e3660046116b5565b610552565b33321461028b5760405162461bcd60e51b81526020600482015260166024820152754265746152756e6e6572426173652f6e6f742d656f6160501b60448201526064016100f6565b610296833383610762565b6102a43386868686866109a9565b6102af843384610da5565b5050505050565b3332146102fe5760405162461bcd60e51b81526020600482015260166024820152754265746152756e6e6572426173652f6e6f742d656f6160501b60448201526064016100f6565b610309338684610f29565b9150610316843384610762565b610324338686868686610fd9565b6102af833383610da5565b6000546001600160a01b031633146103595760405162461bcd60e51b81526004016100f69061186b565b6000198114156103dd576040516370a0823160e01b81523060048201526001600160a01b038316906370a082319060240160206040518083038186803b1580156103a257600080fd5b505afa1580156103b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103da9190611790565b90505b6103f16001600160a01b03831633836112f6565b5050565b6000546001600160a01b0316331461041f5760405162461bcd60e51b81526004016100f69061186b565b60405162461bcd60e51b815260206004820152601a60248201527f72656e6f756e63654f776e6572736869702f64697361626c656400000000000060448201526064016100f6565b6000546001600160a01b031633146104915760405162461bcd60e51b81526004016100f69061186b565b60001981141561049e5750475b60408051600080825260208201909252339083906040516104bf91906117fb565b60006040518083038185875af1925050503d80600081146104fc576040519150601f19603f3d011682016040523d82523d6000602084013e610501565b606091505b50509050806103f15760405162461bcd60e51b815260206004820152601e60248201527f7265636f7665724554482f6574682d7472616e736665722d6661696c6564000060448201526064016100f6565b6000546001600160a01b0316331461057c5760405162461bcd60e51b81526004016100f69061186b565b6001600160a01b0381166105e15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100f6565b6105ea81611326565b50565b8015806106765750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561063c57600080fd5b505afa158015610650573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106749190611790565b155b6106e15760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016100f6565b6040516001600160a01b03831660248201526044810182905261074490849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611376565b505050565b60606107588484600085611448565b90505b9392505050565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316836001600160a01b03161415610994576001600160a01b03821633146107f45760405162461bcd60e51b815260206004820152601b60248201527f5f7472616e73666572496e2f6e6f742d66726f6d2d73656e646572000000000060448201526064016100f6565b348111156108505760405162461bcd60e51b815260206004820152602360248201527f5f7472616e73666572496e2f696e73756666696369656e742d6574682d616d6f6044820152621d5b9d60ea1b60648201526084016100f6565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156108ab57600080fd5b505af11580156108bf573d6000803e3d6000fd5b5050505050803411156107445760006001600160a01b0383166108e283346118a0565b604080516000815260208101918290526108fb916117fb565b60006040518083038185875af1925050503d8060008114610938576040519150601f19603f3d011682016040523d82523d6000602084013e61093d565b606091505b505090508061098e5760405162461bcd60e51b815260206004820152601f60248201527f5f7472616e73666572496e2f6574682d7472616e736665722d6661696c65640060448201526064016100f6565b50505050565b6107446001600160a01b038416833084611570565b600019851415610a6557604051637b8feacb60e11b81526001600160a01b038781166004830152858116602483015284811660448301527f000000000000000000000000972a785b390d05123497169a04c72de652493be1169063f71fd59690606401602060405180830381600087803b158015610a2657600080fd5b505af1158015610a3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5e9190611790565b9450610c6e565b60405163e507470960e01b81526001600160a01b0387811660048301526024820187905260009182917f000000000000000000000000972a785b390d05123497169a04c72de652493be1169063e507470990604401604080518083038186803b158015610ad157600080fd5b505afa158015610ae5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0991906116ef565b91509150816001600160a01b0316856001600160a01b031614610b795760405162461bcd60e51b815260206004820152602260248201527f5f626f72726f772f636f6c6c61746572616c2d6e6f742d5f636f6c6c61746572604482015261185b60f21b60648201526084016100f6565b604051630cf351b560e31b81526001600160a01b0382811660048301527f000000000000000000000000972a785b390d05123497169a04c72de652493be1169063679a8da89060240160206040518083038186803b158015610bda57600080fd5b505afa158015610bee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1291906116d2565b6001600160a01b0316866001600160a01b031614610c6b5760405162461bcd60e51b81526020600482015260166024820152755f626f72726f772f6261642d756e6465726c79696e6760501b60448201526064016100f6565b50505b610c99837f000000000000000000000000972a785b390d05123497169a04c72de652493be1836115a8565b6040516315d21c8d60e11b81526001600160a01b037f000000000000000000000000972a785b390d05123497169a04c72de652493be11690632ba4391a90610ce990899089908690600401611817565b600060405180830381600087803b158015610d0357600080fd5b505af1158015610d17573d6000803e3d6000fd5b505060405163c1bce0b760e01b81526001600160a01b037f000000000000000000000000972a785b390d05123497169a04c72de652493be116925063c1bce0b79150610d6b90899089908790600401611817565b600060405180830381600087803b158015610d8557600080fd5b505af1158015610d99573d6000803e3d6000fd5b50505050505050505050565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316836001600160a01b03161415610f1557604051632e1a7d4d60e01b8152600481018290527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015610e4157600080fd5b505af1158015610e55573d6000803e3d6000fd5b5050604080516000808252602082019283905293506001600160a01b03861692508491610e8291906117fb565b60006040518083038185875af1925050503d8060008114610ebf576040519150601f19603f3d011682016040523d82523d6000602084013e610ec4565b606091505b505090508061098e5760405162461bcd60e51b815260206004820181905260248201527f5f7472616e736665724f75742f6574682d7472616e736665722d6661696c656460448201526064016100f6565b6107446001600160a01b03841683836112f6565b604051620c3a4160e11b81526001600160a01b038481166004830152602482018490526000916107589184917f000000000000000000000000972a785b390d05123497169a04c72de652493be1909116906218748290604401602060405180830381600087803b158015610f9c57600080fd5b505af1158015610fb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd49190611790565b611666565b60405163e507470960e01b81526001600160a01b0387811660048301526024820187905260009182917f000000000000000000000000972a785b390d05123497169a04c72de652493be1169063e507470990604401604080518083038186803b15801561104557600080fd5b505afa158015611059573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107d91906116ef565b91509150816001600160a01b0316856001600160a01b0316146110ec5760405162461bcd60e51b815260206004820152602160248201527f5f72657061792f636f6c6c61746572616c2d6e6f742d5f636f6c6c61746572616044820152601b60fa1b60648201526084016100f6565b604051630cf351b560e31b81526001600160a01b0382811660048301527f000000000000000000000000972a785b390d05123497169a04c72de652493be1169063679a8da89060240160206040518083038186803b15801561114d57600080fd5b505afa158015611161573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118591906116d2565b6001600160a01b0316866001600160a01b0316146111dd5760405162461bcd60e51b81526020600482015260156024820152745f72657061792f6261642d756e6465726c79696e6760581b60448201526064016100f6565b6111e88682866115a8565b604051638cd2e0c760e01b81526001600160a01b037f000000000000000000000000972a785b390d05123497169a04c72de652493be11690638cd2e0c790611238908b908b908990600401611817565b600060405180830381600087803b15801561125257600080fd5b505af1158015611266573d6000803e3d6000fd5b505060405163c640e9bf60e01b81526001600160a01b037f000000000000000000000000972a785b390d05123497169a04c72de652493be116925063c640e9bf91506112ba908b908b908890600401611817565b600060405180830381600087803b1580156112d457600080fd5b505af11580156112e8573d6000803e3d6000fd5b505050505050505050505050565b6040516001600160a01b03831660248201526044810182905261074490849063a9059cbb60e01b9060640161070d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006113cb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166107499092919063ffffffff16565b80519091501561074457808060200190518101906113e99190611755565b6107445760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016100f6565b6060824710156114a95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016100f6565b843b6114f75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016100f6565b600080866001600160a01b0316858760405161151391906117fb565b60006040518083038185875af1925050503d8060008114611550576040519150601f19603f3d011682016040523d82523d6000602084013e611555565b606091505b509150915061156582828661167c565b979650505050505050565b6040516001600160a01b038085166024830152831660448201526064810182905261098e9085906323b872dd60e01b9060840161070d565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e9060440160206040518083038186803b1580156115f357600080fd5b505afa158015611607573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162b9190611790565b90508181101561098e578015611650576116506001600160a01b0385168460006105ed565b61098e6001600160a01b038516846000196105ed565b6000818310611675578161075b565b5090919050565b6060831561168b57508161075b565b82511561169b5782518084602001fd5b8160405162461bcd60e51b81526004016100f69190611838565b6000602082840312156116c757600080fd5b813561075b816118f1565b6000602082840312156116e457600080fd5b815161075b816118f1565b6000806040838503121561170257600080fd5b825161170d816118f1565b602084015190925061171e816118f1565b809150509250929050565b6000806040838503121561173c57600080fd5b8235611747816118f1565b946020939093013593505050565b60006020828403121561176757600080fd5b8151801515811461075b57600080fd5b60006020828403121561178957600080fd5b5035919050565b6000602082840312156117a257600080fd5b5051919050565b600080600080600060a086880312156117c157600080fd5b8535945060208601356117d3816118f1565b935060408601356117e3816118f1565b94979396509394606081013594506080013592915050565b6000825161180d8184602087016118c5565b9190910192915050565b6001600160a01b039390931683526020830191909152604082015260600190565b60208152600082518060208401526118578160408501602087016118c5565b601f01601f19169190910160400192915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000828210156118c057634e487b7160e01b600052601160045260246000fd5b500390565b60005b838110156118e05781810151838201526020016118c8565b8381111561098e5750506000910152565b6001600160a01b03811681146105ea57600080fdfea264697066735822122074973db380099455bd2e54ea948fd7df0b124b834c328e144d8e1658b470abe164736f6c63430008060033

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

000000000000000000000000972a785b390d05123497169a04c72de652493be1000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

-----Decoded View---------------
Arg [0] : _betaBank (address): 0x972a785b390D05123497169a04c72dE652493BE1
Arg [1] : _weth (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000972a785b390d05123497169a04c72de652493be1
Arg [1] : 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
Loading...
Loading
[ 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.