Contract 0x7A0a6906De7714d27413f5092ED1a0636A3FBc9A 1

 

Contract Overview

Zapper.Fi: Curve Zap In 2
Balance:
0 Ether

EtherValue:
$0.00

Token:
Txn Hash
Method
Block
From
To
Value
0x46e5227723810c9fc10cc4a77e9e39dde05fba835cc45f64cc7d309c0a0d5d9aZap In131786762021-09-07 12:46:08385 days 8 hrs ago0x78d2371df0ec3f3e1fb178b62ee313be16909dea IN  Zapper.Fi: Curve Zap In 20.25 Ether0.0022011683
0x4ee62a0f94af74f37949013269b976530d674e5be0deab8bfb27cb6dc3b7b965Zap In130952492021-08-25 15:12:42398 days 6 hrs ago0x88b456b12ac74e2fe90ec002ef5d8ed54b4b061c IN  Zapper.Fi: Curve Zap In 20.314 Ether0.0294672877
0x5ceb7f2b2aff2ec49d6ad9c9e5c54f69afb15789562bc8d5f4c7123172c52da3Zap In130951172021-08-25 14:42:39398 days 6 hrs ago0x01fb5de8847e570899d3e00029ae9cd9cb40e5d7 IN  Zapper.Fi: Curve Zap In 218.5 Ether0.0777282100
0x50f6832156bc0cd6bed1b498ee404ff4f4efd070d2a43b5890ba57347728a3c1Zap In130944472021-08-25 12:02:14398 days 9 hrs ago0xc80abbc38c1deb2ed7ce2ae2b58400878e88f9ac IN  Zapper.Fi: Curve Zap In 2236.3 Ether0.01436766 60
0x0c29c9aa421435a34ddf67fd743c6ca43482c60dcd85ae1dee953c2b3063eb28Zap In130915732021-08-25 1:26:30398 days 20 hrs ago0xf138b5c5aa979e75ca84d925659e3214360d7e57 IN  Zapper.Fi: Curve Zap In 21.2 Ether0.01534125 69
0xf506d2427f673fb4e75cb917fae061c264a77ebe5b896f41102b62c9e09d9d09Zap In130910382021-08-24 23:27:36398 days 22 hrs agoENS Name leekuanjew.eth IN  Zapper.Fi: Curve Zap In 20 Ether0.01945503 64.72476121
0x9b1ac7a882db3e4cebd996d6141eb248ca9648384e3fafa7f8340a7508eabb6fZap In130906172021-08-24 21:48:15398 days 23 hrs agoENS Name dongseon.eth IN  Zapper.Fi: Curve Zap In 20 Ether0.02979535 67.89200012
0x31d5122aa30d13c537d8a2644ef1c1b4ddfaa3072536803836982ef4349550cdZap In130904602021-08-24 21:14:05399 days 15 mins agoENS Name dongseon.eth IN  Zapper.Fi: Curve Zap In 20 Ether0.03003641 69.58238001
0x53b5940eaf54d0de94aa6e929483d93b1aa0ae98a1dcfceeb1d480b1ce9bd5a9Zap In130890332021-08-24 16:06:06399 days 5 hrs ago0x2ab9e915571be3de55e781cbf315fd845efb5743 IN  Zapper.Fi: Curve Zap In 20 Ether0.00419454 139.81813363
0x4b06ce782b0aec15059082d3ec2a5d645308e443523e351e1d0cb7fdb560e555Zap In130882672021-08-24 13:23:14399 days 8 hrs ago0x23fa4be9954ecfa249b1ef5c027eb113542ac9ba IN  Zapper.Fi: Curve Zap In 20 Ether0.01726872 57
0xd70846ac5624bc414ac476a510d9f55f5c3321bf710a87509f2e260968ce368aZap In130875752021-08-24 10:46:27399 days 10 hrs agoENS Name yxoxy.eth IN  Zapper.Fi: Curve Zap In 20 Ether0.0167258736.3
0xe05cb29ef7e02f9b521a5bfe70df6be597a180f2afe60a5f7d4ef5ffbea1a584Zap In130874512021-08-24 10:20:35399 days 11 hrs agoENS Name miloops.eth IN  Zapper.Fi: Curve Zap In 210 Ether0.0105403344
0xb9691ea76f1e8f781d743896ea1088ff9def31fc2a6a366ba66925a444f4da27Zap In130873772021-08-24 10:06:39399 days 11 hrs agoENS Name hisdudeness.eth IN  Zapper.Fi: Curve Zap In 20.76 Ether0.02670644 43
0x408b537bd1622bc2b7710b1e01fae00770e64579bf04d5fed9cd715282015bb7Zap In130862472021-08-24 5:51:49399 days 15 hrs ago0x078f272e24dc976a1c7a4ed273f8db5763bbbeb3 IN  Zapper.Fi: Curve Zap In 20 Ether0.01397802 46
0x36c38ac288a58bf0a9a8e4574f1d6e3e79120e949446b8699513a422088287a9Zap In130854162021-08-24 2:42:24399 days 18 hrs ago0xf138b5c5aa979e75ca84d925659e3214360d7e57 IN  Zapper.Fi: Curve Zap In 21.1 Ether0.01935341 87
0x184cce073e3971739bcaa43ec5c18aecbd8c76110f7b5740aa4a2a1732a0ee1dZap In130822672021-08-23 15:07:57400 days 6 hrs ago0xf138b5c5aa979e75ca84d925659e3214360d7e57 IN  Zapper.Fi: Curve Zap In 21.1 Ether0.01579416 71
0x80debeb011b6a5af126d3ff941576cad52d2b3300d3d3ef234a8843728dedb0aZap In130821882021-08-23 14:50:46400 days 6 hrs agoENS Name hisdudeness.eth IN  Zapper.Fi: Curve Zap In 20.77 Ether0.04406771 71
0x443fb39c4a759e7fd19e86f5b28238518549be41e809d5a7a6305364a3a487cdZap In130805772021-08-23 8:50:56400 days 12 hrs ago0x335fbfe1c7b72e3e3237402b843a7668bce39d16 IN  Zapper.Fi: Curve Zap In 20.0377758 Ether0.0088630137
0xb35a519f6650043087abc9a4faa3d6955db48855a1a44ee53df64b06b24b6367Zap In130794972021-08-23 4:44:10400 days 16 hrs agoENS Name texasblockchainattorney.eth IN  Zapper.Fi: Curve Zap In 23.6 Ether0.0337707954
0xab42c7b86ca73bc2e49224e1e9568b77f015757813c2b2fc5476ef7ce4876647Zap In130794972021-08-23 4:44:10400 days 16 hrs agoENS Name texasblockchainattorney.eth IN  Zapper.Fi: Curve Zap In 25 Ether0.0517438882
0x8cefdd247961874f0cb1c11f3b5317ef19eaedd6783723a6dbf04328c1a9626cZap In130793802021-08-23 4:17:22400 days 17 hrs agoENS Name texasblockchainattorney.eth IN  Zapper.Fi: Curve Zap In 210 Ether0.0745383899
0x1a735f3ef2137972efdd44b0c5d1bd6dcd79f9c1364f9900bb611354eb834fc0Zap In130793552021-08-23 4:11:18400 days 17 hrs agoENS Name texasblockchainattorney.eth IN  Zapper.Fi: Curve Zap In 25 Ether0.0239997565
0x4708e27fb91d1f457e435d8a05bbf8cbd72c8e70cbffaca9831d13edb843e3a3Zap In130793212021-08-23 4:04:11400 days 17 hrs agoENS Name texasblockchainattorney.eth IN  Zapper.Fi: Curve Zap In 24.25 Ether0.0383420554
0x2d719b75c62ae31c3c00cebda941ba9f465963ededf83c7fcf9c4fff001b670fZap In130792852021-08-23 3:58:05400 days 17 hrs agoENS Name texasblockchainattorney.eth IN  Zapper.Fi: Curve Zap In 29 Ether0.0563740177
0x0d72ec1b872051f2851a57a754fbdaee193f4b8a1de3600797b7001ca3fe953dZap In130792342021-08-23 3:46:21400 days 17 hrs agoENS Name texasblockchainattorney.eth IN  Zapper.Fi: Curve Zap In 210 Ether0.0376141185
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xf831291885b9f12c6043ba1b68a18154672236f6ccba15306d6a64e75ba13445130969442021-08-25 21:32:46397 days 23 hrs ago Zapper.Fi: Curve Zap In 2 Wrapped Ether1.32 Ether
0xf831291885b9f12c6043ba1b68a18154672236f6ccba15306d6a64e75ba13445130969442021-08-25 21:32:46397 days 23 hrs ago Zapper.Fi: Yearn yVault Zap In Zapper.Fi: Curve Zap In 21.32 Ether
0x324a5ab312e48825a109ea9fd68a1ced2a1958654999d3adc24a376b8b8965c4130968582021-08-25 21:14:47398 days 15 mins ago Zapper.Fi: Curve Zap In 2 Wrapped Ether0.5 Ether
0x324a5ab312e48825a109ea9fd68a1ced2a1958654999d3adc24a376b8b8965c4130968582021-08-25 21:14:47398 days 15 mins ago Zapper.Fi: Yearn yVault Zap In Zapper.Fi: Curve Zap In 20.5 Ether
0x21676f2a60c5a8bde928256009efef3d6d114d8584004565ec3f5d5257eb9ef3130962492021-08-25 18:59:56398 days 2 hrs ago Zapper.Fi: Curve Zap In 2 Lido: Curve Liquidity Farming Pool Contract2 Ether
0x21676f2a60c5a8bde928256009efef3d6d114d8584004565ec3f5d5257eb9ef3130962492021-08-25 18:59:56398 days 2 hrs ago Zapper.Fi: Yearn yVault Zap In Zapper.Fi: Curve Zap In 22 Ether
0x4ee62a0f94af74f37949013269b976530d674e5be0deab8bfb27cb6dc3b7b965130952492021-08-25 15:12:42398 days 6 hrs ago Zapper.Fi: Curve Zap In 2 Wrapped Ether0.314 Ether
0x5ceb7f2b2aff2ec49d6ad9c9e5c54f69afb15789562bc8d5f4c7123172c52da3130951172021-08-25 14:42:39398 days 6 hrs ago Zapper.Fi: Curve Zap In 2 0x: Exchange Proxy18.5 Ether
0x50f6832156bc0cd6bed1b498ee404ff4f4efd070d2a43b5890ba57347728a3c1130944472021-08-25 12:02:14398 days 9 hrs ago Zapper.Fi: Curve Zap In 2 Lido: Curve Liquidity Farming Pool Contract236.3 Ether
0x4aefc7b72ad32500cd2ddcf1ef817ed48416df0611ea8711d6ee5c69d9490730130936732021-08-25 9:11:41398 days 12 hrs ago Zapper.Fi: Curve Zap In 2 Lido: Curve Liquidity Farming Pool Contract0.27 Ether
0x4aefc7b72ad32500cd2ddcf1ef817ed48416df0611ea8711d6ee5c69d9490730130936732021-08-25 9:11:41398 days 12 hrs ago Zapper.Fi: Yearn yVault Zap In Zapper.Fi: Curve Zap In 20.27 Ether
0x3a53c4a984013d8a149cd2150a6e0e317813aeb32fb81317f5c6e4c782154db9130919652021-08-25 2:56:22398 days 18 hrs ago Zapper.Fi: Curve Zap In 2 Lido: Curve Liquidity Farming Pool Contract1 Ether
0x3a53c4a984013d8a149cd2150a6e0e317813aeb32fb81317f5c6e4c782154db9130919652021-08-25 2:56:22398 days 18 hrs ago Zapper.Fi: Yearn yVault Zap In Zapper.Fi: Curve Zap In 21 Ether
0x0c29c9aa421435a34ddf67fd743c6ca43482c60dcd85ae1dee953c2b3063eb28130915732021-08-25 1:26:30398 days 20 hrs ago Zapper.Fi: Curve Zap In 2 Lido: Curve Liquidity Farming Pool Contract1.2 Ether
0x052554405be2edba4672e054c12780618adcb5908a07fb04d677494560b893bd130907392021-08-24 22:20:27398 days 23 hrs ago Zapper.Fi: Yearn yVault Zap In Zapper.Fi: Curve Zap In 21 Ether
0xc13dad62986fae5e3f4d9404104506893cb14ba2fa7988ac7fd196d8b1b43b28130907182021-08-24 22:14:30398 days 23 hrs ago Zapper.Fi: Yearn yVault Zap In Zapper.Fi: Curve Zap In 21 Ether
0x630e35e03a1deb074adf96dc971f8f0c2922b303c6c501d361db23502ce1b354130907172021-08-24 22:14:24398 days 23 hrs ago Zapper.Fi: Yearn yVault Zap In Zapper.Fi: Curve Zap In 21 Ether
0xcd5235438e0f34d5cc77ff46ddfed5cba15cae7f6e723ed83b097cddee6c2fb6130907082021-08-24 22:12:32398 days 23 hrs ago Zapper.Fi: Yearn yVault Zap In Zapper.Fi: Curve Zap In 21 Ether
0x4cb10cd11bdd637de24a2bee238fed8597188270cbdf490a1f16e86fabe588ff130906372021-08-24 21:53:51398 days 23 hrs ago Zapper.Fi: Curve Zap In 2 Lido: Curve Liquidity Farming Pool Contract1 Ether
0x4cb10cd11bdd637de24a2bee238fed8597188270cbdf490a1f16e86fabe588ff130906372021-08-24 21:53:51398 days 23 hrs ago Zapper.Fi: Yearn yVault Zap In Zapper.Fi: Curve Zap In 21 Ether
0x581a6b21a593d06d3c28a3cbb13e2b9b5f65b0a0be753c27a8b26ac1a58aad52130895442021-08-24 17:56:25399 days 3 hrs ago Zapper.Fi: Curve Zap In 2 Lido: Curve Liquidity Farming Pool Contract10 Ether
0x581a6b21a593d06d3c28a3cbb13e2b9b5f65b0a0be753c27a8b26ac1a58aad52130895442021-08-24 17:56:25399 days 3 hrs ago Zapper.Fi: Yearn yVault Zap In Zapper.Fi: Curve Zap In 210 Ether
0xb0e7035c643c769f9bd70445b9e500163c83c15dba20905ba4a7e81ccd268431130894172021-08-24 17:26:31399 days 4 hrs ago Zapper.Fi: Curve Zap In 2 Lido: Curve Liquidity Farming Pool Contract6 Ether
0xb0e7035c643c769f9bd70445b9e500163c83c15dba20905ba4a7e81ccd268431130894172021-08-24 17:26:31399 days 4 hrs ago Zapper.Fi: Yearn yVault Zap In Zapper.Fi: Curve Zap In 26 Ether
0xafd1e2ff2021d33d1ded3c3c3c5e2f80a4d6f32ff9be35b01aca37a117803b1f130884862021-08-24 14:09:48399 days 7 hrs ago Zapper.Fi: Curve Zap In 2 0x: Exchange Proxy2.06832 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Curve_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 : Curve_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.
//

