Contract Address Details

0xE3D8bd6Aed4F159bc8000a9cD47CffDb95F96121

Contract Name
UniswapV2Router02
Creator
0x4a27c0–5f6ee3 at 0xe759ce–912223
Balance
0.019936660190751762 CELO
Tokens
Fetching tokens...
Transactions
Transfers
Gas Used
Last Balance Update
10249443
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
UniswapV2Router02




Optimization enabled
true
Compiler version
v0.6.12+commit.27d51765




Optimization runs
5000
EVM Version
istanbul




Verified at
2021-07-28 18:09:15.595451Z

Contract source code

// SPDX-License-Identifier: MIT
pragma solidity =0.6.12;
import './libraries/UniswapV2Library.sol';
import './libraries/SafeMath.sol';
import './libraries/TransferHelper.sol';
import './interfaces/IUniswapV2Router02.sol';
import './interfaces/IUniswapV2Factory.sol';
import './interfaces/IERC20.sol';
contract UniswapV2Router02 is IUniswapV2Router02 {
using SafeMathUniswap for uint;
address public immutable override factory;
modifier ensure(uint deadline) {
require(deadline >= block.timestamp, 'UniswapV2Router: EXPIRED');
_;
}
constructor(address _factory) public {
factory = _factory;
}
// **** ADD LIQUIDITY ****
function _addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin
) internal virtual returns (uint amountA, uint amountB) {
// create the pair if it doesn't exist yet
if (IUniswapV2Factory(factory).getPair(tokenA, tokenB) == address(0)) {
IUniswapV2Factory(factory).createPair(tokenA, tokenB);
}
(uint reserveA, uint reserveB) = UniswapV2Library.getReserves(factory, tokenA, tokenB);
if (reserveA == 0 && reserveB == 0) {
(amountA, amountB) = (amountADesired, amountBDesired);
} else {
uint amountBOptimal = UniswapV2Library.quote(amountADesired, reserveA, reserveB);
if (amountBOptimal <= amountBDesired) {
require(amountBOptimal >= amountBMin, 'UniswapV2Router: INSUFFICIENT_B_AMOUNT');
(amountA, amountB) = (amountADesired, amountBOptimal);
} else {
uint amountAOptimal = UniswapV2Library.quote(amountBDesired, reserveB, reserveA);
assert(amountAOptimal <= amountADesired);
require(amountAOptimal >= amountAMin, 'UniswapV2Router: INSUFFICIENT_A_AMOUNT');
(amountA, amountB) = (amountAOptimal, amountBDesired);
}
}
}
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external virtual override ensure(deadline) returns (uint amountA, uint amountB, uint liquidity) {
(amountA, amountB) = _addLiquidity(tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin);
address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB);
TransferHelper.safeTransferFrom(tokenA, msg.sender, pair, amountA);
TransferHelper.safeTransferFrom(tokenB, msg.sender, pair, amountB);
liquidity = IUniswapV2Pair(pair).mint(to);
}
// **** REMOVE LIQUIDITY ****
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) public virtual override ensure(deadline) returns (uint amountA, uint amountB) {
address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB);
IUniswapV2Pair(pair).transferFrom(msg.sender, pair, liquidity); // send liquidity to pair
(uint amount0, uint amount1) = IUniswapV2Pair(pair).burn(to);
(address token0,) = UniswapV2Library.sortTokens(tokenA, tokenB);
(amountA, amountB) = tokenA == token0 ? (amount0, amount1) : (amount1, amount0);
require(amountA >= amountAMin, 'UniswapV2Router: INSUFFICIENT_A_AMOUNT');
require(amountB >= amountBMin, 'UniswapV2Router: INSUFFICIENT_B_AMOUNT');
}
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 virtual override returns (uint amountA, uint amountB) {
address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB);
uint value = approveMax ? uint(-1) : liquidity;
IUniswapV2Pair(pair).permit(msg.sender, address(this), value, deadline, v, r, s);
(amountA, amountB) = removeLiquidity(tokenA, tokenB, liquidity, amountAMin, amountBMin, to, deadline);
}
// **** SWAP ****
// requires the initial amount to have already been sent to the first pair
function _swap(uint[] memory amounts, address[] memory path, address _to) internal virtual {
for (uint i; i < path.length - 1; i++) {
(address input, address output) = (path[i], path[i + 1]);
(address token0,) = UniswapV2Library.sortTokens(input, output);
uint amountOut = amounts[i + 1];
(uint amount0Out, uint amount1Out) = input == token0 ? (uint(0), amountOut) : (amountOut, uint(0));
address to = i < path.length - 2 ? UniswapV2Library.pairFor(factory, output, path[i + 2]) : _to;
IUniswapV2Pair(UniswapV2Library.pairFor(factory, input, output)).swap(
amount0Out, amount1Out, to, new bytes(0)
);
}
}
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external virtual override ensure(deadline) returns (uint[] memory amounts) {
amounts = UniswapV2Library.getAmountsOut(factory, amountIn, path);
require(amounts[amounts.length - 1] >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT');
TransferHelper.safeTransferFrom(
path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0]
);
_swap(amounts, path, to);
}
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external virtual override ensure(deadline) returns (uint[] memory amounts) {
amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path);
require(amounts[0] <= amountInMax, 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT');
TransferHelper.safeTransferFrom(
path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0]
);
_swap(amounts, path, to);
}
// **** SWAP (supporting fee-on-transfer tokens) ****
// requires the initial amount to have already been sent to the first pair
function _swapSupportingFeeOnTransferTokens(address[] memory path, address _to) internal virtual {
for (uint i; i < path.length - 1; i++) {
(address input, address output) = (path[i], path[i + 1]);
(address token0,) = UniswapV2Library.sortTokens(input, output);
IUniswapV2Pair pair = IUniswapV2Pair(UniswapV2Library.pairFor(factory, input, output));
uint amountInput;
uint amountOutput;
{ // scope to avoid stack too deep errors
(uint reserve0, uint reserve1,) = pair.getReserves();
(uint reserveInput, uint reserveOutput) = input == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
amountInput = IERC20Uniswap(input).balanceOf(address(pair)).sub(reserveInput);
amountOutput = UniswapV2Library.getAmountOut(amountInput, reserveInput, reserveOutput);
}
(uint amount0Out, uint amount1Out) = input == token0 ? (uint(0), amountOutput) : (amountOutput, uint(0));
address to = i < path.length - 2 ? UniswapV2Library.pairFor(factory, output, path[i + 2]) : _to;
pair.swap(amount0Out, amount1Out, to, new bytes(0));
}
}
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external virtual override ensure(deadline) {
TransferHelper.safeTransferFrom(
path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amountIn
);
uint balanceBefore = IERC20Uniswap(path[path.length - 1]).balanceOf(to);
_swapSupportingFeeOnTransferTokens(path, to);
require(
IERC20Uniswap(path[path.length - 1]).balanceOf(to).sub(balanceBefore) >= amountOutMin,
'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT'
);
}
// **** LIBRARY FUNCTIONS ****
function quote(uint amountA, uint reserveA, uint reserveB) public pure virtual override returns (uint amountB) {
return UniswapV2Library.quote(amountA, reserveA, reserveB);
}
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut)
public
pure
virtual
override
returns (uint amountOut)
{
return UniswapV2Library.getAmountOut(amountIn, reserveIn, reserveOut);
}
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut)
public
pure
virtual
override
returns (uint amountIn)
{
return UniswapV2Library.getAmountIn(amountOut, reserveIn, reserveOut);
}
function getAmountsOut(uint amountIn, address[] memory path)
public
view
virtual
override
returns (uint[] memory amounts)
{
return UniswapV2Library.getAmountsOut(factory, amountIn, path);
}
function getAmountsIn(uint amountOut, address[] memory path)
public
view
virtual
override
returns (uint[] memory amounts)
{
return UniswapV2Library.getAmountsIn(factory, amountOut, path);
}
function pairFor(address tokenA, address tokenB)
public
view
override
returns (address)
{
return UniswapV2Library.pairFor(factory, tokenA, tokenB);
}
}

UniswapV2Library.sol

// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;
import '../interfaces/IUniswapV2Pair.sol';
import "./SafeMath.sol";
library UniswapV2Library {
using SafeMathUniswap for uint;
// returns sorted token addresses, used to handle return values from pairs sorted in this order
function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES');
(token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS');
}
// calculates the CREATE2 address for a pair without making any external calls
function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = sortTokens(tokenA, tokenB);
pair = address(uint(keccak256(abi.encodePacked(
hex'ff',
factory,
keccak256(abi.encodePacked(token0, token1)),
hex'b3b8ff62960acea3a88039ebcf80699f15786f1b17cebd82802f7375827a339c' // init code hash from UniswapV2Factory.pairCodeHash()
))));
}
// fetches and sorts the reserves for a pair
function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
(address token0,) = sortTokens(tokenA, tokenB);
(uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
(reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
}
// given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT');
require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
amountB = amountA.mul(reserveB) / reserveA;
}
// given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
uint amountInWithFee = amountIn.mul(997);
uint numerator = amountInWithFee.mul(reserveOut);
uint denominator = reserveIn.mul(1000).add(amountInWithFee);
amountOut = numerator / denominator;
}
// given an output amount of an asset and pair reserves, returns a required input amount of the other asset
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) {
require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
uint numerator = reserveIn.mul(amountOut).mul(1000);
uint denominator = reserveOut.sub(amountOut).mul(997);
amountIn = (numerator / denominator).add(1);
}
// performs chained getAmountOut calculations on any number of pairs
function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint[](path.length);
amounts[0] = amountIn;
for (uint i; i < path.length - 1; i++) {
(uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]);
amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
}
}
// performs chained getAmountIn calculations on any number of pairs
function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint[](path.length);
amounts[amounts.length - 1] = amountOut;
for (uint i = path.length - 1; i > 0; i--) {
(uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]);
amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
}
}
}

