-
Notifications
You must be signed in to change notification settings - Fork 118
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 a wrapper contract that allows users to use ETH instead of WETH #404
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #404 +/- ##
=========================================
Coverage ? 99.42%
=========================================
Files ? 15
Lines ? 1036
Branches ? 154
=========================================
Hits ? 1030
Misses ? 6
Partials ? 0
Continue to review full report at Codecov.
|
} else { | ||
IWETH9(weth).withdraw(amounts[i]); | ||
// slither-disable-next-line arbitrary-send | ||
(bool success, ) = msg.sender.call{value: amounts[i]}(""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why performing the send like this instead of a normal transfer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is a legit concern as of today but in case the gas requirements for certain smart contract interactions change, .transfer
could fail.
https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/
b2aa4e9
to
93cbecc
Compare
5ac5eb5
to
9291414
Compare
SwapEthWrapper.sol
is a wrapper contract ofSwap.sol
variants. It allows users to use ETH instead of WETH whenever interacting with this contract.The params associated with the WETH9 token in the underlying pool should match the
msg.value
. For more details please take a look at the test cases foraddLiquidity()
orswap()
functions