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

Title: Refactor swapBridgeAmount to settledAmount for Enhanced Security in Withdrawal Calculations #36

Merged
merged 3 commits into from
Dec 30, 2023

Conversation

SibghatUllah1997
Copy link
Contributor

Description:

Summary

This PR introduces a key update in our contract's handling of fund transfers. We have renamed swapBridgeAmount to settledAmount, and altered its functionality to enhance security and accuracy in the withdrawal process.

Changes

  • Renamed swapBridgeAmount to settledAmount.
  • Modified the calculation of settledAmount to represent the actual amount the Fund Manager (FM) will receive.
  • The settledAmount now denotes the amountIn on the target side,

Rationale

Previously, swapBridgeAmount was calculated before initiating a swap, representing an estimated amountIn 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 calculating settledAmount internally within the contract after the swap is completed. This approach ensures that settledAmount accurately reflects the amount received by the FM, thereby improving the security and accuracy of the subsequent withdrawal calculations.

Impact

  • Security: This change mitigates the risk of discrepancies between the estimated and actual received amounts during swaps.
  • Accuracy: Withdrawal amounts will now be calculated based on the accurate settledAmount, leading to more precise and reliable transactions.

@SibghatUllah1997 SibghatUllah1997 changed the title **Title**: Refactor swapBridgeAmount to settledAmount for Enhanced Security in Withdrawal Calculations Title: Refactor swapBridgeAmount to settledAmount for Enhanced Security in Withdrawal Calculations Dec 26, 2023
@zikriya zikriya merged commit 5d220db into ferrumnet:feature/NonUpgradeable Dec 30, 2023
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