ETH Price: $2,551.39 (-2.27%)

Contract

0x2ffa85f655752fB2aCB210287c60b9ef335f5b6E
 
Transaction Hash
Method
Block
From
To
Burn201042482024-06-16 12:07:11129 days ago1718539631IN
0x2ffa85f6...f335f5b6E
0 ETH0.000956513.62802343
Mint200886822024-06-14 7:54:11131 days ago1718351651IN
0x2ffa85f6...f335f5b6E
0 ETH0.0033300912.10782191
Approve198059502024-05-05 19:22:35171 days ago1714936955IN
0x2ffa85f6...f335f5b6E
0 ETH0.000278625.32329445
Burn197969412024-05-04 13:08:11172 days ago1714828091IN
0x2ffa85f6...f335f5b6E
0 ETH0.002051977.82162904
Burn197709482024-04-30 21:56:47176 days ago1714514207IN
0x2ffa85f6...f335f5b6E
0 ETH0.002052537.79952124
Burn197637732024-04-29 21:53:59177 days ago1714427639IN
0x2ffa85f6...f335f5b6E
0 ETH0.002020157.33912288
Mint197614982024-04-29 14:15:35177 days ago1714400135IN
0x2ffa85f6...f335f5b6E
0 ETH0.002999969.57666547
Approve196346942024-04-11 20:15:11195 days ago1712866511IN
0x2ffa85f6...f335f5b6E
0 ETH0.0008715716.76337841
Burn196317862024-04-11 10:28:35195 days ago1712831315IN
0x2ffa85f6...f335f5b6E
0 ETH0.0047987218.93616485
Burn196317742024-04-11 10:26:11195 days ago1712831171IN
0x2ffa85f6...f335f5b6E
0 ETH0.005397419.57979131
Borrow194147762024-03-11 22:17:35226 days ago1710195455IN
0x2ffa85f6...f335f5b6E
0 ETH0.06674562.99242095
Mint191872482024-02-09 1:17:23258 days ago1707441443IN
0x2ffa85f6...f335f5b6E
0 ETH0.0124717345.27947313
Borrow191057522024-01-28 14:53:59269 days ago1706453639IN
0x2ffa85f6...f335f5b6E
0 ETH0.0109119714.47761019
Borrow191033252024-01-28 6:43:23270 days ago1706424203IN
0x2ffa85f6...f335f5b6E
0 ETH0.0087557111.35992845
Mint190998162024-01-27 18:51:11270 days ago1706381471IN
0x2ffa85f6...f335f5b6E
0 ETH0.0035891912.56967527
Borrow190971372024-01-27 9:51:11270 days ago1706349071IN
0x2ffa85f6...f335f5b6E
0 ETH0.00946412.29775486
Borrow190971312024-01-27 9:49:59270 days ago1706348999IN
0x2ffa85f6...f335f5b6E
0 ETH0.0115273112.2623987
Transfer185439042023-11-10 20:23:35348 days ago1699647815IN
0x2ffa85f6...f335f5b6E
0 ETH0.0026305849.94755209
Transfer178141732023-07-31 16:26:23450 days ago1690820783IN
0x2ffa85f6...f335f5b6E
0 ETH0.0009815329.95513668
Burn174703132023-06-13 9:54:23498 days ago1686650063IN
0x2ffa85f6...f335f5b6E
0 ETH0.0036140414.64996124
Margin Trade168687892023-03-20 12:08:59583 days ago1679314139IN
0x2ffa85f6...f335f5b6E
0 ETH0.0172716515.4736463
Margin Trade156469832022-09-30 15:15:23754 days ago1664550923IN
0x2ffa85f6...f335f5b6E
0 ETH0.0259885424.52934734
Margin Trade155267032022-09-13 11:34:29771 days ago1663068869IN
0x2ffa85f6...f335f5b6E
0 ETH0.01240111.71785735
Margin Trade151855052022-07-21 10:58:33825 days ago1658401113IN
0x2ffa85f6...f335f5b6E
0 ETH0.009830619.49518812
Burn150820552022-07-05 10:52:14841 days ago1657018334IN
0x2ffa85f6...f335f5b6E
0 ETH0.0025579911.84284998
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
135076962021-10-28 19:51:471091 days ago1635450707
0x2ffa85f6...f335f5b6E
10 ETH
129415022021-08-01 19:29:261179 days ago1627846166
0x2ffa85f6...f335f5b6E
40 ETH
129413052021-08-01 18:46:081179 days ago1627843568
0x2ffa85f6...f335f5b6E
40 ETH
125862042021-06-07 7:55:401234 days ago1623052540
0x2ffa85f6...f335f5b6E
30 ETH
125739912021-06-05 10:38:171236 days ago1622889497
0x2ffa85f6...f335f5b6E
25 ETH
121729782021-04-04 12:03:241298 days ago1617537804
0x2ffa85f6...f335f5b6E
44.90492343 ETH
121680882021-04-03 17:56:271299 days ago1617472587
0x2ffa85f6...f335f5b6E
1.86914465 ETH
120922442021-03-23 1:53:441311 days ago1616464424
0x2ffa85f6...f335f5b6E
2.67190619 ETH
119364122021-02-27 1:32:271335 days ago1614389547
0x2ffa85f6...f335f5b6E
2 ETH
119061592021-02-22 10:03:091339 days ago1613988189
0x2ffa85f6...f335f5b6E
10 ETH
118780152021-02-18 2:03:091344 days ago1613613789
0x2ffa85f6...f335f5b6E
5 ETH
118779902021-02-18 1:58:161344 days ago1613613496
0x2ffa85f6...f335f5b6E
5 ETH
118622322021-02-15 15:42:551346 days ago1613403775
0x2ffa85f6...f335f5b6E
64.99846542 ETH
118385732021-02-12 0:28:191350 days ago1613089699
0x2ffa85f6...f335f5b6E
10 ETH
118192712021-02-09 1:22:151353 days ago1612833735
0x2ffa85f6...f335f5b6E
4.5 ETH
117592342021-01-30 19:48:421362 days ago1612036122
0x2ffa85f6...f335f5b6E
2 ETH
117586172021-01-30 17:27:091362 days ago1612027629
0x2ffa85f6...f335f5b6E
11.5 ETH
117327732021-01-26 17:40:561366 days ago1611682856
0x2ffa85f6...f335f5b6E
2 ETH
117222332021-01-25 2:52:121368 days ago1611543132
0x2ffa85f6...f335f5b6E
2.5 ETH
117117782021-01-23 12:20:351369 days ago1611404435
0x2ffa85f6...f335f5b6E
2.14803648 ETH
116537792021-01-14 14:36:551378 days ago1610635015
0x2ffa85f6...f335f5b6E
8 ETH
116087822021-01-07 16:56:581385 days ago1610038618
0x2ffa85f6...f335f5b6E
5 ETH
115965112021-01-05 19:43:401387 days ago1609875820
0x2ffa85f6...f335f5b6E
10 ETH
115901322021-01-04 20:22:211388 days ago1609791741
0x2ffa85f6...f335f5b6E
10.33722055 ETH
115827762021-01-03 17:08:301389 days ago1609693710
0x2ffa85f6...f335f5b6E
10 ETH
View All Internal Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x32E4c68B...604Ab9c15
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
LoanToken

Compiler Version
v0.5.17+commit.d19bba13

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, Apache-2.0 license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2020-09-03
*/

/**
 * Copyright 2017-2020, bZeroX, LLC <https://bzx.network/>. All Rights Reserved.
 * Licensed under the Apache License, Version 2.0.
 */

pragma solidity 0.5.17;


interface IWeth {
    function deposit() external payable;
    function withdraw(uint256 wad) external;
}

contract IERC20 {
    string public name;
    uint8 public decimals;
    string public symbol;
    function totalSupply() public view returns (uint256);
    function balanceOf(address _who) public view returns (uint256);
    function allowance(address _owner, address _spender) public view returns (uint256);
    function approve(address _spender, uint256 _value) public returns (bool);
    function transfer(address _to, uint256 _value) public returns (bool);
    function transferFrom(address _from, address _to, uint256 _value) public returns (bool);
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

contract IWethERC20 is IWeth, IERC20 {}

/**
 * @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, 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) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     *
     * _Available since v2.4.0._
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

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

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts 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) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     *
     * _Available since v2.4.0._
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b != 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
    * @dev Integer division of two numbers, rounding up and truncating the quotient
    */
    function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
        return divCeil(a, b, "SafeMath: division by zero");
    }

    /**
    * @dev Integer division of two numbers, rounding up and truncating the quotient
    */
    function divCeil(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b != 0, errorMessage);

        if (a == 0) {
            return 0;
        }
        uint256 c = ((a - 1) / b) + 1;

        return c;
    }

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

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message 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.
     *
     * _Available since v2.4.0._
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }

    function min256(uint256 _a, uint256 _b) internal pure returns (uint256) {
        return _a < _b ? _a : _b;
    }
}

/**
 * @title SignedSafeMath
 * @dev Signed math operations with safety checks that revert on error.
 */
library SignedSafeMath {
    int256 constant private _INT256_MIN = -2**255;

        /**
     * @dev Returns the multiplication of two signed integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(int256 a, int256 b) internal pure returns (int256) {
        // 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 0;
        }

        require(!(a == -1 && b == _INT256_MIN), "SignedSafeMath: multiplication overflow");

        int256 c = a * b;
        require(c / a == b, "SignedSafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two signed integers. Reverts 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(int256 a, int256 b) internal pure returns (int256) {
        require(b != 0, "SignedSafeMath: division by zero");
        require(!(b == -1 && a == _INT256_MIN), "SignedSafeMath: division overflow");

        int256 c = a / b;

        return c;
    }

    /**
     * @dev Returns the subtraction of two signed integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(int256 a, int256 b) internal pure returns (int256) {
        int256 c = a - b;
        require((b >= 0 && c <= a) || (b < 0 && c > a), "SignedSafeMath: subtraction overflow");

        return c;
    }

    /**
     * @dev Returns the addition of two signed integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(int256 a, int256 b) internal pure returns (int256) {
        int256 c = a + b;
        require((b >= 0 && c >= a) || (b < 0 && c < a), "SignedSafeMath: addition overflow");

        return c;
    }
}

/**
 * @title Helps contracts guard against reentrancy attacks.
 * @author Remco Bloemen <remco@2π.com>, Eenae <[email protected]>
 * @dev If you mark a function `nonReentrant`, you should also
 * mark it `external`.
 */
contract ReentrancyGuard {

    /// @dev Constant for unlocked guard state - non-zero to prevent extra gas costs.
    /// See: https://github.com/OpenZeppelin/openzeppelin-solidity/issues/1056
    uint256 internal constant REENTRANCY_GUARD_FREE = 1;

    /// @dev Constant for locked guard state
    uint256 internal constant REENTRANCY_GUARD_LOCKED = 2;

    /**
    * @dev We use a single lock for the whole contract.
    */
    uint256 internal reentrancyLock = REENTRANCY_GUARD_FREE;

    /**
    * @dev Prevents a contract from calling itself, directly or indirectly.
    * If you mark a function `nonReentrant`, you should also
    * mark it `external`. Calling one `nonReentrant` function from
    * another is not supported. Instead, you can implement a
    * `private` function doing the actual work, and an `external`
    * wrapper marked as `nonReentrant`.
    */
    modifier nonReentrant() {
        require(reentrancyLock == REENTRANCY_GUARD_FREE, "nonReentrant");
        reentrancyLock = REENTRANCY_GUARD_LOCKED;
        _;
        reentrancyLock = REENTRANCY_GUARD_FREE;
    }
}

/**
 * @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) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }

    /**
     * @dev Converts an `address` into `address payable`. Note that this is
     * simply a type cast: the actual underlying value is not changed.
     *
     * _Available since v2.4.0._
     */
    function toPayable(address account) internal pure returns (address payable) {
        return address(uint160(account));
    }

    /**
     * @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].
     *
     * _Available since v2.4.0._
     */
    function sendValue(address recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
contract Context {
    // Empty internal constructor, to prevent people from mistakenly deploying
    // an instance of this contract, which should be used via inheritance.
    constructor () internal { }
    // solhint-disable-previous-line no-empty-blocks

    function _msgSender() internal view returns (address payable) {
        return msg.sender;
    }

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

/**
 * @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.
 *
 * 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.
 */
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 () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(isOwner(), "unauthorized");
        _;
    }

    /**
     * @dev Returns true if the caller is the current owner.
     */
    function isOwner() public view returns (bool) {
        return _msgSender() == _owner;
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public onlyOwner {
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     */
    function _transferOwnership(address newOwner) internal {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

contract Pausable {

    // keccak256("Pausable_FunctionPause")
    bytes32 internal constant Pausable_FunctionPause = 0xa7143c84d793a15503da6f19bf9119a2dac94448ca45d77c8bf08f57b2e91047;

    modifier pausable(bytes4 sig) {
        require(!_isPaused(sig), "unauthorized");
        _;
    }

    function _isPaused(
        bytes4 sig)
        internal
        view
        returns (bool isPaused)
    {
        bytes32 slot = keccak256(abi.encodePacked(sig, Pausable_FunctionPause));
        assembly {
            isPaused := sload(slot)
        }
    }
}

contract LoanTokenBase is ReentrancyGuard, Ownable, Pausable {

    uint256 internal constant WEI_PRECISION = 10**18;
    uint256 internal constant WEI_PERCENT_PRECISION = 10**20;

    int256 internal constant sWEI_PRECISION = 10**18;

    string public name;
    string public symbol;
    uint8 public decimals;

    // uint88 for tight packing -> 8 + 88 + 160 = 256
    uint88 internal lastSettleTime_;

    address public loanTokenAddress;

    uint256 public baseRate;
    uint256 public rateMultiplier;
    uint256 public lowUtilBaseRate;
    uint256 public lowUtilRateMultiplier;

    uint256 public targetLevel;
    uint256 public kinkLevel;
    uint256 public maxScaleRate;

    uint256 internal _flTotalAssetSupply;
    uint256 public checkpointSupply;
    uint256 public initialPrice;

    mapping (uint256 => bytes32) public loanParamsIds; // mapping of keccak256(collateralToken, isTorqueLoan) to loanParamsId
    mapping (address => uint256) internal checkpointPrices_; // price of token at last user checkpoint
}

contract AdvancedTokenStorage is LoanTokenBase {
    using SafeMath for uint256;

    event Transfer(
        address indexed from,
        address indexed to,
        uint256 value
    );

    event Approval(
        address indexed owner,
        address indexed spender,
        uint256 value
    );

    event Mint(
        address indexed minter,
        uint256 tokenAmount,
        uint256 assetAmount,
        uint256 price
    );

    event Burn(
        address indexed burner,
        uint256 tokenAmount,
        uint256 assetAmount,
        uint256 price
    );

    mapping(address => uint256) internal balances;
    mapping (address => mapping (address => uint256)) internal allowed;
    uint256 internal totalSupply_;

    function totalSupply()
        public
        view
        returns (uint256)
    {
        return totalSupply_;
    }

    function balanceOf(
        address _owner)
        public
        view
        returns (uint256)
    {
        return balances[_owner];
    }

    function allowance(
        address _owner,
        address _spender)
        public
        view
        returns (uint256)
    {
        return allowed[_owner][_spender];
    }
}

contract LoanToken is AdvancedTokenStorage {

    address internal target_;

    constructor(
        address _newOwner,
        address _newTarget)
        public
    {
        transferOwnership(_newOwner);
        _setTarget(_newTarget);
    }

    function()
        external
        payable
    {
        if (gasleft() <= 2300) {
            return;
        }

        address target = target_;
        bytes memory data = msg.data;
        assembly {
            let result := delegatecall(gas, target, add(data, 0x20), mload(data), 0, 0)
            let size := returndatasize
            let ptr := mload(0x40)
            returndatacopy(ptr, 0, size)
            switch result
            case 0 { revert(ptr, size) }
            default { return(ptr, size) }
        }
    }

    function setTarget(
        address _newTarget)
        public
        onlyOwner
    {
        _setTarget(_newTarget);
    }

    function _setTarget(
        address _newTarget)
        internal
    {
        require(Address.isContract(_newTarget), "target not a contract");
        target_ = _newTarget;
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"},{"internalType":"address","name":"_newTarget","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"burner","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"minter","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"constant":true,"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"baseRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"checkpointSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"initialPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kinkLevel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"loanParamsIds","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"loanTokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lowUtilBaseRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lowUtilRateMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maxScaleRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rateMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_newTarget","type":"address"}],"name":"setTarget","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"targetLevel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x60806040526004361061012a5760003560e01c8063797bf385116100ab57806395d89b411161006f57806395d89b41146103ff578063ba0e43bf14610414578063d759dbeb14610429578063dd62ed3e1461043e578063ef2b0b3914610479578063f2fde38b1461048e5761012a565b8063797bf385146103665780637b7933b4146103975780637e37c08c146103ac5780638da5cb5b146103c15780638f32d59b146103d65761012a565b80633291c11a116100f25780633291c11a146102ac578063330691ac146102d657806356e07d70146102eb57806370a0823114610300578063776d1a01146103335761012a565b806306fdde03146101a657806318160ddd146102305780631d0806ae146102575780631f68f20a1461026c578063313ce56714610281575b6108fc5a11610138576101a4565b60145460408051602036601f81018290048202830182019093528282526001600160a01b039093169260609260009181908401838280828437600092018290525084519495509384935091505060208401855af43d604051816000823e8280156101a0578282f35b8282fd5b005b3480156101b257600080fd5b506101bb6104c1565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101f55781810151838201526020016101dd565b50505050905090810190601f1680156102225780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023c57600080fd5b5061024561054c565b60408051918252519081900360200190f35b34801561026357600080fd5b50610245610552565b34801561027857600080fd5b50610245610558565b34801561028d57600080fd5b5061029661055e565b6040805160ff9092168252519081900360200190f35b3480156102b857600080fd5b50610245600480360360208110156102cf57600080fd5b5035610567565b3480156102e257600080fd5b50610245610579565b3480156102f757600080fd5b5061024561057f565b34801561030c57600080fd5b506102456004803603602081101561032357600080fd5b50356001600160a01b0316610585565b34801561033f57600080fd5b506101a46004803603602081101561035657600080fd5b50356001600160a01b03166105a0565b34801561037257600080fd5b5061037b6105f4565b604080516001600160a01b039092168252519081900360200190f35b3480156103a357600080fd5b5061024561060a565b3480156103b857600080fd5b50610245610610565b3480156103cd57600080fd5b5061037b610616565b3480156103e257600080fd5b506103eb610625565b604080519115158252519081900360200190f35b34801561040b57600080fd5b506101bb61064b565b34801561042057600080fd5b506102456106a6565b34801561043557600080fd5b506102456106ac565b34801561044a57600080fd5b506102456004803603604081101561046157600080fd5b506001600160a01b03813581169160200135166106b2565b34801561048557600080fd5b506102456106dd565b34801561049a57600080fd5b506101a4600480360360208110156104b157600080fd5b50356001600160a01b03166106e3565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156105445780601f1061051957610100808354040283529160200191610544565b820191906000526020600020905b81548152906001019060200180831161052757829003601f168201915b505050505081565b60135490565b600e5481565b60055481565b60045460ff1681565b600f6020526000908152604090205481565b60065481565b600a5481565b6001600160a01b031660009081526011602052604090205490565b6105a8610625565b6105e8576040805162461bcd60e51b815260206004820152600c60248201526b1d5b985d5d1a1bdc9a5e995960a21b604482015290519081900360640190fd5b6105f181610734565b50565b600454600160601b90046001600160a01b031681565b600d5481565b60085481565b6001546001600160a01b031690565b6001546000906001600160a01b031661063c6107a8565b6001600160a01b031614905090565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105445780601f1061051957610100808354040283529160200191610544565b60095481565b60075481565b6001600160a01b03918216600090815260126020908152604080832093909416825291909152205490565b600b5481565b6106eb610625565b61072b576040805162461bcd60e51b815260206004820152600c60248201526b1d5b985d5d1a1bdc9a5e995960a21b604482015290519081900360640190fd5b6105f1816107ac565b61073d8161084d565b610786576040805162461bcd60e51b81526020600482015260156024820152741d185c99d95d081b9bdd08184818dbdb9d1c9858dd605a1b604482015290519081900360640190fd5b601480546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b6001600160a01b0381166107f15760405162461bcd60e51b815260040180806020018281038252602681526020018061088a6026913960400191505060405180910390fd5b6001546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061088157508115155b94935050505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a265627a7a723158208e159523001d7b30b1641290c62dffd797f6077e0bcbf6b86ce07051a8c0caad64736f6c63430005110032

Deployed Bytecode Sourcemap

20280:1151:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20623:4;20610:9;:17;20606:56;;20644:7;;20606:56;20691:7;;20709:28;;;;20729:8;20709:28;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;20691:7:0;;;;20709:17;;-1:-1:-1;;20729:8:0;;20709:28;;-1:-1:-1;20729:8:0;;-1:-1:-1;20709:28:0;1:33:-1;99:1;81:16;;74:27;;;-1:-1;20829:11:0;;20709:28;;-1:-1:-1;99:1;;;-1:-1;20829:11:0;-1:-1:-1;;20822:4:0;20812:15;;20804:6;20799:3;20786:61;20873:14;20918:4;20912:11;20960:4;20957:1;20952:3;20937:28;20986:6;21006:28;;;;21070:4;21065:3;21058:17;21006:28;21027:4;21022:3;21015:17;20757:331;20280:1151;18214:18;;8:9:-1;5:2;;;30:1;27;20:12;5:2;18214:18:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;18214:18:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19800:123;;8:9:-1;5:2;;;30:1;27;20:12;5:2;19800:123:0;;;:::i;:::-;;;;;;;;;;;;;;;;18760:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;18760:27:0;;;:::i;18431:23::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;18431:23:0;;;:::i;18266:21::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;18266:21:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;;18796:49;;8:9:-1;5:2;;;30:1;27;20:12;5:2;18796:49:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;18796:49:0;;:::i;18461:29::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;18461:29:0;;;:::i;18612:24::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;18612:24:0;;;:::i;19931:149::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;19931:149:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;19931:149:0;-1:-1:-1;;;;;19931:149:0;;:::i;21103:130::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;21103:130:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;21103:130:0;-1:-1:-1;;;;;21103:130:0;;:::i;18391:31::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;18391:31:0;;;:::i;:::-;;;;-1:-1:-1;;;;;18391:31:0;;;;;;;;;;;;;;18722;;8:9:-1;5:2;;;30:1;27;20:12;5:2;18722:31:0;;;:::i;18534:36::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;18534:36:0;;;:::i;16339:79::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;16339:79:0;;;:::i;16685:94::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;16685:94:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;18239:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;18239:20:0;;;:::i;18579:26::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;18579:26:0;;;:::i;18497:30::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;18497:30:0;;;:::i;20088:185::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;20088:185:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;20088:185:0;;;;;;;;;;:::i;18643:27::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;18643:27:0;;;:::i;16934:109::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;16934:109:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;16934:109:0;-1:-1:-1;;;;;16934:109:0;;:::i;18214:18::-;;;;;;;;;;;;;;-1:-1:-1;;18214:18:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;19800:123::-;19903:12;;19800:123;:::o;18760:27::-;;;;:::o;18431:23::-;;;;:::o;18266:21::-;;;;;;:::o;18796:49::-;;;;;;;;;;;;;:::o;18461:29::-;;;;:::o;18612:24::-;;;;:::o;19931:149::-;-1:-1:-1;;;;;20056:16:0;20024:7;20056:16;;;:8;:16;;;;;;;19931:149::o;21103:130::-;16551:9;:7;:9::i;:::-;16543:34;;;;;-1:-1:-1;;;16543:34:0;;;;;;;;;;;;-1:-1:-1;;;16543:34:0;;;;;;;;;;;;;;;21203:22;21214:10;21203;:22::i;:::-;21103:130;:::o;18391:31::-;;;-1:-1:-1;;;18391:31:0;;-1:-1:-1;;;;;18391:31:0;;:::o;18722:::-;;;;:::o;18534:36::-;;;;:::o;16339:79::-;16404:6;;-1:-1:-1;;;;;16404:6:0;16339:79;:::o;16685:94::-;16765:6;;16725:4;;-1:-1:-1;;;;;16765:6:0;16749:12;:10;:12::i;:::-;-1:-1:-1;;;;;16749:22:0;;16742:29;;16685:94;:::o;18239:20::-;;;;;;;;;;;;;;;-1:-1:-1;;18239:20:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18579:26;;;;:::o;18497:30::-;;;;:::o;20088:185::-;-1:-1:-1;;;;;20240:15:0;;;20208:7;20240:15;;;:7;:15;;;;;;;;:25;;;;;;;;;;;;;20088:185::o;18643:27::-;;;;:::o;16934:109::-;16551:9;:7;:9::i;:::-;16543:34;;;;;-1:-1:-1;;;16543:34:0;;;;;;;;;;;;-1:-1:-1;;;16543:34:0;;;;;;;;;;;;;;;17007:28;17026:8;17007:18;:28::i;21241:187::-;21333:30;21352:10;21333:18;:30::i;:::-;21325:64;;;;;-1:-1:-1;;;21325:64:0;;;;;;;;;;;;-1:-1:-1;;;21325:64:0;;;;;;;;;;;;;;;21400:7;:20;;-1:-1:-1;;;;;;21400:20:0;-1:-1:-1;;;;;21400:20:0;;;;;;;;;;21241:187::o;15130:98::-;15210:10;15130:98;:::o;17149:229::-;-1:-1:-1;;;;;17223:22:0;;17215:73;;;;-1:-1:-1;;;17215:73:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17325:6;;17304:38;;-1:-1:-1;;;;;17304:38:0;;;;17325:6;;17304:38;;17325:6;;17304:38;17353:6;:17;;-1:-1:-1;;;;;;17353:17:0;-1:-1:-1;;;;;17353:17:0;;;;;;;;;;17149:229::o;12041:619::-;12101:4;12569:20;;12412:66;12609:23;;;;;;:42;;-1:-1:-1;12636:15:0;;;12609:42;12601:51;12041:619;-1:-1:-1;;;;12041:619:0:o

Swarm Source

bzzr://8e159523001d7b30b1641290c62dffd797f6077e0bcbf6b86ce07051a8c0caad

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.