Posts

Showing posts with the label InteractingwithAaveProtocol

Using Brownie for Interacting with Aave Protocol (Borrowing & Repaying)

Image
This article is about what to do for using Brownie for Aave protocol after depositing WETH in the Aave lending pool. In our next step, we will try to borrow some Dai. To do this, we should add some dependency contracts to the contracts folder such as AggregatorV3Interface.sol and LinkTokenInterface.sol. We should also modify the deploy.py and brownie-config.yaml files to adapt to our new functionality. Adding the necessary contracts to the contracts folder In this 3rd part of the tutorial, after depositing ETH into the pool, it is time to borrow some DAI using our WETH collateral. There are 2 interfaces to add to the interfaces folder: 1. AggregatorV3Interface.sol 2. LinkTokenInterface.sol pragma solidity ^ 0.6.6; interface LinkTokenInterface function allowance(address owner, address spender) external view returns (uint256 remaining); function approve(address spender, uint256 value) external returns (bool success); function balanceOf(ad...

Using Python Framework Brownie for Interacting with Aave Protocol

Image
In this tutorial, regarding the Aave protocol, we are going to interact with the Aave protocol using Brownie. The first step is to swap ETH with WETH which is necessary when we want to deal with Aave. This lending and borrowing protocol, accept WETH instead of ETH. We add WETH (Wrapped Ethereum) to our Metamask wallet and also create the project folder for interacting with the Aave protocol . After the first (which was swapping ETH with WETH), it is now time to deposit our WETH. To do this, we will download some solidity scripts related to the Aave lending pool, and paste them into the contracts directory of the project folder. Finally, modify the deploy.py to also activate the depositing contracts. Interacting with Aave Protocol by Using Brownie This series of tutorials is the continuation of How to deploy a smart contract using python web3 tools in addition to solidity, smart contracts, and brownie python tools. As a result, it is highly recommended that before you star...