Source Code
Overview
GLMR Balance
GLMR Value
$0.00Cross-Chain Transactions
Loading...
Loading
Contract Name:
ComboOracle_UniV2_UniV3
Compiler Version
v0.8.10+commit.fc410830
Contract Source Code (Solidity)
/**
*Submitted for verification at moonbeam.moonscan.io on 2022-01-18
*/
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.8.0;
// Sources flattened with hardhat v2.8.2 https://hardhat.org
// File contracts/Oracle/AggregatorV3Interface.sol
interface AggregatorV3Interface {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
// getRoundData and latestRoundData should both raise "No data present"
// if they do not have data to report, instead of returning unset values
// which could be misinterpreted as actual reported values.
function getRoundData(uint80 _roundId)
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
// File contracts/Oracle/IPricePerShareOptions.sol
interface IPricePerShareOptions {
// Compound-style [Comp, Cream, Rari, Scream]
// Multiplied by 1e18
function exchangeRateStored() external view returns (uint256);
// Curve-style [Curve, Convex, NOT StakeDAO]
// In 1e18
function get_virtual_price() external view returns (uint256);
// SaddleD4Pool (SwapFlashLoan)
function getVirtualPrice() external view returns (uint256);
// StakeDAO
function getPricePerFullShare() external view returns (uint256);
// Yearn Vault
function pricePerShare() external view returns (uint256);
}
// File contracts/Common/Context.sol
/*
* @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 payable(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;
}
}
// File contracts/Math/SafeMath.sol
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*
* _Available since v2.4.0._
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
// File contracts/ERC20/IERC20.sol
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
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);
}
// File contracts/Utils/Address.sol
/**
* @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);
}
}
}
}
// File contracts/ERC20/ERC20.sol
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20Mintable}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory __name, string memory __symbol) public {
_name = __name;
_symbol = __symbol;
_decimals = 18;
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
* called.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.approve(address spender, uint256 amount)
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from the caller.
*
* See {ERC20-_burn}.
*/
function burn(uint256 amount) public virtual {
_burn(_msgSender(), amount);
}
/**
* @dev Destroys `amount` tokens from `account`, deducting from the caller's
* allowance.
*
* See {ERC20-_burn} and {ERC20-allowance}.
*
* Requirements:
*
* - the caller must have allowance for `accounts`'s tokens of at least
* `amount`.
*/
function burnFrom(address account, uint256 amount) public virtual {
uint256 decreasedAllowance = allowance(account, _msgSender()).sub(amount, "ERC20: burn amount exceeds allowance");
_approve(account, _msgSender(), decreasedAllowance);
_burn(account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Destroys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See {_burn} and {_approve}.
*/
function _burnFrom(address account, uint256 amount) internal virtual {
_burn(account, amount);
_approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of `from`'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of `from`'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:using-hooks.adoc[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
// File contracts/Staking/Owned.sol
// https://docs.synthetix.io/contracts/Owned
contract Owned {
address public owner;
address public nominatedOwner;
constructor (address _owner) public {
require(_owner != address(0), "Owner address cannot be 0");
owner = _owner;
emit OwnerChanged(address(0), _owner);
}
function nominateNewOwner(address _owner) external onlyOwner {
nominatedOwner = _owner;
emit OwnerNominated(_owner);
}
function acceptOwnership() external {
require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership");
emit OwnerChanged(owner, nominatedOwner);
owner = nominatedOwner;
nominatedOwner = address(0);
}
modifier onlyOwner {
require(msg.sender == owner, "Only the contract owner may perform this action");
_;
}
event OwnerNominated(address newOwner);
event OwnerChanged(address oldOwner, address newOwner);
}
// File contracts/Math/HomoraMath.sol
library HomoraMath {
using SafeMath for uint;
function divCeil(uint lhs, uint rhs) internal pure returns (uint) {
return lhs.add(rhs).sub(1) / rhs;
}
function fmul(uint lhs, uint rhs) internal pure returns (uint) {
return lhs.mul(rhs) / (2**112);
}
function fdiv(uint lhs, uint rhs) internal pure returns (uint) {
return lhs.mul(2**112) / rhs;
}
// implementation from https://github.com/Uniswap/uniswap-lib/commit/99f3f28770640ba1bb1ff460ac7c5292fb8291a0
// original implementation: https://github.com/abdk-consulting/abdk-libraries-solidity/blob/master/ABDKMath64x64.sol#L687
function sqrt(uint x) internal pure returns (uint) {
if (x == 0) return 0;
uint xx = x;
uint r = 1;
if (xx >= 0x100000000000000000000000000000000) {
xx >>= 128;
r <<= 64;
}
if (xx >= 0x10000000000000000) {
xx >>= 64;
r <<= 32;
}
if (xx >= 0x100000000) {
xx >>= 32;
r <<= 16;
}
if (xx >= 0x10000) {
xx >>= 16;
r <<= 8;
}
if (xx >= 0x100) {
xx >>= 8;
r <<= 4;
}
if (xx >= 0x10) {
xx >>= 4;
r <<= 2;
}
if (xx >= 0x8) {
r <<= 1;
}
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1; // Seven iterations should be enough
uint r1 = x / r;
return (r < r1 ? r : r1);
}
}
// File contracts/Oracle/ComboOracle.sol
// ====================================================================
// | ______ _______ |
// | / _____________ __ __ / ____(_____ ____ _____ ________ |
// | / /_ / ___/ __ `| |/_/ / /_ / / __ \/ __ `/ __ \/ ___/ _ \ |
// | / __/ / / / /_/ _> < / __/ / / / / / /_/ / / / / /__/ __/ |
// | /_/ /_/ \__,_/_/|_| /_/ /_/_/ /_/\__,_/_/ /_/\___/\___/ |
// | |
// ====================================================================
// =========================== ComboOracle ============================
// ====================================================================
// Aggregates prices for various tokens
// Also has improvements from https://github.com/AlphaFinanceLab/alpha-homora-v2-contract/blob/master/contracts/oracle/ChainlinkAdapterOracle.sol
// Frax Finance: https://github.com/FraxFinance
// Primary Author(s)
// Travis Moore: https://github.com/FortisFortuna
// Reviewer(s) / Contributor(s)
// Jason Huan: https://github.com/jasonhuan
// Sam Kazemian: https://github.com/samkazemian
contract ComboOracle is Owned {
/* ========== STATE VARIABLES ========== */
address timelock_address;
address address_to_consult;
AggregatorV3Interface private priceFeedETHUSD;
ERC20 private WETH;
uint256 public PRECISE_PRICE_PRECISION = 1e18;
uint256 public PRICE_PRECISION = 1e6;
uint256 public PRICE_MISSING_MULTIPLIER = 1e12;
address[] public all_token_addresses;
mapping(address => TokenInfo) public token_info; // token address => info
mapping(address => bool) public has_info; // token address => has info
// Price mappings
uint public maxDelayTime = 90000; // 25 hrs. Mapping for max delay time
/* ========== STRUCTS ========== */
struct TokenInfoConstructorArgs {
address token_address;
address agg_addr_for_underlying;
uint256 agg_other_side; // 0: USD, 1: ETH
address underlying_tkn_address; // Will be address(0) for simple tokens. Otherwise, the aUSDC, yvUSDC address, etc
address pps_override_address;
bytes4 pps_call_selector; // eg bytes4(keccak256("pricePerShare()"));
uint256 pps_decimals;
}
struct TokenInfo {
address token_address;
string symbol;
address agg_addr_for_underlying;
uint256 agg_other_side; // 0: USD, 1: ETH
uint256 agg_decimals;
address underlying_tkn_address; // Will be address(0) for simple tokens. Otherwise, the aUSDC, yvUSDC address, etc
address pps_override_address;
bytes4 pps_call_selector; // eg bytes4(keccak256("pricePerShare()"));
uint256 pps_decimals;
int256 ctkn_undrly_missing_decs;
}
/* ========== CONSTRUCTOR ========== */
constructor (
address _owner_address,
address _eth_usd_chainlink_address,
address _weth_address,
string memory _native_token_symbol,
string memory _weth_token_symbol
) Owned(_owner_address) {
// Instantiate the instances
priceFeedETHUSD = AggregatorV3Interface(_eth_usd_chainlink_address);
WETH = ERC20(_weth_address);
// Handle native ETH
all_token_addresses.push(address(0));
token_info[address(0)] = TokenInfo(
address(0),
_native_token_symbol,
address(_eth_usd_chainlink_address),
0,
8,
address(0),
address(0),
bytes4(0),
0,
0
);
has_info[address(0)] = true;
// Handle WETH/USD
all_token_addresses.push(_weth_address);
token_info[_weth_address] = TokenInfo(
_weth_address,
_weth_token_symbol,
address(_eth_usd_chainlink_address),
0,
8,
address(0),
address(0),
bytes4(0),
0,
0
);
has_info[_weth_address] = true;
}
/* ========== MODIFIERS ========== */
modifier onlyByOwnGov() {
require(msg.sender == owner || msg.sender == timelock_address, "You are not an owner or the governance timelock");
_;
}
/* ========== VIEWS ========== */
function allTokenAddresses() public view returns (address[] memory) {
return all_token_addresses;
}
function allTokenInfos() public view returns (TokenInfo[] memory) {
TokenInfo[] memory return_data = new TokenInfo[](all_token_addresses.length);
for (uint i = 0; i < all_token_addresses.length; i++){
return_data[i] = token_info[all_token_addresses[i]];
}
return return_data;
}
// E6
function getETHPrice() public view returns (uint256) {
(uint80 roundID, int price, , uint256 updatedAt, uint80 answeredInRound) = priceFeedETHUSD.latestRoundData();
require(price >= 0 && (updatedAt >= block.timestamp - maxDelayTime) && answeredInRound >= roundID, "Invalid chainlink price");
return (uint256(price) * (PRICE_PRECISION)) / (1e8); // ETH/USD is 8 decimals on Chainlink
}
// E18
function getETHPricePrecise() public view returns (uint256) {
(uint80 roundID, int price, , uint256 updatedAt, uint80 answeredInRound) = priceFeedETHUSD.latestRoundData();
require(price >= 0 && (updatedAt >= block.timestamp - maxDelayTime) && answeredInRound >= roundID, "Invalid chainlink price");
return (uint256(price) * (PRECISE_PRICE_PRECISION)) / (1e8); // ETH/USD is 8 decimals on Chainlink
}
function getTokenPrice(address token_address) public view returns (uint256 precise_price, uint256 short_price, uint256 eth_price) {
// Get the token info
TokenInfo memory thisTokenInfo = token_info[token_address];
// Get the price for the underlying token
(uint80 roundID, int price, , uint256 updatedAt, uint80 answeredInRound) = AggregatorV3Interface(thisTokenInfo.agg_addr_for_underlying).latestRoundData();
require(price >= 0 && (updatedAt >= block.timestamp - maxDelayTime) && answeredInRound >= roundID, "Invalid chainlink price");
uint256 agg_price = uint256(price);
// Convert to USD, if not already
if (thisTokenInfo.agg_other_side == 1) agg_price = (agg_price * getETHPricePrecise()) / PRECISE_PRICE_PRECISION;
// cToken balance * pps = amt of underlying in native decimals
uint256 price_per_share = 1;
if (thisTokenInfo.underlying_tkn_address != address(0)){
address pps_address_to_use = thisTokenInfo.token_address;
if (thisTokenInfo.pps_override_address != address(0)) pps_address_to_use = thisTokenInfo.pps_override_address;
(bool success, bytes memory data) = (pps_address_to_use).staticcall(abi.encodeWithSelector(thisTokenInfo.pps_call_selector));
require(success, 'Oracle Failed');
price_per_share = abi.decode(data, (uint256));
}
// E18
uint256 pps_multiplier = (uint256(10) ** (thisTokenInfo.pps_decimals));
// Handle difference in decimals()
if (thisTokenInfo.ctkn_undrly_missing_decs < 0){
uint256 ctkn_undr_miss_dec_mult = (10 ** uint256(-1 * thisTokenInfo.ctkn_undrly_missing_decs));
precise_price = (agg_price * PRECISE_PRICE_PRECISION * price_per_share) / (ctkn_undr_miss_dec_mult * pps_multiplier * (uint256(10) ** (thisTokenInfo.agg_decimals)));
}
else {
uint256 ctkn_undr_miss_dec_mult = (10 ** uint256(thisTokenInfo.ctkn_undrly_missing_decs));
precise_price = (agg_price * PRECISE_PRICE_PRECISION * price_per_share * ctkn_undr_miss_dec_mult) / (pps_multiplier * (uint256(10) ** (thisTokenInfo.agg_decimals)));
}
// E6
short_price = precise_price / PRICE_MISSING_MULTIPLIER;
// ETH Price
eth_price = (precise_price * PRECISE_PRICE_PRECISION) / getETHPricePrecise();
}
// Return token price in ETH, multiplied by 2**112
function getETHPx112(address token_address) external view returns (uint256) {
if (token_address == address(WETH) || token_address == 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) return uint(2 ** 112);
require(maxDelayTime != 0, 'Max delay time not set');
// Get the ETH Price PRECISE_PRICE_PRECISION
( , , uint256 eth_price) = getTokenPrice(token_address);
// Get the decimals
uint decimals = uint(ERC20(token_address).decimals());
// Scale to 2*112
// Also divide by the token decimals (needed for the math. Nothing to do with missing decimals or anything)
return (eth_price * (2 ** 112)) / (10 ** decimals);
}
/* ========== RESTRICTED GOVERNANCE FUNCTIONS ========== */
function setTimelock(address _timelock_address) external onlyByOwnGov {
timelock_address = _timelock_address;
}
function setMaxDelayTime(uint _maxDelayTime) external onlyByOwnGov {
maxDelayTime = _maxDelayTime;
}
function batchSetOracleInfoDirect(TokenInfoConstructorArgs[] memory _initial_token_infos) external onlyByOwnGov {
// Batch set token info
for (uint256 i = 0; i < _initial_token_infos.length; i++){
TokenInfoConstructorArgs memory this_token_info = _initial_token_infos[i];
_setTokenInfo(
this_token_info.token_address,
this_token_info.agg_addr_for_underlying,
this_token_info.agg_other_side,
this_token_info.underlying_tkn_address,
this_token_info.pps_override_address,
this_token_info.pps_call_selector,
this_token_info.pps_decimals
);
}
}
// Sets oracle info for a token
// Chainlink Addresses
// https://docs.chain.link/docs/ethereum-addresses/
// exchangeRateStored: 0x182df0f5
// getPricePerFullShare: 0x77c7b8fc
// get_virtual_price: 0xbb7b8b80
// getVirtualPrice: 0xe25aa5fa
// pricePerShare: 0x99530b06
// Function signature encoder
// web3_data.eth.abi.encodeFunctionSignature({
// name: 'getVirtualPrice',
// type: 'function',
// inputs: []
// })
// web3_data.eth.abi.encodeFunctionSignature({
// name: 'myMethod',
// type: 'function',
// inputs: [{
// type: 'uint256',
// name: 'myNumber'
// }]
// })
// To burn something, for example, type this on app.frax.finance's JS console
// https://web3js.readthedocs.io/en/v1.2.11/web3-eth-abi.html#encodefunctioncall
// web3_data.eth.abi.encodeFunctionCall({
// name: 'burn',
// type: 'function',
// inputs: [{
// type: 'uint256',
// name: 'myNumber'
// }]
// }, ['100940878321208298244715']);
function _setTokenInfo(
address token_address,
address agg_addr_for_underlying,
uint256 agg_other_side, // 0: USD, 1: ETH
address underlying_tkn_address,
address pps_override_address,
bytes4 pps_call_selector,
uint256 pps_decimals
) internal {
// require(token_address != address(0), "Cannot add zero address");
// See if there are any missing decimals between a cToken and the underlying
int256 ctkn_undrly_missing_decs = 0;
if (underlying_tkn_address != address(0)){
uint256 cToken_decs = ERC20(token_address).decimals();
uint256 underlying_decs = ERC20(underlying_tkn_address).decimals();
ctkn_undrly_missing_decs = int256(cToken_decs) - int256(underlying_decs);
}
// Add the token address to the array if it doesn't already exist
bool token_exists = false;
for (uint i = 0; i < all_token_addresses.length; i++){
if (all_token_addresses[i] == token_address) {
token_exists = true;
break;
}
}
if (!token_exists) all_token_addresses.push(token_address);
uint256 agg_decs = uint256(AggregatorV3Interface(agg_addr_for_underlying).decimals());
// Add the token to the mapping
token_info[token_address] = TokenInfo(
token_address,
ERC20(token_address).name(),
agg_addr_for_underlying,
agg_other_side,
agg_decs,
underlying_tkn_address,
pps_override_address,
pps_call_selector,
pps_decimals,
ctkn_undrly_missing_decs
);
has_info[token_address] = true;
}
function setTokenInfo(
address token_address,
address agg_addr_for_underlying,
uint256 agg_other_side,
address underlying_tkn_address,
address pps_override_address,
bytes4 pps_call_selector,
uint256 pps_decimals
) public onlyByOwnGov {
_setTokenInfo(token_address, agg_addr_for_underlying, agg_other_side, underlying_tkn_address, pps_override_address, pps_call_selector, pps_decimals);
}
}
// File contracts/Uniswap/Interfaces/IUniswapV2Pair.sol
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File contracts/Uniswap/Interfaces/IUniswapV2Router01.sol
interface IUniswapV2Router01 {
function factory() external returns (address);
function WETH() external returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
// File contracts/Uniswap/Interfaces/IUniswapV2Router02.sol
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
// File contracts/Uniswap_V3/IUniswapV3Factory.sol
/// @title The interface for the Uniswap V3 Factory
/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees
interface IUniswapV3Factory {
/// @notice Emitted when the owner of the factory is changed
/// @param oldOwner The owner before the owner was changed
/// @param newOwner The owner after the owner was changed
event OwnerChanged(address indexed oldOwner, address indexed newOwner);
/// @notice Emitted when a pool is created
/// @param token0 The first token of the pool by address sort order
/// @param token1 The second token of the pool by address sort order
/// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
/// @param tickSpacing The minimum number of ticks between initialized ticks
/// @param pool The address of the created pool
event PoolCreated(
address indexed token0,
address indexed token1,
uint24 indexed fee,
int24 tickSpacing,
address pool
);
/// @notice Emitted when a new fee amount is enabled for pool creation via the factory
/// @param fee The enabled fee, denominated in hundredths of a bip
/// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee
event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);
/// @notice Returns the current owner of the factory
/// @dev Can be changed by the current owner via setOwner
/// @return The address of the factory owner
function owner() external view returns (address);
/// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled
/// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context
/// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee
/// @return The tick spacing
function feeAmountTickSpacing(uint24 fee) external view returns (int24);
/// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist
/// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order
/// @param tokenA The contract address of either token0 or token1
/// @param tokenB The contract address of the other token
/// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
/// @return pool The pool address
function getPool(
address tokenA,
address tokenB,
uint24 fee
) external view returns (address pool);
/// @notice Creates a pool for the given two tokens and fee
/// @param tokenA One of the two tokens in the desired pool
/// @param tokenB The other of the two tokens in the desired pool
/// @param fee The desired fee for the pool
/// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved
/// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments
/// are invalid.
/// @return pool The address of the newly created pool
function createPool(
address tokenA,
address tokenB,
uint24 fee
) external returns (address pool);
/// @notice Updates the owner of the factory
/// @dev Must be called by the current owner
/// @param _owner The new owner of the factory
function setOwner(address _owner) external;
/// @notice Enables a fee amount with the given tickSpacing
/// @dev Fee amounts may never be removed once enabled
/// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)
/// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount
function enableFeeAmount(uint24 fee, int24 tickSpacing) external;
}
// File contracts/Uniswap_V3/libraries/TickMath.sol
/// @title Math library for computing sqrt prices from ticks and vice versa
/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports
/// prices between 2**-128 and 2**128
library TickMath {
/// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128
int24 internal constant MIN_TICK = -887272;
/// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128
int24 internal constant MAX_TICK = -MIN_TICK;
/// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)
uint160 internal constant MIN_SQRT_RATIO = 4295128739;
/// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)
uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342;
/// @notice Calculates sqrt(1.0001^tick) * 2^96
/// @dev Throws if |tick| > max tick
/// @param tick The input tick for the above formula
/// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)
/// at the given tick
function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) {
uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));
require(int256(absTick) <= int256(MAX_TICK), 'T');
uint256 ratio = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000000000000000000000000000000;
if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;
if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;
if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;
if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;
if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;
if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;
if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;
if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;
if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;
if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;
if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;
if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;
if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;
if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;
if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;
if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;
if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;
if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;
if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;
if (tick > 0) ratio = type(uint256).max / ratio;
// this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.
// we then downcast because we know the result always fits within 160 bits due to our tick input constraint
// we round up in the division so getTickAtSqrtRatio of the output price is always consistent
sqrtPriceX96 = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1));
}
/// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio
/// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may
/// ever return.
/// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96
/// @return tick The greatest tick for which the ratio is less than or equal to the input ratio
function getTickAtSqrtRatio(uint160 sqrtPriceX96) internal pure returns (int24 tick) {
// second inequality must be < because the price can never reach the price at the max tick
require(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO, 'R');
uint256 ratio = uint256(sqrtPriceX96) << 32;
uint256 r = ratio;
uint256 msb = 0;
assembly {
let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))
msb := or(msb, f)
r := shr(f, r)
}
assembly {
let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))
msb := or(msb, f)
r := shr(f, r)
}
assembly {
let f := shl(5, gt(r, 0xFFFFFFFF))
msb := or(msb, f)
r := shr(f, r)
}
assembly {
let f := shl(4, gt(r, 0xFFFF))
msb := or(msb, f)
r := shr(f, r)
}
assembly {
let f := shl(3, gt(r, 0xFF))
msb := or(msb, f)
r := shr(f, r)
}
assembly {
let f := shl(2, gt(r, 0xF))
msb := or(msb, f)
r := shr(f, r)
}
assembly {
let f := shl(1, gt(r, 0x3))
msb := or(msb, f)
r := shr(f, r)
}
assembly {
let f := gt(r, 0x1)
msb := or(msb, f)
}
if (msb >= 128) r = ratio >> (msb - 127);
else r = ratio << (127 - msb);
int256 log_2 = (int256(msb) - 128) << 64;
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(63, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(62, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(61, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(60, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(59, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(58, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(57, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(56, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(55, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(54, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(53, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(52, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(51, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(50, f))
}
int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number
int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128);
int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128);
tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow;
}
}
// File contracts/Uniswap_V3/libraries/FullMath.sol
/// @title Contains 512-bit math functions
/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision
/// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits
library FullMath {
/// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
/// @param a The multiplicand
/// @param b The multiplier
/// @param denominator The divisor
/// @return result The 256-bit result
/// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv
function mulDiv(
uint256 a,
uint256 b,
uint256 denominator
) internal pure returns (uint256 result) {
// 512-bit multiply [prod1 prod0] = a * b
// Compute the product mod 2**256 and mod 2**256 - 1
// then use the Chinese Remainder Theorem to reconstruct
// the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2**256 + prod0
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(a, b, not(0))
prod0 := mul(a, b)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division
if (prod1 == 0) {
require(denominator > 0);
assembly {
result := div(prod0, denominator)
}
return result;
}
// Make sure the result is less than 2**256.
// Also prevents denominator == 0
require(denominator > prod1);
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0]
// Compute remainder using mulmod
uint256 remainder;
assembly {
remainder := mulmod(a, b, denominator)
}
// Subtract 256 bit number from 512 bit number
assembly {
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator
// Compute largest power of two divisor of denominator.
// Always >= 1.
uint256 twos = (type(uint256).max - denominator + 1) & denominator;
// Divide denominator by power of two
assembly {
denominator := div(denominator, twos)
}
// Divide [prod1 prod0] by the factors of two
assembly {
prod0 := div(prod0, twos)
}
// Shift in bits from prod1 into prod0. For this we need
// to flip `twos` such that it is 2**256 / twos.
// If twos is zero, then it becomes one
assembly {
twos := add(div(sub(0, twos), twos), 1)
}
prod0 |= prod1 * twos;
// Invert denominator mod 2**256
// Now that denominator is an odd number, it has an inverse
// modulo 2**256 such that denominator * inv = 1 mod 2**256.
// Compute the inverse by starting with a seed that is correct
// correct for four bits. That is, denominator * inv = 1 mod 2**4
uint256 inv = (3 * denominator) ^ 2;
// Now use Newton-Raphson iteration to improve the precision.
// Thanks to Hensel's lifting lemma, this also works in modular
// arithmetic, doubling the correct bits in each step.
inv *= 2 - denominator * inv; // inverse mod 2**8
inv *= 2 - denominator * inv; // inverse mod 2**16
inv *= 2 - denominator * inv; // inverse mod 2**32
inv *= 2 - denominator * inv; // inverse mod 2**64
inv *= 2 - denominator * inv; // inverse mod 2**128
inv *= 2 - denominator * inv; // inverse mod 2**256
// Because the division is now exact we can divide by multiplying
// with the modular inverse of denominator. This will give us the
// correct result modulo 2**256. Since the precoditions guarantee
// that the outcome is less than 2**256, this is the final result.
// We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inv;
return result;
}
/// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
/// @param a The multiplicand
/// @param b The multiplier
/// @param denominator The divisor
/// @return result The 256-bit result
function mulDivRoundingUp(
uint256 a,
uint256 b,
uint256 denominator
) internal pure returns (uint256 result) {
result = mulDiv(a, b, denominator);
if (mulmod(a, b, denominator) > 0) {
require(result < type(uint256).max);
result++;
}
}
}
// File contracts/Uniswap_V3/libraries/FixedPoint96.sol
/// @title FixedPoint96
/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)
/// @dev Used in SqrtPriceMath.sol
library FixedPoint96 {
uint8 internal constant RESOLUTION = 96;
uint256 internal constant Q96 = 0x1000000000000000000000000;
}
// File contracts/Uniswap_V3/libraries/LiquidityAmounts.sol
/// @title Liquidity amount functions
/// @notice Provides functions for computing liquidity amounts from token amounts and prices
library LiquidityAmounts {
/// @notice Downcasts uint256 to uint128
/// @param x The uint258 to be downcasted
/// @return y The passed value, downcasted to uint128
function toUint128(uint256 x) private pure returns (uint128 y) {
require((y = uint128(x)) == x);
}
/// @notice Computes the amount of liquidity received for a given amount of token0 and price range
/// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower))
/// @param sqrtRatioAX96 A sqrt price representing the first tick boundary
/// @param sqrtRatioBX96 A sqrt price representing the second tick boundary
/// @param amount0 The amount0 being sent in
/// @return liquidity The amount of returned liquidity
function getLiquidityForAmount0(
uint160 sqrtRatioAX96,
uint160 sqrtRatioBX96,
uint256 amount0
) internal pure returns (uint128 liquidity) {
if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);
uint256 intermediate = FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);
return toUint128(FullMath.mulDiv(amount0, intermediate, sqrtRatioBX96 - sqrtRatioAX96));
}
/// @notice Computes the amount of liquidity received for a given amount of token1 and price range
/// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).
/// @param sqrtRatioAX96 A sqrt price representing the first tick boundary
/// @param sqrtRatioBX96 A sqrt price representing the second tick boundary
/// @param amount1 The amount1 being sent in
/// @return liquidity The amount of returned liquidity
function getLiquidityForAmount1(
uint160 sqrtRatioAX96,
uint160 sqrtRatioBX96,
uint256 amount1
) internal pure returns (uint128 liquidity) {
if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);
return toUint128(FullMath.mulDiv(amount1, FixedPoint96.Q96, sqrtRatioBX96 - sqrtRatioAX96));
}
/// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current
/// pool prices and the prices at the tick boundaries
/// @param sqrtRatioX96 A sqrt price representing the current pool prices
/// @param sqrtRatioAX96 A sqrt price representing the first tick boundary
/// @param sqrtRatioBX96 A sqrt price representing the second tick boundary
/// @param amount0 The amount of token0 being sent in
/// @param amount1 The amount of token1 being sent in
/// @return liquidity The maximum amount of liquidity received
function getLiquidityForAmounts(
uint160 sqrtRatioX96,
uint160 sqrtRatioAX96,
uint160 sqrtRatioBX96,
uint256 amount0,
uint256 amount1
) internal pure returns (uint128 liquidity) {
if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);
if (sqrtRatioX96 <= sqrtRatioAX96) {
liquidity = getLiquidityForAmount0(sqrtRatioAX96, sqrtRatioBX96, amount0);
} else if (sqrtRatioX96 < sqrtRatioBX96) {
uint128 liquidity0 = getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);
uint128 liquidity1 = getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);
liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;
} else {
liquidity = getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1);
}
}
/// @notice Computes the amount of token0 for a given amount of liquidity and a price range
/// @param sqrtRatioAX96 A sqrt price representing the first tick boundary
/// @param sqrtRatioBX96 A sqrt price representing the second tick boundary
/// @param liquidity The liquidity being valued
/// @return amount0 The amount of token0
function getAmount0ForLiquidity(
uint160 sqrtRatioAX96,
uint160 sqrtRatioBX96,
uint128 liquidity
) internal pure returns (uint256 amount0) {
if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);
return
FullMath.mulDiv(
uint256(liquidity) << FixedPoint96.RESOLUTION,
sqrtRatioBX96 - sqrtRatioAX96,
sqrtRatioBX96
) / sqrtRatioAX96;
}
/// @notice Computes the amount of token1 for a given amount of liquidity and a price range
/// @param sqrtRatioAX96 A sqrt price representing the first tick boundary
/// @param sqrtRatioBX96 A sqrt price representing the second tick boundary
/// @param liquidity The liquidity being valued
/// @return amount1 The amount of token1
function getAmount1ForLiquidity(
uint160 sqrtRatioAX96,
uint160 sqrtRatioBX96,
uint128 liquidity
) internal pure returns (uint256 amount1) {
if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);
return FullMath.mulDiv(liquidity, sqrtRatioBX96 - sqrtRatioAX96, FixedPoint96.Q96);
}
/// @notice Computes the token0 and token1 value for a given amount of liquidity, the current
/// pool prices and the prices at the tick boundaries
/// @param sqrtRatioX96 A sqrt price representing the current pool prices
/// @param sqrtRatioAX96 A sqrt price representing the first tick boundary
/// @param sqrtRatioBX96 A sqrt price representing the second tick boundary
/// @param liquidity The liquidity being valued
/// @return amount0 The amount of token0
/// @return amount1 The amount of token1
function getAmountsForLiquidity(
uint160 sqrtRatioX96,
uint160 sqrtRatioAX96,
uint160 sqrtRatioBX96,
uint128 liquidity
) internal pure returns (uint256 amount0, uint256 amount1) {
if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);
if (sqrtRatioX96 <= sqrtRatioAX96) {
amount0 = getAmount0ForLiquidity(sqrtRatioAX96, sqrtRatioBX96, liquidity);
} else if (sqrtRatioX96 < sqrtRatioBX96) {
amount0 = getAmount0ForLiquidity(sqrtRatioX96, sqrtRatioBX96, liquidity);
amount1 = getAmount1ForLiquidity(sqrtRatioAX96, sqrtRatioX96, liquidity);
} else {
amount1 = getAmount1ForLiquidity(sqrtRatioAX96, sqrtRatioBX96, liquidity);
}
}
}
// File @openzeppelin/contracts/utils/introspection/[email protected]
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// File @openzeppelin/contracts/token/ERC721/[email protected]
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
// File @openzeppelin/contracts/token/ERC721/extensions/[email protected]
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
// File @openzeppelin/contracts/token/ERC721/extensions/[email protected]
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Enumerable.sol)
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}
// File contracts/Uniswap_V3/periphery/interfaces/IPoolInitializer.sol
pragma abicoder v2;
/// @title Creates and initializes V3 Pools
/// @notice Provides a method for creating and initializing a pool, if necessary, for bundling with other methods that
/// require the pool to exist.
interface IPoolInitializer {
/// @notice Creates a new pool if it does not exist, then initializes if not initialized
/// @dev This method can be bundled with others via IMulticall for the first action (e.g. mint) performed against a pool
/// @param token0 The contract address of token0 of the pool
/// @param token1 The contract address of token1 of the pool
/// @param fee The fee amount of the v3 pool for the specified token pair
/// @param sqrtPriceX96 The initial square root price of the pool as a Q64.96 value
/// @return pool Returns the pool address based on the pair of tokens and fee, will return the newly created pool address if necessary
function createAndInitializePoolIfNecessary(
address token0,
address token1,
uint24 fee,
uint160 sqrtPriceX96
) external payable returns (address pool);
}
// File contracts/Uniswap_V3/periphery/interfaces/IERC721Permit.sol
/// @title ERC721 with permit
/// @notice Extension to ERC721 that includes a permit function for signature based approvals
interface IERC721Permit is IERC721 {
/// @notice The permit typehash used in the permit signature
/// @return The typehash for the permit
function PERMIT_TYPEHASH() external pure returns (bytes32);
/// @notice The domain separator used in the permit signature
/// @return The domain seperator used in encoding of permit signature
function DOMAIN_SEPARATOR() external view returns (bytes32);
/// @notice Approve of a specific token ID for spending by spender via signature
/// @param spender The account that is being approved
/// @param tokenId The ID of the token that is being approved for spending
/// @param deadline The deadline timestamp by which the call must be mined for the approve to work
/// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`
/// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`
/// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`
function permit(
address spender,
uint256 tokenId,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external payable;
}
// File contracts/Uniswap_V3/periphery/interfaces/IPeripheryPayments.sol
/// @title Periphery Payments
/// @notice Functions to ease deposits and withdrawals of ETH
interface IPeripheryPayments {
/// @notice Unwraps the contract's WETH9 balance and sends it to recipient as ETH.
/// @dev The amountMinimum parameter prevents malicious contracts from stealing WETH9 from users.
/// @param amountMinimum The minimum amount of WETH9 to unwrap
/// @param recipient The address receiving ETH
function unwrapWETH9(uint256 amountMinimum, address recipient) external payable;
/// @notice Refunds any ETH balance held by this contract to the `msg.sender`
/// @dev Useful for bundling with mint or increase liquidity that uses ether, or exact output swaps
/// that use ether for the input amount
function refundETH() external payable;
/// @notice Transfers the full amount of a token held by this contract to recipient
/// @dev The amountMinimum parameter prevents malicious contracts from stealing the token from users
/// @param token The contract address of the token which will be transferred to `recipient`
/// @param amountMinimum The minimum amount of token required for a transfer
/// @param recipient The destination address of the token
function sweepToken(
address token,
uint256 amountMinimum,
address recipient
) external payable;
}
// File contracts/Uniswap_V3/periphery/interfaces/IPeripheryImmutableState.sol
/// @title Immutable state
/// @notice Functions that return immutable state of the router
interface IPeripheryImmutableState {
/// @return Returns the address of the Uniswap V3 factory
function factory() external view returns (address);
/// @return Returns the address of WETH9
function WETH9() external view returns (address);
}
// File contracts/Uniswap_V3/periphery/libraries/PoolAddress.sol
/// @title Provides functions for deriving a pool address from the factory, tokens, and the fee
library PoolAddress {
bytes32 internal constant POOL_INIT_CODE_HASH = 0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54;
/// @notice The identifying key of the pool
struct PoolKey {
address token0;
address token1;
uint24 fee;
}
/// @notice Returns PoolKey: the ordered tokens with the matched fee levels
/// @param tokenA The first token of a pool, unsorted
/// @param tokenB The second token of a pool, unsorted
/// @param fee The fee level of the pool
/// @return Poolkey The pool details with ordered token0 and token1 assignments
function getPoolKey(
address tokenA,
address tokenB,
uint24 fee
) internal pure returns (PoolKey memory) {
if (tokenA > tokenB) (tokenA, tokenB) = (tokenB, tokenA);
return PoolKey({token0: tokenA, token1: tokenB, fee: fee});
}
/// @notice Deterministically computes the pool address given the factory and PoolKey
/// @param factory The Uniswap V3 factory contract address
/// @param key The PoolKey
/// @return pool The contract address of the V3 pool
function computeAddress(address factory, PoolKey memory key) internal pure returns (address pool) {
require(key.token0 < key.token1);
pool = address(uint160(
uint256(
keccak256(
abi.encodePacked(
hex'ff',
factory,
keccak256(abi.encode(key.token0, key.token1, key.fee)),
POOL_INIT_CODE_HASH
)
)
)
));
}
}
// File contracts/Uniswap_V3/periphery/interfaces/INonfungiblePositionManager.sol
/// @title Non-fungible token for positions
/// @notice Wraps Uniswap V3 positions in a non-fungible token interface which allows for them to be transferred
/// and authorized.
interface INonfungiblePositionManager is
IPoolInitializer,
IPeripheryPayments,
IPeripheryImmutableState,
IERC721Metadata,
IERC721Enumerable,
IERC721Permit
{
/// @notice Emitted when liquidity is increased for a position NFT
/// @dev Also emitted when a token is minted
/// @param tokenId The ID of the token for which liquidity was increased
/// @param liquidity The amount by which liquidity for the NFT position was increased
/// @param amount0 The amount of token0 that was paid for the increase in liquidity
/// @param amount1 The amount of token1 that was paid for the increase in liquidity
event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1);
/// @notice Emitted when liquidity is decreased for a position NFT
/// @param tokenId The ID of the token for which liquidity was decreased
/// @param liquidity The amount by which liquidity for the NFT position was decreased
/// @param amount0 The amount of token0 that was accounted for the decrease in liquidity
/// @param amount1 The amount of token1 that was accounted for the decrease in liquidity
event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1);
/// @notice Emitted when tokens are collected for a position NFT
/// @dev The amounts reported may not be exactly equivalent to the amounts transferred, due to rounding behavior
/// @param tokenId The ID of the token for which underlying tokens were collected
/// @param recipient The address of the account that received the collected tokens
/// @param amount0 The amount of token0 owed to the position that was collected
/// @param amount1 The amount of token1 owed to the position that was collected
event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1);
/// @notice Returns the position information associated with a given token ID.
/// @dev Throws if the token ID is not valid.
/// @param tokenId The ID of the token that represents the position
/// @return nonce The nonce for permits
/// @return operator The address that is approved for spending
/// @return token0 The address of the token0 for a specific pool
/// @return token1 The address of the token1 for a specific pool
/// @return fee The fee associated with the pool
/// @return tickLower The lower end of the tick range for the position
/// @return tickUpper The higher end of the tick range for the position
/// @return liquidity The liquidity of the position
/// @return feeGrowthInside0LastX128 The fee growth of token0 as of the last action on the individual position
/// @return feeGrowthInside1LastX128 The fee growth of token1 as of the last action on the individual position
/// @return tokensOwed0 The uncollected amount of token0 owed to the position as of the last computation
/// @return tokensOwed1 The uncollected amount of token1 owed to the position as of the last computation
function positions(uint256 tokenId)
external
view
returns (
uint96 nonce,
address operator,
address token0,
address token1,
uint24 fee,
int24 tickLower,
int24 tickUpper,
uint128 liquidity,
uint256 feeGrowthInside0LastX128,
uint256 feeGrowthInside1LastX128,
uint128 tokensOwed0,
uint128 tokensOwed1
);
struct MintParams {
address token0;
address token1;
uint24 fee;
int24 tickLower;
int24 tickUpper;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
address recipient;
uint256 deadline;
}
/// @notice Creates a new position wrapped in a NFT
/// @dev Call this when the pool does exist and is initialized. Note that if the pool is created but not initialized
/// a method does not exist, i.e. the pool is assumed to be initialized.
/// @param params The params necessary to mint a position, encoded as `MintParams` in calldata
/// @return tokenId The ID of the token that represents the minted position
/// @return liquidity The amount of liquidity for this position
/// @return amount0 The amount of token0
/// @return amount1 The amount of token1
function mint(MintParams calldata params)
external
payable
returns (
uint256 tokenId,
uint128 liquidity,
uint256 amount0,
uint256 amount1
);
struct IncreaseLiquidityParams {
uint256 tokenId;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}
/// @notice Increases the amount of liquidity in a position, with tokens paid by the `msg.sender`
/// @param params tokenId The ID of the token for which liquidity is being increased,
/// amount0Desired The desired amount of token0 to be spent,
/// amount1Desired The desired amount of token1 to be spent,
/// amount0Min The minimum amount of token0 to spend, which serves as a slippage check,
/// amount1Min The minimum amount of token1 to spend, which serves as a slippage check,
/// deadline The time by which the transaction must be included to effect the change
/// @return liquidity The new liquidity amount as a result of the increase
/// @return amount0 The amount of token0 to acheive resulting liquidity
/// @return amount1 The amount of token1 to acheive resulting liquidity
function increaseLiquidity(IncreaseLiquidityParams calldata params)
external
payable
returns (
uint128 liquidity,
uint256 amount0,
uint256 amount1
);
struct DecreaseLiquidityParams {
uint256 tokenId;
uint128 liquidity;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}
/// @notice Decreases the amount of liquidity in a position and accounts it to the position
/// @param params tokenId The ID of the token for which liquidity is being decreased,
/// amount The amount by which liquidity will be decreased,
/// amount0Min The minimum amount of token0 that should be accounted for the burned liquidity,
/// amount1Min The minimum amount of token1 that should be accounted for the burned liquidity,
/// deadline The time by which the transaction must be included to effect the change
/// @return amount0 The amount of token0 accounted to the position's tokens owed
/// @return amount1 The amount of token1 accounted to the position's tokens owed
function decreaseLiquidity(DecreaseLiquidityParams calldata params)
external
payable
returns (uint256 amount0, uint256 amount1);
struct CollectParams {
uint256 tokenId;
address recipient;
uint128 amount0Max;
uint128 amount1Max;
}
/// @notice Collects up to a maximum amount of fees owed to a specific position to the recipient
/// @param params tokenId The ID of the NFT for which tokens are being collected,
/// recipient The account that should receive the tokens,
/// amount0Max The maximum amount of token0 to collect,
/// amount1Max The maximum amount of token1 to collect
/// @return amount0 The amount of fees collected in token0
/// @return amount1 The amount of fees collected in token1
function collect(CollectParams calldata params) external payable returns (uint256 amount0, uint256 amount1);
/// @notice Burns a token ID, which deletes it from the NFT contract. The token must have 0 liquidity and all tokens
/// must be collected first.
/// @param tokenId The ID of the token that is being burned
function burn(uint256 tokenId) external payable;
}
// File contracts/Uniswap_V3/pool/IUniswapV3PoolImmutables.sol
/// @title Pool state that never changes
/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values
interface IUniswapV3PoolImmutables {
/// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface
/// @return The contract address
function factory() external view returns (address);
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token contract address
function token1() external view returns (address);
/// @notice The pool's fee in hundredths of a bip, i.e. 1e-6
/// @return The fee
function fee() external view returns (uint24);
/// @notice The pool tick spacing
/// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive
/// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...
/// This value is an int24 to avoid casting even though it is always positive.
/// @return The tick spacing
function tickSpacing() external view returns (int24);
/// @notice The maximum amount of position liquidity that can use any tick in the range
/// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and
/// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool
/// @return The max amount of liquidity per tick
function maxLiquidityPerTick() external view returns (uint128);
}
// File contracts/Uniswap_V3/pool/IUniswapV3PoolState.sol
/// @title Pool state that can change
/// @notice These methods compose the pool's state, and can change with any frequency including multiple times
/// per transaction
interface IUniswapV3PoolState {
/// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas
/// when accessed externally.
/// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value
/// tick The current tick of the pool, i.e. according to the last tick transition that was run.
/// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick
/// boundary.
/// observationIndex The index of the last oracle observation that was written,
/// observationCardinality The current maximum number of observations stored in the pool,
/// observationCardinalityNext The next maximum number of observations, to be updated when the observation.
/// feeProtocol The protocol fee for both tokens of the pool.
/// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0
/// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.
/// unlocked Whether the pool is currently locked to reentrancy
function slot0()
external
view
returns (
uint160 sqrtPriceX96,
int24 tick,
uint16 observationIndex,
uint16 observationCardinality,
uint16 observationCardinalityNext,
uint8 feeProtocol,
bool unlocked
);
/// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool
/// @dev This value can overflow the uint256
function feeGrowthGlobal0X128() external view returns (uint256);
/// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool
/// @dev This value can overflow the uint256
function feeGrowthGlobal1X128() external view returns (uint256);
/// @notice The amounts of token0 and token1 that are owed to the protocol
/// @dev Protocol fees will never exceed uint128 max in either token
function protocolFees() external view returns (uint128 token0, uint128 token1);
/// @notice The currently in range liquidity available to the pool
/// @dev This value has no relationship to the total liquidity across all ticks
function liquidity() external view returns (uint128);
/// @notice Look up information about a specific tick in the pool
/// @param tick The tick to look up
/// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or
/// tick upper,
/// liquidityNet how much liquidity changes when the pool price crosses the tick,
/// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,
/// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,
/// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick
/// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,
/// secondsOutside the seconds spent on the other side of the tick from the current tick,
/// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.
/// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.
/// In addition, these values are only relative and must be used only in comparison to previous snapshots for
/// a specific position.
function ticks(int24 tick)
external
view
returns (
uint128 liquidityGross,
int128 liquidityNet,
uint256 feeGrowthOutside0X128,
uint256 feeGrowthOutside1X128,
int56 tickCumulativeOutside,
uint160 secondsPerLiquidityOutsideX128,
uint32 secondsOutside,
bool initialized
);
/// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information
function tickBitmap(int16 wordPosition) external view returns (uint256);
/// @notice Returns the information about a position by the position's key
/// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper
/// @return _liquidity The amount of liquidity in the position,
/// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,
/// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,
/// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,
/// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke
function positions(bytes32 key)
external
view
returns (
uint128 _liquidity,
uint256 feeGrowthInside0LastX128,
uint256 feeGrowthInside1LastX128,
uint128 tokensOwed0,
uint128 tokensOwed1
);
/// @notice Returns data about a specific observation index
/// @param index The element of the observations array to fetch
/// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time
/// ago, rather than at a specific index in the array.
/// @return blockTimestamp The timestamp of the observation,
/// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,
/// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,
/// Returns initialized whether the observation has been initialized and the values are safe to use
function observations(uint256 index)
external
view
returns (
uint32 blockTimestamp,
int56 tickCumulative,
uint160 secondsPerLiquidityCumulativeX128,
bool initialized
);
}
// File contracts/Uniswap_V3/pool/IUniswapV3PoolDerivedState.sol
/// @title Pool state that is not stored
/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the
/// blockchain. The functions here may have variable gas costs.
interface IUniswapV3PoolDerivedState {
/// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp
/// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing
/// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,
/// you must call it with secondsAgos = [3600, 0].
/// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in
/// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.
/// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned
/// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp
/// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block
/// timestamp
function observe(uint32[] calldata secondsAgos)
external
view
returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);
/// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range
/// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.
/// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first
/// snapshot is taken and the second snapshot is taken.
/// @param tickLower The lower tick of the range
/// @param tickUpper The upper tick of the range
/// @return tickCumulativeInside The snapshot of the tick accumulator for the range
/// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range
/// @return secondsInside The snapshot of seconds per liquidity for the range
function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
external
view
returns (
int56 tickCumulativeInside,
uint160 secondsPerLiquidityInsideX128,
uint32 secondsInside
);
}
// File contracts/Uniswap_V3/pool/IUniswapV3PoolActions.sol
/// @title Permissionless pool actions
/// @notice Contains pool methods that can be called by anyone
interface IUniswapV3PoolActions {
/// @notice Sets the initial price for the pool
/// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value
/// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96
function initialize(uint160 sqrtPriceX96) external;
/// @notice Adds liquidity for the given recipient/tickLower/tickUpper position
/// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback
/// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends
/// on tickLower, tickUpper, the amount of liquidity, and the current price.
/// @param recipient The address for which the liquidity will be created
/// @param tickLower The lower tick of the position in which to add liquidity
/// @param tickUpper The upper tick of the position in which to add liquidity
/// @param amount The amount of liquidity to mint
/// @param data Any data that should be passed through to the callback
/// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback
/// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback
function mint(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount,
bytes calldata data
) external returns (uint256 amount0, uint256 amount1);
/// @notice Collects tokens owed to a position
/// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.
/// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or
/// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the
/// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.
/// @param recipient The address which should receive the fees collected
/// @param tickLower The lower tick of the position for which to collect fees
/// @param tickUpper The upper tick of the position for which to collect fees
/// @param amount0Requested How much token0 should be withdrawn from the fees owed
/// @param amount1Requested How much token1 should be withdrawn from the fees owed
/// @return amount0 The amount of fees collected in token0
/// @return amount1 The amount of fees collected in token1
function collect(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount0Requested,
uint128 amount1Requested
) external returns (uint128 amount0, uint128 amount1);
/// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position
/// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0
/// @dev Fees must be collected separately via a call to #collect
/// @param tickLower The lower tick of the position for which to burn liquidity
/// @param tickUpper The upper tick of the position for which to burn liquidity
/// @param amount How much liquidity to burn
/// @return amount0 The amount of token0 sent to the recipient
/// @return amount1 The amount of token1 sent to the recipient
function burn(
int24 tickLower,
int24 tickUpper,
uint128 amount
) external returns (uint256 amount0, uint256 amount1);
/// @notice Swap token0 for token1, or token1 for token0
/// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback
/// @param recipient The address to receive the output of the swap
/// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0
/// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
/// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this
/// value after the swap. If one for zero, the price cannot be greater than this value after the swap
/// @param data Any data to be passed through to the callback
/// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive
/// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive
function swap(
address recipient,
bool zeroForOne,
int256 amountSpecified,
uint160 sqrtPriceLimitX96,
bytes calldata data
) external returns (int256 amount0, int256 amount1);
/// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback
/// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback
/// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling
/// with 0 amount{0,1} and sending the donation amount(s) from the callback
/// @param recipient The address which will receive the token0 and token1 amounts
/// @param amount0 The amount of token0 to send
/// @param amount1 The amount of token1 to send
/// @param data Any data to be passed through to the callback
function flash(
address recipient,
uint256 amount0,
uint256 amount1,
bytes calldata data
) external;
/// @notice Increase the maximum number of price and liquidity observations that this pool will store
/// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to
/// the input observationCardinalityNext.
/// @param observationCardinalityNext The desired minimum number of observations for the pool to store
function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;
}
// File contracts/Uniswap_V3/pool/IUniswapV3PoolOwnerActions.sol
/// @title Permissioned pool actions
/// @notice Contains pool methods that may only be called by the factory owner
interface IUniswapV3PoolOwnerActions {
/// @notice Set the denominator of the protocol's % share of the fees
/// @param feeProtocol0 new protocol fee for token0 of the pool
/// @param feeProtocol1 new protocol fee for token1 of the pool
function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;
/// @notice Collect the protocol fee accrued to the pool
/// @param recipient The address to which collected protocol fees should be sent
/// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1
/// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0
/// @return amount0 The protocol fee collected in token0
/// @return amount1 The protocol fee collected in token1
function collectProtocol(
address recipient,
uint128 amount0Requested,
uint128 amount1Requested
) external returns (uint128 amount0, uint128 amount1);
}
// File contracts/Uniswap_V3/pool/IUniswapV3PoolEvents.sol
/// @title Events emitted by a pool
/// @notice Contains all events emitted by the pool
interface IUniswapV3PoolEvents {
/// @notice Emitted exactly once by a pool when #initialize is first called on the pool
/// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize
/// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96
/// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool
event Initialize(uint160 sqrtPriceX96, int24 tick);
/// @notice Emitted when liquidity is minted for a given position
/// @param sender The address that minted the liquidity
/// @param owner The owner of the position and recipient of any minted liquidity
/// @param tickLower The lower tick of the position
/// @param tickUpper The upper tick of the position
/// @param amount The amount of liquidity minted to the position range
/// @param amount0 How much token0 was required for the minted liquidity
/// @param amount1 How much token1 was required for the minted liquidity
event Mint(
address sender,
address indexed owner,
int24 indexed tickLower,
int24 indexed tickUpper,
uint128 amount,
uint256 amount0,
uint256 amount1
);
/// @notice Emitted when fees are collected by the owner of a position
/// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees
/// @param owner The owner of the position for which fees are collected
/// @param tickLower The lower tick of the position
/// @param tickUpper The upper tick of the position
/// @param amount0 The amount of token0 fees collected
/// @param amount1 The amount of token1 fees collected
event Collect(
address indexed owner,
address recipient,
int24 indexed tickLower,
int24 indexed tickUpper,
uint128 amount0,
uint128 amount1
);
/// @notice Emitted when a position's liquidity is removed
/// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect
/// @param owner The owner of the position for which liquidity is removed
/// @param tickLower The lower tick of the position
/// @param tickUpper The upper tick of the position
/// @param amount The amount of liquidity to remove
/// @param amount0 The amount of token0 withdrawn
/// @param amount1 The amount of token1 withdrawn
event Burn(
address indexed owner,
int24 indexed tickLower,
int24 indexed tickUpper,
uint128 amount,
uint256 amount0,
uint256 amount1
);
/// @notice Emitted by the pool for any swaps between token0 and token1
/// @param sender The address that initiated the swap call, and that received the callback
/// @param recipient The address that received the output of the swap
/// @param amount0 The delta of the token0 balance of the pool
/// @param amount1 The delta of the token1 balance of the pool
/// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96
/// @param liquidity The liquidity of the pool after the swap
/// @param tick The log base 1.0001 of price of the pool after the swap
event Swap(
address indexed sender,
address indexed recipient,
int256 amount0,
int256 amount1,
uint160 sqrtPriceX96,
uint128 liquidity,
int24 tick
);
/// @notice Emitted by the pool for any flashes of token0/token1
/// @param sender The address that initiated the swap call, and that received the callback
/// @param recipient The address that received the tokens from flash
/// @param amount0 The amount of token0 that was flashed
/// @param amount1 The amount of token1 that was flashed
/// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee
/// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee
event Flash(
address indexed sender,
address indexed recipient,
uint256 amount0,
uint256 amount1,
uint256 paid0,
uint256 paid1
);
/// @notice Emitted by the pool for increases to the number of observations that can be stored
/// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index
/// just before a mint/swap/burn.
/// @param observationCardinalityNextOld The previous value of the next observation cardinality
/// @param observationCardinalityNextNew The updated value of the next observation cardinality
event IncreaseObservationCardinalityNext(
uint16 observationCardinalityNextOld,
uint16 observationCardinalityNextNew
);
/// @notice Emitted when the protocol fee is changed by the pool
/// @param feeProtocol0Old The previous value of the token0 protocol fee
/// @param feeProtocol1Old The previous value of the token1 protocol fee
/// @param feeProtocol0New The updated value of the token0 protocol fee
/// @param feeProtocol1New The updated value of the token1 protocol fee
event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);
/// @notice Emitted when the collected protocol fees are withdrawn by the factory owner
/// @param sender The address that collects the protocol fees
/// @param recipient The address that receives the collected protocol fees
/// @param amount0 The amount of token0 protocol fees that is withdrawn
/// @param amount0 The amount of token1 protocol fees that is withdrawn
event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);
}
// File contracts/Uniswap_V3/IUniswapV3Pool.sol
/// @title The interface for a Uniswap V3 Pool
/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform
/// to the ERC20 specification
/// @dev The pool interface is broken up into many smaller pieces
interface IUniswapV3Pool is
IUniswapV3PoolImmutables,
IUniswapV3PoolState,
IUniswapV3PoolDerivedState,
IUniswapV3PoolActions,
IUniswapV3PoolOwnerActions,
IUniswapV3PoolEvents
{
}
// File @uniswap/v3-core/contracts/interfaces/callback/[email protected]
/// @title Callback for IUniswapV3PoolActions#swap
/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface
interface IUniswapV3SwapCallback {
/// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.
/// @dev In the implementation you must pay the pool tokens owed for the swap.
/// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.
/// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.
/// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by
/// the end of the swap. If positive, the callback must send that amount of token0 to the pool.
/// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by
/// the end of the swap. If positive, the callback must send that amount of token1 to the pool.
/// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call
function uniswapV3SwapCallback(
int256 amount0Delta,
int256 amount1Delta,
bytes calldata data
) external;
}
// File contracts/Uniswap_V3/ISwapRouter.sol
/// @title Router token swapping functionality
/// @notice Functions for swapping tokens via Uniswap V3
interface ISwapRouter is IUniswapV3SwapCallback {
struct ExactInputSingleParams {
address tokenIn;
address tokenOut;
uint24 fee;
address recipient;
uint256 deadline;
uint256 amountIn;
uint256 amountOutMinimum;
uint160 sqrtPriceLimitX96;
}
/// @notice Swaps `amountIn` of one token for as much as possible of another token
/// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
/// @return amountOut The amount of the received token
function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut);
struct ExactInputParams {
bytes path;
address recipient;
uint256 deadline;
uint256 amountIn;
uint256 amountOutMinimum;
}
/// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path
/// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata
/// @return amountOut The amount of the received token
function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut);
struct ExactOutputSingleParams {
address tokenIn;
address tokenOut;
uint24 fee;
address recipient;
uint256 deadline;
uint256 amountOut;
uint256 amountInMaximum;
uint160 sqrtPriceLimitX96;
}
/// @notice Swaps as little as possible of one token for `amountOut` of another token
/// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata
/// @return amountIn The amount of the input token
function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn);
struct ExactOutputParams {
bytes path;
address recipient;
uint256 deadline;
uint256 amountOut;
uint256 amountInMaximum;
}
/// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)
/// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata
/// @return amountIn The amount of the input token
function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn);
}
// File contracts/Oracle/ComboOracle_UniV2_UniV3.sol
// ====================================================================
// | ______ _______ |
// | / _____________ __ __ / ____(_____ ____ _____ ________ |
// | / /_ / ___/ __ `| |/_/ / /_ / / __ \/ __ `/ __ \/ ___/ _ \ |
// | / __/ / / / /_/ _> < / __/ / / / / / /_/ / / / / /__/ __/ |
// | /_/ /_/ \__,_/_/|_| /_/ /_/_/ /_/\__,_/_/ /_/\___/\___/ |
// | |
// ====================================================================
// ===================== ComboOracle_UniV2_UniV3 ======================
// ====================================================================
// Aggregates prices for SLP, UniV2, and UniV3 style LP tokens
// Frax Finance: https://github.com/FraxFinance
// Primary Author(s)
// Travis Moore: https://github.com/FortisFortuna
// Reviewer(s) / Contributor(s)
// Jason Huan: https://github.com/jasonhuan
// Sam Kazemian: https://github.com/samkazemian
// ComboOracle
// UniV2 / SLP
// UniV3
contract ComboOracle_UniV2_UniV3 is Owned {
using SafeMath for uint256;
using HomoraMath for uint256;
/* ========== STATE VARIABLES ========== */
// Core addresses
address timelock_address;
address public frax_address;
address public fxs_address;
// Oracle info
ComboOracle public combo_oracle;
// UniV2 / SLP
IUniswapV2Router02 public router;
// UniV3
IUniswapV3Factory public univ3_factory;
INonfungiblePositionManager public univ3_positions;
ISwapRouter public univ3_router;
// Precision
uint256 public PRECISE_PRICE_PRECISION = 1e18;
uint256 public PRICE_PRECISION = 1e6;
uint256 public PRICE_MISSING_MULTIPLIER = 1e12;
/* ========== STRUCTS ========== */
// ------------ UniV2 ------------
struct UniV2LPBasicInfo {
address lp_address;
string token_name;
string token_symbol;
address token0;
address token1;
uint256 token0_decimals;
uint256 token1_decimals;
uint256 token0_reserves;
uint256 token1_reserves;
uint256 lp_total_supply;
}
struct UniV2PriceInfo {
uint256 precise_price;
uint256 short_price;
string token_symbol;
string token_name;
string token0_symbol;
string token1_symbol;
}
// ------------ UniV3 ------------
struct UniV3NFTBasicInfo {
address token0;
address token1;
uint24 fee;
int24 tickLower;
int24 tickUpper;
uint128 liquidity;
uint256 token0_decimals;
uint256 token1_decimals;
uint256 lowest_decimals;
}
struct UniV3NFTValueInfo {
uint256 token0_value;
uint256 token1_value;
uint256 total_value;
string token0_symbol;
string token1_symbol;
uint256 liquidity_price;
}
/* ========== CONSTRUCTOR ========== */
constructor (
address _owner_address,
address[] memory _starting_addresses
) Owned(_owner_address) {
// Core addresses
frax_address = _starting_addresses[0];
fxs_address = _starting_addresses[1];
// Oracle info
combo_oracle = ComboOracle(_starting_addresses[2]);
// UniV2 / SLP
router = IUniswapV2Router02(_starting_addresses[3]);
// UniV3
univ3_factory = IUniswapV3Factory(_starting_addresses[4]);
univ3_positions = INonfungiblePositionManager(_starting_addresses[5]);
univ3_router = ISwapRouter(_starting_addresses[6]);
}
/* ========== MODIFIERS ========== */
modifier onlyByOwnGov() {
require(msg.sender == owner || msg.sender == timelock_address, "You are not an owner or the governance timelock");
_;
}
/* ========== VIEWS ========== */
// UniV2 / SLP Info
function uniV2LPBasicInfo(address pair_address) public view returns (UniV2LPBasicInfo memory) {
// Instantiate the pair
IUniswapV2Pair the_pair = IUniswapV2Pair(pair_address);
// Get the reserves
(uint256 reserve0, uint256 reserve1, ) = (the_pair.getReserves());
// Get the token1 address
address token0 = the_pair.token0();
address token1 = the_pair.token1();
// Return
return UniV2LPBasicInfo(
pair_address, // [0]
the_pair.name(), // [1]
the_pair.symbol(), // [2]
token0, // [3]
token1, // [4]
ERC20(token0).decimals(), // [5]
ERC20(token1).decimals(), // [6]
reserve0, // [7]
reserve1, // [8]
the_pair.totalSupply() // [9]
);
}
// UniV2 / SLP LP Token Price
// Alpha Homora Fair LP Pricing Method (flash loan resistant)
// https://cmichel.io/pricing-lp-tokens/
// https://blog.alphafinance.io/fair-lp-token-pricing/
// https://github.com/AlphaFinanceLab/alpha-homora-v2-contract/blob/master/contracts/oracle/UniswapV2Oracle.sol
function uniV2LPPriceInfo(address lp_token_address) public view returns (UniV2PriceInfo memory) {
// Get info about the LP token
UniV2LPBasicInfo memory lp_basic_info = uniV2LPBasicInfo(lp_token_address);
// Get the price of ETH in USD
uint256 eth_price = combo_oracle.getETHPricePrecise();
// Alpha Homora method
uint256 precise_price;
{
uint sqrtK = HomoraMath.sqrt(lp_basic_info.token0_reserves * lp_basic_info.token1_reserves).fdiv(lp_basic_info.lp_total_supply); // in 2**112
uint px0 = combo_oracle.getETHPx112(lp_basic_info.token0); // in 2**112
uint px1 = combo_oracle.getETHPx112(lp_basic_info.token1); // in 2**112
// fair token0 amt: sqrtK * sqrt(px1/px0)
// fair token1 amt: sqrtK * sqrt(px0/px1)
// fair lp price = 2 * sqrt(px0 * px1)
// split into 2 sqrts multiplication to prevent uint overflow (note the 2**112)
// In ETH per unit of LP, multiplied by 2**112.
uint256 precise_price_eth112 = (((sqrtK * 2 * HomoraMath.sqrt(px0)) / (2 ** 56)) * HomoraMath.sqrt(px1)) / (2 ** 56);
// In USD
// Split into 2 parts to avoid overflows
uint256 precise_price56 = precise_price_eth112 / (2 ** 56);
precise_price = (precise_price56 * eth_price) / (2 ** 56);
}
return UniV2PriceInfo(
precise_price, // [0]
precise_price / PRICE_MISSING_MULTIPLIER, // [1]
lp_basic_info.token_symbol, // [2]
lp_basic_info.token_name, // [3]
ERC20(lp_basic_info.token0).symbol(), // [4]
ERC20(lp_basic_info.token1).symbol() // [5]
);
}
// UniV2 / SLP LP Token Price
// Reserves method
function uniV2LPPriceInfoViaReserves(address lp_token_address) public view returns (UniV2PriceInfo memory) {
// Get info about the LP token
UniV2LPBasicInfo memory lp_basic_info = uniV2LPBasicInfo(lp_token_address);
// Get the price of one of the tokens. Try token0 first.
// After that, multiply the price by the reserves, then scale to E18
// Then multiply by 2 since both sides are equal dollar value
// Then divide the the total number of LP tokens
uint256 precise_price;
if (combo_oracle.has_info(lp_basic_info.token0)){
(uint256 token_precise_price, , ) = combo_oracle.getTokenPrice(lp_basic_info.token0);
// Multiply by 2 because each token is half of the TVL
precise_price = (2 * token_precise_price * lp_basic_info.token0_reserves) / lp_basic_info.lp_total_supply;
// Scale to E18
precise_price *= (10 ** (uint(18) - lp_basic_info.token0_decimals));
}
else {
(uint256 token_precise_price, , ) = combo_oracle.getTokenPrice(lp_basic_info.token1);
// Multiply by 2 because each token is half of the TVL
precise_price = (2 * token_precise_price * lp_basic_info.token1_reserves) / lp_basic_info.lp_total_supply;
// Scale to E18
precise_price *= (10 ** (uint(18) - lp_basic_info.token1_decimals));
}
return UniV2PriceInfo(
precise_price, // [0]
precise_price / PRICE_MISSING_MULTIPLIER, // [1]
lp_basic_info.token_symbol, // [2]
lp_basic_info.token_name, // [3]
ERC20(lp_basic_info.token0).symbol(), // [4]
ERC20(lp_basic_info.token1).symbol() // [5]
);
}
function getUniV3NFTBasicInfo(uint256 token_id) public view returns (UniV3NFTBasicInfo memory) {
// Get the position information
(
, // [0]
, // [1]
address token0, // [2]
address token1, // [3]
uint24 fee, // [4]
int24 tickLower, // [5]
int24 tickUpper, // [6]
uint128 liquidity, // [7]
, // [8]
, // [9]
, // [10]
// [11]
) = univ3_positions.positions(token_id);
// Get decimals
uint256 tkn0_dec = ERC20(token0).decimals();
uint256 tkn1_dec = ERC20(token1).decimals();
return UniV3NFTBasicInfo(
token0, // [0]
token1, // [1]
fee, // [2]
tickLower, // [3]
tickUpper, // [4]
liquidity, // [5]
tkn0_dec, // [6]
tkn1_dec, // [7]
(tkn0_dec < tkn1_dec) ? tkn0_dec : tkn1_dec // [8]
);
}
// Get stats about a particular UniV3 NFT
function getUniV3NFTValueInfo(uint256 token_id) public view returns (UniV3NFTValueInfo memory) {
UniV3NFTBasicInfo memory lp_basic_info = getUniV3NFTBasicInfo(token_id);
// Get pool price info
uint160 sqrtPriceX96;
{
address pool_address = univ3_factory.getPool(lp_basic_info.token0, lp_basic_info.token1, lp_basic_info.fee);
IUniswapV3Pool the_pool = IUniswapV3Pool(pool_address);
(sqrtPriceX96, , , , , , ) = the_pool.slot0();
}
// Tick math
uint256 token0_val_usd = 0;
uint256 token1_val_usd = 0;
{
// Get the amount of each underlying token in each NFT
uint160 sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(lp_basic_info.tickLower);
uint160 sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(lp_basic_info.tickUpper);
// Get amount of each token for 0.1% liquidity movement in each direction (1 per mille)
uint256 liq_pricing_divisor = (10 ** lp_basic_info.lowest_decimals);
(uint256 token0_1pm_amt, uint256 token1_1pm_amt) = LiquidityAmounts.getAmountsForLiquidity(sqrtPriceX96, sqrtRatioAX96, sqrtRatioBX96, uint128(lp_basic_info.liquidity / liq_pricing_divisor));
// Get missing decimals
uint256 token0_miss_dec_mult = 10 ** (uint(18) - lp_basic_info.token0_decimals);
uint256 token1_miss_dec_mult = 10 ** (uint(18) - lp_basic_info.token1_decimals);
// Get token prices
// Will revert if ComboOracle doesn't have a price for both token0 and token1
(uint256 token0_precise_price, , ) = combo_oracle.getTokenPrice(lp_basic_info.token0);
(uint256 token1_precise_price, , ) = combo_oracle.getTokenPrice(lp_basic_info.token1);
// Get the value of each portion
// Multiply by liq_pricing_divisor as well
token0_val_usd = (token0_1pm_amt * liq_pricing_divisor * token0_precise_price * token0_miss_dec_mult) / PRECISE_PRICE_PRECISION;
token1_val_usd = (token1_1pm_amt * liq_pricing_divisor * token1_precise_price * token1_miss_dec_mult) / PRECISE_PRICE_PRECISION;
}
// Return the total value of the UniV3 NFT
uint256 nft_ttl_val = (token0_val_usd + token1_val_usd);
// Return
return UniV3NFTValueInfo(
token0_val_usd,
token1_val_usd,
nft_ttl_val,
ERC20(lp_basic_info.token0).symbol(),
ERC20(lp_basic_info.token1).symbol(),
(uint256(lp_basic_info.liquidity) * PRECISE_PRICE_PRECISION) / nft_ttl_val
);
}
/* ========== RESTRICTED GOVERNANCE FUNCTIONS ========== */
function setTimelock(address _timelock_address) external onlyByOwnGov {
timelock_address = _timelock_address;
}
function setComboOracle(address _combo_oracle) external onlyByOwnGov {
combo_oracle = ComboOracle(_combo_oracle);
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_owner_address","type":"address"},{"internalType":"address[]","name":"_starting_addresses","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"inputs":[],"name":"PRECISE_PRICE_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE_MISSING_MULTIPLIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"combo_oracle","outputs":[{"internalType":"contract ComboOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"frax_address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fxs_address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"token_id","type":"uint256"}],"name":"getUniV3NFTBasicInfo","outputs":[{"components":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"token0_decimals","type":"uint256"},{"internalType":"uint256","name":"token1_decimals","type":"uint256"},{"internalType":"uint256","name":"lowest_decimals","type":"uint256"}],"internalType":"struct ComboOracle_UniV2_UniV3.UniV3NFTBasicInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"token_id","type":"uint256"}],"name":"getUniV3NFTValueInfo","outputs":[{"components":[{"internalType":"uint256","name":"token0_value","type":"uint256"},{"internalType":"uint256","name":"token1_value","type":"uint256"},{"internalType":"uint256","name":"total_value","type":"uint256"},{"internalType":"string","name":"token0_symbol","type":"string"},{"internalType":"string","name":"token1_symbol","type":"string"},{"internalType":"uint256","name":"liquidity_price","type":"uint256"}],"internalType":"struct ComboOracle_UniV2_UniV3.UniV3NFTValueInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"nominateNewOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_combo_oracle","type":"address"}],"name":"setComboOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_timelock_address","type":"address"}],"name":"setTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pair_address","type":"address"}],"name":"uniV2LPBasicInfo","outputs":[{"components":[{"internalType":"address","name":"lp_address","type":"address"},{"internalType":"string","name":"token_name","type":"string"},{"internalType":"string","name":"token_symbol","type":"string"},{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint256","name":"token0_decimals","type":"uint256"},{"internalType":"uint256","name":"token1_decimals","type":"uint256"},{"internalType":"uint256","name":"token0_reserves","type":"uint256"},{"internalType":"uint256","name":"token1_reserves","type":"uint256"},{"internalType":"uint256","name":"lp_total_supply","type":"uint256"}],"internalType":"struct ComboOracle_UniV2_UniV3.UniV2LPBasicInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"lp_token_address","type":"address"}],"name":"uniV2LPPriceInfo","outputs":[{"components":[{"internalType":"uint256","name":"precise_price","type":"uint256"},{"internalType":"uint256","name":"short_price","type":"uint256"},{"internalType":"string","name":"token_symbol","type":"string"},{"internalType":"string","name":"token_name","type":"string"},{"internalType":"string","name":"token0_symbol","type":"string"},{"internalType":"string","name":"token1_symbol","type":"string"}],"internalType":"struct ComboOracle_UniV2_UniV3.UniV2PriceInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"lp_token_address","type":"address"}],"name":"uniV2LPPriceInfoViaReserves","outputs":[{"components":[{"internalType":"uint256","name":"precise_price","type":"uint256"},{"internalType":"uint256","name":"short_price","type":"uint256"},{"internalType":"string","name":"token_symbol","type":"string"},{"internalType":"string","name":"token_name","type":"string"},{"internalType":"string","name":"token0_symbol","type":"string"},{"internalType":"string","name":"token1_symbol","type":"string"}],"internalType":"struct ComboOracle_UniV2_UniV3.UniV2PriceInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"univ3_factory","outputs":[{"internalType":"contract IUniswapV3Factory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"univ3_positions","outputs":[{"internalType":"contract INonfungiblePositionManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"univ3_router","outputs":[{"internalType":"contract ISwapRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
6080604052670de0b6b3a7640000600a55620f4240600b5564e8d4a51000600c553480156200002d57600080fd5b50604051620037f3380380620037f383398101604081905262000050916200031b565b816001600160a01b038116620000ac5760405162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015260640160405180910390fd5b600080546001600160a01b0319166001600160a01b03831690811782556040805192835260208301919091527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c910160405180910390a150806000815181106200011a576200011a62000404565b6020026020010151600360006101000a8154816001600160a01b0302191690836001600160a01b03160217905550806001815181106200015e576200015e62000404565b6020026020010151600460006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080600281518110620001a257620001a262000404565b6020026020010151600560006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080600381518110620001e657620001e662000404565b6020026020010151600660006101000a8154816001600160a01b0302191690836001600160a01b03160217905550806004815181106200022a576200022a62000404565b6020026020010151600760006101000a8154816001600160a01b0302191690836001600160a01b03160217905550806005815181106200026e576200026e62000404565b6020026020010151600860006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080600681518110620002b257620002b262000404565b6020026020010151600960006101000a8154816001600160a01b0302191690836001600160a01b0316021790555050506200041a565b80516001600160a01b03811681146200030057600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156200032f57600080fd5b6200033a83620002e8565b602084810151919350906001600160401b03808211156200035a57600080fd5b818601915086601f8301126200036f57600080fd5b81518181111562000384576200038462000305565b8060051b604051601f19603f83011681018181108582111715620003ac57620003ac62000305565b604052918252848201925083810185019189831115620003cb57600080fd5b938501935b82851015620003f457620003e485620002e8565b84529385019392850192620003d0565b8096505050505050509250929050565b634e487b7160e01b600052603260045260246000fd5b6133c9806200042a6000396000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c80638292fd84116100d8578063bdacb3031161008c578063e194c7c511610066578063e194c7c51461037f578063e5c0f84c14610392578063f887ea40146103a557600080fd5b8063bdacb3031461032c578063c8fae1a51461033f578063d40c61a11461035f57600080fd5b806395082d25116100bd57806395082d25146102e35780639a10e958146102ec578063b497d8ca1461030c57600080fd5b80638292fd84146102a35780638da5cb5b146102c357600080fd5b8063462d3a491161012f5780635531981711610114578063553198171461025b578063557b4a091461027b57806379ba50971461029b57600080fd5b8063462d3a491461023257806353a47bb71461023b57600080fd5b806319421ca61161016057806319421ca6146101db5780631baf1682146101f25780632ff7455f1461021257600080fd5b80630a25ef4b1461017c5780631627540c146101c6575b600080fd5b60035461019c9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6101d96101d4366004612924565b6103c5565b005b6101e4600a5481565b6040519081526020016101bd565b60075461019c9073ffffffffffffffffffffffffffffffffffffffff1681565b610225610220366004612941565b6104ea565b6040516101bd919061295a565b6101e4600c5481565b60015461019c9073ffffffffffffffffffffffffffffffffffffffff1681565b60055461019c9073ffffffffffffffffffffffffffffffffffffffff1681565b61028e610289366004612924565b610773565b6040516101bd9190612a90565b6101d9610c8f565b60095461019c9073ffffffffffffffffffffffffffffffffffffffff1681565b60005461019c9073ffffffffffffffffffffffffffffffffffffffff1681565b6101e4600b5481565b6102ff6102fa366004612941565b610dda565b6040516101bd9190612ba2565b60085461019c9073ffffffffffffffffffffffffffffffffffffffff1681565b6101d961033a366004612924565b611343565b60045461019c9073ffffffffffffffffffffffffffffffffffffffff1681565b61037261036d366004612924565b611453565b6040516101bd9190612c2e565b6101d961038d366004612924565b6118a2565b6103726103a0366004612924565b6119b2565b60065461019c9073ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314610471576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201527f6f726d207468697320616374696f6e000000000000000000000000000000000060648201526084015b60405180910390fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229060200160405180910390a150565b6040805161012081018252600080825260208201819052818301819052606082018190526080820181905260a0820181905260c0820181905260e08201819052610100820181905260085492517f99fbab8800000000000000000000000000000000000000000000000000000000815260048101859052919290918291829182918291829173ffffffffffffffffffffffffffffffffffffffff16906399fbab889060240161018060405180830381865afa1580156105ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d19190612d2a565b50505050975097509750975097509750505060008673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610630573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106549190612e1c565b60ff16905060008673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ca9190612e1c565b60ff1690506040518061012001604052808973ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1681526020018762ffffff1681526020018660020b81526020018560020b8152602001846fffffffffffffffffffffffffffffffff1681526020018381526020018281526020018284106107615782610763565b835b90529a9950505050505050505050565b61080b604051806101400160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016060815260200160608152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600081525090565b60008290506000808273ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa15801561085e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108829190612e55565b506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff16915060008373ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109189190612ea5565b905060008473ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610967573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098b9190612ea5565b90506040518061014001604052808873ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa158015610a00573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610a469190810190612ef1565b81526020018673ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015610a96573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610adc9190810190612ef1565b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b889190612e1c565b60ff1681526020018273ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bdb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bff9190612e1c565b60ff1681526020018581526020018481526020018673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c829190612fbc565b9052979650505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610d36576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7560448201527f2063616e20616363657074206f776e65727368697000000000000000000000006064820152608401610468565b6000546001546040805173ffffffffffffffffffffffffffffffffffffffff93841681529290911660208301527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c910160405180910390a160018054600080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff841617909155169055565b610e136040518060c001604052806000815260200160008152602001600081526020016060815260200160608152602001600081525090565b6000610e1e836104ea565b6007548151602083015160408085015190517f1698ee8200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9384166004820152918316602483015262ffffff16604482015292935060009283929190911690631698ee8290606401602060405180830381865afa158015610eb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed99190612ea5565b905060008190508073ffffffffffffffffffffffffffffffffffffffff16633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610f2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4f9190612ff7565b505050506060870151929550600094508493508392610f7092509050611e01565b90506000610f818660800151611e01565b90506000866101000151600a610f9791906131ce565b9050600080610fc9888686868d60a001516fffffffffffffffffffffffffffffffff16610fc49190613209565b61229b565b9150915060008960c001516012610fe0919061321d565b610feb90600a6131ce565b905060008a60e001516012611000919061321d565b61100b90600a6131ce565b6005548c516040517fd02641a000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff918216600482015292935060009291169063d02641a090602401606060405180830381865afa158015611082573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a69190613234565b505060055460208e01516040517fd02641a000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff918216600482015292935060009291169063d02641a090602401606060405180830381865afa158015611122573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111469190613234565b5050600a54909150848361115a8a8a613262565b6111649190613262565b61116e9190613262565b6111789190613209565b600a54909b50838261118a8a89613262565b6111949190613262565b61119e9190613262565b6111a89190613209565b9950505050505050505050600081836111c1919061329f565b90506040518060c00160405280848152602001838152602001828152602001866000015173ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801561122f573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526112759190810190612ef1565b8152602001866020015173ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa1580156112c9573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261130f9190810190612ef1565b815260200182600a548860a001516fffffffffffffffffffffffffffffffff166113399190613262565b610c829190613209565b60005473ffffffffffffffffffffffffffffffffffffffff16331480611380575060025473ffffffffffffffffffffffffffffffffffffffff1633145b61140c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f596f7520617265206e6f7420616e206f776e6572206f722074686520676f766560448201527f726e616e63652074696d656c6f636b00000000000000000000000000000000006064820152608401610468565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61148c6040518060c001604052806000815260200160008152602001606081526020016060815260200160608152602001606081525090565b600061149783610773565b90506000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633179fabc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611508573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152c9190612fbc565b905060008061155d8461012001516115578661010001518760e001516115529190613262565b612385565b90612510565b60055460608601516040517f8020d2ce00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152929350600092911690638020d2ce90602401602060405180830381865afa1580156115d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fb9190612fbc565b60055460808701516040517f8020d2ce00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152929350600092911690638020d2ce90602401602060405180830381865afa158015611675573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116999190612fbc565b905060006701000000000000006116af83612385565b6701000000000000006116c186612385565b6116cc886002613262565b6116d69190613262565b6116e09190613209565b6116ea9190613262565b6116f49190613209565b9050600061170a67010000000000000083613209565b905067010000000000000061171f8883613262565b6117299190613209565b955050505050506040518060c00160405280828152602001600c548361174f9190613209565b81526020018460400151815260200184602001518152602001846060015173ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa1580156117b7573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526117fd9190810190612ef1565b8152602001846080015173ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015611851573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526118979190810190612ef1565b905295945050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314806118df575060025473ffffffffffffffffffffffffffffffffffffffff1633145b61196b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f596f7520617265206e6f7420616e206f776e6572206f722074686520676f766560448201527f726e616e63652074696d656c6f636b00000000000000000000000000000000006064820152608401610468565b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6119eb6040518060c001604052806000815260200160008152602001606081526020016060815260200160608152602001606081525090565b60006119f683610773565b60055460608201516040517f4db769ad00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152929350600092911690634db769ad90602401602060405180830381865afa158015611a70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a9491906132b7565b15611b965760055460608301516040517fd02641a000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152600092919091169063d02641a090602401606060405180830381865afa158015611b12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b369190613234565b505090508261012001518360e00151826002611b529190613262565b611b5c9190613262565b611b669190613209565b91508260a001516012611b79919061321d565b611b8490600a6131ce565b611b8e9083613262565b915050611c90565b60055460808301516040517fd02641a000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152600092919091169063d02641a090602401606060405180830381865afa158015611c0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c339190613234565b50509050826101200151836101000151826002611c509190613262565b611c5a9190613262565b611c649190613209565b91508260c001516012611c77919061321d565b611c8290600a6131ce565b611c8c9083613262565b9150505b6040518060c00160405280828152602001600c5483611caf9190613209565b81526020018360400151815260200183602001518152602001836060015173ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015611d17573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611d5d9190810190612ef1565b8152602001836080015173ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015611db1573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611df79190810190612ef1565b9052949350505050565b60008060008360020b12611e18578260020b611e25565b8260020b611e25906132d2565b9050611e507ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2761861330b565b60020b811315611ebc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600160248201527f54000000000000000000000000000000000000000000000000000000000000006044820152606401610468565b600060018216611edd57700100000000000000000000000000000000611eef565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff1690506002821615611f2e576080611f29826ffff97272373d413259a46990580e213a613262565b901c90505b6004821615611f58576080611f53826ffff2e50f5f656932ef12357cf3c7fdcc613262565b901c90505b6008821615611f82576080611f7d826fffe5caca7e10e4e61c3624eaa0941cd0613262565b901c90505b6010821615611fac576080611fa7826fffcb9843d60f6159c9db58835c926644613262565b901c90505b6020821615611fd6576080611fd1826fff973b41fa98c081472e6896dfb254c0613262565b901c90505b6040821615612000576080611ffb826fff2ea16466c96a3843ec78b326b52861613262565b901c90505b608082161561202a576080612025826ffe5dee046a99a2a811c461f1969c3053613262565b901c90505b610100821615612055576080612050826ffcbe86c7900a88aedcffc83b479aa3a4613262565b901c90505b61020082161561208057608061207b826ff987a7253ac413176f2b074cf7815e54613262565b901c90505b6104008216156120ab5760806120a6826ff3392b0822b70005940c7a398e4b70f3613262565b901c90505b6108008216156120d65760806120d1826fe7159475a2c29b7443b29c7fa6e889d9613262565b901c90505b6110008216156121015760806120fc826fd097f3bdfd2022b8845ad8f792aa5825613262565b901c90505b61200082161561212c576080612127826fa9f746462d870fdf8a65dc1f90e061e5613262565b901c90505b614000821615612157576080612152826f70d869a156d2a1b890bb3df62baf32f7613262565b901c90505b61800082161561218257608061217d826f31be135f97d08fd981231505542fcfa6613262565b901c90505b620100008216156121ae5760806121a9826f09aa508b5b7a84e1c677de54f3e99bc9613262565b901c90505b620200008216156121d95760806121d4826e5d6af8dedb81196699c329225ee604613262565b901c90505b620400008216156122035760806121fe826d2216e584f5fa1ea926041bedfe98613262565b901c90505b6208000082161561222b576080612226826b048a170391f7dc42444e8fa2613262565b901c90505b60008460020b131561226457612261817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff613209565b90505b6122736401000000008261334a565b1561227f576001612282565b60005b6122939060ff16602083901c61329f565b949350505050565b6000808373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1611156122d6579293925b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161161231b5761231485858561253f565b915061237c565b8373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16101561236e5761235a86858561253f565b9150612367858785612606565b905061237c565b612379858585612606565b90505b94509492505050565b60008161239457506000919050565b81600170010000000000000000000000000000000082106123ba5760809190911c9060401b5b6801000000000000000082106123d55760409190911c9060201b5b64010000000082106123ec5760209190911c9060101b5b6201000082106124015760109190911c9060081b5b61010082106124155760089190911c9060041b5b601082106124285760049190911c9060021b5b600882106124345760011b5b60016124408286613209565b61244a908361329f565b901c9050600161245a8286613209565b612464908361329f565b901c905060016124748286613209565b61247e908361329f565b901c9050600161248e8286613209565b612498908361329f565b901c905060016124a88286613209565b6124b2908361329f565b901c905060016124c28286613209565b6124cc908361329f565b901c905060016124dc8286613209565b6124e6908361329f565b901c905060006124f68286613209565b90508082106125055780612507565b815b95945050505050565b60008161252c846e010000000000000000000000000000612689565b6125369190613209565b90505b92915050565b60008273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161115612579579192915b73ffffffffffffffffffffffffffffffffffffffff84166125f27bffffffffffffffffffffffffffffffff000000000000000000000000606085901b166125c0878761335e565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1661273e565b6125fc9190613209565b90505b9392505050565b60008273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161115612640579192915b6125fc6fffffffffffffffffffffffffffffffff8316612660868661335e565b73ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000061273e565b60008261269857506000612539565b60006126a48385613262565b9050826126b18583613209565b14612536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60448201527f77000000000000000000000000000000000000000000000000000000000000006064820152608401610468565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8587098587029250828110838203039150508060001415612796576000841161278b57600080fd5b5082900490506125ff565b8084116127a257600080fd5b6000848688098084039381119092039190506000856127e1817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61321d565b6127ec90600161329f565b1695869004959384900493600081900304600101905061280c8184613262565b90931792600061281d876003613262565b600218905061282c8188613262565b61283790600261321d565b6128419082613262565b905061284d8188613262565b61285890600261321d565b6128629082613262565b905061286e8188613262565b61287990600261321d565b6128839082613262565b905061288f8188613262565b61289a90600261321d565b6128a49082613262565b90506128b08188613262565b6128bb90600261321d565b6128c59082613262565b90506128d18188613262565b6128dc90600261321d565b6128e69082613262565b90506128f28186613262565b9998505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461292157600080fd5b50565b60006020828403121561293657600080fd5b8135612536816128ff565b60006020828403121561295357600080fd5b5035919050565b60006101208201905073ffffffffffffffffffffffffffffffffffffffff8084511683528060208501511660208401525060408301516129a1604084018262ffffff169052565b5060608301516129b6606084018260020b9052565b5060808301516129cb608084018260020b9052565b5060a08301516129ef60a08401826fffffffffffffffffffffffffffffffff169052565b5060c083015160c083015260e083015160e083015261010080840151818401525092915050565b60005b83811015612a31578181015183820152602001612a19565b83811115612a40576000848401525b50505050565b60008151808452612a5e816020860160208601612a16565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152612ab760208201835173ffffffffffffffffffffffffffffffffffffffff169052565b60006020830151610140806040850152612ad5610160850183612a46565b915060408501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0858403016060860152612b108382612a46565b9250506060850151612b3a608086018273ffffffffffffffffffffffffffffffffffffffff169052565b50608085015173ffffffffffffffffffffffffffffffffffffffff811660a08601525060a085015160c085015260c085015160e085015260e0850151610100818187015280870151915050610120818187015280870151838701525050508091505092915050565b602081528151602082015260208201516040820152604082015160608201526000606083015160c06080840152612bdc60e0840182612a46565b905060808401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08483030160a0850152612c178282612a46565b91505060a084015160c08401528091505092915050565b6020815281516020820152602082015160408201526000604083015160c06060840152612c5e60e0840182612a46565b905060608401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe080858403016080860152612c9a8383612a46565b925060808601519150808584030160a0860152612cb78383612a46565b925060a08601519150808584030160c0860152506125078282612a46565b8051612ce0816128ff565b919050565b805162ffffff81168114612ce057600080fd5b8051600281900b8114612ce057600080fd5b80516fffffffffffffffffffffffffffffffff81168114612ce057600080fd5b6000806000806000806000806000806000806101808d8f031215612d4d57600080fd5b8c516bffffffffffffffffffffffff81168114612d6957600080fd5b9b50612d7760208e01612cd5565b9a50612d8560408e01612cd5565b9950612d9360608e01612cd5565b9850612da160808e01612ce5565b9750612daf60a08e01612cf8565b9650612dbd60c08e01612cf8565b9550612dcb60e08e01612d0a565b94506101008d015193506101208d01519250612dea6101408e01612d0a565b9150612df96101608e01612d0a565b90509295989b509295989b509295989b565b805160ff81168114612ce057600080fd5b600060208284031215612e2e57600080fd5b61253682612e0b565b80516dffffffffffffffffffffffffffff81168114612ce057600080fd5b600080600060608486031215612e6a57600080fd5b612e7384612e37565b9250612e8160208501612e37565b9150604084015163ffffffff81168114612e9a57600080fd5b809150509250925092565b600060208284031215612eb757600080fd5b8151612536816128ff565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060208284031215612f0357600080fd5b815167ffffffffffffffff80821115612f1b57600080fd5b818401915084601f830112612f2f57600080fd5b815181811115612f4157612f41612ec2565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715612f8757612f87612ec2565b81604052828152876020848701011115612fa057600080fd5b612fb1836020830160208801612a16565b979650505050505050565b600060208284031215612fce57600080fd5b5051919050565b805161ffff81168114612ce057600080fd5b80518015158114612ce057600080fd5b600080600080600080600060e0888a03121561301257600080fd5b875161301d816128ff565b965061302b60208901612cf8565b955061303960408901612fd5565b945061304760608901612fd5565b935061305560808901612fd5565b925061306360a08901612e0b565b915061307160c08901612fe7565b905092959891949750929550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600181815b8085111561310757817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156130ed576130ed61307f565b808516156130fa57918102915b93841c93908002906130b3565b509250929050565b60008261311e57506001612539565b8161312b57506000612539565b8160018114613141576002811461314b57613167565b6001915050612539565b60ff84111561315c5761315c61307f565b50506001821b612539565b5060208310610133831016604e8410600b841016171561318a575081810a612539565b61319483836130ae565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156131c6576131c661307f565b029392505050565b6000612536838361310f565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082613218576132186131da565b500490565b60008282101561322f5761322f61307f565b500390565b60008060006060848603121561324957600080fd5b8351925060208401519150604084015190509250925092565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561329a5761329a61307f565b500290565b600082198211156132b2576132b261307f565b500190565b6000602082840312156132c957600080fd5b61253682612fe7565b60007f80000000000000000000000000000000000000000000000000000000000000008214156133045761330461307f565b5060000390565b60008160020b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8000008114156133415761334161307f565b60000392915050565b600082613359576133596131da565b500690565b600073ffffffffffffffffffffffffffffffffffffffff8381169083168181101561338b5761338b61307f565b03939250505056fea2646970667358221220c7bce0590dabc2a880f955118b7291474da82e824ec9dd9a6cfc1c5a00a9abaf64736f6c634300080a0033000000000000000000000000104e5d38a2d646ffaf936d0a4af876e56b5b14b300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000007000000000000000000000000322e86852e492a7ee17f28a78c663da38fb33bfb0000000000000000000000002cc0a9d8047a5011defe85328a6f26968c8aaa1c000000000000000000000000247a323daa63cc97c2bad61b4d6f1e0120b5c9e20000000000000000000000007a3909c7996efe42d425cd932fc44e3840fcab71000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101775760003560e01c80638292fd84116100d8578063bdacb3031161008c578063e194c7c511610066578063e194c7c51461037f578063e5c0f84c14610392578063f887ea40146103a557600080fd5b8063bdacb3031461032c578063c8fae1a51461033f578063d40c61a11461035f57600080fd5b806395082d25116100bd57806395082d25146102e35780639a10e958146102ec578063b497d8ca1461030c57600080fd5b80638292fd84146102a35780638da5cb5b146102c357600080fd5b8063462d3a491161012f5780635531981711610114578063553198171461025b578063557b4a091461027b57806379ba50971461029b57600080fd5b8063462d3a491461023257806353a47bb71461023b57600080fd5b806319421ca61161016057806319421ca6146101db5780631baf1682146101f25780632ff7455f1461021257600080fd5b80630a25ef4b1461017c5780631627540c146101c6575b600080fd5b60035461019c9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6101d96101d4366004612924565b6103c5565b005b6101e4600a5481565b6040519081526020016101bd565b60075461019c9073ffffffffffffffffffffffffffffffffffffffff1681565b610225610220366004612941565b6104ea565b6040516101bd919061295a565b6101e4600c5481565b60015461019c9073ffffffffffffffffffffffffffffffffffffffff1681565b60055461019c9073ffffffffffffffffffffffffffffffffffffffff1681565b61028e610289366004612924565b610773565b6040516101bd9190612a90565b6101d9610c8f565b60095461019c9073ffffffffffffffffffffffffffffffffffffffff1681565b60005461019c9073ffffffffffffffffffffffffffffffffffffffff1681565b6101e4600b5481565b6102ff6102fa366004612941565b610dda565b6040516101bd9190612ba2565b60085461019c9073ffffffffffffffffffffffffffffffffffffffff1681565b6101d961033a366004612924565b611343565b60045461019c9073ffffffffffffffffffffffffffffffffffffffff1681565b61037261036d366004612924565b611453565b6040516101bd9190612c2e565b6101d961038d366004612924565b6118a2565b6103726103a0366004612924565b6119b2565b60065461019c9073ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314610471576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201527f6f726d207468697320616374696f6e000000000000000000000000000000000060648201526084015b60405180910390fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229060200160405180910390a150565b6040805161012081018252600080825260208201819052818301819052606082018190526080820181905260a0820181905260c0820181905260e08201819052610100820181905260085492517f99fbab8800000000000000000000000000000000000000000000000000000000815260048101859052919290918291829182918291829173ffffffffffffffffffffffffffffffffffffffff16906399fbab889060240161018060405180830381865afa1580156105ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d19190612d2a565b50505050975097509750975097509750505060008673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610630573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106549190612e1c565b60ff16905060008673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ca9190612e1c565b60ff1690506040518061012001604052808973ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1681526020018762ffffff1681526020018660020b81526020018560020b8152602001846fffffffffffffffffffffffffffffffff1681526020018381526020018281526020018284106107615782610763565b835b90529a9950505050505050505050565b61080b604051806101400160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016060815260200160608152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600081525090565b60008290506000808273ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa15801561085e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108829190612e55565b506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff16915060008373ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109189190612ea5565b905060008473ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610967573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098b9190612ea5565b90506040518061014001604052808873ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa158015610a00573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610a469190810190612ef1565b81526020018673ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015610a96573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610adc9190810190612ef1565b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b889190612e1c565b60ff1681526020018273ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bdb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bff9190612e1c565b60ff1681526020018581526020018481526020018673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c829190612fbc565b9052979650505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610d36576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7560448201527f2063616e20616363657074206f776e65727368697000000000000000000000006064820152608401610468565b6000546001546040805173ffffffffffffffffffffffffffffffffffffffff93841681529290911660208301527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c910160405180910390a160018054600080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff841617909155169055565b610e136040518060c001604052806000815260200160008152602001600081526020016060815260200160608152602001600081525090565b6000610e1e836104ea565b6007548151602083015160408085015190517f1698ee8200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9384166004820152918316602483015262ffffff16604482015292935060009283929190911690631698ee8290606401602060405180830381865afa158015610eb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed99190612ea5565b905060008190508073ffffffffffffffffffffffffffffffffffffffff16633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015610f2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4f9190612ff7565b505050506060870151929550600094508493508392610f7092509050611e01565b90506000610f818660800151611e01565b90506000866101000151600a610f9791906131ce565b9050600080610fc9888686868d60a001516fffffffffffffffffffffffffffffffff16610fc49190613209565b61229b565b9150915060008960c001516012610fe0919061321d565b610feb90600a6131ce565b905060008a60e001516012611000919061321d565b61100b90600a6131ce565b6005548c516040517fd02641a000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff918216600482015292935060009291169063d02641a090602401606060405180830381865afa158015611082573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a69190613234565b505060055460208e01516040517fd02641a000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff918216600482015292935060009291169063d02641a090602401606060405180830381865afa158015611122573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111469190613234565b5050600a54909150848361115a8a8a613262565b6111649190613262565b61116e9190613262565b6111789190613209565b600a54909b50838261118a8a89613262565b6111949190613262565b61119e9190613262565b6111a89190613209565b9950505050505050505050600081836111c1919061329f565b90506040518060c00160405280848152602001838152602001828152602001866000015173ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801561122f573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526112759190810190612ef1565b8152602001866020015173ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa1580156112c9573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261130f9190810190612ef1565b815260200182600a548860a001516fffffffffffffffffffffffffffffffff166113399190613262565b610c829190613209565b60005473ffffffffffffffffffffffffffffffffffffffff16331480611380575060025473ffffffffffffffffffffffffffffffffffffffff1633145b61140c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f596f7520617265206e6f7420616e206f776e6572206f722074686520676f766560448201527f726e616e63652074696d656c6f636b00000000000000000000000000000000006064820152608401610468565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61148c6040518060c001604052806000815260200160008152602001606081526020016060815260200160608152602001606081525090565b600061149783610773565b90506000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633179fabc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611508573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152c9190612fbc565b905060008061155d8461012001516115578661010001518760e001516115529190613262565b612385565b90612510565b60055460608601516040517f8020d2ce00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152929350600092911690638020d2ce90602401602060405180830381865afa1580156115d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fb9190612fbc565b60055460808701516040517f8020d2ce00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152929350600092911690638020d2ce90602401602060405180830381865afa158015611675573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116999190612fbc565b905060006701000000000000006116af83612385565b6701000000000000006116c186612385565b6116cc886002613262565b6116d69190613262565b6116e09190613209565b6116ea9190613262565b6116f49190613209565b9050600061170a67010000000000000083613209565b905067010000000000000061171f8883613262565b6117299190613209565b955050505050506040518060c00160405280828152602001600c548361174f9190613209565b81526020018460400151815260200184602001518152602001846060015173ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa1580156117b7573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526117fd9190810190612ef1565b8152602001846080015173ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015611851573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526118979190810190612ef1565b905295945050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314806118df575060025473ffffffffffffffffffffffffffffffffffffffff1633145b61196b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f596f7520617265206e6f7420616e206f776e6572206f722074686520676f766560448201527f726e616e63652074696d656c6f636b00000000000000000000000000000000006064820152608401610468565b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6119eb6040518060c001604052806000815260200160008152602001606081526020016060815260200160608152602001606081525090565b60006119f683610773565b60055460608201516040517f4db769ad00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152929350600092911690634db769ad90602401602060405180830381865afa158015611a70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a9491906132b7565b15611b965760055460608301516040517fd02641a000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152600092919091169063d02641a090602401606060405180830381865afa158015611b12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b369190613234565b505090508261012001518360e00151826002611b529190613262565b611b5c9190613262565b611b669190613209565b91508260a001516012611b79919061321d565b611b8490600a6131ce565b611b8e9083613262565b915050611c90565b60055460808301516040517fd02641a000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152600092919091169063d02641a090602401606060405180830381865afa158015611c0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c339190613234565b50509050826101200151836101000151826002611c509190613262565b611c5a9190613262565b611c649190613209565b91508260c001516012611c77919061321d565b611c8290600a6131ce565b611c8c9083613262565b9150505b6040518060c00160405280828152602001600c5483611caf9190613209565b81526020018360400151815260200183602001518152602001836060015173ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015611d17573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611d5d9190810190612ef1565b8152602001836080015173ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015611db1573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611df79190810190612ef1565b9052949350505050565b60008060008360020b12611e18578260020b611e25565b8260020b611e25906132d2565b9050611e507ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2761861330b565b60020b811315611ebc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600160248201527f54000000000000000000000000000000000000000000000000000000000000006044820152606401610468565b600060018216611edd57700100000000000000000000000000000000611eef565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff1690506002821615611f2e576080611f29826ffff97272373d413259a46990580e213a613262565b901c90505b6004821615611f58576080611f53826ffff2e50f5f656932ef12357cf3c7fdcc613262565b901c90505b6008821615611f82576080611f7d826fffe5caca7e10e4e61c3624eaa0941cd0613262565b901c90505b6010821615611fac576080611fa7826fffcb9843d60f6159c9db58835c926644613262565b901c90505b6020821615611fd6576080611fd1826fff973b41fa98c081472e6896dfb254c0613262565b901c90505b6040821615612000576080611ffb826fff2ea16466c96a3843ec78b326b52861613262565b901c90505b608082161561202a576080612025826ffe5dee046a99a2a811c461f1969c3053613262565b901c90505b610100821615612055576080612050826ffcbe86c7900a88aedcffc83b479aa3a4613262565b901c90505b61020082161561208057608061207b826ff987a7253ac413176f2b074cf7815e54613262565b901c90505b6104008216156120ab5760806120a6826ff3392b0822b70005940c7a398e4b70f3613262565b901c90505b6108008216156120d65760806120d1826fe7159475a2c29b7443b29c7fa6e889d9613262565b901c90505b6110008216156121015760806120fc826fd097f3bdfd2022b8845ad8f792aa5825613262565b901c90505b61200082161561212c576080612127826fa9f746462d870fdf8a65dc1f90e061e5613262565b901c90505b614000821615612157576080612152826f70d869a156d2a1b890bb3df62baf32f7613262565b901c90505b61800082161561218257608061217d826f31be135f97d08fd981231505542fcfa6613262565b901c90505b620100008216156121ae5760806121a9826f09aa508b5b7a84e1c677de54f3e99bc9613262565b901c90505b620200008216156121d95760806121d4826e5d6af8dedb81196699c329225ee604613262565b901c90505b620400008216156122035760806121fe826d2216e584f5fa1ea926041bedfe98613262565b901c90505b6208000082161561222b576080612226826b048a170391f7dc42444e8fa2613262565b901c90505b60008460020b131561226457612261817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff613209565b90505b6122736401000000008261334a565b1561227f576001612282565b60005b6122939060ff16602083901c61329f565b949350505050565b6000808373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1611156122d6579293925b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161161231b5761231485858561253f565b915061237c565b8373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16101561236e5761235a86858561253f565b9150612367858785612606565b905061237c565b612379858585612606565b90505b94509492505050565b60008161239457506000919050565b81600170010000000000000000000000000000000082106123ba5760809190911c9060401b5b6801000000000000000082106123d55760409190911c9060201b5b64010000000082106123ec5760209190911c9060101b5b6201000082106124015760109190911c9060081b5b61010082106124155760089190911c9060041b5b601082106124285760049190911c9060021b5b600882106124345760011b5b60016124408286613209565b61244a908361329f565b901c9050600161245a8286613209565b612464908361329f565b901c905060016124748286613209565b61247e908361329f565b901c9050600161248e8286613209565b612498908361329f565b901c905060016124a88286613209565b6124b2908361329f565b901c905060016124c28286613209565b6124cc908361329f565b901c905060016124dc8286613209565b6124e6908361329f565b901c905060006124f68286613209565b90508082106125055780612507565b815b95945050505050565b60008161252c846e010000000000000000000000000000612689565b6125369190613209565b90505b92915050565b60008273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161115612579579192915b73ffffffffffffffffffffffffffffffffffffffff84166125f27bffffffffffffffffffffffffffffffff000000000000000000000000606085901b166125c0878761335e565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1661273e565b6125fc9190613209565b90505b9392505050565b60008273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161115612640579192915b6125fc6fffffffffffffffffffffffffffffffff8316612660868661335e565b73ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000061273e565b60008261269857506000612539565b60006126a48385613262565b9050826126b18583613209565b14612536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60448201527f77000000000000000000000000000000000000000000000000000000000000006064820152608401610468565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8587098587029250828110838203039150508060001415612796576000841161278b57600080fd5b5082900490506125ff565b8084116127a257600080fd5b6000848688098084039381119092039190506000856127e1817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61321d565b6127ec90600161329f565b1695869004959384900493600081900304600101905061280c8184613262565b90931792600061281d876003613262565b600218905061282c8188613262565b61283790600261321d565b6128419082613262565b905061284d8188613262565b61285890600261321d565b6128629082613262565b905061286e8188613262565b61287990600261321d565b6128839082613262565b905061288f8188613262565b61289a90600261321d565b6128a49082613262565b90506128b08188613262565b6128bb90600261321d565b6128c59082613262565b90506128d18188613262565b6128dc90600261321d565b6128e69082613262565b90506128f28186613262565b9998505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461292157600080fd5b50565b60006020828403121561293657600080fd5b8135612536816128ff565b60006020828403121561295357600080fd5b5035919050565b60006101208201905073ffffffffffffffffffffffffffffffffffffffff8084511683528060208501511660208401525060408301516129a1604084018262ffffff169052565b5060608301516129b6606084018260020b9052565b5060808301516129cb608084018260020b9052565b5060a08301516129ef60a08401826fffffffffffffffffffffffffffffffff169052565b5060c083015160c083015260e083015160e083015261010080840151818401525092915050565b60005b83811015612a31578181015183820152602001612a19565b83811115612a40576000848401525b50505050565b60008151808452612a5e816020860160208601612a16565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152612ab760208201835173ffffffffffffffffffffffffffffffffffffffff169052565b60006020830151610140806040850152612ad5610160850183612a46565b915060408501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0858403016060860152612b108382612a46565b9250506060850151612b3a608086018273ffffffffffffffffffffffffffffffffffffffff169052565b50608085015173ffffffffffffffffffffffffffffffffffffffff811660a08601525060a085015160c085015260c085015160e085015260e0850151610100818187015280870151915050610120818187015280870151838701525050508091505092915050565b602081528151602082015260208201516040820152604082015160608201526000606083015160c06080840152612bdc60e0840182612a46565b905060808401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08483030160a0850152612c178282612a46565b91505060a084015160c08401528091505092915050565b6020815281516020820152602082015160408201526000604083015160c06060840152612c5e60e0840182612a46565b905060608401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe080858403016080860152612c9a8383612a46565b925060808601519150808584030160a0860152612cb78383612a46565b925060a08601519150808584030160c0860152506125078282612a46565b8051612ce0816128ff565b919050565b805162ffffff81168114612ce057600080fd5b8051600281900b8114612ce057600080fd5b80516fffffffffffffffffffffffffffffffff81168114612ce057600080fd5b6000806000806000806000806000806000806101808d8f031215612d4d57600080fd5b8c516bffffffffffffffffffffffff81168114612d6957600080fd5b9b50612d7760208e01612cd5565b9a50612d8560408e01612cd5565b9950612d9360608e01612cd5565b9850612da160808e01612ce5565b9750612daf60a08e01612cf8565b9650612dbd60c08e01612cf8565b9550612dcb60e08e01612d0a565b94506101008d015193506101208d01519250612dea6101408e01612d0a565b9150612df96101608e01612d0a565b90509295989b509295989b509295989b565b805160ff81168114612ce057600080fd5b600060208284031215612e2e57600080fd5b61253682612e0b565b80516dffffffffffffffffffffffffffff81168114612ce057600080fd5b600080600060608486031215612e6a57600080fd5b612e7384612e37565b9250612e8160208501612e37565b9150604084015163ffffffff81168114612e9a57600080fd5b809150509250925092565b600060208284031215612eb757600080fd5b8151612536816128ff565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060208284031215612f0357600080fd5b815167ffffffffffffffff80821115612f1b57600080fd5b818401915084601f830112612f2f57600080fd5b815181811115612f4157612f41612ec2565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715612f8757612f87612ec2565b81604052828152876020848701011115612fa057600080fd5b612fb1836020830160208801612a16565b979650505050505050565b600060208284031215612fce57600080fd5b5051919050565b805161ffff81168114612ce057600080fd5b80518015158114612ce057600080fd5b600080600080600080600060e0888a03121561301257600080fd5b875161301d816128ff565b965061302b60208901612cf8565b955061303960408901612fd5565b945061304760608901612fd5565b935061305560808901612fd5565b925061306360a08901612e0b565b915061307160c08901612fe7565b905092959891949750929550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600181815b8085111561310757817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156130ed576130ed61307f565b808516156130fa57918102915b93841c93908002906130b3565b509250929050565b60008261311e57506001612539565b8161312b57506000612539565b8160018114613141576002811461314b57613167565b6001915050612539565b60ff84111561315c5761315c61307f565b50506001821b612539565b5060208310610133831016604e8410600b841016171561318a575081810a612539565b61319483836130ae565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156131c6576131c661307f565b029392505050565b6000612536838361310f565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082613218576132186131da565b500490565b60008282101561322f5761322f61307f565b500390565b60008060006060848603121561324957600080fd5b8351925060208401519150604084015190509250925092565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561329a5761329a61307f565b500290565b600082198211156132b2576132b261307f565b500190565b6000602082840312156132c957600080fd5b61253682612fe7565b60007f80000000000000000000000000000000000000000000000000000000000000008214156133045761330461307f565b5060000390565b60008160020b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8000008114156133415761334161307f565b60000392915050565b600082613359576133596131da565b500690565b600073ffffffffffffffffffffffffffffffffffffffff8381169083168181101561338b5761338b61307f565b03939250505056fea2646970667358221220c7bce0590dabc2a880f955118b7291474da82e824ec9dd9a6cfc1c5a00a9abaf64736f6c634300080a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000104e5d38a2d646ffaf936d0a4af876e56b5b14b300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000007000000000000000000000000322e86852e492a7ee17f28a78c663da38fb33bfb0000000000000000000000002cc0a9d8047a5011defe85328a6f26968c8aaa1c000000000000000000000000247a323daa63cc97c2bad61b4d6f1e0120b5c9e20000000000000000000000007a3909c7996efe42d425cd932fc44e3840fcab71000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _owner_address (address): 0x104E5d38a2d646FFaf936d0a4Af876e56B5B14B3
Arg [1] : _starting_addresses (address[]): 0x322E86852e492a7Ee17f28a78c663da38FB33bfb,0x2CC0A9D8047A5011dEfe85328a6f26968C8aaA1C,0x247A323DAA63cC97c2BAD61b4D6f1E0120B5c9e2,0x7a3909C7996EFE42d425cD932fc44E3840fCAB71,0x0000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000
-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 000000000000000000000000104e5d38a2d646ffaf936d0a4af876e56b5b14b3
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [3] : 000000000000000000000000322e86852e492a7ee17f28a78c663da38fb33bfb
Arg [4] : 0000000000000000000000002cc0a9d8047a5011defe85328a6f26968c8aaa1c
Arg [5] : 000000000000000000000000247a323daa63cc97c2bad61b4d6f1e0120b5c9e2
Arg [6] : 0000000000000000000000007a3909c7996efe42d425cd932fc44e3840fcab71
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode Sourcemap
132856:11950:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;133088:27;;;;;;;;;;;;322:42:1;310:55;;;292:74;;280:2;265:18;133088:27:0;;;;;;;;31087:141;;;;;;:::i;:::-;;:::i;:::-;;133452:45;;;;;;;;;934:25:1;;;922:2;907:18;133452:45:0;788:177:1;133292:38:0;;;;;;;;;140686:1038;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;133547:46::-;;;;;;30855:29;;;;;;;;;133177:31;;;;;;;;;135828:862;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;31236:271::-;;;:::i;133394:31::-;;;;;;;;;30828:20;;;;;;;;;133504:36;;;;;;141779:2687;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;133337:50::-;;;;;;;;;144541:125;;;;;;:::i;:::-;;:::i;133122:26::-;;;;;;;;;137023:1776;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;144674:129::-;;;;;;:::i;:::-;;:::i;138866:1812::-;;;;;;:::i;:::-;;:::i;133237:32::-;;;;;;;;;31087:141;31567:5;;;;31553:10;:19;31545:79;;;;;;;7990:2:1;31545:79:0;;;7972:21:1;8029:2;8009:18;;;8002:30;8068:34;8048:18;;;8041:62;8139:17;8119:18;;;8112:45;8174:19;;31545:79:0;;;;;;;;;31159:14:::1;:23:::0;;;::::1;;::::0;::::1;::::0;;::::1;::::0;;;31198:22:::1;::::0;292:74:1;;;31198:22:0::1;::::0;280:2:1;265:18;31198:22:0::1;;;;;;;31087:141:::0;:::o;140686:1038::-;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;141197:15:0;;:35;;;;;;;;934:25:1;;;-1:-1:-1;;;;;;;;;;;;;;141197:15:0;;;:25;;907:18:1;;141197:35:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;140833:399;;;;;;;;;;;;;;;;;;141270:16;141295:6;141289:22;;;:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;141270:43;;;;141324:16;141349:6;141343:22;;;:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;141324:43;;;;141387:329;;;;;;;;141419:6;141387:329;;;;;;141447:6;141387:329;;;;;;141475:3;141387:329;;;;;;141500:9;141387:329;;;;;;141531:9;141387:329;;;;;;141562:9;141387:329;;;;;;141593:8;141387:329;;;;141624:8;141387:329;;;;141667:8;141656;:19;141655:43;;141690:8;141655:43;;;141679:8;141655:43;141387:329;;141380:336;140686:1038;-1:-1:-1;;;;;;;;;;140686:1038:0:o;135828:862::-;135897:23;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;135897:23:0;135966;136007:12;135966:54;;136063:16;136081;136104:8;:20;;;:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;136062:65;;;;;;;;;136175:14;136192:8;:15;;;:17;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;136175:34;;136220:14;136237:8;:15;;;:17;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;136220:34;;136293:389;;;;;;;;136324:12;136293:389;;;;;;136358:8;:13;;;:15;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;136293:389;;;;136395:8;:15;;;:17;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;136293:389;;;;136434:6;136293:389;;;;;;136462:6;136293:389;;;;;;136496:6;136490:22;;;:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;136293:389;;;;;;136542:6;136536:22;;;:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;136293:389;;;;;;136582:8;136293:389;;;;136612:8;136293:389;;;;136642:8;:20;;;:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;136293:389;;136286:396;135828:862;-1:-1:-1;;;;;;;135828:862:0:o;31236:271::-;31305:14;;;;31291:10;:28;31283:94;;;;;;;12880:2:1;31283:94:0;;;12862:21:1;12919:2;12899:18;;;12892:30;12958:34;12938:18;;;12931:62;13029:23;13009:18;;;13002:51;13070:19;;31283:94:0;12678:417:1;31283:94:0;31406:5;;;31413:14;31393:35;;;31406:5;;;;13335:34:1;;31413:14:0;;;;13400:2:1;13385:18;;13378:43;31393:35:0;;13247:18:1;31393:35:0;;;;;;;31447:14;;;;31439:22;;;;;;31447:14;;;31439:22;;;;31472:27;;;31236:271::o;141779:2687::-;141848:24;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;141848:24:0;141885:38;141926:30;141947:8;141926:20;:30::i;:::-;142070:13;;142092:20;;142114;;;;142136:17;;;;;142070:84;;;;;:13;13711:15:1;;;142070:84:0;;;13693:34:1;13763:15;;;13743:18;;;13736:43;13827:8;13815:21;13795:18;;;13788:49;142092:20:0;;-1:-1:-1;142001:20:0;;;;142070:13;;;;;:21;;13605:18:1;;142070:84:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;142047:107;;142169:23;142210:12;142169:54;;142267:8;:14;;;:16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;142539:23:0;;;;142238:45;;-1:-1:-1;142329:22:0;;-1:-1:-1;142329:22:0;;-1:-1:-1;142329:22:0;;142511:52;;-1:-1:-1;142539:23:0;-1:-1:-1;142511:27:0;:52::i;:::-;142487:76;;142578:21;142602:52;142630:13;:23;;;142602:27;:52::i;:::-;142578:76;;142772:27;142809:13;:29;;;142803:2;:35;;;;:::i;:::-;142772:67;;142855:22;142879;142905:139;142945:12;142959:13;142974;143023:19;142997:13;:23;;;:45;;;;;;:::i;:::-;142905:39;:139::i;:::-;142854:190;;;;143098:28;143147:13;:29;;;143141:2;143136:40;;;;:::i;:::-;143129:48;;:2;:48;:::i;:::-;143098:79;;143192:28;143241:13;:29;;;143235:2;143230:40;;;;:::i;:::-;143223:48;;:2;:48;:::i;:::-;143449:12;;143476:20;;143449:48;;;;;:12;310:55:1;;;143449:48:0;;;292:74:1;143192:79:0;;-1:-1:-1;143413:28:0;;143449:12;;;:26;;265:18:1;;143449:48:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;143549:12:0;;143576:20;;;;143549:48;;;;;:12;310:55:1;;;143549:48:0;;;292:74:1;143412:85:0;;-1:-1:-1;143513:28:0;;143549:12;;;:26;;265:18:1;;143549:48:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;143820:23:0;;143512:85;;-1:-1:-1;143796:20:0;143773;143734:36;143751:19;143734:14;:36;:::i;:::-;:59;;;;:::i;:::-;:82;;;;:::i;:::-;143733:110;;;;:::i;:::-;143962:23;;143716:127;;-1:-1:-1;143938:20:0;143915;143876:36;143893:19;143876:14;:36;:::i;:::-;:59;;;;:::i;:::-;:82;;;;:::i;:::-;143875:110;;;;:::i;:::-;143858:127;;142404:1593;;;;;;;;;144061:19;144101:14;144084;:31;;;;:::i;:::-;144061:55;;144155:303;;;;;;;;144187:14;144155:303;;;;144216:14;144155:303;;;;144245:11;144155:303;;;;144277:13;:20;;;144271:34;;;:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;144155:303;;;;144328:13;:20;;;144322:34;;;:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;144155:303;;;;144436:11;144409:23;;144382:13;:23;;;144374:32;;:58;;;;:::i;:::-;144373:74;;;;:::i;144541:125::-;135643:5;;;;135629:10;:19;;:53;;-1:-1:-1;135666:16:0;;;;135652:10;:30;135629:53;135621:113;;;;;;;17941:2:1;135621:113:0;;;17923:21:1;17980:2;17960:18;;;17953:30;18019:34;17999:18;;;17992:62;18090:17;18070:18;;;18063:45;18125:19;;135621:113:0;17739:411:1;135621:113:0;144622:16:::1;:36:::0;;;::::1;;::::0;;;::::1;::::0;;;::::1;::::0;;144541:125::o;137023:1776::-;137096:21;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;137096:21:0;137170:37;137210:34;137227:16;137210;:34::i;:::-;137170:74;;137297:17;137317:12;;;;;;;;;;;:31;;;:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;137297:53;;137395:21;137442:10;137455:114;137539:13;:29;;;137455:78;137503:13;:29;;;137471:13;:29;;;:61;;;;:::i;:::-;137455:15;:78::i;:::-;:83;;:114::i;:::-;137608:12;;137633:20;;;;137608:46;;;;;:12;310:55:1;;;137608:46:0;;;292:74:1;137442:127:0;;-1:-1:-1;137597:8:0;;137608:12;;;:24;;265:18:1;;137608:46:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;137693:12;;137718:20;;;;137693:46;;;;;:12;310:55:1;;;137693:46:0;;;292:74:1;137597:57:0;;-1:-1:-1;137682:8:0;;137693:12;;;:24;;265:18:1;;137693:46:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;137682:57;;138085:28;138193:7;138168:20;138184:3;138168:15;:20::i;:::-;138156:7;138131:20;138147:3;138131:15;:20::i;:::-;138119:9;:5;138127:1;138119:9;:::i;:::-;:32;;;;:::i;:::-;138118:46;;;;:::i;:::-;138117:71;;;;:::i;:::-;138116:85;;;;:::i;:::-;138085:116;-1:-1:-1;138297:23:0;138323:32;138347:7;138085:116;138323:32;:::i;:::-;138297:58;-1:-1:-1;138420:7:0;138388:27;138406:9;138297:58;138388:27;:::i;:::-;138387:41;;;;:::i;:::-;138371:57;;137427:1013;;;;;138459:332;;;;;;;;138488:13;138459:332;;;;138539:24;;138523:13;:40;;;;:::i;:::-;138459:332;;;;138585:13;:26;;;138459:332;;;;138633:13;:24;;;138459:332;;;;138685:13;:20;;;138679:34;;;:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;138459:332;;;;138743:13;:20;;;138737:34;;;:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;138459:332;;138452:339;137023:1776;-1:-1:-1;;;;;137023:1776:0:o;144674:129::-;135643:5;;;;135629:10;:19;;:53;;-1:-1:-1;135666:16:0;;;;135652:10;:30;135629:53;135621:113;;;;;;;17941:2:1;135621:113:0;;;17923:21:1;17980:2;17960:18;;;17953:30;18019:34;17999:18;;;17992:62;18090:17;18070:18;;;18063:45;18125:19;;135621:113:0;17739:411:1;135621:113:0;144754:12:::1;:41:::0;;;::::1;;::::0;;;::::1;::::0;;;::::1;::::0;;144674:129::o;138866:1812::-;138950:21;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;138950:21:0;139024:37;139064:34;139081:16;139064;:34::i;:::-;139420:12;;139442:20;;;;139420:43;;;;;:12;310:55:1;;;139420:43:0;;;292:74:1;139442:20:0;;-1:-1:-1;139384:21:0;;139420:12;;;:21;;265:18:1;;139420:43:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;139416:903;;;139515:12;;139542:20;;;;139515:48;;;;;:12;310:55:1;;;139515:48:0;;;292:74:1;139480:27:0;;139515:12;;;;;:26;;265:18:1;;139515:48:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;139479:84;;;;139724:13;:29;;;139691:13;:29;;;139669:19;139665:1;:23;;;;:::i;:::-;:55;;;;:::i;:::-;139664:89;;;;:::i;:::-;139648:105;;139835:13;:29;;;139829:2;139824:40;;;;:::i;:::-;139817:48;;:2;:48;:::i;:::-;139799:67;;;;:::i;:::-;;;139464:414;139416:903;;;139944:12;;139971:20;;;;139944:48;;;;;:12;310:55:1;;;139944:48:0;;;292:74:1;139909:27:0;;139944:12;;;;;:26;;265:18:1;;139944:48:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;139908:84;;;;140165:13;:29;;;140132:13;:29;;;140110:19;140106:1;:23;;;;:::i;:::-;:55;;;;:::i;:::-;140105:89;;;;:::i;:::-;140089:105;;140276:13;:29;;;140270:2;140265:40;;;;:::i;:::-;140258:48;;:2;:48;:::i;:::-;140240:67;;;;:::i;:::-;;;139893:426;139416:903;140338:332;;;;;;;;140367:13;140338:332;;;;140418:24;;140402:13;:40;;;;:::i;:::-;140338:332;;;;140464:13;:26;;;140338:332;;;;140512:13;:24;;;140338:332;;;;140564:13;:20;;;140558:34;;;:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;140338:332;;;;140622:13;:20;;;140616:34;;;:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;140338:332;;140331:339;138866:1812;-1:-1:-1;;;;138866:1812:0:o;59941:2618::-;60004:20;60037:15;60062:1;60055:4;:8;;;:57;;60106:4;60099:12;;60055:57;;;60082:4;60075:12;;60074:13;;;:::i;:::-;60037:75;-1:-1:-1;59211:9:0;59049:7;59211:9;:::i;:::-;60150:16;;60138:7;60131:35;;60123:49;;;;;;;19003:2:1;60123:49:0;;;18985:21:1;19042:1;19022:18;;;19015:29;19080:3;19060:18;;;19053:31;19101:18;;60123:49:0;18801:324:1;60123:49:0;60185:13;60211:3;60201:13;;:93;;60259:35;60201:93;;;60222:34;60201:93;60185:109;;;-1:-1:-1;60319:3:0;60309:13;;:18;60305:83;;60385:3;60338:42;:5;60346:34;60338:42;:::i;:::-;60337:51;;60329:59;;60305:83;60413:3;60403:13;;:18;60399:83;;60479:3;60432:42;:5;60440:34;60432:42;:::i;:::-;60431:51;;60423:59;;60399:83;60507:3;60497:13;;:18;60493:83;;60573:3;60526:42;:5;60534:34;60526:42;:::i;:::-;60525:51;;60517:59;;60493:83;60601:4;60591:14;;:19;60587:84;;60668:3;60621:42;:5;60629:34;60621:42;:::i;:::-;60620:51;;60612:59;;60587:84;60696:4;60686:14;;:19;60682:84;;60763:3;60716:42;:5;60724:34;60716:42;:::i;:::-;60715:51;;60707:59;;60682:84;60791:4;60781:14;;:19;60777:84;;60858:3;60811:42;:5;60819:34;60811:42;:::i;:::-;60810:51;;60802:59;;60777:84;60886:4;60876:14;;:19;60872:84;;60953:3;60906:42;:5;60914:34;60906:42;:::i;:::-;60905:51;;60897:59;;60872:84;60981:5;60971:15;;:20;60967:85;;61049:3;61002:42;:5;61010:34;61002:42;:::i;:::-;61001:51;;60993:59;;60967:85;61077:5;61067:15;;:20;61063:85;;61145:3;61098:42;:5;61106:34;61098:42;:::i;:::-;61097:51;;61089:59;;61063:85;61173:5;61163:15;;:20;61159:85;;61241:3;61194:42;:5;61202:34;61194:42;:::i;:::-;61193:51;;61185:59;;61159:85;61269:5;61259:15;;:20;61255:85;;61337:3;61290:42;:5;61298:34;61290:42;:::i;:::-;61289:51;;61281:59;;61255:85;61365:6;61355:16;;:21;61351:86;;61434:3;61387:42;:5;61395:34;61387:42;:::i;:::-;61386:51;;61378:59;;61351:86;61462:6;61452:16;;:21;61448:86;;61531:3;61484:42;:5;61492:34;61484:42;:::i;:::-;61483:51;;61475:59;;61448:86;61559:6;61549:16;;:21;61545:86;;61628:3;61581:42;:5;61589:34;61581:42;:::i;:::-;61580:51;;61572:59;;61545:86;61656:6;61646:16;;:21;61642:86;;61725:3;61678:42;:5;61686:34;61678:42;:::i;:::-;61677:51;;61669:59;;61642:86;61753:7;61743:17;;:22;61739:86;;61822:3;61776:41;:5;61784:33;61776:41;:::i;:::-;61775:50;;61767:58;;61739:86;61850:7;61840:17;;:22;61836:85;;61918:3;61873:40;:5;61881:32;61873:40;:::i;:::-;61872:49;;61864:57;;61836:85;61946:7;61936:17;;:22;61932:83;;62012:3;61969:38;:5;61977:30;61969:38;:::i;:::-;61968:47;;61960:55;;61932:83;62040:7;62030:17;;:22;62026:78;;62101:3;62063:33;:5;62071:25;62063:33;:::i;:::-;62062:42;;62054:50;;62026:78;62128:1;62121:4;:8;;;62117:47;;;62139:25;62159:5;62139:17;:25;:::i;:::-;62131:33;;62117:47;62519:17;62528:7;62519:5;:17;:::i;:::-;:22;:30;;62548:1;62519:30;;;62544:1;62519:30;62502:48;;;;62512:2;62503:11;;;62502:48;:::i;:::-;62479:72;59941:2618;-1:-1:-1;;;;59941:2618:0:o;79063:815::-;79248:15;79265;79313:13;79297:29;;:13;:29;;;79293:98;;;79362:13;;79377;79293:98;79424:13;79408:29;;:12;:29;;;79404:467;;79464:63;79487:13;79502;79517:9;79464:22;:63::i;:::-;79454:73;;79404:467;;;79564:13;79549:28;;:12;:28;;;79545:326;;;79604:62;79627:12;79641:13;79656:9;79604:22;:62::i;:::-;79594:72;;79691:62;79714:13;79729:12;79743:9;79691:22;:62::i;:::-;79681:72;;79545:326;;;79796:63;79819:13;79834;79849:9;79796:22;:63::i;:::-;79786:73;;79545:326;79063:815;;;;;;;:::o;32437:892::-;32482:4;32499:6;32495:20;;-1:-1:-1;32514:1:0;;32437:892;-1:-1:-1;32437:892:0:o;32495:20::-;32532:1;32549;32569:35;32563:41;;32559:91;;32622:3;32615:10;;;;;32640:2;32634:8;32559:91;32668:19;32662:2;:25;32658:74;;32705:2;32698:9;;;;;32722:2;32716:8;32658:74;32748:11;32742:2;:17;32738:66;;32777:2;32770:9;;;;;32794:2;32788:8;32738:66;32820:7;32814:2;:13;32810:61;;32845:2;32838:9;;;;;32862:1;32856:7;32810:61;32887:5;32881:2;:11;32877:58;;32910:1;32903:8;;;;;32926:1;32920:7;32877:58;32951:4;32945:2;:10;32941:57;;32973:1;32966:8;;;;;32989:1;32983:7;32941:57;33014:3;33008:2;:9;33004:39;;33034:1;33028:7;33004:39;33070:1;33060:5;33064:1;33060;:5;:::i;:::-;33056:9;;:1;:9;:::i;:::-;33055:16;;;-1:-1:-1;33097:1:0;33087:5;33055:16;33087:1;:5;:::i;:::-;33083:9;;:1;:9;:::i;:::-;33082:16;;;-1:-1:-1;33124:1:0;33114:5;33082:16;33114:1;:5;:::i;:::-;33110:9;;:1;:9;:::i;:::-;33109:16;;;-1:-1:-1;33151:1:0;33141:5;33109:16;33141:1;:5;:::i;:::-;33137:9;;:1;:9;:::i;:::-;33136:16;;;-1:-1:-1;33178:1:0;33168:5;33136:16;33168:1;:5;:::i;:::-;33164:9;;:1;:9;:::i;:::-;33163:16;;;-1:-1:-1;33205:1:0;33195:5;33163:16;33195:1;:5;:::i;:::-;33191:9;;:1;:9;:::i;:::-;33190:16;;;-1:-1:-1;33232:1:0;33222:5;33190:16;33222:1;:5;:::i;:::-;33218:9;;:1;:9;:::i;:::-;33217:16;;;-1:-1:-1;33277:7:0;33287:5;33217:16;33287:1;:5;:::i;:::-;33277:15;;33311:2;33307:1;:6;:15;;33320:2;33307:15;;;33316:1;33307:15;33299:24;32437:892;-1:-1:-1;;;;;32437:892:0:o;32089:104::-;32146:4;32184:3;32166:15;:3;32174:6;32166:7;:15::i;:::-;:21;;;;:::i;:::-;32159:28;;32089:104;;;;;:::o;77253:511::-;77407:15;77455:13;77439:29;;:13;:29;;;77435:98;;;77504:13;;77519;77435:98;77566:190;;;:174;77600:45;72988:2;77600:45;;;;77664:29;77743:13;77664;:29;:::i;:::-;77566:174;;77712:13;77566:174;;:15;:174::i;:::-;:190;;;;:::i;:::-;77546:210;;77253:511;;;;;;:::o;78129:383::-;78283:15;78331:13;78315:29;;:13;:29;;;78311:98;;;78380:13;;78395;78311:98;78429:75;;;;78456:29;78472:13;78456;:29;:::i;:::-;78429:75;;73029:27;78429:15;:75::i;4902:471::-;4960:7;5205:6;5201:47;;-1:-1:-1;5235:1:0;5228:8;;5201:47;5260:9;5272:5;5276:1;5272;:5;:::i;:::-;5260:17;-1:-1:-1;5305:1:0;5296:5;5300:1;5260:17;5296:5;:::i;:::-;:10;5288:56;;;;;;;19708:2:1;5288:56:0;;;19690:21:1;19747:2;19727:18;;;19720:30;19786:34;19766:18;;;19759:62;19857:3;19837:18;;;19830:31;19878:19;;5288:56:0;19506:397:1;68169:3893:0;68285:14;;;68804:6;68801:1;68798;68791:20;68841:1;68838;68834:9;68825:18;;68893:5;68889:2;68886:13;68878:5;68874:2;68870:14;68866:34;68857:43;;;68986:5;68995:1;68986:10;68982:185;;;69035:1;69021:11;:15;69013:24;;;;;;-1:-1:-1;69090:23:0;;;;-1:-1:-1;69142:13:0;;68982:185;69298:5;69284:11;:19;69276:28;;;;;;69589:17;69667:11;69664:1;69661;69654:25;69844:21;;;;69800:20;;69789:32;;;;69641:38;-1:-1:-1;70030:12:0;70085:11;70046:31;70085:11;70046:17;:31;:::i;:::-;:35;;70080:1;70046:35;:::i;:::-;70045:51;70193:22;;;;;70326:16;;;;;70580:1;70576:12;;;70572:23;70597:1;70568:31;;-1:-1:-1;70629:12:0;70568:31;70629:5;:12;:::i;:::-;70620:21;;;;70982:11;70997:15;71001:11;70997:1;:15;:::i;:::-;71016:1;70996:21;;-1:-1:-1;71247:17:0;70996:21;71247:11;:17;:::i;:::-;71243:21;;:1;:21;:::i;:::-;71236:28;;;;:::i;:::-;;-1:-1:-1;71306:17:0;71236:28;71306:11;:17;:::i;:::-;71302:21;;:1;:21;:::i;:::-;71295:28;;;;:::i;:::-;;-1:-1:-1;71366:17:0;71295:28;71366:11;:17;:::i;:::-;71362:21;;:1;:21;:::i;:::-;71355:28;;;;:::i;:::-;;-1:-1:-1;71426:17:0;71355:28;71426:11;:17;:::i;:::-;71422:21;;:1;:21;:::i;:::-;71415:28;;;;:::i;:::-;;-1:-1:-1;71486:17:0;71415:28;71486:11;:17;:::i;:::-;71482:21;;:1;:21;:::i;:::-;71475:28;;;;:::i;:::-;;-1:-1:-1;71547:17:0;71475:28;71547:11;:17;:::i;:::-;71543:21;;:1;:21;:::i;:::-;71536:28;;;;:::i;:::-;;-1:-1:-1;72019:11:0;71536:28;72019:5;:11;:::i;:::-;72010:20;68169:3893;-1:-1:-1;;;;;;;;;68169:3893:0:o;377:154:1:-;463:42;456:5;452:54;445:5;442:65;432:93;;521:1;518;511:12;432:93;377:154;:::o;536:247::-;595:6;648:2;636:9;627:7;623:23;619:32;616:52;;;664:1;661;654:12;616:52;703:9;690:23;722:31;747:5;722:31;:::i;1227:180::-;1286:6;1339:2;1327:9;1318:7;1314:23;1310:32;1307:52;;;1355:1;1352;1345:12;1307:52;-1:-1:-1;1378:23:1;;1227:180;-1:-1:-1;1227:180:1:o;1729:1078::-;1891:4;1933:3;1922:9;1918:19;1910:27;;1956:42;2044:2;2035:6;2029:13;2025:22;2014:9;2007:41;2116:2;2108:4;2100:6;2096:17;2090:24;2086:33;2079:4;2068:9;2064:20;2057:63;;2167:4;2159:6;2155:17;2149:24;2182:53;2229:4;2218:9;2214:20;2200:12;1488:8;1477:20;1465:33;;1412:92;2182:53;;2284:4;2276:6;2272:17;2266:24;2299:54;2347:4;2336:9;2332:20;2316:14;1584:1;1573:20;1561:33;;1509:91;2299:54;;2402:4;2394:6;2390:17;2384:24;2417:54;2465:4;2454:9;2450:20;2434:14;1584:1;1573:20;1561:33;;1509:91;2417:54;;2520:4;2512:6;2508:17;2502:24;2535:56;2585:4;2574:9;2570:20;2554:14;1682:34;1671:46;1659:59;;1605:119;2535:56;;2647:4;2639:6;2635:17;2629:24;2622:4;2611:9;2607:20;2600:54;2710:4;2702:6;2698:17;2692:24;2685:4;2674:9;2670:20;2663:54;2736:6;2796:2;2788:6;2784:15;2778:22;2773:2;2762:9;2758:18;2751:50;;1729:1078;;;;:::o;3063:258::-;3135:1;3145:113;3159:6;3156:1;3153:13;3145:113;;;3235:11;;;3229:18;3216:11;;;3209:39;3181:2;3174:10;3145:113;;;3276:6;3273:1;3270:13;3267:48;;;3311:1;3302:6;3297:3;3293:16;3286:27;3267:48;;3063:258;;;:::o;3326:317::-;3368:3;3406:5;3400:12;3433:6;3428:3;3421:19;3449:63;3505:6;3498:4;3493:3;3489:14;3482:4;3475:5;3471:16;3449:63;:::i;:::-;3557:2;3545:15;3562:66;3541:88;3532:98;;;;3632:4;3528:109;;3326:317;-1:-1:-1;;3326:317:1:o;3648:1351::-;3845:2;3834:9;3827:21;3857:53;3906:2;3895:9;3891:18;3882:6;3876:13;91:42;80:54;68:67;;14:127;3857:53;3808:4;3957:2;3949:6;3945:15;3939:22;3980:6;4022:2;4017;4006:9;4002:18;3995:30;4048:52;4095:3;4084:9;4080:19;4066:12;4048:52;:::i;:::-;4034:66;;4149:2;4141:6;4137:15;4131:22;4217:66;4205:9;4197:6;4193:22;4189:95;4184:2;4173:9;4169:18;4162:123;4308:41;4342:6;4326:14;4308:41;:::i;:::-;4294:55;;;4398:2;4390:6;4386:15;4380:22;4411:55;4461:3;4450:9;4446:19;4430:14;91:42;80:54;68:67;;14:127;4411:55;-1:-1:-1;4515:3:1;4503:16;;4497:23;91:42;80:54;;4579:3;4564:19;;68:67;4529:55;4639:3;4631:6;4627:16;4621:23;4615:3;4604:9;4600:19;4593:52;4700:3;4692:6;4688:16;4682:23;4676:3;4665:9;4661:19;4654:52;4743:3;4735:6;4731:16;4725:23;4767:3;4806:2;4801;4790:9;4786:18;4779:30;4846:2;4838:6;4834:15;4828:22;4818:32;;;4869:3;4908:2;4903;4892:9;4888:18;4881:30;4965:2;4957:6;4953:15;4947:22;4942:2;4931:9;4927:18;4920:50;;;;4987:6;4979:14;;;3648:1351;;;;:::o;5255:880::-;5454:2;5443:9;5436:21;5499:6;5493:13;5488:2;5477:9;5473:18;5466:41;5561:2;5553:6;5549:15;5543:22;5538:2;5527:9;5523:18;5516:50;5620:2;5612:6;5608:15;5602:22;5597:2;5586:9;5582:18;5575:50;5417:4;5672:2;5664:6;5660:15;5654:22;5713:4;5707:3;5696:9;5692:19;5685:33;5741:52;5788:3;5777:9;5773:19;5759:12;5741:52;:::i;:::-;5727:66;;5842:3;5834:6;5830:16;5824:23;5912:66;5900:9;5892:6;5888:22;5884:95;5878:3;5867:9;5863:19;5856:124;6003:41;6037:6;6021:14;6003:41;:::i;:::-;5989:55;;;6100:3;6092:6;6088:16;6082:23;6075:4;6064:9;6060:20;6053:53;6123:6;6115:14;;;5255:880;;;;:::o;6407:1118::-;6600:2;6589:9;6582:21;6645:6;6639:13;6634:2;6623:9;6619:18;6612:41;6707:2;6699:6;6695:15;6689:22;6684:2;6673:9;6669:18;6662:50;6563:4;6759:2;6751:6;6747:15;6741:22;6799:4;6794:2;6783:9;6779:18;6772:32;6827:52;6874:3;6863:9;6859:19;6845:12;6827:52;:::i;:::-;6813:66;;6928:2;6920:6;6916:15;6910:22;6951:66;7082:2;7070:9;7062:6;7058:22;7054:31;7048:3;7037:9;7033:19;7026:60;7109:41;7143:6;7127:14;7109:41;:::i;:::-;7095:55;;7199:3;7191:6;7187:16;7181:23;7159:45;;7269:2;7257:9;7249:6;7245:22;7241:31;7235:3;7224:9;7220:19;7213:60;7296:41;7330:6;7314:14;7296:41;:::i;:::-;7282:55;;7386:3;7378:6;7374:16;7368:23;7346:45;;7457:2;7445:9;7437:6;7433:22;7429:31;7422:4;7411:9;7407:20;7400:61;;7478:41;7512:6;7496:14;7478:41;:::i;8204:138::-;8283:13;;8305:31;8283:13;8305:31;:::i;:::-;8204:138;;;:::o;8347:165::-;8425:13;;8478:8;8467:20;;8457:31;;8447:59;;8502:1;8499;8492:12;8517:164;8594:13;;8647:1;8636:20;;;8626:31;;8616:59;;8671:1;8668;8661:12;8686:192;8765:13;;8818:34;8807:46;;8797:57;;8787:85;;8868:1;8865;8858:12;8883:1186;9046:6;9054;9062;9070;9078;9086;9094;9102;9110;9118;9126:7;9135;9189:3;9177:9;9168:7;9164:23;9160:33;9157:53;;;9206:1;9203;9196:12;9157:53;9238:9;9232:16;9288:26;9281:5;9277:38;9270:5;9267:49;9257:77;;9330:1;9327;9320:12;9257:77;9353:5;-1:-1:-1;9377:49:1;9422:2;9407:18;;9377:49;:::i;:::-;9367:59;;9445:49;9490:2;9479:9;9475:18;9445:49;:::i;:::-;9435:59;;9513:49;9558:2;9547:9;9543:18;9513:49;:::i;:::-;9503:59;;9581:49;9625:3;9614:9;9610:19;9581:49;:::i;:::-;9571:59;;9649:48;9692:3;9681:9;9677:19;9649:48;:::i;:::-;9639:58;;9716:48;9759:3;9748:9;9744:19;9716:48;:::i;:::-;9706:58;;9783:50;9828:3;9817:9;9813:19;9783:50;:::i;:::-;9773:60;;9873:3;9862:9;9858:19;9852:26;9842:36;;9918:3;9907:9;9903:19;9897:26;9887:36;;9943:50;9988:3;9977:9;9973:19;9943:50;:::i;:::-;9932:61;;10013:50;10058:3;10047:9;10043:19;10013:50;:::i;:::-;10002:61;;8883:1186;;;;;;;;;;;;;;:::o;10074:160::-;10151:13;;10204:4;10193:16;;10183:27;;10173:55;;10224:1;10221;10214:12;10239:204;10307:6;10360:2;10348:9;10339:7;10335:23;10331:32;10328:52;;;10376:1;10373;10366:12;10328:52;10399:38;10427:9;10399:38;:::i;10448:188::-;10527:13;;10580:30;10569:42;;10559:53;;10549:81;;10626:1;10623;10616:12;10641:450;10728:6;10736;10744;10797:2;10785:9;10776:7;10772:23;10768:32;10765:52;;;10813:1;10810;10803:12;10765:52;10836:40;10866:9;10836:40;:::i;:::-;10826:50;;10895:49;10940:2;10929:9;10925:18;10895:49;:::i;:::-;10885:59;;10987:2;10976:9;10972:18;10966:25;11031:10;11024:5;11020:22;11013:5;11010:33;11000:61;;11057:1;11054;11047:12;11000:61;11080:5;11070:15;;;10641:450;;;;;:::o;11096:251::-;11166:6;11219:2;11207:9;11198:7;11194:23;11190:32;11187:52;;;11235:1;11232;11225:12;11187:52;11267:9;11261:16;11286:31;11311:5;11286:31;:::i;11352:184::-;11404:77;11401:1;11394:88;11501:4;11498:1;11491:15;11525:4;11522:1;11515:15;11541:943;11621:6;11674:2;11662:9;11653:7;11649:23;11645:32;11642:52;;;11690:1;11687;11680:12;11642:52;11723:9;11717:16;11752:18;11793:2;11785:6;11782:14;11779:34;;;11809:1;11806;11799:12;11779:34;11847:6;11836:9;11832:22;11822:32;;11892:7;11885:4;11881:2;11877:13;11873:27;11863:55;;11914:1;11911;11904:12;11863:55;11943:2;11937:9;11965:2;11961;11958:10;11955:36;;;11971:18;;:::i;:::-;12105:2;12099:9;12167:4;12159:13;;12010:66;12155:22;;;12179:2;12151:31;12147:40;12135:53;;;12203:18;;;12223:22;;;12200:46;12197:72;;;12249:18;;:::i;:::-;12289:10;12285:2;12278:22;12324:2;12316:6;12309:18;12364:7;12359:2;12354;12350;12346:11;12342:20;12339:33;12336:53;;;12385:1;12382;12375:12;12336:53;12398:55;12450:2;12445;12437:6;12433:15;12428:2;12424;12420:11;12398:55;:::i;:::-;12472:6;11541:943;-1:-1:-1;;;;;;;11541:943:1:o;12489:184::-;12559:6;12612:2;12600:9;12591:7;12587:23;12583:32;12580:52;;;12628:1;12625;12618:12;12580:52;-1:-1:-1;12651:16:1;;12489:184;-1:-1:-1;12489:184:1:o;13848:163::-;13926:13;;13979:6;13968:18;;13958:29;;13948:57;;14001:1;13998;13991:12;14016:164;14092:13;;14141;;14134:21;14124:32;;14114:60;;14170:1;14167;14160:12;14185:745;14299:6;14307;14315;14323;14331;14339;14347;14400:3;14388:9;14379:7;14375:23;14371:33;14368:53;;;14417:1;14414;14407:12;14368:53;14449:9;14443:16;14468:31;14493:5;14468:31;:::i;:::-;14518:5;-1:-1:-1;14542:47:1;14585:2;14570:18;;14542:47;:::i;:::-;14532:57;;14608:48;14652:2;14641:9;14637:18;14608:48;:::i;:::-;14598:58;;14675:48;14719:2;14708:9;14704:18;14675:48;:::i;:::-;14665:58;;14742:49;14786:3;14775:9;14771:19;14742:49;:::i;:::-;14732:59;;14810:48;14853:3;14842:9;14838:19;14810:48;:::i;:::-;14800:58;;14877:47;14919:3;14908:9;14904:19;14877:47;:::i;:::-;14867:57;;14185:745;;;;;;;;;;:::o;14935:184::-;14987:77;14984:1;14977:88;15084:4;15081:1;15074:15;15108:4;15105:1;15098:15;15124:482;15213:1;15256:5;15213:1;15270:330;15291:7;15281:8;15278:21;15270:330;;;15410:4;15342:66;15338:77;15332:4;15329:87;15326:113;;;15419:18;;:::i;:::-;15469:7;15459:8;15455:22;15452:55;;;15489:16;;;;15452:55;15568:22;;;;15528:15;;;;15270:330;;;15274:3;15124:482;;;;;:::o;15611:866::-;15660:5;15690:8;15680:80;;-1:-1:-1;15731:1:1;15745:5;;15680:80;15779:4;15769:76;;-1:-1:-1;15816:1:1;15830:5;;15769:76;15861:4;15879:1;15874:59;;;;15947:1;15942:130;;;;15854:218;;15874:59;15904:1;15895:10;;15918:5;;;15942:130;15979:3;15969:8;15966:17;15963:43;;;15986:18;;:::i;:::-;-1:-1:-1;;16042:1:1;16028:16;;16057:5;;15854:218;;16156:2;16146:8;16143:16;16137:3;16131:4;16128:13;16124:36;16118:2;16108:8;16105:16;16100:2;16094:4;16091:12;16087:35;16084:77;16081:159;;;-1:-1:-1;16193:19:1;;;16225:5;;16081:159;16272:34;16297:8;16291:4;16272:34;:::i;:::-;16402:6;16334:66;16330:79;16321:7;16318:92;16315:118;;;16413:18;;:::i;:::-;16451:20;;15611:866;-1:-1:-1;;;15611:866:1:o;16482:131::-;16542:5;16571:36;16598:8;16592:4;16571:36;:::i;16618:184::-;16670:77;16667:1;16660:88;16767:4;16764:1;16757:15;16791:4;16788:1;16781:15;16807:120;16847:1;16873;16863:35;;16878:18;;:::i;:::-;-1:-1:-1;16912:9:1;;16807:120::o;16932:125::-;16972:4;17000:1;16997;16994:8;16991:34;;;17005:18;;:::i;:::-;-1:-1:-1;17042:9:1;;16932:125::o;17062:306::-;17150:6;17158;17166;17219:2;17207:9;17198:7;17194:23;17190:32;17187:52;;;17235:1;17232;17225:12;17187:52;17264:9;17258:16;17248:26;;17314:2;17303:9;17299:18;17293:25;17283:35;;17358:2;17347:9;17343:18;17337:25;17327:35;;17062:306;;;;;:::o;17373:228::-;17413:7;17539:1;17471:66;17467:74;17464:1;17461:81;17456:1;17449:9;17442:17;17438:105;17435:131;;;17546:18;;:::i;:::-;-1:-1:-1;17586:9:1;;17373:228::o;17606:128::-;17646:3;17677:1;17673:6;17670:1;17667:13;17664:39;;;17683:18;;:::i;:::-;-1:-1:-1;17719:9:1;;17606:128::o;18155:202::-;18222:6;18275:2;18263:9;18254:7;18250:23;18246:32;18243:52;;;18291:1;18288;18281:12;18243:52;18314:37;18341:9;18314:37;:::i;18362:191::-;18397:3;18428:66;18421:5;18418:77;18415:103;;;18498:18;;:::i;:::-;-1:-1:-1;18538:1:1;18534:13;;18362:191::o;18558:238::-;18592:3;18639:5;18636:1;18625:20;18669:66;18660:7;18657:79;18654:105;;;18739:18;;:::i;:::-;18779:1;18775:15;;18558:238;-1:-1:-1;;18558:238:1:o;19130:112::-;19162:1;19188;19178:35;;19193:18;;:::i;:::-;-1:-1:-1;19227:9:1;;19130:112::o;19247:254::-;19287:4;19316:42;19408:10;;;;19378;;19430:12;;;19427:38;;;19445:18;;:::i;:::-;19482:13;;19247:254;-1:-1:-1;;;19247:254:1:o
Swarm Source
ipfs://c7bce0590dabc2a880f955118b7291474da82e824ec9dd9a6cfc1c5a00a9abaf
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in GLMR
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.