I know that a smart contract address can accepts a ERC20 token sent to it.
Let’s say there are two smart contracts A and B. A is a deployed smart contract implementing a ERC20 token and B is the contract I want to write.
I would like to know can I write a method in the contract B so that, on trigger by sending a transaction to call its method, it sends a certain amount of the A token owned by the contract B address to another address I specified?
A follow up question: In a manual transaction sender has to sign the raw ERC20 token transaction and send it to network. For smart contract B, is it as simple as calling the target ERC20 smart contract A’s method and it can use the tokens owned by B’s address? Is there any steps needed to "sign" the transfer?