Contract 0x82b66cf68e377e6f207b97c4c6fa7b43d2204322

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xe70a78e9faddf49d7de4890f8345d94c7df209852be3e7f55bd922f1e93a7158Zap301655892022-06-30 6:37:2612 hrs 9 mins ago0x141bc355bd408b706a8802bd5262164bc27de3ff IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.016101551806 68.831229295
0xd58f84f1f34a1f31c2623b89074f14a59c0145d128ce4a3518a265db114aa805Zap301078262022-06-28 18:55:011 day 23 hrs ago0x141bc355bd408b706a8802bd5262164bc27de3ff IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.007724405852 33.950000012
0xbc6cc429556fe83bbb74648ec514b0f179308222b8b8edda344ec0b40f4f7f01Zap301078042022-06-28 18:54:171 day 23 hrs ago0x141bc355bd408b706a8802bd5262164bc27de3ff IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.007520409667 32.150043893
0x2ef9a1c012d9adabc18cb91710938832a89f338421f6bd32b91a57e828f8232fZap301077022022-06-28 18:50:451 day 23 hrs ago0x141bc355bd408b706a8802bd5262164bc27de3ff IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.010618732178 42.139999996
0x4dd99e87f6a824c3566351383c6c9d4fca26f74a2e14fc622a73ee186b176608Zap301075682022-06-28 18:45:392 days 1 min ago0x141bc355bd408b706a8802bd5262164bc27de3ff IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.008738889623 34.681574058
0xe6b77040da9b37de5bdfa193a56c2d243b1f51ddfb4bdc0c4d36eb3e10080b24Zap301075252022-06-28 18:42:472 days 3 mins ago0x141bc355bd408b706a8802bd5262164bc27de3ff IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.007560270004 30.000000017
0xfa70700fc061800593f9d5b509296f42a2b829b6bfb0eb3884252e73179d5224Zap Token Swap301065102022-06-28 18:05:332 days 41 mins ago0x141bc355bd408b706a8802bd5262164bc27de3ff IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.009518310227 30.000000717
0x1adc0e1f923cbac4180399f6952dc9f8f81f68f5d790b6a2e447755185bc7b1fZap299732632022-06-25 7:15:315 days 11 hrs ago0x141bc355bd408b706a8802bd5262164bc27de3ff IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.007559550006 30.000000027
0x72ddef08c52cf5d4ec41038fc769c32db51601bc6890dcd814242ed16e941f88Zap Token Swap299148982022-06-23 17:57:117 days 49 mins ago0x141bc355bd408b706a8802bd5262164bc27de3ff IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.011718233482 31.614251981
0xe9081ad6c88fc9c5253822192fae5e94a0972fb447a0069982fcdba22c321374Zap Token Swap297803182022-06-20 5:34:4010 days 13 hrs ago0x141bc355bd408b706a8802bd5262164bc27de3ff IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.014196865801 38.220125996
0x24a47be5d955cc12dd9daadcd7aad35802ff1c34525f382b9a689c8426cae544Zap Token Swap296941552022-06-17 23:36:5412 days 19 hrs ago0xad915b57fa83355ba26a07774f881f83894bf7c4 IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.010864091805 34.221600016
0x30a018a2c28a3dcea80a54431d39de21c8f5a90deae4518d79d619a3a41002bbZap Token Swap296901652022-06-17 21:04:4612 days 21 hrs ago0xcecef95cfed56fb99f8fd6fcbcbdcd6f9506ca97 IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.014251682424 43.318842002
0xa7fcca54904f634f03fa4f3deb821ad0608fe27b3b3ade0364eda36deba345ebZap Token Swap296747832022-06-17 11:30:3113 days 7 hrs ago0xcecef95cfed56fb99f8fd6fcbcbdcd6f9506ca97 IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.011284528504 34.300000013
0x4bb16f156f6315cefaa0a92745900c8310cdf05a6a0959a2c31898dd532e536fZap Token Swap296699102022-06-17 8:28:5013 days 10 hrs ago0xcecef95cfed56fb99f8fd6fcbcbdcd6f9506ca97 IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.016355856999 48.999999999
0x3c5e5fdac3d73395141d28979f73486b0624acb6027ce147c72789dd69cd46bfZap Token Swap296449932022-06-16 17:31:0914 days 1 hr ago0x487175f921a713d8e67a95bcdd75139c35a7d838 IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.012639912841 39.813382433
0xb7cb738fd08e3d825464324087dcd914326a8f41244190b0abd2663a8c2a1210Zap296411472022-06-16 15:07:2314 days 3 hrs ago0x487175f921a713d8e67a95bcdd75139c35a7d838 IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.019421038632 82.740597953
0x92b6361daa0760f604608c373057ecd05896536e20715ec106beedddb08333fcZap296377382022-06-16 12:59:2514 days 5 hrs ago0x487175f921a713d8e67a95bcdd75139c35a7d838 IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.008086692539 35.523572169
0xc33b18ed4e9e0b2bc2a6076c272ad82116d4b8078671266c6d8ce9bc2c07a3d2Zap296125122022-06-15 21:12:5314 days 21 hrs ago0x7a0ef482134aa53468850a7b117eca38a6a3003d IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.007305135112 31.030882113
0xf41bbc0c676325f74ada67f41aad4b5b45523975d2d2d822978053166b1e5aa8Zap296125002022-06-15 21:12:2914 days 21 hrs ago0x7a0ef482134aa53468850a7b117eca38a6a3003d IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.007302390085 31.953468598
0x661868a596c4b603588063c55265f3475685cd51f2e2b8b536daa8f23f23745aZap Token Swap296122012022-06-15 21:02:1114 days 21 hrs ago0xcecef95cfed56fb99f8fd6fcbcbdcd6f9506ca97 IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.01031759128 31.359983223
0xc1cb882e1eb94e8d793ab80e35187921cfba5f46f2dffd5a2c93f40757ff490dZap Token Swap296117172022-06-15 20:45:3514 days 22 hrs ago0xcecef95cfed56fb99f8fd6fcbcbdcd6f9506ca97 IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.012834242135 38.449704263
0x38bef8dc2ecae7229cec912789ac5651c6f674da1ce8484935bc2f398017c60cZap296011722022-06-15 14:37:2415 days 4 hrs ago0x771d1a7d23d30f9030bc607a559ce3e7496d8422 IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.009146593009 38.949683003
0xddff4edc0c1f37badbd69e03f6fa422658706a8faf8de841520eb46e4c99b09eZap295999222022-06-15 13:52:1615 days 4 hrs ago0x13d3fb701ef7cbf86b651e41e316170793320fe6 IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.061424113174 261.688777253
0x30cb25e588367f02dd24523d6f8eb04dab29d95f63379ad0b5366a786d442e49Zap295980002022-06-15 12:39:4815 days 6 hrs ago0xcecef95cfed56fb99f8fd6fcbcbdcd6f9506ca97 IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.008290352392 35.319577003
0x76e9d91d7868b25b6df32c7a09370003bacfbbf4abe983569c246c9879f77ba0Zap Token Swap295979422022-06-15 12:37:4815 days 6 hrs ago0xcecef95cfed56fb99f8fd6fcbcbdcd6f9506ca97 IN  0x82b66cf68e377e6f207b97c4c6fa7b43d22043220 MATIC0.010729761691 32.612167045
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CarbonicZap

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 4 : CarbonicZap.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import "@openzeppelin/contracts-0.8/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-0.8/access/Ownable.sol";

