I have a smart contract, which has an address when deployed. I want users to send ERC20 tokens to the smart contract address without using specific functions of the contract (USDC for instance) and I want to be able to trigger functions when this happens. Fundamentally, I want to keep track of the number of ERC20 tokens that each address has sent to the contract address.
I am looking for a similar solution to the receive() function, which would work if what I receive in the smart contracts is ETH, and I can just use msg.value. However, with ERC20 the receive function is not triggered.
Any ideas? Thanks in advance