Hot answers tagged

2

The reason is because what is being emitted is an indexed dynamic variable, not static. Solidity stores a keccak256-hash when indexing a dynamic variable, so the string you are getting, 0xb6e... is the keccack256-hash of the string "Hello, world!". More information can be seen here in the Solidity docs. There are two ways you can handle this: 1) Remove ...


1

If I understand correctly your want to upload a file from the client machine to the web application using the standard HTML tag <input type="file"> and then hash the content of the file. Your code is actually hashing the full path of the file. If you want to read the content of a file, I recommend to use FileReader like this: HTML: <div> &...


1

Since all of the eventinloop events will be emitted in a single transaction, you will see the list of all events in the single calc() transaction. There is no way to react to the first event in the loop, before the second loop is executed (as transactions are atomic, so all events are emitted in a single transaction).


1

None of the above. revert() will ensure no event is emitted. This, because revert "reverts" state changes and events are, indeed, state changes. Ergo, any events are reverted so you won't get the diagnostic outputs you are looking for. Use revert() with reason, revert("<reason>"); or require() with reason, require(<exp>, "<reason>");. ...


1

Deploy and Run Transactions Deploy Contract test_f Debug logs value1: 0 Hope it helps.


1

Add a filter to the call with fromblock > 0: contract.getPastEvents("allEvents", { fromBlock: 1}).then(console.log);


1

Ethereum event values are always stored using HEX encoding, therefore you need to know the type of the source value in order to decode it correctly. Web3 provides some functionalities to facilitate the work, for instance, you could have done: MyContract.methods .createOtherContract() .send({from: accounts[0]}) .on('transactionHash',...


1

You can easily achieve this using ProvenDB. Here is an example code written in Go to continuously prove your logs' existence and ownership on Blockchain: https://github.com/SouthbankSoftware/provenlogs. Hope it helps :P


Only top voted, non community-wiki answers of a minimum length are eligible