Target is hidden
This information is not publicly available.
OverlayerWrap is designed so that normal minting only happens on the hub chain. Remote chains are expected to receive supply through LayerZero bridge credits.
The issue is that totalBridgedOut is updated on every chain:
_debit() increases it_credit() decreases itThat accounting only makes sense on the hub chain, where it is used by the backing logic to preserve the collateral invariant. On a fresh remote deployment, totalBridgedOut starts at 0, so the first inbound _credit() tries to execute:
totalBridgedOut -= amountReceivedLD;
and reverts with arithmetic underflow (panic 0x11).
Because LayerZero burns on the source side before minting on the destination side, the user's source-chain tokens are already gone when the destination credit fails. The result is a permanent loss of bridged user funds.
This is a deterministic protocol bug, not a theoretical edge case.
This issue matches the contest's stated critical criteria:
Most importantly, remote chains cannot mint supply locally, so the first inbound bridge is not optional bootstrap behavior. It is the only normal way for remote supply to appear.
The protocol uses totalBridgedOut as hub-side accounting so that backing logic can treat bridged-out supply as still part of the effective supply:
uint256 owTotalSupp = IOverlayerWrap(overlayerWrap).totalSupply() +
IOverlayerWrap(overlayerWrap).totalBridgedOut();
That makes sense only on the hub chain, where collateral backing exists.
However, bridge accounting is applied globally:
function _debit(...) internal override returns (...) {
(amountSentLD, amountReceivedLD) = super._debit(...);
totalBridgedOut += amountSentLD;
}
function _credit(...) internal override returns (uint256 amountReceivedLD) {
amountReceivedLD = super._credit(to_, amountLD_, srcEid_);
totalBridgedOut -= amountReceivedLD;
}
On a remote chain, totalBridgedOut is not meaningful. A newly deployed remote instance begins with totalBridgedOut == 0, so the first successful inbound bridge message attempts to subtract a non-zero amount from zero and always reverts.
Restrict totalBridgedOut accounting to the hub chain only.
Suggested fix:
_debit(), increase totalBridgedOut only when block.chainid == hubChainId_credit(), decrease totalBridgedOut only when block.chainid == hubChainId0x11Example shape:
if (block.chainid == hubChainId) {
totalBridgedOut += amountSentLD;
}
if (block.chainid == hubChainId) {
if (totalBridgedOut < amountReceivedLD) revert InvalidBridgeAccounting();
totalBridgedOut -= amountReceivedLD;
}
OverlayerWrap on the hub chain._debit() burns the user's balance and increments totalBridgedOut._credit()._credit() mints through super._credit(...), then immediately tries to decrement totalBridgedOut.totalBridgedOut == 0, the subtraction underflows and reverts with panic 0x11.The message can be retried, but it will keep failing for the same reason because the remote state does not change.
This point matters for judges: this is not "just a revert".
The source-side burn is part of the bridge debit path. The destination-side mint is a later step. When the destination step fails, the already-burned source balance is not automatically restored by this contract.
So the user ends up in the worst possible bridge state:
That is a permanent lock of bridged user funds unless the team deploys a fix and performs recovery operations.
The PoC deploys two OverlayerWrapMock instances:
It then:
20 OVA for a user on the hub.testDebit() on the hub for 10 OVA.20 to 10.hub.totalBridgedOut() == 10e18.remote.totalBridgedOut() == 0.testCredit() on the remote for 10 OVA.panic 0x11.This proves the protocol can burn bridge funds on the source side while being unable to mint them on the destination side.
Run:
npx hardhat test test/OverlayerWrap.bridgeLockPoC.ts --config hardhat.config.audit.ts
Observed result:
Critical PoC: remote bridge credit permanently locks source funds
✔ burns on the source chain but always reverts on the first remote credit
1 passing (4s)
Attachments are hidden
This information is not publicly available.
Comments are hidden
This information is not publicly available.