feat: compact skills#7
Conversation
| | `@midnight-ntwrk/zswap` | Zero-knowledge token swap library | | ||
| | `@midnight-ntwrk/ledger-*` | Ledger integration (version suffix changes across releases, check `package.json` for the current one) | | ||
|
|
||
| ## Testing |
There was a problem hiding this comment.
We should have a troubleshooting section that provides context for common errors and pain points. I like how it's presented here.
ericglau
left a comment
There was a problem hiding this comment.
It would be good to add some tests in https://github.com/OpenZeppelin/openzeppelin-skills/blob/main/dev/TESTING.md. You can point Claude Code to that file and tell it to run the testcases, which it will do using subagents to simulate responses.
| ### Compact Directory Structure | ||
|
|
||
| Compact contracts use a flat module structure: | ||
|
|
||
| | Category | Modules | Path | | ||
| |----------|---------|------| | ||
| | Access Control | `Ownable`, `AccessControl`, `ZOwnablePK` | `src/access/` | | ||
| | Security | `Pausable`, `Initializable` | `src/security/` | | ||
| | Tokens | `FungibleToken`, `NonFungibleToken`, `MultiToken` | `src/token/` | | ||
| | Utilities | `Utils` | `src/utils/` | | ||
|
|
||
| Compact supports named imports (similar to TypeScript/ES modules) and an optional `prefix` keyword: | ||
|
|
||
| ```typescript | ||
| // Named imports (import specific identifiers) | ||
| import { initialize, assertOnlyOwner } from "./path/to/Ownable"; | ||
|
|
||
| // Named imports with prefix (namespaces to avoid collisions) | ||
| import { initialize, assertOnlyOwner } from "./path/to/Ownable" prefix Ownable_; | ||
|
|
||
| // Wildcard import with prefix | ||
| import "./path/to/Ownable" prefix Ownable_; | ||
|
|
||
| // Wildcard import without prefix | ||
| import "./path/to/Ownable"; | ||
| ``` | ||
|
|
||
| When using a prefix, internal (underscore-prefixed) circuits like `_mint` become double-underscored: `FungibleToken__mint(...)`. |
There was a problem hiding this comment.
These are very specific to Compact and probably belong in a reference file instead. Otherwise they would be irrelevant in the context when working with other languages. (Although the directory structure chart above is also a bit cluttered for the various languages - feel free to propose an alternative if you'd prefer)
No description provided.