Pseudorandom numbers 🎲
Services 0.28 gives Hedera devs a new dApp building block in HIP-351 (Pseudorandom Numbers). HAPI has a new UtilService
with a prng
transaction that generates a record with either a pseudorandom 48-byte seed, or an integer in a requested range.
Smart contracts can also get pseudorandom values by calling a new system contract at address 0x169
, using the interface here as in this example. Applications might include NFT mint contracts, lotteries, and so on.
(Please note the HIP-351 text does not yet reflect the name change from RandomGenerate
to prng
, or the system contract specification. It does explain in detail how prng
derives its entropy from the running hash of transaction records generated by the network.)
This release also includes some bug fixes and smaller improvements; notably, it:
- Extends
ContractCallLocal
support to the ERC-20 and ERC-721 functionsallowance
,getApproved
, andisApprovedForAll
. - Permits staking to contract accounts.
Contributors
We'd like to thank all the contributors who worked on this release!
- @alshapi
- @anighanta
- @bugbytesinc
- @CordonaCodeCraft
- @Daniel-K-Ivanov
- @dimitar-dinev
- @georgiyazovaliiski
- @ivanparnarev
- @IvanKavaldzhiev
- @jasperpotts
- @JeffreyDallas
- @joan41868
- @MarcKriguerAtHedera
- @Neeharika-Sompalli
- @OlegMazurov
- @qnswirlds
- @rbair23
- @rjuang
- @rusiboyadjiev
- @shemnon
- @SimiHunjan
- @statop
- @stoqnkpL
- @superboo
- @tdermendzhievv
- @tinker-michaelj