In the above expression, we track three things to get the USDC deposit for a specific address.
The USDC Ethereum Mainnet contract address 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 in tx_logs_address.
The Transfer event of the smart contract, tx_logs_topic0 takes the hashed function signature of the Transfer event.
Function signature `Transfer(address,address,uint256)`
⬇
Hashed function Signature `ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef`
⬇
Prefixed with 0x `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef`
This will be the receiver’s address; tx_logs_topic2 takes the receiver’s address. There are a few things to note here; since the log topics are in 32 byte format and the Ethereum address is 20 byte we’ll have to use a regex comparator =~ to check for strings matching our address.
We will have to replace ADDRESS_OF_RECEIVER_WITHOUT_0x with the receiver’s address without the 0x prefix, to check for 0xDAFEA492D9c6733ae3d56b7Ed1ADB60692c98Bc5 receiver address we’ll have to check for DAFEA492D9c6733ae3d56b7Ed1ADB60692c98Bc5
We are doing a POC with quicknode alerts functionality.
But if there are two txns from same block number, then it’s missing one event.
In total 4 deposits were done on this address and we were notified 3 times.
Following are the txns coming from same block number: