diff --git a/pages/entropy/generate-random-numbers/evm.mdx b/pages/entropy/generate-random-numbers/evm.mdx index c3418d74..32c68894 100644 --- a/pages/entropy/generate-random-numbers/evm.mdx +++ b/pages/entropy/generate-random-numbers/evm.mdx @@ -46,9 +46,14 @@ import { IEntropyConsumer } from "@pythnetwork/entropy-sdk-solidity/IEntropyCons import { IEntropy } from "@pythnetwork/entropy-sdk-solidity/IEntropy.sol"; // @param entropyAddress The address of the entropy contract. -contract YourContract(address entropyAddress) is IEntropyConsumer { - IEntropy entropy = IEntropy(entropyAddress); +contract YourContract is IEntropyConsumer { + IEntropy public entropy; + + constructor(address entropyAddress) { + entropy = IEntropy(entropyAddress); + } } + ``` @@ -76,14 +81,18 @@ To generate a random number, follow these steps. Generate a 32-byte random number on the client side. - - - ```typescript copy const userRandomNumber = web3.utils.randomHex(32); ``` - - - ```typescript copy const userRandomNumber = ethers.utils.randomBytes(32); + + + ```javascript + const userRandomNumber = web3.utils.randomHex(32); + ``` + + + + ```javascript + const userRandomNumber = ethers.utils.randomBytes(32); ``` - + ### 2. Request a number from Entropy