Mode Docs
  • Introduction
    • ðŸŸĄIntroducing Mode
    • ✅AI Agent Dev Roadmap
  • AI AGENTS
    • Mode AI Terminal
    • ðŸĪ·What are AI Agents?
    • 🏗ïļBuilding your first agent
    • Tutorials
      • Quickstart
    • 🛠ïļAI Tooling
      • AI Audits
      • AI APIs
      • Frameworks
  • Tools
    • ðŸ–ĨïļRPC
    • ðŸŠķMultisig wallets
    • 🔁Bridge
    • 🚰Testnet Faucets
    • ðŸ•ĩïļBlock Explorers
    • 🗂ïļData Indexers
    • 🧙‍♂ïļOracles
    • ⛓ïļInteroperability
    • ⁉ïļRandomness
    • 🌎General Tooling
  • Tutorials
    • Interacting with Smart Contracts using ethers.js
    • Deploying a Smart Contract
      • Using Hardhat
      • Using Thirdweb
      • Using Foundry
      • Using Remix
    • Verifying your smart contract
      • Using Hardhat
      • Using Foundry
  • User Guides
    • â„đïļNetwork Details
    • ðŸĶŠAdd Mode
    • ðŸĄContract Addresses
      • Tokens
      • L1/L2 Mainnet Contracts
      • Testnet Contracts
    • 🌉Bridge
      • ➡ïļBridge to Mode
      • ⮅ïļBridge from Mode
      • 🏗ïļBridging to Testnet
    • ðŸ“ĪMove to/from CEX
  • $MODE
    • ðŸŸĄMODE Tokenonomics
    • 1ïļâƒĢSeason 1 (ended)
    • 2ïļâƒĢSeason 2 (ended)
    • 3ïļâƒĢGovernance Season 3 (ended)
      • Governance Contract Addresses
    • 4ïļâƒĢMode Governance Season 4
    • 5ïļâƒĢSeason 5
  • Other Docs
    • 🔓General Security
      • 🔓Mode L2 Security Model
      • ⛑ïļOptimism Bug Bounty
      • Security Upgrades
        • 01/08/2024 Bridge Upgrade Fund Rescue
        • 06/08/2024 Mode Mainnet Key Handover
      • 🔐Audits
    • 🔗Official Links
    • ðŸĪ˜Branding Guidelines
    • âŒĻïļNode Operators
Powered by GitBook
On this page
  • 1. Deploy using Remix
  • 2. How to explore and interact with your deployed smart contract?

Was this helpful?

Edit on GitHub
  1. Tutorials
  2. Deploying a Smart Contract

Using Remix

How to deploy with Remix IDE on MODE

PreviousUsing FoundryNextVerifying your smart contract

Last updated 1 year ago

Was this helpful?

Mode is an OP Stack Layer-2 designed for hyper-growth. Since MODE is built with the OP Stack, it is EVM compatible, allowing you to easily port your existing Ethereum-based smart contracts without modifying the code.

Let’s see how to deploy a smart contract on MODE using the .

This guide assumes you have got Sepolia ETH and bridged to the Mode Testnet Network.

1. Deploy using Remix

First of all you will need to have Mode network added to your Metamask. Follow for the step-by-step on how to add Mode testnet to Metamask.

We are ready to get started!

is a no-setup tool with a graphical interface for developing smart contracts. It’s easy to get started allowing a simple deployment process, debugging, interacting with smart contracts, and more. It’s a great tool to test quick changes and interact with deployed smart contracts.

For the sake of this tutorial, we will be deploying the ‘1_Storage.sol’ smart contract that comes as an example in Remix, but you can use any of your code. Here is the sample code, you can paste this in any .sol file:

1_Storage.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.8.2 <0.9.0;

contract Storage {

    uint256 number;
    
    function store(uint256 num) public {
        number = num;
    }

    function retrieve() public view returns (uint256){
        return number;
    }
}

To compile your smart contract, go to the Solidity Compiler tab and select the contract you want to compile. Click on "Compile", you can also enable "Auto Compile" for automatic compilation whenever you change the contract code.

Once the smart contract is compiled successfully, switch to the "Deploy & Run Transactions" tab.

In the "Environment" dropdown menu, select "Injected Provider - MetaMask"; this will connect your MetaMask to Remix and will allow you to make transactions from that connected wallet.

Make sure to have Mode as your selected network in Metamask before deploying

Select the compiled contract you want to deploy and click ‘Deploy.’

Now, MetaMask should pop up and ask you to confirm the transaction with super low fees.

CONGRATULATIONS! You just deployed your first smart contract to Mode.


2. How to explore and interact with your deployed smart contract?

Now that you have deployed your first smart contract to Mode let’s see how to interact with it.

You will see your deployed smart contract below in the ‘Deploy & Run Transactions’ tab. You can use the Remix interface to call the methods defined in your smart contract and access it’s public variables.

The screenshot below shows our deployed smart contract, where you can see all transactions, the creator wallet, balance, and more!

Notice that if you call one of the smart contract methods in Remix, you should see the transaction pop up in this explorer. You can directly interact with your deployed smart contract with Remix.

You now have learned how to deploy a smart contract on Mode using Remix online IDE!

In this tutorial, we also went through the Mode bridge, block explorer, and how to interact with your contract.

If you want the next challenge, you can try registering a contract for the SFS following this guide: SFS - Registering a contract with Remix

Make sure to open the advanced configurations and setting the EVM version to London. This is to avoid an issue with the PUSH0 opcode. You can read more on the issue with all the Optimism chains .

We can also find our deployed smart contract in , the Mode block scanner. Copy the contract address from Remix, go to , and paste it into the search bar.

Blockscout

To learn more about Mode and how to turn your code into a business, join our and say hello 👋

here
Blockscout
Blockscout
Discord
Remix IDE
Remix
This image shows a screenshot of Metamask wallet with the transaction to deploy the smart contract. It shows very low fees of around 0.35 dollars or 0.00018852 ETH.
This is a screenshot showing Remix I D E. There is a basic smart contract that will be used for the tutorial.
Solidity Compiler Tab