Home

Awesome

Mox Favorites CU

This is part of the Cyfrin Updraft Vyper Course.

Getting Started

Prerequisites

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:

Not Etherscan at this time.