CryptoFly.us | CRYPTOCURRENCY BITCOIN SHIRTS CLOTHING APPAREL HATS

CRYPTO NEWS

DAOs will be the future of online communities in five years

A decentralized autonomous organization provides power for users to create an online community with as little friction as possible.

Cannot set property ‘defaultAccount’ of undefined

I am trying to run a DApp with metamask enabled , but this error surfaces . <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>My TOKEN</title> <script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script> <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" crossorigin="anonymous"></script> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> </head> <script type="text/javascript" src="./abi.js"></script> <script type="text/javascript"> var MyToken; var Web3; $(document).ready(function(){ window.addEventListener(‘load’, async () => { //::Listen

I am trying to run a DApp with metamask enabled , but this error surfaces .

<head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <meta http-equiv="X-UA-Compatible" content="ie=edge">     <title>My TOKEN</title>     <script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>     <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" crossorigin="anonymous"></script>     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> </head> 
     <script type="text/javascript" src="./abi.js"></script>     <script type="text/javascript">      var MyToken;     var Web3;         $(document).ready(function(){        window.addEventListener('load', async () => {         // Modern dapp browsers...         if (window.ethereum) {             window.web3 = new Web3(ethereum);             try {                 // Request account access if needed                 await ethereum.enable();                 // Acccounts now exposed                 web3.eth.sendTransaction({from : web3.eth.defaultAccount});             } catch (error) {                 // User denied account access...             }         }         // Legacy dapp browsers...         else if (window.web3) {             window.web3 = new Web3(web3.currentProvider);             // Acccounts always exposed             web3.eth.sendTransaction({from : web3.eth.defaultAccount});         }         // Non-dapp browsers...         else {             console.log('Non-Ethereum browser detected. You should consider trying MetaMask!');         }       });       Web3.eth.defaultAccount = "0xCc525f550792D2c8154077B7F4a261dd024638C9";           const address = '0x44e38857745536fC9d17dE71974512a250f9DF9b';         MyToken = new Web3.eth.Contract(abi, address );       }); 

Any help would be greatly appreciated.

DAOs will be the future of online communities in five years

Shopping cart
There are no products in the cart!
Continue shopping
0