-
Notifications
You must be signed in to change notification settings - Fork 8
Description
User Story
Add the details of this issue from the user's POV
Acceptance Criteria
-
Successful order settlement with fee deductions
GIVEN an order with defined sender and protocol fees
WHEN the processSettlement function is called on the Gateway contract
THEN the contract should transfer the correct token amount to the recipient
AND deduct sender and protocol fees accurately
AND emit the ProcessSettlement event with correct parameters -
Settlement fails due to insufficient balance
GIVEN an order where the sender balance is insufficient for the total amount plus fees
WHEN processSettlement is executed
THEN the transaction should revert with an appropriate error message
AND no settlement or event emission should occur
Tech Details
#66
- Implemented processSettlement function in Gateway contract to handle order settlements, including sender fees and protocol fees.
- Added ProcessSettlement event to IGateway interface and emitted it during settlement.
- Updated Gateway contract to check for sender fees and protocol fees during token transfers.
- Enhanced order struct to store additional settlement details.
- Created comprehensive tests for processSettlement functionality, covering various scenarios including fee deductions.
- Updated relevant interfaces and mock contracts to support new functionality.
Notes/Assumptions
- Notes or assumption that has to remain constant.
Open Questions