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
206 changes: 116 additions & 90 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/deployment/CMTATStandalone.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.20;

import {CMTATBaseERC2771} from "../modules/4_CMTATBaseERC2771.sol";
import {CMTATBaseERC2771} from "../modules/5_CMTATBaseERC2771.sol";
import {ERC2771Module} from "../modules/wrapper/options/ERC2771Module.sol";
import {ICMTATConstructor} from "../interfaces/technical/ICMTATConstructor.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/deployment/CMTATUpgradeable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.20;

import {CMTATBaseERC2771} from "../modules/4_CMTATBaseERC2771.sol";
import {CMTATBaseERC2771} from "../modules/5_CMTATBaseERC2771.sol";
import {ERC2771Module} from "../modules/wrapper/options/ERC2771Module.sol";


Expand Down
2 changes: 1 addition & 1 deletion contracts/deployment/CMTATUpgradeableUUPS.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.20;
import {UUPSUpgradeable} from "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
import {CMTATBaseERC2771} from "../modules/4_CMTATBaseERC2771.sol";
import {CMTATBaseERC2771} from "../modules/5_CMTATBaseERC2771.sol";
import {ERC2771Module} from "../modules/wrapper/options/ERC2771Module.sol";

/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/deployment/ERC1363/CMTATStandaloneERC1363.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.20;

import {CMTATBaseERC1363} from "../../modules/5_CMTATBaseERC1363.sol";
import {CMTATBaseERC1363} from "../../modules/6_CMTATBaseERC1363.sol";
import {ERC2771Module, ERC2771ContextUpgradeable} from "../../modules/wrapper/options/ERC2771Module.sol";
import {ICMTATConstructor} from "../../interfaces/technical/ICMTATConstructor.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/deployment/ERC1363/CMTATUpgradeableERC1363.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.20;

import {CMTATBaseERC1363} from "../../modules/5_CMTATBaseERC1363.sol";
import {CMTATBaseERC1363} from "../../modules/6_CMTATBaseERC1363.sol";
import {ERC2771Module, ERC2771ContextUpgradeable} from "../../modules/wrapper/options/ERC2771Module.sol";


Expand Down
2 changes: 1 addition & 1 deletion contracts/deployment/ERC7551/CMTATStandaloneERC7551.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.20;

import {CMTATBaseERC7551} from "../../modules/5_CMTATBaseERC7551.sol";
import {CMTATBaseERC7551} from "../../modules/6_CMTATBaseERC7551.sol";
import {ERC2771Module} from "../../modules/wrapper/options/ERC2771Module.sol";
import {ICMTATConstructor} from "../../interfaces/technical/ICMTATConstructor.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/deployment/ERC7551/CMTATUpgradeableERC7551.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pragma solidity ^0.8.20;

import {ERC2771Module} from "../../modules/wrapper/options/ERC2771Module.sol";
import {CMTATBaseERC7551} from "../../modules/5_CMTATBaseERC7551.sol";
import {CMTATBaseERC7551} from "../../modules/6_CMTATBaseERC7551.sol";

/**
* @title CMTAT version for a proxy deployment (Transparent or Beacon proxy)
Expand Down
10 changes: 3 additions & 7 deletions contracts/deployment/allowlist/CMTATStandaloneAllowlist.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.20;

import {CMTATBaseAllowlist, ISnapshotEngine, IERC1643} from "../../modules/1_CMTATBaseAllowlist.sol";
import {CMTATBaseAllowlist, ISnapshotEngine, IERC1643} from "../../modules/2_CMTATBaseAllowlist.sol";
import {ERC2771Module, ERC2771ContextUpgradeable} from "../../modules/wrapper/options/ERC2771Module.sol";
import {ICMTATConstructor} from "../../interfaces/technical/ICMTATConstructor.sol";

Expand All @@ -23,18 +23,14 @@ contract CMTATStandaloneAllowlist is CMTATBaseAllowlist {
address forwarderIrrevocable,
address admin,
ICMTATConstructor.ERC20Attributes memory ERC20Attributes_,
ICMTATConstructor.ExtraInformationAttributes memory extraInformationAttributes_,
ISnapshotEngine snapshotEngine_,
IERC1643 documentEngine_
ICMTATConstructor.ExtraInformationAttributes memory extraInformationAttributes_

) ERC2771Module(forwarderIrrevocable){
// Initialize the contract to avoid front-running
initialize(
admin,
ERC20Attributes_,
extraInformationAttributes_,
snapshotEngine_,
documentEngine_
extraInformationAttributes_
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.20;

import {CMTATBaseAllowlist} from "../../modules/1_CMTATBaseAllowlist.sol";
import {CMTATBaseAllowlist} from "../../modules/2_CMTATBaseAllowlist.sol";
import {ERC2771Module, ERC2771ContextUpgradeable} from "../../modules/wrapper/options/ERC2771Module.sol";


Expand Down
2 changes: 1 addition & 1 deletion contracts/deployment/debt/CMTATStandaloneDebt.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.20;

import {CMTATBaseDebt} from "../../modules/2_CMTATBaseDebt.sol";
import {CMTATBaseDebt} from "../../modules/3_CMTATBaseDebt.sol";
import {ICMTATConstructor} from "../../interfaces/technical/ICMTATConstructor.sol";
/**
* @title CMTAT version for a standalone deployment (without proxy)
Expand Down
2 changes: 1 addition & 1 deletion contracts/deployment/debt/CMTATUpgradeableDebt.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.20;

import {CMTATBaseDebt} from "../../modules/2_CMTATBaseDebt.sol";
import {CMTATBaseDebt} from "../../modules/3_CMTATBaseDebt.sol";
/**
* @title CMTAT version for a proxy deployment (Transparent or Beacon proxy)
*/
Expand Down
33 changes: 33 additions & 0 deletions contracts/deployment/debtEngine/CMTATStandaloneDebtEngine.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//SPDX-License-Identifier: MPL-2.0

pragma solidity ^0.8.20;

import {CMTATBaseDebtEngine} from "../../modules/5_CMTATBaseDebtEngine.sol";
import {ICMTATConstructor} from "../../interfaces/technical/ICMTATConstructor.sol";
/**
* @title CMTAT version for a standalone deployment (without proxy)
*/
contract CMTATStandaloneDebtEngine is CMTATBaseDebtEngine {
/**
* @notice Contract version for standalone deployment
* @param admin address of the admin of contract (Access Control)
* @param ERC20Attributes_ ERC20 name, symbol and decimals
* @param baseModuleAttributes_ tokenId, terms, information
* @param engines_ external contract
*/
/// @custom:oz-upgrades-unsafe-allow constructor
constructor(
address admin,
ICMTATConstructor.ERC20Attributes memory ERC20Attributes_,
ICMTATConstructor.ExtraInformationAttributes memory extraInformationAttributes_,
ICMTATConstructor.Engine memory engines_
) {
// Initialize the contract to avoid front-running
initialize(
admin,
ERC20Attributes_,
extraInformationAttributes_,
engines_
);
}
}
18 changes: 18 additions & 0 deletions contracts/deployment/debtEngine/CMTATUpgradeableDebtEngine.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//SPDX-License-Identifier: MPL-2.0

pragma solidity ^0.8.20;

import {CMTATBaseDebtEngine} from "../../modules/5_CMTATBaseDebtEngine.sol";
/**
* @title CMTAT version for a proxy deployment (Transparent or Beacon proxy)
*/
contract CMTATUpgradeableDebtEngine is CMTATBaseDebtEngine {
/**
* @notice Contract version for the deployment with a proxy
*/
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
// Disable the possibility to initialize the implementation
_disableInitializers();
}
}
28 changes: 28 additions & 0 deletions contracts/interfaces/modules/IDebtEngineModule.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//SPDX-License-Identifier: MPL-2.0
import {ICMTATDebt, ICMTATCreditEvents} from "../tokenization/ICMTAT.sol";
import {IDebtEngine} from "../engine/IDebtEngine.sol";
pragma solidity ^0.8.20;
/**
* @notice interface to represent DebtEngineModule (debt information and credit events.)
*/
interface IDebtEngineModule is ICMTATDebt, ICMTATCreditEvents {
/* ============ Events ============ */
/**
* @notice Emitted when a new DebtEngine is set.
* @dev Indicates that the contract will delegate debt logic to a new external engine.
* @param newDebtEngine The address of the new debt engine contract.
*/
event DebtEngine(IDebtEngine indexed newDebtEngine);

/* ============ Error ============ */
error CMTAT_DebtEngineModule_SameValue();

/* ============ Functions ============ */
function debtEngine() external view returns (IDebtEngine debtEngine_) ;

function setDebtEngine(
IDebtEngine debtEngine_
) external;
}


2 changes: 0 additions & 2 deletions contracts/interfaces/technical/ICMTATConstructor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import {IERC1643CMTAT} from "../tokenization/draft-IERC1643CMTAT.sol";
interface ICMTATConstructor {
struct Engine {
IRuleEngine ruleEngine;
ISnapshotEngine snapshotEngine;
IERC1643 documentEngine;
}
struct ERC20Attributes {
// token name,
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/technical/IMintBurnToken.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//SPDX-License-Identifier: MPL-2.0
// SPDX-License-Identifier: MPL-2.0

pragma solidity ^0.8.20;

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/tokenization/ICMTAT.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//SPDX-License-Identifier: MPL-2.0
// SPDX-License-Identifier: MPL-2.0

pragma solidity ^0.8.20;

Expand Down
39 changes: 4 additions & 35 deletions contracts/interfaces/tokenization/IERC3643Partial.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//SPDX-License-Identifier: MPL-2.0
// SPDX-License-Identifier: MPL-2.0

/**
* Note:
Expand All @@ -9,6 +9,8 @@

pragma solidity ^0.8.20;

import {IERC7943ERC20Enforcement} from "./draft-IERC7943.sol";

/**
* @title IERC3643Pause
* @dev Interface for pausing and unpausing token transfers.
Expand Down Expand Up @@ -166,19 +168,8 @@ interface IERC3643Enforcement {
* @notice Interface for enforcing partial token freezes and forced transfers, typically used in compliance-sensitive ERC-1400 scenarios.
* @dev For event definitions, see {IERC7551ERC20Enforcement}.
*/
interface IERC3643ERC20Enforcement {
/* ============ View Functions ============ */
/**
* @notice Returns the number of tokens that are currently frozen (i.e., non-transferable) for a given account.
* @dev The frozen amount is always less than or equal to the total balance of the account.
* @param account The address of the wallet being queried.
* @return frozenBalance_ The amount of frozen tokens held by the account.
*/
function getFrozenTokens(address account) external view returns (uint256 frozenBalance_);


interface IERC3643ERC20Enforcement is IERC7943ERC20Enforcement {
/* ============ State Functions ============ */

/**
* @notice Freezes a specific amount of tokens for a given account.
* @dev Emits a `TokensFrozen` event. Prevents the frozen amount from being transferred.
Expand All @@ -194,28 +185,6 @@ interface IERC3643ERC20Enforcement {
* @param value Amount of Tokens to be unfrozen
*/
function unfreezePartialTokens(address account, uint256 value) external;
/**
*
* @notice Triggers a forced transfer.
* @dev
* * Force a transfer of tokens between 2 token holders
* If IERC364320Enforcement is implemented:
* Require that the total value should not exceed available balance.
* In case the `from` address has not enough free tokens (unfrozen tokens)
* but has a total balance higher or equal to the `amount`
* the amount of frozen tokens is reduced in order to have enough free tokens
* to proceed the transfer, in such a case, the remaining balance on the `from`
* account is 100% composed of frozen tokens post-transfer.
* emits a `TokensUnfrozen` event if `value` is higher than the free balance of `from`
* Emits a `Transfer` event
* @param from The address of the token holder
* @param to The address of the receiver
* @param value amount of tokens to transfer
* @return success_ `true` if successful and revert if unsuccessful

*/
function forcedTransfer(address from, address to, uint256 value) external returns (bool success_);

}
/**
* @title IERC3643Mint — Token Minting Interface
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/tokenization/draft-IERC1404.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//SPDX-License-Identifier: MPL-2.0
// SPDX-License-Identifier: MPL-2.0

pragma solidity ^0.8.20;

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/tokenization/draft-IERC1643.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//SPDX-License-Identifier: MPL-2.0
// SPDX-License-Identifier: MPL-2.0

pragma solidity ^0.8.20;

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/tokenization/draft-IERC1643CMTAT.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//SPDX-License-Identifier: MPL-2.0
// SPDX-License-Identifier: MPL-2.0

pragma solidity ^0.8.20;
import {IERC1643} from "./draft-IERC1643.sol";
Expand Down
3 changes: 2 additions & 1 deletion contracts/interfaces/tokenization/draft-IERC7551.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//SPDX-License-Identifier: MPL-2.0
// SPDX-License-Identifier: MPL-2.0
import {IERC3643ComplianceRead} from "./IERC3643Partial.sol";
import {IERC5679Mint, IERC5679Burn} from "../technical/IERC5679.sol";

pragma solidity ^0.8.20;


Expand Down
Loading