ETH Price: $3,103.78 (+1.06%)
Gas: 3 Gwei

Contract

0x4626CEB86aBF6B239e3306382Cca44e5B7113160
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Transfer Ownersh...160459522022-11-25 8:57:47593 days ago1669366667IN
0x4626CEB8...5B7113160
0 ETH0.000282399.86949534
Set Token Feed151460952022-07-15 8:13:23726 days ago1657872803IN
0x4626CEB8...5B7113160
0 ETH0.0007500716.09744396
Set Token Feed151460932022-07-15 8:12:38726 days ago1657872758IN
0x4626CEB8...5B7113160
0 ETH0.0007249315.55777821
Set Token Feed151460922022-07-15 8:12:23726 days ago1657872743IN
0x4626CEB8...5B7113160
0 ETH0.0007222615.50062753
0x60c06040151460362022-07-15 8:00:18726 days ago1657872018IN
 Create: BasketsPriceFeed
0 ETH0.0105707312.40232085

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BasketsPriceFeed

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 9 : BasketsPriceFeed.sol
pragma solidity ^0.8.0;

import {Ownable} from "@openzeppelin/access/Ownable.sol";
import {IBasketFacet} from "./Interfaces/IBasketFacet.sol";
import {ILendingRegistry} from "./Interfaces/ILendingRegistry.sol";
import {IChainLinkOracle} from "./Interfaces/IChainLinkOracle.sol";
import {IERC20} from "@openzeppelin/token/ERC20/IERC20.sol";
import {ILendingLogic} from "./Interfaces/ILendingLogic.sol";
import {IERC20Metadata} from "@openzeppelin/token/ERC20/extensions/IERC20Metadata.sol";

contract BasketsPriceFeed is Ownable {
    IBasketFacet immutable basket;
    ILendingRegistry immutable lendingRegistry;
    uint8 public constant decimals = 18;
    mapping(address => IChainLinkOracle) public linkFeeds;

    constructor (address _basket, address _lendingRegistry) {
        basket = IBasketFacet(_basket);
        lendingRegistry = ILendingRegistry(_lendingRegistry);
    }

    /**
     * Function to retrieve the price of 1 basket token in USD, scaled by 1e18
     *
     * @return usdPrice Price of 1 basket token in USD
     */
    function latestAnswer() external view returns (uint256 usdPrice) {
        address[] memory components = basket.getTokens();

        uint256 marketCapUSD = 0;

        // Gather link prices, component balances, and basket market cap
        for (uint8 i = 0; i < components.length; i++) {
            address component = components[i];
            address underlying = lendingRegistry.wrappedToUnderlying(component);
            IERC20 componentToken = IERC20(component);
            IChainLinkOracle linkFeed;
            if (underlying != address(0)) { // Wrapped tokens
                ILendingLogic lendingLogic = ILendingLogic(lendingRegistry.protocolToLogic(lendingRegistry.wrappedToProtocol(component)));
                linkFeed = linkFeeds[underlying];
                marketCapUSD += (
                    fmul(fmul(componentToken.balanceOf(address(basket)), lendingLogic.exchangeRateView(component), 1 ether),
                    10 ** (36 - IERC20Metadata(address(componentToken)).decimals() - linkFeed.decimals()) * uint256(linkFeed.latestAnswer()),1 ether)
                );
            } else { // Non-wrapped tokens
                linkFeed = linkFeeds[component];
                marketCapUSD += (
                    fmul(componentToken.balanceOf(address(basket)),10 ** (36 - IERC20Metadata(address(componentToken)).decimals() - linkFeed.decimals())  * uint256(linkFeed.latestAnswer()),1 ether)
                );
            }
        }
        usdPrice = fdiv(marketCapUSD, IERC20(address(basket)).totalSupply(), 1 ether);	
	return usdPrice;
    }

    function setTokenFeed(address _token, address _oracle) external onlyOwner {
        linkFeeds[_token] = IChainLinkOracle(_oracle);
    }

    function removeTokenFeed(address _token) external onlyOwner {
        delete linkFeeds[_token];
    }

    function fmul(
        uint256 x,
        uint256 y,
        uint256 baseUnit
    ) internal pure returns (uint256 z) {
        assembly {
            if iszero(eq(div(mul(x,y),x),y)) {revert(0,0)}
            z := div(mul(x,y),baseUnit)
        }
    }

    function fdiv(
        uint256 x,
        uint256 y,
        uint256 baseUnit
    ) internal pure returns (uint256 z) {
        assembly {
            if iszero(eq(div(mul(x,baseUnit),x),baseUnit)) {revert(0,0)}
            z := div(mul(x,baseUnit),y)
        }
    }
}

