I am trying to get all the events that originate from zero (0x0) address in order to capture the mint activity for my ERC20 token.
Here is my code snippet:
var instance = web3.eth.contract(abi).at(tokenContractAddress);
var blockNo = web3.eth.blockNumber;
console.log('latest block', blockNo); //able to get blockNo successfully
var result = instance.Transfer({from: '0x0000000000000000000000000000000000000000'},
{fromBlock:4361077, toBlock:'latest'},
(err, res) => {
console.log(res);
});
However i never get anything in the res object and its always undefined.
logs[i].event == 'Transfer'I tried both and the console statement is never executed
– stud91 May 28 '19 at 08:37==. Are you sure that such an event has been fired prior to your attempt? – goodvibration May 28 '19 at 08:42