I am looking for a way to implement smart contract that can spend user's ETH or erc-20 tokens with just one approve, without anything else required from user.
USECASE
1.User approves token spending(usdt for example) he has 10 USDT.
2.WITHOUT USER INTERACTION our smart contract can transfer this 10 usdt from user to wherever else it is coded to transfer it. (This function
spend_user_usdt
should be invoked with either something like chainlink cron job or manually by contract creator.-
- Since User already approved token spending it doesn't require anything to do, tokens are transfered from his wallet automatically
I know this is possible because sometimes smart contracts get hacked and users have to revoke tokens approval, or their tokens are gone without additional manual confirmation.
But I wasn't able to find decent information on it.
PS: Just in case I don't want to write malicious smart contracts - that in not in the zone of my interests. This mechanics could be used to build very interesting projects that simplify user experience in many areas.