Hi there! Welcome to our OVM ERC20 Waffle tutorial.
If your preferred smart contract testing framework is Truffle, see our OVM ERC20 Truffle tutorial here (todo). If you're interested in writing your first L2-compatible smart contract using Waffle as your smart contract testing framework, then you've come to the right place! This repo serves as an example for how to test running your contracts in the EVM and OVM and how to uncover OVM bugs for the Optimism team to fix.
node v11.10.1
To start out, clone this example repo
git clone https://github.com/ethereum-optimism/ERC20-Example.git
Now, enter the repository
cd ERC20-Example
Install all dependencies
yarn install
To build contracts and run tests in the EVM:
yarn all:evm
To build contracts and run tests in the OVM:
yarn all:ovm
Our goal is to bring the OVM as close to 100% compatibility with all existing Ethereum projects, but our software is still in an early stage. This document will maintain the most up to date list of known incompatibilities between the OVM and EVM, along with our plans to fix them.
Most likely, all of your tests will be passing in the EVM, but not all of your tests will be passing in the OVM. We recommend isolating issues by running the single failing tests and commenting out parts of contracts until you narrow down what line(s) of Solidity are causing the discrepancy between the EVM and OVM. Then, hop in our Discord and share the bug you've uncovered and we'll fix it as soon as possible.
The OVM provides a fresh new take on layer 2 development: it's identical to layer 1 development. No hoops, no tricks--the Ethereum you know and love, ready to scale up with L2. For more info on our progress and what's going on behind the scenes, you can follow us on Twitter and check out our docs!
Example project not working? Create a Github Issue, or hop in our Discord channel and ask away.