Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,7 @@ DeactivateReportGas=true npx hardhat test
- `contracts/interfaces/` - All supported interfaces and standards
- `hardhat.config.js` - Build configuration (EVM & Solidity version)
- `package.json` - Dependencies and scripts

## Note

After each implemented feature or fix, provide a one-line GitHub commit message for all changes since the last commit.
4 changes: 4 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,7 @@ DeactivateReportGas=true npx hardhat test
- `contracts/interfaces/` - All supported interfaces and standards
- `hardhat.config.js` - Build configuration (EVM & Solidity version)
- `package.json` - Dependencies and scripts

## Note

After each implemented feature or fix, provide a one-line GitHub commit message for all changes since the last commit.
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ This would make it easier to keep your changes separate from the upstream CMTAT

It also simplifies upgrading to newer versions of CMTAT, since updating a submodule is typically cleaner and more straightforward than maintaining a fork.

If you want to create a version for another blockchain, you can find more details here: [CMTAT-equivalency-assessment](https://github.com/CMTA/CMTAT-equivalency-assessment)

## Opening an issue

You can [open an issue] to suggest a feature, a difficulty you have or report a minor bug. For serious bugs in an audited version please do not open an issue, instead refer to our [security policy] for appropriate steps. See [SECURITY.md](./SECURITY.MD).
Expand Down
46 changes: 44 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,30 @@ CMTAT implements a wide set of Ethereum standards:
CMTAT provides cross-chain compatibility through `ERC20CrossChain` and related deployment options:

- **ERC-7802**: native `crosschainMint` / `crosschainBurn` support for bridge-style interoperability.
- **Chainlink CCIP (CCT)**: compatible burn/mint token flow, including `getCCIPAdmin()` support through the `CCIPModule`.
- **Chainlink CCIP (CCT)**: compatible burn/mint token flow, including `getCCIPAdmin()` support through the `CCIPModule`. Scripts and examples are available in the project [CMTAT-CCIP](https://github.com/CMTA/CMTAT-CCIP)
- **LayerZero**: supported through external OFT adapters (ERC-3643 and ERC-7802 variants) in [CMTAT-LayerZero](https://github.com/CMTA/CMTAT-LayerZero).

For full architecture, permissions, and operational notes, see:
- [Cross-chain bridge integration](./doc/technical/cross-chain-bridge-integration.md)
- [Main documentation](./doc/README.md)

## Other Blockchain Implementations
## Other CMTA projects

### Deployment version

This section regroups projects which implements new CMTAT deployment version for EVM/Ethereum with additionnal features

- [SnapshotEngine](https://github.com/CMTA/SnapshotEngine)

The SnapshotEngine is a smart contract system designed to perform ERC-20 on-chain snapshots, making it easier to distribute dividends or other token-based rewards directly on-chain The Snapshone engine can be external or integrated directly in the main token contract.

- [CMTAT-FIX](https://github.com/CMTA/CMTAT-FIX) ([Nethermind](https://www.nethermind.io))

Integration of FIX descriptor support for CMTAT.

This project provides a modular engine system that enables CMTAT tokens to store, manage, and verify FIX (Financial Information eXchange) protocol descriptors on-chain.

### Blockchain Implementations

CMTAT is blockchain-agnostic and also has implementations/adaptations beyond this Solidity EVM repository:

Expand All @@ -125,7 +141,33 @@ CMTAT is blockchain-agnostic and also has implementations/adaptations beyond thi
- **Aztec (privacy-focused variant)**: [private-CMTAT-aztec](https://github.com/CMTA/private-CMTAT-aztec)
- **Zama Confidential variant**: [CMTAT-Confidential](https://github.com/CMTA/CMTAT-Confidential)
- A confidential security token implementation combining CMTAT compliance features with the Zama Confidential Blockchain Protocol for private balances.
- [CMTAT-Canton](https://github.com/CMTA/CMTAT-Canton): CMTAT version for Canton

### Utility contract

- [RulEngine](https://github.com/CMTA/RuleEnginehttps://github.com/CMTA/RuleEngine: )

The RuleEngine is an external contract used to apply transfer restrictions to another contract, such as CMTAT and ERC-3643 tokens. Acting as a controller, it can call different contract rules and apply these rules on each transfer.

- [Rules](https://github.com/CMTA/Rules)

**Rules** is a collection of on-chain compliance and transfer-restriction rules designed for use with the [CMTA RuleEngine](https://github.com/CMTA/RuleEngine) and the [CMTAT token standard](https://github.com/CMTA/CMTAT).

- [SnapshotEngine](https://github.com/CMTA/SnapshotEngine)

The SnapshotEngine is a smart contract system designed to perform ERC-20 on-chain snapshots, making it easier to distribute dividends or other token-based rewards directly on-chain

- [IncomeVault](https://github.com/CMTA/IncomeVault)

The `IncomeVault` is a prototype to perform coupon-payment dividend with a CMTAT and the snapshotEngine

- [CMTAT-Factory](https://github.com/CMTA/CMTAT-Factory)

Factory to deploy CMTAT with Transparent, UUPS and Beacon proxy using **deterministic addresses (via CREATE2**

- [Delivery vs. payment protocol](https://github.com/CMTA/DVP)

The DvP (Delivery versus Payment) smart contract (DVP.sol) interacts with an Asset Token smart contract (Delivery) and a *Payment Order Token* smart contract (Payment).

## Security

Expand Down
23 changes: 22 additions & 1 deletion contracts/modules/4_CMTATBaseERC1404.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
pragma solidity ^0.8.20;

import {CMTATBaseRuleEngine} from "./3_CMTATBaseRuleEngine.sol";
import {CMTATBaseAccessControl} from "./2_CMTATBaseAccessControl.sol";
/* ==== Wrapper === */
// Use by detectTransferRestriction
import {ERC20Upgradeable} from "./wrapper/core/ERC20BaseModule.sol";
// Extensions
import {ERC20EnforcementModule} from "./wrapper/extensions/ERC20EnforcementModule.sol";
// Controllers
import {ValidationModuleERC1404, IERC1404Extend} from "./wrapper/extensions/ValidationModule/ValidationModuleERC1404.sol";
import {ValidationModuleERC1404, IERC1404, IERC1404Extend} from "./wrapper/extensions/ValidationModule/ValidationModuleERC1404.sol";
import {ValidationModuleRuleEngine} from "./wrapper/extensions/ValidationModule/ValidationModuleRuleEngine.sol";
import {ERC1404ExtendInterfaceId} from "../library/ERC1404ExtendInterfaceId.sol";

abstract contract CMTATBaseERC1404 is
CMTATBaseRuleEngine,
Expand Down Expand Up @@ -62,6 +64,25 @@ abstract contract CMTATBaseERC1404 is
return CMTATBaseRuleEngine.canTransferFrom(spender, from, to, value);
}

/**
* @notice ERC-165 interface detection
* @dev advertises support for both the canonical ERC-1404 interface
* (`IERC1404`, id `0xab84a5c8`) and its CMTAT extension
* (`IERC1404Extend`, id `0x78a8de7d`).
* @dev The extension id is taken from {ERC1404ExtendInterfaceId} because
* Solidity's `type(IERC1404Extend).interfaceId` excludes inherited
* functions and would therefore only cover `detectTransferRestrictionFrom`.
* @inheritdoc CMTATBaseAccessControl
*/
function supportsInterface(
bytes4 interfaceId
) public view virtual override(CMTATBaseAccessControl) returns (bool) {
return
interfaceId == type(IERC1404).interfaceId ||
interfaceId == ERC1404ExtendInterfaceId.ERC1404EXTEND_INTERFACE_ID ||
super.supportsInterface(interfaceId);
}

/*//////////////////////////////////////////////////////////////
INTERNAL/PRIVATE FUNCTIONS
//////////////////////////////////////////////////////////////*/
Expand Down
5 changes: 2 additions & 3 deletions contracts/modules/5_CMTATBaseERC20CrossChain.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ pragma solidity ^0.8.20;
import {AccessControlUpgradeable} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
/* ==== Module === */
import {CMTATBaseERC1404, CMTATBaseRuleEngine, ERC20Upgradeable} from "./4_CMTATBaseERC1404.sol";
import {CMTATBaseAccessControl} from "./2_CMTATBaseAccessControl.sol";
import {CMTATBaseCommon} from "./0_CMTATBaseCommon.sol";
import {ERC20BurnModuleInternal} from "./wrapper/core/ERC20BurnModule.sol";
import {ERC20MintModuleInternal} from "./wrapper/core/ERC20MintModule.sol";
Expand Down Expand Up @@ -72,8 +71,8 @@ abstract contract CMTATBaseERC20CrossChain is ERC20CrossChainModule, CCIPModule,
return CMTATBaseCommon.symbol();
}

function supportsInterface(bytes4 _interfaceId) public view virtual override(CMTATBaseAccessControl, ERC20CrossChainModule) returns (bool) {
return ERC20CrossChainModule.supportsInterface(_interfaceId)|| CMTATBaseAccessControl.supportsInterface( _interfaceId);
function supportsInterface(bytes4 _interfaceId) public view virtual override(CMTATBaseERC1404, ERC20CrossChainModule) returns (bool) {
return ERC20CrossChainModule.supportsInterface(_interfaceId)|| CMTATBaseERC1404.supportsInterface( _interfaceId);
}

/*//////////////////////////////////////////////////////////////
Expand Down
Loading