-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathICMTAT.sol
More file actions
240 lines (212 loc) · 7.67 KB
/
Copy pathICMTAT.sol
File metadata and controls
240 lines (212 loc) · 7.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
//SPDX-License-Identifier: MPL-2.0
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
* the distributed ledger.
* Contrary to the “burn” function, the “deactivateContract” function
* affects all tokens in issuance, and not only some of them.
*
* a) This function is necessary to allow the issuer to carry out certain corporate actions
* (e.g. share splits, reverse splits or mergers), which
* require that all existing tokens are either canceled or immobilized and decoupled from the shares
* (i.e. the tokens no longer represent shares).
*
* b) The “deactivateContract” function can also be used if the issuer decides that it no longer wishes
* to have its shares issued in the form of ledger-based securities
*
* The “deactivateContract” function does not delete the smart contract’s
* storage and code, i.e. tokens are not burned by the function, however it permanently and
* irreversibly deactivates the smart contract (unless a proxy is used).
*
*/
interface ICMTATDeactivate {
/**
* @notice Emitted when the contract is permanently deactivated.
* @param account The address that performed the deactivation.
*/
event Deactivated(address account);
/*
* @notice Permanently deactivates the contract.
* @dev
* This action is irreversible — once executed, the contract cannot be reactivated.
* Requirements:
* - The contract MUST be paused before deactivation is allowed.
* Emits a {Deactivated} event.
* WARNING: Use with caution. This action permanently disables core contract functionality.
*/
function deactivateContract() external;
/**
* @notice Returns whether the contract has been permanently deactivated.
* @return isDeactivated A boolean indicating the deactivation status.
* @dev Returns `true` if `deactivateContract()` has been successfully called.
*/
function deactivated() external view returns (bool isDeactivated) ;
}
/**
* @title ICMTATBase - Core Tokenization Metadata Interface as part of CMTAT specification
* @notice Defines base properties and metadata structure for a tokenized asset.
* @dev Includes token ID, terms (using IERC1643-compliant document), and a general information field.
*/
interface ICMTATBase {
/* ============ Struct ============ */
/*
* @dev A reference to (e.g. in the form of an Internet address) or a hash of the tokenization terms
*/
struct Terms {
string name;
IERC1643.Document doc;
}
/* ============ Events ============ */
/**
* @notice Emitted when the general information field is updated.
* @param newInformation The newly assigned metadata or descriptive text.
*/
event Information(
string newInformation
);
/**
* @notice Emitted when new tokenization terms are set.
* @param newTerm The new Terms structure containing name and document reference.
*/
event Term(Terms newTerm);
/**
* @notice Emitted when the token ID is set or updated.
* @param newTokenIdIndexed The token ID (indexed for filtering).
* @param newTokenId The full token ID string.
*/
event TokenId(string indexed newTokenIdIndexed, string newTokenId);
/* ============ View Functions ============ */
/*
* @notice return tokenization tokenId
*/
function tokenId() external view returns (string memory tokenId_);
/*
* @notice returns tokenization terms
*/
function terms() external view returns (Terms memory terms_);
/*
* @notice returns information field
*/
function information() external view returns (string memory information_);
/* ============ Write Functions ============ */
/**
* @notice Sets a new tokenization token ID.
* @param tokenId_ The token ID string to assign to the tokenized asset.
*/
function setTokenId(
string calldata tokenId_
) external ;
/**
* @notice Sets new tokenization terms using a document reference.
* @param terms_ The `DocumentInfo` structure referencing the terms document (name + URI + hash).
*/
function setTerms(IERC1643CMTAT.DocumentInfo calldata terms_) external;
/**
* @notice Sets or updates the general information field.
* @param information_ A string describing token attributes, usage, or metadata URI.
*/
function setInformation(
string calldata information_
) external;
}
interface ICMTATCreditEvents {
/**
* @notice Returns credit events
*/
function creditEvents() external view returns(CreditEvents memory creditEvents_);
struct CreditEvents {
bool flagDefault;
bool flagRedeemed;
string rating;
}
}
/**
* @notice interface to represent debt tokens
*/
interface ICMTATDebt {
struct DebtInformation {
DebtIdentifier debtIdentifier;
DebtInstrument debtInstrument;
}
/**
* @dev Information on the issuer and other persons involved
*/
struct DebtIdentifier {
string issuerName;
string issuerDescription;
string guarantor;
string debtHolder;
}
/**
* dev Information on the Instruments
*/
struct DebtInstrument {
// uint256
uint256 interestRate;
uint256 parValue;
uint256 minimumDenomination;
// string
string issuanceDate;
string maturityDate;
string couponPaymentFrequency;
/*
* Interest schedule format (if any). The purpose of the interest schedule is to set, in the parameters of the smart
* contract, the dates on which the interest payments accrue.
* - Format A: start date/end date/period
* - Format B: start date/end date/day of period (e.g. quarter or year)
* - Format C: date 1/date 2/date 3/….
*/
string interestScheduleFormat;
/*
* - Format A: period (indicating the period between the accrual date for the interest payment and the date on
* which the payment is scheduled to be made)
* - Format B: specific date
*/
string interestPaymentDate;
string dayCountConvention;
string businessDayConvention;
string currency;
// address
address currencyContract;
}
/**
* @notice Returns debt information
*/
function debt() external view returns(DebtInformation memory debtInformation_);
}