Skip to content

fix: guard zero native price in oracle and bridge, order wormhole send checks#29

Open
mooncitydev wants to merge 1 commit into
allbridge-io:masterfrom
mooncitydev:fix/oracle-zero-price-and-wormhole-order
Open

fix: guard zero native price in oracle and bridge, order wormhole send checks#29
mooncitydev wants to merge 1 commit into
allbridge-io:masterfrom
mooncitydev:fix/oracle-zero-price-and-wormhole-order

Conversation

@mooncitydev

Copy link
Copy Markdown

This PR addresses two issues:

Gas oracle / Bridge: When the native token USD price is unset (zero), code that divides by this price could hit division-by-zero. The changes add guards so we do not perform those calculations with a zero denominator.

WormholeMessenger: The duplicate-message check is ordered before the external call (aligned with the Messenger pattern), so we fail fast on duplicates without invoking the bridge contract unnecessarily.

Tests: gas-oracle.test.ts is updated to cover the new behavior.

contribution: made by mooncitydev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant