

排错:调用 parseLog 报 data out-of-bounds 错误
source link: https://blog.dteam.top/posts/2023-03/parselog-data-out-of-bounds.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

排错:调用 parseLog 报 data out-of-bounds 错误
调用 parseLog 解析日志,结果得到:
UnhandledPromiseRejectionWarning: Error: data out-of-bounds (length=0, offset=32, code=BUFFER_OVERRUN, version=abi/5.6.0)
...
这种情况一般是使用的 abi 字符串与 contract 的实际 abi 不匹配:缺少了 indexed
关键字。如下例:
- 实际的 abi 为
event Transfer(address indexed from, address indexed to, uint256 indexed value)
- 但使用的却是:
event Transfer(address from, address to, uint256 value)
通过查看 log 的 topics 也能发现,topics 的内容实际是:event + indexed 参数,其长度可以反映出有多少个 indexed
参数。
很简单,补上缺失的 indexed
关键字即可。
觉得有帮助的话,不妨考虑购买付费文章来支持我们 🙂 :
付费文章Recommend
-
30
问题描述:因人员递增及业务发展需要,需要对现阶段Exchange前后端及数据库进行全新规划,并根据实际需要扩容现有数据库。在挂载数据库时发生报错MapiExceptionTooManyMountedDatabases: Unable to mount database。环境描述:Windows Server 2012R2 + Exchange CU...
-
30
-
65
Hbase+Hadoop+Zookeeper集群一、服务器规划和基础配置*RM-ResourceManager,HM-HMaster,SN-SecondaryNameNode,NM-NodeManager,HR-HRegionServerIPHostname角色10.0.0.1Node1RM,HM,NameNode,SN10.0.0.2Node2DataNode,NM,HR10.0.0.3Node
-
54
排错背景:在一次生产环境的部署过程中,配置文件中配置的访问地址为集群的Service,配置好后发现服务不能正常访问,遂启动了一个busybox进行测试,测试发现在busybox中,能通过coredns正常的解析到IP,然后去ping了一下service,发现不能ping通,ping clusterIP也...
-
8
@人脸识别代码和一些常见错误 基于opencv的视频人脸识别(中文显示)以及 index 480 is out of bounds for axis 0 with size 480错误的解决 参考了 https://github.com/niehen6174/face-recognition-and-put-in-chinese 上述代码...
-
19
排错:调用只读方法时,遇到 UNPREDICTABLE_GAS_LIMIT胡键 Posted at — Mar 10, 2021 阅读 78开发以太坊应用时,调用只读方法时遇到类似以下内容的报错信息:ERROR Error: Uncaught (in promise): Error: c...
-
9
排错:调用 rxjs 的 ajax 报 'CORS is not supported by your browser'胡键 Posted at — Apr 6, 2021 阅读 23调用 rxjs 中的 ajax 方法,结果返回以下错误信息: throw new Error('CORS is not supp...
-
4
记录一次ora-01078错误的排错 推荐 原创 冰蓝冰冷 2022-09-01 16:48:56...
-
3
out-of-bounds memory access bug out-of-bounds memory access bug 30 Nov 2022 Recent fuzz testing has uncovered a bug in capnproto-rust and...
-
4
Index out of bounds? Not always! - A Rusty Surprise Serhii Potapov January 04, 2024 #
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK