Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use single on-chain bridge fee #522

Merged
merged 5 commits into from
Dec 9, 2024
Merged

Conversation

shaspitz
Copy link
Contributor

@shaspitz shaspitz commented Dec 9, 2024

Describe your changes

Fixes https://cantina.xyz/code/d35ebc75-9107-4e58-a923-f81725912138/findings/10

  • Removes GatewayStorage.finalizationFee from the storage of the gateway contracts. Each gateway still stores what's currently defined as GatewayStorage.counterpartyFee (now renamed to counterpartyFinalizationFee).
  • TransferInitiated event is augmented to emit this counterpartyFinalizationFee.
  • finalizeTransfer is augmented to accept a finalization fee as a part of the transfer being finalized. The relayer would be responsible for ensuring that the _finalizationFee value in finalizeTransfer is the same as what was specified as counterpartyFinalizationFee in the corresponding TransferInitiated event.

By making these changes, we remove the need for one gateway's counterpartyFee to match the other gateway's finalizationFee. The finalization fee is now (only) be set and stored on the origin chain as counterpartyFinalizationFee, while still being mutable.

Checklist before requesting a review

  • I have added tests that prove my fix is effective or that my feature works
  • I have made corresponding changes to the documentation

@shaspitz shaspitz force-pushed the single-finalization-fee branch 2 times, most recently from cbc584a to f09a651 Compare December 9, 2024 19:44
@shaspitz shaspitz marked this pull request as ready for review December 9, 2024 20:16
contracts/contracts/standard-bridge/Gateway.sol Outdated Show resolved Hide resolved
@shaspitz shaspitz force-pushed the single-finalization-fee branch from de9a531 to a9fdf7d Compare December 9, 2024 22:24
@shaspitz shaspitz merged commit 16db7b9 into main Dec 9, 2024
5 checks passed
@shaspitz shaspitz deleted the single-finalization-fee branch December 9, 2024 23:46
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.

3 participants