1
1
# What's New in Entropy V2
2
2
3
- Entropy V2 is a major update to the Pyth Randomness Protocol.
3
+ Entropy V2 is a major update to the Pyth Randomness Protocol.
4
4
5
- It introduces a series of developer experience improvements, shaped directly by the feedback of teams using it in production:
5
+ It introduces a series of developer experience improvements, shaped directly by the feedback of teams using it in production:
6
6
configurable & customizable gas limits for callbacks, adding callback statuses, and an upcoming public Entropy Explorer.
7
7
8
8
## What's New
@@ -13,15 +13,16 @@ configurable & customizable gas limits for callbacks, adding callback statuses,
13
13
14
14
### Configurable Gas Limits for Callbacks
15
15
16
- Entropy V2 introduces configurable gas limits for callbacks.
16
+ Entropy V2 introduces configurable gas limits for callbacks.
17
17
This allows teams to set the gas limit for their callbacks, which can be useful for:
18
+
18
19
- Computing expensive operations in the callback like minting an NFT collection.
19
20
- Save money on gas fees by setting a lower gas limit.
20
21
21
22
``` solidity copy
22
23
// Calculate the fee for the custom gas limit
23
24
uint256 fee = entropy.getFeeV2(customGasLimit);
24
-
25
+
25
26
// Request random number with custom gas limit
26
27
uint64 sequenceNumber = entropy.requestV2{ value: fee }(customGasLimit);
27
28
```
@@ -31,7 +32,6 @@ uint64 sequenceNumber = entropy.requestV2{ value: fee }(customGasLimit);
31
32
Entropy V2 introduces callback statuses, which allow teams to track the status of their callbacks.
32
33
These callback statuses are emitted in the ` Revealed ` event.
33
34
34
-
35
35
Previous version of Entropy use to emit the following ` RevealedWithCallback ` event:
36
36
37
37
``` solidity copy
@@ -60,7 +60,8 @@ event Revealed(
60
60
);
61
61
```
62
62
63
- This updated ` Revealed ` event
63
+ This updated ` Revealed ` event
64
+
64
65
- abstracted away the information from ` EntropyStructs.Request ` to the ` Revealed ` event for easier consumption.
65
66
- added a ` callbackFailed ` boolean to indicate if the callback failed.
66
67
@@ -72,7 +73,6 @@ Entropy V2 introduces an upcoming public Entropy Explorer, which will allow team
72
73
73
74
This will help teams to easily track the status of their callbacks and re-request them if they fail on-chain.
74
75
75
-
76
76
## Additional Resources
77
77
78
78
These following resources will help you get started with Entropy V2:
0 commit comments