wearenotabank Doku EN
Doku · Mint nachholen
Doku

Einen fehlenden Mint nachholen

Diese Seite gilt, wenn USDC auf einer Quell-Chain verbrannt wurde, aber auf der Ziel-Chain nicht angekommen ist. Die Seite zeigt, wie sich solche Burns finden lassen und wie der Mint gebaut wird; senden kann ihn jeder. Das Nachholen läuft in der Software der Owner oder des Integrators, mit dem Attestierungsdienst von Circle (Iris), den der Integrator konfiguriert.

Der Leitfaden unten steht auf Englisch, weil wir ihn unverändert aus dem Repository der SDKs übernehmen.

Recovering a missed mint

What an integrator does when USDC has been burnt on a source chain and has not arrived on the target chain. Index: README.md. Related: status.md, duties.md.

When it is needed

Circle's Forwarding Service normally submits the mint on the target chain. It may not: Circle's fee at that moment can be above the limit the configuration set for the row, or the attested message can expire before anyone submits it. The USDC has then left the source chain and has not arrived. It waits until someone submits the mint with Circle's attestation. receiveMessage on the target chain is open to anyone and mints only to the Safe the burn named, so the owners, the integrator's software or a stranger can complete it (unless Circle has paused or blocked, below); the SDK builds the call and sends nothing.

Nothing of ours runs a recovery. Recovery runs in the owners' or the integrator's software, against the Iris URL the integrator configured, and never through a proxy of ours. The SDK offers no function to move funds that Circle blocked and no route around a Circle pause: a block freezes them, and a pause delays the mint until Circle lifts it.

Find the burns with no mint

findUnmintedBurns lists the Safe's burns from the blocks given, per source chain, whose nonce is not used on the target chain. A burn whose message was received is left out. It needs iris in the configuration.

const burns = await sdk.findUnmintedBurns({ safe, fromBlock: { 42161: arbitrumBlock, 137: polygonBlock } });
final burns = await sdk.findUnmintedBurns(FindUnmintedInput(  safe: safe,  fromBlock: {42161: arbitrumBlock, 137: polygonBlock},));

The integrator keeps the block to look from for each chain; the SDK keeps no state. Each result carries the state of the transfer and what Circle's Iris holds:

state Meaning What to do
burnt Circle's attestation is not there yet, or Iris could not be reached (attestation says pending or unreachable) ask again later
attested the message and its attestation are ready buildMint
expired the message passed its expiration block on the target chain buildMint with reattest: true

Iris being down is not an error of this call: it is the burn's attestation, unreachable. Standard and Fast burns are treated alike. A message of Iris that does not decode as the burn's is refused (invalid-iris-answer). invalid-config means iris is not in the configuration, or a chain has no RPC.

Build the mint

buildMint builds receiveMessage(message, attestation) for one burn, to the target chain's MessageTransmitterV2 of the release record. The burn is named by its source chain and transaction, with the nonce where one transaction holds several burns of the Safe. A result of findUnmintedBurns fits.

const mint = await sdk.buildMint({ safe, burn: { sourceChainId: 42161, transactionHash, nonce }, reattest: false });await wallet.send(mint.chainId, mint.transaction); // anyone may send it, on the target chain
final mint = await sdk.buildMint(MintInput(  safe: safe,  burn: MintedBurn(sourceChainId: 42161, transactionHash: transactionHash, nonce: nonce),));

The sender pays the gas on the target chain (costs.md, "The mint on the target chain"). The Safe receives the burnt amount less the fee Circle executed.

The refusals are by name:

RefusalMeaning
attestation-pending, iris-unreachable Circle's side is not ready. Both are retryable: ask again later.
message-not-the-safes Iris's message of the transaction does not mint to this Safe through the source chain's token messenger: the call would mint elsewhere, or not at all.
already-minted the nonce is used on the target chain; the USDC is in the Safe's address there
message-expired the message expired and reattest was not asked
reattest-refused Iris refused to attest again; the message carries Iris's request id, for Circle Support

With reattest: true, an expired message is attested again once: the SDK sends POST /v2/reattest/{nonce} to the Iris the integrator configured, with no body. Circle's answer means that it has started to attest the message again and nothing more, so the new attestation usually follows a later call: attestation-pending, and the integrator asks again later with the same input. Re-attestation is documented by Circle for expired Fast Transfer burns and is best-effort for a Standard burn. On Arbitrum One, where the contracts' block.number is the Ethereum block number, the SDK compares the expiration block with the latest block's l1BlockNumber. The SDK builds no target-chain order whose pre-hook mints.

Running it for users

An integrator that runs recovery, burns or a server for its users' Safes is in the "run by us" case for itself (duties.md). The SDK does not change that: it builds the transactions, and the software that fetches the attestation and sends the mint is the integrator's.

The fork suite sends the call to the real transmitter on the target fork for each leg of the ring (ForkSuiteAcrossChainsRecoverMint), and test/fixtures/mint-vectors.json holds the call data both SDKs reproduce byte for byte.