How do display all the events logs from a smart contract?

0 votes
web3.eth.sendTransaction({from : web3.eth.accounts[0], to : c.address, value : web3.toWei(50)}, console.log);

I am able to return the transaction hash.

But how do I capture all the event logs from that transaction that the smart contract returns?

Oct 3, 2018 in Blockchain by slayer
• 29,050 points
76 views

1 answer to this question.

0 votes

You'll need to watch the events.

const filter = { address: web3.eth.accounts[0] }; // filter for your address
const events = c.allEvents(filter); // get all events

events.watch(function(error, result) {
  if (!error)
    console.log(log);
  });
});
answered Oct 3, 2018 by digger
• 26,550 points

Related Questions In Blockchain

0 votes
1 answer

How do I send back ethers to the sender of the tokens in a smart contract?

Whenever a smart contract receives ether via ...READ MORE

answered May 30, 2018 in Blockchain by Perry
• 17,020 points
363 views
0 votes
1 answer

How do I withdraw the balance from a contract on Ethereum test blockchain?

Your need to improvise your code a ...READ MORE

answered Aug 3, 2018 in Blockchain by Perry
• 17,020 points
69 views
0 votes
1 answer

How is a request sent from an app to a smart contract?

Yes, the contract is distributed by every node ...READ MORE

answered Jun 4, 2018 in Blockchain by Perry
• 17,020 points
50 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
140 views
0 votes
1 answer
+3 votes
2 answers

How to run ethereumjs using Node.JS

You need to install testrpc globally on ...READ MORE

answered Mar 27, 2018 in Blockchain by ned_crew
• 1,620 points
136 views
0 votes
1 answer

How do I send ether from an EOA to a smart contract?

You include ether to send in the ...READ MORE

answered Sep 27, 2018 in Blockchain by digger
• 26,550 points
52 views
0 votes
1 answer

How connect library to smart contract from external resources?

pragma solidity ^0.4.0; import "github.com/OpenZeppelin/zeppelin-solidity/contracts/math/SafeMath.sol"; contract MathExtended { ...READ MORE

answered Sep 26, 2018 in Blockchain by digger
• 26,550 points
23 views