Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@ POLYGON_RPC_URL=
ARBITRUM_RPC_URL=
MONAD_RPC_URL=

# Etherscan API Keys
ETHEREUM_SCAN_API_KEY=
OPTIMISM_SCAN_API_KEY=
BASE_SCAN_API_KEY=
BSC_SCAN_API_KEY=
# AVALANCHE_SCAN_API_KEY=
POLYGON_SCAN_API_KEY=
ARBITRUM_SCAN_API_KEY=
# Explorer API Keys
ETHERSCAN_API_KEY=

# Deployed addresses
STAKING_LENS_ADDRESS=

# Private Key for Deployment
PRIVATE_KEY=
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Gem Wallet deployment helpers and read lenses.
## Development

1) Install [Foundry](https://book.getfoundry.sh/).
2) Copy `.env.example` to `.env` and fill RPCs (including `MONAD_RPC_URL`), scan keys, and `PRIVATE_KEY` for deploys.
2) Copy `.env.example` to `.env` and fill RPCs (including `MONAD_RPC_URL`), explorer keys, and `PRIVATE_KEY` for deploys.

## Common Tasks

Expand All @@ -23,6 +23,8 @@ Gem Wallet deployment helpers and read lenses.
- Stargate fee receiver: `just deploy-stargate optimism` (or another supported chain)
- Monad staking lens: `just deploy-monad-staking`

## Deployments


- Hub Reader (BSC): [0x830295c0abe7358f7e24bc38408095621474280b](https://bscscan.com/address/0x830295c0abe7358f7e24bc38408095621474280b)
- Monad Staking Lens: [0x1c5C7645daB3A1642048AF96FACE6be29952CbF9](https://monadvision.com/address/0x1c5C7645daB3A1642048AF96FACE6be29952CbF9?tab=Contract)

9 changes: 0 additions & 9 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,3 @@ avalanche = "${AVALANCHE_RPC_URL}"
polygon = "${POLYGON_RPC_URL}"
arbitrum = "${ARBITRUM_RPC_URL}"
monad = "${MONAD_RPC_URL}"

[etherscan]
ethereum = { key = "${ETHEREUM_SCAN_API_KEY}" }
optimism = { key = "${OPTIMISM_SCAN_API_KEY}" }
base = { key = "${BASE_SCAN_API_KEY}" }
bsc = { key = "${BSC_SCAN_API_KEY}" }
# avalanche = { key = "${AVALANCHE_SCAN_API_KEY}" } // We don't need api key for verification
polygon = { key = "${POLYGON_SCAN_API_KEY}" }
arbitrum = { key = "${ARBITRUM_SCAN_API_KEY}" }
31 changes: 31 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ list:
build:
forge build

build-monad:
forge build --contracts src/monad/StakingLens.sol

test:
forge test

Expand All @@ -20,3 +23,31 @@ deploy-hub-reader:

deploy-monad-staking:
forge script --force script/monad/StakingLens.s.sol:StakingLensScript --rpc-url "$MONAD_RPC_URL" --broadcast -vvvv

read-staking-lens-address BROADCAST_FILE="broadcast/StakingLens.s.sol/143/run-latest.json":
#!/usr/bin/env bash
jq -r '.receipts[]?.contractAddress // empty' "{{BROADCAST_FILE}}"

verify-monad-staking ADDRESS="": build-monad
ADDRESS_TO_VERIFY=${STAKING_LENS_ADDRESS:-${ADDRESS-}}
[ -n "${ADDRESS_TO_VERIFY-}" ] || { echo "Set STAKING_LENS_ADDRESS (hint: STAKING_LENS_ADDRESS=$(just read-staking-lens-address))" >&2; exit 1; }
forge verify-contract \
--rpc-url https://rpc.monad.xyz \
--verifier sourcify \
--verifier-url 'https://sourcify-api-monad.blockvision.org/' \
--chain-id 143 \
"$ADDRESS_TO_VERIFY" \
src/monad/StakingLens.sol:StakingLens

verify-monad-staking-etherscan ADDRESS="": build-monad
ADDRESS_TO_VERIFY=${STAKING_LENS_ADDRESS:-${ADDRESS-}}
[ -n "${ADDRESS_TO_VERIFY-}" ] || { echo "Set STAKING_LENS_ADDRESS (hint: STAKING_LENS_ADDRESS=$(just read-staking-lens-address))" >&2; exit 1; }
[ -n "${ETHERSCAN_API_KEY-}" ] || { echo "ETHERSCAN_API_KEY is required" >&2; exit 1; }
forge verify-contract \
--verifier etherscan \
--verifier-url 'https://api.etherscan.io/v2/api?chainid=143' \
--chain 143 \
--rpc-url https://rpc.monad.xyz \
--etherscan-api-key "$ETHERSCAN_API_KEY" \
"$ADDRESS_TO_VERIFY" \
src/monad/StakingLens.sol:StakingLens