Bài viết
Chia sẻ kiến thức của bạn.
farshad180
Mar 15, 2025
Hỏi đáp Chuyên Gia
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
Chia sẻ
Bình luận
Câu trả lời
1Aliabee59
Mar 16 2025, 15:17Hạn chế này được cố ý thực thi để bảo vệ chống lại các cuộc tấn công bố cục dựa trên PTB. Bạn có thể tìm thêm thông tin trong tài liệu tại đây: https://docs.sui.io/guides/developer/advanced/randomness-onchain#programmable-transaction-block-ptb-restrictions. Thật không may, không có đối tượng 'UnSafeRandom' có sẵn cho phép bạn bỏ qua hạn chế này.
1
Bình luận
Bạn có biết câu trả lời không?
Hãy đăng nhập và chia sẻ nó.