ETH Price: $3,683.68 (-5.13%)

Contract

0xdAecee3C08e953Bd5f89A5Cc90ac560413d709E3
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SmartRouterHelper

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 10 runs

Other Settings:
default evmVersion
File 1 of 12 : SmartRouterHelper.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity =0.7.6;
pragma abicoder v2;

import '../interfaces/IStableSwapFactory.sol';
import '../interfaces/IStableSwapInfo.sol';
import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol';
import '@pancakeswap/v3-core/contracts/libraries/LowGasSafeMath.sol';
import '@pancakeswap/v3-core/contracts/interfaces/IPancakeV3Pool.sol';

library SmartRouterHelper {
    using LowGasSafeMath for uint256;

    /************************************************** Stable **************************************************/

    // get the pool info in stable swap
    function getStableInfo(
        address stableSwapFactory,
        address input,
        address output,
        uint256 flag
    ) public view returns (uint256 i, uint256 j, address swapContract) {
        if (flag == 2) {
            IStableSwapFactory.StableSwapPairInfo memory info = IStableSwapFactory(stableSwapFactory).getPairInfo(input, output);
            i = input == info.token0 ? 0 : 1;
            j = (i == 0) ? 1 : 0;
            swapContract = info.swapContract;
        } else if (flag == 3) {
            IStableSwapFactory.StableSwapThreePoolPairInfo memory info = IStableSwapFactory(stableSwapFactory).getThreePoolPairInfo(input, output);

            if (input == info.token0) i = 0;
            else if (input == info.token1) i = 1;
            else if (input == info.token2) i = 2;

            if (output == info.token0) j = 0;
            else if (output == info.token1) j = 1;
            else if (output == info.token2) j = 2;

            swapContract = info.swapContract;
        }

        require(swapContract != address(0), "getStableInfo: invalid pool address");
    }

    function getStableAmountsIn(
        address stableSwapFactory,
        address stableSwapInfo,
        address[] memory path,
        uint256[] memory flag,
        uint256 amountOut
    ) public view returns (uint256[] memory amounts) {
        uint256 length = path.length;
        require(length >= 2, "getStableAmountsIn: incorrect length");

        amounts = new uint256[](length);
        amounts[length - 1] = amountOut;

        for (uint256 i = length - 1; i > 0; i--) {
            uint256 last = i - 1;
            (uint256 k, uint256 j, address swapContract) = getStableInfo(stableSwapFactory, path[last], path[i], flag[last]);
            amounts[last] = IStableSwapInfo(stableSwapInfo).get_dx(swapContract, k, j, amounts[i], type(uint256).max);
        }
    }



    /************************************************** V2 **************************************************/

    // bytes32 internal constant V2_INIT_CODE_HASH = 0xd0d4c4cd0848c93cb4fd1f498d7013ee6bfb25783ea21593d5834f5d250ece66; // BSC TESTNET
    // bytes32 internal constant V2_INIT_CODE_HASH = 0x00fb7f630766e6a796048ea87d01acd3068e8ff67d078148a3fa3f4a84f69bd5; // BSC
    // bytes32 internal constant V2_INIT_CODE_HASH = 0x57224589c67f3f30a6b0d7a1b54cf3153ab84563bc609ef41dfb34f8b2974d2d; // ETH, GOERLI
    bytes32 internal constant V2_INIT_CODE_HASH = 0x57224589c67f3f30a6b0d7a1b54cf3153ab84563bc609ef41dfb34f8b2974d2d;

    // returns sorted token addresses, used to handle return values from pairs sorted in this order
    function sortTokens(address tokenA, address tokenB) public pure returns (address token0, address token1) {
        require(tokenA != tokenB);
        (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
        require(token0 != address(0));
    }

    // calculates the CREATE2 address for a pair without making any external calls
    function pairFor(
        address factory,
        address tokenA,
        address tokenB
    ) public pure returns (address pair) {
        (address token0, address token1) = sortTokens(tokenA, tokenB);
        pair = address(
            uint256(
                keccak256(
                    abi.encodePacked(
                        hex'ff',
                        factory,
                        keccak256(abi.encodePacked(token0, token1)),
                        V2_INIT_CODE_HASH
                    )
                )
            )
        );
    }

    // fetches and sorts the reserves for a pair
    function getReserves(
        address factory,
        address tokenA,
        address tokenB
    ) public view returns (uint256 reserveA, uint256 reserveB) {
        (address token0, ) = sortTokens(tokenA, tokenB);
        (uint256 reserve0, uint256 reserve1, ) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
        (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
    }

    // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
    function getAmountOut(
        uint256 amountIn,
        uint256 reserveIn,
        uint256 reserveOut
    ) public pure returns (uint256 amountOut) {
        require(amountIn > 0, 'INSUFFICIENT_INPUT_AMOUNT');
        require(reserveIn > 0 && reserveOut > 0);
        uint256 amountInWithFee = amountIn.mul(9975);
        uint256 numerator = amountInWithFee.mul(reserveOut);
        uint256 denominator = reserveIn.mul(10000).add(amountInWithFee);
        amountOut = numerator / denominator;
    }

    // given an output amount of an asset and pair reserves, returns a required input amount of the other asset
    function getAmountIn(
        uint256 amountOut,
        uint256 reserveIn,
        uint256 reserveOut
    ) public pure returns (uint256 amountIn) {
        require(amountOut > 0, 'INSUFFICIENT_OUTPUT_AMOUNT');
        require(reserveIn > 0 && reserveOut > 0);
        uint256 numerator = reserveIn.mul(amountOut).mul(10000);
        uint256 denominator = reserveOut.sub(amountOut).mul(9975);
        amountIn = (numerator / denominator).add(1);
    }

    // performs chained getAmountIn calculations on any number of pairs
    function getAmountsIn(
        address factory,
        uint256 amountOut,
        address[] memory path
    ) public view returns (uint256[] memory amounts) {
        require(path.length >= 2);
        amounts = new uint256[](path.length);
        amounts[amounts.length - 1] = amountOut;
        for (uint256 i = path.length - 1; i > 0; i--) {
            (uint256 reserveIn, uint256 reserveOut) = getReserves(factory, path[i - 1], path[i]);
            amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
        }
    }



    /************************************************** V3 **************************************************/

    bytes32 internal constant V3_INIT_CODE_HASH = 0x6ce8eb472fa82df5469c6ab6d485f17c3ad13c8cd7af59b3d4a8026c5ce0f7e2;

    /// @notice The identifying key of the pool
    struct PoolKey {
        address token0;
        address token1;
        uint24 fee;
    }

    /// @notice Returns PoolKey: the ordered tokens with the matched fee levels
    /// @param tokenA The first token of a pool, unsorted
    /// @param tokenB The second token of a pool, unsorted
    /// @param fee The fee level of the pool
    /// @return Poolkey The pool details with ordered token0 and token1 assignments
    function getPoolKey(
        address tokenA,
        address tokenB,
        uint24 fee
    ) public pure returns (PoolKey memory) {
        if (tokenA > tokenB) (tokenA, tokenB) = (tokenB, tokenA);
        return PoolKey({token0: tokenA, token1: tokenB, fee: fee});
    }

    /// @notice Deterministically computes the pool address given the deployer and PoolKey
    /// @param deployer The PancakeSwap V3 deployer contract address
    /// @param key The PoolKey
    /// @return pool The contract address of the V3 pool
    function computeAddress(address deployer, PoolKey memory key) public pure returns (address pool) {
        require(key.token0 < key.token1);
        pool = address(
            uint256(
                keccak256(
                    abi.encodePacked(
                        hex'ff',
                        deployer,
                        keccak256(abi.encode(key.token0, key.token1, key.fee)),
                        V3_INIT_CODE_HASH
                    )
                )
            )
        );
    }

    /// @dev Returns the pool for the given token pair and fee. The pool contract may or may not exist.
    function getPool(
        address deployer,
        address tokenA,
        address tokenB,
        uint24 fee
    ) public pure returns (IPancakeV3Pool) {
        return IPancakeV3Pool(computeAddress(deployer, getPoolKey(tokenA, tokenB, fee)));
    }

    /// @notice Returns the address of a valid PancakeSwap V3 Pool
    /// @param deployer The contract address of the PancakeSwap V3 deployer
    /// @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 V3 pool contract address
    function verifyCallback(
        address deployer,
        address tokenA,
        address tokenB,
        uint24 fee
    ) public view returns (IPancakeV3Pool pool) {
        return verifyCallback(deployer, getPoolKey(tokenA, tokenB, fee));
    }

    /// @notice Returns the address of a valid PancakeSwap V3 Pool
    /// @param deployer The contract address of the PancakeSwap V3 deployer
    /// @param poolKey The identifying key of the V3 pool
    /// @return pool The V3 pool contract address
    function verifyCallback(address deployer, PoolKey memory poolKey)
        public
        view
        returns (IPancakeV3Pool pool)
    {
        pool = IPancakeV3Pool(computeAddress(deployer, poolKey));
        require(msg.sender == address(pool));
    }
}

File 2 of 12 : IPancakeV3Pool.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

import './pool/IPancakeV3PoolImmutables.sol';
import './pool/IPancakeV3PoolState.sol';
import './pool/IPancakeV3PoolDerivedState.sol';
import './pool/IPancakeV3PoolActions.sol';
import './pool/IPancakeV3PoolOwnerActions.sol';
import './pool/IPancakeV3PoolEvents.sol';

/// @title The interface for a PancakeSwap V3 Pool
/// @notice A PancakeSwap 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 IPancakeV3Pool is
    IPancakeV3PoolImmutables,
    IPancakeV3PoolState,
    IPancakeV3PoolDerivedState,
    IPancakeV3PoolActions,
    IPancakeV3PoolOwnerActions,
    IPancakeV3PoolEvents
{

}

File 3 of 12 : IPancakeV3PoolActions.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Permissionless pool actions
/// @notice Contains pool methods that can be called by anyone
interface IPancakeV3PoolActions {
    /// @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 IPancakeV3MintCallback#pancakeV3MintCallback
    /// 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 IPancakeV3SwapCallback#pancakeV3SwapCallback
    /// @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 IPancakeV3FlashCallback#pancakeV3FlashCallback
    /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling
    /// with 0 amount{0,1} and sending the donation amount(s) from the callback
    /// @param recipient The address which will receive the token0 and token1 amounts
    /// @param amount0 The amount of token0 to send
    /// @param amount1 The amount of token1 to send
    /// @param data Any data to be passed through to the callback
    function flash(
        address recipient,
        uint256 amount0,
        uint256 amount1,
        bytes calldata data
    ) external;

    /// @notice Increase the maximum number of price and liquidity observations that this pool will store
    /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to
    /// the input observationCardinalityNext.
    /// @param observationCardinalityNext The desired minimum number of observations for the pool to store
    function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;
}

File 4 of 12 : IPancakeV3PoolDerivedState.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @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 IPancakeV3PoolDerivedState {
    /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp
    /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing
    /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,
    /// you must call it with secondsAgos = [3600, 0].
    /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in
    /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.
    /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned
    /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp
    /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block
    /// timestamp
    function observe(uint32[] calldata secondsAgos)
        external
        view
        returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);

    /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range
    /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.
    /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first
    /// snapshot is taken and the second snapshot is taken.
    /// @param tickLower The lower tick of the range
    /// @param tickUpper The upper tick of the range
    /// @return tickCumulativeInside The snapshot of the tick accumulator for the range
    /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range
    /// @return secondsInside The snapshot of seconds per liquidity for the range
    function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
        external
        view
        returns (
            int56 tickCumulativeInside,
            uint160 secondsPerLiquidityInsideX128,
            uint32 secondsInside
        );
}

File 5 of 12 : IPancakeV3PoolEvents.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Events emitted by a pool
/// @notice Contains all events emitted by the pool
interface IPancakeV3PoolEvents {
    /// @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
    /// @param protocolFeesToken0 The protocol fee of token0 in the swap
    /// @param protocolFeesToken1 The protocol fee of token1 in the swap
    event Swap(
        address indexed sender,
        address indexed recipient,
        int256 amount0,
        int256 amount1,
        uint160 sqrtPriceX96,
        uint128 liquidity,
        int24 tick,
        uint128 protocolFeesToken0,
        uint128 protocolFeesToken1
    );

    /// @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(
        uint32 feeProtocol0Old,
        uint32 feeProtocol1Old,
        uint32 feeProtocol0New,
        uint32 feeProtocol1New
    );

    /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner
    /// @param sender The address that collects the protocol fees
    /// @param recipient The address that receives the collected protocol fees
    /// @param amount0 The amount of token0 protocol fees that is withdrawn
    /// @param amount0 The amount of token1 protocol fees that is withdrawn
    event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);
}

File 6 of 12 : IPancakeV3PoolImmutables.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @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 IPancakeV3PoolImmutables {
    /// @notice The contract that deployed the pool, which must adhere to the IPancakeV3Factory interface
    /// @return The contract address
    function factory() external view returns (address);

    /// @notice The first of the two tokens of the pool, sorted by address
    /// @return The token contract address
    function token0() external view returns (address);

    /// @notice The second of the two tokens of the pool, sorted by address
    /// @return The token contract address
    function token1() external view returns (address);

    /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6
    /// @return The fee
    function fee() external view returns (uint24);

    /// @notice The pool tick spacing
    /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive
    /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...
    /// This value is an int24 to avoid casting even though it is always positive.
    /// @return The tick spacing
    function tickSpacing() external view returns (int24);

    /// @notice The maximum amount of position liquidity that can use any tick in the range
    /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and
    /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool
    /// @return The max amount of liquidity per tick
    function maxLiquidityPerTick() external view returns (uint128);
}

File 7 of 12 : IPancakeV3PoolOwnerActions.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Permissioned pool actions
/// @notice Contains pool methods that may only be called by the factory owner
interface IPancakeV3PoolOwnerActions {
    /// @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(uint32 feeProtocol0, uint32 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);

    /// @notice Set the LM pool to enable liquidity mining
    function setLmPool(address lmPool) external;
}

File 8 of 12 : IPancakeV3PoolState.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @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 IPancakeV3PoolState {
    /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas
    /// when accessed externally.
    /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value
    /// tick The current tick of the pool, i.e. according to the last tick transition that was run.
    /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick
    /// boundary.
    /// observationIndex The index of the last oracle observation that was written,
    /// observationCardinality The current maximum number of observations stored in the pool,
    /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.
    /// feeProtocol The protocol fee for both tokens of the pool.
    /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0
    /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.
    /// unlocked Whether the pool is currently locked to reentrancy
    function slot0()
        external
        view
        returns (
            uint160 sqrtPriceX96,
            int24 tick,
            uint16 observationIndex,
            uint16 observationCardinality,
            uint16 observationCardinalityNext,
            uint32 feeProtocol,
            bool unlocked
        );

    /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool
    /// @dev This value can overflow the uint256
    function feeGrowthGlobal0X128() external view returns (uint256);

    /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool
    /// @dev This value can overflow the uint256
    function feeGrowthGlobal1X128() external view returns (uint256);

    /// @notice The amounts of token0 and token1 that are owed to the protocol
    /// @dev Protocol fees will never exceed uint128 max in either token
    function protocolFees() external view returns (uint128 token0, uint128 token1);

    /// @notice The currently in range liquidity available to the pool
    /// @dev This value has no relationship to the total liquidity across all ticks
    function liquidity() external view returns (uint128);

    /// @notice Look up information about a specific tick in the pool
    /// @param tick The tick to look up
    /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or
    /// tick upper,
    /// liquidityNet how much liquidity changes when the pool price crosses the tick,
    /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,
    /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,
    /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick
    /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,
    /// secondsOutside the seconds spent on the other side of the tick from the current tick,
    /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.
    /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.
    /// In addition, these values are only relative and must be used only in comparison to previous snapshots for
    /// a specific position.
    function ticks(int24 tick)
        external
        view
        returns (
            uint128 liquidityGross,
            int128 liquidityNet,
            uint256 feeGrowthOutside0X128,
            uint256 feeGrowthOutside1X128,
            int56 tickCumulativeOutside,
            uint160 secondsPerLiquidityOutsideX128,
            uint32 secondsOutside,
            bool initialized
        );

    /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information
    function tickBitmap(int16 wordPosition) external view returns (uint256);

    /// @notice Returns the information about a position by the position's key
    /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper
    /// @return _liquidity The amount of liquidity in the position,
    /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,
    /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,
    /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,
    /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke
    function positions(bytes32 key)
        external
        view
        returns (
            uint128 _liquidity,
            uint256 feeGrowthInside0LastX128,
            uint256 feeGrowthInside1LastX128,
            uint128 tokensOwed0,
            uint128 tokensOwed1
        );

    /// @notice Returns data about a specific observation index
    /// @param index The element of the observations array to fetch
    /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time
    /// ago, rather than at a specific index in the array.
    /// @return blockTimestamp The timestamp of the observation,
    /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,
    /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,
    /// Returns initialized whether the observation has been initialized and the values are safe to use
    function observations(uint256 index)
        external
        view
        returns (
            uint32 blockTimestamp,
            int56 tickCumulative,
            uint160 secondsPerLiquidityCumulativeX128,
            bool initialized
        );
}

