StealthGiveStealthGive
Smart Contracts

Deployment

Compile, test, and deploy the contracts to Arbitrum Sepolia using Foundry.

A working manual,

edited & set
by Ezra Nahumury

Compile & Test

── bash ──
cd sc-StealthGive
forge build
forge test -vv          # 24/24 passing against vendor stubs

Environment

Copy .env.example and fill in your testnet private key and an Arbitrum Sepolia RPC URL.

── bash ──
cp .env.example .env
# Then edit .env:
PRIVATE_KEY=0x...                # testnet only — do not reuse mainnet
ARB_SEPOLIA_RPC=https://sepolia-rollup.arbitrum.io/rpc
ARBISCAN_API_KEY=...             # for verification

Deploy

  1. Source the env

    ── bash ──
    source .env
  2. Run the deploy script

    ── bash ──
    forge script script/Deploy.s.sol:Deploy \
      --rpc-url $ARB_SEPOLIA_RPC \
      --broadcast --skip test
  3. Update the frontend

    Copy the printed addresses for SGD, cSGD, Factory, and Registry into fe-stealthgive/lib/addresses.ts.

Verify on Arbiscan

Verification uses Etherscan API V2 (multi-chain via chainid param). Set ARBISCAN_API_KEY first.

── bash ──
forge verify-contract \
  --chain arbitrum-sepolia \
  --watch \
  <contract-address> \
  src/Campaign.sol:Campaign