Skip to main content

Reactive Contracts Image

Overview

Reactive Contracts (RCs) are event-driven smart contracts for cross-chain, on-chain automation. They monitor event logs across EVM chains, execute Solidity logic when subscribed events occur, and can trigger cross-chain callback transactions.

RCs define which chains, contracts, and events to monitor and operate autonomously based on on-chain events rather than user transactions or bots.

Deployment

Reactive Contracts deploy in two environments:

  • Reactive Network (RNK) — the public chain where EOAs interact with the contract and subscriptions are managed

  • ReactVM (RVM) — a private execution environment where event processing takes place

Both copies use identical bytecode but operate independently.

State Separation

The two deployments do not share state. Constructor flags or runtime checks can be used to distinguish environments. A contract can detect execution inside ReactVM by calling the system contract — calls revert outside ReactVM. See our demos for details.

ReactVM Limitations

Inside ReactVM, Reactive Contracts can't access external systems directly. They receive event logs from Reactive Network and can send callback transactions to destination chains, but can't interact with external RPC endpoints or off-chain services.

Verifying Reactive Contracts

Contracts can be verified during or after deployment using the Sourcify endpoint. Sourcify is a decentralized verification service that matches deployed bytecode with source code, making contracts auditable and transparent.

Verify After Deployment

forge verify-contract \
--verifier sourcify \
--chain-id $CHAIN_ID \
$CONTRACT_ADDR $CONTRACT_NAME

Replace:

  • $CHAIN_ID1597 (Reactive Mainnet) or 5318007 (Lasna Testnet)
  • $CONTRACT_ADDR → deployed contract address
  • $CONTRACT_NAME → contract name (e.g. MyContract)

Verify on Deployment

forge create \
--verifier sourcify \
--verify \
--chain-id $CHAIN_ID \
--private-key $PRIVATE_KEY \
$PATH

Replace:

  • $CHAIN_ID1597 (Reactive Mainnet) or 5318007 (Lasna Testnet)
  • $PATH → e.g. src/MyContract.sol:MyContract
  • $PRIVATE_KEY → deployer key

Example:

forge create \
--broadcast \
--rpc-url $REACTIVE_RPC_URL \
--private-key $REACTIVE_PRIVATE_KEY \
--chain-id $REACTIVE_CHAIN_ID \
--value 0.01ether \
--verify \
--verifier sourcify \
src/.../MyContract.sol:MyContract \
--constructor-args \
$ARGUMENT_1 \
$ARGUMENT_2 \
$ARGUMENT_3 \
# ...add more as needed
Broadcast Error

If you encounter the error below, your Foundry version doesn't expect the --broadcast flag for forge create. Remove --broadcast and retry.

error: unexpected argument '--broadcast' found

Verified Contracts on Reactscan

After verification:

  1. Open Reactscan (Reactive Mainnet, Lasna Testnet)
  2. Navigate to your RVM
  3. Open Contracts

Image a

  1. Select the contract address

Image b

Successful verification shows:

Contract Address: 0xc3e185561D2a8b04F0Fcd104A562f460D6cC503c
Status: VERIFIED (EXACT MATCH)
Compiler: 0.8.28

Image c

Verified contracts expose full source code with syntax highlighting and file structure.

More on Reactive Contracts →