@morpho-labs/v2-deployment
Version:
Morpho v2 chain configurations for viem
252 lines • 9.82 kB
TypeScript
/**
* @fileoverview Morpho Ethereum fork chain configurations for viem
*/
/**
* Morpho Ethereum Fork - Tenderly Virtual Testnet
*
* This chain configuration represents a Tenderly virtual testnet that forks Ethereum mainnet
* with Morpho protocol deployed and configured for testing purposes.
*
* Chain Details:
* - Fork of Ethereum mainnet
* - Tenderly Virtual Network ID: 03ab649e-b1f3-4e0a-8a75-cedd386802b0
* - Pre-deployed Morpho v2 contracts
* - Enhanced for testing and development
*/
export declare const morphoEthereumFork: {
blockExplorers: {
readonly default: {
readonly name: "Tenderly Explorer";
readonly url: "https://dashboard.tenderly.co/explorer/vnet/03ab649e-b1f3-4e0a-8a75-cedd386802b0";
};
};
blockTime?: number | undefined | undefined;
contracts: {
readonly ensRegistry: {
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
};
readonly ensUniversalResolver: {
readonly address: "0xE4Acdd618deED4e6d2f03b9bf62dc6118FC9A4da";
readonly blockCreated: 16773775;
};
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 14353601;
};
};
ensTlds?: readonly string[] | undefined;
id: 1111;
name: "Morpho Ethereum Fork";
nativeCurrency: {
readonly decimals: 18;
readonly name: "Ether";
readonly symbol: "ETH";
};
experimental_preconfirmationTime?: number | undefined | undefined;
rpcUrls: {
readonly default: {
readonly http: readonly ["https://virtual.mainnet.rpc.tenderly.co/03ab649e-b1f3-4e0a-8a75-cedd386802b0"];
};
readonly public: {
readonly http: readonly ["https://virtual.mainnet.rpc.tenderly.co/03ab649e-b1f3-4e0a-8a75-cedd386802b0"];
};
};
sourceId: 1;
testnet: true;
custom?: Record<string, unknown> | undefined;
fees?: import("viem").ChainFees<undefined> | undefined;
formatters?: undefined;
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
};
/**
* Alternative configuration for local development
* Uses a more generic setup for cases where you want to use your own Tenderly fork
*/
export declare const createMorphoFork: (params: {
/** Tenderly virtual network ID */
vnetId: string;
/** Custom chain ID (optional, defaults to 1337) */
chainId?: number;
/** Custom chain name (optional) */
name?: string;
}) => {
blockExplorers: {
readonly default: {
readonly name: "Tenderly Explorer";
readonly url: `https://dashboard.tenderly.co/explorer/vnet/${string}`;
};
};
blockTime?: number | undefined | undefined;
contracts: {
readonly ensRegistry: {
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
};
readonly ensUniversalResolver: {
readonly address: "0xE4Acdd618deED4e6d2f03b9bf62dc6118FC9A4da";
readonly blockCreated: 16773775;
};
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 14353601;
};
};
ensTlds?: readonly string[] | undefined;
id: number;
name: string;
nativeCurrency: {
readonly decimals: 18;
readonly name: "Ether";
readonly symbol: "ETH";
};
experimental_preconfirmationTime?: number | undefined | undefined;
rpcUrls: {
readonly default: {
readonly http: readonly [`https://virtual.mainnet.rpc.tenderly.co/${string}`];
};
readonly public: {
readonly http: readonly [`https://virtual.mainnet.rpc.tenderly.co/${string}`];
};
};
sourceId: 1;
testnet: true;
custom?: Record<string, unknown> | undefined;
fees?: import("viem").ChainFees<undefined> | undefined;
formatters?: undefined;
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
};
/**
* Export commonly used chain configurations
*/
export declare const chains: {
readonly morphoEthereumFork: {
blockExplorers: {
readonly default: {
readonly name: "Tenderly Explorer";
readonly url: "https://dashboard.tenderly.co/explorer/vnet/03ab649e-b1f3-4e0a-8a75-cedd386802b0";
};
};
blockTime?: number | undefined | undefined;
contracts: {
readonly ensRegistry: {
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
};
readonly ensUniversalResolver: {
readonly address: "0xE4Acdd618deED4e6d2f03b9bf62dc6118FC9A4da";
readonly blockCreated: 16773775;
};
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 14353601;
};
};
ensTlds?: readonly string[] | undefined;
id: 1111;
name: "Morpho Ethereum Fork";
nativeCurrency: {
readonly decimals: 18;
readonly name: "Ether";
readonly symbol: "ETH";
};
experimental_preconfirmationTime?: number | undefined | undefined;
rpcUrls: {
readonly default: {
readonly http: readonly ["https://virtual.mainnet.rpc.tenderly.co/03ab649e-b1f3-4e0a-8a75-cedd386802b0"];
};
readonly public: {
readonly http: readonly ["https://virtual.mainnet.rpc.tenderly.co/03ab649e-b1f3-4e0a-8a75-cedd386802b0"];
};
};
sourceId: 1;
testnet: true;
custom?: Record<string, unknown> | undefined;
fees?: import("viem").ChainFees<undefined> | undefined;
formatters?: undefined;
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
};
};
/**
* Type definitions for the chains
*/
export type MorphoChain = typeof morphoEthereumFork;
export type SupportedMorphoChain = keyof typeof chains;
/**
* Helper function to register Morpho contract addresses, deployments, and unwrapped tokens
* for fork chains with the blue-sdk registry.
*
* This enables the blue-sdk to work seamlessly with Morpho fork chains
* by providing the necessary contract addresses, deployment block numbers, and token mappings.
*
* @param options - Configuration object
* @param options.addresses - Morpho contract addresses for the fork chain
* @param options.deployments - Optional deployment block numbers for the contracts
* @param options.unwrappedTokens - Optional mapping of wrapped tokens to their unwrapped equivalents
* @param options.chainId - Chain ID of the fork (defaults to 1111 for morphoEthereumFork)
*
* @example
* import { registerMorphoForkAddresses } from '@morpho-labs/v2-deployment';
*
* // Register addresses for the default Morpho fork
* registerMorphoForkAddresses({
* addresses: {
* morpho: '0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb',
* permit2: '0x000000000022D473030F116dDEE9F6B43aC78BA3',
* adaptiveCurveIrm: '0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC',
* wNative: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
* },
* deployments: {
* morpho: 18883124n,
* permit2: 15986406n,
* },
* unwrappedTokens: {
* '0xWrappedToken': '0xUnderlyingToken'
* }
* });
*
*/
export declare function registerMorphoForkAddresses({ addresses, deployments, unwrappedTokens, chainId, }: {
addresses: import('@morpho-org/blue-sdk').ChainAddresses;
deployments?: import('@morpho-org/blue-sdk').ChainDeployments;
unwrappedTokens?: Record<import('@morpho-org/blue-sdk').Address, import('@morpho-org/blue-sdk').Address>;
chainId?: number;
}): void;
/**
* Convenience function to register the complete Morpho mainnet configuration
* (addresses, deployments, and unwrapped tokens) for the morphoEthereumFork chain.
*
* This function automatically pulls the latest mainnet data from blue-sdk
* and registers it for the fork chain, providing a complete setup.
*
* @param chainId - Optional chain ID to register for (defaults to 1111 for morphoEthereumFork)
*
* @example
* import { setupMorphoFork } from '@morpho-labs/v2-deployment';
*
* // Set up blue-sdk to work with the Morpho fork
* setupMorphoFork();
*
* // Now you can use blue-sdk with the morphoEthereumFork chain
* import { getChainAddresses, addressesRegistry } from '@morpho-org/blue-sdk';
* const addresses = getChainAddresses(1111); // morphoEthereumFork.id
* console.log(addresses.morpho); // Will be properly typed and available
*/
export declare function setupMorphoFork(chainId?: number): void;
/**
* Get the properly typed addresses for the Morpho Ethereum fork chain.
* This function ensures that after setup, the addresses are correctly typed
* and available for use with blue-sdk.
*
* @param chainId - Chain ID to get addresses for (defaults to 1111 for morphoEthereumFork)
* @returns Properly typed ChainAddresses for the fork chain
*
* @example
* import { setupMorphoFork, getMorphoForkAddresses } from '@morpho-labs/v2-deployment';
*
* // First set up the fork
* setupMorphoFork();
*
* // Then get the addresses with proper typing
* const addresses = getMorphoForkAddresses(); // Properly typed as ChainAddresses
* console.log(addresses.morpho); // TypeScript knows this is an Address
*/
export declare function getMorphoForkAddresses(chainId?: number): import('@morpho-org/blue-sdk').ChainAddresses;
//# sourceMappingURL=chains.d.ts.map