Solidity 0.6.0 introduced a breaking change in how ETH transfers are performed. The following doesn't work anymore:
weth.deposit.value(amount)();
What is the latest syntax for depositing ETH into the WETH contract?
address.transferethersoliditysolidity-0.6.x
Solidity 0.6.0 introduced a breaking change in how ETH transfers are performed. The following doesn't work anymore:
weth.deposit.value(amount)();
What is the latest syntax for depositing ETH into the WETH contract?
Best Answer
Solidity 0.6 and 0.7
Here's a simple implementation that can you try out in Remix: