1

If I send ether to a smart contract, how can I see in geth, that it was rejected? I want to see which of my transfers were accepted by an ICO and which were not. I don't see any such field in getTransaction.

  • It would be very useful to see the code of the smart contract. – Jesse Busman May 18 at 8:36
0

You can use the following command to check the ICO contract balance, before and after the transaction to verify whether it was accepted or not.

web3.eth.getBalance(contractAddress)

Hope this helps.

  • The problem with this is, that many people will be sending transactions to that account in a short time, so the balance will change regardless of my transaction. – Alph0r Jun 23 '17 at 14:50
0

Usually tokens contract will generate an event when a transaction is completed.

For example if a contract define the following events

event TokenCreated(address indexed _to, uint256 _amount, uint256 _tokens);

Then you can listen for TokenCreated event where the _to is you address.

0

It depends on the contract itself, there is no general answer to this. If you care about a specific contract, you need to look at it's code and find circumstances where it logs an event or alters it's own storage, and then poke around it's storage or scan transaction receipts for events. If you can find a storage location that isn't altered by it's creation and isn't 0, or find a relevant event, then you know the contract has been used at least once.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.