This repository was archived by the owner on Nov 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed
pages/entropy/generate-random-numbers Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,12 @@ import { IEntropyConsumer } from "@pythnetwork/entropy-sdk-solidity/IEntropyCons
4646import { IEntropy } from "@pythnetwork/entropy-sdk-solidity/IEntropy.sol";
4747
4848// @param entropyAddress The address of the entropy contract.
49- contract YourContract(address entropyAddress) is IEntropyConsumer {
50- IEntropy entropy = IEntropy(entropyAddress);
49+ contract YourContract is IEntropyConsumer {
50+ IEntropy public entropy;
51+
52+ constructor(address entropyAddress) {
53+ entropy = IEntropy(entropyAddress);
54+ }
5155}
5256```
5357
@@ -76,14 +80,18 @@ To generate a random number, follow these steps.
7680
7781Generate a 32-byte random number on the client side.
7882
79- <Tabs items = { [" web3.js" , " ethers.js" ]} >
80- <Tabs.Tab >
81- ``` typescript copy const userRandomNumber = web3.utils.randomHex(32); ```
82- </Tabs.Tab >
83- <Tabs.Tab >
84- ``` typescript copy const userRandomNumber = ethers.utils.randomBytes(32);
83+ <Tabs >
84+ <TabItem value = " web3.js" label = " web3.js" >
85+ ``` javascript
86+ const userRandomNumber = web3 .utils .randomHex (32 );
87+ ```
88+ </TabItem >
89+
90+ <TabItem value = " ethers.js" label = " ethers.js" >
91+ ``` javascript
92+ const userRandomNumber = ethers .utils .randomBytes (32 );
8593 ```
86- </Tabs.Tab >
94+ </TabItem >
8795</Tabs >
8896
8997### 2. Request a number from Entropy
You can’t perform that action at this time.
0 commit comments