Module 3 - Deploying a Smart Contract on Rome EVM
Introduction
Section titled “Introduction”This guide provides step-by-step instructions for deploying a smart contract on the Rome EVM network using MetaMask and Remix IDE.
Prerequisites
Section titled “Prerequisites”- MetaMask: You Metamask wallet using which you deployed your L2
- Remix IDE: We will be utilizing Remix for deploying the smart contract directly.
- Solana Wallet: Your Solana wallet using which you converted SOL to rSOL
Set-up Rome Network in Metamask
Section titled “Set-up Rome Network in Metamask”- Open MetaMask and click on the network dropdown at the top.
- Select the network of Rome EVM, which you created previously which must be having rSOL tokens.
Write your Smart Contract
Section titled “Write your Smart Contract”- Open Remix IDE in your browser.
- Create a new file or open an existing one with your smart contract code.
- For this example, we’ll use a simple “Hello World” contract using Solidity
// SPDX-License-Identifier: MIT// compiler version must be greater than or equal to 0.8.26 and less than 0.9.0pragma solidity ^0.8.26;contract HelloWorld { string public greet = "Hello World!";}
- Compile the smart contract.
- In Remix IDE, go to the “Deploy & Run Transactions” tab.
- In the “Environment” dropdown, select “Injected Provider - MetaMask”. Ensure MetaMask is connected to the Rome network
- Click Deploy.
- MetaMask will prompt you to confirm the transaction. Review the details and approve it. Wait for the transaction to be confirmed on the Rome network.
- Once the transaction is confirmed, Remix will display the deployed contract address, somewhat like this.