Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
ValueInterpreter
Compiler Version
v0.6.12+commit.27d51765
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0
/*
This file is part of the Enzyme Protocol.
(c) Enzyme Council <council@enzyme.finance>
For the full license information, please view the LICENSE
file that was distributed with this source code.
*/
pragma solidity 0.6.12;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "../price-feeds/derivatives/IAggregatedDerivativePriceFeed.sol";
import "../price-feeds/derivatives/IDerivativePriceFeed.sol";
import "../price-feeds/primitives/IPrimitivePriceFeed.sol";
import "./IValueInterpreter.sol";
/// @title ValueInterpreter Contract
/// @author Enzyme Council <security@enzyme.finance>
/// @notice Interprets price feeds to provide covert value between asset pairs
/// @dev This contract contains several "live" value calculations, which for this release are simply
/// aliases to their "canonical" value counterparts since the only primitive price feed (Chainlink)
/// is immutable in this contract and only has one type of value. Including the "live" versions of
/// functions only serves as a placeholder for infrastructural components and plugins (e.g., policies)
/// to explicitly define the types of values that they should (and will) be using in a future release.
contract ValueInterpreter is IValueInterpreter {
using SafeMath for uint256;
address private immutable AGGREGATED_DERIVATIVE_PRICE_FEED;
address private immutable PRIMITIVE_PRICE_FEED;
constructor(address _primitivePriceFeed, address _aggregatedDerivativePriceFeed) public {
AGGREGATED_DERIVATIVE_PRICE_FEED = _aggregatedDerivativePriceFeed;
PRIMITIVE_PRICE_FEED = _primitivePriceFeed;
}
// EXTERNAL FUNCTIONS
/// @notice An alias of calcCanonicalAssetsTotalValue
function calcLiveAssetsTotalValue(
address[] calldata _baseAssets,
uint256[] calldata _amounts,
address _quoteAsset
) external override returns (uint256 value_, bool isValid_) {
return calcCanonicalAssetsTotalValue(_baseAssets, _amounts, _quoteAsset);
}
/// @notice An alias of calcCanonicalAssetValue
function calcLiveAssetValue(
address _baseAsset,
uint256 _amount,
address _quoteAsset
) external override returns (uint256 value_, bool isValid_) {
return calcCanonicalAssetValue(_baseAsset, _amount, _quoteAsset);
}
// PUBLIC FUNCTIONS
/// @notice Calculates the total value of given amounts of assets in a single quote asset
/// @param _baseAssets The assets to convert
/// @param _amounts The amounts of the _baseAssets to convert
/// @param _quoteAsset The asset to which to convert
/// @return value_ The sum value of _baseAssets, denominated in the _quoteAsset
/// @return isValid_ True if the price feed rates used to derive value are all valid
/// @dev Does not alter protocol state,
/// but not a view because calls to price feeds can potentially update third party state
function calcCanonicalAssetsTotalValue(
address[] memory _baseAssets,
uint256[] memory _amounts,
address _quoteAsset
) public override returns (uint256 value_, bool isValid_) {
require(
_baseAssets.length == _amounts.length,
"calcCanonicalAssetsTotalValue: Arrays unequal lengths"
);
require(
IPrimitivePriceFeed(PRIMITIVE_PRICE_FEED).isSupportedAsset(_quoteAsset),
"calcCanonicalAssetsTotalValue: Unsupported _quoteAsset"
);
isValid_ = true;
for (uint256 i; i < _baseAssets.length; i++) {
(uint256 assetValue, bool assetValueIsValid) = __calcAssetValue(
_baseAssets[i],
_amounts[i],
_quoteAsset
);
value_ = value_.add(assetValue);
if (!assetValueIsValid) {
isValid_ = false;
}
}
return (value_, isValid_);
}
/// @notice Calculates the value of a given amount of one asset in terms of another asset
/// @param _baseAsset The asset from which to convert
/// @param _amount The amount of the _baseAsset to convert
/// @param _quoteAsset The asset to which to convert
/// @return value_ The equivalent quantity in the _quoteAsset
/// @return isValid_ True if the price feed rates used to derive value are all valid
/// @dev Does not alter protocol state,
/// but not a view because calls to price feeds can potentially update third party state
function calcCanonicalAssetValue(
address _baseAsset,
uint256 _amount,
address _quoteAsset
) public override returns (uint256 value_, bool isValid_) {
if (_baseAsset == _quoteAsset || _amount == 0) {
return (_amount, true);
}
require(
IPrimitivePriceFeed(PRIMITIVE_PRICE_FEED).isSupportedAsset(_quoteAsset),
"calcCanonicalAssetValue: Unsupported _quoteAsset"
);
return __calcAssetValue(_baseAsset, _amount, _quoteAsset);
}
// PRIVATE FUNCTIONS
/// @dev Helper to differentially calculate an asset value
/// based on if it is a primitive or derivative asset.
function __calcAssetValue(
address _baseAsset,
uint256 _amount,
address _quoteAsset
) private returns (uint256 value_, bool isValid_) {
if (_baseAsset == _quoteAsset || _amount == 0) {
return (_amount, true);
}
// Handle case that asset is a primitive
if (IPrimitivePriceFeed(PRIMITIVE_PRICE_FEED).isSupportedAsset(_baseAsset)) {
return
IPrimitivePriceFeed(PRIMITIVE_PRICE_FEED).calcCanonicalValue(
_baseAsset,
_amount,
_quoteAsset
);
}
// Handle case that asset is a derivative
address derivativePriceFeed = IAggregatedDerivativePriceFeed(
AGGREGATED_DERIVATIVE_PRICE_FEED
)
.getPriceFeedForDerivative(_baseAsset);
if (derivativePriceFeed != address(0)) {
return __calcDerivativeValue(derivativePriceFeed, _baseAsset, _amount, _quoteAsset);
}
revert("__calcAssetValue: Unsupported _baseAsset");
}
/// @dev Helper to calculate the value of a derivative in an arbitrary asset.
/// Handles multiple underlying assets (e.g., Uniswap and Balancer pool tokens).
/// Handles underlying assets that are also derivatives (e.g., a cDAI-ETH LP)
function __calcDerivativeValue(
address _derivativePriceFeed,
address _derivative,
uint256 _amount,
address _quoteAsset
) private returns (uint256 value_, bool isValid_) {
(address[] memory underlyings, uint256[] memory underlyingAmounts) = IDerivativePriceFeed(
_derivativePriceFeed
)
.calcUnderlyingValues(_derivative, _amount);
require(underlyings.length > 0, "__calcDerivativeValue: No underlyings");
require(
underlyings.length == underlyingAmounts.length,
"__calcDerivativeValue: Arrays unequal lengths"
);
// Let validity be negated if any of the underlying value calculations are invalid
isValid_ = true;
for (uint256 i = 0; i < underlyings.length; i++) {
(uint256 underlyingValue, bool underlyingValueIsValid) = __calcAssetValue(
underlyings[i],
underlyingAmounts[i],
_quoteAsset
);
if (!underlyingValueIsValid) {
isValid_ = false;
}
value_ = value_.add(underlyingValue);
}
}
///////////////////
// STATE GETTERS //
///////////////////
/// @notice Gets the `AGGREGATED_DERIVATIVE_PRICE_FEED` variable
/// @return aggregatedDerivativePriceFeed_ The `AGGREGATED_DERIVATIVE_PRICE_FEED` variable value
function getAggregatedDerivativePriceFeed()
external
view
returns (address aggregatedDerivativePriceFeed_)
{
return AGGREGATED_DERIVATIVE_PRICE_FEED;
}
/// @notice Gets the `PRIMITIVE_PRICE_FEED` variable
/// @return primitivePriceFeed_ The `PRIMITIVE_PRICE_FEED` variable value
function getPrimitivePriceFeed() external view returns (address primitivePriceFeed_) {
return PRIMITIVE_PRICE_FEED;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b > a) return (false, 0);
return (true, a - b);
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a / b);
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a % b);
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: modulo by zero");
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
return a - b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a % b;
}
}// SPDX-License-Identifier: GPL-3.0
/*
This file is part of the Enzyme Protocol.
(c) Enzyme Council <council@enzyme.finance>
For the full license information, please view the LICENSE
file that was distributed with this source code.
*/
pragma solidity 0.6.12;
import "./IDerivativePriceFeed.sol";
/// @title IDerivativePriceFeed Interface
/// @author Enzyme Council <security@enzyme.finance>
interface IAggregatedDerivativePriceFeed is IDerivativePriceFeed {
function getPriceFeedForDerivative(address) external view returns (address);
}// SPDX-License-Identifier: GPL-3.0
/*
This file is part of the Enzyme Protocol.
(c) Enzyme Council <council@enzyme.finance>
For the full license information, please view the LICENSE
file that was distributed with this source code.
*/
pragma solidity 0.6.12;
/// @title IDerivativePriceFeed Interface
/// @author Enzyme Council <security@enzyme.finance>
/// @notice Simple interface for derivative price source oracle implementations
interface IDerivativePriceFeed {
function calcUnderlyingValues(address, uint256)
external
returns (address[] memory, uint256[] memory);
function isSupportedAsset(address) external view returns (bool);
}// SPDX-License-Identifier: GPL-3.0
/*
This file is part of the Enzyme Protocol.
(c) Enzyme Council <council@enzyme.finance>
For the full license information, please view the LICENSE
file that was distributed with this source code.
*/
pragma solidity 0.6.12;
/// @title IPrimitivePriceFeed Interface
/// @author Enzyme Council <security@enzyme.finance>
/// @notice Interface for primitive price feeds
interface IPrimitivePriceFeed {
function calcCanonicalValue(
address,
uint256,
address
) external view returns (uint256, bool);
function calcLiveValue(
address,
uint256,
address
) external view returns (uint256, bool);
function isSupportedAsset(address) external view returns (bool);
}// SPDX-License-Identifier: GPL-3.0
/*
This file is part of the Enzyme Protocol.
(c) Enzyme Council <council@enzyme.finance>
For the full license information, please view the LICENSE
file that was distributed with this source code.
*/
pragma solidity 0.6.12;
/// @title IValueInterpreter interface
/// @author Enzyme Council <security@enzyme.finance>
/// @notice Interface for ValueInterpreter
interface IValueInterpreter {
function calcCanonicalAssetValue(
address,
uint256,
address
) external returns (uint256, bool);
function calcCanonicalAssetsTotalValue(
address[] calldata,
uint256[] calldata,
address
) external returns (uint256, bool);
function calcLiveAssetValue(
address,
uint256,
address
) external returns (uint256, bool);
function calcLiveAssetsTotalValue(
address[] calldata,
uint256[] calldata,
address
) external returns (uint256, bool);
}{
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"details": {
"constantOptimizer": true,
"cse": true,
"deduplicate": true,
"jumpdestRemover": true,
"orderLiterals": true,
"peephole": true,
"yul": false
},
"runs": 200
},
"remappings": [],
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_primitivePriceFeed","type":"address"},{"internalType":"address","name":"_aggregatedDerivativePriceFeed","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"_baseAsset","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_quoteAsset","type":"address"}],"name":"calcCanonicalAssetValue","outputs":[{"internalType":"uint256","name":"value_","type":"uint256"},{"internalType":"bool","name":"isValid_","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_baseAssets","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"address","name":"_quoteAsset","type":"address"}],"name":"calcCanonicalAssetsTotalValue","outputs":[{"internalType":"uint256","name":"value_","type":"uint256"},{"internalType":"bool","name":"isValid_","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_baseAsset","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_quoteAsset","type":"address"}],"name":"calcLiveAssetValue","outputs":[{"internalType":"uint256","name":"value_","type":"uint256"},{"internalType":"bool","name":"isValid_","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_baseAssets","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"address","name":"_quoteAsset","type":"address"}],"name":"calcLiveAssetsTotalValue","outputs":[{"internalType":"uint256","name":"value_","type":"uint256"},{"internalType":"bool","name":"isValid_","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAggregatedDerivativePriceFeed","outputs":[{"internalType":"address","name":"aggregatedDerivativePriceFeed_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrimitivePriceFeed","outputs":[{"internalType":"address","name":"primitivePriceFeed_","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60c060405234801561001057600080fd5b50604051610de8380380610de88339818101604052604081101561003357600080fd5b5080516020909101516001600160601b0319606091821b811660805291901b1660a05260805160601c60a05160601c610d506100986000398061030f5280610364528061054552806106bb5280610788525080610450528061080d5250610d506000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806349be72f3146100675780634c67e1061461008b5780635d880c7d146100da5780637733db7d146100e2578063ae3be7f414610118578063ae6f52ad146101df575b600080fd5b61006f61030d565b604080516001600160a01b039092168252519081900360200190f35b6100c1600480360360608110156100a157600080fd5b506001600160a01b03813581169160208101359160409091013516610331565b6040805192835290151560208301528051918290030190f35b61006f61044e565b6100c1600480360360608110156100f857600080fd5b506001600160a01b03813581169160208101359160409091013516610472565b6100c16004803603606081101561012e57600080fd5b810190602081018135600160201b81111561014857600080fd5b82018360208201111561015a57600080fd5b803590602001918460208302840111600160201b8311171561017b57600080fd5b919390929091602081019035600160201b81111561019857600080fd5b8201836020820111156101aa57600080fd5b803590602001918460208302840111600160201b831117156101cb57600080fd5b9193509150356001600160a01b0316610480565b6100c1600480360360608110156101f557600080fd5b810190602081018135600160201b81111561020f57600080fd5b82018360208201111561022157600080fd5b803590602001918460208302840111600160201b8311171561024257600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561029157600080fd5b8201836020820111156102a357600080fd5b803590602001918460208302840111600160201b831117156102c457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550505090356001600160a01b031691506105009050565b7f000000000000000000000000000000000000000000000000000000000000000090565b600080826001600160a01b0316856001600160a01b03161480610352575083155b1561036257508290506001610446565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639be918e6846040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156103cf57600080fd5b505afa1580156103e3573d6000803e3d6000fd5b505050506040513d60208110156103f957600080fd5b50516104365760405162461bcd60e51b8152600401808060200182810382526030815260200180610ceb6030913960400191505060405180910390fd5b610441858585610688565b915091505b935093915050565b7f000000000000000000000000000000000000000000000000000000000000000090565b600080610441858585610331565b6000806104f287878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a925089918291850190849080828437600092019190915250889250610500915050565b915091509550959350505050565b60008083518551146105435760405162461bcd60e51b8152600401808060200182810382526035815260200180610c696035913960400191505060405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639be918e6846040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156105b057600080fd5b505afa1580156105c4573d6000803e3d6000fd5b505050506040513d60208110156105da57600080fd5b50516106175760405162461bcd60e51b8152600401808060200182810382526036815260200180610c066036913960400191505060405180910390fd5b50600160005b855181101561067f5760008061065a88848151811061063857fe5b602002602001015188858151811061064c57fe5b602002602001015188610688565b90925090506106698583610902565b94508061067557600093505b505060010161061d565b50935093915050565b600080826001600160a01b0316856001600160a01b031614806106a9575083155b156106b957508290506001610446565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639be918e6866040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561072657600080fd5b505afa15801561073a573d6000803e3d6000fd5b505050506040513d602081101561075057600080fd5b5051156108095760408051630372a91f60e31b81526001600160a01b03878116600483015260248201879052858116604483015282517f000000000000000000000000000000000000000000000000000000000000000090911692631b9548f89260648082019391829003018186803b1580156107cc57600080fd5b505afa1580156107e0573d6000803e3d6000fd5b505050506040513d60408110156107f657600080fd5b5080516020909101519092509050610446565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166368e81c6d876040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561087857600080fd5b505afa15801561088c573d6000803e3d6000fd5b505050506040513d60208110156108a257600080fd5b505190506001600160a01b038116156108cb576108c181878787610963565b9250925050610446565b60405162461bcd60e51b8152600401808060200182810382526028815260200180610cc36028913960400191505060405180910390fd5b60008282018381101561095c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600080606080876001600160a01b031663727212f688886040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156109c057600080fd5b505af11580156109d4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160409081528110156109fd57600080fd5b8101908080516040519392919084600160201b821115610a1c57600080fd5b908301906020820185811115610a3157600080fd5b82518660208202830111600160201b82111715610a4d57600080fd5b82525081516020918201928201910280838360005b83811015610a7a578181015183820152602001610a62565b5050505090500160405260200180516040519392919084600160201b821115610aa257600080fd5b908301906020820185811115610ab757600080fd5b82518660208202830111600160201b82111715610ad357600080fd5b82525081516020918201928201910280838360005b83811015610b00578181015183820152602001610ae8565b50505050905001604052505050915091506000825111610b515760405162461bcd60e51b8152600401808060200182810382526025815260200180610c9e6025913960400191505060405180910390fd5b8051825114610b915760405162461bcd60e51b815260040180806020018281038252602d815260200180610c3c602d913960400191505060405180910390fd5b6001925060005b8251811015610bf957600080610bd5858481518110610bb357fe5b6020026020010151858581518110610bc757fe5b60200260200101518a610688565b9150915080610be357600095505b610bed8783610902565b96505050600101610b98565b5050509450949250505056fe63616c6343616e6f6e6963616c417373657473546f74616c56616c75653a20556e737570706f72746564205f71756f746541737365745f5f63616c634465726976617469766556616c75653a2041727261797320756e657175616c206c656e6774687363616c6343616e6f6e6963616c417373657473546f74616c56616c75653a2041727261797320756e657175616c206c656e677468735f5f63616c634465726976617469766556616c75653a204e6f20756e6465726c79696e67735f5f63616c63417373657456616c75653a20556e737570706f72746564205f62617365417373657463616c6343616e6f6e6963616c417373657456616c75653a20556e737570706f72746564205f71756f74654173736574a2646970667358221220d54cff4486da6cdb94727f6142a5d1cf834580def80a52407896b0bfdf6f4ccf64736f6c634300060c00330000000000000000000000001fad8faf11e027f8630f394599830dbeb97004ee0000000000000000000000002e45f9b3fd5871ccaf4eb415dfccbdd126f57c4f
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100625760003560e01c806349be72f3146100675780634c67e1061461008b5780635d880c7d146100da5780637733db7d146100e2578063ae3be7f414610118578063ae6f52ad146101df575b600080fd5b61006f61030d565b604080516001600160a01b039092168252519081900360200190f35b6100c1600480360360608110156100a157600080fd5b506001600160a01b03813581169160208101359160409091013516610331565b6040805192835290151560208301528051918290030190f35b61006f61044e565b6100c1600480360360608110156100f857600080fd5b506001600160a01b03813581169160208101359160409091013516610472565b6100c16004803603606081101561012e57600080fd5b810190602081018135600160201b81111561014857600080fd5b82018360208201111561015a57600080fd5b803590602001918460208302840111600160201b8311171561017b57600080fd5b919390929091602081019035600160201b81111561019857600080fd5b8201836020820111156101aa57600080fd5b803590602001918460208302840111600160201b831117156101cb57600080fd5b9193509150356001600160a01b0316610480565b6100c1600480360360608110156101f557600080fd5b810190602081018135600160201b81111561020f57600080fd5b82018360208201111561022157600080fd5b803590602001918460208302840111600160201b8311171561024257600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561029157600080fd5b8201836020820111156102a357600080fd5b803590602001918460208302840111600160201b831117156102c457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550505090356001600160a01b031691506105009050565b7f0000000000000000000000001fad8faf11e027f8630f394599830dbeb97004ee90565b600080826001600160a01b0316856001600160a01b03161480610352575083155b1561036257508290506001610446565b7f0000000000000000000000001fad8faf11e027f8630f394599830dbeb97004ee6001600160a01b0316639be918e6846040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156103cf57600080fd5b505afa1580156103e3573d6000803e3d6000fd5b505050506040513d60208110156103f957600080fd5b50516104365760405162461bcd60e51b8152600401808060200182810382526030815260200180610ceb6030913960400191505060405180910390fd5b610441858585610688565b915091505b935093915050565b7f0000000000000000000000002e45f9b3fd5871ccaf4eb415dfccbdd126f57c4f90565b600080610441858585610331565b6000806104f287878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a925089918291850190849080828437600092019190915250889250610500915050565b915091509550959350505050565b60008083518551146105435760405162461bcd60e51b8152600401808060200182810382526035815260200180610c696035913960400191505060405180910390fd5b7f0000000000000000000000001fad8faf11e027f8630f394599830dbeb97004ee6001600160a01b0316639be918e6846040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156105b057600080fd5b505afa1580156105c4573d6000803e3d6000fd5b505050506040513d60208110156105da57600080fd5b50516106175760405162461bcd60e51b8152600401808060200182810382526036815260200180610c066036913960400191505060405180910390fd5b50600160005b855181101561067f5760008061065a88848151811061063857fe5b602002602001015188858151811061064c57fe5b602002602001015188610688565b90925090506106698583610902565b94508061067557600093505b505060010161061d565b50935093915050565b600080826001600160a01b0316856001600160a01b031614806106a9575083155b156106b957508290506001610446565b7f0000000000000000000000001fad8faf11e027f8630f394599830dbeb97004ee6001600160a01b0316639be918e6866040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561072657600080fd5b505afa15801561073a573d6000803e3d6000fd5b505050506040513d602081101561075057600080fd5b5051156108095760408051630372a91f60e31b81526001600160a01b03878116600483015260248201879052858116604483015282517f0000000000000000000000001fad8faf11e027f8630f394599830dbeb97004ee90911692631b9548f89260648082019391829003018186803b1580156107cc57600080fd5b505afa1580156107e0573d6000803e3d6000fd5b505050506040513d60408110156107f657600080fd5b5080516020909101519092509050610446565b60007f0000000000000000000000002e45f9b3fd5871ccaf4eb415dfccbdd126f57c4f6001600160a01b03166368e81c6d876040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561087857600080fd5b505afa15801561088c573d6000803e3d6000fd5b505050506040513d60208110156108a257600080fd5b505190506001600160a01b038116156108cb576108c181878787610963565b9250925050610446565b60405162461bcd60e51b8152600401808060200182810382526028815260200180610cc36028913960400191505060405180910390fd5b60008282018381101561095c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600080606080876001600160a01b031663727212f688886040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156109c057600080fd5b505af11580156109d4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160409081528110156109fd57600080fd5b8101908080516040519392919084600160201b821115610a1c57600080fd5b908301906020820185811115610a3157600080fd5b82518660208202830111600160201b82111715610a4d57600080fd5b82525081516020918201928201910280838360005b83811015610a7a578181015183820152602001610a62565b5050505090500160405260200180516040519392919084600160201b821115610aa257600080fd5b908301906020820185811115610ab757600080fd5b82518660208202830111600160201b82111715610ad357600080fd5b82525081516020918201928201910280838360005b83811015610b00578181015183820152602001610ae8565b50505050905001604052505050915091506000825111610b515760405162461bcd60e51b8152600401808060200182810382526025815260200180610c9e6025913960400191505060405180910390fd5b8051825114610b915760405162461bcd60e51b815260040180806020018281038252602d815260200180610c3c602d913960400191505060405180910390fd5b6001925060005b8251811015610bf957600080610bd5858481518110610bb357fe5b6020026020010151858581518110610bc757fe5b60200260200101518a610688565b9150915080610be357600095505b610bed8783610902565b96505050600101610b98565b5050509450949250505056fe63616c6343616e6f6e6963616c417373657473546f74616c56616c75653a20556e737570706f72746564205f71756f746541737365745f5f63616c634465726976617469766556616c75653a2041727261797320756e657175616c206c656e6774687363616c6343616e6f6e6963616c417373657473546f74616c56616c75653a2041727261797320756e657175616c206c656e677468735f5f63616c634465726976617469766556616c75653a204e6f20756e6465726c79696e67735f5f63616c63417373657456616c75653a20556e737570706f72746564205f62617365417373657463616c6343616e6f6e6963616c417373657456616c75653a20556e737570706f72746564205f71756f74654173736574a2646970667358221220d54cff4486da6cdb94727f6142a5d1cf834580def80a52407896b0bfdf6f4ccf64736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000001fad8faf11e027f8630f394599830dbeb97004ee0000000000000000000000002e45f9b3fd5871ccaf4eb415dfccbdd126f57c4f
-----Decoded View---------------
Arg [0] : _primitivePriceFeed (address): 0x1fad8faf11E027f8630F394599830dBeb97004EE
Arg [1] : _aggregatedDerivativePriceFeed (address): 0x2E45f9B3fd5871cCaf4eB415dFCcbDD126F57C4f
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000001fad8faf11e027f8630f394599830dbeb97004ee
Arg [1] : 0000000000000000000000002e45f9b3fd5871ccaf4eb415dfccbdd126f57c4f
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.