essential-eth icon indicating copy to clipboard operation
essential-eth copied to clipboard

Add `contract` filters

Open dawsbot opened this issue 2 years ago • 1 comments

Used to fetch histories on thing like ERC-20 transfers

  const filter = contract.filters.Transfer(
    rewardsTreasuryAddress /* from block # */,
    recipientAddress /* to block # (optional) */,
  );

  const startBlock = 12931482;

  const logs = await contract.queryFilter(filter, startBlock);

dawsbot avatar Dec 13 '21 18:12 dawsbot

@dawsbot going to unassign myself from this; looked managable at the start but not sure it's worth my time. Too many things about contracts I don't understand 😅

arimgibson avatar May 30 '22 20:05 arimgibson