File 9 of 12 : LowGasSafeMath.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.0;

/// @title Optimized overflow and underflow safe math operations
/// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost
library LowGasSafeMath {
    /// @notice Returns x + y, reverts if sum overflows uint256
    /// @param x The augend
    /// @param y The addend
    /// @return z The sum of x and y
    function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
        require((z = x + y) >= x);
    }

    /// @notice Returns x - y, reverts if underflows
    /// @param x The minuend
    /// @param y The subtrahend
    /// @return z The difference of x and y
    function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
        require((z = x - y) <= x);
    }

    /// @notice Returns x * y, reverts if overflows
    /// @param x The multiplicand
    /// @param y The multiplier
    /// @return z The product of x and y
    function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
        require(x == 0 || (z = x * y) / x == y);
    }

    /// @notice Returns x + y, reverts if overflows or underflows
    /// @param x The augend
    /// @param y The addend
    /// @return z The sum of x and y
    function add(int256 x, int256 y) internal pure returns (int256 z) {
        require((z = x + y) >= x == (y >= 0));
    }

    /// @notice Returns x - y, reverts if overflows or underflows
    /// @param x The minuend
    /// @param y The subtrahend
    /// @return z The difference of x and y
    function sub(int256 x, int256 y) internal pure returns (int256 z) {
        require((z = x - y) <= x == (y >= 0));
    }
}

File 10 of 12 : IUniswapV2Pair.sol
pragma solidity >=0.5.0;

interface IUniswapV2Pair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external pure returns (string memory);
    function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;

    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);
    function kLast() external view returns (uint);

    function mint(address to) external returns (uint liquidity);
    function burn(address to) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;

    function initialize(address, address) external;
}

File 11 of 12 : IStableSwapFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.7.6;
pragma abicoder v2;

interface IStableSwapFactory {
    struct StableSwapPairInfo {
        address swapContract;
        address token0;
        address token1;
        address LPContract;
    }

    struct StableSwapThreePoolPairInfo {
        address swapContract;
        address token0;
        address token1;
        address token2;
        address LPContract;
    }

    // solium-disable-next-line mixedcase
    function pairLength() external view returns (uint256);

    function getPairInfo(address _tokenA, address _tokenB) 
        external 
        view 
        returns (StableSwapPairInfo memory info);

    function getThreePoolPairInfo(address _tokenA, address _tokenB)
        external
        view
        returns (StableSwapThreePoolPairInfo memory info);
        
}

File 12 of 12 : IStableSwapInfo.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.7.6;
pragma abicoder v2;

