Closed parodime closed 1 month ago
The changes in this pull request focus on the FastBridgeV2
contract, enhancing the handling of bridge transactions, dispute resolution, refunds, and claims. Key modifications include updates to the dispute
, refund
, claim
, bridge
, and relay
functions, with new logic for transferring tokens based on their type (ETH or ERC20) and improved error handling. Additionally, method signatures have been updated to reflect new parameters. The associated test contract has also been modified to rename a parameter for clarity.
File | Change Summary |
---|---|
packages/contracts-rfq/contracts/FastBridgeV2.sol | - Updated dispute function to capture disputedRelayer and modify emitted events. - Altered refund logic to use conditional checks for ETH/ERC20 transfers, updating emitted events accordingly. - Modified claim function for conditional token transfers and updated events. - Refined bridge function to handle originFeeAmount correctly and adjusted event emissions. - Clarified relay function logic for ETH/ERC20 transfers. - Enhanced error handling throughout the contract. - Method signatures updated for bridge , relay , claim , and prove functions. |
packages/contracts-rfq/test/FastBridgeV2.Src.t.sol | - Renamed guard parameter to relayer in expectBridgeProofDisputed function and updated all instances accordingly. - Removed comments about previous parameter mislabeling for clarity. |
sequenceDiagram
participant User
participant FastBridgeV2
participant TokenContract
User->>FastBridgeV2: initiateBridge(params)
FastBridgeV2->>TokenContract: transferTokens()
TokenContract-->>FastBridgeV2: confirmTransfer()
FastBridgeV2->>User: emitBridgeEvent()
User->>FastBridgeV2: disputeTransaction()
FastBridgeV2->>FastBridgeV2: captureDisputedRelayer()
FastBridgeV2->>User: emitDisputeEvent()
User->>FastBridgeV2: requestRefund()
FastBridgeV2->>TokenContract: conditionalTransfer()
TokenContract-->>FastBridgeV2: confirmRefund()
FastBridgeV2->>User: emitRefundEvent()
User->>FastBridgeV2: claimCollateral()
FastBridgeV2->>TokenContract: conditionalTransfer()
TokenContract-->>FastBridgeV2: confirmClaim()
FastBridgeV2->>User: emitClaimEvent()
relay
, prove
, and claim
functions in the FastBridgeV2
contract, which are directly related to the changes made in the main PR regarding the relay
and claim
functionalities.prove
function in the FastBridgeV2
contract, aligning with the changes in the main PR that also update the prove
function's signature and logic.relay
function by storing the relayer address, which is relevant to the updates made in the main PR regarding the relay
functionality.FastBridgeV2
contract, which is directly related to the changes in the main PR that also focus on the refund
function.bridgeStatuses
and bridgeProofs
mappings into a single structure, which relates to the overall restructuring of the FastBridgeV2
contract in the main PR.FastBridgeV2
contract.FastBridgeV2
contract, which is relevant to the enhancements made in the main PR regarding the handling of bridge transactions.bridge
and relay
functions, which are directly related to the changes made in the main PR that focus on error handling and transaction management.FastBridgeV2
contract.size/m
, M-deps
, M-synapse-interface
In the realm of bridges wide,
Tokens dance, with joy and pride.
Disputes resolved, and refunds flow,
With every claim, our spirits grow.
A relayer's role, now clear and bright,
In FastBridgeV2, all feels just right! πβ¨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Latest commit: |
099a4f5
|
Status: | β Deploy successful! |
Preview URL: | https://853d5e13.sanguine-fe.pages.dev |
Branch Preview URL: | https://ft-fixdisputeemit-revampdepo.sanguine-fe.pages.dev |
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 91.52941%. Comparing base (
99cf53e
) to head (099a4f5
). Report is 11 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Generated at commit: 3bb8ae0a9a29b8a0ae5a8399ba42a31cacd8a7b2, compared to commit: fd75dbbbb6fec8ad2c35d5a16efb3a6a4812231a
Contract | Method | Avg (+/-) | % |
---|---|---|---|
FastBridgeV2 | claim(bytes) claim(bytes,address) dispute refund |
-76 β
-76 β +150 β -71 β |
-0.15% -0.14% +0.48% -0.14% |
gas optimized claim/refund transfers -- no longer using universalTransfer
dispute (& respective tests) switched to emitting relayer (as was always indicated by the output param label), not guard address.
storage-read optimizations to come in a follow-up PR
Summary by CodeRabbit
New Features
Bug Fixes
Documentation