decodeParameters解码bytes[]

Tx:

https://etherscan.io/tx/0xecb398ee0e00ec3b3f1bc4d3d34c69153c2abeef995d39a69c1f30300330c18e

Input Data:

0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000104414bf389000000000000000000000000c5e7703d4647ff77bc733bb56d120471b83382e2000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000bb80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006507f7280000000000000000000000000000000000000000000000000001d6c3ef643800000000000000000000000000000000000000000000000000014fcd4e1e5ce130000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004449404b7c000000000000000000000000000000000000000000000000014fcd4e1e5ce13000000000000000000000000019edc2f769ac416c725e1c4032be50c1d4b3bd3a00000000000000000000000000000000000000000000000000000000
let calls = web3.eth.abi.decodeParameters(['bytes[]'], calldata)[0];
console.log(`calls1:${calls}`)

解析结果:

0x414bf389000000000000000000000000c5e7703d4647ff77bc733bb56d120471b83382e2000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000bb80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006507f7280000000000000000000000000000000000000000000000000001d6c3ef643800000000000000000000000000000000000000000000000000014fcd4e1e5ce1300000000000000000000000000000000000000000000000000000000000000000
,
0x49404b7c000000000000000000000000000000000000000000000000014fcd4e1e5ce13000000000000000000000000019edc2f769ac416c725e1c4032be50c1d4b3bd3a

这个类型是bytes[]的数据,请问是怎么解析出2个bytes数据的。解析区分出这2个bytes的原理是什么呢。 有没有对应Java的写法解析web3.eth.abi.decodeParameters

image.png

image.png

请先 登录 后评论

3 个回答

zen
请先 登录 后评论
lfhuang
请先 登录 后评论
alian - 高级开发工程师
请先 登录 后评论
  • 2 关注
  • 0 收藏,1932 浏览
  • lfhuang 提出于 2023-09-19 17:17