Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deployments #402

Merged
merged 8 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,7 @@ AVALANCHE_RPC=' '
XLAYER_RPC=' '

MANTA_PACIFIC_RPC=' '

OPBNB_RPC=' '

GEIST_RPC=' '
326 changes: 326 additions & 0 deletions deployments/prod_addresses.json

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions deployments/prod_verification.json
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,26 @@
["0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836"]
]
],
"204": [
[
"0x525a6489a1df5fF1ae077fAf628E43b7F52298eF",
"SocketSimulator",
"contracts/mocks/fee-updater/SocketSimulator.sol",
[
204,
204,
"0x1F6bc87f3309B5D31Eb0BdaBE3ED7d3110d3B9c3",
"0xc8a4D2fd77c155fd52e65Ab07F337aBF84495Ead",
"IMLI"
]
],
[
"0x6C593aD4C0Fa4E293a0f1240F9ca3CF0e8a28619",
"CapacitorFactory",
"contracts/CapacitorFactory.sol",
["0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", 10]
]
],
"238": [
[
"0x2a1094b6585b32FE33929cDdF7Ee3F5a1c1E163A",
Expand Down Expand Up @@ -4246,6 +4266,26 @@
["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"]
]
],
"63157": [
[
"0x22891c72dE565d884Dfd762B8df7C4632888a93A",
"SocketSimulator",
"contracts/mocks/fee-updater/SocketSimulator.sol",
[
63157,
63157,
"0xFe9DCb3dAba382f46F2Ce69ddEb3b5Df86d96f04",
"0x941f0ef5258604Fe10C76AE3858984CE0452b5f2",
"IMLI"
]
],
[
"0x5C4186D343EeF952c9ED886E45F8243edf0A503F",
"CapacitorFactory",
"contracts/CapacitorFactory.sol",
["0x44A44837894B5eDC2Bde64567FC62599b3b88F4C", 10]
]
],
"80001": [
[
"0x1F0F1FC746fcd4d59b6dBDDFf67a88cde70dAeE5",
Expand Down
20 changes: 20 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ if (isProduction) {
[HardhatChainName.ZKEVM]: getChainConfig(ChainSlug.ZKEVM),
[HardhatChainName.AVALANCHE]: getChainConfig(ChainSlug.AVALANCHE),
[HardhatChainName.MANTA_PACIFIC]: getChainConfig(ChainSlug.MANTA_PACIFIC),
[HardhatChainName.OPBNB]: getChainConfig(ChainSlug.OPBNB),
[HardhatChainName.GEIST]: getChainConfig(ChainSlug.GEIST),
};
}

Expand Down Expand Up @@ -167,6 +169,8 @@ const config: HardhatUserConfig = {
zkevm: process.env.ZKEVM_API_KEY || "",
avalanche: process.env.SNOWTRACE_API_KEY || "",
manta_pacific: process.env.MANTA_PACIFIC_API_KEY || "none",
opbnb: process.env.OPBNB_API_KEY || "none",
geist: process.env.GEIST_API_KEY || "none",
},
customChains: [
{
Expand Down Expand Up @@ -313,6 +317,22 @@ const config: HardhatUserConfig = {
browserURL: "https://pacific-explorer.manta.network/",
},
},
{
network: "opbnb",
chainId: ChainId.OPBNB,
urls: {
apiURL: "https://api-opbnb.bscscan.com/api",
browserURL: "https://opbnb.bscscan.com/",
},
},
{
network: "geist",
chainId: ChainId.GEIST,
urls: {
apiURL: "https://geist-mainnet.explorer.alchemy.com/api",
browserURL: "https://geist-mainnet.explorer.alchemy.com/",
},
},
],
},
networks: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@socket.tech/dl-core",
"license": "UNLICENSED",
"version": "2.30.0",
"version": "2.32.0",
"description": "Smart contracts for socket data layer.",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion scripts/constants/overrides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const chainOverrides: {
},
[ChainSlug.MANTLE]: {
type: 1,
gasLimit: 100_000_000_000,
gasLimit: 10_000_000_000,
gasPrice: 30_000_000,
},
[ChainSlug.NEOX_TESTNET]: {
Expand Down
25 changes: 20 additions & 5 deletions scripts/deploy/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,47 @@ const main = async () => {
value: chain,
}));