interface IStableSwapInfo {
    function get_dx(
        address _swap,
        uint256 i,
        uint256 j,
        uint256 dy,
        uint256 max_dx
    ) external view returns (uint256);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 10
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"deployer","type":"address"},{"components":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"internalType":"struct SmartRouterHelper.PoolKey","name":"key","type":"tuple"}],"name":"computeAddress","outputs":[{"internalType":"address","name":"pool","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"reserveIn","type":"uint256"},{"internalType":"uint256","name":"reserveOut","type":"uint256"}],"name":"getAmountIn","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"reserveIn","type":"uint256"},{"internalType":"uint256","name":"reserveOut","type":"uint256"}],"name":"getAmountOut","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"factory","type":"address"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsIn","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"deployer","type":"address"},{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"name":"getPool","outputs":[{"internalType":"contract IPancakeV3Pool","name":"","type":"IPancakeV3Pool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"name":"getPoolKey","outputs":[{"components":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"internalType":"struct SmartRouterHelper.PoolKey","name":"","type":"tuple"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"factory","type":"address"},{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"}],"name":"getReserves","outputs":[{"internalType":"uint256","name":"reserveA","type":"uint256"},{"internalType":"uint256","name":"reserveB","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"stableSwapFactory","type":"address"},{"internalType":"address","name":"stableSwapInfo","type":"address"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint256[]","name":"flag","type":"uint256[]"},{"internalType":"uint256","name":"amountOut","type":"uint256"}],"name":"getStableAmountsIn","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"stableSwapFactory","type":"address"},{"internalType":"address","name":"input","type":"address"},{"internalType":"address","name":"output","type":"address"},{"internalType":"uint256","name":"flag","type":"uint256"}],"name":"getStableInfo","outputs":[{"internalType":"uint256","name":"i","type":"uint256"},{"internalType":"uint256","name":"j","type":"uint256"},{"internalType":"address","name":"swapContract","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"factory","type":"address"},{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"}],"name":"pairFor","outputs":[{"internalType":"address","name":"pair","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"}],"name":"sortTokens","outputs":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"deployer","type":"address"},{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"name":"verifyCallback","outputs":[{"internalType":"contract IPancakeV3Pool","name":"pool","type":"IPancakeV3Pool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"deployer","type":"address"},{"components":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"internalType":"struct SmartRouterHelper.PoolKey","name":"poolKey","type":"tuple"}],"name":"verifyCallback","outputs":[{"internalType":"contract IPancakeV3Pool","name":"pool","type":"IPancakeV3Pool"}],"stateMutability":"view","type":"function"}]

61146d610026600b82828239805160001a60731461001957fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100b95760003560e01c8063054d50d4146100be578063192128b2146100e75780632b6d5d8f1461010757806332749461146101275780634e6c8ed814610148578063544caa56146101685780635923cab3146101895780636d91c0e21461019c57806370c3718e146101af57806385f8c259146101c25780638bdb1925146101d5578063a497919d146101e8578063b735aecd146101fb575b600080fd5b6100d16100cc36600461113f565b61021d565b6040516100de91906113a9565b60405180910390f35b6100fa6100f5366004610f81565b6102ad565b6040516100de9190611243565b61011a610115366004610eab565b6103b1565b6040516100de9190611375565b61013a610135366004610cd6565b610407565b6040516100de9291906113b2565b61015b610156366004610d20565b6104e0565b6040516100de91906111bf565b61017b610176366004610c9e565b6104fa565b6040516100de9291906111d3565b6100fa610197366004610dc9565b61055e565b61015b6101aa366004610cd6565b610712565b61015b6101bd366004610ef1565b6107a3565b6100d16101d036600461113f565b610854565b61015b6101e3366004610d20565b6108db565b61015b6101f6366004610ef1565b6108ec565b61020e610209366004610d79565b610915565b6040516100de939291906113c0565b60008084116102475760405162461bcd60e51b815260040161023e9061130e565b60405180910390fd5b6000831180156102575750600082115b61026057600080fd5b600061026e856126f7610b96565b9050600061027c8285610b96565b905060006102968361029088612710610b96565b90610bba565b90508082816102a157fe5b04979650505050505050565b60606002825110156102be57600080fd5b81516001600160401b03811180156102d557600080fd5b506040519080825280602002602001820160405280156102ff578160200160208202803683370190505b509050828160018351038151811061031357fe5b60209081029190910101528151600019015b80156103a9576000806103628786600186038151811061034157fe5b602002602001015187868151811061035557fe5b6020026020010151610407565b9150915061038484848151811061037557fe5b60200260200101518383610854565b84600185038151811061039357fe5b6020908102919091010152505060001901610325565b509392505050565b6103b9610bda565b826001600160a01b0316846001600160a01b031611156103d7579192915b50604080516060810182526001600160a01b03948516815292909316602083015262ffffff169181019190915290565b600080600061041685856104fa565b509050600080610427888888610712565b6001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561045f57600080fd5b505afa158015610473573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049791906110e4565b506001600160701b031691506001600160701b03169150826001600160a01b0316876001600160a01b0316146104ce5780826104d1565b81815b90999098509650505050505050565b60006104f1856101bd8686866103b1565b95945050505050565b600080826001600160a01b0316846001600160a01b0316141561051c57600080fd5b826001600160a01b0316846001600160a01b03161061053c57828461053f565b83835b90925090506001600160a01b03821661055757600080fd5b9250929050565b825160609060028110156105845760405162461bcd60e51b815260040161023e90611287565b806001600160401b038111801561059a57600080fd5b506040519080825280602002602001820160405280156105c4578160200160208202803683370190505b509150828260018303815181106105d757fe5b602090810291909101015260001981015b801561070757600060018203905060008060006106408c8b868151811061060b57fe5b60200260200101518c888151811061061f57fe5b60200260200101518c888151811061063357fe5b6020026020010151610915565b9250925092508a6001600160a01b031663ca4bc7148285858b8a8151811061066457fe5b60200260200101516000196040518663ffffffff1660e01b815260040161068f959493929190611215565b60206040518083038186803b1580156106a757600080fd5b505afa1580156106bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106df9190611127565b8785815181106106eb57fe5b6020908102919091010152505060001990920191506105e89050565b505095945050505050565b600080600061072185856104fa565b9150915085828260405160200161073992919061116a565b60408051601f19818403018152908290528051602091820120610781939290917f57224589c67f3f30a6b0d7a1b54cf3153ab84563bc609ef41dfb34f8b2974d2d910161118c565b60408051601f1981840301815291905280516020909101209695505050505050565b600081602001516001600160a01b031682600001516001600160a01b0316106107cb57600080fd5b828260000151836020015184604001516040516020016107ed939291906111ed565b60408051601f19818403018152908290528051602091820120610835939290917f6ce8eb472fa82df5469c6ab6d485f17c3ad13c8cd7af59b3d4a8026c5ce0f7e2910161118c565b60408051601f1981840301815291905280516020909101209392505050565b60008084116108755760405162461bcd60e51b815260040161023e90611341565b6000831180156108855750600082115b61088e57600080fd5b60006108a66127106108a08688610b96565b90610b96565b905060006108ba6126f76108a08689610bca565b90506108d160018284816108ca57fe5b0490610bba565b9695505050505050565b60006104f1856101f68686866103b1565b60006108f883836107a3565b9050336001600160a01b0382161461090f57600080fd5b92915050565b600080600083600214156109f457604051632007bd0f60e11b81526000906001600160a01b0389169063400f7a1e90610954908a908a906004016111d3565b60806040518083038186803b15801561096c57600080fd5b505afa158015610980573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a49190610fd7565b905080602001516001600160a01b0316876001600160a01b0316146109ca5760016109cd565b60005b60ff16935083156109df5760006109e2565b60015b60ff1692508060000151915050610b66565b8360031415610b665760405163923093cb60e01b81526000906001600160a01b0389169063923093cb90610a2e908a908a906004016111d3565b60a06040518083038186803b158015610a4657600080fd5b505afa158015610a5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7e9190611054565b905080602001516001600160a01b0316876001600160a01b03161415610aa75760009350610af1565b80604001516001600160a01b0316876001600160a01b03161415610ace5760019350610af1565b80606001516001600160a01b0316876001600160a01b03161415610af157600293505b80602001516001600160a01b0316866001600160a01b03161415610b185760009250610b62565b80604001516001600160a01b0316866001600160a01b03161415610b3f5760019250610b62565b80606001516001600160a01b0316866001600160a01b03161415610b6257600292505b5190505b6001600160a01b038116610b8c5760405162461bcd60e51b815260040161023e906112cb565b9450945094915050565b6000821580610bb157505081810281838281610bae57fe5b04145b61090f57600080fd5b8082018281101561090f57600080fd5b8082038281111561090f57600080fd5b604080516060810182526000808252602082018190529181019190915290565b600082601f830112610c0a578081fd5b81356020610c1f610c1a83611402565b6113df565b8281528181019085830183850287018401881015610c3b578586fd5b855b85811015610c62578135610c508161141f565b84529284019290840190600101610c3d565b5090979650505050505050565b80516001600160701b0381168114610c8657600080fd5b919050565b803562ffffff81168114610c8657600080fd5b60008060408385031215610cb0578182fd5b8235610cbb8161141f565b91506020830135610ccb8161141f565b809150509250929050565b600080600060608486031215610cea578081fd5b8335610cf58161141f565b92506020840135610d058161141f565b91506040840135610d158161141f565b809150509250925092565b60008060008060808587031215610d35578081fd5b8435610d408161141f565b93506020850135610d508161141f565b92506040850135610d608161141f565b9150610d6e60608601610c8b565b905092959194509250565b60008060008060808587031215610d8e578384fd5b8435610d998161141f565b93506020850135610da98161141f565b92506040850135610db98161141f565b9396929550929360600135925050565b600080600080600060a08688031215610de0578081fd5b8535610deb8161141f565b9450602086810135610dfc8161141f565b945060408701356001600160401b0380821115610e17578384fd5b610e238a838b01610bfa565b95506060890135915080821115610e38578384fd5b508701601f81018913610e49578283fd5b8035610e57610c1a82611402565b81815283810190838501858402850186018d1015610e73578687fd5b8694505b83851015610e95578035835260019490940193918501918501610e77565b50989b979a509598608001359695505050505050565b600080600060608486031215610ebf578081fd5b8335610eca8161141f565b92506020840135610eda8161141f565b9150610ee860408501610c8b565b90509250925092565b6000808284036080811215610f04578283fd5b8335610f0f8161141f565b92506060601f1982011215610f22578182fd5b50604051606081016001600160401b0381118282101715610f3f57fe5b6040526020840135610f508161141f565b81526040840135610f608161141f565b6020820152610f7160608501610c8b565b6040820152809150509250929050565b600080600060608486031215610f95578081fd5b8335610fa08161141f565b92506020840135915060408401356001600160401b03811115610fc1578182fd5b610fcd86828701610bfa565b9150509250925092565b600060808284031215610fe8578081fd5b604051608081016001600160401b038111828210171561100457fe5b60405282516110128161141f565b815260208301516110228161141f565b602082015260408301516110358161141f565b604082015260608301516110488161141f565b60608201529392505050565b600060a08284031215611065578081fd5b60405160a081016001600160401b038111828210171561108157fe5b604052825161108f8161141f565b8152602083015161109f8161141f565b602082015260408301516110b28161141f565b604082015260608301516110c58161141f565b606082015260808301516110d88161141f565b60808201529392505050565b6000806000606084860312156110f8578081fd5b61110184610c6f565b925061110f60208501610c6f565b9150604084015163ffffffff81168114610d15578182fd5b600060208284031215611138578081fd5b5051919050565b600080600060608486031215611153578081fd5b505081359360208301359350604090920135919050565b6001600160601b0319606093841b811682529190921b16601482015260280190565b6001600160f81b0319815260609390931b6001600160601b03191660018401526015830191909152603582015260550190565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03938416815291909216602082015262ffffff909116604082015260600190565b6001600160a01b03959095168552602085019390935260408401919091526060830152608082015260a00190565b6020808252825182820181905260009190848201906040850190845b8181101561127b5783518352928401929184019160010161125f565b50909695505050505050565b60208082526024908201527f676574537461626c65416d6f756e7473496e3a20696e636f7272656374206c656040820152630dccee8d60e31b606082015260800190565b60208082526023908201527f676574537461626c65496e666f3a20696e76616c696420706f6f6c206164647260408201526265737360e81b606082015260800190565b602080825260199082015278125394d551919250d251539517d25394155517d05353d55395603a1b604082015260600190565b6020808252601a9082015279125394d551919250d251539517d3d55514155517d05353d5539560321b604082015260600190565b81516001600160a01b0390811682526020808401519091169082015260409182015162ffffff169181019190915260600190565b90815260200190565b918252602082015260400190565b92835260208301919091526001600160a01b0316604082015260600190565b6040518181016001600160401b03811182821017156113fa57fe5b604052919050565b60006001600160401b0382111561141557fe5b5060209081020190565b6001600160a01b038116811461143457600080fd5b5056fea26469706673582212203b7fafbaff86af2eb54df5eb1a9142763718eca4697ba06c251869ae5069e7fa64736f6c63430007060033

Deployed Bytecode

0x73daecee3c08e953bd5f89a5cc90ac560413d709e330146080604052600436106100b95760003560e01c8063054d50d4146100be578063192128b2146100e75780632b6d5d8f1461010757806332749461146101275780634e6c8ed814610148578063544caa56146101685780635923cab3146101895780636d91c0e21461019c57806370c3718e146101af57806385f8c259146101c25780638bdb1925146101d5578063a497919d146101e8578063b735aecd146101fb575b600080fd5b6100d16100cc36600461113f565b61021d565b6040516100de91906113a9565b60405180910390f35b6100fa6100f5366004610f81565b6102ad565b6040516100de9190611243565b61011a610115366004610eab565b6103b1565b6040516100de9190611375565b61013a610135366004610cd6565b610407565b6040516100de9291906113b2565b61015b610156366004610d20565b6104e0565b6040516100de91906111bf565b61017b610176366004610c9e565b6104fa565b6040516100de9291906111d3565b6100fa610197366004610dc9565b61055e565b61015b6101aa366004610cd6565b610712565b61015b6101bd366004610ef1565b6107a3565b6100d16101d036600461113f565b610854565b61015b6101e3366004610d20565b6108db565b61015b6101f6366004610ef1565b6108ec565b61020e610209366004610d79565b610915565b6040516100de939291906113c0565b60008084116102475760405162461bcd60e51b815260040161023e9061130e565b60405180910390fd5b6000831180156102575750600082115b61026057600080fd5b600061026e856126f7610b96565b9050600061027c8285610b96565b905060006102968361029088612710610b96565b90610bba565b90508082816102a157fe5b04979650505050505050565b60606002825110156102be57600080fd5b81516001600160401b03811180156102d557600080fd5b506040519080825280602002602001820160405280156102ff578160200160208202803683370190505b509050828160018351038151811061031357fe5b60209081029190910101528151600019015b80156103a9576000806103628786600186038151811061034157fe5b602002602001015187868151811061035557fe5b6020026020010151610407565b9150915061038484848151811061037557fe5b60200260200101518383610854565b84600185038151811061039357fe5b6020908102919091010152505060001901610325565b509392505050565b6103b9610bda565b826001600160a01b0316846001600160a01b031611156103d7579192915b50604080516060810182526001600160a01b03948516815292909316602083015262ffffff169181019190915290565b600080600061041685856104fa565b509050600080610427888888610712565b6001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561045f57600080fd5b505afa158015610473573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049791906110e4565b506001600160701b031691506001600160701b03169150826001600160a01b0316876001600160a01b0316146104ce5780826104d1565b81815b90999098509650505050505050565b60006104f1856101bd8686866103b1565b95945050505050565b600080826001600160a01b0316846001600160a01b0316141561051c57600080fd5b826001600160a01b0316846001600160a01b03161061053c57828461053f565b83835b90925090506001600160a01b03821661055757600080fd5b9250929050565b825160609060028110156105845760405162461bcd60e51b815260040161023e90611287565b806001600160401b038111801561059a57600080fd5b506040519080825280602002602001820160405280156105c4578160200160208202803683370190505b509150828260018303815181106105d757fe5b602090810291909101015260001981015b801561070757600060018203905060008060006106408c8b868151811061060b57fe5b60200260200101518c888151811061061f57fe5b60200260200101518c888151811061063357fe5b6020026020010151610915565b9250925092508a6001600160a01b031663ca4bc7148285858b8a8151811061066457fe5b60200260200101516000196040518663ffffffff1660e01b815260040161068f959493929190611215565b60206040518083038186803b1580156106a757600080fd5b505afa1580156106bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106df9190611127565b8785815181106106eb57fe5b6020908102919091010152505060001990920191506105e89050565b505095945050505050565b600080600061072185856104fa565b9150915085828260405160200161073992919061116a565b60408051601f19818403018152908290528051602091820120610781939290917f57224589c67f3f30a6b0d7a1b54cf3153ab84563bc609ef41dfb34f8b2974d2d910161118c565b60408051601f1981840301815291905280516020909101209695505050505050565b600081602001516001600160a01b031682600001516001600160a01b0316106107cb57600080fd5b828260000151836020015184604001516040516020016107ed939291906111ed565b60408051601f19818403018152908290528051602091820120610835939290917f6ce8eb472fa82df5469c6ab6d485f17c3ad13c8cd7af59b3d4a8026c5ce0f7e2910161118c565b60408051601f1981840301815291905280516020909101209392505050565b60008084116108755760405162461bcd60e51b815260040161023e90611341565b6000831180156108855750600082115b61088e57600080fd5b60006108a66127106108a08688610b96565b90610b96565b905060006108ba6126f76108a08689610bca565b90506108d160018284816108ca57fe5b0490610bba565b9695505050505050565b60006104f1856101f68686866103b1565b60006108f883836107a3565b9050336001600160a01b0382161461090f57600080fd5b92915050565b600080600083600214156109f457604051632007bd0f60e11b81526000906001600160a01b0389169063400f7a1e90610954908a908a906004016111d3565b60806040518083038186803b15801561096c57600080fd5b505afa158015610980573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a49190610fd7565b905080602001516001600160a01b0316876001600160a01b0316146109ca5760016109cd565b60005b60ff16935083156109df5760006109e2565b60015b60ff1692508060000151915050610b66565b8360031415610b665760405163923093cb60e01b81526000906001600160a01b0389169063923093cb90610a2e908a908a906004016111d3565b60a06040518083038186803b158015610a4657600080fd5b505afa158015610a5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7e9190611054565b905080602001516001600160a01b0316876001600160a01b03161415610aa75760009350610af1565b80604001516001600160a01b0316876001600160a01b03161415610ace5760019350610af1565b80606001516001600160a01b0316876001600160a01b03161415610af157600293505b80602001516001600160a01b0316866001600160a01b03161415610b185760009250610b62565b80604001516001600160a01b0316866001600160a01b03161415610b3f5760019250610b62565b80606001516001600160a01b0316866001600160a01b03161415610b6257600292505b5190505b6001600160a01b038116610b8c5760405162461bcd60e51b815260040161023e906112cb565b9450945094915050565b6000821580610bb157505081810281838281610bae57fe5b04145b61090f57600080fd5b8082018281101561090f57600080fd5b8082038281111561090f57600080fd5b604080516060810182526000808252602082018190529181019190915290565b600082601f830112610c0a578081fd5b81356020610c1f610c1a83611402565b6113df565b8281528181019085830183850287018401881015610c3b578586fd5b855b85811015610c62578135610c508161141f565b84529284019290840190600101610c3d565b5090979650505050505050565b80516001600160701b0381168114610c8657600080fd5b919050565b803562ffffff81168114610c8657600080fd5b60008060408385031215610cb0578182fd5b8235610cbb8161141f565b91506020830135610ccb8161141f565b809150509250929050565b600080600060608486031215610cea578081fd5b8335610cf58161141f565b92506020840135610d058161141f565b91506040840135610d158161141f565b809150509250925092565b60008060008060808587031215610d35578081fd5b8435610d408161141f565b93506020850135610d508161141f565b92506040850135610d608161141f565b9150610d6e60608601610c8b565b905092959194509250565b60008060008060808587031215610d8e578384fd5b8435610d998161141f565b93506020850135610da98161141f565b92506040850135610db98161141f565b9396929550929360600135925050565b600080600080600060a08688031215610de0578081fd5b8535610deb8161141f565b9450602086810135610dfc8161141f565b945060408701356001600160401b0380821115610e17578384fd5b610e238a838b01610bfa565b95506060890135915080821115610e38578384fd5b508701601f81018913610e49578283fd5b8035610e57610c1a82611402565b81815283810190838501858402850186018d1015610e73578687fd5b8694505b83851015610e95578035835260019490940193918501918501610e77565b50989b979a509598608001359695505050505050565b600080600060608486031215610ebf578081fd5b8335610eca8161141f565b92506020840135610eda8161141f565b9150610ee860408501610c8b565b90509250925092565b6000808284036080811215610f04578283fd5b8335610f0f8161141f565b92506060601f1982011215610f22578182fd5b50604051606081016001600160401b0381118282101715610f3f57fe5b6040526020840135610f508161141f565b81526040840135610f608161141f565b6020820152610f7160608501610c8b565b6040820152809150509250929050565b600080600060608486031215610f95578081fd5b8335610fa08161141f565b92506020840135915060408401356001600160401b03811115610fc1578182fd5b610fcd86828701610bfa565b9150509250925092565b600060808284031215610fe8578081fd5b604051608081016001600160401b038111828210171561100457fe5b60405282516110128161141f565b815260208301516110228161141f565b602082015260408301516110358161141f565b604082015260608301516110488161141f565b60608201529392505050565b600060a08284031215611065578081fd5b60405160a081016001600160401b038111828210171561108157fe5b604052825161108f8161141f565b8152602083015161109f8161141f565b602082015260408301516110b28161141f565b604082015260608301516110c58161141f565b606082015260808301516110d88161141f565b60808201529392505050565b6000806000606084860312156110f8578081fd5b61110184610c6f565b925061110f60208501610c6f565b9150604084015163ffffffff81168114610d15578182fd5b600060208284031215611138578081fd5b5051919050565b600080600060608486031215611153578081fd5b505081359360208301359350604090920135919050565b6001600160601b0319606093841b811682529190921b16601482015260280190565b6001600160f81b0319815260609390931b6001600160601b03191660018401526015830191909152603582015260550190565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03938416815291909216602082015262ffffff909116604082015260600190565b6001600160a01b03959095168552602085019390935260408401919091526060830152608082015260a00190565b6020808252825182820181905260009190848201906040850190845b8181101561127b5783518352928401929184019160010161125f565b50909695505050505050565b60208082526024908201527f676574537461626c65416d6f756e7473496e3a20696e636f7272656374206c656040820152630dccee8d60e31b606082015260800190565b60208082526023908201527f676574537461626c65496e666f3a20696e76616c696420706f6f6c206164647260408201526265737360e81b606082015260800190565b602080825260199082015278125394d551919250d251539517d25394155517d05353d55395603a1b604082015260600190565b6020808252601a9082015279125394d551919250d251539517d3d55514155517d05353d5539560321b604082015260600190565b81516001600160a01b0390811682526020808401519091169082015260409182015162ffffff169181019190915260600190565b90815260200190565b918252602082015260400190565b92835260208301919091526001600160a01b0316604082015260600190565b6040518181016001600160401b03811182821017156113fa57fe5b604052919050565b60006001600160401b0382111561141557fe5b5060209081020190565b6001600160a01b038116811461143457600080fd5b5056fea26469706673582212203b7fafbaff86af2eb54df5eb1a9142763718eca4697ba06c251869ae5069e7fa64736f6c63430007060033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.