Source Code
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Swap Exact ETH F... | 21428846 | 448 days ago | 158 ETH | ||||
| Transfer | 21421902 | 449 days ago | 158 ETH | ||||
| Swap Exact ETH F... | 20840609 | 530 days ago | 82 ETH | ||||
| Swap Exact ETH F... | 20840008 | 530 days ago | 82 ETH | ||||
| Transfer | 20830527 | 532 days ago | 164 ETH | ||||
| Swap Exact ETH F... | 20513482 | 576 days ago | 348 ETH | ||||
| Transfer | 20511075 | 576 days ago | 348 ETH | ||||
| Swap Exact ETH F... | 20510623 | 576 days ago | 1 ETH | ||||
| Transfer | 20498224 | 578 days ago | 1 ETH | ||||
| Swap Exact ETH F... | 15276055 | 1315 days ago | 254.809304 ETH | ||||
| Swap Exact ETH F... | 15263305 | 1317 days ago | 291 ETH | ||||
| Swap Exact ETH F... | 15256726 | 1318 days ago | 209 ETH | ||||
| Swap Exact ETH F... | 15238830 | 1321 days ago | 203 ETH | ||||
| Swap Exact ETH F... | 15237875 | 1321 days ago | 297 ETH | ||||
| Swap Exact ETH F... | 15237436 | 1321 days ago | 28 ETH | ||||
| Swap Exact ETH F... | 15234356 | 1322 days ago | 472 ETH | ||||
| Swap Exact ETH F... | 15221133 | 1324 days ago | 275 ETH | ||||
| Swap Exact ETH F... | 15221017 | 1324 days ago | 275 ETH | ||||
| Swap Exact ETH F... | 15218050 | 1324 days ago | 225 ETH | ||||
| Swap Exact ETH F... | 15185902 | 1329 days ago | 329 ETH | ||||
| Swap Exact ETH F... | 15180274 | 1330 days ago | 271 ETH | ||||
| Swap Exact ETH F... | 15179549 | 1330 days ago | 377.78999999 ETH | ||||
| Swap Exact ETH F... | 15173584 | 1331 days ago | 126 ETH | ||||
| Transfer | 15173438 | 1331 days ago | 3,358.59930472 ETH | ||||
| Swap Exact ETH F... | 15169813 | 1332 days ago | 300 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
Vault
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import { ICorePool } from "./interfaces/ICorePool.sol";
import { ICorePoolV1 } from "./interfaces/ICorePoolV1.sol";
import { IERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import { ErrorHandler } from "./libraries/ErrorHandler.sol";
import { IUniswapV2Router02 } from "./interfaces/IUniswapV2Router02.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title Illuvium Vault.
*
* @dev The Vault is responsible to gather revenue from the protocol, swap to ILV
* periodically and distribute to core pool users from time to time.
* @dev The contract connects with Sushi's router in order to buy ILV from the
* ILV/ETH liquidity pool.
* @dev Since we can change the vault address in the staking pools (see VaultRecipient),
* the Vault contract doesn't need to implement upgradeability.
* @dev It receives ETH from the receive() function and allows conversion to ILV by
* the address with the role ROLE_VAULT_MANAGER (0x0001_0000). This conversion
* can be done in multiple steps, which means it doesn’t require converting
* all ETH balance in 1 function call. The vault is also responsible to be
* calling receiveVaultRewards() function in the core pools, which takes care
* of calculations of how much ILV should be sent to each pool as revenue distribution.
* @notice The contract uses Ownable implementation, so only the eDAO is able to handle
* the ETH => ILV swaps and distribution schedules.
*
*/
contract Vault is Ownable {
using ErrorHandler for bytes4;
/**
* @dev Auxiliary data structure to store ILV, LP and Locked pools,
* linked to this smart contract and receiving vault rewards
*/
struct Pools {
ICorePool ilvPool;
ICorePool pairPool;
ICorePool lockedPoolV1;
}
/**
* @dev struct with each core pool address
*/
Pools public pools;
/**
* @dev Link to Sushiswap's router deployed instance
*/
IUniswapV2Router02 private _sushiRouter;
/**
* @dev Link to IlluviumERC20 token deployed instance
*/
IERC20Upgradeable private _ilv;
/**
* @dev Internal multiplier used to calculate amount to send
* to each staking pool
*/
uint256 internal constant AMOUNT_TO_SEND_MULTIPLIER = 1e12;
/**
* @dev Fired in _swapEthForIlv() and sendIlvRewards() (via swapEthForIlv)
*
* @param by an address which executed the function
* @param ethSpent ETH amount sent to Sushiswap
* @param ilvReceived ILV amount received from Sushiswap
*/
event LogSwapEthForILV(address indexed by, uint256 ethSpent, uint256 ilvReceived);
/**
* @dev Fired in sendIlvRewards()
*
* @param by an address which executed the function
* @param value ILV amount sent to the pool
*/
event LogSendILVRewards(address indexed by, uint256 value);
/**
* @dev Fired in default payable receive()
*
* @param by an address which sent ETH into the vault (this contract)
* @param value ETH amount received
*/
event LogEthReceived(address indexed by, uint256 value);
/**
* @dev Fired in setCorePools()
*
* @param by address who executed the setup
* @param ilvPool deployed ILV core pool address
* @param pairPool deployed ILV/ETH pair (LP) pool address
* @param lockedPoolV1 deployed locked pool V1 address
*/
event LogSetCorePools(address indexed by, address ilvPool, address pairPool, address lockedPoolV1);
/**
* @notice Creates (deploys) Vault linked to Sushi AMM Router and IlluviumERC20 token
*
* @param sushiRouter_ an address of the IUniswapV2Router02 to use for ETH -> ILV exchange
* @param ilv_ an address of the IlluviumERC20 token to use
*/
constructor(address sushiRouter_, address ilv_) {
// we're using a fake selector in the constructor to simplify
// input and state validation
bytes4 fnSelector = bytes4(0);
// verify the inputs are set
fnSelector.verifyNonZeroInput(uint160(sushiRouter_), 0);
fnSelector.verifyNonZeroInput(uint160(ilv_), 1);
// assign the values
_sushiRouter = IUniswapV2Router02(sushiRouter_);
_ilv = IERC20Upgradeable(ilv_);
}
/**
* @dev Auxiliary function used as part of the contract setup process to setup core pools,
* executed by `owner()` after deployment
*
* @param _ilvPool deployed ILV core pool address
* @param _pairPool deployed ILV/ETH pair (LP) pool address
* @param _lockedPoolV1 deployed locked pool V1 address
*/
function setCorePools(
ICorePool _ilvPool,
ICorePool _pairPool,
ICorePool _lockedPoolV1
) external onlyOwner {
bytes4 fnSelector = this.setCorePools.selector;
// verify all the pools are set/supplied
fnSelector.verifyNonZeroInput(uint160(address(_ilvPool)), 2);
fnSelector.verifyNonZeroInput(uint160(address(_pairPool)), 3);
fnSelector.verifyNonZeroInput(uint160(address(_lockedPoolV1)), 4);
// set up
pools.ilvPool = _ilvPool;
pools.pairPool = _pairPool;
pools.lockedPoolV1 = _lockedPoolV1;
// emit an event
emit LogSetCorePools(msg.sender, address(_ilvPool), address(_pairPool), address(_lockedPoolV1));
}
/**
* @notice Exchanges ETH balance present on the contract into ILV via Sushiswap
*
* @dev Logs operation via `EthIlvSwapped` event
*
* @param _ilvOut expected ILV amount to be received from Sushiswap swap
* @param _deadline maximum timestamp to wait for Sushiswap swap (inclusive)
*/
function swapETHForILV(
uint256 _ethIn,
uint256 _ilvOut,
uint256 _deadline
) external onlyOwner {
_swapETHForILV(_ethIn, _ilvOut, _deadline);
}
/**
* @notice Converts an entire contract's ETH balance into ILV via Sushiswap and
* sends the entire contract's ILV balance to the Illuvium Yield Pool
*
* @dev Uses `swapEthForIlv` internally to exchange ETH -> ILV
*
* @dev Logs operation via `RewardsDistributed` event
*
* @dev Set `ilvOut` or `deadline` to zero to skip `swapEthForIlv` call
*
* @param _ilvOut expected ILV amount to be received from Sushiswap swap
* @param _deadline maximum timeout to wait for Sushiswap swap
*/
function sendILVRewards(
uint256 _ethIn,
uint256 _ilvOut,
uint256 _deadline
) external onlyOwner {
// we treat set `ilvOut` and `deadline` as a flag to execute `swapEthForIlv`
// in the same time we won't execute the swap if contract balance is zero
if (_ilvOut > 0 && _deadline > 0 && address(this).balance > 0) {
// exchange ETH on the contract's balance into ILV via Sushi - delegate to `swapEthForIlv`
_swapETHForILV(_ethIn, _ilvOut, _deadline);
}
// reads core pools
(ICorePool ilvPool, ICorePool pairPool, ICorePool lockedPoolV1) = (
pools.ilvPool,
pools.pairPool,
pools.lockedPoolV1
);
// read contract's ILV balance
uint256 ilvBalance = _ilv.balanceOf(address(this));
// approve the entire ILV balance to be sent into the pool
if (_ilv.allowance(address(this), address(ilvPool)) < ilvBalance) {
_ilv.approve(address(ilvPool), ilvBalance);
}
if (_ilv.allowance(address(this), address(pairPool)) < ilvBalance) {
_ilv.approve(address(pairPool), ilvBalance);
}
if (_ilv.allowance(address(this), address(lockedPoolV1)) < ilvBalance) {
_ilv.approve(address(lockedPoolV1), ilvBalance);
}
// gets poolToken reserves in each pool
uint256 reserve0 = ilvPool.getTotalReserves();
uint256 reserve1 = estimatePairPoolReserve(address(pairPool));
uint256 reserve2 = lockedPoolV1.poolTokenReserve();
// ILV in ILV core pool + ILV in ILV/ETH core pool representation + ILV in locked pool
uint256 totalReserve = reserve0 + reserve1 + reserve2;
// amount of ILV to send to ILV core pool
uint256 amountToSend0 = _getAmountToSend(ilvBalance, reserve0, totalReserve);
// amount of ILV to send to ILV/ETH core pool
uint256 amountToSend1 = _getAmountToSend(ilvBalance, reserve1, totalReserve);
// amount of ILV to send to locked ILV pool V1
uint256 amountToSend2 = _getAmountToSend(ilvBalance, reserve2, totalReserve);
// makes sure we are sending a valid amount
assert(amountToSend0 + amountToSend1 + amountToSend2 <= ilvBalance);
// sends ILV to both core pools
ilvPool.receiveVaultRewards(amountToSend0);
pairPool.receiveVaultRewards(amountToSend1);
lockedPoolV1.receiveVaultRewards(amountToSend2);
// emit an event
emit LogSendILVRewards(msg.sender, ilvBalance);
}
/**
* @dev Auxiliary function used to estimate LP core pool share among the other core pools.
*
* @dev Expected to estimate how much ILV is represented by the number of LP tokens staked
* in the pair pool in order to determine how much revenue distribution should be allocated
* to the Sushi LP pool.
*
* @param _pairPool LP core pool extracted from pools structure (gas saving optimization)
* @return ilvAmount ILV estimate of the LP pool share among the other pools
*/
function estimatePairPoolReserve(address _pairPool) public view returns (uint256 ilvAmount) {
// 1. Store the amount of LP tokens staked in the ILV/ETH pool
// and the LP token total supply (total amount of LP tokens in circulation).
// With these two values we will be able to estimate how much ILV each LP token
// is worth.
uint256 lpAmount = ICorePool(_pairPool).getTotalReserves();
uint256 lpTotal = IERC20Upgradeable(ICorePool(_pairPool).poolToken()).totalSupply();
// 2. We check how much ILV the LP token contract holds, that way
// based on the total value of ILV tokens represented by the total
// supply of LP tokens, we are able to calculate through a simple rule
// of 3 how much ILV the amount of staked LP tokens represent.
uint256 ilvTotal = _ilv.balanceOf(ICorePool(_pairPool).poolToken());
// we store the result
ilvAmount = (ilvTotal * lpAmount) / lpTotal;
}
/**
* @dev Auxiliary function to calculate amount of rewards to send to the pool
* based on ILV rewards available to be split between the pools,
* particular pool reserve and total reserve of all the pools
*
* @dev A particular pool receives an amount proportional to its reserves
*
* @param _ilvBalance available amount of rewards to split between the pools
* @param _poolReserve particular pool reserves
* @param _totalReserve total cumulative reserves of all the pools to split rewards between
*/
function _getAmountToSend(
uint256 _ilvBalance,
uint256 _poolReserve,
uint256 _totalReserve
) private pure returns (uint256) {
return (_ilvBalance * ((_poolReserve * AMOUNT_TO_SEND_MULTIPLIER) / _totalReserve)) / AMOUNT_TO_SEND_MULTIPLIER;
}
function _swapETHForILV(
uint256 _ethIn,
uint256 _ilvOut,
uint256 _deadline
) private {
// we're using selector to simplify input and state validation
// internal function simulated selector is `bytes4(keccak256("_swapETHForILV(uint256,uint256,uint256)"))`
bytes4 fnSelector = 0x45b603e4;
// verify the inputs
fnSelector.verifyNonZeroInput(_ethIn, 0);
fnSelector.verifyNonZeroInput(_ilvOut, 1);
fnSelector.verifyInput(_deadline >= block.timestamp, 2);
// checks if there's enough balance
fnSelector.verifyState(address(this).balance > _ethIn, 3);
// create and initialize path array to be used in Sushiswap
// first element of the path determines an input token (what we send to Sushiswap),
// last element determines output token (what we receive from uniwsap)
address[] memory path = new address[](2);
// we send ETH wrapped as WETH into Sushiswap
path[0] = _sushiRouter.WETH();
// we receive ILV from Sushiswap
path[1] = address(_ilv);
// exchange ETH -> ILV via Sushiswap
uint256[] memory amounts = _sushiRouter.swapExactETHForTokens{ value: _ethIn }(
_ilvOut,
path,
address(this),
_deadline
);
// asserts that ILV amount bought wasn't invalid
assert(amounts[1] > 0);
// emit an event logging the operation
emit LogSwapEthForILV(msg.sender, amounts[0], amounts[1]);
}
/**
* @dev Overrides `Ownable.renounceOwnership()`, to avoid accidentally
* renouncing ownership of the Vault contract.
*/
function renounceOwnership() public virtual override {}
/**
* @notice Default payable function, allows to top up contract's ETH balance
* to be exchanged into ILV via Sushiswap
*
* @dev Logs operation via `LogEthReceived` event
*/
receive() external payable {
// emit an event
emit LogEthReceived(msg.sender, msg.value);
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import { Stake } from "../libraries/Stake.sol";
interface ICorePool {
function users(address _user)
external
view
returns (
uint128,
uint128,
uint128,
uint248,
uint8,
uint256,
uint256
);
function poolToken() external view returns (address);
function isFlashPool() external view returns (bool);
function weight() external view returns (uint32);
function lastYieldDistribution() external view returns (uint64);
function yieldRewardsPerWeight() external view returns (uint256);
function globalWeight() external view returns (uint256);
function pendingRewards(address _user) external view returns (uint256, uint256);
function poolTokenReserve() external view returns (uint256);
function balanceOf(address _user) external view returns (uint256);
function getTotalReserves() external view returns (uint256);
function getStake(address _user, uint256 _stakeId) external view returns (Stake.Data memory);
function getStakesLength(address _user) external view returns (uint256);
function sync() external;
function setWeight(uint32 _weight) external;
function receiveVaultRewards(uint256 value) external;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
interface ICorePoolV1 {
struct V1Stake {
// @dev token amount staked
uint256 tokenAmount;
// @dev stake weight
uint256 weight;
// @dev locking period - from
uint64 lockedFrom;
// @dev locking period - until
uint64 lockedUntil;
// @dev indicates if the stake was created as a yield reward
bool isYield;
}
struct V1User {
// @dev Total staked amount
uint256 tokenAmount;
// @dev Total weight
uint256 totalWeight;
// @dev Auxiliary variable for yield calculation
uint256 subYieldRewards;
// @dev Auxiliary variable for vault rewards calculation
uint256 subVaultRewards;
// @dev An array of holder's deposits
V1Stake[] deposits;
}
function users(address _who)
external
view
returns (
uint256,
uint256,
uint256,
uint256
);
function getDeposit(address _from, uint256 _stakeId)
external
view
returns (
uint256,
uint256,
uint64,
uint64,
bool
);
function poolToken() external view returns (address);
function usersLockingWeight() external view returns (uint256);
function poolTokenReserve() external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Upgradeable {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
/**
* @title Errors Library.
*
* @notice Introduces some very common input and state validation for smart contracts,
* such as non-zero input validation, general boolean expression validation, access validation.
*
* @notice Throws pre-defined errors instead of string error messages to reduce gas costs.
*
* @notice Since the library handles only very common errors, concrete smart contracts may
* also introduce their own error types and handling.
*
* @author Basil Gorin
*/
library ErrorHandler {
/**
* @notice Thrown on zero input at index specified in a function specified.
*
* @param fnSelector function selector, defines a function where error was thrown
* @param paramIndex function parameter index which caused an error thrown
*/
error ZeroInput(bytes4 fnSelector, uint8 paramIndex);
/**
* @notice Thrown on invalid input at index specified in a function specified.
*
* @param fnSelector function selector, defines a function where error was thrown
* @param paramIndex function parameter index which caused an error thrown
*/
error InvalidInput(bytes4 fnSelector, uint8 paramIndex);
/**
* @notice Thrown on invalid state in a function specified.
*
* @param fnSelector function selector, defines a function where error was thrown
* @param errorCode unique error code determining the exact place in code where error was thrown
*/
error InvalidState(bytes4 fnSelector, uint256 errorCode);
/**
* @notice Thrown on invalid access to a function specified.
*
* @param fnSelector function selector, defines a function where error was thrown
* @param addr an address which access was denied, usually transaction sender
*/
error AccessDenied(bytes4 fnSelector, address addr);
/**
* @notice Verifies an input is set (non-zero).
*
* @param fnSelector function selector, defines a function which called the verification
* @param value a value to check if it's set (non-zero)
* @param paramIndex function parameter index which is verified
*/
function verifyNonZeroInput(
bytes4 fnSelector,
uint256 value,
uint8 paramIndex
) internal pure {
if (value == 0) {
revert ZeroInput(fnSelector, paramIndex);
}
}
/**
* @notice Verifies an input is correct.
*
* @param fnSelector function selector, defines a function which called the verification
* @param expr a boolean expression used to verify the input
* @param paramIndex function parameter index which is verified
*/
function verifyInput(
bytes4 fnSelector,
bool expr,
uint8 paramIndex
) internal pure {
if (!expr) {
revert InvalidInput(fnSelector, paramIndex);
}
}
/**
* @notice Verifies smart contract state is correct.
*
* @param fnSelector function selector, defines a function which called the verification
* @param expr a boolean expression used to verify the contract state
* @param errorCode unique error code determining the exact place in code which is verified
*/
function verifyState(
bytes4 fnSelector,
bool expr,
uint256 errorCode
) internal pure {
if (!expr) {
revert InvalidState(fnSelector, errorCode);
}
}
/**
* @notice Verifies an access to the function.
*
* @param fnSelector function selector, defines a function which called the verification
* @param expr a boolean expression used to verify the access
*/
function verifyAccess(bytes4 fnSelector, bool expr) internal view {
if (!expr) {
revert AccessDenied(fnSelector, msg.sender);
}
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import { IUniswapV2Router01 } from "./IUniswapV2Router01.sol";
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/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() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(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");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
/**
* @dev Stake library used by ILV pool and Sushi LP Pool.
*
* @dev Responsible to manage weight calculation and store important constants
* related to stake period, base weight and multipliers utilized.
*/
library Stake {
struct Data {
/// @dev token amount staked
uint120 value;
/// @dev locking period - from
uint64 lockedFrom;
/// @dev locking period - until
uint64 lockedUntil;
/// @dev indicates if the stake was created as a yield reward
bool isYield;
}
/**
* @dev Stake weight is proportional to stake value and time locked, precisely
* "stake value wei multiplied by (fraction of the year locked plus one)".
* @dev To avoid significant precision loss due to multiplication by "fraction of the year" [0, 1],
* weight is stored multiplied by 1e6 constant, as an integer.
* @dev Corner case 1: if time locked is zero, weight is stake value multiplied by 1e6 + base weight
* @dev Corner case 2: if time locked is two years, division of
(lockedUntil - lockedFrom) / MAX_STAKE_PERIOD is 1e6, and
* weight is a stake value multiplied by 2 * 1e6.
*/
uint256 internal constant WEIGHT_MULTIPLIER = 1e6;
/**
* @dev Minimum weight value, if result of multiplication using WEIGHT_MULTIPLIER
* is 0 (e.g stake flexible), then BASE_WEIGHT is used.
*/
uint256 internal constant BASE_WEIGHT = 1e6;
/**
* @dev Minimum period that someone can lock a stake for.
*/
uint256 internal constant MIN_STAKE_PERIOD = 30 days;
/**
* @dev Maximum period that someone can lock a stake for.
*/
uint256 internal constant MAX_STAKE_PERIOD = 365 days;
/**
* @dev Rewards per weight are stored multiplied by 1e20 as uint.
*/
uint256 internal constant REWARD_PER_WEIGHT_MULTIPLIER = 1e20;
/**
* @dev When we know beforehand that staking is done for yield instead of
* executing `weight()` function we use the following constant.
*/
uint256 internal constant YIELD_STAKE_WEIGHT_MULTIPLIER = 2 * 1e6;
function weight(Data storage _self) internal view returns (uint256) {
return
uint256(
(((_self.lockedUntil - _self.lockedFrom) * WEIGHT_MULTIPLIER) / MAX_STAKE_PERIOD + BASE_WEIGHT) *
_self.value
);
}
/**
* @dev Converts stake weight (not to be mixed with the pool weight) to
* ILV reward value, applying the 10^12 division on weight
*
* @param _weight stake weight
* @param _rewardPerWeight ILV reward per weight
* @param _rewardPerWeightPaid last reward per weight value used for user earnings
* @return reward value normalized to 10^12
*/
function earned(
uint256 _weight,
uint256 _rewardPerWeight,
uint256 _rewardPerWeightPaid
) internal pure returns (uint256) {
// apply the formula and return
return (_weight * (_rewardPerWeight - _rewardPerWeightPaid)) / REWARD_PER_WEIGHT_MULTIPLIER;
}
/**
* @dev Converts reward ILV value to stake weight (not to be mixed with the pool weight),
* applying the 10^12 multiplication on the reward.
* - OR -
* @dev Converts reward ILV value to reward/weight if stake weight is supplied as second
* function parameter instead of reward/weight.
*
* @param _reward yield reward
* @param _globalWeight total weight in the pool
* @return reward per weight value
*/
function getRewardPerWeight(uint256 _reward, uint256 _globalWeight) internal pure returns (uint256) {
// apply the reverse formula and return
return (_reward * REWARD_PER_WEIGHT_MULTIPLIER) / _globalWeight;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint256 amountADesired,
uint256 amountBDesired,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
)
external
returns (
uint256 amountA,
uint256 amountB,
uint256 liquidity
);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function removeLiquidity(
address tokenA,
address tokenB,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB);
function removeLiquidityETH(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountToken, uint256 amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountA, uint256 amountB);
function removeLiquidityETHWithPermit(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountToken, uint256 amountETH);
function swapExactTokensForTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapTokensForExactTokens(
uint256 amountOut,
uint256 amountInMax,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapExactETHForTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function swapTokensForExactETH(
uint256 amountOut,
uint256 amountInMax,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapExactTokensForETH(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapETHForExactTokens(
uint256 amountOut,
address[] calldata path,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function quote(
uint256 amountA,
uint256 reserveA,
uint256 reserveB
) external pure returns (uint256 amountB);
function getAmountOut(
uint256 amountIn,
uint256 reserveIn,
uint256 reserveOut
) external pure returns (uint256 amountOut);
function getAmountIn(
uint256 amountOut,
uint256 reserveIn,
uint256 reserveOut
) external pure returns (uint256 amountIn);
function getAmountsOut(uint256 amountIn, address[] calldata path) external view returns (uint256[] memory amounts);
function getAmountsIn(uint256 amountOut, address[] calldata path) external view returns (uint256[] memory amounts);
}// SPDX-License-Identifier: MIT
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;
}
}{
"metadata": {
"bytecodeHash": "none"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"sushiRouter_","type":"address"},{"internalType":"address","name":"ilv_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"bytes4","name":"fnSelector","type":"bytes4"},{"internalType":"uint8","name":"paramIndex","type":"uint8"}],"name":"InvalidInput","type":"error"},{"inputs":[{"internalType":"bytes4","name":"fnSelector","type":"bytes4"},{"internalType":"uint256","name":"errorCode","type":"uint256"}],"name":"InvalidState","type":"error"},{"inputs":[{"internalType":"bytes4","name":"fnSelector","type":"bytes4"},{"internalType":"uint8","name":"paramIndex","type":"uint8"}],"name":"ZeroInput","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"LogEthReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"LogSendILVRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"},{"indexed":false,"internalType":"address","name":"ilvPool","type":"address"},{"indexed":false,"internalType":"address","name":"pairPool","type":"address"},{"indexed":false,"internalType":"address","name":"lockedPoolV1","type":"address"}],"name":"LogSetCorePools","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"},{"indexed":false,"internalType":"uint256","name":"ethSpent","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ilvReceived","type":"uint256"}],"name":"LogSwapEthForILV","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"address","name":"_pairPool","type":"address"}],"name":"estimatePairPoolReserve","outputs":[{"internalType":"uint256","name":"ilvAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pools","outputs":[{"internalType":"contract ICorePool","name":"ilvPool","type":"address"},{"internalType":"contract ICorePool","name":"pairPool","type":"address"},{"internalType":"contract ICorePool","name":"lockedPoolV1","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ethIn","type":"uint256"},{"internalType":"uint256","name":"_ilvOut","type":"uint256"},{"internalType":"uint256","name":"_deadline","type":"uint256"}],"name":"sendILVRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ICorePool","name":"_ilvPool","type":"address"},{"internalType":"contract ICorePool","name":"_pairPool","type":"address"},{"internalType":"contract ICorePool","name":"_lockedPoolV1","type":"address"}],"name":"setCorePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ethIn","type":"uint256"},{"internalType":"uint256","name":"_ilvOut","type":"uint256"},{"internalType":"uint256","name":"_deadline","type":"uint256"}],"name":"swapETHForILV","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60806040523480156200001157600080fd5b50604051620015fd380380620015fd833981016040819052620000349162000170565b6200003f33620000c6565b600062000063816001600160a01b0385168162000116602090811b62000d5717901c565b62000093826001600160a01b03166001836001600160e01b0319166200011660201b62000d57179092919060201c565b50600480546001600160a01b039384166001600160a01b03199182161790915560058054929093169116179055620001a7565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b816200014e57604051633bd8dd9360e21b81526001600160e01b03198416600482015260ff8216602482015260440160405180910390fd5b505050565b80516001600160a01b03811681146200016b57600080fd5b919050565b6000806040838503121562000183578182fd5b6200018e8362000153565b91506200019e6020840162000153565b90509250929050565b61144680620001b76000396000f3fe60806040526004361061007f5760003560e01c8063c5c51dca1161004e578063c5c51dca1461014c578063c7ee9618146101a3578063e581a34b146101c3578063f2fde38b146101e357600080fd5b806343ba2eea146100c0578063715018a6146100e25780638d36bfa3146100f15780638da5cb5b1461012457600080fd5b366100bb5760405134815233907f9f989b0392c81cb6bb0358162e1a39467776f69799ba0137b0fc0c3a5efac9bd9060200160405180910390a2005b600080fd5b3480156100cc57600080fd5b506100e06100db366004611276565b610203565b005b3480156100ee57600080fd5b50005b3480156100fd57600080fd5b5061011161010c366004611157565b610318565b6040519081526020015b60405180910390f35b34801561013057600080fd5b506000546040516001600160a01b03909116815260200161011b565b34801561015857600080fd5b50600154600254600354610179926001600160a01b03908116928116911683565b604080516001600160a01b039485168152928416602084015292169181019190915260600161011b565b3480156101af57600080fd5b506100e06101be3660046112d8565b6105a1565b3480156101cf57600080fd5b506100e06101de3660046112d8565b610c82565b3480156101ef57600080fd5b506100e06101fe366004611157565b610cbc565b6000546001600160a01b031633146102365760405162461bcd60e51b815260040161022d90611303565b60405180910390fd5b6321dd177560e11b610253816001600160a01b0386166002610d57565b6102726001600160e01b031982166001600160a01b0385166003610d57565b6102916001600160e01b031982166001600160a01b0384166004610d57565b600180546001600160a01b038681166001600160a01b03199283168117909355600280548783169084168117909155600380549287169290931682179092556040805193845260208401929092529082015233907fb0bfaa6fffe109a6d53e4aab145aef9232482bd51c0b271d264dbb73681a2c829060600160405180910390a250505050565b600080826001600160a01b031663242693d36040518163ffffffff1660e01b815260040160206040518083038186803b15801561035457600080fd5b505afa158015610368573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038c91906112c0565b90506000836001600160a01b031663cbdf382c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103c957600080fd5b505afa1580156103dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610401919061117a565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561043957600080fd5b505afa15801561044d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047191906112c0565b90506000600560009054906101000a90046001600160a01b03166001600160a01b03166370a08231866001600160a01b031663cbdf382c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156104d257600080fd5b505afa1580156104e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050a919061117a565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b15801561054957600080fd5b505afa15801561055d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058191906112c0565b90508161058e84836113d9565b61059891906113b9565b95945050505050565b6000546001600160a01b031633146105cb5760405162461bcd60e51b815260040161022d90611303565b6000821180156105db5750600081115b80156105e75750600047115b156105f7576105f7838383610d8a565b6001546002546003546005546040516370a0823160e01b81523060048201526001600160a01b0394851694938416939283169260009216906370a082319060240160206040518083038186803b15801561065057600080fd5b505afa158015610664573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068891906112c0565b600554604051636eb1769f60e11b81523060048201526001600160a01b03878116602483015292935083929091169063dd62ed3e9060440160206040518083038186803b1580156106d857600080fd5b505afa1580156106ec573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071091906112c0565b101561079e5760055460405163095ea7b360e01b81526001600160a01b038681166004830152602482018490529091169063095ea7b390604401602060405180830381600087803b15801561076457600080fd5b505af1158015610778573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079c9190611256565b505b600554604051636eb1769f60e11b81523060048201526001600160a01b0385811660248301528392169063dd62ed3e9060440160206040518083038186803b1580156107e957600080fd5b505afa1580156107fd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082191906112c0565b10156108af5760055460405163095ea7b360e01b81526001600160a01b038581166004830152602482018490529091169063095ea7b390604401602060405180830381600087803b15801561087557600080fd5b505af1158015610889573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ad9190611256565b505b600554604051636eb1769f60e11b81523060048201526001600160a01b0384811660248301528392169063dd62ed3e9060440160206040518083038186803b1580156108fa57600080fd5b505afa15801561090e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093291906112c0565b10156109c05760055460405163095ea7b360e01b81526001600160a01b038481166004830152602482018490529091169063095ea7b390604401602060405180830381600087803b15801561098657600080fd5b505af115801561099a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109be9190611256565b505b6000846001600160a01b031663242693d36040518163ffffffff1660e01b815260040160206040518083038186803b1580156109fb57600080fd5b505afa158015610a0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3391906112c0565b90506000610a4085610318565b90506000846001600160a01b031663ce1115416040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7d57600080fd5b505afa158015610a91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab591906112c0565b9050600081610ac484866113a1565b610ace91906113a1565b90506000610add86868461106a565b90506000610aec87868561106a565b90506000610afb88868661106a565b90508781610b0984866113a1565b610b1391906113a1565b1115610b2f57634e487b7160e01b600052600160045260246000fd5b6040516301810d2b60e51b8152600481018490526001600160a01b038c1690633021a56090602401600060405180830381600087803b158015610b7157600080fd5b505af1158015610b85573d6000803e3d6000fd5b50506040516301810d2b60e51b8152600481018590526001600160a01b038d169250633021a5609150602401600060405180830381600087803b158015610bcb57600080fd5b505af1158015610bdf573d6000803e3d6000fd5b50506040516301810d2b60e51b8152600481018490526001600160a01b038c169250633021a5609150602401600060405180830381600087803b158015610c2557600080fd5b505af1158015610c39573d6000803e3d6000fd5b50506040518a81523392507ff72070363b93eb92903b606f4f529a49ea60aaab18a805176f05e8be1d26cac5915060200160405180910390a25050505050505050505050505050565b6000546001600160a01b03163314610cac5760405162461bcd60e51b815260040161022d90611303565b610cb7838383610d8a565b505050565b6000546001600160a01b03163314610ce65760405162461bcd60e51b815260040161022d90611303565b6001600160a01b038116610d4b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161022d565b610d54816110a3565b50565b81610cb757604051633bd8dd9360e21b81526001600160e01b03198416600482015260ff8216602482015260440161022d565b63116d80f960e21b610d9e81856000610d57565b610db46001600160e01b03198216846001610d57565b610dcd6001600160e01b031982164284101560026110f3565b610de56001600160e01b031982164786106003611126565b604080516002808252606082018352600092602083019080368337505060048054604080516315ab88c960e31b815290519495506001600160a01b039091169363ad5c4648935081830192602092829003018186803b158015610e4757600080fd5b505afa158015610e5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7f919061117a565b81600081518110610ea057634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600554825191169082906001908110610edf57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260048054604051637ff36ab560e01b81526000939190911691637ff36ab5918991610f28918a91889130918c9101611338565b6000604051808303818588803b158015610f4157600080fd5b505af1158015610f55573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f19168201604052610f7e9190810190611196565b9050600081600181518110610fa357634e487b7160e01b600052603260045260246000fd5b602002602001015111610fc657634e487b7160e01b600052600160045260246000fd5b336001600160a01b03167f3573d96235326ec7ed5759be30b999efb7418010ed44927000f205753f5990558260008151811061101257634e487b7160e01b600052603260045260246000fd5b60200260200101518360018151811061103b57634e487b7160e01b600052603260045260246000fd5b602002602001015160405161105a929190918252602082015260400190565b60405180910390a2505050505050565b600064e8d4a510008261107d82866113d9565b61108791906113b9565b61109190866113d9565b61109b91906113b9565b949350505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b81610cb7576040516301cc826960e41b81526001600160e01b03198416600482015260ff8216602482015260440161022d565b81610cb757604051631db762fb60e31b81526001600160e01b0319841660048201526024810182905260440161022d565b600060208284031215611168578081fd5b813561117381611424565b9392505050565b60006020828403121561118b578081fd5b815161117381611424565b600060208083850312156111a8578182fd5b825167ffffffffffffffff808211156111bf578384fd5b818501915085601f8301126111d2578384fd5b8151818111156111e4576111e461140e565b8060051b604051601f19603f830116810181811085821117156112095761120961140e565b604052828152858101935084860182860187018a1015611227578788fd5b8795505b8386101561124957805185526001959095019493860193860161122b565b5098975050505050505050565b600060208284031215611267578081fd5b81518015158114611173578182fd5b60008060006060848603121561128a578182fd5b833561129581611424565b925060208401356112a581611424565b915060408401356112b581611424565b809150509250925092565b6000602082840312156112d1578081fd5b5051919050565b6000806000606084860312156112ec578283fd5b505081359360208301359350604090920135919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060808201868352602060808185015281875180845260a0860191508289019350845b818110156113815784516001600160a01b03168352938301939183019160010161135c565b50506001600160a01b039690961660408501525050506060015292915050565b600082198211156113b4576113b46113f8565b500190565b6000826113d457634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156113f3576113f36113f8565b500290565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610d5457600080fdfea164736f6c6343000804000a000000000000000000000000d9e1ce17f2641f24ae83637ab66a2cca9c378b9f000000000000000000000000767fe9edc9e0df98e07454847909b5e959d7ca0e
Deployed Bytecode
0x60806040526004361061007f5760003560e01c8063c5c51dca1161004e578063c5c51dca1461014c578063c7ee9618146101a3578063e581a34b146101c3578063f2fde38b146101e357600080fd5b806343ba2eea146100c0578063715018a6146100e25780638d36bfa3146100f15780638da5cb5b1461012457600080fd5b366100bb5760405134815233907f9f989b0392c81cb6bb0358162e1a39467776f69799ba0137b0fc0c3a5efac9bd9060200160405180910390a2005b600080fd5b3480156100cc57600080fd5b506100e06100db366004611276565b610203565b005b3480156100ee57600080fd5b50005b3480156100fd57600080fd5b5061011161010c366004611157565b610318565b6040519081526020015b60405180910390f35b34801561013057600080fd5b506000546040516001600160a01b03909116815260200161011b565b34801561015857600080fd5b50600154600254600354610179926001600160a01b03908116928116911683565b604080516001600160a01b039485168152928416602084015292169181019190915260600161011b565b3480156101af57600080fd5b506100e06101be3660046112d8565b6105a1565b3480156101cf57600080fd5b506100e06101de3660046112d8565b610c82565b3480156101ef57600080fd5b506100e06101fe366004611157565b610cbc565b6000546001600160a01b031633146102365760405162461bcd60e51b815260040161022d90611303565b60405180910390fd5b6321dd177560e11b610253816001600160a01b0386166002610d57565b6102726001600160e01b031982166001600160a01b0385166003610d57565b6102916001600160e01b031982166001600160a01b0384166004610d57565b600180546001600160a01b038681166001600160a01b03199283168117909355600280548783169084168117909155600380549287169290931682179092556040805193845260208401929092529082015233907fb0bfaa6fffe109a6d53e4aab145aef9232482bd51c0b271d264dbb73681a2c829060600160405180910390a250505050565b600080826001600160a01b031663242693d36040518163ffffffff1660e01b815260040160206040518083038186803b15801561035457600080fd5b505afa158015610368573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038c91906112c0565b90506000836001600160a01b031663cbdf382c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103c957600080fd5b505afa1580156103dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610401919061117a565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561043957600080fd5b505afa15801561044d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047191906112c0565b90506000600560009054906101000a90046001600160a01b03166001600160a01b03166370a08231866001600160a01b031663cbdf382c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156104d257600080fd5b505afa1580156104e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050a919061117a565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b15801561054957600080fd5b505afa15801561055d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058191906112c0565b90508161058e84836113d9565b61059891906113b9565b95945050505050565b6000546001600160a01b031633146105cb5760405162461bcd60e51b815260040161022d90611303565b6000821180156105db5750600081115b80156105e75750600047115b156105f7576105f7838383610d8a565b6001546002546003546005546040516370a0823160e01b81523060048201526001600160a01b0394851694938416939283169260009216906370a082319060240160206040518083038186803b15801561065057600080fd5b505afa158015610664573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068891906112c0565b600554604051636eb1769f60e11b81523060048201526001600160a01b03878116602483015292935083929091169063dd62ed3e9060440160206040518083038186803b1580156106d857600080fd5b505afa1580156106ec573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071091906112c0565b101561079e5760055460405163095ea7b360e01b81526001600160a01b038681166004830152602482018490529091169063095ea7b390604401602060405180830381600087803b15801561076457600080fd5b505af1158015610778573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079c9190611256565b505b600554604051636eb1769f60e11b81523060048201526001600160a01b0385811660248301528392169063dd62ed3e9060440160206040518083038186803b1580156107e957600080fd5b505afa1580156107fd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082191906112c0565b10156108af5760055460405163095ea7b360e01b81526001600160a01b038581166004830152602482018490529091169063095ea7b390604401602060405180830381600087803b15801561087557600080fd5b505af1158015610889573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ad9190611256565b505b600554604051636eb1769f60e11b81523060048201526001600160a01b0384811660248301528392169063dd62ed3e9060440160206040518083038186803b1580156108fa57600080fd5b505afa15801561090e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093291906112c0565b10156109c05760055460405163095ea7b360e01b81526001600160a01b038481166004830152602482018490529091169063095ea7b390604401602060405180830381600087803b15801561098657600080fd5b505af115801561099a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109be9190611256565b505b6000846001600160a01b031663242693d36040518163ffffffff1660e01b815260040160206040518083038186803b1580156109fb57600080fd5b505afa158015610a0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3391906112c0565b90506000610a4085610318565b90506000846001600160a01b031663ce1115416040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7d57600080fd5b505afa158015610a91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab591906112c0565b9050600081610ac484866113a1565b610ace91906113a1565b90506000610add86868461106a565b90506000610aec87868561106a565b90506000610afb88868661106a565b90508781610b0984866113a1565b610b1391906113a1565b1115610b2f57634e487b7160e01b600052600160045260246000fd5b6040516301810d2b60e51b8152600481018490526001600160a01b038c1690633021a56090602401600060405180830381600087803b158015610b7157600080fd5b505af1158015610b85573d6000803e3d6000fd5b50506040516301810d2b60e51b8152600481018590526001600160a01b038d169250633021a5609150602401600060405180830381600087803b158015610bcb57600080fd5b505af1158015610bdf573d6000803e3d6000fd5b50506040516301810d2b60e51b8152600481018490526001600160a01b038c169250633021a5609150602401600060405180830381600087803b158015610c2557600080fd5b505af1158015610c39573d6000803e3d6000fd5b50506040518a81523392507ff72070363b93eb92903b606f4f529a49ea60aaab18a805176f05e8be1d26cac5915060200160405180910390a25050505050505050505050505050565b6000546001600160a01b03163314610cac5760405162461bcd60e51b815260040161022d90611303565b610cb7838383610d8a565b505050565b6000546001600160a01b03163314610ce65760405162461bcd60e51b815260040161022d90611303565b6001600160a01b038116610d4b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161022d565b610d54816110a3565b50565b81610cb757604051633bd8dd9360e21b81526001600160e01b03198416600482015260ff8216602482015260440161022d565b63116d80f960e21b610d9e81856000610d57565b610db46001600160e01b03198216846001610d57565b610dcd6001600160e01b031982164284101560026110f3565b610de56001600160e01b031982164786106003611126565b604080516002808252606082018352600092602083019080368337505060048054604080516315ab88c960e31b815290519495506001600160a01b039091169363ad5c4648935081830192602092829003018186803b158015610e4757600080fd5b505afa158015610e5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7f919061117a565b81600081518110610ea057634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600554825191169082906001908110610edf57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260048054604051637ff36ab560e01b81526000939190911691637ff36ab5918991610f28918a91889130918c9101611338565b6000604051808303818588803b158015610f4157600080fd5b505af1158015610f55573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f19168201604052610f7e9190810190611196565b9050600081600181518110610fa357634e487b7160e01b600052603260045260246000fd5b602002602001015111610fc657634e487b7160e01b600052600160045260246000fd5b336001600160a01b03167f3573d96235326ec7ed5759be30b999efb7418010ed44927000f205753f5990558260008151811061101257634e487b7160e01b600052603260045260246000fd5b60200260200101518360018151811061103b57634e487b7160e01b600052603260045260246000fd5b602002602001015160405161105a929190918252602082015260400190565b60405180910390a2505050505050565b600064e8d4a510008261107d82866113d9565b61108791906113b9565b61109190866113d9565b61109b91906113b9565b949350505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b81610cb7576040516301cc826960e41b81526001600160e01b03198416600482015260ff8216602482015260440161022d565b81610cb757604051631db762fb60e31b81526001600160e01b0319841660048201526024810182905260440161022d565b600060208284031215611168578081fd5b813561117381611424565b9392505050565b60006020828403121561118b578081fd5b815161117381611424565b600060208083850312156111a8578182fd5b825167ffffffffffffffff808211156111bf578384fd5b818501915085601f8301126111d2578384fd5b8151818111156111e4576111e461140e565b8060051b604051601f19603f830116810181811085821117156112095761120961140e565b604052828152858101935084860182860187018a1015611227578788fd5b8795505b8386101561124957805185526001959095019493860193860161122b565b5098975050505050505050565b600060208284031215611267578081fd5b81518015158114611173578182fd5b60008060006060848603121561128a578182fd5b833561129581611424565b925060208401356112a581611424565b915060408401356112b581611424565b809150509250925092565b6000602082840312156112d1578081fd5b5051919050565b6000806000606084860312156112ec578283fd5b505081359360208301359350604090920135919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060808201868352602060808185015281875180845260a0860191508289019350845b818110156113815784516001600160a01b03168352938301939183019160010161135c565b50506001600160a01b039690961660408501525050506060015292915050565b600082198211156113b4576113b46113f8565b500190565b6000826113d457634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156113f3576113f36113f8565b500290565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610d5457600080fdfea164736f6c6343000804000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000d9e1ce17f2641f24ae83637ab66a2cca9c378b9f000000000000000000000000767fe9edc9e0df98e07454847909b5e959d7ca0e
-----Decoded View---------------
Arg [0] : sushiRouter_ (address): 0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F
Arg [1] : ilv_ (address): 0x767FE9EDC9E0dF98E07454847909b5E959D7ca0E
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000d9e1ce17f2641f24ae83637ab66a2cca9c378b9f
Arg [1] : 000000000000000000000000767fe9edc9e0df98e07454847909b5e959d7ca0e
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0.000001
Token Allocations
ETH
100.00%
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ETH | 100.00% | $2,023.93 | 0.000000723252 | $0.001464 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.