Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
FeederManager
Compiler Version
v0.8.2+commit.661d1103
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2021-03-31
*/
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.2;
pragma abicoder v2;
interface IPlatformIntegration {
/**
* @dev Deposit the given bAsset to Lending platform
* @param _bAsset bAsset address
* @param _amount Amount to deposit
*/
function deposit(
address _bAsset,
uint256 _amount,
bool isTokenFeeCharged
) external returns (uint256 quantityDeposited);
/**
* @dev Withdraw given bAsset from Lending platform
*/
function withdraw(
address _receiver,
address _bAsset,
uint256 _amount,
bool _hasTxFee
) external;
/**
* @dev Withdraw given bAsset from Lending platform
*/
function withdraw(
address _receiver,
address _bAsset,
uint256 _amount,
uint256 _totalAmount,
bool _hasTxFee
) external;
/**
* @dev Withdraw given bAsset from the cache
*/
function withdrawRaw(
address _receiver,
address _bAsset,
uint256 _amount
) external;
/**
* @dev Returns the current balance of the given bAsset
*/
function checkBalance(address _bAsset) external returns (uint256 balance);
/**
* @dev Returns the pToken
*/
function bAssetToPToken(address _bAsset) external returns (address pToken);
}
struct BassetPersonal {
// Address of the bAsset
address addr;
// Address of the bAsset
address integrator;
// An ERC20 can charge transfer fee, for example USDT, DGX tokens.
bool hasTxFee; // takes a byte in storage
// Status of the bAsset
BassetStatus status;
}
struct BassetData {
// 1 Basset * ratio / ratioScale == x Masset (relative value)
// If ratio == 10e8 then 1 bAsset = 10 mAssets
// A ratio is divised as 10^(18-tokenDecimals) * measurementMultiple(relative value of 1 base unit)
uint128 ratio;
// Amount of the Basset that is held in Collateral
uint128 vaultBalance;
}
// Status of the Basset - has it broken its peg?
enum BassetStatus {
Default,
Normal,
BrokenBelowPeg,
BrokenAbovePeg,
Blacklisted,
Liquidating,
Liquidated,
Failed
}
struct BasketState {
bool undergoingRecol;
bool failed;
}
struct InvariantConfig {
uint256 a;
WeightLimits limits;
}
struct WeightLimits {
uint128 min;
uint128 max;
}
struct FeederConfig {
uint256 supply;
uint256 a;
WeightLimits limits;
}
struct AmpData {
uint64 initialA;
uint64 targetA;
uint64 rampStartTime;
uint64 rampEndTime;
}
struct FeederData {
uint256 swapFee;
uint256 redemptionFee;
uint256 govFee;
uint256 pendingFees;
uint256 cacheSize;
BassetPersonal[] bAssetPersonal;
BassetData[] bAssetData;
AmpData ampData;
WeightLimits weightLimits;
}
struct AssetData {
uint8 idx;
uint256 amt;
BassetPersonal personal;
}
struct Asset {
uint8 idx;
address addr;
bool exists;
}
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);
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeERC20 {
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
library StableMath {
/**
* @dev Scaling unit for use in specific calculations,
* where 1 * 10**18, or 1e18 represents a unit '1'
*/
uint256 private constant FULL_SCALE = 1e18;
/**
* @dev Token Ratios are used when converting between units of bAsset, mAsset and MTA
* Reasoning: Takes into account token decimals, and difference in base unit (i.e. grams to Troy oz for gold)
* bAsset ratio unit for use in exact calculations,
* where (1 bAsset unit * bAsset.ratio) / ratioScale == x mAsset unit
*/
uint256 private constant RATIO_SCALE = 1e8;
/**
* @dev Provides an interface to the scaling unit
* @return Scaling unit (1e18 or 1 * 10**18)
*/
function getFullScale() internal pure returns (uint256) {
return FULL_SCALE;
}
/**
* @dev Provides an interface to the ratio unit
* @return Ratio scale unit (1e8 or 1 * 10**8)
*/
function getRatioScale() internal pure returns (uint256) {
return RATIO_SCALE;
}
/**
* @dev Scales a given integer to the power of the full scale.
* @param x Simple uint256 to scale
* @return Scaled value a to an exact number
*/
function scaleInteger(uint256 x) internal pure returns (uint256) {
return x * FULL_SCALE;
}
/***************************************
PRECISE ARITHMETIC
****************************************/
/**
* @dev Multiplies two precise units, and then truncates by the full scale
* @param x Left hand input to multiplication
* @param y Right hand input to multiplication
* @return Result after multiplying the two inputs and then dividing by the shared
* scale unit
*/
function mulTruncate(uint256 x, uint256 y) internal pure returns (uint256) {
return mulTruncateScale(x, y, FULL_SCALE);
}
/**
* @dev Multiplies two precise units, and then truncates by the given scale. For example,
* when calculating 90% of 10e18, (10e18 * 9e17) / 1e18 = (9e36) / 1e18 = 9e18
* @param x Left hand input to multiplication
* @param y Right hand input to multiplication
* @param scale Scale unit
* @return Result after multiplying the two inputs and then dividing by the shared
* scale unit
*/
function mulTruncateScale(
uint256 x,
uint256 y,
uint256 scale
) internal pure returns (uint256) {
// e.g. assume scale = fullScale
// z = 10e18 * 9e17 = 9e36
// return 9e38 / 1e18 = 9e18
return (x * y) / scale;
}
/**
* @dev Multiplies two precise units, and then truncates by the full scale, rounding up the result
* @param x Left hand input to multiplication
* @param y Right hand input to multiplication
* @return Result after multiplying the two inputs and then dividing by the shared
* scale unit, rounded up to the closest base unit.
*/
function mulTruncateCeil(uint256 x, uint256 y) internal pure returns (uint256) {
// e.g. 8e17 * 17268172638 = 138145381104e17
uint256 scaled = x * y;
// e.g. 138145381104e17 + 9.99...e17 = 138145381113.99...e17
uint256 ceil = scaled + FULL_SCALE - 1;
// e.g. 13814538111.399...e18 / 1e18 = 13814538111
return ceil / FULL_SCALE;
}
/**
* @dev Precisely divides two units, by first scaling the left hand operand. Useful
* for finding percentage weightings, i.e. 8e18/10e18 = 80% (or 8e17)
* @param x Left hand input to division
* @param y Right hand input to division
* @return Result after multiplying the left operand by the scale, and
* executing the division on the right hand input.
*/
function divPrecisely(uint256 x, uint256 y) internal pure returns (uint256) {
// e.g. 8e18 * 1e18 = 8e36
// e.g. 8e36 / 10e18 = 8e17
return (x * FULL_SCALE) / y;
}
/***************************************
RATIO FUNCS
****************************************/
/**
* @dev Multiplies and truncates a token ratio, essentially flooring the result
* i.e. How much mAsset is this bAsset worth?
* @param x Left hand operand to multiplication (i.e Exact quantity)
* @param ratio bAsset ratio
* @return c Result after multiplying the two inputs and then dividing by the ratio scale
*/
function mulRatioTruncate(uint256 x, uint256 ratio) internal pure returns (uint256 c) {
return mulTruncateScale(x, ratio, RATIO_SCALE);
}
/**
* @dev Multiplies and truncates a token ratio, rounding up the result
* i.e. How much mAsset is this bAsset worth?
* @param x Left hand input to multiplication (i.e Exact quantity)
* @param ratio bAsset ratio
* @return Result after multiplying the two inputs and then dividing by the shared
* ratio scale, rounded up to the closest base unit.
*/
function mulRatioTruncateCeil(uint256 x, uint256 ratio) internal pure returns (uint256) {
// e.g. How much mAsset should I burn for this bAsset (x)?
// 1e18 * 1e8 = 1e26
uint256 scaled = x * ratio;
// 1e26 + 9.99e7 = 100..00.999e8
uint256 ceil = scaled + RATIO_SCALE - 1;
// return 100..00.999e8 / 1e8 = 1e18
return ceil / RATIO_SCALE;
}
/**
* @dev Precisely divides two ratioed units, by first scaling the left hand operand
* i.e. How much bAsset is this mAsset worth?
* @param x Left hand operand in division
* @param ratio bAsset ratio
* @return c Result after multiplying the left operand by the scale, and
* executing the division on the right hand input.
*/
function divRatioPrecisely(uint256 x, uint256 ratio) internal pure returns (uint256 c) {
// e.g. 1e14 * 1e8 = 1e22
// return 1e22 / 1e12 = 1e10
return (x * RATIO_SCALE) / ratio;
}
/***************************************
HELPERS
****************************************/
/**
* @dev Calculates minimum of two numbers
* @param x Left hand input
* @param y Right hand input
* @return Minimum of the two inputs
*/
function min(uint256 x, uint256 y) internal pure returns (uint256) {
return x > y ? y : x;
}
/**
* @dev Calculated maximum of two numbers
* @param x Left hand input
* @param y Right hand input
* @return Maximum of the two inputs
*/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
return x > y ? x : y;
}
/**
* @dev Clamps a value to an upper bound
* @param x Left hand input
* @param upperBound Maximum possible value to return
* @return Input x clamped to a maximum value, upperBound
*/
function clamp(uint256 x, uint256 upperBound) internal pure returns (uint256) {
return x > upperBound ? upperBound : x;
}
}
/**
* @title FeederManager
* @author mStable
* @notice Manager contract for fPools. Forked from `masset/Manager.sol`, and performs a subset of functionality
* related to basket management.
* @dev VERSION: 1.0
* DATE: 2021-03-01
*/
library FeederManager {
using SafeERC20 for IERC20;
using StableMath for uint256;
event BassetsMigrated(address[] bAssets, address newIntegrator);
event StartRampA(uint256 currentA, uint256 targetA, uint256 startTime, uint256 rampEndTime);
event StopRampA(uint256 currentA, uint256 time);
uint256 private constant MIN_RAMP_TIME = 1 days;
uint256 private constant MAX_A = 1e6;
/**
* @dev Calculates the gains accrued across all lending markets.
* @param _bAssetPersonal Basset personal storage array
* @param _bAssetData Basset data storage array
* @return idxs Array [0,1]
* @return rawGains Raw increases in vault Balance
*/
function calculatePlatformInterest(
BassetPersonal[] memory _bAssetPersonal,
BassetData[] storage _bAssetData
) external returns (uint8[] memory idxs, uint256[] memory rawGains) {
// Get basket details
BassetData[] memory bAssetData_ = _bAssetData;
uint256 count = bAssetData_.length;
idxs = new uint8[](count);
rawGains = new uint256[](count);
// 1. Calculate rawGains in each bAsset, in comparison to current vault balance
for (uint256 i = 0; i < count; i++) {
idxs[i] = uint8(i);
BassetPersonal memory bPersonal = _bAssetPersonal[i];
BassetData memory bData = bAssetData_[i];
// If there is no integration, then nothing can have accrued
if (bPersonal.integrator == address(0)) continue;
uint256 lending =
IPlatformIntegration(bPersonal.integrator).checkBalance(bPersonal.addr);
uint256 cache = 0;
if (!bPersonal.hasTxFee) {
cache = IERC20(bPersonal.addr).balanceOf(bPersonal.integrator);
}
uint256 balance = lending + cache;
uint256 oldVaultBalance = bData.vaultBalance;
if (balance > oldVaultBalance && bPersonal.status == BassetStatus.Normal) {
_bAssetData[i].vaultBalance = SafeCast.toUint128(balance);
uint256 interestDelta = balance - oldVaultBalance;
rawGains[i] = interestDelta;
} else {
rawGains[i] = 0;
}
}
}
/**
* @dev Transfers all collateral from one lending market to another - used initially
* to handle the migration between Aave V1 and Aave V2. Note - only supports non
* tx fee enabled assets. Supports going from no integration to integration, but
* not the other way around.
* @param _bAssetPersonal Basset data storage array
* @param _bAssets Array of basket assets to migrate
* @param _newIntegration Address of the new platform integration
*/
function migrateBassets(
BassetPersonal[] storage _bAssetPersonal,
address[] calldata _bAssets,
address _newIntegration
) external {
uint256 len = _bAssets.length;
require(len > 0, "Must migrate some bAssets");
for (uint256 i = 0; i < len; i++) {
// 1. Check that the bAsset is in the basket
address bAsset = _bAssets[i];
uint256 index = _getAssetIndex(_bAssetPersonal, bAsset);
require(!_bAssetPersonal[index].hasTxFee, "A bAsset has a transfer fee");
// 2. Withdraw everything from the old platform integration
address oldAddress = _bAssetPersonal[index].integrator;
require(oldAddress != _newIntegration, "Must transfer to new integrator");
(uint256 cache, uint256 lendingBal) = (0, 0);
if (oldAddress == address(0)) {
cache = IERC20(bAsset).balanceOf(address(this));
} else {
IPlatformIntegration oldIntegration = IPlatformIntegration(oldAddress);
cache = IERC20(bAsset).balanceOf(address(oldIntegration));
// 2.1. Withdraw from the lending market
lendingBal = oldIntegration.checkBalance(bAsset);
if (lendingBal > 0) {
oldIntegration.withdraw(address(this), bAsset, lendingBal, false);
}
// 2.2. Withdraw from the cache, if any
if (cache > 0) {
oldIntegration.withdrawRaw(address(this), bAsset, cache);
}
}
uint256 sum = lendingBal + cache;
// 3. Update the integration address for this bAsset
_bAssetPersonal[index].integrator = _newIntegration;
// 4. Deposit everything into the new
// This should fail if we did not receive the full amount from the platform withdrawal
// 4.1. Deposit all bAsset
IERC20(bAsset).safeTransfer(_newIntegration, sum);
IPlatformIntegration newIntegration = IPlatformIntegration(_newIntegration);
if (lendingBal > 0) {
newIntegration.deposit(bAsset, lendingBal, false);
}
// 4.2. Check balances
uint256 newLendingBal = newIntegration.checkBalance(bAsset);
uint256 newCache = IERC20(bAsset).balanceOf(address(newIntegration));
uint256 upperMargin = 10001e14;
uint256 lowerMargin = 9999e14;
require(
newLendingBal >= lendingBal.mulTruncate(lowerMargin) &&
newLendingBal <= lendingBal.mulTruncate(upperMargin),
"Must transfer full amount"
);
require(
newCache >= cache.mulTruncate(lowerMargin) &&
newCache <= cache.mulTruncate(upperMargin),
"Must transfer full amount"
);
}
emit BassetsMigrated(_bAssets, _newIntegration);
}
/**
* @dev Simply gets the asset index by looping through bAssets. Given there are only
* ever 2 assets, should not be gas intensive.
*/
function _getAssetIndex(BassetPersonal[] storage _bAssetPersonal, address _asset)
internal
view
returns (uint8 idx)
{
uint256 len = _bAssetPersonal.length;
for (uint8 i = 0; i < len; i++) {
if (_bAssetPersonal[i].addr == _asset) return i;
}
revert("Invalid asset");
}
/**
* @dev Starts changing of the amplification var A
* @param _targetA Target A value
* @param _rampEndTime Time at which A will arrive at _targetA
*/
function startRampA(
AmpData storage _ampData,
uint256 _targetA,
uint256 _rampEndTime,
uint256 _currentA,
uint256 _precision
) external {
require(
block.timestamp >= (_ampData.rampStartTime + MIN_RAMP_TIME),
"Sufficient period of previous ramp has not elapsed"
);
require(_rampEndTime >= (block.timestamp + MIN_RAMP_TIME), "Ramp time too short");
require(_targetA > 0 && _targetA < MAX_A, "A target out of bounds");
uint256 preciseTargetA = _targetA * _precision;
if (preciseTargetA > _currentA) {
require(preciseTargetA <= _currentA * 10, "A target increase too big");
} else {
require(preciseTargetA >= _currentA / 10, "A target decrease too big");
}
_ampData.initialA = SafeCast.toUint64(_currentA);
_ampData.targetA = SafeCast.toUint64(preciseTargetA);
_ampData.rampStartTime = SafeCast.toUint64(block.timestamp);
_ampData.rampEndTime = SafeCast.toUint64(_rampEndTime);
emit StartRampA(_currentA, preciseTargetA, block.timestamp, _rampEndTime);
}
/**
* @dev Stops the changing of the amplification var A, setting
* it to whatever the current value is.
*/
function stopRampA(AmpData storage _ampData, uint256 _currentA) external {
require(block.timestamp < _ampData.rampEndTime, "Amplification not changing");
_ampData.initialA = SafeCast.toUint64(_currentA);
_ampData.targetA = SafeCast.toUint64(_currentA);
_ampData.rampStartTime = SafeCast.toUint64(block.timestamp);
_ampData.rampEndTime = SafeCast.toUint64(block.timestamp);
emit StopRampA(_currentA, block.timestamp);
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"bAssets","type":"address[]"},{"indexed":false,"internalType":"address","name":"newIntegrator","type":"address"}],"name":"BassetsMigrated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"currentA","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"targetA","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rampEndTime","type":"uint256"}],"name":"StartRampA","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"currentA","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"StopRampA","type":"event"}]Contract Creation Code
6119d861003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100565760003560e01c80637203e78b1461005b578063bd5b0ac61461007d578063ceb5ad271461009d578063e6a048a0146100bd575b600080fd5b81801561006757600080fd5b5061007b610076366004611617565b6100f4565b005b81801561008957600080fd5b5061007b6100983660046116dd565b610871565b8180156100a957600080fd5b5061007b6100b83660046116bc565b610b72565b8180156100c957600080fd5b506100dd6100d836600461150e565b610cbe565b6040516100eb9291906117ac565b60405180910390f35b81806101475760405162461bcd60e51b815260206004820152601960248201527f4d757374206d69677261746520736f6d6520624173736574730000000000000060448201526064015b60405180910390fd5b60005b8181101561082e57600085858381811061017457634e487b7160e01b600052603260045260246000fd5b905060200201602081019061018991906114f4565b9050600061019788836110e4565b60ff1690508781815481106101bc57634e487b7160e01b600052603260045260246000fd5b906000526020600020906002020160010160149054906101000a900460ff16156102285760405162461bcd60e51b815260206004820152601b60248201527f4120624173736574206861732061207472616e73666572206665650000000000604482015260640161013e565b600088828154811061024a57634e487b7160e01b600052603260045260246000fd5b60009182526020909120600160029092020101546001600160a01b03908116915086168114156102bc5760405162461bcd60e51b815260206004820152601f60248201527f4d757374207472616e7366657220746f206e657720696e7465677261746f7200604482015260640161013e565b6000806001600160a01b03831661034b576040516370a0823160e01b81523060048201526001600160a01b038616906370a082319060240160206040518083038186803b15801561030c57600080fd5b505afa158015610320573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103449190611717565b915061052f565b6040516370a0823160e01b81526001600160a01b0380851660048301528491908716906370a082319060240160206040518083038186803b15801561038f57600080fd5b505afa1580156103a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c79190611717565b604051632fa8a91360e11b81526001600160a01b03888116600483015291945090821690635f51522690602401602060405180830381600087803b15801561040e57600080fd5b505af1158015610422573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104469190611717565b915081156104be5760405163934785b760e01b81523060048201526001600160a01b038781166024830152604482018490526000606483015282169063934785b790608401600060405180830381600087803b1580156104a557600080fd5b505af11580156104b9573d6000803e3d6000fd5b505050505b821561052d5760405163a4e2859560e01b81523060048201526001600160a01b0387811660248301526044820185905282169063a4e2859590606401600060405180830381600087803b15801561051457600080fd5b505af1158015610528573d6000803e3d6000fd5b505050505b505b600061053b838361188c565b9050888c868154811061055e57634e487b7160e01b600052603260045260246000fd5b6000918252602090912060029091020160010180546001600160a01b0319166001600160a01b039283161790556105989087168a8361119d565b88821561062a576040516307dba22560e31b81526001600160a01b0388811660048301526024820185905260006044830152821690633edd112890606401602060405180830381600087803b1580156105f057600080fd5b505af1158015610604573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106289190611717565b505b604051632fa8a91360e11b81526001600160a01b03888116600483015260009190831690635f51522690602401602060405180830381600087803b15801561067157600080fd5b505af1158015610685573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a99190611717565b6040516370a0823160e01b81526001600160a01b0384811660048301529192506000918a16906370a082319060240160206040518083038186803b1580156106f057600080fd5b505afa158015610704573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107289190611717565b9050670de111a6b7de4000670de05bc096e9c00061074687826111f4565b841015801561075e575061075a87836111f4565b8411155b6107a65760405162461bcd60e51b8152602060048201526019602482015278135d5cdd081d1c985b9cd9995c88199d5b1b08185b5bdd5b9d603a1b604482015260640161013e565b6107b088826111f4565b83101580156107c857506107c488836111f4565b8311155b6108105760405162461bcd60e51b8152602060048201526019602482015278135d5cdd081d1c985b9cd9995c88199d5b1b08185b5bdd5b9d603a1b604482015260640161013e565b505050505050505050505080806108269061192a565b91505061014a565b507f407ca8e939a25b34f290fb7f4d3b0d85d03f13313dc34a6a15bbd91492cfa2498484846040516108629392919061174b565b60405180910390a15050505050565b8454610891906201518090600160801b90046001600160401b031661188c565b4210156108fb5760405162461bcd60e51b815260206004820152603260248201527f53756666696369656e7420706572696f64206f662070726576696f75732072616044820152711b5c081a185cc81b9bdd08195b185c1cd95960721b606482015260840161013e565b610908620151804261188c565b83101561094d5760405162461bcd60e51b815260206004820152601360248201527214985b5c081d1a5b59481d1bdbc81cda1bdc9d606a1b604482015260640161013e565b60008411801561095f5750620f424084105b6109a45760405162461bcd60e51b81526020600482015260166024820152754120746172676574206f7574206f6620626f756e647360501b604482015260640161013e565b60006109b082866118c4565b905082811115610a19576109c583600a6118c4565b811115610a145760405162461bcd60e51b815260206004820152601960248201527f412074617267657420696e63726561736520746f6f2062696700000000000000604482015260640161013e565b610a73565b610a24600a846118a4565b811015610a735760405162461bcd60e51b815260206004820152601960248201527f412074617267657420646563726561736520746f6f2062696700000000000000604482015260640161013e565b610a7c83611210565b865467ffffffffffffffff19166001600160401b0391909116178655610aa181611210565b86546001600160401b0391909116600160401b0267ffffffffffffffff60401b19909116178655610ad142611210565b86546001600160401b0391909116600160801b0267ffffffffffffffff60801b19909116178655610b0184611210565b86546001600160c01b0316600160c01b6001600160401b039290921691909102178655604080518481526020810183905242818301526060810186905290517fbed20f105bdd1ca3336acef7422ceb8a840b29ffa3411edd10279120b372d6c19181900360800190a1505050505050565b8154600160c01b90046001600160401b03164210610bd25760405162461bcd60e51b815260206004820152601a60248201527f416d706c696669636174696f6e206e6f74206368616e67696e67000000000000604482015260640161013e565b610bdb81611210565b825467ffffffffffffffff19166001600160401b0391909116178255610c0081611210565b82546001600160401b0391909116600160401b0267ffffffffffffffff60401b19909116178255610c3042611210565b82546001600160401b0391909116600160801b0267ffffffffffffffff60801b19909116178255610c6042611210565b82546001600160401b0391909116600160c01b026001600160c01b03909116178255604080518281524260208201527f46e22fb3709ad289f62ce63d469248536dbc78d82b84a3d7e74ad606dc201938910160405180910390a15050565b606080600083805480602002602001604051908101604052809291908181526020016000905b82821015610d2d57600084815260209081902060408051808201909152908401546001600160801b038082168352600160801b9091041681830152825260019092019101610ce4565b50508251929350829150506001600160401b03811115610d5d57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610d86578160200160208202803683370190505b509350806001600160401b03811115610daf57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610dd8578160200160208202803683370190505b50925060005b818110156110da5780858281518110610e0757634e487b7160e01b600052603260045260246000fd5b602002602001019060ff16908160ff16815250506000878281518110610e3d57634e487b7160e01b600052603260045260246000fd5b602002602001015190506000848381518110610e6957634e487b7160e01b600052603260045260246000fd5b6020026020010151905060006001600160a01b031682602001516001600160a01b03161415610e995750506110c8565b60208201518251604051632fa8a91360e11b81526001600160a01b0391821660048201526000929190911690635f51522690602401602060405180830381600087803b158015610ee857600080fd5b505af1158015610efc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f209190611717565b905060008360400151610fb057835160208501516040516370a0823160e01b81526001600160a01b0391821660048201529116906370a082319060240160206040518083038186803b158015610f7557600080fd5b505afa158015610f89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fad9190611717565b90505b6000610fbc828461188c565b60208501519091506001600160801b03168082118015610fff5750600186606001516007811115610ffd57634e487b7160e01b600052602160045260246000fd5b145b156110925761100d8261127c565b8c888154811061102d57634e487b7160e01b600052603260045260246000fd5b6000918252602082200180546001600160801b03938416600160801b0293169290921790915561105d82846118e3565b9050808b898151811061108057634e487b7160e01b600052603260045260246000fd5b602002602001018181525050506110c1565b60008a88815181106110b457634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b5050505050505b806110d28161192a565b915050610dde565b5050509250929050565b8154600090815b818160ff16101561115e57836001600160a01b0316858260ff168154811061112357634e487b7160e01b600052603260045260246000fd5b60009182526020909120600290910201546001600160a01b0316141561114c5791506111979050565b8061115681611945565b9150506110eb565b5060405162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a5908185cdcd95d609a1b604482015260640161013e565b92915050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526111ef9084906112e1565b505050565b60006112098383670de0b6b3a76400006113b3565b9392505050565b6000600160401b82106112745760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203660448201526534206269747360d01b606482015260840161013e565b50805b919050565b6000600160801b82106112745760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b606482015260840161013e565b6000611336826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113d29092919063ffffffff16565b8051909150156111ef578080602001905181019061135491906116a0565b6111ef5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161013e565b6000816113c084866118c4565b6113ca91906118a4565b949350505050565b60606113ca848460008585843b61142b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161013e565b600080866001600160a01b03168587604051611447919061172f565b60006040518083038185875af1925050503d8060008114611484576040519150601f19603f3d011682016040523d82523d6000602084013e611489565b606091505b50915091506114998282866114a4565b979650505050505050565b606083156114b3575081611209565b8251156114c35782518084602001fd5b8160405162461bcd60e51b815260040161013e9190611829565b80356001600160a01b038116811461127757600080fd5b600060208284031215611505578081fd5b611209826114dd565b6000806040808486031215611521578182fd5b83356001600160401b0380821115611537578384fd5b818601915086601f83011261154a578384fd5b813560208282111561155e5761155e61197b565b61156b818284020161185c565b82815281810193508482016080808502870184018c101561158a578889fd5b8896505b848710156116045780828d0312156115a4578889fd5b6115ad8161185c565b6115b6836114dd565b81526115c38584016114dd565b85820152888301356115d481611991565b818a0152606083810135600881106115ea578b8cfd5b90820152865260019690960195948301949081019061158e565b50909a9890910135985050505050505050565b6000806000806060858703121561162c578182fd5b8435935060208501356001600160401b0380821115611649578384fd5b818701915087601f83011261165c578384fd5b81358181111561166a578485fd5b886020808302850101111561167d578485fd5b602083019550809450505050611695604086016114dd565b905092959194509250565b6000602082840312156116b1578081fd5b815161120981611991565b600080604083850312156116ce578182fd5b50508035926020909101359150565b600080600080600060a086880312156116f4578081fd5b505083359560208501359550604085013594606081013594506080013592509050565b600060208284031215611728578081fd5b5051919050565b600082516117418184602087016118fa565b9190910192915050565b6040808252810183905260008460608301825b8681101561178c576001600160a01b03611777846114dd565b1682526020928301929091019060010161175e565b506001600160a01b03949094166020939093019290925250909392505050565b604080825283519082018190526000906020906060840190828701845b828110156117e857815160ff16845292840192908401906001016117c9565b50505083810382850152845180825285830191830190845b8181101561181c57835183529284019291840191600101611800565b5090979650505050505050565b60006020825282518060208401526118488160408501602087016118fa565b601f01601f19169190910160400192915050565b604051601f8201601f191681016001600160401b03811182821017156118845761188461197b565b604052919050565b6000821982111561189f5761189f611965565b500190565b6000826118bf57634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156118de576118de611965565b500290565b6000828210156118f5576118f5611965565b500390565b60005b838110156119155781810151838201526020016118fd565b83811115611924576000848401525b50505050565b600060001982141561193e5761193e611965565b5060010190565b600060ff821660ff81141561195c5761195c611965565b60010192915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b801515811461199f57600080fd5b5056fea26469706673582212209f51551ef30b773af1daeddafc45ca33a52f839b5a27abe54ccf769645b1c4d164736f6c63430008020033
Deployed Bytecode
0x7390ae544e8cc76d2867987ee4f5456c02c50abd8b30146080604052600436106100565760003560e01c80637203e78b1461005b578063bd5b0ac61461007d578063ceb5ad271461009d578063e6a048a0146100bd575b600080fd5b81801561006757600080fd5b5061007b610076366004611617565b6100f4565b005b81801561008957600080fd5b5061007b6100983660046116dd565b610871565b8180156100a957600080fd5b5061007b6100b83660046116bc565b610b72565b8180156100c957600080fd5b506100dd6100d836600461150e565b610cbe565b6040516100eb9291906117ac565b60405180910390f35b81806101475760405162461bcd60e51b815260206004820152601960248201527f4d757374206d69677261746520736f6d6520624173736574730000000000000060448201526064015b60405180910390fd5b60005b8181101561082e57600085858381811061017457634e487b7160e01b600052603260045260246000fd5b905060200201602081019061018991906114f4565b9050600061019788836110e4565b60ff1690508781815481106101bc57634e487b7160e01b600052603260045260246000fd5b906000526020600020906002020160010160149054906101000a900460ff16156102285760405162461bcd60e51b815260206004820152601b60248201527f4120624173736574206861732061207472616e73666572206665650000000000604482015260640161013e565b600088828154811061024a57634e487b7160e01b600052603260045260246000fd5b60009182526020909120600160029092020101546001600160a01b03908116915086168114156102bc5760405162461bcd60e51b815260206004820152601f60248201527f4d757374207472616e7366657220746f206e657720696e7465677261746f7200604482015260640161013e565b6000806001600160a01b03831661034b576040516370a0823160e01b81523060048201526001600160a01b038616906370a082319060240160206040518083038186803b15801561030c57600080fd5b505afa158015610320573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103449190611717565b915061052f565b6040516370a0823160e01b81526001600160a01b0380851660048301528491908716906370a082319060240160206040518083038186803b15801561038f57600080fd5b505afa1580156103a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c79190611717565b604051632fa8a91360e11b81526001600160a01b03888116600483015291945090821690635f51522690602401602060405180830381600087803b15801561040e57600080fd5b505af1158015610422573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104469190611717565b915081156104be5760405163934785b760e01b81523060048201526001600160a01b038781166024830152604482018490526000606483015282169063934785b790608401600060405180830381600087803b1580156104a557600080fd5b505af11580156104b9573d6000803e3d6000fd5b505050505b821561052d5760405163a4e2859560e01b81523060048201526001600160a01b0387811660248301526044820185905282169063a4e2859590606401600060405180830381600087803b15801561051457600080fd5b505af1158015610528573d6000803e3d6000fd5b505050505b505b600061053b838361188c565b9050888c868154811061055e57634e487b7160e01b600052603260045260246000fd5b6000918252602090912060029091020160010180546001600160a01b0319166001600160a01b039283161790556105989087168a8361119d565b88821561062a576040516307dba22560e31b81526001600160a01b0388811660048301526024820185905260006044830152821690633edd112890606401602060405180830381600087803b1580156105f057600080fd5b505af1158015610604573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106289190611717565b505b604051632fa8a91360e11b81526001600160a01b03888116600483015260009190831690635f51522690602401602060405180830381600087803b15801561067157600080fd5b505af1158015610685573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a99190611717565b6040516370a0823160e01b81526001600160a01b0384811660048301529192506000918a16906370a082319060240160206040518083038186803b1580156106f057600080fd5b505afa158015610704573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107289190611717565b9050670de111a6b7de4000670de05bc096e9c00061074687826111f4565b841015801561075e575061075a87836111f4565b8411155b6107a65760405162461bcd60e51b8152602060048201526019602482015278135d5cdd081d1c985b9cd9995c88199d5b1b08185b5bdd5b9d603a1b604482015260640161013e565b6107b088826111f4565b83101580156107c857506107c488836111f4565b8311155b6108105760405162461bcd60e51b8152602060048201526019602482015278135d5cdd081d1c985b9cd9995c88199d5b1b08185b5bdd5b9d603a1b604482015260640161013e565b505050505050505050505080806108269061192a565b91505061014a565b507f407ca8e939a25b34f290fb7f4d3b0d85d03f13313dc34a6a15bbd91492cfa2498484846040516108629392919061174b565b60405180910390a15050505050565b8454610891906201518090600160801b90046001600160401b031661188c565b4210156108fb5760405162461bcd60e51b815260206004820152603260248201527f53756666696369656e7420706572696f64206f662070726576696f75732072616044820152711b5c081a185cc81b9bdd08195b185c1cd95960721b606482015260840161013e565b610908620151804261188c565b83101561094d5760405162461bcd60e51b815260206004820152601360248201527214985b5c081d1a5b59481d1bdbc81cda1bdc9d606a1b604482015260640161013e565b60008411801561095f5750620f424084105b6109a45760405162461bcd60e51b81526020600482015260166024820152754120746172676574206f7574206f6620626f756e647360501b604482015260640161013e565b60006109b082866118c4565b905082811115610a19576109c583600a6118c4565b811115610a145760405162461bcd60e51b815260206004820152601960248201527f412074617267657420696e63726561736520746f6f2062696700000000000000604482015260640161013e565b610a73565b610a24600a846118a4565b811015610a735760405162461bcd60e51b815260206004820152601960248201527f412074617267657420646563726561736520746f6f2062696700000000000000604482015260640161013e565b610a7c83611210565b865467ffffffffffffffff19166001600160401b0391909116178655610aa181611210565b86546001600160401b0391909116600160401b0267ffffffffffffffff60401b19909116178655610ad142611210565b86546001600160401b0391909116600160801b0267ffffffffffffffff60801b19909116178655610b0184611210565b86546001600160c01b0316600160c01b6001600160401b039290921691909102178655604080518481526020810183905242818301526060810186905290517fbed20f105bdd1ca3336acef7422ceb8a840b29ffa3411edd10279120b372d6c19181900360800190a1505050505050565b8154600160c01b90046001600160401b03164210610bd25760405162461bcd60e51b815260206004820152601a60248201527f416d706c696669636174696f6e206e6f74206368616e67696e67000000000000604482015260640161013e565b610bdb81611210565b825467ffffffffffffffff19166001600160401b0391909116178255610c0081611210565b82546001600160401b0391909116600160401b0267ffffffffffffffff60401b19909116178255610c3042611210565b82546001600160401b0391909116600160801b0267ffffffffffffffff60801b19909116178255610c6042611210565b82546001600160401b0391909116600160c01b026001600160c01b03909116178255604080518281524260208201527f46e22fb3709ad289f62ce63d469248536dbc78d82b84a3d7e74ad606dc201938910160405180910390a15050565b606080600083805480602002602001604051908101604052809291908181526020016000905b82821015610d2d57600084815260209081902060408051808201909152908401546001600160801b038082168352600160801b9091041681830152825260019092019101610ce4565b50508251929350829150506001600160401b03811115610d5d57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610d86578160200160208202803683370190505b509350806001600160401b03811115610daf57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610dd8578160200160208202803683370190505b50925060005b818110156110da5780858281518110610e0757634e487b7160e01b600052603260045260246000fd5b602002602001019060ff16908160ff16815250506000878281518110610e3d57634e487b7160e01b600052603260045260246000fd5b602002602001015190506000848381518110610e6957634e487b7160e01b600052603260045260246000fd5b6020026020010151905060006001600160a01b031682602001516001600160a01b03161415610e995750506110c8565b60208201518251604051632fa8a91360e11b81526001600160a01b0391821660048201526000929190911690635f51522690602401602060405180830381600087803b158015610ee857600080fd5b505af1158015610efc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f209190611717565b905060008360400151610fb057835160208501516040516370a0823160e01b81526001600160a01b0391821660048201529116906370a082319060240160206040518083038186803b158015610f7557600080fd5b505afa158015610f89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fad9190611717565b90505b6000610fbc828461188c565b60208501519091506001600160801b03168082118015610fff5750600186606001516007811115610ffd57634e487b7160e01b600052602160045260246000fd5b145b156110925761100d8261127c565b8c888154811061102d57634e487b7160e01b600052603260045260246000fd5b6000918252602082200180546001600160801b03938416600160801b0293169290921790915561105d82846118e3565b9050808b898151811061108057634e487b7160e01b600052603260045260246000fd5b602002602001018181525050506110c1565b60008a88815181106110b457634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b5050505050505b806110d28161192a565b915050610dde565b5050509250929050565b8154600090815b818160ff16101561115e57836001600160a01b0316858260ff168154811061112357634e487b7160e01b600052603260045260246000fd5b60009182526020909120600290910201546001600160a01b0316141561114c5791506111979050565b8061115681611945565b9150506110eb565b5060405162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a5908185cdcd95d609a1b604482015260640161013e565b92915050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526111ef9084906112e1565b505050565b60006112098383670de0b6b3a76400006113b3565b9392505050565b6000600160401b82106112745760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203660448201526534206269747360d01b606482015260840161013e565b50805b919050565b6000600160801b82106112745760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b606482015260840161013e565b6000611336826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113d29092919063ffffffff16565b8051909150156111ef578080602001905181019061135491906116a0565b6111ef5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161013e565b6000816113c084866118c4565b6113ca91906118a4565b949350505050565b60606113ca848460008585843b61142b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161013e565b600080866001600160a01b03168587604051611447919061172f565b60006040518083038185875af1925050503d8060008114611484576040519150601f19603f3d011682016040523d82523d6000602084013e611489565b606091505b50915091506114998282866114a4565b979650505050505050565b606083156114b3575081611209565b8251156114c35782518084602001fd5b8160405162461bcd60e51b815260040161013e9190611829565b80356001600160a01b038116811461127757600080fd5b600060208284031215611505578081fd5b611209826114dd565b6000806040808486031215611521578182fd5b83356001600160401b0380821115611537578384fd5b818601915086601f83011261154a578384fd5b813560208282111561155e5761155e61197b565b61156b818284020161185c565b82815281810193508482016080808502870184018c101561158a578889fd5b8896505b848710156116045780828d0312156115a4578889fd5b6115ad8161185c565b6115b6836114dd565b81526115c38584016114dd565b85820152888301356115d481611991565b818a0152606083810135600881106115ea578b8cfd5b90820152865260019690960195948301949081019061158e565b50909a9890910135985050505050505050565b6000806000806060858703121561162c578182fd5b8435935060208501356001600160401b0380821115611649578384fd5b818701915087601f83011261165c578384fd5b81358181111561166a578485fd5b886020808302850101111561167d578485fd5b602083019550809450505050611695604086016114dd565b905092959194509250565b6000602082840312156116b1578081fd5b815161120981611991565b600080604083850312156116ce578182fd5b50508035926020909101359150565b600080600080600060a086880312156116f4578081fd5b505083359560208501359550604085013594606081013594506080013592509050565b600060208284031215611728578081fd5b5051919050565b600082516117418184602087016118fa565b9190910192915050565b6040808252810183905260008460608301825b8681101561178c576001600160a01b03611777846114dd565b1682526020928301929091019060010161175e565b506001600160a01b03949094166020939093019290925250909392505050565b604080825283519082018190526000906020906060840190828701845b828110156117e857815160ff16845292840192908401906001016117c9565b50505083810382850152845180825285830191830190845b8181101561181c57835183529284019291840191600101611800565b5090979650505050505050565b60006020825282518060208401526118488160408501602087016118fa565b601f01601f19169190910160400192915050565b604051601f8201601f191681016001600160401b03811182821017156118845761188461197b565b604052919050565b6000821982111561189f5761189f611965565b500190565b6000826118bf57634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156118de576118de611965565b500290565b6000828210156118f5576118f5611965565b500390565b60005b838110156119155781810151838201526020016118fd565b83811115611924576000848401525b50505050565b600060001982141561193e5761193e611965565b5060010190565b600060ff821660ff81141561195c5761195c611965565b60010192915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b801515811461199f57600080fd5b5056fea26469706673582212209f51551ef30b773af1daeddafc45ca33a52f839b5a27abe54ccf769645b1c4d164736f6c63430008020033
Deployed Bytecode Sourcemap
30657:8484:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;33538:3082;;;;;;;;;;-1:-1:-1;33538:3082:0;;;;;:::i;:::-;;:::i;:::-;;37336:1182;;;;;;;;;;-1:-1:-1;37336:1182:0;;;;;:::i;:::-;;:::i;38657:481::-;;;;;;;;;;-1:-1:-1;38657:481:0;;;;;:::i;:::-;;:::i;31398:1604::-;;;;;;;;;;-1:-1:-1;31398:1604:0;;;;;:::i;:::-;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;33538:3082;33726:8;33760:7;33752:45;;;;-1:-1:-1;;;33752:45:0;;9423:2:1;33752:45:0;;;9405:21:1;9462:2;9442:18;;;9435:30;9501:27;9481:18;;;9474:55;9546:18;;33752:45:0;;;;;;;;;33815:9;33810:2743;33834:3;33830:1;:7;33810:2743;;;33917:14;33934:8;;33943:1;33934:11;;;;;-1:-1:-1;;;33934:11:0;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;33917:28;;33960:13;33976:39;33991:15;34008:6;33976:14;:39::i;:::-;33960:55;;;;34039:15;34055:5;34039:22;;;;;;-1:-1:-1;;;34039:22:0;;;;;;;;;;;;;;;;;;;:31;;;;;;;;;;;;34038:32;34030:72;;;;-1:-1:-1;;;34030:72:0;;9067:2:1;34030:72:0;;;9049:21:1;9106:2;9086:18;;;9079:30;9145:29;9125:18;;;9118:57;9192:18;;34030:72:0;9039:177:1;34030:72:0;34192:18;34213:15;34229:5;34213:22;;;;;;-1:-1:-1;;;34213:22:0;;;;;;;;;;;;;;;;;:33;:22;;;;;:33;;-1:-1:-1;;;;;34213:33:0;;;;-1:-1:-1;34269:29:0;;;;;34261:73;;;;-1:-1:-1;;;34261:73:0;;13949:2:1;34261:73:0;;;13931:21:1;13988:2;13968:18;;;13961:30;14027:33;14007:18;;;14000:61;14078:18;;34261:73:0;13921:181:1;34261:73:0;34350:13;;-1:-1:-1;;;;;34412:24:0;;34408:759;;34465:39;;-1:-1:-1;;;34465:39:0;;34498:4;34465:39;;;4665:51:1;-1:-1:-1;;;;;34465:24:0;;;;;4638:18:1;;34465:39:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;34457:47;;34408:759;;;34642:49;;-1:-1:-1;;;34642:49:0;;-1:-1:-1;;;;;4683:32:1;;;34642:49:0;;;4665:51:1;34604:10:0;;34642:24;;;;;;4638:18:1;;34642:49:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;34781:35;;-1:-1:-1;;;34781:35:0;;-1:-1:-1;;;;;4683:32:1;;;34781:35:0;;;4665:51:1;34634:57:0;;-1:-1:-1;34781:27:0;;;;;;4638:18:1;;34781:35:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;34768:48;-1:-1:-1;34839:14:0;;34835:128;;34878:65;;-1:-1:-1;;;34878:65:0;;34910:4;34878:65;;;5370:34:1;-1:-1:-1;;;;;5440:15:1;;;5420:18;;;5413:43;5472:18;;;5465:34;;;34937:5:0;5515:18:1;;;5508:50;34878:23:0;;;;;5304:19:1;;34878:65:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;34835:128;35042:9;;35038:114;;35076:56;;-1:-1:-1;;;35076:56:0;;35111:4;35076:56;;;4967:34:1;-1:-1:-1;;;;;5037:15:1;;;5017:18;;;5010:43;5069:18;;;5062:34;;;35076:26:0;;;;;4902:18:1;;35076:56:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;35038:114;34408:759;;35181:11;35195:18;35208:5;35195:10;:18;:::i;:::-;35181:32;;35332:15;35296;35312:5;35296:22;;;;;;-1:-1:-1;;;35296:22:0;;;;;;;;;;;;;;;;;;;;;;:33;;:51;;-1:-1:-1;;;;;;35296:51:0;-1:-1:-1;;;;;35296:51:0;;;;;;35558:49;;:27;;35586:15;35603:3;35558:27;:49::i;:::-;35681:15;35716:14;;35712:104;;35751:49;;-1:-1:-1;;;35751:49:0;;-1:-1:-1;;;;;6062:32:1;;;35751:49:0;;;6044:51:1;6111:18;;;6104:34;;;35794:5:0;6154:18:1;;;6147:50;35751:22:0;;;;;6017:18:1;;35751:49:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;35712:104;35890:35;;-1:-1:-1;;;35890:35:0;;-1:-1:-1;;;;;4683:32:1;;;35890:35:0;;;4665:51:1;35866:21:0;;35890:27;;;;;;4638:18:1;;35890:35:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;35959:49;;-1:-1:-1;;;35959:49:0;;-1:-1:-1;;;;;4683:32:1;;;35959:49:0;;;4665:51:1;35866:59:0;;-1:-1:-1;35940:16:0;;35959:24;;;;;4638:18:1;;35959:49:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;35940:68;-1:-1:-1;36045:8:0;36090:7;36157:35;:10;36090:7;36157:22;:35::i;:::-;36140:13;:52;;:129;;;;-1:-1:-1;36234:35:0;:10;36257:11;36234:22;:35::i;:::-;36217:13;:52;;36140:129;36114:216;;;;-1:-1:-1;;;36114:216:0;;10940:2:1;36114:216:0;;;10922:21:1;10979:2;10959:18;;;10952:30;-1:-1:-1;;;10998:18:1;;;10991:55;11063:18;;36114:216:0;10912:175:1;36114:216:0;36383:30;:5;36401:11;36383:17;:30::i;:::-;36371:8;:42;;:109;;;;-1:-1:-1;36450:30:0;:5;36468:11;36450:17;:30::i;:::-;36438:8;:42;;36371:109;36345:196;;;;-1:-1:-1;;;36345:196:0;;10940:2:1;36345:196:0;;;10922:21:1;10979:2;10959:18;;;10952:30;-1:-1:-1;;;10998:18:1;;;10991:55;11063:18;;36345:196:0;10912:175:1;36345:196:0;33810:2743;;;;;;;;;;;33839:3;;;;;:::i;:::-;;;;33810:2743;;;;36570:42;36586:8;;36596:15;36570:42;;;;;;;;:::i;:::-;;;;;;;;33538:3082;;;;;:::o;37336:1182::-;37575:22;;:38;;31021:6;;-1:-1:-1;;;37575:22:0;;-1:-1:-1;;;;;37575:22:0;:38;:::i;:::-;37555:15;:59;;37533:159;;;;-1:-1:-1;;;37533:159:0;;11294:2:1;37533:159:0;;;11276:21:1;11333:2;11313:18;;;11306:30;11372:34;11352:18;;;11345:62;-1:-1:-1;;;11423:18:1;;;11416:48;11481:19;;37533:159:0;11266:240:1;37533:159:0;37728:31;31021:6;37728:15;:31;:::i;:::-;37711:12;:49;;37703:81;;;;-1:-1:-1;;;37703:81:0;;9777:2:1;37703:81:0;;;9759:21:1;9816:2;9796:18;;;9789:30;-1:-1:-1;;;9835:18:1;;;9828:49;9894:18;;37703:81:0;9749:169:1;37703:81:0;37814:1;37803:8;:12;:32;;;;;31067:3;37819:8;:16;37803:32;37795:67;;;;-1:-1:-1;;;37795:67:0;;11713:2:1;37795:67:0;;;11695:21:1;11752:2;11732:18;;;11725:30;-1:-1:-1;;;11771:18:1;;;11764:52;11833:18;;37795:67:0;11685:172:1;37795:67:0;37875:22;37900:21;37911:10;37900:8;:21;:::i;:::-;37875:46;;37955:9;37938:14;:26;37934:232;;;38007:14;:9;38019:2;38007:14;:::i;:::-;37989;:32;;37981:70;;;;-1:-1:-1;;;37981:70:0;;14309:2:1;37981:70:0;;;14291:21:1;14348:2;14328:18;;;14321:30;14387:27;14367:18;;;14360:55;14432:18;;37981:70:0;14281:175:1;37981:70:0;37934:232;;;38110:14;38122:2;38110:9;:14;:::i;:::-;38092;:32;;38084:70;;;;-1:-1:-1;;;38084:70:0;;12826:2:1;38084:70:0;;;12808:21:1;12865:2;12845:18;;;12838:30;12904:27;12884:18;;;12877:55;12949:18;;38084:70:0;12798:175:1;38084:70:0;38198:28;38216:9;38198:17;:28::i;:::-;38178:48;;-1:-1:-1;;38178:48:0;-1:-1:-1;;;;;38178:48:0;;;;;;;38256:33;38274:14;38256:17;:33::i;:::-;38237:52;;-1:-1:-1;;;;;38237:52:0;;;;-1:-1:-1;;;38237:52:0;-1:-1:-1;;;;38237:52:0;;;;;;38325:34;38343:15;38325:17;:34::i;:::-;38300:59;;-1:-1:-1;;;;;38300:59:0;;;;-1:-1:-1;;;38300:59:0;-1:-1:-1;;;;38300:59:0;;;;;;38393:31;38411:12;38393:17;:31::i;:::-;38370:54;;-1:-1:-1;;;;;38370:54:0;-1:-1:-1;;;;;;;;38370:54:0;;;;;;;;;;;38442:68;;;14945:25:1;;;15001:2;14986:18;;14979:34;;;38480:15:0;15029:18:1;;;15022:34;15087:2;15072:18;;15065:34;;;38442:68:0;;;;;;;14932:3:1;38442:68:0;;;37336:1182;;;;;;:::o;38657:481::-;38767:20;;-1:-1:-1;;;38767:20:0;;-1:-1:-1;;;;;38767:20:0;38749:15;:38;38741:77;;;;-1:-1:-1;;;38741:77:0;;12471:2:1;38741:77:0;;;12453:21:1;12510:2;12490:18;;;12483:30;12549:28;12529:18;;;12522:56;12595:18;;38741:77:0;12443:176:1;38741:77:0;38851:28;38869:9;38851:17;:28::i;:::-;38831:48;;-1:-1:-1;;38831:48:0;-1:-1:-1;;;;;38831:48:0;;;;;;;38909:28;38927:9;38909:17;:28::i;:::-;38890:47;;-1:-1:-1;;;;;38890:47:0;;;;-1:-1:-1;;;38890:47:0;-1:-1:-1;;;;38890:47:0;;;;;;38973:34;38991:15;38973:17;:34::i;:::-;38948:59;;-1:-1:-1;;;;;38948:59:0;;;;-1:-1:-1;;;38948:59:0;-1:-1:-1;;;;38948:59:0;;;;;;39041:34;39059:15;39041:17;:34::i;:::-;39018:57;;-1:-1:-1;;;;;39018:57:0;;;;-1:-1:-1;;;39018:57:0;-1:-1:-1;;;;;39018:57:0;;;;;;39093:37;;;14635:25:1;;;39114:15:0;14691:2:1;14676:18;;14669:34;39093:37:0;;14608:18:1;39093:37:0;;;;;;;38657:481;;:::o;31398:1604::-;31551:19;31572:25;31641:31;31675:11;31641:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;31641:45:0;;;;;-1:-1:-1;;;31641:45:0;;;;;;;;;;;;;;;;;;;-1:-1:-1;;31713:18:0;;31641:45;;-1:-1:-1;31713:18:0;;-1:-1:-1;;;;;;;31749:18:0;;;;;-1:-1:-1;;;31749:18:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;31749:18:0;;31742:25;;31803:5;-1:-1:-1;;;;;31789:20:0;;;;;-1:-1:-1;;;31789:20:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;31789:20:0;;31778:31;;31914:9;31909:1086;31933:5;31929:1;:9;31909:1086;;;31976:1;31960:4;31965:1;31960:7;;;;;;-1:-1:-1;;;31960:7:0;;;;;;;;;;;;;;:18;;;;;;;;;;;31993:31;32027:15;32043:1;32027:18;;;;;;-1:-1:-1;;;32027:18:0;;;;;;;;;;;;;;;31993:52;;32060:23;32086:11;32098:1;32086:14;;;;;;-1:-1:-1;;;32086:14:0;;;;;;;;;;;;;;;32060:40;;32225:1;-1:-1:-1;;;;;32193:34:0;:9;:20;;;-1:-1:-1;;;;;32193:34:0;;32189:48;;;32229:8;;;;32189:48;32308:20;;;;32343:14;;32287:71;;-1:-1:-1;;;32287:71:0;;-1:-1:-1;;;;;4683:32:1;;;32287:71:0;;;4665:51:1;32252:15:0;;32287:55;;;;;;;4638:18:1;;32287:71:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;32252:106;;32373:13;32410:9;:18;;;32405:122;;32464:14;;32490:20;;;;32457:54;;-1:-1:-1;;;32457:54:0;;-1:-1:-1;;;;;4683:32:1;;;32457:54:0;;;4665:51:1;32457:32:0;;;;;4638:18:1;;32457:54:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;32449:62;;32405:122;32541:15;32559;32569:5;32559:7;:15;:::i;:::-;32615:18;;;;32541:33;;-1:-1:-1;;;;;;32589:44:0;32652:25;;;:68;;;;-1:-1:-1;32701:19:0;32681:9;:16;;;:39;;;;;;-1:-1:-1;;;32681:39:0;;;;;;;;;;32652:68;32648:336;;;32771:27;32790:7;32771:18;:27::i;:::-;32741:11;32753:1;32741:14;;;;;;-1:-1:-1;;;32741:14:0;;;;;;;;;;;;;;;;;:57;;-1:-1:-1;;;;;32741:57:0;;;-1:-1:-1;;;32741:57:0;;;;;;;;;;32841:25;32851:15;32841:7;:25;:::i;:::-;32817:49;;32899:13;32885:8;32894:1;32885:11;;;;;;-1:-1:-1;;;32885:11:0;;;;;;;;;;;;;;:27;;;;;32648:336;;;;32967:1;32953:8;32962:1;32953:11;;;;;;-1:-1:-1;;;32953:11:0;;;;;;;;;;;;;;:15;;;;;32648:336;31909:1086;;;;;;;31940:3;;;;:::i;:::-;;;;31909:1086;;;;31398:1604;;;;;;;:::o;36788:353::-;36961:22;;36920:9;;;36994:106;37016:3;37012:1;:7;;;36994:106;;;37072:6;-1:-1:-1;;;;;37045:33:0;:15;37061:1;37045:18;;;;;;;;-1:-1:-1;;;37045:18:0;;;;;;;;;;;;;;;;;;;;;;:23;-1:-1:-1;;;;;37045:23:0;:33;37041:47;;;37087:1;-1:-1:-1;37080:8:0;;-1:-1:-1;37080:8:0;37041:47;37021:3;;;;:::i;:::-;;;;36994:106;;;-1:-1:-1;37110:23:0;;-1:-1:-1;;;37110:23:0;;8725:2:1;37110:23:0;;;8707:21:1;8764:2;8744:18;;;8737:30;-1:-1:-1;;;8783:18:1;;;8776:43;8836:18;;37110:23:0;8697:163:1;36788:353:0;;;;;:::o;19804:177::-;19914:58;;;-1:-1:-1;;;;;5761:32:1;;19914:58:0;;;5743:51:1;5810:18;;;;5803:34;;;19914:58:0;;;;;;;;;;5716:18:1;;;;19914:58:0;;;;;;;;-1:-1:-1;;;;;19914:58:0;-1:-1:-1;;;19914:58:0;;;19887:86;;19907:5;;19887:19;:86::i;:::-;19804:177;;;:::o;24830:135::-;24896:7;24923:34;24940:1;24943;23204:4;24923:16;:34::i;:::-;24916:41;24830:135;-1:-1:-1;;;24830:135:0:o;3935:179::-;3991:6;-1:-1:-1;;;4018:5:0;:13;4010:65;;;;-1:-1:-1;;;4010:65:0;;12064:2:1;4010:65:0;;;12046:21:1;12103:2;12083:18;;;12076:30;12142:34;12122:18;;;12115:62;-1:-1:-1;;;12193:18:1;;;12186:36;12239:19;;4010:65:0;12036:228:1;4010:65:0;-1:-1:-1;4100:5:0;3935:179;;;;:::o;3452:184::-;3509:7;-1:-1:-1;;;3537:5:0;:14;3529:67;;;;-1:-1:-1;;;3529:67:0;;10125:2:1;3529:67:0;;;10107:21:1;10164:2;10144:18;;;10137:30;10203:34;10183:18;;;10176:62;-1:-1:-1;;;10254:18:1;;;10247:37;10301:19;;3529:67:0;10097:229:1;22238:761:0;22662:23;22688:69;22716:4;22688:69;;;;;;;;;;;;;;;;;22696:5;-1:-1:-1;;;;;22688:27:0;;;:69;;;;;:::i;:::-;22772:17;;22662:95;;-1:-1:-1;22772:21:0;22768:224;;22914:10;22903:30;;;;;;;;;;;;:::i;:::-;22895:85;;;;-1:-1:-1;;;22895:85:0;;13538:2:1;22895:85:0;;;13520:21:1;13577:2;13557:18;;;13550:30;13616:34;13596:18;;;13589:62;-1:-1:-1;;;13667:18:1;;;13660:40;13717:19;;22895:85:0;13510:232:1;25438:286:0;25558:7;25711:5;25702;25706:1;25702;:5;:::i;:::-;25701:15;;;;:::i;:::-;25694:22;25438:286;-1:-1:-1;;;;25438:286:0:o;15404:195::-;15507:12;15539:52;15561:6;15569:4;15575:1;15578:12;15507;12853:20;;16700:60;;;;-1:-1:-1;;;16700:60:0;;13180:2:1;16700:60:0;;;13162:21:1;13219:2;13199:18;;;13192:30;13258:31;13238:18;;;13231:59;13307:18;;16700:60:0;13152:179:1;16700:60:0;16834:12;16848:23;16875:6;-1:-1:-1;;;;;16875:11:0;16895:5;16903:4;16875:33;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16833:75;;;;16926:52;16944:7;16953:10;16965:12;16926:17;:52::i;:::-;16919:59;16456:530;-1:-1:-1;;;;;;;16456:530:0:o;18996:742::-;19111:12;19140:7;19136:595;;;-1:-1:-1;19171:10:0;19164:17;;19136:595;19285:17;;:21;19281:439;;19548:10;19542:17;19609:15;19596:10;19592:2;19588:19;19581:44;19496:148;19691:12;19684:20;;-1:-1:-1;;;19684:20:0;;;;;;;;:::i;14:173:1:-;82:20;;-1:-1:-1;;;;;131:31:1;;121:42;;111:2;;177:1;174;167:12;192:196;;304:2;292:9;283:7;279:23;275:32;272:2;;;325:6;317;310:22;272:2;353:29;372:9;353:29;:::i;393:1735::-;;;604:2;647;635:9;626:7;622:23;618:32;615:2;;;668:6;660;653:22;615:2;713:9;700:23;-1:-1:-1;;;;;783:2:1;775:6;772:14;769:2;;;804:6;796;789:22;769:2;847:6;836:9;832:22;822:32;;892:7;885:4;881:2;877:13;873:27;863:2;;919:6;911;904:22;863:2;960;947:16;982:4;1005:2;1001;998:10;995:2;;;1011:18;;:::i;:::-;1051:37;1084:2;1079;1075;1071:11;1067:20;1051:37;:::i;:::-;1122:15;;;1153:12;;;;-1:-1:-1;1185:11:1;;;1215:4;1246:11;;;1238:20;;1234:29;;1231:42;-1:-1:-1;1228:2:1;;;1291:6;1283;1276:22;1228:2;1318:6;1309:15;;1333:714;1347:2;1344:1;1341:9;1333:714;;;1418:2;1412:3;1403:7;1399:17;1395:26;1392:2;;;1439:6;1431;1424:22;1392:2;1474:19;1490:2;1474:19;:::i;:::-;1520:23;1539:3;1520:23;:::i;:::-;1513:5;1506:38;1580:32;1608:2;1603:3;1599:12;1580:32;:::i;:::-;1575:2;1568:5;1564:14;1557:56;1663:2;1658:3;1654:12;1641:26;1680:30;1702:7;1680:30;:::i;:::-;1730:14;;;1723:31;1777:2;1820:12;;;1807:26;1868:1;1856:14;;1846:2;;1889:6;1881;1874:22;1846:2;1918:14;;;1911:31;1955:18;;1365:1;1358:9;;;;;1993:12;;;;2025;;;;1333:714;;;-1:-1:-1;2066:5:1;;2103:18;;;;2090:32;;-1:-1:-1;;;;;;;;584:1544:1:o;2133:861::-;;;;;2367:2;2355:9;2346:7;2342:23;2338:32;2335:2;;;2388:6;2380;2373:22;2335:2;2429:9;2416:23;2406:33;;2490:2;2479:9;2475:18;2462:32;-1:-1:-1;;;;;2554:2:1;2546:6;2543:14;2540:2;;;2575:6;2567;2560:22;2540:2;2618:6;2607:9;2603:22;2593:32;;2663:7;2656:4;2652:2;2648:13;2644:27;2634:2;;2690:6;2682;2675:22;2634:2;2735;2722:16;2761:2;2753:6;2750:14;2747:2;;;2782:6;2774;2767:22;2747:2;2841:7;2836:2;2830;2822:6;2818:15;2814:2;2810:24;2806:33;2803:46;2800:2;;;2867:6;2859;2852:22;2800:2;2903;2899;2895:11;2885:21;;2925:6;2915:16;;;;;2950:38;2984:2;2973:9;2969:18;2950:38;:::i;:::-;2940:48;;2325:669;;;;;;;:::o;2999:255::-;;3119:2;3107:9;3098:7;3094:23;3090:32;3087:2;;;3140:6;3132;3125:22;3087:2;3177:9;3171:16;3196:28;3218:5;3196:28;:::i;3259:283::-;;;3413:2;3401:9;3392:7;3388:23;3384:32;3381:2;;;3434:6;3426;3419:22;3381:2;-1:-1:-1;;3462:23:1;;;3532:2;3517:18;;;3504:32;;-1:-1:-1;3371:171:1:o;3547:489::-;;;;;;3752:3;3740:9;3731:7;3727:23;3723:33;3720:2;;;3774:6;3766;3759:22;3720:2;-1:-1:-1;;3802:23:1;;;3872:2;3857:18;;3844:32;;-1:-1:-1;3923:2:1;3908:18;;3895:32;;3974:2;3959:18;;3946:32;;-1:-1:-1;4025:3:1;4010:19;3997:33;;-1:-1:-1;3710:326:1;-1:-1:-1;3710:326:1:o;4041:194::-;;4164:2;4152:9;4143:7;4139:23;4135:32;4132:2;;;4185:6;4177;4170:22;4132:2;-1:-1:-1;4213:16:1;;4122:113;-1:-1:-1;4122:113:1:o;4240:274::-;;4407:6;4401:13;4423:53;4469:6;4464:3;4457:4;4449:6;4445:17;4423:53;:::i;:::-;4492:16;;;;;4377:137;-1:-1:-1;;4377:137:1:o;6208:744::-;6436:2;6448:21;;;6421:18;;6504:22;;;6208:744;6583:6;6557:2;6542:18;;6208:744;6620:235;6634:6;6631:1;6628:13;6620:235;;;-1:-1:-1;;;;;6699:26:1;6718:6;6699:26;:::i;:::-;6695:52;6683:65;;6771:4;6830:15;;;;6795:12;;;;6656:1;6649:9;6620:235;;;-1:-1:-1;;;;;;6913:32:1;;;;6906:4;6891:20;;;;6884:62;;;;-1:-1:-1;6872:3:1;;6397:555;-1:-1:-1;;;6397:555:1:o;6957:1173::-;7229:2;7241:21;;;7311:13;;7214:18;;;7333:22;;;6957:1173;;7408:4;;7386:2;7371:18;;;7435:15;;;6957:1173;7481:180;7495:6;7492:1;7489:13;7481:180;;;7560:13;;7575:4;7556:24;7544:37;;7601:12;;;;7636:15;;;;7517:1;7510:9;7481:180;;;-1:-1:-1;;;7697:19:1;;;7677:18;;;7670:47;7767:13;;7789:21;;;7865:15;;;;7828:12;;;7900:4;7913:189;7929:8;7924:3;7921:17;7913:189;;;7998:15;;7984:30;;8075:17;;;;8036:14;;;;7957:1;7948:11;7913:189;;;-1:-1:-1;8119:5:1;;7190:940;-1:-1:-1;;;;;;;7190:940:1:o;8135:383::-;;8284:2;8273:9;8266:21;8316:6;8310:13;8359:6;8354:2;8343:9;8339:18;8332:34;8375:66;8434:6;8429:2;8418:9;8414:18;8409:2;8401:6;8397:15;8375:66;:::i;:::-;8502:2;8481:15;-1:-1:-1;;8477:29:1;8462:45;;;;8509:2;8458:54;;8256:262;-1:-1:-1;;8256:262:1:o;15110:275::-;15181:2;15175:9;15246:2;15227:13;;-1:-1:-1;;15223:27:1;15211:40;;-1:-1:-1;;;;;15266:34:1;;15302:22;;;15263:62;15260:2;;;15328:18;;:::i;:::-;15364:2;15357:22;15155:230;;-1:-1:-1;15155:230:1:o;15390:128::-;;15461:1;15457:6;15454:1;15451:13;15448:2;;;15467:18;;:::i;:::-;-1:-1:-1;15503:9:1;;15438:80::o;15523:217::-;;15589:1;15579:2;;-1:-1:-1;;;15614:31:1;;15668:4;15665:1;15658:15;15696:4;15621:1;15686:15;15579:2;-1:-1:-1;15725:9:1;;15569:171::o;15745:168::-;;15851:1;15847;15843:6;15839:14;15836:1;15833:21;15828:1;15821:9;15814:17;15810:45;15807:2;;;15858:18;;:::i;:::-;-1:-1:-1;15898:9:1;;15797:116::o;15918:125::-;;15986:1;15983;15980:8;15977:2;;;15991:18;;:::i;:::-;-1:-1:-1;16028:9:1;;15967:76::o;16048:258::-;16120:1;16130:113;16144:6;16141:1;16138:13;16130:113;;;16220:11;;;16214:18;16201:11;;;16194:39;16166:2;16159:10;16130:113;;;16261:6;16258:1;16255:13;16252:2;;;16296:1;16287:6;16282:3;16278:16;16271:27;16252:2;;16101:205;;;:::o;16311:135::-;;-1:-1:-1;;16371:17:1;;16368:2;;;16391:18;;:::i;:::-;-1:-1:-1;16438:1:1;16427:13;;16358:88::o;16451:175::-;;16532:4;16525:5;16521:16;16561:4;16552:7;16549:17;16546:2;;;16569:18;;:::i;:::-;16618:1;16605:15;;16496:130;-1:-1:-1;;16496:130:1:o;16631:127::-;16692:10;16687:3;16683:20;16680:1;16673:31;16723:4;16720:1;16713:15;16747:4;16744:1;16737:15;16763:127;16824:10;16819:3;16815:20;16812:1;16805:31;16855:4;16852:1;16845:15;16879:4;16876:1;16869:15;16895:118;16981:5;16974:13;16967:21;16960:5;16957:32;16947:2;;17003:1;17000;16993:12;16947:2;16937:76;:::o
Swarm Source
ipfs://9f51551ef30b773af1daeddafc45ca33a52f839b5a27abe54ccf769645b1c4d1
Loading...
Loading
Loading...
Loading
OVERVIEW
Solidity library for the Feeder Pool contracts.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.