TransferHelper.sol

// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.6.0;
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(address token, address to, uint value) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED');
}
function safeTransfer(address token, address to, uint value) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED');
}
function safeTransferFrom(address token, address from, address to, uint value) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED');
}
function safeTransferETH(address to, uint value) internal {
(bool success,) = to.call{value:value}(new bytes(0));
require(success, 'TransferHelper: ETH_TRANSFER_FAILED');
}
}

SafeMath.sol

// SPDX-License-Identifier: MIT
pragma solidity =0.6.12;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMathUniswap {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}

IUniswapV2Router02.sol

// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2;
import './IUniswapV2Router01.sol';
interface IUniswapV2Router02 is IUniswapV2Router01 {
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function pairFor(address tokenA, address tokenB) external view returns (address);
}

IUniswapV2Router01.sol

// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() 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 removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
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 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 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);
}

IUniswapV2Pair.sol

// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;
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;
}

IUniswapV2Factory.sol

// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}

IERC20.sol

// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;
interface IERC20Uniswap {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view 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);
}

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_factory","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"amountA","internalType":"uint256"},{"type":"uint256","name":"amountB","internalType":"uint256"},{"type":"uint256","name":"liquidity","internalType":"uint256"}],"name":"addLiquidity","inputs":[{"type":"address","name":"tokenA","internalType":"address"},{"type":"address","name":"tokenB","internalType":"address"},{"type":"uint256","name":"amountADesired","internalType":"uint256"},{"type":"uint256","name":"amountBDesired","internalType":"uint256"},{"type":"uint256","name":"amountAMin","internalType":"uint256"},{"type":"uint256","name":"amountBMin","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"factory","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"}],"name":"getAmountIn","inputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"},{"type":"uint256","name":"reserveIn","internalType":"uint256"},{"type":"uint256","name":"reserveOut","internalType":"uint256"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"}],"name":"getAmountOut","inputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"uint256","name":"reserveIn","internalType":"uint256"},{"type":"uint256","name":"reserveOut","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"getAmountsIn","inputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"getAmountsOut","inputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"pairFor","inputs":[{"type":"address","name":"tokenA","internalType":"address"},{"type":"address","name":"tokenB","internalType":"address"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"amountB","internalType":"uint256"}],"name":"quote","inputs":[{"type":"uint256","name":"amountA","internalType":"uint256"},{"type":"uint256","name":"reserveA","internalType":"uint256"},{"type":"uint256","name":"reserveB","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"amountA","internalType":"uint256"},{"type":"uint256","name":"amountB","internalType":"uint256"}],"name":"removeLiquidity","inputs":[{"type":"address","name":"tokenA","internalType":"address"},{"type":"address","name":"tokenB","internalType":"address"},{"type":"uint256","name":"liquidity","internalType":"uint256"},{"type":"uint256","name":"amountAMin","internalType":"uint256"},{"type":"uint256","name":"amountBMin","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"amountA","internalType":"uint256"},{"type":"uint256","name":"amountB","internalType":"uint256"}],"name":"removeLiquidityWithPermit","inputs":[{"type":"address","name":"tokenA","internalType":"address"},{"type":"address","name":"tokenB","internalType":"address"},{"type":"uint256","name":"liquidity","internalType":"uint256"},{"type":"uint256","name":"amountAMin","internalType":"uint256"},{"type":"uint256","name":"amountBMin","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"},{"type":"bool","name":"approveMax","internalType":"bool"},{"type":"uint8","name":"v","internalType":"uint8"},{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"swapExactTokensForTokens","inputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"uint256","name":"amountOutMin","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"swapExactTokensForTokensSupportingFeeOnTransferTokens","inputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"uint256","name":"amountOutMin","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"swapTokensForExactTokens","inputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"},{"type":"uint256","name":"amountInMax","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]}]
            

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106100df5760003560e01c80638803dbee1161008c578063baa2abde11610066578063baa2abde146104e2578063c45a015514610532578063d06ca61f1461053a578063e8e33700146105e4576100df565b80638803dbee146103e457806396ed28f91461046f578063ad615dec146104b9576100df565b806338ed1739116100bd57806338ed1739146102a35780635c11d7951461032e57806385f8c259146103bb576100df565b8063054d50d4146100e45780631f00ca741461011f5780632195995c14610219575b600080fd5b61010d600480360360608110156100fa57600080fd5b5080359060208101359060400135610657565b60408051918252519081900360200190f35b6101c96004803603604081101561013557600080fd5b8135919081019060408101602082013564010000000081111561015757600080fd5b82018360208201111561016957600080fd5b8035906020019184602083028401116401000000008311171561018b57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061066c945050505050565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156102055781810151838201526020016101ed565b505050509050019250505060405180910390f35b61028a600480360361016081101561023057600080fd5b506001600160a01b038135811691602081013582169160408201359160608101359160808201359160a08101359091169060c08101359060e081013515159060ff61010082013516906101208101359061014001356106a2565b6040805192835260208301919091528051918290030190f35b6101c9600480360360a08110156102b957600080fd5b8135916020810135918101906060810160408201356401000000008111156102e057600080fd5b8201836020820111156102f257600080fd5b8035906020019184602083028401116401000000008311171561031457600080fd5b91935091506001600160a01b0381351690602001356107b5565b6103b9600480360360a081101561034457600080fd5b81359160208101359181019060608101604082013564010000000081111561036b57600080fd5b82018360208201111561037d57600080fd5b8035906020019184602083028401116401000000008311171561039f57600080fd5b91935091506001600160a01b0381351690602001356109ab565b005b61010d600480360360608110156103d157600080fd5b5080359060208101359060400135610c3a565b6101c9600480360360a08110156103fa57600080fd5b81359160208101359181019060608101604082013564010000000081111561042157600080fd5b82018360208201111561043357600080fd5b8035906020019184602083028401116401000000008311171561045557600080fd5b91935091506001600160a01b038135169060200135610c47565b61049d6004803603604081101561048557600080fd5b506001600160a01b0381358116916020013516610d52565b604080516001600160a01b039092168252519081900360200190f35b61010d600480360360608110156104cf57600080fd5b5080359060208101359060400135610d7f565b61028a600480360360e08110156104f857600080fd5b506001600160a01b038135811691602081013582169160408201359160608101359160808201359160a08101359091169060c00135610d8c565b61049d611014565b6101c96004803603604081101561055057600080fd5b8135919081019060408101602082013564010000000081111561057257600080fd5b82018360208201111561058457600080fd5b803590602001918460208302840111640100000000831117156105a657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611038945050505050565b61063960048036036101008110156105fb57600080fd5b506001600160a01b038135811691602081013582169160408201359160608101359160808201359160a08101359160c0820135169060e00135611065565b60408051938452602084019290925282820152519081900360600190f35b60006106648484846111aa565b949350505050565b60606106997f00000000000000000000000062d5b84be28a183abb507e125b384122d2c25fae8484611282565b90505b92915050565b60008060006106d27f00000000000000000000000062d5b84be28a183abb507e125b384122d2c25fae8f8f6113cf565b90506000876106e1578c6106e5565b6000195b604080517fd505accf00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101839052606481018c905260ff8a16608482015260a4810189905260c4810188905290519192506001600160a01b0384169163d505accf9160e48082019260009290919082900301818387803b15801561077457600080fd5b505af1158015610788573d6000803e3d6000fd5b5050505061079b8f8f8f8f8f8f8f610d8c565b809450819550505050509b509b9950505050505050505050565b6060814281101561080d576040805162461bcd60e51b815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b61086b7f00000000000000000000000062d5b84be28a183abb507e125b384122d2c25fae898888808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506114ba92505050565b9150868260018451038151811061087e57fe5b602002602001015110156108c35760405162461bcd60e51b815260040180806020018281038252602b8152602001806124e7602b913960400191505060405180910390fd5b610961868660008181106108d357fe5b905060200201356001600160a01b0316336109477f00000000000000000000000062d5b84be28a183abb507e125b384122d2c25fae8a8a600081811061091557fe5b905060200201356001600160a01b03168b8b600181811061093257fe5b905060200201356001600160a01b03166113cf565b8560008151811061095457fe5b60200260200101516115f1565b6109a08287878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525089925061179a915050565b509695505050505050565b8042811015610a01576040805162461bcd60e51b815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b610a7685856000818110610a1157fe5b905060200201356001600160a01b031633610a707f00000000000000000000000062d5b84be28a183abb507e125b384122d2c25fae89896000818110610a5357fe5b905060200201356001600160a01b03168a8a600181811061093257fe5b8a6115f1565b600085856000198101818110610a8857fe5b905060200201356001600160a01b03166001600160a01b03166370a08231856040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610ae457600080fd5b505afa158015610af8573d6000803e3d6000fd5b505050506040513d6020811015610b0e57600080fd5b50516040805160208881028281018201909352888252929350610b509290918991899182918501908490808284376000920191909152508892506119d7915050565b86610bf38288886000198101818110610b6557fe5b905060200201356001600160a01b03166001600160a01b03166370a08231886040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610bc157600080fd5b505afa158015610bd5573d6000803e3d6000fd5b505050506040513d6020811015610beb57600080fd5b505190611cfe565b1015610c305760405162461bcd60e51b815260040180806020018281038252602b8152602001806124e7602b913960400191505060405180910390fd5b5050505050505050565b6000610664848484611d56565b60608142811015610c9f576040805162461bcd60e51b815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b610cfd7f00000000000000000000000062d5b84be28a183abb507e125b384122d2c25fae8988888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061128292505050565b91508682600081518110610d0d57fe5b602002602001015111156108c35760405162461bcd60e51b815260040180806020018281038252602781526020018061249a6027913960400191505060405180910390fd5b60006106997f00000000000000000000000062d5b84be28a183abb507e125b384122d2c25fae84846113cf565b6000610664848484611e2e565b6000808242811015610de5576040805162461bcd60e51b815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b6000610e127f00000000000000000000000062d5b84be28a183abb507e125b384122d2c25fae8c8c6113cf565b604080517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03831660248201819052604482018d9052915192935090916323b872dd916064808201926020929091908290030181600087803b158015610e8657600080fd5b505af1158015610e9a573d6000803e3d6000fd5b505050506040513d6020811015610eb057600080fd5b5050604080517f89afcb440000000000000000000000000000000000000000000000000000000081526001600160a01b03888116600483015282516000938493928616926389afcb44926024808301939282900301818787803b158015610f1657600080fd5b505af1158015610f2a573d6000803e3d6000fd5b505050506040513d6040811015610f4057600080fd5b50805160209091015190925090506000610f5a8e8e611ed4565b509050806001600160a01b03168e6001600160a01b031614610f7d578183610f80565b82825b90975095508a871015610fc45760405162461bcd60e51b81526004018080602001828103825260268152602001806124c16026913960400191505060405180910390fd5b898610156110035760405162461bcd60e51b81526004018080602001828103825260268152602001806124276026913960400191505060405180910390fd5b505050505097509795505050505050565b7f00000000000000000000000062d5b84be28a183abb507e125b384122d2c25fae81565b60606106997f00000000000000000000000062d5b84be28a183abb507e125b384122d2c25fae84846114ba565b600080600083428110156110c0576040805162461bcd60e51b815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b6110ce8c8c8c8c8c8c611fb2565b909450925060006111007f00000000000000000000000062d5b84be28a183abb507e125b384122d2c25fae8e8e6113cf565b905061110e8d3383886115f1565b61111a8c3383876115f1565b806001600160a01b0316636a627842886040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050602060405180830381600087803b15801561116957600080fd5b505af115801561117d573d6000803e3d6000fd5b505050506040513d602081101561119357600080fd5b5051949d939c50939a509198505050505050505050565b60008084116111ea5760405162461bcd60e51b815260040180806020018281038252602b815260200180612536602b913960400191505060405180910390fd5b6000831180156111fa5750600082115b6112355760405162461bcd60e51b815260040180806020018281038252602881526020018061244d6028913960400191505060405180910390fd5b6000611243856103e5612243565b905060006112518285612243565b9050600061126b83611265886103e8612243565b906122af565b905080828161127657fe5b04979650505050505050565b60606002825110156112db576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a20494e56414c49445f504154480000604482015290519081900360640190fd5b815167ffffffffffffffff811180156112f357600080fd5b5060405190808252806020026020018201604052801561131d578160200160208202803683370190505b509050828160018351038151811061133157fe5b60209081029190910101528151600019015b80156113c7576000806113808786600186038151811061135f57fe5b602002602001015187868151811061137357fe5b6020026020010151612307565b915091506113a284848151811061139357fe5b60200260200101518383611d56565b8460018503815181106113b157fe5b6020908102919091010152505060001901611343565b509392505050565b60008060006113de8585611ed4565b604080517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606094851b811660208084019190915293851b81166034830152825160288184030181526048830184528051908501207fff0000000000000000000000000000000000000000000000000000000000000060688401529a90941b9093166069840152607d8301989098527fb3b8ff62960acea3a88039ebcf80699f15786f1b17cebd82802f7375827a339c609d808401919091528851808403909101815260bd909201909752805196019590952095945050505050565b6060600282511015611513576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a20494e56414c49445f504154480000604482015290519081900360640190fd5b815167ffffffffffffffff8111801561152b57600080fd5b50604051908082528060200260200182016040528015611555578160200160208202803683370190505b509050828160008151811061156657fe5b60200260200101818152505060005b60018351038110156113c7576000806115ab8786858151811061159457fe5b602002602001015187866001018151811061137357fe5b915091506115cd8484815181106115be57fe5b602002602001015183836111aa565b8484600101815181106115dc57fe5b60209081029190910101525050600101611575565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017815292518251600094606094938a169392918291908083835b602083106116c257805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101611685565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611724576040519150601f19603f3d011682016040523d82523d6000602084013e611729565b606091505b5091509150818015611757575080511580611757575080806020019051602081101561175457600080fd5b50515b6117925760405162461bcd60e51b81526004018080602001828103825260248152602001806125126024913960400191505060405180910390fd5b505050505050565b60005b60018351038110156119d1576000808483815181106117b857fe5b60200260200101518584600101815181106117cf57fe5b60200260200101519150915060006117e78383611ed4565b50905060008785600101815181106117fb57fe5b60200260200101519050600080836001600160a01b0316866001600160a01b0316146118295782600061182d565b6000835b91509150600060028a510388106118445788611885565b6118857f00000000000000000000000062d5b84be28a183abb507e125b384122d2c25fae878c8b6002018151811061187857fe5b60200260200101516113cf565b90506118b27f00000000000000000000000062d5b84be28a183abb507e125b384122d2c25fae88886113cf565b6001600160a01b031663022c0d9f84848460006040519080825280601f01601f1916602001820160405280156118ef576020820181803683370190505b506040518563ffffffff1660e01b815260040180858152602001848152602001836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561195757818101518382015260200161193f565b50505050905090810190601f1680156119845780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156119a657600080fd5b505af11580156119ba573d6000803e3d6000fd5b50506001909901985061179d975050505050505050565b50505050565b60005b6001835103811015611cf9576000808483815181106119f557fe5b6020026020010151858460010181518110611a0c57fe5b6020026020010151915091506000611a248383611ed4565b5090506000611a547f00000000000000000000000062d5b84be28a183abb507e125b384122d2c25fae85856113cf565b9050600080600080846001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015611a9557600080fd5b505afa158015611aa9573d6000803e3d6000fd5b505050506040513d6060811015611abf57600080fd5b5080516020909101516dffffffffffffffffffffffffffff91821693501690506000806001600160a01b038a811690891614611afc578284611aff565b83835b91509150611b54828b6001600160a01b03166370a082318a6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610bc157600080fd5b9550611b618683836111aa565b945050505050600080856001600160a01b0316886001600160a01b031614611b8b57826000611b8f565b6000835b91509150600060028c51038a10611ba6578a611bda565b611bda7f00000000000000000000000062d5b84be28a183abb507e125b384122d2c25fae898e8d6002018151811061187857fe5b60408051600080825260208201928390527f022c0d9f00000000000000000000000000000000000000000000000000000000835260248201878152604483018790526001600160a01b038086166064850152608060848501908152845160a48601819052969750908c169563022c0d9f958a958a958a9591949193919260c486019290918190849084905b83811015611c7d578181015183820152602001611c65565b50505050905090810190601f168015611caa5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611ccc57600080fd5b505af1158015611ce0573d6000803e3d6000fd5b50506001909b019a506119da9950505050505050505050565b505050565b8082038281111561069c576040805162461bcd60e51b815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6000808411611d965760405162461bcd60e51b815260040180806020018281038252602c8152602001806123d6602c913960400191505060405180910390fd5b600083118015611da65750600082115b611de15760405162461bcd60e51b815260040180806020018281038252602881526020018061244d6028913960400191505060405180910390fd5b6000611df96103e8611df38688612243565b90612243565b90506000611e0d6103e5611df38689611cfe565b9050611e246001828481611e1d57fe5b04906122af565b9695505050505050565b6000808411611e6e5760405162461bcd60e51b81526004018080602001828103825260258152602001806124756025913960400191505060405180910390fd5b600083118015611e7e5750600082115b611eb95760405162461bcd60e51b815260040180806020018281038252602881526020018061244d6028913960400191505060405180910390fd5b82611ec48584612243565b81611ecb57fe5b04949350505050565b600080826001600160a01b0316846001600160a01b03161415611f285760405162461bcd60e51b81526004018080602001828103825260258152602001806124026025913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b031610611f48578284611f4b565b83835b90925090506001600160a01b038216611fab576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015290519081900360640190fd5b9250929050565b60008060006001600160a01b03167f00000000000000000000000062d5b84be28a183abb507e125b384122d2c25fae6001600160a01b031663e6a439058a8a6040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060206040518083038186803b15801561203e57600080fd5b505afa158015612052573d6000803e3d6000fd5b505050506040513d602081101561206857600080fd5b50516001600160a01b03161415612126577f00000000000000000000000062d5b84be28a183abb507e125b384122d2c25fae6001600160a01b031663c9c6539689896040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b0316815260200192505050602060405180830381600087803b1580156120f957600080fd5b505af115801561210d573d6000803e3d6000fd5b505050506040513d602081101561212357600080fd5b50505b6000806121547f00000000000000000000000062d5b84be28a183abb507e125b384122d2c25fae8b8b612307565b91509150816000148015612166575080155b1561217657879350869250612236565b6000612183898484611e2e565b90508781116121d657858110156121cb5760405162461bcd60e51b81526004018080602001828103825260268152602001806124276026913960400191505060405180910390fd5b889450925082612234565b60006121e3898486611e2e565b9050898111156121ef57fe5b8781101561222e5760405162461bcd60e51b81526004018080602001828103825260268152602001806124c16026913960400191505060405180910390fd5b94508793505b505b5050965096945050505050565b600081158061225e5750508082028282828161225b57fe5b04145b61069c576040805162461bcd60e51b815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b8082018281101561069c576040805162461bcd60e51b815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b60008060006123168585611ed4565b5090506000806123278888886113cf565b6001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561235f57600080fd5b505afa158015612373573d6000803e3d6000fd5b505050506040513d606081101561238957600080fd5b5080516020909101516dffffffffffffffffffffffffffff91821693501690506001600160a01b03878116908416146123c35780826123c6565b81815b9099909850965050505050505056fe556e697377617056324c6962726172793a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056324c6962726172793a204944454e544943414c5f414444524553534553556e69737761705632526f757465723a20494e53554646494349454e545f425f414d4f554e54556e697377617056324c6962726172793a20494e53554646494349454e545f4c4951554944495459556e697377617056324c6962726172793a20494e53554646494349454e545f414d4f554e54556e69737761705632526f757465723a204558434553534956455f494e5055545f414d4f554e54556e69737761705632526f757465723a20494e53554646494349454e545f415f414d4f554e54556e69737761705632526f757465723a20494e53554646494349454e545f4f55545055545f414d4f554e545472616e7366657248656c7065723a205452414e534645525f46524f4d5f4641494c4544556e697377617056324c6962726172793a20494e53554646494349454e545f494e5055545f414d4f554e54a264697066735822122030d5ff4ce68959c671fc9138983ba12418c2801101fe6834cd2e9562adb8d58a64736f6c634300060c0033