Remix
In this tutorial, we'll walk through creating a basic Remix project and deploying a sample contract.
Explore the Remix workspace
To start using Remix, navigate to their website. The default project includes a code sample with a configured smart contract.
Compile a Remix contract
Navigate to the Solidity compiler tab on the left navigation and click Compile contract.
Deploy the contract
You can deploy a smart contract using the injected provider, meaning Remix can auto-detect the network you're on and your account information. To do this, navigate to the Deploy & run transactions tab.
The public endpoints are rate limited and not meant for production systems. To use Infura, you'll need to get an API key. Then, manually add a network to your MetaMask wallet using the network information.
Switch to the Linea network (mainnet or testnets) in your MetaMask wallet, and from the ENVIRONMENT drop down, select Injected provider - MetaMask.
Then, select Deploy and confirm the transaction. This deploys the contract to the network selected in MetaMask.
Customize and deploy with Linea integration
With the latest update, you can now easily integrate the Linea network into Remix using the Customize this list... feature. This simplifies the deployment process by allowing you to enable Linea as an environment directly within Remix.
Enable Linea in the environment list
- Navigate to the Deploy & run transactions tab.
- Under the ENVIRONMENT dropdown menu, click on Customize this list....
- In the Deploy using a Browser Extension section, check the L2 - Linea - MetaMask option.
- The L2 - Linea - MetaMask option will now appear in the ENVIRONMENT dropdown.
Deploy a contract on Linea
- From the ENVIRONMENT dropdown, select L2 - Linea - MetaMask.
- Connect your MetaMask wallet, ensuring it is set to the Linea mainnet or testnet.
- Compile your smart contract as described earlier in this tutorial.
- Click Deploy and confirm the transaction in MetaMask.