> For the complete documentation index, see [llms.txt](https://docs.t-rex.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.t-rex.network/reference/token-suite/errors-of-the-token-suite.md).

# Errors of the token suite

Every custom error of the token suite, grouped by the contract that raises it. The errors are declared in `ErrorsLib` (`contracts/libraries/ErrorsLib.sol`). Those that belong to the standard are also declared in `ERC3643ErrorsLib`, with the same names and arguments. The errors of the ERC-20 base, of the pause, of the access manager and of ERC-7786 are OpenZeppelin's and are listed at the end.

### Common

| Error                               | Raised when                                                                                                                         |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `ZeroAddress()`                     | A required address is zero                                                                                                          |
| `ZeroValue()`                       | An amount is zero: a transfer, a mint or a burn of zero, or a validation with nothing available                                     |
| `EmptyString()`                     | A name, a symbol or a salt is empty                                                                                                 |
| `ArrayLengthMismatch()`             | The arrays of a batch call differ in length                                                                                         |
| `ArraySizeLimited(uint256 maxSize)` | More than five setting calls in `addAndSetModule`                                                                                   |
| `AuthorityMismatch()`               | Two contracts that must share an access manager do not                                                                              |
| `Deprecated()`                      | A function kept for the standard that T-REX does not serve: the country functions, the setters of the topics and issuers registries |

### Token

| Error                                                                                                                                                             | Raised when                                                                                            |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| `ComplianceNotFollowed()`                                                                                                                                         | The rules refuse a transfer or a mint                                                                  |
| `UnverifiedIdentity()`                                                                                                                                            | The recipient is not eligible                                                                          |
| `FrozenWallet(address user)`                                                                                                                                      | The sender or the recipient is frozen                                                                  |
| `AmountAboveFrozenTokens(uint256 amount, uint256 maxAmount)`                                                                                                      | An unfreeze exceeds the frozen amount                                                                  |
| `SpenderNotAllowed(address spender, address from, address to, uint256 value)`                                                                                     | The spender policy refuses the caller of `transferFrom`                                                |
| `NotLinkedIdentity(address from, address caller)`                                                                                                                 | `identityTransfer` is called by another address than the identity `from` resolves to                   |
| `DecimalsOutOfRange(uint256 decimals)`                                                                                                                            | Decimals above 18 at deployment                                                                        |
| `InvalidIdentityRegistry()`, `InvalidCompliance()`                                                                                                                | A setter receives a contract that is not a registry, not a compliance                                  |
| `ComplianceAlreadyBoundToToken()`                                                                                                                                 | The compliance given to `setCompliance` serves another token                                           |
| `TokenCirculating()`                                                                                                                                              | The registry or the compliance is replaced, or a token is bound, while the supply is not zero          |
| `SameWalletRecovery()`, `NoTokenToRecover()`, `RecoveryNotPossible()`                                                                                             | A recovery names the same address twice, an empty address, or two addresses the registry does not know |
| `OnlyBoundCompliance()`                                                                                                                                           | A ledger function reserved to the compliance is called by another address                              |
| `InsufficientBridgedBalance(bytes wallet, uint256 balance, uint256 needed)`                                                                                       | The position of a satellite wallet is smaller than the amount to move out of it                        |
| `TransitAlreadyHeld(uint256 validationId)`, `NothingInTransit(uint256 validationId)`, `TransitAmountMismatch(uint256 validationId, uint256 held, uint256 amount)` | The in-transit amount of a validation is held twice, absent, or different from the amount settled      |
| `NotASatelliteWallet(bytes wallet)`                                                                                                                               | A wallet of the reference chain is given where a satellite wallet is required                          |

### Registry and storage

| Error                                                                         | Raised when                                                                 |
| ----------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `ClaimTopicAlreadyExists()`                                                   | A required topic is added twice                                             |
| `MaxClaimTopicsReached(uint256 max)`, `MaxTrustedIssuersReached(uint256 max)` | A limit of the registry, or of the factory at deployment, is reached        |
| `InvalidIdentityType()`                                                       | A topic is set for identity type 0                                          |
| `TrustedIssuerAlreadyExists()`, `NotATrustedIssuer()`                         | A trusted issuer is added twice, or is unknown                              |
| `TrustedClaimTopicsCannotBeEmpty()`, `ClaimTopicsCannotBeEmpty()`             | A trusted issuer is added, or updated, with no topic                        |
| `EligibilityChecksDisabledAlready()`, `EligibilityChecksEnabledAlready()`     | The switch is already in the requested state                                |
| `InvalidIdentityRegistryStorage()`, `RegistryNotBoundToStorage()`             | A new storage does not support the interface, or does not list the registry |
| `InvalidClaimPattern()`                                                       | At deployment, the issuers and their topics differ in length                |
| `AddressAlreadyStored()`, `AddressNotYetStored()`                             | A registration exists already, or does not exist                            |
| `IdentityRegistryNotStored()`, `MaxIRByIRSReached(uint256 max)`               | A registry to unbind is not bound, or 300 registries are bound              |

### Compliance and modules

| Error                                                                                           | Raised when                                                                                                       |
| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `AddressNotATokenBoundToComplianceContract()`                                                   | A function reserved to the bound token is called by another address                                               |
| `OnlyOwnerOrTokenCanCall()`, `TokenNotBound()`                                                  | `bindToken` or `unbindToken` by an unauthorized caller, or for a token that is not bound                          |
| `MaxModulesReached(uint256 maxValue)`, `ModuleAlreadyBound()`, `ModuleNotBound()`               | 25 modules are bound, a module is bound twice, or is not bound                                                    |
| `ComplianceNotSuitableForBindingToModule(address module)`                                       | A module refuses the compliance                                                                                   |
| `ModuleHasNoType()`, `DuplicateModuleType(uint8 moduleType)`                                    | A module declares no type, or one type twice                                                                      |
| `InvalidCompliancePattern()`                                                                    | At deployment, more settings than modules                                                                         |
| `InsufficientPosition(address identity, uint256 held, uint256 amount)`, `FromAndToAreTheSame()` | `fixPosition` moves more than the position, or between one identity and itself                                    |
| `OnlyBoundComplianceCanCall()`, `OnlyComplianceContractCanCall()`                               | A module function is called by an address that is not a bound compliance, or not the compliance concerned         |
| `ComplianceAlreadyBound()`, `ComplianceNotBound()`, `ModuleStillBound()`                        | A module is asked to bind a compliance twice, to serve one it does not know, or to unbind one that still lists it |
| `SpenderAlreadyAllowed(bytes spender)`, `SpenderNotListed(bytes spender)`                       | The list of named operators already has, or lacks, the spender                                                    |

### Transfer validation

| Error                                                                                                                             | Raised when                                                             |
| --------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `InvalidRequestedRange(uint256 requestedMin, uint256 requestedMax)`                                                               | The minimum is above the maximum                                        |
| `SenderNotOnSatellite(bytes wallet)`                                                                                              | `from` is on the reference chain                                        |
| `UnverifiedWallet(bytes wallet)`                                                                                                  | `from` resolves to no identity, or `to` is not eligible                 |
| `NotAuthorizedForWallet(address caller, bytes wallet)`                                                                            | The caller is neither the identity of `from` nor an `AGENT`             |
| `ValidityWindowNotSet()`, `ReconciliationWindowNotSet(bytes32 chainKey)`, `ZeroDuration()`                                        | A window is missing, or set to zero                                     |
| `ValidationIssuancePaused(bytes32 chainKey)`                                                                                      | Issuance is paused for a chain involved                                 |
| `EmptyValidationRange(uint256 min, uint256 max)`                                                                                  | The available balance or the rules leave no amount to authorize         |
| `ValidationSpenderRefused(bytes spender)`                                                                                         | A `SPENDER` module refuses the named spender                            |
| `UnknownValidation(uint256 validationId)`                                                                                         | The id was never issued                                                 |
| `ValidationNotDiscardable(uint256 validationId, uint8 status)`, `ValidationNotReleasable(uint256 validationId, uint64 releaseAt)` | A discard of a validation that is not `Pending`, or before `releaseAt`  |
| `ValidationNotStuck(uint256 validationId, uint8 status)`, `ValidationNotYetResolvable(uint256 validationId, uint64 resolvableAt)` | A resolution of a validation that awaits no leg, or too early           |
| `SettlementLegMismatch(uint256 validationId)`                                                                                     | The wallets or the origin chain of a report do not match the validation |
| `SettlementOutOfBounds(uint256 validationId, uint256 amount)`                                                                     | The executed amount is outside the range                                |
| `SettlementAmountMismatch(uint256 validationId, uint256 expected, uint256 amount)`                                                | The second report does not repeat the amount of the first               |

### Messaging

| Error                                                                                                                                                   | Raised when                                                                                         |
| ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| `ChainNotOpen(bytes32 chainKey)`, `ChainNotRegistered(bytes32 chainKey)`                                                                                | A message is sent to a chain with no usable route and peer. A peer is set for a chain with no route |
| `GatewayNotTrusted(address gateway)`                                                                                                                    | A route names a gateway the network does not trust                                                  |
| `InvalidChainReference(bytes2 chainType, bytes chainReference)`, `InvalidPeer(bytes peer)`, `PeerChainMismatch(bytes32 chainKey, bytes32 peerChainKey)` | A route or a peer is malformed, or on another chain                                                 |
| `NonCanonicalInteroperableAddress(bytes envelope)`                                                                                                      | A wallet is not in the canonical ERC-7930 form                                                      |
| `SenderNotCompliance(address sender)`                                                                                                                   | A validation is dispatched by another address than the compliance                                   |
| `ValidationAlreadyRouted(uint256 validationId, bytes32 chainKey, address gateway)`                                                                      | A validation is sent again to a chain through another gateway                                       |
| `SenderNotPeer(bytes32 chainKey, bytes sender)`                                                                                                         | The author of a delivery is not the peer of its chain                                               |
| `UnsupportedMessageVersion(uint8 messageVersion)`, `MessageTypeNotInbound(MessageTypesLib.Message messageType)`                                         | A payload has another version than 1, or a type the token does not receive                          |
| `MessageAlreadyReceived(address gateway, bytes32 receiveId)`                                                                                            | A gateway delivers the same `receiveId` twice                                                       |
| `GatewayNotPinned(address gateway, uint256 validationId, bytes32 chainKey)`, `GatewayNotRouted(address gateway, bytes32 chainKey)`                      | A delivery comes through another gateway than the one expected                                      |

### Factory, versions and access

| Error                                                                                                                                             | Raised when                                                                                                                                 |
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `TokenAlreadyDeployed()`                                                                                                                          | The salt was already used                                                                                                                   |
| `MaxClaimIssuersReached(uint256 max)`                                                                                                             | More than five trusted issuers at deployment                                                                                                |
| `InvalidAccessManagerAdmin()`, `AccessManagerNotAContract(address accessManager)`                                                                 | The administrator of a new manager is the factory or the manager itself. A supplied manager has no code                                     |
| `StorageAuthorityMismatch(address identityRegistryStorage, address expected, address actual)`                                                     | A supplied storage answers to another manager                                                                                               |
| `IsolatedSuiteCannotReuseIRS()`                                                                                                                   | An isolated suite is given an existing storage                                                                                              |
| `TokenIdentityAlreadyBound(address token, address boundIdentity)`                                                                                 | The token address is already linked to another identity                                                                                     |
| `InvalidImplementationAuthority()`                                                                                                                | The authority given to the factory has a zero beacon                                                                                        |
| `EmptyImplementations()`, `VersionAlreadyPublished()`, `UnknownVersion()`, `VersionNotNewer()`                                                    | A version with a zero implementation, published twice, unknown, or not above the current one                                                |
| `DomainNotFound(uint32 domainId)`, `InvalidDomain()`                                                                                              | A domain does not exist. A role is built for domain 0 or for the platform domain                                                            |
| `NotAssigned(address target)`                                                                                                                     | A suite is commissioned for a token that has no domain                                                                                      |
| `RoleNotHeld(address account, uint64 role)`, `PendingRoleGrant(address account, uint64 role)`, `PendingDelayChange(address account, uint64 role)` | A role is carried from one domain to another for an account that does not hold it, whose grant is not effective, or whose delay is changing |

### Errors from OpenZeppelin

| Error                                                                                       | Raised when                                                                        |
| ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| `ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed)`                 | An amount exceeds the free balance, or the balance for a burn or a forced transfer |
| `ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed)`            | `transferFrom` above the allowance                                                 |
| `EnforcedPause()`, `ExpectedPause()`                                                        | An action that the pause stops. `unpause` while not paused                         |
| `AccessManagedUnauthorized(address caller)`                                                 | A restricted function is called without the role                                   |
| `ERC7786RecipientUnauthorizedGateway(address gateway, bytes sender)`                        | A delivery by a gateway the network does not trust                                 |
| `InteroperableAddressParsingError(bytes)`, `InteroperableAddressEmptyReferenceAndAddress()` | A sender that is not a valid ERC-7930 address                                      |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.t-rex.network/reference/token-suite/errors-of-the-token-suite.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
