What is the difference between
instance.totalSupply() vs instance.methods.totalSupply().call()
To my knowledge one is for truffle and the other is for web3. But truffle also uses web3 then why can i not call the functions in a single way?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.Sign up to join this community
From web3.js version 1.0 it has been recommended to call smart contract functions like this
Reference : methods
For earlier version ( < 1.0) we could call like
Note : from docs