uniV2Router02

    0

    0

    lucycodes42

    Solidity Code Snippets

    The code snippet above contains the implementation of the UniswapV2Router02 contract. This contract is deployed at 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D on the Ethereum mainnet, and the Ropsten, Rinkeby, Görli, and Kovan testnets.

    In addition to the IUniswapV2Router02 interface, the UniswapV2Router02 contract also has two external functions. The first function, removeLiquidityETHSupportingFeeOnTransferTokens, is used to remove the liquidity fee associated with the transfer of tokens. The second function, removeLiquidityETHWithPermitSupportingFeeOnTransferTokens, is used to remove the liquidity fee associated with the transfer of ETH with a permit.

    Shortcut: uni_v2_router02

    // https://uniswap.org/docs/v2/smart-contracts/router02/
    // https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/UniswapV2Router02.sol implementation
    // UniswapV2Router02 is deployed at 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D on the Ethereum mainnet, and the Ropsten, Rinkeby, Görli, and Kovan testnets.
    
    // SPDX-License-Identifier: MIT
    pragma solidity >=0.6.2;
    
    // You can add this typing "uniV2Router01" 
    import './IUniswapV2Router01.sol';
    
    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;
    }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.