diff --git a/networks.json b/networks.json index 67fa798..9783836 100644 --- a/networks.json +++ b/networks.json @@ -1,16 +1,24 @@ { "mainnet": { "MorphoBlue": { - "address": "0x0000000000000000000000000000000000000000", - "startBlock": 0 + "address": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb", + "startBlock": 18883124 + }, - "Contract": { - "address": "0x38989BBA00BDF8181F4082995b3DEAe96163aC5D" + "MetaMorphoFactory": { + "address": "0xa9c3d3a366466fa809d1ae982fb2c46e5fc41101", + "startBlock": 18925584 } }, - "goerli": { - "Contract": { - "address": "0x0000000000000000000000000000000000000000" + "base": { + "MorphoBlue": { + "address": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb", + "startBlock": 13977148 + + }, + "MetaMorphoFactory": { + "address": "0xa9c3d3a366466fa809d1ae982fb2c46e5fc41101", + "startBlock": 13978134 } } } \ No newline at end of file diff --git a/package.json b/package.json index feb220b..86f4bd8 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,10 @@ "license": "MIT", "scripts": { "codegen": "graph codegen", - "build": "graph build", + "build:mainnet": "graph build --network mainnet", + "build:base": "graph build --network base", + "deploy:studio:base": "graph deploy --studio morpho-blue-base --network base", + "deploy:studio:mainnet": "graph deploy --studio morpho-blue-base --network mainnet", "create-local": "graph create --node http://localhost:8020/ morpho-org/morpho-blue", "remove-local": "graph remove --node http://localhost:8020/ morpho-org/morpho-blue", "deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 morpho-org/morpho-blue", diff --git a/schema.graphql b/schema.graphql index 7d7acd8..08f2483 100644 --- a/schema.graphql +++ b/schema.graphql @@ -25,6 +25,7 @@ enum Network { MATIC # aka Polygon GNOSIS GOERLI + BASE } enum ProtocolType { diff --git a/src/initializers/protocol.ts b/src/initializers/protocol.ts index 772edef..8d91cb4 100644 --- a/src/initializers/protocol.ts +++ b/src/initializers/protocol.ts @@ -10,27 +10,21 @@ import { INT_ZERO, } from "../sdk/constants"; -const MORPHO_BLUE_ADDRESS = new Map(); -MORPHO_BLUE_ADDRESS.set( - "mainnet", - Address.fromString("0xbbbbbbbbbb9cc5e90e3b3af64bdaf62c37eeffcb") +const MORPHO_BLUE_ADDRESS = Address.fromString( + "0xbbbbbbbbbb9cc5e90e3b3af64bdaf62c37eeffcb" ); let protocol: LendingProtocol | null = null; export function getProtocol(): LendingProtocol { if (protocol !== null) return protocol!; - protocol = LendingProtocol.load( - MORPHO_BLUE_ADDRESS.get(dataSource.network()) - ); + protocol = LendingProtocol.load(MORPHO_BLUE_ADDRESS); if (protocol) return protocol!; protocol = initBlue(); return protocol!; } function initBlue(): LendingProtocol { - const protocol = new LendingProtocol( - MORPHO_BLUE_ADDRESS.get(dataSource.network()) - ); + const protocol = new LendingProtocol(MORPHO_BLUE_ADDRESS); protocol.protocol = "Morpho"; protocol.name = "Morpho Blue"; protocol.slug = "morpho-blue"; diff --git a/src/sdk/constants.ts b/src/sdk/constants.ts index 48a4dde..0863c99 100644 --- a/src/sdk/constants.ts +++ b/src/sdk/constants.ts @@ -12,6 +12,7 @@ import { _ActiveAccount } from "../../generated/schema"; // https://thegraph.com/docs/en/hosted-service/what-is-hosted-service/#supported-networks-on-the-hosted-service export namespace Network { export const ARBITRUM_ONE = "ARBITRUM_ONE"; + export const BASE = "BASE"; export const ARWEAVE_MAINNET = "ARWEAVE_MAINNET"; export const AURORA = "AURORA"; export const AVALANCHE = "AVALANCHE";