Rayls DocsRayls Custody API
Rayls Docs

Freezing Tokens

The Token Freezing/Unfreezing mechanism allows governance actors (e.g., Subnet Operators) to restrict the movement of tokens across nodes (PLs) for specific participants.

It works across multiple token standards (ERC20, ERC721, ERC1155) and validates the compliance enforcement layer of Rayls using

  • Token Freezing per participant or globally.
  • Teleporting arbitrary messages across Rayls Nodes via resource-linked smart contracts.
  • Permission enforcement, including revert logic on unauthorized transfers.

How to use

1 Freeze → Revert → Unfreeze (ERC20)

Scenario:

The operator freezes the token erc721ResourceId for RN A and erc1155ResourceId for RN B

await tokenRegistry.freezeToken(erc721ResourceId, [chainIdA]);  // for A
await tokenRegistry.freezeToken(erc1155ResourceId, [chainIdB]); // for B

Outcome:

All attempts to send messages for the frozen tokens from the two RNs will fail as expected, validating the universal freeze.

  1. Freeze for All Participants

Scenario:

The operator freezes a token (e.g., ERC20) across all RNs.

const chainIds = await participantStorage.getAllParticipantsChainIds();
await tokenRegistry.freezeToken(resourceId, chainIds);

for (const chainId of chainIds) {
  await expect(arbitraryMessagesPlX.batchTeleport(...)).to.be.rejected;

Outcome:

All attempts to send messages fail as expected, validating universal freeze.