Whether erc20 usdt can be sent to a smart contract so the owner will be a contract address, I mean balanceOf[] will use contract address or the contract owner address? If I send the erc20 again from the contract, I can just call the usdt contract function transfer within my contract? Thanks
[Ethereum] Whether usdt can be sent to a contract
erc-20usdt
Best Answer
Any address can be an owner of ERC20 tokens, so a contract is also fine.
The possible problem with contracts owning tokens is that the contract has to have functionality to transfer the tokens onwards (call the token contract). If the contract doesn't have such functionality the tokens are essentially lost/burned as they can never be transferred anywhere.
What you need in your contract is basically:
Write an interface which says what functionality the other contract has
Create a reference to the token contract with the interface and the token contract's address
Call the token contract's functionality within your contract
Something like this: