From what I've gathered (and I'm new to Ethereum), smart contracts can receive ETH payments and hold them through the receive
/fallback
blocks, but cannot directly hold ERC-20 tokens, but rather they can utilise them if a user calls the allow
function on the token's contract. If the above statement is even true, why is that?
Example through a random use case: Say that there's a smart contract that converts certain ERC-20 tokens to ETH through an exchange. Users deposit their ERC-20 tokens and invoke the swap functions. Do the users have to allow the contract to manage the tokens or is there a simpler way to achieve the same effect?