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

Add if to skip if either borrow/repay is having 0 amount #106

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

cwang25
Copy link
Contributor

@cwang25 cwang25 commented Nov 21, 2024

When just withdraw collateral, we should skip the borrow calls instead of calling borrow with 0 amount.
It looks like it was made in two scripts originally, but simple if in these two scripts do the tricks, so keep it in same script is more gas saving imo.

Copy link
Contributor

@fluffywaffles fluffywaffles left a comment

Choose a reason for hiding this comment

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

seems reasonable

@cwang25 cwang25 merged commit 8718926 into main Nov 21, 2024
4 checks passed
@cwang25 cwang25 deleted the hans/zero-borrow-bug-fix branch November 21, 2024 23:11
@cwang25 cwang25 restored the hans/zero-borrow-bug-fix branch November 22, 2024 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants