Skip to content

Commit

Permalink
feat: add base sepolia support
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyar committed Dec 5, 2024
1 parent b60c302 commit b8968a9
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 21 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
"@types/node": "^20.5.9",
"@typescript-eslint/eslint-plugin": "^5.40.1",
"@typescript-eslint/parser": "^5.40.1",
"@venusprotocol/governance-contracts": "2.5.0-dev.4",
"@venusprotocol/isolated-pools": "3.6.0",
"@venusprotocol/governance-contracts": "2.5.0-dev.6",
"@venusprotocol/isolated-pools": "3.7.0-dev.6",
"@venusprotocol/oracle": "2.6.0",
"@venusprotocol/protocol-reserve": "2.3.0",
"@venusprotocol/solidity-utilities": "^2.0.3",
Expand Down Expand Up @@ -86,7 +86,7 @@
"typescript": "^4.8.4"
},
"resolutions": {
"@venusprotocol/governance-contracts": "2.5.0-dev.4",
"@venusprotocol/governance-contracts": "2.5.0-dev.6",
"@venusprotocol/venus-protocol": "9.3.0",
"prettier": "^3.0.3"
},
Expand Down
12 changes: 12 additions & 0 deletions subgraphs/cross-chain-governance/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import optimismSepoliaDeployments from '@venusprotocol/governance-contracts/depl
import sepoliaDeployments from '@venusprotocol/governance-contracts/deployments/sepolia_addresses.json';
import zkSyncDeployments from '@venusprotocol/governance-contracts/deployments/zksyncmainnet_addresses.json';
import zkSyncSepoliaDeployments from '@venusprotocol/governance-contracts/deployments/zksyncsepolia_addresses.json';
import baseSepoliaDeployments from '@venusprotocol/governance-contracts/deployments/basesepolia_addresses.json';
import fs from 'fs';
import Mustache from 'mustache';

Expand All @@ -23,6 +24,7 @@ export const getNetwork = () => {
'zkSync',
'optimismSepolia',
'optimism',
'baseSepolia',
] as const;
const network = process.env.NETWORK;
// @ts-expect-error network env var is unknown here
Expand Down Expand Up @@ -137,6 +139,16 @@ const main = () => {
accessControlManagerAddress: optimismDeployments.addresses.AccessControlManager,
accessControlManagerStartBlock: '125490536',
},
baseSepolia: {
network: 'base-sepolia',
layerZeroChainId: 10245,
omnichainGovernanceOwnerAddress: baseSepoliaDeployments.addresses.OmnichainExecutorOwner,
startBlockOmnichainGovernanceOwner: '18475319',
omnichainExecutorOwnerAddress: baseSepoliaDeployments.addresses.OmnichainGovernanceExecutor,
startBlockOmnichainGovernanceExecutor: '18470846',
accessControlManagerAddress: baseSepoliaDeployments.addresses.AccessControlManager,
accessControlManagerStartBlock: '16737038',
},
};

const yamlTemplate = fs.readFileSync('template.yaml', 'utf8');
Expand Down
4 changes: 3 additions & 1 deletion subgraphs/cross-chain-governance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"deploy:optimism": "yarn prepare:optimism && yarn graph deploy --studio venus-governance-optimism",
"deploy:zkSyncSepolia": "yarn prepare:zkSyncSepolia && yarn graph deploy --studio venus-governance-zksyncsepolia",
"deploy:zkSync": "yarn prepare:zkSync && yarn graph deploy --studio venus-governance-zksync",
"deploy:baseSepolia": "yarn prepare:baseSepolia && yarn graph deploy --studio venus-governance-base-sepolia",
"prepare:docker": "NETWORK=docker yarn ts-node config/index.ts",
"prepare:ethereum": "NETWORK=ethereum yarn ts-node config/index.ts",
"prepare:sepolia": "NETWORK=sepolia yarn ts-node config/index.ts",
Expand All @@ -33,14 +34,15 @@
"prepare:optimism": "NETWORK=optimism yarn ts-node config/index.ts",
"prepare:zkSyncSepolia": "NETWORK=zkSyncSepolia yarn ts-node config/index.ts",
"prepare:zkSync": "NETWORK=zkSync yarn ts-node config/index.ts",
"prepare:baseSepolia": "NETWORK=baseSepolia yarn ts-node config/index.ts",
"test": "yarn prepare:docker && graph test",
"test:integration": "true"
},
"dependencies": {
"@graphprotocol/client-cli": "3.0.0",
"@graphprotocol/graph-cli": "^0.80.0",
"@layerzerolabs/solidity-examples": "^1.0.0",
"@venusprotocol/governance-contracts": "2.5.0-dev.4",
"@venusprotocol/governance-contracts": "2.5.0-dev.6",
"@venusprotocol/subgraph-utils": "workspace:^",
"apollo-fetch": "^0.7.0",
"hardhat": "^2.10.2",
Expand Down
7 changes: 7 additions & 0 deletions subgraphs/isolated-pools/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import optimismSepoliaDeployments from '@venusprotocol/isolated-pools/deployment
import sepoliaDeployments from '@venusprotocol/isolated-pools/deployments/sepolia_addresses.json';
import zksyncDeployments from '@venusprotocol/isolated-pools/deployments/zksyncmainnet_addresses.json';
import zksyncSepoliaDeployments from '@venusprotocol/isolated-pools/deployments/zksyncsepolia_addresses.json';
import baseSepoliaDeployments from '@venusprotocol/isolated-pools/deployments/basesepolia_addresses.json';
import fs from 'fs';
import Mustache from 'mustache';

Expand All @@ -26,6 +27,7 @@ export const getNetwork = () => {
'zksync',
'optimismSepolia',
'optimism',
'baseSepolia',
] as const;
const network = process.env.NETWORK;
// @ts-expect-error network env var is unknown here
Expand Down Expand Up @@ -98,6 +100,11 @@ const main = () => {
poolRegistryAddress: optimismDeployments.addresses.PoolRegistry,
startBlock: '126048098',
},
baseSepolia: {
network: 'base-sepolia',
poolRegistryAddress: baseSepoliaDeployments.addresses.PoolRegistry,
startBlock: '18242654',
},
};

