I am building a framework for ERC20 tokens.
Aim is to scan all events (Transfer and Approve) generated by ERC20 contract, for which I am using web3.js getPastEvents.
I have set the toBlock to web3.eth.getBlockNumber() i.e. latest block
Now, to avoid scanning unnecessary blocks, I have to set fromBlock option. Can someone explain how to get block's number of the block in which erc20 token was deployed?