Move.

帖子

分享您的知识。

farshad.
Mar 15, 2025
专家问答

How to handle randomness restriction in PTB?

I came across an issue where I can't execute multiple commands following a random command in the PTB. It seems that the commands following a Random command can only be TransferObjects or MergeCoins. Is there a workaround like an UnsafeRandom, or is the only option to develop our own PRNG?

  • Move CLI
1
1
分享
评论
.

答案

1
Aliabee.
Mar 16 2025, 15:17

故意执行此限制是为了防范基于 PTB 的合成攻击. 你可以在此处的文档中找到更多信息:https://docs.sui.io/guides/developer/advanced/randomness-onchain#programmable-transaction-block-ptb-restrictions. 不幸的是,没有 “UnsafeRandom” 对象可以让你绕过这个限制.

1
评论
.

你知道答案吗?

请登录并分享。

Move is an executable bytecode language used to implement custom transactions and smart contracts.

148帖子231答案
Sui.X.Peera.

赚取你的 1000 Sui 份额

获取声誉积分,并因帮助 Sui 社区成长而获得奖励。

奖励活动七月