Liquidity Management and Cancellation of Failed Withdrawals #44
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.
Overview
This pull request introduces enhancements and features to the
FundManager
contract for liquidity management functionality by introducing a base contractLiquidityManagerRole
. Moreover, it introduces the functionality of cancellation of failed withdrawals. The notable changes include:MultiSwap Contract Changes:
Base Contract:
LiquidityManagerRole
setLiquidityManagers
: A setter function to set the addresses of the primary and secondary liquidity managers.setLiquidityManagerWithdrawal
: A setter function to set the withdrawal addresses for the liquidity manager and bot.removeLiquidityByManager
: A function called by onlyLiquidityManager for withdrawal of liquidity from theFundManager
.onlyLiquidityManager
modifier for designated liquidity managers.FillOrderRFQTo
function in 1inchDecoder, 1inchSwap and FiberRouter contracts.Derived Contract:
FundManager
FundManager
now derived fromLiquidityManagerRole
.LiquidityManagerRole
.New Modifiers:
onlySettlementManager
: A modifier allowing only the designatedsettlementManager
to execute certain functions. It checks if the sender is equal to thesettlementManager
address.New Setter Function:
setSettlementManager
: A setter function to set the address of the settlement manager.New Cancel Withdrawal Functions (Settlement Engine Related):
cancelFailedWithdrawSigned
: A function to cancel a signed token withdrawal initiated by the router. Only thesettlementManager
can execute this function. This helps in managing failed withdrawal transactions within the context of the settlement engine.cancelFailedWithdrawSignedOneInch
: A function to cancel a signed OneInch token withdrawal initiated by the router. Similar to the previous function, it's exclusive to thesettlementManager
and is designed to handle failed OneInch token withdrawals within the settlement engine.New Event:
FailedWithdrawalCancelled
: A new event emitted when a withdrawal is canceled. It provides information about the canceled withdrawal, including the settlement manager, recipient, token, amount, and salt.LiquidityRemovedByManager
emitted when liquidity is removed by a manager.Additional Changes:
FiberRouter
andFundManager
contract for improved documentation and readability.configContracts.js
) for calling the configuration-related functions of multiswap contracts. This script facilitates the configuration process and ensures smooth interaction with the contracts.