forta-network / starter-kits

MIT License
63 stars 38 forks source link

Suspicious Funding V2 Update #642

Open Vxatz opened 6 months ago

0xtaf commented 6 months ago

not notes for v2 but as a performance improvement, would you think the first condition is often false?

      if (
        (await provider.getTransactionCount(txEvent.to)) === 0 &&
        (await provider.getCode(txEvent.to)) === "0x"
      ) {

I was thinking to use Promise.all but if the first condition is generally false, this is more efficient as the second condition wouldn't be evaluated.