///@author Zapper
///@notice This contract adds liquidity to Curve pools with ETH or ERC tokens.
// SPDX-License-Identifier: GPL-2.0

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

interface IWETH {
    function deposit() external payable;
}

interface ICurveSwap {
    function coins(int128 arg0) external view returns (address);

    function underlying_coins(int128 arg0) external view returns (address);

    function add_liquidity(uint256[4] calldata amounts, uint256 min_mint_amount)
        external;

    function add_liquidity(
        uint256[4] calldata amounts,
        uint256 min_mint_amount,
        bool addUnderlying
    ) external;

    function add_liquidity(uint256[3] calldata amounts, uint256 min_mint_amount)
        external;

    function add_liquidity(
        uint256[3] calldata amounts,
        uint256 min_mint_amount,
        bool addUnderlying
    ) external;

    function add_liquidity(uint256[2] calldata amounts, uint256 min_mint_amount)
        external;

    function add_liquidity(
        uint256[2] calldata amounts,
        uint256 min_mint_amount,
        bool addUnderlying
    ) external;
}

interface ICurveEthSwap {
    function add_liquidity(uint256[2] calldata amounts, uint256 min_mint_amount)
        external
        payable
        returns (uint256);
}

interface ICurveRegistry {
    function getSwapAddress(address tokenAddress)
        external
        view
        returns (address swapAddress);

