A simple full stack application with smart contract that allows to interact with the Aave lending protocol. With a single function you can deposit ETH and then borrow some DAI against that ETH to your wallet address.
You need to have Metamask Wallet. Connect to the app using your wallet. When connected, your address will show on the top navigation bar. You can follow the Metamask prompts to complete the transactions on the Dapp.
- Aave Protocol
- Metamask Wallet
- Truffle - development framework
- React - front end framework
- Solidity - ethereum smart contract language
- Ganache - local blockchain development
- Web3 - library interact with ethereum nodes
- JavaScript - logic front end and testing smart contracts
- Infura - connection to ethereum networks
- Open Zeppelin - smart contract libraries
- AaveDefi
- migrations
- public
- src
- abis
- components
- contracts index.js
- test
You will node installed node (14.15.4) is preferred
- Clone repository
$ git clone https://github.com/MatricksDeCoder/AaveDeFi.git
- Enter project directory and install dependancies
$ cd AaveDeFi
$ npm install
- Install truffle globally (preferrably [email protected])
$ npm install -g truffle
- Install ganache globally
$ npm install -g ganache-cli
- Run local blockchain as a fork of Ethereum mainnet using ganache-cli and Infura Allow to work with the state of mainnet and deployed contracts on mainnet Go to infura create a new project and copy the mainnet URL e.g Mainnet URL https://mainnet.infura.io/v3/11111111111111111
$ ganache-cli -f https://mainnet.infura.io/v3/11111111111111111
Above should run local blockchain with ganache. Ensure truffle-config.js networks config is your Ganache port. By default it should be host: 127.0.0.1 and port: 8545
- Connect your ganache addresses to Metamask! Copy private Key of the addresses in ganache and import to Metamask Connect your metamask to network Localhost 8545
- To compile contracts e.g you make changes to contracts
$ truffle compile
- Migrate contracts to local running instance fork
$ truffle migrate --reset
- To test contracts
$ truffle test
- Run app locally
$ npm run start
Enter amount of ETH to deposit. Aave has no lower or upper bound amount you may enter. Eg. enter 1 ETH or 0.1 ETH etc Click the button "Borrow DAI" to deposit ETH and borrow an amount of DAI into your wallet from Aave protocol To interact with DAPP you need Metamask installed
- Dapp functionalty hardcoded to only deposit ETH and borrow DAI will in future extend to lend any EC20 and borrow any asset offered in Aave markets
- Display interest rates for borrowing assets
- Display your transactions using subscribe to events e.g DepositBorrow in event in contract or such other etc
- Repay borrowed amount etc
- Withdraw collateral etc
- Metrics like interest rate, liquidation, availaleBorrowsETH, etc
MIT