Questions tagged [events]

Solidity events and logging problems. Events allow the convenient usage of the EVM logging facilities, which in turn can be used to “call” JavaScript callbacks in the user interface of a dapp, which listen for these events.

Filter by
Sorted by
Tagged with
0
votes
2answers
443 views

Do Etherscan stores all the events and transaction history?

To get the history of a transactions for an account, we have to traverse the whole chain everytime, but etherscan provides the entire history of all the accounts instantly. Similarly it does the same ...
0
votes
1answer
322 views

How to use async to get event logs in the for loop?

I want to get event log to do other thing, so I try to use for loop to get the event log in the websjs. I try to use async and await, but order is wrong. Here is my web3js sample code ...
0
votes
1answer
90 views

Watch contract events without heaving to set up na api key or MetaMask?

I really just need to listen for events coming from the smart contract. Metamask works good on pc but it wont work on mobile and other circumstances. I was thinkng about an open api from infura but ...
0
votes
1answer
888 views

How to use events to retrieve data from a transaction? PRIVATE CHAIN

i am using GETH for the architecture and deployment of my contract on a private chain and it works pretty fine, but unfortunately i want to return data from a transaction function and this makes me ...
0
votes
1answer
275 views

Why myContract.events.MyEvent([options][, callback]) does not return “data” and “logs”?

We have an event as follows : event LogNewObject(address sender, bytes32 indexed id, bytes32 sub_states_types, bytes32 sub_states_values, address owner); This event is called in following function : ...
0
votes
1answer
46 views

A common error at time of using web3 options

When i use some web3 options as follows, I receive a common error i.e. TypeError: web3.[option] is not a function For example : TypeError: web3.toAscii is not a function web3.toAscii(...
0
votes
0answers
594 views

Truffle Test Sell Event Assertion Error

When I test my selling event in truffle.So, the following error comes:- The solidity code is :- event Sell(address _buyer, uint256 _amount); // Buy token function buyTokens(uint256 _numberOfTokens) ...
0
votes
2answers
415 views

How to find the block, when contract was deployed

I have contract address, and I want to find the block number, when it was deployed, to use it for loading events for this contract. Is it possible?
0
votes
0answers
589 views

Listen to emitted event from front-end

Could somebody please provide me code that works to listen to an event from your front-end. It was working for me and there are a few tutorials that I've tried now to fix it but it still persists with ...
0
votes
1answer
245 views

How do you listen to block changes using web3 (1.0.0) and MetaMask ?

I need to display a message (in my react app) when the block count reaches a particular number. I tried using web3.eth.subscribe but MetaMask provider does not support that. So is there any other way ...
0
votes
1answer
287 views

How to prevent callback event occur twice?

Hi this is my web3 code events.watch(function (error,result){ if (error) { console.log('Error:'+JSON.stringify(error)); res.send({'status':0,'message':...
0
votes
1answer
52 views

Dynamically call event with arugments

How do I dynamically call an event with a name? For example, my contract has a few events and based on some conditions I would like to call one of them. I don't want to use a switch or an if ...
0
votes
1answer
171 views

Event cannot trigger when the transaction is done

My contract location is here pragma solidity ^0.4.18; contract Coursetro { string fName; uint age; event Instructor( string name, uint age ); function setInstructor(...
0
votes
0answers
131 views

Testrpc some times not returning event after transaction execution

I am using testrpc to test my contract While executing some functions in my contract I have observed some inconstancy in responses from testrpc, Same function call give me 3 different results at ...
0
votes
0answers
67 views

Indexed event parameter only returns 1st character in address

pragma solidity ^0.4.13; contract OwnedI { /** * Event emitted when a new owner has been set. * @param previousOwner The previous owner, who happened to effect the change. * @param ...
0
votes
1answer
133 views

How do I watch Events from multiple contracts

I wrote a script that is able to read events from one contract address and then paste it into a .csv. Now I would like to extend that script listening watching/reading the same event of several ...
0
votes
1answer
151 views

Iterating through events

I have events (fired some time ago by the contract) containing numbers. I need to load them all, and then to draw a chart. What I do: contract.getInitBlock(function(error, value) { var ...
0
votes
1answer
77 views

Can not see Solidity events

I can see events in a private net, but when I connect to "real" net, I can not see them. Meaning .watch(function(err, result) is never called. My theory is I am using lightning, and it probably means ...
0
votes
2answers
518 views

Events with string argument not working (not indexed)

I am trying to listen to an event on rinkeby test which I run locally. Every thing works fine when my argument is int such as event EventTester(int values); When I change the event argument to string ...
0
votes
1answer
353 views

Events are not getting recognised TypeError: Contract.events.event is not a function

I am trying to get older state of a contract. I have deployed contract using truffle. my contract is pragma solidity ^0.4.15; contract NDA { bytes32 party1name; bytes32 party2name; bytes32 ...
0
votes
0answers
128 views

Using events and logs to get function returned value with a simple example

My question is related to this one: Can a contract function both change the state and return a value when it's called externally Question: How to read event/log content? I have a contract like:...
0
votes
1answer
133 views

Watching for events returns 0 blocknumber

I am trying to listen for recently mined events from a live smartcontract(EtherDelta). //https://github.com/praneethmendu/ethualizer/blob/master/backnd.js tradeEvent = contractIns.Trade(...
0
votes
1answer
491 views

Simple event watching with testrpc - unexpected output

Working with this example, I've been attempting to utilise event watching from the web js api. Window 1 (a testrpc instance with filled account): testrpc -a 1 Window 2 geth attach rpc:http://...
0
votes
0answers
574 views

Regarding Event Generation Cost

Lets say events are invoked from all the methods of a contract. Each event is storing some data. The methods where only computation or data fetching logic is applied will it cost ether if any event is ...
-1
votes
1answer
152 views

How to call Sell event and buy token function with help of web3.py?

I am new to ethereum block-chain. I created a ERC20 token and crow-sale smart contract in solidity. I also deployed these smart contract with the help of web3.py. I created a contract instance. ...
-1
votes
1answer
59 views

Capture Solidity Emit Events without Web3 — E.g., Calling via Postman

Is there some way to capture Solidity Emit Events without the use of Web3? For example, I am calling via Postman JSON RPC eth_sendTransaction. How to capture the returned results?