Move.

Beitrag

Teile dein Wissen.

farshad.
Mar 15, 2025
Experten Q&A

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
Teilen
Kommentare
.

Antworten

1
Aliabee.
Mar 16 2025, 15:17

Diese Einschränkung wird bewusst durchgesetzt, um sich vor PTB-basierten Kompositionsangriffen zu schützen. Weitere Informationen finden Sie in der Dokumentation hier: https://docs.sui.io/guides/developer/advanced/randomness-onchain#programmable-transaction-block-ptb-restrictions. Leider ist kein 'UnsafeRandom'-Objekt verfügbar, mit dem Sie diese Einschränkung umgehen könnten.

1
Kommentare
.

Weißt du die Antwort?

Bitte melde dich an und teile sie.

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

148Beiträge231Antworten
Sui.X.Peera.

Verdiene deinen Anteil an 1000 Sui

Sammle Reputationspunkte und erhalte Belohnungen für deine Hilfe beim Wachstum der Sui-Community.

BelohnungskampagneJuli