Title: Refactor swapBridgeAmount
to settledAmount
for Enhanced Security in Withdrawal Calculations
#36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Summary
This PR introduces a key update in our contract's handling of fund transfers. We have renamed
swapBridgeAmount
tosettledAmount
, and altered its functionality to enhance security and accuracy in the withdrawal process.Changes
swapBridgeAmount
tosettledAmount
.settledAmount
to represent the actual amount the Fund Manager (FM) will receive.settledAmount
now denotes theamountIn
on the target side,Rationale
Previously,
swapBridgeAmount
was calculated before initiating a swap, representing an estimatedamountIn
to be received on the target side. However, this pre-swap estimation posed potential risks, as the actual received amount could differ during the swap. To address this, we've shifted to calculatingsettledAmount
internally within the contract after the swap is completed. This approach ensures thatsettledAmount
accurately reflects the amount received by the FM, thereby improving the security and accuracy of the subsequent withdrawal calculations.Impact
settledAmount
, leading to more precise and reliable transactions.