0

I am newbie, I am testing . I have 1 question. How to withdraw usdt from an approved spender?. We hope to receive an answerenter image description here

Tashun Sandaru
  • 518
  • 2
  • 14
thu anh
  • 11
  • 3

1 Answers1

0

Easiest way to withdraw it is by using the etherscan(or the relevant explorer itself). Goreli USDT

As the token contract is verified you can use the write functions which is exposed through the explorer to withdraw the token.

When you are in the write contract tab, connect the wallet, fill up the data and execute.

from : spender's address to : your address value : the approved amount

Tashun Sandaru
  • 518
  • 2
  • 14
  • Thank you sir , I see some contracts automatically withdraw without manual steps . Can you send me an article about this. Have a nice day. – thu anh Jan 04 '23 at 18:29
  • if you referring to do the approval and the transferFrom in one transaction, it is not possible. If you are the owner you can just transfer the tokens directly to another account without approvals. refer: https://ethereum.stackexchange.com/questions/79653/is-it-possible-to-batch-approve-transfer-an-erc-20-token – Tashun Sandaru Jan 04 '23 at 18:43
  • Thank you, I mean create a smart contract, automatically call transferFrom – thu anh Jan 04 '23 at 18:49
  • you can not program a smart contract to do something automatically when an event occurred. but it is possible offchain using something like JavaScript and listening to log events. these will be helpful. https://stackoverflow.com/questions/71488069/ethers-js-transferring-erc20-between-contracts -
    https://betterprogramming.pub/learn-solidity-events-2801d6a99a92
    – Tashun Sandaru Jan 04 '23 at 19:05
  • thanks you, love you – thu anh Jan 04 '23 at 20:05