I'm learning Solidity and maybe this is a dumb question. Say I have approved X amount of token A to be transferred from my wallet to my deployed contract. What's preventing a hacker writing his own contract and execute something like IERC20(tokenA).transferFrom(mywallet, mycontract, X); I know it's of no benefit to him since he can't get the money out of my contract but it could cause a lot of hassle to me to move money back from my contract back to my wallet. In fact, how does a DEX router prevent this from happening after user did approval?
Asked
Active
Viewed 30 times