Receive() keyword

Hey!
Is there a way to use the receive() keyword to check for specific tokens?
Let's say I wanna know if my contract received USDT instead of BNB, is this possible?

receive() is only for the native token on a blockchain, i.e., BNB on BSC or ETH on Ethereum. In fact, a smart contract can never "receive" USDT in the first place. USDT is transferred by updating the records on the USDT smart contract.

If a smart contract wants to know if a token is received, a listener similar to onERC721Received() can be written.

2 Likes