Contract 0x647965B19280988A75C3a1369938C8927E6c8715

 
Ad
Crypto.com
Txn Hash Method
Block
From
To
Value
0xc86fa5cec65e14a71c289a45ae16909bbfc0470c3f1283d3db6f91afa1c25cf9Zap In129039912021-07-26 20:42:2954 days 20 hrs ago0x1bc6955e458927b30eeeb6dace42887798e69b3b IN  0x647965b19280988a75c3a1369938c8927e6c87152 Ether0.00495990432
0x3b59f0864c72ca487265504831bb47ac3edc35094377f833e33ac6628dc584acZap In128916892021-07-24 22:21:1656 days 18 hrs ago0x514967a0b3a0ab3d82904c18d8dd0be946b535e6 IN  0x647965b19280988a75c3a1369938c8927e6c87150.0024 Ether0.00335722222
0x4d68f14dffbef43307b07f3a167159d9008c19291bfa2705a59a1ba3986343fbZap In128914902021-07-24 21:39:3056 days 19 hrs ago0xf9b37a737d629af0ee96b0435ac11aeb48bfe823 IN  0x647965b19280988a75c3a1369938c8927e6c87150 Ether0.00395969616
0xcd95958c492bf901338442afb84054c0efeef685579e1e4a13f717a480027355Zap In128867112021-07-24 3:52:1357 days 13 hrs ago0xb4c5e785da421294b5d0967df661908c57bf2945 IN  0x647965b19280988a75c3a1369938c8927e6c87150.0024 Ether0.00228901515
0xb7a1e35cf3f907de89173c4ea5f84fb567cd32f3c7e1350b56b3932f912ba8dbZap In128866702021-07-24 3:42:0757 days 13 hrs ago0xcc337d4fd1b1755ee8d8b270ebbb86a1ae908978 IN  0x647965b19280988a75c3a1369938c8927e6c87150.0025 Ether0.00244180816
0x00a750915319b0582c0b728e5ad9ff83ff72be21d394488b6eeebdc33a3a7e20Zap In128832162021-07-23 14:42:2558 days 2 hrs ago0x3f06d634e48bb6411e715fb6d86d900a6bafea62 IN  0x647965b19280988a75c3a1369938c8927e6c87150 Ether0.00450976129
0x0f45c909dfefcf9724b382bf6f6fd24708cc5abdc7b750547ecaa8baa1467ef2Zap In128697852021-07-21 12:27:4360 days 4 hrs agoENS Name erin.eth IN  0x647965b19280988a75c3a1369938c8927e6c87150 Ether0.0055960815
0xa653461f4d17cebe20ce518db0025ae32578c9a7bac22dc0cebd0cc167854799Zap In128599582021-07-19 23:19:4561 days 17 hrs ago0x49f4d0222c880d4780b636662f5f18f572f2f88a IN  0x647965b19280988a75c3a1369938c8927e6c87150 Ether0.00170263511
0xfabab705a6ef6084ed8f4ab8677c799e45cb871240d7a51f83ec313dbd2be765Zap In128575532021-07-19 14:27:0662 days 2 hrs ago0xf7fc288cb288c79c76dec08b8a5db897b85dd5e3 IN  0x647965b19280988a75c3a1369938c8927e6c87150.01 Ether0.00439283329
0x82683005e200ce15c844a1cea3668a3614700873ac9692432279138439715496Zap In128565872021-07-19 10:52:2462 days 6 hrs ago0x7cc78773cf63b47cbbc5aad573ace669d3ab4feb IN  0x647965b19280988a75c3a1369938c8927e6c87150.01 Ether0.00216801616
0x84527573c5173b7fe652c823289d80855b479ad6bd5924aabf21cdeb5aa3aebaZap In128564812021-07-19 10:31:4462 days 6 hrs ago0x290789aed2d6fae51191bce9cce498d0c336dd89 IN  0x647965b19280988a75c3a1369938c8927e6c87150 Ether0.00223086618
0x84f0644a94e1dc511783b07795dec7ba5ffb12906a85b8a980f5f69ec8332d94Zap In128542222021-07-19 1:56:2862 days 15 hrs ago0x892dc405aa7310dde0fb82318110a3c01f55a246 IN  0x647965b19280988a75c3a1369938c8927e6c87150.028 Ether0.00191448614
0x97f8d72b672bb7cf72f05c53656dd568506efe2cfe582a3cfdeb135d38f09ca5Zap In128538012021-07-19 0:27:3062 days 16 hrs ago0x2477912a8b321b83e07ba04ee6aaf7369a24539a IN  0x647965b19280988a75c3a1369938c8927e6c87150.1 Ether0.0035236526
0xc374a22db50000366ca0e7b49d58c6500851790e9fa5fb9e0404ef92ff2f8253Zap In128470082021-07-17 22:44:4663 days 18 hrs ago0xc6be36e90aa068526680f4e9c1e4f639cf0f5c51 IN  0x647965b19280988a75c3a1369938c8927e6c87150 Ether0.00251656218
0x68c3a4351a04c043d0b81ca54a9e155d377777e950efa4d8bbf889de6b9f5320Zap In128308612021-07-15 9:57:4366 days 7 hrs ago0xcb2855c0fecef8eab1ee82a0fc3358577c317802 IN  0x647965b19280988a75c3a1369938c8927e6c87150.00056 Ether0.0034934926
0x8c37ad80f461ea93bbbd11e4caf67d9c84579bf2a5045e15615e2a3a0d0eeadfZap In128271732021-07-14 20:10:5266 days 21 hrs ago0xfc4f3e893de2a62d62f82f749a15111add6bcfb0 IN  0x647965b19280988a75c3a1369938c8927e6c87150.15 Ether0.00507741333
0xdd5fac1961a1b3c059b9ebc9af5b488b04d08d90b2e450d976c6dafb96574400Zap In128266622021-07-14 18:13:5866 days 22 hrs ago0x487879f338236b992a143f4570913a221261acd7 IN  0x647965b19280988a75c3a1369938c8927e6c87150 Ether0.00810681137
0x76acca6a5395c48fe32491bcbe5edf819e0b469ee3677539f80c5fd032febe29Zap In128259992021-07-14 15:41:1367 days 1 hr ago0x9a75ab1be7a09a825c8b6278ced70115c46a64b5 IN  0x647965b19280988a75c3a1369938c8927e6c87150 Ether0.00793553837
0x7322cbcb6717311ff3947f499e38c180d0b8008a58f9eb7dece48c49fee44bd4Zap In128220882021-07-14 0:56:5067 days 16 hrs agoENS Name digitalradio.eth IN  0x647965b19280988a75c3a1369938c8927e6c87150.26 Ether0.0108372832
0x582f66c7c9c58b219cc209bfefe77ff34f276f405515ac5915545bbc6d0364c8Zap In128170362021-07-13 5:55:3968 days 11 hrs ago0xf3521b4b8ab0d8ca00c745c9848e2b078ab36e60 IN  0x647965b19280988a75c3a1369938c8927e6c87150.0101805 Ether0.00381562525
0x2d44c8ccfa08f574b15665f11d91a0d635ef995cdc80cdbd23a41db3c612ded3Zap In128136192021-07-12 16:49:1969 days 24 mins ago0xf7fc288cb288c79c76dec08b8a5db897b85dd5e3 IN  0x647965b19280988a75c3a1369938c8927e6c87150 Ether0.0076601754
0x71c5e1564cd59944c76c57248934cce3b7cae03d2f5857fb17aef030ba0eebabZap In128114912021-07-12 8:49:0369 days 8 hrs ago0x290789aed2d6fae51191bce9cce498d0c336dd89 IN  0x647965b19280988a75c3a1369938c8927e6c87150.01 Ether0.00216820816
0x1a7980cefecbf103e0a9b1f89ed9a043e3a1f1bab393da0a1ded2b6434af24efZap In128110382021-07-12 7:08:3069 days 10 hrs ago0xdf0c51958d2f7c33eb116a28d15d5c9c009f144e IN  0x647965b19280988a75c3a1369938c8927e6c87150.05 Ether0.0033409211
0xdd3af6255ead3ea2a0c5f1608030617b7b3a78abc11850a8668a506e8a942d6cZap In128108772021-07-12 6:33:2369 days 10 hrs ago0x892dc405aa7310dde0fb82318110a3c01f55a246 IN  0x647965b19280988a75c3a1369938c8927e6c87150.025 Ether0.0010940888
0x52a586e8ca4df3d6dc4afe5d2461dd039995dc3eeef67d8e7c269e780b1cc75cZap In128106152021-07-12 5:38:4969 days 11 hrs ago0x3984a87defa0cf64b337160a1ee2f95723cb4236 IN  0x647965b19280988a75c3a1369938c8927e6c87150.01 Ether0.001562046
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xc86fa5cec65e14a71c289a45ae16909bbfc0470c3f1283d3db6f91afa1c25cf9129039912021-07-26 20:42:2954 days 20 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether2 Ether
0x3b59f0864c72ca487265504831bb47ac3edc35094377f833e33ac6628dc584ac128916892021-07-24 22:21:1656 days 18 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether0.0024 Ether
0xcd95958c492bf901338442afb84054c0efeef685579e1e4a13f717a480027355128867112021-07-24 3:52:1357 days 13 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether0.0024 Ether
0xb7a1e35cf3f907de89173c4ea5f84fb567cd32f3c7e1350b56b3932f912ba8db128866702021-07-24 3:42:0757 days 13 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether0.0025 Ether
0xfabab705a6ef6084ed8f4ab8677c799e45cb871240d7a51f83ec313dbd2be765128575532021-07-19 14:27:0662 days 2 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether0.01 Ether
0x82683005e200ce15c844a1cea3668a3614700873ac9692432279138439715496128565872021-07-19 10:52:2462 days 6 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether0.01 Ether
0x84f0644a94e1dc511783b07795dec7ba5ffb12906a85b8a980f5f69ec8332d94128542222021-07-19 1:56:2862 days 15 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether0.028 Ether
0x97f8d72b672bb7cf72f05c53656dd568506efe2cfe582a3cfdeb135d38f09ca5128538012021-07-19 0:27:3062 days 16 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether0.1 Ether
0x68c3a4351a04c043d0b81ca54a9e155d377777e950efa4d8bbf889de6b9f5320128308612021-07-15 9:57:4366 days 7 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether0.00056 Ether
0x8c37ad80f461ea93bbbd11e4caf67d9c84579bf2a5045e15615e2a3a0d0eeadf128271732021-07-14 20:10:5266 days 21 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether0.15 Ether
0x7322cbcb6717311ff3947f499e38c180d0b8008a58f9eb7dece48c49fee44bd4128220882021-07-14 0:56:5067 days 16 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 0x: Exchange Proxy0.26 Ether
0x582f66c7c9c58b219cc209bfefe77ff34f276f405515ac5915545bbc6d0364c8128170362021-07-13 5:55:3968 days 11 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether0.0101805 Ether
0x71c5e1564cd59944c76c57248934cce3b7cae03d2f5857fb17aef030ba0eebab128114912021-07-12 8:49:0369 days 8 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether0.01 Ether
0x1a7980cefecbf103e0a9b1f89ed9a043e3a1f1bab393da0a1ded2b6434af24ef128110382021-07-12 7:08:3069 days 10 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 0x: Exchange Proxy0.05 Ether
0xdd3af6255ead3ea2a0c5f1608030617b7b3a78abc11850a8668a506e8a942d6c128108772021-07-12 6:33:2369 days 10 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether0.025 Ether
0x52a586e8ca4df3d6dc4afe5d2461dd039995dc3eeef67d8e7c269e780b1cc75c128106152021-07-12 5:38:4969 days 11 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 0x: Exchange Proxy0.01 Ether
0x37d382f6ccdbb484aab7ecb4401b68ef9c9e1345befcf3de1433514b14135489128091932021-07-12 0:13:1969 days 17 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether0.01 Ether
0x6820edd20507ff59223ccf338960556ba62a77e4ed38b9bbfa594e997154fe9c128035362021-07-11 3:06:5770 days 14 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether0.14 Ether
0x397a90f88d925053fee4ad5db51550ef426b993ac8d90a25d55e521deb2a2de9127975292021-07-10 4:29:0671 days 12 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether0.0001 Ether
0xdff050879ec83191cc62e7a3dc2bf4c33f6111e4175097a998e8c5904f444dbb127970512021-07-10 2:45:5071 days 14 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether6.7 Ether
0x3fb7ae6e7bd6c0d9357652e335847fd3e8dba76cb92705ba80102d9c1dda45af127924482021-07-09 9:45:3972 days 7 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether0.01 Ether
0xc832c37eae8f831276d413a0f3c2113ec17edf20403cb041575156c54f404206127924012021-07-09 9:33:1272 days 7 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether0.0301874 Ether
0x0e7d7a478b27b3c85968a55f3778638afce79aebabbfff0193a1b1c8048d9ad8127916742021-07-09 6:54:0072 days 10 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether1 Ether
0x310c1fb511f3e14027b24121ec818bd9a3ff1595aa2550b6c3cf5736c3a721d8127903202021-07-09 1:42:1572 days 15 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 0x: Exchange Proxy0.31 Ether
0x9d97059de48c426a61e9180e61db925abc3a81e262012e0c4c9abfa9a78db691127868452021-07-08 12:59:5973 days 4 hrs ago 0x647965b19280988a75c3a1369938c8927e6c8715 Wrapped Ether0.636015 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Balancer_ZapIn_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 : Balancer_ZapIn_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.
// SPDX-License-Identifier: GPL-2.0

