Skip to content

Update smart contract to support onramp #73

@SarahSync

Description

@SarahSync

User Story

Add the details of this issue from the user's POV

Acceptance Criteria

  1. 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

  2. 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions