• Stars
    star
    866
  • Rank 52,675 (Top 2 %)
  • Language
    TypeScript
  • License
    Other
  • Created over 3 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This repository contains the core smart contracts of the Aave V3 protocol.

Build pass codecov

        .///.                .///.     //.            .//  `/////////////-
       `++:++`              .++:++`    :++`          `++:  `++:......---.`
      `/+: -+/`            `++- :+/`    /+/         `/+/   `++.
      /+/   :+/            /+:   /+/    `/+/        /+/`   `++.
  -::/++::`  /+:       -::/++::` `/+:    `++:      :++`    `++/:::::::::.
  -:+++::-`  `/+:      --++/---`  `++-    .++-    -++.     `++/:::::::::.
   -++.       .++-      -++`       .++.    .++.  .++-      `++.
  .++-         -++.    .++.         -++.    -++``++-       `++.
 `++:           :++`  .++-           :++`    :+//+:        `++:----------`
 -/:             :/-  -/:             :/.     ://:         `/////////////-

Aave Protocol v3

This repository contains the smart contracts source code and markets configuration for Aave Protocol V3. The repository uses Docker Compose and Hardhat as development environment for compilation, testing and deployment tasks.

What is Aave?

Aave is a decentralized non-custodial liquidity markets protocol where users can participate as suppliers or borrowers. Suppliers provide liquidity to the market to earn a passive income, while borrowers are able to borrow in an overcollateralized (perpetually) or undercollateralized (one-block liquidity) fashion.

Documentation

See the link to the technical paper or visit the Aave Developer docs

Audits and Formal Verification

You can find all audit reports under the audits folder

V3.0.1 - December 2022

V3 Round 1 - October 2021

V3 Round 2 - December 2021

Formal Verification - November 2021-January 2022

Connect with the community

You can join the Discord channel or the Governance Forum to ask questions about the protocol or talk about Aave with other peers.

Getting Started

You can install @aave/core-v3 as an NPM package in your Hardhat or Truffle project to import the contracts and interfaces:

npm install @aave/core-v3

Import at Solidity files:

import {IPool} from "@aave/core-v3/contracts/interfaces/IPool.sol";

contract Misc {

  function supply(address pool, address token, address user, uint256 amount) public {
    IPool(pool).supply(token, amount, user, 0);
    {...}
  }
}

The JSON artifacts with the ABI and Bytecode are also included in the bundled NPM package at artifacts/ directory.

Import JSON file via Node JS require:

const PoolV3Artifact = require('@aave/core-v3/artifacts/contracts/protocol/pool/Pool.sol/Pool.json');

// Log the ABI into console
console.log(PoolV3Artifact.abi)

Setup

The repository uses Docker Compose to manage sensitive keys and load the configuration. Prior to any action like test or deploy, you must run docker-compose up to start the contracts-env container, and then connect to the container console via docker-compose exec contracts-env bash.

Follow the next steps to setup the repository:

  • Install docker and docker-compose
  • Create an environment file named .env and fill the next environment variables
# Add Alchemy or Infura provider keys, alchemy takes preference at the config level
ALCHEMY_KEY=""
INFURA_KEY=""


# Optional, if you plan to use Tenderly scripts
TENDERLY_PROJECT=""
TENDERLY_USERNAME=""

Test

You can run the full test suite with the following commands:

# In one terminal
docker-compose up

# Open another tab or terminal
docker-compose exec contracts-env bash

# A new Bash terminal is prompted, connected to the container
npm run test

More Repositories

1

aave-protocol

Aave Protocol Version 1.0 - Decentralized Lending Pools
HTML
1,384
star
2

protocol-v2

Aave Protocol V2
TypeScript
660
star
3

flashloan-box

A box containing all you need to get started with developing Aave v1 flash loans
Solidity
582
star
4

interface

An open source interface for the decentralized liquidity protocol Aave
TypeScript
407
star
5

gho-core

Solidity
252
star
6

governance-crosschain-bridges

This repo contains the crosschain governance bridges used for the aave markets deployed across different networks
TypeScript
165
star
7

aave-js

TypeScript
142
star
8

