Deploy the WREACT token from the wreact-erc20-token repository to Ethereum Sepolia:
forge create --rpc-url $SEPOLIA_RPC --private-key $SEPOLIA_PRIVATE_KEY src/WrappedReact.sol:WrappedReactDeployed address:
export WREACT_ADDR=...Deploy the non-reactive bridge component to Ethereum Sepolia:
forge create --rpc-url $SEPOLIA_RPC --private-key $SEPOLIA_PRIVATE_KEY src/Bridge.sol:Bridge --value 0.1ether --constructor-args $SEPOLIA_CALLBACK_PROXY_ADDR 2 false 10 $WREACT_ADDR true false 0.05ether 250 100000Deployed address:
export BRIDGE_ADDR=... // to be announced laterIf the token is mintable, authorize the bridge to mint WREACT tokens:
cast send --rpc-url $SEPOLIA_RPC --private-key $SEPOLIA_PRIVATE_KEY $WREACT_ADDR "authorizeMinter(address)" $BRIDGE_ADDROtherwise, provide liquidity to the bridge directly:
cast send --rpc-url $SEPOLIA_RPC --private-key $SEPOLIA_PRIVATE_KEY $WREACT_ADDR "transfer(address,uint256)" $BRIDGE_ADDR 1etherEnsure the deployment keys match before proceeding with the Reactive Bridge setup:
forge create --legacy --rpc-url $REACTIVE_RPC --private-key $SEPOLIA_PRIVATE_KEY src/ReactiveBridge.sol:ReactiveBridge --value 1ether --constructor-args 5318008 11155111 $BRIDGE_ADDR 2 false 10 0.05ether 250 trueDeployed address:
export RBRIDGE_ADDR=... // to be announced laterInitiate the bridging of REACT tokens to Ethereum Sepolia:
cast send --legacy --rpc-url $REACTIVE_RPC --private-key $SEPOLIA_PRIVATE_KEY $RBRIDGE_ADDR "bridge(uint256,address)" 0x123467 $RECIPIENT_ADDR --value 1etherThis command triggers four reactive transactions on the bridge contract:
- Initial Reaction: Processes the
SendMessageevent from the Reactive Network and sends the initial callback to Ethereum Sepolia. - First Confirmation: Responds to the
ConfirmationRequestevent from Ethereum Sepolia and sends the first confirmation callback. - Final Confirmation: Handles another
ConfirmationRequestevent, sending the final callback and minting WREACT tokens on Ethereum Sepolia. - Delivery Confirmation: Processes the
DeliveryConfirmationevent from the other side, completing the bridging sequence with no further callbacks.
To unwrap some WREACT and send it back to the Reactive Network, first authorize the bridge on Ethereum Sepolia:
cast send --rpc-url $SEPOLIA_RPC --private-key $SEPOLIA_PRIVATE_KEY $WREACT_ADDR "approve(address,uint256)" $BRIDGE_ADDR 0.75etherThen initiate the bridging sequence:
cast send --rpc-url $SEPOLIA_RPC --private-key $SEPOLIA_PRIVATE_KEY $BRIDGE_ADDR "bridge(uint256,address,uint256)" 0x987643 $RECIPIENT_ADDR 0.75ether --value 0.2etherThis triggers four additional reactive transactions with similar semantics:
- Initial Message: The Ethereum Sepolia bridge sends an
InitialMessageto the Reactive Network. - First Confirmation: The Reactive Network responds with a
FirstConfirmation. - Final Confirmation: The final confirmation triggers the actual transfer of funds back to the Reactive Network.
- Delivery Confirmation: A
DeliveryConfirmationis sent to Ethereum Sepolia, marking the successful completion of the process.