Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(DOS): cross pool dos vector removed by refunding eth only if weth… #122

Merged
merged 3 commits into from
Apr 7, 2024

Conversation

Alexangelj
Copy link
Contributor

@Alexangelj Alexangelj commented Apr 5, 2024

… token

Discussion: #89 (comment)

For pools with WETH, the _transferFrom will try to use the native ether for the payment if msg.value is >= the amount required.

If msg.value is not zero, but also not enough to make the payment, the else branch will be entered which will pull the full amount of WETH tokens from the sender.

If msg.value is greater than the amount (leaving excess), or the else branch was entered, the remaining ether balance of the contract is sent to the sender. Note this is only if the token is WETH,

@Alexangelj Alexangelj requested a review from clemlak April 5, 2024 23:31
@clemlak clemlak marked this pull request as ready for review April 7, 2024 09:52
@clemlak clemlak changed the base branch from main to fix/post-review April 7, 2024 09:52
@clemlak clemlak merged commit 54f0e2a into fix/post-review Apr 7, 2024
5 checks passed
@clemlak clemlak deleted the fix/native-eth branch April 7, 2024 10:01
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants