Basic A (ERC20) - Optimism

Deposit & Withdraw from DSA. Basic-v1.1 connector on optimism triggers methods like deposit, depositFrom, withdraw. You can view details like source code, ABIs on Etherscan.

  • Use 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee to indicate ETH.
  • use -1 or dsa.maxValue for the maximum amount in function.
  • If not sure about the arguments getId and setId, pass 0.

Deposit

Deposit a token to DSA.

spells.add({  connector: "BASIC-A",  method: "deposit",  args: [token, amt, getId, setId]});
Parameter Type Description
token address The address of the token to deposit.
(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE and need to pass `value` parameter equal to `amt` in cast function ```dsa.cast({..., value: amt})```.
For ERC20: Need to give allowance prior casting spells.)
amt uint256 The amount of tokens to deposit. (For max: `uint256(-1)` (Not valid for ETH))
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens deposited.

DepositFrom

Deposit a token to DSA from any user.

spells.add({  connector: "BASIC-A",  method: "depositFrom",  args: [token, amt, from, getId, setId]});
Parameter Type Description
token address The address of the token to deposit. (Note: ETH is not supported. Use `deposit()`)
amt uint256 The amount of tokens to deposit. (For max: `uint256(-1)`)
from address The address depositing the token.
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens deposited.

Withdraw

Withdraw a token from DSA

spells.add({  connector: "BASIC-A",  method: "withdraw",  args: [token, amt, to, getId, setId]});
Parameter Type Description
token address The address of the token to withdraw. (For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
amt uint256 The amount of tokens to withdraw. (For max: `uint256(-1)`)
to address The address to receive the token upon withdrawal
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens withdrawn.

If you still can't find something you're looking for or have any questions, ask them at our developers community on Discord or simply send an Email.


Our team is excited about assisting you to build an application using Instadapp Developer Platform. Your questions and feedback help us make a better development environment for future developers.