///@author Zapper
///@notice this contract adds liquidity to Balancer liquidity pools in one transaction

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

interface IWETH {
    function deposit() external payable;
}

interface IBFactory {
    function isBPool(address b) external view returns (bool);
}

interface IBPool {
    function joinswapExternAmountIn(
        address tokenIn,
        uint256 tokenAmountIn,
        uint256 minPoolAmountOut
    ) external payable returns (uint256 poolAmountOut);

    function isBound(address t) external view returns (bool);
}

contract Balancer_ZapIn_General_V4 is ZapInBaseV3_1 {
    using SafeERC20 for IERC20;

    IBFactory BalancerFactory =
        IBFactory(0x9424B1412450D0f8Fc2255FAf6046b98213B76Bd);

    address private constant wethTokenAddress =
        0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;

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

        transferOwnership(ZapperAdmin);
    }

    event zapIn(address sender, address pool, uint256 tokensRec);

    /**
    @notice This function is used to invest in given balancer pool using ETH/ERC20 Tokens
    @param _FromTokenContractAddress The token used for investment (address(0x00) if ether)
    @param _ToBalancerPoolAddress The address of balancer pool
    @param _toTokenContractAddress The token with which we are adding liquidity
    @param _amount The amount of fromToken to invest
    @param _minPoolTokens Minimum quantity of pool tokens to receive. Reverts otherwise
    @param _swapTarget indicates the execution target for swap.
    @param swapData indicates the callData for execution
    @param affiliate Affiliate address
    @return LPTRec quantity of Balancer pool tokens acquired
    */
    function ZapIn(
        address _FromTokenContractAddress,
        address _ToBalancerPoolAddress,
        address _toTokenContractAddress,
        uint256 _amount,
        uint256 _minPoolTokens,
        address _swapTarget,
        bytes calldata swapData,
        address affiliate
    ) external payable stopInEmergency returns (uint256 LPTRec) {
        require(
            BalancerFactory.isBPool(_ToBalancerPoolAddress),
            "Invalid Balancer Pool"
        );

        // get incoming tokens
        uint256 toInvest =
            _pullTokens(_FromTokenContractAddress, _amount, affiliate, true);

        LPTRec = _performZapIn(
            _FromTokenContractAddress,
            _ToBalancerPoolAddress,
            toInvest,
            _toTokenContractAddress,
            _swapTarget,
            swapData
        );

        require(LPTRec >= _minPoolTokens, "High Slippage");

        IERC20(_ToBalancerPoolAddress).safeTransfer(msg.sender, LPTRec);

        emit zapIn(msg.sender, _ToBalancerPoolAddress, LPTRec);

        return LPTRec;
    }

    function _performZapIn(
        address _FromTokenContractAddress,
        address _ToBalancerPoolAddress,
        uint256 _amount,
        address _toTokenContractAddress,
        address _swapTarget,
        bytes memory swapData
    ) internal returns (uint256 tokensBought) {
        bool isBound =
            IBPool(_ToBalancerPoolAddress).isBound(_FromTokenContractAddress);

        uint256 balancerTokens;

        if (isBound) {
            balancerTokens = _enter2Balancer(
                _ToBalancerPoolAddress,
                _FromTokenContractAddress,
                _amount
            );
        } else {
            uint256 tokenBought =
                _fillQuote(
                    _FromTokenContractAddress,
                    _toTokenContractAddress,
                    _amount,
                    _swapTarget,
                    swapData
                );

            //get BPT
            balancerTokens = _enter2Balancer(
                _ToBalancerPoolAddress,
                _toTokenContractAddress,
                tokenBought
            );
        }

        return balancerTokens;
    }

    function _fillQuote(
        address _fromTokenAddress,
        address toToken,
        uint256 _amount,
        address _swapTarget,
        bytes memory swapData
    ) internal returns (uint256 amtBought) {
        if (_fromTokenAddress == toToken) {
            return _amount;
        }

        if (_fromTokenAddress == address(0) && toToken == wethTokenAddress) {
            IWETH(wethTokenAddress).deposit{ value: _amount }();
            return _amount;
        }

        uint256 valueToSend;
        if (_fromTokenAddress == address(0)) {
            valueToSend = _amount;
        } else {
            _approveToken(_fromTokenAddress, _swapTarget, _amount);
        }

        uint256 iniBal = _getBalance(toToken);
        require(approvedTargets[_swapTarget], "Target not Authorized");
        (bool success, ) = _swapTarget.call{ value: valueToSend }(swapData);
        require(success, "Error Swapping Tokens 1");
        uint256 finalBal = _getBalance(toToken);

        amtBought = finalBal - iniBal;
        require(amtBought > 0, "Swapped To Invalid Intermediate");
    }

    function _enter2Balancer(
        address _ToBalancerPoolAddress,
        address _FromTokenContractAddress,
        uint256 tokens2Trade
    ) internal returns (uint256 poolTokensOut) {
        require(
            IBPool(_ToBalancerPoolAddress).isBound(_FromTokenContractAddress),
            "Token not bound"
        );

        uint256 allowance =
            IERC20(_FromTokenContractAddress).allowance(
                address(this),
                _ToBalancerPoolAddress
            );

        if (allowance < tokens2Trade) {
            IERC20(_FromTokenContractAddress).safeApprove(
                _ToBalancerPoolAddress,
                tokens2Trade
            );
        }

        poolTokensOut = IBPool(_ToBalancerPoolAddress).joinswapExternAmountIn(
            _FromTokenContractAddress,
            tokens2Trade,
            1
        );

        require(poolTokensOut > 0, "Error Entering Pool");
    }
}

File 2 of 8 : ZapBaseV2_1.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_1 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;

    address internal constant ZapperAdmin =
        0x3CE37278de6388532C3949ce4e886F365B14fB56;

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

    // circuit breaker modifiers
    modifier stopInEmergency {
        if (stopped) {
            revert("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];
        }
    }

    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;
            }
        }
    }

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

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

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

abstract contract ZapInBaseV3_1 is ZapBaseV2_1 {
    using SafeERC20 for IERC20;

    /**
    @dev Transfer tokens (including ETH) from msg.sender to this contract
    @param token The ERC20 token to transfer to this contract (0 address if ETH)
    @return Quantity of tokens transferred to this contract
     */
    function _pullTokens(
        address token,
        uint256 amount,
        address affiliate,
        bool enableGoodwill
    ) internal returns (uint256) {
        uint256 totalGoodwillPortion;

        if (token == address(0)) {
            require(msg.value > 0, "No eth sent");

            // subtract goodwill
            totalGoodwillPortion = _subtractGoodwill(
                ETHAddress,
                msg.value,
                affiliate,
                enableGoodwill
            );

            return msg.value - totalGoodwillPortion;
        }

        require(amount > 0, "Invalid token amount");
        require(msg.value == 0, "Eth sent with token");

        //transfer token

        IERC20(token).safeTransferFrom(msg.sender, address(this), amount);

        // subtract goodwill
        totalGoodwillPortion = _subtractGoodwill(
            token,
            amount,
            affiliate,
            enableGoodwill
        );

        return amount - totalGoodwillPortion;
    }
}

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":"uint256","name":"tokensRec","type":"uint256"}],"name":"zapIn","type":"event"},{"inputs":[{"internalType":"address","name":"_FromTokenContractAddress","type":"address"},{"internalType":"address","name":"_ToBalancerPoolAddress","type":"address"},{"internalType":"address","name":"_toTokenContractAddress","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_minPoolTokens","type":"uint256"},{"internalType":"address","name":"_swapTarget","type":"address"},{"internalType":"bytes","name":"swapData","type":"bytes"},{"internalType":"address","name":"affiliate","type":"address"}],"name":"ZapIn","outputs":[{"internalType":"uint256","name":"LPTRec","type":"uint256"}],"stateMutability":"payable","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":[],"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"}]

60806040526000805460ff60a01b19169055600880546001600160a01b031916739424b1412450d0f8fc2255faf6046b98213b76bd1790553480156200004457600080fd5b506040516200242e3803806200242e833981016040819052620000679162000225565b600080546001600160a01b03191633908117825560405184928492918291906000805160206200240e833981519152908290a35060029190915560035573def1c0ded9bec7f1a1670819833240f027b25eff60005260076020527ff6019cd1944dc466e824190b288e5a63528dd4c9a6d8cbd707956fd30d2f1e0d805460ff191660011790556200010c733ce37278de6388532c3949ce4e886f365b14fb5662000114565b505062000249565b6000546001600160a01b03163314620001745760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b038116620001db5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200016b565b600080546040516001600160a01b03808516939216916000805160206200240e83398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000806040838503121562000238578182fd5b505080516020909101519092909150565b6121b580620002596000396000f3fe6080604052600436106101185760003560e01c80635ecb16cd116100a05780639735a634116100645780639735a6341461036d5780639779d1a61461038d578063d408f657146103bd578063f2fde38b146103ed578063fbec27bf1461040d57600080fd5b80635ecb16cd146102dc57806364c98c6c146102fc578063715018a61461030f57806375f12b21146103245780638da5cb5b1461034557600080fd5b806318b135e3116100e757806318b135e3146102195780633ff428c7146102465780634f51e29414610266578063550bfa56146102a65780635de0398e146102c657600080fd5b806301e980d4146101795780630dc9de85146101995780631385d24c146101b95780631781261f146101ce57600080fd5b3661017457333214156101725760405162461bcd60e51b815260206004820152601860248201527f446f206e6f742073656e6420455448206469726563746c79000000000000000060448201526064015b60405180910390fd5b005b600080fd5b34801561018557600080fd5b50610172610194366004611fef565b61042d565b3480156101a557600080fd5b506101726101b4366004611f0e565b6104b7565b3480156101c557600080fd5b50610172610712565b3480156101da57600080fd5b506102066101e9366004611dd2565b600560209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b34801561022557600080fd5b50610206610234366004611db8565b60066020526000908152604090205481565b34801561025257600080fd5b50610172610261366004611ed8565b61075d565b34801561027257600080fd5b50610296610281366004611db8565b60046020526000908152604090205460ff1681565b6040519015158152602001610210565b3480156102b257600080fd5b506101726102c1366004611fef565b6107b2565b3480156102d257600080fd5b5061020660025481565b3480156102e857600080fd5b506101726102f7366004611f0e565b610832565b61020661030a366004611e04565b610aa3565b34801561031b57600080fd5b50610172610caa565b34801561033057600080fd5b5060005461029690600160a01b900460ff1681565b34801561035157600080fd5b506000546040516001600160a01b039091168152602001610210565b34801561037957600080fd5b50610172610388366004611f4e565b610d1e565b34801561039957600080fd5b506102966103a8366004611db8565b60076020526000908152604090205460ff1681565b3480156103c957600080fd5b506102966103d8366004611db8565b60016020526000908152604090205460ff1681565b3480156103f957600080fd5b50610172610408366004611db8565b610e48565b34801561041957600080fd5b50610172610428366004611ed8565b610f32565b6000546001600160a01b031633146104575760405162461bcd60e51b81526004016101699061206e565b60648111156104b25760405162461bcd60e51b815260206004820152602160248201527f416666696c696174652053706c69742056616c7565206e6f7420616c6c6f77656044820152601960fa1b6064820152608401610169565b600355565b6000805b8281101561070c57336000908152600560205260408120908585848181106104f357634e487b7160e01b600052603260045260246000fd5b90506020020160208101906105089190611db8565b6001600160a01b0316815260208082019290925260409081016000908120543382526005909352908120919350908186868581811061055757634e487b7160e01b600052603260045260246000fd5b905060200201602081019061056c9190611db8565b6001600160a01b03166001600160a01b031681526020019081526020016000208190555081600660008686858181106105b557634e487b7160e01b600052603260045260246000fd5b90506020020160208101906105ca9190611db8565b6001600160a01b03166001600160a01b03168152602001908152602001600020546105f591906120fa565b6006600086868581811061061957634e487b7160e01b600052603260045260246000fd5b905060200201602081019061062e9190611db8565b6001600160a01b0316815260208101919091526040016000205573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee84848381811061067d57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906106929190611db8565b6001600160a01b031614156106b0576106ab3383610f87565b6106fa565b6106fa33838686858181106106d557634e487b7160e01b600052603260045260246000fd5b90506020020160208101906106ea9190611db8565b6001600160a01b031691906110a0565b806107048161213d565b9150506104bb565b50505050565b6000546001600160a01b0316331461073c5760405162461bcd60e51b81526004016101699061206e565b6000805460ff60a01b198116600160a01b9182900460ff1615909102179055565b6000546001600160a01b031633146107875760405162461bcd60e51b81526004016101699061206e565b6001600160a01b03919091166000908152600460205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146107dc5760405162461bcd60e51b81526004016101699061206e565b606481111561082d5760405162461bcd60e51b815260206004820152601a60248201527f476f6f6457696c6c2056616c7565206e6f7420616c6c6f7765640000000000006044820152606401610169565b600255565b6000546001600160a01b0316331461085c5760405162461bcd60e51b81526004016101699061206e565b60005b81811015610a9e57600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee84848481811061089e57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906108b39190611db8565b6001600160a01b0316141561094157600660008585858181106108e657634e487b7160e01b600052603260045260246000fd5b90506020020160208101906108fb9190611db8565b6001600160a01b0316815260208101919091526040016000205461091f90476120fa565b905061093c6109366000546001600160a01b031690565b82610f87565b610a8b565b6006600085858581811061096557634e487b7160e01b600052603260045260246000fd5b905060200201602081019061097a9190611db8565b6001600160a01b03166001600160a01b03168152602001908152602001600020548484848181106109bb57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906109d09190611db8565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b158015610a1157600080fd5b505afa158015610a25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a499190612007565b610a5391906120fa565b9050610a8b610a6a6000546001600160a01b031690565b828686868181106106d557634e487b7160e01b600052603260045260246000fd5b5080610a968161213d565b91505061085f565b505050565b60008054600160a01b900460ff1615610ae75760405162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b6044820152606401610169565b60085460405163615db6e160e11b81526001600160a01b038b811660048301529091169063c2bb6dc29060240160206040518083038186803b158015610b2c57600080fd5b505afa158015610b40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b649190611fd3565b610ba85760405162461bcd60e51b8152602060048201526015602482015274125b9d985b1a590810985b185b98d95c88141bdbdb605a1b6044820152606401610169565b6000610bb78b89856001611103565b9050610bfd8b8b838c8a8a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061124a92505050565b915086821015610c3f5760405162461bcd60e51b815260206004820152600d60248201526c4869676820536c69707061676560981b6044820152606401610169565b610c536001600160a01b038b1633846110a0565b604080513381526001600160a01b038c1660208201529081018390527f7f31d76771556dce5ab39ba5b60664743da2629a75c474e9445734b7ad34087d9060600160405180910390a1509998505050505050505050565b6000546001600160a01b03163314610cd45760405162461bcd60e51b81526004016101699061206e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610d485760405162461bcd60e51b81526004016101699061206e565b828114610d8e5760405162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c84092dce0eae840d8cadccee8d60631b6044820152606401610169565b60005b83811015610e4157828282818110610db957634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610dce9190611fb7565b60076000878785818110610df257634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610e079190611db8565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610e398161213d565b915050610d91565b5050505050565b6000546001600160a01b03163314610e725760405162461bcd60e51b81526004016101699061206e565b6001600160a01b038116610ed75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610169565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610f5c5760405162461bcd60e51b81526004016101699061206e565b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b80471015610fd75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610169565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611024576040519150601f19603f3d011682016040523d82523d6000602084013e611029565b606091505b5050905080610a9e5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610169565b6040516001600160a01b038316602482015260448101829052610a9e90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611310565b6000806001600160a01b03861661118657600034116111525760405162461bcd60e51b815260206004820152600b60248201526a139bc8195d1a081cd95b9d60aa1b6044820152606401610169565b61117273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee3486866113e2565b905061117e81346120fa565b915050611242565b600085116111cd5760405162461bcd60e51b8152602060048201526014602482015273125b9d985b1a59081d1bdad95b88185b5bdd5b9d60621b6044820152606401610169565b34156112115760405162461bcd60e51b815260206004820152601360248201527222ba341039b2b73a103bb4ba34103a37b5b2b760691b6044820152606401610169565b6112266001600160a01b03871633308861150d565b611232868686866113e2565b905061123e81866120fa565b9150505b949350505050565b604051630bcded8960e21b81526001600160a01b0387811660048301526000918291881690632f37b6249060240160206040518083038186803b15801561129057600080fd5b505afa1580156112a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c89190611fd3565b9050600081156112e4576112dd888a89611545565b9050611304565b60006112f38a888a898961177a565b9050611300898883611545565b9150505b98975050505050505050565b6000611365826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166119fa9092919063ffffffff16565b805190915015610a9e57808060200190518101906113839190611fd3565b610a9e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610169565b3360009081526001602052604081205460ff16828015611400575080155b801561140e57506000600254115b15611504576127106002548661142491906120db565b61142e91906120bb565b6001600160a01b03851660009081526004602052604090205490925060ff1615611504576001600160a01b0386166114785773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee95505b600060646003548461148a91906120db565b61149491906120bb565b6001600160a01b038087166000908152600560209081526040808320938c168352929052908120805492935083929091906114d09084906120a3565b90915550506001600160a01b038716600090815260066020526040812080548392906114fd9084906120a3565b9091555050505b50949350505050565b6040516001600160a01b038085166024830152831660448201526064810182905261070c9085906323b872dd60e01b906084016110cc565b604051630bcded8960e21b81526001600160a01b03838116600483015260009190851690632f37b6249060240160206040518083038186803b15801561158a57600080fd5b505afa15801561159e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c29190611fd3565b6116005760405162461bcd60e51b815260206004820152600f60248201526e151bdad95b881b9bdd08189bdd5b99608a1b6044820152606401610169565b604051636eb1769f60e11b81523060048201526001600160a01b0385811660248301526000919085169063dd62ed3e9060440160206040518083038186803b15801561164b57600080fd5b505afa15801561165f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116839190612007565b9050828110156116a1576116a16001600160a01b0385168685611a13565b604051635db3427760e01b81526001600160a01b0385811660048301526024820185905260016044830152861690635db3427790606401602060405180830381600087803b1580156116f257600080fd5b505af1158015611706573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061172a9190612007565b9150600082116117725760405162461bcd60e51b8152602060048201526013602482015272115c9c9bdc88115b9d195c9a5b99c8141bdbdb606a1b6044820152606401610169565b509392505050565b6000846001600160a01b0316866001600160a01b0316141561179d5750826119f1565b6001600160a01b0386161580156117d057506001600160a01b03851673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2145b156118455773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0856040518263ffffffff1660e01b81526004016000604051808303818588803b15801561182457600080fd5b505af1158015611838573d6000803e3d6000fd5b50505050508390506119f1565b60006001600160a01b03871661185c575083611867565b611867878587611b37565b600061187287611b60565b6001600160a01b03861660009081526007602052604090205490915060ff166118d55760405162461bcd60e51b815260206004820152601560248201527415185c99d95d081b9bdd08105d5d1a1bdc9a5e9959605a1b6044820152606401610169565b6000856001600160a01b031683866040516118f0919061201f565b60006040518083038185875af1925050503d806000811461192d576040519150601f19603f3d011682016040523d82523d6000602084013e611932565b606091505b50509050806119835760405162461bcd60e51b815260206004820152601760248201527f4572726f72205377617070696e6720546f6b656e7320310000000000000000006044820152606401610169565b600061198e89611b60565b905061199a83826120fa565b9450600085116119ec5760405162461bcd60e51b815260206004820152601f60248201527f5377617070656420546f20496e76616c696420496e7465726d656469617465006044820152606401610169565b505050505b95945050505050565b6060611a098484600085611bf6565b90505b9392505050565b801580611a9c5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b158015611a6257600080fd5b505afa158015611a76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a9a9190612007565b155b611b075760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610169565b6040516001600160a01b038316602482015260448101829052610a9e90849063095ea7b360e01b906064016110cc565b611b4c6001600160a01b038416836000611a13565b610a9e6001600160a01b0384168383611a13565b60006001600160a01b038216611b77575047919050565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a082319060240160206040518083038186803b158015611bb657600080fd5b505afa158015611bca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bee9190612007565b90505b919050565b606082471015611c575760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610169565b843b611ca55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610169565b600080866001600160a01b03168587604051611cc1919061201f565b60006040518083038185875af1925050503d8060008114611cfe576040519150601f19603f3d011682016040523d82523d6000602084013e611d03565b606091505b5091509150611d13828286611d1e565b979650505050505050565b60608315611d2d575081611a0c565b825115611d3d5782518084602001fd5b8160405162461bcd60e51b8152600401610169919061203b565b80356001600160a01b0381168114611bf157600080fd5b60008083601f840112611d7f578182fd5b50813567ffffffffffffffff811115611d96578182fd5b6020830191508360208260051b8501011115611db157600080fd5b9250929050565b600060208284031215611dc9578081fd5b611a0c82611d57565b60008060408385031215611de4578081fd5b611ded83611d57565b9150611dfb60208401611d57565b90509250929050565b60008060008060008060008060006101008a8c031215611e22578485fd5b611e2b8a611d57565b9850611e3960208b01611d57565b9750611e4760408b01611d57565b965060608a0135955060808a01359450611e6360a08b01611d57565b935060c08a013567ffffffffffffffff80821115611e7f578485fd5b818c0191508c601f830112611e92578485fd5b813581811115611ea0578586fd5b8d6020828501011115611eb1578586fd5b602083019550809450505050611ec960e08b01611d57565b90509295985092959850929598565b60008060408385031215611eea578182fd5b611ef383611d57565b91506020830135611f038161216e565b809150509250929050565b60008060208385031215611f20578182fd5b823567ffffffffffffffff811115611f36578283fd5b611f4285828601611d6e565b90969095509350505050565b60008060008060408587031215611f63578384fd5b843567ffffffffffffffff80821115611f7a578586fd5b611f8688838901611d6e565b90965094506020870135915080821115611f9e578384fd5b50611fab87828801611d6e565b95989497509550505050565b600060208284031215611fc8578081fd5b8135611a0c8161216e565b600060208284031215611fe4578081fd5b8151611a0c8161216e565b600060208284031215612000578081fd5b5035919050565b600060208284031215612018578081fd5b5051919050565b60008251612031818460208701612111565b9190910192915050565b602081526000825180602084015261205a816040850160208701612111565b601f01601f19169190910160400192915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082198211156120b6576120b6612158565b500190565b6000826120d657634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156120f5576120f5612158565b500290565b60008282101561210c5761210c612158565b500390565b60005b8381101561212c578181015183820152602001612114565b8381111561070c5750506000910152565b600060001982141561215157612151612158565b5060010190565b634e487b7160e01b600052601160045260246000fd5b801515811461217c57600080fd5b5056fea26469706673582212203d09ff6db8dd03f4f35e1bac1d36a8ee18d4a783932375244adbb44d4dd98ff364736f6c634300080400338be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

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.