Deploy, Interact and Verify Smart Contracts using Remix and Rootstock Explorer
The process of writing, compiling and deploying Solidity contracts can be tedious or a bit obscure at the beginning, if you try to do it programmatically or using terminals. Get started writing, compiling, and deploying Solidity contracts quickly with Remix. Remix offers an online IDE that allows for writing, compiling, interacting and deploying smart contracts to any network.
In this guide, we will use the Remix online IDE to write, compile, deploy, interact and verify a smart contract on the Rootstock Testnet Explorer.
Prerequisites
- Remix online IDE, go to the Remix online IDE
- MetaMask Wallet. See how to Configure MetaMask Wallet for Rootstock
- Rootstock Testnet Explorer
Setting up Remix
In the left menu, click on Deploy and run transactions, and under Environment select Injected provider - MetaMask, this will trigger the MetaMask Wallet, confirm connection, and ensure you are logged in to Metamask and connected to the Testnet or Mainnet Rootstock network.
Once selected, under Account, select the account you want to deploy the contract with.
Writing a Smart Contract
In the left menu, click on File explorer, and under Workspaces, you can create separate workspaces with different templates, like ERC20
, ERC1155
, an empty one, or use the default one that comes with a simple set of example contracts.
Inside the contracts folder, put all the contracts you want that satisfy the dependencies of the main contract you want to deploy, if any.
In this guide, we’ll use one of the example contracts that Remix provides in the default workspace, 1_Storage.sol
.
⚠️ Note: for the sake of the verification process some steps after, ensure the
.sol
filename of the main contract matches exactly its declared name. So we’ll rename it toStorage.sol
.