I want to approve my tokens to allow a smart contract to transfer them for me to another contract.
Steps:
- I approve my tokens for Contract A to spend on my behalf.
- Contract A transfers my tokens to Contract B
- Contract B receives my tokens via Contract A
How can I make this happen in a single transaction? I noticed Uniswap doesn't require you to approve your tokens and is able to transfer them in 1 single transaction.
How can I also do this?
I essentially want to be able to call approve()
& transferFrom()
all in 1 transaction to avoid having to do 2 transactions.