Skip to content
Open

Dev #13

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2c8a6f3
feat(rules): add multi-token ConditionalTransferLight + tests/docs, w…
rya-sge May 11, 2026
f49f0b9
Update version to v0.4.0
rya-sge May 11, 2026
3cbe2ca
refactor(erc165): extract Ownable2StepERC165Module, apply to all Owna…
rya-sge May 11, 2026
c95018f
fix(cmtat): upgrade to v3.3.0-rc1, rename CMTATStandalone→CMTATStanda…
rya-sge Jun 8, 2026
58ac60e
feat(rules): add RuleMintAllowance with single-target binding, tests/…
rya-sge Jun 10, 2026
a7fb7dd
test(rules): cover RuleMintAllowance batch mint and advertised interf…
rya-sge Jun 10, 2026
9b9221a
fix(rules): stop advertising ERC3643 compliance for mint allowance
rya-sge Jun 10, 2026
f5d5051
chore(deps): upgrade RuleEngine to v3.0.0-rc4 and inherit isolated ro…
rya-sge Jul 6, 2026
5ae92cd
update changelog
rya-sge Jul 6, 2026
7e6cd40
Update surya schema
rya-sge Jul 6, 2026
699a3b1
Add per-rule CMTAT transfer-flow
rya-sge Jul 6, 2026
e24b2dc
docs(readme): fix RuleEngine schema link and align version info (Rule…
rya-sge Jul 8, 2026
001b5aa
docs(readme): add integration-modes overview, real TOC, list RuleMint…
rya-sge Jul 8, 2026
6a8fa44
docs(readme): add Which rule should I use? selection guide and Bindi…
rya-sge Jul 8, 2026
d34a649
docs(readme): fix typos, align restriction-code table, qualify CMTA…
rya-sge Jul 8, 2026
b63fe1f
docs(readme): clarify ERC-3643 summary column and add RuleMintAllow…
rya-sge Jul 8, 2026
725c4bf
docs(readme): lift Overview intro above Schema and move Schema below…
rya-sge Jul 8, 2026
44916a1
docs(readme): move Quick Start to sit directly before the Deploymen…
rya-sge Jul 8, 2026
739b46d
Apply solidity style guideline to src production contracts
rya-sge Jul 8, 2026
5fb5e40
style: apply function ordering and /** */ NatSpec to src/mocks (beha…
rya-sge Jul 8, 2026
e2dbc21
fix(mocks): correct SanctionListOracle.removeFromSanctionsList to un-…
rya-sge Jul 8, 2026
4ff0f26
Add plantuml schema
rya-sge Jul 8, 2026
0addfbc
Add audit tools with slither and aderyn
rya-sge Jul 9, 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ docOut/
node_modules/
/history
/ERCSpecification
FEEDBACK.md
*.dbg.json

# Codex
Expand All @@ -27,3 +28,5 @@ node_modules/
#drawio
*.bkp
*.dtmp


6 changes: 5 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Modular compliance-rule library for CMTAT / ERC-3643 security tokens. Each rule
| `RuleERC2980Ownable2Step` | Ownable2Step variant of RuleERC2980 |
| `RuleConditionalTransferLight` | Require operator approval before each transfer; bound to exactly one token at a time (`bindToken` reverts if a token is already bound; use `unbindToken` first to migrate) |
| `RuleConditionalTransferLightOwnable2Step` | Owner-only approval and execution for conditional transfers |
| `RuleMintAllowance` | Enforce a per-minter mint quota; each mint reduces the minter's allowance; operator can set/increase/decrease allowances; bind to RuleEngine address before use |
| `RuleMintAllowanceOwnable2Step` | Ownable2Step variant of RuleMintAllowance |
| `AccessControlModuleStandalone` | Base RBAC module; admin implicitly holds all roles |
| `MetaTxModuleStandalone` | ERC-2771 meta-transaction support |
| `VersionModule` | Implements `IERC3643Version`; returns the contract version string |
Expand All @@ -36,7 +38,7 @@ Modular compliance-rule library for CMTAT / ERC-3643 security tokens. Each rule
- `openzeppelin-contracts` v5.6.1 — `AccessControl`, `Ownable2Step`, `EnumerableSet`, `ERC2771Context`
- `openzeppelin-contracts-upgradeable` v5.6.1
- `CMTAT` v3.0.0 — `IERC1404`, `IERC3643`, `IRuleEngine` interfaces
- `RuleEngine` v3.0.0-rc2 — `IRule`, `RulesManagementModule`
- `RuleEngine` v3.0.0-rc4 — `IRule`, `RulesManagementModule`
- `forge-std` — Foundry test utilities

Remappings are in `remappings.txt`; aliases used in source: `OZ/`, `CMTAT/`, `RuleEngine/`.
Expand All @@ -60,6 +62,7 @@ Foundry config: `foundry.toml` (solc 0.8.34, EVM prague, optimizer 200 runs).
| RuleIdentityRegistry | 55–57 |
| RuleERC2980 | 60–63 |
| RuleSpenderWhitelist | 66 |
| RuleMintAllowance | 70 |

## Conventions
- Each rule has an `InvariantStorage` abstract contract holding its constants, custom errors, and events.
Expand All @@ -76,3 +79,4 @@ Foundry config: `foundry.toml` (solc 0.8.34, EVM prague, optimizer 200 runs).
- `AGENTS.md` and `CLAUDE.md` are identical — always update both together.
- Always update README.md with the latest change
- New rule or features implemented: create/update technical documentation in `doc/technical`, update README, create/update test (target: 100% of code coverage), update CHANGELOG.md. Code coverage, run `forge coverage --report summary`
- After each implemented feature or fix, provide a one-line GitHub commit message for all changes since the last commit.
40 changes: 39 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,45 @@ Custom changelog tag: `Dependencies`, `Documentation`, `Testing`
- Update surya doc by running the 3 scripts in [./doc/script](./doc/script)
- Update changelog

## v0.3.0 -


## v0.4.0

### Added

- `RuleConditionalTransferLightMultiToken` and `RuleConditionalTransferLightMultiTokenOwnable2Step` — multi-token conditional transfer rules with token-scoped approvals keyed by `(token, from, to, value)`.
- `RuleMintAllowance` and `RuleMintAllowanceOwnable2Step` — operation rule enforcing a per-minter mint quota managed by an operator. Each mint reduces the minter's allowance; the operator can set an absolute quota or increment/decrement it. Regular transfers and burns are not restricted. Restriction code 70 (`CODE_MINTER_ALLOWANCE_EXCEEDED`).

### Changed

- Update contract version in `VersionModule` to `0.4.0`.
- Ownable2Step rule deployments now explicitly advertise ERC-165 `IERC165` (`0x01ffc9a7`), ERC-173 (`0x7f5828d0`), and Ownable2Step (`0x9ab669ef`) interface IDs.
- `RuleMintAllowance` now enforces single-target binding like `RuleConditionalTransferLight`: a second `bindToken` call reverts with `RuleMintAllowance_TokenAlreadyBound` until the current RuleEngine/token is unbound.
- `RuleMintAllowance` no longer advertises the full ERC-3643 `ICompliance` interface through ERC-165 because its mint quota requires spender-aware callbacks.

### Dependencies

- Update RuleEngine to `v3.0.0-rc4`. Role constants were isolated into dedicated storage contracts (`RulesManagementModuleRolesStorage`, `ERC3643ComplianceRolesStorage`); concrete rules that reference `RULES_MANAGEMENT_ROLE` / `COMPLIANCE_MANAGER_ROLE` now inherit the corresponding storage contract.

### Documentation

- Added technical documentation: `doc/technical/RuleConditionalTransferLightMultiToken.md`.
- Updated README operation-rule sections and tables to include `RuleConditionalTransferLightMultiToken`.
- Added technical documentation: `doc/technical/RuleMintAllowance.md`.
- Updated restriction code table, rule index, role summary, and Ownable2Step list in README.
- Documented that `RuleMintAllowance` does not work with pure ERC-3643 3-arg mint callbacks; it requires the spender-aware CMTAT/RuleEngine path.

### Testing

- Added `RuleConditionalTransferLightMultiToken` tests proving approvals are token-scoped and cannot be consumed cross-token.
- Added explicit RuleEngine integration tests for `RuleConditionalTransferLightMultiToken` documenting caller-context behavior in shared RuleEngine topology.
- Added `Ownable2StepERC165Support` test covering all Ownable2Step rule deployments.
- Extended `Ownable2StepERC165Support` with negative assertions to ensure Ownable2Step rule deployments do not advertise unrelated interfaces (`IAccessControl`, `0xdeadbeef`).
- Added unit tests (`test/RuleMintAllowance/RuleMintAllowance.t.sol`, `test/RuleMintAllowance/RuleMintAllowanceOwnable2Step.t.sol`) and CMTAT integration test (`test/RuleMintAllowance/CMTATIntegration.t.sol`) — 54 tests, including batch mint rollback and ERC-165 advertised-interface coverage, >98% line coverage on `RuleMintAllowanceBase`.

## v0.3.0 - 2026-04-16

Commit: `91c21c1191e84ff938892267ec443b0d1bb9efb0`

### Security

Expand Down
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Modular compliance-rule library for CMTAT / ERC-3643 security tokens. Each rule
- `openzeppelin-contracts` v5.6.1 — `AccessControl`, `Ownable2Step`, `EnumerableSet`, `ERC2771Context`
- `openzeppelin-contracts-upgradeable` v5.6.1
- `CMTAT` v3.0.0 — `IERC1404`, `IERC3643`, `IRuleEngine` interfaces
- `RuleEngine` v3.0.0-rc2 — `IRule`, `RulesManagementModule`
- `RuleEngine` v3.0.0-rc4 — `IRule`, `RulesManagementModule`
- `forge-std` — Foundry test utilities

Remappings are in `remappings.txt`; aliases used in source: `OZ/`, `CMTAT/`, `RuleEngine/`.
Expand Down Expand Up @@ -76,3 +76,4 @@ Foundry config: `foundry.toml` (solc 0.8.34, EVM prague, optimizer 200 runs).
- `AGENTS.md` and `CLAUDE.md` are identical — always update both together.
- Always update README.md with the latest change
- New rule or features implemented: create/update technical documentation in `doc/technical`, update README, create/update test (target: 100% of code coverage), update CHANGELOG.md. Code coverage, run `forge coverage --report summary`
- After each implemented feature or fix, provide a one-line GitHub commit message for all changes since the last commit.
Loading
Loading