Developing smart contracts on Optimism

This guide shows you the ropes of developing smart contracts for Optimism. With Optimism, all your favourite developer tools work out the box, no special set up required. They work because Optimism is EVM Equivalent (opens new window) with some small exceptions. We have made this guide to make it that much easier to get started!

Optimism supports Solidity (opens new window) as well as Vyper (opens new window). If you have never written a smart contract before, we have a more step by step guide for developers using Remix and recommend reading the Solidity docs getting started section (opens new window).

# Local Development

To get started we need to get a local environment set up for testing and development. We have a Hardhat tutorial (opens new window), dapptools tutorial (opens new window), as well as a Truffle tutorial (opens new window). If you prefer doing things in your browser, we also have a Remix tutorial (opens new window).

Depending on your set up you will need to set up a local testnet. All of the above tutorials have instructions on how to set up an appropriate testing environment.

# Deploying on Testnet

So you've written your contracts and are ready to deploy them to the testnet! First things first you are going to need some test ETH on Optimism Kovan. Head to the faucet (opens new window) for some test ETH on both Kovan and Optimism Kovan.

Next you will need to connect to the Optimism Kovan network to deploy your contracts. You can find all the required network information as well as PRC endpoints in our networks page. Additionally we have a helpful page of debugging tools you can make use of while working out those final bugs.

Please read through our known issues if you run into any unexpected behaviors before you deploy to mainnet.

# Mainnet Deployments

Ready for mainnet? Fantastic! Just like with the testnet, you are going to need ETH on the Optimism network in order to deploy.

There are three ways you can do this:

  1. Bridge ETH from mainnet to Optimism using the Optimism Gateway (opens new window).
  2. Use a fiat onramp (opens new window) directly onto Optimism.
  3. Bridge ETH from another chain to Optimism using a third party bridge (opens new window).

Now that your deployer address has ETH, you will need to point to the right network to deploy. You can find the required network information as well as RPC provider information in our networks page.

If you run into any trouble don't hesitate to ask for help on our Discord (opens new window)!