Many questions have been asked here but mostly they have been vague questions and/or answers so before marking as duplicate please read this one as its completely specific.
I have an ether account that deploys multiple forwarder contracts to be used as unique deposit addresses for the public, just like an exchange. I need to detect all the deposits made to these contract addresses or to the one main ether address.
Possible solution was to use web3 subscriptions as documented web3.eth.subscribe but the code(below) given as example doesn't log any deposits/transactions made to the account address to be honest it doesn't log any relevant information when it comes to logging the data with the contract address and/or account address. I tried removing all the filters and seeing all the logs, made a deposit to contract address but it never logged anything related to my account or contract address or the sender address for that matter.
var subscription = web3.eth.subscribe('logs', {
address: '0x123456..',
topics: ['0x12345...']
}, function(error, result){
if (!error)
console.log(result);
});
// unsubscribes the subscription
subscription.unsubscribe(function(error, success){
if(success)
console.log('Successfully unsubscribed!');
});
References:
https://github.com/ethereum/web3.js/issues/1752
How to programmatically detect and accept ETH and ERC20 deposits
How to detect ETH deposits into an Ether address?
I believe it was quite simple when it was web3.eth.filter but since web3 1.0 this is no more an option.
So what is the current recommended method for listening to the deposits?
external.internalis when using one of those services to send eth FROM a smart contract (eg.<address>.transfer(<amount>)) and those are not detected by any of the Web3 libraries I've seen. i'm fairly certain that block explorers like Etherscan are using custom nodes and recording that info into a separate db. unfortunately, I haven't figured out how to do that myself, so I really can't help you there. – Shomari Aug 20 '18 at 08:30