New answers tagged

0

I had this error too. It got fixed after I changed my web3 version to 2.0.0-alpha which was 1.0.0-beta.55 before. So just uninstall your web3 using npm uninstall web3. Then do npm install web3@2.0.0-alpha. Hopefully, this will fix it for you.


1

Normal way would be as described by @Morten. Alternatively just purchase WETH with ETH at https://app.uniswap.org/#/swap.


0

You can simply send the Ether to the WETH contract, and it will send wrapped Ether back.


0

You can watch for solidity events using myContract.events.MyEvent([options][, callback]) with web3 (https://web3js.readthedocs.io/en/v1.2.0/web3-eth-contract.html#contract-events). Note that you have to connect to your node via websocket in order to subscribe to events.


Top 50 recent answers are included