aave-v3-periphery

TypeScript
132
star
9

aave-ui

[DEPRECATED] An open source interface for the decentralized liquidity protocol Aave
TypeScript
127
star
10

aave-utilities

TypeScript
119
star
11

protocol-subgraphs

The code of Aave protocol subgraphs
TypeScript
116
star
12

aip

Aave Improvement Proposals
JavaScript
103
star
13

code-examples-protocol

Solidity
103
star
14

gho-bug-bounty

81
star
15

aave-stake-v2

V2 implementation of the stkAAVE token
Solidity
57
star
16

aave-v3-deploy

TypeScript
45
star
17

governance-v2

TypeScript
44
star
18

Aave-Vault

ERC4626 vault to hold aToken assets
Solidity
42
star
19

ethlondon-flash

Flashy workshop
JavaScript
34
star
20

aave-sandbox

Sandbox of Aave Markets that replicates a forked production environment. The environment is envisioned for testing liquidations or other integrations.
TypeScript
31
star
21

aptos-aave-v3

Aave's V3 Protocol on Aptos
Move
26
star
22

bug-bounty

25
star
23

aave-token

AAVE token implementation
TypeScript
23
star
24

aave-token-v2

V2 implementation of the AAVE token
TypeScript
21
star
25

safety-module

Safety module implementation for the Aave protocol
TypeScript
20
star
26

aave-ui-caching-server

Thin and simple data caching layer to give better "real time" experience to users of https://github.com/aave/aave-ui
TypeScript
18
star
27

aave-ui-kit

Package containing UI components and helpers used on https://github.com/aave/aave-ui
TypeScript
18
star
28

price-aggregators

Solidity
14
star
29

governance-v2-subgraph

TypeScript
12
star
30

incentives-controller

TypeScript
12
star
31

liquidation-ui

TypeScript
11
star
32

branding-assets

Repository for the Aave protocol branding assets
11
star
33

docs-v3

11
star
34

upgradeable-configurable-rights-pool

Solidity
10
star
35

dlp-docs-abi

Initial documentation of the Decentralized Lending Pool protocol developed by Aave
JavaScript
10
star
36

aave-asset-listing

TypeScript
8
star
37

gho-aip

Solidity
8
star
38

markets-adapters

Adapters smart contracts used on different Aave markets
TypeScript
6
star
39

loanlord-bot

An open source bot that interacts with the ETHLend platform.
JavaScript
5
star
40

aave-api

Misc Aave api
TypeScript
5
star
41

risk-v3

5
star
42

tests-protocol-v2-sigmaprime

Test suite for the Aave Protocol v2 by SigmaPrime during their audit
Solidity
5
star
43

docs-gho

JavaScript
4
star
44

aip-uploader

JavaScript
4
star
45

docs-v2

4
star
46

split-croatia-workshop

https://aave.github.io/split-croatia-workshop/
JavaScript
4
star
47

proto-governance

Aave governance based on LEND token
TypeScript
4
star
48

gho-public

Gho is a collateral backed stablecoin that can be natively integrated into the Aave Protocol
4
star
49

aavenomics

4
star
50

aave-grants-update-and-renewal

TypeScript
4
star
51

arc-timelock

Set of contracts for Timelock Executor of ARC Market
TypeScript
3
star
52

v3-retroactive-funding

V3 Retroactive funding proposal
TypeScript
3
star
53

walletconnect-connector

Fork of @web3-react/walletconnect-connector from deprecated V6 version of uniswap/web3-react, which is still in use on aave/interface
TypeScript
3
star
54

aave-addresses

TypeScript
3
star
55

gho-brand-assets

3
star
56

pinata-action

Github action to upload & pin to pinata
JavaScript
2
star
57

cloudflare-update-action

JavaScript
2
star
58

aave-gitcoin-hackaton-2019

2
star
59

governance-delegation-subgraph

TypeScript
1
star
60

token-wrappers

Foundry-based repository for testing token wrappers for supply/withdrawal from v3 Pools
Solidity
1
star
61

genesis-migration

Misc smart contracts used on the LEND -> AAVE migration
TypeScript
1
star