帖子
分享您的知识。
doodee37
Feb 17, 2025
专家问答
How to properly pass BCS serialized struct parameters in Sui?
I've been trying to pass BCS serialized struct parameters to a move module in the Sui blockchain, but I'm hitting an InvalidUsageOfPureArg error. Can Sui handle BCS serialized struct parameters directly, or do I need to create a struct object first and pass it to the move module? How should I structure my code to achieve this?
- Move CLI
1
2
分享
评论
答案
2DRAMA35
Feb 17 2025, 15:38要传递 BCS 序列化结构参数,您无法直接创建新的结构实例,因为它们必须通过移动调用创建. 这是因为允许直接创建可以不受限制地传入任意物体或硬币. 为了使移动模块管理其结构的创建方式,您的合约需要实现专门用于构造结构的方法. 这样可以确保对创建过程的控制并保持完整性.
1
评论
你知道答案吗?
请登录并分享。
Move is an executable bytecode language used to implement custom transactions and smart contracts.
98帖子158答案