Skip to content

Releases: CMTA/Rules

v0.2.0

10 Mar 16:04
d72a98a

Choose a tag to compare

Added

  • RuleSpenderWhitelist — validation rule that blocks transferFrom when spender is not listed; direct transfers are always allowed. Restriction code 66.
  • RuleSpenderWhitelistOwnable2Step — Ownable2Step variant of RuleSpenderWhitelist.
  • Technical documentation file doc/technical/RuleSpenderWhitelist.md.
  • Transfer-context mocks in src/mocks: MockERC20WithTransferContext and MockERC721WithTransferContext.
  • Transfer-context mocks in src/mocks now inherit OpenZeppelin ERC20 / ERC721 and emit rule callbacks through ITransferContext.
  • 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 of RuleERC2980.
  • IERC2980 interface with NatSpec documenting the deviation from the ERC example interfaces (single-item functions revert on invalid input rather than returning bool).
  • isVerified(address) to RuleERC2980Base and RuleWhitelistWrapperBase, implementing IIdentityRegistryVerified; for ERC-2980 it reflects whitelist membership only (frozen status is excluded).
  • VersionModule — abstract module implementing IERC3643Version; all rules now expose version() 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 / FungibleTransferContext with an extra data field.
  • Explicit sanctions oracle clearing via clearSanctionListOracle().
  • CMTAT deployment scripts for whitelist and blacklist configurations.
  • DeployCMTATWithBlacklistAndSanctionsList deployment script — deploys a CMTAT token wired to a RuleEngine configured with both RuleBlacklist and RuleSanctionsList.
  • Technical documentation for all rules in doc/technical/: added RuleMaxTotalSupply.md, RuleIdentityRegistry.md, RuleERC2980.md, RuleConditionalTransferLight.md; updated RuleWhitelist.md, RuleBlacklist.md, RuleSanctionList.md, RuleWhitelistWrapper.md.

Changed

  • RBAC variants now use AccessControlEnumerable (replacing plain AccessControl); role members can be enumerated with getRoleMember / getRoleMemberCount.
  • Default admin implicitly holds all roles via a hasRole override; may not appear in role member enumerations unless explicitly granted.
  • Authorization hooks (_authorize*()) now use onlyRole(ROLE) modifier instead of direct _checkRole calls.
  • All internal functions marked virtual to allow downstream overriding.
  • Validation flow refactored to internal hooks (no this. calls) via RuleTransferValidation and RuleNFTAdapter.
  • RuleConditionalTransferLight and RuleMaxTotalSupply are 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, and deployment folders.
  • Rule transfer-context dispatch now treats sender == from as direct transfer (non-spender path) in RuleNFTAdapter.
  • Concrete utilities and harness contracts used by tests were moved from test/ into src/mocks and src/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.md and .gas-snapshot.

v0.1.0

03 Dec 15:16
0937641

Choose a tag to compare

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, detectTransferRestrictionFrom which takes the spender argument

  • Add functions canTransfer, canTransferFrom, detectTransferRestriction,detectTransferRestrictionFrom which takes the tokenId argument.

  • Add support of ERC-165 in each rule.