File 2 of 9 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 9 : IBasketFacet.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IBasketFacet {

    event TokenAdded(address indexed _token);
    event TokenRemoved(address indexed _token);
    event EntryFeeSet(uint256 fee);
    event ExitFeeSet(uint256 fee);
    event AnnualizedFeeSet(uint256 fee);
    event FeeBeneficiarySet(address indexed beneficiary);
    event EntryFeeBeneficiaryShareSet(uint256 share);
    event ExitFeeBeneficiaryShareSet(uint256 share);

    event PoolJoined(address indexed who, uint256 amount);
    event PoolExited(address indexed who, uint256 amount);
    event FeeCharged(uint256 amount);
    event LockSet(uint256 lockBlock);
    event CapSet(uint256 cap);

    /**
        @notice Sets entry fee paid when minting
        @param _fee Amount of fee. 1e18 == 100%, capped at 10%
    */
    function setEntryFee(uint256 _fee) external;

    /**
        @notice Get the entry fee
        @return Current entry fee
    */
    function getEntryFee() external view returns(uint256);

    /**
        @notice Set the exit fee paid when exiting
        @param _fee Amount of fee. 1e18 == 100%, capped at 10%
    */
    function setExitFee(uint256 _fee) external;

    /**
        @notice Get the exit fee
        @return Current exit fee
    */
    function getExitFee() external view returns(uint256);

    /**
        @notice Set the annualized fee. Often referred to as streaming fee
        @param _fee Amount of fee. 1e18 == 100%, capped at 10%
    */
    function setAnnualizedFee(uint256 _fee) external;

    /**
        @notice Get the annualized fee.
        @return Current annualized fee.
    */
    function getAnnualizedFee() external view returns(uint256);

    /**
        @notice Set the address receiving the fees.
    */
    function setFeeBeneficiary(address _beneficiary) external;

    /**
        @notice Get the fee benificiary
        @return The current fee beneficiary
    */
    function getFeeBeneficiary() external view returns(address);

    /**
        @notice Set the fee beneficiaries share of the entry fee
        @notice _share Share of the fee. 1e18 == 100%. Capped at 100%
    */
    function setEntryFeeBeneficiaryShare(uint256 _share) external;

    /**
        @notice Get the entry fee beneficiary share
        @return Feeshare amount
    */
    function getEntryFeeBeneficiaryShare() external view returns(uint256);

    /**
        @notice Set the fee beneficiaries share of the exit fee
        @notice _share Share of the fee. 1e18 == 100%. Capped at 100%
    */
    function setExitFeeBeneficiaryShare(uint256 _share) external;

    /**
        @notice Get the exit fee beneficiary share
        @return Feeshare amount
    */
    function getExitFeeBeneficiaryShare() external view returns(uint256);

    /**
        @notice Calculate the oustanding annualized fee
        @return Amount of pool tokens to be minted to charge the annualized fee
    */
    function calcOutStandingAnnualizedFee() external view returns(uint256);

    /**
        @notice Charges the annualized fee
    */
    function chargeOutstandingAnnualizedFee() external;

    /**
        @notice Pulls underlying from caller and mints the pool token
        @param _amount Amount of pool tokens to mint
    */
    function joinPool(uint256 _amount) external;

    /**
        @notice Burns pool tokens from the caller and returns underlying assets
    */
    function exitPool(uint256 _amount) external;

    /**
        @notice Get if the pool is locked or not. (not accepting exit and entry)
        @return Boolean indicating if the pool is locked
    */
    function getLock() external view returns (bool);

    /**
        @notice Get the block until which the pool is locked
        @return The lock block
    */
    function getLockBlock() external view returns (uint256);

    /**
        @notice Set the lock block
        @param _lock Block height of the lock
    */
    function setLock(uint256 _lock) external;

    /**
        @notice Get the maximum of pool tokens that can be minted
        @return Cap
    */
    function getCap() external view returns (uint256);

    /**
        @notice Set the maximum of pool tokens that can be minted
        @param _maxCap Max cap
    */
    function setCap(uint256 _maxCap) external;

    /**
        @notice Get the amount of tokens owned by the pool
        @param _token Addres of the token
        @return Amount owned by the contract
    */
    function balance(address _token) external view returns (uint256);

    /**
        @notice Get the tokens in the pool
        @return Array of tokens in the pool
    */
    function getTokens() external view returns (address[] memory);

    /**
        @notice Add a token to the pool. Should have at least a balance of 10**6
        @param _token Address of the token to add
    */
    function addToken(address _token) external;

    /**
        @notice Removes a token from the pool
        @param _token Address of the token to remove
    */
    function removeToken(address _token) external;

    /**
        @notice Checks if a token was added to the pool
        @param _token address of the token
        @return If token is in the pool or not
    */
    function getTokenInPool(address _token) external view returns (bool);

    /**
        @notice Calculate the amounts of underlying needed to mint that pool amount.
        @param _amount Amount of pool tokens to mint
        @return tokens Tokens needed
        @return amounts Amounts of underlying needed
    */
    function calcTokensForAmount(uint256 _amount)
        external
        view
        returns (address[] memory tokens, uint256[] memory amounts);

    /**
        @notice Calculate the amounts of underlying to receive when burning that pool amount
        @param _amount Amount of pool tokens to burn
        @return tokens Tokens returned
        @return amounts Amounts of underlying returned
    */
    function calcTokensForAmountExit(uint256 _amount)
        external
        view
        returns (address[] memory tokens, uint256[] memory amounts);
}

