Contract 0x3098cFaAbA3795AB98DC2D5066eC4d2584ae7C68 2

 

Contract Overview

Zapper.Fi: Sushiswap Zap Out
Balance:
0 Ether

EtherValue:
$0.00

Token:
 
Txn Hash
Method
Block
From
To
Value
0x6da3449ebb3f7d6466909de0f304f1cb14da2c8700b36d7d08aae99696656799Zap Out With Per...159708002022-11-14 20:55:3522 days 19 hrs ago0xc0946a671c40dbfdc1d6077303eb8493189cbd33 IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.01023665 18.60848693
0x8c1c5a2ce81f55aeb1b8924d8d81e9907a0fc326fa1c3d82c04a2c6a1b874c1bZap Out With Per...151834642022-07-21 3:13:35139 days 13 hrs ago0x17e88d29c8d4129554620490d783bce20e1a7eae IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.02173345 31.14487091
0x8dd5e341fdff4a4b0ddcbc59e3ae525a19a468d73f0555fb1f5304aab0d72452Zap Out With Per...151834522022-07-21 3:10:30139 days 13 hrs ago0x17e88d29c8d4129554620490d783bce20e1a7eae IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.01370577 26.9234813
0x781ee7dffb48442e16ad83ab7279bb6d14cefd38ef1d7eb62dfc0825a5fe1792Zap Out With Per...151834452022-07-21 3:07:46139 days 13 hrs ago0x17e88d29c8d4129554620490d783bce20e1a7eae IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.02068533 18.67416088
0xb4bd9df0688ba342f03969f21bba167157236df620e646fd338c8c2a791e2bf6Zap Out With Per...151814082022-07-20 19:40:00139 days 20 hrs ago0xc79b8b594f8a7906f3b8c5792186431da9908e4d IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.01339294 28.0997269
0x75648c99398ab60afca549d35bf70d8b801b7b943c041503e68de105ca15b15fZap Out With Per...151788522022-07-20 10:05:37140 days 6 hrs ago0x46bf034406b988ca1aaea22954471f07d30ec861 IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.01308783 23.27768395
0xaca26835c732445a84d0a221e17b6d2e6538a1b14e7c4b42347bd11407bf5ac3Zap Out With Per...151787622022-07-20 9:45:59140 days 6 hrs ago0x46bf034406b988ca1aaea22954471f07d30ec861 IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.0076936 16.18823063
0x844a60f08e2beeee583c75d9813802cf9af18c2d4358e538705400fc31bcda6bZap Out With Per...151750632022-07-19 19:47:51140 days 20 hrs ago0x0609857eab532b24995c2991685f52cb442c62c7 IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.02075319 34.20910023
0xc009034c91e45489badeb9cacb6668f9c0df537a68dcc73f605400b10ee7fa7fZap Out151607162022-07-17 14:33:53143 days 1 hr ago0xfe9bae5f3a30746de18e59f6e6f9d600e90cfdd4 IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.01896014 41.44420779
0x37d36c1c65dd9ab5f9f35d4921e2350fbeb794d9816be9a94d7f22df144eeac2Zap Out With Per...151589042022-07-17 7:45:58143 days 8 hrs agoENS Name manishk8227.eth IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.00373609 7.30716102
0x9e9636d6d8449558ee052646a87fa3b67eef38289decfdaaf8753ead1f8dbfe7Zap Out151584702022-07-17 6:05:05143 days 10 hrs ago0xfe9bae5f3a30746de18e59f6e6f9d600e90cfdd4 IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.00530655 11.81761166
0xe3cbd9c5ae065907739aea1f16de521330c6d2064a3a2f2528b6f3202aa38128Zap Out With Per...151580812022-07-17 4:33:54143 days 11 hrs ago0x5e599555ad9416c6e36e52ff96b8c598b1a25d9d IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.00398103 8.41629104
0xee74b9dd2f38b954223c692856d93de3a2af106260ac13a77b55d738f215e968Zap Out2Pair Tok...151512202022-07-16 3:11:03144 days 13 hrs ago0x24d1feff00f89cc6c40a845e11ed55bbed621822 IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.00272103 8.5704113
0x5efa7fe0faf38a9d615248c3b1611c3c4dd44ad3cff569433e0b9d4e16a5ba73Zap Out With Per...151453202022-07-15 5:11:31145 days 11 hrs ago0xb50f74390506fb87b7847e6f6e562db9c7f741ae IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.00521017 10.97106915
0x9c6650da04acce383afd03589872b816bb7ef0479857e5ebd1b75b52ecbe1e5aZap Out With Per...151397512022-07-14 8:50:44146 days 7 hrs ago0x83dbf9f6fec1d59a2979397424be2148d9c556e2 IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.00393366 8.06278894
0x44346ac14c6e20d8c3042b45f27c43ca8b7db0bfb922f860ab0ab272adab0062Zap Out With Per...151389842022-07-14 6:09:40146 days 10 hrs ago0x99c2e4708493b19baa116e26dfa0056f5a69a783 IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.00729784 13.5262809
0x6e2880bf7da10bc46e15fd73ff3c4c4731ca4b928f42db7e687f956bfefcf805Zap Out151315162022-07-13 1:59:32147 days 14 hrs agoENS Name unvetica.eth IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.00704446 15.72347633
0x99c4a8e8f6cce822bb889ea71109b4948d701b6615086dc9302630768b21f0d8Zap Out With Per...151265972022-07-12 7:43:05148 days 8 hrs ago0x7eedc89660a3275c338402dbb1bbf0c03bddf295 IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.00692685 11.76996026
0x19e42e6cfbe05c7d1451ebc0d49cf83dd9c11dbab89aafd21e8d3d02c3a1c6e0Zap Out With Per...151232052022-07-11 19:21:08148 days 21 hrs ago0x5dfd0b12377bfcb67775d118056c0254d2f3dedd IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.02023401 41.77853334
0x0745043084257fb07fa7025a08612b9ed01b3a99ff454a90e0ea5d15e751399dZap Out With Per...151165382022-07-10 18:33:24149 days 21 hrs ago0xa0b9905166c2773941cdbd287b3f1b6ab76f96b1 IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.01121185 17.87789421
0x4b7dc50b5beacb16aeebb92c737b21f4687f77c7d79632c04d9173b01762eb56Zap Out With Per...151152322022-07-10 13:46:57150 days 2 hrs agoENS Name ethhonduras.eth IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.00770628 15.02987597
0xba2164d5082019b073047d75a84a9311d7bf17d4507db3fefb99d2adbc1dca5fZap Out With Per...151118092022-07-10 1:05:39150 days 15 hrs agoENS Name unvetica.eth IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.00989376 14.20571293
0xf1fce7b3892b486a75db81889d34258cac6a0e34732a8d75bd44a375170a92bfZap Out With Per...151106332022-07-09 20:49:05150 days 19 hrs agoMirror: Chris Martz IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.01967486 41.73576068
0xe6405b657f1f6c2a8ecaf579a746b6a7bbbb15befdd519be3d0e7343a5973d49Zap Out With Per...151094512022-07-09 16:21:51151 days ago0xec9f7dce2a28b7d9efff14c9245a24f7d3443cbf IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.01704338 25.08010012
0xb5a77035b05ad67c9786ec27e3910231d7a2375f14439b26c57e5216091407efZap Out With Per...151082842022-07-09 12:16:26151 days 4 hrs ago0x90c5d4fb190df3432cde9c0a56121797c6b425cf IN  Zapper.Fi: Sushiswap Zap Out0 Ether0.00337176 7.34780837
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x75648c99398ab60afca549d35bf70d8b801b7b943c041503e68de105ca15b15f151788522022-07-20 10:05:37140 days 6 hrs ago Zapper.Fi: Sushiswap Zap Out0x46bf034406b988ca1aaea22954471f07d30ec8618.02260245 Ether
0x75648c99398ab60afca549d35bf70d8b801b7b943c041503e68de105ca15b15f151788522022-07-20 10:05:37140 days 6 hrs ago Wrapped Ether Zapper.Fi: Sushiswap Zap Out4.02651336 Ether
0x75648c99398ab60afca549d35bf70d8b801b7b943c041503e68de105ca15b15f151788522022-07-20 10:05:37140 days 6 hrs ago 0x: Exchange Proxy Flash Wallet Zapper.Fi: Sushiswap Zap Out3.99608908 Ether
0xaca26835c732445a84d0a221e17b6d2e6538a1b14e7c4b42347bd11407bf5ac3151787622022-07-20 9:45:59140 days 6 hrs ago Zapper.Fi: Sushiswap Zap Out0x46bf034406b988ca1aaea22954471f07d30ec8612.81207316 Ether
0xaca26835c732445a84d0a221e17b6d2e6538a1b14e7c4b42347bd11407bf5ac3151787622022-07-20 9:45:59140 days 6 hrs ago 0x: Exchange Proxy Flash Wallet Zapper.Fi: Sushiswap Zap Out1.40360839 Ether
0xaca26835c732445a84d0a221e17b6d2e6538a1b14e7c4b42347bd11407bf5ac3151787622022-07-20 9:45:59140 days 6 hrs ago Wrapped Ether Zapper.Fi: Sushiswap Zap Out1.40846476 Ether
0x844a60f08e2beeee583c75d9813802cf9af18c2d4358e538705400fc31bcda6b151750632022-07-19 19:47:51140 days 20 hrs ago Zapper.Fi: Sushiswap Zap Out0x0609857eab532b24995c2991685f52cb442c62c723.16728726 Ether
0x844a60f08e2beeee583c75d9813802cf9af18c2d4358e538705400fc31bcda6b151750632022-07-19 19:47:51140 days 20 hrs ago Wrapped Ether Zapper.Fi: Sushiswap Zap Out11.58522775 Ether
0x844a60f08e2beeee583c75d9813802cf9af18c2d4358e538705400fc31bcda6b151750632022-07-19 19:47:51140 days 20 hrs ago 0x: Exchange Proxy Flash Wallet Zapper.Fi: Sushiswap Zap Out11.58205951 Ether
0xc009034c91e45489badeb9cacb6668f9c0df537a68dcc73f605400b10ee7fa7f151607162022-07-17 14:33:53143 days 1 hr ago Zapper.Fi: Sushiswap Zap Out0xfe9bae5f3a30746de18e59f6e6f9d600e90cfdd41.77602711 Ether
0xc009034c91e45489badeb9cacb6668f9c0df537a68dcc73f605400b10ee7fa7f151607162022-07-17 14:33:53143 days 1 hr ago Wrapped Ether Zapper.Fi: Sushiswap Zap Out0.8893604 Ether
0xc009034c91e45489badeb9cacb6668f9c0df537a68dcc73f605400b10ee7fa7f151607162022-07-17 14:33:53143 days 1 hr ago 0x: Exchange Proxy Flash Wallet Zapper.Fi: Sushiswap Zap Out0.8866667 Ether
0x9e9636d6d8449558ee052646a87fa3b67eef38289decfdaaf8753ead1f8dbfe7151584702022-07-17 6:05:05143 days 10 hrs ago Zapper.Fi: Sushiswap Zap Out0xfe9bae5f3a30746de18e59f6e6f9d600e90cfdd40.50463149 Ether
0x9e9636d6d8449558ee052646a87fa3b67eef38289decfdaaf8753ead1f8dbfe7151584702022-07-17 6:05:05143 days 10 hrs ago Wrapped Ether Zapper.Fi: Sushiswap Zap Out0.25269581 Ether
0x9e9636d6d8449558ee052646a87fa3b67eef38289decfdaaf8753ead1f8dbfe7151584702022-07-17 6:05:05143 days 10 hrs ago 0x: Exchange Proxy Flash Wallet Zapper.Fi: Sushiswap Zap Out0.25193568 Ether
0xe3cbd9c5ae065907739aea1f16de521330c6d2064a3a2f2528b6f3202aa38128151580812022-07-17 4:33:54143 days 11 hrs ago Zapper.Fi: Sushiswap Zap Out0x5e599555ad9416c6e36e52ff96b8c598b1a25d9d0.05681708 Ether
0xe3cbd9c5ae065907739aea1f16de521330c6d2064a3a2f2528b6f3202aa38128151580812022-07-17 4:33:54143 days 11 hrs ago Wrapped Ether Zapper.Fi: Sushiswap Zap Out0.02845208 Ether
0xe3cbd9c5ae065907739aea1f16de521330c6d2064a3a2f2528b6f3202aa38128151580812022-07-17 4:33:54143 days 11 hrs ago 0x: Exchange Proxy Flash Wallet Zapper.Fi: Sushiswap Zap Out0.02836499 Ether
0xee74b9dd2f38b954223c692856d93de3a2af106260ac13a77b55d738f215e968151512202022-07-16 3:11:03144 days 13 hrs ago Zapper.Fi: Sushiswap Zap Out0x24d1feff00f89cc6c40a845e11ed55bbed6218220.00824706 Ether
0xee74b9dd2f38b954223c692856d93de3a2af106260ac13a77b55d738f215e968151512202022-07-16 3:11:03144 days 13 hrs ago SushiSwap: Router Zapper.Fi: Sushiswap Zap Out0.00824706 Ether
0x44346ac14c6e20d8c3042b45f27c43ca8b7db0bfb922f860ab0ab272adab0062151389842022-07-14 6:09:40146 days 10 hrs ago Zapper.Fi: Sushiswap Zap Out0x99c2e4708493b19baa116e26dfa0056f5a69a7830.12239536 Ether
0x44346ac14c6e20d8c3042b45f27c43ca8b7db0bfb922f860ab0ab272adab0062151389842022-07-14 6:09:40146 days 10 hrs ago Wrapped Ether Zapper.Fi: Sushiswap Zap Out0.06077008 Ether
0x44346ac14c6e20d8c3042b45f27c43ca8b7db0bfb922f860ab0ab272adab0062151389842022-07-14 6:09:40146 days 10 hrs ago 0x: Exchange Proxy Flash Wallet Zapper.Fi: Sushiswap Zap Out0.06162528 Ether
0x19e42e6cfbe05c7d1451ebc0d49cf83dd9c11dbab89aafd21e8d3d02c3a1c6e0151232052022-07-11 19:21:08148 days 21 hrs ago Zapper.Fi: Sushiswap Zap Out0x5dfd0b12377bfcb67775d118056c0254d2f3dedd0.83087612 Ether
0x19e42e6cfbe05c7d1451ebc0d49cf83dd9c11dbab89aafd21e8d3d02c3a1c6e0151232052022-07-11 19:21:08148 days 21 hrs ago Wrapped Ether Zapper.Fi: Sushiswap Zap Out0.41606487 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Sushiswap_ZapOut_General_V4

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU GPLv2 license
File 1 of 8 : Sushiswap_ZapOut_General_V4.sol
// ███████╗░█████╗░██████╗░██████╗░███████╗██████╗░░░░███████╗██╗
// ╚════██║██╔══██╗██╔══██╗██╔══██╗██╔════╝██╔══██╗░░░██╔════╝██║
// ░░███╔═╝███████║██████╔╝██████╔╝█████╗░░██████╔╝░░░█████╗░░██║
// ██╔══╝░░██╔══██║██╔═══╝░██╔═══╝░██╔══╝░░██╔══██╗░░░██╔══╝░░██║
// ███████╗██║░░██║██║░░░░░██║░░░░░███████╗██║░░██║██╗██║░░░░░██║
// ╚══════╝╚═╝░░╚═╝╚═╝░░░░░╚═╝░░░░░╚══════╝╚═╝░░╚═╝╚═╝╚═╝░░░░░╚═╝
// Copyright (C) 2021 zapper

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// Visit <https://www.gnu.org/licenses/>for a copy of the GNU Affero General Public License

///@author Zapper
///@notice this contract implements one click removal of liquidity from Sushiswap pools, receiving ETH, ERC20 or both.
// SPDX-License-Identifier: GPL-2.0

pragma solidity ^0.8.0;
import "../_base/ZapOutBaseV3.sol";

interface IUniswapV2Factory {
    function getPair(address tokenA, address tokenB)
        external
        view
        returns (address pair);
}

interface IUniswapV2Router02 {
    function WETH() external pure returns (address);

    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountA, uint256 amountB);

    function removeLiquidityETH(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountToken, uint256 amountETH);
}

interface IUniswapV2Pair {
    function token0() external pure returns (address);

    function token1() external pure returns (address);

    function balanceOf(address user) external view returns (uint256);

    function totalSupply() external view returns (uint256);

    function getReserves()
        external
        view
        returns (
            uint112 _reserve0,
            uint112 _reserve1,
            uint32 _blockTimestampLast
        );

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

interface IWETH {
    function withdraw(uint256 wad) external;
}

contract Sushiswap_ZapOut_General_V4 is ZapOutBaseV3 {
    using SafeERC20 for IERC20;

    uint256 private constant deadline =
        0xf000000000000000000000000000000000000000000000000000000000000000;

    uint256 private constant permitAllowance = 79228162514260000000000000000;

    IUniswapV2Router02 private constant sushiswapRouter =
        IUniswapV2Router02(0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F);
    IUniswapV2Factory private constant sushiswapFactory =
        IUniswapV2Factory(0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac);

    address private constant wethTokenAddress =
        address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2);

    constructor(uint256 _goodwill, uint256 _affiliateSplit)
        ZapBaseV2(_goodwill, _affiliateSplit)
    {
        // 0x exchange
        approvedTargets[0xDef1C0ded9bec7F1a1670819833240f027b25EfF] = true;
    }

    event zapOut(
        address sender,
        address pool,
        address token,
        uint256 tokensRec
    );

    /**
        @notice Zap out in both tokens
        @param fromPoolAddress Pool from which to remove liquidity
        @param incomingLP Quantity of LP to remove from pool
        @param affiliate Affiliate address
        @return amountA Quantity of tokenA received after zapout
        @return amountB Quantity of tokenB received after zapout
    */
    function ZapOut2PairToken(
        address fromPoolAddress,
        uint256 incomingLP,
        address affiliate
    ) public stopInEmergency returns (uint256 amountA, uint256 amountB) {
        IUniswapV2Pair pair = IUniswapV2Pair(fromPoolAddress);

        require(address(pair) != address(0), "Pool Cannot be Zero Address");

        // get reserves
        address token0 = pair.token0();
        address token1 = pair.token1();

        IERC20(fromPoolAddress).safeTransferFrom(
            msg.sender,
            address(this),
            incomingLP
        );

        _approveToken(fromPoolAddress, address(sushiswapRouter), incomingLP);

        if (token0 == wethTokenAddress || token1 == wethTokenAddress) {
            address _token = token0 == wethTokenAddress ? token1 : token0;
            (amountA, amountB) = sushiswapRouter.removeLiquidityETH(
                _token,
                incomingLP,
                1,
                1,
                address(this),
                deadline
            );

            // subtract goodwill
            uint256 tokenGoodwill =
                _subtractGoodwill(_token, amountA, affiliate, true);
            uint256 ethGoodwill =
                _subtractGoodwill(ETHAddress, amountB, affiliate, true);

            // send tokens
            IERC20(_token).safeTransfer(msg.sender, amountA - tokenGoodwill);
            Address.sendValue(payable(msg.sender), amountB - ethGoodwill);
        } else {
            (amountA, amountB) = sushiswapRouter.removeLiquidity(
                token0,
                token1,
                incomingLP,
                1,
                1,
                address(this),
                deadline
            );

            // subtract goodwill
            uint256 tokenAGoodwill =
                _subtractGoodwill(token0, amountA, affiliate, true);
            uint256 tokenBGoodwill =
                _subtractGoodwill(token1, amountB, affiliate, true);

            // send tokens
            IERC20(token0).safeTransfer(msg.sender, amountA - tokenAGoodwill);
            IERC20(token1).safeTransfer(msg.sender, amountB - tokenBGoodwill);
        }
        emit zapOut(msg.sender, fromPoolAddress, token0, amountA);
        emit zapOut(msg.sender, fromPoolAddress, token1, amountB);
    }

    /**
    @notice Zap out in a single token
    @param toTokenAddress Address of desired token
    @param fromPoolAddress Pool from which to remove liquidity
    @param incomingLP Quantity of LP to remove from pool
    @param minTokensRec Minimum quantity of tokens to receive
    @param swapTargets Execution targets for swaps
    @param swapData DEX swap data
    @param affiliate Affiliate address
    @param shouldSellEntireBalance If True transfers entrire allowable amount from another contract
    */
    function ZapOut(
        address toTokenAddress,
        address fromPoolAddress,
        uint256 incomingLP,
        uint256 minTokensRec,
        address[] memory swapTargets,
        bytes[] memory swapData,
        address affiliate,
        bool shouldSellEntireBalance
    ) public stopInEmergency returns (uint256 tokensRec) {
        (uint256 amount0, uint256 amount1) =
            _removeLiquidity(
                fromPoolAddress,
                incomingLP,
                shouldSellEntireBalance
            );

        //swaps tokens to token
        tokensRec = _swapTokens(
            fromPoolAddress,
            amount0,
            amount1,
            toTokenAddress,
            swapTargets,
            swapData
        );
        require(tokensRec >= minTokensRec, "High Slippage");

        uint256 totalGoodwillPortion;

        // transfer toTokens to sender
        if (toTokenAddress == address(0)) {
            totalGoodwillPortion = _subtractGoodwill(
                ETHAddress,
                tokensRec,
                affiliate,
                true
            );

            payable(msg.sender).transfer(tokensRec - totalGoodwillPortion);
        } else {
            totalGoodwillPortion = _subtractGoodwill(
                toTokenAddress,
                tokensRec,
                affiliate,
                true
            );

            IERC20(toTokenAddress).safeTransfer(
                msg.sender,
                tokensRec - totalGoodwillPortion
            );
        }

        tokensRec = tokensRec - totalGoodwillPortion;

        emit zapOut(msg.sender, fromPoolAddress, toTokenAddress, tokensRec);

        return tokensRec;
    }

    /**
    @notice Zap out in both tokens with permit
    @param fromPoolAddress Pool from which to remove liquidity
    @param incomingLP Quantity of LP to remove from pool
    @param affiliate Affiliate address to share fees
    @param permitSig Signature for permit
    @return amountA Quantity of tokenA received
    @return amountB Quantity of tokenB received
    */
    function ZapOut2PairTokenWithPermit(
        address fromPoolAddress,
        uint256 incomingLP,
        address affiliate,
        bytes calldata permitSig
    ) external stopInEmergency returns (uint256 amountA, uint256 amountB) {
        // permit
        _permit(fromPoolAddress, permitAllowance, permitSig);

        (amountA, amountB) = ZapOut2PairToken(
            fromPoolAddress,
            incomingLP,
            affiliate
        );
    }

    /**
    @notice Zap out in a single token with permit
    @param toTokenAddress Address of desired token
    @param fromPoolAddress Pool from which to remove liquidity
    @param incomingLP Quantity of LP to remove from pool
    @param minTokensRec Minimum quantity of tokens to receive
    @param swapTargets Execution targets for swaps
    @param swapData DEX swap data
    @param affiliate Affiliate address
    */
    function ZapOutWithPermit(
        address toTokenAddress,
        address fromPoolAddress,
        uint256 incomingLP,
        uint256 minTokensRec,
        bytes calldata permitSig,
        address[] memory swapTargets,
        bytes[] memory swapData,
        address affiliate
    ) public stopInEmergency returns (uint256) {
        // permit
        _permit(fromPoolAddress, permitAllowance, permitSig);

        return (
            ZapOut(
                toTokenAddress,
                fromPoolAddress,
                incomingLP,
                minTokensRec,
                swapTargets,
                swapData,
                affiliate,
                false
            )
        );
    }

    function _permit(
        address fromPoolAddress,
        uint256 amountIn,
        bytes memory permitSig
    ) internal {
        require(permitSig.length == 65, "Invalid signature length");

        bytes32 r;
        bytes32 s;
        uint8 v;
        assembly {
            r := mload(add(permitSig, 32))
            s := mload(add(permitSig, 64))
            v := byte(0, mload(add(permitSig, 96)))
        }
        IUniswapV2Pair(fromPoolAddress).permit(
            msg.sender,
            address(this),
            amountIn,
            deadline,
            v,
            r,
            s
        );
    }

    function _removeLiquidity(
        address fromPoolAddress,
        uint256 incomingLP,
        bool shouldSellEntireBalance
    ) internal returns (uint256 amount0, uint256 amount1) {
        IUniswapV2Pair pair = IUniswapV2Pair(fromPoolAddress);

        require(address(pair) != address(0), "Pool Cannot be Zero Address");

        address token0 = pair.token0();
        address token1 = pair.token1();

        _pullTokens(fromPoolAddress, incomingLP, shouldSellEntireBalance);

        _approveToken(fromPoolAddress, address(sushiswapRouter), incomingLP);

        (amount0, amount1) = sushiswapRouter.removeLiquidity(
            token0,
            token1,
            incomingLP,
            1,
            1,
            address(this),
            deadline
        );
        require(amount0 > 0 && amount1 > 0, "Removed Insufficient Liquidity");
    }

    function _swapTokens(
        address fromPoolAddress,
        uint256 amount0,
        uint256 amount1,
        address toToken,
        address[] memory swapTargets,
        bytes[] memory swapData
    ) internal returns (uint256 tokensBought) {
        address token0 = IUniswapV2Pair(fromPoolAddress).token0();
        address token1 = IUniswapV2Pair(fromPoolAddress).token1();

        //swap token0 to toToken
        if (token0 == toToken) {
            tokensBought = tokensBought + amount0;
        } else {
            //swap token using 0x swap
            tokensBought =
                tokensBought +
                _fillQuote(
                    token0,
                    toToken,
                    amount0,
                    swapTargets[0],
                    swapData[0]
                );
        }

        //swap token1 to toToken
        if (token1 == toToken) {
            tokensBought = tokensBought + amount1;
        } else {
            //swap token using 0x swap
            tokensBought =
                tokensBought +
                _fillQuote(
                    token1,
                    toToken,
                    amount1,
                    swapTargets[1],
                    swapData[1]
                );
        }
    }

    function _fillQuote(
        address fromTokenAddress,
        address toToken,
        uint256 amount,
        address swapTarget,
        bytes memory swapData
    ) internal returns (uint256) {
        if (fromTokenAddress == wethTokenAddress && toToken == address(0)) {
            IWETH(wethTokenAddress).withdraw(amount);
            return amount;
        }

        uint256 valueToSend;
        if (fromTokenAddress == address(0)) {
            valueToSend = amount;
        } else {
            _approveToken(fromTokenAddress, swapTarget, amount);
        }

        uint256 initialBalance = _getBalance(toToken);

        require(approvedTargets[swapTarget], "Target not Authorized");
        (bool success, ) = swapTarget.call{ value: valueToSend }(swapData);
        require(success, "Error Swapping Tokens");

        uint256 finalBalance = _getBalance(toToken) - initialBalance;

        require(finalBalance > 0, "Swapped to Invalid Intermediate");

        return finalBalance;
    }

    /**
        @notice Utility function to determine quantity and addresses of tokens being removed
        @param fromPoolAddress Pool from which to remove liquidity
        @param liquidity Quantity of LP tokens to remove.
        @return amountA Quantity of tokenA removed
        @return amountB Quantity of tokenB removed
        @return token0 Address of the underlying token to be removed
        @return token1 Address of the underlying token to be removed
    */
    function removeLiquidityReturn(address fromPoolAddress, uint256 liquidity)
        external
        view
        returns (
            uint256 amountA,
            uint256 amountB,
            address token0,
            address token1
        )
    {
        IUniswapV2Pair pair = IUniswapV2Pair(fromPoolAddress);
        token0 = pair.token0();
        token1 = pair.token1();

        uint256 balance0 = IERC20(token0).balanceOf(fromPoolAddress);
        uint256 balance1 = IERC20(token1).balanceOf(fromPoolAddress);

        uint256 _totalSupply = pair.totalSupply();

        amountA = (liquidity * balance0) / _totalSupply;
        amountB = (liquidity * balance1) / _totalSupply;
    }
}

File 2 of 8 : ZapBaseV2.sol
// SPDX-License-Identifier: GPL-2.0
pragma solidity ^0.8.0;

import "../oz/0.8.0/access/Ownable.sol";
import "../oz/0.8.0/token/ERC20/utils/SafeERC20.sol";

abstract contract ZapBaseV2 is Ownable {
    using SafeERC20 for IERC20;
    bool public stopped = false;

    // if true, goodwill is not deducted
    mapping(address => bool) public feeWhitelist;

    uint256 public goodwill;
    // % share of goodwill (0-100 %)
    uint256 affiliateSplit;
    // restrict affiliates
    mapping(address => bool) public affiliates;
    // affiliate => token => amount
    mapping(address => mapping(address => uint256)) public affiliateBalance;
    // token => amount
    mapping(address => uint256) public totalAffiliateBalance;
    // swapTarget => approval status
    mapping(address => bool) public approvedTargets;

    address internal constant ETHAddress =
        0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    constructor(uint256 _goodwill, uint256 _affiliateSplit) {
        goodwill = _goodwill;
        affiliateSplit = _affiliateSplit;
    }

    // circuit breaker modifiers
    modifier stopInEmergency {
        if (stopped) {
            revert("Temporarily Paused");
        } else {
            _;
        }
    }

    function _getBalance(address token)
        internal
        view
        returns (uint256 balance)
    {
        if (token == address(0)) {
            balance = address(this).balance;
        } else {
            balance = IERC20(token).balanceOf(address(this));
        }
    }

    function _approveToken(address token, address spender) internal {
        IERC20 _token = IERC20(token);
        if (_token.allowance(address(this), spender) > 0) return;
        else {
            _token.safeApprove(spender, type(uint256).max);
        }
    }

    function _approveToken(
        address token,
        address spender,
        uint256 amount
    ) internal {
        IERC20(token).safeApprove(spender, 0);
        IERC20(token).safeApprove(spender, amount);
    }

    // - to Pause the contract
    function toggleContractActive() public onlyOwner {
        stopped = !stopped;
    }

    function set_feeWhitelist(address zapAddress, bool status)
        external
        onlyOwner
    {
        feeWhitelist[zapAddress] = status;
    }

    function set_new_goodwill(uint256 _new_goodwill) public onlyOwner {
        require(
            _new_goodwill >= 0 && _new_goodwill <= 100,
            "GoodWill Value not allowed"
        );
        goodwill = _new_goodwill;
    }

    function set_new_affiliateSplit(uint256 _new_affiliateSplit)
        external
        onlyOwner
    {
        require(
            _new_affiliateSplit <= 100,
            "Affiliate Split Value not allowed"
        );
        affiliateSplit = _new_affiliateSplit;
    }

    function set_affiliate(address _affiliate, bool _status)
        external
        onlyOwner
    {
        affiliates[_affiliate] = _status;
    }

    ///@notice Withdraw goodwill share, retaining affilliate share
    function withdrawTokens(address[] calldata tokens) external onlyOwner {
        for (uint256 i = 0; i < tokens.length; i++) {
            uint256 qty;

            if (tokens[i] == ETHAddress) {
                qty = address(this).balance - totalAffiliateBalance[tokens[i]];

                Address.sendValue(payable(owner()), qty);
            } else {
                qty =
                    IERC20(tokens[i]).balanceOf(address(this)) -
                    totalAffiliateBalance[tokens[i]];
                IERC20(tokens[i]).safeTransfer(owner(), qty);
            }
        }
    }

    ///@notice Withdraw affilliate share, retaining goodwill share
    function affilliateWithdraw(address[] calldata tokens) external {
        uint256 tokenBal;
        for (uint256 i = 0; i < tokens.length; i++) {
            tokenBal = affiliateBalance[msg.sender][tokens[i]];
            affiliateBalance[msg.sender][tokens[i]] = 0;
            totalAffiliateBalance[tokens[i]] =
                totalAffiliateBalance[tokens[i]] -
                tokenBal;

            if (tokens[i] == ETHAddress) {
                Address.sendValue(payable(msg.sender), tokenBal);
            } else {
                IERC20(tokens[i]).safeTransfer(msg.sender, tokenBal);
            }
        }
    }

    function setApprovedTargets(
        address[] calldata targets,
        bool[] calldata isApproved
    ) external onlyOwner {
        require(targets.length == isApproved.length, "Invalid Input length");

        for (uint256 i = 0; i < targets.length; i++) {
            approvedTargets[targets[i]] = isApproved[i];
        }
    }

    receive() external payable {
        require(msg.sender != tx.origin, "Do not send ETH directly");
    }
}

