205 bytes 怎么传参 一直失败

https://kovan.etherscan.io/tx/0x95a0a5c31d94f089f8c19b481b0e22d3e399eb140509c35c47a1f9a6e603dd13 这个是我手动兑换的结果

let path = ethers.utils.arrayify("0x31eeb2d0f9b6fd8642914ab10f4dd473677d80df000bb8d0a1e359811322d97991e03f863a0c30c2cf029c0001f41f9840a85d5af5bf1d1762f925bdaddc4201f984") console.log(path); let recipient = "0x43CbB7b02f2b373474dc87568C976bA4a5C4485B"; let deadline = 1635793948; let amountIn = 100000; let amountOutMinimum= 130726914869254; var abiCoder =new ethers.utils.AbiCoder()

var abi=abiCoder.encode([ 'bytes', 'address', 'uint256', 'uint256','uint256'], [ path ,recipient, deadline ,amountIn ,amountOutMinimum])
 console.log(abi.toString() );

返回结果0000000000000000000000000000000000000000000000000000000000000a000000000000000000000000043cbb7b02f2b373474dc87568c976ba4a5c4485b0000000000000000000000000000000000000000000000000000000061803c1c00000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000000076e53b52c806000000000000000000000000000000000000000000000000000000000000004231eeb2d0f9b6fd8642914ab10f4dd473677d80df000bb8d0a1e359811322d97991e03f863a0c30c2cf029c0001f41f9840a85d5af5bf1d1762f925bdaddc4201f984000000000000000000000000000000000000000000000000000000000000

手动兑换结果是:000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000043cbb7b02f2b373474dc87568c976ba4a5c4485b0000000000000000000000000000000000000000000000000000000061803c1c00000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000000076e53b52c806000000000000000000000000000000000000000000000000000000000000004231eeb2d0f9b6fd8642914ab10f4dd473677d80df000bb8d0a1e359811322d97991e03f863a0c30c2cf029c0001f41f9840a85d5af5bf1d1762f925bdaddc4201f984000000000000000000000000000000000000000000000000000000000000

请先 登录 后评论

1 个回答

Tiny熊
  擅长:智能合约,以太坊
请先 登录 后评论
  • 1 关注
  • 0 收藏,2407 浏览
  • xigua 提出于 2021-11-02 03:34