File 4 of 9 : ILendingRegistry.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;

interface ILendingRegistry {
    // Maps wrapped token to protocol
    function wrappedToProtocol(address _wrapped) external view returns(bytes32);
    // Maps wrapped token to underlying
    function wrappedToUnderlying(address _wrapped) external view returns(address);
    function underlyingToProtocolWrapped(address _underlying, bytes32 protocol) external view returns (address);
    function protocolToLogic(bytes32 _protocol) external view returns (address);

    /**
        @notice Set which protocl a wrapped token belongs to
        @param _wrapped Address of the wrapped token
        @param _protocol Bytes32 key of the protocol
    */
    function setWrappedToProtocol(address _wrapped, bytes32 _protocol) external;

    /**
        @notice Set what is the underlying for a wrapped token
        @param _wrapped Address of the wrapped token
        @param _underlying Address of the underlying token
    */
    function setWrappedToUnderlying(address _wrapped, address _underlying) external;

    /**
        @notice Set the logic contract for the protocol
        @param _protocol Bytes32 key of the procol
        @param _logic Address of the lending logic contract for that protocol
    */
    function setProtocolToLogic(bytes32 _protocol, address _logic) external;
    /**
        @notice Set the wrapped token for the underlying deposited in this protocol
        @param _underlying Address of the unerlying token
        @param _protocol Bytes32 key of the protocol
        @param _wrapped Address of the wrapped token
    */
    function setUnderlyingToProtocolWrapped(address _underlying, bytes32 _protocol, address _wrapped) external;

    /**
        @notice Get tx data to lend the underlying amount in a specific protocol
        @param _underlying Address of the underlying token
        @param _amount Amount to lend
        @param _protocol Bytes32 key of the protocol
        @return targets Addresses of the src to call
        @return data Calldata for the calls
    */
    function getLendTXData(address _underlying, uint256 _amount, bytes32 _protocol) external view returns(address[] memory targets, bytes[] memory data);

    /**
        @notice Get the tx data to unlend the wrapped amount
        @param _wrapped Address of the wrapped token
        @param _amount Amount of wrapped token to unlend
        @return targets Addresses of the src to call
        @return data Calldata for the calls
    */
    function getUnlendTXData(address _wrapped, uint256 _amount) external view returns(address[] memory targets, bytes[] memory data);
}

File 5 of 9 : IChainLinkOracle.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IChainLinkOracle {
  function decimals() external view returns (uint8);

  function description() external view returns (string memory);

  function latestAnswer() external view returns (int256);

  function latestTimestamp() external view returns (uint256);

  function latestRound() external view returns (uint256);

  function getAnswer(uint256 roundId) external view returns (int256);

  function getTimestamp(uint256 roundId) external view returns (uint256);

  event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 updatedAt);

  event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt);

  function version() external view returns (uint256);

  // getRoundData and latestRoundData should both raise "No data present"
  // if they do not have data to report, instead of returning unset values
  // which could be misinterpreted as actual reported values.
  function getRoundData(uint80 _roundId)
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );

  function latestRoundData()
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );
}

File 6 of 9 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 7 of 9 : ILendingLogic.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface ILendingLogic {
    /**
        @notice Get the APR based on underlying token.
        @param _token Address of the underlying token
        @return Interest with 18 decimals
    */
    function getAPRFromUnderlying(address _token) external view returns(uint256);

    /**
        @notice Get the APR based on wrapped token.
        @param _token Address of the wrapped token
        @return Interest with 18 decimals
    */
    function getAPRFromWrapped(address _token) external view returns(uint256);

    /**
        @notice Get the calls needed to lend.
        @param _underlying Address of the underlying token
        @param _amount Amount of the underlying token
        @return targets Addresses of the src to call
        @return data Calldata of the calls
    */
    function lend(address _underlying, uint256 _amount, address _tokenHolder) external view returns(address[] memory targets, bytes[] memory data);

    /**
        @notice Get the calls needed to unlend
        @param _wrapped Address of the wrapped token
        @param _amount Amount of the underlying tokens
        @return targets Addresses of the src to call
        @return data Calldata of the calls
    */
    function unlend(address _wrapped, uint256 _amount, address _tokenHolder) external view returns(address[] memory targets, bytes[] memory data);

    /**
        @notice Get the underlying wrapped exchange rate
        @param _wrapped Address of the wrapped token
        @return The exchange rate
    */
    function exchangeRate(address _wrapped) external returns(uint256);

    /**
        @notice Get the underlying wrapped exchange rate in a view (non state changing) way
        @param _wrapped Address of the wrapped token
        @return The exchange rate
    */
    function exchangeRateView(address _wrapped) external view returns(uint256);
}

File 8 of 9 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

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

pragma solidity ^0.8.0;

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

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

