Target is hidden
This information is not publicly available.
OverlayerWrapCore overrides the LayerZero OFT _credit() hook and unconditionally decrements totalBridgedOut after every token receive:
// OverlayerWrapCore.sol line 543
function _credit(address to_, uint256 amountLD_, uint32 srcEid_)
internal virtual override returns (uint256 amountReceivedLD)
{
amountReceivedLD = super._credit(to_, amountLD_, srcEid_);
totalBridgedOut -= amountReceivedLD; // underflows on non-hub chains
}
totalBridgedOut is initialised to 0 on every deployed chain. On the hub chain the invariant holds because _debit() increments it before any corresponding _credit() arrives. On non-hub chains, local minting is blocked by the onlyHubChain modifier, so _debit() never fires first, totalBridgedOut stays 0 forever. Any call to _credit() therefore executes 0 - amountReceivedLD, which Solidity 0.8 checked arithmetic converts into a revert (panic: 0x11). The revert rolls back super._credit()'s mint, so no tokens are ever delivered.
I shall attach the POC for reproducing.
forge test --match-test testExploit -vvvv
Guard the decrement with a hub-chain check:
Open contracts/overlayer/OverlayerWrapCore.sol at git commit 519c9e92fd9d80d11e35e9868130f6334b88d676. Navigate to the _credit() function (lines 537–544). Confirm the subtraction totalBridgedOut -= amountReceivedLD has no hub-chain guard.
Search the codebase for any initialisation of totalBridgedOut other than the implicit zero. There is none. Confirm that _debit() (the only incrementor) is only triggered by outbound OFT sends, meaning on a fresh non-hub deployment, totalBridgedOut is permanently 0 until tokens leave that chain. Since minting on non-hub chains is blocked by onlyHubChain, no tokens can ever exist there to send out first.
PoC_CreditUnderflow.t.sol
forge test --match-contract PoC_CreditUnderflow -vvvv
Output as seen below:
testExploit proves the non-hub receive always reverts and tokens are destroyed. testHubChainWorksCorrectly proves the hub chain is unaffected, isolating the bug to the non-hub _credit path.
Search for any function that can: (a) mint tokens on a non-hub chain without going through _credit, or (b) directly set totalBridgedOut to a non-zero value on a non-hub chain. Neither exists. The bug is deterministic and permanent for every non-hub deployment.
Attachments are hidden
This information is not publicly available.
Comments are hidden
This information is not publicly available.