Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
285 commits
Select commit Hold shift + click to select a range
54bd0e4
Add airdrop of gOHM to OHMv1 holders
0xJem Jan 12, 2026
8dde051
Add AGENTS.md
0xJem Jan 13, 2026
b9c73d7
Tweaks
0xJem Jan 13, 2026
b606f2c
Document agent behaviours
0xJem Jan 13, 2026
95e8d4e
fix: typos
0xJem Jan 13, 2026
9c27249
docs(AGENTS.md): details of suggested git commit messages
0xJem Jan 13, 2026
fa6a45e
chore: linting
0xJem Jan 13, 2026
ff895c3
docs(AGENTS.md): add suggested use of git worktree
0xJem Jan 13, 2026
e89bc19
docs(AGENTS.md): tweaks
0xJem Jan 13, 2026
f6e654e
Merge pull request #195 from OlympusDAO/feature/agent-docs
0xJem Jan 13, 2026
91afd51
Merge branch 'develop' into feature/migrator-burn
0xJem Jan 13, 2026
6a0d883
Merge branch 'master' into feature/migrator-burn
0xJem Jan 13, 2026
f51eda8
docs(AGENTS.md): add notes on common mix-ins and interfaces
0xJem Jan 13, 2026
d0252e1
feat: policy to allow for OHM v1 -> v2 migration, clean up of OCG pro…
0xJem Jan 13, 2026
ee8b200
docs(AGENTS.md): import behaviour
0xJem Jan 13, 2026
3ec9a97
test: split LegacyMigrator tests into per-function test files
0xJem Jan 13, 2026
ae2a7b9
test: shift tests to use modifiers, improve test coverage
0xJem Jan 14, 2026
e18bdb3
feat: improve test coverage, re-arrange tests, add support for partia…
0xJem Jan 14, 2026
b8e2c8a
fix: simplify state management with MINTR approval and migration cap,…
0xJem Jan 14, 2026
7f46344
deps: bump safe-utils to 0.0.17 (and related dependencies)
0xJem Jan 15, 2026
4f97301
fix: OHM v1 to v2 conversion rate using the same process as the origi…
0xJem Jan 15, 2026
c9822cd
fix: ensure that the OHM v2 amount is not zero
0xJem Jan 15, 2026
f4f1488
test: add fork test for migration without mocks
0xJem Jan 15, 2026
4669f03
refactor: set the merkle root in the constructor, migration cap in th…
0xJem Jan 15, 2026
a00207b
refactor: shift ILegacyMigrator into correct directory
0xJem Jan 15, 2026
e33e67b
refactor: remove airdrop from MigrationHelper contract
0xJem Jan 15, 2026
26e6659
fix: extract OwnedERC20 contract and treasury/migrator interfaces
0xJem Jan 15, 2026
3ce10cc
fix: rename MigrationHelper to MigrationProposalHelper
0xJem Jan 15, 2026
61e8da7
test: update MigrationProposal test to handle different stages of dep…
0xJem Jan 15, 2026
c0ae3e6
chore: linting
0xJem Jan 15, 2026
5a7d4ea
docs: update OCG proposal
0xJem Jan 15, 2026
9b440f6
feat: implement deployment scripts
0xJem Jan 15, 2026
611ea97
docs(AGENTS.md): instruction to pay attention to linter note-level
0xJem Jan 15, 2026
fa63358
fix: fix formatting in OCG proposal
0xJem Jan 15, 2026
31bf225
docs: typos
0xJem Jan 15, 2026
5e767e8
fix: versioned imports
0xJem Jan 15, 2026
316e7b8
fix: use safeApprove
0xJem Jan 15, 2026
e61493b
fix: update state before mint and burn of tokens
0xJem Jan 15, 2026
2faa31e
test: more precise event checking
0xJem Jan 15, 2026
20375d5
docs: update OCG proposal with additional steps
0xJem Jan 15, 2026
180e903
chore: TODO
0xJem Jan 15, 2026
7e2a46b
fix: avoid potential DoS when setting a new merkle root
0xJem Jan 15, 2026
b4bdecc
docs: update docs on setting a new merkle root
0xJem Jan 15, 2026
0eb5d38
fix: add versioned legacy treasury contracts, rename MS batch functio…
0xJem Jan 16, 2026
7f39edb
feat: add MS batch to disable permissions in the legacy treasury for …
0xJem Jan 16, 2026
495334c
fix: mintTempOHM helper now adds to the batch
0xJem Jan 16, 2026
ea14993
docs: add project-level MCP servers
0xJem Jan 16, 2026
f403fc4
docs: spacing
0xJem Jan 16, 2026
e1ea06b
fix(proposal): set migration cap when enabling LegacyMigrator, use co…
0xJem Jan 16, 2026
16c6dd0
fix(deploy): add OHM v1 to env.json, use correct key in deployment sc…
0xJem Jan 16, 2026
88c50f2
fix: remove TODO
0xJem Jan 16, 2026
5ddd22a
fix: more intuitive variable naming
0xJem Jan 16, 2026
1141e31
chore: linting
0xJem Jan 16, 2026
df10aff
chore: linting
0xJem Jan 16, 2026
51142d5
feat: add ability to run MS batches and OCG proposals on a local anvi…
0xJem Jan 16, 2026
1fb9663
feat: add support for validation of state after an MS batch has been …
0xJem Jan 16, 2026
0c9bdbe
fix: use correct keys for tempOHM in the MS batch
0xJem Jan 16, 2026
dc749bd
feat: add validation functions for migration batch functions
0xJem Jan 16, 2026
e255afe
feat: add missing anvil/tenderly fork support to BatchScriptV2, skip …
0xJem Jan 16, 2026
debb3d8
fix: add missing argument
0xJem Jan 19, 2026
ca6fed0
docs: update example for fork testing
0xJem Jan 19, 2026
c4d7e62
fix: minor consistency fix with function argument naming
0xJem Jan 19, 2026
0435bf9
fix: fixes issue with forge complaining about the DAO MS address not …
0xJem Jan 19, 2026
6b4771a
fix: correct reference to blocks instead of timestamp for treasury ti…
0xJem Jan 19, 2026
43f0e58
chore: add script to warp a local fork forward by the specified numbe…
0xJem Jan 19, 2026
0828cd1
fix: correct JSON keys
0xJem Jan 19, 2026
f878c33
fix: more accurate parsing of deployment function names
0xJem Jan 19, 2026
41a8a2a
fix: add missing ProposalScript
0xJem Jan 19, 2026
c9a8018
fix: adjust submit proposal script to support a local anvil fork
0xJem Jan 19, 2026
8655972
feat: add missing install script
0xJem Jan 19, 2026
fb9fe4d
fix: consolidate MS batch simulation/validation code, fix issue with …
0xJem Jan 19, 2026
25eb316
fix: add missing TempOHM spending approval by timelock
0xJem Jan 19, 2026
595e7c5
fix: add missing addresses for OCG proposal
0xJem Jan 19, 2026
8e21409
test: fix OCG proposal tests
0xJem Jan 19, 2026
8351c33
fix: make OwnedERC20 inherit from ERC20Burnable instead of implementi…
0xJem Jan 19, 2026
bd78ed8
feat(migration): make OHM v1 migration limit configurable
0xJem Jan 19, 2026
e8dac68
fix: add missing deployment arg
0xJem Jan 19, 2026
78052d0
fix: incorrect commit SHA for safe-utils dependency
0xJem Jan 20, 2026
ef55201
fix: correct scale for OHM v1 to migrate
0xJem Jan 20, 2026
7f0c929
fix: correct format for blocks given in anvil_warp.sh
0xJem Jan 20, 2026
a562616
fix: correct key for DAO MS
0xJem Jan 20, 2026
3179059
docs: fix discrepancies in FORK docs
0xJem Jan 20, 2026
b7bac4b
fix: ensure approval is given for the correct amount of TempOHM to de…
0xJem Jan 20, 2026
36b7a86
chore: linting
0xJem Jan 20, 2026
3d04f34
fix: compiler error
0xJem Jan 20, 2026
6d13780
test: fix failing test due to change in MockGohm index
0xJem Jan 20, 2026
0ade5dd
fix: tweaks to OCG proposal and burning of excess tokens
0xJem Jan 20, 2026
9d3c2bf
feat: add script to set the OHM v1 quantity to migrate on the Migrati…
0xJem Jan 20, 2026
cbee52a
chore: linting
0xJem Jan 20, 2026
230b462
test: add MigrationProposalHelper fork tests
0xJem Jan 20, 2026
6c472aa
fix: formatting in OCG proposal
0xJem Jan 20, 2026
46bfc86
feat: specify mintTempOHM now uses an args file, add script to determ…
0xJem Jan 20, 2026
5393502
feat: anvil script to deal gOHM on a local anvil fork
0xJem Jan 20, 2026
33fd930
fix: deploy MigrationProposalHelper with current quantity of OHM v1 t…
0xJem Jan 20, 2026
6027bf3
fix: address issues with executeOnAnvilFork script for OCG proposals,…
0xJem Jan 20, 2026
fc17b82
chore: linting
0xJem Jan 20, 2026
e701333
chore: linting
0xJem Jan 21, 2026
f71cac9
chore: exclude MaxMigratableOHMScript from unit tests
0xJem Jan 21, 2026
d4a8ade
fix: clean up RPC_URL references
0xJem Jan 21, 2026
146197b
fix: check whether lower bound fails when calculating the max migrata…
0xJem Jan 21, 2026
be02437
fix: minor code fixes
0xJem Jan 21, 2026
04d3758
chore: linting
0xJem Jan 21, 2026
4dd37f2
chore: linting
0xJem Jan 21, 2026
a861179
chore: rename LegacyMigrator to more appropriate V1Migrator
0xJem Jan 21, 2026
63fecc7
docs: add audit README and metrics
0xJem Jan 21, 2026
bfd7446
fix: store OHM v1 to migrate as number
0xJem Jan 21, 2026
3348fb8
docs(AGENTS.md): add notes on common mix-ins and interfaces
0xJem Jan 13, 2026
f97b789
docs(AGENTS.md): import behaviour
0xJem Jan 13, 2026
f35cbc0
docs(AGENTS.md): instruction to pay attention to linter note-level
0xJem Jan 15, 2026
9d80a3f
docs: add project-level MCP servers
0xJem Jan 16, 2026
9a0ffc2
chore: linting
0xJem Jan 16, 2026
dea10e0
docs: rename project in package.json
0xJem Jan 26, 2026
2238d1d
chore: split build script into traditional build script + install script
0xJem Jan 26, 2026
bd804a4
chore: remove .claude from gitignore
0xJem Jan 26, 2026
40c3396
docs: add claude skill for writing tests using the BTT format
0xJem Jan 26, 2026
5b86bcd
docs: add claude skill for test debugging
0xJem Jan 26, 2026
d8631cd
docs: add claude skill for linting
0xJem Jan 26, 2026
2a80fe0
chore: ignore local claude settings
0xJem Jan 26, 2026
68a53a5
chore: add conductor configuration
0xJem Jan 26, 2026
4c5bcf4
docs: add information on MCP servers
0xJem Jan 26, 2026
9cb4fd3
fix: adjust github workflow to use renamed scripts
0xJem Jan 26, 2026
c84f246
chore: linting
0xJem Jan 26, 2026
95f7d0f
chore: include claude files in markdownlint script
0xJem Jan 26, 2026
ec2fd23
chore: linting
0xJem Jan 26, 2026
9fe78b8
chore: ensure all fixes are linted
0xJem Jan 26, 2026
8fa785a
docs: fix example of unwrapped modifier logic
0xJem Jan 26, 2026
33aadde
chore: use markdownlint flag for invisible directories
0xJem Jan 26, 2026
9799f67
docs: tweaks to test-write skill
0xJem Jan 26, 2026
57fd9bc
docs: tweaks to lint-fix skill
0xJem Jan 26, 2026
04e6e66
docs: fix inconsistencies
0xJem Jan 26, 2026
c37baba
docs: fix function example
0xJem Jan 26, 2026
b9dbd61
Merge pull request #197 from OlympusDAO/agent-improvements
0xJem Jan 26, 2026
0c8f6a6
feat: add centralized emergency shutdown config
bust-playback Jan 28, 2026
02de17c
fix: align CoolerComposites contract name to CoolerV2Composites acros…
bust-playback Jan 28, 2026
86bc18e
fix: limit ccip-token-pool-non-mainnet to sepolia (not yet deployed o…
bust-playback Jan 28, 2026
1845d2e
feat: refactor update-emergency-config skill to parse existing scripts
bust-playback Jan 29, 2026
968daa9
fix(proposal): remove timelock balance checks to prevent griefing
0xJem Feb 3, 2026
0d5dd3c
fix: make burner category addition idempotent in migration helper
0xJem Feb 3, 2026
e050054
docs: clarify tempOHM burn behavior is intentional (#202)
0xJem Feb 3, 2026
1db0c63
feat: allow V1Migrator admin functions while disabled
0xJem Feb 3, 2026
ca52b3c
Merge pull request #204 from OlympusDAO/migrator-burn-idempotent
0xJem Feb 3, 2026
0a945db
Merge pull request #205 from OlympusDAO/migrator-admin-while-disabled
0xJem Feb 3, 2026
5c5c021
test(proposal): add griefing protection and end state tests
0xJem Feb 3, 2026
76b87c2
fix(v1migrator): prevent same merkle root from being set
0xJem Feb 3, 2026
ff5d49a
Merge branch 'feature/migrator-burn-fix' into migrator-setmerkleroot-…
0xJem Feb 3, 2026
8f5141a
test: exclude current root from fuzz test
0xJem Feb 3, 2026
71a605a
fix(test): use external OHMv2 holder in griefing test
0xJem Feb 3, 2026
f8b78b0
fix(test): remove duplicate comment and rename misleading test names
0xJem Feb 3, 2026
782f049
feat(V1Migrator): add previewMigrate view helper
0xJem Feb 3, 2026
21ffd50
test: fix _refreshMerkleTree to generate different root
0xJem Feb 3, 2026
a4e1928
test: remove unused _refreshMerkleTree and givenMerkleRootRefreshed
0xJem Feb 3, 2026
46ef1bf
fix(ops): use actual sender in Tenderly simulation
0xJem Feb 3, 2026
be5f410
feat(v1migrator): add rescue function to recover accidentally sent to…
0xJem Feb 3, 2026
222d3f9
Merge pull request #203 from OlympusDAO/fix/migrator-validation-grief
0xJem Feb 3, 2026
a15ed37
Merge pull request #208 from OlympusDAO/fix-olybatch-tenderly-sender
0xJem Feb 3, 2026
5946c7b
chore: rename sweep test file to rescue
0xJem Feb 3, 2026
6524e54
Merge pull request #207 from OlympusDAO/migrator-preview-migrate
0xJem Feb 3, 2026
1a9925d
Merge pull request #206 from OlympusDAO/migrator-setmerkleroot-guard
0xJem Feb 3, 2026
a5f3c5f
Merge pull request #209 from OlympusDAO/migrator-token-sweep
0xJem Feb 3, 2026
923918c
refactor(migrator): rename setMigrationCap to setRemainingMintApproval
0xJem Feb 3, 2026
ad0066a
Merge origin/feature/migrator-burn-fix into rename-migration-approval
0xJem Feb 3, 2026
a9ce985
Merge pull request #210 from OlympusDAO/rename-migration-approval
0xJem Feb 3, 2026
3627a72
test(migrator): fix linting issues in test files
0xJem Feb 3, 2026
3a1bce3
test: address compiler warning
0xJem Feb 5, 2026
ae31ce3
chore: remove Burner policy from DeployV2 (redundant)
0xJem Feb 5, 2026
6a4ebc0
feat(Burner): add PolicyEnabler mix-in, IVersioned and IERC165 support
0xJem Feb 5, 2026
c6df5df
fix(V1Migrator): remove redundant RolesConsumer mix-in
0xJem Feb 5, 2026
d73f43c
docs(proposal): add OHM v1 migration cap, links to GitHub PR, enablin…
0xJem Feb 5, 2026
f1bc8ca
docs(proposal): add validation of Burner enabled status
0xJem Feb 5, 2026
d76c1b3
test: tweaks
0xJem Feb 5, 2026
e7df6ab
test: correct revert signature
0xJem Feb 5, 2026
346d47f
fix: adjust OHM v1 quantity to migrate
0xJem Feb 5, 2026
ed52d8d
fix(migrator): allow rescue() when contract is disabled
0xJem Feb 10, 2026
81fa297
fix(migration): approve max uint256 for tempOHM to handle balance cha…
0xJem Feb 10, 2026
d625d8f
Merge pull request #213 from OlympusDAO/feature/migrator-rescue-fix
0xJem Feb 10, 2026
4cc5424
Merge pull request #214 from OlympusDAO/migrator-max-approval
0xJem Feb 10, 2026
3c6e5d9
feat: rewrite `update-emergency-config` skill to derive config from c…
zeroxnoodle Feb 10, 2026
771aa85
feat: update `update-emergency-config` to use `jq` and add validation…
zeroxnoodle Feb 10, 2026
6b883db
refactor: improve `update-emergency-config.md` skill
zeroxnoodle Feb 10, 2026
9a8290c
chore: update `emergency-config.json`
zeroxnoodle Feb 11, 2026
273e2a3
chore: exclude zero ms addresses from `emergency-config`
zeroxnoodle Feb 11, 2026
2bdd320
Merge pull request #211 from OlympusDAO/feature/migrator-burn-fix
0xJem Feb 12, 2026
a46c915
Merge branch 'feature/migrator-burn' into feature/migrator-deployment
0xJem Feb 12, 2026
912690e
docs: fix step numbering, add audit report
0xJem Feb 12, 2026
32885e8
docs: remove redundant comment
0xJem Feb 12, 2026
3dda04f
docs: add note on how the migration cap is determined
0xJem Feb 12, 2026
abd008a
Merge pull request #212 from OlympusDAO/feature/migrator-deployment
0xJem Feb 12, 2026
e8c7c00
Merge branch 'develop' into feature/migrator-burn
0xJem Feb 12, 2026
9a830dd
fix: update OHMv1ToMigrate amount
0xJem Feb 12, 2026
b333dd2
feat: deploy to mainnet
0xJem Feb 12, 2026
8abf84b
docs: update batch script documentation
0xJem Feb 12, 2026
8f61992
docs: enhance emergency config skill with shutdown and post-shutdown …
zeroxnoodle Feb 12, 2026
60b1422
docs: add values for kernel executor and role admin on sepolia and ma…
0xJem Feb 13, 2026
f8bc6d1
chore: add dependency for olympus-contracts repo
0xJem Feb 13, 2026
bc04406
chore: update proposal addresses with deployments
0xJem Feb 14, 2026
9076679
refactor: update printInputs and submitProposal scripts to use latest…
0xJem Feb 16, 2026
642cf1d
fix: adjust quantity of OHM v1 to migrate
0xJem Feb 16, 2026
72267ce
chore: remove olympus-contracts dependency
0xJem Feb 16, 2026
2d1f6fa
feat(scripts): add staking contract replacement scripts for sepolia
0xJem Feb 16, 2026
9a401c9
docs(scripts): simplify Step 1 with custom deploy-staking-only.js script
0xJem Feb 16, 2026
4527e79
docs(scripts): integrate Anvil fork instructions into main flow
0xJem Feb 16, 2026
568e8f5
docs(scripts): reference .env file for credentials
0xJem Feb 16, 2026
a8f6281
refactor(scripts): VerifyLegacyStaking reads from env.json
0xJem Feb 16, 2026
df4ed37
chore: set OHM v1 to migrate to a lower quantity
0xJem Feb 16, 2026
8db4d39
test: update flags in MigrationProposal test
0xJem Feb 17, 2026
ff9cde7
feat(shell): add Ledger support to grantRole.sh
0xJem Feb 17, 2026
24bce7b
chore: linting
0xJem Feb 17, 2026
2b914e3
refactor(scripts): detect chain from block.chainid in Roles.s.sol
0xJem Feb 17, 2026
f548680
feat(scripts): add verification phase to ReplaceStaking
0xJem Feb 17, 2026
ba21693
docs: tweak to anvil usage
0xJem Feb 17, 2026
718d56b
refactor(scripts): remove ClearinghouseRegistry update from ReplaceSt…
0xJem Feb 17, 2026
e9b075e
chore: revert env.json changes
0xJem Feb 17, 2026
c563023
feat(scripts): add LTV and enabled status to ReplaceStaking
0xJem Feb 17, 2026
6bf9eed
refactor(scripts): detect chain from block.chainid in Minter.s.sol
0xJem Feb 17, 2026
715b655
feat: sepolia deployment for sOHM/gOHM and dependent contracts
0xJem Feb 17, 2026
fa689b3
chore: linting
0xJem Feb 17, 2026
aa237ca
chore: minor fixes
0xJem Feb 17, 2026
a7ef0f3
fix: correct ordering of stake() parameters
0xJem Feb 17, 2026
b11728c
chore: bump OHM v1 to migrate value with actual
0xJem Feb 27, 2026
1355dfd
script: final amount of OHM v1 to migrate
0xJem Feb 27, 2026
b1f3120
script: add batch script to set merkle root on V1Migrator
0xJem Mar 2, 2026
375249a
docs: add detailed documentation on V1Migrator
0xJem Mar 2, 2026
c48ff11
Merge pull request #198 from CallistoDAO/emergency
0xJem Mar 2, 2026
8f211f9
Merge pull request #196 from OlympusDAO/feature/migrator-burn
0xJem Mar 2, 2026
06a0bcb
Merge branch 'develop' into emergency
0xJem Mar 10, 2026
4291a3a
chore: update with V1 Migrator and Burner
0xJem Mar 10, 2026
c9ce2db
chore: add missing emergency MS entry for arbitrum
0xJem Mar 10, 2026
c18153e
chore: linting
0xJem Mar 10, 2026
967864e
docs: fix typo
0xJem Mar 10, 2026
c4fc7fa
script: improve validation
0xJem Mar 10, 2026
2379077
script: remove obsolete emergency scripts, update docs
0xJem Mar 10, 2026
2a0d627
chore: linting
0xJem Mar 10, 2026
c1ea34f
chore: correct ABI
0xJem Mar 10, 2026
815e9cd
chore: nitpicks
0xJem Mar 10, 2026
819fb9d
docs: restrict update-emergency-config to policies/periphery
0xJem Mar 10, 2026
5e0c81e
docs: improve scan mode inheritance detection in update-emergency-config
0xJem Mar 10, 2026
68056fa
chore: add missing definition for CD LimitOrders
0xJem Mar 10, 2026
e5a4a80
script: format files after config
0xJem Mar 10, 2026
d260d43
docs: clarify /update-emergency-config command usage
0xJem Mar 10, 2026
4c75901
fix: implement JSON schema validation in emergency-config validator
0xJem Mar 10, 2026
c4a504d
fix: validate function existence in referenced ABIs
0xJem Mar 10, 2026
bcbfb26
ci: install dependencies in emergency-config validation workflow
0xJem Mar 10, 2026
830906a
chore: linting
0xJem Mar 10, 2026
1acaee3
script: tweaks to validation workflow
0xJem Mar 10, 2026
4175b49
chore: missing tool
0xJem Mar 10, 2026
1485bfc
Merge pull request #183 from OlympusDAO/emergency
0xJem Mar 10, 2026
effdca2
Merge branch 'develop' into opencode/eager-forest
0xJem Mar 10, 2026
769a1b7
chore: consistent naming of Cooler Composites key
0xJem Mar 10, 2026
85a9b2b
fix(docs): align sepolia addresses with env.json
0xJem Mar 10, 2026
2979cfc
Merge pull request #215 from OlympusDAO/origin/feature/sepolia-redepl…
0xJem Mar 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
358 changes: 358 additions & 0 deletions .claude/commands/update-emergency-config.md

Large diffs are not rendered by default.

268 changes: 268 additions & 0 deletions .claude/skills/lint-fix/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
---
description: Guide for addressing linter notes in the Olympus V3 codebase. Run this after every coding task.
---

# Linter Note Resolution Guide

This guide covers how to address forge-lint notes in the Olympus V3 codebase.

## Important: Run After Every Coding Task

After completing any code changes (writing new code, refactoring, fixing bugs), ALWAYS run linting and address any notes before considering the task complete.

```bash
# Check for linting issues
pnpm run lint:check

# Or run full lint which will auto-fix some issues
pnpm run lint
```

## Scope: Focus on Current Work

When analyzing linting output:

1. **Only address notes in files you're actively working on** - Don't modify files outside your current task scope unless explicitly asked
2. **Explicitly list out-of-scope files** - When providing analysis, clearly categorize files as:
- **In scope** - Files being modified in the current task
- **Deployed/Out of scope** - Files that should be suppressed but not touched

### Reporting Format

When providing linting analysis, organize findings as:

```text
## In-Scope Files (Fix Required)
- src/path/File.sol: Fix the issue directly

## Deployed/Out-of-Scope Files (Ignored - Would Require Suppression)
- src/external/Contract.sol: Deployed - suppress with justification
- src/modules/Deployed.sol: Deployed - suppress with justification
```

This makes it explicit what was skipped and why.

## Two-Tier Approach

The approach to fixing linter notes depends on whether the contract is deployed to production:

| Contract Status | Approach |
|-----------------|----------|
| **IN DEVELOPMENT** (current branch/PR) | Fix linter notes by refactoring code |
| **DEPLOYED** to production | Suppress with justification comment |

### Determining Deployment Status

1. **Check if the contract is deployed:**
- Search the contract name in `src/scripts/deploy/savedDeployments/`
- Check `src/scripts/env.json` for deployed addresses
- Ask the user if unsure

2. **In-development contracts:**
- New contracts being written for the first time
- Contracts undergoing significant refactoring
- Contracts not yet deployed to any chain

3. **Deployed contracts:**
- Contracts with live deployments on mainnet/testnet
- Contracts where changing code would require a governance proposal

## In-Development Contracts: Fix the Code

For contracts still in development, **always fix the linter note** by refactoring the code rather than suppressing it.

### Common Fixes

**Shadowing variable names:**

```solidity
// BAD - Shadowing
uint256 amount = 100;
{
uint256 amount = 200; // Linter note: shadowing
}

// GOOD - Use distinct names
uint256 amount = 100;
{
uint256 newAmount = 200;
}
```

**Unnecessary variables:**

```solidity
// BAD - Unused variable
uint256 calculatedValue = _calculate();
return true;

// GOOD - Remove or use
uint256 calculatedValue = _calculate();
return calculatedValue > 0;
```

**Explicit conversions:**

```solidity
// BAD - Unsafe typecast
address contractAddress = address(uint160(tokenContract));

// GOOD - Use safe conversion pattern
address contractAddress = address(tokenContract);
```

**Modifier logic:**

```solidity
// BAD - Unwrapped modifier logic
modifier onlyAdmin() {
if(msg.sender != admin) revert("Unauthorized");
_;
}

// GOOD - Wrap in function
function _onlyAdmin() internal {
if(msg.sender != admin) revert("Unauthorized");
}

modifier onlyAdmin() {
_onlyAdmin();
_;
}
```

## Deployed Contracts: Suppress with Justification

For deployed contracts, suppression is acceptable since changing the code would require a governance proposal.

### Suppression Template

```solidity
/// forge-lint: disable-next-line(rule-name)
/// Reason: Deployed contract - changing would require governance proposal
```

### Examples

```solidity
// Example 1: Shadowing in deployed contract
/// forge-lint: disable-next-line(var-name-mixedcase)
/// Reason: Deployed contract - variable naming matches existing interface
uint256 depositAmount = _getDeposit();

// Example 2: External constraint
/// forge-lint: disable-next-line(avoid-low-level-calls)
/// Reason: Required for compatibility with external contract interface
_callExternalTarget(target, data);

// Example 3: Legitimate exception
/// forge-lint: disable-next-line(no-empty-blocks)
/// Reason: Empty block intentionally left for future upgrade path
function upgradeV2() external { }
```

## Internal State Variable Naming

**Internal state variables MUST use underscore prefix:**

```solidity
// GOOD - Internal state with underscore
uint256 internal _counter;
mapping(address => uint256) internal _balances;

// BAD - Missing underscore
uint256 internal counter;
mapping(address => uint256) internal balances;
```

This convention distinguishes internal state from:

- Public state variables (no underscore): `uint256 public totalSupply;`
- Local variables (no underscore): `uint256 amount = 100;`
- Function parameters (no underscore): `function mint(uint256 amount)`

## Running Linting

### Quick Check (No Auto-Fix)

```bash
pnpm run lint:check
```

This runs:

- `prettier:check` - Check formatting
- `solhint:check` - Check Solidity linting
- `markdownlint:check` - Check Markdown files

### Full Lint (With Auto-Fix)

```bash
pnpm run lint
```

This runs:

- `prettier` - Auto-formats code
- `solhint` - Auto-fixes some Solidity issues
- `markdownlint` - Auto-fixes Markdown issues

### Individual Tools

```bash
# Format code only (fastest)
pnpm run prettier

# Check Solidity linting only
pnpm run solhint:check

# Fix Solidity linting where possible
pnpm run solhint
```

## Common Forge-Lint Rules

| Rule | Description | Fix Strategy |
|------|-------------|--------------|
| `var-name-mixedcase` | Variable uses mixedCase | Ensure variable uses mixedCase or suppress |
| `func-name-mixedcase` | Function uses mixedCase | Rename or suppress if external interface |
| `const-name-snakecase` | Constant uses snakeCase | Rename to SCREAMING_SNAKE_CASE or suppress |
| `avoid-low-level-calls` | Uses `call`/`delegatecall` | Refactor or suppress if required |
| `no-empty-blocks` | Empty code block | Remove or add comment |
| `unwrapped-modifier-logic` | Logic after `_;` in modifier | Move logic to function |
| `unsafe-typecast` | Direct address typecast | Use safe conversion or suppress |
| `screaming-snake-case-immutable` | Immutable uses UPPER_CASE | Suppress (acceptable pattern) |
| `reason-string` | Revert uses string message | Use custom error instead |
| `no-global-import` | Global import used | Use specific imports |
| `func-visibility` | Function lacks visibility | Add `public`/`external`/`internal` |
| `max-line-length` | Line exceeds 80 chars | Break line or suppress |

## Auto-Fixable Issues

Many linting issues can be auto-fixed by running:

```bash
pnpm run prettier # Auto-formats code
pnpm run solhint # Auto-fixes some Solidity issues
```

Always run these first before manual fixes.

## Workflow Summary

1. **Complete code changes** - Write or modify code
2. **Run linting** - `pnpm run lint:check`
3. **Address notes for in-development contracts** - Refactor code to fix
4. **Suppress notes for deployed contracts** - Add justification comments
5. **Re-run linting** - Verify all issues resolved
6. **Mark task complete** - Only when linting passes

## Quick Reference

| Goal | Command |
|------|---------|
| Check linting | `pnpm run lint:check` |
| Auto-fix and format | `pnpm run lint` |
| Format only | `pnpm run prettier` |
| Check Solidity only | `pnpm run solhint:check` |
| Fix specific file | `pnpm run prettier -- src/Contract.sol` |
Loading
Loading