UNPKG

@morpho-dev/v2-deployment

Version:
75 lines (54 loc) 2.63 kB
# @morpho-dev/v2-deployment Morpho v2 chain configurations and contract deployment tools for viem. ## Features - 🔗 Pre-configured Morpho Ethereum fork chain for viem - 📋 TypeScript ABI generation - 📍 Address registry with deployment metadata - 🔧 Blue SDK integration helpers ## Installation ```bash npm install @morpho-dev/v2-deployment # or bun add @morpho-dev/v2-deployment ``` ## Fork Definition The **Morpho Ethereum Fork** is a development chain that replicates Ethereum mainnet state at a specific block, pre-configured with: - **Chain ID**: `109111114` - **Base**: Ethereum mainnet fork - **Purpose**: Development, testing, and integration of Morpho v2 protocols - **Features**: - All mainnet contracts and state available - Pre-deployed Morpho v2 contracts - Blue SDK integration with mainnet token data - Fast block times for development ### Shared Development Addresses For internal testing and development, use these pre-funded Anvil addresses: | Label | Address | Private Key | |-------|---------|-------------| | **Alice** | `0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266` | `0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80` | | **Bob** | `0x70997970C51812dc3A010C7d01b50e0d17dc79C8` | `0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d` | | **Charlie** | `0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC` | `0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a` | | **Dave** | `0x90F79bf6EB2c4f870365E785982E1f101E93b906` | `0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6` | | **Eve** | `0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65` | `0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a` | > ⚠️ **Warning**: These are well-known test keys. Never use them on mainnet or with real funds. ## Blue SDK Integration ```typescript import { setupMorphoFork, morphoEthereumFork, deployments, termsAbi } from '@morpho-dev/v2-deployment'; import { getChainAddresses } from '@morpho-org/blue-sdk'; import { createPublicClient, getContract } from "viem"; // Setup Morpho fork with mainnet data (addresses, deployments, tokens) in the blue sdk // Required only if you want to use the blue-sdk setupMorphoFork(); // Get typed addresses for the fork const addresses = getChainAddresses(morphoEthereumFork.id) console.log('Morpho address:', addresses.morpho); const client = createPublicClient({ chain: morphoEthereumFork, transport: http() // will use the default rpc url }); const termsContract = getContract({ client, address: deployments[morphoEthereumFork.id].terms.address, abi: termsAbi, }) ```