Transfer and Approve of ERC20 tokens

Using the Openzeppelin libraries, for example in a function to deposit tokens, I need to check if the contract is approved and the user has the tokens or does the Transfer function take care of that?

Yeah, when you deposit tokens, you should approve at first, actually, it should be

token.approve(contract, approvalAmount);
contract.deposit(amount);

And in the function deposit(), it should call transferFrom().

Hi @franco_villa_santana,

You may want to look at the following examples: