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
2 changes: 1 addition & 1 deletion contracts/interfaces/technical/IERC7802.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface IERC7802 is IERC165 {
* @notice Emitted when a crosschain transfer mints tokens.
* @param to Address of the account tokens are being minted for.
* @param value Amount of tokens minted.
* @param sender Address of the account that finilized the crosschain transfer.
* @param sender Address of the account that finalized the crosschain transfer.
*/
event CrosschainMint(address indexed to, uint256 value, address indexed sender);

Expand Down
43 changes: 43 additions & 0 deletions contracts/interfaces/tokenization/ICMTAT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,49 @@
pragma solidity ^0.8.20;

import {IERC1643CMTAT, IERC1643} from "./draft-IERC1643CMTAT.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC3643EnforcementEvent} from "../tokenization/IERC3643Partial.sol";

/**
* Interface with the mandatory functions according to CMTAT Functional Specification
*/
interface ICMTATMandatory is IERC3643EnforcementEvent {

/*
* @notice returns tokenization terms
*/
function termsURI() external view returns (string memory);

/**
* Mints the amount of tokens to the target address.
*/
function mint(address target, uint256 amount) external;

/**
* Burns the amount of tokens from the target address.
*/
function burn(address target, uint256 amount) external;

/**
* Freeze the target address.
*
* Must emit an AddressFrozen event for the address with isFrozen=true, if successful.
*/
function freeze(address target) external;

/**
* Freeze the target address.
*
* Must emit an AddressFrozen event for the address with isFrozen=false, if successful.
*/
function unfreeze(address target) external;

/**
* Returns whether the target address is frozen.
*/
function isFrozen(address account) external returns(bool);

}

/**
* The issuer must be able to “deactivate” the smart contract, to prevent execution of transactions on
Expand Down
32 changes: 23 additions & 9 deletions contracts/modules/wrapper/core/EnforcementModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,27 @@ abstract contract EnforcementModule is
PUBLIC/EXTERNAL FUNCTIONS
//////////////////////////////////////////////////////////////*/
/* ============ State restricted functions ============ */
/**
* As defined in ICMTATMandatory
*/
function freeze(address account) public {
setAddressFrozen(account, true);
}

/**
* As defined in ICMTATMandatory
*/
function unfreeze(address account) public {
setAddressFrozen(account, false);
}

/**
* @inheritdoc IERC3643Enforcement
* @custom:access-control
* - the caller must have the `ENFORCER_ROLE`.
*/
function setAddressFrozen(address account, bool freeze) public virtual override(IERC3643Enforcement) onlyRole(ENFORCER_ROLE){
_addAddressToTheList(account, freeze, "");
function setAddressFrozen(address account, bool frozen) public virtual override(IERC3643Enforcement) onlyRole(ENFORCER_ROLE){
_addAddressToTheList(account, frozen, "");
}

/**
Expand All @@ -43,15 +57,15 @@ abstract contract EnforcementModule is
* - Freezing an account prevents it from transferring or receiving tokens depending on enforcement logic.
* - Emits an `AddressFrozen` event.
* @param account The address whose frozen status is being updated.
* @param freeze Set to `true` to freeze the account, or `false` to unfreeze it.
* @param frozen Set to `true` to freeze the account, or `false` to unfreeze it.
* @param data Optional metadata providing context or justification for the action (e.g. compliance reason).
* @custom:access-control
* - the caller must have the `ENFORCER_ROLE`.
*/
function setAddressFrozen(
address account, bool freeze, bytes calldata data
address account, bool frozen, bytes calldata data
) public virtual onlyRole(ENFORCER_ROLE) {
_addAddressToTheList(account, freeze, data);
_addAddressToTheList(account, frozen, data);
}

/**
Expand All @@ -69,16 +83,16 @@ abstract contract EnforcementModule is
/**
* @inheritdoc IERC3643Enforcement
*/
function isFrozen(address account) public override(IERC3643Enforcement) view virtual returns (bool isFrozen_) {
function isFrozen(address account) public override(IERC3643Enforcement) view virtual returns (bool frozen) {
return _addressIsListed(account);

}

/*//////////////////////////////////////////////////////////////
INTERNAL/PRIVATE FUNCTIONS
//////////////////////////////////////////////////////////////*/
function _addAddressToTheList(EnforcementModuleInternalStorage storage $,address account, bool freeze, bytes memory data) internal override(EnforcementModuleInternal){
EnforcementModuleInternal._addAddressToTheList($, account, freeze, data);
emit AddressFrozen(account, freeze, _msgSender(), data);
function _addAddressToTheList(EnforcementModuleInternalStorage storage $,address account, bool frozen, bytes memory data) internal override(EnforcementModuleInternal){
EnforcementModuleInternal._addAddressToTheList($, account, frozen, data);
emit AddressFrozen(account, frozen, _msgSender(), data);
}
}
7 changes: 7 additions & 0 deletions contracts/modules/wrapper/options/ERC7551Module.sol
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ abstract contract ERC7551Module is ExtraInformationModule, IERC7551Document {
function termsHash() public view virtual override(IERC7551Document) returns (bytes32 hash_){
return terms().doc.documentHash;
}

/**
* As defined in ICMTATMandatory
*/
function termsURI() public view returns (string memory) {
return terms().doc.uri;
}

/*//////////////////////////////////////////////////////////////
INTERNAL/PRIVATE FUNCTIONS
Expand Down