Source Code
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
PriceOracle
Compiler Version
v0.6.10+commit.00c0fcaf
Optimization Enabled:
Yes with 20000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
/*
Copyright 2020 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache License, Version 2.0
*/
pragma solidity 0.6.10;
pragma experimental "ABIEncoderV2";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {AddressArrayUtils} from "./lib/AddressArrayUtils.sol";
import {IController} from "./interfaces/IController.sol";
import {IOracle} from "./interfaces/IOracle.sol";
import {IOracleAdapter} from "./interfaces/IOracleAdapter.sol";
import {PreciseUnitMath} from "./lib/PreciseUnitMath.sol";
/**
* @title PriceOracle
* @author Set Protocol
*
* Contract that returns the price for any given asset pair. Price is retrieved either directly from an oracle,
* calculated using common asset pairs, or uses external data to calculate price.
* Note: Prices are returned in preciseUnits (i.e. 18 decimals of precision)
*/
contract PriceOracle is Ownable {
using PreciseUnitMath for uint256;
using AddressArrayUtils for address[];
/* ============ Events ============ */
event PairAdded(
address indexed _assetOne,
address indexed _assetTwo,
address _oracle
);
event PairRemoved(
address indexed _assetOne,
address indexed _assetTwo,
address _oracle
);
event PairEdited(
address indexed _assetOne,
address indexed _assetTwo,
address _newOracle
);
event AdapterAdded(address _adapter);
event AdapterRemoved(address _adapter);
event MasterQuoteAssetEdited(address _newMasterQuote);
/* ============ State Variables ============ */
// Address of the Controller contract
IController public controller;
// Mapping between assetA/assetB and its associated Price Oracle
// Asset 1 -> Asset 2 -> IOracle Interface
mapping(address => mapping(address => IOracle)) public oracles;
// Token address of the bridge asset that prices are derived from if the specified pair price is missing
address public masterQuoteAsset;
// List of IOracleAdapters used to return prices of third party protocols (e.g. Uniswap, Compound, Balancer)
address[] public adapters;
/* ============ Constructor ============ */
/**
* Set state variables and map asset pairs to their oracles
*
* @param _controller Address of controller contract
* @param _masterQuoteAsset Address of asset that can be used to link unrelated asset pairs
* @param _adapters List of adapters used to price assets created by other protocols
* @param _assetOnes List of first asset in pair, index i maps to same index in assetTwos and oracles
* @param _assetTwos List of second asset in pair, index i maps to same index in assetOnes and oracles
* @param _oracles List of oracles, index i maps to same index in assetOnes and assetTwos
*/
constructor(
IController _controller,
address _masterQuoteAsset,
address[] memory _adapters,
address[] memory _assetOnes,
address[] memory _assetTwos,
IOracle[] memory _oracles
) public {
controller = _controller;
masterQuoteAsset = _masterQuoteAsset;
adapters = _adapters;
require(
_assetOnes.length == _assetTwos.length &&
_assetTwos.length == _oracles.length,
"Array lengths do not match."
);
for (uint256 i = 0; i < _assetOnes.length; i++) {
oracles[_assetOnes[i]][_assetTwos[i]] = _oracles[i];
}
}
/* ============ External Functions ============ */
/**
* SYSTEM-ONLY PRIVELEGE: Find price of passed asset pair, if possible. The steps it takes are:
* 1) Check to see if a direct or inverse oracle of the pair exists,
* 2) If not, use masterQuoteAsset to link pairs together (i.e. BTC/ETH and ETH/USDC
* could be used to calculate BTC/USDC).
* 3) If not, check oracle adapters in case one or more of the assets needs external protocol data
* to price.
* 4) If all steps fail, revert.
*
* @param _assetOne Address of first asset in pair
* @param _assetTwo Address of second asset in pair
* @return Price of asset pair to 18 decimals of precision
*/
function getPrice(
address _assetOne,
address _assetTwo
) external view returns (uint256) {
require(
controller.isSystemContract(msg.sender),
"PriceOracle.getPrice: Caller must be system contract."
);
bool priceFound;
uint256 price;
(priceFound, price) = _getDirectOrInversePrice(_assetOne, _assetTwo);
if (!priceFound) {
(priceFound, price) = _getPriceFromMasterQuote(
_assetOne,
_assetTwo
);
}
if (!priceFound) {
(priceFound, price) = _getPriceFromAdapters(_assetOne, _assetTwo);
}
require(priceFound, "PriceOracle.getPrice: Price not found.");
return price;
}
/**
* GOVERNANCE FUNCTION: Add new asset pair oracle.
*
* @param _assetOne Address of first asset in pair
* @param _assetTwo Address of second asset in pair
* @param _oracle Address of asset pair's oracle
*/
function addPair(
address _assetOne,
address _assetTwo,
IOracle _oracle
) external onlyOwner {
require(
address(oracles[_assetOne][_assetTwo]) == address(0),
"PriceOracle.addPair: Pair already exists."
);
oracles[_assetOne][_assetTwo] = _oracle;
emit PairAdded(_assetOne, _assetTwo, address(_oracle));
}
/**
* GOVERNANCE FUNCTION: Edit an existing asset pair's oracle.
*
* @param _assetOne Address of first asset in pair
* @param _assetTwo Address of second asset in pair
* @param _oracle Address of asset pair's new oracle
*/
function editPair(
address _assetOne,
address _assetTwo,
IOracle _oracle
) external onlyOwner {
require(
address(oracles[_assetOne][_assetTwo]) != address(0),
"PriceOracle.editPair: Pair doesn't exist."
);
oracles[_assetOne][_assetTwo] = _oracle;
emit PairEdited(_assetOne, _assetTwo, address(_oracle));
}
/**
* GOVERNANCE FUNCTION: Remove asset pair's oracle.
*
* @param _assetOne Address of first asset in pair
* @param _assetTwo Address of second asset in pair
*/
function removePair(
address _assetOne,
address _assetTwo
) external onlyOwner {
require(
address(oracles[_assetOne][_assetTwo]) != address(0),
"PriceOracle.removePair: Pair doesn't exist."
);
IOracle oldOracle = oracles[_assetOne][_assetTwo];
delete oracles[_assetOne][_assetTwo];
emit PairRemoved(_assetOne, _assetTwo, address(oldOracle));
}
/**
* GOVERNANCE FUNCTION: Add new oracle adapter.
*
* @param _adapter Address of new adapter
*/
function addAdapter(address _adapter) external onlyOwner {
require(
!adapters.contains(_adapter),
"PriceOracle.addAdapter: Adapter already exists."
);
adapters.push(_adapter);
emit AdapterAdded(_adapter);
}
/**
* GOVERNANCE FUNCTION: Remove oracle adapter.
*
* @param _adapter Address of adapter to remove
*/
function removeAdapter(address _adapter) external onlyOwner {
require(
adapters.contains(_adapter),
"PriceOracle.removeAdapter: Adapter does not exist."
);
adapters = adapters.remove(_adapter);
emit AdapterRemoved(_adapter);
}
/**
* GOVERNANCE FUNCTION: Change the master quote asset.
*
* @param _newMasterQuoteAsset New address of master quote asset
*/
function editMasterQuoteAsset(
address _newMasterQuoteAsset
) external onlyOwner {
masterQuoteAsset = _newMasterQuoteAsset;
emit MasterQuoteAssetEdited(_newMasterQuoteAsset);
}
/* ============ External View Functions ============ */
/**
* Returns an array of adapters
*/
function getAdapters() external view returns (address[] memory) {
return adapters;
}
/* ============ Internal Functions ============ */
/**
* Check if direct or inverse oracle exists. If so return that price along with boolean indicating
* it exists. Otherwise return boolean indicating oracle doesn't exist.
*
* @param _assetOne Address of first asset in pair
* @param _assetTwo Address of second asset in pair
* @return bool Boolean indicating if oracle exists
* @return uint256 Price of asset pair to 18 decimal precision (if exists, otherwise 0)
*/
function _getDirectOrInversePrice(
address _assetOne,
address _assetTwo
) internal view returns (bool, uint256) {
IOracle directOracle = oracles[_assetOne][_assetTwo];
bool hasDirectOracle = address(directOracle) != address(0);
// Check asset1 -> asset 2. If exists, then return value
if (hasDirectOracle) {
IOracle.RoundData memory result = directOracle.latestRoundData();
return (true, uint256(result.answer));
}
IOracle inverseOracle = oracles[_assetTwo][_assetOne];
bool hasInverseOracle = address(inverseOracle) != address(0);
// If not, check asset 2 -> asset 1. If exists, then return 1 / asset1 -> asset2
if (hasInverseOracle) {
return (true, _calculateInversePrice(inverseOracle));
}
return (false, 0);
}
/**
* Try to calculate asset pair price by getting each asset in the pair's price relative to master
* quote asset. Both prices must exist otherwise function returns false and no price.
*
* @param _assetOne Address of first asset in pair
* @param _assetTwo Address of second asset in pair
* @return bool Boolean indicating if oracle exists
* @return uint256 Price of asset pair to 18 decimal precision (if exists, otherwise 0)
*/
function _getPriceFromMasterQuote(
address _assetOne,
address _assetTwo
) internal view returns (bool, uint256) {
(bool priceFoundOne, uint256 assetOnePrice) = _getDirectOrInversePrice(
_assetOne,
masterQuoteAsset
);
(bool priceFoundTwo, uint256 assetTwoPrice) = _getDirectOrInversePrice(
_assetTwo,
masterQuoteAsset
);
if (priceFoundOne && priceFoundTwo) {
return (true, assetOnePrice.preciseDiv(assetTwoPrice));
}
return (false, 0);
}
/**
* Scan adapters to see if one or more of the assets needs external protocol data to be priced. If
* does not exist return false and no price.
*
* @param _assetOne Address of first asset in pair
* @param _assetTwo Address of second asset in pair
* @return bool Boolean indicating if oracle exists
* @return uint256 Price of asset pair to 18 decimal precision (if exists, otherwise 0)
*/
function _getPriceFromAdapters(
address _assetOne,
address _assetTwo
) internal view returns (bool, uint256) {
for (uint256 i = 0; i < adapters.length; i++) {
(bool priceFound, uint256 price) = IOracleAdapter(adapters[i])
.getPrice(_assetOne, _assetTwo);
if (priceFound) {
return (priceFound, price);
}
}
return (false, 0);
}
/**
* Calculate inverse price of passed oracle. The inverse price is 1 (or 1e18) / inverse price
*
* @param _inverseOracle Address of oracle to invert
* @return uint256 Inverted price of asset pair to 18 decimal precision
*/
function _calculateInversePrice(
IOracle _inverseOracle
) internal view returns (uint256) {
IOracle.RoundData memory inverseValue = _inverseOracle
.latestRoundData();
return
PreciseUnitMath.preciseUnit().preciseDiv(
uint256(inverseValue.answer)
);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "../GSN/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.
*/
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(_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 {
emit OwnershipTransferred(_owner, address(0));
_owner = 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");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.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 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.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.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, 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.
*/
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.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
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 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.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @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;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
* checks.
*
* Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
* easily result in undesired exploitation or bugs, since developers usually
* assume that overflows raise errors. `SafeCast` restores this intuition by
* reverting the transaction when such 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.
*
* Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
* all math on `uint256` and `int256` and then downcasting.
*/
library SafeCast {
/**
* @dev Returns the downcasted uint128 from uint256, reverting on
* overflow (when the input is greater than largest uint128).
*
* Counterpart to Solidity's `uint128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toUint128(uint256 value) internal pure returns (uint128) {
require(value < 2**128, "SafeCast: value doesn\'t fit in 128 bits");
return uint128(value);
}
/**
* @dev Returns the downcasted uint64 from uint256, reverting on
* overflow (when the input is greater than largest uint64).
*
* Counterpart to Solidity's `uint64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toUint64(uint256 value) internal pure returns (uint64) {
require(value < 2**64, "SafeCast: value doesn\'t fit in 64 bits");
return uint64(value);
}
/**
* @dev Returns the downcasted uint32 from uint256, reverting on
* overflow (when the input is greater than largest uint32).
*
* Counterpart to Solidity's `uint32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toUint32(uint256 value) internal pure returns (uint32) {
require(value < 2**32, "SafeCast: value doesn\'t fit in 32 bits");
return uint32(value);
}
/**
* @dev Returns the downcasted uint16 from uint256, reverting on
* overflow (when the input is greater than largest uint16).
*
* Counterpart to Solidity's `uint16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toUint16(uint256 value) internal pure returns (uint16) {
require(value < 2**16, "SafeCast: value doesn\'t fit in 16 bits");
return uint16(value);
}
/**
* @dev Returns the downcasted uint8 from uint256, reverting on
* overflow (when the input is greater than largest uint8).
*
* Counterpart to Solidity's `uint8` operator.
*
* Requirements:
*
* - input must fit into 8 bits.
*/
function toUint8(uint256 value) internal pure returns (uint8) {
require(value < 2**8, "SafeCast: value doesn\'t fit in 8 bits");
return uint8(value);
}
/**
* @dev Converts a signed int256 into an unsigned uint256.
*
* Requirements:
*
* - input must be greater than or equal to 0.
*/
function toUint256(int256 value) internal pure returns (uint256) {
require(value >= 0, "SafeCast: value must be positive");
return uint256(value);
}
/**
* @dev Returns the downcasted int128 from int256, reverting on
* overflow (when the input is less than smallest int128 or
* greater than largest int128).
*
* Counterpart to Solidity's `int128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*
* _Available since v3.1._
*/
function toInt128(int256 value) internal pure returns (int128) {
require(value >= -2**127 && value < 2**127, "SafeCast: value doesn\'t fit in 128 bits");
return int128(value);
}
/**
* @dev Returns the downcasted int64 from int256, reverting on
* overflow (when the input is less than smallest int64 or
* greater than largest int64).
*
* Counterpart to Solidity's `int64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*
* _Available since v3.1._
*/
function toInt64(int256 value) internal pure returns (int64) {
require(value >= -2**63 && value < 2**63, "SafeCast: value doesn\'t fit in 64 bits");
return int64(value);
}
/**
* @dev Returns the downcasted int32 from int256, reverting on
* overflow (when the input is less than smallest int32 or
* greater than largest int32).
*
* Counterpart to Solidity's `int32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*
* _Available since v3.1._
*/
function toInt32(int256 value) internal pure returns (int32) {
require(value >= -2**31 && value < 2**31, "SafeCast: value doesn\'t fit in 32 bits");
return int32(value);
}
/**
* @dev Returns the downcasted int16 from int256, reverting on
* overflow (when the input is less than smallest int16 or
* greater than largest int16).
*
* Counterpart to Solidity's `int16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*
* _Available since v3.1._
*/
function toInt16(int256 value) internal pure returns (int16) {
require(value >= -2**15 && value < 2**15, "SafeCast: value doesn\'t fit in 16 bits");
return int16(value);
}
/**
* @dev Returns the downcasted int8 from int256, reverting on
* overflow (when the input is less than smallest int8 or
* greater than largest int8).
*
* Counterpart to Solidity's `int8` operator.
*
* Requirements:
*
* - input must fit into 8 bits.
*
* _Available since v3.1._
*/
function toInt8(int256 value) internal pure returns (int8) {
require(value >= -2**7 && value < 2**7, "SafeCast: value doesn\'t fit in 8 bits");
return int8(value);
}
/**
* @dev Converts an unsigned uint256 into a signed int256.
*
* Requirements:
*
* - input must be less than or equal to maxInt256.
*/
function toInt256(uint256 value) internal pure returns (int256) {
require(value < 2**255, "SafeCast: value doesn't fit in an int256");
return int256(value);
}
}/*
Copyright 2020 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache License, Version 2.0
*/
pragma solidity 0.6.10;
interface IController {
function addSet(address _setToken) external;
function feeRecipient() external view returns(address);
function getModuleFee(address _module, uint256 _feeType) external view returns(uint256);
function isModule(address _module) external view returns(bool);
function isSet(address _setToken) external view returns(bool);
function isSystemContract(address _contractAddress) external view returns (bool);
function resourceId(uint256 _id) external view returns(address);
}/*
Copyright 2020 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache License, Version 2.0
*/
pragma solidity 0.6.10;
pragma experimental "ABIEncoderV2";
/**
* @title IOracle
* @author Set Protocol
*
* Interface for operating with any external Oracle that returns uint256 or
* an adapting contract that converts oracle output to uint256
*/
interface IOracle {
struct RoundData {
uint80 roundID;
int answer;
uint startedAt;
uint timeStamp;
uint80 answeredInRound;
}
/**
* @return Current price of asset represented in uint256, typically a preciseUnit where 10^18 = 1.
*/
function latestRoundData() external view returns (RoundData memory);
}/*
Copyright 2020 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache License, Version 2.0
*/
pragma solidity 0.6.10;
/**
* @title IOracleAdapter
* @author Set Protocol
*
* Interface for calling an oracle adapter.
*/
interface IOracleAdapter {
/**
* Function for retrieving a price that requires sourcing data from outside protocols to calculate.
*
* @param _assetOne First asset in pair
* @param _assetTwo Second asset in pair
* @return Boolean indicating if oracle exists
* @return Current price of asset represented in uint256
*/
function getPrice(address _assetOne, address _assetTwo) external view returns (bool, uint256);
}/*
Copyright 2020 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache License, Version 2.0
*/
pragma solidity 0.6.10;
/**
* @title AddressArrayUtils
* @author Set Protocol
*
* Utility functions to handle Address Arrays
*
* CHANGELOG:
* - 4/21/21: Added validatePairsWithArray methods
*/
library AddressArrayUtils {
/**
* Finds the index of the first occurrence of the given element.
* @param A The input array to search
* @param a The value to find
* @return Returns (index and isIn) for the first occurrence starting from index 0
*/
function indexOf(address[] memory A, address a) internal pure returns (uint256, bool) {
uint256 length = A.length;
for (uint256 i = 0; i < length; i++) {
if (A[i] == a) {
return (i, true);
}
}
return (uint256(-1), false);
}
/**
* Returns true if the value is present in the list. Uses indexOf internally.
* @param A The input array to search
* @param a The value to find
* @return Returns isIn for the first occurrence starting from index 0
*/
function contains(address[] memory A, address a) internal pure returns (bool) {
(, bool isIn) = indexOf(A, a);
return isIn;
}
/**
* Returns true if there are 2 elements that are the same in an array
* @param A The input array to search
* @return Returns boolean for the first occurrence of a duplicate
*/
function hasDuplicate(address[] memory A) internal pure returns(bool) {
require(A.length > 0, "A is empty");
for (uint256 i = 0; i < A.length - 1; i++) {
address current = A[i];
for (uint256 j = i + 1; j < A.length; j++) {
if (current == A[j]) {
return true;
}
}
}
return false;
}
/**
* @param A The input array to search
* @param a The address to remove
* @return Returns the array with the object removed.
*/
function remove(address[] memory A, address a)
internal
pure
returns (address[] memory)
{
(uint256 index, bool isIn) = indexOf(A, a);
if (!isIn) {
revert("Address not in array.");
} else {
(address[] memory _A,) = pop(A, index);
return _A;
}
}
/**
* @param A The input array to search
* @param a The address to remove
*/
function removeStorage(address[] storage A, address a)
internal
{
(uint256 index, bool isIn) = indexOf(A, a);
if (!isIn) {
revert("Address not in array.");
} else {
uint256 lastIndex = A.length - 1; // If the array would be empty, the previous line would throw, so no underflow here
if (index != lastIndex) { A[index] = A[lastIndex]; }
A.pop();
}
}
/**
* Removes specified index from array
* @param A The input array to search
* @param index The index to remove
* @return Returns the new array and the removed entry
*/
function pop(address[] memory A, uint256 index)
internal
pure
returns (address[] memory, address)
{
uint256 length = A.length;
require(index < A.length, "Index must be < A length");
address[] memory newAddresses = new address[](length - 1);
for (uint256 i = 0; i < index; i++) {
newAddresses[i] = A[i];
}
for (uint256 j = index + 1; j < length; j++) {
newAddresses[j - 1] = A[j];
}
return (newAddresses, A[index]);
}
/**
* Returns the combination of the two arrays
* @param A The first array
* @param B The second array
* @return Returns A extended by B
*/
function extend(address[] memory A, address[] memory B) internal pure returns (address[] memory) {
uint256 aLength = A.length;
uint256 bLength = B.length;
address[] memory newAddresses = new address[](aLength + bLength);
for (uint256 i = 0; i < aLength; i++) {
newAddresses[i] = A[i];
}
for (uint256 j = 0; j < bLength; j++) {
newAddresses[aLength + j] = B[j];
}
return newAddresses;
}
/**
* Validate that address and uint array lengths match. Validate address array is not empty
* and contains no duplicate elements.
*
* @param A Array of addresses
* @param B Array of uint
*/
function validatePairsWithArray(address[] memory A, uint[] memory B) internal pure {
require(A.length == B.length, "Array length mismatch");
_validateLengthAndUniqueness(A);
}
/**
* Validate that address and bool array lengths match. Validate address array is not empty
* and contains no duplicate elements.
*
* @param A Array of addresses
* @param B Array of bool
*/
function validatePairsWithArray(address[] memory A, bool[] memory B) internal pure {
require(A.length == B.length, "Array length mismatch");
_validateLengthAndUniqueness(A);
}
/**
* Validate that address and string array lengths match. Validate address array is not empty
* and contains no duplicate elements.
*
* @param A Array of addresses
* @param B Array of strings
*/
function validatePairsWithArray(address[] memory A, string[] memory B) internal pure {
require(A.length == B.length, "Array length mismatch");
_validateLengthAndUniqueness(A);
}
/**
* Validate that address array lengths match, and calling address array are not empty
* and contain no duplicate elements.
*
* @param A Array of addresses
* @param B Array of addresses
*/
function validatePairsWithArray(address[] memory A, address[] memory B) internal pure {
require(A.length == B.length, "Array length mismatch");
_validateLengthAndUniqueness(A);
}
/**
* Validate that address and bytes array lengths match. Validate address array is not empty
* and contains no duplicate elements.
*
* @param A Array of addresses
* @param B Array of bytes
*/
function validatePairsWithArray(address[] memory A, bytes[] memory B) internal pure {
require(A.length == B.length, "Array length mismatch");
_validateLengthAndUniqueness(A);
}
/**
* Validate address array is not empty and contains no duplicate elements.
*
* @param A Array of addresses
*/
function _validateLengthAndUniqueness(address[] memory A) internal pure {
require(A.length > 0, "Array length must be > 0");
require(!hasDuplicate(A), "Cannot duplicate addresses");
}
}/*
Copyright 2020 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache License, Version 2.0
*/
pragma solidity 0.6.10;
pragma experimental ABIEncoderV2;
import { SafeCast } from "@openzeppelin/contracts/utils/SafeCast.sol";
import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol";
import { SignedSafeMath } from "@openzeppelin/contracts/math/SignedSafeMath.sol";
/**
* @title PreciseUnitMath
* @author Set Protocol
*
* Arithmetic for fixed-point numbers with 18 decimals of precision. Some functions taken from
* dYdX's BaseMath library.
*
* CHANGELOG:
* - 9/21/20: Added safePower function
* - 4/21/21: Added approximatelyEquals function
* - 12/13/21: Added preciseDivCeil (int overloads) function
* - 12/13/21: Added abs function
*/
library PreciseUnitMath {
using SafeMath for uint256;
using SignedSafeMath for int256;
using SafeCast for int256;
// The number One in precise units.
uint256 constant internal PRECISE_UNIT = 10 ** 18;
int256 constant internal PRECISE_UNIT_INT = 10 ** 18;
// Max unsigned integer value
uint256 constant internal MAX_UINT_256 = type(uint256).max;
// Max and min signed integer value
int256 constant internal MAX_INT_256 = type(int256).max;
int256 constant internal MIN_INT_256 = type(int256).min;
/**
* @dev Getter function since constants can't be read directly from libraries.
*/
function preciseUnit() internal pure returns (uint256) {
return PRECISE_UNIT;
}
/**
* @dev Getter function since constants can't be read directly from libraries.
*/
function preciseUnitInt() internal pure returns (int256) {
return PRECISE_UNIT_INT;
}
/**
* @dev Getter function since constants can't be read directly from libraries.
*/
function maxUint256() internal pure returns (uint256) {
return MAX_UINT_256;
}
/**
* @dev Getter function since constants can't be read directly from libraries.
*/
function maxInt256() internal pure returns (int256) {
return MAX_INT_256;
}
/**
* @dev Getter function since constants can't be read directly from libraries.
*/
function minInt256() internal pure returns (int256) {
return MIN_INT_256;
}
/**
* @dev Multiplies value a by value b (result is rounded down). It's assumed that the value b is the significand
* of a number with 18 decimals precision.
*/
function preciseMul(uint256 a, uint256 b) internal pure returns (uint256) {
return a.mul(b).div(PRECISE_UNIT);
}
/**
* @dev Multiplies value a by value b (result is rounded towards zero). It's assumed that the value b is the
* significand of a number with 18 decimals precision.
*/
function preciseMul(int256 a, int256 b) internal pure returns (int256) {
return a.mul(b).div(PRECISE_UNIT_INT);
}
/**
* @dev Multiplies value a by value b (result is rounded up). It's assumed that the value b is the significand
* of a number with 18 decimals precision.
*/
function preciseMulCeil(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0 || b == 0) {
return 0;
}
return a.mul(b).sub(1).div(PRECISE_UNIT).add(1);
}
/**
* @dev Divides value a by value b (result is rounded down).
*/
function preciseDiv(uint256 a, uint256 b) internal pure returns (uint256) {
return a.mul(PRECISE_UNIT).div(b);
}
/**
* @dev Divides value a by value b (result is rounded towards 0).
*/
function preciseDiv(int256 a, int256 b) internal pure returns (int256) {
return a.mul(PRECISE_UNIT_INT).div(b);
}
/**
* @dev Divides value a by value b (result is rounded up or away from 0).
*/
function preciseDivCeil(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "Cant divide by 0");
return a > 0 ? a.mul(PRECISE_UNIT).sub(1).div(b).add(1) : 0;
}
/**
* @dev Divides value a by value b (result is rounded up or away from 0). When `a` is 0, 0 is
* returned. When `b` is 0, method reverts with divide-by-zero error.
*/
function preciseDivCeil(int256 a, int256 b) internal pure returns (int256) {
require(b != 0, "Cant divide by 0");
a = a.mul(PRECISE_UNIT_INT);
int256 c = a.div(b);
if (a % b != 0) {
// a ^ b == 0 case is covered by the previous if statement, hence it won't resolve to --c
(a ^ b > 0) ? ++c : --c;
}
return c;
}
/**
* @dev Divides value a by value b (result is rounded down - positive numbers toward 0 and negative away from 0).
*/
function divDown(int256 a, int256 b) internal pure returns (int256) {
require(b != 0, "Cant divide by 0");
require(a != MIN_INT_256 || b != -1, "Invalid input");
int256 result = a.div(b);
if (a ^ b < 0 && a % b != 0) {
result -= 1;
}
return result;
}
/**
* @dev Multiplies value a by value b where rounding is towards the lesser number.
* (positive values are rounded towards zero and negative values are rounded away from 0).
*/
function conservativePreciseMul(int256 a, int256 b) internal pure returns (int256) {
return divDown(a.mul(b), PRECISE_UNIT_INT);
}
/**
* @dev Divides value a by value b where rounding is towards the lesser number.
* (positive values are rounded towards zero and negative values are rounded away from 0).
*/
function conservativePreciseDiv(int256 a, int256 b) internal pure returns (int256) {
return divDown(a.mul(PRECISE_UNIT_INT), b);
}
/**
* @dev Performs the power on a specified value, reverts on overflow.
*/
function safePower(
uint256 a,
uint256 pow
)
internal
pure
returns (uint256)
{
require(a > 0, "Value must be positive");
uint256 result = 1;
for (uint256 i = 0; i < pow; i++){
uint256 previousResult = result;
// Using safemath multiplication prevents overflows
result = previousResult.mul(a);
}
return result;
}
/**
* @dev Returns true if a =~ b within range, false otherwise.
*/
function approximatelyEquals(uint256 a, uint256 b, uint256 range) internal pure returns (bool) {
return a <= b.add(range) && a >= b.sub(range);
}
/**
* Returns the absolute value of int256 `a` as a uint256
*/
function abs(int256 a) internal pure returns (uint) {
return a >= 0 ? a.toUint256() : a.mul(-1).toUint256();
}
/**
* Returns the negation of a
*/
function neg(int256 a) internal pure returns (int256) {
require(a > MIN_INT_256, "Inversion overflow");
return -a;
}
}{
"optimizer": {
"enabled": true,
"runs": 20000
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IController","name":"_controller","type":"address"},{"internalType":"address","name":"_masterQuoteAsset","type":"address"},{"internalType":"address[]","name":"_adapters","type":"address[]"},{"internalType":"address[]","name":"_assetOnes","type":"address[]"},{"internalType":"address[]","name":"_assetTwos","type":"address[]"},{"internalType":"contract IOracle[]","name":"_oracles","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_adapter","type":"address"}],"name":"AdapterAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_adapter","type":"address"}],"name":"AdapterRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_newMasterQuote","type":"address"}],"name":"MasterQuoteAssetEdited","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":"_assetOne","type":"address"},{"indexed":true,"internalType":"address","name":"_assetTwo","type":"address"},{"indexed":false,"internalType":"address","name":"_oracle","type":"address"}],"name":"PairAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_assetOne","type":"address"},{"indexed":true,"internalType":"address","name":"_assetTwo","type":"address"},{"indexed":false,"internalType":"address","name":"_newOracle","type":"address"}],"name":"PairEdited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_assetOne","type":"address"},{"indexed":true,"internalType":"address","name":"_assetTwo","type":"address"},{"indexed":false,"internalType":"address","name":"_oracle","type":"address"}],"name":"PairRemoved","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"adapters","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_adapter","type":"address"}],"name":"addAdapter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_assetOne","type":"address"},{"internalType":"address","name":"_assetTwo","type":"address"},{"internalType":"contract IOracle","name":"_oracle","type":"address"}],"name":"addPair","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"contract IController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newMasterQuoteAsset","type":"address"}],"name":"editMasterQuoteAsset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_assetOne","type":"address"},{"internalType":"address","name":"_assetTwo","type":"address"},{"internalType":"contract IOracle","name":"_oracle","type":"address"}],"name":"editPair","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAdapters","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_assetOne","type":"address"},{"internalType":"address","name":"_assetTwo","type":"address"}],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"masterQuoteAsset","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"oracles","outputs":[{"internalType":"contract IOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_adapter","type":"address"}],"name":"removeAdapter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_assetOne","type":"address"},{"internalType":"address","name":"_assetTwo","type":"address"}],"name":"removePair","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b50604051620022f3380380620022f383398101604081905262000034916200036a565b6000620000496001600160e01b03620001d016565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600180546001600160a01b038089166001600160a01b03199283161790925560038054928816929091169190911790558351620000d8906004906020870190620001d5565b5081518351148015620000ec575080518251145b620001145760405162461bcd60e51b81526004016200010b9062000445565b60405180910390fd5b60005b8351811015620001c3578181815181106200012e57fe5b6020026020010151600260008684815181106200014757fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008584815181106200017e57fe5b6020908102919091018101516001600160a01b0390811683529082019290925260400160002080546001600160a01b0319169290911691909117905560010162000117565b50505050505050620004dc565b335b90565b8280548282559060005260206000209081019282156200022d579160200282015b828111156200022d57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620001f6565b506200023b9291506200023f565b5090565b620001d291905b808211156200023b5780546001600160a01b031916815560010162000246565b80516200027381620004c3565b92915050565b600082601f8301126200028a578081fd5b8151620002a16200029b82620004a3565b6200047c565b818152915060208083019084810181840286018201871015620002c357600080fd5b60005b84811015620002ef578151620002dc81620004c3565b84529282019290820190600101620002c6565b505050505092915050565b600082601f8301126200030b578081fd5b81516200031c6200029b82620004a3565b8181529150602080830190848101818402860182018710156200033e57600080fd5b60005b84811015620002ef5781516200035781620004c3565b8452928201929082019060010162000341565b60008060008060008060c0878903121562000383578182fd5b6200038f888862000266565b9550620003a0886020890162000266565b60408801519095506001600160401b0380821115620003bd578384fd5b620003cb8a838b0162000279565b95506060890151915080821115620003e1578384fd5b620003ef8a838b0162000279565b9450608089015191508082111562000405578384fd5b620004138a838b0162000279565b935060a089015191508082111562000429578283fd5b506200043889828a01620002fa565b9150509295509295509295565b6020808252601b908201527f4172726179206c656e6774687320646f206e6f74206d617463682e0000000000604082015260600190565b6040518181016001600160401b03811182821017156200049b57600080fd5b604052919050565b60006001600160401b03821115620004b9578081fd5b5060209081020190565b6001600160a01b0381168114620004d957600080fd5b50565b611e0780620004ec6000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806361d5b14411610097578063b82e16e311610066578063b82e16e3146101cf578063f1ec23cf146101e4578063f2fde38b146101f7578063f77c47911461020a576100f5565b806361d5b1441461018c578063715018a61461019f5780638da5cb5b146101a7578063ac41865a146101af576100f5565b806352a03c03116100d357806352a03c0314610140578063585cd34b146101535780635861b2271461016657806360d54d4114610179576100f5565b806304289853146100fa578063342833541461010f5780634ef501ac1461012d575b600080fd5b61010d61010836600461177f565b610212565b005b610117610380565b60405161012491906118a8565b60405180910390f35b61011761013b366004611890565b61039c565b61011761014e366004611747565b6103d0565b61010d61016136600461172b565b610403565b61010d610174366004611747565b6105d8565b61010d61018736600461172b565b610732565b61010d61019a36600461172b565b6108dd565b61010d6109a9565b610117610a74565b6101c26101bd366004611747565b610a91565b6040516101249190611da3565b6101d7610beb565b60405161012491906118f0565b61010d6101f236600461177f565b610c5a565b61010d61020536600461172b565b610db3565b610117610ee9565b61021a610f05565b60005473ffffffffffffffffffffffffffffffffffffffff908116911614610277576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611cb4565b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff83811660009081526002602090815260408083208685168452909152902054166102e2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611ce9565b73ffffffffffffffffffffffffffffffffffffffff838116600081815260026020908152604080832087861680855292529182902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001694861694909417909355517f31639ce2bfc7c00ec8297cb6df66924b38918a7417c8e6b10eb7dc9f95838910906103739085906118a8565b60405180910390a3505050565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b600481815481106103a957fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b600260209081526000928352604080842090915290825290205473ffffffffffffffffffffffffffffffffffffffff1681565b61040b610f05565b60005473ffffffffffffffffffffffffffffffffffffffff90811691161461045f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611cb4565b6104d98160048054806020026020016040519081016040528092919081815260200182805480156104c657602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161049b575b5050505050610f0990919063ffffffff16565b61050f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611a86565b61058981600480548060200260200160405190810160405280929190818152602001828054801561057657602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161054b575b5050505050610f1f90919063ffffffff16565b805161059d91600491602090910190611604565b507fdf980d21d8c7bb34800e668dbe003299093bac8e693614151d3c57f73f98a93d816040516105cd91906118a8565b60405180910390a150565b6105e0610f05565b60005473ffffffffffffffffffffffffffffffffffffffff908116911614610634576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611cb4565b73ffffffffffffffffffffffffffffffffffffffff828116600090815260026020908152604080832085851684529091529020541661069f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611d46565b73ffffffffffffffffffffffffffffffffffffffff828116600081815260026020908152604080832086861680855292529182902080547fffffffffffffffffffffffff000000000000000000000000000000000000000081169091559151919093169291907fd9001d4fd555e50f50619eeca8a260400b5e944989042d0652c5834aa2b96860906103739085906118a8565b61073a610f05565b60005473ffffffffffffffffffffffffffffffffffffffff90811691161461078e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611cb4565b6108068160048054806020026020016040519081016040528092919081815260200182805480156104c65760200282019190600052602060002090815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161049b575050505050610f0990919063ffffffff16565b1561083d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611b9d565b600480546001810182556000919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790556040517fcf9c2c7f9adbb156bd76affb04df84595f8f5e69cab2e61221b05b05a902fa26906105cd9083906118a8565b6108e5610f05565b60005473ffffffffffffffffffffffffffffffffffffffff908116911614610939576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611cb4565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790556040517f748818fcd84486bc2804c035b8dec2300489b070a39a4a290d8311cd9791d867906105cd9083906118a8565b6109b1610f05565b60005473ffffffffffffffffffffffffffffffffffffffff908116911614610a05576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611cb4565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60005473ffffffffffffffffffffffffffffffffffffffff165b90565b6001546040517f13bc6d4b00000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff16906313bc6d4b90610ae89033906004016118a8565b60206040518083038186803b158015610b0057600080fd5b505afa158015610b14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3891906117c9565b610b6e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611bfa565b600080610b7b8585610f81565b909250905081610b9557610b8f85856110c5565b90925090505b81610baa57610ba48585611145565b90925090505b81610be1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611ae3565b9150505b92915050565b60606004805480602002602001604051908101604052809291908181526020018280548015610c5057602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610c25575b5050505050905090565b610c62610f05565b60005473ffffffffffffffffffffffffffffffffffffffff908116911614610cb6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611cb4565b73ffffffffffffffffffffffffffffffffffffffff838116600090815260026020908152604080832086851684529091529020541615610d22576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611b40565b73ffffffffffffffffffffffffffffffffffffffff838116600081815260026020908152604080832087861680855292529182902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001694861694909417909355517f7f46075c67ca5bbd3aaf82d8e324282141f27b7cba3376e5498a6b70c9931c2a906103739085906118a8565b610dbb610f05565b60005473ffffffffffffffffffffffffffffffffffffffff908116911614610e0f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611cb4565b73ffffffffffffffffffffffffffffffffffffffff8116610e5c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611a29565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b3390565b600080610f168484611241565b95945050505050565b6060600080610f2e8585611241565b9150915080610f69576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e906119bb565b6060610f7586846112dc565b509350610be592505050565b73ffffffffffffffffffffffffffffffffffffffff808316600090815260026020908152604080832085851684529091528120549091829116801580159061105c57610fcb61168e565b8273ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561101157600080fd5b505afa158015611025573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611049919061181a565b602001516001955093506110be92505050565b73ffffffffffffffffffffffffffffffffffffffff80861660009081526002602090815260408083208a851684529091529020541680158015906110b25760016110a58361143f565b95509550505050506110be565b50600094508493505050505b9250929050565b6003546000908190819081906110f290879073ffffffffffffffffffffffffffffffffffffffff16610f81565b6003549193509150600090819061112090889073ffffffffffffffffffffffffffffffffffffffff16610f81565b9150915083801561112e5750815b156110b25760016110a5848363ffffffff6114ec16565b600080805b600454811015611234576000806004838154811061116457fe5b6000918252602090912001546040517fac41865a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063ac41865a906111c5908a908a906004016118c9565b604080518083038186803b1580156111dc57600080fd5b505afa1580156111f0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061121491906117e9565b91509150811561122a5790935091506110be9050565b505060010161114a565b5060009485945092505050565b81516000908190815b818110156112ae578473ffffffffffffffffffffffffffffffffffffffff1686828151811061127557fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614156112a6579250600191506110be9050565b60010161124a565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff95600095509350505050565b815160609060009080841061131d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e906119f2565b60606001820367ffffffffffffffff8111801561133957600080fd5b50604051908082528060200260200182016040528015611363578160200160208202803683370190505b50905060005b858110156113be5786818151811061137d57fe5b602002602001015182828151811061139157fe5b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910190910152600101611369565b50600185015b8281101561141c578681815181106113d857fe5b60200260200101518260018303815181106113ef57fe5b73ffffffffffffffffffffffffffffffffffffffff909216602092830291909101909101526001016113c4565b508086868151811061142a57fe5b60200260200101519350935050509250929050565b600061144961168e565b8273ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561148f57600080fd5b505afa1580156114a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c7919061181a565b90506114e581602001516114d9611516565b9063ffffffff6114ec16565b9392505050565b60006114e58261150a85670de0b6b3a764000063ffffffff61152216565b9063ffffffff61157616565b670de0b6b3a764000090565b60008261153157506000610be5565b8282028284828161153e57fe5b04146114e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611c57565b60006114e583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250600081836115ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e919061194a565b5060008385816115fa57fe5b0495945050505050565b82805482825590600052602060002090810192821561167e579160200282015b8281111561167e57825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190611624565b5061168a9291506116d5565b5090565b6040518060a00160405280600069ffffffffffffffffffff168152602001600081526020016000815260200160008152602001600069ffffffffffffffffffff1681525090565b610a8e91905b8082111561168a5780547fffffffffffffffffffffffff00000000000000000000000000000000000000001681556001016116db565b805169ffffffffffffffffffff81168114610be557600080fd5b60006020828403121561173c578081fd5b81356114e581611dac565b60008060408385031215611759578081fd5b823561176481611dac565b9150602083013561177481611dac565b809150509250929050565b600080600060608486031215611793578081fd5b833561179e81611dac565b925060208401356117ae81611dac565b915060408401356117be81611dac565b809150509250925092565b6000602082840312156117da578081fd5b815180151581146114e5578182fd5b600080604083850312156117fb578182fd5b8251801515811461180a578283fd5b6020939093015192949293505050565b600060a0828403121561182b578081fd5b60405160a0810181811067ffffffffffffffff8211171561184a578283fd5b6040526118578484611711565b81526020830151602082015260408301516040820152606083015160608201526118848460808501611711565b60808201529392505050565b6000602082840312156118a1578081fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b6020808252825182820181905260009190848201906040850190845b8181101561193e57835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161190c565b50909695505050505050565b6000602080835283518082850152825b818110156119765785810183015185820160400152820161195a565b818111156119875783604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60208082526015908201527f41646472657373206e6f7420696e2061727261792e0000000000000000000000604082015260600190565b60208082526018908201527f496e646578206d757374206265203c2041206c656e6774680000000000000000604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201527f6464726573730000000000000000000000000000000000000000000000000000606082015260800190565b60208082526032908201527f50726963654f7261636c652e72656d6f7665416461707465723a20416461707460408201527f657220646f6573206e6f742065786973742e0000000000000000000000000000606082015260800190565b60208082526026908201527f50726963654f7261636c652e67657450726963653a205072696365206e6f742060408201527f666f756e642e0000000000000000000000000000000000000000000000000000606082015260800190565b60208082526029908201527f50726963654f7261636c652e616464506169723a205061697220616c7265616460408201527f79206578697374732e0000000000000000000000000000000000000000000000606082015260800190565b6020808252602f908201527f50726963654f7261636c652e616464416461707465723a20416461707465722060408201527f616c7265616479206578697374732e0000000000000000000000000000000000606082015260800190565b60208082526035908201527f50726963654f7261636c652e67657450726963653a2043616c6c6572206d757360408201527f742062652073797374656d20636f6e74726163742e0000000000000000000000606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60408201527f7700000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526029908201527f50726963654f7261636c652e65646974506169723a205061697220646f65736e60408201527f27742065786973742e0000000000000000000000000000000000000000000000606082015260800190565b6020808252602b908201527f50726963654f7261636c652e72656d6f7665506169723a205061697220646f6560408201527f736e27742065786973742e000000000000000000000000000000000000000000606082015260800190565b90815260200190565b73ffffffffffffffffffffffffffffffffffffffff81168114611dce57600080fd5b5056fea26469706673582212200b84bf15bb5e1959f28e3e911a77a4649ffc7abbb3d4ff46fa7f2ccc213fb20764736f6c634300060a003300000000000000000000000036a7a778df69b6888045a708624477cab45d0b960000000000000000000000004d15ea9c2573addaed814e48c148b5262694646a00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000fc00000000000000000000000000000000000006000000000000000000000000fc00000000000000000000000000000000000002000000000000000000000000fc0000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000030000000000000000000000004d15ea9c2573addaed814e48c148b5262694646a0000000000000000000000004d15ea9c2573addaed814e48c148b5262694646a0000000000000000000000004d15ea9c2573addaed814e48c148b5262694646a000000000000000000000000000000000000000000000000000000000000000300000000000000000000000089e60b56efd70a1d4fbbae947bc33cae41e37a72000000000000000000000000bf228a9131ab3bb8ca8c7a4ad574932253d99cd1000000000000000000000000a41107f9259bb835275eacaad8048307b80d7c00
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806361d5b14411610097578063b82e16e311610066578063b82e16e3146101cf578063f1ec23cf146101e4578063f2fde38b146101f7578063f77c47911461020a576100f5565b806361d5b1441461018c578063715018a61461019f5780638da5cb5b146101a7578063ac41865a146101af576100f5565b806352a03c03116100d357806352a03c0314610140578063585cd34b146101535780635861b2271461016657806360d54d4114610179576100f5565b806304289853146100fa578063342833541461010f5780634ef501ac1461012d575b600080fd5b61010d61010836600461177f565b610212565b005b610117610380565b60405161012491906118a8565b60405180910390f35b61011761013b366004611890565b61039c565b61011761014e366004611747565b6103d0565b61010d61016136600461172b565b610403565b61010d610174366004611747565b6105d8565b61010d61018736600461172b565b610732565b61010d61019a36600461172b565b6108dd565b61010d6109a9565b610117610a74565b6101c26101bd366004611747565b610a91565b6040516101249190611da3565b6101d7610beb565b60405161012491906118f0565b61010d6101f236600461177f565b610c5a565b61010d61020536600461172b565b610db3565b610117610ee9565b61021a610f05565b60005473ffffffffffffffffffffffffffffffffffffffff908116911614610277576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611cb4565b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff83811660009081526002602090815260408083208685168452909152902054166102e2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611ce9565b73ffffffffffffffffffffffffffffffffffffffff838116600081815260026020908152604080832087861680855292529182902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001694861694909417909355517f31639ce2bfc7c00ec8297cb6df66924b38918a7417c8e6b10eb7dc9f95838910906103739085906118a8565b60405180910390a3505050565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b600481815481106103a957fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b600260209081526000928352604080842090915290825290205473ffffffffffffffffffffffffffffffffffffffff1681565b61040b610f05565b60005473ffffffffffffffffffffffffffffffffffffffff90811691161461045f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611cb4565b6104d98160048054806020026020016040519081016040528092919081815260200182805480156104c657602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161049b575b5050505050610f0990919063ffffffff16565b61050f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611a86565b61058981600480548060200260200160405190810160405280929190818152602001828054801561057657602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161054b575b5050505050610f1f90919063ffffffff16565b805161059d91600491602090910190611604565b507fdf980d21d8c7bb34800e668dbe003299093bac8e693614151d3c57f73f98a93d816040516105cd91906118a8565b60405180910390a150565b6105e0610f05565b60005473ffffffffffffffffffffffffffffffffffffffff908116911614610634576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611cb4565b73ffffffffffffffffffffffffffffffffffffffff828116600090815260026020908152604080832085851684529091529020541661069f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611d46565b73ffffffffffffffffffffffffffffffffffffffff828116600081815260026020908152604080832086861680855292529182902080547fffffffffffffffffffffffff000000000000000000000000000000000000000081169091559151919093169291907fd9001d4fd555e50f50619eeca8a260400b5e944989042d0652c5834aa2b96860906103739085906118a8565b61073a610f05565b60005473ffffffffffffffffffffffffffffffffffffffff90811691161461078e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611cb4565b6108068160048054806020026020016040519081016040528092919081815260200182805480156104c65760200282019190600052602060002090815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161049b575050505050610f0990919063ffffffff16565b1561083d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611b9d565b600480546001810182556000919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790556040517fcf9c2c7f9adbb156bd76affb04df84595f8f5e69cab2e61221b05b05a902fa26906105cd9083906118a8565b6108e5610f05565b60005473ffffffffffffffffffffffffffffffffffffffff908116911614610939576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611cb4565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790556040517f748818fcd84486bc2804c035b8dec2300489b070a39a4a290d8311cd9791d867906105cd9083906118a8565b6109b1610f05565b60005473ffffffffffffffffffffffffffffffffffffffff908116911614610a05576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611cb4565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60005473ffffffffffffffffffffffffffffffffffffffff165b90565b6001546040517f13bc6d4b00000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff16906313bc6d4b90610ae89033906004016118a8565b60206040518083038186803b158015610b0057600080fd5b505afa158015610b14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3891906117c9565b610b6e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611bfa565b600080610b7b8585610f81565b909250905081610b9557610b8f85856110c5565b90925090505b81610baa57610ba48585611145565b90925090505b81610be1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611ae3565b9150505b92915050565b60606004805480602002602001604051908101604052809291908181526020018280548015610c5057602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610c25575b5050505050905090565b610c62610f05565b60005473ffffffffffffffffffffffffffffffffffffffff908116911614610cb6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611cb4565b73ffffffffffffffffffffffffffffffffffffffff838116600090815260026020908152604080832086851684529091529020541615610d22576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611b40565b73ffffffffffffffffffffffffffffffffffffffff838116600081815260026020908152604080832087861680855292529182902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001694861694909417909355517f7f46075c67ca5bbd3aaf82d8e324282141f27b7cba3376e5498a6b70c9931c2a906103739085906118a8565b610dbb610f05565b60005473ffffffffffffffffffffffffffffffffffffffff908116911614610e0f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611cb4565b73ffffffffffffffffffffffffffffffffffffffff8116610e5c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611a29565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b3390565b600080610f168484611241565b95945050505050565b6060600080610f2e8585611241565b9150915080610f69576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e906119bb565b6060610f7586846112dc565b509350610be592505050565b73ffffffffffffffffffffffffffffffffffffffff808316600090815260026020908152604080832085851684529091528120549091829116801580159061105c57610fcb61168e565b8273ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561101157600080fd5b505afa158015611025573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611049919061181a565b602001516001955093506110be92505050565b73ffffffffffffffffffffffffffffffffffffffff80861660009081526002602090815260408083208a851684529091529020541680158015906110b25760016110a58361143f565b95509550505050506110be565b50600094508493505050505b9250929050565b6003546000908190819081906110f290879073ffffffffffffffffffffffffffffffffffffffff16610f81565b6003549193509150600090819061112090889073ffffffffffffffffffffffffffffffffffffffff16610f81565b9150915083801561112e5750815b156110b25760016110a5848363ffffffff6114ec16565b600080805b600454811015611234576000806004838154811061116457fe5b6000918252602090912001546040517fac41865a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063ac41865a906111c5908a908a906004016118c9565b604080518083038186803b1580156111dc57600080fd5b505afa1580156111f0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061121491906117e9565b91509150811561122a5790935091506110be9050565b505060010161114a565b5060009485945092505050565b81516000908190815b818110156112ae578473ffffffffffffffffffffffffffffffffffffffff1686828151811061127557fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614156112a6579250600191506110be9050565b60010161124a565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff95600095509350505050565b815160609060009080841061131d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e906119f2565b60606001820367ffffffffffffffff8111801561133957600080fd5b50604051908082528060200260200182016040528015611363578160200160208202803683370190505b50905060005b858110156113be5786818151811061137d57fe5b602002602001015182828151811061139157fe5b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910190910152600101611369565b50600185015b8281101561141c578681815181106113d857fe5b60200260200101518260018303815181106113ef57fe5b73ffffffffffffffffffffffffffffffffffffffff909216602092830291909101909101526001016113c4565b508086868151811061142a57fe5b60200260200101519350935050509250929050565b600061144961168e565b8273ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561148f57600080fd5b505afa1580156114a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c7919061181a565b90506114e581602001516114d9611516565b9063ffffffff6114ec16565b9392505050565b60006114e58261150a85670de0b6b3a764000063ffffffff61152216565b9063ffffffff61157616565b670de0b6b3a764000090565b60008261153157506000610be5565b8282028284828161153e57fe5b04146114e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611c57565b60006114e583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250600081836115ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e919061194a565b5060008385816115fa57fe5b0495945050505050565b82805482825590600052602060002090810192821561167e579160200282015b8281111561167e57825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190611624565b5061168a9291506116d5565b5090565b6040518060a00160405280600069ffffffffffffffffffff168152602001600081526020016000815260200160008152602001600069ffffffffffffffffffff1681525090565b610a8e91905b8082111561168a5780547fffffffffffffffffffffffff00000000000000000000000000000000000000001681556001016116db565b805169ffffffffffffffffffff81168114610be557600080fd5b60006020828403121561173c578081fd5b81356114e581611dac565b60008060408385031215611759578081fd5b823561176481611dac565b9150602083013561177481611dac565b809150509250929050565b600080600060608486031215611793578081fd5b833561179e81611dac565b925060208401356117ae81611dac565b915060408401356117be81611dac565b809150509250925092565b6000602082840312156117da578081fd5b815180151581146114e5578182fd5b600080604083850312156117fb578182fd5b8251801515811461180a578283fd5b6020939093015192949293505050565b600060a0828403121561182b578081fd5b60405160a0810181811067ffffffffffffffff8211171561184a578283fd5b6040526118578484611711565b81526020830151602082015260408301516040820152606083015160608201526118848460808501611711565b60808201529392505050565b6000602082840312156118a1578081fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b6020808252825182820181905260009190848201906040850190845b8181101561193e57835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161190c565b50909695505050505050565b6000602080835283518082850152825b818110156119765785810183015185820160400152820161195a565b818111156119875783604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60208082526015908201527f41646472657373206e6f7420696e2061727261792e0000000000000000000000604082015260600190565b60208082526018908201527f496e646578206d757374206265203c2041206c656e6774680000000000000000604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201527f6464726573730000000000000000000000000000000000000000000000000000606082015260800190565b60208082526032908201527f50726963654f7261636c652e72656d6f7665416461707465723a20416461707460408201527f657220646f6573206e6f742065786973742e0000000000000000000000000000606082015260800190565b60208082526026908201527f50726963654f7261636c652e67657450726963653a205072696365206e6f742060408201527f666f756e642e0000000000000000000000000000000000000000000000000000606082015260800190565b60208082526029908201527f50726963654f7261636c652e616464506169723a205061697220616c7265616460408201527f79206578697374732e0000000000000000000000000000000000000000000000606082015260800190565b6020808252602f908201527f50726963654f7261636c652e616464416461707465723a20416461707465722060408201527f616c7265616479206578697374732e0000000000000000000000000000000000606082015260800190565b60208082526035908201527f50726963654f7261636c652e67657450726963653a2043616c6c6572206d757360408201527f742062652073797374656d20636f6e74726163742e0000000000000000000000606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60408201527f7700000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526029908201527f50726963654f7261636c652e65646974506169723a205061697220646f65736e60408201527f27742065786973742e0000000000000000000000000000000000000000000000606082015260800190565b6020808252602b908201527f50726963654f7261636c652e72656d6f7665506169723a205061697220646f6560408201527f736e27742065786973742e000000000000000000000000000000000000000000606082015260800190565b90815260200190565b73ffffffffffffffffffffffffffffffffffffffff81168114611dce57600080fd5b5056fea26469706673582212200b84bf15bb5e1959f28e3e911a77a4649ffc7abbb3d4ff46fa7f2ccc213fb20764736f6c634300060a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000036a7a778df69b6888045a708624477cab45d0b960000000000000000000000004d15ea9c2573addaed814e48c148b5262694646a00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000fc00000000000000000000000000000000000006000000000000000000000000fc00000000000000000000000000000000000002000000000000000000000000fc0000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000030000000000000000000000004d15ea9c2573addaed814e48c148b5262694646a0000000000000000000000004d15ea9c2573addaed814e48c148b5262694646a0000000000000000000000004d15ea9c2573addaed814e48c148b5262694646a000000000000000000000000000000000000000000000000000000000000000300000000000000000000000089e60b56efd70a1d4fbbae947bc33cae41e37a72000000000000000000000000bf228a9131ab3bb8ca8c7a4ad574932253d99cd1000000000000000000000000a41107f9259bb835275eacaad8048307b80d7c00
-----Decoded View---------------
Arg [0] : _controller (address): 0x36a7a778DF69B6888045a708624477CAb45d0B96
Arg [1] : _masterQuoteAsset (address): 0x4d15EA9C2573ADDAeD814e48C148b5262694646A
Arg [2] : _adapters (address[]):
Arg [3] : _assetOnes (address[]): 0xFC00000000000000000000000000000000000006,0xFc00000000000000000000000000000000000002,0xFc00000000000000000000000000000000000001
Arg [4] : _assetTwos (address[]): 0x4d15EA9C2573ADDAeD814e48C148b5262694646A,0x4d15EA9C2573ADDAeD814e48C148b5262694646A,0x4d15EA9C2573ADDAeD814e48C148b5262694646A
Arg [5] : _oracles (address[]): 0x89e60b56efD70a1D4FBBaE947bC33cae41e37A72,0xbf228a9131AB3BB8ca8C7a4Ad574932253D99Cd1,0xa41107f9259bB835275eaCaAd8048307B80D7c00
-----Encoded View---------------
19 Constructor Arguments found :
Arg [0] : 00000000000000000000000036a7a778df69b6888045a708624477cab45d0b96
Arg [1] : 0000000000000000000000004d15ea9c2573addaed814e48c148b5262694646a
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [3] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [5] : 00000000000000000000000000000000000000000000000000000000000001e0
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [8] : 000000000000000000000000fc00000000000000000000000000000000000006
Arg [9] : 000000000000000000000000fc00000000000000000000000000000000000002
Arg [10] : 000000000000000000000000fc00000000000000000000000000000000000001
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [12] : 0000000000000000000000004d15ea9c2573addaed814e48c148b5262694646a
Arg [13] : 0000000000000000000000004d15ea9c2573addaed814e48c148b5262694646a
Arg [14] : 0000000000000000000000004d15ea9c2573addaed814e48c148b5262694646a
Arg [15] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [16] : 00000000000000000000000089e60b56efd70a1d4fbbae947bc33cae41e37a72
Arg [17] : 000000000000000000000000bf228a9131ab3bb8ca8c7a4ad574932253d99cd1
Arg [18] : 000000000000000000000000a41107f9259bb835275eacaad8048307b80d7c00
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in FRAX
0
Multichain Portfolio | 35 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.