Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
BunniMigrator
Compiler Version
v0.8.15+commit.e14f2714
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2022-09-15 */ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.15; interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; } /** * @dev Interface of the ERC20 standard as defined in the EIP. * Modified from OpenZeppelin's IERC20 contract */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @return The name of the token */ function name() external view returns (string memory); /** * @return The symbol of the token */ function symbol() external view returns (string memory); /** * @return The number of decimal places the token has */ function decimals() external view returns (uint8); function nonces(address account) external view returns (uint256); function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; function DOMAIN_SEPARATOR() external view returns (bytes32); /** * @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 ); } /// @title Interface for WETH9 interface IWETH9 is IERC20 { /// @notice Deposit ether to get wrapped ether function deposit() external payable; /// @notice Withdraw wrapped ether to get ether function withdraw(uint256) external; } pragma abicoder v2; /// @title Pool state that never changes /// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values interface IUniswapV3PoolImmutables { /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface /// @return The contract address function factory() external view returns (address); /// @notice The first of the two tokens of the pool, sorted by address /// @return The token contract address function token0() external view returns (address); /// @notice The second of the two tokens of the pool, sorted by address /// @return The token contract address function token1() external view returns (address); /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6 /// @return The fee function fee() external view returns (uint24); /// @notice The pool tick spacing /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ... /// This value is an int24 to avoid casting even though it is always positive. /// @return The tick spacing function tickSpacing() external view returns (int24); /// @notice The maximum amount of position liquidity that can use any tick in the range /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool /// @return The max amount of liquidity per tick function maxLiquidityPerTick() external view returns (uint128); } /// @title Pool state that can change /// @notice These methods compose the pool's state, and can change with any frequency including multiple times /// per transaction interface IUniswapV3PoolState { /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas /// when accessed externally. /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value /// @return tick The current tick of the pool, i.e. according to the last tick transition that was run. /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick /// boundary. /// @return observationIndex The index of the last oracle observation that was written, /// @return observationCardinality The current maximum number of observations stored in the pool, /// @return observationCardinalityNext The next maximum number of observations, to be updated when the observation. /// @return feeProtocol The protocol fee for both tokens of the pool. /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0 /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee. /// unlocked Whether the pool is currently locked to reentrancy function slot0() external view returns ( uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol, bool unlocked ); /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool /// @dev This value can overflow the uint256 function feeGrowthGlobal0X128() external view returns (uint256); /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool /// @dev This value can overflow the uint256 function feeGrowthGlobal1X128() external view returns (uint256); /// @notice The amounts of token0 and token1 that are owed to the protocol /// @dev Protocol fees will never exceed uint128 max in either token function protocolFees() external view returns (uint128 token0, uint128 token1); /// @notice The currently in range liquidity available to the pool /// @dev This value has no relationship to the total liquidity across all ticks /// @return The liquidity at the current price of the pool function liquidity() external view returns (uint128); /// @notice Look up information about a specific tick in the pool /// @param tick The tick to look up /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or /// tick upper /// @return liquidityNet how much liquidity changes when the pool price crosses the tick, /// @return feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0, /// @return feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1, /// @return tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick /// @return secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick, /// @return secondsOutside the seconds spent on the other side of the tick from the current tick, /// @return initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false. /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0. /// In addition, these values are only relative and must be used only in comparison to previous snapshots for /// a specific position. function ticks(int24 tick) external view returns ( uint128 liquidityGross, int128 liquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128, int56 tickCumulativeOutside, uint160 secondsPerLiquidityOutsideX128, uint32 secondsOutside, bool initialized ); /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information function tickBitmap(int16 wordPosition) external view returns (uint256); /// @notice Returns the information about a position by the position's key /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper /// @return liquidity The amount of liquidity in the position, /// @return feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke, /// @return feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke, /// @return tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke, /// @return tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke function positions(bytes32 key) external view returns ( uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1 ); /// @notice Returns data about a specific observation index /// @param index The element of the observations array to fetch /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time /// ago, rather than at a specific index in the array. /// @return blockTimestamp The timestamp of the observation, /// @return tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp, /// @return secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp, /// @return initialized whether the observation has been initialized and the values are safe to use function observations(uint256 index) external view returns ( uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, bool initialized ); } /// @title Pool state that is not stored /// @notice Contains view functions to provide information about the pool that is computed rather than stored on the /// blockchain. The functions here may have variable gas costs. interface IUniswapV3PoolDerivedState { /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick, /// you must call it with secondsAgos = [3600, 0]. /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio. /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block /// timestamp function observe(uint32[] calldata secondsAgos) external view returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s); /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed. /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first /// snapshot is taken and the second snapshot is taken. /// @param tickLower The lower tick of the range /// @param tickUpper The upper tick of the range /// @return tickCumulativeInside The snapshot of the tick accumulator for the range /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range /// @return secondsInside The snapshot of seconds per liquidity for the range function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) external view returns ( int56 tickCumulativeInside, uint160 secondsPerLiquidityInsideX128, uint32 secondsInside ); } /// @title Permissionless pool actions /// @notice Contains pool methods that can be called by anyone interface IUniswapV3PoolActions { /// @notice Sets the initial price for the pool /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96 function initialize(uint160 sqrtPriceX96) external; /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends /// on tickLower, tickUpper, the amount of liquidity, and the current price. /// @param recipient The address for which the liquidity will be created /// @param tickLower The lower tick of the position in which to add liquidity /// @param tickUpper The upper tick of the position in which to add liquidity /// @param amount The amount of liquidity to mint /// @param data Any data that should be passed through to the callback /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback function mint( address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes calldata data ) external returns (uint256 amount0, uint256 amount1); /// @notice Collects tokens owed to a position /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity. /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity. /// @param recipient The address which should receive the fees collected /// @param tickLower The lower tick of the position for which to collect fees /// @param tickUpper The upper tick of the position for which to collect fees /// @param amount0Requested How much token0 should be withdrawn from the fees owed /// @param amount1Requested How much token1 should be withdrawn from the fees owed /// @return amount0 The amount of fees collected in token0 /// @return amount1 The amount of fees collected in token1 function collect( address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested ) external returns (uint128 amount0, uint128 amount1); /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0 /// @dev Fees must be collected separately via a call to #collect /// @param tickLower The lower tick of the position for which to burn liquidity /// @param tickUpper The upper tick of the position for which to burn liquidity /// @param amount How much liquidity to burn /// @return amount0 The amount of token0 sent to the recipient /// @return amount1 The amount of token1 sent to the recipient function burn( int24 tickLower, int24 tickUpper, uint128 amount ) external returns (uint256 amount0, uint256 amount1); /// @notice Swap token0 for token1, or token1 for token0 /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback /// @param recipient The address to receive the output of the swap /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0 /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative) /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this /// value after the swap. If one for zero, the price cannot be greater than this value after the swap /// @param data Any data to be passed through to the callback /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive function swap( address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes calldata data ) external returns (int256 amount0, int256 amount1); /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling /// with 0 amount{0,1} and sending the donation amount(s) from the callback /// @param recipient The address which will receive the token0 and token1 amounts /// @param amount0 The amount of token0 to send /// @param amount1 The amount of token1 to send /// @param data Any data to be passed through to the callback function flash( address recipient, uint256 amount0, uint256 amount1, bytes calldata data ) external; /// @notice Increase the maximum number of price and liquidity observations that this pool will store /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to /// the input observationCardinalityNext. /// @param observationCardinalityNext The desired minimum number of observations for the pool to store function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external; } /// @title Permissioned pool actions /// @notice Contains pool methods that may only be called by the factory owner interface IUniswapV3PoolOwnerActions { /// @notice Set the denominator of the protocol's % share of the fees /// @param feeProtocol0 new protocol fee for token0 of the pool /// @param feeProtocol1 new protocol fee for token1 of the pool function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external; /// @notice Collect the protocol fee accrued to the pool /// @param recipient The address to which collected protocol fees should be sent /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1 /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0 /// @return amount0 The protocol fee collected in token0 /// @return amount1 The protocol fee collected in token1 function collectProtocol( address recipient, uint128 amount0Requested, uint128 amount1Requested ) external returns (uint128 amount0, uint128 amount1); } /// @title Errors emitted by a pool /// @notice Contains all events emitted by the pool interface IUniswapV3PoolErrors { error LOK(); error TLU(); error TLM(); error TUM(); error AI(); error M0(); error M1(); error AS(); error IIA(); error L(); error F0(); error F1(); } /// @title Events emitted by a pool /// @notice Contains all events emitted by the pool interface IUniswapV3PoolEvents { /// @notice Emitted exactly once by a pool when #initialize is first called on the pool /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96 /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool event Initialize(uint160 sqrtPriceX96, int24 tick); /// @notice Emitted when liquidity is minted for a given position /// @param sender The address that minted the liquidity /// @param owner The owner of the position and recipient of any minted liquidity /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount The amount of liquidity minted to the position range /// @param amount0 How much token0 was required for the minted liquidity /// @param amount1 How much token1 was required for the minted liquidity event Mint( address sender, address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1 ); /// @notice Emitted when fees are collected by the owner of a position /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees /// @param owner The owner of the position for which fees are collected /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount0 The amount of token0 fees collected /// @param amount1 The amount of token1 fees collected event Collect( address indexed owner, address recipient, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount0, uint128 amount1 ); /// @notice Emitted when a position's liquidity is removed /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect /// @param owner The owner of the position for which liquidity is removed /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount The amount of liquidity to remove /// @param amount0 The amount of token0 withdrawn /// @param amount1 The amount of token1 withdrawn event Burn( address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1 ); /// @notice Emitted by the pool for any swaps between token0 and token1 /// @param sender The address that initiated the swap call, and that received the callback /// @param recipient The address that received the output of the swap /// @param amount0 The delta of the token0 balance of the pool /// @param amount1 The delta of the token1 balance of the pool /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96 /// @param liquidity The liquidity of the pool after the swap /// @param tick The log base 1.0001 of price of the pool after the swap event Swap( address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick ); /// @notice Emitted by the pool for any flashes of token0/token1 /// @param sender The address that initiated the swap call, and that received the callback /// @param recipient The address that received the tokens from flash /// @param amount0 The amount of token0 that was flashed /// @param amount1 The amount of token1 that was flashed /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee event Flash( address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1 ); /// @notice Emitted by the pool for increases to the number of observations that can be stored /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index /// just before a mint/swap/burn. /// @param observationCardinalityNextOld The previous value of the next observation cardinality /// @param observationCardinalityNextNew The updated value of the next observation cardinality event IncreaseObservationCardinalityNext( uint16 observationCardinalityNextOld, uint16 observationCardinalityNextNew ); /// @notice Emitted when the protocol fee is changed by the pool /// @param feeProtocol0Old The previous value of the token0 protocol fee /// @param feeProtocol1Old The previous value of the token1 protocol fee /// @param feeProtocol0New The updated value of the token0 protocol fee /// @param feeProtocol1New The updated value of the token1 protocol fee event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New); /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner /// @param sender The address that collects the protocol fees /// @param recipient The address that receives the collected protocol fees /// @param amount0 The amount of token0 protocol fees that is withdrawn /// @param amount0 The amount of token1 protocol fees that is withdrawn event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1); } /// @title The interface for a Uniswap V3 Pool /// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform /// to the ERC20 specification /// @dev The pool interface is broken up into many smaller pieces interface IUniswapV3Pool is IUniswapV3PoolImmutables, IUniswapV3PoolState, IUniswapV3PoolDerivedState, IUniswapV3PoolActions, IUniswapV3PoolOwnerActions, IUniswapV3PoolErrors, IUniswapV3PoolEvents { } /// @title Multicall interface /// @notice Enables calling multiple methods in a single call to the contract interface IMulticall { /// @notice Call multiple functions in the current contract and return the data from all of them if they all succeed /// @dev The `msg.value` should not be trusted for any method callable from multicall. /// @param data The encoded function data for each of the calls to make to this contract /// @return results The results from each of the calls passed in via data function multicall(bytes[] calldata data) external payable returns (bytes[] memory results); } /// @title Self Permit /// @notice Functionality to call permit on any EIP-2612-compliant token for use in the route interface ISelfPermit { /// @notice Permits this contract to spend a given token from `msg.sender` /// @dev The `owner` is always msg.sender and the `spender` is always address(this). /// @param token The address of the token spent /// @param value The amount that can be spent of token /// @param deadline A timestamp, the current blocktime must be less than or equal to this timestamp /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s` /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s` /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v` function selfPermit( address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external payable; /// @notice Permits this contract to spend a given token from `msg.sender` /// @dev The `owner` is always msg.sender and the `spender` is always address(this). /// Can be used instead of #selfPermit to prevent calls from failing due to a frontrun of a call to #selfPermit /// @param token The address of the token spent /// @param value The amount that can be spent of token /// @param deadline A timestamp, the current blocktime must be less than or equal to this timestamp /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s` /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s` /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v` function selfPermitIfNecessary( address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external payable; /// @notice Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter /// @dev The `owner` is always msg.sender and the `spender` is always address(this) /// @param token The address of the token spent /// @param nonce The current nonce of the owner /// @param expiry The timestamp at which the permit is no longer valid /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s` /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s` /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v` function selfPermitAllowed( address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) external payable; /// @notice Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter /// @dev The `owner` is always msg.sender and the `spender` is always address(this) /// Can be used instead of #selfPermitAllowed to prevent calls from failing due to a frontrun of a call to #selfPermitAllowed. /// @param token The address of the token spent /// @param nonce The current nonce of the owner /// @param expiry The timestamp at which the permit is no longer valid /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s` /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s` /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v` function selfPermitAllowedIfNecessary( address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) external payable; } /// @param pool The Uniswap V3 pool /// @param tickLower The lower tick of the Bunni's UniV3 LP position /// @param tickUpper The upper tick of the Bunni's UniV3 LP position struct BunniKey { IUniswapV3Pool pool; int24 tickLower; int24 tickUpper; } /// @title BunniToken /// @author zefram.eth /// @notice ERC20 token that represents a user's LP position interface IBunniToken is IERC20 { function pool() external view returns (IUniswapV3Pool); function tickLower() external view returns (int24); function tickUpper() external view returns (int24); function hub() external view returns (IBunniHub); function mint(address to, uint256 amount) external; function burn(address from, uint256 amount) external; } /// @title The interface for the Uniswap V3 Factory /// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees interface IUniswapV3Factory { /// @notice Emitted when the owner of the factory is changed /// @param oldOwner The owner before the owner was changed /// @param newOwner The owner after the owner was changed event OwnerChanged(address indexed oldOwner, address indexed newOwner); /// @notice Emitted when a pool is created /// @param token0 The first token of the pool by address sort order /// @param token1 The second token of the pool by address sort order /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip /// @param tickSpacing The minimum number of ticks between initialized ticks /// @param pool The address of the created pool event PoolCreated( address indexed token0, address indexed token1, uint24 indexed fee, int24 tickSpacing, address pool ); /// @notice Emitted when a new fee amount is enabled for pool creation via the factory /// @param fee The enabled fee, denominated in hundredths of a bip /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing); /// @notice Returns the current owner of the factory /// @dev Can be changed by the current owner via setOwner /// @return The address of the factory owner function owner() external view returns (address); /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee /// @return The tick spacing function feeAmountTickSpacing(uint24 fee) external view returns (int24); /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order /// @param tokenA The contract address of either token0 or token1 /// @param tokenB The contract address of the other token /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip /// @return pool The pool address function getPool( address tokenA, address tokenB, uint24 fee ) external view returns (address pool); /// @notice Creates a pool for the given two tokens and fee /// @param tokenA One of the two tokens in the desired pool /// @param tokenB The other of the two tokens in the desired pool /// @param fee The desired fee for the pool /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments /// are invalid. /// @return pool The address of the newly created pool function createPool( address tokenA, address tokenB, uint24 fee ) external returns (address pool); /// @notice Updates the owner of the factory /// @dev Must be called by the current owner /// @param _owner The new owner of the factory function setOwner(address _owner) external; /// @notice Enables a fee amount with the given tickSpacing /// @dev Fee amounts may never be removed once enabled /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6) /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount function enableFeeAmount(uint24 fee, int24 tickSpacing) external; } /// @title Callback for IUniswapV3PoolActions#mint /// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface interface IUniswapV3MintCallback { /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint. /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity. /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory. /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call function uniswapV3MintCallback( uint256 amount0Owed, uint256 amount1Owed, bytes calldata data ) external; } /// @title Liquidity management functions /// @notice Internal functions for safely managing liquidity in Uniswap V3 interface ILiquidityManagement is IUniswapV3MintCallback { function factory() external view returns (IUniswapV3Factory); } /// @title BunniHub /// @author zefram.eth /// @notice The main contract LPs interact with. Each BunniKey corresponds to a BunniToken, /// which is the ERC20 LP token for the Uniswap V3 position specified by the BunniKey. /// Use deposit()/withdraw() to mint/burn LP tokens, and use compound() to compound the swap fees /// back into the LP position. interface IBunniHub is IMulticall, ISelfPermit, ILiquidityManagement { /// @notice Emitted when liquidity is increased via deposit /// @param sender The msg.sender address /// @param recipient The address of the account that received the share tokens /// @param bunniKeyHash The hash of the Bunni position's key /// @param liquidity The amount by which liquidity was increased /// @param amount0 The amount of token0 that was paid for the increase in liquidity /// @param amount1 The amount of token1 that was paid for the increase in liquidity /// @param shares The amount of share tokens minted to the recipient event Deposit( address indexed sender, address indexed recipient, bytes32 indexed bunniKeyHash, uint128 liquidity, uint256 amount0, uint256 amount1, uint256 shares ); /// @notice Emitted when liquidity is decreased via withdrawal /// @param sender The msg.sender address /// @param recipient The address of the account that received the collected tokens /// @param bunniKeyHash The hash of the Bunni position's key /// @param liquidity The amount by which liquidity was decreased /// @param amount0 The amount of token0 that was accounted for the decrease in liquidity /// @param amount1 The amount of token1 that was accounted for the decrease in liquidity /// @param shares The amount of share tokens burnt from the sender event Withdraw( address indexed sender, address indexed recipient, bytes32 indexed bunniKeyHash, uint128 liquidity, uint256 amount0, uint256 amount1, uint256 shares ); /// @notice Emitted when fees are compounded back into liquidity /// @param sender The msg.sender address /// @param bunniKeyHash The hash of the Bunni position's key /// @param liquidity The amount by which liquidity was increased /// @param amount0 The amount of token0 added to the liquidity position /// @param amount1 The amount of token1 added to the liquidity position event Compound( address indexed sender, bytes32 indexed bunniKeyHash, uint128 liquidity, uint256 amount0, uint256 amount1 ); /// @notice Emitted when a new IBunniToken is created /// @param bunniKeyHash The hash of the Bunni position's key /// @param pool The Uniswap V3 pool /// @param tickLower The lower tick of the Bunni's UniV3 LP position /// @param tickUpper The upper tick of the Bunni's UniV3 LP position event NewBunni( IBunniToken indexed token, bytes32 indexed bunniKeyHash, IUniswapV3Pool indexed pool, int24 tickLower, int24 tickUpper ); /// @notice Emitted when protocol fees are paid to the factory /// @param amount0 The amount of token0 protocol fees that is withdrawn /// @param amount1 The amount of token1 protocol fees that is withdrawn event PayProtocolFee(uint256 amount0, uint256 amount1); /// @notice Emitted when the protocol fee has been updated /// @param newProtocolFee The new protocol fee event SetProtocolFee(uint256 newProtocolFee); /// @param key The Bunni position's key /// @param amount0Desired The desired amount of token0 to be spent, /// @param amount1Desired The desired amount of token1 to be spent, /// @param amount0Min The minimum amount of token0 to spend, which serves as a slippage check, /// @param amount1Min The minimum amount of token1 to spend, which serves as a slippage check, /// @param deadline The time by which the transaction must be included to effect the change /// @param recipient The recipient of the minted share tokens struct DepositParams { BunniKey key; uint256 amount0Desired; uint256 amount1Desired; uint256 amount0Min; uint256 amount1Min; uint256 deadline; address recipient; } /// @notice Increases the amount of liquidity in a position, with tokens paid by the `msg.sender` /// @dev Must be called after the corresponding BunniToken has been deployed via deployBunniToken() /// @param params The input parameters /// key The Bunni position's key /// amount0Desired The desired amount of token0 to be spent, /// amount1Desired The desired amount of token1 to be spent, /// amount0Min The minimum amount of token0 to spend, which serves as a slippage check, /// amount1Min The minimum amount of token1 to spend, which serves as a slippage check, /// deadline The time by which the transaction must be included to effect the change /// @return shares The new share tokens minted to the sender /// @return addedLiquidity The new liquidity amount as a result of the increase /// @return amount0 The amount of token0 to acheive resulting liquidity /// @return amount1 The amount of token1 to acheive resulting liquidity function deposit(DepositParams calldata params) external payable returns ( uint256 shares, uint128 addedLiquidity, uint256 amount0, uint256 amount1 ); /// @param key The Bunni position's key /// @param recipient The user if not withdrawing ETH, address(0) if withdrawing ETH /// @param shares The amount of ERC20 tokens (this) to burn, /// @param amount0Min The minimum amount of token0 that should be accounted for the burned liquidity, /// @param amount1Min The minimum amount of token1 that should be accounted for the burned liquidity, /// @param deadline The time by which the transaction must be included to effect the change struct WithdrawParams { BunniKey key; address recipient; uint256 shares; uint256 amount0Min; uint256 amount1Min; uint256 deadline; } /// @notice Decreases the amount of liquidity in the position and sends the tokens to the sender. /// If withdrawing ETH, need to follow up with unwrapWETH9() and sweepToken() /// @dev Must be called after the corresponding BunniToken has been deployed via deployBunniToken() /// @param params The input parameters /// key The Bunni position's key /// recipient The user if not withdrawing ETH, address(0) if withdrawing ETH /// shares The amount of share tokens to burn, /// amount0Min The minimum amount of token0 that should be accounted for the burned liquidity, /// amount1Min The minimum amount of token1 that should be accounted for the burned liquidity, /// deadline The time by which the transaction must be included to effect the change /// @return removedLiquidity The amount of liquidity decrease /// @return amount0 The amount of token0 withdrawn to the recipient /// @return amount1 The amount of token1 withdrawn to the recipient function withdraw(WithdrawParams calldata params) external returns ( uint128 removedLiquidity, uint256 amount0, uint256 amount1 ); /// @notice Claims the trading fees earned and uses it to add liquidity. /// @dev Must be called after the corresponding BunniToken has been deployed via deployBunniToken() /// @param key The Bunni position's key /// @return addedLiquidity The new liquidity amount as a result of the increase /// @return amount0 The amount of token0 added to the liquidity position /// @return amount1 The amount of token1 added to the liquidity position function compound(BunniKey calldata key) external returns ( uint128 addedLiquidity, uint256 amount0, uint256 amount1 ); /// @notice Deploys the BunniToken contract for a Bunni position. This token /// represents a user's share in the Uniswap V3 LP position. /// @param key The Bunni position's key /// @return token The deployed BunniToken function deployBunniToken(BunniKey calldata key) external returns (IBunniToken token); /// @notice Returns the BunniToken contract for a Bunni position. This token /// represents a user's share in the Uniswap V3 LP position. /// If the contract hasn't been created yet, returns 0. /// @param key The Bunni position's key /// @return token The BunniToken contract function getBunniToken(BunniKey calldata key) external view returns (IBunniToken token); /// @notice Sweeps ERC20 token balances to a recipient. Mainly used for extracting protocol fees. /// Only callable by the owner. /// @param tokenList The list of ERC20 tokens to sweep /// @param recipient The token recipient address function sweepTokens(IERC20[] calldata tokenList, address recipient) external; /// @notice Updates the protocol fee value. Scaled by 1e18. Only callable by the owner. /// @param value The new protocol fee value function setProtocolFee(uint256 value) external; /// @notice Returns the protocol fee value. Decimal value <1, scaled by 1e18. function protocolFee() external returns (uint256); } /// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol) /// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer. /// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller. library SafeTransferLib { /*////////////////////////////////////////////////////////////// ETH OPERATIONS //////////////////////////////////////////////////////////////*/ function safeTransferETH(address to, uint256 amount) internal { bool success; assembly { // Transfer the ETH and store if it succeeded or not. success := call(gas(), to, amount, 0, 0, 0, 0) } require(success, "ETH_TRANSFER_FAILED"); } /*////////////////////////////////////////////////////////////// ERC20 OPERATIONS //////////////////////////////////////////////////////////////*/ function safeTransferFrom( IERC20 token, address from, address to, uint256 amount ) internal { bool success; assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore( freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000 ) mstore(add(freeMemoryPointer, 4), from) // Append the "from" argument. mstore(add(freeMemoryPointer, 36), to) // Append the "to" argument. mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or( and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize()) ), // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 100, 0, 32) ) } require(success, "TRANSFER_FROM_FAILED"); } function safeTransfer( IERC20 token, address to, uint256 amount ) internal { bool success; assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore( freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000 ) mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument. mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or( and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize()) ), // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 68, 0, 32) ) } require(success, "TRANSFER_FAILED"); } function safeApprove( IERC20 token, address to, uint256 amount ) internal { bool success; assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore( freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000 ) mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument. mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or( and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize()) ), // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 68, 0, 32) ) } require(success, "APPROVE_FAILED"); } } /// @title BunniMigrator /// @author zefram.eth /// @notice Migrates Uniswap v2 LP tokens to Bunni LP tokens interface IBunniMigrator { struct MigrateParams { address pair; // the Uniswap v2-compatible pair uint256 liquidityToMigrate; // expected to be balanceOf(msg.sender) uint8 percentageToMigrate; // represented as a numerator over 100 address token0; address token1; BunniKey key; uint256 amount0Min; // must be discounted by percentageToMigrate uint256 amount1Min; // must be discounted by percentageToMigrate address recipient; uint256 deadline; } /// @notice Migrates liquidity to v3 by burning v2 liquidity and minting a new position for v3 using Bunni /// @dev Slippage protection is enforced via `amount{0,1}Min`, which should be a discount of the expected values of /// the maximum amount of v3 liquidity that the v2 liquidity can get. For the special case of migrating to an /// out-of-range position, `amount{0,1}Min` may be set to 0, enforcing that the position remains out of range /// @param params The params necessary to migrate v2 liquidity, encoded as `MigrateParams` in calldata /// @return sharesMinted The amount of Bunni LP tokens minted function migrate(MigrateParams calldata params) external returns (uint256 sharesMinted); function hub() external view returns (IBunniHub); } /// @title BunniMigrator /// @author zefram.eth /// @notice Migrates Uniswap v2 LP tokens to Bunni LP tokens contract BunniMigrator is IBunniMigrator { IBunniHub public immutable override hub; constructor(IBunniHub hub_) { hub = hub_; } /// @inheritdoc IBunniMigrator function migrate(MigrateParams calldata params) external override returns (uint256 sharesMinted) { require(params.percentageToMigrate > 0, "SMOL_PP"); require(params.percentageToMigrate <= 100, "BIG_PP"); // burn v2 liquidity to this address IUniswapV2Pair(params.pair).transferFrom( msg.sender, params.pair, params.liquidityToMigrate ); (uint256 amount0V2, uint256 amount1V2) = IUniswapV2Pair(params.pair) .burn(address(this)); // calculate the amounts to migrate to v3 uint256 amount0V2ToMigrate = (amount0V2 * params.percentageToMigrate) / 100; uint256 amount1V2ToMigrate = (amount1V2 * params.percentageToMigrate) / 100; // approve the position manager up to the maximum token amounts SafeTransferLib.safeApprove( IERC20(params.token0), address(hub), amount0V2ToMigrate ); SafeTransferLib.safeApprove( IERC20(params.token1), address(hub), amount1V2ToMigrate ); // mint v3 position via Bunni uint256 amount0V3; uint256 amount1V3; (sharesMinted, , amount0V3, amount1V3) = hub.deposit( IBunniHub.DepositParams({ key: params.key, amount0Desired: amount0V2ToMigrate, amount1Desired: amount1V2ToMigrate, amount0Min: params.amount0Min, amount1Min: params.amount1Min, recipient: params.recipient, deadline: params.deadline }) ); // if necessary, clear allowance and refund dust if (amount0V3 < amount0V2) { if (amount0V3 < amount0V2ToMigrate) { SafeTransferLib.safeApprove( IERC20(params.token0), address(hub), 0 ); } uint256 refund0 = amount0V2 - amount0V3; SafeTransferLib.safeTransfer( IERC20(params.token0), msg.sender, refund0 ); } if (amount1V3 < amount1V2) { if (amount1V3 < amount1V2ToMigrate) { SafeTransferLib.safeApprove( IERC20(params.token1), address(hub), 0 ); } uint256 refund1 = amount1V2 - amount1V3; SafeTransferLib.safeTransfer( IERC20(params.token1), msg.sender, refund1 ); } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IBunniHub","name":"hub_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"hub","outputs":[{"internalType":"contract IBunniHub","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"pair","type":"address"},{"internalType":"uint256","name":"liquidityToMigrate","type":"uint256"},{"internalType":"uint8","name":"percentageToMigrate","type":"uint8"},{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"components":[{"internalType":"contract IUniswapV3Pool","name":"pool","type":"address"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"}],"internalType":"struct BunniKey","name":"key","type":"tuple"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct IBunniMigrator.MigrateParams","name":"params","type":"tuple"}],"name":"migrate","outputs":[{"internalType":"uint256","name":"sharesMinted","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a060405234801561001057600080fd5b50604051610b5f380380610b5f83398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b608051610ab96100a660003960008181606601528181610398015281816103d2015281816103fc01526105410152610ab96000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806333db850b1461003b578063365a86fc14610061575b600080fd5b61004e61004936600461075a565b6100ad565b6040519081526020015b60405180910390f35b6100887f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610058565b6000806100c06060840160408501610773565b60ff161161012f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600760248201527f534d4f4c5f50500000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b60646101416060840160408501610773565b60ff1611156101ac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f4249475f505000000000000000000000000000000000000000000000000000006044820152606401610126565b6101b960208301836107c2565b73ffffffffffffffffffffffffffffffffffffffff166323b872dd336101e260208601866107c2565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff928316600482015291166024820152602085013560448201526064016020604051808303816000875af115801561025e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028291906107df565b5060008061029360208501856107c2565b6040517f89afcb4400000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906389afcb449060240160408051808303816000875af1158015610300573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103249190610801565b90925090506000606461033d6060870160408801610773565b61034a9060ff1685610854565b6103549190610891565b90506000606461036a6060880160408901610773565b6103779060ff1685610854565b6103819190610891565b90506103bd61039660808801606089016107c2565b7f0000000000000000000000000000000000000000000000000000000000000000846105e2565b6103f76103d060a08801608089016107c2565b7f0000000000000000000000000000000000000000000000000000000000000000836105e2565b6000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663b3165aaf6040518060e001604052808b60a00180360381019061045591906108e3565b81526020018781526020018681526020018b610100013581526020018b610120013581526020018b610160013581526020018b61014001602081019061049b91906107c2565b73ffffffffffffffffffffffffffffffffffffffff168152506040518263ffffffff1660e01b81526004016104d09190610978565b6080604051808303816000875af11580156104ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105139190610a19565b9299509350909150508582101561059157838210156105675761056761053f60808a0160608b016107c2565b7f000000000000000000000000000000000000000000000000000000000000000060006105e2565b60006105738388610a6c565b905061058f61058860808b0160608c016107c2565b33836106a1565b505b848110156105d757828110156105b4576105b461053f60a08a0160808b016107c2565b60006105c08287610a6c565b90506105d561058860a08b0160808c016107c2565b505b505050505050919050565b60006040517f095ea7b3000000000000000000000000000000000000000000000000000000008152836004820152826024820152602060006044836000895af13d15601f3d116001600051141617169150508061069b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f415050524f56455f4641494c45440000000000000000000000000000000000006044820152606401610126565b50505050565b60006040517fa9059cbb000000000000000000000000000000000000000000000000000000008152836004820152826024820152602060006044836000895af13d15601f3d116001600051141617169150508061069b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5452414e534645525f4641494c454400000000000000000000000000000000006044820152606401610126565b6000610180828403121561076d57600080fd5b50919050565b60006020828403121561078557600080fd5b813560ff8116811461079657600080fd5b9392505050565b73ffffffffffffffffffffffffffffffffffffffff811681146107bf57600080fd5b50565b6000602082840312156107d457600080fd5b81356107968161079d565b6000602082840312156107f157600080fd5b8151801515811461079657600080fd5b6000806040838503121561081457600080fd5b505080516020909101519092909150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561088c5761088c610825565b500290565b6000826108c7577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8035600281900b81146108de57600080fd5b919050565b6000606082840312156108f557600080fd5b6040516060810181811067ffffffffffffffff8211171561093f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604052823561094d8161079d565b815261095b602084016108cc565b602082015261096c604084016108cc565b60408201529392505050565b600061012082019050825173ffffffffffffffffffffffffffffffffffffffff8151168352602081015160020b6020840152604081015160020b6040840152506020830151606083015260408301516080830152606083015160a0830152608083015160c083015260a083015160e083015260c0830151610a1261010084018273ffffffffffffffffffffffffffffffffffffffff169052565b5092915050565b60008060008060808587031215610a2f57600080fd5b8451935060208501516fffffffffffffffffffffffffffffffff81168114610a5657600080fd5b6040860151606090960151949790965092505050565b600082821015610a7e57610a7e610825565b50039056fea2646970667358221220e40d9573069631d27dfdcb9577f2ceee885569c06172469d50763206c656dbd664736f6c634300080f0033000000000000000000000000b7e85cc44a5e1d36ecb118627dcf20cefe926980
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100365760003560e01c806333db850b1461003b578063365a86fc14610061575b600080fd5b61004e61004936600461075a565b6100ad565b6040519081526020015b60405180910390f35b6100887f000000000000000000000000b7e85cc44a5e1d36ecb118627dcf20cefe92698081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610058565b6000806100c06060840160408501610773565b60ff161161012f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600760248201527f534d4f4c5f50500000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b60646101416060840160408501610773565b60ff1611156101ac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f4249475f505000000000000000000000000000000000000000000000000000006044820152606401610126565b6101b960208301836107c2565b73ffffffffffffffffffffffffffffffffffffffff166323b872dd336101e260208601866107c2565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff928316600482015291166024820152602085013560448201526064016020604051808303816000875af115801561025e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028291906107df565b5060008061029360208501856107c2565b6040517f89afcb4400000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906389afcb449060240160408051808303816000875af1158015610300573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103249190610801565b90925090506000606461033d6060870160408801610773565b61034a9060ff1685610854565b6103549190610891565b90506000606461036a6060880160408901610773565b6103779060ff1685610854565b6103819190610891565b90506103bd61039660808801606089016107c2565b7f000000000000000000000000b7e85cc44a5e1d36ecb118627dcf20cefe926980846105e2565b6103f76103d060a08801608089016107c2565b7f000000000000000000000000b7e85cc44a5e1d36ecb118627dcf20cefe926980836105e2565b6000807f000000000000000000000000b7e85cc44a5e1d36ecb118627dcf20cefe92698073ffffffffffffffffffffffffffffffffffffffff1663b3165aaf6040518060e001604052808b60a00180360381019061045591906108e3565b81526020018781526020018681526020018b610100013581526020018b610120013581526020018b610160013581526020018b61014001602081019061049b91906107c2565b73ffffffffffffffffffffffffffffffffffffffff168152506040518263ffffffff1660e01b81526004016104d09190610978565b6080604051808303816000875af11580156104ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105139190610a19565b9299509350909150508582101561059157838210156105675761056761053f60808a0160608b016107c2565b7f000000000000000000000000b7e85cc44a5e1d36ecb118627dcf20cefe92698060006105e2565b60006105738388610a6c565b905061058f61058860808b0160608c016107c2565b33836106a1565b505b848110156105d757828110156105b4576105b461053f60a08a0160808b016107c2565b60006105c08287610a6c565b90506105d561058860a08b0160808c016107c2565b505b505050505050919050565b60006040517f095ea7b3000000000000000000000000000000000000000000000000000000008152836004820152826024820152602060006044836000895af13d15601f3d116001600051141617169150508061069b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f415050524f56455f4641494c45440000000000000000000000000000000000006044820152606401610126565b50505050565b60006040517fa9059cbb000000000000000000000000000000000000000000000000000000008152836004820152826024820152602060006044836000895af13d15601f3d116001600051141617169150508061069b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5452414e534645525f4641494c454400000000000000000000000000000000006044820152606401610126565b6000610180828403121561076d57600080fd5b50919050565b60006020828403121561078557600080fd5b813560ff8116811461079657600080fd5b9392505050565b73ffffffffffffffffffffffffffffffffffffffff811681146107bf57600080fd5b50565b6000602082840312156107d457600080fd5b81356107968161079d565b6000602082840312156107f157600080fd5b8151801515811461079657600080fd5b6000806040838503121561081457600080fd5b505080516020909101519092909150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561088c5761088c610825565b500290565b6000826108c7577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8035600281900b81146108de57600080fd5b919050565b6000606082840312156108f557600080fd5b6040516060810181811067ffffffffffffffff8211171561093f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604052823561094d8161079d565b815261095b602084016108cc565b602082015261096c604084016108cc565b60408201529392505050565b600061012082019050825173ffffffffffffffffffffffffffffffffffffffff8151168352602081015160020b6020840152604081015160020b6040840152506020830151606083015260408301516080830152606083015160a0830152608083015160c083015260a083015160e083015260c0830151610a1261010084018273ffffffffffffffffffffffffffffffffffffffff169052565b5092915050565b60008060008060808587031215610a2f57600080fd5b8451935060208501516fffffffffffffffffffffffffffffffff81168114610a5657600080fd5b6040860151606090960151949790965092505050565b600082821015610a7e57610a7e610825565b50039056fea2646970667358221220e40d9573069631d27dfdcb9577f2ceee885569c06172469d50763206c656dbd664736f6c634300080f0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000b7e85cc44a5e1d36ecb118627dcf20cefe926980
-----Decoded View---------------
Arg [0] : hub_ (address): 0xb7e85CC44A5E1d36ecB118627DCF20cEfE926980
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000b7e85cc44a5e1d36ecb118627dcf20cefe926980
Deployed Bytecode Sourcemap
59737:2989:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;59934:2789;;;;;;:::i;:::-;;:::i;:::-;;;365:25:1;;;353:2;338:18;59934:2789:0;;;;;;;;59785:39;;;;;;;;595:42:1;583:55;;;565:74;;553:2;538:18;59785:39:0;401:244:1;59934:2789:0;60036:20;;60082:26;;;;;;;;:::i;:::-;:30;;;60074:50;;;;;;;1126:2:1;60074:50:0;;;1108:21:1;1165:1;1145:18;;;1138:29;1203:9;1183:18;;;1176:37;1230:18;;60074:50:0;;;;;;;;;60173:3;60143:26;;;;;;;;:::i;:::-;:33;;;;60135:52;;;;;;;1461:2:1;60135:52:0;;;1443:21:1;1500:1;1480:18;;;1473:29;1538:8;1518:18;;;1511:36;1564:18;;60135:52:0;1259:329:1;60135:52:0;60261:11;;;;:6;:11;:::i;:::-;60246:40;;;60301:10;60326:11;;;;:6;:11;:::i;:::-;60246:142;;;;;;;;;;2348:42:1;2417:15;;;60246:142:0;;;2399:34:1;2469:15;;2449:18;;;2442:43;60352:25:0;;;;2501:18:1;;;2494:34;2311:18;;60246:142:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;60400:17:0;;60455:11;;;;:6;:11;:::i;:::-;60440:61;;;;;60495:4;60440:61;;;565:74:1;60440:46:0;;;;;;;;538:18:1;;60440:61:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;60399:102;;-1:-1:-1;60399:102:0;-1:-1:-1;60565:26:0;60650:3;60607:26;;;;;;;;:::i;:::-;60595:38;;;;:9;:38;:::i;:::-;60594:59;;;;:::i;:::-;60565:88;-1:-1:-1;60664:26:0;60749:3;60706:26;;;;;;;;:::i;:::-;60694:38;;;;:9;:38;:::i;:::-;60693:59;;;;:::i;:::-;60664:88;-1:-1:-1;60838:134:0;60887:13;;;;;;;;:::i;:::-;60924:3;60943:18;60838:27;:134::i;:::-;60983;61032:13;;;;;;;;:::i;:::-;61069:3;61088:18;60983:27;:134::i;:::-;61171:17;61199;61268:3;:11;;;61294:366;;;;;;;;61342:6;:10;;61294:366;;;;;;;;;;:::i;:::-;;;;;61387:18;61294:366;;;;61440:18;61294:366;;;;61489:6;:17;;;61294:366;;;;61537:6;:17;;;61294:366;;;;61629:6;:15;;;61294:366;;;;61584:6;:16;;;;;;;;;;:::i;:::-;61294:366;;;;;61268:403;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;61227:444;;-1:-1:-1;61227:444:0;-1:-1:-1;61227:444:0;;-1:-1:-1;;61746:21:0;;;61742:482;;;61800:18;61788:9;:30;61784:220;;;61839:149;61896:13;;;;;;;;:::i;:::-;61941:3;61968:1;61839:27;:149::i;:::-;62020:15;62038:21;62050:9;62038;:21;:::i;:::-;62020:39;-1:-1:-1;62074:138:0;62128:13;;;;;;;;:::i;:::-;62161:10;62190:7;62074:28;:138::i;:::-;61769:455;61742:482;62250:9;62238;:21;62234:482;;;62292:18;62280:9;:30;62276:220;;;62331:149;62388:13;;;;;;;;:::i;62331:149::-;62512:15;62530:21;62542:9;62530;:21;:::i;:::-;62512:39;-1:-1:-1;62566:138:0;62620:13;;;;;;;;:::i;62566:138::-;62261:455;62234:482;60063:2660;;;;;;59934:2789;;;:::o;56548:1594::-;56665:12;56796:4;56790:11;56976:66;56940:17;56915:142;57105:2;57101:1;57082:17;57078:25;57071:37;57186:6;57181:2;57162:17;57158:26;57151:42;58059:2;58056:1;58052:2;58033:17;58030:1;58023:5;58016;58011:51;57557:16;57550:24;57523:2;57505:16;57502:24;57498:1;57494;57488:8;57485:15;57481:46;57456:137;57253:824;57242:835;;;58108:7;58100:34;;;;;;;6708:2:1;58100:34:0;;;6690:21:1;6747:2;6727:18;;;6720:30;6786:16;6766:18;;;6759:44;6820:18;;58100:34:0;6506:338:1;58100:34:0;56654:1488;56548:1594;;;:::o;54944:1596::-;55062:12;55193:4;55187:11;55373:66;55337:17;55312:142;55502:2;55498:1;55479:17;55475:25;55468:37;55583:6;55578:2;55559:17;55555:26;55548:42;56456:2;56453:1;56449:2;56430:17;56427:1;56420:5;56413;56408:51;55954:16;55947:24;55920:2;55902:16;55899:24;55895:1;55891;55885:8;55882:15;55878:46;55853:137;55650:824;55639:835;;;56505:7;56497:35;;;;;;;7051:2:1;56497:35:0;;;7033:21:1;7090:2;7070:18;;;7063:30;7129:17;7109:18;;;7102:45;7164:18;;56497:35:0;6849:339:1;14:200;106:6;159:3;147:9;138:7;134:23;130:33;127:53;;;176:1;173;166:12;127:53;-1:-1:-1;199:9:1;14:200;-1:-1:-1;14:200:1:o;650:269::-;707:6;760:2;748:9;739:7;735:23;731:32;728:52;;;776:1;773;766:12;728:52;815:9;802:23;865:4;858:5;854:16;847:5;844:27;834:55;;885:1;882;875:12;834:55;908:5;650:269;-1:-1:-1;;;650:269:1:o;1593:154::-;1679:42;1672:5;1668:54;1661:5;1658:65;1648:93;;1737:1;1734;1727:12;1648:93;1593:154;:::o;1752:247::-;1811:6;1864:2;1852:9;1843:7;1839:23;1835:32;1832:52;;;1880:1;1877;1870:12;1832:52;1919:9;1906:23;1938:31;1963:5;1938:31;:::i;2539:277::-;2606:6;2659:2;2647:9;2638:7;2634:23;2630:32;2627:52;;;2675:1;2672;2665:12;2627:52;2707:9;2701:16;2760:5;2753:13;2746:21;2739:5;2736:32;2726:60;;2782:1;2779;2772:12;3052:245;3131:6;3139;3192:2;3180:9;3171:7;3167:23;3163:32;3160:52;;;3208:1;3205;3198:12;3160:52;-1:-1:-1;;3231:16:1;;3287:2;3272:18;;;3266:25;3231:16;;3266:25;;-1:-1:-1;3052:245:1:o;3302:184::-;3354:77;3351:1;3344:88;3451:4;3448:1;3441:15;3475:4;3472:1;3465:15;3491:228;3531:7;3657:1;3589:66;3585:74;3582:1;3579:81;3574:1;3567:9;3560:17;3556:105;3553:131;;;3664:18;;:::i;:::-;-1:-1:-1;3704:9:1;;3491:228::o;3724:274::-;3764:1;3790;3780:189;;3825:77;3822:1;3815:88;3926:4;3923:1;3916:15;3954:4;3951:1;3944:15;3780:189;-1:-1:-1;3983:9:1;;3724:274::o;4003:160::-;4069:20;;4129:1;4118:20;;;4108:31;;4098:59;;4153:1;4150;4143:12;4098:59;4003:160;;;:::o;4168:799::-;4252:6;4305:2;4293:9;4284:7;4280:23;4276:32;4273:52;;;4321:1;4318;4311:12;4273:52;4354:2;4348:9;4396:2;4388:6;4384:15;4465:6;4453:10;4450:22;4429:18;4417:10;4414:34;4411:62;4408:242;;;4506:77;4503:1;4496:88;4607:4;4604:1;4597:15;4635:4;4632:1;4625:15;4408:242;4666:2;4659:22;4703:23;;4735:31;4703:23;4735:31;:::i;:::-;4775:21;;4829:36;4861:2;4846:18;;4829:36;:::i;:::-;4824:2;4816:6;4812:15;4805:61;4899:36;4931:2;4920:9;4916:18;4899:36;:::i;:::-;4894:2;4882:15;;4875:61;4886:6;4168:799;-1:-1:-1;;;4168:799:1:o;4972:905::-;5126:4;5168:3;5157:9;5153:19;5145:27;;5197:6;5191:13;5246:42;5241:2;5235:9;5231:58;5220:9;5213:77;5356:4;5352:2;5348:13;5342:20;5339:1;5328:35;5321:4;5310:9;5306:20;5299:65;5430:4;5426:2;5422:13;5416:20;5413:1;5402:35;5395:4;5384:9;5380:20;5373:65;;5494:4;5486:6;5482:17;5476:24;5469:4;5458:9;5454:20;5447:54;5557:4;5549:6;5545:17;5539:24;5532:4;5521:9;5517:20;5510:54;5620:4;5612:6;5608:17;5602:24;5595:4;5584:9;5580:20;5573:54;5683:4;5675:6;5671:17;5665:24;5658:4;5647:9;5643:20;5636:54;5746:4;5738:6;5734:17;5728:24;5721:4;5710:9;5706:20;5699:54;5800:4;5792:6;5788:17;5782:24;5815:56;5863:6;5852:9;5848:22;5834:12;2081:42;2070:54;2058:67;;2004:127;5815:56;;4972:905;;;;:::o;5882:489::-;5979:6;5987;5995;6003;6056:3;6044:9;6035:7;6031:23;6027:33;6024:53;;;6073:1;6070;6063:12;6024:53;6102:9;6096:16;6086:26;;6155:2;6144:9;6140:18;6134:25;6199:34;6192:5;6188:46;6181:5;6178:57;6168:85;;6249:1;6246;6239:12;6168:85;6317:2;6302:18;;6296:25;6361:2;6346:18;;;6340:25;5882:489;;6272:5;;-1:-1:-1;5882:489:1;-1:-1:-1;;;5882:489:1:o;6376:125::-;6416:4;6444:1;6441;6438:8;6435:34;;;6449:18;;:::i;:::-;-1:-1:-1;6486:9:1;;6376:125::o
Swarm Source
ipfs://e40d9573069631d27dfdcb9577f2ceee885569c06172469d50763206c656dbd6
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.