为什么在 Erc20 Contract 中包含 UniSwapRouterV2?

许多 ERC20 代币都包含UniSwapRouterV2在他们的合约中。这样做有什么好处?不包括路由器可以吗?

例如 的路由器代码:


// pragma solidity >=0.6.2;

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;
}
请先 登录 后评论

5 个回答

Leego
请先 登录 后评论
wess
请先 登录 后评论
666bbhhj
请先 登录 后评论
王long
请先 登录 后评论
执灯一盏 - 区块链开发工程师
请先 登录 后评论
  • 5 关注
  • 1 收藏,2636 浏览
  • 666bbhhj 提出于 2022-02-13 00:24