library Babylonian {
    function sqrt(uint256 x) internal pure returns (uint256) {
        if (x == 0) return 0;
        uint256 xx = x;
        uint256 r = 1;
        if (xx >= 0x100000000000000000000000000000000) {
            xx >>= 128;
            r <<= 64;
        }
        if (xx >= 0x10000000000000000) {
            xx >>= 64;
            r <<= 32;
        }
        if (xx >= 0x100000000) {
            xx >>= 32;
            r <<= 16;
        }
        if (xx >= 0x10000) {
            xx >>= 16;
            r <<= 8;
        }
        if (xx >= 0x100) {
            xx >>= 8;
            r <<= 4;
        }
        if (xx >= 0x10) {
            xx >>= 4;
            r <<= 2;
        }
        if (xx >= 0x8) {
            r <<= 1;
        }
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1; // Seven iterations should be enough
        uint256 r1 = x / r;
        return (r < r1 ? r : r1);
    }
}

interface IUniswapV2Router01 {
    function factory() external pure returns (address);
    function WETH() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);
    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETHWithPermit(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountToken, uint amountETH);
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}

interface IUniswapV2Router02 is IUniswapV2Router01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountETH);
    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountETH);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
}

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

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

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

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

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

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

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

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

    function initialize(address, address) external;
}

interface IWMATIC is IERC20 {
    function deposit() external payable;
    function withdraw(uint amount) external;
}

contract CarbonicZap is Ownable {
    address public BCT = 0x2F800Db0fdb5223b3C3f354886d907A671414A7F;
    address public WMATIC = 0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270;
    address public USDC = 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174;

    address public Router = 0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506;
    mapping(address => mapping(address => address)) public zapTokens;

    uint256 public constant MAX_INT = 2 ** 256 - 1;

    function setZapTokens(address token0, address token1, address pair) external onlyOwner {
        zapTokens[token0][token1] = pair;
        zapTokens[token1][token0] = pair;
    }

    function zap(address token0, address token1, uint256 amount, uint256 minLiquidity) external {
        require(amount > 0, "CarbonicZap: invalid amount");
        IERC20(token0).transferFrom(msg.sender, address(this), amount);
        _zap(token0, token1, amount, minLiquidity);
    }

    function zapMaticSwap(address[] calldata swapPath, address token0, address token1, uint256 minLiquidity) external payable {
        require(msg.value > 0, "CarbonicZap: invalid amount");
        uint256[] memory amounts = IUniswapV2Router02(Router).swapExactETHForTokens{value: msg.value}(
            1,
            swapPath,
            address(this),
            block.timestamp
        );
        _zap(token0, token1, amounts[amounts.length - 1], minLiquidity);
    }

    function zapTokenSwap(
        address[] calldata swapPath,
        uint256 amount,
        address token0,
        address token1,
        uint256 minLiquidity
    ) external {
        require(amount > 0, "CarbonicZap: invalid amount");
        IERC20(swapPath[0]).transferFrom(msg.sender, address(this), amount);
        IERC20(swapPath[0]).approve(Router, MAX_INT);
        uint256[] memory amounts = IUniswapV2Router02(Router).swapExactTokensForTokens(
            amount,
            1,
            swapPath,
            address(this),
            block.timestamp
        );
        _zap(token0, token1, amounts[amounts.length - 1], minLiquidity);
    }

    function _zap(address token0, address token1, uint256 amount, uint256 minLiquidity) internal {
        address pair = zapTokens[token0][token1];
        require(pair != address(0), "CarbonicZap: invalid pair");
        IERC20(token0).approve(Router, MAX_INT);
        IERC20(token1).approve(Router, MAX_INT);
        uint256 swapAmount = _calcSwapAmount(token0, amount, pair);
        uint256[] memory amounts = IUniswapV2Router02(Router).swapExactTokensForTokens(
            swapAmount,
            1,
            _swapPath(token0, token1),
            address(this),
            block.timestamp
        );
        (,, uint256 liquidity) = IUniswapV2Router02(Router).addLiquidity(
            token0,
            token1,
            amount - swapAmount,
            amounts[amounts.length - 1],
            1,
            1,
            msg.sender,
            block.timestamp
        );
        require(liquidity >= minLiquidity, "CarbonicZap: insufficient out");
        IERC20(token0).transfer(msg.sender, IERC20(token0).balanceOf(address(this)));
        IERC20(token1).transfer(msg.sender, IERC20(token1).balanceOf(address(this)));
    }

    function _calcSwapAmount(address token, uint256 amount, address pair) internal view returns (uint256 swapAmount) {
        address token0 = IUniswapV2Pair(pair).token0();
        (uint256 reserve0, uint256 reserve1,) = IUniswapV2Pair(pair).getReserves();
        if (token0 == token) {
            swapAmount = _calcAmount(reserve0, amount);
        } else {
            swapAmount = _calcAmount(reserve1, amount);
        }
        if (swapAmount == 0) {
            swapAmount = amount / 2;
        }
    }

    function _calcAmount(uint256 reserveIn, uint256 tokenIn) internal pure returns (uint256) {
        return (Babylonian.sqrt(reserveIn * ((tokenIn * 3988000) + (reserveIn * 3988009))) - (reserveIn * 1997)) / 1994;
    }

    function _swapPath(address first, address second) internal pure returns (address[] memory) {
        address[] memory path = new address[](2);
        path[0] = first;
        path[1] = second;
        return path;
    }

    function recoverToken(address token) external onlyOwner {
        IERC20(token).transfer(owner(), IERC20(token).balanceOf(address(this)));
    }

    function recoverMATIC() external onlyOwner {
        (bool success,) = owner().call{value: address(this).balance}("");
        require(success, "CarbonicZap: transfer failed");
    }
}

