Basic A (ERC20) - Polygon
Deposit & Withdraw from DSA. Basic-v1.1 connector on polygon triggers methods like deposit, depositFrom, withdraw. You can view details like source code, ABIs on Polygonscan.
- Use
0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
to indicate MATIC. - use -1 or
dsa.maxValue
for the maximum amount in function. - If not sure about the arguments
getId
andsetId
, 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 MATIC: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) |
amt | uint256 | The amount of tokens to deposit. (For max: `uint256(-1)` (Not valid for MATIC)) |
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: MATIC 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 MATIC: 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.
Table of Contents