Publication
Partagez vos connaissances.
farshad180
Mar 15, 2025
Questions et Réponses avec des Experts
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
Partager
Commentaires
Réponses
1Aliabee59
Mar 16 2025, 15:17Cette restriction est intentionnellement appliquée pour se prémunir contre les attaques de composition basées sur le PTB. Vous pouvez trouver plus d'informations dans la documentation ici : https://docs.sui.io/guides/developer/advanced/randomness-onchain#programmable-transaction-block-ptb-restrictions. Malheureusement, aucun objet « UnsafeRandom » n'est disponible qui vous permettrait de contourner cette restriction.
1
Commentaires
Connaissez-vous la réponse ?
Veuillez vous connecter et la partager.