Getting Started with Bundler3
This tutorial will guide you through setting up your development environment for Morpho Bundler3, the newest version of Morpho’s bundler contracts.
- Bundler3 repository: morpho-org/bundler3
- Bundler2 repository: morpho-org/morpho-blue-bundlers.
Prerequisites
- Git
- Node.js (preferably the latest LTS)
- Yarn (or your favorite package manager)
- Foundry (for Forge tests)
- If you haven’t installed Foundry yet, follow the Foundry Book installation guide.
- Alchemy (or Infura) API key (if you plan to connect to mainnet or testnets)
Steps
-
Clone the Bundler3 repository:
git clone https://github.com/morpho-org/bundler3
cd bundler3 -
Install dependencies:
yarn install
-
Set up your Alchemy API key:
export ALCHEMY_KEY=<your_alchemy_key>
-
Run tests to ensure everything is set up correctly:
By default, this tests on chain ID 1 (Ethereum).
forge test
Optionally specify another chain, e.g. Base (8453):
forge test --chain 8453
Note: The first time you run the tests, it will build Morpho, which may take a few minutes.
-
Explore the repository:
./src/Bundler3.sol
is the main contract, exposing the multicall entry point../src/adapters/
contains the pre-built adapters (e.g. GeneralAdapter1, EthereumGeneralAdapter1, ParaswapAdapter), each inheriting from CoreAdapter../test/
folder contains Forge-based tests demonstrating Bundler3 usage.
Now your development environment is ready for working with Morpho Bundlers!