Foundry¶
Foundry 1.8.5 is the reference toolchain for this documentation: every Getting Started journey is executed with it.
curl -L https://foundry.paradigm.xyz | bash
foundryup --install 1.8.5
forge --version # forge Version: 1.8.5
foundry.toml
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
solc_version = "0.8.26" # pinned; matches contracts/studio/compilers.json
evm_version = "cancun" # chain 77240 runs PUSH0/MCOPY/TSTORE; never use blobhash()/blobbasefee
optimizer = true
optimizer_runs = 200
bytecode_hash = "none" # no metadata hash: deterministic runtime bytes for byte-for-byte verification
remappings = ["@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/"]
| Task | Command |
|---|---|
| Chain check | cast chain-id --rpc-url "$RPC" → 77240 |
| Account | cast wallet new keystore dev -p |
| Balance | cast balance <addr> --ether --rpc-url "$RPC" |
| Send | cast send <to> --value 0.01ether --keystore … --password-file … --rpc-url "$RPC" |
| Deploy | forge create src/C.sol:C --broadcast --keystore … --password-file … --rpc-url "$RPC" --constructor-args … (constructor args last) |
| Raw bytecode deploy | cast send --async <wallet opts> --create 0x<bytecode> (options before --create) |
| Call | cast call <addr> "get()(uint256)" --rpc-url "$RPC" |
| PQWERAI finality | cast rpc g4_status --rpc-url "$RPC" |
| Logs | cast logs --from-block N --to-block M --address <addr> "Event(...)" (≤ 5000 blocks) |
Notes from testing:
cast receipt <tx> statusprintstrue/false.forgelint warnings (e.g.reentrancy-events) are advisory; the tutorials are written to avoid them.- Offline builds:
FOUNDRY_OFFLINE=true FOUNDRY_SOLC=/path/to/solc-0.8.26. forge script --broadcastworks like on any EVM chain; set--chain-id 77240if you sign offline.
Sources at 72057fe3ec: developers/examples/first-contract/foundry.toml · scripts/devhub/run_examples.sh
Found a problem? Report a documentation issue · Build testnet-rc1+72057fe3ec