Can One Unverified Wallet Stop an ERC-3643 Batch Mint?
An ERC-3643 batch mint is one agent transaction that calls mint once per investor in a plain loop with no skip mode. In the T-REX reference code, one unverified wallet, one failed compliance check or one zero amount reverts the whole batch, so no investor in it is minted. A mismatched amounts array can also revert the batch or silently drop allocations.
TL;DR — Key Takeaways
- ✓The answer: Yes. T-REX batchMint is a plain loop over mint with no try/catch and no skip mode. One row that fails isVerified or canTransfer reverts the whole transaction, so no investor in the batch is minted (code reading).
- ✓The arrays: The loop is bounded by the address array only. A shorter amounts array reverts with panic 0x32; a longer one is ignored past the last address, and the call still succeeds.
- ✓The trap: Rows interact. A per-identity cap counts earlier rows in the same batch, so two rows that each pass a pre-check can fail together.
- ✓The control: Validate arrays, check each row with the same view functions, simulate the full batch, split large lists, and reconcile mint events against the allocation register.

Does one failed row revert an ERC-3643 batch mint?
Yes. In the T-REX reference Token.sol, batchMint calls mint once per row inside a single transaction, and mint uses two require checks. When any row fails, the EVM undoes every earlier mint in the same call.
The batch functions in T-REX are thin wrappers. batchMint(address[] _toList, uint256[] _amounts) runs for (i = 0; i < _toList.length; i++) mint(_toList[i], _amounts[i]). There is no try/catch, no success flag per row and no event that names a skipped investor. mint itself is onlyAgent and then requires isVerified(_to) (“Identity is not verified.”) and canTransfer(address(0), _to, _amount) (“Compliance not followed”) before it writes the balance and calls compliance.created. This is the issuance side of the ERC-3643 permission model described in the guide to RWA token standards: the token refuses to place units in a wallet that the registry and modules do not accept, and in a batch that refusal applies to everyone in the call.
“function batchMint(address[] calldata _toList, uint256[] calldata _amounts) external override { for (uint256 i = 0; i < _toList.length; i++) { mint(_toList[i], _amounts[i]); } }”
Token.sol, batchMint, TokenySolutions/T-REX main @ f1390127
The revert behaviour is standard Solidity. A failed require raises a state-reverting exception, and because mint is called internally, there is no sub-call boundary where the batch could catch it. The transaction fails as a unit. Gas consumed up to the failing row is still charged.
“Solidity uses state-reverting exceptions to handle errors. Such an exception undoes all changes made to the state in the current call (and all its sub-calls) and flags an error to the caller.”
Solidity documentation, Error handling: Assert, Require, Revert and Exceptions
All behaviour in this article comes from reading the code and the Solidity rules above. We did not run it on a fork or testnet.
Which checks can fail one row and stop the batch?
Five conditions in the mint path revert a row: a caller without the agent role, an unverified receiver, a compliance module that says no, a zero amount, and a missing amount. Each one reverts every row in the call.
| Row condition | Where it fails | Revert reason (code reading) |
|---|---|---|
| Caller is not an agent of the token | onlyAgent on mint, first row | “AgentRole: caller does not have the Agent role” |
| Wallet not registered, or a required claim missing, revoked or rejected by its issuer | IdentityRegistry.isVerified | “Identity is not verified.” |
| Any bound module returns false, for example a holding cap or a restricted receiver country | ModularCompliance.canTransfer | “Compliance not followed” |
| Amount is 0 | ModularCompliance.created, after the balance write | “invalid argument - no value mint” |
| Amounts array shorter than the address array | Read of _amounts[i] | Panic 0x32 (out-of-bounds index) |
The second row is the one that reaches most operations teams. isVerified returns false when the wallet has no identity in the registry, or when no trusted issuer holds a valid claim for one of the required topics. Whether an expired claim counts as invalid depends on the claim issuer contract, a dependency covered in the KYC expiry article listed below. The third row depends on which modules the token has bound. A receiver-country rule rejects mints to a restricted wallet, as set out in what happens when an ERC-3643 investor changes country; this page covers what that one rejection does to the rest of the batch.
Illustrative example (invented numbers, not a real issuer). A fund closes a subscription round for 200 investors and submits one batchMint. Row 147 belongs to an investor whose KYC claim was revoked by the claim issuer the day before. Rows 1 to 146 execute, row 147 reverts, and the transaction fails. On-chain, none of the 200 investors holds new units, the agent paid gas for 146 mints, and the error message names the reason but not the row.
Which other T-REX batch functions are all-or-nothing?
All seven. batchTransfer, batchForcedTransfer, batchMint, batchBurn, batchSetAddressFrozen, batchFreezePartialTokens and batchUnfreezePartialTokens are each a loop over the single-row function, so one failing row reverts every row.
| Batch function | Per-row checks that can revert | Runs while paused? |
|---|---|---|
batchMint | Agent role, isVerified(to), canTransfer, amount above 0, module mint hooks | Yes |
batchTransfer | Sender or receiver frozen, unfrozen balance, isVerified(to), canTransfer, amount above 0 | No, reverts on row 1 |
batchForcedTransfer | Agent role, sender balance, isVerified(to), module transfer hooks; no canTransfer | Yes |
batchBurn | Agent role, balance at least the amount, module burn hooks | Yes |
batchSetAddressFrozen | Agent role only | Yes |
batchFreezePartialTokens | Agent role, frozen plus amount not above balance | Yes |
batchUnfreezePartialTokens | Agent role, amount not above frozen tokens | Yes |
batchTransfer is the holder-side version, and its balance check runs per row against the sender balance left by earlier rows. A sender who lists 10 transfers that add up to more than the unfrozen balance fails on the first row that overdraws, and the earlier nine are undone with it. batchForcedTransfer skips the canTransfer pre-check, but it still requires a verified receiver, and the compliance transferred hook still runs each module's post-transfer action, which can revert. A forced batch is not a way around one bad row.
What happens when the address and amount arrays differ in length?
The loop counts only the address array. A shorter amounts array reverts the batch with panic code 0x32; a longer one succeeds and the extra amounts are never read, so those allocations do not reach the chain and no error is raised.
None of the seven batch functions compares array lengths. batchForcedTransfer takes three arrays and bounds its loop by _fromList.length, so a short _toList or _amounts panics, and long ones are cut off. Solidity 0.8 checks every array index, which is why the short case fails loudly.
“0x32: If you access an array, bytesN or an array slice at an out-of-bounds or negative index (i.e. x[i] where i >= x.length or i < 0).”
Solidity documentation, Panic error codes
The long case is the one that reaches a reconciliation break. If a script builds the address list from one source and the amounts from another, and one investor drops out of the address list, every amount after that point shifts by one row and the last amount is discarded. The call succeeds and every Transfer event looks valid, but most investors after the gap receive the wrong number of units. A length check and a per-row pairing check in the submission script prevent it; the contract will not.
Why can a row that passed a pre-check still fail inside the batch?
Because each mint updates state that the next row is checked against. A per-identity cap counts earlier rows in the same batch, so two rows that each pass alone can fail together. A claim or module change between check and inclusion has the same effect.
MaxBalanceModule shows the pattern. Its moduleCheck compares the identity's tracked balance plus the new amount with the cap. Its moduleMintAction, called through compliance.created after each mint, adds the amount to that tracked balance. When the batch reaches a second row for the same identity, the check sees the first row's units. An investor with two wallets under one ONCHAINID, or one wallet listed twice, can pass two separate pre-checks and still revert the batch. How the module keeps that ledger is covered in adding a holding cap to a live ERC-3643 token.
“_IDBalance[msg.sender][_idTo] += _value; if (_IDBalance[msg.sender][_idTo] > _maxBalance[msg.sender]) revert MaxBalanceExceeded(msg.sender, _value);”
MaxBalanceModule.sol, moduleMintAction, TokenySolutions/T-REX main @ f1390127
Time is the other gap. A pre-check reads state at one block; the batch executes at a later one. A claim issuer can revoke a claim, the compliance owner can bind a module or change a list, and a registry agent can delete an identity in between. The closer the final check is to submission, the smaller that window.
How should an operator pre-flight an ERC-3643 batch mint?
Validate the arrays, group rows by identity, check each row with the same view functions the token calls, simulate the whole batch, then submit and reconcile. A failed simulation names only the first bad row, so the per-row pass is what produces the full exception list.
| Step | Check | Catches |
|---|---|---|
| 1. Shape | Equal array lengths; no zero address; no zero amount; each row paired by investor ID, not by position | Panic 0x32, silent truncation, shifted amounts, zero-value revert |
| 2. Caller | isAgent(signer) on the token | Agent role revert on row 1 |
| 3. Group | Resolve identityRegistry.identity(wallet); merge or flag duplicate wallets and identities | Intra-batch cap failures |
| 4. Per row | identityRegistry.isVerified(to) and compliance.canTransfer(address(0), to, amountPerIdentity) at one block | Unverified wallets, module rejections, with the row named |
| 5. Hold | Remove failing rows to a hold list with the reason and owner | One investor blocking the rest |
| 6. Simulate | eth_call of the final batchMint from the agent address | Anything the per-row pass missed, including hook reverts |
| 7. Reconcile | Match each Transfer(address(0), to, amount) event to the allocation register; check the totalSupply change | Rows lost to truncation, wrong amounts, missing batches |
The hold list is the part that changes the investor experience. Without it, one revoked claim delays every investor in the round until someone finds the row by hand. With it, 199 investors are minted on time and one investor gets a clear request to renew KYC. The record of who was held, why, and when they were minted later is also what an auditor will ask for when the register and the chain disagree for a few days.
A step 4 check with an amount per row is not enough for stateful modules. Sum the amounts per identity first, as step 3 does, and check that total. For a token whose agent keys sit in a multisig, the simulation in step 6 should run against the exact calldata the signers will approve.
How many rows can one batch mint hold?
No fixed number. The interface warns that a long list can run out of gas, and the cost per row grows with the number of required claim topics, trusted issuers and bound modules, up to 25 modules per compliance contract. Measure on a fork.
“IMPORTANT : THIS TRANSACTION COULD EXCEED GAS LIMIT IF `_toList.length` IS TOO HIGH, USE WITH CARE OR YOU COULD LOSE TX FEES WITH AN "OUT OF GAS" TRANSACTION”
IToken.sol, batchMint NatSpec, TokenySolutions/T-REX main @ f1390127
Each row calls isVerified, which loops over required claim topics and their trusted issuers and makes external calls to each claim issuer. It then calls canTransfer, which runs moduleCheck on every bound module, and created, which runs moduleMintAction on every bound module. ModularCompliance.addModule stops at 25 modules (“cannot add more than 25 modules”). Two tokens with the same holder list can therefore have very different safe batch sizes. Measure the gas of a representative batch on a fork of the live chain, keep a margin below the block gas limit, and split the list into chunks that each reconcile on their own. Smaller chunks also limit the damage when one row slips through: one chunk fails, not the whole round.
Who does this apply to, and what was not checked?
It applies to transfer agents and token operators who run closings, distributions in kind or migrations through T-REX batch functions. The successor ERC-3643/ERC-3643 repository ships an identical Token.sol, so the same behaviour applies there.
All code was read from the TokenySolutions/T-REX repository at commit f1390127 on its main branch. That repository is archived and points to ERC-3643/ERC-3643, whose Token.sol at commit 2f0704de is byte-identical. Other ERC-3643 implementations may add a skip mode, a length check or per-row events; check the deployed bytecode, not the standard. The all-or-nothing design is not a vulnerability: it guarantees that a round never lands half-minted, and we know of no incident in which it was exploited against a permissioned RWA token. The cost is operational.
We did not execute any batch on a fork or testnet; the revert, panic and truncation behaviour is code reading plus the Solidity rules quoted above. We did not check whether any hosted issuance platform pre-checks batches before submission, and we make no claim either way.
Sources: Token.sol, IToken.sol, ModularCompliance.sol, MaxBalanceModule.sol and IdentityRegistry.sol, all TokenySolutions/T-REX main @ f1390127 (repository archived); ERC-3643/ERC-3643 Token.sol @ 2f0704de; Solidity documentation, error handling.
Frequently Asked Questions
If one investor in an ERC-3643 batchMint is not verified, are the others minted?
No, in code reading. batchMint calls mint for each row inside one transaction, and mint uses require for isVerified and canTransfer. A failed require reverts the whole transaction, including the rows already minted earlier in the loop. Nobody in the batch receives tokens, no Transfer events remain, and the agent still pays for the gas used up to the failure.
Does the T-REX batchMint check that both arrays have the same length?
No. The loop runs while i is less than _toList.length and reads _amounts[i] with no length check. If amounts is shorter, the read past its end causes a Solidity panic with code 0x32 and the batch reverts. If amounts is longer, the extra values are never read and the call succeeds, so those allocations never reach the chain. This follows from the code; we did not execute it.
Can a batch mint run while an ERC-3643 token is paused?
Yes. In the T-REX reference Token.sol, mint carries onlyAgent but no whenNotPaused modifier, so batchMint proceeds while holder transfers are paused. batchTransfer does not: it loops over transfer, which is whenNotPaused, so a paused token reverts the whole batch transfer on the first row. Pause is therefore not a control over agent issuance.
Why did a batch fail when every row passed a pre-check?
Because earlier rows change state that later rows are checked against. A stateful module such as MaxBalanceModule adds each mint to the identity total before the next row runs. Two rows for one identity, or two wallets of one investor, can each pass alone and fail together. A claim revoked or a module changed between the check and the block has the same effect.
Is the all-or-nothing batch behaviour a vulnerability in ERC-3643?
No. It is a design choice with an operational cost. Atomic batches mean a closing never lands half-minted, which keeps the register simple. The cost is that one bad row blocks everyone. We know of no incident in which it was used against a permissioned RWA token. The fix is process: validate rows, simulate the batch, and reconcile what was minted.
Related Articles
Can Expired KYC Make an ERC-3643 Position Unsellable?
ERC-3643 transfer checks can turn expired or revoked identity claims into a liveness dependency for tokenized securities.
Can Token Decimals Corrupt an RWA Subscription Amount?
How a decimals mismatch between the subscription register and the token contract turns into wrong on-chain allocations.
Who Really Controls an ERC-3643 Token's Agent Keys?
ERC-3643 agent keys control privileged functions that can move or freeze holdings, yet the standard requires no multisig or timelock for them.
Who Is the Transfer Agent for a Tokenized Security?
Legal ownership of a security lives in the master securityholder file, not in a wallet balance, even when a registered transfer agent keeps that file on a blockchain.