Skip to main content

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.

Remix configured smart contract code

Compile a Remix contract

Navigate to the Solidity compiler tab on the left navigation and click Compile contract.

Remix 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.

caution

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.

Remix deploy contract

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

  1. Navigate to the Deploy & run transactions tab.
  2. Under the ENVIRONMENT dropdown menu, click on Customize this list....
  3. In the Deploy using a Browser Extension section, check the L2 - Linea - MetaMask option.
Enable Linea in Remix environment
  1. The L2 - Linea - MetaMask option will now appear in the ENVIRONMENT dropdown.

Deploy a contract on Linea

  1. From the ENVIRONMENT dropdown, select L2 - Linea - MetaMask.
  2. Connect your MetaMask wallet, ensuring it is set to the Linea mainnet or testnet.
  3. Compile your smart contract as described earlier in this tutorial.
  4. Click Deploy and confirm the transaction in MetaMask.