UniswapV2路由合约的函数选择器和事件选择器

Posted sanqima

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了UniswapV2路由合约的函数选择器和事件选择器相关的知识,希望对你有一定的参考价值。

    UniswapV2路由合约UniswapV2Router02,其继承于IUniswapV2Router02, 而IUniswapV2Router02又继承于IUniswapV2Router01。路由合约用于在原Token与目标Token之间找到一条兑换路径,比如 TokenA --> TokenB --> TokenC,把TokenA兑换TokenC,需要通过TokenB来继续转接。实际是2个交易对: (TokenA,TokenB),(Token B,TokenC) 。
    路由合约的继承图表如下:

UniswapV2Router02的函数选择器和事件选择器

functionselect
constructor(address,address)0x4525f804
WETH()0xad5c4648
addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256)0xe8e33700
addLiquidityETH(address,uint256,uint256,uint256,address,uint256)0xf305d719
factory()0xc45a0155
getAmountIn(uint256,uint256,uint256)0x85f8c259
getAmountOut(uint256,uint256,uint256)0x054d50d4
getAmountsIn(uint256,address[])0x1f00ca74
getAmountsOut(uint256,address[])0xd06ca61f
quote(uint256,uint256,uint256)0xad615dec
removeLiquidity(address,address,uint256,uint256,uint256,address,uint256)0xbaa2abde
removeLiquidityETH(address,uint256,uint256,uint256,address,uint256)0x02751cec
removeLiquidityETHSupportingFeeOnTransferTokens(address,uint256,uint256,uint256,address,uint256)0xaf2979eb
removeLiquidityETHWithPermit(address,uint256,uint256,uint256,address,uint256,bool,uint8,bytes32,bytes32)0xded9382a
removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(address,uint256,uint256,uint256,address,uint256,bool,uint8,bytes32,bytes32)0x5b0d5984
removeLiquidityWithPermit(address,address,uint256,uint256,uint256,address,uint256,bool,uint8,bytes32,bytes32)0x2195995c
swapETHForExactTokens(uint256,address[],address,uint256)0xfb3bdb41
swapExactETHForTokens(uint256,address[],address,uint256)0x7ff36ab5
swapExactETHForTokensSupportingFeeOnTransferTokens(uint256,address[],address,uint256)0xb6f9de95
swapExactTokensForETH(uint256,uint256,address[],address,uint256)0x18cbafe5
swapExactTokensForETHSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)0x791ac947
swapExactTokensForTokens(uint256,uint256,address[],address,uint256)0x38ed1739
swapExactTokensForTokensSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)0x5c11d795
swapTokensForExactETH(uint256,uint256,address[],address,uint256)0x4a25d94a
swapTokensForExactTokens(uint256,uint256,address[],address,uint256)0x8803dbee

参考文献

    [1] ethers计算函数选择器和事件选择器

以上是关于UniswapV2路由合约的函数选择器和事件选择器的主要内容,如果未能解决你的问题,请参考以下文章

UniswapV2配对合约里的函数选择器与事件选择器

JQuery语法,选择器和事件

Ext JS 4 - 理解 this.control、选择器和事件处理

jQuery选择器和事件

jQuery 类选择器和单击事件,我错过了啥吗?

jQuery选择器和事件