Conversation
…rableSet.at to pos
…, add PlantUML transfer-flow diagram
…rect the transferred overload selection in the docs
…ument the disjoint CMTAT and ERC-3643 entry points
…try points and document their disjoint RuleEngine paths
… drawio schema in doc/README.md
…ers and never forwards a zero spender
…ed imports and custom errors across src/
…ntion, maxRules event)
…-rc5 and apply its fixes
…ify mock scope in the docs
…iew under audits/tools/v3.0.0-rc5
…ack and an audit overview
…OOLCHAIN.md with a note on abstract-declaration hit counts, and refresh the published coverage report
Return NoRestriction for ERC-1404 code 0 instead of Unknown
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed
ERC3643ComplianceModule._bindToken/_unbindToken: rely on theEnumerableSetmutation return value instead of a precedingcontains()lookup, keeping theTokenAlreadyBound/TokenNotBounddiagnostics (269 gas measured)._bindToken,_unbindTokenandRuleEngineBase._supportsRuleEngineBaseInterfaceare nowvirtual, along with the remaining non-virtualinternals in the mock rules, per the project convention.RuleAddressList.addressIsListedBatch:memoryparameter changed tocalldata(587 gas measured for 10 addresses).SetMaxRuleswith the initial cap, so the event log alone is sufficient to reconstructmaxRules.RulesManagementModule: the rule-cap write and its event moved into a newinternal virtual _setMaxRules(uint256), called bysetMaxRulesand by the deployable contracts' constructors._maxRulesis now written from a single place, so the invariant "every change to the cap emitsSetMaxRules" holds structurally rather than by convention, and the non-zero check guards every path including construction.RulesManagementModule: rule insertion moved into a newinternal virtual _addRule(IRule), called byaddRuleand by thesetRulesloop.AddRuleis now emitted from a single site. ThemaxRulescap is deliberately checked by the callers, sinceaddRulechecks per insertion whilesetRuleschecks the whole batch up front.Added
Add
ERC3643TokenMock: a minimal ERC-3643 (T-REX) style token whose compliance interaction mirrorsToken.solfrom the reference implementation, used to test the RuleEngine through the ERC-3643 entry points (setComplianceself-binding,transferred,created,destroyed).Add
ERC3643TokenIntegration.t.sol(11 tests), including a regression guard for the H-1 mint pre-check fail-open and one pinning the requirement thataddress(0)be whitelisted for an ERC-3643 token to mint.Renamed the reference rules in
src/mocks/rules/with aMocksuffix, so a reader cannot mistake them for the production rules of the same name maintained in CMTA/Rules:RuleWhitelist->RuleWhitelistMock,RuleConditionalTransferLight->RuleConditionalTransferLightMock,RuleMintAllowance->RuleMintAllowanceMock,RuleOperationRevert->RuleOperationRevertMock. Files renamed to match. The abstract bases and invariant-storage contracts they build on are unchanged, as they are not themselves rules.Removed
RuleEngine_ERC3643Compliance_OperationNotSuccessful: unreachable after the bind/unbind simplification and referenced nowhere else.Documentation
canTransfer/detectTransferRestrictionpath fails open for spender-dependent rules, and thatcanTransferFrom/detectTransferRestrictionFrommust be used to pre-check an operation that has an operator.doc/technical: RuleEngine-with-CMTAT.md and RuleEngine-with-ERC3643.md, covering entry points, configuration, warnings, limitations and test coverage for each token standard.Fixed
RuleEngineScript.s.sol: the CMTAT token is now bound to the engine (passed to the constructor). Previously the script produced a deployment in which every transfer, mint and burn reverted withRuleEngine_ERC3643Compliance_UnauthorizedCaller, because the token was never bound.RuleEngineScript.s.sol:setRuleEngineis now called through the typed interface instead of a low-level.callguarded by a barerequire(success). The previous form returned success whenCMTAT_ADDRESSheld no code, silently producing an unconfigured deployment, and discarded the revert reason on failure.RuleEngineScript.s.sol: the demo whitelist is now seeded with the deployer andaddress(0), so the resulting deployment can transfer, mint and burn as-is.test/script/RuleEngineScript.t.sol: asserts the resulting deployment works (engine set, token bound, rule configured, a real mint) instead of only thatrun()does not revert.doc/script/script_surya_*.sh: fixed the shebang (#/bin/bash->#!/bin/bash), the undefined$dirloop variable,mkdirwithout-pin the report script, and the output-directory guard in the inheritance script; addedset -euo pipefailand null-delimitedfinditeration to all three. The loop iteratesfind .rather than an absolute path on purpose:surya mdreportembeds the path it is given, so an absolute one would write machine-specific paths into the committed reports underdoc/schema/surya/surya_report.package.json: thesurya:*anduml:*scripts now write beneathdocOut/(gitignored) instead of the repository root.doc/script/convert_links_for_pdf.sh: the default input is nowdoc/README.md(the full documentation) rather than the short root README.Dependencies