This project lets you send messages between two different networks. The sender contract is deployed on the Sepolia network and the receiver contract is deployed on the Optimism Sepolia network. The sender contract sends a message to the receiver contract and the receiver contract receives the message.
The project is a PoC. It uses Scaffold ETH 2 as a boilerplate to speed up prototyping time. The smart contract part is inside contracts. The frontend part is in the main page.
Before you begin, you need to install the following tools:
- Node (>= v18.17)
- Yarn (v1 or v2+)
- Git
- Install dependencies:
yarn install
- Start your NextJS app:
yarn start
Visit your app at: http://localhost:3000
.
This step is not necessary, as the contracts are already deployed. However, if you want to deploy the contracts, you can follow the steps below.
Deploy Sender.sol to Sepoplia
forge script --chain sepolia script/DeploySender.s.sol:DeploySender --rpc-url https://eth-sepolia.g.alchemy.com/v2/API_KEY --broadcast --verify -vvvv
Deploy Receiver.sol to Sepolia. Before deploying change in the DeployReceiver.s.sol
the address of the sender contract to the address of the sender contract deployed in the previous step.
forge script --chain optimism-sepolia script/DeployReceiver.s.sol:DeployReceiver --rpc-url https://opt-sepolia.g.alchemy.com/v2/API_KEY --broadcast --verify -vvvv
After the deployment place the addresses of the contracts in the contracts.ts
file.