Target is hidden
This information is not publicly available.
Summary The _credit override in OverlayerWrapCore performs totalBridgedOut -= amountReceivedLD after calling super._credit(). On any non-hub chain deployment, totalBridgedOut is initialized to 0 and can never be incremented (because _debit requires tokens to exist first, and tokens can never arrive). This causes an arithmetic underflow revert in Solidity 0.8+, permanently bricking all inbound cross-chain transfers and permanently locking the user's tokens.
The totalBridgedOut state variable tracks tokens leaving the hub chain via _debit (which does totalBridgedOut += amountSentLD). This accounting is correct only on the hub chain, where tokens are first minted and then bridged out (incrementing totalBridgedOut), and later bridged back (decrementing it).
On a non-hub chain:
Attack Flow / Exploitation Scenario
Why This Is High Likelihood
Why This Is High Impact
Only track totalBridgedOut on the hub chain:
function _credit(
address to_,
uint256 amountLD_,
uint32 srcEid_
) internal virtual override returns (uint256 amountReceivedLD) {
amountReceivedLD = super._credit(to_, amountLD_, srcEid_);
if (block.chainid == hubChainId) {
totalBridgedOut -= amountReceivedLD;
}
}
function _debit(
address from_,
uint256 amountLD_,
uint256 minAmountLD_,
uint32 dstEid_
) internal virtual override returns (uint256 amountSentLD, uint256 amountReceivedLD) {
(amountSentLD, amountReceivedLD) = super._debit(from_, amountLD_, minAmountLD_, dstEid_);
if (block.chainid == hubChainId) {
totalBridgedOut += amountSentLD;
}
}
This ensures the collateral-backing accounting (totalSupply() + totalBridgedOut) only applies on the hub chain where it's meaningful, while allowing cross-chain transfers to work correctly on all chains.
Attachments are hidden
This information is not publicly available.
Comments are hidden
This information is not publicly available.