Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
2answers
282 views

When does a ERC-20 token transfer should be considered confirmed?

I'm wondering when you should consider that a transfer of ERC-20 tokens is confirmed. At the beginning I thought that just making sure the transaction calling transfer is confirmed successfully was ...
0
votes
1answer
164 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
37 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(...
1
vote
3answers
186 views

How to get “event logs” similar to “remix”?

I have an event as follows : event LogNewObject(address sender, bytes32 indexed id, bytes32 sub_states_types, bytes32 sub_states_values, address owner); And this event is used in following function :...
2
votes
0answers
200 views

Parity syncing status for smart contract events with warp

So I'm trying to find the fastest way to fully sync a parity node in order to get all smart contract events, not just account states. The problem I've found is that when parity has warp syncing ...
0
votes
0answers
131 views

Using string as an indexed variable in an Event

I have written a contract that has an event like this: event Creation(string indexed _id,string _transType, string _ownerFirstName,string _ownerLastName); I am trying to listen to the Event through ...
1
vote
1answer
212 views

How filter event based on a value?

I have this solidity event : event ValidateData( address professorAddr, address studentAddr, bytes32 data ); in Javascript I want watch the event only when the ...
1
vote
1answer
358 views

Smart Contract events

I am developing a Dapp that contains a notification between two Users. for example : User 1 (Student): send a transaction that contains data to be confirmed. User 2 (Professor): receive a ...
1
vote
0answers
81 views

web3 got duplicate events and make data in server different from blockchain

I use web3j to listen ethereum smart contract events to synchronize data for the server, but sometimes I got duplicate events in one function. Let's consider Birth evens in CryptoKitties smart ...
1
vote
1answer
48 views

Only one topics args for event logs visible in the transaction receipt, instead of three expected

I have a Smart Contrat where there is some events like bellow : MyContract { event CustomerDataSendingToSeller(address _seller, string _hasheCustomerData, uint256 _orderSeq); function ...
0
votes
2answers
1k views

How to listen to events generated by an existing contract in web3 1.x.x?

Currently I'm unable to find a working solution. Let's say I have the following smartcontract: contract Manufacturer { event LogNewOrder(string order); string[] public orders; function ...
0
votes
0answers
148 views

How to see log of an event?

I set the entire of a payload via an event as follows and i get transaction hash. However in transaction hash I cannot see the value of payload. How can I see that? event setPayloadEvent(uint256 ...
3
votes
2answers
855 views

How to convert Hexadecimal values into readable format?

I'm using etherscan API to fetch the event logs: http://api-ropsten.etherscan.io/api?module=logs&action=getLogs&fromBlock=3147081&toBlock=latest&address=...
0
votes
0answers
118 views

Transaction receipt logs has logs from another transaction

I'm trying to analyze contract call transactions from blockchain by looking at the each transaction's logs to see whether some events were emitted (can't use plain filters/watches). I wanted to go ...
0
votes
0answers
18 views

How to use an event to store a buffer (payload)? [duplicate]

I want to store the following payload using an event instead of storing by string (since using string in smart contract is expensive). How can I do this by an event ? My payload is as follows : {"...
0
votes
0answers
54 views

Web3py: How to listen for any failed transactions to a contract address

How can one capture all transactions sent to a contract address that failed? EventFilter only works if there is a filter within the contract code that specifies a FAIL but what I am referring to here ...
0
votes
0answers
11 views

Problem Watching Evetns

I was testing a simple dapp with a very simple contract that generate a payment if you choose the same number of a "random" value that the contract generate. Anyway, I put two events in the contract ...
1
vote
2answers
94 views

Event not found in Contract

I am trying to access an event from my contract to observe in Javascript. I expect to get c.QuantumPilotKeyPurchased but that is undefined var web3 = new Web3(new Web3.providers.HttpProvider("http://...
1
vote
1answer
233 views

Mapping an address to a balance with keeping history of transactions

I have a balance as follows such that after changing its value, I want to keep the history of previous transactions, for example, for the first time, value of Energy_Balance is 5 and for the second ...
1
vote
1answer
43 views

When should we call( ), watch( ) or get ( ) an event? which is the fastest way to get your data from the smart contract?

Q1. I find this concept to be very confusing, when should I be using watch, call or get to listen to an event? how are they different and when should they be used? Also, var event1 = newInst....
2
votes
0answers
156 views

Web3 js events not listening after 5 mins of idle time

My contract is deployed on ropsten infura test-network and that contract has events which gets fired when there is some transaction. contract file function functionName(address from, address ...
0
votes
0answers
139 views

parsing event result in DApp

I created a DApp that watch for specific event on blockchain and prints that event information to the console as shown below. code var AccessManagerERC20ContractAddress = "...
0
votes
1answer
481 views

watching for events in web3 v1.x.x

I deployed a contract and would like to watch for events on that contract. var access_manager_erc20_abi = require('./AccessManagerERC20_abi.js'); //To read the abi. //In this js file i export abi ...
0
votes
0answers
193 views

Watching pending transaction using parity

I was "watch"ing pending transactions using web3 and geth with from and to blocks as pending. When trying to run the same code using parity, the watch is triggered when the transaction is mined. Is ...
0
votes
0answers
428 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) ...
-1
votes
0answers
44 views

Get return value from function on CLIQUE private chain implementation

I'm developing an easy contract that simply transfer a token among parties on a private chain. I build up my chain using geth + PoA consensus so i know the exactly validators and the block time ...
1
vote
3answers
186 views

Emit event in view function or

Is it possible to emit event in view function (via event or logi)? Or is it possible to return value to javascript without(before) mining in a transaction function? My aim is to avoid wait due to ...
1
vote
1answer
587 views

Where is storing events log? [duplicate]

i can't understand where is events log data is storing? I can access to my logs by myContract.allEvents({ fromBlock: 2139049, toBlock: 'latest' }, function(error, event){ ...
0
votes
0answers
90 views

Watching an event infinite getFilterChanges loop

Here is my code for App.js: Contract.deployed().then((instance) => { var event = instance.hasVoted(); var _this = this; let wachtEvent = event.watch(function(...
2
votes
0answers
164 views

How to use logx in Solidity?

Aim: To log data from a smart contract. Following function is written in accordance with low level interface to Logs in ethereum. However, due to lack of documentation, and being new in Solidity, I ...
1
vote
1answer
190 views

eth_getLogs only returns logs for last transaction

The following command only returns logs for the last transaction (or block). I'm currently running ganach-cli for the local testnet. There were previous transactions with events but when a new ...
2
votes
0answers
116 views

Etherscan for Ropsten not showing tx events anymore [closed]

Since today 2018-04-11 etherscan on Ropsten testnet does not show anymore the events related to a given transaction. It is very important for the testing and debugging of Smart Contract to view the ...
0
votes
2answers
261 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?
1
vote
1answer
594 views

Web3 handling of contract events

It seems that there is an issue with handling of contract events and I am not sure if it is at the EVM level or just web3js. I have 2 contracts "SomeCoin" and "SomeConcert". Both contracts emit "...
0
votes
0answers
265 views

Events not recognised - Uncaught type error “is not a function”

I am trying to implement Events in a smart contract. I am using VueJS framework for frontend and deploying smart contracts through Remix Remix version - http://remix.ethereum.org/#optimize=false&...
1
vote
1answer
113 views

Web3.js function(s) to help determine the block numbers inside a date range?

I just learned today that you can query past events using the Web3.js 1.0.0 getPastEvents() function. That function supports filtering via the fromBlock and toBlock call parameters, so you can limit ...
0
votes
0answers
476 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 ...
2
votes
1answer
47 views

Is it possible Filter events with wildcards based on recorded indexed parameters

Let's say I have a contract that fire an event PersonCreated(uint personId, bytes32 indexed name) every time a person is created. To query for all the past events with name equal to Jason, we can ...
1
vote
1answer
99 views

Event unique identifier

The web3.js (1.0) docs helpfully list the return values from a contract event subscription. I've noticed that there is an additional return value id that isn't listed there but is returned with the ...
1
vote
2answers
173 views

Are events in Ethereum Tokens worth it?

QUESTION: Is it worth it to have events in your token? Each transaction usually has the event inside it meaning more gas is spent for the users (which is bad). I don't have a full picture of all the ...
0
votes
1answer
207 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
0answers
130 views

Debugging why Solidity Events not being logged

I am using the truffle React box. I am unable to capture event logs as txns come in from my contract. See my code below where I set event listeners in the ComponentDidMount() function. After ...
0
votes
1answer
164 views

Can I assume when an event is received means the transaction is 100% confirmed?

I am listening to the even using Nethereum. May I know if an event is received means the transaction is confirmed? If not? How can I know it is failed and perform a rollback?
1
vote
1answer
274 views

Understanding what events are doing in Solidity

CONTEXT OF THE QUESTION: The references at the end of this post gave me the following understanding of events: Whenever a transaction takes place that is meant to alter information in the ...
7
votes
1answer
465 views

What are limitations of Event arguments?

Are there any limitation on the amount of arguments that can be send in an event? I have a function in which I want to trigger event that has 12 arguments of which 6 arguments are arrays. I get Stack ...
1
vote
1answer
34 views

Why raise a Created event in a Smart Contract constructor?

Reading through the Bancor code I see this: function SmartToken(string _name, string _symbol, uint8 _decimals) public ERC20Token(_name, _symbol, _decimals) { NewSmartToken(address(this)); ...
0
votes
0answers
269 views

Events not arriving in sent sequence

I have a game coded as a contract in Solidity which is emitting events in a particular sequence. On the client side I'm using Truffle-Contract to listen to these events. Events are being received in ...
0
votes
0answers
39 views

How can I get a limited number of recent event logs?

I think Ethereum's indexed events can act as the getter of the database system. In order to perform this role, it is essential to return a specific number of events in the most recent sequence (...
0
votes
1answer
78 views

Get the output value

I am making a transaction using the function, simple.multiply.sendTransaction(5,6{from:"0xcf03e41ee1116bed4f1acf8a2209b4d37d755988"}) This is a simple function which multiplies the two numbers 5 &...
0
votes
0answers
66 views

Question for Nethereum and Events

Is polling for the event the only way to retrieve it? Seems like very inefficient. But luckily it doesn't cost any gas. Is event received in Nethereum means the transaction (in smart contract) had ...