With regards to the SafeERC20 library, see my answer to a different question.
Other than that, the rules of engaging with an ERC20-Token contract are pretty simple:
- An entity can transfer its own tokens using function
transfer
(orsafeTransfer
) - An entity can transfer the tokens of another entity using function
transferFrom
(orsafeTransferFrom
), but only after the latter has approved the former to do so, using functionapprove
(orsafeApprove
)
An entity can be either one of the following:
- An EOA (externally-owned account, aka wallet)
- An SCA (smart-contract account, aka contract)
Every entity is associated with an Ethereum address of course.