Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
This article covers ERC7943, a proposal to standardize the uRWA (Universal Real World Asset Interface) for compliance checks, transfer controls, forced enforcement, and other functionality required when tokenizing real-world assets.
This article translates, summarizes, and supplements the following proposal.
Overview
ERC7943 proposes the uRWA (Universal RWA) standard, which defines common interfaces needed when tokenizing real-world assets (RWAs) on a blockchain. RWAs include securities, real estate, commodities, and other physical or financial assets.
RWAs require compliance functionality not normally expected of ordinary tokens. Examples include freezing assets, forcibly changing ownership pursuant to an authority's or court's order (executing a transfer for compliance purposes), and allowing transfers only by authorized users. The uRWA standard extends existing common token standards (ERC20, ERC721, and ERC1155) so that these functions can be added with a minimal interface. It also takes an opinionless approach, leaving implementation details unspecified so that projects can choose implementations suited to their circumstances.
This enables DeFi (decentralized finance) protocols and applications to interact with RWA tokens consistently. They can check in advance whether an account may send or receive tokens, handle frozen assets appropriately, and access RWAs through a uniform interface regardless of the internal compliance logic. The standard also adopts introspection through ERC165, allowing external callers to detect the features a contract supports.
For more on ERC165, see the following article.
[ERC165] Checking Whether a Contract Supports a Specific Interface
Motivation
RWAs have significant potential to connect traditional finance and DeFi. Tokenizing real estate, corporate bonds, commodities, art, securities, and other assets enables fractional ownership from small amounts, programmable compliance, expanded secondary-market trading for traditionally illiquid assets, and integration with decentralized protocols.
However, tokenizing RWAs entails requirements uncommon for purely digital assets. These include managing user allowlists, restricting transfers, freezing assets, and responding to requests from law enforcement authorities. Existing ERC20, ERC721, and ERC1155 standards do not themselves account for these compliance features.
Earlier RWA standardization efforts sometimes became feature-heavy in an attempt to cover every use case, introducing unnecessary gas costs and complexity even for simple applications. For example, imposing fine-grained role-based access control, on-chain allowlists, a specific on-chain identity system, or a fixed metadata management approach can reduce flexibility in development and operation.
RWAs come in many forms, and a single all-purpose standard may not reflect real-world requirements. The uRWA standard therefore defines a minimal mandatory interface, providing only a common foundation for compliance and control. Base token implementations can remain lightweight while standardizing only the functions needed for RWA-specific interactions. The ultimate goal is composable DeFi components for RWAs, allowing different asset types to interact using the same compliance checks.
Terminology
| Term | Description |
|---|---|
| EIP | Ethereum Improvement Proposal, a document proposing improvements to Ethereum and defining specifications or standards. |
| RWA (Real World Assets) | Assets in the real world, including real estate, securities, and commodities, represented as blockchain tokens. |
| uRWA (Universal RWA) standard | A proposal extending existing token standards by defining the minimum compliance interfaces RWA tokens should implement. |
| ERC20 / ERC721 / ERC1155 | Ethereum standards for fungible tokens, non-fungible tokens, and multi-token contracts, respectively. |
| ERC165 | A standard providing introspection so external callers can determine the interfaces supported by a contract. |
| Asset freezing | Temporarily prevents transfers or use of tokens in response to regulatory requirements or operational incidents. |
| Enforcement transfer | A procedure changing ownership or custody of tokens regardless of the parties' wishes, pursuant to legal requirements or court orders. |
| Allowlist | A list of addresses permitted to perform specific operations such as sending or receiving tokens. Used for regulatory compliance and KYC. |
| Opinionless design | A design approach that does not prescribe implementation methods or specific operating procedures. Each project can choose an appropriate approach. |
| Composability | The ability to combine different protocols and applications under shared assumptions. Standardized interfaces are key to this property. |
Specification
Basic structure of ERC7943
ERC7943 extends one of the following underlying token standards.
| Token type | Base standard | Corresponding interface |
|---|---|---|
| Fungible Token | ERC20 | IERC7943Fungible |
| Non-Fungible Token | ERC721 | IERC7943NonFungible |
| Multi Token | ERC1155 | IERC7943MultiToken |
All implementations use ERC165 so their supported interfaces can be identified.
ERC20-based interface (IERC7943Fungible)
/// @notice Interface for ERC-20 based implementations.
interface IERC7943Fungible is IERC165 {
/// @notice Emitted when tokens are taken from one address and transferred to another.
/// @param from The address from which tokens were taken.
/// @param to The address to which seized tokens were transferred.
/// @param amount The amount seized.
event ForcedTransfer(address indexed from, address indexed to, uint256 amount);
/// @notice Emitted when `setFrozenTokens` is called, changing the frozen `amount` of tokens for `user`.
/// @param user The address of the user whose tokens are being frozen.
/// @param amount The amount of tokens frozen after the change.
event Frozen(address indexed user, uint256 amount);
/// @notice Error reverted when a user is not allowed to interact.
/// @param account The address of the user which is not allowed for interactions.
error ERC7943NotAllowedUser(address account);
/// @notice Error reverted when a transfer is attempted from `user` with an `amount` less or equal than its balance, but greater than its unfrozen balance.
/// @param user The address holding the tokens.
/// @param amount The amount being transferred.
/// @param unfrozen The amount of tokens that are unfrozen and available to transfer.
error ERC7943InsufficientUnfrozenBalance(address user, uint256 amount, uint256 unfrozen);
/// @notice Takes tokens from one address and transfers them to another.
/// @dev Requires specific authorization. Used for regulatory compliance or recovery scenarios.
/// @param from The address from which `amount` is taken.
/// @param to The address that receives `amount`.
/// @param amount The amount to force transfer.
function forcedTransfer(address from, address to, uint256 amount) external;
/// @notice Changes the frozen status of `amount` tokens belonging to a `user`.
/// This overwrites the current value, similar to an `approve` function.
/// @dev Requires specific authorization. Frozen tokens cannot be transferred by the user.
/// @param user The address of the user whose tokens are to be frozen/unfrozen.
/// @param amount The amount of tokens to freeze/unfreeze.
function setFrozenTokens(address user, uint256 amount) external;
/// @notice Checks if a specific user is allowed to interact according to token rules.
/// @dev This is often used for allowlist/KYC/KYB/AML checks.
/// @param user The address to check.
/// @return allowed True if the user is allowed, false otherwise.
function isUserAllowed(address user) external view returns (bool allowed);
/// @notice Checks the frozen status/amount.
/// @param user The address of the user.
/// @return amount The amount of tokens currently frozen for `user`.
function getFrozenTokens(address user) external view returns (uint256 amount);
/// @notice Checks if a transfer is currently possible according to token rules. It enforces validations on the frozen tokens.
/// @dev This may involve checks like allowlists, blocklists, transfer limits and other policy-defined restrictions.
/// @param from The address sending tokens.
/// @param to The address receiving tokens.
/// @param amount The amount being transferred.
/// @return allowed True if the transfer is allowed, false otherwise.
function canTransfer(address from, address to, uint256 amount) external view returns (bool allowed);
}ForcedTransfer
event ForcedTransfer(address indexed from, address indexed to, uint256 amount);Emitted when tokens are forcibly transferred from one address to another. This event is emitted when a forced transfer (forcedTransfer) occurs. Only accounts with special permission can perform this operation, for purposes such as regulatory compliance or asset recovery.
Parameters
from- Address from which tokens were seized.
to- Address to which tokens were sent.
amount- Amount of tokens forcibly transferred.
Frozen
event Frozen(address indexed user, uint256 amount);Emitted when a particular user's tokens are frozen or unfrozen.
The event is emitted when setFrozenTokens changes the user's token freezing state.
This is used to temporarily prevent the transfer of some or all of a user's tokens.
Parameters
user- Address of the user whose tokens are frozen.
amount- Total amount frozen after the change.
ERC7943NotAllowedUser
error ERC7943NotAllowedUser(address account);An error raised when a user is not permitted. It occurs when a user performs an operation without satisfying KYC (identity verification) or allowlist requirements.
Parameters
account- Address of the user who is not allowed.
ERC7943InsufficientUnfrozenBalance
error ERC7943InsufficientUnfrozenBalance(address user, uint256 amount, uint256 unfrozen);An error raised when the unfrozen balance is insufficient. It occurs when the transfer amount exceeds the unfrozen balance. This addresses cases where the total balance is sufficient but the available balance after excluding frozen tokens is insufficient.
Parameters
user- Token holder.
amount- Amount the user attempted to transfer.
unfrozen- Currently available (unfrozen) balance.
forcedTransfer
function forcedTransfer(address from, address to, uint256 amount) external;A function allowing accounts with special authority, such as administrators, to forcibly transfer tokens. It is used for regulatory compliance, asset recovery, and correction of erroneous transfers, among other purposes. The function bypasses ordinary transfer restrictions and directly modifies balances to perform the transfer. Calling it requires special permission.
Arguments
from- Address from which tokens are withdrawn.
to- Address receiving the tokens.
amount- Amount to transfer forcibly.
setFrozenTokens
function setFrozenTokens(address user, uint256 amount) external;Sets the amount of a particular user's tokens that is frozen. It freezes a specified amount of the tokens held by the user. The user can no longer transfer the frozen tokens. Only authorized accounts may call the function.
Arguments
user- Address subject to freezing.
amount- Total amount frozen after the update.
isUserAllowed
function isUserAllowed(address user) external view returns (bool allowed);Checks whether a specified user is authorized to operate the tokens. It checks whether the user is allowed under policies such as KYC, KYB (business verification), and AML (anti-money laundering). It is often called before executing a transaction.
Arguments
user- User to check.
Return value
allowed- true if permitted, false if prohibited.
getFrozenTokens
function getFrozenTokens(address user) external view returns (uint256 amount);Checks how many of a user's tokens are frozen. External callers can inspect the current freezing state. It does not modify the contract's storage.
Arguments
user- Address to check.
Return value
amount- Amount of frozen tokens.
canTransfer
function canTransfer(address from, address to, uint256 amount) external view returns (bool allowed);Checks whether a token transfer is permitted. It determines whether the transfer can be performed. The decision takes internal rules such as freezing state, allowlists, blocklists, and transaction restrictions into account. It returns false if the contract is paused.
Arguments
from- Sending address.
to- Receiving address.
amount- Amount to transfer.
Return value
allowedtrueif the transfer is allowed,falseotherwise.
ERC721-based interface (IERC7943NonFungible)
This version of the specification covers non-fungible tokens (NFTs).
Its structure is almost identical to the ERC20 version, except that it works with tokenId instead of token amounts.
/// @notice Interface for ERC-721 based implementations.
interface IERC7943NonFungible is IERC165 {
/// @notice Emitted when `tokenId` is taken from one address and transferred to another.
/// @param from The address from which `tokenId` is taken.
/// @param to The address to which seized `tokenId` is transferred.
/// @param tokenId The ID of the token being transferred.
event ForcedTransfer(address indexed from, address indexed to, uint256 indexed tokenId);
/// @notice Emitted when `setFrozenTokens` is called, changing the frozen status of `tokenId` for `user`.
/// @param user The address of the user whose `tokenId` is subjected to freeze/unfreeze.
/// @param tokenId The ID of the token subjected to freeze/unfreeze.
/// @param frozenStatus Whether `tokenId` has been frozen or unfrozen.
event Frozen(address indexed user, uint256 indexed tokenId, bool indexed frozenStatus);
/// @notice Error reverted when a user is not allowed to interact.
/// @param account The address of the user which is not allowed for interactions.
error ERC7943NotAllowedUser(address account);
/// @notice Error reverted when a transfer is attempted from `user` with a `tokenId` which has been previously frozen.
/// @param user The address holding the tokens.
/// @param tokenId The ID of the token being frozen.
error ERC7943FrozenTokenId(address user, uint256 tokenId);
/// @notice Takes `tokenId` from one address and transfers it to another.
/// @dev Requires specific authorization. Used for regulatory compliance or recovery scenarios.
/// @param from The address from which `tokenId` is taken.
/// @param to The address that receives `tokenId`.
/// @param tokenId The ID of the token being transferred.
function forcedTransfer(address from, address to, uint256 tokenId) external;
/// @notice Changes the frozen status of `tokenId` belonging to a `user`.
/// This overwrites the current value, similar to an `approve` function.
/// @dev Requires specific authorization. Frozen tokens cannot be transferred by the user.
/// @param user The address of the user whose tokens are to be frozen/unfrozen.
/// @param tokenId The ID of the token to freeze/unfreeze.
/// @param frozenStatus whether `tokenId` is being frozen or not.
function setFrozenTokens(address user, uint256 tokenId, bool frozenStatus) external;
/// @notice Checks if a specific user is allowed to interact according to token rules.
/// @dev This is often used for allowlist/KYC/KYB/AML checks.
/// @param user The address to check.
/// @return allowed True if the user is allowed, false otherwise.
function isUserAllowed(address user) external view returns (bool allowed);
/// @notice Checks the frozen status of a specific `tokenId`.
/// @param user The address of the user.
/// @param tokenId The ID of the token.
/// @return frozenStatus Whether `tokenId` is currently frozen for `user`.
function getFrozenTokens(address user, uint256 tokenId) external view returns (bool frozenStatus);
/// @notice Checks if a transfer is currently possible according to token rules. It enforces validations on the frozen tokens.
/// @dev This may involve checks like allowlists, blocklists, transfer limits and other policy-defined restrictions.
/// @param from The address sending tokens.
/// @param to The address receiving tokens.
/// @param tokenId The ID of the token being transferred.
/// @return allowed True if the transfer is allowed, false otherwise.
function canTransfer(address from, address to, uint256 tokenId) external view returns (bool allowed);
}Main differences
| Item | ERC20 version | ERC721 version |
|---|---|---|
| Unit of management | Amount (amount) | Token ID (tokenId) |
| Freezing target | Specified quantity | Individual token |
| Specific error | ERC7943FrozenTokenId | ERC7943InsufficientUnfrozenBalance |
ERC1155-based interface (IERC7943MultiToken)
This version supports multiple tokens. It manages amounts for each token ID and controls freezing and forced transfers. It combines characteristics of ERC20 and ERC721.
/// @notice Interface for ERC-1155 based implementations.
interface IERC7943MultiToken is IERC165 {
/// @notice Emitted when tokens are taken from one address and transferred to another.
/// @param from The address from which tokens were taken.
/// @param to The address to which seized tokens were transferred.
/// @param tokenId The ID of the token being transferred.
/// @param amount The amount seized.
event ForcedTransfer(address indexed from, address indexed to, uint256 indexed tokenId, uint256 amount);
/// @notice Emitted when `setFrozenTokens` is called, changing the frozen `amount` of `tokenId` tokens for `user`.
/// @param user The address of the user whose tokens are being frozen.
/// @param tokenId The ID of the token being frozen.
/// @param amount The amount of tokens frozen after the change.
event Frozen(address indexed user, uint256 indexed tokenId, uint256 amount);
/// @notice Error reverted when a user is not allowed to interact.
/// @param account The address of the user which is not allowed for interactions.
error ERC7943NotAllowedUser(address account);
/// @notice Error reverted when a transfer is attempted from `user` with an `amount` of `tokenId` less or equal than its balance, but greater than its unfrozen balance.
/// @param user The address holding the tokens.
/// @param tokenId The ID of the token being transferred.
/// @param amount The amount being transferred.
/// @param unfrozen The amount of tokens that are unfrozen and available to transfer.
error ERC7943InsufficientUnfrozenBalance(address user, uint256 tokenId, uint256 amount, uint256 unfrozen);
/// @notice Takes tokens from one address and transfers them to another.
/// @dev Requires specific authorization. Used for regulatory compliance or recovery scenarios.
/// @param from The address from which `amount` is taken.
/// @param to The address that receives `amount`.
/// @param tokenId The ID of the token being transferred.
/// @param amount The amount to force transfer.
function forcedTransfer(address from, address to, uint256 tokenId, uint256 amount) external;
/// @notice Changes the frozen status of `amount` of `tokenId` tokens belonging to a `user`.
/// This overwrites the current value, similar to an `approve` function.
/// @dev Requires specific authorization. Frozen tokens cannot be transferred by the user.
/// @param user The address of the user whose tokens are to be frozen/unfrozen.
/// @param tokenId The ID of the token to freeze/unfreeze.
/// @param amount The amount of tokens to freeze/unfreeze.
function setFrozenTokens(address user, uint256 tokenId, uint256 amount) external;
/// @notice Checks if a specific user is allowed to interact according to token rules.
/// @dev This is often used for allowlist/KYC/KYB/AML checks.
/// @param user The address to check.
/// @return allowed True if the user is allowed, false otherwise.
function isUserAllowed(address user) external view returns (bool allowed);
/// @notice Checks the frozen status/amount of a specific `tokenId`.
/// @param user The address of the user.
/// @param tokenId The ID of the token.
/// @return amount The amount of `tokenId` tokens currently frozen for `user`.
function getFrozenTokens(address user, uint256 tokenId) external view returns (uint256 amount);
/// @notice Checks if a transfer is currently possible according to token rules. It enforces validations on the frozen tokens.
/// @dev This may involve checks like allowlists, blocklists, transfer limits and other policy-defined restrictions.
/// @param from The address sending tokens.
/// @param to The address receiving tokens.
/// @param tokenId The ID of the token being transferred.
/// @param amount The amount being transferred.
/// @return allowed True if the transfer is allowed, false otherwise.
function canTransfer(address from, address to, uint256 tokenId, uint256 amount) external view returns (bool allowed);
}Additional requirements
| Requirement | Details |
|---|---|
| ERC165 implementation | Implement supportsInterface and report support for the following identifiers. |
| Fungible | 0x20e30a04 |
| Non-Fungible | 0xa1264b3e |
| Multi Token | 0x5ffc456d |
In addition, forcedTransfer and setFrozenTokens must be protected by access control, such as onlyOwner or role-based access control.
The standard does not specify the particular access control method.
Transfer behavior
| Operation | Requirement |
|---|---|
Public transfers (transfer, transferFrom, safeTransferFrom, etc.) |
Must not execute if canTransfer or isUserAllowed is false. |
| Mint | Must not mint to accounts for which isUserAllowed is false. |
| Burn | Ordinarily requires no restrictions. If frozen assets are involved, the freezing state must be updated and the Frozen event emitted. |
Error handling policy
ERC7943NotAllowedUser can be used for general denials.
For more specific cases, ERC7943InsufficientUnfrozenBalance or ERC7943FrozenTokenId is recommended.
If the transfer amount exceeds the balance or the token ID is not owned by the user, use the error defined by the base standard (ERC20, ERC721, or ERC1155).
Additional notes
Overall design
| Area of focus | Objective | Implementation approach |
|---|---|---|
| Minimalism | Limit the standard to essential RWA controls and avoid imposing excessive features. | Standardize only forcedTransfer, setFrozenTokens, isUserAllowed, canTransfer, getFrozenTokens, and their events and errors. |
| Flexible compliance | Leave internal checks unconstrained while providing consistent external query mechanisms. | Define read functions isUserAllowed, canTransfer, and getFrozenTokens. Leave internal logic to each implementation. |
| Compatibility | Coexist with existing ERC20, ERC721, and ERC1155 standards. | Add an interface layer over the base standards. |
| Enforcement rules | Standardize operations required for regulatory compliance and recovery procedures. | Define forcedTransfer and setFrozenTokens as mandatory functions and require access control. |
| ERC165 | Enable implementations to declare interface support. | Report support through supportsInterface. |
Minimalism
ERC7943 defines only functionality commonly required for RWAs.
It does not mandate additional role designs, specific identity mechanisms, or metadata specifications.
The errors are also limited to those necessary for the functionality introduced.
Specifically, ERC7943NotAllowedUser handles user authorization, and ERC7943InsufficientUnfrozenBalance handles insufficient balances after accounting for freezing.
This allows external callers to identify more precisely the conditions and reasons for a failure.
The Frozen and ForcedTransfer events reliably notify external systems of unusual transfers, such as seizures, and changes in freezing state.
The design pays particular attention to the emission order relative to the underlying token's Transfer event so that off-chain indexers can accurately account for seizures and frozen amounts.
Flexible compliance
isUserAllowed, canTransfer, and getFrozenTokens are read functions for inspecting the contract's compliance policies and freezing state externally.
Each implementation is free to decide how permission is determined, using strategies such as on-chain or off-chain KYC, blocklists, transfer restrictions, or time-based rules.
Compatibility
ERC7943 is an interface layer placed over existing ERC20, ERC721, and ERC1155 standards.
Existing wallets and block explorers can continue interacting with the base standard's functions.
The implementation enforces restrictions through isUserAllowed, canTransfer, and getFrozenTokens, but wallets and protocols must explicitly integrate the ERC7943 features to take full advantage of them.
Necessary enforcement rules
Forced transfers and freezing/unfreezing are unavoidable real-world requirements for RWAs.
The standard therefore specifies forcedTransfer and setFrozenTokens and makes access control mandatory.
For example, forcedTransfer can bypass ordinary transfer checks.
However, when modifying freezing state, the events must follow the required order: the freeze change (Frozen) followed by the base Transfer event.
Adoption of ERC165
Implementing ERC165 allows external callers to detect support for ERC7943 safely.
Protocols can check supportsInterface to determine whether to handle the token as an RWA-compatible token.
How this works in practice
DeFi protocols such as automated market makers (AMMs) and lending platforms can use isUserAllowed and canTransfer to perform preliminary checks against an ERC7943-compatible ERC20 token.
Enforcement operations (forcedTransfer and setFrozenTokens) can be automated by third-party operators or external protocols to implement programmable compliance.
Each token can also include asset-specific extensions, such as on-chain identity integration, history-based functionality (for example, dividends), or metadata for semi-fungible tokenization.
Extensibility
ERC7943 provides primitives required for regulated assets, while other functionality can be added freely as extensions. For example, if management operations such as setFrozenTokens must include legal evidence (legal proof), a separate function can process the evidence together with the operation in a batch.
ComplianceOperator
contract ComplianceOperator is IERC7943MultiToken {
// ... Implement the necessary state variables, constructor, access control, etc. ...
function setFrozenTokensWithProof(
address user,
uint256 tokenId,
uint256 amount,
bytes calldata legalProof
) public {
/// Verify and record legalProof here, etc.
token.setFrozenToken(user, tokenId, amount);
}
}An example of part of an extension contract that attaches a legal basis (legalProof) to a freezing operation.
It performs an operation equivalent to setFrozenTokens with additional supporting evidence.
This facilitates integration with external compliance processes, for example by combining verification of signed orders with recording hashes for evidence stored off-chain.
Parameters
user- Address subject to freezing.
tokenId- Target token ID.
amount- Amount after freezing.
legalProof- Byte array containing legal evidence, such as a signed order.
setFrozenTokensWithProof
function setFrozenTokensWithProof(
address user,
uint256 tokenId,
uint256 amount,
bytes calldata legalProof
) public {
/// do anything with `legalProof`
token.setFrozenToken(user, tokenId, amount);
}Sets the frozen amount together with a legal basis.
The function receives data associated with a regulator's or court's order as legalProof, verifies and records it, and delegates the actual freezing operation.
Implementations must appropriately incorporate access control (such as role-based access control), availability of the token.setFrozenTokens call, event emission, and error handling.
Arguments
user- Address subject to freezing.
tokenId- Token ID subject to freezing.
amount- Frozen amount to set.
legalProof- Legal evidence data.
- Used for verification and audit records.
Combining multicall and pausing (Pausable)
Using a multicall pattern such as the one described in ERC6357, ERC7943 primitives (including forcedTransfer and setFrozenTokens) and additional functionality can be combined in a single transaction.
For greater platform security, pausing (Pausable) can also be implemented in modifiers or functions, making the paused state explicit and consistent with the return value (false) of canTransfer.
Naming rationale
Names prioritize semantic consistency and neutrality in the RWA domain. Alignment with existing standards is also considered, reducing learning costs and improving interoperability.
| Name | Rationale |
|---|---|
forcedTransfer |
A neutral operation name independent of its motivation (seizure, recovery, etc.). It describes only the fact that assets are forcibly transferred. The naming follows ERC3643 for consistency across RWA standards. |
canTransfer |
Matches terminology widely used in ERC3643 and ERC7518, reducing the cognitive overhead of implementation and integration. |
setFrozenTokens / getFrozenTokens |
Directly express management of transfer restrictions and align with the naming pattern used by ERC3643. |
| Unified freezing functionality | Rather than separating freeze and unfreeze, use one overwriting setter and one event (Frozen), keeping the specification simple. |
| Choice of the term "Frozen" | Neutral terminology that applies consistently to fungible assets (amounts) and non-fungible assets (states). |
ERC7943InsufficientUnfrozenBalance |
Accurately describes the condition of an insufficient unfrozen balance. Its prefix and subject are clear, in accordance with ERC6093 guidelines. |
Event ordering and examples
When forcedTransfer modifies the freezing state while transferring assets, it is important to emit the freeze change (Frozen) before the base standard's transfer event.
For example, with ERC721 or ERC1155, where external calls may occur on the receiving side, updating the unfrozen amount first is also advantageous for reentrancy protection.
Off-chain indexers can account for transfers accurately by establishing the change in frozen amount before processing the transfer.
Frozen
event Frozen(address indexed user, uint256 amount);Emitted when a user's frozen amount is set or modified.
It indicates that setFrozenTokens has overwritten the frozen amount for a particular user. This helps off-chain accounting and auditing systems track frozen amounts at a particular point in time.
Parameters
user- Address of the relevant user.
amount- Total frozen amount after the change.
ForcedTransfer
event ForcedTransfer(address indexed from, address indexed to, uint256 amount);Emitted when a forced transfer takes place. It indicates that assets were forcibly transferred by an authorized party, rather than through an ordinary user-initiated transfer. It is used to identify special cases, including seizures and recovery operations.
Parameters
from- Address from which assets are withdrawn.
to- Receiving address.
amount- Amount forcibly transferred.
Compatibility
ERC7943 is a new interface standard and does not rewrite ERC20, ERC721, or ERC1155 themselves.
Existing wallets and explorers can continue accessing the base standard's functionality as before.
The implementation then incorporates the results of isUserAllowed, canTransfer, and getFrozenTokens internally, enforcing conditions under which transfer or minting is prohibited.
However, fully utilizing ERC7943's additional features (forced transfers, frozen amount settings, detailed errors, and others) requires explicit support from the integration layer, including wallets, protocols, and indexers.
For example, AMMs and lending protocols can call isUserAllowed or canTransfer when providing liquidity or borrowing, checking eligibility beforehand.
Indexers process Frozen, ForcedTransfer, and base-standard events in order to reconstruct frozen amounts and seizure histories accurately.
Review of representative functions
isUserAllowed
function isUserAllowed(address user) external view returns (bool allowed);Returns whether a user is authorized to perform operations. The determination is made against internal policies such as KYC, KYB, AML, allowlists, and blocklists. It is a read function and does not modify storage.
Arguments
user- Address to check.
Return value
allowedtrueif permitted,falseotherwise.
canTransfer
function canTransfer(address from, address to, uint256 amountOrTokenId) external view returns (bool allowed);Returns whether the specified transfer is currently possible. The decision includes checking frozen amounts (whether the transfer is within the unfrozen amount), user eligibility, the paused state, and other restrictions such as limits or blocklists. It is a read function and does not modify storage.
Arguments
from- Sending address.
to- Receiving address.
amountOrTokenId- Amount for ERC20 or ERC1155,
tokenIdfor ERC721.
- Amount for ERC20 or ERC1155,
Return value
allowedtrueif possible,falseotherwise.
getFrozenTokens
function getFrozenTokens(address user[, uint256 tokenId]) external view returns (uint256 amountOrStatus);Returns the freezing state for a user and, where applicable, a tokenId.
It returns an amount for ERC20 and ERC1155 (allowing the difference from the unfrozen amount to be determined) and a flag indicating whether the token is frozen for ERC721.
It is a read function and does not modify storage.
Arguments
user- Target user.
tokenId(for ERC721/1155)- Target token ID.
Return value
amountOrStatus- Frozen amount for ERC20 and ERC1155, freezing flag for ERC721.
setFrozenTokens
function setFrozenTokens(address user[, uint256 tokenId], uint256 amountOrStatus) external;Sets the frozen amount or freezing flag.
The new setting overwrites the existing value.
Only authorized parties may call it. The Frozen event is emitted upon execution.
Arguments
user- Target user.
tokenId(for ERC721/1155)- Target token ID.
amountOrStatus- Amount for ERC20 and ERC1155, boolean for ERC721.
forcedTransfer
function forcedTransfer(address from, address to[, uint256 tokenId], uint256 amountOrOne) external;Allows an authorized party to forcibly transfer assets.
It transfers assets by directly modifying internal balances or ownership.
It bypasses canTransfer checks.
It updates the freezing state first when necessary and emits events in the appropriate order: Frozen → base transfer event → ForcedTransfer.
An isUserAllowed check must always be performed for to.
Arguments
from- Address from which assets are withdrawn.
to- Receiving address.
tokenId(for ERC721/1155)- Target token ID.
amountOrOne- Amount for ERC20 and ERC1155, 1 (a single token) for ERC721.
Reference implementation
ERC20
pragma solidity ^0.8.29;
/* required imports ... */
contract uRWA20 is Context, ERC20, AccessControlEnumerable, IERC7943Fungible {
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");
bytes32 public constant ENFORCER_ROLE = keccak256("ENFORCER_ROLE");
bytes32 public constant WHITELIST_ROLE = keccak256("WHITELIST_ROLE");
mapping(address user => bool whitelisted) public isWhitelisted;
mapping(address user => uint256 amount) internal _frozenTokens;
event Whitelisted(address indexed account, bool status);
error NotZeroAddress();
constructor(string memory name, string memory symbol, address initialAdmin) ERC20(name, symbol) {
/* give initialAdmin necessary roles ...*/
}
function canTransfer(address from, address to, uint256 amount) public virtual view returns (bool allowed) {
if (balanceOf(from) < _frozenTokens[from]) return;
if (amount > balanceOf(from) - _frozenTokens[from]) return;
if (!isUserAllowed(from) || !isUserAllowed(to)) return;
allowed = true;
}
function isUserAllowed(address user) public virtual view returns (bool allowed) {
if (isWhitelisted[user]) allowed = true;
}
function getFrozenTokens(address user) external view returns (uint256 amount) {
amount = _frozenTokens[user];
}
function changeWhitelist(address account, bool status) external onlyRole(WHITELIST_ROLE) {
require(account != address(0), NotZeroAddress());
isWhitelisted[account] = status;
emit Whitelisted(account, status);
}
/* standard mint and burn functions with access control ...*/
function setFrozenTokens(address user, uint256 amount) public onlyRole(ENFORCER_ROLE) {
_frozenTokens[user] = amount;
emit Frozen(user, amount);
}
function forcedTransfer(address from, address to, uint256 amount) public onlyRole(ENFORCER_ROLE) {
require(isUserAllowed(to), ERC7943NotAllowedUser(to));
_excessFrozenUpdate(from, amount);
super._update(from, to, amount);
emit ForcedTransfer(from, to, amount);
}
function _excessFrozenUpdate(address user, uint256 amount) internal {
uint256 unfrozenBalance = _unfrozenBalance(user);
if(amount > unfrozenBalance && amount <= balanceOf(user)) {
// Protect from underflow: if amount > balanceOf(user) the call will revert in super._update with insufficient balance error
_frozenTokens[user] -= amount - unfrozenBalance; // Reduce by excess amount
emit Frozen(user, _frozenTokens[user]);
}
}
function _unfrozenBalance(address user) internal view returns(uint256 unfrozenBalance) {
unfrozenBalance = balanceOf(user) < _frozenTokens[user] ? 0 : balanceOf(user) - _frozenTokens[user];
}
function _update(address from, address to, uint256 amount) internal virtual override {
if (from != address(0) && to != address(0)) { // Transfer
require(amount <= balanceOf(from), IERC20Errors.ERC20InsufficientBalance(from, balanceOf(from), amount));
uint256 unfrozenBalance = _unfrozenBalance(from);
require(amount <= unfrozenBalance, ERC7943InsufficientUnfrozenBalance(from, amount, unfrozenBalance));
require(canTransfer(from, to, amount), "ERC7943: transfer not allowed");
} else if (from == address(0)) { // Mint
require(isUserAllowed(to), ERC7943NotAllowedUser(to));
} else { // Burn
_excessFrozenUpdate(from, amount);
}
super._update(from, to, amount);
}
function supportsInterface(bytes4 interfaceId) public view virtual override(AccessControlEnumerable, IERC165) returns (bool) {
return interfaceId == type(IERC7943Fungible).interfaceId ||
interfaceId == type(IERC20).interfaceId ||
super.supportsInterface(interfaceId);
}
}ERC721
pragma solidity ^0.8.29;
/* required imports ... */
contract uRWA721 is Context, ERC721, AccessControlEnumerable, IERC7943NonFungible {
/* same definitions, constructor and changeWhitelist function as before ...*/
mapping(address user => mapping(uint256 tokenId => bool frozen)) internal _frozenTokens;
function isUserAllowed(address user) public view virtual override returns (bool allowed) {
if (isWhitelisted[user]) allowed = true;
}
function canTransfer(address from, address to, uint256 tokenId) public view virtual override returns (bool allowed) {
address owner = _ownerOf(tokenId);
if (owner != from || owner == address(0)) return;
if (!isUserAllowed(from) || !isUserAllowed(to)) return;
if (_frozenTokens[from][tokenId]) return;
allowed = true;
}
function getFrozenTokens(address user, uint256 tokenId) external view returns (bool frozenStatus) {
frozenStatus = _frozenTokens[user][tokenId];
}
function setFrozenTokens(address user, uint256 tokenId, bool frozenStatus) public onlyRole(ENFORCER_ROLE) {
require(user == ownerOf(tokenId), IERC721Errors.ERC721InvalidOwner(user));
_frozenTokens[user][tokenId] = frozenStatus;
emit Frozen(user, tokenId, frozenStatus);
}
function forcedTransfer(address from, address to, uint256 tokenId) public virtual override onlyRole(ENFORCER_ROLE) {
require(to != address(0), ERC721InvalidReceiver(address(0)));
require(isUserAllowed(to), ERC7943NotAllowedUser(to));
_excessFrozenUpdate(from , tokenId);
super._update(to, tokenId, address(0)); // Skip _update override
ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, "");
emit ForcedTransfer(from, to, tokenId);
}
function _excessFrozenUpdate(address from, uint256 tokenId) internal {
_validateCorrectOwner(from, tokenId);
if(_frozenTokens[from][tokenId]) {
_frozenTokens[from][tokenId] = false; // Unfreeze the token if it was frozen
emit Frozen(from, tokenId, false);
}
}
function _validateCorrectOwner(address claimant, uint256 tokenId) internal view {
address currentOwner = ownerOf(tokenId);
require(currentOwner == claimant, ERC721IncorrectOwner(claimant, tokenId, currentOwner));
}
/* standard mint function with access control ...*/
function burn(uint256 tokenId) external virtual onlyRole(BURNER_ROLE) {
address previousOwner = _update(address(0), tokenId, _msgSender());
if (previousOwner == address(0)) revert ERC721NonexistentToken(tokenId);
}
function _update(address to, uint256 tokenId, address auth) internal virtual override returns(address) {
address from = _ownerOf(tokenId);
if (auth != address(0)) {
_checkAuthorized(from, auth, tokenId);
}
if (from != address(0) && to != address(0)) { // Transfer
_validateCorrectOwner(from, tokenId);
require(!_frozenTokens[from][tokenId], ERC7943FrozenTokenId(from, tokenId));
require(canTransfer(from, to, tokenId), "ERC7943: transfer not allowed");
} else if (from == address(0)) { // Mint
require(isUserAllowed(to), ERC7943NotAllowedUser(to));
} else { // Burn
_excessFrozenUpdate(from, tokenId);
}
return super._update(to, tokenId, auth);
}
function supportsInterface(bytes4 interfaceId) public view virtual override(AccessControlEnumerable, ERC721, IERC165) returns (bool) {
return interfaceId == type(IERC7943NonFungible).interfaceId ||
super.supportsInterface(interfaceId);
}
}ERC1155
pragma solidity ^0.8.29;
/* required imports ... */
contract uRWA1155 is Context, ERC1155, AccessControlEnumerable, IERC7943MultiToken {
/* same definitions, constructor and changeWhitelist function as before ...*/
mapping(address user => mapping(uint256 tokenId => uint256 amount)) internal _frozenTokens;
function canTransfer(address from, address to, uint256 tokenId, uint256 amount) public view virtual override returns (bool allowed) {
if (balanceOf(from, tokenId) < _frozenTokens[from][tokenId]) return;
if (balanceOf(from, tokenId) < amount) return;
if (!isUserAllowed(from) || !isUserAllowed(to)) return;
if (amount > balanceOf(from, tokenId) - _frozenTokens[from][tokenId]) return;
allowed = true;
}
function isUserAllowed(address user) public view virtual override returns (bool allowed) {
if (isWhitelisted[user]) allowed = true;
}
function getFrozenTokens(address user, uint256 tokenId) external view returns (uint256 amount) {
amount = _frozenTokens[user][tokenId];
}
function setFrozenTokens(address user, uint256 tokenId, uint256 amount) public onlyRole(ENFORCER_ROLE) {
_frozenTokens[user][tokenId] = amount;
emit Frozen(user, tokenId, amount);
}
function forcedTransfer(address from, address to, uint256 tokenId, uint256 amount) public onlyRole(ENFORCER_ROLE) {
require(isUserAllowed(to), ERC7943NotAllowedUser(to));
// Reimplementing _safeTransferFrom to avoid the check on _update
if (to == address(0)) {
revert ERC1155InvalidReceiver(address(0));
}
if (from == address(0)) {
revert ERC1155InvalidSender(address(0));
}
_excessFrozenUpdate(from, tokenId, amount);
uint256[] memory ids = new uint256[](1);
uint256[] memory values = new uint256[](1);
ids[0] = tokenId;
values[0] = amount;
super._update(from, to, ids, values);
if (to != address(0)) {
address operator = _msgSender();
if (ids.length == 1) {
uint256 id = ids[0];
uint256 value = values[0];
ERC1155Utils.checkOnERC1155Received(operator, from, to, id, value, "");
} else {
ERC1155Utils.checkOnERC1155BatchReceived(operator, from, to, ids, values, "");
}
}
emit ForcedTransfer(from, to, tokenId, amount);
}
function _excessFrozenUpdate(address user, uint256 tokenId, uint256 amount) internal {
uint256 unfrozenBalance = _unfrozenBalance(user, tokenId);
if(amount > unfrozenBalance && amount <= balanceOf(user, tokenId)) {
// Protect from underflow: if amount > balanceOf(user) the call will revert in super._update with insufficient balance error
_frozenTokens[user][tokenId] -= amount - unfrozenBalance; // Reduce by excess amount
emit Frozen(user, tokenId, _frozenTokens[user][tokenId]);
}
}
/* standard mint and burn functions with access control ...*/
function _unfrozenBalance(address user, uint256 tokenId) internal view returns(uint256 unfrozenBalance) {
unfrozenBalance = balanceOf(user, tokenId) < _frozenTokens[user][tokenId] ? 0 : balanceOf(user, tokenId) - _frozenTokens[user][tokenId];
}
function _update(address from, address to, uint256[] memory ids, uint256[] memory values) internal virtual override {
if (ids.length != values.length) {
revert ERC1155InvalidArrayLength(ids.length, values.length);
}
if (from != address(0) && to != address(0)) { // Transfer
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids[i];
uint256 value = values[i];
require(value <= balanceOf(from, id), ERC1155InsufficientBalance(from, balanceOf(from, id), value, id));
uint256 unfrozenBalance = _unfrozenBalance(from, id);
require(value <= unfrozenBalance, ERC7943InsufficientUnfrozenBalance(from, id, value, unfrozenBalance));
require(canTransfer(from, to, id, value), "ERC7943: transfer not allowed");
}
}
if (from == address(0)) { // Mint
require(isUserAllowed(to), ERC7943NotAllowedUser(to));
} else if (to == address(0)) { // Burn
for (uint256 j = 0; j < ids.length; ++j) {
_excessFrozenUpdate(from, ids[j], values[j]);
}
}
super._update(from, to, ids, values);
}
function supportsInterface(bytes4 interfaceId) public view virtual override(AccessControlEnumerable, ERC1155, IERC165) returns (bool) {
return interfaceId == type(IERC7943MultiToken).interfaceId ||
super.supportsInterface(interfaceId);
}
}Security
Access control for forcedTransfer and setFrozenTokens
Unlike ordinary token transfers, forcedTransfer and setFrozenTokens are privileged functions that allow assets to be manipulated without the user's consent.
Access control for these functions is therefore critical.
Incorrect permission management can allow third parties to transfer, freeze, or unfreeze assets arbitrarily, leading to theft or unauthorized operations. The following security design patterns are consequently recommended.
| Recommended design | Details |
|---|---|
| Multisignature (multisig) | Require approval from multiple signers, preventing operations resulting from the loss or compromise of a single key. |
| Timelock | Introduce a delay before operations execute, allowing human monitoring and intervention in the event of errors or unauthorized operations. |
These controls help avoid serious risks such as unauthorized forced transfers and arbitrary freezing.
Front-running concerns for setFrozenTokens
Like the ERC20 approve function, setFrozenTokens may be susceptible to front-running attacks.
An attacker might transfer away their assets just before a freeze takes effect, rendering the freezing operation ineffective. To address this, the standard proposes allowing an amount greater than the holder's balance to be frozen. If this approach is not adopted, and only the amount currently held can be frozen, the risk increases that the attacker moves their assets before the freeze can take effect.
A more secure design could also introduce functionality for increasing or decreasing freezing state incrementally. Extensions such as making freezes effective after a specified number of blocks rather than immediately, or locking assets progressively over time, are possible approaches.
| Countermeasure | Details |
|---|---|
| Do not limit the frozen amount to the balance | Allow amounts above current holdings to be frozen temporarily to deter evasion. |
| Introduce incremental freezing functionality | Gradually increase or release freezing restrictions to minimize the impact of front-running. |
Correctness of implementation logic
Interface functions such as isUserAllowed, canTransfer, forcedTransfer, and getFrozenTokens implement core logic for determining whether asset transfers are permitted and enforcing compliance.
Defects in their internal implementations can produce unintended behavior.
- Incorrect conditional logic may permit transfers that should be prohibited.
- Conversely, legitimate transactions may be incorrectly rejected.
- Incorrect updates to frozen amounts may cause inconsistent balances or double-spending (using the same asset twice).
All anticipated scenarios must therefore be simulated when designing and testing each function.
The return value of canTransfer in particular directly affects the behavior of DeFi protocols and wallets, requiring careful verification.
General contract-wide security measures
Contracts implementing ERC7943 must also follow general smart contract security design practices. Protecting against reentrancy attacks is particularly important for token transfer functions that make numerous external calls.
| Recommended pattern | Details |
|---|---|
| Reentrancy Guard | Prevent the same function from being executed again following an external call. |
| Checks-Effects-Interactions pattern | Perform state updates (effects) before external calls (interactions) to minimize side effects. |
| Safe management of external calls | Particular care is needed for tokens such as ERC721 and ERC1155, which call receiver hooks such as onERC721Received. The hooks may trigger unintended reexecution or external calls. |
Introducing a reentrancy guard can effectively prevent reentrancy attacks and state manipulation caused by these hook calls.
For functions that modify storage, particularly forcedTransfer and setFrozenTokens, it is important to follow the operation order of checks, updates, and calls.
References
Dario Lo Buglio (@xaler5), "ERC-7943: uRWA - Universal Real World Asset Interface [DRAFT]," Ethereum Improvement Proposals, no. 7943, June 2025. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7943.
Conclusion
This article covered ERC7943, a proposal to standardize the uRWA (Universal Real World Asset Interface) for compliance checks, transfer controls, forced enforcement, and other functionality needed when tokenizing real-world assets. I hope it was useful.

