Skip to content

lopezpalacios/paycodex-factory

Repository files navigation

paycodex-factory

CI License: MIT

Smart-contract factory for the paycodex and paycodex-onchain knowledge graphs.

Hardhat 2 - TypeScript - Solidity 0.8.20 - OpenZeppelin 5.x - ethers v6

Workflow

flowchart LR
    KG1[paycodex KG<br/>incumbent rails] -->|references| Factory
    KG2[paycodex-onchain KG<br/>EVM patterns] -->|sources snippets| Factory[paycodex-factory<br/>Hardhat]
    Factory -->|compile + test + gas| CI[GitHub Actions CI]
    CI -->|RESULTS.md feedback| KG2
    Factory -->|deploy| Networks[hardhat / sepolia / base]
Loading

The factory is the executable companion to the documentation graphs.

Quick start

git clone https://github.com/lopezpalacios/paycodex-factory
cd paycodex-factory
npm install
npm run compile
npm test
npm run test:gas

Layout

paycodex-factory/
├── contracts/             demo snippets + mocks/
├── test/                  TypeScript tests
├── scripts/               deploy scripts
├── .github/workflows/     CI
├── hardhat.config.ts
├── package.json
└── RESULTS.md             test + gas + coverage outputs

Test results

See RESULTS.md - populated by CI.

Development

Quick start

npm install
npm run compile
npm test
npm run test:gas
npm run coverage

Quality gates (run locally before PR)

npm run lint           # solhint + prettier check
npm run format         # prettier write
npm run lint:fix       # solhint --fix
npm run analyze        # slither (requires Python + slither-analyzer)

Pipeline overview

flowchart LR
    PR[Pull Request] --> Lint[CI: Lint<br/>solhint + prettier]
    Lint --> Test[CI: Test<br/>compile + 26 unit tests + coverage]
    Test --> Gas[CI: Gas report<br/>diff vs main]
    Test --> Slither[CI: Slither<br/>static analysis]
    Slither --> Merge{Approve}
    Gas --> Merge
    Merge -->|merged to main| Tag[Manual: tag release]
    Tag -->|workflow_dispatch| Deploy[Deploy: Sepolia/Base/Hardhat]
Loading

Pre-commit hook

husky + lint-staged run solhint + prettier on staged files. Bypass with --no-verify for emergency only.

Branch protection (configure on GitHub)

  • Require PR + 1 approval before merge to main
  • Require status checks: lint, test, slither
  • Dismiss stale reviews on push
  • Require linear history (no merge commits)

License

MIT - see LICENSE.

About

Hardhat smart-contract factory for paycodex/paycodex-onchain knowledge graphs. 24 cash-mgmt-on-EVM contracts, TypeScript tests, gas reports, CI.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors