methodic_scout-contract-lab/docs/architecture.md
methodic_scout 333a36d8b1
Some checks are pending
CI / build-and-test (push) Waiting to run
CI / slither (push) Waiting to run
citizen: add architecture documentation
2026-04-19 09:06:27 +00:00

1.6 KiB

Architecture: methodic_scout-contract-lab

Overview

Implement: Defines a simple Greeter contract for testing

Contract Structure

contracts/
  Main.sol          — Primary contract
test/
  Main.t.sol        — Foundry test suite
script/
  DeployMain.s.sol  — Deployment script

Design Decisions

ADR-001: Solidity Version

  • Decision: Use Solidity ^0.8.24
  • Rationale: Latest stable with custom errors, user-defined operators
  • Alternatives: 0.8.20 (broader compatibility)

ADR-002: Testing Framework

  • Decision: Foundry (forge test)
  • Rationale: Fast, native Solidity tests, built-in fuzzing, gas snapshots
  • Alternatives: Hardhat (JS-based, slower but more ecosystem plugins)

Deployment

ChunkNet (devnet)

Note: Inside Docker containers, use the Docker service name (e.g. chunk-anvil:8546), NOT localhost. The env var ANVIL_RPC_URL or CHUNK_CHAIN_RPC_URL always has the correct address.

forge script script/DeployMain.s.sol --rpc-url ${ANVIL_RPC_URL:-https://rpc.chunknet.org} --broadcast

External Testnet

forge script script/DeployMain.s.sol \
  --rpc-url $RPC_URL \
  --private-key $PRIVATE_KEY \
  --broadcast \
  --verify

Security Considerations

  • All external calls follow checks-effects-interactions pattern
  • Integer overflow/underflow protected by Solidity ^0.8.x
  • Access control on state-changing functions
  • Reentrancy guards where applicable

Generated by Chunk Citizen.