File 3 of 8 : ZapOutBaseV3.sol
// SPDX-License-Identifier: GPL-2.0

pragma solidity ^0.8.0;
import "./ZapBaseV2.sol";

abstract contract ZapOutBaseV3 is ZapBaseV2 {
    using SafeERC20 for IERC20;

    /**
        @dev Transfer tokens from msg.sender to this contract
        @param token The ERC20 token to transfer to this contract
        @param shouldSellEntireBalance If True transfers entrire allowable amount from another contract
        @return Quantity of tokens transferred to this contract
     */
    function _pullTokens(
        address token,
        uint256 amount,
        bool shouldSellEntireBalance
    ) internal returns (uint256) {
        if (shouldSellEntireBalance) {
            require(
                Address.isContract(msg.sender),
                "ERR: shouldSellEntireBalance is true for EOA"
            );

            uint256 allowance =
                IERC20(token).allowance(msg.sender, address(this));
            IERC20(token).safeTransferFrom(
                msg.sender,
                address(this),
                allowance
            );

            return allowance;
        } else {
            IERC20(token).safeTransferFrom(msg.sender, address(this), amount);

            return amount;
        }
    }

    function _subtractGoodwill(
        address token,
        uint256 amount,
        address affiliate,
        bool enableGoodwill
    ) internal returns (uint256 totalGoodwillPortion) {
        bool whitelisted = feeWhitelist[msg.sender];
        if (enableGoodwill && !whitelisted && goodwill > 0) {
            totalGoodwillPortion = (amount * goodwill) / 10000;

            if (affiliates[affiliate]) {
                if (token == address(0)) {
                    token = ETHAddress;
                }

                uint256 affiliatePortion =
                    (totalGoodwillPortion * affiliateSplit) / 100;
                affiliateBalance[affiliate][token] += affiliatePortion;
                totalAffiliateBalance[token] += affiliatePortion;
            }
        }
    }
}

File 4 of 8 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(
        address indexed previousOwner,
        address indexed newOwner
    );

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(
            newOwner != address(0),
            "Ownable: new owner is the zero address"
        );
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 5 of 8 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
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);

    /**
     * @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
    );
}

File 6 of 8 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(
            token,
            abi.encodeWithSelector(token.transfer.selector, to, value)
        );
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(
            token,
            abi.encodeWithSelector(token.transferFrom.selector, from, to, value)
        );
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(
            token,
            abi.encodeWithSelector(token.approve.selector, spender, value)
        );
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(
            token,
            abi.encodeWithSelector(
                token.approve.selector,
                spender,
                newAllowance
            )
        );
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(
                oldAllowance >= value,
                "SafeERC20: decreased allowance below zero"
            );
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(
                token,
                abi.encodeWithSelector(
                    token.approve.selector,
                    spender,
                    newAllowance
                )
            );
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata =
            address(token).functionCall(
                data,
                "SafeERC20: low-level call failed"
            );
        if (returndata.length > 0) {
            // Return data is optional
            // solhint-disable-next-line max-line-length
            require(
                abi.decode(returndata, (bool)),
                "SafeERC20: ERC20 operation did not succeed"
            );
        }
    }
}

File 7 of 8 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(
            address(this).balance >= amount,
            "Address: insufficient balance"
        );

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(
            success,
            "Address: unable to send value, recipient may have reverted"
        );
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data)
        internal
        returns (bytes memory)
    {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return
            functionCallWithValue(
                target,
                data,
                value,
                "Address: low-level call with value failed"
            );
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(
            address(this).balance >= value,
            "Address: insufficient balance for call"
        );
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) =
            target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data)
        internal
        view
        returns (bytes memory)
    {
        return
            functionStaticCall(
                target,
                data,
                "Address: low-level static call failed"
            );
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data)
        internal
        returns (bytes memory)
    {
        return
            functionDelegateCall(
                target,
                data,
                "Address: low-level delegate call failed"
            );
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) private pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 8 of 8 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

Settings
{
  "evmVersion": "istanbul",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"_goodwill","type":"uint256"},{"internalType":"uint256","name":"_affiliateSplit","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"pool","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokensRec","type":"uint256"}],"name":"zapOut","type":"event"},{"inputs":[{"internalType":"address","name":"toTokenAddress","type":"address"},{"internalType":"address","name":"fromPoolAddress","type":"address"},{"internalType":"uint256","name":"incomingLP","type":"uint256"},{"internalType":"uint256","name":"minTokensRec","type":"uint256"},{"internalType":"address[]","name":"swapTargets","type":"address[]"},{"internalType":"bytes[]","name":"swapData","type":"bytes[]"},{"internalType":"address","name":"affiliate","type":"address"},{"internalType":"bool","name":"shouldSellEntireBalance","type":"bool"}],"name":"ZapOut","outputs":[{"internalType":"uint256","name":"tokensRec","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromPoolAddress","type":"address"},{"internalType":"uint256","name":"incomingLP","type":"uint256"},{"internalType":"address","name":"affiliate","type":"address"}],"name":"ZapOut2PairToken","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromPoolAddress","type":"address"},{"internalType":"uint256","name":"incomingLP","type":"uint256"},{"internalType":"address","name":"affiliate","type":"address"},{"internalType":"bytes","name":"permitSig","type":"bytes"}],"name":"ZapOut2PairTokenWithPermit","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"toTokenAddress","type":"address"},{"internalType":"address","name":"fromPoolAddress","type":"address"},{"internalType":"uint256","name":"incomingLP","type":"uint256"},{"internalType":"uint256","name":"minTokensRec","type":"uint256"},{"internalType":"bytes","name":"permitSig","type":"bytes"},{"internalType":"address[]","name":"swapTargets","type":"address[]"},{"internalType":"bytes[]","name":"swapData","type":"bytes[]"},{"internalType":"address","name":"affiliate","type":"address"}],"name":"ZapOutWithPermit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"affiliateBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"affiliates","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"affilliateWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"approvedTargets","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"feeWhitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"goodwill","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"fromPoolAddress","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"}],"name":"removeLiquidityReturn","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"},{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"targets","type":"address[]"},{"internalType":"bool[]","name":"isApproved","type":"bool[]"}],"name":"setApprovedTargets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_affiliate","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"set_affiliate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"zapAddress","type":"address"},{"internalType":"bool","name":"status","type":"bool"}],"name":"set_feeWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_new_affiliateSplit","type":"uint256"}],"name":"set_new_affiliateSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_new_goodwill","type":"uint256"}],"name":"set_new_goodwill","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stopped","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleContractActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalAffiliateBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"withdrawTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040526000805460ff60a01b191690553480156200001e57600080fd5b5060405162003271380380620032718339810160408190526200004191620000e0565b600080546001600160a01b03191633908117825560405184928492918291907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600291909155600355505073def1c0ded9bec7f1a1670819833240f027b25eff60005260076020527ff6019cd1944dc466e824190b288e5a63528dd4c9a6d8cbd707956fd30d2f1e0d805460ff1916600117905562000104565b60008060408385031215620000f3578182fd5b505080516020909101519092909150565b61315d80620001146000396000f3fe6080604052600436106101445760003560e01c8063715018a6116100b65780639779d1a61161006f5780639779d1a614610435578063cfd7789c14610465578063d408f6571461049a578063f21d3ab5146104ca578063f2fde38b146104ea578063fbec27bf1461050a57600080fd5b8063715018a61461034857806375f12b211461035d5780637ee992831461037e5780638da5cb5b146103cd57806391027c5b146103f55780639735a6341461041557600080fd5b8063247482ba11610108578063247482ba146102725780633ff428c7146102925780634f51e294146102b2578063550bfa56146102f25780635de0398e146103125780635ecb16cd1461032857600080fd5b806301e980d4146101a55780630dc9de85146101c55780631385d24c146101e55780631781261f146101fa57806318b135e31461024557600080fd5b366101a0573332141561019e5760405162461bcd60e51b815260206004820152601860248201527f446f206e6f742073656e6420455448206469726563746c79000000000000000060448201526064015b60405180910390fd5b005b600080fd5b3480156101b157600080fd5b5061019e6101c0366004612e5e565b61052a565b3480156101d157600080fd5b5061019e6101e0366004612d7d565b6105b4565b3480156101f157600080fd5b5061019e61080f565b34801561020657600080fd5b50610232610215366004612aab565b600560209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b34801561025157600080fd5b50610232610260366004612a73565b60066020526000908152604090205481565b34801561027e57600080fd5b5061023261028d366004612ae3565b61085a565b34801561029e57600080fd5b5061019e6102ad366004612c73565b6109dc565b3480156102be57600080fd5b506102e26102cd366004612a73565b60046020526000908152604090205460ff1681565b604051901515815260200161023c565b3480156102fe57600080fd5b5061019e61030d366004612e5e565b610a31565b34801561031e57600080fd5b5061023260025481565b34801561033457600080fd5b5061019e610343366004612d7d565b610ab1565b34801561035457600080fd5b5061019e610d22565b34801561036957600080fd5b506000546102e290600160a01b900460ff1681565b34801561038a57600080fd5b5061039e610399366004612ca0565b610d96565b6040805194855260208501939093526001600160a01b039182169284019290925216606082015260800161023c565b3480156103d957600080fd5b506000546040516001600160a01b03909116815260200161023c565b34801561040157600080fd5b50610232610410366004612ba4565b611035565b34801561042157600080fd5b5061019e610430366004612dbd565b6110cc565b34801561044157600080fd5b506102e2610450366004612a73565b60076020526000908152604090205460ff1681565b34801561047157600080fd5b50610485610480366004612d0c565b6111f6565b6040805192835260208301919091520161023c565b3480156104a657600080fd5b506102e26104b5366004612a73565b60016020526000908152604090205460ff1681565b3480156104d657600080fd5b506104856104e5366004612ccb565b611289565b3480156104f657600080fd5b5061019e610505366004612a73565b611742565b34801561051657600080fd5b5061019e610525366004612c73565b61182c565b6000546001600160a01b031633146105545760405162461bcd60e51b815260040161019590612f96565b60648111156105af5760405162461bcd60e51b815260206004820152602160248201527f416666696c696174652053706c69742056616c7565206e6f7420616c6c6f77656044820152601960fa1b6064820152608401610195565b600355565b6000805b8281101561080957336000908152600560205260408120908585848181106105f057634e487b7160e01b600052603260045260246000fd5b90506020020160208101906106059190612a73565b6001600160a01b0316815260208082019290925260409081016000908120543382526005909352908120919350908186868581811061065457634e487b7160e01b600052603260045260246000fd5b90506020020160208101906106699190612a73565b6001600160a01b03166001600160a01b031681526020019081526020016000208190555081600660008686858181106106b257634e487b7160e01b600052603260045260246000fd5b90506020020160208101906106c79190612a73565b6001600160a01b03166001600160a01b03168152602001908152602001600020546106f29190613077565b6006600086868581811061071657634e487b7160e01b600052603260045260246000fd5b905060200201602081019061072b9190612a73565b6001600160a01b0316815260208101919091526040016000205573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee84848381811061077a57634e487b7160e01b600052603260045260246000fd5b905060200201602081019061078f9190612a73565b6001600160a01b031614156107ad576107a83383611881565b6107f7565b6107f733838686858181106107d257634e487b7160e01b600052603260045260246000fd5b90506020020160208101906107e79190612a73565b6001600160a01b0316919061199a565b80610801816130ba565b9150506105b8565b50505050565b6000546001600160a01b031633146108395760405162461bcd60e51b815260040161019590612f96565b6000805460ff60a01b198116600160a01b9182900460ff1615909102179055565b60008054600160a01b900460ff16156108855760405162461bcd60e51b815260040161019590612f6a565b6000806108938a8a866119fd565b915091506108a58a83838e8b8b611c70565b9250878310156108e75760405162461bcd60e51b815260206004820152600d60248201526c4869676820536c69707061676560981b6044820152606401610195565b60006001600160a01b038c166109565761091873eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee85886001611e84565b9050336108fc6109288387613077565b6040518115909202916000818181858888f19350505050158015610950573d6000803e3d6000fd5b50610984565b6109638c85886001611e84565b9050610984336109738387613077565b6001600160a01b038f16919061199a565b61098e8185613077565b93507ff2d3e32195f8631c70e1d996c9bd5d4a3369d0580786dcd662bf13139310355d338c8e876040516109c59493929190612ecd565b60405180910390a150505098975050505050505050565b6000546001600160a01b03163314610a065760405162461bcd60e51b815260040161019590612f96565b6001600160a01b03919091166000908152600460205260409020805460ff1916911515919091179055565b6000546001600160a01b03163314610a5b5760405162461bcd60e51b815260040161019590612f96565b6064811115610aac5760405162461bcd60e51b815260206004820152601a60248201527f476f6f6457696c6c2056616c7565206e6f7420616c6c6f7765640000000000006044820152606401610195565b600255565b6000546001600160a01b03163314610adb5760405162461bcd60e51b815260040161019590612f96565b60005b81811015610d1d57600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee848484818110610b1d57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610b329190612a73565b6001600160a01b03161415610bc05760066000858585818110610b6557634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610b7a9190612a73565b6001600160a01b03168152602081019190915260400160002054610b9e9047613077565b9050610bbb610bb56000546001600160a01b031690565b82611881565b610d0a565b60066000858585818110610be457634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610bf99190612a73565b6001600160a01b03166001600160a01b0316815260200190815260200160002054848484818110610c3a57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610c4f9190612a73565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b158015610c9057600080fd5b505afa158015610ca4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc89190612e76565b610cd29190613077565b9050610d0a610ce96000546001600160a01b031690565b828686868181106107d257634e487b7160e01b600052603260045260246000fd5b5080610d15816130ba565b915050610ade565b505050565b6000546001600160a01b03163314610d4c5760405162461bcd60e51b815260040161019590612f96565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000806000806000869050806001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015610dda57600080fd5b505afa158015610dee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e129190612a8f565b9250806001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b158015610e4d57600080fd5b505afa158015610e61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e859190612a8f565b6040516370a0823160e01b81526001600160a01b0389811660048301529193506000918516906370a082319060240160206040518083038186803b158015610ecc57600080fd5b505afa158015610ee0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f049190612e76565b6040516370a0823160e01b81526001600160a01b038a811660048301529192506000918516906370a082319060240160206040518083038186803b158015610f4b57600080fd5b505afa158015610f5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f839190612e76565b90506000836001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610fc057600080fd5b505afa158015610fd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff89190612e76565b905080611005848b613058565b61100f9190613038565b97508061101c838b613058565b6110269190613038565b96505050505092959194509250565b60008054600160a01b900460ff16156110605760405162461bcd60e51b815260040161019590612f6a565b6110ad896bfffffffffff096fb4da2000088888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611faf92505050565b6110be8a8a8a8a888888600061085a565b9a9950505050505050505050565b6000546001600160a01b031633146110f65760405162461bcd60e51b815260040161019590612f96565b82811461113c5760405162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c84092dce0eae840d8cadccee8d60631b6044820152606401610195565b60005b838110156111ef5782828281811061116757634e487b7160e01b600052603260045260246000fd5b905060200201602081019061117c9190612e26565b600760008787858181106111a057634e487b7160e01b600052603260045260246000fd5b90506020020160208101906111b59190612a73565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055806111e7816130ba565b91505061113f565b5050505050565b600080548190600160a01b900460ff16156112235760405162461bcd60e51b815260040161019590612f6a565b611270876bfffffffffff096fb4da2000086868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611faf92505050565b61127b878787611289565b909890975095505050505050565b600080548190600160a01b900460ff16156112b65760405162461bcd60e51b815260040161019590612f6a565b846001600160a01b03811661130d5760405162461bcd60e51b815260206004820152601b60248201527f506f6f6c2043616e6e6f74206265205a65726f204164647265737300000000006044820152606401610195565b6000816001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561134857600080fd5b505afa15801561135c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113809190612a8f565b90506000826001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156113bd57600080fd5b505afa1580156113d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f59190612a8f565b905061140c6001600160a01b03891633308a6120a4565b61142b8873d9e1ce17f2641f24ae83637ab66a2cca9c378b9f896120dc565b6001600160a01b03821673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2148061147257506001600160a01b03811673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2145b156115cd5760006001600160a01b03831673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2146114a357826114a5565b815b604051629d473b60e21b81526001600160a01b0382166004820152602481018a90526001604482018190526064820152306084820152600f60fc1b60a482015290915073d9e1ce17f2641f24ae83637ab66a2cca9c378b9f906302751cec9060c4016040805180830381600087803b15801561152057600080fd5b505af1158015611534573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115589190612e8e565b9096509450600061156c82888a6001611e84565b9050600061159173eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee888b6001611e84565b90506115b2336115a1848b613077565b6001600160a01b038616919061199a565b6115c5336115c0838a613077565b611881565b5050506116bd565b604051635d5155ef60e11b815273d9e1ce17f2641f24ae83637ab66a2cca9c378b9f9063baa2abde9061161590859085908c9060019081903090600f60fc1b90600401612ef7565b6040805180830381600087803b15801561162e57600080fd5b505af1158015611642573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116669190612e8e565b9095509350600061167a8387896001611e84565b9050600061168b83878a6001611e84565b90506116ac3361169b848a613077565b6001600160a01b038716919061199a565b6116ba336115a18389613077565b50505b7ff2d3e32195f8631c70e1d996c9bd5d4a3369d0580786dcd662bf13139310355d338984886040516116f29493929190612ecd565b60405180910390a17ff2d3e32195f8631c70e1d996c9bd5d4a3369d0580786dcd662bf13139310355d3389838760405161172f9493929190612ecd565b60405180910390a1505050935093915050565b6000546001600160a01b0316331461176c5760405162461bcd60e51b815260040161019590612f96565b6001600160a01b0381166117d15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610195565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146118565760405162461bcd60e51b815260040161019590612f96565b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b804710156118d15760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610195565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461191e576040519150601f19603f3d011682016040523d82523d6000602084013e611923565b606091505b5050905080610d1d5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610195565b6040516001600160a01b038316602482015260448101829052610d1d90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612105565b600080846001600160a01b038116611a575760405162461bcd60e51b815260206004820152601b60248201527f506f6f6c2043616e6e6f74206265205a65726f204164647265737300000000006044820152606401610195565b6000816001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015611a9257600080fd5b505afa158015611aa6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aca9190612a8f565b90506000826001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b158015611b0757600080fd5b505afa158015611b1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b3f9190612a8f565b9050611b4c8888886121d7565b50611b6c8873d9e1ce17f2641f24ae83637ab66a2cca9c378b9f896120dc565b604051635d5155ef60e11b815273d9e1ce17f2641f24ae83637ab66a2cca9c378b9f9063baa2abde90611bb490859085908c9060019081903090600f60fc1b90600401612ef7565b6040805180830381600087803b158015611bcd57600080fd5b505af1158015611be1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c059190612e8e565b90955093508415801590611c195750600084115b611c655760405162461bcd60e51b815260206004820152601e60248201527f52656d6f76656420496e73756666696369656e74204c697175696469747900006044820152606401610195565b505050935093915050565b600080876001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015611cac57600080fd5b505afa158015611cc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ce49190612a8f565b90506000886001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b158015611d2157600080fd5b505afa158015611d35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d599190612a8f565b9050856001600160a01b0316826001600160a01b03161415611d8657611d7f8884613020565b9250611df0565b611de382878a88600081518110611dad57634e487b7160e01b600052603260045260246000fd5b602002602001015188600081518110611dd657634e487b7160e01b600052603260045260246000fd5b60200260200101516122ff565b611ded9084613020565b92505b856001600160a01b0316816001600160a01b03161415611e1b57611e148784613020565b9250611e78565b611e6b81878988600181518110611e4257634e487b7160e01b600052603260045260246000fd5b602002602001015188600181518110611dd657634e487b7160e01b600052603260045260246000fd5b611e759084613020565b92505b50509695505050505050565b3360009081526001602052604081205460ff16828015611ea2575080155b8015611eb057506000600254115b15611fa65761271060025486611ec69190613058565b611ed09190613038565b6001600160a01b03851660009081526004602052604090205490925060ff1615611fa6576001600160a01b038616611f1a5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee95505b6000606460035484611f2c9190613058565b611f369190613038565b6001600160a01b038087166000908152600560209081526040808320938c16835292905290812080549293508392909190611f72908490613020565b90915550506001600160a01b03871660009081526006602052604081208054839290611f9f908490613020565b9091555050505b50949350505050565b80516041146120005760405162461bcd60e51b815260206004820152601860248201527f496e76616c6964207369676e6174757265206c656e67746800000000000000006044820152606401610195565b60208101516040808301516060840151915163d505accf60e01b815233600482015230602482015260448101869052600f60fc1b606482015260009290921a6084830181905260a4830184905260c4830182905290916001600160a01b0387169063d505accf9060e401600060405180830381600087803b15801561208457600080fd5b505af1158015612098573d6000803e3d6000fd5b50505050505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526108099085906323b872dd60e01b906084016119c6565b6120f16001600160a01b038416836000612553565b610d1d6001600160a01b0384168383612553565b600061215a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166126779092919063ffffffff16565b805190915015610d1d57808060200190518101906121789190612e42565b610d1d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610195565b600081156122e057333b6122425760405162461bcd60e51b815260206004820152602c60248201527f4552523a2073686f756c6453656c6c456e7469726542616c616e63652069732060448201526b7472756520666f7220454f4160a01b6064820152608401610195565b604051636eb1769f60e11b81523360048201523060248201526000906001600160a01b0386169063dd62ed3e9060440160206040518083038186803b15801561228a57600080fd5b505afa15801561229e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c29190612e76565b90506122d96001600160a01b0386163330846120a4565b90506122f8565b6122f56001600160a01b0385163330866120a4565b50815b9392505050565b60006001600160a01b03861673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214801561233457506001600160a01b038516155b156123a657604051632e1a7d4d60e01b81526004810185905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d90602401600060405180830381600087803b15801561238657600080fd5b505af115801561239a573d6000803e3d6000fd5b5050505083905061254a565b60006001600160a01b0387166123bd5750836123c8565b6123c88785876120dc565b60006123d38761268e565b6001600160a01b03861660009081526007602052604090205490915060ff166124365760405162461bcd60e51b815260206004820152601560248201527415185c99d95d081b9bdd08105d5d1a1bdc9a5e9959605a1b6044820152606401610195565b6000856001600160a01b031683866040516124519190612eb1565b60006040518083038185875af1925050503d806000811461248e576040519150601f19603f3d011682016040523d82523d6000602084013e612493565b606091505b50509050806124dc5760405162461bcd60e51b81526020600482015260156024820152744572726f72205377617070696e6720546f6b656e7360581b6044820152606401610195565b6000826124e88a61268e565b6124f29190613077565b9050600081116125445760405162461bcd60e51b815260206004820152601f60248201527f5377617070656420746f20496e76616c696420496e7465726d656469617465006044820152606401610195565b93505050505b95945050505050565b8015806125dc5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b1580156125a257600080fd5b505afa1580156125b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125da9190612e76565b155b6126475760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610195565b6040516001600160a01b038316602482015260448101829052610d1d90849063095ea7b360e01b906064016119c6565b60606126868484600085612724565b949350505050565b60006001600160a01b0382166126a5575047919050565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a082319060240160206040518083038186803b1580156126e457600080fd5b505afa1580156126f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061271c9190612e76565b90505b919050565b6060824710156127855760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610195565b843b6127d35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610195565b600080866001600160a01b031685876040516127ef9190612eb1565b60006040518083038185875af1925050503d806000811461282c576040519150601f19603f3d011682016040523d82523d6000602084013e612831565b606091505b509150915061284182828661284c565b979650505050505050565b6060831561285b5750816122f8565b82511561286b5782518084602001fd5b8160405162461bcd60e51b81526004016101959190612f37565b803561271f81613101565b60008083601f8401126128a1578182fd5b50813567ffffffffffffffff8111156128b8578182fd5b6020830191508360208260051b85010111156128d357600080fd5b9250929050565b600082601f8301126128ea578081fd5b813560206128ff6128fa83612ffc565b612fcb565b80838252828201915082860187848660051b890101111561291e578586fd5b855b8581101561294557813561293381613101565b84529284019290840190600101612920565b5090979650505050505050565b6000601f8381840112612963578182fd5b823560206129736128fa83612ffc565b80838252828201915082870188848660051b8a01011115612992578687fd5b865b85811015612a2557813567ffffffffffffffff808211156129b357898afd5b818b0191508b603f8301126129c657898afd5b868201356040828211156129dc576129dc6130eb565b6129ed828c01601f19168a01612fcb565b92508183528d81838601011115612a02578b8cfd5b818185018a85013750810187018a90528552509284019290840190600101612994565b509098975050505050505050565b60008083601f840112612a44578182fd5b50813567ffffffffffffffff811115612a5b578182fd5b6020830191508360208285010111156128d357600080fd5b600060208284031215612a84578081fd5b81356122f881613101565b600060208284031215612aa0578081fd5b81516122f881613101565b60008060408385031215612abd578081fd5b8235612ac881613101565b91506020830135612ad881613101565b809150509250929050565b600080600080600080600080610100898b031215612aff578384fd5b8835612b0a81613101565b97506020890135612b1a81613101565b96506040890135955060608901359450608089013567ffffffffffffffff80821115612b44578586fd5b612b508c838d016128da565b955060a08b0135915080821115612b65578485fd5b50612b728b828c01612952565b93505060c0890135612b8381613101565b915060e0890135612b9381613119565b809150509295985092959890939650565b60008060008060008060008060006101008a8c031215612bc2578081fd5b612bcb8a612885565b9850612bd960208b01612885565b975060408a0135965060608a0135955060808a013567ffffffffffffffff80821115612c03578283fd5b612c0f8d838e01612a33565b909750955060a08c0135915080821115612c27578283fd5b612c338d838e016128da565b945060c08c0135915080821115612c48578283fd5b50612c558c828d01612952565b925050612c6460e08b01612885565b90509295985092959850929598565b60008060408385031215612c85578182fd5b8235612c9081613101565b91506020830135612ad881613119565b60008060408385031215612cb2578182fd5b8235612cbd81613101565b946020939093013593505050565b600080600060608486031215612cdf578081fd5b8335612cea81613101565b9250602084013591506040840135612d0181613101565b809150509250925092565b600080600080600060808688031215612d23578283fd5b8535612d2e81613101565b9450602086013593506040860135612d4581613101565b9250606086013567ffffffffffffffff811115612d60578182fd5b612d6c88828901612a33565b969995985093965092949392505050565b60008060208385031215612d8f578182fd5b823567ffffffffffffffff811115612da5578283fd5b612db185828601612890565b90969095509350505050565b60008060008060408587031215612dd2578182fd5b843567ffffffffffffffff80821115612de9578384fd5b612df588838901612890565b90965094506020870135915080821115612e0d578384fd5b50612e1a87828801612890565b95989497509550505050565b600060208284031215612e37578081fd5b81356122f881613119565b600060208284031215612e53578081fd5b81516122f881613119565b600060208284031215612e6f578081fd5b5035919050565b600060208284031215612e87578081fd5b5051919050565b60008060408385031215612ea0578182fd5b505080516020909101519092909150565b60008251612ec381846020870161308e565b9190910192915050565b6001600160a01b039485168152928416602084015292166040820152606081019190915260800190565b6001600160a01b039788168152958716602087015260408601949094526060850192909252608084015290921660a082015260c081019190915260e00190565b6020815260008251806020840152612f5681604085016020870161308e565b601f01601f19169190910160400192915050565b60208082526012908201527115195b5c1bdc985c9a5b1e4814185d5cd95960721b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b604051601f8201601f1916810167ffffffffffffffff81118282101715612ff457612ff46130eb565b604052919050565b600067ffffffffffffffff821115613016576130166130eb565b5060051b60200190565b60008219821115613033576130336130d5565b500190565b60008261305357634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615613072576130726130d5565b500290565b600082821015613089576130896130d5565b500390565b60005b838110156130a9578181015183820152602001613091565b838111156108095750506000910152565b60006000198214156130ce576130ce6130d5565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461311657600080fd5b50565b801515811461311657600080fdfea2646970667358221220422163f7e95e2a197c2954bff5c28449b1a7a2b16ad098bc0424b3b8afae1b1764736f6c6343000804003300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _goodwill (uint256): 0
Arg [1] : _affiliateSplit (uint256): 0

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

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.