Skip to main content

Use Cases

Overview

The Use Cases section focuses on analyzing scenarios where Reactive Smart Contracts might be a game changer.

The Basic Demo Smart Contract is a basic use case of the Reactive Network with low-latency monitoring of logs emitted by arbitrary contracts on any chain (Sepolia testnet in this case) and enabling calls from the Reactive Network to these arbitrary chain contracts.

The Uniswap V2 Stop Order Demo is a demo of a simple reactive smart contract that implements a stop order upon a Uniswap V2 liquidity pool. Study its setup and try deploying and testing it yourself.

GitHub Repository

Visit our GitHub repository for all the important information on use cases and more. Clone the project and start exploring!

How to Get Kopli Testnet REACT

Users can acquire REACT tokens on the Reactive Network (RN) by interacting with the Sepolia faucet contract. One method is simply transferring SepETH to the faucet contract on the Sepolia Network. Upon completion, an equivalent number of REACT tokens will be transferred to the sender's address on the Reactive Network, subject to a predefined limit (0.1 ETH by default) and assuming the faucet has available funds. This process can be executed using MetaMask or any other wallet.

Alternatively, users can call the payable method request(address) on the Sepolia contract to transfer REACT tokens directly to a specified RN address. In that case, users must provide the corresponding amount of SepETH when invoking this method.

More information on Kopli Testnet →

Environment Setup

To set up the foundry environment, run:

curl -L https://foundry.paradigm.xyz | bash
source ~/.bashrc
foundryup

Install dependencies:

forge install

Development & Testing

To compile artifacts:

forge compile

To run the test suite:

forge test -vv

To inspect the call tree:

forge test -vvvv

Environment Variable Configuration

The following environment variables are used in the instructions for running the demos and should be configured beforehand.

SEPOLIA_RPC

RPC address for Sepolia testnet, https://rpc2.sepolia.org unless you want to use your own.

SEPOLIA_PRIVATE_KEY

Private key to your Sepolia wallet.

REACTIVE_RPC

RPC address for Reactive testnet, which should be set to https://kopli-rpc.reactive.network/.

REACTIVE_PRIVATE_KEY

The private key to your Reactive wallet.

DEPLOYER_ADDR

The address of your Reactive wallet.

SYSTEM_CONTRACT_ADDR

System contract address for Reactive testnet, which should be set to 0x0000000000000000000000000000000000FFFFFF.

CALLBACK_SENDER_ADDR

Refer to the documentation for addresses used by Reactive testnet for callbacks on supported networks.