Merge pull request #1 from NethermindEth/feat/FixEngine#1
Merge pull request #1 from NethermindEth/feat/FixEngine#1
Conversation
Add engine with Data module and basic tests
Adds FIX descriptor engine for CMTA tokens
|
Hello @dhruv035, Great, thanks a lot for your work! I didn't have the time yet to check all the code, but I just want to highlight that we have released CMTAT v3.2.0 today. So it could be great if you can update the submodule to v3.2.0 in your project too! Best |
Fix engine binding validation and secure token helper descriptor writes, add regression tests for both paths, and include Cursor worktree setup commands for submodule-aware initialization. Co-authored-by: Cursor <cursoragent@cursor.com>
Add deterministic verifyField assertions, missing engine setter and helper authorization revert-path tests, and refactor repeated descriptor fixtures for clearer, maintainable test suites. Co-authored-by: Cursor <cursoragent@cursor.com>
Validate initializer-provided engine addresses against the token binding invariant and add dedicated module tests to cover valid, invalid, and zero-engine initialization paths. Co-authored-by: Cursor <cursoragent@cursor.com>
Use TOKEN_ADDRESS from environment instead of defaulting to implementation address and document the new variable to reduce production misconfiguration risk. Co-authored-by: Cursor <cursoragent@cursor.com>
Bump the CMTAT submodule to v3.2.0, align base-module imports and Engine constructor usage with the upstream API changes, and refresh dependency documentation to match the current releases. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Another potential improvement: separate FixDescriptorEngine in two contracts: FixDescriptorEngineBase This will make easier in the future to use a different access control for the FixDescriptorEngine |
Clarify token-side authorization wording to match the hook-based engine policy and correct the repository license reference to MPL-2.0. Made-with: Cursor
Align module imports and constructor engine struct usage with upstream interface changes so the branch compiles and the full Forge test suite passes again. Made-with: Cursor
Move token binding and descriptor mechanics into a new base contract with _authorize hooks, keep AccessControl policy in the concrete wrapper, and add base-level harness tests to preserve behavior. Made-with: Cursor
Implemented this change, @rya-sge could you help un-draft this PR |
|
@rya-sge I think PR is ready to go through a review, lmk if you need anything else from me. |
|
Hello @swapnilraj, @dhruv035 Sorry for the delay! Thanks a lot for your work. Directory Could it be possible to separate more clearly the CMTAT modified example and associated module and the Engine in the repository ? Also, the Engine should work with any tokens implementing the right interface, I think this is the case but could be relevant to indicate in the readme PR Warning Could be relevant to fix them or to explain why they are not fixed.
note[screaming-snake-case-immutable]: immutables should use SCREAMING_SNAKE_CASE note[mixed-case-function]: function names should use mixedCase note[mixed-case-function]: function names should use mixedCase note[mixed-case-variable]: mutable variables should use mixedCase note[mixed-case-variable]: mutable variables should use mixedCase note[mixed-case-function]: function names should use mixedCase note[mixed-case-variable]: mutable variables should use mixedCase note[mixed-case-variable]: mutable variables should use mixedCase note[mixed-case-variable]: mutable variables should use mixedCase note[mixed-case-variable]: mutable variables should use mixedCase note[mixed-case-function]: function names should use mixedCase note[mixed-case-function]: function names should use mixedCase note[mixed-case-variable]: mutable variables should use mixedCase note[mixed-case-function]: function names should use mixedCase note[mixed-case-variable]: mutable variables should use mixedCase note[mixed-case-function]: function names should use mixedCase note[mixed-case-variable]: mutable variables should use mixedCase note[mixed-case-function]: function names should use mixedCase note[mixed-case-function]: function names should use mixedCase note[mixed-case-variable]: mutable variables should use mixedCase note[mixed-case-variable]: mutable variables should use mixedCase note[mixed-case-variable]: mutable variables should use mixedCase note[mixed-case-function]: function names should use mixedCase note[mixed-case-variable]: mutable variables should use mixedCase note[mixed-case-variable]: mutable variables should use mixedCase note[mixed-case-variable]: mutable variables should use mixedCase note[mixed-case-variable]: mutable variables should use mixedCase note[mixed-case-variable]: mutable variables should use mixedCase note[mixed-case-variable]: mutable variables should use mixedCase note[mixed-case-variable]: mutable variables should use mixedCase note[mixed-case-variable]: mutable variables should use mixedCase |
- Move engine contracts to src/engine/ (FixDescriptorEngine, Base, interfaces, modules) - Move example token to src/example/ (CMTATWithFixDescriptor) - Keep FixDescriptorEngineModule in src/ for clear separation (engine vs CMTAT integration) - Update FixDescriptorEngine to use AccessControlEnumerable (align with PR #4 tests) - Apply CEI reorder in FixDescriptorEngineModule: state update before external call in setFixDescriptorEngine and __fixDescriptorEngineModuleInitUnchained (Aderyn H-2) - Update README project structure and all imports (tests, script) Made-with: Cursor
- Add .github/workflows/lint.yml: run forge lint, filter SBE/CBOR findings from log (Solidity style guide + FixDescriptorKit use caps for initialisms) - foundry.toml: exclude asm-keccak256 lint (optional micro-opt, keep keccak256()) - Re-run Aderyn, update doc/audit/tools/aderyn-report.md - Remove unused IFixDescriptorEngine import from CMTATWithFixDescriptor.sol Made-with: Cursor
- Point inheritance, graph, and report scripts to doc/surya/ - Fix find usage (use SRC_DIR, -name '*.sol') in all three scripts - Post-process report .md to strip repo root so File Name is relative - Regenerate inheritance/graph PNGs and report markdown Made-with: Cursor
- Clarify engine vs CMTAT integration layout and locations - Move SBE/CBOR and lint notes into Foundry configuration section - Add lint.yml to project structure; document asm-keccak256 exclusion - Aderyn: 1 High / 5 Low, remove H-2 (CEI fixed), tidy finding table Made-with: Cursor
- Add comment in _authorizeSetDescriptorEngine() body (CMTATWithFixDescriptor) - Remove L-2 Empty Block from aderyn-report; renumber lows to L-2–L-4 - Update feedback doc: Empty Block fixed, summary and section IDs - README: 1 High / 4 Low, update finding summary table Made-with: Cursor
np @rya-sge!
Done! let me know if the new folder structure looks more readable to you.
Merged and fixed the feedback.
We should leave CBOR and SBE as it is, because that's how they are used in their normal usage |
|
Great! I think we are almost done. May two small last points: a) If still relevant, potentially add an hypertext to this website: https://fixdescriptor.vercel.app/spec Also could be nice to add more schema or explanation on how FIX works alongside CMTAT in the readme. Maybe also a terminology section as the one present in the spec b) After the initial introduction in the readme, if you want, you can add a line like this: See => Update link with the correct link if you copy/past |
…erminology - Add credits line (Nethermind, swapnilraj, CMTA, Taurus) - Add spec link; How FIX messages identify assets with ASCII diagram - Add Terminology table; caption clarifying contract stores root+SBE, verify is separate - Note pathCBOR in Terminology; add FIX Descriptor Spec to References Made-with: Cursor
Added a simple "layman" explanation with an ascii diagram and link to the spec.
Done
I used the vercel link because that's more stable the erc-fix.com link might change once we turn it into an ERC and get a number. |
Add engine with Data module and basic tests