📤

Withdraw ERC20 Token

This spell will allow you to withdraw any token from the DSA. This can be used if a token is not listed on the interface.

CODE SNIPPET

/**
* Welcome to Instadapp Terminal, the online DeFi playground!
*
* Manual ERC20 Token Withdrawal
*
*/

const tokenAddress = "" // Fill the address of the token between the inverted commas. Eg: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
const tokenAmount = "" // Fill the token amount in wei between the inverted commas. Eg: "1000000000" // 1000 USDC in wei.
const ownerAddress = "" // Fill the owner address, where you want your tokens withdrawn between the inverted commas.

if (!tokenAddress) alert(`fill 'tokenAddress'. Eg: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"`)
if (!tokenAmount) alert(`fill 'tokenAmount'. Eg: "1000000000" // 1000 USDC in wei.`)
if (!ownerAddress) alert(`fill 'ownerAddress'. Eg: "0xb1DC62EC38E6E3857a887210C38418E4A17Da5B2"`)
let spells = new dsa.Spell()

// spell to withdraw ERC20 token from your DSA to EOA(ownerAddress)
spells.add({
  "connector": "basic",
  "method": "withdraw",
  "args": [tokenAddress, tokenAmount, ownerAddress, 0, 0]
})

console.log("Transaction hash:",
  await dsa.cast({spells})
)