Skip to content

aave/aave-v4-foundry-template

Repository files navigation

Aave v4 Foundry Boilerplate

This repository contains a minimal boilerplate for developing smart contracts that integrate with Aave v4 using Foundry.

Table of Contents

Requirements

  • Foundry

Install or update Foundry:

curl -L https://foundry.paradigm.xyz | bash
foundryup

Initial Setup

Install dependencies

forge install

Create a .env file copying the .env.example file:

cp .env.example .env

Update the .env file with the correct values.

  • RPC_URL – RPC endpoint (Tenderly Virtual TestNet or public network).
  • SPOKE_ADDRESS – Aave v4 spoke (e.g. Core on Ethereum mainnet: 0x89914a22E30CDf88A06e801E407ca82520210a79).
  • RESERVE_ID – Reserve identifier (e.g. 4 for USDC on Core).
  • PRIVATE_KEY – Optional deployer key used by scripts (keep it secret).
  • TENDERLY_ACCESS_KEY – Tenderly access token for verification.

Usage

Build

forge build

Test

forge test

Deploy

forge script script/Deploy_ReserveUtilization.s.sol:DeployReserveUtilization \
  --rpc-url <RPC_URL> \
  --broadcast

Verify

Tenderly Virtual TestNet

forge verify-contract \
  <DEPLOYED_ADDRESS> \
  src/ReserveUtilization.sol:ReserveUtilization \
  --verifier-url <RPC_URL>/verify/etherscan \
  --etherscan-api-key <TENDERLY_ACCESS_KEY> \
  --watch

Etherscan (Public Networks)

forge verify-contract \
  <DEPLOYED_ADDRESS> \
  src/ReserveUtilization.sol:ReserveUtilization \
  --chain <CHAIN_ID> \
  --etherscan-api-key $ETHERSCAN_API_KEY

License

Aave v4 Foundry Boilerplate MIT licensed

About

Foundry Boilerplate project for Aave V4 contracts development

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published