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
  • Get everything ready
  • Remix & Sample Code
  • Steps to deploy

Was this helpful?

Edit on GitHub
  1. Introduction

Quick start

Last updated 5 months ago

Was this helpful?

In this section we'll get you deploying a sample contract on Mode in less than 10 minutes. Let’s see how to deploy a smart contract on Mode using the for simplicity.

Get everything ready

Before getting started:

  1. Follow for the step-by-step on how to add Mode testnet to .

  2. This guide assumes you have got Sepolia ETH and bridged to the Mode Testnet Network. Learn how to do that in Testnet Faucets

We are ready to get started!

Remix & Sample Code

is a no-setup tool 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.

We added a few lines of code to register this contract on the SFS. You can copy and then paste this in Remix or use your own contract code. Here's the sample code:

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

pragma solidity ^0.8.20;

interface Sfs {
    function register(address _recipient) external returns (uint256 tokenId);
}

contract Storage {

    uint256 number;

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

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

Steps to deploy

  1. Copy the sample code and paste it in one of the .sol files in Remix

  2. To compile your smart contract, go to the Solidity Compiler tab and select the contract you want to compile

  3. Click on "Compile", you can also enable "Auto Compile" for automatic compilation whenever you change the contract code.

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

  2. 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 Testnet as your selected network in Metamask before deploying.

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

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 this specification with all Optimism chains .

If you want to learn how to interact with your recently deployed contact, check .

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

🕐
here
Discord
Remix IDE
Metamask
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.
Testnet
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 - correct settings
2. How to explore and interact with your deployed smart contract?