Move.

帖子

分享您的知识。

kryptoschain.
Feb 14, 2025
专家问答

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
0
2
分享
评论
.

答案

2
Mister_CocaCola.
Feb 17 2025, 15:37

我实际上是用sui client ptb:弄清楚的sui client ptb --move-call 0x2::transfer::public_freeze_object "<0x7a7e054896810bbbe031041ee131137c417fdf8320ba40ec47203e1ab4b8f7e1::example::Sword>" @0xbcb2c3c6b0f67828fce9702115b914414df767a35c8a541413787d0a1e66682e,至少在测试网上是这样. 你只需要正确的调用类型,尽管我不确定这是否key使它实现了特定的特征.

1
评论
.
tomek.
Feb 17 2025, 15:37

可以通过 Sui CLI 从 Sui 框架包中调用公共函数,但有一些限制. 例如,尚不完全支持直接访问某些系统模块,如 0x2. 一种常见的解决方法是发布一个包装所需函数的自定义包public_freeze_object,例如,允许您使用对象 ID 作为参数来调用它. 这提供了更大的灵活性. 如果您在创建此包装包时需要帮助,请随时联系我们!

0
评论
.

你知道答案吗?

请登录并分享。

我们使用 cookie 确保您在我们的网站上获得最佳体验。
更多信息