KDA Pool Deposit Contract Tutorial
only works in testnet
This repository contains tutorials for the Deposit KDA Pool Contract! Here you will find how deploy your Smart Contract with your kda pool using Klever IDE.
- Checkout the contract repository.
Pre Requisites
- Install VSCode and the Rust Analyzer extension.
- Install the Klever IDE Plugin.
- Clone this repository and install the dependencies using cargo.
Understand the Contract
When you create a kda pool, only the owner, admin, and the addresses with Deposit Permission are allowed to deposit into the kda pool. This contract will allow any other address to deposit into your kda pool.
Deploy the Contract
-
You can click on the Klever IDE Icon and Select the deposit-kda-pool contract, and with the right click, selec the option Build Contract.
-
The output must be this:
-
Now you can click on the Klever IDE Icon and Select the deposit-kda-pool again, right click, and select the option Deploy Contract.
-
In arguments page you must pass your Pool ID. Pool ID is your asset id.
-
Congrats, you have deployed your deposit kda pool contract! Now we need to give the correct permissions to the contract.
Contract Permission
-
You need to get the contract address.
-
We must do a Asset Trigger Transaction of type Add Role (6) in the asset of your pool.
-
In Kleverscan make sure to pass the contract address in the Address field and mark the Has Role Deposit
-
Now all addresses can deposit in your kda pool!