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

Fix transfer refund fee to treasury if fee is greater than zero #44

Merged
merged 1 commit into from
Sep 22, 2024

Conversation

OnahProsperity
Copy link
Collaborator

This PR fix the issue with transferring 0 amoutn to treasury address when fee is 0

closes #43

@OnahProsperity OnahProsperity self-assigned this Sep 12, 2024
@OnahProsperity OnahProsperity added bug Something isn't working enhancement New feature or request labels Sep 12, 2024
@@ -203,8 +203,10 @@ contract Gateway is IGateway, GatewaySettingManager, PausableUpgradeable {
require(!order[_orderId].isRefunded, 'OrderRefunded');
require(order[_orderId].protocolFee >= _fee, 'FeeExceedsProtocolFee');

// transfer refund fee to the treasury
IERC20(order[_orderId].token).transfer(treasuryAddress, _fee);
if (_fee > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use _fee != 0

it's cheaper in gas costs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kindly disagree with this sir.
code

@chibie chibie changed the base branch from main to v1 September 16, 2024 14:12
@chibie chibie merged commit 130c898 into v1 Sep 22, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Refund Function to Skip Treasury Transfer for Zero Fee
2 participants