Skip to content

Latest commit

 

History

History
146 lines (101 loc) · 3.09 KB

README.md

File metadata and controls

146 lines (101 loc) · 3.09 KB

Mox Favorites CU

This is part of the Cyfrin Updraft Vyper Course.

Getting Started

Prerequisites

  • git
    • You'll know you've done it right if you can run git --version and see a version number.
  • anvil
    • You'll know you've done it right if you can run anvil --version and see an output like anvil 0.2.0 (fdd321b 2024-10-15T00:21:13.119600000Z)
  • era-anvil-zksync-node
    • You'll know you've done it right if you can run anvil-zksync --version and see an output like anvil-zksync 0.1.0-alpha.28
  • moccasin
    • You'll know you've done it right if you can run mox --version and get an output like: Moccasin CLI v0.3.0

Installation

git clone https://github.com/cyfrin/mox-favorites-cu
cd mox-favorites-cu

Quickstart

mox run deploy 

Usage

Compile

mox compile

Test

mox test

Deployment

Deployment - pyevm

mox run deploy

Deployment - eravm

mox run deploy --network eravm

Deployment - anvil

  1. In a terminal, run:
anvil
  1. Then, in another terminal, run:
mox run deploy --network anvil

Deployment - Testnet or Mainnet

Let's say you want to deploy to the sepolia-zksync network.

  1. Update your moccasin.toml entry for that network:
[networks.sepolia-zksync]
url = "$SEPOLIA_ZKSYNC_RPC_URL"
chain_id = 300
default_account_name = "default"
is_zksync = true
save_to_db = true
explorer_uri = "https://explorer.sepolia.era.zksync.dev"
explorer_type = "zksyncexplorer"
  1. Add a SEPOLIA_ZKSYNC_RPC_URL environment variable to your shell or a .env file:
# This is a public endpoint, feel free to try this one
SEPOLIA_ZKSYNC_RPC_URL="https://sepolia.era.zksync.dev"
  1. Make sure you have a wallet named default that is encrypted
mox wallet import default

You will be prompted to enter your private key, and a password to encrypt it with.

Once done, you can verify it's accessible by running:

mox wallet list

And seeing the default wallet listed.

  1. Deploy to the network
mox run deploy --network sepolia-zksync

You will be prompted for your wallet password to unlock the wallet.

Verification

If you want to verify your contract, add the explorer_uri, explorer_type, and explorer_api_key (if applicable) to your moccasin.toml file.

As of writing, only the following are supported:

  • Blockscout
  • ZKsync explorer

Not Etherscan at this time.