File 2 of 4 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

    /**
     * @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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 3 of 4 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

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() {
        _transferOwnership(_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 {
        _transferOwnership(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");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 4 of 4 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

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) {
        return msg.data;
    }
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"BCT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_INT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"Router","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDC","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WMATIC","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"recoverMATIC","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"recoverToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"address","name":"pair","type":"address"}],"name":"setZapTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minLiquidity","type":"uint256"}],"name":"zap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"swapPath","type":"address[]"},{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint256","name":"minLiquidity","type":"uint256"}],"name":"zapMaticSwap","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[]","name":"swapPath","type":"address[]"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint256","name":"minLiquidity","type":"uint256"}],"name":"zapTokenSwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"zapTokens","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

6080604052600180546001600160a01b0319908116732f800db0fdb5223b3c3f354886d907a671414a7f17909155600280548216730d500b1d8e8ef31e21c99d1db9a6444d3adf1270179055600380548216732791bca1f2de4661ed88a30c99a7a9449aa8417417905560048054909116731b02da8cb0d097eb8d57a175b88c7d8b4799750617905534801561009457600080fd5b5061009e336100a3565b6100f3565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b611a33806101026000396000f3fe6080604052600436106100e85760003560e01c80638903ca5c1161008a578063d4044f9811610059578063d4044f981461026c578063df4fd9701461028c578063f2fde38b146102ac578063f6d7eade146102cc57600080fd5b80638903ca5c146101cd57806389a302711461020e5780638da5cb5b1461022e5780639be65a601461024c57600080fd5b80634c8ff793116100c65780634c8ff793146101705780634d95cad914610185578063528d12df146101a5578063715018a6146101b857600080fd5b8063098d3228146100ed5780631e8d20e2146101165780633b70458814610138575b600080fd5b3480156100f957600080fd5b5061010360001981565b6040519081526020015b60405180910390f35b34801561012257600080fd5b506101366101313660046114ab565b6102ec565b005b34801561014457600080fd5b50600154610158906001600160a01b031681565b6040516001600160a01b03909116815260200161010d565b34801561017c57600080fd5b50610136610378565b34801561019157600080fd5b50600254610158906001600160a01b031681565b6101366101b336600461153c565b610448565b3480156101c457600080fd5b50610136610537565b3480156101d957600080fd5b506101586101e8366004611472565b60056020908152600092835260408084209091529082529020546001600160a01b031681565b34801561021a57600080fd5b50600354610158906001600160a01b031681565b34801561023a57600080fd5b506000546001600160a01b0316610158565b34801561025857600080fd5b50610136610267366004611438565b61056d565b34801561027857600080fd5b506101366102873660046115ac565b6106b1565b34801561029857600080fd5b506101366102a73660046114f6565b6108e8565b3480156102b857600080fd5b506101366102c7366004611438565b6109a1565b3480156102d857600080fd5b50600454610158906001600160a01b031681565b6000546001600160a01b0316331461031f5760405162461bcd60e51b81526004016103169061181b565b60405180910390fd5b6001600160a01b03928316600081815260056020818152604080842096881684529581528583208054979095166001600160a01b0319978816811790955590815284822092825291909152919091208054909216179055565b6000546001600160a01b031633146103a25760405162461bcd60e51b81526004016103169061181b565b600080546040516001600160a01b039091169047908381818185875af1925050503d80600081146103ef576040519150601f19603f3d011682016040523d82523d6000602084013e6103f4565b606091505b50509050806104455760405162461bcd60e51b815260206004820152601c60248201527f436172626f6e69635a61703a207472616e73666572206661696c6564000000006044820152606401610316565b50565b600034116104685760405162461bcd60e51b815260040161031690611850565b60048054604051637ff36ab560e01b81526000926001600160a01b0390921691637ff36ab59134916104a5916001918c918c9130914291016117e4565b6000604051808303818588803b1580156104be57600080fd5b505af11580156104d2573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526104fb9190810190611628565b905061052f84848360018551610511919061198f565b81518110610521576105216119bc565b602002602001015185610a39565b505050505050565b6000546001600160a01b031633146105615760405162461bcd60e51b81526004016103169061181b565b61056b6000610fbd565b565b6000546001600160a01b031633146105975760405162461bcd60e51b81526004016103169061181b565b806001600160a01b031663a9059cbb6105b86000546001600160a01b031690565b6040516370a0823160e01b81523060048201526001600160a01b038516906370a082319060240160206040518083038186803b1580156105f757600080fd5b505afa15801561060b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062f9190611754565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561067557600080fd5b505af1158015610689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ad91906116ed565b5050565b600084116106d15760405162461bcd60e51b815260040161031690611850565b858560008181106106e4576106e46119bc565b90506020020160208101906106f99190611438565b6040516323b872dd60e01b8152336004820152306024820152604481018690526001600160a01b0391909116906323b872dd90606401602060405180830381600087803b15801561074957600080fd5b505af115801561075d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078191906116ed565b5085856000818110610795576107956119bc565b90506020020160208101906107aa9190611438565b6004805460405163095ea7b360e01b81526001600160a01b03918216928101929092526000196024830152919091169063095ea7b390604401602060405180830381600087803b1580156107fd57600080fd5b505af1158015610811573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083591906116ed565b50600480546040516338ed173960e01b81526000926001600160a01b03909216916338ed1739916108739189916001918d918d913091429101611887565b600060405180830381600087803b15801561088d57600080fd5b505af11580156108a1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108c99190810190611628565b90506108df84848360018551610511919061198f565b50505050505050565b600082116109085760405162461bcd60e51b815260040161031690611850565b6040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b038516906323b872dd90606401602060405180830381600087803b15801561095657600080fd5b505af115801561096a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098e91906116ed565b5061099b84848484610a39565b50505050565b6000546001600160a01b031633146109cb5760405162461bcd60e51b81526004016103169061181b565b6001600160a01b038116610a305760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610316565b61044581610fbd565b6001600160a01b03808516600090815260056020908152604080832087851684529091529020541680610aae5760405162461bcd60e51b815260206004820152601960248201527f436172626f6e69635a61703a20696e76616c69642070616972000000000000006044820152606401610316565b6004805460405163095ea7b360e01b81526001600160a01b0391821692810192909252600019602483015286169063095ea7b390604401602060405180830381600087803b158015610aff57600080fd5b505af1158015610b13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3791906116ed565b506004805460405163095ea7b360e01b81526001600160a01b0391821692810192909252600019602483015285169063095ea7b390604401602060405180830381600087803b158015610b8957600080fd5b505af1158015610b9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc191906116ed565b506000610bcf86858461100d565b6004549091506000906001600160a01b03166338ed1739836001610bf38b8b611163565b30426040518663ffffffff1660e01b8152600401610c159594939291906118c5565b600060405180830381600087803b158015610c2f57600080fd5b505af1158015610c43573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610c6b9190810190611628565b6004549091506000906001600160a01b031663e8e337008989610c8e878b61198f565b8660018851610c9d919061198f565b81518110610cad57610cad6119bc565b60209081029190910101516040516001600160e01b031960e087901b1681526001600160a01b0394851660048201529390921660248401526044830152606482015260016084820181905260a48201523360c48201524260e482015261010401606060405180830381600087803b158015610d2757600080fd5b505af1158015610d3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5f919061176d565b9250505084811015610db35760405162461bcd60e51b815260206004820152601d60248201527f436172626f6e69635a61703a20696e73756666696369656e74206f75740000006044820152606401610316565b6040516370a0823160e01b81523060048201526001600160a01b0389169063a9059cbb90339083906370a082319060240160206040518083038186803b158015610dfc57600080fd5b505afa158015610e10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e349190611754565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b158015610e7a57600080fd5b505af1158015610e8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb291906116ed565b506040516370a0823160e01b81523060048201526001600160a01b0388169063a9059cbb90339083906370a082319060240160206040518083038186803b158015610efc57600080fd5b505afa158015610f10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f349190611754565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b158015610f7a57600080fd5b505af1158015610f8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb291906116ed565b505050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080826001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561104957600080fd5b505afa15801561105d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110819190611455565b9050600080846001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156110bf57600080fd5b505afa1580156110d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110f7919061170f565b506001600160701b031691506001600160701b03169150866001600160a01b0316836001600160a01b031614156111395761113282876111f0565b9350611146565b61114381876111f0565b93505b836111595761115660028761194e565b93505b5050509392505050565b60408051600280825260608083018452926000929190602083019080368337019050509050838160008151811061119c5761119c6119bc565b60200260200101906001600160a01b031690816001600160a01b03168152505082816001815181106111d0576111d06119bc565b6001600160a01b0390921660209283029190910190910152905092915050565b60006107ca611201846107cd611970565b61123761121186623cda29611970565b61121e86623cda20611970565b6112289190611936565b6112329087611970565b611252565b611241919061198f565b61124b919061194e565b9392505050565b60008161126157506000919050565b816001600160801b821061127a5760809190911c9060401b5b6801000000000000000082106112955760409190911c9060201b5b64010000000082106112ac5760209190911c9060101b5b6201000082106112c15760109190911c9060081b5b61010082106112d55760089190911c9060041b5b601082106112e85760049190911c9060021b5b600882106112f45760011b5b6001611300828661194e565b61130a9083611936565b901c9050600161131a828661194e565b6113249083611936565b901c90506001611334828661194e565b61133e9083611936565b901c9050600161134e828661194e565b6113589083611936565b901c90506001611368828661194e565b6113729083611936565b901c90506001611382828661194e565b61138c9083611936565b901c9050600161139c828661194e565b6113a69083611936565b901c905060006113b6828661194e565b90508082106113c557806113c7565b815b95945050505050565b60008083601f8401126113e257600080fd5b50813567ffffffffffffffff8111156113fa57600080fd5b6020830191508360208260051b850101111561141557600080fd5b9250929050565b80516001600160701b038116811461143357600080fd5b919050565b60006020828403121561144a57600080fd5b813561124b816119e8565b60006020828403121561146757600080fd5b815161124b816119e8565b6000806040838503121561148557600080fd5b8235611490816119e8565b915060208301356114a0816119e8565b809150509250929050565b6000806000606084860312156114c057600080fd5b83356114cb816119e8565b925060208401356114db816119e8565b915060408401356114eb816119e8565b809150509250925092565b6000806000806080858703121561150c57600080fd5b8435611517816119e8565b93506020850135611527816119e8565b93969395505050506040820135916060013590565b60008060008060006080868803121561155457600080fd5b853567ffffffffffffffff81111561156b57600080fd5b611577888289016113d0565b909650945050602086013561158b816119e8565b9250604086013561159b816119e8565b949793965091946060013592915050565b60008060008060008060a087890312156115c557600080fd5b863567ffffffffffffffff8111156115dc57600080fd5b6115e889828a016113d0565b909750955050602087013593506040870135611603816119e8565b92506060870135611613816119e8565b80925050608087013590509295509295509295565b6000602080838503121561163b57600080fd5b825167ffffffffffffffff8082111561165357600080fd5b818501915085601f83011261166757600080fd5b815181811115611679576116796119d2565b8060051b604051601f19603f8301168101818110858211171561169e5761169e6119d2565b604052828152858101935084860182860187018a10156116bd57600080fd5b600095505b838610156116e05780518552600195909501949386019386016116c2565b5098975050505050505050565b6000602082840312156116ff57600080fd5b8151801515811461124b57600080fd5b60008060006060848603121561172457600080fd5b61172d8461141c565b925061173b6020850161141c565b9150604084015163ffffffff811681146114eb57600080fd5b60006020828403121561176657600080fd5b5051919050565b60008060006060848603121561178257600080fd5b8351925060208401519150604084015190509250925092565b8183526000602080850194508260005b858110156117d95781356117be816119e8565b6001600160a01b0316875295820195908201906001016117ab565b509495945050505050565b8581526080602082015260006117fe60808301868861179b565b6001600160a01b0394909416604083015250606001529392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601b908201527f436172626f6e69635a61703a20696e76616c696420616d6f756e740000000000604082015260600190565b86815285602082015260a0604082015260006118a760a08301868861179b565b6001600160a01b039490941660608301525060800152949350505050565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119155784516001600160a01b0316835293830193918301916001016118f0565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611949576119496119a6565b500190565b60008261196b57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561198a5761198a6119a6565b500290565b6000828210156119a1576119a16119a6565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461044557600080fdfea2646970667358221220efa0e438faf91477ec820981a7b4495f33478a05462665de7d9899209254a93f64736f6c63430008070033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
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.