@aave/core-v3

中文文档
1.19.3发布于 2024/03/07BUSL-1.1CommonJS零依赖近 30 天下载 1.1万

Aave Protocol V3 core smart contracts

原始使用文档
文档目录7 节
  1. What is Aave?
  2. Documentation
  3. Audits and Formal Verification
  4. Connect with the community
  5. Getting Started
  6. Setup
  7. Test

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

版本与发布记录

@aave/core-v3 共发布 17 个版本,首次发布于 2022/01/28;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.19.3latest2024/03/072 年前
1.19.2-beta.12024/02/282 年前
1.19.22024/02/272 年前
1.19.12024/02/272 年前
1.18.02023/07/043 年前
1.19.02023/07/043 年前

关于 @aave/core-v3 的常见问题

@aave/core-v3 是什么?

Aave Protocol V3 core smart contracts

如何安装 @aave/core-v3?

在项目目录运行 npm install @aave/core-v3,或使用 pnpm add / yarn add / bun add。

@aave/core-v3 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/aave__core-v3 是否存在。

@aave/core-v3 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@aave/core-v3 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=16.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@aave/core-v3 可以商用吗?

@aave/core-v3 使用 BUSL-1.1 许可。声明的许可为 BUSL-1.1,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@aave/core-v3 的下载量有多少?

根据 npm 官方下载统计,@aave/core-v3 在 2026/10/05 – 2026/11/03 这 30 天内被下载 11,248 次,日均约 375 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aave/core-v3 还在维护吗?

最新版本 1.19.3 发布于 2024/03/07(2 年前);至今共发布 17 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/01/28。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。