It looks like you're new here. If you want to get involved, click one of these buttons!
var Web3 = require('web3'); var web3 = new Web3(Web3.givenProvider || "ws://localhost:8546"); var subscription = web3.eth.subscribe('logs', { address: '0xb1690C08E213a35Ed9bAb7B318DE14420FB57d8C' // sales auction contract }, function(error, result) { if (!error) { console.log(result); } });
{ address: '0xb1690C08E213a35Ed9bAb7B318DE14420FB57d8C', topics: [ '0x4fcc30d90a842164dd58501ab874a101a3749c3d4747139cefe7c876f4ccebd2' ], data: '0x00000000000000000000000000000000000000000000000000000000000409020000000000000000000000000000000000000000000000000018de76816d8000 0000000000000000000000005f8119e5cab14c2f4ecc81cef51789f1a3bc611a', blockNumber: 0, transactionHash: '0x0000000000000000000000000000000000000000000000000000000000000000', transactionIndex: 0, blockHash: '0x0000000000000000000000000000000000000000000000000000000000000000', logIndex: 0, removed: false, id: 'log_247b1779', } { address: '0xb1690C08E213a35Ed9bAb7B318DE14420FB57d8C', topics: [ '0xa9c8dfcda5664a5a124c713e386da27de87432d5b668e79458501eb296389ba7' ], data: '0x000000000000000000000000000000000000000000000000000000000003ad5e000000000000000000000000000000000000000000000000008e1bc9bf040000000000000000000000000000000000000000000000000000006a94d74f430000000000000000000000000000000000000000000000000000000000000002a300', blockNumber: 0, transactionHash: '0x0000000000000000000000000000000000000000000000000000000000000000', transactionIndex: 0, blockHash: '0x0000000000000000000000000000000000000000000000000000000000000000', logIndex: 0, removed: false, id: 'log_247b1779', } { address: '0xb1690C08E213a35Ed9bAb7B318DE14420FB57d8C', topics: [ '0x2809c7e17bf978fbc7194c0a694b638c4215e9140cacc6c38ca36010b45697df' ], data: '0x00000000000000000000000000000000000000000000000000000000000270d0', blockNumber: 0, transactionHash: '0x0000000000000000000000000000000000000000000000000000000000000000', transactionIndex: 0, blockHash: '0x0000000000000000000000000000000000000000000000000000000000000000', logIndex: 0, removed: false, id: 'log_247b1779', }Could someone explain to me the values for the topics array I am seeing here? I tried to hash various Event signatures with sha3() but it came up with something else.
Comments
One of the events is "AuctionSuccessful" with the signature
AuctionSuccessful(uint256,uint256,address)
sha3() yields 0x4fcc30d90a842164dd58501ab874a101a3749c3d4747139cefe7c876f4ccebd2
Another one is
AuctionCreated(uint256,uint256,uint256,uint256)
yielding
0xa9c8dfcda5664a5a124c713e386da27de87432d5b668e79458501eb296389ba7
Here is my new working code: