SKIP TO CONTENT
TOKENIZATION6 minBuilding the RWA Chain · Episode 7

ERC-3643 Mint Check: Refusing Mints Above the Reserve

Your token’s supply is 900 and the latest reserve reads 1,000. Can the token itself refuse a mint of 200?

Pixel-art night scene of a coin press whose lever is chained to the level gauge of a glowing vault. The gauge reads half full and the chain holds the lever down. A wall clock hangs above the gauge.

IN 30 SECONDS

A reserve check on mint, in this sketch, is a compliance module that can refuse any mint pushing supply above the latest fresh reserve reading. In ERC-3643, it would join the compliance step every mint already goes through.

KEY TAKEAWAYS

· 3
  • An ERC-3643 mint checks identity, not reserves. A compliance module can refuse a mint that would push total supply above the latest reserve reading, if that reading is recent enough.
  • Count the token’s unit, scale decimals, reject old readings and refuse by default. Even then, the check can’t see pledged reserves, debts or a bad source.
  • SecureMintPolicy is Chainlink’s version of this check, not something I shipped.
On this page

Where a reserve check fits in an ERC-3643 mint

IN SHORT An ERC-3643 mint checks who receives the tokens, not what backs them. So I’d add the reserve check as a compliance module.

WORDS TO KNOW

Mint
Creating new tokens and adding them to the total supply.
Agent
In ERC-3643, an address the token owner trusts with actions like minting, burning (destroying tokens), freezing and forced transfers.
Compliance module
A small contract plugged into an ERC-3643 token that can refuse a transfer or a mint that breaks its rule.
Heartbeat
The longest a feed should go without a new reading. A reading older than your limit is stale.

ERC-3643 is an Ethereum standard for tokens that only verified holders can receive. T-REX is its reference implementation. To Mint Creating new tokens and adding them to the total supply. See the glossary there is a call only an Agent In ERC-3643, an address the token owner trusts with actions like minting, burning (destroying tokens), freezing and forced transfers. See the glossary can make.

STEP BY STEP

Flow diagram: 5 stepsFlow diagram: 5 steps. An agent asks to mint, then Is the receiver verified?. Is the receiver verified?, then Compliance modules. Compliance modules, then Reserve module (added). Reserve module (added), then Tokens created.1An agent asks to mint2Is the receiver verified?3Compliance modules4Reserve module (added)5Tokens created
canTransfer(address(0), to, amount) asks each module in order. Scaled to the token’s decimals before the comparison.

Step 1. Request. An agent asks to mint new tokens to a holder.

Pick a step to see it move
  1. Request An agent asks to mint new tokens to a holder.
  2. Identity The token checks that the receiver is verified in its identity registry.
  3. Compliance To compliance, a mint is a transfer from the zero address. Modules run in order, and the first “no” blocks the mint.
  4. Over the reserve The added module compares supply plus the new amount with the latest fresh reserve. Over it, like 900 + 200 against 1,000: refused, nothing is created.
  5. Mint Only when every check passes are the tokens created, and compliance is told.
T-REX’s mint path, with the reserve module added as one more compliance module. Step 4 is the addition, shown refusing. A batch mint takes the same path.

Nothing in that path of the T-REX Token.sol compares supply with anything off-chain, by design. But its SupplyLimitModule refuses a mint when total supply plus the amount passes a fixed cap. A reserve check is the same Compliance module A small contract plugged into an ERC-3643 token that can refuse a transfer or a mint that breaks its rule. See the glossary, with the cap read from a feed.

IN PLAIN WORDS

A module sits on every mint path, whichever agent calls it. But the compliance owner can remove it, the token owner can swap the whole compliance contract, and it undoes nothing if the reserve drops later. Pausing transfers doesn’t stop mints either.

Chainlink’s SecureMintPolicy does the same comparison in its own policy engine. Before every mint, it reads the latest reserve and rejects a mint that would take supply above the reserve-based limit you configure.

Coming up next: So what would that module check, and where can it go wrong?

What the reserve module checks, and its four traps

IN SHORT The module can refuse a mint that would push supply above the latest fresh reserve. Four settings decide whether that check means anything.

I implemented the core T-REX contracts, and this is the design I’d apply. It follows SupplyLimitModule’s structure and SecureMintPolicy’s rules: a negative reserve fails, stale data fails when the age check is on, and decimals get scaled.

It adds three rules of my own: the age limit can’t be zero, mints are refused until a feed is configured, and scaling rounds down.

FOUR TRAPS
Units
A USD reserve feed against a share token compares two different things
Nothing in code: you pick a feed that counts the unit one token stands for, such as shares or ounces
Decimals
A feed with 8 decimals and a token with 18 differ by 10^10. T-REX allows 0 to 18
Reads both decimals at call time and scales, rounding down
Staleness
In Chainlink’s policy, a limit of 0 turns the check off
Refuses 0. Chainlink suggests a limit at or slightly above the feed’s heartbeat
Margin
SecureMintPolicy allows a negative margin, where supply may exceed reserves
No margin in this sketch. For a security token, I’d use none or a positive one, never negative
The four traps, in the order I’d check them.

Get one trap wrong and a reserve check can over-mint, block valid mints, or check nothing at all.

Chainlink’s docs warn that a wrong decimals value can mean “potentially allowing over-minting or blocking valid mints”.

The module compiles with solc 0.8.17 against T-REX’s IModule and AbstractModule. A mock-feed smoke test for this post checks the edges. The exact cap passes, but one smallest unit over fails, as do stale, negative or future-dated readings; transfers pass.

ITEM GET

Refuse by default

No feed configured or a stale reading: no mint.

That’s a smoke test, not an audit. Wiring is two owner calls on the compliance contract, ideally from a multisig behind a timelock, and no mint gets through between them. Take the age limit from the feed’s real Heartbeat The longest a feed should go without a new reading. A reading older than your limit is stale. See the glossary, from its docs.

FAQ

It can refuse a mint that would push supply above the latest reserve number it reads. It narrows one failure mode. It can’t tell whether that number is right, pledged elsewhere or offset by liabilities, and it only runs on new mints.

PART COMPLETE

What you now know

  • An ERC-3643 mint checks identity, not reserves; a compliance module can add that check.
  • Units, decimals, the age limit and the margin decide whether that check means anything.

Check yourself

Tap or click a question to see the answer.

A share token’s mint check reads a reserve feed that reports a US dollar value. The numbers look comfortable. What’s wrong?

The units don’t match. The check compares tokens with dollars, so it means nothing, whatever the numbers say. The feed has to count shares.

Next part:What does a reserve check on mint catch, what does it miss, and what should you ask before trusting a reserve claim?6 min
Adam Boudjemaa
Adam Boudjemaa

Web3 x AI engineer, former CTO of Integra. Named author (1 of 5) of ERC-3643, first author of ERC-6960, co-author of ERC-7410, and co-author of ERC-8203, which is still a draft.

Have a project to ship or a role to fill?

Discuss your project or role

My work at the web3 x AI intersectionOpen-source tools I build

Follow the engineering notes

Get new articles on production AI and smart contracts by email.