Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 28 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Update Pool Weig... | 21336255 | 365 days ago | IN | 0 ETH | 0.06196861 | ||||
| Update Pool Weig... | 19768690 | 584 days ago | IN | 0 ETH | 0.06596834 | ||||
| Update Pool Weig... | 19668422 | 598 days ago | IN | 0 ETH | 0.03667109 | ||||
| Update Pool Weig... | 19574583 | 611 days ago | IN | 0 ETH | 0.04313587 | ||||
| Update Pool Weig... | 19386488 | 638 days ago | IN | 0 ETH | 0.06909795 | ||||
| Update Pool Weig... | 19318294 | 647 days ago | IN | 0 ETH | 0.07724558 | ||||
| Update Pool Weig... | 19311935 | 648 days ago | IN | 0 ETH | 0.07665965 | ||||
| Update Pool Weig... | 19283338 | 652 days ago | IN | 0 ETH | 0.05257629 | ||||
| Update Pool Weig... | 19247155 | 657 days ago | IN | 0 ETH | 0.04054661 | ||||
| Update Pool Weig... | 19197057 | 664 days ago | IN | 0 ETH | 0.04042111 | ||||
| Update Pool Weig... | 19162677 | 669 days ago | IN | 0 ETH | 0.04239118 | ||||
| Update Pool Weig... | 19135322 | 673 days ago | IN | 0 ETH | 0.05972115 | ||||
| Update Pool Weig... | 19134846 | 673 days ago | IN | 0 ETH | 0.0852263 | ||||
| Update Pool Weig... | 19134736 | 673 days ago | IN | 0 ETH | 0.06578643 | ||||
| Update Pool Weig... | 19134675 | 673 days ago | IN | 0 ETH | 0.05016159 | ||||
| Update Pool Weig... | 19134653 | 673 days ago | IN | 0 ETH | 0.05367029 | ||||
| Update Pool Weig... | 19132867 | 673 days ago | IN | 0 ETH | 0.02744353 | ||||
| Update Pool Weig... | 19130172 | 674 days ago | IN | 0 ETH | 0.03493765 | ||||
| Update Pool Weig... | 19129423 | 674 days ago | IN | 0 ETH | 0.04373807 | ||||
| Update Pool Weig... | 19128995 | 674 days ago | IN | 0 ETH | 0.03339548 | ||||
| Update Pool Weig... | 19128650 | 674 days ago | IN | 0 ETH | 0.06318395 | ||||
| Update Pool Weig... | 19084817 | 680 days ago | IN | 0 ETH | 0.09473836 | ||||
| Transfer Ownersh... | 19079740 | 681 days ago | IN | 0 ETH | 0.00037241 | ||||
| Add Pool Rebalan... | 19079304 | 681 days ago | IN | 0 ETH | 0.00137935 | ||||
| Add Pool Rebalan... | 19079302 | 681 days ago | IN | 0 ETH | 0.00137935 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
InflationManager
Compiler Version
v0.8.17+commit.8df45f5f
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
import "Ownable.sol";
import "EnumerableSet.sol";
import "IRebalancingRewardsHandler.sol";
import "IInflationManager.sol";
import "IController.sol";
import "ICNCToken.sol";
import "IConicPool.sol";
import "ILpToken.sol";
import "ScaledMath.sol";
contract InflationManager is IInflationManager, Ownable {
using ScaledMath for uint256;
using EnumerableSet for EnumerableSet.AddressSet;
ICNCToken public constant CNC = ICNCToken(0x9aE380F0272E2162340a5bB646c354271c0F5cFC);
IController public immutable controller;
uint256 internal constant _INITIAL_INFLATION_RATE = 1_500_000 * 1e18;
uint256 internal constant _INFLATION_RATE_DECAY = 0.3999999 * 1e18;
uint256 internal constant _INFLATION_RATE_PERIOD = 365 days;
// 155 days 66228 seconds: 1st of March 2023 (2023-03-01T14:34:23) to August 4th 2023 (2023-08-04T08:58:11)
uint256 internal constant _INFLATION_SECONDS_USED = 13_458_228;
/// @dev mapping from conic pool to their rebalancing reward handlers
mapping(address => EnumerableSet.AddressSet) internal _rebalancingRewardHandlers;
uint256 public override currentInflationRate;
uint256 public lastInflationRateDecay;
uint256 public totalLpInflationMinted;
mapping(address => uint256) public currentPoolWeights;
constructor(address _controller) Ownable() {
require(_controller != address(0), "Cannot use zero address for controller");
controller = IController(_controller);
currentInflationRate = _INITIAL_INFLATION_RATE / _INFLATION_RATE_PERIOD;
lastInflationRateDecay = block.timestamp - _INFLATION_SECONDS_USED;
}
/// @notice returns the weights of the Conic pools to know how much inflation
/// each of them will receive. totalUSDValue only accounts for funds in active pools
function computePoolWeights()
public
view
override
returns (address[] memory pools, uint256[] memory poolWeights, uint256 totalUSDValue)
{
IOracle oracle = controller.priceOracle();
pools = controller.listPools();
uint256[] memory poolUSDValues = new uint256[](pools.length);
for (uint256 i; i < pools.length; i++) {
if (controller.isActivePool(pools[i])) {
IConicPool pool = IConicPool(pools[i]);
IERC20Metadata underlying = pool.underlying();
uint256 price = oracle.getUSDPrice(address(underlying));
uint256 poolUSDValue = pool
.cachedTotalUnderlying()
.convertScale(underlying.decimals(), 18)
.mulDown(price);
poolUSDValues[i] = poolUSDValue;
totalUSDValue += poolUSDValue;
}
}
poolWeights = new uint256[](pools.length);
if (totalUSDValue == 0) {
for (uint256 i; i < pools.length; i++) {
poolWeights[i] = ScaledMath.ONE / pools.length;
}
} else {
for (uint256 i; i < pools.length; i++) {
poolWeights[i] = poolUSDValues[i].divDown(totalUSDValue);
}
}
}
/// @notice Same as `computePoolWeights` but only returns the value for a single pool
/// totalUSDValue only accounts for funds in active pools
function computePoolWeight(
address pool
) public view returns (uint256 poolWeight, uint256 totalUSDValue) {
require(controller.isPool(pool), "pool not found");
IOracle oracle = controller.priceOracle();
address[] memory pools = controller.listPools();
uint256 poolUSDValue;
for (uint256 i; i < pools.length; i++) {
if (controller.isActivePool(pools[i])) {
IConicPool currentPool = IConicPool(pools[i]);
IERC20Metadata underlying = currentPool.underlying();
uint256 price = oracle.getUSDPrice(address(underlying));
uint256 usdValue = currentPool
.cachedTotalUnderlying()
.convertScale(underlying.decimals(), 18)
.mulDown(price);
totalUSDValue += usdValue;
if (address(currentPool) == pool) poolUSDValue = usdValue;
}
}
if (!controller.isActivePool(pool)) {
return (0, totalUSDValue);
}
poolWeight = totalUSDValue == 0
? ScaledMath.ONE / pools.length
: poolUSDValue.divDown(totalUSDValue);
}
function executeInflationRateUpdate() external override {
_executeInflationRateUpdate();
}
function handleRebalancingRewards(
address account,
uint256 deviationBefore,
uint256 deviationAfter
) external {
require(controller.isPool(msg.sender), "only pools can call this function");
for (uint256 i; i < _rebalancingRewardHandlers[msg.sender].length(); i++) {
address handler = _rebalancingRewardHandlers[msg.sender].at(i);
IRebalancingRewardsHandler(handler).handleRebalancingRewards(
IConicPool(msg.sender),
account,
deviationBefore,
deviationAfter
);
}
}
function addPoolRebalancingRewardHandler(
address poolAddress,
address rebalancingRewardHandler
) external override onlyOwner {
require(controller.isPool(poolAddress), "invalid pool");
require(
_rebalancingRewardHandlers[poolAddress].add(rebalancingRewardHandler),
"handler already set"
);
emit RebalancingRewardHandlerAdded(poolAddress, rebalancingRewardHandler);
}
function removePoolRebalancingRewardHandler(
address poolAddress,
address rebalancingRewardHandler
) external override onlyOwner {
require(controller.isPool(poolAddress), "invalid pool");
require(
_rebalancingRewardHandlers[poolAddress].remove(rebalancingRewardHandler),
"handler not set"
);
emit RebalancingRewardHandlerRemoved(poolAddress, rebalancingRewardHandler);
}
function hasPoolRebalancingRewardHandler(
address poolAddress,
address handler
) external view returns (bool) {
return _rebalancingRewardHandlers[poolAddress].contains(handler);
}
function rebalancingRewardHandlers(
address poolAddress
) external view returns (address[] memory) {
return _rebalancingRewardHandlers[poolAddress].values();
}
function updatePoolWeights() public override {
(address[] memory _pools, uint256[] memory poolWeights, ) = computePoolWeights();
uint256 numPools = _pools.length;
ILpTokenStaker lpTokenStaker = controller.lpTokenStaker();
for (uint256 i; i < numPools; i++) {
address conicPool = _pools[i];
IConicPool(conicPool).runSanityChecks();
IRewardManager(IConicPool(conicPool).rewardManager()).poolCheckpoint();
lpTokenStaker.checkpoint(conicPool);
currentPoolWeights[conicPool] = poolWeights[i];
}
emit PoolWeightsUpdated();
}
/// @dev Pool weights will be updated periodically
function getCurrentPoolInflationRate(address pool) external view override returns (uint256) {
return currentInflationRate.mulDown(currentPoolWeights[pool]);
}
function _executeInflationRateUpdate() internal {
if (block.timestamp >= lastInflationRateDecay + _INFLATION_RATE_PERIOD) {
updatePoolWeights();
currentInflationRate = currentInflationRate.mulDown(_INFLATION_RATE_DECAY);
lastInflationRateDecay = block.timestamp;
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.
pragma solidity ^0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```solidity
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*
* [WARNING]
* ====
* Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
* unusable.
* See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
*
* In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
* array of EnumerableSet.
* ====
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping(bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
// Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastValue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastValue;
// Update the index for the moved value
set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
bytes32[] memory store = _values(set._inner);
bytes32[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
import "IConicPool.sol";
interface IRebalancingRewardsHandler {
event RebalancingRewardDistributed(
address indexed pool,
address indexed account,
address indexed token,
uint256 tokenAmount
);
/// @notice Handles the rewards distribution for the rebalancing of the pool
/// @param conicPool The pool that is being rebalanced
/// @param account The account that is rebalancing the pool
/// @param deviationBefore The total absolute deviation of the Conic pool before the rebalancing
/// @param deviationAfter The total absolute deviation of the Conic pool after the rebalancing
function handleRebalancingRewards(
IConicPool conicPool,
address account,
uint256 deviationBefore,
uint256 deviationAfter
) external;
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
import "ILpToken.sol";
import "IRewardManager.sol";
import "IOracle.sol";
import "IController.sol";
import "IPausable.sol";
import "IConicPoolWeightManagement.sol";
interface IConicPool is IConicPoolWeightManagement, IPausable {
event Deposit(
address indexed sender,
address indexed receiver,
uint256 depositedAmount,
uint256 lpReceived
);
event Withdraw(address indexed account, uint256 amount);
event NewWeight(address indexed curvePool, uint256 newWeight);
event NewMaxIdleCurveLpRatio(uint256 newRatio);
event ClaimedRewards(uint256 claimedCrv, uint256 claimedCvx);
event HandledDepeggedCurvePool(address curvePool_);
event HandledInvalidConvexPid(address curvePool_, uint256 pid_);
event CurvePoolAdded(address curvePool_);
event CurvePoolRemoved(address curvePool_);
event Shutdown();
event DepegThresholdUpdated(uint256 newThreshold);
event MaxDeviationUpdated(uint256 newMaxDeviation);
event RebalancingRewardsEnabledSet(bool enabled);
event EmergencyRebalancingRewardFactorUpdated(uint256 factor);
struct PoolWithAmount {
address poolAddress;
uint256 amount;
}
function underlying() external view returns (IERC20Metadata);
function lpToken() external view returns (ILpToken);
function rewardManager() external view returns (IRewardManager);
function depegThreshold() external view returns (uint256);
function maxIdleCurveLpRatio() external view returns (uint256);
function setMaxIdleCurveLpRatio(uint256 value) external;
function setMaxDeviation(uint256 maxDeviation_) external;
function updateDepegThreshold(uint256 value) external;
function depositFor(
address _account,
uint256 _amount,
uint256 _minLpReceived,
bool stake
) external returns (uint256);
function deposit(uint256 _amount, uint256 _minLpReceived) external returns (uint256);
function deposit(
uint256 _amount,
uint256 _minLpReceived,
bool stake
) external returns (uint256);
function exchangeRate() external view returns (uint256);
function usdExchangeRate() external view returns (uint256);
function unstakeAndWithdraw(uint256 _amount, uint256 _minAmount) external returns (uint256);
function unstakeAndWithdraw(
uint256 _amount,
uint256 _minAmount,
address _to
) external returns (uint256);
function withdraw(uint256 _amount, uint256 _minAmount) external returns (uint256);
function withdraw(uint256 _amount, uint256 _minAmount, address _to) external returns (uint256);
function getAllocatedUnderlying() external view returns (PoolWithAmount[] memory);
function rebalancingRewardActive() external view returns (bool);
function totalDeviationAfterWeightUpdate() external view returns (uint256);
function computeTotalDeviation() external view returns (uint256);
/// @notice returns the total amount of funds held by this pool in terms of underlying
function totalUnderlying() external view returns (uint256);
function getTotalAndPerPoolUnderlying()
external
view
returns (
uint256 totalUnderlying_,
uint256 totalAllocated_,
uint256[] memory perPoolUnderlying_
);
/// @notice same as `totalUnderlying` but returns a cached version
/// that might be slightly outdated if oracle prices have changed
/// @dev this is useful in cases where we want to reduce gas usage and do
/// not need a precise value
function cachedTotalUnderlying() external view returns (uint256);
function updateRewardSpendingApproval(address token, bool approved) external;
function shutdownPool() external;
function isShutdown() external view returns (bool);
function isBalanced() external view returns (bool);
function rebalancingRewardsEnabled() external view returns (bool);
function setRebalancingRewardsEnabled(bool enabled) external;
function getAllUnderlyingCoins() external view returns (address[] memory result);
function rebalancingRewardsFactor() external view returns (uint256);
function rebalancingRewardsActivatedAt() external view returns (uint64);
function getWeights() external view returns (PoolWeight[] memory);
function runSanityChecks() external;
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
import "IERC20Metadata.sol";
interface ILpToken is IERC20Metadata {
function minter() external view returns (address);
function mint(address account, uint256 amount, address ubo) external returns (uint256);
function burn(address _owner, uint256 _amount, address ubo) external returns (uint256);
function taint(address from, address to, uint256 amount) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
interface IRewardManager {
event ClaimedRewards(uint256 claimedCrv, uint256 claimedCvx);
event SoldRewardTokens(uint256 targetTokenReceived);
event ExtraRewardAdded(address reward);
event ExtraRewardRemoved(address reward);
event ExtraRewardsCurvePoolSet(address extraReward, address curvePool);
event FeesSet(uint256 feePercentage);
event FeesEnabled(uint256 feePercentage);
event EarningsClaimed(
address indexed claimedBy,
uint256 cncEarned,
uint256 crvEarned,
uint256 cvxEarned
);
function accountCheckpoint(address account) external;
function poolCheckpoint() external returns (bool);
function addExtraReward(address reward) external returns (bool);
function addBatchExtraRewards(address[] memory rewards) external;
function conicPool() external view returns (address);
function setFeePercentage(uint256 _feePercentage) external;
function claimableRewards(
address account
) external view returns (uint256 cncRewards, uint256 crvRewards, uint256 cvxRewards);
function claimEarnings() external returns (uint256, uint256, uint256);
function claimPoolEarningsAndSellRewardTokens() external;
function feePercentage() external view returns (uint256);
function feesEnabled() external view returns (bool);
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
interface IOracle {
event TokenUpdated(address indexed token, address feed, uint256 maxDelay, bool isEthPrice);
/// @notice returns the price in USD of symbol.
function getUSDPrice(address token) external view returns (uint256);
/// @notice returns if the given token is supported for pricing.
function isTokenSupported(address token) external view returns (bool);
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
import "IConicPoolWeightManagement.sol";
import "IConicPool.sol";
import "IGenericOracle.sol";
import "IInflationManager.sol";
import "ILpTokenStaker.sol";
import "IBonding.sol";
import "IPoolAdapter.sol";
import "IFeeRecipient.sol";
import "ICurveRegistryCache.sol";
interface IController {
event PoolAdded(address indexed pool);
event PoolRemoved(address indexed pool);
event PoolShutdown(address indexed pool);
event ConvexBoosterSet(address convexBooster);
event CurveHandlerSet(address curveHandler);
event ConvexHandlerSet(address convexHandler);
event CurveRegistryCacheSet(address curveRegistryCache);
event InflationManagerSet(address inflationManager);
event BondingSet(address bonding);
event FeeRecipientSet(address feeRecipient);
event PriceOracleSet(address priceOracle);
event WeightUpdateMinDelaySet(uint256 weightUpdateMinDelay);
event PauseManagerSet(address indexed manager, bool isManager);
event MultiDepositsWithdrawsWhitelistSet(address pool, bool allowed);
event MinimumTaintedTransferAmountSet(address indexed token, uint256 amount);
event DefaultPoolAdapterSet(address poolAdapter);
event CustomPoolAdapterSet(address indexed pool, address poolAdapter);
struct WeightUpdate {
address conicPoolAddress;
IConicPoolWeightManagement.PoolWeight[] weights;
}
function initialize(address _lpTokenStaker) external;
// inflation manager
function inflationManager() external view returns (IInflationManager);
function setInflationManager(address manager) external;
// views
function curveRegistryCache() external view returns (ICurveRegistryCache);
// pool adapter
function poolAdapterFor(address pool) external view returns (IPoolAdapter);
function defaultPoolAdapter() external view returns (IPoolAdapter);
function setDefaultPoolAdapter(address poolAdapter) external;
function setCustomPoolAdapter(address pool, address poolAdapter) external;
/// lp token staker
function switchLpTokenStaker(address _lpTokenStaker) external;
function lpTokenStaker() external view returns (ILpTokenStaker);
// bonding
function bonding() external view returns (IBonding);
function setBonding(address _bonding) external;
// fees
function feeRecipient() external view returns (IFeeRecipient);
function setFeeRecipient(address _feeRecipient) external;
// oracle
function priceOracle() external view returns (IGenericOracle);
function setPriceOracle(address oracle) external;
// pool functions
function listPools() external view returns (address[] memory);
function listActivePools() external view returns (address[] memory);
function isPool(address poolAddress) external view returns (bool);
function isActivePool(address poolAddress) external view returns (bool);
function addPool(address poolAddress) external;
function shutdownPool(address poolAddress) external;
function removePool(address poolAddress) external;
function cncToken() external view returns (address);
function lastWeightUpdate(address poolAddress) external view returns (uint256);
function updateWeights(WeightUpdate memory update) external;
function updateAllWeights(WeightUpdate[] memory weights) external;
// handler functions
function convexBooster() external view returns (address);
function curveHandler() external view returns (address);
function convexHandler() external view returns (address);
function setConvexBooster(address _convexBooster) external;
function setCurveHandler(address _curveHandler) external;
function setConvexHandler(address _convexHandler) external;
function setCurveRegistryCache(address curveRegistryCache_) external;
function setWeightUpdateMinDelay(uint256 delay) external;
function isPauseManager(address account) external view returns (bool);
function listPauseManagers() external view returns (address[] memory);
function setPauseManager(address account, bool isManager) external;
// deposit/withdrawal whitelist
function isAllowedMultipleDepositsWithdraws(address poolAddress) external view returns (bool);
function setAllowedMultipleDepositsWithdraws(address account, bool allowed) external;
function getMultipleDepositsWithdrawsWhitelist() external view returns (address[] memory);
// tainted transfer amount
function setMinimumTaintedTransferAmount(address token, uint256 amount) external;
function getMinimumTaintedTransferAmount(address token) external view returns (uint256);
// constants
function MAX_WEIGHT_UPDATE_MIN_DELAY() external view returns (uint256);
function MIN_WEIGHT_UPDATE_MIN_DELAY() external view returns (uint256);
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
interface IConicPoolWeightManagement {
struct PoolWeight {
address poolAddress;
uint256 weight;
}
function addPool(address pool) external;
function removePool(address pool) external;
function updateWeights(PoolWeight[] memory poolWeights) external;
function handleDepeggedCurvePool(address curvePool_) external;
function handleInvalidConvexPid(address pool) external returns (uint256);
function allPools() external view returns (address[] memory);
function poolsCount() external view returns (uint256);
function getPoolAtIndex(uint256 _index) external view returns (address);
function getWeight(address curvePool) external view returns (uint256);
function getWeights() external view returns (PoolWeight[] memory);
function isRegisteredPool(address _pool) external view returns (bool);
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
import "IOracle.sol";
interface IGenericOracle is IOracle {
/// @notice returns the oracle to be used to price `token`
function getOracle(address token) external view returns (IOracle);
/// @notice converts the price of an LP token to the given underlying
function curveLpToUnderlying(
address curveLpToken,
address underlying,
uint256 curveLpAmount
) external view returns (uint256);
/// @notice same as above but avoids fetching the underlying price again
function curveLpToUnderlying(
address curveLpToken,
address underlying,
uint256 curveLpAmount,
uint256 underlyingPrice
) external view returns (uint256);
/// @notice converts the price an underlying asset to a given Curve LP token
function underlyingToCurveLp(
address underlying,
address curveLpToken,
uint256 underlyingAmount
) external view returns (uint256);
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
interface IInflationManager {
event TokensClaimed(address indexed pool, uint256 cncAmount);
event RebalancingRewardHandlerAdded(address indexed pool, address indexed handler);
event RebalancingRewardHandlerRemoved(address indexed pool, address indexed handler);
event PoolWeightsUpdated();
function executeInflationRateUpdate() external;
function updatePoolWeights() external;
/// @notice returns the weights of the Conic pools to know how much inflation
/// each of them will receive, as well as the total amount of USD value in all the pools
function computePoolWeights()
external
view
returns (address[] memory _pools, uint256[] memory poolWeights, uint256 totalUSDValue);
function computePoolWeight(
address pool
) external view returns (uint256 poolWeight, uint256 totalUSDValue);
function currentInflationRate() external view returns (uint256);
function getCurrentPoolInflationRate(address pool) external view returns (uint256);
function handleRebalancingRewards(
address account,
uint256 deviationBefore,
uint256 deviationAfter
) external;
function addPoolRebalancingRewardHandler(
address poolAddress,
address rebalancingRewardHandler
) external;
function removePoolRebalancingRewardHandler(
address poolAddress,
address rebalancingRewardHandler
) external;
function rebalancingRewardHandlers(
address poolAddress
) external view returns (address[] memory);
function hasPoolRebalancingRewardHandler(
address poolAddress,
address handler
) external view returns (bool);
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
interface ILpTokenStaker {
event LpTokenStaked(address indexed account, uint256 amount);
event LpTokenUnstaked(address indexed account, uint256 amount);
event TokensClaimed(address indexed pool, uint256 cncAmount);
event Shutdown();
function stake(uint256 amount, address conicPool) external;
function unstake(uint256 amount, address conicPool) external;
function stakeFor(uint256 amount, address conicPool, address account) external;
function unstakeFor(uint256 amount, address conicPool, address account) external;
function unstakeFrom(uint256 amount, address account) external;
function getUserBalanceForPool(
address conicPool,
address account
) external view returns (uint256);
function getBalanceForPool(address conicPool) external view returns (uint256);
function updateBoost(address user) external;
function claimCNCRewardsForPool(address pool) external;
function claimableCnc(address pool) external view returns (uint256);
function checkpoint(address pool) external returns (uint256);
function shutdown() external;
function getBoost(address user) external view returns (uint256);
function isShutdown() external view returns (bool);
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
interface IBonding {
event CncStartPriceSet(uint256 startPrice);
event PriceIncreaseFactorSet(uint256 factor);
event MinBondingAmountSet(uint256 amount);
event Bonded(
address indexed account,
address indexed recipient,
uint256 lpTokenAmount,
uint256 cncReceived,
uint256 lockTime
);
event DebtPoolSet(address indexed pool);
event DebtPoolFeesClaimed(uint256 crvAmount, uint256 cvxAmount, uint256 cncAmount);
event StreamClaimed(address indexed account, uint256 amount);
event BondingStarted(uint256 amount, uint256 epochs);
event RemainingCNCRecovered(uint256 amount);
function startBonding() external;
function setCncStartPrice(uint256 _cncStartPrice) external;
function setCncPriceIncreaseFactor(uint256 _priceIncreaseFactor) external;
function setMinBondingAmount(uint256 _minBondingAmount) external;
function setDebtPool(address _debtPool) external;
function bondCncCrvUsd(
uint256 lpTokenAmount,
uint256 minCncReceived,
uint64 cncLockTime
) external returns (uint256);
function recoverRemainingCNC() external;
function claimStream() external;
function claimFeesForDebtPool() external;
function streamCheckpoint() external;
function accountCheckpoint(address account) external;
function computeCurrentCncBondPrice() external view returns (uint256);
function cncAvailable() external view returns (uint256);
function cncBondPrice() external view returns (uint256);
function bondCncCrvUsdFor(
uint256 lpTokenAmount,
uint256 minCncReceived,
uint64 cncLockTime,
address recipient
) external returns (uint256);
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
interface IPoolAdapter {
/// @notice This is to set which LP token price the value computation should use
/// `Latest` uses a freshly computed price
/// `Cached` uses the price in cache
/// `Minimum` uses the minimum of these two
enum PriceMode {
Latest,
Cached,
Minimum
}
/// @notice Deposit `underlyingAmount` of `underlying` into `pool`
/// @dev This function should be written with the assumption that it will be delegate-called into
function deposit(address pool, address underlying, uint256 underlyingAmount) external;
/// @notice Withdraw `underlyingAmount` of `underlying` from `pool`
/// @dev This function should be written with the assumption that it will be delegate-called into
function withdraw(address pool, address underlying, uint256 underlyingAmount) external;
/// @notice Returns the amount of of assets that `conicPool` holds in `pool`, in terms of USD
function computePoolValueInUSD(
address conicPool,
address pool
) external view returns (uint256 usdAmount);
/// @notice Updates the price caches of the given pools
function updatePriceCache(address pool) external;
/// @notice Returns the amount of of assets that `conicPool` holds in `pool`, in terms of USD
/// using the given price mode
function computePoolValueInUSD(
address conicPool,
address pool,
PriceMode priceMode
) external view returns (uint256 usdAmount);
/// @notice Returns the amount of of assets that `conicPool` holds in `pool`, in terms of underlying
function computePoolValueInUnderlying(
address conicPool,
address pool,
address underlying,
uint256 underlyingPrice
) external view returns (uint256 underlyingAmount);
/// @notice Returns the amount of of assets that `conicPool` holds in `pool`, in terms of underlying
/// using the given price mode
function computePoolValueInUnderlying(
address conicPool,
address pool,
address underlying,
uint256 underlyingPrice,
PriceMode priceMode
) external view returns (uint256 underlyingAmount);
/// @notice Claim earnings of `conicPool` from `pool`
function claimEarnings(address conicPool, address pool) external;
/// @notice Returns the LP token of a given `pool`
function lpToken(address pool) external view returns (address);
/// @notice Returns true if `pool` supports `asset`
function supportsAsset(address pool, address asset) external view returns (bool);
/// @notice Returns the amount of CRV earned by `pool` on Convex
function getCRVEarnedOnConvex(
address account,
address curvePool
) external view returns (uint256);
/// @notice Executes a sanity check, e.g. checking for reentrancy
function executeSanityCheck(address pool) external;
/// @notice returns all the underlying coins of the pool
function getAllUnderlyingCoins(address pool) external view returns (address[] memory);
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
interface IFeeRecipient {
event FeesReceived(address indexed sender, uint256 crvAmount, uint256 cvxAmount);
function receiveFees(uint256 amountCrv, uint256 amountCvx) external;
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
import "IBooster.sol";
import "CurvePoolUtils.sol";
interface ICurveRegistryCache {
event PoolInitialized(address indexed pool, uint256 indexed pid);
function BOOSTER() external view returns (IBooster);
function initPool(address pool_) external;
function initPool(address pool_, uint256 pid_) external;
function lpToken(address pool_) external view returns (address);
function assetType(address pool_) external view returns (CurvePoolUtils.AssetType);
function isRegistered(address pool_) external view returns (bool);
function hasCoinDirectly(address pool_, address coin_) external view returns (bool);
function hasCoinAnywhere(address pool_, address coin_) external view returns (bool);
function basePool(address pool_) external view returns (address);
function coinIndex(address pool_, address coin_) external view returns (int128);
function nCoins(address pool_) external view returns (uint256);
function coinIndices(
address pool_,
address from_,
address to_
) external view returns (int128, int128, bool);
function decimals(address pool_) external view returns (uint256[] memory);
function interfaceVersion(address pool_) external view returns (uint256);
function poolFromLpToken(address lpToken_) external view returns (address);
function coins(address pool_) external view returns (address[] memory);
function getPid(address _pool) external view returns (uint256);
function getRewardPool(address _pool) external view returns (address);
function isShutdownPid(uint256 pid_) external view returns (bool);
/// @notice this returns the underlying coins of a pool, including the underlying of the base pool
/// if the given pool is a meta pool
/// This does not return the LP token of the base pool as an underlying
/// e.g. if the pool is 3CrvFrax, this will return FRAX, DAI, USDC, USDT
function getAllUnderlyingCoins(address pool) external view returns (address[] memory);
}// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.17;
interface IBooster {
function poolInfo(
uint256 pid
)
external
view
returns (
address lpToken,
address token,
address gauge,
address crvRewards,
address stash,
bool shutdown
);
function poolLength() external view returns (uint256);
function deposit(uint256 _pid, uint256 _amount, bool _stake) external returns (bool);
function withdraw(uint256 _pid, uint256 _amount) external returns (bool);
function withdrawAll(uint256 _pid) external returns (bool);
function depositAll(uint256 _pid, bool _stake) external returns (bool);
function earmarkRewards(uint256 _pid) external returns (bool);
function isShutdown() external view returns (bool);
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
import "ICurvePoolV2.sol";
import "ICurvePoolV1.sol";
import "ScaledMath.sol";
library CurvePoolUtils {
using ScaledMath for uint256;
error NotWithinThreshold(address pool, uint256 assetA, uint256 assetB);
/// @dev by default, allow for 30 bps deviation regardless of pool fees
uint256 internal constant _DEFAULT_IMBALANCE_BUFFER = 30e14;
/// @dev Curve scales the `fee` by 1e10
uint8 internal constant _CURVE_POOL_FEE_DECIMALS = 10;
/// @dev allow imbalance to be buffer + 3x the fee, e.g. if fee is 3.6 bps and buffer is 30 bps, allow 40.8 bps
uint256 internal constant _FEE_IMBALANCE_MULTIPLIER = 3;
enum AssetType {
USD,
ETH,
BTC,
OTHER,
CRYPTO
}
struct PoolMeta {
address pool;
uint256 numberOfCoins;
AssetType assetType;
uint256[] decimals;
uint256[] prices;
uint256[] imbalanceBuffers;
}
function ensurePoolBalanced(PoolMeta memory poolMeta) internal view {
uint256 poolFee = ICurvePoolV1(poolMeta.pool).fee().convertScale(
_CURVE_POOL_FEE_DECIMALS,
18
);
for (uint256 i = 0; i < poolMeta.numberOfCoins - 1; i++) {
uint256 fromDecimals = poolMeta.decimals[i];
uint256 fromBalance = 10 ** fromDecimals;
uint256 fromPrice = poolMeta.prices[i];
for (uint256 j = i + 1; j < poolMeta.numberOfCoins; j++) {
uint256 toDecimals = poolMeta.decimals[j];
uint256 toPrice = poolMeta.prices[j];
uint256 toExpectedUnscaled = (fromBalance * fromPrice) / toPrice;
uint256 toExpected = toExpectedUnscaled.convertScale(
uint8(fromDecimals),
uint8(toDecimals)
);
uint256 toActual;
if (poolMeta.assetType == AssetType.CRYPTO) {
// Handling crypto pools
toActual = ICurvePoolV2(poolMeta.pool).get_dy(i, j, fromBalance);
} else {
// Handling other pools
toActual = ICurvePoolV1(poolMeta.pool).get_dy(
int128(uint128(i)),
int128(uint128(j)),
fromBalance
);
}
uint256 _maxImbalanceBuffer = poolMeta.imbalanceBuffers[i].max(
poolMeta.imbalanceBuffers[j]
);
if (!_isWithinThreshold(toExpected, toActual, poolFee, _maxImbalanceBuffer))
revert NotWithinThreshold(poolMeta.pool, i, j);
}
}
}
function _isWithinThreshold(
uint256 a,
uint256 b,
uint256 poolFee,
uint256 imbalanceBuffer
) internal pure returns (bool) {
if (imbalanceBuffer == 0) imbalanceBuffer = _DEFAULT_IMBALANCE_BUFFER;
uint256 imbalanceTreshold = imbalanceBuffer + poolFee * _FEE_IMBALANCE_MULTIPLIER;
if (a > b) return (a - b).divDown(a) <= imbalanceTreshold;
return (b - a).divDown(b) <= imbalanceTreshold;
}
}// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.17;
interface ICurvePoolV2 {
function token() external view returns (address);
function coins(uint256 i) external view returns (address);
function factory() external view returns (address);
function exchange(
uint256 i,
uint256 j,
uint256 dx,
uint256 min_dy,
bool use_eth,
address receiver
) external returns (uint256);
function exchange_underlying(
uint256 i,
uint256 j,
uint256 dx,
uint256 min_dy,
address receiver
) external returns (uint256);
function add_liquidity(
uint256[2] memory amounts,
uint256 min_mint_amount,
bool use_eth,
address receiver
) external returns (uint256);
function add_liquidity(
uint256[2] memory amounts,
uint256 min_mint_amount
) external returns (uint256);
function add_liquidity(
uint256[3] memory amounts,
uint256 min_mint_amount,
bool use_eth,
address receiver
) external returns (uint256);
function add_liquidity(
uint256[3] memory amounts,
uint256 min_mint_amount
) external returns (uint256);
function remove_liquidity(
uint256 _amount,
uint256[2] memory min_amounts,
bool use_eth,
address receiver
) external;
function remove_liquidity(uint256 _amount, uint256[2] memory min_amounts) external;
function remove_liquidity(
uint256 _amount,
uint256[3] memory min_amounts,
bool use_eth,
address receiver
) external;
function remove_liquidity(uint256 _amount, uint256[3] memory min_amounts) external;
function remove_liquidity_one_coin(
uint256 token_amount,
uint256 i,
uint256 min_amount,
bool use_eth,
address receiver
) external returns (uint256);
function get_dy(uint256 i, uint256 j, uint256 dx) external view returns (uint256);
function calc_token_amount(uint256[] memory amounts) external view returns (uint256);
function calc_withdraw_one_coin(
uint256 token_amount,
uint256 i
) external view returns (uint256);
function get_virtual_price() external view returns (uint256);
}// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.17;
interface ICurvePoolV1 {
function get_virtual_price() external view returns (uint256);
function add_liquidity(uint256[8] calldata amounts, uint256 min_mint_amount) external;
function add_liquidity(uint256[7] calldata amounts, uint256 min_mint_amount) external;
function add_liquidity(uint256[6] calldata amounts, uint256 min_mint_amount) external;
function add_liquidity(uint256[5] calldata amounts, uint256 min_mint_amount) external;
function add_liquidity(uint256[4] calldata amounts, uint256 min_mint_amount) external;
function add_liquidity(uint256[3] calldata amounts, uint256 min_mint_amount) external;
function add_liquidity(uint256[2] calldata amounts, uint256 min_mint_amount) external;
function remove_liquidity_imbalance(
uint256[4] calldata amounts,
uint256 max_burn_amount
) external;
function remove_liquidity_imbalance(
uint256[3] calldata amounts,
uint256 max_burn_amount
) external;
function remove_liquidity_imbalance(
uint256[2] calldata amounts,
uint256 max_burn_amount
) external;
function lp_token() external view returns (address);
function A_PRECISION() external view returns (uint256);
function A_precise() external view returns (uint256);
function remove_liquidity(uint256 _amount, uint256[3] calldata min_amounts) external;
function exchange(
int128 from,
int128 to,
uint256 _from_amount,
uint256 _min_to_amount
) external;
function coins(uint256 i) external view returns (address);
function balances(uint256 i) external view returns (uint256);
function get_dy(int128 i, int128 j, uint256 _dx) external view returns (uint256);
function calc_token_amount(
uint256[4] calldata amounts,
bool deposit
) external view returns (uint256);
function calc_token_amount(
uint256[3] calldata amounts,
bool deposit
) external view returns (uint256);
function calc_token_amount(
uint256[2] calldata amounts,
bool deposit
) external view returns (uint256);
function calc_withdraw_one_coin(
uint256 _token_amount,
int128 i
) external view returns (uint256);
function remove_liquidity_one_coin(
uint256 _token_amount,
int128 i,
uint256 min_amount
) external;
function fee() external view returns (uint256);
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
library ScaledMath {
uint256 internal constant DECIMALS = 18;
uint256 internal constant ONE = 10 ** DECIMALS;
function mulDown(uint256 a, uint256 b) internal pure returns (uint256) {
return (a * b) / ONE;
}
function mulDown(uint256 a, uint256 b, uint256 decimals) internal pure returns (uint256) {
return (a * b) / (10 ** decimals);
}
function divDown(uint256 a, uint256 b) internal pure returns (uint256) {
return (a * ONE) / b;
}
function divDown(uint256 a, uint256 b, uint256 decimals) internal pure returns (uint256) {
return (a * 10 ** decimals) / b;
}
function divUp(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
return ((a * ONE) - 1) / b + 1;
}
function mulDown(int256 a, int256 b) internal pure returns (int256) {
return (a * b) / int256(ONE);
}
function mulDownUint128(uint128 a, uint128 b) internal pure returns (uint128) {
return (a * b) / uint128(ONE);
}
function mulDown(int256 a, int256 b, uint256 decimals) internal pure returns (int256) {
return (a * b) / int256(10 ** decimals);
}
function divDown(int256 a, int256 b) internal pure returns (int256) {
return (a * int256(ONE)) / b;
}
function divDownUint128(uint128 a, uint128 b) internal pure returns (uint128) {
return (a * uint128(ONE)) / b;
}
function divDown(int256 a, int256 b, uint256 decimals) internal pure returns (int256) {
return (a * int256(10 ** decimals)) / b;
}
function convertScale(
uint256 a,
uint8 fromDecimals,
uint8 toDecimals
) internal pure returns (uint256) {
if (fromDecimals == toDecimals) return a;
if (fromDecimals > toDecimals) return downscale(a, fromDecimals, toDecimals);
return upscale(a, fromDecimals, toDecimals);
}
function convertScale(
int256 a,
uint8 fromDecimals,
uint8 toDecimals
) internal pure returns (int256) {
if (fromDecimals == toDecimals) return a;
if (fromDecimals > toDecimals) return downscale(a, fromDecimals, toDecimals);
return upscale(a, fromDecimals, toDecimals);
}
function upscale(
uint256 a,
uint8 fromDecimals,
uint8 toDecimals
) internal pure returns (uint256) {
return a * (10 ** (toDecimals - fromDecimals));
}
function downscale(
uint256 a,
uint8 fromDecimals,
uint8 toDecimals
) internal pure returns (uint256) {
return a / (10 ** (fromDecimals - toDecimals));
}
function upscale(
int256 a,
uint8 fromDecimals,
uint8 toDecimals
) internal pure returns (int256) {
return a * int256(10 ** (toDecimals - fromDecimals));
}
function downscale(
int256 a,
uint8 fromDecimals,
uint8 toDecimals
) internal pure returns (int256) {
return a / int256(10 ** (fromDecimals - toDecimals));
}
function intPow(uint256 a, uint256 n) internal pure returns (uint256) {
uint256 result = ONE;
for (uint256 i; i < n; ) {
result = mulDown(result, a);
unchecked {
++i;
}
}
return result;
}
function absSub(uint256 a, uint256 b) internal pure returns (uint256) {
unchecked {
return a >= b ? a - b : b - a;
}
}
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a <= b ? a : b;
}
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
import "Ownable.sol";
import "IController.sol";
interface IPausable {
event Paused(uint256 pausedUntil);
event PauseDurationSet(uint256 pauseDuration);
function controller() external view returns (IController);
function pausedUntil() external view returns (uint256);
function pauseDuration() external view returns (uint256);
function isPaused() external view returns (bool);
function setPauseDuration(uint256 _pauseDuration) external;
function pause() external;
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
import "IERC20.sol";
interface ICNCToken is IERC20 {
event MinterAdded(address minter);
event MinterRemoved(address minter);
event InitialDistributionMinted(uint256 amount);
event AirdropMinted(uint256 amount);
event AMMRewardsMinted(uint256 amount);
event TreasuryRewardsMinted(uint256 amount);
event SeedShareMinted(uint256 amount);
/// @notice adds a new minter
function addMinter(address newMinter) external;
/// @notice renounces the minter rights of the sender
function renounceMinterRights() external;
/// @notice mints the initial distribution amount to the distribution contract
function mintInitialDistribution(address distribution) external;
/// @notice mints the airdrop amount to the airdrop contract
function mintAirdrop(address airdropHandler) external;
/// @notice mints the amm rewards
function mintAMMRewards(address ammGauge) external;
/// @notice mints `amount` to `account`
function mint(address account, uint256 amount) external returns (uint256);
/// @notice returns a list of all authorized minters
function listMinters() external view returns (address[] memory);
/// @notice returns the ratio of inflation already minted
function inflationMintedRatio() external view returns (uint256);
}{
"evmVersion": "london",
"optimizer": {
"enabled": true,
"runs": 200
},
"libraries": {
"InflationManager.sol": {}
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[],"name":"PoolWeightsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"},{"indexed":true,"internalType":"address","name":"handler","type":"address"}],"name":"RebalancingRewardHandlerAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"},{"indexed":true,"internalType":"address","name":"handler","type":"address"}],"name":"RebalancingRewardHandlerRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"},{"indexed":false,"internalType":"uint256","name":"cncAmount","type":"uint256"}],"name":"TokensClaimed","type":"event"},{"inputs":[],"name":"CNC","outputs":[{"internalType":"contract ICNCToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"poolAddress","type":"address"},{"internalType":"address","name":"rebalancingRewardHandler","type":"address"}],"name":"addPoolRebalancingRewardHandler","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"computePoolWeight","outputs":[{"internalType":"uint256","name":"poolWeight","type":"uint256"},{"internalType":"uint256","name":"totalUSDValue","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"computePoolWeights","outputs":[{"internalType":"address[]","name":"pools","type":"address[]"},{"internalType":"uint256[]","name":"poolWeights","type":"uint256[]"},{"internalType":"uint256","name":"totalUSDValue","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"contract IController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentInflationRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"currentPoolWeights","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"executeInflationRateUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"getCurrentPoolInflationRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"deviationBefore","type":"uint256"},{"internalType":"uint256","name":"deviationAfter","type":"uint256"}],"name":"handleRebalancingRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"poolAddress","type":"address"},{"internalType":"address","name":"handler","type":"address"}],"name":"hasPoolRebalancingRewardHandler","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastInflationRateDecay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"poolAddress","type":"address"}],"name":"rebalancingRewardHandlers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"poolAddress","type":"address"},{"internalType":"address","name":"rebalancingRewardHandler","type":"address"}],"name":"removePoolRebalancingRewardHandler","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalLpInflationMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updatePoolWeights","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60a06040523480156200001157600080fd5b506040516200204e3803806200204e83398101604081905262000034916200013d565b6200003f33620000ed565b6001600160a01b038116620000a95760405162461bcd60e51b815260206004820152602660248201527f43616e6e6f7420757365207a65726f206164647265737320666f7220636f6e746044820152653937b63632b960d11b606482015260840160405180910390fd5b6001600160a01b038116608052620000d16301e133806a013da329b63364718000006200016f565b600255620000e362cd5b344262000192565b60035550620001ba565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156200015057600080fd5b81516001600160a01b03811681146200016857600080fd5b9392505050565b6000826200018d57634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115620001b457634e487b7160e01b600052601160045260246000fd5b92915050565b608051611e246200022a600039600081816102b8015281816102fe015281816103af01528181610435015281816104ca015281816107b40152818161087b01528181610a5101528181610d2d01528181610ede01528181610f620152818161103e01526113b30152611e246000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c80638da5cb5b116100ad578063cd1c374f11610071578063cd1c374f1461027b578063d30113b714610284578063dba8cc351461028d578063f2fde38b146102a0578063f77c4791146102b357600080fd5b80638da5cb5b1461020a578063965125c61461021b578063a53eb52e1461023b578063a563c3d514610252578063ad174d8e1461025b57600080fd5b80634a17ed59116100f45780634a17ed591461019157806356a0d31514610199578063632473da146101ac578063715018a6146101df57806373c96394146101e757600080fd5b8063129e16511461012657806314915ebe146101535780631d43c9d3146101685780633dc4f7de14610189575b600080fd5b610139610134366004611974565b6102da565b604080519283526020830191909152015b60405180910390f35b610166610161366004611991565b610866565b005b61017b610176366004611974565b610a0c565b60405190815260200161014a565b610166610a37565b610166610cfc565b6101666101a73660046119c6565b610d06565b6101c7739ae380f0272e2162340a5bb646c354271c0f5cfc81565b6040516001600160a01b03909116815260200161014a565b610166610e77565b6101fa6101f53660046119c6565b610e89565b604051901515815260200161014a565b6000546001600160a01b03166101c7565b61022e610229366004611974565b610eb2565b60405161014a9190611a43565b610243610ed6565b60405161014a93929190611a56565b61017b60025481565b61017b610269366004611974565b60056020526000908152604090205481565b61017b60045481565b61017b60035481565b61016661029b3660046119c6565b61138c565b6101666102ae366004611974565b611501565b6101c77f000000000000000000000000000000000000000000000000000000000000000081565b604051635b16ebb760e01b81526001600160a01b03828116600483015260009182917f00000000000000000000000000000000000000000000000000000000000000001690635b16ebb790602401602060405180830381865afa158015610345573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103699190611ab6565b6103ab5760405162461bcd60e51b815260206004820152600e60248201526d1c1bdbdb081b9bdd08199bdd5b9960921b60448201526064015b60405180910390fd5b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632630c12f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561040b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042f9190611ad8565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663687958626040518163ffffffff1660e01b8152600401600060405180830381865afa158015610491573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104b99190810190611b1b565b90506000805b8251811015610794577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638097354f84838151811061050957610509611be0565b60200260200101516040518263ffffffff1660e01b815260040161053c91906001600160a01b0391909116815260200190565b602060405180830381865afa158015610559573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061057d9190611ab6565b1561078257600083828151811061059657610596611be0565b602002602001015190506000816001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106049190611ad8565b604051638b2f0f4f60e01b81526001600160a01b038083166004830152919250600091881690638b2f0f4f90602401602060405180830381865afa158015610650573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106749190611bf6565b905060006107528261074c856001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e19190611c0f565b6012886001600160a01b03166324a71a666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610721573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107459190611bf6565b919061157a565b906115c3565b905061075e818a611c48565b98508a6001600160a01b0316846001600160a01b03160361077d578095505b505050505b8061078c81611c5b565b9150506104bf565b50604051638097354f60e01b81526001600160a01b0387811660048301527f00000000000000000000000000000000000000000000000000000000000000001690638097354f90602401602060405180830381865afa1580156107fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081f9190611ab6565b61082f5760009450505050915091565b83156108445761083f81856115e5565b61085c565b81516108526012600a611d58565b61085c9190611d64565b9450505050915091565b604051635b16ebb760e01b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635b16ebb790602401602060405180830381865afa1580156108ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ee9190611ab6565b6109445760405162461bcd60e51b815260206004820152602160248201527f6f6e6c7920706f6f6c732063616e2063616c6c20746869732066756e6374696f6044820152603760f91b60648201526084016103a2565b60005b33600090815260016020526040902061095f906115fe565b811015610a065733600090815260016020526040812061097f9083611608565b60405163f95878f560e01b81523360048201526001600160a01b03878116602483015260448201879052606482018690529192509082169063f95878f590608401600060405180830381600087803b1580156109da57600080fd5b505af11580156109ee573d6000803e3d6000fd5b505050505080806109fe90611c5b565b915050610947565b50505050565b6001600160a01b038116600090815260056020526040812054600254610a31916115c3565b92915050565b600080610a42610ed6565b509150915060008251905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166348439e7e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad19190611ad8565b905060005b82811015610ccc576000858281518110610af257610af2611be0565b60200260200101519050806001600160a01b031663904c9bf06040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b3757600080fd5b505af1158015610b4b573d6000803e3d6000fd5b50505050806001600160a01b0316630f4ef8a66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb19190611ad8565b6001600160a01b0316635790a0c86040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610bf0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c149190611ab6565b506040516354b94c2f60e11b81526001600160a01b03828116600483015284169063a972985e906024016020604051808303816000875af1158015610c5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c819190611bf6565b50848281518110610c9457610c94611be0565b6020908102919091018101516001600160a01b0390921660009081526005909152604090205580610cc481611c5b565b915050610ad6565b506040517ffb56001529302f12afdfa225ba5ad5da2d7d51b21709e2a2a8821f42b0e2cb5690600090a150505050565b610d04611614565b565b610d0e611652565b604051635b16ebb760e01b81526001600160a01b0383811660048301527f00000000000000000000000000000000000000000000000000000000000000001690635b16ebb790602401602060405180830381865afa158015610d74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d989190611ab6565b610dd35760405162461bcd60e51b815260206004820152600c60248201526b1a5b9d985b1a59081c1bdbdb60a21b60448201526064016103a2565b6001600160a01b0382166000908152600160205260409020610df590826116ac565b610e335760405162461bcd60e51b815260206004820152600f60248201526e1a185b991b195c881b9bdd081cd95d608a1b60448201526064016103a2565b806001600160a01b0316826001600160a01b03167f388f4b3ec4b4c3329f2ec4ad5434090b54fdef42e3efa2bb40e82136640abc3160405160405180910390a35050565b610e7f611652565b610d0460006116c1565b6001600160a01b0382166000908152600160205260408120610eab9083611711565b9392505050565b6001600160a01b0381166000908152600160205260409020606090610a3190611733565b6060806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632630c12f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5e9190611ad8565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663687958626040518163ffffffff1660e01b8152600401600060405180830381865afa158015610fbe573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fe69190810190611b1b565b93506000845167ffffffffffffffff81111561100457611004611af5565b60405190808252806020026020018201604052801561102d578160200160208202803683370190505b50905060005b8551811015611274577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638097354f87838151811061107d5761107d611be0565b60200260200101516040518263ffffffff1660e01b81526004016110b091906001600160a01b0391909116815260200190565b602060405180830381865afa1580156110cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110f19190611ab6565b1561126257600086828151811061110a5761110a611be0565b602002602001015190506000816001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa158015611154573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111789190611ad8565b604051638b2f0f4f60e01b81526001600160a01b038083166004830152919250600091871690638b2f0f4f90602401602060405180830381865afa1580156111c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e89190611bf6565b905060006112318261074c856001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106bd573d6000803e3d6000fd5b90508086868151811061124657611246611be0565b602090810291909101015261125b8189611c48565b9750505050505b8061126c81611c5b565b915050611033565b50845167ffffffffffffffff81111561128f5761128f611af5565b6040519080825280602002602001820160405280156112b8578160200160208202803683370190505b5093508260000361131c5760005b85518110156113165785516112dd6012600a611d58565b6112e79190611d64565b8582815181106112f9576112f9611be0565b60209081029190910101528061130e81611c5b565b9150506112c6565b50611385565b60005b8551811015611383576113548483838151811061133e5761133e611be0565b60200260200101516115e590919063ffffffff16565b85828151811061136657611366611be0565b60209081029190910101528061137b81611c5b565b91505061131f565b505b5050909192565b611394611652565b604051635b16ebb760e01b81526001600160a01b0383811660048301527f00000000000000000000000000000000000000000000000000000000000000001690635b16ebb790602401602060405180830381865afa1580156113fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141e9190611ab6565b6114595760405162461bcd60e51b815260206004820152600c60248201526b1a5b9d985b1a59081c1bdbdb60a21b60448201526064016103a2565b6001600160a01b038216600090815260016020526040902061147b9082611740565b6114bd5760405162461bcd60e51b81526020600482015260136024820152721a185b991b195c88185b1c9958591e481cd95d606a1b60448201526064016103a2565b806001600160a01b0316826001600160a01b03167fc2892f3aa5a025efdf54a8a5b3ef7397fc15169328547915b9b5825a8c33e05f60405160405180910390a35050565b611509611652565b6001600160a01b03811661156e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103a2565b611577816116c1565b50565b60008160ff168360ff1603611590575082610eab565b8160ff168360ff1611156115b0576115a9848484611755565b9050610eab565b6115bb848484611776565b949350505050565b60006115d16012600a611d58565b6115db8385611d86565b610eab9190611d64565b6000816115f46012600a611d58565b6115db9085611d86565b6000610a31825490565b6000610eab8383611797565b6301e133806003546116269190611c48565b4210610d0457611634610a37565b6002546116499067058d15ca2db118006115c3565b60025542600355565b6000546001600160a01b03163314610d045760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103a2565b6000610eab836001600160a01b0384166117c1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811660009081526001830160205260408120541515610eab565b60606000610eab836118b4565b6000610eab836001600160a01b038416611910565b60006117618284611d9d565b61176c90600a611db6565b6115bb9085611d64565b60006117828383611d9d565b61178d90600a611db6565b6115bb9085611d86565b60008260000182815481106117ae576117ae611be0565b9060005260206000200154905092915050565b600081815260018301602052604081205480156118aa5760006117e5600183611dc5565b85549091506000906117f990600190611dc5565b905081811461185e57600086600001828154811061181957611819611be0565b906000526020600020015490508087600001848154811061183c5761183c611be0565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061186f5761186f611dd8565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610a31565b6000915050610a31565b60608160000180548060200260200160405190810160405280929190818152602001828054801561190457602002820191906000526020600020905b8154815260200190600101908083116118f0575b50505050509050919050565b600081815260018301602052604081205461195757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a31565b506000610a31565b6001600160a01b038116811461157757600080fd5b60006020828403121561198657600080fd5b8135610eab8161195f565b6000806000606084860312156119a657600080fd5b83356119b18161195f565b95602085013595506040909401359392505050565b600080604083850312156119d957600080fd5b82356119e48161195f565b915060208301356119f48161195f565b809150509250929050565b600081518084526020808501945080840160005b83811015611a385781516001600160a01b031687529582019590820190600101611a13565b509495945050505050565b602081526000610eab60208301846119ff565b606081526000611a6960608301866119ff565b82810360208481019190915285518083528682019282019060005b81811015611aa057845183529383019391830191600101611a84565b5050809350505050826040830152949350505050565b600060208284031215611ac857600080fd5b81518015158114610eab57600080fd5b600060208284031215611aea57600080fd5b8151610eab8161195f565b634e487b7160e01b600052604160045260246000fd5b8051611b168161195f565b919050565b60006020808385031215611b2e57600080fd5b825167ffffffffffffffff80821115611b4657600080fd5b818501915085601f830112611b5a57600080fd5b815181811115611b6c57611b6c611af5565b8060051b604051601f19603f83011681018181108582111715611b9157611b91611af5565b604052918252848201925083810185019188831115611baf57600080fd5b938501935b82851015611bd457611bc585611b0b565b84529385019392850192611bb4565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611c0857600080fd5b5051919050565b600060208284031215611c2157600080fd5b815160ff81168114610eab57600080fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610a3157610a31611c32565b600060018201611c6d57611c6d611c32565b5060010190565b600181815b80851115611caf578160001904821115611c9557611c95611c32565b80851615611ca257918102915b93841c9390800290611c79565b509250929050565b600082611cc657506001610a31565b81611cd357506000610a31565b8160018114611ce95760028114611cf357611d0f565b6001915050610a31565b60ff841115611d0457611d04611c32565b50506001821b610a31565b5060208310610133831016604e8410600b8410161715611d32575081810a610a31565b611d3c8383611c74565b8060001904821115611d5057611d50611c32565b029392505050565b6000610eab8383611cb7565b600082611d8157634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610a3157610a31611c32565b60ff8281168282160390811115610a3157610a31611c32565b6000610eab60ff841683611cb7565b81810381811115610a3157610a31611c32565b634e487b7160e01b600052603160045260246000fdfea26469706673582212202ca9f00daf1385059e0da345b0a513833dfc3175cf648a4ca5080ac40302222b64736f6c634300081100330000000000000000000000002790ec478f150a98f5d96755601a26403df57eae
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101215760003560e01c80638da5cb5b116100ad578063cd1c374f11610071578063cd1c374f1461027b578063d30113b714610284578063dba8cc351461028d578063f2fde38b146102a0578063f77c4791146102b357600080fd5b80638da5cb5b1461020a578063965125c61461021b578063a53eb52e1461023b578063a563c3d514610252578063ad174d8e1461025b57600080fd5b80634a17ed59116100f45780634a17ed591461019157806356a0d31514610199578063632473da146101ac578063715018a6146101df57806373c96394146101e757600080fd5b8063129e16511461012657806314915ebe146101535780631d43c9d3146101685780633dc4f7de14610189575b600080fd5b610139610134366004611974565b6102da565b604080519283526020830191909152015b60405180910390f35b610166610161366004611991565b610866565b005b61017b610176366004611974565b610a0c565b60405190815260200161014a565b610166610a37565b610166610cfc565b6101666101a73660046119c6565b610d06565b6101c7739ae380f0272e2162340a5bb646c354271c0f5cfc81565b6040516001600160a01b03909116815260200161014a565b610166610e77565b6101fa6101f53660046119c6565b610e89565b604051901515815260200161014a565b6000546001600160a01b03166101c7565b61022e610229366004611974565b610eb2565b60405161014a9190611a43565b610243610ed6565b60405161014a93929190611a56565b61017b60025481565b61017b610269366004611974565b60056020526000908152604090205481565b61017b60045481565b61017b60035481565b61016661029b3660046119c6565b61138c565b6101666102ae366004611974565b611501565b6101c77f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae81565b604051635b16ebb760e01b81526001600160a01b03828116600483015260009182917f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae1690635b16ebb790602401602060405180830381865afa158015610345573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103699190611ab6565b6103ab5760405162461bcd60e51b815260206004820152600e60248201526d1c1bdbdb081b9bdd08199bdd5b9960921b60448201526064015b60405180910390fd5b60007f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae6001600160a01b0316632630c12f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561040b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042f9190611ad8565b905060007f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae6001600160a01b031663687958626040518163ffffffff1660e01b8152600401600060405180830381865afa158015610491573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104b99190810190611b1b565b90506000805b8251811015610794577f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae6001600160a01b0316638097354f84838151811061050957610509611be0565b60200260200101516040518263ffffffff1660e01b815260040161053c91906001600160a01b0391909116815260200190565b602060405180830381865afa158015610559573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061057d9190611ab6565b1561078257600083828151811061059657610596611be0565b602002602001015190506000816001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106049190611ad8565b604051638b2f0f4f60e01b81526001600160a01b038083166004830152919250600091881690638b2f0f4f90602401602060405180830381865afa158015610650573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106749190611bf6565b905060006107528261074c856001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e19190611c0f565b6012886001600160a01b03166324a71a666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610721573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107459190611bf6565b919061157a565b906115c3565b905061075e818a611c48565b98508a6001600160a01b0316846001600160a01b03160361077d578095505b505050505b8061078c81611c5b565b9150506104bf565b50604051638097354f60e01b81526001600160a01b0387811660048301527f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae1690638097354f90602401602060405180830381865afa1580156107fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081f9190611ab6565b61082f5760009450505050915091565b83156108445761083f81856115e5565b61085c565b81516108526012600a611d58565b61085c9190611d64565b9450505050915091565b604051635b16ebb760e01b81523360048201527f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae6001600160a01b031690635b16ebb790602401602060405180830381865afa1580156108ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ee9190611ab6565b6109445760405162461bcd60e51b815260206004820152602160248201527f6f6e6c7920706f6f6c732063616e2063616c6c20746869732066756e6374696f6044820152603760f91b60648201526084016103a2565b60005b33600090815260016020526040902061095f906115fe565b811015610a065733600090815260016020526040812061097f9083611608565b60405163f95878f560e01b81523360048201526001600160a01b03878116602483015260448201879052606482018690529192509082169063f95878f590608401600060405180830381600087803b1580156109da57600080fd5b505af11580156109ee573d6000803e3d6000fd5b505050505080806109fe90611c5b565b915050610947565b50505050565b6001600160a01b038116600090815260056020526040812054600254610a31916115c3565b92915050565b600080610a42610ed6565b509150915060008251905060007f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae6001600160a01b03166348439e7e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad19190611ad8565b905060005b82811015610ccc576000858281518110610af257610af2611be0565b60200260200101519050806001600160a01b031663904c9bf06040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b3757600080fd5b505af1158015610b4b573d6000803e3d6000fd5b50505050806001600160a01b0316630f4ef8a66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb19190611ad8565b6001600160a01b0316635790a0c86040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610bf0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c149190611ab6565b506040516354b94c2f60e11b81526001600160a01b03828116600483015284169063a972985e906024016020604051808303816000875af1158015610c5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c819190611bf6565b50848281518110610c9457610c94611be0565b6020908102919091018101516001600160a01b0390921660009081526005909152604090205580610cc481611c5b565b915050610ad6565b506040517ffb56001529302f12afdfa225ba5ad5da2d7d51b21709e2a2a8821f42b0e2cb5690600090a150505050565b610d04611614565b565b610d0e611652565b604051635b16ebb760e01b81526001600160a01b0383811660048301527f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae1690635b16ebb790602401602060405180830381865afa158015610d74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d989190611ab6565b610dd35760405162461bcd60e51b815260206004820152600c60248201526b1a5b9d985b1a59081c1bdbdb60a21b60448201526064016103a2565b6001600160a01b0382166000908152600160205260409020610df590826116ac565b610e335760405162461bcd60e51b815260206004820152600f60248201526e1a185b991b195c881b9bdd081cd95d608a1b60448201526064016103a2565b806001600160a01b0316826001600160a01b03167f388f4b3ec4b4c3329f2ec4ad5434090b54fdef42e3efa2bb40e82136640abc3160405160405180910390a35050565b610e7f611652565b610d0460006116c1565b6001600160a01b0382166000908152600160205260408120610eab9083611711565b9392505050565b6001600160a01b0381166000908152600160205260409020606090610a3190611733565b6060806000807f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae6001600160a01b0316632630c12f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5e9190611ad8565b90507f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae6001600160a01b031663687958626040518163ffffffff1660e01b8152600401600060405180830381865afa158015610fbe573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fe69190810190611b1b565b93506000845167ffffffffffffffff81111561100457611004611af5565b60405190808252806020026020018201604052801561102d578160200160208202803683370190505b50905060005b8551811015611274577f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae6001600160a01b0316638097354f87838151811061107d5761107d611be0565b60200260200101516040518263ffffffff1660e01b81526004016110b091906001600160a01b0391909116815260200190565b602060405180830381865afa1580156110cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110f19190611ab6565b1561126257600086828151811061110a5761110a611be0565b602002602001015190506000816001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa158015611154573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111789190611ad8565b604051638b2f0f4f60e01b81526001600160a01b038083166004830152919250600091871690638b2f0f4f90602401602060405180830381865afa1580156111c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e89190611bf6565b905060006112318261074c856001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106bd573d6000803e3d6000fd5b90508086868151811061124657611246611be0565b602090810291909101015261125b8189611c48565b9750505050505b8061126c81611c5b565b915050611033565b50845167ffffffffffffffff81111561128f5761128f611af5565b6040519080825280602002602001820160405280156112b8578160200160208202803683370190505b5093508260000361131c5760005b85518110156113165785516112dd6012600a611d58565b6112e79190611d64565b8582815181106112f9576112f9611be0565b60209081029190910101528061130e81611c5b565b9150506112c6565b50611385565b60005b8551811015611383576113548483838151811061133e5761133e611be0565b60200260200101516115e590919063ffffffff16565b85828151811061136657611366611be0565b60209081029190910101528061137b81611c5b565b91505061131f565b505b5050909192565b611394611652565b604051635b16ebb760e01b81526001600160a01b0383811660048301527f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae1690635b16ebb790602401602060405180830381865afa1580156113fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141e9190611ab6565b6114595760405162461bcd60e51b815260206004820152600c60248201526b1a5b9d985b1a59081c1bdbdb60a21b60448201526064016103a2565b6001600160a01b038216600090815260016020526040902061147b9082611740565b6114bd5760405162461bcd60e51b81526020600482015260136024820152721a185b991b195c88185b1c9958591e481cd95d606a1b60448201526064016103a2565b806001600160a01b0316826001600160a01b03167fc2892f3aa5a025efdf54a8a5b3ef7397fc15169328547915b9b5825a8c33e05f60405160405180910390a35050565b611509611652565b6001600160a01b03811661156e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103a2565b611577816116c1565b50565b60008160ff168360ff1603611590575082610eab565b8160ff168360ff1611156115b0576115a9848484611755565b9050610eab565b6115bb848484611776565b949350505050565b60006115d16012600a611d58565b6115db8385611d86565b610eab9190611d64565b6000816115f46012600a611d58565b6115db9085611d86565b6000610a31825490565b6000610eab8383611797565b6301e133806003546116269190611c48565b4210610d0457611634610a37565b6002546116499067058d15ca2db118006115c3565b60025542600355565b6000546001600160a01b03163314610d045760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103a2565b6000610eab836001600160a01b0384166117c1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811660009081526001830160205260408120541515610eab565b60606000610eab836118b4565b6000610eab836001600160a01b038416611910565b60006117618284611d9d565b61176c90600a611db6565b6115bb9085611d64565b60006117828383611d9d565b61178d90600a611db6565b6115bb9085611d86565b60008260000182815481106117ae576117ae611be0565b9060005260206000200154905092915050565b600081815260018301602052604081205480156118aa5760006117e5600183611dc5565b85549091506000906117f990600190611dc5565b905081811461185e57600086600001828154811061181957611819611be0565b906000526020600020015490508087600001848154811061183c5761183c611be0565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061186f5761186f611dd8565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610a31565b6000915050610a31565b60608160000180548060200260200160405190810160405280929190818152602001828054801561190457602002820191906000526020600020905b8154815260200190600101908083116118f0575b50505050509050919050565b600081815260018301602052604081205461195757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a31565b506000610a31565b6001600160a01b038116811461157757600080fd5b60006020828403121561198657600080fd5b8135610eab8161195f565b6000806000606084860312156119a657600080fd5b83356119b18161195f565b95602085013595506040909401359392505050565b600080604083850312156119d957600080fd5b82356119e48161195f565b915060208301356119f48161195f565b809150509250929050565b600081518084526020808501945080840160005b83811015611a385781516001600160a01b031687529582019590820190600101611a13565b509495945050505050565b602081526000610eab60208301846119ff565b606081526000611a6960608301866119ff565b82810360208481019190915285518083528682019282019060005b81811015611aa057845183529383019391830191600101611a84565b5050809350505050826040830152949350505050565b600060208284031215611ac857600080fd5b81518015158114610eab57600080fd5b600060208284031215611aea57600080fd5b8151610eab8161195f565b634e487b7160e01b600052604160045260246000fd5b8051611b168161195f565b919050565b60006020808385031215611b2e57600080fd5b825167ffffffffffffffff80821115611b4657600080fd5b818501915085601f830112611b5a57600080fd5b815181811115611b6c57611b6c611af5565b8060051b604051601f19603f83011681018181108582111715611b9157611b91611af5565b604052918252848201925083810185019188831115611baf57600080fd5b938501935b82851015611bd457611bc585611b0b565b84529385019392850192611bb4565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611c0857600080fd5b5051919050565b600060208284031215611c2157600080fd5b815160ff81168114610eab57600080fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610a3157610a31611c32565b600060018201611c6d57611c6d611c32565b5060010190565b600181815b80851115611caf578160001904821115611c9557611c95611c32565b80851615611ca257918102915b93841c9390800290611c79565b509250929050565b600082611cc657506001610a31565b81611cd357506000610a31565b8160018114611ce95760028114611cf357611d0f565b6001915050610a31565b60ff841115611d0457611d04611c32565b50506001821b610a31565b5060208310610133831016604e8410600b8410161715611d32575081810a610a31565b611d3c8383611c74565b8060001904821115611d5057611d50611c32565b029392505050565b6000610eab8383611cb7565b600082611d8157634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610a3157610a31611c32565b60ff8281168282160390811115610a3157610a31611c32565b6000610eab60ff841683611cb7565b81810381811115610a3157610a31611c32565b634e487b7160e01b600052603160045260246000fdfea26469706673582212202ca9f00daf1385059e0da345b0a513833dfc3175cf648a4ca5080ac40302222b64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae
-----Decoded View---------------
Arg [0] : _controller (address): 0x2790EC478f150a98F5D96755601a26403DF57EaE
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.