New answers tagged

0

There is quite some information missing to properly answer this question: What framework do you use and what programming languate? How do you create the myContractInstance (e.g. what ABI, is there a provider or signer)? Making some assumptions I would say the following: In the ABI that you use to create your contract instance the balanceOf method is not ...


0

With web3js, you can use web3.eth.subscribe('logs', options [, callback]); (doc) or web3.eth.getPastLogs(options [, callback]) (doc). Be aware that it is probably not possible to get all the past events of all contracts with web3js using web3.eth.getPastLogs. It would take a lifetime to process on a very powerful machine running a full node. You may be able ...


2

The contract address should be the same for all the users of your dApp, but in this dApp you should differentiate between public keys of the users. It is common to use a map to do this. Use a mapping from address (the private key of the user that you can access using msg.sender) to balance. That way all the users will have different balances and noone will ...


Top 50 recent answers are included