npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@sebasgoldberg/hardhat-aave

v0.0.9

Published

Hardhat plugin to use existing contract instances.

Downloads

12

Readme

hardhat-aave-plugin

This plug-in it is used to encapsulate operations with the AAVE protocol.

Hardhat AAVE plugin.

What

This plugin will help you with:

  • The AAVE contract interaction, suppling type information based in constracts abis.
  • Simplified interaction with the protocol for all supported networks using hardhat-network-alias.

Installation

npm install @sebasgoldberg/hardhat-aave

Import the plugin in your hardhat.config.js:

require("@sebasgoldberg/hardhat-aave");

Or if you are using TypeScript, in your hardhat.config.ts:

import "@sebasgoldberg/hardhat-aave";

Tasks

There are no tasks for this plugin.

Environment extensions

This plugin extends the Hardhat Runtime Environment by adding an aave field whose type is AAVE.

Here is a simple usage example to get the AAVE Pool contract for the selected network:

// ...
const pool = await this.hre.aave.getPool()
// ...

Note that pool has the type Pool generated using typechains.

Configuration

Network Aliases

You must configure the hre.config.networkAliases key, adding the "aave-plugin" group, and for this group especify for each of your project networks, wich of the hardhat-aave-plugin predifined networks should be mapped.

This is necessary to know wich AAVE's contract addresses should be used for each one of your hardhat project networks.

Here is an example of the configuration:

import { AVALANCHE_MAINNET_NETWORK } from "@sebasgoldberg/hardhat-aave";
// ...

const config: HardhatUserConfig = {
  //...
  networkAliases: {
    "aave-plugin": {
      'localhost': AVALANCHE_MAINNET_NETWORK,
      'mainnet': AVALANCHE_MAINNET_NETWORK,
    }
  },
  //...
};
// ...

In the example above we are telling that 'mainnet' and 'localhost' networks configured in the hardhat project, should use the Avalanche Mainnet contract addresses.

Custom Network and Address Redefinitions

In case you need to redefine a contract address for a specific network, you can do this using the hre.config.aave.contractAddressByNetwork.

You can also define addresses for your own network using the CUSTOM_NETWORK key.

Here is an example (including networkAliases):

import { AVALANCHE_MAINNET_NETWORK, CUSTOM_NETWORK } from "@sebasgoldberg/hardhat-aave";
// ...

const config: HardhatUserConfig = {
  //...
  aave: {
    contractAddressByNetwork: {
      [AVALANCHE_MAINNET_NETWORK]: {
        PoolAddressesProvider: '0x0123456789012345678901234567890123456789'
      },
      [CUSTOM_NETWORK]: {
        PoolAddressesProvider: '0xABCDEFABCDEFABCDEFABCDEFABCDEFABCDEFABCD'
      }
    },
  },
  //...
  networkAliases: {
    "aave-plugin": {
      'hardhat': CUSTOM_NETWORK
      'localhost': AVALANCHE_MAINNET_NETWORK,
      'mainnet': AVALANCHE_MAINNET_NETWORK,
    }
  },
  //...
};
// ...