    function getTokenAddress(address swapAddress)
        external
        view
        returns (address tokenAddress);

    function getDepositAddress(address swapAddress)
        external
        view
        returns (address depositAddress);

    function getPoolTokens(address swapAddress)
        external
        view
        returns (address[4] memory poolTokens);

    function shouldAddUnderlying(address swapAddress)
        external
        view
        returns (bool);

    function getNumTokens(address swapAddress)
        external
        view
        returns (uint8 numTokens);

    function isBtcPool(address swapAddress) external view returns (bool);

    function isEthPool(address swapAddress) external view returns (bool);

    function isUnderlyingToken(
        address swapAddress,
        address tokenContractAddress
    ) external view returns (bool, uint8);
}

contract Curve_ZapIn_General_V4 is ZapInBaseV3 {
    using SafeERC20 for IERC20;

    ICurveRegistry public curveReg;

    address private constant wethTokenAddress =
        0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;

    constructor(
        ICurveRegistry _curveRegistry,
        uint256 _goodwill,
        uint256 _affiliateSplit
    ) ZapBaseV2(_goodwill, _affiliateSplit) {
        curveReg = _curveRegistry;

        // 0x exchange
        approvedTargets[0xDef1C0ded9bec7F1a1670819833240f027b25EfF] = true;
    }

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

    /**
        @notice This function adds liquidity to a Curve pool with ETH or ERC20 tokens
        @param fromTokenAddress The token used for entry (address(0) if ether)
        @param toTokenAddress The intermediate ERC20 token to swap to
        @param swapAddress Curve swap address for the pool
        @param incomingTokenQty The amount of fromTokenAddress to invest
        @param minPoolTokens The minimum acceptable quantity of Curve LP to receive. Reverts otherwise
        @param swapTarget Excecution target for the first swap
        @param swapData DEX quote data
        @param affiliate Affiliate address
        @param shouldSellEntireBalance If True transfers entrire allowable amount from another contract
        @return crvTokensBought Quantity of Curve LP tokens received
    */
    function ZapIn(
        address fromTokenAddress,
        address toTokenAddress,
        address swapAddress,
        uint256 incomingTokenQty,
        uint256 minPoolTokens,
        address swapTarget,
        bytes calldata swapData,
        address affiliate,
        bool shouldSellEntireBalance
    ) external payable stopInEmergency returns (uint256 crvTokensBought) {
        uint256 toInvest =
            _pullTokens(
                fromTokenAddress,
                incomingTokenQty,
                affiliate,
                true,
                shouldSellEntireBalance
            );
        if (fromTokenAddress == address(0)) {
            fromTokenAddress = ETHAddress;
        }

        // perform zapIn
        crvTokensBought = _performZapIn(
            fromTokenAddress,
            toTokenAddress,
            swapAddress,
            toInvest,
            swapTarget,
            swapData
        );

        require(
            crvTokensBought > minPoolTokens,
            "Received less than minPoolTokens"
        );

        address poolTokenAddress = curveReg.getTokenAddress(swapAddress);

        emit zapIn(msg.sender, poolTokenAddress, crvTokensBought);

        IERC20(poolTokenAddress).transfer(msg.sender, crvTokensBought);
    }

    function _performZapIn(
        address fromTokenAddress,
        address toTokenAddress,
        address swapAddress,
        uint256 toInvest,
        address swapTarget,
        bytes memory swapData
    ) internal returns (uint256 crvTokensBought) {
        (bool isUnderlying, uint8 underlyingIndex) =
            curveReg.isUnderlyingToken(swapAddress, fromTokenAddress);

        if (isUnderlying) {
            crvTokensBought = _enterCurve(
                swapAddress,
                toInvest,
                underlyingIndex
            );
        } else {
            //swap tokens using 0x swap
            uint256 tokensBought =
                _fillQuote(
                    fromTokenAddress,
                    toTokenAddress,
                    toInvest,
                    swapTarget,
                    swapData
                );
            if (toTokenAddress == address(0)) toTokenAddress = ETHAddress;

            //get underlying token index
            (isUnderlying, underlyingIndex) = curveReg.isUnderlyingToken(
                swapAddress,
                toTokenAddress
            );

            if (isUnderlying) {
                crvTokensBought = _enterCurve(
                    swapAddress,
                    tokensBought,
                    underlyingIndex
                );
            } else {
                (uint256 tokens, uint8 metaIndex) =
                    _enterMetaPool(swapAddress, toTokenAddress, tokensBought);

                crvTokensBought = _enterCurve(swapAddress, tokens, metaIndex);
            }
        }
    }

    /**
        @notice This function gets adds the liquidity for meta pools and returns the token index and swap tokens
        @param swapAddress Curve swap address for the pool
        @param toTokenAddress The ERC20 token to which from token to be convert
        @param swapTokens quantity of toToken to invest
        @return tokensBought quantity of curve LP acquired
        @return index index of LP token in swapAddress whose pool tokens were acquired
     */
    function _enterMetaPool(
        address swapAddress,
        address toTokenAddress,
        uint256 swapTokens
    ) internal returns (uint256 tokensBought, uint8 index) {
        address[4] memory poolTokens = curveReg.getPoolTokens(swapAddress);
        for (uint8 i = 0; i < 4; i++) {
            address intermediateSwapAddress =
                curveReg.getSwapAddress(poolTokens[i]);
            if (intermediateSwapAddress != address(0)) {
                (, index) = curveReg.isUnderlyingToken(
                    intermediateSwapAddress,
                    toTokenAddress
                );

                tokensBought = _enterCurve(
                    intermediateSwapAddress,
                    swapTokens,
                    index
                );

                return (tokensBought, i);
            }
        }
    }

    function _fillQuote(
        address fromTokenAddress,
        address toTokenAddress,
        uint256 amount,
        address swapTarget,
        bytes memory swapData
    ) internal returns (uint256 amountBought) {
        if (fromTokenAddress == toTokenAddress) {
            return amount;
        }

        if (swapTarget == wethTokenAddress) {
            IWETH(wethTokenAddress).deposit{ value: amount }();
            return amount;
        }

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

        uint256 initialBalance = _getBalance(toTokenAddress);

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

        amountBought = _getBalance(toTokenAddress) - initialBalance;

        require(amountBought > 0, "Swapped To Invalid Intermediate");
    }

    /**
        @notice This function adds liquidity to a curve pool
        @param swapAddress Curve swap address for the pool
        @param amount The quantity of tokens being added as liquidity
        @param index The token index for the add_liquidity call
        @return crvTokensBought the quantity of curve LP tokens received
    */
    function _enterCurve(
        address swapAddress,
        uint256 amount,
        uint8 index
    ) internal returns (uint256 crvTokensBought) {
        address tokenAddress = curveReg.getTokenAddress(swapAddress);
        address depositAddress = curveReg.getDepositAddress(swapAddress);
        uint256 initialBalance = _getBalance(tokenAddress);
        address entryToken = curveReg.getPoolTokens(swapAddress)[index];
        if (entryToken != ETHAddress) {
            IERC20(entryToken).safeIncreaseAllowance(
                address(depositAddress),
                amount
            );
        }

        uint256 numTokens = curveReg.getNumTokens(swapAddress);
        bool addUnderlying = curveReg.shouldAddUnderlying(swapAddress);

        if (numTokens == 4) {
            uint256[4] memory amounts;
            amounts[index] = amount;
            if (addUnderlying) {
                ICurveSwap(depositAddress).add_liquidity(amounts, 0, true);
            } else {
                ICurveSwap(depositAddress).add_liquidity(amounts, 0);
            }
        } else if (numTokens == 3) {
            uint256[3] memory amounts;
            amounts[index] = amount;
            if (addUnderlying) {
                ICurveSwap(depositAddress).add_liquidity(amounts, 0, true);
            } else {
                ICurveSwap(depositAddress).add_liquidity(amounts, 0);
            }
        } else {
            uint256[2] memory amounts;
            amounts[index] = amount;
            if (curveReg.isEthPool(depositAddress)) {
                ICurveEthSwap(depositAddress).add_liquidity{ value: amount }(
                    amounts,
                    0
                );
            } else if (addUnderlying) {
                ICurveSwap(depositAddress).add_liquidity(amounts, 0, true);
            } else {
                ICurveSwap(depositAddress).add_liquidity(amounts, 0);
            }
        }
        crvTokensBought = _getBalance(tokenAddress) - initialBalance;
    }

    function updateCurveRegistry(ICurveRegistry newCurveRegistry)
        external
        onlyOwner
    {
        require(newCurveRegistry != curveReg, "Already using this Registry");
        curveReg = newCurveRegistry;
    }
}

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 : ZapInBaseV3.sol
// SPDX-License-Identifier: GPL-2.0

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

