5 web3.eth.abi.decodeParameter 解码报错

在区块浏览器上正常解码的,HEX到STRING,如图1和图2: QQ20220425130403.png

QQ20220425130644.png

let myString=web3.eth.abi.decodeParameter('string','46616d69736865642041626572726174696f6e20312f33000000000000000000');

WEB3.JS里面,但是我用上面的代码解码,会报错:

Uncaught Error: overflow [ See: https://links.ethers.org/v5-errors-NUMERIC_FAULT-overflow ] (fault="overflow", operation="toNumber", value="31834038699412210277990251717829464956029523634591941805922455599467156471808", code=NUMERIC_FAULT, version=bignumber/5.6.0)

请问这是什么问题。

请先 登录 后评论

最佳答案 2022-04-25 15:51

根据tx分析,event 函数原型如下:

https://www.4byte.directory/event-signatures/?bytes_signature=0xb3cd69c2fae51b3e21f25978f3604c96acf27abbf4fcb05685b102b4a567cb1d

NewSale(uint256,address[],uint256[],uint256[],uint128,uint256,bool,uint256,bool,string,string,address[])

参考我的文章,

https://learnblockchain.cn/article/3506 自己构造一个这个事件abi,即可解码这个事件。

请先 登录 后评论

其它 1 个回答

晓道
请先 登录 后评论