You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -74,15 +75,15 @@ interface IERC7943Fungible is IERC165 {
74
75
/// @param from The address from which `amount` is taken.
75
76
/// @param to The address that receives `amount`.
76
77
/// @param amount The amount to force transfer.
77
-
/// @return result True if the transfer executed correctly, false otherwise.
78
+
/// @return result True if the transfer executed correctly. Reverts on failure.
78
79
function forcedTransfer(address from, address to, uint256 amount) external returns(bool result);
79
80
80
81
/// @notice Changes the frozen status of `amount` tokens belonging to `account`.
81
82
/// This overwrites the current value, similar to an `approve` function.
82
83
/// @dev Requires specific authorization. Frozen tokens cannot be transferred by the account.
83
84
/// @param account The address of the account whose tokens are to be frozen.
84
85
/// @param amount The amount of tokens to freeze. It can be greater than account balance.
85
-
/// @return result True if the freezing executed correctly, false otherwise.
86
+
/// @return result True if the freezing executed correctly. Reverts on failure.
86
87
function setFrozenTokens(address account, uint256 amount) external returns(bool result);
87
88
88
89
/// @notice Checks if a specific account is allowed to transact according to token rules.
@@ -140,7 +141,7 @@ interface IERC7943NonFungible is IERC165 {
140
141
/// @param from The address from which `tokenId` is taken.
141
142
/// @param to The address that receives `tokenId`.
142
143
/// @param tokenId The ID of the token being transferred.
143
-
/// @return result True if the transfer executed correctly, false otherwise.
144
+
/// @return result True if the transfer executed correctly. Reverts on failure.
144
145
function forcedTransfer(address from, address to, uint256 tokenId) external returns(bool result);
145
146
146
147
/// @notice Changes the frozen status of `tokenId` belonging to an `account`.
@@ -149,7 +150,7 @@ interface IERC7943NonFungible is IERC165 {
149
150
/// @param account The address of the account whose tokens are to be frozen.
150
151
/// @param tokenId The ID of the token to freeze.
151
152
/// @param frozenStatus Whether `tokenId` is being frozen or not.
152
-
/// @return result True if the freezing executed correctly, false otherwise.
153
+
/// @return result True if the freezing executed correctly. Reverts on failure.
153
154
function setFrozenTokens(address account, uint256 tokenId, bool frozenStatus) external returns(bool result);
154
155
155
156
/// @notice Checks if a specific account is allowed to transact according to token rules.
@@ -213,7 +214,7 @@ interface IERC7943MultiToken is IERC165 {
213
214
/// @param to The address that receives `amount`.
214
215
/// @param tokenId The ID of the token being transferred.
215
216
/// @param amount The amount to force transfer.
216
-
/// @return result True if the transfer executed correctly, false otherwise.
217
+
/// @return result True if the transfer executed correctly. Reverts on failure.
217
218
function forcedTransfer(address from, address to, uint256 tokenId, uint256 amount) external returns(bool result);
218
219
219
220
/// @notice Changes the frozen status of `amount` of `tokenId` tokens belonging to an `account`.
@@ -222,7 +223,7 @@ interface IERC7943MultiToken is IERC165 {
222
223
/// @param account The address of the account whose tokens are to be frozen.
223
224
/// @param tokenId The ID of the token to freeze.
224
225
/// @param amount The amount of tokens to freeze. It can be greater than account balance.
225
-
/// @return result True if the freezing executed correctly, false otherwise.
226
+
/// @return result True if the freezing executed correctly. Reverts on failure.
226
227
function setFrozenTokens(address account, uint256 tokenId, uint256 amount) external returns(bool result);
227
228
228
229
/// @notice Checks if a specific account is allowed to transact according to token rules.
@@ -259,7 +260,8 @@ These provide views into the implementing contract's compliance, transfer policy
259
260
- The `canTransfer`
260
261
- MUST validate that the `amount` being transferred doesn't exceed the unfrozen amount (which is the difference between the current balance and the frozen balance).
261
262
- MUST perform a `canTransact` check on the `from` and `to` parameters. An important documentation note is that [ERC-3643](./eip-3643.md) doesn't perform a `canTransact` check within `canTransfer` as required.
262
-
- MUST return false in general, if any permissioned rule will would prevent a given transfer from succeeding. A transfer refers to any operation that emits the token’s canonical transfer event. A permissioned check can be a pausing mechanism, a call to `canTransact` or anything else that requires privileged actors.
263
+
- MUST return false in general, if any permissioned rule would prevent a given transfer from succeeding. A transfer refers to any operation that emits the token’s canonical transfer event. A permissioned check can be a pausing mechanism, a call to `canTransact` or anything else that requires privileged actors.
264
+
263
265
-`getFrozenTokens` will return the absolute frozen amount, which MAY exceed the account's current balance. In [ERC-721](./eip-721.md) tokens, it MAY return true even if the account does not hold the token.
264
266
265
267
### `forcedTransfer`
@@ -271,10 +273,11 @@ This function provides a standard mechanism for forcing a transfer from a `from`
271
273
- MUST perform necessary validation checks (e.g., sufficient balance/ownership of a specific token).
272
274
- MUST emit both the standard transfer event (from the base standard) and the `ForcedTransfer` event.
273
275
- In single-party permissioned contexts:
274
-
- It MAY bypass the `canTransfer` checks. If this happens, it MUST unfreeze the assets first and emit a `Frozen` event before the underlying base token transfer event reflecting the change. Having the unfrozen amount changed before the actual transfer is critical for tokens that might be susceptible to reentrancy attacks doing external checks on recipients as it is the case for [ERC-721](./eip-721.md) and [ERC-1155](./eip-1155.md) tokens.
276
+
- It MAY bypass the `canTransfer` checks. If this happens, and the transfer involves tokens that are currently counted as frozen, it MUST unfreeze the assets first and emit a `Frozen` event before the underlying base token transfer event reflecting the change. Having the unfrozen amount changed before the actual transfer is critical for tokens that might be susceptible to reentrancy attacks doing external checks on recipients as it is the case for [ERC-721](./eip-721.md) and [ERC-1155](./eip-1155.md) tokens.
275
277
- It SHOULD at least perform a `canTransact` check on the `to` parameter to ensure compliance.
276
278
- In multi-party permissioned contexts:
277
-
- It MUST perform the `canTransfer` checks.
279
+
- It SHOULD perform the `canTransfer` checks and SHOULD NOT bypass the frozen constraints.
280
+
- MUST revert in cases where validations and/or `canTransact` checks return false or fail.
278
281
279
282
### `setFrozenTokens`
280
283
@@ -283,6 +286,7 @@ It provides a way to freeze or unfreeze assets held by a specific account. This
283
286
- MUST emit the `Frozen` event.
284
287
- MUST be restricted in access.
285
288
- MUST allow freezing more assets than those held. This allows for future balances withholding.
289
+
- MUST revert in cases of logical issues or validation checks failure.
286
290
287
291
### Additional Specifications
288
292
@@ -291,7 +295,7 @@ The contract MUST implement the [ERC-165](./eip-165.md) `supportsInterface` func
291
295
-`0xa8fdc849` for the non-fungible interface.
292
296
-`0x5627c61a` for the multi token interface.
293
297
294
-
Implementations of these interfaces MUST implement the necessary functions of their chosen base standard (e.g., [ERC-20](./eip-20.md) for the fungible interface, [ERC-721](./eip-721.md) for the nonfungible interface and [ERC-1155](./eip-1155.md) for the multi token interface) and MUST also restrict access to sensitive functions like `forcedTransfer` and `setFrozenTokens` using an appropriate access control mechanism (e.g., `onlyOwner`, Role-Based Access Control). The specific mechanism is NOT mandated by this interface standard.
298
+
Implementations of these interfaces MUST implement the necessary functions of their chosen base standard (e.g., [ERC-20](./eip-20.md) for the fungible interface, [ERC-721](./eip-721.md) for the non-fungible interface and [ERC-1155](./eip-1155.md) for the multi token interface) and MUST also restrict access to sensitive functions like `forcedTransfer` and `setFrozenTokens` using an appropriate access control mechanism (e.g., `onlyOwner`, Role-Based Access Control). The specific mechanism is NOT mandated by this interface standard.
295
299
296
300
Implementations MUST ensure their transfer methods exhibit the following behavior:
/// @notice Takes `tokenId` from one address and transfers it to another.
102
102
/// @dev Requires specific authorization. Used for regulatory compliance or recovery scenarios.
103
103
/// @param from The address from which `tokenId` is taken.
104
104
/// @param to The address that receives `tokenId`.
105
105
/// @param tokenId The ID of the token being transferred.
106
-
/// @return result True if the transfer executed correctly, false otherwise.
106
+
/// @return result True if the transfer executed correctly. Reverts on failure.
107
107
function forcedTransfer(addressfrom, addressto, uint256tokenId) externalreturns(boolresult);
108
108
109
109
/// @notice Changes the frozen status of `tokenId` belonging to an `account`.
110
110
/// This overwrites the current value, similar to an `approve` function.
111
111
/// @dev Requires specific authorization. Frozen tokens cannot be transferred by the account.
112
-
/// @param account The address of the account whose tokens are to be frozen/unfrozen.
113
-
/// @param tokenId The ID of the token to freeze/unfreeze.
112
+
/// @param account The address of the account whose tokens are to be frozen.
113
+
/// @param tokenId The ID of the token to freeze.
114
114
/// @param frozenStatus Whether `tokenId` is being frozen or not.
115
-
/// @return result True if the freezing executed correctly, false otherwise.
115
+
/// @return result True if the freezing executed correctly. Reverts on failure.
116
116
function setFrozenTokens(addressaccount, uint256tokenId, boolfrozenStatus) externalreturns(boolresult);
117
117
118
118
/// @notice Checks if a specific account is allowed to transact according to token rules.
@@ -129,7 +129,7 @@ interface IERC7943NonFungible is IERC165 {
129
129
function getFrozenTokens(addressaccount, uint256tokenId) externalviewreturns (boolfrozenStatus);
130
130
131
131
/// @notice Checks if a transfer is currently possible according to token rules. It enforces validations on the frozen tokens.
132
-
/// @dev This may involve checks like allowlists, blocklists, transfer limits and other policy-defined restrictions.
132
+
/// @dev This can involve checks like allowlists, blocklists, transfer limits and other policy-defined restrictions.
133
133
/// @param from The address sending tokens.
134
134
/// @param to The address receiving tokens.
135
135
/// @param tokenId The ID of the token being transferred.
@@ -165,7 +165,7 @@ interface IERC7943MultiToken is IERC165 {
165
165
166
166
/// @notice Error reverted when a transfer is attempted from `account` with an `amount` of `tokenId` less than or equal to its balance, but greater than its unfrozen balance.
167
167
/// @param account The address holding the `amount` of `tokenId` tokens.
168
-
/// @param tokenId The Id of the token being transferred.
168
+
/// @param tokenId The ID of the token being transferred.
169
169
/// @param amount The amount of `tokenId` tokens being transferred.
170
170
/// @param unfrozen The amount of tokens that are unfrozen and available to transfer.
0 commit comments