# Smart Contract interaction

**We DO NOT recommend you proceed with this path unless you are an experienced user and have an urgent need to access the funds.**

**Please be aware of scam, if you are not sure about something, ask** [support](https://docs.kiln.fi/v1/working-with-kiln/support "mention")**, or wait for your prefered UI to be back online.**

**Note: If you are trying to interact with the contract via a Ledger device, Ledger Live does not work currently. We would recommend you connect it with a trusted browser wallet extension, for example Rabby Wallet or Trust Wallet.  See** [**here**](https://support.ledger.com/article/4409801559569-zd) **for more info.**&#x20;

### View your position via Etherscan

1. Open your wallet address on Etherscan:
   1. eg. <https://etherscan.io/address/0x2eec5d4dcbb5c15a7924b54e6cb516a6bb0a1c3f>
2. Click on token holdings and over the ERC-20 to see names related to your preferred application, it will open the holder history filtered on your wallet, where you can find all transaction you did for this defi product.

   <figure><img src="https://1911902555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fnye3yqpuOzdfrtWAlwng%2Fuploads%2F83nyJ4cGTRbDAuxpSbQP%2Fimage.png?alt=media&#x26;token=c9057bf3-54b0-4bf1-9b98-b4a3c7fdfa03" alt="" width="375"><figcaption></figcaption></figure>

   1. You can already see here the amount you hold, here&#x20;
      1. 3136.22 `cwAaveUSDT`
3. On the transaction page, over the Interacted With (To) address and click on it.

   1. Eg. <https://etherscan.io/address/0x924e38bdfda04990fc78fec258e8b83b3478b1af#code>
   2.

   ```
   <figure><img src="https://1911902555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fnye3yqpuOzdfrtWAlwng%2Fuploads%2F1YKSPzxypFdc5a0mdknR%2Fimage.png?alt=media&#x26;token=eac4807f-9198-48b6-b973-da61d94301c9" alt=""><figcaption></figcaption></figure>
   ```
4. On the deposit contract page, navigate to the `Contract` tab and sub tab  `Read as Proxy` , find `31. maxRedeem (0xd905777e)`&#x20;
   1. Input your wallet address, and click **query.**

   2. eg. for `0x2eEC5D4dcBB5C15A7924b54E6CB516A6BB0A1C3F`  it returns: <mark style="color:purple;">`3136221376`</mark> it's the amount in USDT your principal + rewards is worth.&#x20;

   3. To see this amount in a human readable format, read the `19. decimals (0x313ce567)` function on the same page.&#x20;
      1. eg. for this defi position I receive <mark style="color:orange;">`6`</mark>` ``decimals`&#x20;
      2. You can then multiply the maxRedeem value  <mark style="color:purple;">`3136221376`</mark> to 1e-`decimals` , so here <mark style="color:purple;">`3136221376`</mark><mark style="color:$primary;">`*1e-`</mark><mark style="color:orange;">`6`</mark> <mark style="color:orange;"></mark><mark style="color:orange;">=</mark> `3 136,221376`

   4. To confirm the asset read the `11. asset (0x38d52e0f)` function on the same page, and click on the asset address, you will see the asset deposited in this defi position here. <mark style="color:$success;">`USDT`</mark>.
      1\.

      ```
      <figure><img src="https://1911902555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fnye3yqpuOzdfrtWAlwng%2Fuploads%2FfZ9nbHDTjPldzBFPG6Dw%2Fimage.png?alt=media&#x26;token=c7aeeb31-4b93-4c16-8516-1b5123be271e" alt=""><figcaption></figcaption></figure>
      ```

   5. Doing so I can confirm that I own and can redeem anytime  `3 136,221376 USDT`&#x20;

### Withdraw all assets deposited aka Redeem via Etherscan

*Requirement, connnect you wallet to a browser wallet or use Wallet Connect to connect to Etherscan.*&#x20;

In this example we show how you can **withdraw all your asset from your position** in Etherscan.&#x20;

1. Find the defi position deposit contract (see [#view-your-position-via-etherscan](#view-your-position-via-etherscan "mention"))
   1. eg. <https://etherscan.io/address/0x924e38bdfda04990fc78fec258e8b83b3478b1af#code>
2. On the deposit contract page, navigate to the `Contract` tab and sub tab  `Read as Proxy` , find `12.balanceOf 0x70a08231)`&#x20;
   1. Past your wallet address and click **query**.
   2. eg. for `0x2eEC5D4dcBB5C15A7924b54E6CB516A6BB0A1C3F` , it's `3136221376` , this is the amount of shared you own, it's representing your principal + all rewards.
3. On the deposit contract page, navigate to the `Contract` tab and sub tab  `Write as Proxy` , find `16.redeem (0xba087652)`&#x20;
   1. &#x20;Input the value you got from the previous `balanceOf`  read on step 2, and your wallet for `receiver`  and `owner` . (Make sure you connect your wallet on top)
      1\.

      ```
      <figure><img src="https://1911902555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fnye3yqpuOzdfrtWAlwng%2Fuploads%2F3v9kvrxt419mRHMdPEyo%2Fimage.png?alt=media&#x26;token=cd0373ab-d38f-491c-acd4-0f7f347c35b3" alt=""><figcaption></figcaption></figure>
      ```
   2. You will be prompted in your wallet to sign the transaction.&#x20;

      <figure><img src="https://1911902555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fnye3yqpuOzdfrtWAlwng%2Fuploads%2FbMauopPjkpO7oTgUwsRh%2Fimage.png?alt=media&#x26;token=43b729c6-5cb5-4418-8db3-7967d030b517" alt="" width="375"><figcaption></figcaption></figure>
4. After signing this one transaction you will directly receive the assets directly in your wallet.&#x20;
