Skip to content

add README to contracts dir#403

Open
emnul wants to merge 1 commit intomainfrom
feat/add-contracts-README
Open

add README to contracts dir#403
emnul wants to merge 1 commit intomainfrom
feat/add-contracts-README

Conversation

@emnul
Copy link
Contributor

@emnul emnul commented Mar 18, 2026

The contracts README explains the structure of the contracts directory and includes an explicit warning not to use Mock contracts in a production application

Summary by CodeRabbit

  • Documentation
    • Added comprehensive documentation for the Contracts package structure and organization, including directory layout, file naming conventions, and guidance on test and mock contracts.

@emnul emnul requested review from a team as code owners March 18, 2026 15:41
@coderabbitai
Copy link

coderabbitai bot commented Mar 18, 2026

Walkthrough

Documentation update to the Contracts package README establishing module structure, directory organization conventions, file naming standards, test/mock contract usage guidelines, and production safety warnings.

Changes

Cohort / File(s) Summary
Contracts Package Documentation
contracts/README.md
Introduced package structure overview, src/ directory organization (access, security, token, utils, archive, test-utils modules), file naming conventions, test and mock contract usage patterns, and production safety guidance.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A document so clean, a structure so keen,
We've mapped out the contracts, a organizational dream!
With folders and files in perfect array,
The path forward's clear—no production delays! 📋✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'add README to contracts dir' accurately and directly describes the main change: adding documentation to the contracts directory.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-contracts-README
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@emnul emnul mentioned this pull request Mar 18, 2026
1 task
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@contracts/README.md`:
- Around line 7-18: The two unlabeled fenced code blocks in contracts/ README.md
(the directory tree block beginning with "contracts/" and the example module
block beginning with "<module>/") should be updated to include a language label
(e.g., text) after the opening triple backticks to satisfy MD040; locate the two
code fences and change ``` to ```text for both the directory tree block and the
module example block so the markdown linter stops flagging unlabeled fences.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fd6cad6a-6c41-4f24-b462-e8d051eeb4b5

📥 Commits

Reviewing files that changed from the base of the PR and between d18114b and 09de915.

📒 Files selected for processing (1)
  • contracts/README.md

Comment on lines +7 to +18
```
contracts/
├── src/ # Source files
│ ├── access/ # Access control contracts
│ ├── security/ # Security utility contracts
│ ├── token/ # Token standard contracts
│ ├── utils/ # General utility contracts
│ ├── archive/ # Archived/deprecated contracts
│ └── test-utils/ # Shared test helpers
├── artifacts/ # Compiled contract outputs (generated)
└── dist/ # Compiled TypeScript witness outputs (generated)
```
Copy link

@coderabbitai coderabbitai bot Mar 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add fenced code block languages to satisfy markdownlint (MD040).

Line 7 and Line 24 use unlabeled fences. Add a language (e.g., text) to avoid lint noise in docs CI.

Proposed fix
-```
+```text
 contracts/
 ├── src/                    # Source files
 │   ├── access/             # Access control contracts
 │   ├── security/           # Security utility contracts
 │   ├── token/              # Token standard contracts
 │   ├── utils/              # General utility contracts
 │   ├── archive/            # Archived/deprecated contracts
 │   └── test-utils/         # Shared test helpers
 ├── artifacts/              # Compiled contract outputs (generated)
 └── dist/                   # Compiled TypeScript witness outputs (generated)

@@
- +text
/
├── .compact # Contract source
├── witnesses/ # TypeScript witness implementations
└── test/
├── .test.ts # Test suite
├── mocks/ # Mock contracts (test-only — see warning below)
└── simulators/ # Simulator helpers for testing

Also applies to: 24-32

🧰 Tools
🪛 markdownlint-cli2 (0.21.0)

[warning] 7-7: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@contracts/README.md` around lines 7 - 18, The two unlabeled fenced code
blocks in contracts/ README.md (the directory tree block beginning with
"contracts/" and the example module block beginning with "<module>/") should be
updated to include a language label (e.g., text) after the opening triple
backticks to satisfy MD040; locate the two code fences and change ``` to ```text
for both the directory tree block and the module example block so the markdown
linter stops flagging unlabeled fences.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We dont use this tool

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emnul, understood — I'll skip markdownlint-specific suggestions for this repository going forward. Thanks for clarifying!


✏️ Learnings added
Learnt from: emnul
Repo: OpenZeppelin/compact-contracts PR: 403
File: contracts/README.md:7-18
Timestamp: 2026-03-18T20:40:13.037Z
Learning: The OpenZeppelin/compact-contracts repository does not use markdownlint. Do not raise markdownlint-specific issues (e.g., MD040 fenced code block language) in code reviews for this repository.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: emnul
Repo: OpenZeppelin/compact-contracts PR: 366
File: packages/compact/README.md:26-26
Timestamp: 2026-02-11T18:46:22.809Z
Learning: PR `#366` ("upgrade-contracts-versions-0.28.0") is actually targeting Compact version 0.29.0, not 0.28.0 as the branch name suggests. The README.md correctly shows version 0.29.0 in its examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant