简体   繁体   中英

TypeError: web3.eth.Contract is not a constructor

Please how so I solve these error with web3.js Snapshot of Error Message

const web3Token = new web3.eth.Contract(ERC20Token.abi);

you are probably using a version of web3 < 1.0.

Try this:

const web3Token = web3.eth.contract(ERC20Token.abi);

source: https://github.com/ChainSafe/web3.js/issues/3139

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM