Deposit ERC-20 tokens from L1 to L2 using Optimism and Optimism-compatible bridge.
Go to file
Moon Man afdab1cd64 rm built stuff 2023-08-20 15:23:22 -04:00
src initial commit. 2023-08-20 14:52:05 -04:00
.gitignore rm built stuff 2023-08-20 15:23:22 -04:00
README.md formatting 2023-08-20 14:53:59 -04:00
package-lock.json initial commit. 2023-08-20 14:52:05 -04:00
package.json initial commit. 2023-08-20 14:52:05 -04:00
tsconfig.json initial commit. 2023-08-20 14:52:05 -04:00

README.md

L2 Optimism ERC-20 Bridging

This is for depositing L1 ERC-20 tokens to L2. Written for Base blockchain originally.

This is a separate project from the token build/deploy project because there is a dependency conflict between Hardhat and the Optimism SDK.

Build

npm install #download dependencies
npx tsc # compile

configure

create a file .env.dev:

MNEMONIC="special person entering our world egg yolks"
L1_TOKEN_ADDRESS=0xwhatever01
L2_TOKEN_ADDRESS=0xwhatever02
L1_RPC_URL="https://goerli.infura.io/v3/yourapikeyhere"
L2_RPC_URL=https://goerli.base.org

Tailor to your environment. You can create multiple with different suffixes, they are loaded by the NODE_ENV environment variable below.

Run

NODE_ENV=dev node dist/index.js weiamounthere

License

MIT license.