Feature Tip: Add private address tag to any address under My Name Tag !
More Info
Private Name Tags
ContractCreator
Latest 15 from a total of 15 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Unstake | 19865625 | 105 days ago | IN | 0 ETH | 0.00663055 | ||||
Stake | 19708159 | 127 days ago | IN | 0 ETH | 0.00938699 | ||||
Unstake | 19665220 | 133 days ago | IN | 0 ETH | 0.01047057 | ||||
Stake | 19638427 | 137 days ago | IN | 0 ETH | 0.02643903 | ||||
Unstake | 19414278 | 168 days ago | IN | 0 ETH | 0.04243718 | ||||
Unstake For | 19399674 | 170 days ago | IN | 0 ETH | 0.04591142 | ||||
Stake | 19268670 | 189 days ago | IN | 0 ETH | 0.01792775 | ||||
Unstake | 19219316 | 196 days ago | IN | 0 ETH | 0.01814998 | ||||
Stake | 19163599 | 204 days ago | IN | 0 ETH | 0.01670294 | ||||
Unstake | 19145701 | 206 days ago | IN | 0 ETH | 0.01092085 | ||||
Unstake | 19140046 | 207 days ago | IN | 0 ETH | 0.0172912 | ||||
Stake | 19140043 | 207 days ago | IN | 0 ETH | 0.0265012 | ||||
Stake | 19131291 | 208 days ago | IN | 0 ETH | 0.01351822 | ||||
Stake | 19129063 | 208 days ago | IN | 0 ETH | 0.01647712 | ||||
0x60e06040 | 19036171 | 221 days ago | IN | 0 ETH | 0.08852456 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
LpTokenStaker
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 "SafeERC20.sol"; import "ILpTokenStaker.sol"; import "IInflationManager.sol"; import "IController.sol"; import "IConicPool.sol"; import "ILpToken.sol"; import "ICNCToken.sol"; import "ScaledMath.sol"; /// @dev USD amounts in this contract are always scaled by 1e18 contract LpTokenStaker is ILpTokenStaker { using SafeERC20 for IERC20; using SafeERC20 for ILpToken; using ScaledMath for uint256; struct Boost { uint256 timeBoost; uint256 lastUpdated; } uint256 public constant MAX_BOOST = 10e18; uint256 public constant MIN_BOOST = 1e18; uint256 public constant TIME_STARTING_FACTOR = 1e17; uint256 public constant INCREASE_PERIOD = 30 days; uint256 public constant TVL_FACTOR = 45e18; mapping(address => mapping(address => uint256)) internal stakedPerUser; mapping(address => uint256) internal _stakedPerPool; mapping(address => Boost) public boosts; mapping(address => uint256) public poolShares; mapping(address => uint256) public poolLastUpdated; IController public immutable controller; ICNCToken public immutable cnc; address internal immutable _treasury; bool public isShutdown; modifier notShutdown() { require(!isShutdown, "LpTokenStaker: shutdown"); _; } constructor(address controller_, ICNCToken cnc_, address treasury_) { controller = IController(controller_); cnc = cnc_; _initializeLastUpdated(); _treasury = treasury_; } function stake(uint256 amount, address conicPool) external override { stakeFor(amount, conicPool, msg.sender); } function unstake(uint256 amount, address conicPool) external override { unstakeFor(amount, conicPool, msg.sender); } function stakeFor( uint256 amount, address conicPool, address account ) public override notShutdown { require(controller.isPool(conicPool), "not a conic pool"); ILpToken lpToken = IConicPool(conicPool).lpToken(); uint256 exchangeRate = IConicPool(conicPool).usdExchangeRate(); // Checkpoint all inflation logic IConicPool(conicPool).rewardManager().accountCheckpoint(account); _stakerCheckpoint( account, amount.convertScale(lpToken.decimals(), 18).mulDown(exchangeRate) ); // Actual staking lpToken.safeTransferFrom(msg.sender, address(this), amount); if (!controller.isPool(msg.sender)) { lpToken.taint(msg.sender, account, amount); } stakedPerUser[account][conicPool] += amount; _stakedPerPool[conicPool] += amount; } function unstakeFor(uint256 amount, address conicPool, address account) public override { require(controller.isPool(conicPool), "not a conic pool"); require(stakedPerUser[msg.sender][conicPool] >= amount, "not enough staked"); // Checkpoint all inflation logic if (!isShutdown) { IConicPool(conicPool).rewardManager().accountCheckpoint(msg.sender); _stakerCheckpoint(msg.sender, 0); } // Actual unstaking stakedPerUser[msg.sender][conicPool] -= amount; _stakedPerPool[conicPool] -= amount; IConicPool(conicPool).lpToken().safeTransfer(account, amount); IConicPool(conicPool).lpToken().taint(msg.sender, account, amount); } function unstakeFrom(uint256 amount, address account) public override { require(controller.isPool(msg.sender), "only callable from conic pool"); require(stakedPerUser[account][msg.sender] >= amount, "not enough staked"); // Checkpoint all inflation logic if (!isShutdown) { IConicPool(msg.sender).rewardManager().accountCheckpoint(account); _stakerCheckpoint(account, 0); } // Actual unstaking stakedPerUser[account][msg.sender] -= amount; _stakedPerPool[msg.sender] -= amount; IConicPool(msg.sender).lpToken().safeTransfer(account, amount); } function shutdown() external { require(msg.sender == address(controller), "LpTokenStaker: not controller"); // Claim all rewards address[] memory pools = controller.listPools(); for (uint256 i; i < pools.length; i++) { _claimCNCRewardsForPool(pools[i]); } // Transfer all idle CNC to treasury uint256 idleCnc = cnc.balanceOf(address(this)); if (idleCnc > 0) IERC20(address(cnc)).transfer(_treasury, idleCnc); isShutdown = true; emit Shutdown(); } function getUserBalanceForPool( address conicPool, address account ) external view override returns (uint256) { return stakedPerUser[account][conicPool]; } function getBalanceForPool(address conicPool) external view override returns (uint256) { return _stakedPerPool[conicPool]; } function getCachedBoost(address user) external view returns (uint256) { return boosts[user].timeBoost; } function getBoost(address user) external view override returns (uint256) { if (isShutdown) return MIN_BOOST; (uint256 userStakedUSD, uint256 totalStakedUSD) = _getTotalStakedForUserCommonDenomination( user ); if (totalStakedUSD == 0 || userStakedUSD == 0) { return MIN_BOOST; } uint256 stakeBoost = ScaledMath.ONE + userStakedUSD.divDown(totalStakedUSD).mulDown(TVL_FACTOR); Boost storage userBoost = boosts[user]; uint256 timeBoost = userBoost.timeBoost; timeBoost += (block.timestamp - userBoost.lastUpdated).divDown(INCREASE_PERIOD).mulDown( ScaledMath.ONE - TIME_STARTING_FACTOR ); if (timeBoost > ScaledMath.ONE) { timeBoost = ScaledMath.ONE; } uint256 totalBoost = stakeBoost.mulDown(timeBoost); if (totalBoost < MIN_BOOST) { totalBoost = MIN_BOOST; } else if (totalBoost > MAX_BOOST) { totalBoost = MAX_BOOST; } return totalBoost; } function updateBoost(address user) external override notShutdown { (uint256 userStaked, ) = _getTotalStakedForUserCommonDenomination(user); _updateTimeBoost(user, userStaked, 0); } function claimCNCRewardsForPool(address pool) external override notShutdown { require( msg.sender == address(IConicPool(pool).rewardManager()), "can only be called by reward manager" ); _claimCNCRewardsForPool(pool); } function _claimCNCRewardsForPool(address pool) internal { require(controller.isPool(pool), "not a pool"); uint256 cncToMint = checkpoint(pool); if (cncToMint == 0) { return; } uint256 idleCnc = cnc.balanceOf(address(this)); if (idleCnc > 0) { if (idleCnc > cncToMint) idleCnc = cncToMint; IERC20(address(cnc)).transfer(address(pool), idleCnc); cncToMint -= idleCnc; } if (cncToMint > 0) { cnc.mint(address(pool), cncToMint); } poolShares[pool] = 0; emit TokensClaimed(pool, cncToMint + idleCnc); } function claimableCnc(address pool) public view override returns (uint256) { if (isShutdown) return 0; uint256 currentRate = controller.inflationManager().getCurrentPoolInflationRate(pool); uint256 timeElapsed = block.timestamp - poolLastUpdated[pool]; return poolShares[pool] + (currentRate * timeElapsed); } function _stakerCheckpoint(address account, uint256 amountAddedUSD) internal { (uint256 userStakedUSD, ) = _getTotalStakedForUserCommonDenomination(account); _updateTimeBoost(account, userStakedUSD, amountAddedUSD); } function checkpoint(address pool) public override notShutdown returns (uint256) { // Update the integral of total token supply for the pool uint256 timeElapsed = block.timestamp - poolLastUpdated[pool]; if (timeElapsed == 0) return poolShares[pool]; poolCheckpoint(pool); poolLastUpdated[pool] = block.timestamp; return poolShares[pool]; } function poolCheckpoint(address pool) internal { uint256 currentRate = controller.inflationManager().getCurrentPoolInflationRate(pool); uint256 timeElapsed = block.timestamp - poolLastUpdated[pool]; poolShares[pool] += (currentRate * timeElapsed); } function _updateTimeBoost( address user, uint256 userStakedUSD, uint256 amountAddedUSD ) internal { Boost storage userBoost = boosts[user]; if (userStakedUSD == 0) { userBoost.timeBoost = TIME_STARTING_FACTOR; userBoost.lastUpdated = block.timestamp; return; } uint256 newBoost; newBoost = userBoost.timeBoost; newBoost += (block.timestamp - userBoost.lastUpdated).divDown(INCREASE_PERIOD).mulDown( ScaledMath.ONE - TIME_STARTING_FACTOR ); if (newBoost > ScaledMath.ONE) { newBoost = ScaledMath.ONE; } if (amountAddedUSD == 0) { userBoost.timeBoost = newBoost; } else { uint256 newTotalStakedUSD = userStakedUSD + amountAddedUSD; userBoost.timeBoost = newBoost.mulDown(userStakedUSD.divDown(newTotalStakedUSD)) + TIME_STARTING_FACTOR.mulDown(amountAddedUSD.divDown(newTotalStakedUSD)); } userBoost.lastUpdated = block.timestamp; } function _getUserUSDStakedInPool( address account, address pool ) internal view returns (uint256 poolStaked, uint256 poolUserStaked) { uint256 curExchangeRate = IConicPool(pool).usdExchangeRate(); uint8 decimals = IConicPool(pool).lpToken().decimals(); poolStaked = _stakedPerPool[pool].convertScale(decimals, 18).mulDown(curExchangeRate); poolUserStaked = stakedPerUser[account][pool].convertScale(decimals, 18).mulDown( curExchangeRate ); } function _getTotalStakedForUserCommonDenomination( address account ) public view returns (uint256, uint256) { address[] memory conicPools = controller.listPools(); uint256 totalStakedUSD = 0; uint256 userStakedUSD = 0; for (uint256 i; i < conicPools.length; i++) { (uint256 poolStakedUSD, uint256 poolUserStakedUSD) = _getUserUSDStakedInPool( account, conicPools[i] ); totalStakedUSD += poolStakedUSD; userStakedUSD += poolUserStakedUSD; } return (userStakedUSD, totalStakedUSD); } function _initializeLastUpdated() internal { address[] memory pools = controller.listPools(); for (uint256 i; i < pools.length; i++) { poolLastUpdated[pools[i]] = block.timestamp; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "IERC20.sol"; import "IERC20Permit.sol"; import "Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token)); } }
// 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: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// 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 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; 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 "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: 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 "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: 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: 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 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 "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": { "LpTokenStaker.sol": {} }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"controller_","type":"address"},{"internalType":"contract ICNCToken","name":"cnc_","type":"address"},{"internalType":"address","name":"treasury_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LpTokenStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LpTokenUnstaked","type":"event"},{"anonymous":false,"inputs":[],"name":"Shutdown","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":"INCREASE_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_BOOST","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_BOOST","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIME_STARTING_FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TVL_FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"_getTotalStakedForUserCommonDenomination","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"boosts","outputs":[{"internalType":"uint256","name":"timeBoost","type":"uint256"},{"internalType":"uint256","name":"lastUpdated","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"checkpoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"claimCNCRewardsForPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"claimableCnc","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cnc","outputs":[{"internalType":"contract ICNCToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"contract IController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"conicPool","type":"address"}],"name":"getBalanceForPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getBoost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getCachedBoost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"conicPool","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"getUserBalanceForPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isShutdown","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"poolLastUpdated","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"poolShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"shutdown","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"conicPool","type":"address"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"conicPool","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"stakeFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"conicPool","type":"address"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"conicPool","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"unstakeFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"account","type":"address"}],"name":"unstakeFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"updateBoost","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60e06040523480156200001157600080fd5b5060405162002a5038038062002a5083398101604081905262000034916200016d565b6001600160a01b03808416608052821660a0526200005162000066565b6001600160a01b031660c05250620002e79050565b60006080516001600160a01b031663687958626040518163ffffffff1660e01b8152600401600060405180830381865afa158015620000a9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620000d39190810190620001d7565b905060005b81518110156200013e574260046000848481518110620000fc57620000fc620002a9565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000208190555080806200013590620002bf565b915050620000d8565b5050565b6001600160a01b03811681146200015857600080fd5b50565b8051620001688162000142565b919050565b6000806000606084860312156200018357600080fd5b8351620001908162000142565b6020850151909350620001a38162000142565b6040850151909250620001b68162000142565b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215620001eb57600080fd5b82516001600160401b03808211156200020357600080fd5b818501915085601f8301126200021857600080fd5b8151818111156200022d576200022d620001c1565b8060051b604051601f19603f83011681018181108582111715620002555762000255620001c1565b6040529182528482019250838101850191888311156200027457600080fd5b938501935b828510156200029d576200028d856200015b565b8452938501939285019262000279565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b600060018201620002e057634e487b7160e01b600052601160045260246000fd5b5060010190565b60805160a05160c0516126d06200038060003960006116cd0152600081816103890152818161163b015281816116fc015281816119de01528181611a8a0152611b310152600081816103c80152818161044b015281816107f301528181610ad001528181610db0015281816111750152818161136b015281816114eb0152818161155c015281816119090152611e8601526126d06000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c80638aba3f77116100de578063bf86d69011610097578063f77c479111610071578063f77c4791146103c3578063fa4083ca146103ea578063fc0e74d1146103fd578063fdabc9861461040557600080fd5b8063bf86d69014610354578063d3487a8c14610371578063f0aa0a1d1461038457600080fd5b80638aba3f77146102bb578063a0190c17146102e4578063a3f0ed07146102f7578063a91ea1ba1461031f578063a972985e14610332578063bb51ccf01461034557600080fd5b80635598b2091161014b5780637acb7757116101255780637acb77571461027b5780637b3db81a1461028e5780638381e18214610298578063863445b8146102ab57600080fd5b80635598b2091461021f57806362f04c001461024857806367ba3d901461026857600080fd5b80630276d476146101935780630325d161146101a85780630a7486c7146101bb5780630fb51f41146101dd578063315865df146101fd57806333f1c3371461020c575b600080fd5b6101a66101a1366004612216565b61042c565b005b6101a66101b6366004612258565b6107de565b6101ca670de0b6b3a764000081565b6040519081526020015b60405180910390f35b6101ca6101eb366004612288565b60036020526000908152604090205481565b6101ca678ac7230489e8000081565b6101a661021a366004612216565b610a8e565b6101ca61022d366004612288565b6001600160a01b031660009081526001602052604090205490565b6101ca610256366004612288565b60046020526000908152604090205481565b6101ca610276366004612288565b610efe565b6101a6610289366004612258565b61105b565b6101ca62278d0081565b6101a66102a6366004612258565b611066565b6101ca680270801d946c94000081565b6101ca6102c9366004612288565b6001600160a01b031660009081526002602052604090205490565b6101a66102f2366004612288565b611071565b61030a610305366004612288565b61116e565b604080519283526020830191909152016101d4565b6101a661032d366004612288565b61126d565b6101ca610340366004612288565b6112aa565b6101ca67016345785d8a000081565b6005546103619060ff1681565b60405190151581526020016101d4565b6101ca61037f366004612288565b611351565b6103ab7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101d4565b6103ab7f000000000000000000000000000000000000000000000000000000000000000081565b6101ca6103f83660046122a5565b6114b5565b6101a66114e0565b61030a610413366004612288565b6002602052600090815260409020805460019091015482565b604051635b16ebb760e01b81526001600160a01b0383811660048301527f00000000000000000000000000000000000000000000000000000000000000001690635b16ebb790602401602060405180830381865afa158015610492573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b691906122d3565b6104fa5760405162461bcd60e51b815260206004820152601060248201526f1b9bdd08184818dbdb9a58c81c1bdbdb60821b60448201526064015b60405180910390fd5b336000908152602081815260408083206001600160a01b038616845290915290205483111561055f5760405162461bcd60e51b81526020600482015260116024820152701b9bdd08195b9bdd59da081cdd185ad959607a1b60448201526064016104f1565b60055460ff1661063157816001600160a01b0316630f4ef8a66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105cb91906122f5565b60405163bf928f8b60e01b81523360048201526001600160a01b03919091169063bf928f8b90602401600060405180830381600087803b15801561060e57600080fd5b505af1158015610622573d6000803e3d6000fd5b505050506106313360006117a5565b336000908152602081815260408083206001600160a01b038616845290915281208054859290610662908490612328565b90915550506001600160a01b0382166000908152600160205260408120805485929061068f908490612328565b9250508190555061070d8184846001600160a01b0316635fcbd2856040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fd91906122f5565b6001600160a01b031691906117c3565b816001600160a01b0316635fcbd2856040518163ffffffff1660e01b8152600401602060405180830381865afa15801561074b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076f91906122f5565b6040516362e4a67760e11b81523360048201526001600160a01b03838116602483015260448201869052919091169063c5c94cee90606401600060405180830381600087803b1580156107c157600080fd5b505af11580156107d5573d6000803e3d6000fd5b50505050505050565b604051635b16ebb760e01b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635b16ebb790602401602060405180830381865afa158015610842573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086691906122d3565b6108b25760405162461bcd60e51b815260206004820152601d60248201527f6f6e6c792063616c6c61626c652066726f6d20636f6e696320706f6f6c00000060448201526064016104f1565b6001600160a01b0381166000908152602081815260408083203384529091529020548211156109175760405162461bcd60e51b81526020600482015260116024820152701b9bdd08195b9bdd59da081cdd185ad959607a1b60448201526064016104f1565b60055460ff166109eb57336001600160a01b0316630f4ef8a66040518163ffffffff1660e01b8152600401602060405180830381865afa15801561095f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098391906122f5565b60405163bf928f8b60e01b81526001600160a01b038381166004830152919091169063bf928f8b90602401600060405180830381600087803b1580156109c857600080fd5b505af11580156109dc573d6000803e3d6000fd5b505050506109eb8160006117a5565b6001600160a01b03811660009081526020818152604080832033845290915281208054849290610a1c908490612328565b90915550503360009081526001602052604081208054849290610a40908490612328565b92505081905550610a8a8183336001600160a01b0316635fcbd2856040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106d9573d6000803e3d6000fd5b5050565b60055460ff1615610ab15760405162461bcd60e51b81526004016104f19061233b565b604051635b16ebb760e01b81526001600160a01b0383811660048301527f00000000000000000000000000000000000000000000000000000000000000001690635b16ebb790602401602060405180830381865afa158015610b17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3b91906122d3565b610b7a5760405162461bcd60e51b815260206004820152601060248201526f1b9bdd08184818dbdb9a58c81c1bdbdb60821b60448201526064016104f1565b6000826001600160a01b0316635fcbd2856040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bde91906122f5565b90506000836001600160a01b031663ce75040e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c449190612372565b9050836001600160a01b0316630f4ef8a66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca891906122f5565b60405163bf928f8b60e01b81526001600160a01b038581166004830152919091169063bf928f8b90602401600060405180830381600087803b158015610ced57600080fd5b505af1158015610d01573d6000803e3d6000fd5b50505050610d8683610d8183610d7b866001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d72919061238b565b8a906012611826565b90611871565b6117a5565b610d9b6001600160a01b038316333088611893565b604051635b16ebb760e01b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635b16ebb790602401602060405180830381865afa158015610dff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2391906122d3565b610e90576040516362e4a67760e11b81523360048201526001600160a01b0384811660248301526044820187905283169063c5c94cee90606401600060405180830381600087803b158015610e7757600080fd5b505af1158015610e8b573d6000803e3d6000fd5b505050505b6001600160a01b0380841660009081526020818152604080832093881683529290529081208054879290610ec59084906123ae565b90915550506001600160a01b03841660009081526001602052604081208054879290610ef29084906123ae565b90915550505050505050565b60055460009060ff1615610f1b5750670de0b6b3a7640000919050565b600080610f278461116e565b915091508060001480610f38575081155b15610f4e5750670de0b6b3a76400009392505050565b6000610f67680270801d946c940000610d7b85856118d1565b610f736012600a6124a5565b610f7d91906123ae565b6001600160a01b0386166000908152600260205260409020805491925090610fda67016345785d8a0000610fb36012600a6124a5565b610fbd9190612328565b610d7b62278d00856001015442610fd49190612328565b906118d1565b610fe490826123ae565b9050610ff26012600a6124a5565b811115611008576110056012600a6124a5565b90505b60006110148483611871565b9050670de0b6b3a76400008110156110355750670de0b6b3a7640000611050565b678ac7230489e800008111156110505750678ac7230489e800005b979650505050505050565b610a8a828233610a8e565b610a8a82823361042c565b60055460ff16156110945760405162461bcd60e51b81526004016104f19061233b565b806001600160a01b0316630f4ef8a66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110f691906122f5565b6001600160a01b0316336001600160a01b0316146111625760405162461bcd60e51b8152602060048201526024808201527f63616e206f6e6c792062652063616c6c656420627920726577617264206d616e60448201526330b3b2b960e11b60648201526084016104f1565b61116b816118ea565b50565b60008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663687958626040518163ffffffff1660e01b8152600401600060405180830381865afa1580156111d1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111f991908101906124d2565b905060008060005b8351811015611262576000806112308987858151811061122357611223612597565b6020026020010151611bfa565b909250905061123f82866123ae565b945061124b81856123ae565b93505050808061125a906125ad565b915050611201565b509590945092505050565b60055460ff16156112905760405162461bcd60e51b81526004016104f19061233b565b600061129b8261116e565b509050610a8a82826000611d9a565b60055460009060ff16156112d05760405162461bcd60e51b81526004016104f19061233b565b6001600160a01b0382166000908152600460205260408120546112f39042612328565b90508060000361131a5750506001600160a01b031660009081526003602052604090205490565b61132383611e82565b50506001600160a01b038116600090815260046020908152604080832042905560039091529020545b919050565b60055460009060ff161561136757506000919050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663dbcd89fa6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113eb91906122f5565b604051631d43c9d360e01b81526001600160a01b0385811660048301529190911690631d43c9d390602401602060405180830381865afa158015611433573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114579190612372565b6001600160a01b0384166000908152600460205260408120549192509061147e9042612328565b905061148a81836125c6565b6001600160a01b0385166000908152600360205260409020546114ad91906123ae565b949350505050565b6001600160a01b03808216600090815260208181526040808320938616835292905220545b92915050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146115585760405162461bcd60e51b815260206004820152601d60248201527f4c70546f6b656e5374616b65723a206e6f7420636f6e74726f6c6c657200000060448201526064016104f1565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663687958626040518163ffffffff1660e01b8152600401600060405180830381865afa1580156115b8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526115e091908101906124d2565b905060005b81518110156116225761161082828151811061160357611603612597565b60200260200101516118ea565b8061161a816125ad565b9150506115e5565b506040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561168a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ae9190612372565b9050801561176b5760405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015611745573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176991906122d3565b505b6005805460ff191660011790556040517f4426aa1fb73e391071491fcfe21a88b5c38a0a0333a1f6e77161470439704cf890600090a15050565b60006117b08361116e565b5090506117be838284611d9a565b505050565b6040516001600160a01b0383166024820152604481018290526117be90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611fd7565b60008160ff168360ff160361183c57508261186a565b8160ff168360ff16111561185c576118558484846120ac565b905061186a565b6118678484846120cd565b90505b9392505050565b600061187f6012600a6124a5565b61188983856125c6565b61186a91906125dd565b6040516001600160a01b03808516602483015283166044820152606481018290526118cb9085906323b872dd60e01b906084016117ef565b50505050565b6000816118e06012600a6124a5565b61188990856125c6565b604051635b16ebb760e01b81526001600160a01b0382811660048301527f00000000000000000000000000000000000000000000000000000000000000001690635b16ebb790602401602060405180830381865afa158015611950573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197491906122d3565b6119ad5760405162461bcd60e51b815260206004820152600a6024820152691b9bdd0818481c1bdbdb60b21b60448201526064016104f1565b60006119b8826112aa565b9050806000036119c6575050565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611a2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a519190612372565b90508015611b055781811115611a645750805b60405163a9059cbb60e01b81526001600160a01b038481166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015611ad3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611af791906122d3565b50611b028183612328565b91505b8115611ba0576040516340c10f1960e01b81526001600160a01b038481166004830152602482018490527f000000000000000000000000000000000000000000000000000000000000000016906340c10f19906044016020604051808303816000875af1158015611b7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9e9190612372565b505b6001600160a01b0383166000818152600360205260408120557f896e034966eaaf1adc54acc0f257056febbd300c9e47182cf761982cf1f5e430611be483856123ae565b60405190815260200160405180910390a2505050565b6000806000836001600160a01b031663ce75040e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c619190612372565b90506000846001600160a01b0316635fcbd2856040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ca3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cc791906122f5565b6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d28919061238b565b6001600160a01b038616600090815260016020526040902054909150611d56908390610d7b90846012611826565b6001600160a01b03808816600090815260208181526040808320938a1683529290522054909450611d8f908390610d7b90846012611826565b925050509250929050565b6001600160a01b038316600090815260026020526040812090839003611dd15767016345785d8a0000815542600190910155505050565b8054611deb67016345785d8a0000610fb36012600a6124a5565b611df590826123ae565b9050611e036012600a6124a5565b811115611e1957611e166012600a6124a5565b90505b82600003611e2957808255611e75565b6000611e3584866123ae565b9050611e53611e4485836118d1565b67016345785d8a000090611871565b611e67611e6087846118d1565b8490611871565b611e7191906123ae565b8355505b5042600190910155505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663dbcd89fa6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ee2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0691906122f5565b604051631d43c9d360e01b81526001600160a01b0384811660048301529190911690631d43c9d390602401602060405180830381865afa158015611f4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f729190612372565b6001600160a01b03831660009081526004602052604081205491925090611f999042612328565b9050611fa581836125c6565b6001600160a01b03841660009081526003602052604081208054909190611fcd9084906123ae565b9091555050505050565b600061202c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166120ee9092919063ffffffff16565b905080516000148061204d57508080602001905181019061204d91906122d3565b6117be5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104f1565b60006120b882846125ff565b6120c390600a612618565b61186790856125dd565b60006120d983836125ff565b6120e490600a612618565b61186790856125c6565b6060611867848460008585600080866001600160a01b03168587604051612115919061264b565b60006040518083038185875af1925050503d8060008114612152576040519150601f19603f3d011682016040523d82523d6000602084013e612157565b606091505b509150915061105087838387606083156121d25782516000036121cb576001600160a01b0385163b6121cb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104f1565b50816114ad565b6114ad83838151156121e75781518083602001fd5b8060405162461bcd60e51b81526004016104f19190612667565b6001600160a01b038116811461116b57600080fd5b60008060006060848603121561222b57600080fd5b83359250602084013561223d81612201565b9150604084013561224d81612201565b809150509250925092565b6000806040838503121561226b57600080fd5b82359150602083013561227d81612201565b809150509250929050565b60006020828403121561229a57600080fd5b813561186a81612201565b600080604083850312156122b857600080fd5b82356122c381612201565b9150602083013561227d81612201565b6000602082840312156122e557600080fd5b8151801515811461186a57600080fd5b60006020828403121561230757600080fd5b815161186a81612201565b634e487b7160e01b600052601160045260246000fd5b818103818111156114da576114da612312565b60208082526017908201527f4c70546f6b656e5374616b65723a2073687574646f776e000000000000000000604082015260600190565b60006020828403121561238457600080fd5b5051919050565b60006020828403121561239d57600080fd5b815160ff8116811461186a57600080fd5b808201808211156114da576114da612312565b600181815b808511156123fc5781600019048211156123e2576123e2612312565b808516156123ef57918102915b93841c93908002906123c6565b509250929050565b600082612413575060016114da565b81612420575060006114da565b816001811461243657600281146124405761245c565b60019150506114da565b60ff84111561245157612451612312565b50506001821b6114da565b5060208310610133831016604e8410600b841016171561247f575081810a6114da565b61248983836123c1565b806000190482111561249d5761249d612312565b029392505050565b600061186a8383612404565b634e487b7160e01b600052604160045260246000fd5b805161134c81612201565b600060208083850312156124e557600080fd5b825167ffffffffffffffff808211156124fd57600080fd5b818501915085601f83011261251157600080fd5b815181811115612523576125236124b1565b8060051b604051601f19603f83011681018181108582111715612548576125486124b1565b60405291825284820192508381018501918883111561256657600080fd5b938501935b8285101561258b5761257c856124c7565b8452938501939285019261256b565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b6000600182016125bf576125bf612312565b5060010190565b80820281158282048414176114da576114da612312565b6000826125fa57634e487b7160e01b600052601260045260246000fd5b500490565b60ff82811682821603908111156114da576114da612312565b600061186a60ff841683612404565b60005b8381101561264257818101518382015260200161262a565b50506000910152565b6000825161265d818460208701612627565b9190910192915050565b6020815260008251806020840152612686816040850160208701612627565b601f01601f1916919091016040019291505056fea2646970667358221220288546bd852a618e10406f912b2fc6dfbf231f12b97ee12ef01853c14950a06464736f6c634300081100330000000000000000000000002790ec478f150a98f5d96755601a26403df57eae0000000000000000000000009ae380f0272e2162340a5bb646c354271c0f5cfc000000000000000000000000b27dc5f8286f063f11491c8f349053cb37718bea
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80638aba3f77116100de578063bf86d69011610097578063f77c479111610071578063f77c4791146103c3578063fa4083ca146103ea578063fc0e74d1146103fd578063fdabc9861461040557600080fd5b8063bf86d69014610354578063d3487a8c14610371578063f0aa0a1d1461038457600080fd5b80638aba3f77146102bb578063a0190c17146102e4578063a3f0ed07146102f7578063a91ea1ba1461031f578063a972985e14610332578063bb51ccf01461034557600080fd5b80635598b2091161014b5780637acb7757116101255780637acb77571461027b5780637b3db81a1461028e5780638381e18214610298578063863445b8146102ab57600080fd5b80635598b2091461021f57806362f04c001461024857806367ba3d901461026857600080fd5b80630276d476146101935780630325d161146101a85780630a7486c7146101bb5780630fb51f41146101dd578063315865df146101fd57806333f1c3371461020c575b600080fd5b6101a66101a1366004612216565b61042c565b005b6101a66101b6366004612258565b6107de565b6101ca670de0b6b3a764000081565b6040519081526020015b60405180910390f35b6101ca6101eb366004612288565b60036020526000908152604090205481565b6101ca678ac7230489e8000081565b6101a661021a366004612216565b610a8e565b6101ca61022d366004612288565b6001600160a01b031660009081526001602052604090205490565b6101ca610256366004612288565b60046020526000908152604090205481565b6101ca610276366004612288565b610efe565b6101a6610289366004612258565b61105b565b6101ca62278d0081565b6101a66102a6366004612258565b611066565b6101ca680270801d946c94000081565b6101ca6102c9366004612288565b6001600160a01b031660009081526002602052604090205490565b6101a66102f2366004612288565b611071565b61030a610305366004612288565b61116e565b604080519283526020830191909152016101d4565b6101a661032d366004612288565b61126d565b6101ca610340366004612288565b6112aa565b6101ca67016345785d8a000081565b6005546103619060ff1681565b60405190151581526020016101d4565b6101ca61037f366004612288565b611351565b6103ab7f0000000000000000000000009ae380f0272e2162340a5bb646c354271c0f5cfc81565b6040516001600160a01b0390911681526020016101d4565b6103ab7f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae81565b6101ca6103f83660046122a5565b6114b5565b6101a66114e0565b61030a610413366004612288565b6002602052600090815260409020805460019091015482565b604051635b16ebb760e01b81526001600160a01b0383811660048301527f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae1690635b16ebb790602401602060405180830381865afa158015610492573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b691906122d3565b6104fa5760405162461bcd60e51b815260206004820152601060248201526f1b9bdd08184818dbdb9a58c81c1bdbdb60821b60448201526064015b60405180910390fd5b336000908152602081815260408083206001600160a01b038616845290915290205483111561055f5760405162461bcd60e51b81526020600482015260116024820152701b9bdd08195b9bdd59da081cdd185ad959607a1b60448201526064016104f1565b60055460ff1661063157816001600160a01b0316630f4ef8a66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105cb91906122f5565b60405163bf928f8b60e01b81523360048201526001600160a01b03919091169063bf928f8b90602401600060405180830381600087803b15801561060e57600080fd5b505af1158015610622573d6000803e3d6000fd5b505050506106313360006117a5565b336000908152602081815260408083206001600160a01b038616845290915281208054859290610662908490612328565b90915550506001600160a01b0382166000908152600160205260408120805485929061068f908490612328565b9250508190555061070d8184846001600160a01b0316635fcbd2856040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fd91906122f5565b6001600160a01b031691906117c3565b816001600160a01b0316635fcbd2856040518163ffffffff1660e01b8152600401602060405180830381865afa15801561074b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076f91906122f5565b6040516362e4a67760e11b81523360048201526001600160a01b03838116602483015260448201869052919091169063c5c94cee90606401600060405180830381600087803b1580156107c157600080fd5b505af11580156107d5573d6000803e3d6000fd5b50505050505050565b604051635b16ebb760e01b81523360048201527f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae6001600160a01b031690635b16ebb790602401602060405180830381865afa158015610842573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086691906122d3565b6108b25760405162461bcd60e51b815260206004820152601d60248201527f6f6e6c792063616c6c61626c652066726f6d20636f6e696320706f6f6c00000060448201526064016104f1565b6001600160a01b0381166000908152602081815260408083203384529091529020548211156109175760405162461bcd60e51b81526020600482015260116024820152701b9bdd08195b9bdd59da081cdd185ad959607a1b60448201526064016104f1565b60055460ff166109eb57336001600160a01b0316630f4ef8a66040518163ffffffff1660e01b8152600401602060405180830381865afa15801561095f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098391906122f5565b60405163bf928f8b60e01b81526001600160a01b038381166004830152919091169063bf928f8b90602401600060405180830381600087803b1580156109c857600080fd5b505af11580156109dc573d6000803e3d6000fd5b505050506109eb8160006117a5565b6001600160a01b03811660009081526020818152604080832033845290915281208054849290610a1c908490612328565b90915550503360009081526001602052604081208054849290610a40908490612328565b92505081905550610a8a8183336001600160a01b0316635fcbd2856040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106d9573d6000803e3d6000fd5b5050565b60055460ff1615610ab15760405162461bcd60e51b81526004016104f19061233b565b604051635b16ebb760e01b81526001600160a01b0383811660048301527f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae1690635b16ebb790602401602060405180830381865afa158015610b17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3b91906122d3565b610b7a5760405162461bcd60e51b815260206004820152601060248201526f1b9bdd08184818dbdb9a58c81c1bdbdb60821b60448201526064016104f1565b6000826001600160a01b0316635fcbd2856040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bde91906122f5565b90506000836001600160a01b031663ce75040e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c449190612372565b9050836001600160a01b0316630f4ef8a66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca891906122f5565b60405163bf928f8b60e01b81526001600160a01b038581166004830152919091169063bf928f8b90602401600060405180830381600087803b158015610ced57600080fd5b505af1158015610d01573d6000803e3d6000fd5b50505050610d8683610d8183610d7b866001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d72919061238b565b8a906012611826565b90611871565b6117a5565b610d9b6001600160a01b038316333088611893565b604051635b16ebb760e01b81523360048201527f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae6001600160a01b031690635b16ebb790602401602060405180830381865afa158015610dff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2391906122d3565b610e90576040516362e4a67760e11b81523360048201526001600160a01b0384811660248301526044820187905283169063c5c94cee90606401600060405180830381600087803b158015610e7757600080fd5b505af1158015610e8b573d6000803e3d6000fd5b505050505b6001600160a01b0380841660009081526020818152604080832093881683529290529081208054879290610ec59084906123ae565b90915550506001600160a01b03841660009081526001602052604081208054879290610ef29084906123ae565b90915550505050505050565b60055460009060ff1615610f1b5750670de0b6b3a7640000919050565b600080610f278461116e565b915091508060001480610f38575081155b15610f4e5750670de0b6b3a76400009392505050565b6000610f67680270801d946c940000610d7b85856118d1565b610f736012600a6124a5565b610f7d91906123ae565b6001600160a01b0386166000908152600260205260409020805491925090610fda67016345785d8a0000610fb36012600a6124a5565b610fbd9190612328565b610d7b62278d00856001015442610fd49190612328565b906118d1565b610fe490826123ae565b9050610ff26012600a6124a5565b811115611008576110056012600a6124a5565b90505b60006110148483611871565b9050670de0b6b3a76400008110156110355750670de0b6b3a7640000611050565b678ac7230489e800008111156110505750678ac7230489e800005b979650505050505050565b610a8a828233610a8e565b610a8a82823361042c565b60055460ff16156110945760405162461bcd60e51b81526004016104f19061233b565b806001600160a01b0316630f4ef8a66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110f691906122f5565b6001600160a01b0316336001600160a01b0316146111625760405162461bcd60e51b8152602060048201526024808201527f63616e206f6e6c792062652063616c6c656420627920726577617264206d616e60448201526330b3b2b960e11b60648201526084016104f1565b61116b816118ea565b50565b60008060007f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae6001600160a01b031663687958626040518163ffffffff1660e01b8152600401600060405180830381865afa1580156111d1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111f991908101906124d2565b905060008060005b8351811015611262576000806112308987858151811061122357611223612597565b6020026020010151611bfa565b909250905061123f82866123ae565b945061124b81856123ae565b93505050808061125a906125ad565b915050611201565b509590945092505050565b60055460ff16156112905760405162461bcd60e51b81526004016104f19061233b565b600061129b8261116e565b509050610a8a82826000611d9a565b60055460009060ff16156112d05760405162461bcd60e51b81526004016104f19061233b565b6001600160a01b0382166000908152600460205260408120546112f39042612328565b90508060000361131a5750506001600160a01b031660009081526003602052604090205490565b61132383611e82565b50506001600160a01b038116600090815260046020908152604080832042905560039091529020545b919050565b60055460009060ff161561136757506000919050565b60007f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae6001600160a01b031663dbcd89fa6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113eb91906122f5565b604051631d43c9d360e01b81526001600160a01b0385811660048301529190911690631d43c9d390602401602060405180830381865afa158015611433573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114579190612372565b6001600160a01b0384166000908152600460205260408120549192509061147e9042612328565b905061148a81836125c6565b6001600160a01b0385166000908152600360205260409020546114ad91906123ae565b949350505050565b6001600160a01b03808216600090815260208181526040808320938616835292905220545b92915050565b336001600160a01b037f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae16146115585760405162461bcd60e51b815260206004820152601d60248201527f4c70546f6b656e5374616b65723a206e6f7420636f6e74726f6c6c657200000060448201526064016104f1565b60007f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae6001600160a01b031663687958626040518163ffffffff1660e01b8152600401600060405180830381865afa1580156115b8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526115e091908101906124d2565b905060005b81518110156116225761161082828151811061160357611603612597565b60200260200101516118ea565b8061161a816125ad565b9150506115e5565b506040516370a0823160e01b81523060048201526000907f0000000000000000000000009ae380f0272e2162340a5bb646c354271c0f5cfc6001600160a01b0316906370a0823190602401602060405180830381865afa15801561168a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ae9190612372565b9050801561176b5760405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000b27dc5f8286f063f11491c8f349053cb37718bea81166004830152602482018390527f0000000000000000000000009ae380f0272e2162340a5bb646c354271c0f5cfc169063a9059cbb906044016020604051808303816000875af1158015611745573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176991906122d3565b505b6005805460ff191660011790556040517f4426aa1fb73e391071491fcfe21a88b5c38a0a0333a1f6e77161470439704cf890600090a15050565b60006117b08361116e565b5090506117be838284611d9a565b505050565b6040516001600160a01b0383166024820152604481018290526117be90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611fd7565b60008160ff168360ff160361183c57508261186a565b8160ff168360ff16111561185c576118558484846120ac565b905061186a565b6118678484846120cd565b90505b9392505050565b600061187f6012600a6124a5565b61188983856125c6565b61186a91906125dd565b6040516001600160a01b03808516602483015283166044820152606481018290526118cb9085906323b872dd60e01b906084016117ef565b50505050565b6000816118e06012600a6124a5565b61188990856125c6565b604051635b16ebb760e01b81526001600160a01b0382811660048301527f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae1690635b16ebb790602401602060405180830381865afa158015611950573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197491906122d3565b6119ad5760405162461bcd60e51b815260206004820152600a6024820152691b9bdd0818481c1bdbdb60b21b60448201526064016104f1565b60006119b8826112aa565b9050806000036119c6575050565b6040516370a0823160e01b81523060048201526000907f0000000000000000000000009ae380f0272e2162340a5bb646c354271c0f5cfc6001600160a01b0316906370a0823190602401602060405180830381865afa158015611a2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a519190612372565b90508015611b055781811115611a645750805b60405163a9059cbb60e01b81526001600160a01b038481166004830152602482018390527f0000000000000000000000009ae380f0272e2162340a5bb646c354271c0f5cfc169063a9059cbb906044016020604051808303816000875af1158015611ad3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611af791906122d3565b50611b028183612328565b91505b8115611ba0576040516340c10f1960e01b81526001600160a01b038481166004830152602482018490527f0000000000000000000000009ae380f0272e2162340a5bb646c354271c0f5cfc16906340c10f19906044016020604051808303816000875af1158015611b7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9e9190612372565b505b6001600160a01b0383166000818152600360205260408120557f896e034966eaaf1adc54acc0f257056febbd300c9e47182cf761982cf1f5e430611be483856123ae565b60405190815260200160405180910390a2505050565b6000806000836001600160a01b031663ce75040e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c619190612372565b90506000846001600160a01b0316635fcbd2856040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ca3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cc791906122f5565b6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d28919061238b565b6001600160a01b038616600090815260016020526040902054909150611d56908390610d7b90846012611826565b6001600160a01b03808816600090815260208181526040808320938a1683529290522054909450611d8f908390610d7b90846012611826565b925050509250929050565b6001600160a01b038316600090815260026020526040812090839003611dd15767016345785d8a0000815542600190910155505050565b8054611deb67016345785d8a0000610fb36012600a6124a5565b611df590826123ae565b9050611e036012600a6124a5565b811115611e1957611e166012600a6124a5565b90505b82600003611e2957808255611e75565b6000611e3584866123ae565b9050611e53611e4485836118d1565b67016345785d8a000090611871565b611e67611e6087846118d1565b8490611871565b611e7191906123ae565b8355505b5042600190910155505050565b60007f0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae6001600160a01b031663dbcd89fa6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ee2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0691906122f5565b604051631d43c9d360e01b81526001600160a01b0384811660048301529190911690631d43c9d390602401602060405180830381865afa158015611f4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f729190612372565b6001600160a01b03831660009081526004602052604081205491925090611f999042612328565b9050611fa581836125c6565b6001600160a01b03841660009081526003602052604081208054909190611fcd9084906123ae565b9091555050505050565b600061202c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166120ee9092919063ffffffff16565b905080516000148061204d57508080602001905181019061204d91906122d3565b6117be5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104f1565b60006120b882846125ff565b6120c390600a612618565b61186790856125dd565b60006120d983836125ff565b6120e490600a612618565b61186790856125c6565b6060611867848460008585600080866001600160a01b03168587604051612115919061264b565b60006040518083038185875af1925050503d8060008114612152576040519150601f19603f3d011682016040523d82523d6000602084013e612157565b606091505b509150915061105087838387606083156121d25782516000036121cb576001600160a01b0385163b6121cb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104f1565b50816114ad565b6114ad83838151156121e75781518083602001fd5b8060405162461bcd60e51b81526004016104f19190612667565b6001600160a01b038116811461116b57600080fd5b60008060006060848603121561222b57600080fd5b83359250602084013561223d81612201565b9150604084013561224d81612201565b809150509250925092565b6000806040838503121561226b57600080fd5b82359150602083013561227d81612201565b809150509250929050565b60006020828403121561229a57600080fd5b813561186a81612201565b600080604083850312156122b857600080fd5b82356122c381612201565b9150602083013561227d81612201565b6000602082840312156122e557600080fd5b8151801515811461186a57600080fd5b60006020828403121561230757600080fd5b815161186a81612201565b634e487b7160e01b600052601160045260246000fd5b818103818111156114da576114da612312565b60208082526017908201527f4c70546f6b656e5374616b65723a2073687574646f776e000000000000000000604082015260600190565b60006020828403121561238457600080fd5b5051919050565b60006020828403121561239d57600080fd5b815160ff8116811461186a57600080fd5b808201808211156114da576114da612312565b600181815b808511156123fc5781600019048211156123e2576123e2612312565b808516156123ef57918102915b93841c93908002906123c6565b509250929050565b600082612413575060016114da565b81612420575060006114da565b816001811461243657600281146124405761245c565b60019150506114da565b60ff84111561245157612451612312565b50506001821b6114da565b5060208310610133831016604e8410600b841016171561247f575081810a6114da565b61248983836123c1565b806000190482111561249d5761249d612312565b029392505050565b600061186a8383612404565b634e487b7160e01b600052604160045260246000fd5b805161134c81612201565b600060208083850312156124e557600080fd5b825167ffffffffffffffff808211156124fd57600080fd5b818501915085601f83011261251157600080fd5b815181811115612523576125236124b1565b8060051b604051601f19603f83011681018181108582111715612548576125486124b1565b60405291825284820192508381018501918883111561256657600080fd5b938501935b8285101561258b5761257c856124c7565b8452938501939285019261256b565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b6000600182016125bf576125bf612312565b5060010190565b80820281158282048414176114da576114da612312565b6000826125fa57634e487b7160e01b600052601260045260246000fd5b500490565b60ff82811682821603908111156114da576114da612312565b600061186a60ff841683612404565b60005b8381101561264257818101518382015260200161262a565b50506000910152565b6000825161265d818460208701612627565b9190910192915050565b6020815260008251806020840152612686816040850160208701612627565b601f01601f1916919091016040019291505056fea2646970667358221220288546bd852a618e10406f912b2fc6dfbf231f12b97ee12ef01853c14950a06464736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae0000000000000000000000009ae380f0272e2162340a5bb646c354271c0f5cfc000000000000000000000000b27dc5f8286f063f11491c8f349053cb37718bea
-----Decoded View---------------
Arg [0] : controller_ (address): 0x2790EC478f150a98F5D96755601a26403DF57EaE
Arg [1] : cnc_ (address): 0x9aE380F0272E2162340a5bB646c354271c0F5cFC
Arg [2] : treasury_ (address): 0xB27DC5f8286f063F11491c8f349053cB37718bea
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000002790ec478f150a98f5d96755601a26403df57eae
Arg [1] : 0000000000000000000000009ae380f0272e2162340a5bb646c354271c0f5cfc
Arg [2] : 000000000000000000000000b27dc5f8286f063f11491c8f349053cb37718bea
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.