Mustache.escape = function (text) {
Expand Down
4 changes: 3 additions & 1 deletion subgraphs/isolated-pools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"deploy:zksync": "yarn prepare:zksync && yarn codegen && yarn graph deploy --studio venus-isolated-pools-zksync",
"deploy:optimismSepolia": "yarn prepare:optimismSepolia && yarn codegen && yarn graph deploy --studio venus-il-optimism-sepolia",
"deploy:optimism": "yarn prepare:optimism && yarn codegen && yarn graph deploy --studio venus-isolated-pools-optimism",
"deploy:baseSepolia": "yarn prepare:baseSepolia && yarn codegen && yarn graph deploy --studio venus-isolated-pools-base-sepolia",
"prepare:docker": "NETWORK=docker yarn ts-node config/index.ts",
"prepare:chapel": "NETWORK=chapel yarn ts-node config/index.ts",
"prepare:bsc": "NETWORK=bsc yarn ts-node config/index.ts",
Expand All @@ -38,13 +39,14 @@
"prepare:zksync": "NETWORK=zksync yarn ts-node config/index.ts",
"prepare:optimismSepolia": "NETWORK=optimismSepolia yarn ts-node config/index.ts",
"prepare:optimism": "NETWORK=optimism yarn ts-node config/index.ts",
"prepare:baseSepolia": "NETWORK=baseSepolia yarn ts-node config/index.ts",
"generate-subgraph-types": "rm -rf /subgraph-client/.graphclient && yarn graphclient build --dir ./subgraph-client",
"pretty": "prettier —-write '**/*.ts'",
"test": "yarn prepare:docker && graph test",
"test:integration": "yarn hardhat test tests/integration/index.ts --network localhost"
},
"dependencies": {
"@venusprotocol/isolated-pools": "3.6.0"
"@venusprotocol/isolated-pools": "3.7.0-dev.6"
},
"devDependencies": {
"@graphprotocol/client-cli": "3.0.0",
Expand Down
32 changes: 16 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5719,7 +5719,7 @@ __metadata:
"@graphprotocol/client-cli": 3.0.0
"@graphprotocol/graph-cli": ^0.80.0
"@layerzerolabs/solidity-examples": ^1.0.0
"@venusprotocol/governance-contracts": 2.5.0-dev.4
"@venusprotocol/governance-contracts": 2.5.0-dev.6
"@venusprotocol/subgraph-utils": "workspace:^"
apollo-fetch: ^0.7.0
hardhat: ^2.10.2
Expand All @@ -5743,14 +5743,14 @@ __metadata:
languageName: unknown
linkType: soft

"@venusprotocol/governance-contracts@npm:2.5.0-dev.4":
version: 2.5.0-dev.4
resolution: "@venusprotocol/governance-contracts@npm:2.5.0-dev.4"
"@venusprotocol/governance-contracts@npm:2.5.0-dev.6":
version: 2.5.0-dev.6
resolution: "@venusprotocol/governance-contracts@npm:2.5.0-dev.6"
dependencies:
"@venusprotocol/solidity-utilities": 2.0.0
hardhat-deploy-ethers: ^0.3.0-beta.13
module-alias: ^2.2.2
checksum: 1886e4ee17e1181b403c5351742ad01e10f561945a0a0df2ef25018dfc189fc3e00c736a94ceefc43f8db595af4b3d6ca615102408d860162e05f940310a910a
checksum: b0c975ea3c0620cbde8cda7c25c0525ba0b876ebedf31ff74f4f51637e2fc0d73f4c17c8fb5c57392645c11ef1eac91c702861247895d8a03ad15063638c6616
languageName: node
linkType: hard

Expand All @@ -5777,7 +5777,7 @@ __metadata:
dependencies:
"@graphprotocol/client-cli": 3.0.0
"@graphprotocol/graph-cli": ^0.80.0
"@venusprotocol/isolated-pools": 3.6.0
"@venusprotocol/isolated-pools": 3.7.0-dev.6
"@venusprotocol/subgraph-utils": "workspace:^"
apollo-fetch: ^0.7.0
hardhat: ^2.10.2
Expand All @@ -5788,9 +5788,9 @@ __metadata:
languageName: unknown
linkType: soft

"@venusprotocol/isolated-pools@npm:3.6.0":
version: 3.6.0
resolution: "@venusprotocol/isolated-pools@npm:3.6.0"
"@venusprotocol/isolated-pools@npm:3.7.0-dev.5":
version: 3.7.0-dev.5
resolution: "@venusprotocol/isolated-pools@npm:3.7.0-dev.5"
dependencies:
"@nomiclabs/hardhat-ethers": ^2.2.3
"@openzeppelin/contracts": ^4.8.3
Expand All @@ -5801,13 +5801,13 @@ __metadata:
ethers: ^5.7.0
hardhat-deploy: ^0.11.14
module-alias: ^2.2.2
checksum: 6112115e99568ed6458aaa7f91650aece8e225e19d21354ad6802add84f94cd1c92223e3156624f7bf90fee2b2f207abdfc7eb95be75349cc16bd7a57a57f45c
checksum: 0d4cea585025102481d6634ab5ec902b6d8abffcdfee4769b27023d5f4ad6d0fc86ad63ea4e30a73d43bf5f729e05bc5eb786b27233630a4982b366e124a34c6
languageName: node
linkType: hard

"@venusprotocol/isolated-pools@npm:3.7.0-dev.5":
version: 3.7.0-dev.5
resolution: "@venusprotocol/isolated-pools@npm:3.7.0-dev.5"
"@venusprotocol/isolated-pools@npm:3.7.0-dev.6":
version: 3.7.0-dev.6
resolution: "@venusprotocol/isolated-pools@npm:3.7.0-dev.6"
dependencies:
"@nomiclabs/hardhat-ethers": ^2.2.3
"@openzeppelin/contracts": ^4.8.3
Expand All @@ -5818,7 +5818,7 @@ __metadata:
ethers: ^5.7.0
hardhat-deploy: ^0.11.14
module-alias: ^2.2.2
checksum: 0d4cea585025102481d6634ab5ec902b6d8abffcdfee4769b27023d5f4ad6d0fc86ad63ea4e30a73d43bf5f729e05bc5eb786b27233630a4982b366e124a34c6
checksum: 94cc295b4bc5cc4720b9f2a5b4b2a6914d460ba18440c1ad66840ea43930f91c703668e15ad73ce41130889249dcc9a07f267ff03c7be11d6ff086951dd0cb2f
languageName: node
linkType: hard

Expand Down Expand Up @@ -5942,8 +5942,8 @@ __metadata:
"@types/node": ^20.5.9
"@typescript-eslint/eslint-plugin": ^5.40.1
"@typescript-eslint/parser": ^5.40.1
"@venusprotocol/governance-contracts": 2.5.0-dev.4
"@venusprotocol/isolated-pools": 3.6.0
"@venusprotocol/governance-contracts": 2.5.0-dev.6
"@venusprotocol/isolated-pools": 3.7.0-dev.6
"@venusprotocol/oracle": 2.6.0
"@venusprotocol/protocol-reserve": 2.3.0
"@venusprotocol/solidity-utilities": ^2.0.3
Expand Down

0 comments on commit b8968a9

Please sign in to comment.