• Stars
    star
    779
  • Rank 56,379 (Top 2 %)
  • Language
    TypeScript
  • License
    Other
  • Created almost 3 years ago
  • Updated 22 days 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,367
star
2

protocol-v2

Aave Protocol V2
TypeScript
646
star
3

flashloan-box

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

interface

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

gho-core

Solidity
220
star
6

governance-crosschain-bridges

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

aave-js

TypeScript
140
star
8

aave-ui

[DEPRECATED] An open source interface for the decentralized liquidity protocol Aave
TypeScript
126
star
9

aave-v3-periphery

TypeScript
113
star
10

protocol-subgraphs

The code of Aave protocol subgraphs
TypeScript
106
star
11

code-examples-protocol

Solidity
102
star
12

aip

Aave Improvement Proposals
JavaScript
98
star
13

aave-utilities

TypeScript
95
star
14

gho-bug-bounty

79
star
15

aave-stake-v2

V2 implementation of the stkAAVE token
Solidity
53
star
16

governance-v2

TypeScript
44
star
17

aave-v3-deploy

TypeScript
40
star
18

ethlondon-flash

Flashy workshop
JavaScript
32
star
19

aave-sandbox

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

bug-bounty

22
star
21

aave-token

AAVE token implementation
TypeScript
21
star
22

Aave-Vault

ERC4626 vault to hold aToken assets
Solidity
19
star
23

aave-token-v2

V2 implementation of the AAVE token
TypeScript
18
star
24

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
17
star
25

safety-module

Safety module implementation for the Aave protocol
TypeScript
17
star
26

aave-ui-kit

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

price-aggregators

Solidity
12
star
28

governance-v2-subgraph

TypeScript
11
star
29

incentives-controller

TypeScript
10
star
30

liquidation-ui

TypeScript
8
star
31

upgradeable-configurable-rights-pool

Solidity
8
star
32

dlp-docs-abi

Initial documentation of the Decentralized Lending Pool protocol developed by Aave
JavaScript
8
star
33

docs-v3

8
star
34

aave-asset-listing

TypeScript
7
star
35

branding-assets

Repository for the Aave protocol branding assets
7
star
36

gho-aip

Solidity
6
star
37

loanlord-bot

An open source bot that interacts with the ETHLend platform.
JavaScript
4
star
38

aave-api

Misc Aave api
TypeScript
4
star
39

aip-uploader

JavaScript
3
star
40

markets-adapters

Adapters smart contracts used on different Aave markets
TypeScript
3
star
41

split-croatia-workshop

https://aave.github.io/split-croatia-workshop/
JavaScript
3
star
42

aave-grants-update-and-renewal

TypeScript
3
star
43

tests-protocol-v2-sigmaprime

Test suite for the Aave Protocol v2 by SigmaPrime during their audit
Solidity
3
star
44

gho-public

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

docs-gho

JavaScript
2
star
46

arc-timelock

Set of contracts for Timelock Executor of ARC Market
TypeScript
2
star
47

v3-retroactive-funding

V3 Retroactive funding proposal
TypeScript
2
star
48

risk-v3

2
star
49

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
2
star
50

proto-governance

Aave governance based on LEND token
TypeScript
2
star
51

aave-addresses

TypeScript
2
star
52

aavenomics

2
star
53

aave-gitcoin-hackaton-2019

2
star
54

cloudflare-update-action

JavaScript
1
star
55

pinata-action

Github action to upload & pin to pinata
JavaScript
1
star
56

docs-v2

1
star