- Core Solidity modules live in
src/, split intosrc/hub_readerandsrc/monad; shared utilities live insrc/library. - Automation scripts reside in
script/(Foundry); compiled artifacts land inout/. - Tests live in
test/using.t.solsuffixes; dependencies stay inlib/; align configuration via root-levelfoundry.tomland.env.example.
forge buildorjust buildcompiles the workspace with default remappings.forge testandforge test --rpc-url $BSC_RPC_URLexecute the suite locally or against a fork.forge lintthenforge fmtkeep Solidity style consistent; run them before sharing branches.just deploy-hub-readerandjust deploy-monad-stakingbroadcast deployments through the prewired RPCs.
- Use 4-space indentation,
pragma solidity ^0.8.x, sorted imports, and SPDX identifiers. - Name contracts, libraries, and interfaces in PascalCase; state variables in camelCase; constants in ALL_CAPS.
- Match test filenames to their targets (
StakingLens.t.sol) and prefix helper contracts withTest. - Validate formatting with
forge fmtorforge fmt --checkbefore review.
- Keep integration scenarios in dedicated contracts and isolate unit fixtures per module.
- Leverage
vm.expectRevert,vm.prank, and explicitassertEqmessages to clarify intent. - When forking, pass the RPC with
--rpc-urland note chain assumptions in header comments. - Prioritize coverage of staking hub reads and Monad staking lens behavior;
forge coverage --report lcovhelps quantify readiness.
- Follow the short imperative style seen in history (
add auto formatter), keeping summaries under 65 characters. - Reference tickets, flag deployment or configuration impacts, and list the tests you ran.
- For PRs, link on-chain transactions, attach explorer URLs or calldata, and note any environment variable or RPC updates.
- Copy
.env.exampleto.env, add RPC URLs and scan keys matchingfoundry.toml, and keep secrets untracked. - Limit raw private keys to deployment contexts; favor hardware signing for
forge script --broadcast. - Before merging, confirm remappings, target chain IDs, and contract addresses to avoid wrong-chain deployments.