Releases: CMTA/Rules
Releases · CMTA/Rules
v0.2.0
Added
RuleSpenderWhitelist— validation rule that blockstransferFromwhen spender is not listed; direct transfers are always allowed. Restriction code 66.RuleSpenderWhitelistOwnable2Step— Ownable2Step variant ofRuleSpenderWhitelist.- Technical documentation file
doc/technical/RuleSpenderWhitelist.md. - Transfer-context mocks in
src/mocks:MockERC20WithTransferContextandMockERC721WithTransferContext. - Transfer-context mocks in
src/mocksnow inherit OpenZeppelinERC20/ERC721and emit rule callbacks throughITransferContext. - Transfer-context tests for ERC-20/ERC-721 mock integration in
test/TransferContext/TransferContextMocks.t.sol. RuleERC2980— ERC-2980 Swiss Compliant rule combining a whitelist (recipient-only) and a frozenlist (blocks sender, recipient, and spender); frozenlist takes priority. Restriction codes 60–63.RuleERC2980Ownable2Step— Ownable2Step variant ofRuleERC2980.IERC2980interface with NatSpec documenting the deviation from the ERC example interfaces (single-item functions revert on invalid input rather than returningbool).isVerified(address)toRuleERC2980BaseandRuleWhitelistWrapperBase, implementingIIdentityRegistryVerified; for ERC-2980 it reflects whitelist membership only (frozen status is excluded).VersionModule— abstract module implementingIERC3643Version; all rules now exposeversion()returning"0.2.0".- New deployable rules:
RuleIdentityRegistry,RuleMaxTotalSupply,RuleConditionalTransferLight. - Ownable2Step variants for all rules:
RuleWhitelistOwnable2Step,RuleBlacklistOwnable2Step,RuleSanctionsListOwnable2Step,RuleMaxTotalSupplyOwnable2Step,RuleIdentityRegistryOwnable2Step,RuleWhitelistWrapperOwnable2Step,RuleConditionalTransferLightOwnable2Step. - Transfer-context struct API:
MultiTokenTransferContext/FungibleTransferContextwith an extradatafield. - Explicit sanctions oracle clearing via
clearSanctionListOracle(). - CMTAT deployment scripts for whitelist and blacklist configurations.
DeployCMTATWithBlacklistAndSanctionsListdeployment script — deploys a CMTAT token wired to aRuleEngineconfigured with bothRuleBlacklistandRuleSanctionsList.- Technical documentation for all rules in
doc/technical/: addedRuleMaxTotalSupply.md,RuleIdentityRegistry.md,RuleERC2980.md,RuleConditionalTransferLight.md; updatedRuleWhitelist.md,RuleBlacklist.md,RuleSanctionList.md,RuleWhitelistWrapper.md.
Changed
- RBAC variants now use
AccessControlEnumerable(replacing plainAccessControl); role members can be enumerated withgetRoleMember/getRoleMemberCount. - Default admin implicitly holds all roles via a
hasRoleoverride; may not appear in role member enumerations unless explicitly granted. - Authorization hooks (
_authorize*()) now useonlyRole(ROLE)modifier instead of direct_checkRolecalls. - All
internalfunctions markedvirtualto allow downstream overriding. - Validation flow refactored to internal hooks (no
this.calls) viaRuleTransferValidationandRuleNFTAdapter. RuleConditionalTransferLightandRuleMaxTotalSupplyare ERC-20 only; ERC-721/1155 compliance interfaces are limited to validation rules.- Address list batch updates emit only add/remove events (no summary events).
- Reorganized validation contracts into
abstract/base,abstract/core,abstract/invariant, anddeploymentfolders. - Rule transfer-context dispatch now treats
sender == fromas direct transfer (non-spender path) inRuleNFTAdapter. - Concrete utilities and harness contracts used by tests were moved from
test/intosrc/mocksandsrc/mocks/harness.
Dependencies
- Updated Solidity toolchain to 0.8.34.
- Update OpenZeppelin to 5.6.0
- Update CMTAT to v3.2.0
- Update RuleEngine to v3.0.0-rc1
Documentation
- Access-control role table with keccak256 hashes.
- Rule-engine flow diagrams, API accuracy, directory layout notes.
- Static analysis reports (Aderyn, Slither) with project feedback in
doc/security/audits/tools/v0.2.0/. - Gas benchmarks in
doc/GAS.mdand.gas-snapshot.
v0.1.0
First release !
-
Update Rules to CMTAT v3.0.0 and latest RuleEngine version
-
Use EnumerableSet from OpenZeppelin to store address status for blacklist and whitelist rules.
-
Add function
canTransferFrom,detectTransferRestrictionFromwhich takes the spender argument -
Add functions
canTransfer,canTransferFrom,detectTransferRestriction,detectTransferRestrictionFromwhich takes thetokenIdargument. -
Add support of ERC-165 in each rule.