You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a developer, I want to ensure that the refund fee is not transferred to the treasury if the fee value is 0, so that unnecessary transactions are avoided.
Acceptance Criteria
GIVEN an order with a refund fee of 0, WHEN the refund function is called, THEN the system should not transfer the refund fee to the treasury.
GIVEN an order with a refund fee greater than 0, WHEN the refund function is called, THEN the system should transfer the refund fee to the treasury as usual.
Product & Design Links:
Tech Details:
Update the refund function to include a check that ensures the refund fee is not transferred to the treasury if the fee value is 0.
Ensure proper error handling and validation for the refund functionality.
Open Questions:
Notes/Assumptions:
Code Changes
Update the refund function as follows:
function refund(uint256_fee, bytes32_orderId) external onlyAggregator returns (bool) {
...
// transfer refund fee to the treasury if the fee is not 0if (_fee !=0) {
IERC20(order[_orderId].token).transfer(treasuryAddress, _fee);
}
...
}
The text was updated successfully, but these errors were encountered:
chibie
changed the title
Implement Transfer Protocol to Refund Fee Only When the Provided Fee Value is Not Zero
Update Refund Function to Skip Treasury Transfer for Zero Fee
Jul 27, 2024
User Story
As a developer, I want to ensure that the refund fee is not transferred to the treasury if the fee value is 0, so that unnecessary transactions are avoided.
Acceptance Criteria
GIVEN an order with a refund fee of 0,
WHEN the refund function is called,
THEN the system should not transfer the refund fee to the treasury.
GIVEN an order with a refund fee greater than 0,
WHEN the refund function is called,
THEN the system should transfer the refund fee to the treasury as usual.
Product & Design Links:
Tech Details:
refund
function to include a check that ensures the refund fee is not transferred to the treasury if the fee value is 0.Open Questions:
Notes/Assumptions:
Code Changes
Update the
refund
function as follows:The text was updated successfully, but these errors were encountered: