in a second terminal window:
YourContract.sol
-> L2 An amended version of the basic YourContract that comes with scaffold-ethERC20.sol
-> L1 An ERC20 contract with a mint(value)
function that allows any user to mint themselve some tokensL1ERC20Gateway.sol
The example Optimism L1 Gateway contractsL2DepositedERC20.sol
The example Optimism L2 Deposited ERC20 contractin a third terminal window, generate a local account:
when the local nodes are up and running, deploy local contracts & attempt to go from L1 -> L2 and back again!
hardhat.config.js
:oe-deploy.js
, and split out our deploy()
function in utils.js
such that it can deploy on the EVM or the OVM.oe-deploy.js
instantiates using the specified network (currently localhost
or kovan
), deploys the above contracts, tying the bridged ERC20s, initialises the OVM_L2DepositedERC20
, and then if demo == true
, it demonstrates the L1->L2->L1 ERC20 bridging.const { Watcher } = require('@eth-optimism/watcher')
which monitors the relayed messages between L1 and L2.