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 stubsEnvironment
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 verificationDeploy
Source the env
── bash ──source .envRun the deploy script
── bash ──forge script script/Deploy.s.sol:Deploy \ --rpc-url $ARB_SEPOLIA_RPC \ --broadcast --skip testUpdate the frontend
Copy the printed addresses for SGD, cSGD, Factory, and Registry intofe-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