Repository navigation
Pilot: harden ERC-20 project – reproducible build, expanded tests, CI scanning, deployment docs - #12
creatingfire2026 with Copilot wants to merge 10 commits into
Conversation
Co-authored-by: creatingfire2026 <277700495+creatingfire2026@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Enabling ESM at the package level currently breaks existing CommonJS .js entry points (Hardhat config/tests/scripts) unless they’re also migrated or renamed to .cjs.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the project’s Node module mode to ESM by setting the package-level module type, which is a prerequisite for ESM-compatible Hardhat configuration/tests in an ERC-20 project setup.
Changes:
- Set
"type": "module"inpackage.jsonto opt the repo into ESM semantics for.jsfiles.
File summaries
| File | Description |
|---|---|
| package.json | Enables ESM mode at the package level via "type": "module". |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "dependencies": { | ||
| "@openzeppelin/contracts": "^5.0.0" | ||
| } | ||
| }, | ||
| "type": "module" |
- Downgrade hardhat to v2 (ESM not needed), install compatible @nomicfoundation/hardhat-ethers@hh2 and hardhat-chai-matchers@hh2 - Add solc@0.8.26 and solidity-coverage as devDependencies - Add offline-compiler fallback in hardhat.config.js (bundles solc when binaries.soliditylang.org is unreachable) - Expand CI workflow: lint (solhint), coverage, npm audit, gitleaks scan - Add invariant/property/negative tests (21 new tests, 46 total, 100% coverage) - Add DEPLOYMENT.md: prerequisites, recipient-wallet controls, verification, rollback limitations, and unresolved risks (no deployment performed) Co-authored-by: creatingfire2026 <277700495+creatingfire2026@users.noreply.github.com>
Co-authored-by: creatingfire2026 <277700495+creatingfire2026@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d3489bac56
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Git-town |
Co-authored-by: creatingfire2026 <277700495+creatingfire2026@users.noreply.github.com>
Co-authored-by: creatingfire2026 <277700495+creatingfire2026@users.noreply.github.com>
Co-authored-by: creatingfire2026 <277700495+creatingfire2026@users.noreply.github.com>
Co-authored-by: creatingfire2026 <277700495+creatingfire2026@users.noreply.github.com>
Co-authored-by: creatingfire2026 <277700495+creatingfire2026@users.noreply.github.com>
Co-authored-by: creatingfire2026 <277700495+creatingfire2026@users.noreply.github.com>
Addresses the safe engineering pilot requirements for
Cf-: reproducible install, full test hardening, non-deploying CI validation, dependency/secret scanning, and deployment risk documentation. No production deployment, no mainnet interaction, PR #4 excluded throughout.Changes
Build / install
2.29.1); v3 requires ESM and cannot resolve the Solidity compiler CDN in restricted environments@nomicfoundation/hardhat-ethers@hh2andhardhat-chai-matchers@hh2; addedsolc@0.8.26andsolidity-coverageas devDependencieshardhat.config.jsthat catches CDN failures and uses the bundledsolcpackage:Tests (
test/ERC20_Token_Sample.invariants.test.js)21 new tests across five categories (46 total, 100% coverage):
ERC20Burnable.burn()pathburnFrom,approveoverwrite, partialtransferFromZeroBurnAmounton bothburnTokens(0)andburnFrom(…, 0)ERC20InsufficientAllowanceonburnFrom/transferFromwithout approvalburn()does not emitTokensBurnedCI (
.github/workflows/test.yml)Replaced single-step workflow with three jobs — no deployment step anywhere:
hardhat compile/test,solhint,hardhat coveragenpm audit --audit-level=criticalgitleaks/gitleaks-action@v2Documentation (
DEPLOYMENT.md)New file covering: install prerequisites, pre-deployment checklist, mainnet gate requirements, recipient-wallet controls (multi-sig recommendation), Etherscan verification steps, rollback limitations (contract is fully immutable), and a risk register (R-1–R-7) including the duplicate burn interface question and the known high-severity advisories in Hardhat v2's transitive
undicidependency.