Open i-likekapil opened 3 years ago
These are the old methods to call the web3 library. If you have installed a new truffle version other than 5.0.2 it won't run.
@shwetha-pingala that s reason it s better to add new branch for last updates on diffirents tools like metamask @i-likekapil use this line and u will get solution
const accounts = await ethereum.request({ method: 'eth_accounts' });
for more details check this link https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3
//app.js loadAccount: async ()=>{ App.account = web3.eth.accounts[0] // line no. 42 console.log(App.account) }
//console app.js:42 Uncaught (in promise) TypeError: Cannot read property 'accounts' of undefined at Object.loadAccount (app.js:42) at Object.load (app.js:9)