In my smart contract (in moment erc20), is possible create payment function receive eth I would like to receive usdt (or usdc) and not eth, how could I do it? Thanks
Work in the following order.
- Use the USDT contract's approve function to allow the user USDT to be sent to your contract address.
- Write a payment function in your contract. The user calls this function. In the payment function, the USDT corresponding to the payment amount is transferred to your contract.