The Reactive Faucet App links the Reactive Network with any EVM-compatible chain. Users can request funds from a faucet contract on another chain, with the Reactive Network processing the request via a corresponding contract.
-
Origin Chain Contract: ReactiveFaucetL1 handles Ether payment requests, defines a maximum payout per request, and emits
PaymentRequest
events containing details of the transaction. -
Reactive Contract: ReactiveFaucet operates on the Reactive Network. It subscribes to events on the Sepolia chain, processes callbacks, and distributes Ether to the appropriate receivers based on external
PaymentRequest
events.
To deploy the contracts to Ethereum Sepolia and Kopli Testnet, follow these steps. Replace the relevant keys, addresses, and endpoints as needed. Make sure the following environment variables are correctly configured before proceeding:
SEPOLIA_RPC
— https://ethereum-sepolia-rpc.publicnode.com/ or https://1rpc.io/sepoliaSEPOLIA_PRIVATE_KEY
— Ethereum Sepolia private keyREACTIVE_RPC
— https://kopli-rpc.rkt.inkREACTIVE_PRIVATE_KEY
— Kopli Testnet private key
export REACTIVE_FAUCET_L1_ADDR=0x9b9BB25f1A81078C544C829c5EB7822d747Cf434
Find more information on Reactive faucet address here.
Deploy the ReactiveFaucetL1
contract to Ethereum Sepolia and assign the Deployed to
address from the response to REACTIVE_FAUCET_L1_ADDR
. You can skip this step and export the pre-deployed REACTIVE_FAUCET_L1_ADDR
for Ethereum Sepolia shown above.
forge create --rpc-url $SEPOLIA_RPC --private-key $SEPOLIA_PRIVATE_KEY src/faucet/ReactiveFaucetL1.sol:ReactiveFaucetL1 --constructor-args 1ether
Deploy the ReactiveFaucet
contract to the Reactive Network and assign the Deployed to
address from the response to REACTIVE_FAUCET_ADDR
.
forge create --rpc-url $REACTIVE_RPC --private-key $REACTIVE_PRIVATE_KEY src/faucet/ReactiveFaucet.sol:ReactiveFaucet --value 10ether --constructor-args $REACTIVE_FAUCET_L1_ADDR 1ether
Test the faucet:
cast send $REACTIVE_FAUCET_L1_ADDR --rpc-url $SEPOLIA_RPC --private-key $SEPOLIA_PRIVATE_KEY --value 0.01ether
To pause the reactive contract:
cast send $REACTIVE_FAUCET_ADDR "pause()" --rpc-url $REACTIVE_RPC --private-key $REACTIVE_PRIVATE_KEY
To resume the reactive contract:
cast send $REACTIVE_FAUCET_ADDR "resume()" --rpc-url $REACTIVE_RPC --private-key $REACTIVE_PRIVATE_KEY
Provide additional funds to the reactive contract if needed:
cast send $REACTIVE_FAUCET_ADDR --rpc-url $REACTIVE_RPC --private-key $REACTIVE_PRIVATE_KEY --value 0.1ether