Skip to content

Commit

Permalink
feat: update tokenAirdrop
Browse files Browse the repository at this point in the history
  • Loading branch information
ponyjackal committed May 7, 2024
1 parent 34872d1 commit 4241529
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/contextualizers/heuristics/tokenAirdrop/tokenAirdrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export function detect(transaction: Transaction): boolean {
}

// check if only 1 address is sending
const sendAddresses = Object.keys(transaction.netAssetTransfers).filter(
(address) => transaction.netAssetTransfers![address]?.sent.length > 0,
const sendAddresses = transaction.assetTransfers.map(
(assetTransfer) => assetTransfer.from,
);
if (sendAddresses.length !== 1) {
return false;
Expand All @@ -65,6 +65,16 @@ export function detect(transaction: Transaction): boolean {
| ERC1155Asset
| ERC721Asset
)[];
if (
transaction.hash ===
'0xcce0b3924cf1be66ad19fbaa255ab8a3d65cd6ad42e1fde3486f23b30293327b'
) {
console.log(
'assetsSent',
assetsSent[0],
assetsSent.every((ele) => ele.contract === assetsSent[0].contract),
);
}
if (!assetsSent.every((ele) => ele.contract === assetsSent[0].contract)) {
return false;
}
Expand Down

0 comments on commit 4241529

Please sign in to comment.