abstract contract ZapInBaseV3 is ZapBaseV2 {
    using SafeERC20 for IERC20;

    function _pullTokens(
        address token,
        uint256 amount,
        address affiliate,
        bool enableGoodwill,
        bool shouldSellEntireBalance
    ) internal returns (uint256 value) {
        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
        if (shouldSellEntireBalance) {
            require(
                Address.isContract(msg.sender),
                "ERR: shouldSellEntireBalance is true for EOA"
            );
            amount = IERC20(token).allowance(msg.sender, address(this));
        }
        IERC20(token).safeTransferFrom(msg.sender, address(this), amount);

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

        return amount - totalGoodwillPortion;
    }

    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":"contract ICurveRegistry","name":"_curveRegistry","type":"address"},{"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":"fromTokenAddress","type":"address"},{"internalType":"address","name":"toTokenAddress","type":"address"},{"internalType":"address","name":"swapAddress","type":"address"},{"internalType":"uint256","name":"incomingTokenQty","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"},{"internalType":"bool","name":"shouldSellEntireBalance","type":"bool"}],"name":"ZapIn","outputs":[{"internalType":"uint256","name":"crvTokensBought","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":[],"name":"curveReg","outputs":[{"internalType":"contract ICurveRegistry","name":"","type":"address"}],"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":"contract ICurveRegistry","name":"newCurveRegistry","type":"address"}],"name":"updateCurveRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"withdrawTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040526000805460ff60a01b191690553480156200001e57600080fd5b50604051620030c6380380620030c6833981016040819052620000419162000100565b600080546001600160a01b03191633908117825560405184928492918291907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506002919091556003555050600880546001600160a01b0319166001600160a01b039290921691909117905573def1c0ded9bec7f1a1670819833240f027b25eff60005260076020527ff6019cd1944dc466e824190b288e5a63528dd4c9a6d8cbd707956fd30d2f1e0d805460ff1916600117905562000143565b60008060006060848603121562000115578283fd5b83516001600160a01b03811681146200012c578384fd5b602085015160409095015190969495509392505050565b612f7380620001536000396000f3fe60806040526004361061012e5760003560e01c80635de0398e116100ab5780639735a6341161006f5780639735a634146103b15780639779d1a6146103d1578063d408f65714610401578063e595338214610431578063f2fde38b14610451578063fbec27bf1461047157600080fd5b80635de0398e146103275780635ecb16cd1461033d578063715018a61461035d57806375f12b21146103725780638da5cb5b1461039357600080fd5b8063374b09f8116100f2578063374b09f81461025c5780633ff428c71461029457806349ee0fa6146102b45780634f51e294146102c7578063550bfa561461030757600080fd5b806301e980d41461018f5780630dc9de85146101af5780631385d24c146101cf5780631781261f146101e457806318b135e31461022f57600080fd5b3661018a57333214156101885760405162461bcd60e51b815260206004820152601860248201527f446f206e6f742073656e6420455448206469726563746c79000000000000000060448201526064015b60405180910390fd5b005b600080fd5b34801561019b57600080fd5b506101886101aa366004612c22565b610491565b3480156101bb57600080fd5b506101886101ca366004612b0d565b61051b565b3480156101db57600080fd5b50610188610776565b3480156101f057600080fd5b5061021c6101ff366004612930565b600560209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b34801561023b57600080fd5b5061021c61024a3660046128f8565b60066020526000908152604090205481565b34801561026857600080fd5b5060085461027c906001600160a01b031681565b6040516001600160a01b039091168152602001610226565b3480156102a057600080fd5b506101886102af366004612a56565b6107c1565b61021c6102c2366004612968565b610816565b3480156102d357600080fd5b506102f76102e23660046128f8565b60046020526000908152604090205460ff1681565b6040519015158152602001610226565b34801561031357600080fd5b50610188610322366004612c22565b610a8e565b34801561033357600080fd5b5061021c60025481565b34801561034957600080fd5b50610188610358366004612b0d565b610b0e565b34801561036957600080fd5b50610188610d7f565b34801561037e57600080fd5b506000546102f790600160a01b900460ff1681565b34801561039f57600080fd5b506000546001600160a01b031661027c565b3480156103bd57600080fd5b506101886103cc366004612b4d565b610df3565b3480156103dd57600080fd5b506102f76103ec3660046128f8565b60076020526000908152604090205460ff1681565b34801561040d57600080fd5b506102f761041c3660046128f8565b60016020526000908152604090205460ff1681565b34801561043d57600080fd5b5061018861044c3660046128f8565b610f1d565b34801561045d57600080fd5b5061018861046c3660046128f8565b610fc7565b34801561047d57600080fd5b5061018861048c366004612a56565b6110b1565b6000546001600160a01b031633146104bb5760405162461bcd60e51b815260040161017f90612de1565b60648111156105165760405162461bcd60e51b815260206004820152602160248201527f416666696c696174652053706c69742056616c7565206e6f7420616c6c6f77656044820152601960fa1b606482015260840161017f565b600355565b6000805b82811015610770573360009081526005602052604081209085858481811061055757634e487b7160e01b600052603260045260246000fd5b905060200201602081019061056c91906128f8565b6001600160a01b031681526020808201929092526040908101600090812054338252600590935290812091935090818686858181106105bb57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906105d091906128f8565b6001600160a01b03166001600160a01b0316815260200190815260200160002081905550816006600086868581811061061957634e487b7160e01b600052603260045260246000fd5b905060200201602081019061062e91906128f8565b6001600160a01b03166001600160a01b03168152602001908152602001600020546106599190612e6d565b6006600086868581811061067d57634e487b7160e01b600052603260045260246000fd5b905060200201602081019061069291906128f8565b6001600160a01b0316815260208101919091526040016000205573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee8484838181106106e157634e487b7160e01b600052603260045260246000fd5b90506020020160208101906106f691906128f8565b6001600160a01b031614156107145761070f3383611106565b61075e565b61075e338386868581811061073957634e487b7160e01b600052603260045260246000fd5b905060200201602081019061074e91906128f8565b6001600160a01b0316919061121f565b8061076881612eb0565b91505061051f565b50505050565b6000546001600160a01b031633146107a05760405162461bcd60e51b815260040161017f90612de1565b6000805460ff60a01b198116600160a01b9182900460ff1615909102179055565b6000546001600160a01b031633146107eb5760405162461bcd60e51b815260040161017f90612de1565b6001600160a01b03919091166000908152600460205260409020805460ff1916911515919091179055565b60008054600160a01b900460ff16156108665760405162461bcd60e51b815260206004820152601260248201527115195b5c1bdc985c9a5b1e4814185d5cd95960721b604482015260640161017f565b60006108768c8a86600187611282565b90506001600160a01b038c1661089e5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee9b505b6108e28c8c8c848b8b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506114b392505050565b91508782116109335760405162461bcd60e51b815260206004820181905260248201527f5265636569766564206c657373207468616e206d696e506f6f6c546f6b656e73604482015260640161017f565b60085460405163b8d7b66960e01b81526001600160a01b038c81166004830152600092169063b8d7b6699060240160206040518083038186803b15801561097957600080fd5b505afa15801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b19190612914565b604080513381526001600160a01b03831660208201529081018590529091507f7f31d76771556dce5ab39ba5b60664743da2629a75c474e9445734b7ad34087d9060600160405180910390a160405163a9059cbb60e01b8152336004820152602481018490526001600160a01b0382169063a9059cbb90604401602060405180830381600087803b158015610a4557600080fd5b505af1158015610a59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7d9190612bd2565b5050509a9950505050505050505050565b6000546001600160a01b03163314610ab85760405162461bcd60e51b815260040161017f90612de1565b6064811115610b095760405162461bcd60e51b815260206004820152601a60248201527f476f6f6457696c6c2056616c7565206e6f7420616c6c6f776564000000000000604482015260640161017f565b600255565b6000546001600160a01b03163314610b385760405162461bcd60e51b815260040161017f90612de1565b60005b81811015610d7a57600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee848484818110610b7a57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610b8f91906128f8565b6001600160a01b03161415610c1d5760066000858585818110610bc257634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610bd791906128f8565b6001600160a01b03168152602081019190915260400160002054610bfb9047612e6d565b9050610c18610c126000546001600160a01b031690565b82611106565b610d67565b60066000858585818110610c4157634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610c5691906128f8565b6001600160a01b03166001600160a01b0316815260200190815260200160002054848484818110610c9757634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610cac91906128f8565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b158015610ced57600080fd5b505afa158015610d01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d259190612c3a565b610d2f9190612e6d565b9050610d67610d466000546001600160a01b031690565b8286868681811061073957634e487b7160e01b600052603260045260246000fd5b5080610d7281612eb0565b915050610b3b565b505050565b6000546001600160a01b03163314610da95760405162461bcd60e51b815260040161017f90612de1565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610e1d5760405162461bcd60e51b815260040161017f90612de1565b828114610e635760405162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c84092dce0eae840d8cadccee8d60631b604482015260640161017f565b60005b83811015610f1657828282818110610e8e57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610ea39190612bb6565b60076000878785818110610ec757634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610edc91906128f8565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610f0e81612eb0565b915050610e66565b5050505050565b6000546001600160a01b03163314610f475760405162461bcd60e51b815260040161017f90612de1565b6008546001600160a01b0382811691161415610fa55760405162461bcd60e51b815260206004820152601b60248201527f416c7265616479207573696e6720746869732052656769737472790000000000604482015260640161017f565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610ff15760405162461bcd60e51b815260040161017f90612de1565b6001600160a01b0381166110565760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161017f565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146110db5760405162461bcd60e51b815260040161017f90612de1565b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b804710156111565760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161017f565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146111a3576040519150601f19603f3d011682016040523d82523d6000602084013e6111a8565b606091505b5050905080610d7a5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161017f565b6040516001600160a01b038316602482015260448101829052610d7a90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611662565b6000806001600160a01b03871661130557600034116112d15760405162461bcd60e51b815260206004820152600b60248201526a139bc8195d1a081cd95b9d60aa1b604482015260640161017f565b6112f173eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee348787611734565b90506112fd8134612e6d565b9150506114aa565b6000861161134c5760405162461bcd60e51b8152602060048201526014602482015273125b9d985b1a59081d1bdad95b88185b5bdd5b9d60621b604482015260640161017f565b34156113905760405162461bcd60e51b815260206004820152601360248201527222ba341039b2b73a103bb4ba34103a37b5b2b760691b604482015260640161017f565b821561147957333b6113f95760405162461bcd60e51b815260206004820152602c60248201527f4552523a2073686f756c6453656c6c456e7469726542616c616e63652069732060448201526b7472756520666f7220454f4160a01b606482015260840161017f565b604051636eb1769f60e11b81523360048201523060248201526001600160a01b0388169063dd62ed3e9060440160206040518083038186803b15801561143e57600080fd5b505afa158015611452573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114769190612c3a565b95505b61148e6001600160a01b03881633308961185f565b61149a87878787611734565b90506114a68187612e6d565b9150505b95945050505050565b6008546040516301e09fa360e41b81526001600160a01b03868116600483015288811660248301526000928392839290911690631e09fa3090604401604080518083038186803b15801561150657600080fd5b505afa15801561151a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061153e9190612bee565b91509150811561155a57611553878783611897565b9250611656565b60006115698a8a898989611f76565b90506001600160a01b0389166115915773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee98505b6008546040516301e09fa360e41b81526001600160a01b038a811660048301528b8116602483015290911690631e09fa3090604401604080518083038186803b1580156115dd57600080fd5b505afa1580156115f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116159190612bee565b909350915082156116325761162b888284611897565b9350611654565b6000806116408a8c856121ed565b9150915061164f8a8383611897565b955050505b505b50509695505050505050565b60006116b7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166124049092919063ffffffff16565b805190915015610d7a57808060200190518101906116d59190612bd2565b610d7a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161017f565b3360009081526001602052604081205460ff16828015611752575080155b801561176057506000600254115b1561185657612710600254866117769190612e4e565b6117809190612e2e565b6001600160a01b03851660009081526004602052604090205490925060ff1615611856576001600160a01b0386166117ca5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee95505b60006064600354846117dc9190612e4e565b6117e69190612e2e565b6001600160a01b038087166000908152600560209081526040808320938c16835292905290812080549293508392909190611822908490612e16565b90915550506001600160a01b0387166000908152600660205260408120805483929061184f908490612e16565b9091555050505b50949350505050565b6040516001600160a01b03808516602483015283166044820152606481018290526107709085906323b872dd60e01b9060840161124b565b60085460405163b8d7b66960e01b81526001600160a01b038581166004830152600092839291169063b8d7b6699060240160206040518083038186803b1580156118e057600080fd5b505afa1580156118f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119189190612914565b60085460405163d83a7f6760e01b81526001600160a01b0388811660048301529293506000929091169063d83a7f679060240160206040518083038186803b15801561196357600080fd5b505afa158015611977573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061199b9190612914565b905060006119a88361241d565b60085460405163ca4f280360e01b81526001600160a01b038a811660048301529293506000929091169063ca4f28039060240160806040518083038186803b1580156119f357600080fd5b505afa158015611a07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a2b9190612a83565b8660ff1660048110611a4d57634e487b7160e01b600052603260045260246000fd5b602002015190506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14611a8c57611a8c6001600160a01b03821684896124b3565b600854604051633aa3eb0160e01b81526001600160a01b038a811660048301526000921690633aa3eb019060240160206040518083038186803b158015611ad257600080fd5b505afa158015611ae6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b0a9190612c52565b600854604051630a6954a960e21b81526001600160a01b038c8116600483015260ff939093169350600092909116906329a552a49060240160206040518083038186803b158015611b5a57600080fd5b505afa158015611b6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b929190612bd2565b90508160041415611ca457611ba5612822565b89818a60ff1660048110611bc957634e487b7160e01b600052603260045260246000fd5b60200201528115611c3d5760405163dc3a2d8160e01b81526001600160a01b0387169063dc3a2d8190611c06908490600090600190600401612d8a565b600060405180830381600087803b158015611c2057600080fd5b505af1158015611c34573d6000803e3d6000fd5b50505050611c9e565b60405162a6cbcd60e21b81526001600160a01b0387169063029b2f3490611c6b908490600090600401612d6f565b600060405180830381600087803b158015611c8557600080fd5b505af1158015611c99573d6000803e3d6000fd5b505050505b50611f54565b8160031415611d4557611cb5612840565b89818a60ff1660038110611cd957634e487b7160e01b600052603260045260246000fd5b60200201528115611d16576040516315b74c9d60e11b81526001600160a01b03871690632b6e993a90611c06908490600090600190600401612d4b565b604051634515cef360e01b81526001600160a01b03871690634515cef390611c6b908490600090600401612d30565b611d4d61285e565b89818a60ff1660028110611d7157634e487b7160e01b600052603260045260246000fd5b6020020152600854604051636002a82360e11b81526001600160a01b0388811660048301529091169063c00550469060240160206040518083038186803b158015611dbb57600080fd5b505afa158015611dcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611df39190612bd2565b15611e8157604051630b4c7e4d60e01b81526001600160a01b03871690630b4c7e4d908c90611e29908590600090600401612cf1565b6020604051808303818588803b158015611e4257600080fd5b505af1158015611e56573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611e7b9190612c3a565b50611f52565b8115611ef05760405163ee22be2360e01b81526001600160a01b0387169063ee22be2390611eb9908490600090600190600401612d0c565b600060405180830381600087803b158015611ed357600080fd5b505af1158015611ee7573d6000803e3d6000fd5b50505050611f52565b604051630b4c7e4d60e01b81526001600160a01b03871690630b4c7e4d90611f1f908490600090600401612cf1565b600060405180830381600087803b158015611f3957600080fd5b505af1158015611f4d573d6000803e3d6000fd5b505050505b505b83611f5e8761241d565b611f689190612e6d565b9a9950505050505050505050565b6000846001600160a01b0316866001600160a01b03161415611f995750826114aa565b6001600160a01b03831673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2141561202e5773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0856040518263ffffffff1660e01b81526004016000604051808303818588803b15801561200d57600080fd5b505af1158015612021573d6000803e3d6000fd5b50505050508390506114aa565b60006001600160a01b03871673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561205c575083612067565b612067878587612574565b60006120728761241d565b6001600160a01b03861660009081526007602052604090205490915060ff166120d55760405162461bcd60e51b815260206004820152601560248201527415185c99d95d081b9bdd08105d5d1a1bdc9a5e9959605a1b604482015260640161017f565b6000856001600160a01b031683866040516120f09190612cd5565b60006040518083038185875af1925050503d806000811461212d576040519150601f19603f3d011682016040523d82523d6000602084013e612132565b606091505b505090508061217b5760405162461bcd60e51b81526020600482015260156024820152744572726f72205377617070696e6720546f6b656e7360581b604482015260640161017f565b816121858961241d565b61218f9190612e6d565b9350600084116121e15760405162461bcd60e51b815260206004820152601f60248201527f5377617070656420546f20496e76616c696420496e7465726d65646961746500604482015260640161017f565b50505095945050505050565b60085460405163ca4f280360e01b81526001600160a01b038581166004830152600092839283929091169063ca4f28039060240160806040518083038186803b15801561223957600080fd5b505afa15801561224d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122719190612a83565b905060005b60048160ff1610156123f9576008546000906001600160a01b031663bbff1a668460ff8516600481106122b957634e487b7160e01b600052603260045260246000fd5b60200201516040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b1580156122fd57600080fd5b505afa158015612311573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123359190612914565b90506001600160a01b038116156123e6576008546040516301e09fa360e41b81526001600160a01b038381166004830152898116602483015290911690631e09fa3090604401604080518083038186803b15801561239257600080fd5b505afa1580156123a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123ca9190612bee565b94506123d99050818786611897565b94509092506123fc915050565b50806123f181612ecb565b915050612276565b50505b935093915050565b6060612413848460008561259d565b90505b9392505050565b60006001600160a01b038216612434575047919050565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a082319060240160206040518083038186803b15801561247357600080fd5b505afa158015612487573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124ab9190612c3a565b90505b919050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e9060440160206040518083038186803b1580156124ff57600080fd5b505afa158015612513573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125379190612c3a565b6125419190612e16565b6040516001600160a01b03851660248201526044810182905290915061077090859063095ea7b360e01b9060640161124b565b6125896001600160a01b0384168360006126c5565b610d7a6001600160a01b03841683836126c5565b6060824710156125fe5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161017f565b843b61264c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161017f565b600080866001600160a01b031685876040516126689190612cd5565b60006040518083038185875af1925050503d80600081146126a5576040519150601f19603f3d011682016040523d82523d6000602084013e6126aa565b606091505b50915091506126ba8282866127e9565b979650505050505050565b80158061274e5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561271457600080fd5b505afa158015612728573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061274c9190612c3a565b155b6127b95760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606482015260840161017f565b6040516001600160a01b038316602482015260448101829052610d7a90849063095ea7b360e01b9060640161124b565b606083156127f8575081612416565b8251156128085782518084602001fd5b8160405162461bcd60e51b815260040161017f9190612dae565b60405180608001604052806004906020820280368337509192915050565b60405180606001604052806003906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b80356124ae81612f17565b80516124ae81612f17565b60008083601f8401126128a3578182fd5b50813567ffffffffffffffff8111156128ba578182fd5b6020830191508360208260051b85010111156128d557600080fd5b9250929050565b80356124ae81612f2f565b805160ff811681146124ae57600080fd5b600060208284031215612909578081fd5b813561241681612f17565b600060208284031215612925578081fd5b815161241681612f17565b60008060408385031215612942578081fd5b823561294d81612f17565b9150602083013561295d81612f17565b809150509250929050565b6000806000806000806000806000806101208b8d031215612987578586fd5b8a3561299281612f17565b995060208b01356129a281612f17565b985060408b01356129b281612f17565b975060608b0135965060808b0135955060a08b01356129d081612f17565b945060c08b013567ffffffffffffffff808211156129ec578586fd5b818d0191508d601f8301126129ff578586fd5b813581811115612a0d578687fd5b8e6020828501011115612a1e578687fd5b602083019650809550505050612a3660e08c0161287c565b9150612a456101008c016128dc565b90509295989b9194979a5092959850565b60008060408385031215612a68578182fd5b8235612a7381612f17565b9150602083013561295d81612f2f565b600060808284031215612a94578081fd5b82601f830112612aa2578081fd5b6040516080810181811067ffffffffffffffff82111715612ac557612ac5612f01565b604052808360808101861015612ad9578384fd5b835b6004811015612b0257612aed82612887565b83526020928301929190910190600101612adb565b509195945050505050565b60008060208385031215612b1f578182fd5b823567ffffffffffffffff811115612b35578283fd5b612b4185828601612892565b90969095509350505050565b60008060008060408587031215612b62578384fd5b843567ffffffffffffffff80821115612b79578586fd5b612b8588838901612892565b90965094506020870135915080821115612b9d578384fd5b50612baa87828801612892565b95989497509550505050565b600060208284031215612bc7578081fd5b813561241681612f2f565b600060208284031215612be3578081fd5b815161241681612f2f565b60008060408385031215612c00578182fd5b8251612c0b81612f2f565b9150612c19602084016128e7565b90509250929050565b600060208284031215612c33578081fd5b5035919050565b600060208284031215612c4b578081fd5b5051919050565b600060208284031215612c63578081fd5b612416826128e7565b8060005b6002811015610770578151845260209384019390910190600101612c70565b8060005b6003811015610770578151845260209384019390910190600101612c93565b8060005b6004811015610770578151845260209384019390910190600101612cb6565b60008251612ce7818460208701612e84565b9190910192915050565b60608101612cff8285612c6c565b8260408301529392505050565b60808101612d1a8286612c6c565b8360408301528215156060830152949350505050565b60808101612d3e8285612c8f565b8260608301529392505050565b60a08101612d598286612c8f565b8360608301528215156080830152949350505050565b60a08101612d7d8285612cb2565b8260808301529392505050565b60c08101612d988286612cb2565b83608083015282151560a0830152949350505050565b6020815260008251806020840152612dcd816040850160208701612e84565b601f01601f19169190910160400192915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115612e2957612e29612eeb565b500190565b600082612e4957634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615612e6857612e68612eeb565b500290565b600082821015612e7f57612e7f612eeb565b500390565b60005b83811015612e9f578181015183820152602001612e87565b838111156107705750506000910152565b6000600019821415612ec457612ec4612eeb565b5060010190565b600060ff821660ff811415612ee257612ee2612eeb565b60010192915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114612f2c57600080fd5b50565b8015158114612f2c57600080fdfea264697066735822122056b62d8f456f0d20b508e34ddd28622c31e5a0b92763f69ff59c870972b63be964736f6c634300080400330000000000000000000000008aee0a8a05a319bfca41ff2e95c48f3f8638321100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

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

0000000000000000000000008aee0a8a05a319bfca41ff2e95c48f3f8638321100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _curveRegistry (address): 0x8AEE0a8A05A319BfCa41fF2E95C48f3F86383211
Arg [1] : _goodwill (uint256): 0
Arg [2] : _affiliateSplit (uint256): 0

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000008aee0a8a05a319bfca41ff2e95c48f3f86383211
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 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.