Settings
{
  "remappings": [
    "@openzeppelin/=lib/openzeppelin-contracts/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "solmate/=lib/solmate/src/",
    "weird-erc20/=lib/weird-erc20/src/",
    "src/=src/",
    "test/=test/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_basket","type":"address"},{"internalType":"address","name":"_lendingRegistry","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":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestAnswer","outputs":[{"internalType":"uint256","name":"usdPrice","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"linkFeeds","outputs":[{"internalType":"contract IChainLinkOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"removeTokenFeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_oracle","type":"address"}],"name":"setTokenFeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c060405234801561001057600080fd5b50604051610f28380380610f2883398101604081905261002f916100bb565b6100383361004f565b6001600160a01b039182166080521660a0526100ee565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146100b657600080fd5b919050565b600080604083850312156100ce57600080fd5b6100d78361009f565b91506100e56020840161009f565b90509250929050565b60805160a051610df961012f6000396000818161023901526102da01526000818161015c015281816103d80152818161066001526108090152610df96000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806387ef019a1161005b57806387ef019a1461010d5780638da5cb5b14610120578063eec5d84a14610131578063f2fde38b1461014457600080fd5b8063313ce5671461008d57806350d25bcd146100ac578063511ee14d146100c2578063715018a614610103575b600080fd5b610095601281565b60405160ff90911681526020015b60405180910390f35b6100b4610157565b6040519081526020016100a3565b6100eb6100d0366004610a88565b6001602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016100a3565b61010b61089e565b005b61010b61011b366004610aac565b6108b2565b6000546001600160a01b03166100eb565b61010b61013f366004610a88565b6108e8565b61010b610152366004610a88565b610917565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663aa6ca8086040518163ffffffff1660e01b8152600401600060405180830381865afa1580156101b8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101e09190810190610b0b565b90506000805b82518160ff161015610802576000838260ff168151811061020957610209610bd0565b6020908102919091010151604051632aabce9960e11b81526001600160a01b0380831660048301529192506000917f000000000000000000000000000000000000000000000000000000000000000016906355579d3290602401602060405180830381865afa158015610280573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a49190610be6565b90508160006001600160a01b0383161561063557604051632df6e47f60e21b81526001600160a01b0385811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063f8b7f42290829063b7db91fc90602401602060405180830381865afa15801561032b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061034f9190610c03565b6040518263ffffffff1660e01b815260040161036d91815260200190565b602060405180830381865afa15801561038a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ae9190610be6565b6001600160a01b03858116600090815260016020526040908190205490516370a0823160e01b81527f0000000000000000000000000000000000000000000000000000000000000000831660048201529082169450919250610623916104d3918616906370a0823190602401602060405180830381865afa158015610437573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045b9190610c03565b60405163269d294760e01b81526001600160a01b03898116600483015285169063269d294790602401602060405180830381865afa1580156104a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c59190610c03565b670de0b6b3a7640000610995565b836001600160a01b03166350d25bcd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610511573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105359190610c03565b846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610573573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105979190610c1c565b866001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f99190610c1c565b610604906024610c55565b61060e9190610c55565b61061990600a610d5e565b6104c59190610d6d565b61062d9088610d8c565b9650506107eb565b506001600160a01b03838116600090815260016020526040908190205490516370a0823160e01b81527f000000000000000000000000000000000000000000000000000000000000000083166004820152908216916107de91908416906370a0823190602401602060405180830381865afa1580156106b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106dc9190610c03565b826001600160a01b03166350d25bcd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561071a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073e9190610c03565b836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561077c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a09190610c1c565b856001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105d5573d6000803e3d6000fd5b6107e89087610d8c565b95505b5050505080806107fa90610da4565b9150506101e6565b50610897817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610865573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108899190610c03565b670de0b6b3a76400006109ae565b9250505090565b6108a66109c9565b6108b06000610a23565b565b6108ba6109c9565b6001600160a01b03918216600090815260016020526040902080546001600160a01b03191691909216179055565b6108f06109c9565b6001600160a01b0316600090815260016020526040902080546001600160a01b0319169055565b61091f6109c9565b6001600160a01b0381166109895760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61099281610a23565b50565b6000828484860204146109a757600080fd5b5091020490565b6000818483860204146109c057600080fd5b50919091020490565b6000546001600160a01b031633146108b05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610980565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461099257600080fd5b600060208284031215610a9a57600080fd5b8135610aa581610a73565b9392505050565b60008060408385031215610abf57600080fd5b8235610aca81610a73565b91506020830135610ada81610a73565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b8051610b0681610a73565b919050565b60006020808385031215610b1e57600080fd5b825167ffffffffffffffff80821115610b3657600080fd5b818501915085601f830112610b4a57600080fd5b815181811115610b5c57610b5c610ae5565b8060051b604051601f19603f83011681018181108582111715610b8157610b81610ae5565b604052918252848201925083810185019188831115610b9f57600080fd5b938501935b82851015610bc457610bb585610afb565b84529385019392850192610ba4565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610bf857600080fd5b8151610aa581610a73565b600060208284031215610c1557600080fd5b5051919050565b600060208284031215610c2e57600080fd5b815160ff81168114610aa557600080fd5b634e487b7160e01b600052601160045260246000fd5b600060ff821660ff841680821015610c6f57610c6f610c3f565b90039392505050565b600181815b80851115610cb3578160001904821115610c9957610c99610c3f565b80851615610ca657918102915b93841c9390800290610c7d565b509250929050565b600082610cca57506001610d58565b81610cd757506000610d58565b8160018114610ced5760028114610cf757610d13565b6001915050610d58565b60ff841115610d0857610d08610c3f565b50506001821b610d58565b5060208310610133831016604e8410600b8410161715610d36575081810a610d58565b610d408383610c78565b8060001904821115610d5457610d54610c3f565b0290505b92915050565b6000610aa560ff841683610cbb565b6000816000190483118215151615610d8757610d87610c3f565b500290565b60008219821115610d9f57610d9f610c3f565b500190565b600060ff821660ff8103610dba57610dba610c3f565b6001019291505056fea26469706673582212200a484be5b8de5810751dbc08a4ec3f0c8cedebd348d614d6022fa2d01576ec7364736f6c634300080f00330000000000000000000000005ee08f40b637417bcc9d2c51b62f4820ec9cf5d800000000000000000000000008a2b7d713e388123dc6678168656659d297d397

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100885760003560e01c806387ef019a1161005b57806387ef019a1461010d5780638da5cb5b14610120578063eec5d84a14610131578063f2fde38b1461014457600080fd5b8063313ce5671461008d57806350d25bcd146100ac578063511ee14d146100c2578063715018a614610103575b600080fd5b610095601281565b60405160ff90911681526020015b60405180910390f35b6100b4610157565b6040519081526020016100a3565b6100eb6100d0366004610a88565b6001602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016100a3565b61010b61089e565b005b61010b61011b366004610aac565b6108b2565b6000546001600160a01b03166100eb565b61010b61013f366004610a88565b6108e8565b61010b610152366004610a88565b610917565b6000807f0000000000000000000000005ee08f40b637417bcc9d2c51b62f4820ec9cf5d86001600160a01b031663aa6ca8086040518163ffffffff1660e01b8152600401600060405180830381865afa1580156101b8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101e09190810190610b0b565b90506000805b82518160ff161015610802576000838260ff168151811061020957610209610bd0565b6020908102919091010151604051632aabce9960e11b81526001600160a01b0380831660048301529192506000917f00000000000000000000000008a2b7d713e388123dc6678168656659d297d39716906355579d3290602401602060405180830381865afa158015610280573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a49190610be6565b90508160006001600160a01b0383161561063557604051632df6e47f60e21b81526001600160a01b0385811660048301526000917f00000000000000000000000008a2b7d713e388123dc6678168656659d297d3979091169063f8b7f42290829063b7db91fc90602401602060405180830381865afa15801561032b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061034f9190610c03565b6040518263ffffffff1660e01b815260040161036d91815260200190565b602060405180830381865afa15801561038a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ae9190610be6565b6001600160a01b03858116600090815260016020526040908190205490516370a0823160e01b81527f0000000000000000000000005ee08f40b637417bcc9d2c51b62f4820ec9cf5d8831660048201529082169450919250610623916104d3918616906370a0823190602401602060405180830381865afa158015610437573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045b9190610c03565b60405163269d294760e01b81526001600160a01b03898116600483015285169063269d294790602401602060405180830381865afa1580156104a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c59190610c03565b670de0b6b3a7640000610995565b836001600160a01b03166350d25bcd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610511573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105359190610c03565b846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610573573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105979190610c1c565b866001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f99190610c1c565b610604906024610c55565b61060e9190610c55565b61061990600a610d5e565b6104c59190610d6d565b61062d9088610d8c565b9650506107eb565b506001600160a01b03838116600090815260016020526040908190205490516370a0823160e01b81527f0000000000000000000000005ee08f40b637417bcc9d2c51b62f4820ec9cf5d883166004820152908216916107de91908416906370a0823190602401602060405180830381865afa1580156106b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106dc9190610c03565b826001600160a01b03166350d25bcd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561071a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073e9190610c03565b836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561077c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a09190610c1c565b856001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105d5573d6000803e3d6000fd5b6107e89087610d8c565b95505b5050505080806107fa90610da4565b9150506101e6565b50610897817f0000000000000000000000005ee08f40b637417bcc9d2c51b62f4820ec9cf5d86001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610865573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108899190610c03565b670de0b6b3a76400006109ae565b9250505090565b6108a66109c9565b6108b06000610a23565b565b6108ba6109c9565b6001600160a01b03918216600090815260016020526040902080546001600160a01b03191691909216179055565b6108f06109c9565b6001600160a01b0316600090815260016020526040902080546001600160a01b0319169055565b61091f6109c9565b6001600160a01b0381166109895760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61099281610a23565b50565b6000828484860204146109a757600080fd5b5091020490565b6000818483860204146109c057600080fd5b50919091020490565b6000546001600160a01b031633146108b05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610980565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461099257600080fd5b600060208284031215610a9a57600080fd5b8135610aa581610a73565b9392505050565b60008060408385031215610abf57600080fd5b8235610aca81610a73565b91506020830135610ada81610a73565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b8051610b0681610a73565b919050565b60006020808385031215610b1e57600080fd5b825167ffffffffffffffff80821115610b3657600080fd5b818501915085601f830112610b4a57600080fd5b815181811115610b5c57610b5c610ae5565b8060051b604051601f19603f83011681018181108582111715610b8157610b81610ae5565b604052918252848201925083810185019188831115610b9f57600080fd5b938501935b82851015610bc457610bb585610afb565b84529385019392850192610ba4565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610bf857600080fd5b8151610aa581610a73565b600060208284031215610c1557600080fd5b5051919050565b600060208284031215610c2e57600080fd5b815160ff81168114610aa557600080fd5b634e487b7160e01b600052601160045260246000fd5b600060ff821660ff841680821015610c6f57610c6f610c3f565b90039392505050565b600181815b80851115610cb3578160001904821115610c9957610c99610c3f565b80851615610ca657918102915b93841c9390800290610c7d565b509250929050565b600082610cca57506001610d58565b81610cd757506000610d58565b8160018114610ced5760028114610cf757610d13565b6001915050610d58565b60ff841115610d0857610d08610c3f565b50506001821b610d58565b5060208310610133831016604e8410600b8410161715610d36575081810a610d58565b610d408383610c78565b8060001904821115610d5457610d54610c3f565b0290505b92915050565b6000610aa560ff841683610cbb565b6000816000190483118215151615610d8757610d87610c3f565b500290565b60008219821115610d9f57610d9f610c3f565b500190565b600060ff821660ff8103610dba57610dba610c3f565b6001019291505056fea26469706673582212200a484be5b8de5810751dbc08a4ec3f0c8cedebd348d614d6022fa2d01576ec7364736f6c634300080f0033

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

0000000000000000000000005ee08f40b637417bcc9d2c51b62f4820ec9cf5d800000000000000000000000008a2b7d713e388123dc6678168656659d297d397

-----Decoded View---------------
Arg [0] : _basket (address): 0x5ee08f40b637417bcC9d2C51B62F4820ec9cF5D8
Arg [1] : _lendingRegistry (address): 0x08a2b7D713e388123dc6678168656659d297d397

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000005ee08f40b637417bcc9d2c51b62f4820ec9cf5d8
Arg [1] : 00000000000000000000000008a2b7d713e388123dc6678168656659d297d397


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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