WETH10 / WETH10

revamped contract
GNU General Public License v3.0
213 stars 116 forks source link

Embedded conversion functions - DO NOT MERGE #70

Closed alcueca closed 3 years ago

alcueca commented 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.

Unfortunately, address.transfer sends 2300 gas, and weth10.receive uses more than that.

There seems to be no way for a contract to withdraw from weth9 and do something as a result.