Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions docs/tutorials/native-vrf/vrf-in-solidity.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Flow provides secure, native on-chain randomness that developers can leverage th
- **Block Explorer**: `https://evm-testnet.flowscan.io`
3. Click **Save** and switch to the Flow EVM Testnet.

![vrf-1.png]
![MetaMask Network Configuration](./imgs/vrf-1.png)

## **Obtaining Testnet FLOW**

Expand Down Expand Up @@ -107,27 +107,27 @@ contract CadenceArchCaller {
1. Open Remix IDE.
2. Create a new file and paste the Solidity code above.

![vrf-2.png]
![Creating file in Remix](./imgs/vrf-2.png)

3. Compile the contract by selecting the appropriate Solidity compiler version (0.8.x).

![vrf-3.png]
![Compiling in Remix](./imgs/vrf-3.png)

4. Connect Remix to your Metamask wallet (with Flow EVM testnet) by selecting **Injected Web3** as the environment.

![vrf-4.png]
![Connecting to MetaMask](./imgs/vrf-4.png)

5. Deploy the contract.

![vrf-5.png]
![Deploying the contract](./imgs/vrf-5.png)

### Call revertibleRandom

After deployment, you can interact with the contract to retrieve a random number.

Call the `revertibleRandom()` function in the left sidebar on the deployed contract. This will fetch a pseudo-random number generated by Flow's VRF.

![vrf-6.png]
![Calling revertibleRandom function](./imgs/vrf-6.png)

The result will be a `uint64` random number generated on Flow EVM.

Expand Down Expand Up @@ -181,13 +181,6 @@ You can also view an example in both Solidity and Cadence of a [random coin toss

_This documentation was contributed by [Noah Naizir] a community developer._

[vrf-1.png]: ./imgs/vrf-1.png
[vrf-2.png]: ./imgs/vrf-2.png
[vrf-3.png]: ./imgs/vrf-3.png
[vrf-4.png]: ./imgs/vrf-4.png
[vrf-5.png]: ./imgs/vrf-5.png
[vrf-6.png]: ./imgs/vrf-6.png

[Cadence Arch]: https://github.com/onflow/flips/blob/main/protocol/20231116-evm-support.md#cadence-arch
[Flow EVM Testnet RPC]: https://testnet.evm.nodes.onflow.org/
[Flow EVM Testnet Explorer]: https://evm-testnet.flowscan.io/
Expand Down