const configResponse = await prompts([
const chainsResponse = await prompts([
{
name: "chains",
type: "multiselect",
message: "Select chains to connect",
choices,
},
{
name: "siblings",
type: "multiselect",
message: "Select sibling chains to connect",
choices,
},
]);

const chains = [...configResponse.chains];
const chains = chainsResponse.chains;
const siblings = chainsResponse.siblings;
const allChains = [...chains, ...siblings];
let addresses: DeploymentAddresses = await deployForChains(
chains,
allChains,
executionManagerVersion
);

if (chains.length === 0) {
console.log("No siblings selected!");
return;
}
await configureRoles(addresses, chains, true, executionManagerVersion);
await configureRoles(
addresses,
chains,
siblings,
true,
executionManagerVersion
);
addresses = await configureSwitchboards(
addresses,
chains,
siblings,
executionManagerVersion
);
await connectPlugs(addresses, chains);
await connectPlugs(addresses, chains, siblings);
} catch (error) {
console.log("Error:", error);
}
Expand Down
15 changes: 8 additions & 7 deletions scripts/deploy/scripts/configureRoles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ import {
import { checkAndUpdateRoles } from "./roles";
import { sleep } from "@socket.tech/dl-common";

const sleepTime = 3000;
const sleepTime = 10000;
const newRoleStatus = true;

export const configureRoles = async (
addresses: DeploymentAddresses,
chains: ChainSlug[],
siblings: ChainSlug[],
sendTransaction: boolean,
executionManagerVersion: CORE_CONTRACTS
) => {
Expand Down Expand Up @@ -60,7 +61,7 @@ export const configureRoles = async (
],
contractName: executionManagerVersion,
filterChains: chains,
filterSiblingChains: chains,
filterSiblingChains: siblings,
sendTransaction,
newRoleStatus,
},
Expand Down Expand Up @@ -90,7 +91,7 @@ export const configureRoles = async (
],
contractName: CORE_CONTRACTS.TransmitManager,
filterChains: chains,
filterSiblingChains: chains,
filterSiblingChains: siblings,
sendTransaction,
newRoleStatus,
},
Expand All @@ -111,7 +112,7 @@ export const configureRoles = async (
],
contractName: CORE_CONTRACTS.Socket,
filterChains: chains,
filterSiblingChains: chains,
filterSiblingChains: siblings,
sendTransaction,
newRoleStatus,
},
Expand Down Expand Up @@ -152,7 +153,7 @@ export const configureRoles = async (

contractName: CORE_CONTRACTS.FastSwitchboard,
filterChains: chains,
filterSiblingChains: chains,
filterSiblingChains: siblings,
sendTransaction,
newRoleStatus,
},
Expand Down Expand Up @@ -191,7 +192,7 @@ export const configureRoles = async (
],
contractName: CORE_CONTRACTS.OptimisticSwitchboard,
filterChains: chains,
filterSiblingChains: chains,
filterSiblingChains: siblings,
sendTransaction,
newRoleStatus,
},
Expand Down Expand Up @@ -227,7 +228,7 @@ export const configureRoles = async (
],
contractName: CORE_CONTRACTS.NativeSwitchboard,
filterChains: chains,
filterSiblingChains: chains,
filterSiblingChains: siblings,
sendTransaction,
newRoleStatus,
},
Expand Down
17 changes: 9 additions & 8 deletions scripts/deploy/scripts/configureSwitchboards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
export const configureSwitchboards = async (
addresses: DeploymentAddresses,
chains: ChainSlug[],
siblings: ChainSlug[],
executionManagerVersion: CORE_CONTRACTS
) => {
try {
Expand All @@ -42,25 +43,25 @@ export const configureSwitchboards = async (

let addr: ChainSocketAddresses = addresses[chain]!;

const list = isTestnet(chain) ? TestnetIds : MainnetIds;
const siblingSlugs: ChainSlug[] = list.filter(
(chainSlug) => chainSlug !== chain && chains.includes(chainSlug)
);
// const list = isTestnet(chain) ? TestnetIds : MainnetIds;
// const siblingSlugs: ChainSlug[] = list.filter(
// (chainSlug) => chainSlug !== chain && chains.includes(chainSlug)
// );

await configureExecutionManager(
executionManagerVersion,
addr[executionManagerVersion]!,
addr[CORE_CONTRACTS.SocketBatcher],
chain,
siblingSlugs,
siblings,
socketSigner
);

await setManagers(addr, socketSigner, executionManagerVersion);

const integrations = addr["integrations"] ?? {};
const integrationList = Object.keys(integrations).filter((chain) =>
chains.includes(parseInt(chain) as ChainSlug)
siblings.includes(parseInt(chain) as ChainSlug)
);

console.log(`Configuring for ${chain}`);
Expand Down Expand Up @@ -91,7 +92,7 @@ export const configureSwitchboards = async (

addr = await registerSwitchboards(
chain,
siblingSlugs,
siblings,
CORE_CONTRACTS.FastSwitchboard,
IntegrationTypes.fast,
addr,
Expand All @@ -101,7 +102,7 @@ export const configureSwitchboards = async (

addr = await registerSwitchboards(
chain,
siblingSlugs,
siblings,
CORE_CONTRACTS.OptimisticSwitchboard,
IntegrationTypes.optimistic,
addr,
Expand Down
23 changes: 12 additions & 11 deletions scripts/deploy/scripts/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import { overrides } from "../config/config";

export const connectPlugs = async (
addresses: DeploymentAddresses,
chains: ChainSlug[]
chains: ChainSlug[],
siblings: ChainSlug[]
) => {
try {
await Promise.all(
Expand All @@ -34,15 +35,15 @@ export const connectPlugs = async (
const addr: ChainSocketAddresses = addresses[chain]!;
if (!addr["integrations"]) return;

const list = isTestnet(chain) ? TestnetIds : MainnetIds;
const siblingSlugs: ChainSlug[] = list.filter(
(chainSlug) =>
chainSlug !== chain &&
addresses?.[chainSlug]?.["Counter"] &&
chains.includes(chainSlug)
);
// const list = isTestnet(chain) ? TestnetIds : MainnetIds;
// const siblingSlugs: ChainSlug[] = list.filter(
// (chainSlug) =>
// chainSlug !== chain &&
// addresses?.[chainSlug]?.["Counter"] &&
// chains.includes(chainSlug)
// );

const siblingIntegrationtype: IntegrationTypes[] = siblingSlugs.map(
const siblingIntegrationtype: IntegrationTypes[] = siblings.map(
(chainSlug) => {
return getDefaultIntegrationType(chain, chainSlug);
}
Expand All @@ -58,8 +59,8 @@ export const connectPlugs = async (
await getInstance("Socket", addr["Socket"])
).connect(socketSigner);

for (let index = 0; index < siblingSlugs.length; index++) {
const sibling = siblingSlugs[index];
for (let index = 0; index < siblings.length; index++) {
const sibling = siblings[index];
const siblingCounter = addresses?.[sibling]?.["Counter"];
let switchboard;
try {
Expand Down
4 changes: 3 additions & 1 deletion scripts/rpcConfig/constants/batcherSupportedChainSlug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const batcherSupportedChainSlugs = [
// ChainSlug.BOB,
ChainSlug.KINTO,
// ChainSlug.KINTO_DEVNET,
ChainSlug.SIPHER_FUNKI_TESTNET,
// ChainSlug.SIPHER_FUNKI_TESTNET,
ChainSlug.WINR,
ChainSlug.BLAST,
// ChainSlug.BSC_TESTNET,
Expand All @@ -41,4 +41,6 @@ export const batcherSupportedChainSlugs = [
ChainSlug.AVALANCHE,
ChainSlug.XLAYER,
ChainSlug.MANTA_PACIFIC,
ChainSlug.OPBNB,
ChainSlug.GEIST,
];
2 changes: 2 additions & 0 deletions scripts/rpcConfig/constants/explorers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ export const explorers = {
[ChainSlug.AVALANCHE]: "https://snowtrace.io/",
[ChainSlug.XLAYER]: "https://www.okx.com/web3/explorer/xlayer",
[ChainSlug.MANTA_PACIFIC]: "https://pacific-explorer.manta.network/",
[ChainSlug.OPBNB]: "https://opbnb.bscscan.com/",
[ChainSlug.GEIST]: "https://geist-mainnet.explorer.alchemy.com/",
};
2 changes: 2 additions & 0 deletions scripts/rpcConfig/constants/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ export const icons = {
[ChainSlug.AVALANCHE]: "",
[ChainSlug.XLAYER]: "",
[ChainSlug.MANTA_PACIFIC]: "",
[ChainSlug.OPBNB]: "",
[ChainSlug.GEIST]: "",
};
2 changes: 2 additions & 0 deletions scripts/rpcConfig/constants/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,6 @@ export const rpcs = {
[ChainSlug.AVALANCHE]: checkEnvValue("AVALANCHE_RPC"),
[ChainSlug.XLAYER]: checkEnvValue("XLAYER_RPC"),
[ChainSlug.MANTA_PACIFIC]: checkEnvValue("MANTA_PACIFIC_RPC"),
[ChainSlug.OPBNB]: checkEnvValue("OPBNB_RPC"),
[ChainSlug.GEIST]: checkEnvValue("GEIST_RPC"),
};
2 changes: 1 addition & 1 deletion scripts/rpcConfig/constants/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { DeploymentMode } from "../../../src";

export const version = {
[DeploymentMode.DEV]: "1.0.5",
[DeploymentMode.PROD]: "1.0.60",
[DeploymentMode.PROD]: "1.0.65",
};
2 changes: 0 additions & 2 deletions scripts/rpcConfig/rpcConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ const getOldEMVersionChainSlugs = (): ChainSlug[] => {
if (!chainAddress.ExecutionManagerDF)
chains.push(parseInt(chain) as ChainSlug);
});

console.log(chains);
} catch (error) {
return [] as ChainSlug[];
}
Expand Down
Loading
Loading