Reputation: 25
Is it possible to get all the contracts (contracts addresses) that are deployed from a specific address??
For example, I have deployed a few contracts from my account, is there a function in web3.js that can return all the contracts that are deployed from my account?
Upvotes: 1
Views: 1220
Reputation: 82553
Not unless your deployed contracts all emit some event (either at time of deployment, or as some part of their usage).
Only events are indexed in ethereum. For everything else, such as all transfers from an address, or all transfers to an address, you must scan the chain. This essentially amounts to starting from block 0 (or a higher block, if you know for certain the address was not used before that), and then checking each block for a contract creation transaction from your address.
This can be complicated further if your contracts are deployed from another contract, in which case you will need to run a transaction trace.
Upvotes: 3