Closed alcueca closed 3 years ago
This PR is just a draft showing that a weth9 to weth10 function can't be coded inside weth10.sol.
In such a function, weth10 would have to weth9.withdraw, which does address(weth10).transfer, which calls back at weth10.receive.
weth9.withdraw
address(weth10).transfer
weth10.receive
Unfortunately, address.transfer sends 2300 gas, and weth10.receive uses more than that.
address.transfer
There seems to be no way for a contract to withdraw from weth9 and do something as a result.
withdraw
This PR is just a draft showing that a weth9 to weth10 function can't be coded inside weth10.sol.
In such a function, weth10 would have to
weth9.withdraw
, which doesaddress(weth10).transfer
, which calls back atweth10.receive
.Unfortunately,
address.transfer
sends 2300 gas, andweth10.receive
uses more than that.There seems to be no way for a contract to
withdraw
from weth9 and do something as a result.