Publicación
Comparte tu conocimiento.
farshad180
Mar 15, 2025
P&R expertos
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
Cuota
Comentarios
Respuestas
1Aliabee59
Mar 16 2025, 15:17Esta restricción se aplica intencionadamente para protegerse contra los ataques de composición basados en PTB. Puede encontrar más información en la documentación aquí: https://docs.sui.io/guides/developer/advanced/randomness-onchain#programmable-transaction-block-ptb-restrictions. Lamentablemente, no hay ningún objeto «UnsafeRandom» disponible que te permita eludir esta restricción.
1
Comentarios
Sabes la respuesta?
Inicie sesión y compártalo.