帖子
分享您的知识。
How to call `public fun`s from Sui framework using CLI?
Hey folks, I'm trying to call public functions from the Sui framework using the Sui CLI. For instance, if someone transfers an object to me and I don't want it, how can I freeze it? I thought about using sui client call
, but I'm having trouble with the module identifier. Is publishing a wrapper package the only way, or is there a CLI command I'm missing?
- Move CLI
- Move
答案
2我实际上是用sui client ptb
:弄清楚的sui client ptb --move-call 0x2::transfer::public_freeze_object "<0x7a7e054896810bbbe031041ee131137c417fdf8320ba40ec47203e1ab4b8f7e1::example::Sword>" @0xbcb2c3c6b0f67828fce9702115b914414df767a35c8a541413787d0a1e66682e
,至少在测试网上是这样. 你只需要正确的调用类型,尽管我不确定这是否key
使它实现了特定的特征.
可以通过 Sui CLI 从 Sui 框架包中调用公共函数,但有一些限制. 例如,尚不完全支持直接访问某些系统模块,如 0x2. 一种常见的解决方法是发布一个包装所需函数的自定义包public_freeze_object
,例如,允许您使用对象 ID 作为参数来调用它. 这提供了更大的灵活性. 如果您在创建此包装包时需要帮助,请随时联系我们!
你知道答案吗?
请登录并分享。
Move is an executable bytecode language used to implement custom transactions and smart contracts.