Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
087b127
fix(enforcement): reject zero address in _setFrozenTokens (NM-15/NM-1…
rya-sge Jul 24, 2026
31ee67a
fix(allowance): always allow revocation (approve/permit value == 0) w…
rya-sge Jul 24, 2026
076d497
docs(ruleengine): document permissionless zero-value transferred cal…
rya-sge Jul 24, 2026
98afb77
fix(erc7551): preserve terms document name in setTerms(bytes32,string…
rya-sge Jul 24, 2026
967fb65
docs(crosschain): document the raw msg.sender bridge gate and the CRO…
rya-sge Jul 24, 2026
c521c2e
docs(erc2612): document that setName does not update the EIP-712 doma…
rya-sge Jul 24, 2026
69cd504
docs(pause): scope the ERC20Burn pause note and extend the existing d…
rya-sge Jul 24, 2026
a033bc1
fix(ruleengine): guard the transferred callback against reentrancy on…
rya-sge Jul 24, 2026
c3ee5b2
chore(solidity): raise the pragma floor to ^0.8.24 across all contrac…
rya-sge Jul 24, 2026
d27d6fa
docs(erc20): correct the IERC20Allowance.Spend NatSpec and add allowa…
rya-sge Jul 27, 2026
6fc9221
feat(enforcement): emit Spend on forcedTransfer allowance reduction a…
rya-sge Jul 27, 2026
a87ef3f
fix(enforcement): thread _msgSender() as spender in Light minter-tran…
rya-sge Jul 27, 2026
8a13692
docs(allowlist): document that transferFrom requires the spender (cal…
rya-sge Jul 27, 2026
054ce24
test(permit): add zero-value permit revocation tests (paused/owner/sp…
rya-sge Jul 27, 2026
21d1775
docs: document setFrozenTokens zero-address guard on the ERC20Enforce…
rya-sge Jul 27, 2026
7fa0b14
docs(audit): bring the AuditAgent feedback outcome, test lists and su…
rya-sge Jul 27, 2026
fda1d51
chore(solidity): bump the pinned compiler to 0.8.36 in hardhat/found…
rya-sge Jul 27, 2026
2d2098e
docs(holderlist): correct the costs nothing extra gas claim — a trans…
rya-sge Jul 27, 2026
1aceb85
docs(holderlist): clarify that off-chain balance-at-a-block queries u…
rya-sge Jul 27, 2026
5901a7d
docs(holderlist): clarify that off-chain balance-at-a-block queries …
rya-sge Jul 27, 2026
d0125cf
docs(readme): remove ERC-1450 integration/improvements links from the…
rya-sge Jul 27, 2026
d12b921
docs(technical): rename guideline-new-blockchain to cmtat-specificat…
rya-sge Jul 27, 2026
daec60c
docs(readme): drop the duplicated Nethermind AuditAgent summary table…
rya-sge Jul 28, 2026
c3a4b8c
docs(readme): split the ERC-1404 version-support row into base (detec…
rya-sge Jul 28, 2026
13578e6
docs(readme): add an ERC-2771 (MetaTx/Gasless) per-deployment-version…
rya-sge Jul 28, 2026
84fcdb7
docs(readme): expand the Additional documents through ERC-1643 and Do…
rya-sge Jul 28, 2026
0e2f0a3
docs(readme): explain the ERC-1363 and Light inheritance schemas — ER…
rya-sge Jul 28, 2026
47abc5c
docs(readme): explain the Debt, DebtEngine, Permit and Allowlist inhe…
rya-sge Jul 28, 2026
119a4b9
docs(readme): list CMTAT-Confidential (FHE/ERC-7984 confidential toke…
rya-sge Jul 28, 2026
50936ac
docs(readme): expand the security Tools section into a per-tool overv…
rya-sge Jul 28, 2026
55c9c59
Update coverage image
rya-sge Jul 28, 2026
8734bcf
chore(deps): bump npm devDependency to ^12.0.1
rya-sge Jul 28, 2026
bfb7ba2
docs(changelog): flesh out the 3.3.0-rc3 entry — Nethermind AuditAge…
rya-sge Jul 28, 2026
2489f4a
docs(readme): add Permit (ERC-2612), Multicall (ERC-6357) and Holder …
rya-sge Jul 28, 2026
7dafdaf
ocs(readme): refresh the DocumentEngine version table — add CMTAT v3.…
rya-sge Jul 28, 2026
8d3029d
test(ruleengine): assert spender-aware vs legacy transferred dispatch…
rya-sge Jul 28, 2026
f6aceb2
docs(natspec): correct misleading access-control comments — crosschai…
rya-sge Jul 28, 2026
6434930
docs(deactivation): document that forcedTransfer/forcedBurn intenti…
rya-sge Jul 28, 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
158 changes: 84 additions & 74 deletions .claude/tree/contracts_tree.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ contracts
│   ├── allowlist
│   │   ├── CMTATStandaloneAllowlist.sol
│   │   └── CMTATUpgradeableAllowlist.sol
│   ├── CMTATStandalone.sol
│   ├── CMTATUpgradeable.sol
│   ├── CMTATStandardStandalone.sol
│   ├── CMTATStandardUpgradeable.sol
│   ├── CMTATUpgradeableUUPS.sol
│   ├── debt
│   │   ├── CMTATStandaloneDebt.sol
Expand All @@ -21,15 +21,15 @@ contracts
│   ├── holderList
│   │   ├── CMTATStandaloneHolderList.sol
│   │   └── CMTATUpgradeableHolderList.sol
│   ├── light
│   │   ├── CMTATStandaloneLight.sol
│   │   └── CMTATUpgradeableLight.sol
│   ├── permit
│   │   ├── CMTATStandalonePermit.sol
│   │   └── CMTATUpgradeablePermit.sol
│   ├── snapshot
│   │   ├── CMTATStandaloneSnapshot.sol
│   │   └── CMTATUpgradeableSnapshot.sol
│   └── light
│   ├── CMTATStandaloneLight.sol
│   └── CMTATUpgradeableLight.sol
│   └── snapshot
│   ├── CMTATStandaloneSnapshot.sol
│   └── CMTATUpgradeableSnapshot.sol
├── interfaces
│   ├── engine
│   │   ├── IDebtEngine.sol
Expand All @@ -41,6 +41,7 @@ contracts
│   │   ├── IDebtEngineModule.sol
│   │   ├── IDebtModule.sol
│   │   ├── IDocumentEngineModule.sol
│   │   ├── IHolderListModule.sol
│   │   └── ISnapshotEngineModule.sol
│   ├── technical
│   │   ├── ICMTATConstructor.sol
Expand All @@ -55,15 +56,18 @@ contracts
│   ├── draft-IERC1643.sol
│   ├── draft-IERC7551.sol
│   ├── draft-IERC7943.sol
│   ├── draft-IERC8343.sol
│   ├── ICMTAT.sol
│   └── IERC3643Partial.sol
├── library
│   ├── ERC1404ExtendInterfaceId.sol
│   └── RuleEngineInterfaceId.sol
├── mocks
│   ├── CMTATMsgDataMock.sol
│   ├── DebtEngineMock.sol
│   ├── DocumentEngineMock.sol
│   ├── engine
│   │   ├── CMTATDocumentEngineModuleMock.sol
│   │   └── CMTATEngineInitializerMock.sol
│   ├── ERC1363ReceiverMock.sol
│   ├── ERC165Helper
Expand All @@ -82,76 +86,82 @@ contracts
│   │   ├── CodeList.sol
│   │   ├── interfaces
│   │   │   ├── IRuleEngineMock.sol
│   │   │   └── IRule.sol
│   │   │   ├── IRule.sol
│   │   │   └── IRuleTransferHook.sol
│   │   ├── RuleEngineMock.sol
│   │   ├── RuleEngineReentrantMock.sol
│   │   ├── RuleMockMint.sol
│   │   └── RuleMock.sol
│   │   ├── RuleMock.sol
│   │   ├── RuleSpenderAuthorized.sol
│   │   └── RuleTokenHolderTracker.sol
│   ├── SnapshotEngineMock.sol
│   └── test
│   └── proxy
│   ├── CMTAT_PROXY_TEST.sol
│   └── CMTAT_PROXY_TEST_UUPS.sol
├── modules
│   ├── 0_CMTATBaseCommon.sol
│   ├── 0_CMTATBaseCore.sol
│   ├── 0_CMTATBaseGeneric.sol
│   ├── 0_CMTATBaseSnapshot.sol
│   ├── 2_CMTATBaseAccessControl.sol
│   ├── 3_CMTATBaseAllowlist.sol
│   ├── 3_CMTATBaseRuleEngine.sol
│   ├── 1_CMTATBaseDocument.sol
│   ├── 4_CMTATBaseDebt.sol
│   ├── 4_CMTATBaseERC1404.sol
│   ├── 4_CMTATBaseERC20CrossChain.sol
│   ├── 4_CMTATBaseERC2612.sol
│   ├── 5_CMTATBaseDebtEngine.sol
│   ├── 5_CMTATBaseERC2771.sol
│   ├── 6_CMTATBaseERC2771Snapshot.sol
│   ├── 6_CMTATBaseERC7551Enforcement.sol
│   ├── 7_CMTATBaseERC1363.sol
│   ├── 7_CMTATBaseERC7551.sol
│   ├── 8_CMTATBaseHolderList.sol
│   ├── internal
│   │   ├── AllowlistModuleInternal.sol
│   │   ├── common
│   │   │   └── EnforcementModuleLibrary.sol
│   │   ├── EnforcementModuleInternal.sol
│   │   ├── ERC20BurnModuleInternal.sol
│   │   ├── ERC20EnforcementModuleInternal.sol
│   │   ├── ERC20MintModuleInternal.sol
│   │   └── ValidationModuleRuleEngineInternal.sol
│   └── wrapper
│   ├── controllers
│   │   ├── ValidationModuleAllowlist.sol
│   │   └── ValidationModule.sol
│   ├── core
│   │   ├── EnforcementModule.sol
│   │   ├── ERC20BaseModule.sol
│   │   ├── ERC20BurnModule.sol
│   │   ├── ERC20MintModule.sol
│   │   ├── PauseModule.sol
│   │   ├── TokenAttributeModule.sol
│   │   ├── ValidationModuleCore.sol
│   │   └── VersionModule.sol
│   ├── extensions
│   │   ├── DocumentEngineModule.sol
│   │   ├── ERC20EnforcementModule.sol
│   │   ├── ExtraInformationModule.sol
│   │   ├── SnapshotEngineModule.sol
│   │   └── ValidationModule
│   │   ├── ValidationModuleAllowance.sol
│   │   ├── ValidationModuleERC1404.sol
│   │   └── ValidationModuleRuleEngine.sol
│   ├── options
│   │   ├── AllowlistModule.sol
│   │   ├── CCIPModule.sol
│   │   ├── DebtEngineModule.sol
│   │   ├── DebtModule.sol
│   │   ├── ERC20CrossChainModule.sol
│   │   ├── ERC20EnforcementERC7551Module.sol
│   │   ├── ERC2771Module.sol
│   │   ├── ERC7551Module.sol
│   │   └── HolderListModule.sol
│   └── security
│   └── AccessControlModule.sol
33 directories, 110 files
└── modules
├── 0_CMTATBaseCommon.sol
├── 0_CMTATBaseCore.sol
├── 0_CMTATBaseGeneric.sol
├── 0_CMTATBaseSnapshot.sol
├── 1_CMTATBaseDocument.sol
├── 2_CMTATBaseAccessControl.sol
├── 3_CMTATBaseAllowlist.sol
├── 3_CMTATBaseRuleEngine.sol
├── 4_CMTATBaseDebt.sol
├── 4_CMTATBaseERC1404.sol
├── 5_CMTATBaseERC20CrossChain.sol
├── 6_CMTATBaseDebtEngine.sol
├── 6_CMTATBaseERC2612.sol
├── 6_CMTATBaseERC2771.sol
├── 7_CMTATBaseERC2771Snapshot.sol
├── 7_CMTATBaseERC7551Enforcement.sol
├── 8_CMTATBaseERC1363.sol
├── 8_CMTATBaseERC7551.sol
├── 8_CMTATBaseHolderList.sol
├── internal
│   ├── AllowlistModuleInternal.sol
│   ├── common
│   │   └── EnforcementModuleLibrary.sol
│   ├── EnforcementModuleInternal.sol
│   ├── ERC20BurnModuleInternal.sol
│   ├── ERC20EnforcementModuleInternal.sol
│   ├── ERC20MintModuleInternal.sol
│   └── ValidationModuleRuleEngineInternal.sol
└── wrapper
├── controllers
│   ├── ValidationModuleAllowlist.sol
│   └── ValidationModule.sol
├── core
│   ├── EnforcementModule.sol
│   ├── ERC20BaseModule.sol
│   ├── ERC20BurnModule.sol
│   ├── ERC20MintModule.sol
│   ├── PauseModule.sol
│   ├── TokenAttributeModule.sol
│   ├── ValidationModuleCore.sol
│   └── VersionModule.sol
├── extensions
│   ├── DocumentERC1643Module.sol
│   ├── ERC20EnforcementModule.sol
│   ├── ExtraInformationModule.sol
│   ├── SnapshotEngineModule.sol
│   └── ValidationModule
│   ├── ValidationModuleAllowance.sol
│   ├── ValidationModuleERC1404.sol
│   └── ValidationModuleRuleEngine.sol
├── options
│   ├── AllowlistModule.sol
│   ├── CCIPModule.sol
│   ├── DebtEngineModule.sol
│   ├── DebtModule.sol
│   ├── DocumentEngineModule.sol
│   ├── ERC20CrossChainModule.sol
│   ├── ERC20EnforcementERC7551Module.sol
│   ├── ERC2771Module.sol
│   ├── ERC7551Module.sol
│   └── HolderListModule.sol
└── security
└── AccessControlModule.sol

35 directories, 129 files
27 changes: 21 additions & 6 deletions .claude/tree/test_tree.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ test
│   ├── ERC20BaseModuleCommon.js
│   ├── ERC20BurnModuleCommon.js
│   ├── ERC20CrossChainModuleCommon.js
│   ├── ERC20EnforcementERC7551ModuleCommon.js
│   ├── ERC20EnforcementModuleCommon.js
│   ├── ERC20MintModuleCommon.js
│   ├── ERC7551ModuleCommon.js
│   ├── ExtraInfoModuleCommon.js
│   ├── HolderListModuleCommon.js
│   ├── MulticallModuleCommon.js
│   ├── MetaTxModuleCommon.js
│   ├── MetaTxMsgDataCommon.js
│   ├── MulticallModuleCommon.js
│   ├── PauseModuleCommon.js
│   ├── PermitModuleCommon.js
│   ├── SnapshotModuleCommon
Expand All @@ -42,6 +44,7 @@ test
│   ├── ValidationModule
│   │   ├── proxy
│   │   │   └── ValidationModuleProxyCommon.js
│   │   ├── RuleEngineReentrancyCommon.js
│   │   ├── ValidationModuleCommonCore.js
│   │   ├── ValidationModuleCommon.js
│   │   └── ValidationModuleSetRuleEngineCommon.js
Expand All @@ -57,7 +60,7 @@ test
│   │   ├── deploymentUpgradeableDebtSnapshot.test.js
│   │   └── deploymentUpgradeableDebt.test.js
│   ├── debtEngine
│   │   ├── deploymentStandaloneDebtEngineSnapshot.test .js
│   │   ├── deploymentStandaloneDebtEngineSnapshot.test.js
│   │   ├── deploymentStandaloneDebtEngine.test.js
│   │   └── deploymentUpgradeableDebtEngine.test.js
│   ├── deployment.test.js
Expand All @@ -71,12 +74,15 @@ test
│   ├── erc7551
│   │   ├── deploymentERC7551Standalone.test.js
│   │   └── deploymentERC7551Upgradeable.test.js
│   ├── light
│   │   ├── deploymentStandaloneLight.test.js
│   │   └── deploymentUpgradeableLight.test.js
│   ├── permit
│   │   ├── deploymentPermitStandalone.test.js
│   │   └── deploymentPermitUpgradeable.test.js
│   └── light
│   ├── deploymentStandaloneLight.test.js
│   └── deploymentUpgradeableLight.test.js
│   └── snapshot
│   ├── deploymentStandaloneSnapshot.test.js
│   └── deploymentUpgradeableSnapshot.test.js
├── deploymentUtils.js
├── proxy
│   ├── general
Expand Down Expand Up @@ -104,6 +110,7 @@ test
│   ├── SnapshotModule
│   │   └── SnapshotModule.test.js
│   ├── ValidationModule
│   │   ├── ValidationModuleReentrancy.test.js
│   │   └── ValidationModule.test.js
│   └── VersionModule.test.js
├── standard
Expand All @@ -112,6 +119,8 @@ test
│   │   └── AuthorizationModule.test.js
│   ├── CCIPModule.test.js
│   ├── CMTATIntegration.test.js
│   ├── DocumentEngineModule
│   │   └── DocumentEngineModule.test.js
│   ├── DocumentModule
│   │   └── DocumentModule.test.js
│   ├── EnforcementModule.test.js
Expand All @@ -126,14 +135,20 @@ test
│   ├── MetaTxModuleERC1363.test.js
│   ├── MetaTxModule.test.js
│   ├── MetaTxModuleUUPS.test.js
│   ├── MetaTxMsgDataAllowlist.test.js
│   ├── MetaTxMsgDataERC1363.test.js
│   ├── MetaTxMsgDataSnapshot.test.js
│   ├── MetaTxMsgData.test.js
│   ├── PauseModule.test.js
│   ├── RuleEngineMockStatefulRule.test.js
│   ├── SnapshotModule
│   │   └── SnapshotModule.test.js
│   ├── ValidationModule
│   │   ├── ValidationModuleConstructor.test.js
│   │   ├── ValidationModuleReentrancy.test.js
│   │   ├── ValidationModuleSetRuleEngine.test.js
│   │   └── ValidationModule.test.js
│   └── VersionModule.test.js
└── utils.js

30 directories, 101 files
33 directories, 118 files
37 changes: 37 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ npm run coverage # Generate coverage report
npm run hardhat:compile # Compile contracts
```

## Test Catalogue

The test suite is catalogued per feature module and per deployment version in **[doc/test/Test.md](doc/test/Test.md)**
— a hand-maintained map whose purpose is to make **missing tests easy to find**.

**Whenever you add, change or remove a test, update `doc/test/Test.md` in the same change:**
- test added → adjust the module's `it` count / scenario, and add a matrix row or column if it covers a new feature or variant;
- test removed → remove it, and note any resulting coverage gap;
- new deployment variant or shared test module → add the corresponding matrix column / row and module-reference entry.

An out-of-date catalogue is worse than none — keep it in sync.

## Test Troubleshooting

If tests fail with gas reporter / Mocha reporter errors (for example `ERR_MOCHA_INVALID_REPORTER` with `eth-gas-reporter`), run tests with gas reporting disabled:
Expand All @@ -99,6 +111,31 @@ DeactivateReportGas=true npx hardhat test
- `hardhat.config.js` - Build configuration (EVM & Solidity version)
- `package.json` - Dependencies and scripts

## Documentation Lookup

Before stating that something is **not documented**, search **all** of the documentation surfaces below. They
overlap and none of them is authoritative on its own — a rationale is often recorded in one place and the
per-function facts in another.

| Surface | What lives there |
| --- | --- |
| `doc/README.md` | The largest document. Standards mapping (ERC-3643, ERC-7943, ERC-7551, ERC-7802), architecture, module list, access control, engines, and the **Enforcement / Transfer restriction** chapter — including behavioural rationales such as why pause does not block issuer mint/burn. |
| `doc/USAGE.md` | Build, test, deploy and tooling instructions. |
| `doc/modules/**` | Per-module reference pages (`core/`, `extensions/`, `options/`, `controllers/`), one per module, with per-function requirements, events and errors. |
| `doc/technical/**` | Cross-cutting topics: `access-control.md`, `cross-chain-bridge-integration.md`, `deployment.md`, `upgradeable.md`, `stablecoin.md`, ERC-specific notes. |
| `doc/SUMMARY.md` | Short index of modules, deployment variants and roles. |
| `doc/security/**` | Audit reports and maintainer feedback. |
| `contracts/**` NatSpec + inline comments | Design rationales are frequently recorded only in code comments (e.g. the `onlyTokenBridge` `msg.sender` justification). |

Practical rule: grep the whole `doc/` tree **and** `contracts/`, not a subset.

```bash
grep -rn -i "<topic>" doc/ contracts/ --include=*.md --include=*.sol | grep -v doc/hardhat-compilation
```

Exclude `doc/hardhat-compilation/` (flattened build artifacts, including vendored OpenZeppelin comments) — matches
there are **not** CMTAT statements and must not be quoted as project documentation.

## Note

After each implemented feature or fix, provide a one-line GitHub commit message for all changes since the last commit.
Loading