From 2dc4d9063431ffd4d4ceeb2031cb14c949941276 Mon Sep 17 00:00:00 2001 From: A5 Pickle Date: Fri, 19 Jul 2024 14:39:59 -0500 Subject: [PATCH 01/80] solana: add new IDs --- solana/Anchor.toml | 5 +++ solana/Makefile | 2 ++ solana/modules/common/Cargo.toml | 1 + solana/modules/common/src/lib.rs | 5 ++- solana/programs/matching-engine/Cargo.toml | 1 + solana/programs/matching-engine/src/lib.rs | 7 ++++- solana/programs/token-router/Cargo.toml | 14 +++++++-- solana/programs/token-router/src/lib.rs | 7 ++++- solana/programs/upgrade-manager/Cargo.toml | 17 ++++++++-- solana/programs/upgrade-manager/src/lib.rs | 4 ++- .../ts/src/cctp/messageTransmitter/index.ts | 28 ++--------------- .../ts/src/cctp/tokenMessengerMinter/index.ts | 31 +++---------------- solana/ts/src/matchingEngine/index.ts | 24 +++++++++----- solana/ts/src/tokenRouter/index.ts | 19 ++++++++++-- solana/ts/src/upgradeManager/index.ts | 5 +++ 15 files changed, 100 insertions(+), 70 deletions(-) diff --git a/solana/Anchor.toml b/solana/Anchor.toml index ffe16742..3665088f 100644 --- a/solana/Anchor.toml +++ b/solana/Anchor.toml @@ -23,6 +23,11 @@ token_router = "tD8RmtdcV7bzBeuFgyrFc8wvayj988ChccEzRQzo6md" matching_engine = "mPydpGUWxzERTNpyvTKdvS7v8kvw5sgwfiP8WQFrXVS" upgrade_manager = "ucdP9ktgrXgEUnn6roqD2SfdGMR2JSiWHUKv23oXwxt" +[programs.mainnet] +token_router = "28topqjtJzMnPaGFmmZk68tzGmj9W9aMntaEK3QkgtRe" +matching_engine = "HtkeCDdYY4i9ncAxXKjYTx8Uu3WM8JbtiLRYjtHwaVXb" +upgrade_manager = "4jyJ7EEsYa72REdD8ZMBvHFTXZ4VYGQPUHaJTajsK8SN" + [registry] url = "https://api.apr.dev" diff --git a/solana/Makefile b/solana/Makefile index ae47eaca..0d72bd4f 100644 --- a/solana/Makefile +++ b/solana/Makefile @@ -30,6 +30,7 @@ cargo-test: cargo-test-all: NETWORK=localnet $(MAKE) cargo-test NETWORK=testnet $(MAKE) cargo-test + NETWORK=mainnet $(MAKE) cargo-test .PHONY: build build: @@ -79,6 +80,7 @@ lint: cargo fmt --check NETWORK=localnet $(MAKE) clippy NETWORK=testnet $(MAKE) clippy + NETWORK=mainnet $(MAKE) clippy ts/tests/artifacts: mkdir ts/tests/artifacts diff --git a/solana/modules/common/Cargo.toml b/solana/modules/common/Cargo.toml index 38b68be5..6a3cd733 100644 --- a/solana/modules/common/Cargo.toml +++ b/solana/modules/common/Cargo.toml @@ -10,6 +10,7 @@ repository.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] +mainnet = ["wormhole-solana-consts/mainnet", "wormhole-cctp-solana/mainnet"] testnet = ["wormhole-solana-consts/testnet", "wormhole-cctp-solana/testnet"] localnet = ["wormhole-solana-consts/mainnet", "wormhole-cctp-solana/mainnet"] idl-build = ["localnet", "anchor-lang/idl-build"] diff --git a/solana/modules/common/src/lib.rs b/solana/modules/common/src/lib.rs index 889f0aca..fe23481d 100644 --- a/solana/modules/common/src/lib.rs +++ b/solana/modules/common/src/lib.rs @@ -17,7 +17,10 @@ pub use wormhole_solana_consts::USDC_MINT; use solana_program::{pubkey, pubkey::Pubkey}; cfg_if::cfg_if! { - if #[cfg(feature = "testnet")] { + if #[cfg(feature = "mainnet")] { + pub const UPGRADE_MANAGER_PROGRAM_ID: Pubkey = pubkey!("4jyJ7EEsYa72REdD8ZMBvHFTXZ4VYGQPUHaJTajsK8SN"); + pub const UPGRADE_MANAGER_AUTHORITY: Pubkey = pubkey!("Ag7BnUJ6C3mFXTaJfL2v9eJM2QbQ7GNLsDyewdCCLY8r"); + } else if #[cfg(feature = "testnet")] { pub const UPGRADE_MANAGER_PROGRAM_ID: Pubkey = pubkey!("ucdP9ktgrXgEUnn6roqD2SfdGMR2JSiWHUKv23oXwxt"); pub const UPGRADE_MANAGER_AUTHORITY: Pubkey = pubkey!("2sxpm9pvWmNWFzhgWtmxkMsdWk2uSNT9MoKvww53po1M"); } else if #[cfg(feature = "localnet")] { diff --git a/solana/programs/matching-engine/Cargo.toml b/solana/programs/matching-engine/Cargo.toml index a9547191..0704b587 100644 --- a/solana/programs/matching-engine/Cargo.toml +++ b/solana/programs/matching-engine/Cargo.toml @@ -17,6 +17,7 @@ no-entrypoint = [] no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] +mainnet = ["common/mainnet"] testnet = ["common/testnet"] localnet = ["common/localnet"] integration-test = ["localnet"] diff --git a/solana/programs/matching-engine/src/lib.rs b/solana/programs/matching-engine/src/lib.rs index 9e52f782..26a7263b 100644 --- a/solana/programs/matching-engine/src/lib.rs +++ b/solana/programs/matching-engine/src/lib.rs @@ -18,7 +18,12 @@ pub use utils::admin::AddCctpRouterEndpointArgs; use anchor_lang::{prelude::*, solana_program::pubkey}; cfg_if::cfg_if! { - if #[cfg(feature = "testnet")] { + if #[cfg(feature = "mainnet")] { + declare_id!("HtkeCDdYY4i9ncAxXKjYTx8Uu3WM8JbtiLRYjtHwaVXb"); + + const CUSTODIAN_BUMP: u8 = 254; + const CCTP_MINT_RECIPIENT: Pubkey = pubkey!("HUXc7MBf55vWrrkevVbmJN8HAyfFtjLcPLBt9yWngKzm"); + } else if #[cfg(feature = "testnet")] { declare_id!("mPydpGUWxzERTNpyvTKdvS7v8kvw5sgwfiP8WQFrXVS"); const CUSTODIAN_BUMP: u8 = 254; diff --git a/solana/programs/token-router/Cargo.toml b/solana/programs/token-router/Cargo.toml index 77a6d11b..a5377182 100644 --- a/solana/programs/token-router/Cargo.toml +++ b/solana/programs/token-router/Cargo.toml @@ -17,8 +17,18 @@ no-entrypoint = [] no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] -testnet = ["common/testnet", "matching-engine/testnet"] -localnet = ["common/localnet", "matching-engine/localnet"] +mainnet = [ + "common/mainnet", + "matching-engine/mainnet" +] +testnet = [ + "common/testnet", + "matching-engine/testnet" +] +localnet = [ + "common/localnet", + "matching-engine/localnet" +] integration-test = ["localnet"] idl-build = [ "localnet", diff --git a/solana/programs/token-router/src/lib.rs b/solana/programs/token-router/src/lib.rs index 0d5d6875..4fbecbe5 100644 --- a/solana/programs/token-router/src/lib.rs +++ b/solana/programs/token-router/src/lib.rs @@ -14,7 +14,12 @@ pub mod state; use anchor_lang::{prelude::*, solana_program::pubkey}; cfg_if::cfg_if! { - if #[cfg(feature = "testnet")] { + if #[cfg(feature = "mainnet")] { + declare_id!("28topqjtJzMnPaGFmmZk68tzGmj9W9aMntaEK3QkgtRe"); + + const CUSTODIAN_BUMP: u8 = 255; + const CCTP_MINT_RECIPIENT: Pubkey = pubkey!("J9jEttqjYkWWaWDvwuo69fLPEA9fHEUQqE62WjBCf55P"); + } else if #[cfg(feature = "testnet")] { declare_id!("tD8RmtdcV7bzBeuFgyrFc8wvayj988ChccEzRQzo6md"); const CUSTODIAN_BUMP: u8 = 255; diff --git a/solana/programs/upgrade-manager/Cargo.toml b/solana/programs/upgrade-manager/Cargo.toml index 405b9771..910866dc 100644 --- a/solana/programs/upgrade-manager/Cargo.toml +++ b/solana/programs/upgrade-manager/Cargo.toml @@ -17,8 +17,21 @@ no-entrypoint = [] no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] -testnet = ["common/testnet", "matching-engine/testnet", "token-router/testnet"] -localnet = ["common/localnet", "matching-engine/localnet", "token-router/localnet"] +mainnet = [ + "common/mainnet", + "matching-engine/mainnet", + "token-router/mainnet" +] +testnet = [ + "common/testnet", + "matching-engine/testnet", + "token-router/testnet" +] +localnet = [ + "common/localnet", + "matching-engine/localnet", + "token-router/localnet" +] integration-test = ["localnet"] idl-build = [ "localnet", diff --git a/solana/programs/upgrade-manager/src/lib.rs b/solana/programs/upgrade-manager/src/lib.rs index 0ef7fdf6..86a15354 100644 --- a/solana/programs/upgrade-manager/src/lib.rs +++ b/solana/programs/upgrade-manager/src/lib.rs @@ -17,7 +17,9 @@ use anchor_lang::prelude::*; declare_id!(common::UPGRADE_MANAGER_PROGRAM_ID); cfg_if::cfg_if! { - if #[cfg(feature = "testnet")] { + if #[cfg(feature = "mainnet")] { + const UPGRADE_AUTHORITY_BUMP: u8 = 255; + } else if #[cfg(feature = "testnet")] { const UPGRADE_AUTHORITY_BUMP: u8 = 255; } else if #[cfg(feature = "localnet")] { const UPGRADE_AUTHORITY_BUMP: u8 = 255; diff --git a/solana/ts/src/cctp/messageTransmitter/index.ts b/solana/ts/src/cctp/messageTransmitter/index.ts index 4366bffd..cdbf26c7 100644 --- a/solana/ts/src/cctp/messageTransmitter/index.ts +++ b/solana/ts/src/cctp/messageTransmitter/index.ts @@ -33,7 +33,7 @@ export class MessageTransmitterProgram { program: Program; constructor(connection: Connection, programId?: ProgramId) { - this._programId = programId ?? testnet(); + this._programId = programId ?? PROGRAM_IDS[0]; this.program = new Program(IDL, new PublicKey(this._programId), { connection, }); @@ -71,23 +71,7 @@ export class MessageTransmitterProgram { } tokenMessengerMinterProgram(): TokenMessengerMinterProgram { - switch (this._programId) { - case testnet(): { - return new TokenMessengerMinterProgram( - this.program.provider.connection, - "CCTPiPYPc6AsJuwueEnWgSgucamXDZwBd53dQ11YiKX3", - ); - } - case mainnet(): { - return new TokenMessengerMinterProgram( - this.program.provider.connection, - "CCTPiPYPc6AsJuwueEnWgSgucamXDZwBd53dQ11YiKX3", - ); - } - default: { - throw new Error("unsupported network"); - } - } + return new TokenMessengerMinterProgram(this.program.provider.connection); } receiveTokenMessengerMinterMessageAccounts( @@ -133,11 +117,3 @@ export class MessageTransmitterProgram { .instruction(); } } - -export function mainnet(): ProgramId { - return "CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd"; -} - -export function testnet(): ProgramId { - return "CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd"; -} diff --git a/solana/ts/src/cctp/tokenMessengerMinter/index.ts b/solana/ts/src/cctp/tokenMessengerMinter/index.ts index 6541cbec..7b325488 100644 --- a/solana/ts/src/cctp/tokenMessengerMinter/index.ts +++ b/solana/ts/src/cctp/tokenMessengerMinter/index.ts @@ -26,7 +26,7 @@ export class TokenMessengerMinterProgram { program: Program; constructor(connection: Connection, programId?: ProgramId) { - this._programId = programId ?? testnet(); + this._programId = programId ?? PROGRAM_IDS[0]; this.program = new Program(IDL, new PublicKey(this._programId), { connection, }); @@ -89,23 +89,10 @@ export class TokenMessengerMinterProgram { } messageTransmitterProgram(): MessageTransmitterProgram { - switch (this._programId) { - case testnet(): { - return new MessageTransmitterProgram( - this.program.provider.connection, - "CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd", - ); - } - case mainnet(): { - return new MessageTransmitterProgram( - this.program.provider.connection, - "CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd", - ); - } - default: { - throw new Error("unsupported network"); - } - } + return new MessageTransmitterProgram( + this.program.provider.connection, + "CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd", + ); } depositForBurnWithCallerAccounts( @@ -126,11 +113,3 @@ export class TokenMessengerMinterProgram { }; } } - -export function mainnet(): ProgramId { - return "CCTPiPYPc6AsJuwueEnWgSgucamXDZwBd53dQ11YiKX3"; -} - -export function testnet(): ProgramId { - return "CCTPiPYPc6AsJuwueEnWgSgucamXDZwBd53dQ11YiKX3"; -} diff --git a/solana/ts/src/matchingEngine/index.ts b/solana/ts/src/matchingEngine/index.ts index dd25dd7a..c8e29cbb 100644 --- a/solana/ts/src/matchingEngine/index.ts +++ b/solana/ts/src/matchingEngine/index.ts @@ -59,6 +59,7 @@ import { ChainId, toChainId, isChainId } from "@wormhole-foundation/sdk-base"; export const PROGRAM_IDS = [ "MatchingEngine11111111111111111111111111111", "mPydpGUWxzERTNpyvTKdvS7v8kvw5sgwfiP8WQFrXVS", + "HtkeCDdYY4i9ncAxXKjYTx8Uu3WM8JbtiLRYjtHwaVXb", ] as const; export const FEE_PRECISION_MAX = 1_000_000n; @@ -2462,6 +2463,12 @@ export class MatchingEngineProgram { upgradeManagerProgram(): UpgradeManagerProgram { switch (this._programId) { + case mainnet(): { + return new UpgradeManagerProgram( + this.program.provider.connection, + "4jyJ7EEsYa72REdD8ZMBvHFTXZ4VYGQPUHaJTajsK8SN", + ); + } case testnet(): { return new UpgradeManagerProgram( this.program.provider.connection, @@ -2481,21 +2488,18 @@ export class MatchingEngineProgram { } tokenMessengerMinterProgram(): TokenMessengerMinterProgram { - return new TokenMessengerMinterProgram( - this.program.provider.connection, - "CCTPiPYPc6AsJuwueEnWgSgucamXDZwBd53dQ11YiKX3", - ); + return new TokenMessengerMinterProgram(this.program.provider.connection); } messageTransmitterProgram(): MessageTransmitterProgram { - return new MessageTransmitterProgram( - this.program.provider.connection, - "CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd", - ); + return new MessageTransmitterProgram(this.program.provider.connection); } coreBridgeProgramId(): PublicKey { switch (this._programId) { + case mainnet(): { + return new PublicKey("worm2ZoG2kUd4vFXhvjh93UUH596ayRfgQ2MgjNMTth"); + } case testnet(): { return new PublicKey("3u8hJUVTA4jH1wYAyUur7FFZVQ8H635K3tSHHF4ssjQ5"); } @@ -2560,6 +2564,10 @@ export class MatchingEngineProgram { } } +export function mainnet(): ProgramId { + return "HtkeCDdYY4i9ncAxXKjYTx8Uu3WM8JbtiLRYjtHwaVXb"; +} + export function testnet(): ProgramId { return "mPydpGUWxzERTNpyvTKdvS7v8kvw5sgwfiP8WQFrXVS"; } diff --git a/solana/ts/src/tokenRouter/index.ts b/solana/ts/src/tokenRouter/index.ts index 666dde6c..20667b7c 100644 --- a/solana/ts/src/tokenRouter/index.ts +++ b/solana/ts/src/tokenRouter/index.ts @@ -33,6 +33,7 @@ import { ChainId, isChainId } from "@wormhole-foundation/sdk-base"; export const PROGRAM_IDS = [ "TokenRouter11111111111111111111111111111111", "tD8RmtdcV7bzBeuFgyrFc8wvayj988ChccEzRQzo6md", + "28topqjtJzMnPaGFmmZk68tzGmj9W9aMntaEK3QkgtRe", ] as const; export type ProgramId = (typeof PROGRAM_IDS)[number]; @@ -933,6 +934,13 @@ export class TokenRouterProgram { matchingEngineProgram(): matchingEngineSdk.MatchingEngineProgram { switch (this._programId) { + case mainnet(): { + return new matchingEngineSdk.MatchingEngineProgram( + this.program.provider.connection, + matchingEngineSdk.mainnet(), + this.mint, + ); + } case testnet(): { return new matchingEngineSdk.MatchingEngineProgram( this.program.provider.connection, @@ -955,6 +963,9 @@ export class TokenRouterProgram { coreBridgeProgramId(): PublicKey { switch (this._programId) { + case mainnet(): { + return new PublicKey("worm2ZoG2kUd4vFXhvjh93UUH596ayRfgQ2MgjNMTth"); + } case testnet(): { return new PublicKey("3u8hJUVTA4jH1wYAyUur7FFZVQ8H635K3tSHHF4ssjQ5"); } @@ -968,10 +979,14 @@ export class TokenRouterProgram { } } -export function localnet(): ProgramId { - return "TokenRouter11111111111111111111111111111111"; +export function mainnet(): ProgramId { + return "28topqjtJzMnPaGFmmZk68tzGmj9W9aMntaEK3QkgtRe"; } export function testnet(): ProgramId { return "tD8RmtdcV7bzBeuFgyrFc8wvayj988ChccEzRQzo6md"; } + +export function localnet(): ProgramId { + return "TokenRouter11111111111111111111111111111111"; +} diff --git a/solana/ts/src/upgradeManager/index.ts b/solana/ts/src/upgradeManager/index.ts index 371e9fe6..4f58b227 100644 --- a/solana/ts/src/upgradeManager/index.ts +++ b/solana/ts/src/upgradeManager/index.ts @@ -19,6 +19,7 @@ import { UpgradeReceipt } from "./state"; export const PROGRAM_IDS = [ "UpgradeManager11111111111111111111111111111", "ucdP9ktgrXgEUnn6roqD2SfdGMR2JSiWHUKv23oXwxt", + "4jyJ7EEsYa72REdD8ZMBvHFTXZ4VYGQPUHaJTajsK8SN", ] as const; export type ProgramId = (typeof PROGRAM_IDS)[number]; @@ -236,6 +237,10 @@ export class UpgradeManagerProgram { } } +export function mainnet(): ProgramId { + return "4jyJ7EEsYa72REdD8ZMBvHFTXZ4VYGQPUHaJTajsK8SN"; +} + export function testnet(): ProgramId { return "ucdP9ktgrXgEUnn6roqD2SfdGMR2JSiWHUKv23oXwxt"; } From cee22bbe7436a88ec38b1d81c5dba711a172506b Mon Sep 17 00:00:00 2001 From: A5 Pickle Date: Fri, 26 Jul 2024 14:15:20 -0500 Subject: [PATCH 02/80] solana: fix stack access err --- .../matching-engine/src/processor/admin/initialize.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solana/programs/matching-engine/src/processor/admin/initialize.rs b/solana/programs/matching-engine/src/processor/admin/initialize.rs index a88509de..6c2f8425 100644 --- a/solana/programs/matching-engine/src/processor/admin/initialize.rs +++ b/solana/programs/matching-engine/src/processor/admin/initialize.rs @@ -86,7 +86,7 @@ pub struct Initialize<'info> { program_data.upgrade_authority_address.is_some() } @ MatchingEngineError::ImmutableProgram )] - program_data: Account<'info, ProgramData>, + program_data: Box>, /// CHECK: This program PDA will be the upgrade authority for the Token Router program. #[account(address = common::UPGRADE_MANAGER_AUTHORITY)] @@ -110,7 +110,7 @@ pub struct InitializeArgs { } pub fn initialize(ctx: Context, args: InitializeArgs) -> Result<()> { - let owner: Pubkey = ctx.accounts.owner.key(); + let owner = ctx.accounts.owner.key(); let auction_config_id = 0; // We need to check that the upgrade authority is the owner passed into the account context. From 09ad27b3e49ec592b6fe9fa23306feef8daaff8b Mon Sep 17 00:00:00 2001 From: solanoe Date: Fri, 10 May 2024 16:20:00 -0300 Subject: [PATCH 03/80] initial commit deployment scripts --- deployment/package-lock.json | 6838 ++++++++++++++++++++++++++++++++++ deployment/package.json | 18 + 2 files changed, 6856 insertions(+) create mode 100644 deployment/package-lock.json create mode 100644 deployment/package.json diff --git a/deployment/package-lock.json b/deployment/package-lock.json new file mode 100644 index 00000000..13267f5d --- /dev/null +++ b/deployment/package-lock.json @@ -0,0 +1,6838 @@ +{ + "name": "deployment", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "deployment", + "devDependencies": { + "@certusone/wormhole-sdk": "^0.10.11", + "@typechain/ethers-v5": "^11.1.2", + "@types/node": "^20.11.22", + "@xlabs-xyz/ledger-signer": "^0.0.4", + "dotenv": "^16.4.5", + "ethers": "^5.7.2", + "tsx": "^4.7.2", + "typechain": "^8.3.2", + "typescript": "^5.4.5" + } + }, + "node_modules/@apollo/client": { + "version": "3.10.3", + "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.10.3.tgz", + "integrity": "sha512-4EIgZnFmRO1laWv3NCxlVIxcvimG63djuAXvyXhpQH3wkNMv9SykrasKRN08+z+cn/fVisBOLmkSRdyNyP9f4A==", + "dev": true, + "optional": true, + "dependencies": { + "@graphql-typed-document-node/core": "^3.1.1", + "@wry/caches": "^1.0.0", + "@wry/equality": "^0.5.6", + "@wry/trie": "^0.5.0", + "graphql-tag": "^2.12.6", + "hoist-non-react-statics": "^3.3.2", + "optimism": "^0.18.0", + "prop-types": "^15.7.2", + "rehackt": "^0.1.0", + "response-iterator": "^0.2.6", + "symbol-observable": "^4.0.0", + "ts-invariant": "^0.10.3", + "tslib": "^2.3.0", + "zen-observable-ts": "^1.2.5" + }, + "peerDependencies": { + "graphql": "^15.0.0 || ^16.0.0", + "graphql-ws": "^5.5.5", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", + "subscriptions-transport-ws": "^0.9.0 || ^0.11.0" + }, + "peerDependenciesMeta": { + "graphql-ws": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + }, + "subscriptions-transport-ws": { + "optional": true + } + } + }, + "node_modules/@babel/runtime": { + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.5.tgz", + "integrity": "sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==", + "dev": true, + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@certusone/wormhole-sdk": { + "version": "0.10.15", + "resolved": "https://registry.npmjs.org/@certusone/wormhole-sdk/-/wormhole-sdk-0.10.15.tgz", + "integrity": "sha512-XECfrvdYjsGPZWyR1bqWCPOiRw7+6upszpSvAXjKIqEnTNXOCYRkt5ae8TVh5oZxPjpts2X3t4Oi9WGcEssHpQ==", + "dev": true, + "dependencies": { + "@certusone/wormhole-sdk-proto-web": "0.0.7", + "@certusone/wormhole-sdk-wasm": "^0.0.1", + "@coral-xyz/borsh": "0.2.6", + "@mysten/sui.js": "0.32.2", + "@project-serum/anchor": "^0.25.0", + "@solana/spl-token": "^0.3.5", + "@solana/web3.js": "^1.66.2", + "@terra-money/terra.js": "3.1.9", + "@xpla/xpla.js": "^0.2.1", + "algosdk": "^2.4.0", + "aptos": "1.5.0", + "axios": "^0.24.0", + "bech32": "^2.0.0", + "binary-parser": "^2.2.1", + "bs58": "^4.0.1", + "elliptic": "^6.5.4", + "js-base64": "^3.6.1", + "near-api-js": "^1.0.0" + }, + "optionalDependencies": { + "@injectivelabs/networks": "1.10.12", + "@injectivelabs/sdk-ts": "1.10.72", + "@injectivelabs/utils": "1.10.12" + } + }, + "node_modules/@certusone/wormhole-sdk-proto-web": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/@certusone/wormhole-sdk-proto-web/-/wormhole-sdk-proto-web-0.0.7.tgz", + "integrity": "sha512-GCe1/bcqMS0Mt+hsWp4SE4NLL59pWmK0lhQXO0oqAKl0G9AuuTdudySMDF/sLc7z5H2w34bSuSrIEKvPuuSC+w==", + "dev": true, + "dependencies": { + "@improbable-eng/grpc-web": "^0.15.0", + "protobufjs": "^7.0.0", + "rxjs": "^7.5.6" + } + }, + "node_modules/@certusone/wormhole-sdk-wasm": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@certusone/wormhole-sdk-wasm/-/wormhole-sdk-wasm-0.0.1.tgz", + "integrity": "sha512-LdIwLhOyr4pPs2jqYubqC7d4UkqYBX0EG/ppspQlW3qlVE0LZRMrH6oVzzLMyHtV0Rw7O9sIKzORW/T3mrJv2w==", + "dev": true, + "dependencies": { + "@types/long": "^4.0.2", + "@types/node": "^18.0.3" + } + }, + "node_modules/@certusone/wormhole-sdk-wasm/node_modules/@types/node": { + "version": "18.19.33", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.33.tgz", + "integrity": "sha512-NR9+KrpSajr2qBVp/Yt5TU/rp+b5Mayi3+OlMlcg2cVCfRmcG5PWZ7S4+MG9PZ5gWBoc9Pd0BKSRViuBCRPu0A==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@classic-terra/terra.proto": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@classic-terra/terra.proto/-/terra.proto-1.1.0.tgz", + "integrity": "sha512-bYhQG5LUaGF0KPRY9hYT/HEcd1QExZPQd6zLV/rQkCe/eDxfwFRLzZHpaaAdfWoAAZjsRWqJbUCqCg7gXBbJpw==", + "dev": true, + "dependencies": { + "@improbable-eng/grpc-web": "^0.14.1", + "google-protobuf": "^3.17.3", + "long": "^4.0.0", + "protobufjs": "~6.11.2" + } + }, + "node_modules/@classic-terra/terra.proto/node_modules/@improbable-eng/grpc-web": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.14.1.tgz", + "integrity": "sha512-XaIYuunepPxoiGVLLHmlnVminUGzBTnXr8Wv7khzmLWbNw4TCwJKX09GSMJlKhu/TRk6gms0ySFxewaETSBqgw==", + "dev": true, + "dependencies": { + "browser-headers": "^0.4.1" + }, + "peerDependencies": { + "google-protobuf": "^3.14.0" + } + }, + "node_modules/@classic-terra/terra.proto/node_modules/protobufjs": { + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + } + }, + "node_modules/@confio/ics23": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/@confio/ics23/-/ics23-0.6.8.tgz", + "integrity": "sha512-wB6uo+3A50m0sW/EWcU64xpV/8wShZ6bMTa7pF8eYsTrSkQA7oLUIJcs/wb8g4y2Oyq701BaGiO6n/ak5WXO1w==", + "dev": true, + "optional": true, + "dependencies": { + "@noble/hashes": "^1.0.0", + "protobufjs": "^6.8.8" + } + }, + "node_modules/@confio/ics23/node_modules/protobufjs": { + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + } + }, + "node_modules/@coral-xyz/borsh": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/@coral-xyz/borsh/-/borsh-0.2.6.tgz", + "integrity": "sha512-y6nmHw1bFcJib7sMHsQPpC8r47xhqDZVvhUdna7NUPzpSbOZG6f46N21+aXsQ2w/tG8Ggls488J/ZmwbgVmyjg==", + "dev": true, + "dependencies": { + "bn.js": "^5.1.2", + "buffer-layout": "^1.2.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@solana/web3.js": "^1.2.0" + } + }, + "node_modules/@cosmjs/amino": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.30.1.tgz", + "integrity": "sha512-yNHnzmvAlkETDYIpeCTdVqgvrdt1qgkOXwuRVi8s27UKI5hfqyE9fJ/fuunXE6ZZPnKkjIecDznmuUOMrMvw4w==", + "dev": true, + "optional": true, + "dependencies": { + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1" + } + }, + "node_modules/@cosmjs/crypto": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.30.1.tgz", + "integrity": "sha512-rAljUlake3MSXs9xAm87mu34GfBLN0h/1uPPV6jEwClWjNkAMotzjC0ab9MARy5FFAvYHL3lWb57bhkbt2GtzQ==", + "dev": true, + "optional": true, + "dependencies": { + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "@noble/hashes": "^1", + "bn.js": "^5.2.0", + "elliptic": "^6.5.4", + "libsodium-wrappers": "^0.7.6" + } + }, + "node_modules/@cosmjs/encoding": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.30.1.tgz", + "integrity": "sha512-rXmrTbgqwihORwJ3xYhIgQFfMSrwLu1s43RIK9I8EBudPx3KmnmyAKzMOVsRDo9edLFNuZ9GIvysUCwQfq3WlQ==", + "dev": true, + "optional": true, + "dependencies": { + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" + } + }, + "node_modules/@cosmjs/encoding/node_modules/bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", + "dev": true, + "optional": true + }, + "node_modules/@cosmjs/json-rpc": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.30.1.tgz", + "integrity": "sha512-pitfC/2YN9t+kXZCbNuyrZ6M8abnCC2n62m+JtU9vQUfaEtVsgy+1Fk4TRQ175+pIWSdBMFi2wT8FWVEE4RhxQ==", + "dev": true, + "optional": true, + "dependencies": { + "@cosmjs/stream": "^0.30.1", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/math": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.30.1.tgz", + "integrity": "sha512-yaoeI23pin9ZiPHIisa6qqLngfnBR/25tSaWpkTm8Cy10MX70UF5oN4+/t1heLaM6SSmRrhk3psRkV4+7mH51Q==", + "dev": true, + "optional": true, + "dependencies": { + "bn.js": "^5.2.0" + } + }, + "node_modules/@cosmjs/proto-signing": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.30.1.tgz", + "integrity": "sha512-tXh8pPYXV4aiJVhTKHGyeZekjj+K9s2KKojMB93Gcob2DxUjfKapFYBMJSgfKPuWUPEmyr8Q9km2hplI38ILgQ==", + "dev": true, + "optional": true, + "dependencies": { + "@cosmjs/amino": "^0.30.1", + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "cosmjs-types": "^0.7.1", + "long": "^4.0.0" + } + }, + "node_modules/@cosmjs/socket": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.30.1.tgz", + "integrity": "sha512-r6MpDL+9N+qOS/D5VaxnPaMJ3flwQ36G+vPvYJsXArj93BjgyFB7BwWwXCQDzZ+23cfChPUfhbINOenr8N2Kow==", + "dev": true, + "optional": true, + "dependencies": { + "@cosmjs/stream": "^0.30.1", + "isomorphic-ws": "^4.0.1", + "ws": "^7", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/stargate": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.30.1.tgz", + "integrity": "sha512-RdbYKZCGOH8gWebO7r6WvNnQMxHrNXInY/gPHPzMjbQF6UatA6fNM2G2tdgS5j5u7FTqlCI10stNXrknaNdzog==", + "dev": true, + "optional": true, + "dependencies": { + "@confio/ics23": "^0.6.8", + "@cosmjs/amino": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/proto-signing": "^0.30.1", + "@cosmjs/stream": "^0.30.1", + "@cosmjs/tendermint-rpc": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "cosmjs-types": "^0.7.1", + "long": "^4.0.0", + "protobufjs": "~6.11.3", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/stargate/node_modules/protobufjs": { + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + } + }, + "node_modules/@cosmjs/stream": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.30.1.tgz", + "integrity": "sha512-Fg0pWz1zXQdoxQZpdHRMGvUH5RqS6tPv+j9Eh7Q953UjMlrwZVo0YFLC8OTf/HKVf10E4i0u6aM8D69Q6cNkgQ==", + "dev": true, + "optional": true, + "dependencies": { + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/tendermint-rpc": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.30.1.tgz", + "integrity": "sha512-Z3nCwhXSbPZJ++v85zHObeUggrEHVfm1u18ZRwXxFE9ZMl5mXTybnwYhczuYOl7KRskgwlB+rID0WYACxj4wdQ==", + "dev": true, + "optional": true, + "dependencies": { + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/json-rpc": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/socket": "^0.30.1", + "@cosmjs/stream": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "axios": "^0.21.2", + "readonly-date": "^1.0.0", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/tendermint-rpc/node_modules/axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "dev": true, + "optional": true, + "dependencies": { + "follow-redirects": "^1.14.0" + } + }, + "node_modules/@cosmjs/utils": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.30.1.tgz", + "integrity": "sha512-KvvX58MGMWh7xA+N+deCfunkA/ZNDvFLw4YbOmX3f/XBIkqrVY7qlotfy2aNb1kgp6h4B6Yc8YawJPDTfvWX7g==", + "dev": true, + "optional": true + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", + "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", + "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", + "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", + "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", + "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", + "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", + "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", + "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", + "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", + "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", + "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", + "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", + "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", + "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", + "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", + "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", + "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", + "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", + "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", + "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", + "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", + "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", + "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@ethereumjs/common": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.5.tgz", + "integrity": "sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA==", + "dev": true, + "optional": true, + "dependencies": { + "crc-32": "^1.2.0", + "ethereumjs-util": "^7.1.5" + } + }, + "node_modules/@ethereumjs/tx": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.2.tgz", + "integrity": "sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw==", + "dev": true, + "optional": true, + "dependencies": { + "@ethereumjs/common": "^2.6.4", + "ethereumjs-util": "^7.1.5" + } + }, + "node_modules/@ethersproject/abi": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", + "integrity": "sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/abstract-provider": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz", + "integrity": "sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0" + } + }, + "node_modules/@ethersproject/abstract-signer": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz", + "integrity": "sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0" + } + }, + "node_modules/@ethersproject/address": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz", + "integrity": "sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/rlp": "^5.7.0" + } + }, + "node_modules/@ethersproject/base64": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz", + "integrity": "sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0" + } + }, + "node_modules/@ethersproject/basex": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz", + "integrity": "sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/properties": "^5.7.0" + } + }, + "node_modules/@ethersproject/bignumber": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz", + "integrity": "sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "bn.js": "^5.2.1" + } + }, + "node_modules/@ethersproject/bytes": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", + "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/constants": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz", + "integrity": "sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0" + } + }, + "node_modules/@ethersproject/contracts": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.7.0.tgz", + "integrity": "sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0" + } + }, + "node_modules/@ethersproject/hash": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", + "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/hdnode": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.7.0.tgz", + "integrity": "sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" + } + }, + "node_modules/@ethersproject/json-wallets": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz", + "integrity": "sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "aes-js": "3.0.0", + "scrypt-js": "3.0.1" + } + }, + "node_modules/@ethersproject/keccak256": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz", + "integrity": "sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "js-sha3": "0.8.0" + } + }, + "node_modules/@ethersproject/logger": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", + "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ] + }, + "node_modules/@ethersproject/networks": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz", + "integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/pbkdf2": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz", + "integrity": "sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/sha2": "^5.7.0" + } + }, + "node_modules/@ethersproject/properties": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz", + "integrity": "sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/providers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz", + "integrity": "sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0", + "bech32": "1.1.4", + "ws": "7.4.6" + } + }, + "node_modules/@ethersproject/providers/node_modules/bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", + "dev": true + }, + "node_modules/@ethersproject/random": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", + "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/rlp": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", + "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/sha2": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", + "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "hash.js": "1.1.7" + } + }, + "node_modules/@ethersproject/signing-key": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz", + "integrity": "sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "bn.js": "^5.2.1", + "elliptic": "6.5.4", + "hash.js": "1.1.7" + } + }, + "node_modules/@ethersproject/signing-key/node_modules/elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dev": true, + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/@ethersproject/signing-key/node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/@ethersproject/solidity": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.7.0.tgz", + "integrity": "sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/strings": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz", + "integrity": "sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/transactions": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz", + "integrity": "sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0" + } + }, + "node_modules/@ethersproject/units": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.7.0.tgz", + "integrity": "sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/wallet": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.7.0.tgz", + "integrity": "sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/json-wallets": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" + } + }, + "node_modules/@ethersproject/web": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz", + "integrity": "sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/wordlists": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.7.0.tgz", + "integrity": "sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@graphql-typed-document-node/core": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", + "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", + "dev": true, + "optional": true, + "peerDependencies": { + "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/@improbable-eng/grpc-web": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.15.0.tgz", + "integrity": "sha512-ERft9/0/8CmYalqOVnJnpdDry28q+j+nAlFFARdjyxXDJ+Mhgv9+F600QC8BR9ygOfrXRlAk6CvST2j+JCpQPg==", + "dev": true, + "dependencies": { + "browser-headers": "^0.4.1" + }, + "peerDependencies": { + "google-protobuf": "^3.14.0" + } + }, + "node_modules/@injectivelabs/core-proto-ts": { + "version": "0.0.14", + "resolved": "https://registry.npmjs.org/@injectivelabs/core-proto-ts/-/core-proto-ts-0.0.14.tgz", + "integrity": "sha512-NZWlgBzgVrXow9IknFQHvcYKX4QkUD25taRigoNYQK8PDn4+VXd9xM5WFUDRhzm2smTCguyl/+MghpEp4oTPWw==", + "dev": true, + "optional": true, + "dependencies": { + "@injectivelabs/grpc-web": "^0.0.1", + "google-protobuf": "^3.14.0", + "protobufjs": "^7.0.0", + "rxjs": "^7.4.0" + } + }, + "node_modules/@injectivelabs/exceptions": { + "version": "1.14.6", + "resolved": "https://registry.npmjs.org/@injectivelabs/exceptions/-/exceptions-1.14.6.tgz", + "integrity": "sha512-A+URJwygeDjFPhulGMNVw70z738NtpIiCr0W8q4Kr4Ggg30i+AaVAjViYLm56pSMXXpomu9CYJ/sY6ijQn48IQ==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "@injectivelabs/grpc-web": "^0.0.1", + "@injectivelabs/ts-types": "^1.14.6", + "http-status-codes": "^2.2.0", + "link-module-alias": "^1.2.0", + "shx": "^0.3.2" + } + }, + "node_modules/@injectivelabs/grpc-web": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@injectivelabs/grpc-web/-/grpc-web-0.0.1.tgz", + "integrity": "sha512-Pu5YgaZp+OvR5UWfqbrPdHer3+gDf+b5fQoY+t2VZx1IAVHX8bzbN9EreYTvTYtFeDpYRWM8P7app2u4EX5wTw==", + "dev": true, + "optional": true, + "dependencies": { + "browser-headers": "^0.4.1" + }, + "peerDependencies": { + "google-protobuf": "^3.14.0" + } + }, + "node_modules/@injectivelabs/grpc-web-node-http-transport": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@injectivelabs/grpc-web-node-http-transport/-/grpc-web-node-http-transport-0.0.2.tgz", + "integrity": "sha512-rpyhXLiGY/UMs6v6YmgWHJHiO9l0AgDyVNv+jcutNVt4tQrmNvnpvz2wCAGOFtq5LuX/E9ChtTVpk3gWGqXcGA==", + "dev": true, + "optional": true, + "peerDependencies": { + "@injectivelabs/grpc-web": ">=0.0.1" + } + }, + "node_modules/@injectivelabs/grpc-web-react-native-transport": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@injectivelabs/grpc-web-react-native-transport/-/grpc-web-react-native-transport-0.0.2.tgz", + "integrity": "sha512-mk+aukQXnYNgPsPnu3KBi+FD0ZHQpazIlaBZ2jNZG7QAVmxTWtv3R66Zoq99Wx2dnE946NsZBYAoa0K5oSjnow==", + "dev": true, + "optional": true, + "peerDependencies": { + "@injectivelabs/grpc-web": ">=0.0.1" + } + }, + "node_modules/@injectivelabs/indexer-proto-ts": { + "version": "1.10.8-rc.4", + "resolved": "https://registry.npmjs.org/@injectivelabs/indexer-proto-ts/-/indexer-proto-ts-1.10.8-rc.4.tgz", + "integrity": "sha512-IwbepTfsHHAv3Z36As6yH/+HIplOEpUu6SFHBCVgdSIaQ8GuvTib4HETiVnV4mjYqoyVgWs+zLSAfih46rdMJQ==", + "dev": true, + "optional": true, + "dependencies": { + "@injectivelabs/grpc-web": "^0.0.1", + "google-protobuf": "^3.14.0", + "protobufjs": "^7.0.0", + "rxjs": "^7.4.0" + } + }, + "node_modules/@injectivelabs/mito-proto-ts": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@injectivelabs/mito-proto-ts/-/mito-proto-ts-1.0.9.tgz", + "integrity": "sha512-+TZMvJ4SHwcn6SFPdqaiQFZdNhjH7hyRFozY15nOTC2utdGij9jEsjz1NsyOejfYDA0s1z5Wm1SgrMYKaVpAmQ==", + "dev": true, + "optional": true, + "dependencies": { + "@injectivelabs/grpc-web": "^0.0.1", + "google-protobuf": "^3.14.0", + "protobufjs": "^7.0.0", + "rxjs": "^7.4.0" + } + }, + "node_modules/@injectivelabs/networks": { + "version": "1.10.12", + "resolved": "https://registry.npmjs.org/@injectivelabs/networks/-/networks-1.10.12.tgz", + "integrity": "sha512-tTHyLls1Nik5QTs/S03qqG2y/ITvNwI8CJOQbMmmsr1CL2CdjJBtzRYn9Dyx2p8XgzRFf9hmlybpe20tq9O3SA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "@injectivelabs/exceptions": "^1.10.12", + "@injectivelabs/ts-types": "^1.10.12", + "@injectivelabs/utils": "^1.10.12", + "link-module-alias": "^1.2.0", + "shx": "^0.3.2" + } + }, + "node_modules/@injectivelabs/sdk-ts": { + "version": "1.10.72", + "resolved": "https://registry.npmjs.org/@injectivelabs/sdk-ts/-/sdk-ts-1.10.72.tgz", + "integrity": "sha512-A5mHNNBgO4fI1c/7CZ0bGfVXliy8laP+VaYZ++aWh1YyudoZw4CTCEmLetZRy7AUU3XcfbHa8sAImRi7db+v6Q==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "@apollo/client": "^3.5.8", + "@cosmjs/amino": "^0.30.1", + "@cosmjs/proto-signing": "^0.30.1", + "@cosmjs/stargate": "^0.30.1", + "@ethersproject/bytes": "^5.7.0", + "@injectivelabs/core-proto-ts": "^0.0.14", + "@injectivelabs/exceptions": "^1.10.12", + "@injectivelabs/grpc-web": "^0.0.1", + "@injectivelabs/grpc-web-node-http-transport": "^0.0.2", + "@injectivelabs/grpc-web-react-native-transport": "^0.0.2", + "@injectivelabs/indexer-proto-ts": "1.10.8-rc.4", + "@injectivelabs/mito-proto-ts": "1.0.9", + "@injectivelabs/networks": "^1.10.12", + "@injectivelabs/test-utils": "^1.10.12", + "@injectivelabs/token-metadata": "^1.10.42", + "@injectivelabs/ts-types": "^1.10.12", + "@injectivelabs/utils": "^1.10.12", + "@metamask/eth-sig-util": "^4.0.0", + "axios": "^0.27.2", + "bech32": "^2.0.0", + "bip39": "^3.0.4", + "cosmjs-types": "^0.7.1", + "eth-crypto": "^2.6.0", + "ethereumjs-util": "^7.1.4", + "ethers": "^5.7.2", + "google-protobuf": "^3.21.0", + "graphql": "^16.3.0", + "http-status-codes": "^2.2.0", + "js-sha3": "^0.8.0", + "jscrypto": "^1.0.3", + "keccak256": "^1.0.6", + "link-module-alias": "^1.2.0", + "rxjs": "^7.8.0", + "secp256k1": "^4.0.3", + "shx": "^0.3.2", + "snakecase-keys": "^5.4.1" + } + }, + "node_modules/@injectivelabs/sdk-ts/node_modules/axios": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "dev": true, + "optional": true, + "dependencies": { + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" + } + }, + "node_modules/@injectivelabs/test-utils": { + "version": "1.14.4", + "resolved": "https://registry.npmjs.org/@injectivelabs/test-utils/-/test-utils-1.14.4.tgz", + "integrity": "sha512-M7UoB5CIVVN7BtdmU26GwZsWKp0BQg9qV5a+YvcdhlwlSIkvt3gKVKBMq/vKClCakOu2AjhCVGDMZVnagIBogg==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "axios": "^0.21.1", + "bignumber.js": "^9.0.1", + "link-module-alias": "^1.2.0", + "shx": "^0.3.2", + "snakecase-keys": "^5.1.2", + "store2": "^2.12.0" + } + }, + "node_modules/@injectivelabs/test-utils/node_modules/axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "dev": true, + "optional": true, + "dependencies": { + "follow-redirects": "^1.14.0" + } + }, + "node_modules/@injectivelabs/token-metadata": { + "version": "1.14.7", + "resolved": "https://registry.npmjs.org/@injectivelabs/token-metadata/-/token-metadata-1.14.7.tgz", + "integrity": "sha512-RRRuyirzoThwQ5P8D3STH2YOavGsdnetQy6ZPQ8yA7VUavt00KBB26M92zSLbiUz5VrxhPHDCEEkuJVWx+xtmw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "@injectivelabs/exceptions": "^1.14.6", + "@injectivelabs/networks": "^1.14.6", + "@injectivelabs/ts-types": "^1.14.6", + "@injectivelabs/utils": "^1.14.6", + "@types/lodash.values": "^4.3.6", + "copyfiles": "^2.4.1", + "jsonschema": "^1.4.0", + "link-module-alias": "^1.2.0", + "lodash": "^4.17.21", + "lodash.values": "^4.3.0", + "shx": "^0.3.2" + } + }, + "node_modules/@injectivelabs/token-metadata/node_modules/@injectivelabs/networks": { + "version": "1.14.6", + "resolved": "https://registry.npmjs.org/@injectivelabs/networks/-/networks-1.14.6.tgz", + "integrity": "sha512-O1IkPFJl8ThNL6N+k/9OimrgCYsSWQ8A1FtVMXSQge+0QRZsDKSpRmQRwE601otXXauO31nOUct5AaiWPffXVQ==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "@injectivelabs/exceptions": "^1.14.6", + "@injectivelabs/ts-types": "^1.14.6", + "@injectivelabs/utils": "^1.14.6", + "link-module-alias": "^1.2.0", + "shx": "^0.3.2" + } + }, + "node_modules/@injectivelabs/token-metadata/node_modules/@injectivelabs/utils": { + "version": "1.14.6", + "resolved": "https://registry.npmjs.org/@injectivelabs/utils/-/utils-1.14.6.tgz", + "integrity": "sha512-5I0h4GiLB5PPTl+g2lpevRP+WScvEbntdkoUQVtAdHewl4kutd5p1Kcnoi1Nvpq+sz5N/e9qtBIRuyxG38akOg==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "@injectivelabs/exceptions": "^1.14.6", + "@injectivelabs/ts-types": "^1.14.6", + "axios": "^0.21.1", + "bignumber.js": "^9.0.1", + "http-status-codes": "^2.2.0", + "link-module-alias": "^1.2.0", + "shx": "^0.3.2", + "snakecase-keys": "^5.1.2", + "store2": "^2.12.0" + } + }, + "node_modules/@injectivelabs/token-metadata/node_modules/axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "dev": true, + "optional": true, + "dependencies": { + "follow-redirects": "^1.14.0" + } + }, + "node_modules/@injectivelabs/ts-types": { + "version": "1.14.6", + "resolved": "https://registry.npmjs.org/@injectivelabs/ts-types/-/ts-types-1.14.6.tgz", + "integrity": "sha512-/Ax5eCSfE9OhcyUc9wZk/LFKTYhIY9RJIaNT/n92rbHjXSfXRLSX+Bvk62vC9Ej+SEBPp77WYngtrePPA1HEgw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "link-module-alias": "^1.2.0", + "shx": "^0.3.2" + } + }, + "node_modules/@injectivelabs/utils": { + "version": "1.10.12", + "resolved": "https://registry.npmjs.org/@injectivelabs/utils/-/utils-1.10.12.tgz", + "integrity": "sha512-c8al79nxIJgV1cBAdW2TPDGldj/8gm5k0h5TIN/AJs8/AeIjpTwwVGfLY3QvPOpRsxuQ9CjBkTXrAcSL1wwkcw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "@injectivelabs/exceptions": "^1.10.12", + "@injectivelabs/ts-types": "^1.10.12", + "axios": "^0.21.1", + "bignumber.js": "^9.0.1", + "http-status-codes": "^2.2.0", + "link-module-alias": "^1.2.0", + "shx": "^0.3.2", + "snakecase-keys": "^5.1.2", + "store2": "^2.12.0" + } + }, + "node_modules/@injectivelabs/utils/node_modules/axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "dev": true, + "optional": true, + "dependencies": { + "follow-redirects": "^1.14.0" + } + }, + "node_modules/@ledgerhq/cryptoassets": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/cryptoassets/-/cryptoassets-12.1.0.tgz", + "integrity": "sha512-KF9J0X5qmEpHyAy9FphAmDsuodQN/UA3xmjqBhmBSELt/8tAUHHWNOeEV4TfuJLmk2HzXF730aH+61lvVvIUVw==", + "dev": true, + "dependencies": { + "axios": "^1.6.0", + "bs58check": "^2.1.2", + "invariant": "2" + } + }, + "node_modules/@ledgerhq/cryptoassets/node_modules/axios": { + "version": "1.6.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", + "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/@ledgerhq/devices": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-8.3.0.tgz", + "integrity": "sha512-h5Scr+yIae8yjPOViCHLdMjpqn4oC2Whrsq8LinRxe48LEGMdPqSV1yY7+3Ch827wtzNpMv+/ilKnd8rY+rTlg==", + "dev": true, + "dependencies": { + "@ledgerhq/errors": "^6.16.4", + "@ledgerhq/logs": "^6.12.0", + "rxjs": "^7.8.1", + "semver": "^7.3.5" + } + }, + "node_modules/@ledgerhq/domain-service": { + "version": "1.1.20", + "resolved": "https://registry.npmjs.org/@ledgerhq/domain-service/-/domain-service-1.1.20.tgz", + "integrity": "sha512-+o1cEZj9HkJeIz2eL3r52tzkOiEKMs9w5aXF+Gy4mrmBjQ3Tw0OY9b69b3jz6PjlEHwAZsDRmcvF1/hSW6ITjw==", + "dev": true, + "dependencies": { + "@ledgerhq/errors": "^6.16.4", + "@ledgerhq/logs": "^6.12.0", + "@ledgerhq/types-live": "^6.46.0", + "axios": "^1.3.4", + "eip55": "^2.1.1", + "react": "^18.2.0", + "react-dom": "^18.2.0" + } + }, + "node_modules/@ledgerhq/domain-service/node_modules/axios": { + "version": "1.6.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", + "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/@ledgerhq/errors": { + "version": "6.16.4", + "resolved": "https://registry.npmjs.org/@ledgerhq/errors/-/errors-6.16.4.tgz", + "integrity": "sha512-M57yFaLYSN+fZCX0E0zUqOmrV6eipK+s5RhijHoUNlHUqrsvUz7iRQgpd5gRgHB5VkIjav7KdaZjKiWGcHovaQ==", + "dev": true + }, + "node_modules/@ledgerhq/evm-tools": { + "version": "1.0.18", + "resolved": "https://registry.npmjs.org/@ledgerhq/evm-tools/-/evm-tools-1.0.18.tgz", + "integrity": "sha512-jF7H5kjnFp/ju+QvErHyjNtb9G6aaZ1/ne703SO9JwLf/p8fM3uWe5TvS93S8V2sFoO06aoInnwFTJ860ZQKmw==", + "dev": true, + "dependencies": { + "@ledgerhq/cryptoassets": "^12.1.0", + "@ledgerhq/live-env": "^2.0.1", + "axios": "^1.6.5", + "crypto-js": "4.2.0", + "ethers": "5.7.2" + } + }, + "node_modules/@ledgerhq/evm-tools/node_modules/axios": { + "version": "1.6.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", + "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/@ledgerhq/hw-app-eth": { + "version": "6.36.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-app-eth/-/hw-app-eth-6.36.0.tgz", + "integrity": "sha512-PnIUicutm3vGtsWMBPXvn24msFhfcxQc7iR+UOVK+h1pYVTkBwOOGvNMtPjrayfDIr+66eLtKBrQrAJpUDHF/A==", + "dev": true, + "dependencies": { + "@ethersproject/abi": "^5.5.0", + "@ethersproject/rlp": "^5.5.0", + "@ledgerhq/cryptoassets": "^12.1.0", + "@ledgerhq/domain-service": "^1.1.20", + "@ledgerhq/errors": "^6.16.4", + "@ledgerhq/evm-tools": "^1.0.18", + "@ledgerhq/hw-transport": "^6.30.6", + "@ledgerhq/hw-transport-mocker": "^6.28.6", + "@ledgerhq/logs": "^6.12.0", + "@ledgerhq/types-live": "^6.46.0", + "axios": "^1.3.4", + "bignumber.js": "^9.1.2" + } + }, + "node_modules/@ledgerhq/hw-app-eth/node_modules/axios": { + "version": "1.6.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", + "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/@ledgerhq/hw-transport": { + "version": "6.30.6", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-6.30.6.tgz", + "integrity": "sha512-fT0Z4IywiuJuZrZE/+W0blkV5UCotDPFTYKLkKCLzYzuE6javva7D/ajRaIeR+hZ4kTmKF4EqnsmDCXwElez+w==", + "dev": true, + "dependencies": { + "@ledgerhq/devices": "^8.3.0", + "@ledgerhq/errors": "^6.16.4", + "@ledgerhq/logs": "^6.12.0", + "events": "^3.3.0" + } + }, + "node_modules/@ledgerhq/hw-transport-mocker": { + "version": "6.28.6", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.28.6.tgz", + "integrity": "sha512-JDO2kqMOTRCQWNZr1KVlyX1AqE6WBzHjJDS3FnSI8Z/Bj2KSc2/1H/4lW6+Ap64yLtlmOW3GchdafFmLgYAgqw==", + "dev": true, + "dependencies": { + "@ledgerhq/hw-transport": "^6.30.6", + "@ledgerhq/logs": "^6.12.0", + "rxjs": "^7.8.1" + } + }, + "node_modules/@ledgerhq/hw-transport-node-hid": { + "version": "6.28.6", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-node-hid/-/hw-transport-node-hid-6.28.6.tgz", + "integrity": "sha512-USSTOO0zv9XtguWismP7/StnNS/s7Rz0JOGGaBhKe3Bzl7d5XPncUlmOvoNFzzY/QdasEoFs2QId1+ibJG71Vw==", + "dev": true, + "dependencies": { + "@ledgerhq/devices": "^8.3.0", + "@ledgerhq/errors": "^6.16.4", + "@ledgerhq/hw-transport": "^6.30.6", + "@ledgerhq/hw-transport-node-hid-noevents": "^6.29.6", + "@ledgerhq/logs": "^6.12.0", + "lodash": "^4.17.21", + "node-hid": "^2.1.2", + "usb": "2.9.0" + } + }, + "node_modules/@ledgerhq/hw-transport-node-hid-noevents": { + "version": "6.29.6", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-node-hid-noevents/-/hw-transport-node-hid-noevents-6.29.6.tgz", + "integrity": "sha512-H1cGC4TLwSCxve3rbV7qfPJBZfy7VD7k9Czc9HOMDwQ9zHFtaoeiIotIMGjzHjfPtAGauMpAYvrpmEdBBX5sHg==", + "dev": true, + "dependencies": { + "@ledgerhq/devices": "^8.3.0", + "@ledgerhq/errors": "^6.16.4", + "@ledgerhq/hw-transport": "^6.30.6", + "@ledgerhq/logs": "^6.12.0", + "node-hid": "^2.1.2" + } + }, + "node_modules/@ledgerhq/live-env": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/live-env/-/live-env-2.0.1.tgz", + "integrity": "sha512-fs13laLOvREtWb40JhNX9ImFPvPU/+pKhzs51UFXDMujCtk5VCA8s8bKCA4YJ6rD5Ebpg7aJRc423lMxPyVR2A==", + "dev": true, + "dependencies": { + "rxjs": "^7.8.1", + "utility-types": "^3.10.0" + } + }, + "node_modules/@ledgerhq/logs": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/logs/-/logs-6.12.0.tgz", + "integrity": "sha512-ExDoj1QV5eC6TEbMdLUMMk9cfvNKhhv5gXol4SmULRVCx/3iyCPhJ74nsb3S0Vb+/f+XujBEj3vQn5+cwS0fNA==", + "dev": true + }, + "node_modules/@ledgerhq/types-live": { + "version": "6.46.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/types-live/-/types-live-6.46.0.tgz", + "integrity": "sha512-UtI4qm13wJIv9FB/0g6Hi1NijU7PuJEGetqGQxELlKEOmjubXa52EfKVA9IVOngL25m6U8i7jzluwLsHiN2uQQ==", + "dev": true, + "dependencies": { + "bignumber.js": "^9.1.2", + "rxjs": "^7.8.1" + } + }, + "node_modules/@metamask/eth-sig-util": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz", + "integrity": "sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ==", + "dev": true, + "optional": true, + "dependencies": { + "ethereumjs-abi": "^0.6.8", + "ethereumjs-util": "^6.2.1", + "ethjs-util": "^0.1.6", + "tweetnacl": "^1.0.3", + "tweetnacl-util": "^0.15.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@metamask/eth-sig-util/node_modules/@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "dev": true, + "optional": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@metamask/eth-sig-util/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true, + "optional": true + }, + "node_modules/@metamask/eth-sig-util/node_modules/ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "dev": true, + "optional": true, + "dependencies": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + }, + "node_modules/@mysten/bcs": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@mysten/bcs/-/bcs-0.7.1.tgz", + "integrity": "sha512-wFPb8bkhwrbiStfZMV5rFM7J+umpke59/dNjDp+UYJKykNlW23LCk2ePyEUvGdb62HGJM1jyOJ8g4egE3OmdKA==", + "dev": true, + "dependencies": { + "bs58": "^5.0.0" + } + }, + "node_modules/@mysten/bcs/node_modules/base-x": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", + "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==", + "dev": true + }, + "node_modules/@mysten/bcs/node_modules/bs58": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", + "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", + "dev": true, + "dependencies": { + "base-x": "^4.0.0" + } + }, + "node_modules/@mysten/sui.js": { + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/@mysten/sui.js/-/sui.js-0.32.2.tgz", + "integrity": "sha512-/Hm4xkGolJhqj8FvQr7QSHDTlxIvL52mtbOao9f75YjrBh7y1Uh9kbJSY7xiTF1NY9sv6p5hUVlYRJuM0Hvn9A==", + "dev": true, + "dependencies": { + "@mysten/bcs": "0.7.1", + "@noble/curves": "^1.0.0", + "@noble/hashes": "^1.3.0", + "@scure/bip32": "^1.3.0", + "@scure/bip39": "^1.2.0", + "@suchipi/femver": "^1.0.0", + "jayson": "^4.0.0", + "rpc-websockets": "^7.5.1", + "superstruct": "^1.0.3", + "tweetnacl": "^1.0.3" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@noble/curves": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.0.tgz", + "integrity": "sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==", + "dev": true, + "dependencies": { + "@noble/hashes": "1.4.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "dev": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@project-serum/anchor": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@project-serum/anchor/-/anchor-0.25.0.tgz", + "integrity": "sha512-E6A5Y/ijqpfMJ5psJvbw0kVTzLZFUcOFgs6eSM2M2iWE1lVRF18T6hWZVNl6zqZsoz98jgnNHtVGJMs+ds9A7A==", + "dev": true, + "dependencies": { + "@project-serum/borsh": "^0.2.5", + "@solana/web3.js": "^1.36.0", + "base64-js": "^1.5.1", + "bn.js": "^5.1.2", + "bs58": "^4.0.1", + "buffer-layout": "^1.2.2", + "camelcase": "^5.3.1", + "cross-fetch": "^3.1.5", + "crypto-hash": "^1.3.0", + "eventemitter3": "^4.0.7", + "js-sha256": "^0.9.0", + "pako": "^2.0.3", + "snake-case": "^3.0.4", + "superstruct": "^0.15.4", + "toml": "^3.0.0" + }, + "engines": { + "node": ">=11" + } + }, + "node_modules/@project-serum/anchor/node_modules/superstruct": { + "version": "0.15.5", + "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.15.5.tgz", + "integrity": "sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ==", + "dev": true + }, + "node_modules/@project-serum/borsh": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@project-serum/borsh/-/borsh-0.2.5.tgz", + "integrity": "sha512-UmeUkUoKdQ7rhx6Leve1SssMR/Ghv8qrEiyywyxSWg7ooV7StdpPBhciiy5eB3T0qU1BXvdRNC8TdrkxK7WC5Q==", + "dev": true, + "dependencies": { + "bn.js": "^5.1.2", + "buffer-layout": "^1.2.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@solana/web3.js": "^1.2.0" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "dev": true + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "dev": true + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "dev": true + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "dev": true + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "dev": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "dev": true + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "dev": true + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "dev": true + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "dev": true + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "dev": true + }, + "node_modules/@scure/base": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.6.tgz", + "integrity": "sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g==", + "dev": true, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip32": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", + "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", + "dev": true, + "dependencies": { + "@noble/curves": "~1.4.0", + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip39": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", + "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", + "dev": true, + "dependencies": { + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@solana/buffer-layout": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz", + "integrity": "sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==", + "dev": true, + "dependencies": { + "buffer": "~6.0.3" + }, + "engines": { + "node": ">=5.10" + } + }, + "node_modules/@solana/buffer-layout-utils": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@solana/buffer-layout-utils/-/buffer-layout-utils-0.2.0.tgz", + "integrity": "sha512-szG4sxgJGktbuZYDg2FfNmkMi0DYQoVjN2h7ta1W1hPrwzarcFLBq9UpX1UjNXsNpT9dn+chgprtWGioUAr4/g==", + "dev": true, + "dependencies": { + "@solana/buffer-layout": "^4.0.0", + "@solana/web3.js": "^1.32.0", + "bigint-buffer": "^1.1.5", + "bignumber.js": "^9.0.1" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@solana/codecs": { + "version": "2.0.0-preview.2", + "resolved": "https://registry.npmjs.org/@solana/codecs/-/codecs-2.0.0-preview.2.tgz", + "integrity": "sha512-4HHzCD5+pOSmSB71X6w9ptweV48Zj1Vqhe732+pcAQ2cMNnN0gMPMdDq7j3YwaZDZ7yrILVV/3+HTnfT77t2yA==", + "dev": true, + "dependencies": { + "@solana/codecs-core": "2.0.0-preview.2", + "@solana/codecs-data-structures": "2.0.0-preview.2", + "@solana/codecs-numbers": "2.0.0-preview.2", + "@solana/codecs-strings": "2.0.0-preview.2", + "@solana/options": "2.0.0-preview.2" + } + }, + "node_modules/@solana/codecs-core": { + "version": "2.0.0-preview.2", + "resolved": "https://registry.npmjs.org/@solana/codecs-core/-/codecs-core-2.0.0-preview.2.tgz", + "integrity": "sha512-gLhCJXieSCrAU7acUJjbXl+IbGnqovvxQLlimztPoGgfLQ1wFYu+XJswrEVQqknZYK1pgxpxH3rZ+OKFs0ndQg==", + "dev": true, + "dependencies": { + "@solana/errors": "2.0.0-preview.2" + } + }, + "node_modules/@solana/codecs-data-structures": { + "version": "2.0.0-preview.2", + "resolved": "https://registry.npmjs.org/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-preview.2.tgz", + "integrity": "sha512-Xf5vIfromOZo94Q8HbR04TbgTwzigqrKII0GjYr21K7rb3nba4hUW2ir8kguY7HWFBcjHGlU5x3MevKBOLp3Zg==", + "dev": true, + "dependencies": { + "@solana/codecs-core": "2.0.0-preview.2", + "@solana/codecs-numbers": "2.0.0-preview.2", + "@solana/errors": "2.0.0-preview.2" + } + }, + "node_modules/@solana/codecs-numbers": { + "version": "2.0.0-preview.2", + "resolved": "https://registry.npmjs.org/@solana/codecs-numbers/-/codecs-numbers-2.0.0-preview.2.tgz", + "integrity": "sha512-aLZnDTf43z4qOnpTcDsUVy1Ci9im1Md8thWipSWbE+WM9ojZAx528oAql+Cv8M8N+6ALKwgVRhPZkto6E59ARw==", + "dev": true, + "dependencies": { + "@solana/codecs-core": "2.0.0-preview.2", + "@solana/errors": "2.0.0-preview.2" + } + }, + "node_modules/@solana/codecs-strings": { + "version": "2.0.0-preview.2", + "resolved": "https://registry.npmjs.org/@solana/codecs-strings/-/codecs-strings-2.0.0-preview.2.tgz", + "integrity": "sha512-EgBwY+lIaHHgMJIqVOGHfIfpdmmUDNoNO/GAUGeFPf+q0dF+DtwhJPEMShhzh64X2MeCZcmSO6Kinx0Bvmmz2g==", + "dev": true, + "dependencies": { + "@solana/codecs-core": "2.0.0-preview.2", + "@solana/codecs-numbers": "2.0.0-preview.2", + "@solana/errors": "2.0.0-preview.2" + }, + "peerDependencies": { + "fastestsmallesttextencoderdecoder": "^1.0.22" + } + }, + "node_modules/@solana/errors": { + "version": "2.0.0-preview.2", + "resolved": "https://registry.npmjs.org/@solana/errors/-/errors-2.0.0-preview.2.tgz", + "integrity": "sha512-H2DZ1l3iYF5Rp5pPbJpmmtCauWeQXRJapkDg8epQ8BJ7cA2Ut/QEtC3CMmw/iMTcuS6uemFNLcWvlOfoQhvQuA==", + "dev": true, + "dependencies": { + "chalk": "^5.3.0", + "commander": "^12.0.0" + }, + "bin": { + "errors": "bin/cli.js" + } + }, + "node_modules/@solana/options": { + "version": "2.0.0-preview.2", + "resolved": "https://registry.npmjs.org/@solana/options/-/options-2.0.0-preview.2.tgz", + "integrity": "sha512-FAHqEeH0cVsUOTzjl5OfUBw2cyT8d5Oekx4xcn5hn+NyPAfQJgM3CEThzgRD6Q/4mM5pVUnND3oK/Mt1RzSE/w==", + "dev": true, + "dependencies": { + "@solana/codecs-core": "2.0.0-preview.2", + "@solana/codecs-numbers": "2.0.0-preview.2" + } + }, + "node_modules/@solana/spl-token": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.3.11.tgz", + "integrity": "sha512-bvohO3rIMSVL24Pb+I4EYTJ6cL82eFpInEXD/I8K8upOGjpqHsKUoAempR/RnUlI1qSFNyFlWJfu6MNUgfbCQQ==", + "dev": true, + "dependencies": { + "@solana/buffer-layout": "^4.0.0", + "@solana/buffer-layout-utils": "^0.2.0", + "@solana/spl-token-metadata": "^0.1.2", + "buffer": "^6.0.3" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "@solana/web3.js": "^1.88.0" + } + }, + "node_modules/@solana/spl-token-metadata": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@solana/spl-token-metadata/-/spl-token-metadata-0.1.4.tgz", + "integrity": "sha512-N3gZ8DlW6NWDV28+vCCDJoTqaCZiF/jDUnk3o8GRkAFzHObiR60Bs1gXHBa8zCPdvOwiG6Z3dg5pg7+RW6XNsQ==", + "dev": true, + "dependencies": { + "@solana/codecs": "2.0.0-preview.2", + "@solana/spl-type-length-value": "0.1.0" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "@solana/web3.js": "^1.91.6" + } + }, + "node_modules/@solana/spl-type-length-value": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@solana/spl-type-length-value/-/spl-type-length-value-0.1.0.tgz", + "integrity": "sha512-JBMGB0oR4lPttOZ5XiUGyvylwLQjt1CPJa6qQ5oM+MBCndfjz2TKKkw0eATlLLcYmq1jBVsNlJ2cD6ns2GR7lA==", + "dev": true, + "dependencies": { + "buffer": "^6.0.3" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@solana/web3.js": { + "version": "1.91.8", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.91.8.tgz", + "integrity": "sha512-USa6OS1jbh8zOapRJ/CBZImZ8Xb7AJjROZl5adql9TpOoBN9BUzyyouS5oPuZHft7S7eB8uJPuXWYjMi6BHgOw==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.24.5", + "@noble/curves": "^1.4.0", + "@noble/hashes": "^1.4.0", + "@solana/buffer-layout": "^4.0.1", + "agentkeepalive": "^4.5.0", + "bigint-buffer": "^1.1.5", + "bn.js": "^5.2.1", + "borsh": "^0.7.0", + "bs58": "^4.0.1", + "buffer": "6.0.3", + "fast-stable-stringify": "^1.0.0", + "jayson": "^4.1.0", + "node-fetch": "^2.7.0", + "rpc-websockets": "^7.11.0", + "superstruct": "^0.14.2" + } + }, + "node_modules/@solana/web3.js/node_modules/superstruct": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.14.2.tgz", + "integrity": "sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ==", + "dev": true + }, + "node_modules/@suchipi/femver": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@suchipi/femver/-/femver-1.0.0.tgz", + "integrity": "sha512-bprE8+K5V+DPX7q2e2K57ImqNBdfGHDIWaGI5xHxZoxbKOuQZn4wzPiUxOAHnsUr3w3xHrWXwN7gnG/iIuEMIg==", + "dev": true + }, + "node_modules/@terra-money/legacy.proto": { + "name": "@terra-money/terra.proto", + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/@terra-money/terra.proto/-/terra.proto-0.1.7.tgz", + "integrity": "sha512-NXD7f6pQCulvo6+mv6MAPzhOkUzRjgYVuHZE/apih+lVnPG5hDBU0rRYnOGGofwvKT5/jQoOENnFn/gioWWnyQ==", + "dev": true, + "dependencies": { + "google-protobuf": "^3.17.3", + "long": "^4.0.0", + "protobufjs": "~6.11.2" + } + }, + "node_modules/@terra-money/legacy.proto/node_modules/protobufjs": { + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + } + }, + "node_modules/@terra-money/terra.js": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/@terra-money/terra.js/-/terra.js-3.1.9.tgz", + "integrity": "sha512-JulSvOHLM56fL7s+cIjIbZeWPBluq883X1soWxA4TG5rKkDythT/DHeLXr3jP5Ld/26VENPSg6lNvK7cEYKpiw==", + "dev": true, + "dependencies": { + "@classic-terra/terra.proto": "^1.1.0", + "@terra-money/terra.proto": "^2.1.0", + "axios": "^0.27.2", + "bech32": "^2.0.0", + "bip32": "^2.0.6", + "bip39": "^3.0.3", + "bufferutil": "^4.0.3", + "decimal.js": "^10.2.1", + "jscrypto": "^1.0.1", + "readable-stream": "^3.6.0", + "secp256k1": "^4.0.2", + "tmp": "^0.2.1", + "utf-8-validate": "^5.0.5", + "ws": "^7.5.9" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@terra-money/terra.js/node_modules/axios": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" + } + }, + "node_modules/@terra-money/terra.js/node_modules/ws": { + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "dev": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/@terra-money/terra.proto": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@terra-money/terra.proto/-/terra.proto-2.1.0.tgz", + "integrity": "sha512-rhaMslv3Rkr+QsTQEZs64FKA4QlfO0DfQHaR6yct/EovenMkibDEQ63dEL6yJA6LCaEQGYhyVB9JO9pTUA8ybw==", + "dev": true, + "dependencies": { + "@improbable-eng/grpc-web": "^0.14.1", + "google-protobuf": "^3.17.3", + "long": "^4.0.0", + "protobufjs": "~6.11.2" + } + }, + "node_modules/@terra-money/terra.proto/node_modules/@improbable-eng/grpc-web": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.14.1.tgz", + "integrity": "sha512-XaIYuunepPxoiGVLLHmlnVminUGzBTnXr8Wv7khzmLWbNw4TCwJKX09GSMJlKhu/TRk6gms0ySFxewaETSBqgw==", + "dev": true, + "dependencies": { + "browser-headers": "^0.4.1" + }, + "peerDependencies": { + "google-protobuf": "^3.14.0" + } + }, + "node_modules/@terra-money/terra.proto/node_modules/protobufjs": { + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + } + }, + "node_modules/@typechain/ethers-v5": { + "version": "11.1.2", + "resolved": "https://registry.npmjs.org/@typechain/ethers-v5/-/ethers-v5-11.1.2.tgz", + "integrity": "sha512-ID6pqWkao54EuUQa0P5RgjvfA3MYqxUQKpbGKERbsjBW5Ra7EIXvbMlPp2pcP5IAdUkyMCFYsP2SN5q7mPdLDQ==", + "dev": true, + "dependencies": { + "lodash": "^4.17.15", + "ts-essentials": "^7.0.1" + }, + "peerDependencies": { + "@ethersproject/abi": "^5.0.0", + "@ethersproject/providers": "^5.0.0", + "ethers": "^5.1.3", + "typechain": "^8.3.2", + "typescript": ">=4.3.0" + } + }, + "node_modules/@types/bn.js": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.1.tgz", + "integrity": "sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/lodash": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.1.tgz", + "integrity": "sha512-X+2qazGS3jxLAIz5JDXDzglAF3KpijdhFxlf/V1+hEsOUc+HnWi81L/uv/EvGuV90WY+7mPGFCUDGfQC3Gj95Q==", + "dev": true, + "optional": true + }, + "node_modules/@types/lodash.values": { + "version": "4.3.9", + "resolved": "https://registry.npmjs.org/@types/lodash.values/-/lodash.values-4.3.9.tgz", + "integrity": "sha512-IJ20OEfqNwm3k8ENwoM3q0yOs4UMpgtD4GqxB4lwBHToGthHWqhyh5DdSgQjioocz0QK2SSBkJfCq95ZTV8BTw==", + "dev": true, + "optional": true, + "dependencies": { + "@types/lodash": "*" + } + }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.12.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.11.tgz", + "integrity": "sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/prettier": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz", + "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==", + "dev": true + }, + "node_modules/@types/secp256k1": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.6.tgz", + "integrity": "sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/w3c-web-usb": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@types/w3c-web-usb/-/w3c-web-usb-1.0.10.tgz", + "integrity": "sha512-CHgUI5kTc/QLMP8hODUHhge0D4vx+9UiAwIGiT0sTy/B2XpdX1U5rJt6JSISgr6ikRT7vxV9EVAFeYZqUnl1gQ==", + "dev": true + }, + "node_modules/@types/ws": { + "version": "7.4.7", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", + "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@wry/caches": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@wry/caches/-/caches-1.0.1.tgz", + "integrity": "sha512-bXuaUNLVVkD20wcGBWRyo7j9N3TxePEWFZj2Y+r9OoUzfqmavM84+mFykRicNsBqatba5JLay1t48wxaXaWnlA==", + "dev": true, + "optional": true, + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@wry/context": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.7.4.tgz", + "integrity": "sha512-jmT7Sb4ZQWI5iyu3lobQxICu2nC/vbUhP0vIdd6tHC9PTfenmRmuIFqktc6GH9cgi+ZHnsLWPvfSvc4DrYmKiQ==", + "dev": true, + "optional": true, + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@wry/equality": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.5.7.tgz", + "integrity": "sha512-BRFORjsTuQv5gxcXsuDXx6oGRhuVsEGwZy6LOzRRfgu+eSfxbhUQ9L9YtSEIuIjY/o7g3iWFjrc5eSY1GXP2Dw==", + "dev": true, + "optional": true, + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@wry/trie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.5.0.tgz", + "integrity": "sha512-FNoYzHawTMk/6KMQoEG5O4PuioX19UbwdQKF44yw0nLfOypfQdjtfZzo/UIJWAJ23sNIFbD1Ug9lbaDGMwbqQA==", + "dev": true, + "optional": true, + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@xlabs-xyz/ledger-signer": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@xlabs-xyz/ledger-signer/-/ledger-signer-0.0.4.tgz", + "integrity": "sha512-jqAV13JqRj4TGj29ByBeRDec2EIPp7OjRSw4Qs6LmrQB5/U9rJOpYLUWyIQP51sVHfNTAzKBXWsAb3sTTQrlPA==", + "dev": true, + "dependencies": { + "@ledgerhq/hw-app-eth": "^6.35.6", + "@ledgerhq/hw-transport": "^6.30.4", + "@ledgerhq/hw-transport-node-hid": "^6.28.4", + "ethers": "^5.7.2" + } + }, + "node_modules/@xpla/xpla.js": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@xpla/xpla.js/-/xpla.js-0.2.3.tgz", + "integrity": "sha512-Tfk7hCGWXtwr08reY3Pi6dmzIqFbzri9jcyzJdfNmdo4cN0PMwpRJuZZcPmtxiIUnNef3AN1E/6nJUD5MKniuA==", + "dev": true, + "dependencies": { + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/keccak256": "^5.6.1", + "@ethersproject/signing-key": "^5.6.2", + "@terra-money/legacy.proto": "npm:@terra-money/terra.proto@^0.1.7", + "@terra-money/terra.proto": "^2.1.0", + "axios": "^0.26.1", + "bech32": "^2.0.0", + "bip32": "^2.0.6", + "bip39": "^3.0.3", + "bufferutil": "^4.0.3", + "crypto-addr-codec": "^0.1.7", + "decimal.js": "^10.2.1", + "elliptic": "^6.5.4", + "ethereumjs-util": "^7.1.5", + "jscrypto": "^1.0.1", + "readable-stream": "^3.6.0", + "secp256k1": "^4.0.2", + "tmp": "^0.2.1", + "utf-8-validate": "^5.0.5", + "ws": "^7.5.8" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@xpla/xpla.js/node_modules/axios": { + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", + "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.14.8" + } + }, + "node_modules/@xpla/xpla.js/node_modules/ws": { + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "dev": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/acorn": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", + "dev": true, + "optional": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==", + "dev": true + }, + "node_modules/agentkeepalive": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", + "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==", + "dev": true, + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/algo-msgpack-with-bigint": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/algo-msgpack-with-bigint/-/algo-msgpack-with-bigint-2.1.1.tgz", + "integrity": "sha512-F1tGh056XczEaEAqu7s+hlZUDWwOBT70Eq0lfMpBP2YguSQVyxRbprLq5rELXKQOyOaixTWYhMeMQMzP0U5FoQ==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/algosdk": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/algosdk/-/algosdk-2.7.0.tgz", + "integrity": "sha512-sBE9lpV7bup3rZ+q2j3JQaFAE9JwZvjWKX00vPlG8e9txctXbgLL56jZhSWZndqhDI9oI+0P4NldkuQIWdrUyg==", + "dev": true, + "dependencies": { + "algo-msgpack-with-bigint": "^2.1.1", + "buffer": "^6.0.3", + "hi-base32": "^0.5.1", + "js-sha256": "^0.9.0", + "js-sha3": "^0.8.0", + "js-sha512": "^0.8.0", + "json-bigint": "^1.0.0", + "tweetnacl": "^1.0.3", + "vlq": "^2.0.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/aptos": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/aptos/-/aptos-1.5.0.tgz", + "integrity": "sha512-N7OuRtU7IYHkDkNx+4QS3g/QQGCp+36KzYn3oXPmT7Kttfuv+UKliQVdjy3cLmwd/DCQSh9ObTovwdxnHjUn0g==", + "dev": true, + "dependencies": { + "@noble/hashes": "1.1.3", + "@scure/bip39": "1.1.0", + "axios": "0.27.2", + "form-data": "4.0.0", + "tweetnacl": "1.0.3" + }, + "engines": { + "node": ">=11.0.0" + } + }, + "node_modules/aptos/node_modules/@noble/hashes": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.1.3.tgz", + "integrity": "sha512-CE0FCR57H2acVI5UOzIGSSIYxZ6v/HOhDR0Ro9VLyhnzLwx0o8W1mmgaqlEUx4049qJDlIBRztv5k+MM8vbO3A==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ] + }, + "node_modules/aptos/node_modules/@scure/bip39": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.1.0.tgz", + "integrity": "sha512-pwrPOS16VeTKg98dYXQyIjJEcWfz7/1YJIwxUEPFfQPtc86Ym/1sVgQ2RLoD43AazMk2l/unK4ITySSpW2+82w==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "@noble/hashes": "~1.1.1", + "@scure/base": "~1.1.0" + } + }, + "node_modules/aptos/node_modules/axios": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" + } + }, + "node_modules/array-back": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", + "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "node_modules/axios": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz", + "integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.14.4" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/base-x": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", + "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bech32": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", + "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==", + "dev": true + }, + "node_modules/big-integer": { + "version": "1.6.36", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.36.tgz", + "integrity": "sha512-t70bfa7HYEA1D9idDbmuv7YbsbVkQ+Hp+8KFSul4aE5e/i1bjCNIRYJZlA8Q8p0r9T8cF/RVvwUgRA//FydEyg==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/bigint-buffer": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", + "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "bindings": "^1.3.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/bignumber.js": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/binary-parser": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/binary-parser/-/binary-parser-2.2.1.tgz", + "integrity": "sha512-5ATpz/uPDgq5GgEDxTB4ouXCde7q2lqAQlSdBRQVl/AJnxmQmhIfyxJx+0MGu//D5rHQifkfGbWWlaysG0o9NA==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/bip32": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/bip32/-/bip32-2.0.6.tgz", + "integrity": "sha512-HpV5OMLLGTjSVblmrtYRfFFKuQB+GArM0+XP8HGWfJ5vxYBqo+DesvJwOdC2WJ3bCkZShGf0QIfoIpeomVzVdA==", + "dev": true, + "dependencies": { + "@types/node": "10.12.18", + "bs58check": "^2.1.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "tiny-secp256k1": "^1.1.3", + "typeforce": "^1.11.5", + "wif": "^2.0.6" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/bip32/node_modules/@types/node": { + "version": "10.12.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", + "integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==", + "dev": true + }, + "node_modules/bip39": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.1.0.tgz", + "integrity": "sha512-c9kiwdk45Do5GL0vJMe7tS95VjCii65mYAH7DfWl3uW8AVzXKQVUm64i3hzVybBDMp9r7j9iNxR85+ul8MdN/A==", + "dev": true, + "dependencies": { + "@noble/hashes": "^1.2.0" + } + }, + "node_modules/bip66": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", + "integrity": "sha512-nemMHz95EmS38a26XbbdxIYj5csHd3RMP3H5bwQknX0WYHF01qhpufP42mLOwVICuH2JmhIhXiWs89MfUGL7Xw==", + "dev": true, + "optional": true, + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/bl/node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/blakejs": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==", + "dev": true + }, + "node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "dev": true + }, + "node_modules/borsh": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.7.0.tgz", + "integrity": "sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==", + "dev": true, + "dependencies": { + "bn.js": "^5.2.0", + "bs58": "^4.0.0", + "text-encoding-utf-8": "^1.0.2" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", + "dev": true + }, + "node_modules/browser-headers": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/browser-headers/-/browser-headers-0.4.1.tgz", + "integrity": "sha512-CA9hsySZVo9371qEHjHZtYxV2cFtVj5Wj/ZHi8ooEsrtm4vOnl9Y9HmyYWk9q+05d7K3rdoAE0j3MVEFVvtQtg==", + "dev": true + }, + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dev": true, + "dependencies": { + "base-x": "^3.0.2" + } + }, + "node_modules/bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "dev": true, + "dependencies": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/buffer-layout": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/buffer-layout/-/buffer-layout-1.2.2.tgz", + "integrity": "sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==", + "dev": true, + "engines": { + "node": ">=4.5" + } + }, + "node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", + "dev": true + }, + "node_modules/bufferutil": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.8.tgz", + "integrity": "sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/capability": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/capability/-/capability-0.2.5.tgz", + "integrity": "sha512-rsJZYVCgXd08sPqwmaIqjAd5SUTfonV0z/gDJ8D6cN8wQphky1kkAYEqQ+hmDxTw7UihvBfjUVUSY+DBEe44jg==", + "dev": true + }, + "node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true + }, + "node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "optional": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/command-line-args": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", + "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", + "dev": true, + "dependencies": { + "array-back": "^3.1.0", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/command-line-usage": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz", + "integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==", + "dev": true, + "dependencies": { + "array-back": "^4.0.2", + "chalk": "^2.4.2", + "table-layout": "^1.0.2", + "typical": "^5.2.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/command-line-usage/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/command-line-usage/node_modules/array-back": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", + "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/command-line-usage/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/command-line-usage/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/command-line-usage/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/command-line-usage/node_modules/typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/commander": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.0.0.tgz", + "integrity": "sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/copyfiles": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz", + "integrity": "sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==", + "dev": true, + "optional": true, + "dependencies": { + "glob": "^7.0.5", + "minimatch": "^3.0.3", + "mkdirp": "^1.0.4", + "noms": "0.0.0", + "through2": "^2.0.1", + "untildify": "^4.0.0", + "yargs": "^16.1.0" + }, + "bin": { + "copyfiles": "copyfiles", + "copyup": "copyfiles" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true, + "optional": true + }, + "node_modules/cosmjs-types": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.7.2.tgz", + "integrity": "sha512-vf2uLyktjr/XVAgEq0DjMxeAWh1yYREe7AMHDKd7EiHVqxBPCaBS+qEEQUkXbR9ndnckqr1sUG8BQhazh4X5lA==", + "dev": true, + "optional": true, + "dependencies": { + "long": "^4.0.0", + "protobufjs": "~6.11.2" + } + }, + "node_modules/cosmjs-types/node_modules/protobufjs": { + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + } + }, + "node_modules/crc-32": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "dev": true, + "optional": true, + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/cross-fetch": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz", + "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==", + "dev": true, + "dependencies": { + "node-fetch": "^2.6.12" + } + }, + "node_modules/crypto-addr-codec": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/crypto-addr-codec/-/crypto-addr-codec-0.1.8.tgz", + "integrity": "sha512-GqAK90iLLgP3FvhNmHbpT3wR6dEdaM8hZyZtLX29SPardh3OA13RFLHDR6sntGCgRWOfiHqW6sIyohpNqOtV/g==", + "dev": true, + "dependencies": { + "base-x": "^3.0.8", + "big-integer": "1.6.36", + "blakejs": "^1.1.0", + "bs58": "^4.0.1", + "ripemd160-min": "0.0.6", + "safe-buffer": "^5.2.0", + "sha3": "^2.1.1" + } + }, + "node_modules/crypto-hash": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/crypto-hash/-/crypto-hash-1.3.0.tgz", + "integrity": "sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/crypto-js": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz", + "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==", + "dev": true + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/decimal.js": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", + "dev": true + }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dev": true, + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "optional": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "optional": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delay": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", + "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/dot-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", + "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", + "dev": true, + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/drbg.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", + "integrity": "sha512-F4wZ06PvqxYLFEZKkFxTDcns9oFNk34hvmJSEwdzsxVQ8YI5YaxtACgQatkYgv2VI2CFkUd2Y+xosPQnHv809g==", + "dev": true, + "optional": true, + "dependencies": { + "browserify-aes": "^1.0.6", + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/eccrypto": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/eccrypto/-/eccrypto-1.1.6.tgz", + "integrity": "sha512-d78ivVEzu7Tn0ZphUUaL43+jVPKTMPFGtmgtz1D0LrFn7cY3K8CdrvibuLz2AAkHBLKZtR8DMbB2ukRYFk987A==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "acorn": "7.1.1", + "elliptic": "6.5.4", + "es6-promise": "4.2.8", + "nan": "2.14.0" + }, + "optionalDependencies": { + "secp256k1": "3.7.1" + } + }, + "node_modules/eccrypto/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true, + "optional": true + }, + "node_modules/eccrypto/node_modules/elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dev": true, + "optional": true, + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/eccrypto/node_modules/secp256k1": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.1.tgz", + "integrity": "sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "drbg.js": "^1.0.1", + "elliptic": "^6.4.1", + "nan": "^2.14.0", + "safe-buffer": "^5.1.2" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/eip55": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/eip55/-/eip55-2.1.1.tgz", + "integrity": "sha512-WcagVAmNu2Ww2cDUfzuWVntYwFxbvZ5MvIyLZpMjTTkjD6sCvkGOiS86jTppzu9/gWsc8isLHAeMBWK02OnZmA==", + "dev": true, + "dependencies": { + "keccak": "^3.0.3" + } + }, + "node_modules/elliptic": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.5.tgz", + "integrity": "sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw==", + "dev": true, + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "optional": true + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/error-polyfill": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/error-polyfill/-/error-polyfill-0.1.3.tgz", + "integrity": "sha512-XHJk60ufE+TG/ydwp4lilOog549iiQF2OAPhkk9DdiYWMrltz5yhDz/xnKuenNwP7gy3dsibssO5QpVhkrSzzg==", + "dev": true, + "dependencies": { + "capability": "^0.2.5", + "o3": "^1.0.3", + "u3": "^0.1.1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "optional": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "optional": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "dev": true + }, + "node_modules/es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==", + "dev": true, + "dependencies": { + "es6-promise": "^4.0.3" + } + }, + "node_modules/esbuild": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", + "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.20.2", + "@esbuild/android-arm": "0.20.2", + "@esbuild/android-arm64": "0.20.2", + "@esbuild/android-x64": "0.20.2", + "@esbuild/darwin-arm64": "0.20.2", + "@esbuild/darwin-x64": "0.20.2", + "@esbuild/freebsd-arm64": "0.20.2", + "@esbuild/freebsd-x64": "0.20.2", + "@esbuild/linux-arm": "0.20.2", + "@esbuild/linux-arm64": "0.20.2", + "@esbuild/linux-ia32": "0.20.2", + "@esbuild/linux-loong64": "0.20.2", + "@esbuild/linux-mips64el": "0.20.2", + "@esbuild/linux-ppc64": "0.20.2", + "@esbuild/linux-riscv64": "0.20.2", + "@esbuild/linux-s390x": "0.20.2", + "@esbuild/linux-x64": "0.20.2", + "@esbuild/netbsd-x64": "0.20.2", + "@esbuild/openbsd-x64": "0.20.2", + "@esbuild/sunos-x64": "0.20.2", + "@esbuild/win32-arm64": "0.20.2", + "@esbuild/win32-ia32": "0.20.2", + "@esbuild/win32-x64": "0.20.2" + } + }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "dev": true, + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eth-crypto": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eth-crypto/-/eth-crypto-2.6.0.tgz", + "integrity": "sha512-GCX4ffFYRUGgnuWR5qxcZIRQJ1KEqPFiyXU9yVy7s6dtXIMlUXZQ2h+5ID6rFaOHWbpJbjfkC6YdhwtwRYCnug==", + "dev": true, + "optional": true, + "dependencies": { + "@babel/runtime": "7.20.13", + "@ethereumjs/tx": "3.5.2", + "@types/bn.js": "5.1.1", + "eccrypto": "1.1.6", + "ethereumjs-util": "7.1.5", + "ethers": "5.7.2", + "secp256k1": "5.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/pubkey" + } + }, + "node_modules/eth-crypto/node_modules/@babel/runtime": { + "version": "7.20.13", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.13.tgz", + "integrity": "sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA==", + "dev": true, + "optional": true, + "dependencies": { + "regenerator-runtime": "^0.13.11" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/eth-crypto/node_modules/node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==", + "dev": true, + "optional": true + }, + "node_modules/eth-crypto/node_modules/regenerator-runtime": { + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", + "dev": true, + "optional": true + }, + "node_modules/eth-crypto/node_modules/secp256k1": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-5.0.0.tgz", + "integrity": "sha512-TKWX8xvoGHrxVdqbYeZM9w+izTF4b9z3NhSaDkdn81btvuh+ivbIMGT/zQvDtTFWhRlThpoz6LEYTr7n8A5GcA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "elliptic": "^6.5.4", + "node-addon-api": "^5.0.0", + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "node_modules/ethereumjs-abi": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz", + "integrity": "sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==", + "dev": true, + "optional": true, + "dependencies": { + "bn.js": "^4.11.8", + "ethereumjs-util": "^6.0.0" + } + }, + "node_modules/ethereumjs-abi/node_modules/@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "dev": true, + "optional": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/ethereumjs-abi/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true, + "optional": true + }, + "node_modules/ethereumjs-abi/node_modules/ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "dev": true, + "optional": true, + "dependencies": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + }, + "node_modules/ethereumjs-util": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", + "dev": true, + "dependencies": { + "@types/bn.js": "^5.1.0", + "bn.js": "^5.1.2", + "create-hash": "^1.1.2", + "ethereum-cryptography": "^0.1.3", + "rlp": "^2.2.4" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/ethers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", + "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abi": "5.7.0", + "@ethersproject/abstract-provider": "5.7.0", + "@ethersproject/abstract-signer": "5.7.0", + "@ethersproject/address": "5.7.0", + "@ethersproject/base64": "5.7.0", + "@ethersproject/basex": "5.7.0", + "@ethersproject/bignumber": "5.7.0", + "@ethersproject/bytes": "5.7.0", + "@ethersproject/constants": "5.7.0", + "@ethersproject/contracts": "5.7.0", + "@ethersproject/hash": "5.7.0", + "@ethersproject/hdnode": "5.7.0", + "@ethersproject/json-wallets": "5.7.0", + "@ethersproject/keccak256": "5.7.0", + "@ethersproject/logger": "5.7.0", + "@ethersproject/networks": "5.7.1", + "@ethersproject/pbkdf2": "5.7.0", + "@ethersproject/properties": "5.7.0", + "@ethersproject/providers": "5.7.2", + "@ethersproject/random": "5.7.0", + "@ethersproject/rlp": "5.7.0", + "@ethersproject/sha2": "5.7.0", + "@ethersproject/signing-key": "5.7.0", + "@ethersproject/solidity": "5.7.0", + "@ethersproject/strings": "5.7.0", + "@ethersproject/transactions": "5.7.0", + "@ethersproject/units": "5.7.0", + "@ethersproject/wallet": "5.7.0", + "@ethersproject/web": "5.7.1", + "@ethersproject/wordlists": "5.7.0" + } + }, + "node_modules/ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "dev": true, + "optional": true, + "dependencies": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "dev": true + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==", + "dev": true, + "engines": { + "node": "> 0.1.90" + } + }, + "node_modules/fast-stable-stringify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz", + "integrity": "sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==", + "dev": true + }, + "node_modules/fastestsmallesttextencoderdecoder": { + "version": "1.0.22", + "resolved": "https://registry.npmjs.org/fastestsmallesttextencoderdecoder/-/fastestsmallesttextencoderdecoder-1.0.22.tgz", + "integrity": "sha512-Pb8d48e+oIuY4MaM64Cd7OW1gt4nxCHs7/ddPPZ/Ic3sg8yVGM7O9wDvZ7us6ScaUupzM+pfBolwtYhN1IxBIw==", + "dev": true, + "peer": true + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true + }, + "node_modules/find-replace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", + "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", + "dev": true, + "dependencies": { + "array-back": "^3.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "dev": true + }, + "node_modules/fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "optional": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "optional": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "optional": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "dev": true + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "optional": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "optional": true, + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/google-protobuf": { + "version": "3.21.2", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.2.tgz", + "integrity": "sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA==", + "dev": true + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "optional": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/graphql": { + "version": "16.8.1", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz", + "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==", + "dev": true, + "optional": true, + "engines": { + "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" + } + }, + "node_modules/graphql-tag": { + "version": "2.12.6", + "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.12.6.tgz", + "integrity": "sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==", + "dev": true, + "optional": true, + "dependencies": { + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "graphql": "^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "optional": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "optional": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "optional": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "optional": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hi-base32": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/hi-base32/-/hi-base32-0.5.1.tgz", + "integrity": "sha512-EmBBpvdYh/4XxsnUybsPag6VikPYnN30td+vQk+GI3qpahVEG9+gTkG0aXVxTjBqQ5T6ijbWIu77O+C5WFWsnA==", + "dev": true + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dev": true, + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "dev": true, + "optional": true, + "dependencies": { + "react-is": "^16.7.0" + } + }, + "node_modules/http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "dev": true, + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/http-errors/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/http-status-codes": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/http-status-codes/-/http-status-codes-2.3.0.tgz", + "integrity": "sha512-RJ8XvFvpPM/Dmc5SV+dC4y5PCeOhT3x1Hq0NU3rjGeg5a/CqlhZ7uudknPwZFz4aeAXDcbAyaeP7GAo9lvngtA==", + "dev": true, + "optional": true + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "dev": true, + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true, + "optional": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "dependencies": { + "loose-envify": "^1.0.0" + } + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, + "optional": true, + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==", + "dev": true, + "optional": true, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "dev": true, + "optional": true + }, + "node_modules/isomorphic-ws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", + "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", + "dev": true, + "peerDependencies": { + "ws": "*" + } + }, + "node_modules/jayson": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/jayson/-/jayson-4.1.0.tgz", + "integrity": "sha512-R6JlbyLN53Mjku329XoRT2zJAE6ZgOQ8f91ucYdMCD4nkGCF9kZSrcGXpHIU4jeKj58zUZke2p+cdQchU7Ly7A==", + "dev": true, + "dependencies": { + "@types/connect": "^3.4.33", + "@types/node": "^12.12.54", + "@types/ws": "^7.4.4", + "commander": "^2.20.3", + "delay": "^5.0.0", + "es6-promisify": "^5.0.0", + "eyes": "^0.1.8", + "isomorphic-ws": "^4.0.1", + "json-stringify-safe": "^5.0.1", + "JSONStream": "^1.3.5", + "uuid": "^8.3.2", + "ws": "^7.4.5" + }, + "bin": { + "jayson": "bin/jayson.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jayson/node_modules/@types/node": { + "version": "12.20.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", + "dev": true + }, + "node_modules/jayson/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/js-base64": { + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.7.tgz", + "integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==", + "dev": true + }, + "node_modules/js-sha256": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", + "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==", + "dev": true + }, + "node_modules/js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "dev": true + }, + "node_modules/js-sha512": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha512/-/js-sha512-0.8.0.tgz", + "integrity": "sha512-PWsmefG6Jkodqt+ePTvBZCSMFgN7Clckjd0O7su3I0+BW2QWUTJNzjktHsztGLhncP2h8mcF9V9Y2Ha59pAViQ==", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/jscrypto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/jscrypto/-/jscrypto-1.0.3.tgz", + "integrity": "sha512-lryZl0flhodv4SZHOqyb1bx5sKcJxj0VBo0Kzb4QMAg3L021IC9uGpl0RCZa+9KJwlRGSK2C80ITcwbe19OKLQ==", + "dev": true, + "bin": { + "jscrypto": "bin/cli.js" + } + }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "dev": true, + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", + "dev": true, + "engines": [ + "node >= 0.2.0" + ] + }, + "node_modules/jsonschema": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz", + "integrity": "sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==", + "dev": true, + "optional": true, + "engines": { + "node": "*" + } + }, + "node_modules/JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dev": true, + "dependencies": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + }, + "bin": { + "JSONStream": "bin.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/keccak": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.4.tgz", + "integrity": "sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/keccak256": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/keccak256/-/keccak256-1.0.6.tgz", + "integrity": "sha512-8GLiM01PkdJVGUhR1e6M/AvWnSqYS0HaERI+K/QtStGDGlSTx2B1zTqZk4Zlqu5TxHJNTxWAdP9Y+WI50OApUw==", + "dev": true, + "optional": true, + "dependencies": { + "bn.js": "^5.2.0", + "buffer": "^6.0.3", + "keccak": "^3.0.2" + } + }, + "node_modules/libsodium": { + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.13.tgz", + "integrity": "sha512-mK8ju0fnrKXXfleL53vtp9xiPq5hKM0zbDQtcxQIsSmxNgSxqCj6R7Hl9PkrNe2j29T4yoDaF7DJLK9/i5iWUw==", + "dev": true, + "optional": true + }, + "node_modules/libsodium-wrappers": { + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.13.tgz", + "integrity": "sha512-kasvDsEi/r1fMzKouIDv7B8I6vNmknXwGiYodErGuESoFTohGSKZplFtVxZqHaoQ217AynyIFgnOVRitpHs0Qw==", + "dev": true, + "optional": true, + "dependencies": { + "libsodium": "^0.7.13" + } + }, + "node_modules/link-module-alias": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/link-module-alias/-/link-module-alias-1.2.0.tgz", + "integrity": "sha512-ahPjXepbSVKbahTB6LxR//VHm8HPfI+QQygCH+E82spBY4HR5VPJTvlhKBc9F7muVxnS6C1rRfoPOXAbWO/fyw==", + "dev": true, + "optional": true, + "dependencies": { + "chalk": "^2.4.1" + }, + "bin": { + "link-module-alias": "index.js" + }, + "engines": { + "node": "> 8.0.0" + } + }, + "node_modules/link-module-alias/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "optional": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/link-module-alias/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "optional": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/link-module-alias/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "optional": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/link-module-alias/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "optional": true + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "dev": true + }, + "node_modules/lodash.values": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.values/-/lodash.values-4.3.0.tgz", + "integrity": "sha512-r0RwvdCv8id9TUblb/O7rYPwVy6lerCbcawrfdo9iC/1t1wsNMJknO79WNBgwkH0hIeJ08jmvvESbFpNb4jH0Q==", + "dev": true, + "optional": true + }, + "node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", + "dev": true + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "dev": true, + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/map-obj": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "dev": true, + "optional": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", + "dev": true + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "dev": true + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/mustache": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", + "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", + "dev": true, + "bin": { + "mustache": "bin/mustache" + } + }, + "node_modules/nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "dev": true + }, + "node_modules/napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", + "dev": true + }, + "node_modules/near-api-js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/near-api-js/-/near-api-js-1.1.0.tgz", + "integrity": "sha512-qYKv1mYsaDZc2uYndhS+ttDhR9+60qFc+ZjD6lWsAxr3ZskMjRwPffDGQZYhC7BRDQMe1HEbk6d5mf+TVm0Lqg==", + "dev": true, + "dependencies": { + "bn.js": "5.2.1", + "borsh": "^0.7.0", + "bs58": "^4.0.0", + "depd": "^2.0.0", + "error-polyfill": "^0.1.3", + "http-errors": "^1.7.2", + "js-sha256": "^0.9.0", + "mustache": "^4.0.0", + "node-fetch": "^2.6.1", + "text-encoding-utf-8": "^1.0.2", + "tweetnacl": "^1.0.1" + } + }, + "node_modules/no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "dev": true, + "dependencies": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, + "node_modules/node-abi": { + "version": "3.62.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.62.0.tgz", + "integrity": "sha512-CPMcGa+y33xuL1E0TcNIu4YyaZCxnnvkVaEXrsosR3FxN+fV8xvb7Mzpb7IgKler10qeMkE6+Dp8qJhpzdq35g==", + "dev": true, + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", + "dev": true + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-gyp-build": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.1.tgz", + "integrity": "sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==", + "dev": true, + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/node-hid": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/node-hid/-/node-hid-2.2.0.tgz", + "integrity": "sha512-vj48zh9j555DZzUhMc8tk/qw6xPFrDyPBH1ST1Z/hWaA/juBJw7IuSxPeOgpzNFNU36mGYj+THioRMt1xOdm/g==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "bindings": "^1.5.0", + "node-addon-api": "^3.0.2", + "prebuild-install": "^7.1.1" + }, + "bin": { + "hid-showdevices": "src/show-devices.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-hid/node_modules/node-addon-api": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", + "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", + "dev": true + }, + "node_modules/noms": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", + "integrity": "sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==", + "dev": true, + "optional": true, + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "~1.0.31" + } + }, + "node_modules/noms/node_modules/readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", + "dev": true, + "optional": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/noms/node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", + "dev": true, + "optional": true + }, + "node_modules/o3": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/o3/-/o3-1.0.3.tgz", + "integrity": "sha512-f+4n+vC6s4ysy7YO7O2gslWZBUu8Qj2i2OUJOvjRxQva7jVjYjB29jrr9NCjmxZQR0gzrOcv1RnqoYOeMs5VRQ==", + "dev": true, + "dependencies": { + "capability": "^0.2.5" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "optional": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optimism": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.18.0.tgz", + "integrity": "sha512-tGn8+REwLRNFnb9WmcY5IfpOqeX2kpaYJ1s6Ae3mn12AeydLkR3j+jSCmVQFoXqU8D41PAJ1RG1rCRNWmNZVmQ==", + "dev": true, + "optional": true, + "dependencies": { + "@wry/caches": "^1.0.0", + "@wry/context": "^0.7.0", + "@wry/trie": "^0.4.3", + "tslib": "^2.3.0" + } + }, + "node_modules/optimism/node_modules/@wry/trie": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.4.3.tgz", + "integrity": "sha512-I6bHwH0fSf6RqQcnnXLJKhkSXG45MFral3GxPaY4uAl0LYDZM+YDVDAiU9bYwjTuysy1S0IeecWtmq1SZA3M1w==", + "dev": true, + "optional": true, + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pako": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", + "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==", + "dev": true + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "optional": true + }, + "node_modules/pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dev": true, + "dependencies": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/prebuild-install": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz", + "integrity": "sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==", + "dev": true, + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true, + "optional": true + }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dev": true, + "optional": true, + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/protobufjs": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.0.tgz", + "integrity": "sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/protobufjs/node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", + "dev": true + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/react": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "dev": true, + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "dev": true, + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + }, + "peerDependencies": { + "react": "^18.3.1" + } + }, + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true, + "optional": true + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readonly-date": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/readonly-date/-/readonly-date-1.0.0.tgz", + "integrity": "sha512-tMKIV7hlk0h4mO3JTmmVuIlJVXjKk3Sep9Bf5OH0O+758ruuVkUy2J9SttDLm91IEX/WHlXPSpxMGjPj4beMIQ==", + "dev": true, + "optional": true + }, + "node_modules/rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", + "dev": true, + "optional": true, + "dependencies": { + "resolve": "^1.1.6" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/reduce-flatten": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", + "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "dev": true + }, + "node_modules/rehackt": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/rehackt/-/rehackt-0.1.0.tgz", + "integrity": "sha512-7kRDOuLHB87D/JESKxQoRwv4DzbIdwkAGQ7p6QKGdVlY1IZheUnVhlk/4UZlNUVxdAXpyxikE3URsG067ybVzw==", + "dev": true, + "optional": true, + "peerDependencies": { + "@types/react": "*", + "react": "*" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "react": { + "optional": true + } + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "optional": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/response-iterator": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/response-iterator/-/response-iterator-0.2.6.tgz", + "integrity": "sha512-pVzEEzrsg23Sh053rmDUvLSkGXluZio0qu8VT6ukrYuvtjVfCbDZH9d6PGXb8HZfzdNZt8feXv/jvUzlhRgLnw==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/ripemd160-min": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/ripemd160-min/-/ripemd160-min-0.0.6.tgz", + "integrity": "sha512-+GcJgQivhs6S9qvLogusiTcS9kQUfgR75whKuy5jIhuiOfQuJ8fjqxV6EGD5duH1Y/FawFUMtMhyeq3Fbnib8A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/rlp": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", + "integrity": "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==", + "dev": true, + "dependencies": { + "bn.js": "^5.2.0" + }, + "bin": { + "rlp": "bin/rlp" + } + }, + "node_modules/rpc-websockets": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.11.0.tgz", + "integrity": "sha512-IkLYjayPv6Io8C/TdCL5gwgzd1hFz2vmBZrjMw/SPEXo51ETOhnzgS4Qy5GWi2JQN7HKHa66J3+2mv0fgNh/7w==", + "dev": true, + "dependencies": { + "eventemitter3": "^4.0.7", + "uuid": "^8.3.2", + "ws": "^8.5.0" + }, + "funding": { + "type": "paypal", + "url": "https://paypal.me/kozjak" + }, + "optionalDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + } + }, + "node_modules/rpc-websockets/node_modules/ws": { + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.0.tgz", + "integrity": "sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==", + "dev": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dev": true, + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/scheduler": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "dev": true, + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", + "dev": true + }, + "node_modules/secp256k1": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "elliptic": "^6.5.4", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true + }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "node_modules/sha3": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/sha3/-/sha3-2.1.4.tgz", + "integrity": "sha512-S8cNxbyb0UGUM2VhRD4Poe5N58gJnJsLJ5vC7FYWGUmGhcsj4++WaIOBFVDxlG0W3To6xBuiRh+i0Qp2oNCOtg==", + "dev": true, + "dependencies": { + "buffer": "6.0.3" + } + }, + "node_modules/shelljs": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", + "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", + "dev": true, + "optional": true, + "dependencies": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + }, + "bin": { + "shjs": "bin/shjs" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/shx": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/shx/-/shx-0.3.4.tgz", + "integrity": "sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==", + "dev": true, + "optional": true, + "dependencies": { + "minimist": "^1.2.3", + "shelljs": "^0.8.5" + }, + "bin": { + "shx": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/snake-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", + "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", + "dev": true, + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/snakecase-keys": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/snakecase-keys/-/snakecase-keys-5.5.0.tgz", + "integrity": "sha512-r3kRtnoPu3FxGJ3fny6PKNnU3pteb29o6qAa0ugzhSseKNWRkw1dw8nIjXMyyKaU9vQxxVIE62Mb3bKbdrgpiw==", + "dev": true, + "optional": true, + "dependencies": { + "map-obj": "^4.1.0", + "snake-case": "^3.0.4", + "type-fest": "^3.12.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/store2": { + "version": "2.14.3", + "resolved": "https://registry.npmjs.org/store2/-/store2-2.14.3.tgz", + "integrity": "sha512-4QcZ+yx7nzEFiV4BMLnr/pRa5HYzNITX2ri0Zh6sT9EyQHbBHacC6YigllUPU9X3D0f/22QCgfokpKs52YRrUg==", + "dev": true, + "optional": true + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-format": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/string-format/-/string-format-2.0.0.tgz", + "integrity": "sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA==", + "dev": true + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "optional": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "optional": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==", + "dev": true, + "optional": true, + "dependencies": { + "is-hex-prefixed": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/superstruct": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-1.0.4.tgz", + "integrity": "sha512-7JpaAoX2NGyoFlI9NBh66BQXGONc+uE+MRS5i2iOBKuS4e+ccgMDjATgZldkah+33DakBxDHiss9kvUcGAO8UQ==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "optional": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/symbol-observable": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", + "integrity": "sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/table-layout": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz", + "integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==", + "dev": true, + "dependencies": { + "array-back": "^4.0.1", + "deep-extend": "~0.6.0", + "typical": "^5.2.0", + "wordwrapjs": "^4.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/table-layout/node_modules/array-back": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", + "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/table-layout/node_modules/typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "dev": true, + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dev": true, + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/text-encoding-utf-8": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz", + "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==", + "dev": true + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true + }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "optional": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/through2/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true, + "optional": true + }, + "node_modules/through2/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "optional": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/through2/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "optional": true + }, + "node_modules/through2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "optional": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/tiny-secp256k1": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/tiny-secp256k1/-/tiny-secp256k1-1.1.6.tgz", + "integrity": "sha512-FmqJZGduTyvsr2cF3375fqGHUovSwDi/QytexX1Se4BPuPZpTE5Ftp5fg+EFSuEf3lhZqgCRjEG3ydUQ/aNiwA==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "bindings": "^1.3.0", + "bn.js": "^4.11.8", + "create-hmac": "^1.1.7", + "elliptic": "^6.4.0", + "nan": "^2.13.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/tiny-secp256k1/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/tmp": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", + "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", + "dev": true, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/toml": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", + "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==", + "dev": true + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, + "node_modules/ts-command-line-args": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/ts-command-line-args/-/ts-command-line-args-2.5.1.tgz", + "integrity": "sha512-H69ZwTw3rFHb5WYpQya40YAX2/w7Ut75uUECbgBIsLmM+BNuYnxsltfyyLMxy6sEeKxgijLTnQtLd0nKd6+IYw==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "command-line-args": "^5.1.1", + "command-line-usage": "^6.1.0", + "string-format": "^2.0.0" + }, + "bin": { + "write-markdown": "dist/write-markdown.js" + } + }, + "node_modules/ts-command-line-args/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ts-command-line-args/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ts-command-line-args/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ts-essentials": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-7.0.3.tgz", + "integrity": "sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ==", + "dev": true, + "peerDependencies": { + "typescript": ">=3.7.0" + } + }, + "node_modules/ts-invariant": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.10.3.tgz", + "integrity": "sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==", + "dev": true, + "optional": true, + "dependencies": { + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, + "node_modules/tsx": { + "version": "4.9.4", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.9.4.tgz", + "integrity": "sha512-TlSJTVn2taGGDgdV3jAqCj7WQ/CafCB5p4SbG7W2Bl/0AJWH1ShJlBbc0y2lOFTjQEVAAULSTlmehw/Mwv3S/Q==", + "dev": true, + "dependencies": { + "esbuild": "~0.20.2", + "get-tsconfig": "^4.7.3" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "dev": true + }, + "node_modules/tweetnacl-util": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", + "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==", + "dev": true, + "optional": true + }, + "node_modules/type-fest": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typechain": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/typechain/-/typechain-8.3.2.tgz", + "integrity": "sha512-x/sQYr5w9K7yv3es7jo4KTX05CLxOf7TRWwoHlrjRh8H82G64g+k7VuWPJlgMo6qrjfCulOdfBjiaDtmhFYD/Q==", + "dev": true, + "dependencies": { + "@types/prettier": "^2.1.1", + "debug": "^4.3.1", + "fs-extra": "^7.0.0", + "glob": "7.1.7", + "js-sha3": "^0.8.0", + "lodash": "^4.17.15", + "mkdirp": "^1.0.4", + "prettier": "^2.3.1", + "ts-command-line-args": "^2.2.0", + "ts-essentials": "^7.0.1" + }, + "bin": { + "typechain": "dist/cli/cli.js" + }, + "peerDependencies": { + "typescript": ">=4.3.0" + } + }, + "node_modules/typechain/node_modules/glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/typeforce": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/typeforce/-/typeforce-1.18.0.tgz", + "integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==", + "dev": true + }, + "node_modules/typescript": { + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typical": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", + "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/u3": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/u3/-/u3-0.1.1.tgz", + "integrity": "sha512-+J5D5ir763y+Am/QY6hXNRlwljIeRMZMGs0cT6qqZVVzzT3X3nFPXVyPOFRMOR4kupB0T8JnCdpWdp6Q/iXn3w==", + "dev": true + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true, + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/usb": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/usb/-/usb-2.9.0.tgz", + "integrity": "sha512-G0I/fPgfHUzWH8xo2KkDxTTFruUWfppgSFJ+bQxz/kVY2x15EQ/XDB7dqD1G432G4gBG4jYQuF3U7j/orSs5nw==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@types/w3c-web-usb": "^1.0.6", + "node-addon-api": "^6.0.0", + "node-gyp-build": "^4.5.0" + }, + "engines": { + "node": ">=10.20.0 <11.x || >=12.17.0 <13.0 || >=14.0.0" + } + }, + "node_modules/usb/node_modules/node-addon-api": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", + "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==", + "dev": true + }, + "node_modules/utf-8-validate": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", + "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "node_modules/utility-types": { + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/utility-types/-/utility-types-3.11.0.tgz", + "integrity": "sha512-6Z7Ma2aVEWisaL6TvBCy7P8rm2LQoPv6dJ7ecIaIixHcwfbJ0x7mWdbcwlIM5IGQxPZSFYeqRCqlOOeKoJYMkw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/vlq": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-2.0.4.tgz", + "integrity": "sha512-aodjPa2wPQFkra1G8CzJBTHXhgk3EVSwxSWXNPr1fgdFLUb8kvLV1iEb6rFgasIsjP82HWI6dsb5Io26DDnasA==", + "dev": true + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/wif": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/wif/-/wif-2.0.6.tgz", + "integrity": "sha512-HIanZn1zmduSF+BQhkE+YXIbEiH0xPr1012QbFEGB0xsKqJii0/SqJjyn8dFv6y36kOznMgMB+LGcbZTJ1xACQ==", + "dev": true, + "dependencies": { + "bs58check": "<3.0.0" + } + }, + "node_modules/wordwrapjs": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.1.tgz", + "integrity": "sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==", + "dev": true, + "dependencies": { + "reduce-flatten": "^2.0.0", + "typical": "^5.2.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/wordwrapjs/node_modules/typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "optional": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/ws": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "dev": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xstream": { + "version": "11.14.0", + "resolved": "https://registry.npmjs.org/xstream/-/xstream-11.14.0.tgz", + "integrity": "sha512-1bLb+kKKtKPbgTK6i/BaoAn03g47PpFstlbe1BA+y3pNS/LfvcaghS5BFf9+EE1J+KwSQsEpfJvFN5GqFtiNmw==", + "dev": true, + "optional": true, + "dependencies": { + "globalthis": "^1.0.1", + "symbol-observable": "^2.0.3" + } + }, + "node_modules/xstream/node_modules/symbol-observable": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-2.0.3.tgz", + "integrity": "sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "optional": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "optional": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "optional": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/zen-observable": { + "version": "0.8.15", + "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.15.tgz", + "integrity": "sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==", + "dev": true, + "optional": true + }, + "node_modules/zen-observable-ts": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-1.2.5.tgz", + "integrity": "sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg==", + "dev": true, + "optional": true, + "dependencies": { + "zen-observable": "0.8.15" + } + } + } +} diff --git a/deployment/package.json b/deployment/package.json new file mode 100644 index 00000000..c34b416a --- /dev/null +++ b/deployment/package.json @@ -0,0 +1,18 @@ +{ + "name": "deployment", + "scripts": { + "build-evm": "npx typechain --target=ethers-v5 --out-dir=./contract-bindings ../out/../evm/*/*.json" + }, + "author": "", + "devDependencies": { + "@certusone/wormhole-sdk": "^0.10.11", + "@typechain/ethers-v5": "^11.1.2", + "@types/node": "^20.11.22", + "@xlabs-xyz/ledger-signer": "^0.0.4", + "dotenv": "^16.4.5", + "ethers": "^5.7.2", + "tsx": "^4.7.2", + "typechain": "^8.3.2", + "typescript": "^5.4.5" + } +} From 3122ddce38a4822f38d9a4e8a74aa94d45388f56 Mon Sep 17 00:00:00 2001 From: solanoe Date: Fri, 10 May 2024 16:20:35 -0300 Subject: [PATCH 04/80] environment setup utils --- deployment/config/testnet/chains.json | 41 ++++++++ deployment/config/testnet/contracts.json | 0 .../config/testnet/matching-engine.json | 0 deployment/config/testnet/token-router.json | 0 deployment/helpers/env.ts | 97 +++++++++++++++++++ deployment/helpers/evm.ts | 46 +++++++++ deployment/helpers/index.ts | 3 + deployment/helpers/solana.ts | 1 + .../scripts/evm/deploy-matching-engine.ts | 0 deployment/scripts/evm/deploy-token-router.ts | 0 10 files changed, 188 insertions(+) create mode 100644 deployment/config/testnet/chains.json create mode 100644 deployment/config/testnet/contracts.json create mode 100644 deployment/config/testnet/matching-engine.json create mode 100644 deployment/config/testnet/token-router.json create mode 100644 deployment/helpers/env.ts create mode 100644 deployment/helpers/evm.ts create mode 100644 deployment/helpers/index.ts create mode 100644 deployment/helpers/solana.ts create mode 100644 deployment/scripts/evm/deploy-matching-engine.ts create mode 100644 deployment/scripts/evm/deploy-token-router.ts diff --git a/deployment/config/testnet/chains.json b/deployment/config/testnet/chains.json new file mode 100644 index 00000000..600cf871 --- /dev/null +++ b/deployment/config/testnet/chains.json @@ -0,0 +1,41 @@ +{ + "guardianSetIndex": 3, + "evm": { + "operatingChains": [], + "networks": [ + { + "description": "Ethereum", + "externalId": 1, + "chainId": 2, + "rpc": "https://eth.llamarpc.com" + }, + { + "description": "Arbitrum", + "externalId": 42161, + "chainId": 23, + "rpc": "https://arbitrum.llamarpc.com" + }, + { + "description": "Optimism", + "externalId": 10, + "chainId": 24, + "rpc": "https://optimism-rpc.publicnode.com" + }, + { + "description": "Base", + "externalId": 8453, + "chainId": 30, + "rpc": "https://mainnet.base.org" + } + ] + }, + "solana": { + "networks": [ + { + "description": "Solana", + "chainId": 1, + "rpc": "https://solana.llamarpc.com" + } + ] + } +} \ No newline at end of file diff --git a/deployment/config/testnet/contracts.json b/deployment/config/testnet/contracts.json new file mode 100644 index 00000000..e69de29b diff --git a/deployment/config/testnet/matching-engine.json b/deployment/config/testnet/matching-engine.json new file mode 100644 index 00000000..e69de29b diff --git a/deployment/config/testnet/token-router.json b/deployment/config/testnet/token-router.json new file mode 100644 index 00000000..e69de29b diff --git a/deployment/helpers/env.ts b/deployment/helpers/env.ts new file mode 100644 index 00000000..f78ccdd9 --- /dev/null +++ b/deployment/helpers/env.ts @@ -0,0 +1,97 @@ +import fs from "fs"; +import { ChainId } from "@certusone/wormhole-sdk"; + +/** + * Types: + */ +export type ChainInfo = { + name: string; + chainId: ChainId; + rpc: string; + externalId?: string; +}; + +export type Deployment = { + chainId: ChainId; + address: string; +}; + +export type Ecosystem = { + guardianSetIndex: number; + evm: { + operatingChains?: number[]; + networks: ChainInfo[]; + }, + solana: { + networks: ChainInfo[]; + } +}; + +export type ContractsJson = Record; + +interface ChainConfig { + chainId: ChainId; +} + +export const env = getEnv("ENV"); +export const contracts = loadContracts(); +export const ecosystemChains = loadEcosystem(); + +function loadJson(filename: string): T { + const fileContent = fs.readFileSync( + `./config/${env}/${filename}.json` + ); + + return JSON.parse(fileContent.toString()) as T; +} + +function loadContracts() { + return loadJson("contracts"); +} + +function loadEcosystem(): Ecosystem { + return loadJson("ecosystem"); +} + +export function getEnv(env: string): string { + const v = process.env[env]; + if (!v) { + throw Error(`Env var not set: ${env}`); + } + return v; +} + +export async function getChainConfig(filename: string, chainId: ChainId): Promise { + const scriptConfig: T[] = await loadJson(filename); + + const chainConfig = scriptConfig.find((x) => x.chainId == chainId); + + if (!chainConfig) { + throw Error(`Failed to find chain config for chain ${chainId}`); + } + + return chainConfig; +} + +export async function getContractAddress(contractName: string, chainId: ChainId): Promise { + const contract = contracts[contractName]?.find((c) => c.chainId === chainId)?.address; + + if (!contract) { + throw new Error(`No ${contractName} contract found for chain ${chainId}`); + } + + return contract; +} + +export function writeDeployedContract(chain: ChainId, contractName: string, address: string) { + const contracts = loadContracts(); + if (!contracts[contractName]) { + contracts[contractName] = []; + } + contracts[contractName].push({ chainId: chain, address: process.env[contractName]! }); + fs.writeFileSync( + `./config/${env}/contracts.json`, + JSON.stringify(contracts), + { flag: "w" } + ); +} diff --git a/deployment/helpers/evm.ts b/deployment/helpers/evm.ts new file mode 100644 index 00000000..16ff5384 --- /dev/null +++ b/deployment/helpers/evm.ts @@ -0,0 +1,46 @@ +import { ecosystemChains } from "./index"; + +export function evmOperatingChains() { + const { operatingChains } = ecosystemChains.evm; + if (Array.isArray(operatingChains) && operatingChains.length >= 1) { + return ecosystemChains.evm.networks.filter((x) => { + return operatingChains.includes(x.chainId); + }); + } + return ecosystemChains.evm.networks; +}; + + +// export async function getSigner(chain: ChainInfo): Promise { +// const provider = getProvider(chain); +// const privateKey = loadPrivateKey(); + +// if (privateKey === "ledger") { +// if (process.env.LEDGER_BIP32_PATH === undefined) { +// throw new Error(`Missing BIP32 derivation path. +// With ledger devices the path needs to be specified in env var 'LEDGER_BIP32_PATH'.`); +// } +// const { LedgerSigner } = await import("@xlabs-xyz/ledger-signer"); +// return LedgerSigner.create(provider, process.env.LEDGER_BIP32_PATH); +// } + +// const signer = new ethers.Wallet(privateKey, provider); +// return signer; +// } + +// export function getProvider( +// chain: ChainInfo +// ): ethers.providers.StaticJsonRpcProvider { +// const providerRpc = loadChains().find((x: any) => x.chainId == chain.chainId)?.rpc || ""; + +// if (!providerRpc) { +// throw new Error("Failed to find a provider RPC for chain " + chain.chainId); +// } + +// let provider = new ethers.providers.StaticJsonRpcProvider( +// providerRpc, +// ); + +// return provider; +// } + diff --git a/deployment/helpers/index.ts b/deployment/helpers/index.ts new file mode 100644 index 00000000..6fa1d6a9 --- /dev/null +++ b/deployment/helpers/index.ts @@ -0,0 +1,3 @@ +export * from "./env"; +export * from "./evm"; +export * from "./solana"; diff --git a/deployment/helpers/solana.ts b/deployment/helpers/solana.ts new file mode 100644 index 00000000..dd9c6f96 --- /dev/null +++ b/deployment/helpers/solana.ts @@ -0,0 +1 @@ +export const one = 1; \ No newline at end of file diff --git a/deployment/scripts/evm/deploy-matching-engine.ts b/deployment/scripts/evm/deploy-matching-engine.ts new file mode 100644 index 00000000..e69de29b diff --git a/deployment/scripts/evm/deploy-token-router.ts b/deployment/scripts/evm/deploy-token-router.ts new file mode 100644 index 00000000..e69de29b From 0f7d16ad69586bc9b588bf1dd529421b9a24f46f Mon Sep 17 00:00:00 2001 From: solanoe Date: Fri, 10 May 2024 18:51:34 -0300 Subject: [PATCH 05/80] adds gitignore to deployment directory --- deployment/.gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 deployment/.gitignore diff --git a/deployment/.gitignore b/deployment/.gitignore new file mode 100644 index 00000000..4da2edd1 --- /dev/null +++ b/deployment/.gitignore @@ -0,0 +1,2 @@ +contract-bindings +**.env \ No newline at end of file From 791acfbcdccfb70162af82192c163e7a19a5d70f Mon Sep 17 00:00:00 2001 From: solanoe Date: Fri, 10 May 2024 18:53:37 -0300 Subject: [PATCH 06/80] improves configuration structure --- deployment/config/config-types.ts | 20 +++++ deployment/config/testnet/dependencies.json | 8 ++ .../config/testnet/matching-engine.json | 10 +++ deployment/config/testnet/token-router.json | 9 +++ deployment/helpers/env.ts | 38 ++++++++-- deployment/helpers/evm.ts | 73 +++++++++++-------- deployment/helpers/index.ts | 2 + deployment/package.json | 3 +- 8 files changed, 126 insertions(+), 37 deletions(-) create mode 100644 deployment/config/config-types.ts create mode 100644 deployment/config/testnet/dependencies.json diff --git a/deployment/config/config-types.ts b/deployment/config/config-types.ts new file mode 100644 index 00000000..cd2c636b --- /dev/null +++ b/deployment/config/config-types.ts @@ -0,0 +1,20 @@ +import { ChainId } from "@certusone/wormhole-sdk"; + +export type TokenRouterConfiguration = { + chainId: ChainId; + ownerAssistant: string; + matchingEngineMintRecipient: string; + matchingEngineChain: string; + matchingEngineDomain: string; +}; + +export type MatchingEngineConfiguration = { + chainId: ChainId, + ownerAssistant: string, + feeRecipient: string, + userPenaltyRewardBps: string, + initialPenaltyBps: string, + auctionDuration: string, + auctionGracePeriod: string, + auctionPenaltyBlocks: string +}; \ No newline at end of file diff --git a/deployment/config/testnet/dependencies.json b/deployment/config/testnet/dependencies.json new file mode 100644 index 00000000..d7fb7a49 --- /dev/null +++ b/deployment/config/testnet/dependencies.json @@ -0,0 +1,8 @@ +[ + { + "chainId": 1, + "wormhole": "", + "token": "", + "tokenMessenger": "" + } +] \ No newline at end of file diff --git a/deployment/config/testnet/matching-engine.json b/deployment/config/testnet/matching-engine.json index e69de29b..d26b46b8 100644 --- a/deployment/config/testnet/matching-engine.json +++ b/deployment/config/testnet/matching-engine.json @@ -0,0 +1,10 @@ +{ + "chainId": 1, + "ownerAssistant": "", + "feeRecipient": "", + "userPenaltyRewardBps": "", + "initialPenaltyBps": "", + "auctionDuration": "", + "auctionGracePeriod": "", + "auctionPenaltyBlocks": "" +} \ No newline at end of file diff --git a/deployment/config/testnet/token-router.json b/deployment/config/testnet/token-router.json index e69de29b..b4dc92e2 100644 --- a/deployment/config/testnet/token-router.json +++ b/deployment/config/testnet/token-router.json @@ -0,0 +1,9 @@ +[ + { + "chainId": "", + "ownerAssistant": "", + "matchingEngineMintRecipient": "", + "matchingEngineChain": "", + "matchingEngineDomain": "" + } +] \ No newline at end of file diff --git a/deployment/helpers/env.ts b/deployment/helpers/env.ts index f78ccdd9..fa77f3f0 100644 --- a/deployment/helpers/env.ts +++ b/deployment/helpers/env.ts @@ -1,9 +1,6 @@ import fs from "fs"; import { ChainId } from "@certusone/wormhole-sdk"; -/** - * Types: - */ export type ChainInfo = { name: string; chainId: ChainId; @@ -29,12 +26,13 @@ export type Ecosystem = { export type ContractsJson = Record; -interface ChainConfig { +export interface ChainConfig { chainId: ChainId; } export const env = getEnv("ENV"); export const contracts = loadContracts(); +export const dependencies = loadDependencies(); export const ecosystemChains = loadEcosystem(); function loadJson(filename: string): T { @@ -45,6 +43,10 @@ function loadJson(filename: string): T { return JSON.parse(fileContent.toString()) as T; } +function loadDependencies() { + return loadJson("dependencies"); +} + function loadContracts() { return loadJson("contracts"); } @@ -83,12 +85,36 @@ export async function getContractAddress(contractName: string, chainId: ChainId) return contract; } +export function getDependencyAddress(dependencyName: string, chainId: ChainId): string { + const dependency = dependencies[dependencyName]?.find((d) => d.chainId === chainId)?.address; + + if (!dependency) { + throw new Error(`No dependency found for ${dependencyName}`); + } + + return dependency; +} + export function writeDeployedContract(chain: ChainId, contractName: string, address: string) { const contracts = loadContracts(); if (!contracts[contractName]) { - contracts[contractName] = []; + contracts[contractName] = [{ chainId: chain, address: process.env[contractName]! }]; } - contracts[contractName].push({ chainId: chain, address: process.env[contractName]! }); + + else if (!contracts[contractName].find((c) => c.chainId === chain)) { + contracts[contractName].push({ chainId: chain, address }); + } + + else { + contracts[contractName] = contracts[contractName].map((c) => { + if (c.chainId === chain) { + return { chainId: chain, address }; + } + + return c; + }); + } + fs.writeFileSync( `./config/${env}/contracts.json`, JSON.stringify(contracts), diff --git a/deployment/helpers/evm.ts b/deployment/helpers/evm.ts index 16ff5384..35f3c92c 100644 --- a/deployment/helpers/evm.ts +++ b/deployment/helpers/evm.ts @@ -1,4 +1,29 @@ -import { ecosystemChains } from "./index"; +import { LedgerSigner } from "@xlabs-xyz/ledger-signer"; +import { ethers } from "ethers"; +import { ChainInfo, ecosystemChains, getEnv, LoggerFn } from "./index"; + +export type EvmScriptCb = (chain: ChainInfo, signer: ethers.Signer, logFn: LoggerFn) => Promise; + +export async function runOnEvms(scriptName: string, cb: EvmScriptCb) { + const chains = evmOperatingChains(); + + console.log(`Running script on EVMs (${chains.map(c => c.chainId).join(", ")}):`, scriptName); + + const result = chains.map(async chain => { + const log = (...args: any[]) => console.log(`[${chain.chainId}]`, ...args); + const signer = await getSigner(chain); + log(`Starting script. Signer: ${await signer.getAddress()}`); + + try { + await cb(chain, signer, log); + log("Success"); + } catch (error) { + log("Error: ", error); + } + }); + + await Promise.all(result); +} export function evmOperatingChains() { const { operatingChains } = ecosystemChains.evm; @@ -10,37 +35,25 @@ export function evmOperatingChains() { return ecosystemChains.evm.networks; }; +export async function getSigner(chain: ChainInfo): Promise { + const derivationPath = getEnv("LEDGER_BIP32_PATH"); + const provider = getProvider(chain); + return LedgerSigner.create(provider, derivationPath); +} -// export async function getSigner(chain: ChainInfo): Promise { -// const provider = getProvider(chain); -// const privateKey = loadPrivateKey(); - -// if (privateKey === "ledger") { -// if (process.env.LEDGER_BIP32_PATH === undefined) { -// throw new Error(`Missing BIP32 derivation path. -// With ledger devices the path needs to be specified in env var 'LEDGER_BIP32_PATH'.`); -// } -// const { LedgerSigner } = await import("@xlabs-xyz/ledger-signer"); -// return LedgerSigner.create(provider, process.env.LEDGER_BIP32_PATH); -// } - -// const signer = new ethers.Wallet(privateKey, provider); -// return signer; -// } +export function getProvider( + chain: ChainInfo +): ethers.providers.StaticJsonRpcProvider { + const providerRpc = ecosystemChains.evm.networks.find((x: any) => x.chainId == chain.chainId)?.rpc || ""; -// export function getProvider( -// chain: ChainInfo -// ): ethers.providers.StaticJsonRpcProvider { -// const providerRpc = loadChains().find((x: any) => x.chainId == chain.chainId)?.rpc || ""; - -// if (!providerRpc) { -// throw new Error("Failed to find a provider RPC for chain " + chain.chainId); -// } + if (!providerRpc) { + throw new Error("Failed to find a provider RPC for chain " + chain.chainId); + } -// let provider = new ethers.providers.StaticJsonRpcProvider( -// providerRpc, -// ); + let provider = new ethers.providers.StaticJsonRpcProvider( + providerRpc, + ); -// return provider; -// } + return provider; +} diff --git a/deployment/helpers/index.ts b/deployment/helpers/index.ts index 6fa1d6a9..03ad2724 100644 --- a/deployment/helpers/index.ts +++ b/deployment/helpers/index.ts @@ -1,3 +1,5 @@ export * from "./env"; export * from "./evm"; export * from "./solana"; + +export type LoggerFn = (...args: any[]) => void; diff --git a/deployment/package.json b/deployment/package.json index c34b416a..2c918585 100644 --- a/deployment/package.json +++ b/deployment/package.json @@ -1,7 +1,8 @@ { "name": "deployment", "scripts": { - "build-evm": "npx typechain --target=ethers-v5 --out-dir=./contract-bindings ../out/../evm/*/*.json" + "evm-deps": "forge build -C /home/solanoe/xlabs/projects/example-liquidity-layer/evm/lib/openzeppelin-contracts/contracts/proxy/ERC1967", + "build-evm": "npm run evm-deps && npx typechain --target=ethers-v5 --out-dir=./contract-bindings ../evm/out/*/*.json ../evm/lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol" }, "author": "", "devDependencies": { From d192dc1b8bed263b0c6449c5b4c1f5f65366efd1 Mon Sep 17 00:00:00 2001 From: solanoe Date: Fri, 10 May 2024 18:54:14 -0300 Subject: [PATCH 07/80] evm deploy matching engine script --- .../scripts/evm/deploy-matching-engine.ts | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/deployment/scripts/evm/deploy-matching-engine.ts b/deployment/scripts/evm/deploy-matching-engine.ts index e69de29b..2d02a6ae 100644 --- a/deployment/scripts/evm/deploy-matching-engine.ts +++ b/deployment/scripts/evm/deploy-matching-engine.ts @@ -0,0 +1,64 @@ +import { ethers } from "ethers"; +import { runOnEvms, ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract } from "../../helpers"; +import { MatchingEngineConfiguration } from "../../config/config-types"; + +import { MatchingEngine__factory, ERC1967Upgrade__factory } from "../../contract-bindings"; +import { ERC1967Proxy__factory } from "@certusone/wormhole-sdk/lib/cjs/ethers-contracts"; + +runOnEvms("deploy-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + const config = await getMachingEngineConfiguration(chain); + const implementation = await deployImplementation(signer, config, log); + const proxy = await deployProxy(signer, config, implementation, log); + +}); + +function getMachingEngineConfiguration (chain: ChainInfo): Promise { + return getChainConfig("matching-engine", chain.chainId); +} + +async function deployImplementation (signer: ethers.Signer, config: MatchingEngineConfiguration, log: LoggerFn) { + const factory = new MatchingEngine__factory(signer); + const token = getDependencyAddress("Token", config.chainId); + const wormhole = getDependencyAddress("Wormhole", config.chainId); + const tokenMessenger = getDependencyAddress("TokenMessenger", config.chainId); + const deployment = await factory.deploy( + token, + wormhole, + tokenMessenger, + config.userPenaltyRewardBps, + config.initialPenaltyBps, + config.auctionDuration, + config.auctionGracePeriod, + config.auctionPenaltyBlocks, + {} // overrides + ); + + await deployment.deployed(); + + log(`MatchingEngine deployed at ${deployment.address}`); + + writeDeployedContract(config.chainId, "MatchingEngineImplementations", deployment.address); + + return deployment; +} + +async function deployProxy (signer: ethers.Signer, config: MatchingEngineConfiguration, implementation: ethers.Contract, log: LoggerFn) { + const factory = new ERC1967Proxy__factory(signer); + + const abi = ["function initialize(address,address)"]; + const iface = new ethers.utils.Interface(abi); + const encodedCall = iface.encodeFunctionData("initialize", [config.ownerAssistant, config.feeRecipient]); + + const deployment = await factory.deploy( + implementation.address, + encodedCall, + ); + + await deployment.deployed(); + + log(`MatchingEngineProxy deployed at ${deployment.address}`); + + writeDeployedContract(config.chainId, "MatchingEngineProxies", deployment.address); + + return deployment; +} From 371eb328d6c0ac6dc8c833ab147ab4bdf3aa04d0 Mon Sep 17 00:00:00 2001 From: solanoe Date: Wed, 15 May 2024 22:59:58 -0300 Subject: [PATCH 08/80] config placeholders for testnet chains --- deployment/config/testnet/chains.json | 12 ++++ deployment/config/testnet/contracts.json | 1 + deployment/config/testnet/dependencies.json | 32 ++++++++- .../config/testnet/matching-engine.json | 72 ++++++++++++++++--- deployment/config/testnet/token-router.json | 37 +++++++++- .../scripts/evm/deploy-matching-engine.ts | 2 +- 6 files changed, 143 insertions(+), 13 deletions(-) diff --git a/deployment/config/testnet/chains.json b/deployment/config/testnet/chains.json index 600cf871..7213ba0c 100644 --- a/deployment/config/testnet/chains.json +++ b/deployment/config/testnet/chains.json @@ -9,6 +9,18 @@ "chainId": 2, "rpc": "https://eth.llamarpc.com" }, + { + "description": "Polygon (amoy)", + "externalId": 80002, + "chainId": 5, + "rpc": "https://polygon-amoy-bor-rpc.publicnode.com" + }, + { + "description": "Avalanche", + "externalId": 43113, + "chainId": 6, + "rpc": "https://rpc.ankr.com/avalanche_fuji" + }, { "description": "Arbitrum", "externalId": 42161, diff --git a/deployment/config/testnet/contracts.json b/deployment/config/testnet/contracts.json index e69de29b..9e26dfee 100644 --- a/deployment/config/testnet/contracts.json +++ b/deployment/config/testnet/contracts.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/deployment/config/testnet/dependencies.json b/deployment/config/testnet/dependencies.json index d7fb7a49..b07e3a94 100644 --- a/deployment/config/testnet/dependencies.json +++ b/deployment/config/testnet/dependencies.json @@ -1,6 +1,36 @@ [ { - "chainId": 1, + "chainId": 2, + "wormhole": "", + "token": "", + "tokenMessenger": "" + }, + { + "chainId": 5, + "wormhole": "", + "token": "", + "tokenMessenger": "" + }, + { + "chainId": 6, + "wormhole": "", + "token": "", + "tokenMessenger": "" + }, + { + "chainId": 23, + "wormhole": "", + "token": "", + "tokenMessenger": "" + }, + { + "chainId": 24, + "wormhole": "", + "token": "", + "tokenMessenger": "" + }, + { + "chainId": 30, "wormhole": "", "token": "", "tokenMessenger": "" diff --git a/deployment/config/testnet/matching-engine.json b/deployment/config/testnet/matching-engine.json index d26b46b8..ad6fe13a 100644 --- a/deployment/config/testnet/matching-engine.json +++ b/deployment/config/testnet/matching-engine.json @@ -1,10 +1,62 @@ -{ - "chainId": 1, - "ownerAssistant": "", - "feeRecipient": "", - "userPenaltyRewardBps": "", - "initialPenaltyBps": "", - "auctionDuration": "", - "auctionGracePeriod": "", - "auctionPenaltyBlocks": "" -} \ No newline at end of file +[ + { + "chainId": 2, + "ownerAssistant": "", + "feeRecipient": "", + "userPenaltyRewardBps": "", + "initialPenaltyBps": "", + "auctionDuration": "", + "auctionGracePeriod": "", + "auctionPenaltyBlocks": "" + }, + { + "chainId": 5, + "ownerAssistant": "", + "feeRecipient": "", + "userPenaltyRewardBps": "", + "initialPenaltyBps": "", + "auctionDuration": "", + "auctionGracePeriod": "", + "auctionPenaltyBlocks": "" + }, + { + "chainId": 6, + "ownerAssistant": "", + "feeRecipient": "", + "userPenaltyRewardBps": "", + "initialPenaltyBps": "", + "auctionDuration": "", + "auctionGracePeriod": "", + "auctionPenaltyBlocks": "" + }, + { + "chainId": 23, + "ownerAssistant": "", + "feeRecipient": "", + "userPenaltyRewardBps": "", + "initialPenaltyBps": "", + "auctionDuration": "", + "auctionGracePeriod": "", + "auctionPenaltyBlocks": "" + }, + { + "chainId": 24, + "ownerAssistant": "", + "feeRecipient": "", + "userPenaltyRewardBps": "", + "initialPenaltyBps": "", + "auctionDuration": "", + "auctionGracePeriod": "", + "auctionPenaltyBlocks": "" + }, + { + "chainId": 30, + "ownerAssistant": "", + "feeRecipient": "", + "userPenaltyRewardBps": "", + "initialPenaltyBps": "", + "auctionDuration": "", + "auctionGracePeriod": "", + "auctionPenaltyBlocks": "" + } +] \ No newline at end of file diff --git a/deployment/config/testnet/token-router.json b/deployment/config/testnet/token-router.json index b4dc92e2..d42f3e82 100644 --- a/deployment/config/testnet/token-router.json +++ b/deployment/config/testnet/token-router.json @@ -1,6 +1,41 @@ [ { - "chainId": "", + "chainId": 2, + "ownerAssistant": "", + "matchingEngineMintRecipient": "", + "matchingEngineChain": "", + "matchingEngineDomain": "" + }, + { + "chainId": 5, + "ownerAssistant": "", + "matchingEngineMintRecipient": "", + "matchingEngineChain": "", + "matchingEngineDomain": "" + }, + { + "chainId": 6, + "ownerAssistant": "", + "matchingEngineMintRecipient": "", + "matchingEngineChain": "", + "matchingEngineDomain": "" + }, + { + "chainId": 23, + "ownerAssistant": "", + "matchingEngineMintRecipient": "", + "matchingEngineChain": "", + "matchingEngineDomain": "" + }, + { + "chainId": 24, + "ownerAssistant": "", + "matchingEngineMintRecipient": "", + "matchingEngineChain": "", + "matchingEngineDomain": "" + }, + { + "chainId": 30, "ownerAssistant": "", "matchingEngineMintRecipient": "", "matchingEngineChain": "", diff --git a/deployment/scripts/evm/deploy-matching-engine.ts b/deployment/scripts/evm/deploy-matching-engine.ts index 2d02a6ae..cd0d1fc0 100644 --- a/deployment/scripts/evm/deploy-matching-engine.ts +++ b/deployment/scripts/evm/deploy-matching-engine.ts @@ -2,7 +2,7 @@ import { ethers } from "ethers"; import { runOnEvms, ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract } from "../../helpers"; import { MatchingEngineConfiguration } from "../../config/config-types"; -import { MatchingEngine__factory, ERC1967Upgrade__factory } from "../../contract-bindings"; +import { MatchingEngine__factory } from "../../contract-bindings"; import { ERC1967Proxy__factory } from "@certusone/wormhole-sdk/lib/cjs/ethers-contracts"; runOnEvms("deploy-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { From c33754a9ebec74aa4c0c987cf3b3ba4d68619b3e Mon Sep 17 00:00:00 2001 From: solanoe Date: Wed, 15 May 2024 23:14:27 -0300 Subject: [PATCH 09/80] evm: deploy-token-router script --- deployment/scripts/evm/deploy-token-router.ts | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/deployment/scripts/evm/deploy-token-router.ts b/deployment/scripts/evm/deploy-token-router.ts index e69de29b..d130a077 100644 --- a/deployment/scripts/evm/deploy-token-router.ts +++ b/deployment/scripts/evm/deploy-token-router.ts @@ -0,0 +1,73 @@ +import { ethers } from "ethers"; +import { ERC1967Proxy__factory } from "@certusone/wormhole-sdk/lib/cjs/ethers-contracts"; +import { ChainId } from "@certusone/wormhole-sdk"; +import { runOnEvms, ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress } from "../../helpers"; +import { MatchingEngineConfiguration, TokenRouterConfiguration } from "../../config/config-types"; + +import { MatchingEngine__factory, TokenRouter__factory } from "../../contract-bindings"; +import { TokenRouter } from "../../../evm/ts/src/types"; + +runOnEvms("deploy-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + const config = await getTokenRouterConfiguration(chain); + const implementation = await deployImplementation(signer, config, log); + const proxy = await deployProxy(signer, config, implementation, log); + +}); + +function getTokenRouterConfiguration (chain: ChainInfo): Promise { + return getChainConfig("token-router", chain.chainId); +} + +async function deployImplementation (signer: ethers.Signer, config: TokenRouterConfiguration, log: LoggerFn) { + const factory = new TokenRouter__factory(signer); + + const token = getDependencyAddress("Token", config.chainId); + const wormhole = getDependencyAddress("Wormhole", config.chainId); + const tokenMessenger = getDependencyAddress("TokenMessenger", config.chainId); + + // TODO: ensure that this is a 32-byte address? + const matchingEngineAddress = await getContractAddress( + "MatchingEngineProxies", + Number(config.matchingEngineChain) as ChainId + ); + + const deployment = await factory.deploy( + token, + wormhole, + tokenMessenger, + config.matchingEngineChain, + matchingEngineAddress, + config.matchingEngineMintRecipient, + config.matchingEngineDomain, + {} // overrides + ); + + await deployment.deployed(); + + log(`TokenRouter deployed at ${deployment.address}`); + + writeDeployedContract(config.chainId, "TokenRouterImplementations", deployment.address); + + return deployment; +} + +async function deployProxy (signer: ethers.Signer, config: TokenRouterConfiguration, implementation: ethers.Contract, log: LoggerFn) { + const factory = new ERC1967Proxy__factory(signer); + + const abi = ["function initialize(address)"]; + const iface = new ethers.utils.Interface(abi); + const encodedCall = iface.encodeFunctionData("initialize", [config.ownerAssistant]); + + const deployment = await factory.deploy( + implementation.address, + encodedCall, + ); + + await deployment.deployed(); + + log(`TokenRouterProxy deployed at ${deployment.address}`); + + writeDeployedContract(config.chainId, "TokenRouterProxies", deployment.address); + + return deployment; +} From ece0606f8e8205b61624890b555a92bff9e34938 Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Thu, 13 Jun 2024 13:50:14 -0300 Subject: [PATCH 10/80] WIP deployment scripts --- .gitignore | 2 + deployment/README.md | 1 + deployment/config/config-types.ts | 48 +++- deployment/helpers/env.ts | 64 +++--- deployment/helpers/evm.ts | 13 +- deployment/helpers/index.ts | 3 +- deployment/helpers/interfaces.ts | 44 ++++ deployment/helpers/solana.ts | 13 +- deployment/package-lock.json | 205 +++++++++++------- deployment/package.json | 7 +- .../bytecode-verification-matching-engine.ts | 6 + .../MatchingEngine/config-matching-engine.ts | 6 + .../MatchingEngine/deploy-matching-engine.ts | 39 ++++ .../get-config-diff-matching-engine.ts | 51 +++++ .../read-config-matching-engine.ts | 10 + .../register-new-token-router.ts | 6 + .../MatchingEngine/upgrade-matching-engine.ts | 57 +++++ .../scripts/evm/MatchingEngine/utils.ts | 178 +++++++++++++++ .../bytecode-verification-token-router.ts | 6 + .../evm/TokenRouter/config-token-router.ts | 8 + .../evm/TokenRouter/deploy-token-router.ts | 33 +++ .../evm/TokenRouter/upgrade-token-router.ts | 57 +++++ deployment/scripts/evm/TokenRouter/utils.ts | 80 +++++++ .../scripts/evm/deploy-matching-engine.ts | 64 ------ deployment/scripts/evm/deploy-token-router.ts | 73 ------- 25 files changed, 810 insertions(+), 264 deletions(-) create mode 100644 deployment/README.md create mode 100644 deployment/helpers/interfaces.ts create mode 100644 deployment/scripts/evm/MatchingEngine/bytecode-verification-matching-engine.ts create mode 100644 deployment/scripts/evm/MatchingEngine/config-matching-engine.ts create mode 100644 deployment/scripts/evm/MatchingEngine/deploy-matching-engine.ts create mode 100644 deployment/scripts/evm/MatchingEngine/get-config-diff-matching-engine.ts create mode 100644 deployment/scripts/evm/MatchingEngine/read-config-matching-engine.ts create mode 100644 deployment/scripts/evm/MatchingEngine/register-new-token-router.ts create mode 100644 deployment/scripts/evm/MatchingEngine/upgrade-matching-engine.ts create mode 100644 deployment/scripts/evm/MatchingEngine/utils.ts create mode 100644 deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts create mode 100644 deployment/scripts/evm/TokenRouter/config-token-router.ts create mode 100644 deployment/scripts/evm/TokenRouter/deploy-token-router.ts create mode 100644 deployment/scripts/evm/TokenRouter/upgrade-token-router.ts create mode 100644 deployment/scripts/evm/TokenRouter/utils.ts delete mode 100644 deployment/scripts/evm/deploy-matching-engine.ts delete mode 100644 deployment/scripts/evm/deploy-token-router.ts diff --git a/.gitignore b/.gitignore index d7393dfc..b1b0e059 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ node_modules *.tgz dist .env +out +cache diff --git a/deployment/README.md b/deployment/README.md new file mode 100644 index 00000000..75da104d --- /dev/null +++ b/deployment/README.md @@ -0,0 +1 @@ +# Contracts scrips \ No newline at end of file diff --git a/deployment/config/config-types.ts b/deployment/config/config-types.ts index cd2c636b..61e72ef9 100644 --- a/deployment/config/config-types.ts +++ b/deployment/config/config-types.ts @@ -1,20 +1,50 @@ import { ChainId } from "@certusone/wormhole-sdk"; +import { BytesLike } from "ethers"; + +export type RouterEndpointConfig = { + chainId: ChainId; + endpoint: { + router: BytesLike; + mintRecipient: BytesLike; + }, + circleDomain: number; +} export type TokenRouterConfiguration = { + // Chain ID of the token router configuration chainId: ChainId; - ownerAssistant: string; + + // Immutable values matchingEngineMintRecipient: string; matchingEngineChain: string; matchingEngineDomain: string; + + // Mutable values + ownerAssistant: string; + routerEndpoints: RouterEndpointConfig[]; + fastTransferParameters: { + enabled: boolean; + maxAmount: number; + baseFee: number; + initAuctionFee: number; + }; + cctpAllowance: number; }; export type MatchingEngineConfiguration = { - chainId: ChainId, - ownerAssistant: string, - feeRecipient: string, - userPenaltyRewardBps: string, - initialPenaltyBps: string, - auctionDuration: string, - auctionGracePeriod: string, - auctionPenaltyBlocks: string + // Chain ID of the matching engine configuration + chainId: ChainId; + + // Immutable values + userPenaltyRewardBps: string; + initialPenaltyBps: string; + auctionDuration: string; + auctionGracePeriod: string; + auctionPenaltyBlocks: string; + + // Mutable values + ownerAssistant: string; + feeRecipient: string; + routerEndpoints: RouterEndpointConfig[]; + cctpAllowance: number; }; \ No newline at end of file diff --git a/deployment/helpers/env.ts b/deployment/helpers/env.ts index fa77f3f0..de117e3a 100644 --- a/deployment/helpers/env.ts +++ b/deployment/helpers/env.ts @@ -1,34 +1,11 @@ import fs from "fs"; import { ChainId } from "@certusone/wormhole-sdk"; - -export type ChainInfo = { - name: string; - chainId: ChainId; - rpc: string; - externalId?: string; -}; - -export type Deployment = { - chainId: ChainId; - address: string; -}; - -export type Ecosystem = { - guardianSetIndex: number; - evm: { - operatingChains?: number[]; - networks: ChainInfo[]; - }, - solana: { - networks: ChainInfo[]; - } -}; - -export type ContractsJson = Record; - -export interface ChainConfig { - chainId: ChainId; -} +import { ethers, utils } from "ethers"; +import { validateSolAddress } from "./solana"; +import { ChainConfig, ChainInfo, ContractsJson, DependenciesJson, Ecosystem } from "./interfaces"; +import { getSigner } from "./evm"; +// TODO: support different env files +import 'dotenv/config'; export const env = getEnv("ENV"); export const contracts = loadContracts(); @@ -43,8 +20,8 @@ function loadJson(filename: string): T { return JSON.parse(fileContent.toString()) as T; } -function loadDependencies() { - return loadJson("dependencies"); +function loadDependencies(): DependenciesJson { + return loadJson("dependencies"); } function loadContracts() { @@ -82,23 +59,42 @@ export async function getContractAddress(contractName: string, chainId: ChainId) throw new Error(`No ${contractName} contract found for chain ${chainId}`); } + if (!utils.isAddress(contract) && !validateSolAddress(contract)){ + throw new Error(`Invalid address for ${contractName} contract found for chain ${chainId}`); + } + return contract; } export function getDependencyAddress(dependencyName: string, chainId: ChainId): string { - const dependency = dependencies[dependencyName]?.find((d) => d.chainId === chainId)?.address; + // @ts-ignore + const dependency = dependencies.find((d) => d.chainId === chainId)[dependencyName]; if (!dependency) { throw new Error(`No dependency found for ${dependencyName}`); } + if (!utils.isAddress(dependency) && !validateSolAddress(dependency)){ + throw new Error(`Invalid address for ${dependencyName} dependency found for chain ${chainId}`); + } + return dependency; } +export async function getContractInstance( + contractName: string, + contractAddress: string, + chain: ChainInfo, +): Promise { + const factory = require("../contract-bindings")[`${contractName}__factory`]; + const signer = await getSigner(chain); + return factory.connect(contractAddress, signer); +} + export function writeDeployedContract(chain: ChainId, contractName: string, address: string) { const contracts = loadContracts(); if (!contracts[contractName]) { - contracts[contractName] = [{ chainId: chain, address: process.env[contractName]! }]; + contracts[contractName] = [{ chainId: chain, address }]; } else if (!contracts[contractName].find((c) => c.chainId === chain)) { @@ -120,4 +116,4 @@ export function writeDeployedContract(chain: ChainId, contractName: string, addr JSON.stringify(contracts), { flag: "w" } ); -} +} \ No newline at end of file diff --git a/deployment/helpers/evm.ts b/deployment/helpers/evm.ts index 35f3c92c..4ca61683 100644 --- a/deployment/helpers/evm.ts +++ b/deployment/helpers/evm.ts @@ -1,8 +1,16 @@ import { LedgerSigner } from "@xlabs-xyz/ledger-signer"; import { ethers } from "ethers"; -import { ChainInfo, ecosystemChains, getEnv, LoggerFn } from "./index"; +import { ChainInfo, ecosystemChains, EvmScriptCb, getEnv } from "./index"; -export type EvmScriptCb = (chain: ChainInfo, signer: ethers.Signer, logFn: LoggerFn) => Promise; +export const ETHEREUM_ADDRESS_LENGTH = 40; +export const zeroValues = [ + 0, + "0x0000000000000000000000000000000000000000", + "", + false, + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0.0" +]; export async function runOnEvms(scriptName: string, cb: EvmScriptCb) { const chains = evmOperatingChains(); @@ -20,6 +28,7 @@ export async function runOnEvms(scriptName: string, cb: EvmScriptCb) { } catch (error) { log("Error: ", error); } + console.log(); }); await Promise.all(result); diff --git a/deployment/helpers/index.ts b/deployment/helpers/index.ts index 03ad2724..3fdad0e5 100644 --- a/deployment/helpers/index.ts +++ b/deployment/helpers/index.ts @@ -1,5 +1,4 @@ export * from "./env"; export * from "./evm"; export * from "./solana"; - -export type LoggerFn = (...args: any[]) => void; +export * from "./interfaces"; \ No newline at end of file diff --git a/deployment/helpers/interfaces.ts b/deployment/helpers/interfaces.ts new file mode 100644 index 00000000..3909b9ac --- /dev/null +++ b/deployment/helpers/interfaces.ts @@ -0,0 +1,44 @@ +import { ChainId } from "@certusone/wormhole-sdk"; +import { ethers } from "ethers"; + +export type EvmScriptCb = (chain: ChainInfo, signer: ethers.Signer, logFn: LoggerFn) => Promise; + +export type LoggerFn = (...args: any[]) => void; + +export type ChainInfo = { + name: string; + chainId: ChainId; + rpc: string; + externalId?: string; +}; + +export type Deployment = { + chainId: ChainId; + address: string; +}; + +export type Ecosystem = { + guardianSetIndex: number; + evm: { + operatingChains?: number[]; + networks: ChainInfo[]; + }, + solana: { + networks: ChainInfo[]; + } +}; + +export type ContractsJson = Record; + +export interface ChainConfig { + chainId: ChainId; +} + +export type DependenciesJson = [ + { + chainId: ChainId; + wormhole: string; + token: string; + tokenMessenger: string; + } +]; \ No newline at end of file diff --git a/deployment/helpers/solana.ts b/deployment/helpers/solana.ts index dd9c6f96..9e63e6a4 100644 --- a/deployment/helpers/solana.ts +++ b/deployment/helpers/solana.ts @@ -1 +1,12 @@ -export const one = 1; \ No newline at end of file +import { PublicKey } from '@solana/web3.js'; + +export const SOLANA_ADDRESS_LENGTH = 43; + +export function validateSolAddress(address: string){ + try { + const pubkey = new PublicKey(address); + return PublicKey.isOnCurve(pubkey.toBuffer()); + } catch (error) { + return false; + } +} \ No newline at end of file diff --git a/deployment/package-lock.json b/deployment/package-lock.json index 13267f5d..eb0d60d5 100644 --- a/deployment/package-lock.json +++ b/deployment/package-lock.json @@ -7,9 +7,12 @@ "name": "deployment", "devDependencies": { "@certusone/wormhole-sdk": "^0.10.11", + "@solana/web3.js": "^1.92.2", "@typechain/ethers-v5": "^11.1.2", "@types/node": "^20.11.22", "@xlabs-xyz/ledger-signer": "^0.0.4", + "bs58": "^5.0.0", + "chalk": "^4.1.2", "dotenv": "^16.4.5", "ethers": "^5.7.2", "tsx": "^4.7.2", @@ -62,9 +65,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.24.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.5.tgz", - "integrity": "sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", + "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", "dev": true, "dependencies": { "regenerator-runtime": "^0.14.0" @@ -134,6 +137,15 @@ "undici-types": "~5.26.4" } }, + "node_modules/@certusone/wormhole-sdk/node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dev": true, + "dependencies": { + "base-x": "^3.0.2" + } + }, "node_modules/@classic-terra/terra.proto": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@classic-terra/terra.proto/-/terra.proto-1.1.0.tgz", @@ -2119,21 +2131,6 @@ "bs58": "^5.0.0" } }, - "node_modules/@mysten/bcs/node_modules/base-x": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", - "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==", - "dev": true - }, - "node_modules/@mysten/bcs/node_modules/bs58": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", - "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", - "dev": true, - "dependencies": { - "base-x": "^4.0.0" - } - }, "node_modules/@mysten/sui.js": { "version": "0.32.2", "resolved": "https://registry.npmjs.org/@mysten/sui.js/-/sui.js-0.32.2.tgz", @@ -2205,6 +2202,15 @@ "node": ">=11" } }, + "node_modules/@project-serum/anchor/node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dev": true, + "dependencies": { + "base-x": "^3.0.2" + } + }, "node_modules/@project-serum/anchor/node_modules/superstruct": { "version": "0.15.5", "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.15.5.tgz", @@ -2424,6 +2430,18 @@ "errors": "bin/cli.js" } }, + "node_modules/@solana/errors/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, "node_modules/@solana/options": { "version": "2.0.0-preview.2", "resolved": "https://registry.npmjs.org/@solana/options/-/options-2.0.0-preview.2.tgz", @@ -2481,12 +2499,12 @@ } }, "node_modules/@solana/web3.js": { - "version": "1.91.8", - "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.91.8.tgz", - "integrity": "sha512-USa6OS1jbh8zOapRJ/CBZImZ8Xb7AJjROZl5adql9TpOoBN9BUzyyouS5oPuZHft7S7eB8uJPuXWYjMi6BHgOw==", + "version": "1.92.2", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.92.2.tgz", + "integrity": "sha512-dk26IHhtKyBszzsSzAuh6Lj2Z6guGlmdzkBjsOTvMmU/BiZTs5riNb+3eq56zXNLK3qvaMHAvVQPGwi9Po6qZQ==", "dev": true, "dependencies": { - "@babel/runtime": "^7.24.5", + "@babel/runtime": "^7.24.6", "@noble/curves": "^1.4.0", "@noble/hashes": "^1.4.0", "@solana/buffer-layout": "^4.0.1", @@ -2499,15 +2517,18 @@ "fast-stable-stringify": "^1.0.0", "jayson": "^4.1.0", "node-fetch": "^2.7.0", - "rpc-websockets": "^7.11.0", - "superstruct": "^0.14.2" + "rpc-websockets": "^7.11.1", + "superstruct": "^1.0.4" } }, - "node_modules/@solana/web3.js/node_modules/superstruct": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.14.2.tgz", - "integrity": "sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ==", - "dev": true + "node_modules/@solana/web3.js/node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dev": true, + "dependencies": { + "base-x": "^3.0.2" + } }, "node_modules/@suchipi/femver": { "version": "1.0.0", @@ -3244,6 +3265,15 @@ "text-encoding-utf-8": "^1.0.2" } }, + "node_modules/borsh/node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dev": true, + "dependencies": { + "base-x": "^3.0.2" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -3281,14 +3311,20 @@ } }, "node_modules/bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", + "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", "dev": true, "dependencies": { - "base-x": "^3.0.2" + "base-x": "^4.0.0" } }, + "node_modules/bs58/node_modules/base-x": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", + "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==", + "dev": true + }, "node_modules/bs58check": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", @@ -3300,6 +3336,15 @@ "safe-buffer": "^5.1.2" } }, + "node_modules/bs58check/node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dev": true, + "dependencies": { + "base-x": "^3.0.2" + } + }, "node_modules/buffer": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", @@ -3368,17 +3413,42 @@ "dev": true }, "node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" + "node": ">=10" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/chalk/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/chownr": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", @@ -3670,6 +3740,15 @@ "sha3": "^2.1.1" } }, + "node_modules/crypto-addr-codec/node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dev": true, + "dependencies": { + "base-x": "^3.0.2" + } + }, "node_modules/crypto-hash": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/crypto-hash/-/crypto-hash-1.3.0.tgz", @@ -5274,6 +5353,15 @@ "tweetnacl": "^1.0.1" } }, + "node_modules/near-api-js/node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dev": true, + "dependencies": { + "base-x": "^3.0.2" + } + }, "node_modules/no-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", @@ -5799,9 +5887,9 @@ } }, "node_modules/rpc-websockets": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.11.0.tgz", - "integrity": "sha512-IkLYjayPv6Io8C/TdCL5gwgzd1hFz2vmBZrjMw/SPEXo51ETOhnzgS4Qy5GWi2JQN7HKHa66J3+2mv0fgNh/7w==", + "version": "7.11.1", + "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.11.1.tgz", + "integrity": "sha512-ePm9GVlk1D1p1B35iU1AiAr9lMKUpSqU9wjYoUb9YaoabfLAcQ7DG6IfQvyam2nDJ0FOSB00AgEA4pGm/wSD5A==", "dev": true, "dependencies": { "eventemitter3": "^4.0.7", @@ -6366,43 +6454,6 @@ "write-markdown": "dist/write-markdown.js" } }, - "node_modules/ts-command-line-args/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/ts-command-line-args/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ts-command-line-args/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/ts-essentials": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-7.0.3.tgz", diff --git a/deployment/package.json b/deployment/package.json index 2c918585..3bd76043 100644 --- a/deployment/package.json +++ b/deployment/package.json @@ -1,15 +1,18 @@ { "name": "deployment", "scripts": { - "evm-deps": "forge build -C /home/solanoe/xlabs/projects/example-liquidity-layer/evm/lib/openzeppelin-contracts/contracts/proxy/ERC1967", - "build-evm": "npm run evm-deps && npx typechain --target=ethers-v5 --out-dir=./contract-bindings ../evm/out/*/*.json ../evm/lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol" + "evm-deps": "forge build -C $(dirname $(pwd))/evm/lib/openzeppelin-contracts/contracts", + "build-evm": "npm run evm-deps && npx typechain --target=ethers-v5 --out-dir=./contract-bindings ../evm/out/*/*.json ../out/*/*.json" }, "author": "", "devDependencies": { "@certusone/wormhole-sdk": "^0.10.11", + "@solana/web3.js": "^1.92.2", "@typechain/ethers-v5": "^11.1.2", "@types/node": "^20.11.22", "@xlabs-xyz/ledger-signer": "^0.0.4", + "bs58": "^5.0.0", + "chalk": "^4.1.2", "dotenv": "^16.4.5", "ethers": "^5.7.2", "tsx": "^4.7.2", diff --git a/deployment/scripts/evm/MatchingEngine/bytecode-verification-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/bytecode-verification-matching-engine.ts new file mode 100644 index 00000000..5d582183 --- /dev/null +++ b/deployment/scripts/evm/MatchingEngine/bytecode-verification-matching-engine.ts @@ -0,0 +1,6 @@ +import { runOnEvms, ChainInfo, LoggerFn } from "../../../helpers"; +import { ethers } from "ethers"; + +runOnEvms("", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + +}); \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts new file mode 100644 index 00000000..34e38490 --- /dev/null +++ b/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts @@ -0,0 +1,6 @@ +import { runOnEvms, ChainInfo, LoggerFn } from "../../../helpers"; +import { ethers } from "ethers"; + +runOnEvms("config-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + +}); \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/deploy-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/deploy-matching-engine.ts new file mode 100644 index 00000000..a1252e8f --- /dev/null +++ b/deployment/scripts/evm/MatchingEngine/deploy-matching-engine.ts @@ -0,0 +1,39 @@ +import { ethers } from "ethers"; +import { runOnEvms, ChainInfo, LoggerFn, writeDeployedContract, zeroValues } from "../../../helpers"; +import { MatchingEngineConfiguration } from "../../../config/config-types"; + +import { ERC1967Proxy__factory } from "@certusone/wormhole-sdk/lib/cjs/ethers-contracts"; +import { deployImplementation, getMachingEngineConfiguration } from "./utils"; + +runOnEvms("deploy-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + const config = await getMachingEngineConfiguration(chain); + const implementation = await deployImplementation(signer, config, log); + const proxy = await deployProxy(signer, config, implementation, log); +}); + +async function deployProxy(signer: ethers.Signer, config: MatchingEngineConfiguration, implementation: ethers.Contract, log: LoggerFn) { + const factory = new ERC1967Proxy__factory(signer); + const abi = ["function initialize(bytes)"]; + const iface = new ethers.utils.Interface(abi); + const data = [config.ownerAssistant, config.feeRecipient]; + + // Validate if the addresses are valid and not zero + for (const value of data) + if (!ethers.utils.isAddress(value) || zeroValues.includes(value)) + throw new Error(`Invalid value: ${value}`); + + const encodedData = ethers.utils.solidityPack(["address", "address"], data); + const encodedCall = iface.encodeFunctionData("initialize", [encodedData]); + + const deployment = await factory.deploy( + implementation.address, + encodedCall, + ); + + await deployment.deployed(); + + log(`MatchingEngineProxy deployed at ${deployment.address}`); + writeDeployedContract(config.chainId, "MatchingEngineProxy", deployment.address); + + return deployment; +} \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/get-config-diff-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/get-config-diff-matching-engine.ts new file mode 100644 index 00000000..9523b69d --- /dev/null +++ b/deployment/scripts/evm/MatchingEngine/get-config-diff-matching-engine.ts @@ -0,0 +1,51 @@ +import { runOnEvms, ChainInfo, LoggerFn, zeroValues } from "../../../helpers"; +import { ethers } from "ethers"; +import { getConfigurationDifferences } from "./utils"; +import chalk from 'chalk'; + +runOnEvms("get-config-diff-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + const diff = await getConfigurationDifferences(chain); + + log(`MatchingEngine configuration differences on chain ${chain.chainId}:`); + walkThrough(diff, log); +}); + +function walkThrough(differences: Record, log: LoggerFn) { + for (const [key, value] of Object.entries(differences)) { + + // If the value is an array, walk through each item + if (Array.isArray(value)) { + for (const item of value) { + walkThrough(item, log); + } + continue; + } + + // If the value is an object, walk through its properties + if (!value.onChain && !value.offChain) { + log(`${key}: `); + walkThrough(value, log); + continue; + } + + logComparision(key, value, log); + } +} + + +function logComparision(name: string, diffValues: any, log: LoggerFn) { + // If the on chain value is not present or it is zero value, log it as an addition + if (!diffValues.onChain || zeroValues.includes(diffValues.onChain)) { + log(chalk.green(`+ ${name}: ${diffValues.offChain}`)); + } + + // If the off chain value is not present or it is zero value, log it as a removal + else if (!diffValues.offChain || zeroValues.includes(diffValues.offChain)) { + log(chalk.red(`- ${name}: ${diffValues.onChain}`)); + } + + // If both values are present and they are different, log it as a change + else if (diffValues.onChain && diffValues.offChain) { + log(chalk.yellow(`~ ${name}: `) + chalk.red(`${diffValues.onChain}`) + ' -> ' + chalk.green(`${diffValues.offChain}`)); + } +} diff --git a/deployment/scripts/evm/MatchingEngine/read-config-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/read-config-matching-engine.ts new file mode 100644 index 00000000..d47e37c9 --- /dev/null +++ b/deployment/scripts/evm/MatchingEngine/read-config-matching-engine.ts @@ -0,0 +1,10 @@ +import { runOnEvms, ChainInfo, LoggerFn } from "../../../helpers"; +import { ethers } from "ethers"; +import { getOnChainMachingEngineConfiguration } from "./utils"; +import { inspect } from "util"; + +runOnEvms("read-config-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + const onChainConfig = await getOnChainMachingEngineConfiguration(chain); + log(`MatchingEngine configuration for chainId ${chain.chainId}:`); + log(inspect(onChainConfig, { depth: null, colors: true, compact: true })); +}); \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/register-new-token-router.ts b/deployment/scripts/evm/MatchingEngine/register-new-token-router.ts new file mode 100644 index 00000000..5d582183 --- /dev/null +++ b/deployment/scripts/evm/MatchingEngine/register-new-token-router.ts @@ -0,0 +1,6 @@ +import { runOnEvms, ChainInfo, LoggerFn } from "../../../helpers"; +import { ethers } from "ethers"; + +runOnEvms("", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + +}); \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/upgrade-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/upgrade-matching-engine.ts new file mode 100644 index 00000000..0e483dce --- /dev/null +++ b/deployment/scripts/evm/MatchingEngine/upgrade-matching-engine.ts @@ -0,0 +1,57 @@ +import { runOnEvms, ChainInfo, LoggerFn, getContractInstance, getContractAddress, getDependencyAddress } from "../../../helpers"; +import { ethers } from "ethers"; +import { deployImplementation, getMachingEngineConfiguration } from "./utils"; +import { MatchingEngine } from "../../../contract-bindings"; +import { MatchingEngineConfiguration } from "../../../config/config-types"; + +runOnEvms("upgrade-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + const currentImplementationAddress = await getContractAddress("MatchingEngineImplementation", chain.chainId); + const proxyAddress = await getContractAddress("MatchingEngineProxy", chain.chainId); + const proxy = (await getContractInstance("MatchingEngine", proxyAddress, chain)) as MatchingEngine; + const config = await getMachingEngineConfiguration(chain); + + log(`Checking immutables for MatchingEngine...`); + await checkImmutables(proxy, config, chain); + + const newImplementation = await deployImplementation(signer, config, log); + + log(`Upgrading MatchingEngineImplementation implementation from ${currentImplementationAddress} to ${newImplementation.address}`); + await proxy.upgradeContract(newImplementation.address); +}); + +async function checkImmutables(matchingEngine: MatchingEngine, config: MatchingEngineConfiguration, chain: ChainInfo) { + const tokenAddress = getDependencyAddress("token", chain.chainId); + const [ + token, + userPenaltyRewardBps, + initialPenaltyBps, + auctionDuration, + auctionGracePeriod, + auctionPenaltyBlocks, + ] = await Promise.all([ + matchingEngine.token(), + matchingEngine.getUserPenaltyRewardBps(), + matchingEngine.getInitialPenaltyBps(), + matchingEngine.getAuctionDuration(), + matchingEngine.getAuctionGracePeriod(), + matchingEngine.getAuctionPenaltyBlocks(), + ]); + + if (token !== tokenAddress) + throw new Error(`Token is an immutable value and cannot be changed.`); + + if (userPenaltyRewardBps !== Number(config.userPenaltyRewardBps)) + throw new Error(`UserPenaltyRewardBps is an immutable value and cannot be changed.`); + + if (initialPenaltyBps !== Number(config.initialPenaltyBps)) + throw new Error(`InitialPenaltyBps is an immutable value and cannot be changed.`); + + if (auctionDuration !== Number(config.auctionDuration)) + throw new Error(`AuctionDuration is an immutable value and cannot be changed.`); + + if (auctionGracePeriod !== Number(config.auctionGracePeriod)) + throw new Error(`AuctionGracePeriod is an immutable value and cannot be changed.`); + + if (auctionPenaltyBlocks !== Number(config.auctionPenaltyBlocks)) + throw new Error(`AuctionPenaltyBlocks is an immutable value and cannot be changed.`); +} \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/utils.ts b/deployment/scripts/evm/MatchingEngine/utils.ts new file mode 100644 index 00000000..7c1b8fa1 --- /dev/null +++ b/deployment/scripts/evm/MatchingEngine/utils.ts @@ -0,0 +1,178 @@ +import { ethers } from "ethers"; +import { MatchingEngineConfiguration, RouterEndpointConfig } from "../../../config/config-types"; +import { MatchingEngine, MatchingEngine__factory } from "../../../contract-bindings"; +import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance } from "../../../helpers"; +import { ERC20 } from "../../../contract-bindings/out/ERC20"; +import { ChainId } from "@certusone/wormhole-sdk"; + +export function getMachingEngineConfiguration(chain: ChainInfo): Promise { + return getChainConfig("matching-engine", chain.chainId); +} + +export async function deployImplementation(signer: ethers.Signer, config: MatchingEngineConfiguration, log: LoggerFn) { + const factory = new MatchingEngine__factory(signer); + const token = getDependencyAddress("token", config.chainId); + const wormhole = getDependencyAddress("wormhole", config.chainId); + const tokenMessenger = getDependencyAddress("tokenMessenger", config.chainId); + const MAX_BPS_FEE = 1000000; + + if (Number(config.auctionDuration) === 0) { + throw new Error(`Auction duration must be greater than 0.`); + } + if (Number(config.auctionGracePeriod) <= Number(config.auctionDuration)) { + throw new Error(`Auction grace period must be greater than auction duration.`); + } + if (Number(config.userPenaltyRewardBps) > MAX_BPS_FEE) { + throw new Error(`User penalty reward bps must be less than or equal to ${MAX_BPS_FEE}.`); + } + if (Number(config.initialPenaltyBps) > MAX_BPS_FEE) { + throw new Error(`Initial penalty bps must be less than or equal to ${MAX_BPS_FEE}.`); + } + + const deployment = await factory.deploy( + token, + wormhole, + tokenMessenger, + config.userPenaltyRewardBps, + config.initialPenaltyBps, + config.auctionDuration, + config.auctionGracePeriod, + config.auctionPenaltyBlocks, + {} // overrides + ); + + await deployment.deployed(); + + log(`MatchingEngine deployed at ${deployment.address}`); + + writeDeployedContract(config.chainId, "MatchingEngineImplementation", deployment.address); + + return deployment; +} + +export async function getOnChainMachingEngineConfiguration(chain: ChainInfo) { + const config = await getMachingEngineConfiguration(chain); + const matchingEngineImplementationAddress = await getContractAddress("MatchingEngineImplementation", chain.chainId); + const matchingEngineAddress = await getContractAddress("MatchingEngineProxy", chain.chainId); + const matchingEngine = (await getContractInstance("MatchingEngine", matchingEngineAddress, chain)) as MatchingEngine; + + // Get the allowance for the token messenger + const tokenMessengerAddress = getDependencyAddress("tokenMessenger", chain.chainId); + const tokenAddress = await matchingEngine.token(); + const token = (await getContractInstance("ERC20", tokenAddress, chain)) as ERC20; + const decimals = await token.decimals(); + const rawCctpAllowance = await token.allowance(matchingEngineImplementationAddress, tokenMessengerAddress); + const cctpAllowance = ethers.utils.formatUnits(rawCctpAllowance, decimals); + + const feeRecipient = await matchingEngine.feeRecipient(); + + const routerEndpoints = await Promise.all(config + .routerEndpoints + .map(async ({ chainId }) => { + const { router, mintRecipient } = await matchingEngine.getRouterEndpoint(chainId); + return { + chainId, + endpoint: { + router, + mintRecipient + }, + circleDomain: await matchingEngine.getDomain(chainId) + } + })); + + return { + cctpAllowance, + feeRecipient, + routerEndpoints + }; +} + +export async function getConfigurationDifferences(chain: ChainInfo) { + const differences = {} as Record; + const onChainConfig = await getOnChainMachingEngineConfiguration(chain); + const offChainConfig = await getMachingEngineConfiguration(chain); + + // Compare non-array values + for (const key of Object.keys(onChainConfig)) { + const offChainValue = offChainConfig[key as keyof typeof offChainConfig]; + const onChainValue = onChainConfig[key as keyof typeof onChainConfig]; + + if (!offChainValue) + throw new Error(`${key} not found in offChainConfig`); + + // Ignore key if it's an array + if (Array.isArray(offChainValue)) + continue; + + const isDifferent = offChainValue.toString() !== onChainValue; + if (isDifferent) { + differences[key] = { + offChain: offChainValue, + onChain: onChainValue + }; + } + } + + let onChainIndex = 0; + let offChainIndex = 0; + const routerEndpointsDifferences = []; + const onChainRouterEndpoints = onChainConfig.routerEndpoints.sort((a, b) => a.chainId - b.chainId); + const offChainRouterEndpoints = offChainConfig.routerEndpoints.sort((a, b) => a.chainId - b.chainId); + while (true) { + const onChainEndpoint = onChainRouterEndpoints[onChainIndex]; + const offChainEndpoint = offChainRouterEndpoints[offChainIndex]; + + // If we've reached the end of both arrays, we're done + if (!onChainEndpoint && !offChainEndpoint) { + break; + } + + // If we've reached the end of offChainEndpoints, add the remaining onChainEndpoints + // or if the onChainEndpoint is less than the offChainEndpoint, add the onChainEndpoint + if (!offChainEndpoint || onChainEndpoint?.chainId < offChainEndpoint?.chainId) { + routerEndpointsDifferences.push( + routerEndpointConfig(onChainEndpoint.chainId, onChainEndpoint, {}) + ); + onChainIndex++; + } + + // If we've reached the end of onChainEndpoints, add the remaining offChainEndpoints + // or if the offChainEndpoint is less than the onChainEndpoint, add the offChainEndpoint + else if (!onChainEndpoint || onChainEndpoint?.chainId > offChainEndpoint?.chainId) { + routerEndpointsDifferences.push( + routerEndpointConfig(offChainEndpoint.chainId, {}, offChainEndpoint) + ); + offChainIndex++; + } + + // If the chainIds are the same, add the differences between the two endpoints + else { + routerEndpointsDifferences.push( + routerEndpointConfig(onChainEndpoint.chainId, onChainEndpoint, offChainEndpoint) + ); + onChainIndex++; + offChainIndex++; + } + } + + differences.routerEndpoints = routerEndpointsDifferences; + + return differences; +} + +const routerEndpointConfig = (chainId: ChainId, onChain: Partial, offChain: Partial) => ({ + [`endpoint-chainId-${chainId}`]: { + router: { + onChain: onChain?.endpoint?.router, + offChain: offChain?.endpoint?.router + }, + mintRecipient: { + onChain: onChain?.endpoint?.mintRecipient, + offChain: offChain?.endpoint?.mintRecipient + } + }, + circleDomain: { + onChain: onChain?.circleDomain, + offChain: offChain?.circleDomain + } +}); \ No newline at end of file diff --git a/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts b/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts new file mode 100644 index 00000000..5d582183 --- /dev/null +++ b/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts @@ -0,0 +1,6 @@ +import { runOnEvms, ChainInfo, LoggerFn } from "../../../helpers"; +import { ethers } from "ethers"; + +runOnEvms("", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + +}); \ No newline at end of file diff --git a/deployment/scripts/evm/TokenRouter/config-token-router.ts b/deployment/scripts/evm/TokenRouter/config-token-router.ts new file mode 100644 index 00000000..6685912f --- /dev/null +++ b/deployment/scripts/evm/TokenRouter/config-token-router.ts @@ -0,0 +1,8 @@ +import { runOnEvms, ChainInfo, LoggerFn, getContractInstance, getContractAddress } from "../../../helpers"; +import { ethers } from "ethers"; + +runOnEvms("config-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + const tokenRouterAddress = await getContractAddress("TokenRouter", chain.chainId); + const tokenRouter = await getContractInstance("TokenRouter", tokenRouterAddress, chain); + +}); \ No newline at end of file diff --git a/deployment/scripts/evm/TokenRouter/deploy-token-router.ts b/deployment/scripts/evm/TokenRouter/deploy-token-router.ts new file mode 100644 index 00000000..dea88c3a --- /dev/null +++ b/deployment/scripts/evm/TokenRouter/deploy-token-router.ts @@ -0,0 +1,33 @@ +import { ethers } from "ethers"; +import { ERC1967Proxy__factory } from "@certusone/wormhole-sdk/lib/cjs/ethers-contracts"; +import { runOnEvms, ChainInfo, LoggerFn, writeDeployedContract } from "../../../helpers"; +import { TokenRouterConfiguration } from "../../../config/config-types"; +import { deployImplementation, getTokenRouterConfiguration } from "./utils"; + +runOnEvms("deploy-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + const config = await getTokenRouterConfiguration(chain); + const implementation = await deployImplementation(signer, config, log); + const proxy = await deployProxy(signer, config, implementation, log); +}); + +async function deployProxy(signer: ethers.Signer, config: TokenRouterConfiguration, implementation: ethers.Contract, log: LoggerFn) { + const factory = new ERC1967Proxy__factory(signer); + + const abi = ["function initialize(bytes)"]; + const iface = new ethers.utils.Interface(abi); + const encodedData = ethers.utils.solidityPack(["address"], [config.ownerAssistant]); + const encodedCall = iface.encodeFunctionData("initialize", [encodedData]); + + const deployment = await factory.deploy( + implementation.address, + encodedCall, + ); + + await deployment.deployed(); + + log(`TokenRouterProxy deployed at ${deployment.address}`); + + writeDeployedContract(config.chainId, "TokenRouterProxy", deployment.address); + + return deployment; +} diff --git a/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts b/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts new file mode 100644 index 00000000..98e9ae30 --- /dev/null +++ b/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts @@ -0,0 +1,57 @@ +import { runOnEvms, ChainInfo, LoggerFn, getContractInstance, getContractAddress, getDependencyAddress } from "../../../helpers"; +import { ethers } from "ethers"; +import { deployImplementation, getAddressAsBytes32, getTokenRouterConfiguration } from "./utils"; +import { TokenRouter } from "../../../contract-bindings"; +import { TokenRouterConfiguration } from "../../../config/config-types"; + +runOnEvms("upgrade-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + const currentImplementationAddress = await getContractAddress("TokenRouterImplementation", chain.chainId); + const proxyAddress = await getContractAddress("TokenRouterProxy", chain.chainId); + const proxy = (await getContractInstance("TokenRouter", proxyAddress, chain)) as TokenRouter; + const config = await getTokenRouterConfiguration(chain); + + log(`Checking immutables for TokenRouter`); + checkImmutables(proxy, config, chain); + + const newImplementation = await deployImplementation(signer, config, log); + + log(`Upgrading TokenRouter implementation from ${currentImplementationAddress} to ${newImplementation.address}`); + + await proxy.upgradeContract(newImplementation.address); +}); + +async function checkImmutables(tokenRouter: TokenRouter, config: TokenRouterConfiguration, chain: ChainInfo) { + const [ + token, + matchingEngineMintRecipient, + matchingEngineChain, + matchingEngineDomain, + matchingEngineAddress, + ] = await Promise.all([ + tokenRouter.orderToken(), + tokenRouter.matchingEngineMintRecipient(), + tokenRouter.matchingEngineChain(), + tokenRouter.matchingEngineDomain(), + tokenRouter.matchingEngineAddress(), + ]); + + const expectedMatchingEngineMintRecipient = getAddressAsBytes32(config.matchingEngineMintRecipient); + const localMatchingEngineAddress = await getContractAddress("MatchingEngineProxy", chain.chainId); + const expectedMatchingEngineAddress = getAddressAsBytes32(localMatchingEngineAddress); + const tokenAddress = getDependencyAddress("token", chain.chainId); + + if (matchingEngineMintRecipient !== expectedMatchingEngineMintRecipient) + throw new Error(`MatchingEngineMintRecipient is an immutable value and cannot be changed.`); + + if (matchingEngineChain !== Number(config.matchingEngineChain)) + throw new Error(`MatchingEngineChain is an immutable value and cannot be changed.`); + + if (matchingEngineDomain !== Number(config.matchingEngineDomain)) + throw new Error(`MatchingEngineDomain is an immutable value and cannot be changed.`); + + if (matchingEngineAddress !== expectedMatchingEngineAddress) + throw new Error(`MatchingEngineAddress is an immutable value and cannot be changed.`); + + if (token !== tokenAddress) + throw new Error(`Token is an immutable value and cannot be changed.`); +} \ No newline at end of file diff --git a/deployment/scripts/evm/TokenRouter/utils.ts b/deployment/scripts/evm/TokenRouter/utils.ts new file mode 100644 index 00000000..8dc10e96 --- /dev/null +++ b/deployment/scripts/evm/TokenRouter/utils.ts @@ -0,0 +1,80 @@ +import { ChainId } from "@certusone/wormhole-sdk"; +import { ethers } from "ethers"; +import { TokenRouterConfiguration } from "../../../config/config-types"; +import { TokenRouter, TokenRouter__factory } from "../../../contract-bindings"; +import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, ETHEREUM_ADDRESS_LENGTH, getContractInstance } from "../../../helpers"; +import bs58 from 'bs58'; + +export function getTokenRouterConfiguration(chain: ChainInfo): Promise { + return getChainConfig("token-router", chain.chainId); +} + +export async function deployImplementation(signer: ethers.Signer, config: TokenRouterConfiguration, log: LoggerFn) { + const factory = new TokenRouter__factory(signer); + + const token = getDependencyAddress("token", config.chainId); + const wormhole = getDependencyAddress("wormhole", config.chainId); + const tokenMessenger = getDependencyAddress("tokenMessenger", config.chainId); + const matchingEngineMintRecipient = getAddressAsBytes32(config.matchingEngineMintRecipient); + + let matchingEngineAddress = await getContractAddress( + "MatchingEngineProxy", + Number(config.matchingEngineChain) as ChainId + ); + matchingEngineAddress = getAddressAsBytes32(matchingEngineAddress); + + const deployment = await factory.deploy( + token, + wormhole, + tokenMessenger, + config.matchingEngineChain, + matchingEngineAddress, + matchingEngineMintRecipient, + config.matchingEngineDomain, + {} // overrides + ); + + await deployment.deployed(); + + log(`TokenRouter deployed at ${deployment.address}`); + + writeDeployedContract(config.chainId, "TokenRouterImplementation", deployment.address); + + return deployment; +} + +export async function getOnChainTokenRouterConfiguration(chain: ChainInfo) { + const config = await getTokenRouterConfiguration(chain); + const tokenRouterAddress = await getContractAddress("TokenRouterProxy", chain.chainId); + const tokenRouter = (await getContractInstance("TokenRouterImplementation", tokenRouterAddress, chain)) as TokenRouter; + + // instantiate erc20 token and get the allowance for the token messenger? + const cctpAllowance = await tokenRouter.cctpAllowance(); + + const routerEndpoints = await Promise.all(config + .routerEndpoints + .map(async ({ chainId }) => ({ chainId, endpoint: await tokenRouter.getRouterEndpoint(chainId)}))); + + + + return { + cctpAllowance, + routerEndpoints + }; +} + +export function getAddressAsBytes32(address: string): string { + const addressLength = address.length - (address.startsWith("0x") ? 2 : 0); + + // Solana address + if (addressLength > ETHEREUM_ADDRESS_LENGTH) { + const bytes = bs58.decode(address); + address = "0x" + Buffer.from(bytes).toString('hex'); + } + // Ethereum address + else { + address = ethers.utils.defaultAbiCoder.encode(["address"], [address]); + } + + return address; +} \ No newline at end of file diff --git a/deployment/scripts/evm/deploy-matching-engine.ts b/deployment/scripts/evm/deploy-matching-engine.ts deleted file mode 100644 index cd0d1fc0..00000000 --- a/deployment/scripts/evm/deploy-matching-engine.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { ethers } from "ethers"; -import { runOnEvms, ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract } from "../../helpers"; -import { MatchingEngineConfiguration } from "../../config/config-types"; - -import { MatchingEngine__factory } from "../../contract-bindings"; -import { ERC1967Proxy__factory } from "@certusone/wormhole-sdk/lib/cjs/ethers-contracts"; - -runOnEvms("deploy-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { - const config = await getMachingEngineConfiguration(chain); - const implementation = await deployImplementation(signer, config, log); - const proxy = await deployProxy(signer, config, implementation, log); - -}); - -function getMachingEngineConfiguration (chain: ChainInfo): Promise { - return getChainConfig("matching-engine", chain.chainId); -} - -async function deployImplementation (signer: ethers.Signer, config: MatchingEngineConfiguration, log: LoggerFn) { - const factory = new MatchingEngine__factory(signer); - const token = getDependencyAddress("Token", config.chainId); - const wormhole = getDependencyAddress("Wormhole", config.chainId); - const tokenMessenger = getDependencyAddress("TokenMessenger", config.chainId); - const deployment = await factory.deploy( - token, - wormhole, - tokenMessenger, - config.userPenaltyRewardBps, - config.initialPenaltyBps, - config.auctionDuration, - config.auctionGracePeriod, - config.auctionPenaltyBlocks, - {} // overrides - ); - - await deployment.deployed(); - - log(`MatchingEngine deployed at ${deployment.address}`); - - writeDeployedContract(config.chainId, "MatchingEngineImplementations", deployment.address); - - return deployment; -} - -async function deployProxy (signer: ethers.Signer, config: MatchingEngineConfiguration, implementation: ethers.Contract, log: LoggerFn) { - const factory = new ERC1967Proxy__factory(signer); - - const abi = ["function initialize(address,address)"]; - const iface = new ethers.utils.Interface(abi); - const encodedCall = iface.encodeFunctionData("initialize", [config.ownerAssistant, config.feeRecipient]); - - const deployment = await factory.deploy( - implementation.address, - encodedCall, - ); - - await deployment.deployed(); - - log(`MatchingEngineProxy deployed at ${deployment.address}`); - - writeDeployedContract(config.chainId, "MatchingEngineProxies", deployment.address); - - return deployment; -} diff --git a/deployment/scripts/evm/deploy-token-router.ts b/deployment/scripts/evm/deploy-token-router.ts deleted file mode 100644 index d130a077..00000000 --- a/deployment/scripts/evm/deploy-token-router.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { ethers } from "ethers"; -import { ERC1967Proxy__factory } from "@certusone/wormhole-sdk/lib/cjs/ethers-contracts"; -import { ChainId } from "@certusone/wormhole-sdk"; -import { runOnEvms, ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress } from "../../helpers"; -import { MatchingEngineConfiguration, TokenRouterConfiguration } from "../../config/config-types"; - -import { MatchingEngine__factory, TokenRouter__factory } from "../../contract-bindings"; -import { TokenRouter } from "../../../evm/ts/src/types"; - -runOnEvms("deploy-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { - const config = await getTokenRouterConfiguration(chain); - const implementation = await deployImplementation(signer, config, log); - const proxy = await deployProxy(signer, config, implementation, log); - -}); - -function getTokenRouterConfiguration (chain: ChainInfo): Promise { - return getChainConfig("token-router", chain.chainId); -} - -async function deployImplementation (signer: ethers.Signer, config: TokenRouterConfiguration, log: LoggerFn) { - const factory = new TokenRouter__factory(signer); - - const token = getDependencyAddress("Token", config.chainId); - const wormhole = getDependencyAddress("Wormhole", config.chainId); - const tokenMessenger = getDependencyAddress("TokenMessenger", config.chainId); - - // TODO: ensure that this is a 32-byte address? - const matchingEngineAddress = await getContractAddress( - "MatchingEngineProxies", - Number(config.matchingEngineChain) as ChainId - ); - - const deployment = await factory.deploy( - token, - wormhole, - tokenMessenger, - config.matchingEngineChain, - matchingEngineAddress, - config.matchingEngineMintRecipient, - config.matchingEngineDomain, - {} // overrides - ); - - await deployment.deployed(); - - log(`TokenRouter deployed at ${deployment.address}`); - - writeDeployedContract(config.chainId, "TokenRouterImplementations", deployment.address); - - return deployment; -} - -async function deployProxy (signer: ethers.Signer, config: TokenRouterConfiguration, implementation: ethers.Contract, log: LoggerFn) { - const factory = new ERC1967Proxy__factory(signer); - - const abi = ["function initialize(address)"]; - const iface = new ethers.utils.Interface(abi); - const encodedCall = iface.encodeFunctionData("initialize", [config.ownerAssistant]); - - const deployment = await factory.deploy( - implementation.address, - encodedCall, - ); - - await deployment.deployed(); - - log(`TokenRouterProxy deployed at ${deployment.address}`); - - writeDeployedContract(config.chainId, "TokenRouterProxies", deployment.address); - - return deployment; -} From 17132effac684350ec33c7ce9e1cada86314054f Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Thu, 13 Jun 2024 15:22:18 -0300 Subject: [PATCH 11/80] Validate values on tokenRouter proxy deployment --- .../scripts/evm/TokenRouter/deploy-token-router.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/deployment/scripts/evm/TokenRouter/deploy-token-router.ts b/deployment/scripts/evm/TokenRouter/deploy-token-router.ts index dea88c3a..c48cfa87 100644 --- a/deployment/scripts/evm/TokenRouter/deploy-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/deploy-token-router.ts @@ -1,6 +1,6 @@ import { ethers } from "ethers"; import { ERC1967Proxy__factory } from "@certusone/wormhole-sdk/lib/cjs/ethers-contracts"; -import { runOnEvms, ChainInfo, LoggerFn, writeDeployedContract } from "../../../helpers"; +import { runOnEvms, ChainInfo, LoggerFn, writeDeployedContract, zeroValues } from "../../../helpers"; import { TokenRouterConfiguration } from "../../../config/config-types"; import { deployImplementation, getTokenRouterConfiguration } from "./utils"; @@ -12,10 +12,15 @@ runOnEvms("deploy-token-router", async (chain: ChainInfo, signer: ethers.Signer, async function deployProxy(signer: ethers.Signer, config: TokenRouterConfiguration, implementation: ethers.Contract, log: LoggerFn) { const factory = new ERC1967Proxy__factory(signer); - const abi = ["function initialize(bytes)"]; const iface = new ethers.utils.Interface(abi); - const encodedData = ethers.utils.solidityPack(["address"], [config.ownerAssistant]); + const data = config.ownerAssistant; + + // Validate if the address are valid and not zero + if (!ethers.utils.isAddress(data) || zeroValues.includes(data)) + throw new Error(`Invalid value: ${data}`); + + const encodedData = ethers.utils.solidityPack(["address"], [data]); const encodedCall = iface.encodeFunctionData("initialize", [encodedData]); const deployment = await factory.deploy( From e3349ea71af5e37472688faaecdc1466973824a9 Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Mon, 24 Jun 2024 14:10:17 -0300 Subject: [PATCH 12/80] Add config scripts --- deployment/helpers/evm.ts | 28 ++- deployment/helpers/index.ts | 3 +- deployment/helpers/interfaces.ts | 7 +- deployment/helpers/utils.ts | 112 ++++++++++++ deployment/package-lock.json | 167 +++++++++++++++++- deployment/package.json | 1 + .../MatchingEngine/config-matching-engine.ts | 82 ++++++++- .../MatchingEngine/deploy-matching-engine.ts | 4 +- .../get-config-diff-matching-engine.ts | 49 +---- .../scripts/evm/MatchingEngine/utils.ts | 101 +++-------- .../evm/TokenRouter/config-token-router.ts | 121 ++++++++++++- .../evm/TokenRouter/deploy-token-router.ts | 4 +- .../get-config-diff-token-router.ts | 10 ++ .../TokenRouter/read-config-token-router.ts | 10 ++ deployment/scripts/evm/TokenRouter/utils.ts | 112 +++++++++--- 15 files changed, 641 insertions(+), 170 deletions(-) create mode 100644 deployment/helpers/utils.ts create mode 100644 deployment/scripts/evm/TokenRouter/get-config-diff-token-router.ts create mode 100644 deployment/scripts/evm/TokenRouter/read-config-token-router.ts diff --git a/deployment/helpers/evm.ts b/deployment/helpers/evm.ts index 4ca61683..100c3e3f 100644 --- a/deployment/helpers/evm.ts +++ b/deployment/helpers/evm.ts @@ -3,14 +3,6 @@ import { ethers } from "ethers"; import { ChainInfo, ecosystemChains, EvmScriptCb, getEnv } from "./index"; export const ETHEREUM_ADDRESS_LENGTH = 40; -export const zeroValues = [ - 0, - "0x0000000000000000000000000000000000000000", - "", - false, - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0.0" -]; export async function runOnEvms(scriptName: string, cb: EvmScriptCb) { const chains = evmOperatingChains(); @@ -34,6 +26,26 @@ export async function runOnEvms(scriptName: string, cb: EvmScriptCb) { await Promise.all(result); } +export async function runOnEvmsSequentially(scriptName: string, cb: EvmScriptCb) { + const chains = evmOperatingChains(); + + console.log(`Running script on EVMs (${chains.map(c => c.chainId).join(", ")}):`, scriptName); + + for (const chain of chains) { + const log = (...args: any[]) => console.log(`[${chain.chainId}]`, ...args); + const signer = await getSigner(chain); + log(`Starting script. Signer: ${await signer.getAddress()}`); + + try { + await cb(chain, signer, log); + log("Success"); + } catch (error) { + log("Error: ", error); + } + console.log(); + } +} + export function evmOperatingChains() { const { operatingChains } = ecosystemChains.evm; if (Array.isArray(operatingChains) && operatingChains.length >= 1) { diff --git a/deployment/helpers/index.ts b/deployment/helpers/index.ts index 3fdad0e5..8d3435c4 100644 --- a/deployment/helpers/index.ts +++ b/deployment/helpers/index.ts @@ -1,4 +1,5 @@ export * from "./env"; export * from "./evm"; export * from "./solana"; -export * from "./interfaces"; \ No newline at end of file +export * from "./interfaces"; +export * from "./utils"; \ No newline at end of file diff --git a/deployment/helpers/interfaces.ts b/deployment/helpers/interfaces.ts index 3909b9ac..f02ad335 100644 --- a/deployment/helpers/interfaces.ts +++ b/deployment/helpers/interfaces.ts @@ -41,4 +41,9 @@ export type DependenciesJson = [ token: string; tokenMessenger: string; } -]; \ No newline at end of file +]; + +export interface ValueDiff { + onChain: any; + offChain: any; +} \ No newline at end of file diff --git a/deployment/helpers/utils.ts b/deployment/helpers/utils.ts new file mode 100644 index 00000000..aa98a3e5 --- /dev/null +++ b/deployment/helpers/utils.ts @@ -0,0 +1,112 @@ +import chalk from 'chalk'; +import { ETHEREUM_ADDRESS_LENGTH, LoggerFn, ValueDiff } from '.'; +import { ChainId } from '@certusone/wormhole-sdk'; +import { RouterEndpointConfig } from '../config/config-types'; +import { ethers } from 'ethers'; +import bs58 from 'bs58'; + +export const someoneIsDifferent = (values: ValueDiff[]) => values.some((value) => value.onChain.toString() !== value.offChain.toString()); + +export function logComparision(name: string, diffValues: any, log: LoggerFn) { + + // If the values are the same, do nothing + if (diffValues.onChain.toString() === diffValues.offChain.toString()) + return; + + // If the on chain value is not present or it is zero value, log it as an addition + if (!diffValues.onChain || Number(diffValues.onChain) === 0) { + log(chalk.green(`+ ${name}: ${diffValues.offChain}`)); + } + + // If the off chain value is not present or it is zero value, log it as a removal + else if (!diffValues.offChain || Number(diffValues.offChain) === 0) { + log(chalk.red(`- ${name}: ${diffValues.onChain}`)); + } + + // If both values are present and they are different, log it as a change + else { + log(chalk.yellow(`~ ${name}: `) + chalk.red(`${diffValues.onChain}`) + ' -> ' + chalk.green(`${diffValues.offChain}`)); + } +} + +export function getAddressAsBytes32(address: string): string { + const addressLength = address.length - (address.startsWith("0x") ? 2 : 0); + + // Solana address + if (addressLength > ETHEREUM_ADDRESS_LENGTH) { + const bytes = bs58.decode(address); + address = "0x" + Buffer.from(bytes).toString('hex'); + } + // Ethereum address + else { + address = ethers.utils.defaultAbiCoder.encode(["address"], [address]); + } + + return address; +} + +// Router endpoint helpers + +export function getRouterEndpointDifferences(onChainRouterEndpoints: RouterEndpointConfig[], offChainRouterEndpoints: RouterEndpointConfig[]) { + const routerEndpointsDifferences = []; + let onChainIndex = 0; + let offChainIndex = 0; + + onChainRouterEndpoints = onChainRouterEndpoints.sort((a, b) => a.chainId - b.chainId); + offChainRouterEndpoints = offChainRouterEndpoints.sort((a, b) => a.chainId - b.chainId); + + while (true) { + const onChainEndpoint = onChainRouterEndpoints[onChainIndex]; + const offChainEndpoint = offChainRouterEndpoints[offChainIndex]; + + // If we've reached the end of both arrays, we're done + if (!onChainEndpoint && !offChainEndpoint) { + break; + } + + // If we've reached the end of offChainEndpoints, add the remaining onChainEndpoints + // or if the onChainEndpoint is less than the offChainEndpoint, add the onChainEndpoint + if (!offChainEndpoint || onChainEndpoint?.chainId < offChainEndpoint?.chainId) { + routerEndpointsDifferences.push( + routerEndpointConfig(onChainEndpoint.chainId, onChainEndpoint, {}) + ); + onChainIndex++; + continue; + } + + // If we've reached the end of onChainEndpoints, add the remaining offChainEndpoints + // or if the offChainEndpoint is less than the onChainEndpoint, add the offChainEndpoint + if (!onChainEndpoint || onChainEndpoint?.chainId > offChainEndpoint?.chainId) { + routerEndpointsDifferences.push( + routerEndpointConfig(offChainEndpoint.chainId, {}, offChainEndpoint) + ); + offChainIndex++; + continue; + } + + routerEndpointsDifferences.push( + routerEndpointConfig(onChainEndpoint.chainId, onChainEndpoint, offChainEndpoint) + ); + + onChainIndex++; + offChainIndex++; + } + + return routerEndpointsDifferences; +} + +const routerEndpointConfig = (chainId: ChainId, onChain: Partial, offChain: Partial) => ({ + chainId, + router: { + onChain: onChain?.endpoint?.router, + offChain: offChain?.endpoint?.router ? getAddressAsBytes32(offChain?.endpoint?.router as string) : undefined + }, + mintRecipient: { + onChain: onChain?.endpoint?.mintRecipient, + offChain: offChain?.endpoint?.mintRecipient ? getAddressAsBytes32(offChain?.endpoint?.mintRecipient as string) : undefined + }, + circleDomain: { + onChain: onChain?.circleDomain, + offChain: offChain?.circleDomain + } +}); \ No newline at end of file diff --git a/deployment/package-lock.json b/deployment/package-lock.json index eb0d60d5..0cf7bd02 100644 --- a/deployment/package-lock.json +++ b/deployment/package-lock.json @@ -7,6 +7,7 @@ "name": "deployment", "devDependencies": { "@certusone/wormhole-sdk": "^0.10.11", + "@inquirer/confirm": "^3.1.9", "@solana/web3.js": "^1.92.2", "@typechain/ethers-v5": "^11.1.2", "@types/node": "^20.11.22", @@ -1873,6 +1874,75 @@ "follow-redirects": "^1.14.0" } }, + "node_modules/@inquirer/confirm": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-3.1.9.tgz", + "integrity": "sha512-UF09aejxCi4Xqm6N/jJAiFXArXfi9al52AFaSD+2uIHnhZGtd1d6lIGTRMPouVSJxbGEi+HkOWSYaiEY/+szUw==", + "dev": true, + "dependencies": { + "@inquirer/core": "^8.2.2", + "@inquirer/type": "^1.3.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/core": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-8.2.2.tgz", + "integrity": "sha512-K8SuNX45jEFlX3EBJpu9B+S2TISzMPGXZIuJ9ME924SqbdW6Pt6fIkKvXg7mOEOKJ4WxpQsxj0UTfcL/A434Ww==", + "dev": true, + "dependencies": { + "@inquirer/figures": "^1.0.3", + "@inquirer/type": "^1.3.3", + "@types/mute-stream": "^0.0.4", + "@types/node": "^20.12.13", + "@types/wrap-ansi": "^3.0.0", + "ansi-escapes": "^4.3.2", + "chalk": "^4.1.2", + "cli-spinners": "^2.9.2", + "cli-width": "^4.1.0", + "mute-stream": "^1.0.0", + "signal-exit": "^4.1.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^6.2.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/core/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@inquirer/figures": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.3.tgz", + "integrity": "sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/type": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-1.3.3.tgz", + "integrity": "sha512-xTUt0NulylX27/zMx04ZYar/kr1raaiFTVvQ5feljQsiAgdm0WPj4S73/ye0fbslh+15QrIuDvfCXTek7pMY5A==", + "dev": true, + "engines": { + "node": ">=18" + } + }, "node_modules/@ledgerhq/cryptoassets": { "version": "12.1.0", "resolved": "https://registry.npmjs.org/@ledgerhq/cryptoassets/-/cryptoassets-12.1.0.tgz", @@ -2738,10 +2808,19 @@ "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", "dev": true }, + "node_modules/@types/mute-stream": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@types/mute-stream/-/mute-stream-0.0.4.tgz", + "integrity": "sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/node": { - "version": "20.12.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.11.tgz", - "integrity": "sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==", + "version": "20.14.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", + "integrity": "sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -2777,6 +2856,12 @@ "integrity": "sha512-CHgUI5kTc/QLMP8hODUHhge0D4vx+9UiAwIGiT0sTy/B2XpdX1U5rJt6JSISgr6ikRT7vxV9EVAFeYZqUnl1gQ==", "dev": true }, + "node_modules/@types/wrap-ansi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz", + "integrity": "sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==", + "dev": true + }, "node_modules/@types/ws": { "version": "7.4.7", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", @@ -2971,12 +3056,38 @@ "node": ">=18.0.0" } }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "optional": true, "engines": { "node": ">=8" } @@ -3465,6 +3576,27 @@ "safe-buffer": "^5.0.1" } }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-width": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", + "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", + "dev": true, + "engines": { + "node": ">= 12" + } + }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -4027,8 +4159,7 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "optional": true + "dev": true }, "node_modules/end-of-stream": { "version": "1.4.4", @@ -4880,7 +5011,6 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, - "optional": true, "engines": { "node": ">=8" } @@ -5322,6 +5452,15 @@ "mustache": "bin/mustache" } }, + "node_modules/mute-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", + "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/nan": { "version": "2.14.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", @@ -6066,6 +6205,18 @@ "node": ">=6" } }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/simple-concat": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", @@ -6172,7 +6323,6 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, - "optional": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -6187,7 +6337,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "optional": true, "dependencies": { "ansi-regex": "^5.0.1" }, diff --git a/deployment/package.json b/deployment/package.json index 3bd76043..74e9068b 100644 --- a/deployment/package.json +++ b/deployment/package.json @@ -7,6 +7,7 @@ "author": "", "devDependencies": { "@certusone/wormhole-sdk": "^0.10.11", + "@inquirer/confirm": "^3.1.9", "@solana/web3.js": "^1.92.2", "@typechain/ethers-v5": "^11.1.2", "@types/node": "^20.11.22", diff --git a/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts index 34e38490..0062a132 100644 --- a/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts +++ b/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts @@ -1,6 +1,82 @@ -import { runOnEvms, ChainInfo, LoggerFn } from "../../../helpers"; +import { MatchingEngine } from "../../../contract-bindings"; +import { runOnEvmsSequentially, ChainInfo, LoggerFn, getContractInstance, getContractAddress } from "../../../helpers"; import { ethers } from "ethers"; +import { getConfigurationDifferences, logDiff } from "./utils"; +import confirm from '@inquirer/confirm'; -runOnEvms("config-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { - +runOnEvmsSequentially("config-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + const matchingEngineAddress = await getContractAddress("MatchingEngineProxy", chain.chainId); + const matchingEgine = (await getContractInstance("MatchingEngine", matchingEngineAddress, chain)) as MatchingEngine; + const diff = await getConfigurationDifferences(chain); + + log(`MatchingEngine configuration differences on chain ${chain.chainId}:`); + logDiff(diff, log); + + const deployConfig: boolean = await confirm({ message: 'Continue?', default: false }); + if (!deployConfig){ + log(`Configuration deployment aborted on chain ${chain.chainId}`); + return; + } + + const { feeRecipient, cctpAllowance, routerEndpoints } = diff; + + // Fee recipient + if (feeRecipient.onChain !== feeRecipient.offChain) { + if (Number(feeRecipient.offChain) === 0) + throw new Error('Invalid fee recipient address'); + + await matchingEgine.updateFeeRecipient(feeRecipient.offChain); + log(`Fee recipient updated to ${feeRecipient.offChain}`); + } + + // CCTP allowance + if (cctpAllowance.onChain.toString() !== cctpAllowance.offChain.toString()) { + await matchingEgine.setCctpAllowance(cctpAllowance.offChain); + log(`CCTP allowance updated to ${cctpAllowance.offChain}`); + } + + // Router endpoints + for (const { chainId, router, mintRecipient, circleDomain } of routerEndpoints) { + const offChainEndpoint = { + router: router.offChain, + mintRecipient: mintRecipient.offChain + }; + + // Add new router endpoint if all values are zero + if (Number(router?.onChain) === 0 && Number(mintRecipient?.onChain) === 0 && Number(circleDomain?.onChain) === 0) { + if (chainId === 0) + throw new Error('Invalid chainId when adding new router endpoint'); + + if (Number(offChainEndpoint.router) === 0 || Number(offChainEndpoint.mintRecipient) === 0) + throw new Error(`Invalid router or mintRecipient endpoint for chainId ${chainId}`); + + await matchingEgine.addRouterEndpoint(chainId, offChainEndpoint, circleDomain.offChain); + log(`Router endpoint added for chainId ${chainId}`); + continue; + } + + // Disable router endpoint, must be the three values zero + if (Number(router?.offChain) === 0 && Number(mintRecipient?.offChain) === 0 && Number(circleDomain?.offChain) === 0) { + await matchingEgine.disableRouterEndpoint(chainId); + log(`Router endpoint disabled for chainId ${chainId}`); + continue; + } + + // Update router endpoint + if ( + router?.onChain.toString() !== router?.offChain.toString() || + mintRecipient?.onChain.toString() !== mintRecipient?.offChain.toString() || + circleDomain?.onChain.toString() !== circleDomain?.offChain.toString() + ) { + if (chainId === 0) + throw new Error('Invalid chainId when adding new router endpoint'); + + if (Number(offChainEndpoint.router) === 0 || Number(offChainEndpoint.mintRecipient) === 0) + throw new Error(`Invalid router or mintRecipient endpoint for chainId ${chainId}`); + + await matchingEgine.updateRouterEndpoint(chainId, offChainEndpoint, circleDomain.offChain); + log(`Router endpoint updated for chainId ${chainId}`); + continue; + } + } }); \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/deploy-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/deploy-matching-engine.ts index a1252e8f..3214ddf9 100644 --- a/deployment/scripts/evm/MatchingEngine/deploy-matching-engine.ts +++ b/deployment/scripts/evm/MatchingEngine/deploy-matching-engine.ts @@ -1,5 +1,5 @@ import { ethers } from "ethers"; -import { runOnEvms, ChainInfo, LoggerFn, writeDeployedContract, zeroValues } from "../../../helpers"; +import { runOnEvms, ChainInfo, LoggerFn, writeDeployedContract } from "../../../helpers"; import { MatchingEngineConfiguration } from "../../../config/config-types"; import { ERC1967Proxy__factory } from "@certusone/wormhole-sdk/lib/cjs/ethers-contracts"; @@ -19,7 +19,7 @@ async function deployProxy(signer: ethers.Signer, config: MatchingEngineConfigur // Validate if the addresses are valid and not zero for (const value of data) - if (!ethers.utils.isAddress(value) || zeroValues.includes(value)) + if (!ethers.utils.isAddress(value) || Number(value) === 0) throw new Error(`Invalid value: ${value}`); const encodedData = ethers.utils.solidityPack(["address", "address"], data); diff --git a/deployment/scripts/evm/MatchingEngine/get-config-diff-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/get-config-diff-matching-engine.ts index 9523b69d..796920e3 100644 --- a/deployment/scripts/evm/MatchingEngine/get-config-diff-matching-engine.ts +++ b/deployment/scripts/evm/MatchingEngine/get-config-diff-matching-engine.ts @@ -1,51 +1,10 @@ -import { runOnEvms, ChainInfo, LoggerFn, zeroValues } from "../../../helpers"; +import { runOnEvms, ChainInfo, LoggerFn } from "../../../helpers"; import { ethers } from "ethers"; -import { getConfigurationDifferences } from "./utils"; -import chalk from 'chalk'; +import { getConfigurationDifferences, logDiff } from "./utils"; runOnEvms("get-config-diff-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { const diff = await getConfigurationDifferences(chain); log(`MatchingEngine configuration differences on chain ${chain.chainId}:`); - walkThrough(diff, log); -}); - -function walkThrough(differences: Record, log: LoggerFn) { - for (const [key, value] of Object.entries(differences)) { - - // If the value is an array, walk through each item - if (Array.isArray(value)) { - for (const item of value) { - walkThrough(item, log); - } - continue; - } - - // If the value is an object, walk through its properties - if (!value.onChain && !value.offChain) { - log(`${key}: `); - walkThrough(value, log); - continue; - } - - logComparision(key, value, log); - } -} - - -function logComparision(name: string, diffValues: any, log: LoggerFn) { - // If the on chain value is not present or it is zero value, log it as an addition - if (!diffValues.onChain || zeroValues.includes(diffValues.onChain)) { - log(chalk.green(`+ ${name}: ${diffValues.offChain}`)); - } - - // If the off chain value is not present or it is zero value, log it as a removal - else if (!diffValues.offChain || zeroValues.includes(diffValues.offChain)) { - log(chalk.red(`- ${name}: ${diffValues.onChain}`)); - } - - // If both values are present and they are different, log it as a change - else if (diffValues.onChain && diffValues.offChain) { - log(chalk.yellow(`~ ${name}: `) + chalk.red(`${diffValues.onChain}`) + ' -> ' + chalk.green(`${diffValues.offChain}`)); - } -} + logDiff(diff, log); +}); \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/utils.ts b/deployment/scripts/evm/MatchingEngine/utils.ts index 7c1b8fa1..b1b627d7 100644 --- a/deployment/scripts/evm/MatchingEngine/utils.ts +++ b/deployment/scripts/evm/MatchingEngine/utils.ts @@ -1,9 +1,8 @@ import { ethers } from "ethers"; import { MatchingEngineConfiguration, RouterEndpointConfig } from "../../../config/config-types"; import { MatchingEngine, MatchingEngine__factory } from "../../../contract-bindings"; -import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance } from "../../../helpers"; +import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, getRouterEndpointDifferences, logComparision, someoneIsDifferent } from "../../../helpers"; import { ERC20 } from "../../../contract-bindings/out/ERC20"; -import { ChainId } from "@certusone/wormhole-sdk"; export function getMachingEngineConfiguration(chain: ChainInfo): Promise { return getChainConfig("matching-engine", chain.chainId); @@ -52,17 +51,14 @@ export async function deployImplementation(signer: ethers.Signer, config: Matchi export async function getOnChainMachingEngineConfiguration(chain: ChainInfo) { const config = await getMachingEngineConfiguration(chain); - const matchingEngineImplementationAddress = await getContractAddress("MatchingEngineImplementation", chain.chainId); - const matchingEngineAddress = await getContractAddress("MatchingEngineProxy", chain.chainId); - const matchingEngine = (await getContractInstance("MatchingEngine", matchingEngineAddress, chain)) as MatchingEngine; + const matchingEngineProxyAddress = await getContractAddress("MatchingEngineProxy", chain.chainId); + const matchingEngine = (await getContractInstance("MatchingEngine", matchingEngineProxyAddress, chain)) as MatchingEngine; // Get the allowance for the token messenger const tokenMessengerAddress = getDependencyAddress("tokenMessenger", chain.chainId); const tokenAddress = await matchingEngine.token(); const token = (await getContractInstance("ERC20", tokenAddress, chain)) as ERC20; - const decimals = await token.decimals(); - const rawCctpAllowance = await token.allowance(matchingEngineImplementationAddress, tokenMessengerAddress); - const cctpAllowance = ethers.utils.formatUnits(rawCctpAllowance, decimals); + const cctpAllowance = (await token.allowance(matchingEngineProxyAddress, tokenMessengerAddress)).toString(); const feeRecipient = await matchingEngine.feeRecipient(); @@ -97,82 +93,41 @@ export async function getConfigurationDifferences(chain: ChainInfo) { const offChainValue = offChainConfig[key as keyof typeof offChainConfig]; const onChainValue = onChainConfig[key as keyof typeof onChainConfig]; - if (!offChainValue) + if (offChainValue === undefined) throw new Error(`${key} not found in offChainConfig`); // Ignore key if it's an array if (Array.isArray(offChainValue)) continue; - const isDifferent = offChainValue.toString() !== onChainValue; - if (isDifferent) { - differences[key] = { - offChain: offChainValue, - onChain: onChainValue - }; - } + differences[key] = { + offChain: offChainValue, + onChain: onChainValue + }; } - let onChainIndex = 0; - let offChainIndex = 0; - const routerEndpointsDifferences = []; - const onChainRouterEndpoints = onChainConfig.routerEndpoints.sort((a, b) => a.chainId - b.chainId); - const offChainRouterEndpoints = offChainConfig.routerEndpoints.sort((a, b) => a.chainId - b.chainId); - while (true) { - const onChainEndpoint = onChainRouterEndpoints[onChainIndex]; - const offChainEndpoint = offChainRouterEndpoints[offChainIndex]; - - // If we've reached the end of both arrays, we're done - if (!onChainEndpoint && !offChainEndpoint) { - break; - } - - // If we've reached the end of offChainEndpoints, add the remaining onChainEndpoints - // or if the onChainEndpoint is less than the offChainEndpoint, add the onChainEndpoint - if (!offChainEndpoint || onChainEndpoint?.chainId < offChainEndpoint?.chainId) { - routerEndpointsDifferences.push( - routerEndpointConfig(onChainEndpoint.chainId, onChainEndpoint, {}) - ); - onChainIndex++; - } - - // If we've reached the end of onChainEndpoints, add the remaining offChainEndpoints - // or if the offChainEndpoint is less than the onChainEndpoint, add the offChainEndpoint - else if (!onChainEndpoint || onChainEndpoint?.chainId > offChainEndpoint?.chainId) { - routerEndpointsDifferences.push( - routerEndpointConfig(offChainEndpoint.chainId, {}, offChainEndpoint) - ); - offChainIndex++; - } - - // If the chainIds are the same, add the differences between the two endpoints - else { - routerEndpointsDifferences.push( - routerEndpointConfig(onChainEndpoint.chainId, onChainEndpoint, offChainEndpoint) - ); - onChainIndex++; - offChainIndex++; - } - } - - differences.routerEndpoints = routerEndpointsDifferences; + differences.routerEndpoints = getRouterEndpointDifferences(onChainConfig.routerEndpoints, offChainConfig.routerEndpoints); return differences; } -const routerEndpointConfig = (chainId: ChainId, onChain: Partial, offChain: Partial) => ({ - [`endpoint-chainId-${chainId}`]: { - router: { - onChain: onChain?.endpoint?.router, - offChain: offChain?.endpoint?.router - }, - mintRecipient: { - onChain: onChain?.endpoint?.mintRecipient, - offChain: offChain?.endpoint?.mintRecipient +export function logDiff(differences: Record, log: LoggerFn) { + logComparision('feeRecipient', differences.feeRecipient, log); + logComparision('cctpAllowance', differences.cctpAllowance, log); + + let routersLogged = false; + for (const { chainId, router, mintRecipient, circleDomain } of differences.routerEndpoints) { + if (!someoneIsDifferent([router, mintRecipient, circleDomain])) + continue; + + if (!routersLogged) { + log('Router endpoints:'); + routersLogged = true; } - }, - circleDomain: { - onChain: onChain?.circleDomain, - offChain: offChain?.circleDomain + + log(`ChainId ${chainId}:`); + logComparision('router', router, log); + logComparision('mintRecipient', mintRecipient, log); + logComparision('circleDomain', circleDomain, log); } -}); \ No newline at end of file +} \ No newline at end of file diff --git a/deployment/scripts/evm/TokenRouter/config-token-router.ts b/deployment/scripts/evm/TokenRouter/config-token-router.ts index 6685912f..c13f6da2 100644 --- a/deployment/scripts/evm/TokenRouter/config-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/config-token-router.ts @@ -1,8 +1,119 @@ -import { runOnEvms, ChainInfo, LoggerFn, getContractInstance, getContractAddress } from "../../../helpers"; +import { ChainInfo, LoggerFn, getContractInstance, getContractAddress, runOnEvmsSequentially, ValueDiff } from "../../../helpers"; import { ethers } from "ethers"; +import { getConfigurationDifferences, logDiff } from "./utils"; +import confirm from '@inquirer/confirm'; +import { TokenRouter } from "../../../contract-bindings"; +import { FastTransferParametersStruct } from "../../../contract-bindings/evm/out/ITokenRouter"; -runOnEvms("config-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { - const tokenRouterAddress = await getContractAddress("TokenRouter", chain.chainId); - const tokenRouter = await getContractInstance("TokenRouter", tokenRouterAddress, chain); +runOnEvmsSequentially("config-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + const tokenRouterAddress = await getContractAddress("TokenRouterProxy", chain.chainId); + const tokenRouter = (await getContractInstance("TokenRouter", tokenRouterAddress, chain)) as TokenRouter; + const diff = await getConfigurationDifferences(chain); -}); \ No newline at end of file + log(`TokenRouter configuration differences on chain ${chain.chainId}:`); + logDiff(diff, log); + + const deployConfig: boolean = await confirm({ message: 'Continue?', default: false }); + if (!deployConfig){ + log(`Configuration deployment aborted on chain ${chain.chainId}`); + return; + } + + const { cctpAllowance, routerEndpoints, fastTransferParameters } = diff; + + // Fast transfer parameters + await updateFastTransferParameters(tokenRouter, fastTransferParameters, log); + + // CCTP allowance + if (cctpAllowance.onChain.toString() !== cctpAllowance.offChain.toString()) { + await tokenRouter.setCctpAllowance(cctpAllowance.offChain); + log(`CCTP allowance updated to ${cctpAllowance.offChain}`); + } + + // Router endpoints + for (const { chainId, router, mintRecipient, circleDomain } of routerEndpoints) { + const offChainEndpoint = { + router: router.offChain, + mintRecipient: mintRecipient.offChain + }; + + // Add new router endpoint if all values are zero + if (Number(router?.onChain) === 0 && Number(mintRecipient?.onChain) === 0 && Number(circleDomain?.onChain) === 0) { + if (chainId === 0) + throw new Error('Invalid chainId when adding new router endpoint'); + + if (Number(offChainEndpoint.router) === 0 || Number(offChainEndpoint.mintRecipient) === 0) + throw new Error(`Invalid router or mintRecipient endpoint for chainId ${chainId}`); + + await tokenRouter.addRouterEndpoint(chainId, offChainEndpoint, circleDomain.offChain); + log(`Router endpoint added for chainId ${chainId}`); + continue; + } + + // Disable router endpoint, must be the three values zero + if (Number(router?.offChain) === 0 && Number(mintRecipient?.offChain) === 0 && Number(circleDomain?.offChain) === 0) { + await tokenRouter.disableRouterEndpoint(chainId); + log(`Router endpoint disabled for chainId ${chainId}`); + continue; + } + + // Update router endpoint + if ( + router?.onChain.toString() !== router?.offChain.toString() || + mintRecipient?.onChain.toString() !== mintRecipient?.offChain.toString() || + circleDomain?.onChain.toString() !== circleDomain?.offChain.toString() + ) { + if (chainId === 0) + throw new Error('Invalid chainId when adding new router endpoint'); + + if (Number(offChainEndpoint.router) === 0 || Number(offChainEndpoint.mintRecipient) === 0) + throw new Error(`Invalid router or mintRecipient endpoint for chainId ${chainId}`); + + await tokenRouter.updateRouterEndpoint(chainId, offChainEndpoint, circleDomain.offChain); + log(`Router endpoint updated for chainId ${chainId}`); + continue; + } + } +}); + +async function updateFastTransferParameters(tokenRouter: TokenRouter, params: Record, log: LoggerFn) { + let enableFastTransfers = false; + let updatedFastTransferParameters = false; + + // Check if any of the fast transfer parameters have changed + for (const [key, value] of Object.entries(params)) { + if (value.onChain.toString() !== value.offChain.toString()) { + // Check if we are updating the enabled flag + if (key === "enabled") { + enableFastTransfers = true; + } else { + updatedFastTransferParameters = true; + } + } + } + + // Update fast transfer parameters if any of the values have changed (except for the enabled flag) + if (updatedFastTransferParameters) { + + if (params.maxAmount.offChain <= params.baseFee.offChain + params.initAuctionFee.offChain) + throw new Error(`Invalid fast transfer parameters: maxAmount must be greater than baseFee + initAuctionFee`); + + await tokenRouter.updateFastTransferParameters({ + enabled: params.enabled.offChain, + baseFee: params.baseFee.offChain, + maxAmount: params.maxAmount.offChain, + initAuctionFee: params.initAuctionFee.offChain + } as FastTransferParametersStruct); + log(`Fast transfer parameters updated`); + } + + // Enable / Disable fast transfers if only the enabled flag has changed + else if (enableFastTransfers) { + const enabled = params.enabled.offChain; + await tokenRouter.enableFastTransfers(enabled); + if (enabled) + log(`Fast transfers enabled`); + else + log(`Fast transfers disabled`); + } +} \ No newline at end of file diff --git a/deployment/scripts/evm/TokenRouter/deploy-token-router.ts b/deployment/scripts/evm/TokenRouter/deploy-token-router.ts index c48cfa87..e8a3eb88 100644 --- a/deployment/scripts/evm/TokenRouter/deploy-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/deploy-token-router.ts @@ -1,6 +1,6 @@ import { ethers } from "ethers"; import { ERC1967Proxy__factory } from "@certusone/wormhole-sdk/lib/cjs/ethers-contracts"; -import { runOnEvms, ChainInfo, LoggerFn, writeDeployedContract, zeroValues } from "../../../helpers"; +import { runOnEvms, ChainInfo, LoggerFn, writeDeployedContract } from "../../../helpers"; import { TokenRouterConfiguration } from "../../../config/config-types"; import { deployImplementation, getTokenRouterConfiguration } from "./utils"; @@ -17,7 +17,7 @@ async function deployProxy(signer: ethers.Signer, config: TokenRouterConfigurati const data = config.ownerAssistant; // Validate if the address are valid and not zero - if (!ethers.utils.isAddress(data) || zeroValues.includes(data)) + if (!ethers.utils.isAddress(data) || Number(data) === 0) throw new Error(`Invalid value: ${data}`); const encodedData = ethers.utils.solidityPack(["address"], [data]); diff --git a/deployment/scripts/evm/TokenRouter/get-config-diff-token-router.ts b/deployment/scripts/evm/TokenRouter/get-config-diff-token-router.ts new file mode 100644 index 00000000..5b82d7ae --- /dev/null +++ b/deployment/scripts/evm/TokenRouter/get-config-diff-token-router.ts @@ -0,0 +1,10 @@ +import { runOnEvms, ChainInfo, LoggerFn } from "../../../helpers"; +import { ethers } from "ethers"; +import { getConfigurationDifferences, logDiff } from "./utils"; + +runOnEvms("get-config-diff-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + const diff = await getConfigurationDifferences(chain); + + log(`TokenRouter configuration differences on chain ${chain.chainId}:`); + logDiff(diff, log); +}); \ No newline at end of file diff --git a/deployment/scripts/evm/TokenRouter/read-config-token-router.ts b/deployment/scripts/evm/TokenRouter/read-config-token-router.ts new file mode 100644 index 00000000..8449246c --- /dev/null +++ b/deployment/scripts/evm/TokenRouter/read-config-token-router.ts @@ -0,0 +1,10 @@ +import { runOnEvms, ChainInfo, LoggerFn } from "../../../helpers"; +import { ethers } from "ethers"; +import { getOnChainTokenRouterConfiguration } from "./utils"; +import { inspect } from "util"; + +runOnEvms("read-config-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + const onChainConfig = await getOnChainTokenRouterConfiguration(chain); + log(`TokenRouter configuration for chainId ${chain.chainId}:`); + log(inspect(onChainConfig, { depth: null, colors: true, compact: true })); +}); \ No newline at end of file diff --git a/deployment/scripts/evm/TokenRouter/utils.ts b/deployment/scripts/evm/TokenRouter/utils.ts index 8dc10e96..eb972e75 100644 --- a/deployment/scripts/evm/TokenRouter/utils.ts +++ b/deployment/scripts/evm/TokenRouter/utils.ts @@ -2,8 +2,8 @@ import { ChainId } from "@certusone/wormhole-sdk"; import { ethers } from "ethers"; import { TokenRouterConfiguration } from "../../../config/config-types"; import { TokenRouter, TokenRouter__factory } from "../../../contract-bindings"; -import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, ETHEREUM_ADDRESS_LENGTH, getContractInstance } from "../../../helpers"; -import bs58 from 'bs58'; +import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, getRouterEndpointDifferences, getAddressAsBytes32, logComparision, someoneIsDifferent } from "../../../helpers"; +import { ERC20 } from "../../../contract-bindings/out/ERC20"; export function getTokenRouterConfiguration(chain: ChainInfo): Promise { return getChainConfig("token-router", chain.chainId); @@ -45,36 +45,106 @@ export async function deployImplementation(signer: ethers.Signer, config: TokenR export async function getOnChainTokenRouterConfiguration(chain: ChainInfo) { const config = await getTokenRouterConfiguration(chain); - const tokenRouterAddress = await getContractAddress("TokenRouterProxy", chain.chainId); - const tokenRouter = (await getContractInstance("TokenRouterImplementation", tokenRouterAddress, chain)) as TokenRouter; + const tokenRouterProxyAddress = await getContractAddress("TokenRouterProxy", chain.chainId); + const tokenRouter = (await getContractInstance("TokenRouter", tokenRouterProxyAddress, chain)) as TokenRouter; - // instantiate erc20 token and get the allowance for the token messenger? - const cctpAllowance = await tokenRouter.cctpAllowance(); + // Get the allowance for the token messenger + const tokenMessengerAddress = getDependencyAddress("tokenMessenger", chain.chainId); + const orderTokenAddress = await tokenRouter.orderToken(); + const orderToken = (await getContractInstance("ERC20", orderTokenAddress, chain)) as ERC20; + const cctpAllowance = (await orderToken.allowance(tokenRouterProxyAddress, tokenMessengerAddress)).toString(); const routerEndpoints = await Promise.all(config .routerEndpoints - .map(async ({ chainId }) => ({ chainId, endpoint: await tokenRouter.getRouterEndpoint(chainId)}))); - - + .map(async ({ chainId }) => { + const { router, mintRecipient } = await tokenRouter.getRouterEndpoint(chainId); + return { + chainId, + endpoint: { + router, + mintRecipient + }, + circleDomain: await tokenRouter.getDomain(chainId) + } + })); + + const { enabled, maxAmount, baseFee, initAuctionFee} = await tokenRouter.getFastTransferParameters(); return { cctpAllowance, + fastTransferParameters: { + enabled, + maxAmount: maxAmount.toString(), + baseFee: baseFee.toString(), + initAuctionFee: initAuctionFee.toString() + }, routerEndpoints }; } -export function getAddressAsBytes32(address: string): string { - const addressLength = address.length - (address.startsWith("0x") ? 2 : 0); - - // Solana address - if (addressLength > ETHEREUM_ADDRESS_LENGTH) { - const bytes = bs58.decode(address); - address = "0x" + Buffer.from(bytes).toString('hex'); - } - // Ethereum address - else { - address = ethers.utils.defaultAbiCoder.encode(["address"], [address]); +function compareConfigurations(onChainConfig: Record, offChainConfig: Record) { + const differences = {} as Record; + + for (const key of Object.keys(onChainConfig)) { + const offChainValue = offChainConfig[key as keyof typeof offChainConfig]; + const onChainValue = onChainConfig[key as keyof typeof onChainConfig]; + + if (offChainValue === undefined) + throw new Error(`${key} not found in offChainConfig`); + + // Ignore key if it's an array + if (Array.isArray(offChainValue)) + continue; + + // If the values are objects, compare them + if (typeof offChainValue === 'object' && typeof onChainValue === 'object') { + differences[key] = compareConfigurations(onChainValue, offChainValue); + continue; + } + + differences[key] = { + offChain: offChainValue, + onChain: onChainValue + }; } - return address; + return differences; +} + +export async function getConfigurationDifferences(chain: ChainInfo) { + const onChainConfig = await getOnChainTokenRouterConfiguration(chain); + const offChainConfig = await getTokenRouterConfiguration(chain); + const differences = compareConfigurations(onChainConfig, offChainConfig); + + differences.routerEndpoints = getRouterEndpointDifferences(onChainConfig.routerEndpoints, offChainConfig.routerEndpoints); + + return differences; +} + +export function logDiff(differences: Record, log: LoggerFn) { + logComparision('cctpAllowance', differences.cctpAllowance, log); + + let routersLogged = false; + for (const { chainId, router, mintRecipient, circleDomain } of differences.routerEndpoints) { + if (!someoneIsDifferent([router, mintRecipient, circleDomain])) + continue; + + if (!routersLogged) { + log('Router endpoints:'); + routersLogged = true; + } + + log(`ChainId ${chainId}:`); + logComparision('router', router, log); + logComparision('mintRecipient', mintRecipient, log); + logComparision('circleDomain', circleDomain, log); + } + + const { enabled, maxAmount, baseFee, initAuctionFee } = differences.fastTransferParameters; + if (someoneIsDifferent([enabled, maxAmount, baseFee, initAuctionFee])) { + log('Fast transfer parameters:'); + for (const [key, value] of Object.entries(differences.fastTransferParameters)) { + logComparision(key, value, log); + } + } } \ No newline at end of file From 7e58f458708ad2fb1e1d6db2f359be8a18743271 Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Mon, 1 Jul 2024 14:15:05 -0300 Subject: [PATCH 13/80] Refactor scripts deps --- deployment/config/config-types.ts | 14 +- deployment/helpers/env.ts | 59 +- deployment/helpers/evm.ts | 2 - deployment/helpers/interfaces.ts | 16 +- deployment/helpers/utils.ts | 82 +- deployment/package-lock.json | 3657 +---------------- deployment/package.json | 4 +- .../bytecode-verification-matching-engine.ts | 46 +- .../MatchingEngine/config-matching-engine.ts | 41 +- .../MatchingEngine/deploy-matching-engine.ts | 7 +- .../get-config-diff-matching-engine.ts | 1 - .../register-new-token-router.ts | 6 - .../update-owner-assistant-matching-engine.ts | 35 + .../MatchingEngine/upgrade-matching-engine.ts | 6 +- .../scripts/evm/MatchingEngine/utils.ts | 38 +- .../bytecode-verification-token-router.ts | 46 +- .../evm/TokenRouter/config-token-router.ts | 35 +- .../evm/TokenRouter/deploy-token-router.ts | 8 +- .../update-owner-assistant-token-router.ts | 35 + .../evm/TokenRouter/upgrade-token-router.ts | 25 +- deployment/scripts/evm/TokenRouter/utils.ts | 54 +- 21 files changed, 517 insertions(+), 3700 deletions(-) delete mode 100644 deployment/scripts/evm/MatchingEngine/register-new-token-router.ts create mode 100644 deployment/scripts/evm/MatchingEngine/update-owner-assistant-matching-engine.ts create mode 100644 deployment/scripts/evm/TokenRouter/update-owner-assistant-token-router.ts diff --git a/deployment/config/config-types.ts b/deployment/config/config-types.ts index 61e72ef9..1b4e4a59 100644 --- a/deployment/config/config-types.ts +++ b/deployment/config/config-types.ts @@ -1,8 +1,8 @@ -import { ChainId } from "@certusone/wormhole-sdk"; +import { ChainId } from "@wormhole-foundation/sdk-base"; import { BytesLike } from "ethers"; export type RouterEndpointConfig = { - chainId: ChainId; + wormholeChainId: ChainId; endpoint: { router: BytesLike; mintRecipient: BytesLike; @@ -11,12 +11,12 @@ export type RouterEndpointConfig = { } export type TokenRouterConfiguration = { - // Chain ID of the token router configuration - chainId: ChainId; + // EVM Chain ID of the token router configuration + chainId: number; // Immutable values matchingEngineMintRecipient: string; - matchingEngineChain: string; + matchingEngineChain: ChainId; // Wormhole Chain ID matchingEngineDomain: string; // Mutable values @@ -32,8 +32,8 @@ export type TokenRouterConfiguration = { }; export type MatchingEngineConfiguration = { - // Chain ID of the matching engine configuration - chainId: ChainId; + // EVM Chain ID of the matching engine configuration + chainId: number; // Immutable values userPenaltyRewardBps: string; diff --git a/deployment/helpers/env.ts b/deployment/helpers/env.ts index de117e3a..ef293383 100644 --- a/deployment/helpers/env.ts +++ b/deployment/helpers/env.ts @@ -1,8 +1,7 @@ import fs from "fs"; -import { ChainId } from "@certusone/wormhole-sdk"; import { ethers, utils } from "ethers"; import { validateSolAddress } from "./solana"; -import { ChainConfig, ChainInfo, ContractsJson, DependenciesJson, Ecosystem } from "./interfaces"; +import { ChainConfig, ChainInfo, ContractsJson, Dependencies, Ecosystem } from "./interfaces"; import { getSigner } from "./evm"; // TODO: support different env files import 'dotenv/config'; @@ -20,8 +19,8 @@ function loadJson(filename: string): T { return JSON.parse(fileContent.toString()) as T; } -function loadDependencies(): DependenciesJson { - return loadJson("dependencies"); +function loadDependencies(): Dependencies[] { + return loadJson("dependencies"); } function loadContracts() { @@ -40,42 +39,46 @@ export function getEnv(env: string): string { return v; } -export async function getChainConfig(filename: string, chainId: ChainId): Promise { +export async function getChainConfig(filename: string, evmChainId: number): Promise { const scriptConfig: T[] = await loadJson(filename); - const chainConfig = scriptConfig.find((x) => x.chainId == chainId); + const chainConfig = scriptConfig.find((x) => x.chainId == evmChainId); if (!chainConfig) { - throw Error(`Failed to find chain config for chain ${chainId}`); + throw Error(`Failed to find chain config for chain ${evmChainId}`); } return chainConfig; } -export async function getContractAddress(contractName: string, chainId: ChainId): Promise { - const contract = contracts[contractName]?.find((c) => c.chainId === chainId)?.address; +export function getContractAddress(contractName: string, evmChainId: number): string { + const contract = contracts[contractName]?.find((c) => c.chainId === evmChainId)?.address; if (!contract) { - throw new Error(`No ${contractName} contract found for chain ${chainId}`); + throw new Error(`No ${contractName} contract found for chain ${evmChainId}`); } if (!utils.isAddress(contract) && !validateSolAddress(contract)){ - throw new Error(`Invalid address for ${contractName} contract found for chain ${chainId}`); + throw new Error(`Invalid address for ${contractName} contract found for chain ${evmChainId}`); } return contract; } -export function getDependencyAddress(dependencyName: string, chainId: ChainId): string { - // @ts-ignore - const dependency = dependencies.find((d) => d.chainId === chainId)[dependencyName]; +export function getDependencyAddress(dependencyName: string, evmChainId: number): string { + const chainDependencies = dependencies.find((d) => d.chainId === evmChainId); - if (!dependency) { - throw new Error(`No dependency found for ${dependencyName}`); + if (chainDependencies === undefined ) { + throw new Error(`No dependencies found for chain ${evmChainId}`); + } + + const dependency = chainDependencies[dependencyName as keyof Dependencies] as string; + if (dependency === undefined) { + throw new Error(`No dependency found for ${dependencyName} for chain ${evmChainId}`); } if (!utils.isAddress(dependency) && !validateSolAddress(dependency)){ - throw new Error(`Invalid address for ${dependencyName} dependency found for chain ${chainId}`); + throw new Error(`Invalid address for ${dependencyName} dependency found for chain ${evmChainId}`); } return dependency; @@ -91,20 +94,30 @@ export async function getContractInstance( return factory.connect(contractAddress, signer); } -export function writeDeployedContract(chain: ChainId, contractName: string, address: string) { +export function getDeploymentArgs(contractName: string, evmChainId: number): any[] { + const constructorArgs = contracts[contractName]?.find((c) => c.chainId === evmChainId)?.constructorArgs; + + if (!constructorArgs) { + throw new Error(`No constructorArgs found for ${contractName} contract for chain ${evmChainId}`); + } + + return constructorArgs; +} + +export function writeDeployedContract(evmChainId: number, contractName: string, address: string, constructorArgs: any[] ) { const contracts = loadContracts(); if (!contracts[contractName]) { - contracts[contractName] = [{ chainId: chain, address }]; + contracts[contractName] = [{ chainId: evmChainId, address, constructorArgs }]; } - else if (!contracts[contractName].find((c) => c.chainId === chain)) { - contracts[contractName].push({ chainId: chain, address }); + else if (!contracts[contractName].find((c) => c.chainId === evmChainId)) { + contracts[contractName].push({ chainId: evmChainId, address, constructorArgs }); } else { contracts[contractName] = contracts[contractName].map((c) => { - if (c.chainId === chain) { - return { chainId: chain, address }; + if (c.chainId === evmChainId) { + return { chainId: evmChainId, address, constructorArgs }; } return c; diff --git a/deployment/helpers/evm.ts b/deployment/helpers/evm.ts index 100c3e3f..7c2d6512 100644 --- a/deployment/helpers/evm.ts +++ b/deployment/helpers/evm.ts @@ -2,8 +2,6 @@ import { LedgerSigner } from "@xlabs-xyz/ledger-signer"; import { ethers } from "ethers"; import { ChainInfo, ecosystemChains, EvmScriptCb, getEnv } from "./index"; -export const ETHEREUM_ADDRESS_LENGTH = 40; - export async function runOnEvms(scriptName: string, cb: EvmScriptCb) { const chains = evmOperatingChains(); diff --git a/deployment/helpers/interfaces.ts b/deployment/helpers/interfaces.ts index f02ad335..83c7c1d0 100644 --- a/deployment/helpers/interfaces.ts +++ b/deployment/helpers/interfaces.ts @@ -1,4 +1,3 @@ -import { ChainId } from "@certusone/wormhole-sdk"; import { ethers } from "ethers"; export type EvmScriptCb = (chain: ChainInfo, signer: ethers.Signer, logFn: LoggerFn) => Promise; @@ -7,14 +6,16 @@ export type LoggerFn = (...args: any[]) => void; export type ChainInfo = { name: string; - chainId: ChainId; + chainId: number; // EVM ChainId rpc: string; + type: "Mainnet" | "Testnet" | "Devnet"; externalId?: string; }; export type Deployment = { - chainId: ChainId; + chainId: number; // EVM ChainId address: string; + constructorArgs?: any[]; }; export type Ecosystem = { @@ -31,17 +32,14 @@ export type Ecosystem = { export type ContractsJson = Record; export interface ChainConfig { - chainId: ChainId; + chainId: number; // EVM ChainId } -export type DependenciesJson = [ - { - chainId: ChainId; +export interface Dependencies extends ChainConfig { wormhole: string; token: string; tokenMessenger: string; - } -]; +}; export interface ValueDiff { onChain: any; diff --git a/deployment/helpers/utils.ts b/deployment/helpers/utils.ts index aa98a3e5..3d02dbe7 100644 --- a/deployment/helpers/utils.ts +++ b/deployment/helpers/utils.ts @@ -1,16 +1,15 @@ import chalk from 'chalk'; -import { ETHEREUM_ADDRESS_LENGTH, LoggerFn, ValueDiff } from '.'; -import { ChainId } from '@certusone/wormhole-sdk'; +import { LoggerFn, ValueDiff, getEnv } from '.'; +import { ChainId } from "@wormhole-foundation/sdk-base"; import { RouterEndpointConfig } from '../config/config-types'; -import { ethers } from 'ethers'; -import bs58 from 'bs58'; +import { UniversalAddress } from '@wormhole-foundation/sdk-definitions'; -export const someoneIsDifferent = (values: ValueDiff[]) => values.some((value) => value.onChain.toString() !== value.offChain.toString()); +export const someoneIsDifferent = (values: ValueDiff[]) => values.some((value) => value.onChain.toString() !== value.offChain.toString() && Number(value.onChain) !== Number(value.offChain)); export function logComparision(name: string, diffValues: any, log: LoggerFn) { // If the values are the same, do nothing - if (diffValues.onChain.toString() === diffValues.offChain.toString()) + if (diffValues.onChain.toString() === diffValues.offChain.toString() || Number(diffValues.onChain) === Number(diffValues.offChain)) return; // If the on chain value is not present or it is zero value, log it as an addition @@ -29,20 +28,16 @@ export function logComparision(name: string, diffValues: any, log: LoggerFn) { } } -export function getAddressAsBytes32(address: string): string { +// Assuming that we'll only have two types of addresses: Ethereum and Solana +export function getAddressType(address: string): 'hex' | 'base58' { + const ETHEREUM_ADDRESS_LENGTH = 40; const addressLength = address.length - (address.startsWith("0x") ? 2 : 0); - // Solana address - if (addressLength > ETHEREUM_ADDRESS_LENGTH) { - const bytes = bs58.decode(address); - address = "0x" + Buffer.from(bytes).toString('hex'); - } - // Ethereum address - else { - address = ethers.utils.defaultAbiCoder.encode(["address"], [address]); - } + // TODO: check lenght of solana addresses + if (address.length < ETHEREUM_ADDRESS_LENGTH) + throw new Error(`Invalid address length: ${address}`); - return address; + return addressLength === ETHEREUM_ADDRESS_LENGTH ? 'hex' : 'base58'; } // Router endpoint helpers @@ -52,8 +47,8 @@ export function getRouterEndpointDifferences(onChainRouterEndpoints: RouterEndpo let onChainIndex = 0; let offChainIndex = 0; - onChainRouterEndpoints = onChainRouterEndpoints.sort((a, b) => a.chainId - b.chainId); - offChainRouterEndpoints = offChainRouterEndpoints.sort((a, b) => a.chainId - b.chainId); + onChainRouterEndpoints = onChainRouterEndpoints.sort((a, b) => a.wormholeChainId - b.wormholeChainId); + offChainRouterEndpoints = offChainRouterEndpoints.sort((a, b) => a.wormholeChainId - b.wormholeChainId); while (true) { const onChainEndpoint = onChainRouterEndpoints[onChainIndex]; @@ -66,9 +61,9 @@ export function getRouterEndpointDifferences(onChainRouterEndpoints: RouterEndpo // If we've reached the end of offChainEndpoints, add the remaining onChainEndpoints // or if the onChainEndpoint is less than the offChainEndpoint, add the onChainEndpoint - if (!offChainEndpoint || onChainEndpoint?.chainId < offChainEndpoint?.chainId) { + if (!offChainEndpoint || onChainEndpoint?.wormholeChainId < offChainEndpoint?.wormholeChainId) { routerEndpointsDifferences.push( - routerEndpointConfig(onChainEndpoint.chainId, onChainEndpoint, {}) + routerEndpointConfig(onChainEndpoint.wormholeChainId, onChainEndpoint, {}) ); onChainIndex++; continue; @@ -76,16 +71,16 @@ export function getRouterEndpointDifferences(onChainRouterEndpoints: RouterEndpo // If we've reached the end of onChainEndpoints, add the remaining offChainEndpoints // or if the offChainEndpoint is less than the onChainEndpoint, add the offChainEndpoint - if (!onChainEndpoint || onChainEndpoint?.chainId > offChainEndpoint?.chainId) { + if (!onChainEndpoint || onChainEndpoint?.wormholeChainId > offChainEndpoint?.wormholeChainId) { routerEndpointsDifferences.push( - routerEndpointConfig(offChainEndpoint.chainId, {}, offChainEndpoint) + routerEndpointConfig(offChainEndpoint.wormholeChainId, {}, offChainEndpoint) ); offChainIndex++; continue; } routerEndpointsDifferences.push( - routerEndpointConfig(onChainEndpoint.chainId, onChainEndpoint, offChainEndpoint) + routerEndpointConfig(onChainEndpoint.wormholeChainId, onChainEndpoint, offChainEndpoint) ); onChainIndex++; @@ -95,18 +90,47 @@ export function getRouterEndpointDifferences(onChainRouterEndpoints: RouterEndpo return routerEndpointsDifferences; } -const routerEndpointConfig = (chainId: ChainId, onChain: Partial, offChain: Partial) => ({ - chainId, +const routerEndpointConfig = (wormholeChainId: ChainId, onChain: Partial, offChain: Partial) => ({ + wormholeChainId, router: { onChain: onChain?.endpoint?.router, - offChain: offChain?.endpoint?.router ? getAddressAsBytes32(offChain?.endpoint?.router as string) : undefined + offChain: offChain?.endpoint?.router }, mintRecipient: { onChain: onChain?.endpoint?.mintRecipient, - offChain: offChain?.endpoint?.mintRecipient ? getAddressAsBytes32(offChain?.endpoint?.mintRecipient as string) : undefined + offChain: offChain?.endpoint?.mintRecipient }, circleDomain: { onChain: onChain?.circleDomain, offChain: offChain?.circleDomain } -}); \ No newline at end of file +}); + +export function getFormattedEndpoint(router: string, mintRecipient: string) { + const routerAddresType = getAddressType(router); + const mintRecipientAddressType = getAddressType(mintRecipient); + + return { + router: (new UniversalAddress(router, routerAddresType)).toString(), + mintRecipient: (new UniversalAddress(mintRecipient, mintRecipientAddressType)).toString() + }; +} + +/// Verify bytecode helper + +export function getVerifyCommand( + contractName: string, + contractPath: string, + contractAddress: string, + constructorSignature: string, + constructorArgs: any[], + EvmChainId: number +): string { + const ETHERSCAN_API_KEY = getEnv("ETHERSCAN_API_KEY"); + return ` + forge verify-contract ${contractAddress} ${contractPath}:${contractName} \ + --watch --constructor-args $(cast abi-encode "${constructorSignature}" "${constructorArgs.join('" "')}") \ + --chain-id ${EvmChainId} \ + --etherscan-api-key ${ETHERSCAN_API_KEY} \ + `; +} \ No newline at end of file diff --git a/deployment/package-lock.json b/deployment/package-lock.json index 0cf7bd02..bd8802b5 100644 --- a/deployment/package-lock.json +++ b/deployment/package-lock.json @@ -6,13 +6,13 @@ "": { "name": "deployment", "devDependencies": { - "@certusone/wormhole-sdk": "^0.10.11", "@inquirer/confirm": "^3.1.9", "@solana/web3.js": "^1.92.2", "@typechain/ethers-v5": "^11.1.2", "@types/node": "^20.11.22", + "@wormhole-foundation/sdk-base": "^0.7.0", + "@wormhole-foundation/sdk-definitions": "^0.7.0", "@xlabs-xyz/ledger-signer": "^0.0.4", - "bs58": "^5.0.0", "chalk": "^4.1.2", "dotenv": "^16.4.5", "ethers": "^5.7.2", @@ -21,50 +21,6 @@ "typescript": "^5.4.5" } }, - "node_modules/@apollo/client": { - "version": "3.10.3", - "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.10.3.tgz", - "integrity": "sha512-4EIgZnFmRO1laWv3NCxlVIxcvimG63djuAXvyXhpQH3wkNMv9SykrasKRN08+z+cn/fVisBOLmkSRdyNyP9f4A==", - "dev": true, - "optional": true, - "dependencies": { - "@graphql-typed-document-node/core": "^3.1.1", - "@wry/caches": "^1.0.0", - "@wry/equality": "^0.5.6", - "@wry/trie": "^0.5.0", - "graphql-tag": "^2.12.6", - "hoist-non-react-statics": "^3.3.2", - "optimism": "^0.18.0", - "prop-types": "^15.7.2", - "rehackt": "^0.1.0", - "response-iterator": "^0.2.6", - "symbol-observable": "^4.0.0", - "ts-invariant": "^0.10.3", - "tslib": "^2.3.0", - "zen-observable-ts": "^1.2.5" - }, - "peerDependencies": { - "graphql": "^15.0.0 || ^16.0.0", - "graphql-ws": "^5.5.5", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", - "subscriptions-transport-ws": "^0.9.0 || ^0.11.0" - }, - "peerDependenciesMeta": { - "graphql-ws": { - "optional": true - }, - "react": { - "optional": true - }, - "react-dom": { - "optional": true - }, - "subscriptions-transport-ws": { - "optional": true - } - } - }, "node_modules/@babel/runtime": { "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", @@ -77,372 +33,6 @@ "node": ">=6.9.0" } }, - "node_modules/@certusone/wormhole-sdk": { - "version": "0.10.15", - "resolved": "https://registry.npmjs.org/@certusone/wormhole-sdk/-/wormhole-sdk-0.10.15.tgz", - "integrity": "sha512-XECfrvdYjsGPZWyR1bqWCPOiRw7+6upszpSvAXjKIqEnTNXOCYRkt5ae8TVh5oZxPjpts2X3t4Oi9WGcEssHpQ==", - "dev": true, - "dependencies": { - "@certusone/wormhole-sdk-proto-web": "0.0.7", - "@certusone/wormhole-sdk-wasm": "^0.0.1", - "@coral-xyz/borsh": "0.2.6", - "@mysten/sui.js": "0.32.2", - "@project-serum/anchor": "^0.25.0", - "@solana/spl-token": "^0.3.5", - "@solana/web3.js": "^1.66.2", - "@terra-money/terra.js": "3.1.9", - "@xpla/xpla.js": "^0.2.1", - "algosdk": "^2.4.0", - "aptos": "1.5.0", - "axios": "^0.24.0", - "bech32": "^2.0.0", - "binary-parser": "^2.2.1", - "bs58": "^4.0.1", - "elliptic": "^6.5.4", - "js-base64": "^3.6.1", - "near-api-js": "^1.0.0" - }, - "optionalDependencies": { - "@injectivelabs/networks": "1.10.12", - "@injectivelabs/sdk-ts": "1.10.72", - "@injectivelabs/utils": "1.10.12" - } - }, - "node_modules/@certusone/wormhole-sdk-proto-web": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@certusone/wormhole-sdk-proto-web/-/wormhole-sdk-proto-web-0.0.7.tgz", - "integrity": "sha512-GCe1/bcqMS0Mt+hsWp4SE4NLL59pWmK0lhQXO0oqAKl0G9AuuTdudySMDF/sLc7z5H2w34bSuSrIEKvPuuSC+w==", - "dev": true, - "dependencies": { - "@improbable-eng/grpc-web": "^0.15.0", - "protobufjs": "^7.0.0", - "rxjs": "^7.5.6" - } - }, - "node_modules/@certusone/wormhole-sdk-wasm": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@certusone/wormhole-sdk-wasm/-/wormhole-sdk-wasm-0.0.1.tgz", - "integrity": "sha512-LdIwLhOyr4pPs2jqYubqC7d4UkqYBX0EG/ppspQlW3qlVE0LZRMrH6oVzzLMyHtV0Rw7O9sIKzORW/T3mrJv2w==", - "dev": true, - "dependencies": { - "@types/long": "^4.0.2", - "@types/node": "^18.0.3" - } - }, - "node_modules/@certusone/wormhole-sdk-wasm/node_modules/@types/node": { - "version": "18.19.33", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.33.tgz", - "integrity": "sha512-NR9+KrpSajr2qBVp/Yt5TU/rp+b5Mayi3+OlMlcg2cVCfRmcG5PWZ7S4+MG9PZ5gWBoc9Pd0BKSRViuBCRPu0A==", - "dev": true, - "dependencies": { - "undici-types": "~5.26.4" - } - }, - "node_modules/@certusone/wormhole-sdk/node_modules/bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", - "dev": true, - "dependencies": { - "base-x": "^3.0.2" - } - }, - "node_modules/@classic-terra/terra.proto": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@classic-terra/terra.proto/-/terra.proto-1.1.0.tgz", - "integrity": "sha512-bYhQG5LUaGF0KPRY9hYT/HEcd1QExZPQd6zLV/rQkCe/eDxfwFRLzZHpaaAdfWoAAZjsRWqJbUCqCg7gXBbJpw==", - "dev": true, - "dependencies": { - "@improbable-eng/grpc-web": "^0.14.1", - "google-protobuf": "^3.17.3", - "long": "^4.0.0", - "protobufjs": "~6.11.2" - } - }, - "node_modules/@classic-terra/terra.proto/node_modules/@improbable-eng/grpc-web": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.14.1.tgz", - "integrity": "sha512-XaIYuunepPxoiGVLLHmlnVminUGzBTnXr8Wv7khzmLWbNw4TCwJKX09GSMJlKhu/TRk6gms0ySFxewaETSBqgw==", - "dev": true, - "dependencies": { - "browser-headers": "^0.4.1" - }, - "peerDependencies": { - "google-protobuf": "^3.14.0" - } - }, - "node_modules/@classic-terra/terra.proto/node_modules/protobufjs": { - "version": "6.11.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", - "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" - } - }, - "node_modules/@confio/ics23": { - "version": "0.6.8", - "resolved": "https://registry.npmjs.org/@confio/ics23/-/ics23-0.6.8.tgz", - "integrity": "sha512-wB6uo+3A50m0sW/EWcU64xpV/8wShZ6bMTa7pF8eYsTrSkQA7oLUIJcs/wb8g4y2Oyq701BaGiO6n/ak5WXO1w==", - "dev": true, - "optional": true, - "dependencies": { - "@noble/hashes": "^1.0.0", - "protobufjs": "^6.8.8" - } - }, - "node_modules/@confio/ics23/node_modules/protobufjs": { - "version": "6.11.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", - "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" - } - }, - "node_modules/@coral-xyz/borsh": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/@coral-xyz/borsh/-/borsh-0.2.6.tgz", - "integrity": "sha512-y6nmHw1bFcJib7sMHsQPpC8r47xhqDZVvhUdna7NUPzpSbOZG6f46N21+aXsQ2w/tG8Ggls488J/ZmwbgVmyjg==", - "dev": true, - "dependencies": { - "bn.js": "^5.1.2", - "buffer-layout": "^1.2.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@solana/web3.js": "^1.2.0" - } - }, - "node_modules/@cosmjs/amino": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.30.1.tgz", - "integrity": "sha512-yNHnzmvAlkETDYIpeCTdVqgvrdt1qgkOXwuRVi8s27UKI5hfqyE9fJ/fuunXE6ZZPnKkjIecDznmuUOMrMvw4w==", - "dev": true, - "optional": true, - "dependencies": { - "@cosmjs/crypto": "^0.30.1", - "@cosmjs/encoding": "^0.30.1", - "@cosmjs/math": "^0.30.1", - "@cosmjs/utils": "^0.30.1" - } - }, - "node_modules/@cosmjs/crypto": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.30.1.tgz", - "integrity": "sha512-rAljUlake3MSXs9xAm87mu34GfBLN0h/1uPPV6jEwClWjNkAMotzjC0ab9MARy5FFAvYHL3lWb57bhkbt2GtzQ==", - "dev": true, - "optional": true, - "dependencies": { - "@cosmjs/encoding": "^0.30.1", - "@cosmjs/math": "^0.30.1", - "@cosmjs/utils": "^0.30.1", - "@noble/hashes": "^1", - "bn.js": "^5.2.0", - "elliptic": "^6.5.4", - "libsodium-wrappers": "^0.7.6" - } - }, - "node_modules/@cosmjs/encoding": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.30.1.tgz", - "integrity": "sha512-rXmrTbgqwihORwJ3xYhIgQFfMSrwLu1s43RIK9I8EBudPx3KmnmyAKzMOVsRDo9edLFNuZ9GIvysUCwQfq3WlQ==", - "dev": true, - "optional": true, - "dependencies": { - "base64-js": "^1.3.0", - "bech32": "^1.1.4", - "readonly-date": "^1.0.0" - } - }, - "node_modules/@cosmjs/encoding/node_modules/bech32": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", - "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", - "dev": true, - "optional": true - }, - "node_modules/@cosmjs/json-rpc": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.30.1.tgz", - "integrity": "sha512-pitfC/2YN9t+kXZCbNuyrZ6M8abnCC2n62m+JtU9vQUfaEtVsgy+1Fk4TRQ175+pIWSdBMFi2wT8FWVEE4RhxQ==", - "dev": true, - "optional": true, - "dependencies": { - "@cosmjs/stream": "^0.30.1", - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/math": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.30.1.tgz", - "integrity": "sha512-yaoeI23pin9ZiPHIisa6qqLngfnBR/25tSaWpkTm8Cy10MX70UF5oN4+/t1heLaM6SSmRrhk3psRkV4+7mH51Q==", - "dev": true, - "optional": true, - "dependencies": { - "bn.js": "^5.2.0" - } - }, - "node_modules/@cosmjs/proto-signing": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.30.1.tgz", - "integrity": "sha512-tXh8pPYXV4aiJVhTKHGyeZekjj+K9s2KKojMB93Gcob2DxUjfKapFYBMJSgfKPuWUPEmyr8Q9km2hplI38ILgQ==", - "dev": true, - "optional": true, - "dependencies": { - "@cosmjs/amino": "^0.30.1", - "@cosmjs/crypto": "^0.30.1", - "@cosmjs/encoding": "^0.30.1", - "@cosmjs/math": "^0.30.1", - "@cosmjs/utils": "^0.30.1", - "cosmjs-types": "^0.7.1", - "long": "^4.0.0" - } - }, - "node_modules/@cosmjs/socket": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.30.1.tgz", - "integrity": "sha512-r6MpDL+9N+qOS/D5VaxnPaMJ3flwQ36G+vPvYJsXArj93BjgyFB7BwWwXCQDzZ+23cfChPUfhbINOenr8N2Kow==", - "dev": true, - "optional": true, - "dependencies": { - "@cosmjs/stream": "^0.30.1", - "isomorphic-ws": "^4.0.1", - "ws": "^7", - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/stargate": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.30.1.tgz", - "integrity": "sha512-RdbYKZCGOH8gWebO7r6WvNnQMxHrNXInY/gPHPzMjbQF6UatA6fNM2G2tdgS5j5u7FTqlCI10stNXrknaNdzog==", - "dev": true, - "optional": true, - "dependencies": { - "@confio/ics23": "^0.6.8", - "@cosmjs/amino": "^0.30.1", - "@cosmjs/encoding": "^0.30.1", - "@cosmjs/math": "^0.30.1", - "@cosmjs/proto-signing": "^0.30.1", - "@cosmjs/stream": "^0.30.1", - "@cosmjs/tendermint-rpc": "^0.30.1", - "@cosmjs/utils": "^0.30.1", - "cosmjs-types": "^0.7.1", - "long": "^4.0.0", - "protobufjs": "~6.11.3", - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/stargate/node_modules/protobufjs": { - "version": "6.11.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", - "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" - } - }, - "node_modules/@cosmjs/stream": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.30.1.tgz", - "integrity": "sha512-Fg0pWz1zXQdoxQZpdHRMGvUH5RqS6tPv+j9Eh7Q953UjMlrwZVo0YFLC8OTf/HKVf10E4i0u6aM8D69Q6cNkgQ==", - "dev": true, - "optional": true, - "dependencies": { - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/tendermint-rpc": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.30.1.tgz", - "integrity": "sha512-Z3nCwhXSbPZJ++v85zHObeUggrEHVfm1u18ZRwXxFE9ZMl5mXTybnwYhczuYOl7KRskgwlB+rID0WYACxj4wdQ==", - "dev": true, - "optional": true, - "dependencies": { - "@cosmjs/crypto": "^0.30.1", - "@cosmjs/encoding": "^0.30.1", - "@cosmjs/json-rpc": "^0.30.1", - "@cosmjs/math": "^0.30.1", - "@cosmjs/socket": "^0.30.1", - "@cosmjs/stream": "^0.30.1", - "@cosmjs/utils": "^0.30.1", - "axios": "^0.21.2", - "readonly-date": "^1.0.0", - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/tendermint-rpc/node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dev": true, - "optional": true, - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, - "node_modules/@cosmjs/utils": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.30.1.tgz", - "integrity": "sha512-KvvX58MGMWh7xA+N+deCfunkA/ZNDvFLw4YbOmX3f/XBIkqrVY7qlotfy2aNb1kgp6h4B6Yc8YawJPDTfvWX7g==", - "dev": true, - "optional": true - }, "node_modules/@esbuild/aix-ppc64": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", @@ -811,28 +401,6 @@ "node": ">=12" } }, - "node_modules/@ethereumjs/common": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.5.tgz", - "integrity": "sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA==", - "dev": true, - "optional": true, - "dependencies": { - "crc-32": "^1.2.0", - "ethereumjs-util": "^7.1.5" - } - }, - "node_modules/@ethereumjs/tx": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.2.tgz", - "integrity": "sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw==", - "dev": true, - "optional": true, - "dependencies": { - "@ethereumjs/common": "^2.6.4", - "ethereumjs-util": "^7.1.5" - } - }, "node_modules/@ethersproject/abi": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", @@ -1561,414 +1129,101 @@ "@ethersproject/strings": "^5.7.0" } }, - "node_modules/@graphql-typed-document-node/core": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", - "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", - "dev": true, - "optional": true, - "peerDependencies": { - "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" - } - }, - "node_modules/@improbable-eng/grpc-web": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.15.0.tgz", - "integrity": "sha512-ERft9/0/8CmYalqOVnJnpdDry28q+j+nAlFFARdjyxXDJ+Mhgv9+F600QC8BR9ygOfrXRlAk6CvST2j+JCpQPg==", + "node_modules/@inquirer/confirm": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-3.1.9.tgz", + "integrity": "sha512-UF09aejxCi4Xqm6N/jJAiFXArXfi9al52AFaSD+2uIHnhZGtd1d6lIGTRMPouVSJxbGEi+HkOWSYaiEY/+szUw==", "dev": true, "dependencies": { - "browser-headers": "^0.4.1" + "@inquirer/core": "^8.2.2", + "@inquirer/type": "^1.3.3" }, - "peerDependencies": { - "google-protobuf": "^3.14.0" - } - }, - "node_modules/@injectivelabs/core-proto-ts": { - "version": "0.0.14", - "resolved": "https://registry.npmjs.org/@injectivelabs/core-proto-ts/-/core-proto-ts-0.0.14.tgz", - "integrity": "sha512-NZWlgBzgVrXow9IknFQHvcYKX4QkUD25taRigoNYQK8PDn4+VXd9xM5WFUDRhzm2smTCguyl/+MghpEp4oTPWw==", - "dev": true, - "optional": true, - "dependencies": { - "@injectivelabs/grpc-web": "^0.0.1", - "google-protobuf": "^3.14.0", - "protobufjs": "^7.0.0", - "rxjs": "^7.4.0" + "engines": { + "node": ">=18" } }, - "node_modules/@injectivelabs/exceptions": { - "version": "1.14.6", - "resolved": "https://registry.npmjs.org/@injectivelabs/exceptions/-/exceptions-1.14.6.tgz", - "integrity": "sha512-A+URJwygeDjFPhulGMNVw70z738NtpIiCr0W8q4Kr4Ggg30i+AaVAjViYLm56pSMXXpomu9CYJ/sY6ijQn48IQ==", + "node_modules/@inquirer/core": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-8.2.2.tgz", + "integrity": "sha512-K8SuNX45jEFlX3EBJpu9B+S2TISzMPGXZIuJ9ME924SqbdW6Pt6fIkKvXg7mOEOKJ4WxpQsxj0UTfcL/A434Ww==", "dev": true, - "hasInstallScript": true, - "optional": true, "dependencies": { - "@injectivelabs/grpc-web": "^0.0.1", - "@injectivelabs/ts-types": "^1.14.6", - "http-status-codes": "^2.2.0", - "link-module-alias": "^1.2.0", - "shx": "^0.3.2" + "@inquirer/figures": "^1.0.3", + "@inquirer/type": "^1.3.3", + "@types/mute-stream": "^0.0.4", + "@types/node": "^20.12.13", + "@types/wrap-ansi": "^3.0.0", + "ansi-escapes": "^4.3.2", + "chalk": "^4.1.2", + "cli-spinners": "^2.9.2", + "cli-width": "^4.1.0", + "mute-stream": "^1.0.0", + "signal-exit": "^4.1.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^6.2.0" + }, + "engines": { + "node": ">=18" } }, - "node_modules/@injectivelabs/grpc-web": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@injectivelabs/grpc-web/-/grpc-web-0.0.1.tgz", - "integrity": "sha512-Pu5YgaZp+OvR5UWfqbrPdHer3+gDf+b5fQoY+t2VZx1IAVHX8bzbN9EreYTvTYtFeDpYRWM8P7app2u4EX5wTw==", + "node_modules/@inquirer/core/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, - "optional": true, "dependencies": { - "browser-headers": "^0.4.1" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, - "peerDependencies": { - "google-protobuf": "^3.14.0" + "engines": { + "node": ">=8" } }, - "node_modules/@injectivelabs/grpc-web-node-http-transport": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@injectivelabs/grpc-web-node-http-transport/-/grpc-web-node-http-transport-0.0.2.tgz", - "integrity": "sha512-rpyhXLiGY/UMs6v6YmgWHJHiO9l0AgDyVNv+jcutNVt4tQrmNvnpvz2wCAGOFtq5LuX/E9ChtTVpk3gWGqXcGA==", + "node_modules/@inquirer/figures": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.3.tgz", + "integrity": "sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==", "dev": true, - "optional": true, - "peerDependencies": { - "@injectivelabs/grpc-web": ">=0.0.1" + "engines": { + "node": ">=18" } }, - "node_modules/@injectivelabs/grpc-web-react-native-transport": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@injectivelabs/grpc-web-react-native-transport/-/grpc-web-react-native-transport-0.0.2.tgz", - "integrity": "sha512-mk+aukQXnYNgPsPnu3KBi+FD0ZHQpazIlaBZ2jNZG7QAVmxTWtv3R66Zoq99Wx2dnE946NsZBYAoa0K5oSjnow==", + "node_modules/@inquirer/type": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-1.3.3.tgz", + "integrity": "sha512-xTUt0NulylX27/zMx04ZYar/kr1raaiFTVvQ5feljQsiAgdm0WPj4S73/ye0fbslh+15QrIuDvfCXTek7pMY5A==", "dev": true, - "optional": true, - "peerDependencies": { - "@injectivelabs/grpc-web": ">=0.0.1" + "engines": { + "node": ">=18" } }, - "node_modules/@injectivelabs/indexer-proto-ts": { - "version": "1.10.8-rc.4", - "resolved": "https://registry.npmjs.org/@injectivelabs/indexer-proto-ts/-/indexer-proto-ts-1.10.8-rc.4.tgz", - "integrity": "sha512-IwbepTfsHHAv3Z36As6yH/+HIplOEpUu6SFHBCVgdSIaQ8GuvTib4HETiVnV4mjYqoyVgWs+zLSAfih46rdMJQ==", + "node_modules/@ledgerhq/cryptoassets": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/cryptoassets/-/cryptoassets-12.1.0.tgz", + "integrity": "sha512-KF9J0X5qmEpHyAy9FphAmDsuodQN/UA3xmjqBhmBSELt/8tAUHHWNOeEV4TfuJLmk2HzXF730aH+61lvVvIUVw==", "dev": true, - "optional": true, "dependencies": { - "@injectivelabs/grpc-web": "^0.0.1", - "google-protobuf": "^3.14.0", - "protobufjs": "^7.0.0", - "rxjs": "^7.4.0" + "axios": "^1.6.0", + "bs58check": "^2.1.2", + "invariant": "2" } }, - "node_modules/@injectivelabs/mito-proto-ts": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@injectivelabs/mito-proto-ts/-/mito-proto-ts-1.0.9.tgz", - "integrity": "sha512-+TZMvJ4SHwcn6SFPdqaiQFZdNhjH7hyRFozY15nOTC2utdGij9jEsjz1NsyOejfYDA0s1z5Wm1SgrMYKaVpAmQ==", + "node_modules/@ledgerhq/cryptoassets/node_modules/axios": { + "version": "1.6.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", + "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", "dev": true, - "optional": true, "dependencies": { - "@injectivelabs/grpc-web": "^0.0.1", - "google-protobuf": "^3.14.0", - "protobufjs": "^7.0.0", - "rxjs": "^7.4.0" + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" } }, - "node_modules/@injectivelabs/networks": { - "version": "1.10.12", - "resolved": "https://registry.npmjs.org/@injectivelabs/networks/-/networks-1.10.12.tgz", - "integrity": "sha512-tTHyLls1Nik5QTs/S03qqG2y/ITvNwI8CJOQbMmmsr1CL2CdjJBtzRYn9Dyx2p8XgzRFf9hmlybpe20tq9O3SA==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "dependencies": { - "@injectivelabs/exceptions": "^1.10.12", - "@injectivelabs/ts-types": "^1.10.12", - "@injectivelabs/utils": "^1.10.12", - "link-module-alias": "^1.2.0", - "shx": "^0.3.2" - } - }, - "node_modules/@injectivelabs/sdk-ts": { - "version": "1.10.72", - "resolved": "https://registry.npmjs.org/@injectivelabs/sdk-ts/-/sdk-ts-1.10.72.tgz", - "integrity": "sha512-A5mHNNBgO4fI1c/7CZ0bGfVXliy8laP+VaYZ++aWh1YyudoZw4CTCEmLetZRy7AUU3XcfbHa8sAImRi7db+v6Q==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "dependencies": { - "@apollo/client": "^3.5.8", - "@cosmjs/amino": "^0.30.1", - "@cosmjs/proto-signing": "^0.30.1", - "@cosmjs/stargate": "^0.30.1", - "@ethersproject/bytes": "^5.7.0", - "@injectivelabs/core-proto-ts": "^0.0.14", - "@injectivelabs/exceptions": "^1.10.12", - "@injectivelabs/grpc-web": "^0.0.1", - "@injectivelabs/grpc-web-node-http-transport": "^0.0.2", - "@injectivelabs/grpc-web-react-native-transport": "^0.0.2", - "@injectivelabs/indexer-proto-ts": "1.10.8-rc.4", - "@injectivelabs/mito-proto-ts": "1.0.9", - "@injectivelabs/networks": "^1.10.12", - "@injectivelabs/test-utils": "^1.10.12", - "@injectivelabs/token-metadata": "^1.10.42", - "@injectivelabs/ts-types": "^1.10.12", - "@injectivelabs/utils": "^1.10.12", - "@metamask/eth-sig-util": "^4.0.0", - "axios": "^0.27.2", - "bech32": "^2.0.0", - "bip39": "^3.0.4", - "cosmjs-types": "^0.7.1", - "eth-crypto": "^2.6.0", - "ethereumjs-util": "^7.1.4", - "ethers": "^5.7.2", - "google-protobuf": "^3.21.0", - "graphql": "^16.3.0", - "http-status-codes": "^2.2.0", - "js-sha3": "^0.8.0", - "jscrypto": "^1.0.3", - "keccak256": "^1.0.6", - "link-module-alias": "^1.2.0", - "rxjs": "^7.8.0", - "secp256k1": "^4.0.3", - "shx": "^0.3.2", - "snakecase-keys": "^5.4.1" - } - }, - "node_modules/@injectivelabs/sdk-ts/node_modules/axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", - "dev": true, - "optional": true, - "dependencies": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" - } - }, - "node_modules/@injectivelabs/test-utils": { - "version": "1.14.4", - "resolved": "https://registry.npmjs.org/@injectivelabs/test-utils/-/test-utils-1.14.4.tgz", - "integrity": "sha512-M7UoB5CIVVN7BtdmU26GwZsWKp0BQg9qV5a+YvcdhlwlSIkvt3gKVKBMq/vKClCakOu2AjhCVGDMZVnagIBogg==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "dependencies": { - "axios": "^0.21.1", - "bignumber.js": "^9.0.1", - "link-module-alias": "^1.2.0", - "shx": "^0.3.2", - "snakecase-keys": "^5.1.2", - "store2": "^2.12.0" - } - }, - "node_modules/@injectivelabs/test-utils/node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dev": true, - "optional": true, - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, - "node_modules/@injectivelabs/token-metadata": { - "version": "1.14.7", - "resolved": "https://registry.npmjs.org/@injectivelabs/token-metadata/-/token-metadata-1.14.7.tgz", - "integrity": "sha512-RRRuyirzoThwQ5P8D3STH2YOavGsdnetQy6ZPQ8yA7VUavt00KBB26M92zSLbiUz5VrxhPHDCEEkuJVWx+xtmw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "dependencies": { - "@injectivelabs/exceptions": "^1.14.6", - "@injectivelabs/networks": "^1.14.6", - "@injectivelabs/ts-types": "^1.14.6", - "@injectivelabs/utils": "^1.14.6", - "@types/lodash.values": "^4.3.6", - "copyfiles": "^2.4.1", - "jsonschema": "^1.4.0", - "link-module-alias": "^1.2.0", - "lodash": "^4.17.21", - "lodash.values": "^4.3.0", - "shx": "^0.3.2" - } - }, - "node_modules/@injectivelabs/token-metadata/node_modules/@injectivelabs/networks": { - "version": "1.14.6", - "resolved": "https://registry.npmjs.org/@injectivelabs/networks/-/networks-1.14.6.tgz", - "integrity": "sha512-O1IkPFJl8ThNL6N+k/9OimrgCYsSWQ8A1FtVMXSQge+0QRZsDKSpRmQRwE601otXXauO31nOUct5AaiWPffXVQ==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "dependencies": { - "@injectivelabs/exceptions": "^1.14.6", - "@injectivelabs/ts-types": "^1.14.6", - "@injectivelabs/utils": "^1.14.6", - "link-module-alias": "^1.2.0", - "shx": "^0.3.2" - } - }, - "node_modules/@injectivelabs/token-metadata/node_modules/@injectivelabs/utils": { - "version": "1.14.6", - "resolved": "https://registry.npmjs.org/@injectivelabs/utils/-/utils-1.14.6.tgz", - "integrity": "sha512-5I0h4GiLB5PPTl+g2lpevRP+WScvEbntdkoUQVtAdHewl4kutd5p1Kcnoi1Nvpq+sz5N/e9qtBIRuyxG38akOg==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "dependencies": { - "@injectivelabs/exceptions": "^1.14.6", - "@injectivelabs/ts-types": "^1.14.6", - "axios": "^0.21.1", - "bignumber.js": "^9.0.1", - "http-status-codes": "^2.2.0", - "link-module-alias": "^1.2.0", - "shx": "^0.3.2", - "snakecase-keys": "^5.1.2", - "store2": "^2.12.0" - } - }, - "node_modules/@injectivelabs/token-metadata/node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dev": true, - "optional": true, - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, - "node_modules/@injectivelabs/ts-types": { - "version": "1.14.6", - "resolved": "https://registry.npmjs.org/@injectivelabs/ts-types/-/ts-types-1.14.6.tgz", - "integrity": "sha512-/Ax5eCSfE9OhcyUc9wZk/LFKTYhIY9RJIaNT/n92rbHjXSfXRLSX+Bvk62vC9Ej+SEBPp77WYngtrePPA1HEgw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "dependencies": { - "link-module-alias": "^1.2.0", - "shx": "^0.3.2" - } - }, - "node_modules/@injectivelabs/utils": { - "version": "1.10.12", - "resolved": "https://registry.npmjs.org/@injectivelabs/utils/-/utils-1.10.12.tgz", - "integrity": "sha512-c8al79nxIJgV1cBAdW2TPDGldj/8gm5k0h5TIN/AJs8/AeIjpTwwVGfLY3QvPOpRsxuQ9CjBkTXrAcSL1wwkcw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "dependencies": { - "@injectivelabs/exceptions": "^1.10.12", - "@injectivelabs/ts-types": "^1.10.12", - "axios": "^0.21.1", - "bignumber.js": "^9.0.1", - "http-status-codes": "^2.2.0", - "link-module-alias": "^1.2.0", - "shx": "^0.3.2", - "snakecase-keys": "^5.1.2", - "store2": "^2.12.0" - } - }, - "node_modules/@injectivelabs/utils/node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dev": true, - "optional": true, - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, - "node_modules/@inquirer/confirm": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-3.1.9.tgz", - "integrity": "sha512-UF09aejxCi4Xqm6N/jJAiFXArXfi9al52AFaSD+2uIHnhZGtd1d6lIGTRMPouVSJxbGEi+HkOWSYaiEY/+szUw==", - "dev": true, - "dependencies": { - "@inquirer/core": "^8.2.2", - "@inquirer/type": "^1.3.3" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@inquirer/core": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-8.2.2.tgz", - "integrity": "sha512-K8SuNX45jEFlX3EBJpu9B+S2TISzMPGXZIuJ9ME924SqbdW6Pt6fIkKvXg7mOEOKJ4WxpQsxj0UTfcL/A434Ww==", - "dev": true, - "dependencies": { - "@inquirer/figures": "^1.0.3", - "@inquirer/type": "^1.3.3", - "@types/mute-stream": "^0.0.4", - "@types/node": "^20.12.13", - "@types/wrap-ansi": "^3.0.0", - "ansi-escapes": "^4.3.2", - "chalk": "^4.1.2", - "cli-spinners": "^2.9.2", - "cli-width": "^4.1.0", - "mute-stream": "^1.0.0", - "signal-exit": "^4.1.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^6.2.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@inquirer/core/node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@inquirer/figures": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.3.tgz", - "integrity": "sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==", - "dev": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/@inquirer/type": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-1.3.3.tgz", - "integrity": "sha512-xTUt0NulylX27/zMx04ZYar/kr1raaiFTVvQ5feljQsiAgdm0WPj4S73/ye0fbslh+15QrIuDvfCXTek7pMY5A==", - "dev": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/@ledgerhq/cryptoassets": { - "version": "12.1.0", - "resolved": "https://registry.npmjs.org/@ledgerhq/cryptoassets/-/cryptoassets-12.1.0.tgz", - "integrity": "sha512-KF9J0X5qmEpHyAy9FphAmDsuodQN/UA3xmjqBhmBSELt/8tAUHHWNOeEV4TfuJLmk2HzXF730aH+61lvVvIUVw==", - "dev": true, - "dependencies": { - "axios": "^1.6.0", - "bs58check": "^2.1.2", - "invariant": "2" - } - }, - "node_modules/@ledgerhq/cryptoassets/node_modules/axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", - "dev": true, - "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, - "node_modules/@ledgerhq/devices": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-8.3.0.tgz", - "integrity": "sha512-h5Scr+yIae8yjPOViCHLdMjpqn4oC2Whrsq8LinRxe48LEGMdPqSV1yY7+3Ch827wtzNpMv+/ilKnd8rY+rTlg==", + "node_modules/@ledgerhq/devices": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-8.3.0.tgz", + "integrity": "sha512-h5Scr+yIae8yjPOViCHLdMjpqn4oC2Whrsq8LinRxe48LEGMdPqSV1yY7+3Ch827wtzNpMv+/ilKnd8rY+rTlg==", "dev": true, "dependencies": { "@ledgerhq/errors": "^6.16.4", @@ -2142,86 +1397,6 @@ "rxjs": "^7.8.1" } }, - "node_modules/@metamask/eth-sig-util": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz", - "integrity": "sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ==", - "dev": true, - "optional": true, - "dependencies": { - "ethereumjs-abi": "^0.6.8", - "ethereumjs-util": "^6.2.1", - "ethjs-util": "^0.1.6", - "tweetnacl": "^1.0.3", - "tweetnacl-util": "^0.15.1" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/@metamask/eth-sig-util/node_modules/@types/bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", - "dev": true, - "optional": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@metamask/eth-sig-util/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true, - "optional": true - }, - "node_modules/@metamask/eth-sig-util/node_modules/ethereumjs-util": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", - "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", - "dev": true, - "optional": true, - "dependencies": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - }, - "node_modules/@mysten/bcs": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@mysten/bcs/-/bcs-0.7.1.tgz", - "integrity": "sha512-wFPb8bkhwrbiStfZMV5rFM7J+umpke59/dNjDp+UYJKykNlW23LCk2ePyEUvGdb62HGJM1jyOJ8g4egE3OmdKA==", - "dev": true, - "dependencies": { - "bs58": "^5.0.0" - } - }, - "node_modules/@mysten/sui.js": { - "version": "0.32.2", - "resolved": "https://registry.npmjs.org/@mysten/sui.js/-/sui.js-0.32.2.tgz", - "integrity": "sha512-/Hm4xkGolJhqj8FvQr7QSHDTlxIvL52mtbOao9f75YjrBh7y1Uh9kbJSY7xiTF1NY9sv6p5hUVlYRJuM0Hvn9A==", - "dev": true, - "dependencies": { - "@mysten/bcs": "0.7.1", - "@noble/curves": "^1.0.0", - "@noble/hashes": "^1.3.0", - "@scure/bip32": "^1.3.0", - "@scure/bip39": "^1.2.0", - "@suchipi/femver": "^1.0.0", - "jayson": "^4.0.0", - "rpc-websockets": "^7.5.1", - "superstruct": "^1.0.3", - "tweetnacl": "^1.0.3" - }, - "engines": { - "node": ">=16" - } - }, "node_modules/@noble/curves": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.0.tgz", @@ -2240,332 +1415,31 @@ "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", "dev": true, "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@project-serum/anchor": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@project-serum/anchor/-/anchor-0.25.0.tgz", - "integrity": "sha512-E6A5Y/ijqpfMJ5psJvbw0kVTzLZFUcOFgs6eSM2M2iWE1lVRF18T6hWZVNl6zqZsoz98jgnNHtVGJMs+ds9A7A==", - "dev": true, - "dependencies": { - "@project-serum/borsh": "^0.2.5", - "@solana/web3.js": "^1.36.0", - "base64-js": "^1.5.1", - "bn.js": "^5.1.2", - "bs58": "^4.0.1", - "buffer-layout": "^1.2.2", - "camelcase": "^5.3.1", - "cross-fetch": "^3.1.5", - "crypto-hash": "^1.3.0", - "eventemitter3": "^4.0.7", - "js-sha256": "^0.9.0", - "pako": "^2.0.3", - "snake-case": "^3.0.4", - "superstruct": "^0.15.4", - "toml": "^3.0.0" - }, - "engines": { - "node": ">=11" - } - }, - "node_modules/@project-serum/anchor/node_modules/bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", - "dev": true, - "dependencies": { - "base-x": "^3.0.2" - } - }, - "node_modules/@project-serum/anchor/node_modules/superstruct": { - "version": "0.15.5", - "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.15.5.tgz", - "integrity": "sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ==", - "dev": true - }, - "node_modules/@project-serum/borsh": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/@project-serum/borsh/-/borsh-0.2.5.tgz", - "integrity": "sha512-UmeUkUoKdQ7rhx6Leve1SssMR/Ghv8qrEiyywyxSWg7ooV7StdpPBhciiy5eB3T0qU1BXvdRNC8TdrkxK7WC5Q==", - "dev": true, - "dependencies": { - "bn.js": "^5.1.2", - "buffer-layout": "^1.2.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@solana/web3.js": "^1.2.0" - } - }, - "node_modules/@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", - "dev": true - }, - "node_modules/@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", - "dev": true - }, - "node_modules/@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", - "dev": true - }, - "node_modules/@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", - "dev": true - }, - "node_modules/@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", - "dev": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "node_modules/@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", - "dev": true - }, - "node_modules/@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", - "dev": true - }, - "node_modules/@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", - "dev": true - }, - "node_modules/@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", - "dev": true - }, - "node_modules/@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", - "dev": true - }, - "node_modules/@scure/base": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.6.tgz", - "integrity": "sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g==", - "dev": true, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/bip32": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", - "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", - "dev": true, - "dependencies": { - "@noble/curves": "~1.4.0", - "@noble/hashes": "~1.4.0", - "@scure/base": "~1.1.6" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/bip39": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", - "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", - "dev": true, - "dependencies": { - "@noble/hashes": "~1.4.0", - "@scure/base": "~1.1.6" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@solana/buffer-layout": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz", - "integrity": "sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==", - "dev": true, - "dependencies": { - "buffer": "~6.0.3" - }, - "engines": { - "node": ">=5.10" - } - }, - "node_modules/@solana/buffer-layout-utils": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@solana/buffer-layout-utils/-/buffer-layout-utils-0.2.0.tgz", - "integrity": "sha512-szG4sxgJGktbuZYDg2FfNmkMi0DYQoVjN2h7ta1W1hPrwzarcFLBq9UpX1UjNXsNpT9dn+chgprtWGioUAr4/g==", - "dev": true, - "dependencies": { - "@solana/buffer-layout": "^4.0.0", - "@solana/web3.js": "^1.32.0", - "bigint-buffer": "^1.1.5", - "bignumber.js": "^9.0.1" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/@solana/codecs": { - "version": "2.0.0-preview.2", - "resolved": "https://registry.npmjs.org/@solana/codecs/-/codecs-2.0.0-preview.2.tgz", - "integrity": "sha512-4HHzCD5+pOSmSB71X6w9ptweV48Zj1Vqhe732+pcAQ2cMNnN0gMPMdDq7j3YwaZDZ7yrILVV/3+HTnfT77t2yA==", - "dev": true, - "dependencies": { - "@solana/codecs-core": "2.0.0-preview.2", - "@solana/codecs-data-structures": "2.0.0-preview.2", - "@solana/codecs-numbers": "2.0.0-preview.2", - "@solana/codecs-strings": "2.0.0-preview.2", - "@solana/options": "2.0.0-preview.2" - } - }, - "node_modules/@solana/codecs-core": { - "version": "2.0.0-preview.2", - "resolved": "https://registry.npmjs.org/@solana/codecs-core/-/codecs-core-2.0.0-preview.2.tgz", - "integrity": "sha512-gLhCJXieSCrAU7acUJjbXl+IbGnqovvxQLlimztPoGgfLQ1wFYu+XJswrEVQqknZYK1pgxpxH3rZ+OKFs0ndQg==", - "dev": true, - "dependencies": { - "@solana/errors": "2.0.0-preview.2" - } - }, - "node_modules/@solana/codecs-data-structures": { - "version": "2.0.0-preview.2", - "resolved": "https://registry.npmjs.org/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-preview.2.tgz", - "integrity": "sha512-Xf5vIfromOZo94Q8HbR04TbgTwzigqrKII0GjYr21K7rb3nba4hUW2ir8kguY7HWFBcjHGlU5x3MevKBOLp3Zg==", - "dev": true, - "dependencies": { - "@solana/codecs-core": "2.0.0-preview.2", - "@solana/codecs-numbers": "2.0.0-preview.2", - "@solana/errors": "2.0.0-preview.2" - } - }, - "node_modules/@solana/codecs-numbers": { - "version": "2.0.0-preview.2", - "resolved": "https://registry.npmjs.org/@solana/codecs-numbers/-/codecs-numbers-2.0.0-preview.2.tgz", - "integrity": "sha512-aLZnDTf43z4qOnpTcDsUVy1Ci9im1Md8thWipSWbE+WM9ojZAx528oAql+Cv8M8N+6ALKwgVRhPZkto6E59ARw==", - "dev": true, - "dependencies": { - "@solana/codecs-core": "2.0.0-preview.2", - "@solana/errors": "2.0.0-preview.2" - } - }, - "node_modules/@solana/codecs-strings": { - "version": "2.0.0-preview.2", - "resolved": "https://registry.npmjs.org/@solana/codecs-strings/-/codecs-strings-2.0.0-preview.2.tgz", - "integrity": "sha512-EgBwY+lIaHHgMJIqVOGHfIfpdmmUDNoNO/GAUGeFPf+q0dF+DtwhJPEMShhzh64X2MeCZcmSO6Kinx0Bvmmz2g==", - "dev": true, - "dependencies": { - "@solana/codecs-core": "2.0.0-preview.2", - "@solana/codecs-numbers": "2.0.0-preview.2", - "@solana/errors": "2.0.0-preview.2" - }, - "peerDependencies": { - "fastestsmallesttextencoderdecoder": "^1.0.22" - } - }, - "node_modules/@solana/errors": { - "version": "2.0.0-preview.2", - "resolved": "https://registry.npmjs.org/@solana/errors/-/errors-2.0.0-preview.2.tgz", - "integrity": "sha512-H2DZ1l3iYF5Rp5pPbJpmmtCauWeQXRJapkDg8epQ8BJ7cA2Ut/QEtC3CMmw/iMTcuS6uemFNLcWvlOfoQhvQuA==", - "dev": true, - "dependencies": { - "chalk": "^5.3.0", - "commander": "^12.0.0" - }, - "bin": { - "errors": "bin/cli.js" - } - }, - "node_modules/@solana/errors/node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "dev": true, - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@solana/options": { - "version": "2.0.0-preview.2", - "resolved": "https://registry.npmjs.org/@solana/options/-/options-2.0.0-preview.2.tgz", - "integrity": "sha512-FAHqEeH0cVsUOTzjl5OfUBw2cyT8d5Oekx4xcn5hn+NyPAfQJgM3CEThzgRD6Q/4mM5pVUnND3oK/Mt1RzSE/w==", - "dev": true, - "dependencies": { - "@solana/codecs-core": "2.0.0-preview.2", - "@solana/codecs-numbers": "2.0.0-preview.2" - } - }, - "node_modules/@solana/spl-token": { - "version": "0.3.11", - "resolved": "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.3.11.tgz", - "integrity": "sha512-bvohO3rIMSVL24Pb+I4EYTJ6cL82eFpInEXD/I8K8upOGjpqHsKUoAempR/RnUlI1qSFNyFlWJfu6MNUgfbCQQ==", - "dev": true, - "dependencies": { - "@solana/buffer-layout": "^4.0.0", - "@solana/buffer-layout-utils": "^0.2.0", - "@solana/spl-token-metadata": "^0.1.2", - "buffer": "^6.0.3" - }, - "engines": { - "node": ">=16" + "node": ">= 16" }, - "peerDependencies": { - "@solana/web3.js": "^1.88.0" + "funding": { + "url": "https://paulmillr.com/funding/" } }, - "node_modules/@solana/spl-token-metadata": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@solana/spl-token-metadata/-/spl-token-metadata-0.1.4.tgz", - "integrity": "sha512-N3gZ8DlW6NWDV28+vCCDJoTqaCZiF/jDUnk3o8GRkAFzHObiR60Bs1gXHBa8zCPdvOwiG6Z3dg5pg7+RW6XNsQ==", + "node_modules/@scure/base": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.6.tgz", + "integrity": "sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g==", "dev": true, - "dependencies": { - "@solana/codecs": "2.0.0-preview.2", - "@solana/spl-type-length-value": "0.1.0" - }, - "engines": { - "node": ">=16" - }, - "peerDependencies": { - "@solana/web3.js": "^1.91.6" + "funding": { + "url": "https://paulmillr.com/funding/" } }, - "node_modules/@solana/spl-type-length-value": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@solana/spl-type-length-value/-/spl-type-length-value-0.1.0.tgz", - "integrity": "sha512-JBMGB0oR4lPttOZ5XiUGyvylwLQjt1CPJa6qQ5oM+MBCndfjz2TKKkw0eATlLLcYmq1jBVsNlJ2cD6ns2GR7lA==", + "node_modules/@solana/buffer-layout": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz", + "integrity": "sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==", "dev": true, "dependencies": { - "buffer": "^6.0.3" + "buffer": "~6.0.3" }, "engines": { - "node": ">=16" + "node": ">=5.10" } }, "node_modules/@solana/web3.js": { @@ -2600,156 +1474,6 @@ "base-x": "^3.0.2" } }, - "node_modules/@suchipi/femver": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@suchipi/femver/-/femver-1.0.0.tgz", - "integrity": "sha512-bprE8+K5V+DPX7q2e2K57ImqNBdfGHDIWaGI5xHxZoxbKOuQZn4wzPiUxOAHnsUr3w3xHrWXwN7gnG/iIuEMIg==", - "dev": true - }, - "node_modules/@terra-money/legacy.proto": { - "name": "@terra-money/terra.proto", - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/@terra-money/terra.proto/-/terra.proto-0.1.7.tgz", - "integrity": "sha512-NXD7f6pQCulvo6+mv6MAPzhOkUzRjgYVuHZE/apih+lVnPG5hDBU0rRYnOGGofwvKT5/jQoOENnFn/gioWWnyQ==", - "dev": true, - "dependencies": { - "google-protobuf": "^3.17.3", - "long": "^4.0.0", - "protobufjs": "~6.11.2" - } - }, - "node_modules/@terra-money/legacy.proto/node_modules/protobufjs": { - "version": "6.11.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", - "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" - } - }, - "node_modules/@terra-money/terra.js": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/@terra-money/terra.js/-/terra.js-3.1.9.tgz", - "integrity": "sha512-JulSvOHLM56fL7s+cIjIbZeWPBluq883X1soWxA4TG5rKkDythT/DHeLXr3jP5Ld/26VENPSg6lNvK7cEYKpiw==", - "dev": true, - "dependencies": { - "@classic-terra/terra.proto": "^1.1.0", - "@terra-money/terra.proto": "^2.1.0", - "axios": "^0.27.2", - "bech32": "^2.0.0", - "bip32": "^2.0.6", - "bip39": "^3.0.3", - "bufferutil": "^4.0.3", - "decimal.js": "^10.2.1", - "jscrypto": "^1.0.1", - "readable-stream": "^3.6.0", - "secp256k1": "^4.0.2", - "tmp": "^0.2.1", - "utf-8-validate": "^5.0.5", - "ws": "^7.5.9" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@terra-money/terra.js/node_modules/axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", - "dev": true, - "dependencies": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" - } - }, - "node_modules/@terra-money/terra.js/node_modules/ws": { - "version": "7.5.9", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", - "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", - "dev": true, - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/@terra-money/terra.proto": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@terra-money/terra.proto/-/terra.proto-2.1.0.tgz", - "integrity": "sha512-rhaMslv3Rkr+QsTQEZs64FKA4QlfO0DfQHaR6yct/EovenMkibDEQ63dEL6yJA6LCaEQGYhyVB9JO9pTUA8ybw==", - "dev": true, - "dependencies": { - "@improbable-eng/grpc-web": "^0.14.1", - "google-protobuf": "^3.17.3", - "long": "^4.0.0", - "protobufjs": "~6.11.2" - } - }, - "node_modules/@terra-money/terra.proto/node_modules/@improbable-eng/grpc-web": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.14.1.tgz", - "integrity": "sha512-XaIYuunepPxoiGVLLHmlnVminUGzBTnXr8Wv7khzmLWbNw4TCwJKX09GSMJlKhu/TRk6gms0ySFxewaETSBqgw==", - "dev": true, - "dependencies": { - "browser-headers": "^0.4.1" - }, - "peerDependencies": { - "google-protobuf": "^3.14.0" - } - }, - "node_modules/@terra-money/terra.proto/node_modules/protobufjs": { - "version": "6.11.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", - "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" - } - }, "node_modules/@typechain/ethers-v5": { "version": "11.1.2", "resolved": "https://registry.npmjs.org/@typechain/ethers-v5/-/ethers-v5-11.1.2.tgz", @@ -2767,15 +1491,6 @@ "typescript": ">=4.3.0" } }, - "node_modules/@types/bn.js": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.1.tgz", - "integrity": "sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/connect": { "version": "3.4.38", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", @@ -2785,29 +1500,6 @@ "@types/node": "*" } }, - "node_modules/@types/lodash": { - "version": "4.17.1", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.1.tgz", - "integrity": "sha512-X+2qazGS3jxLAIz5JDXDzglAF3KpijdhFxlf/V1+hEsOUc+HnWi81L/uv/EvGuV90WY+7mPGFCUDGfQC3Gj95Q==", - "dev": true, - "optional": true - }, - "node_modules/@types/lodash.values": { - "version": "4.3.9", - "resolved": "https://registry.npmjs.org/@types/lodash.values/-/lodash.values-4.3.9.tgz", - "integrity": "sha512-IJ20OEfqNwm3k8ENwoM3q0yOs4UMpgtD4GqxB4lwBHToGthHWqhyh5DdSgQjioocz0QK2SSBkJfCq95ZTV8BTw==", - "dev": true, - "optional": true, - "dependencies": { - "@types/lodash": "*" - } - }, - "node_modules/@types/long": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", - "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", - "dev": true - }, "node_modules/@types/mute-stream": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/@types/mute-stream/-/mute-stream-0.0.4.tgz", @@ -2826,30 +1518,12 @@ "undici-types": "~5.26.4" } }, - "node_modules/@types/pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/prettier": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz", "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==", "dev": true }, - "node_modules/@types/secp256k1": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.6.tgz", - "integrity": "sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/w3c-web-usb": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/@types/w3c-web-usb/-/w3c-web-usb-1.0.10.tgz", @@ -2871,56 +1545,24 @@ "@types/node": "*" } }, - "node_modules/@wry/caches": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@wry/caches/-/caches-1.0.1.tgz", - "integrity": "sha512-bXuaUNLVVkD20wcGBWRyo7j9N3TxePEWFZj2Y+r9OoUzfqmavM84+mFykRicNsBqatba5JLay1t48wxaXaWnlA==", - "dev": true, - "optional": true, - "dependencies": { - "tslib": "^2.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@wry/context": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.7.4.tgz", - "integrity": "sha512-jmT7Sb4ZQWI5iyu3lobQxICu2nC/vbUhP0vIdd6tHC9PTfenmRmuIFqktc6GH9cgi+ZHnsLWPvfSvc4DrYmKiQ==", - "dev": true, - "optional": true, - "dependencies": { - "tslib": "^2.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@wry/equality": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.5.7.tgz", - "integrity": "sha512-BRFORjsTuQv5gxcXsuDXx6oGRhuVsEGwZy6LOzRRfgu+eSfxbhUQ9L9YtSEIuIjY/o7g3iWFjrc5eSY1GXP2Dw==", + "node_modules/@wormhole-foundation/sdk-base": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-base/-/sdk-base-0.7.0.tgz", + "integrity": "sha512-YvxEfoDeWw9klit4C3DM78+W57Humri1Fz61zc+Nt4NDn8nmKLSbmZ3MvMEUFbRSlDZZrjHjlwrescd3l/jK8A==", "dev": true, - "optional": true, "dependencies": { - "tslib": "^2.3.0" - }, - "engines": { - "node": ">=8" + "@scure/base": "^1.1.3" } }, - "node_modules/@wry/trie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.5.0.tgz", - "integrity": "sha512-FNoYzHawTMk/6KMQoEG5O4PuioX19UbwdQKF44yw0nLfOypfQdjtfZzo/UIJWAJ23sNIFbD1Ug9lbaDGMwbqQA==", + "node_modules/@wormhole-foundation/sdk-definitions": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-definitions/-/sdk-definitions-0.7.0.tgz", + "integrity": "sha512-AJQtlNCwJXQ2GmUIZHt5GiUBnHrivilnZk4wqNtLu4m0yvPOqdM81KdlLHIH++95HAlFHkwmLv1+IWCZNHTDYA==", "dev": true, - "optional": true, "dependencies": { - "tslib": "^2.3.0" - }, - "engines": { - "node": ">=8" + "@noble/curves": "^1.4.0", + "@noble/hashes": "^1.3.1", + "@wormhole-foundation/sdk-base": "0.7.0" } }, "node_modules/@xlabs-xyz/ledger-signer": { @@ -2935,80 +1577,6 @@ "ethers": "^5.7.2" } }, - "node_modules/@xpla/xpla.js": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@xpla/xpla.js/-/xpla.js-0.2.3.tgz", - "integrity": "sha512-Tfk7hCGWXtwr08reY3Pi6dmzIqFbzri9jcyzJdfNmdo4cN0PMwpRJuZZcPmtxiIUnNef3AN1E/6nJUD5MKniuA==", - "dev": true, - "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/signing-key": "^5.6.2", - "@terra-money/legacy.proto": "npm:@terra-money/terra.proto@^0.1.7", - "@terra-money/terra.proto": "^2.1.0", - "axios": "^0.26.1", - "bech32": "^2.0.0", - "bip32": "^2.0.6", - "bip39": "^3.0.3", - "bufferutil": "^4.0.3", - "crypto-addr-codec": "^0.1.7", - "decimal.js": "^10.2.1", - "elliptic": "^6.5.4", - "ethereumjs-util": "^7.1.5", - "jscrypto": "^1.0.1", - "readable-stream": "^3.6.0", - "secp256k1": "^4.0.2", - "tmp": "^0.2.1", - "utf-8-validate": "^5.0.5", - "ws": "^7.5.8" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@xpla/xpla.js/node_modules/axios": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", - "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", - "dev": true, - "dependencies": { - "follow-redirects": "^1.14.8" - } - }, - "node_modules/@xpla/xpla.js/node_modules/ws": { - "version": "7.5.9", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", - "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", - "dev": true, - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/acorn": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", - "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", - "dev": true, - "optional": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/aes-js": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", @@ -3027,35 +1595,6 @@ "node": ">= 8.0.0" } }, - "node_modules/algo-msgpack-with-bigint": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/algo-msgpack-with-bigint/-/algo-msgpack-with-bigint-2.1.1.tgz", - "integrity": "sha512-F1tGh056XczEaEAqu7s+hlZUDWwOBT70Eq0lfMpBP2YguSQVyxRbprLq5rELXKQOyOaixTWYhMeMQMzP0U5FoQ==", - "dev": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/algosdk": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/algosdk/-/algosdk-2.7.0.tgz", - "integrity": "sha512-sBE9lpV7bup3rZ+q2j3JQaFAE9JwZvjWKX00vPlG8e9txctXbgLL56jZhSWZndqhDI9oI+0P4NldkuQIWdrUyg==", - "dev": true, - "dependencies": { - "algo-msgpack-with-bigint": "^2.1.1", - "buffer": "^6.0.3", - "hi-base32": "^0.5.1", - "js-sha256": "^0.9.0", - "js-sha3": "^0.8.0", - "js-sha512": "^0.8.0", - "json-bigint": "^1.0.0", - "tweetnacl": "^1.0.3", - "vlq": "^2.0.4" - }, - "engines": { - "node": ">=18.0.0" - } - }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -3107,60 +1646,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/aptos": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/aptos/-/aptos-1.5.0.tgz", - "integrity": "sha512-N7OuRtU7IYHkDkNx+4QS3g/QQGCp+36KzYn3oXPmT7Kttfuv+UKliQVdjy3cLmwd/DCQSh9ObTovwdxnHjUn0g==", - "dev": true, - "dependencies": { - "@noble/hashes": "1.1.3", - "@scure/bip39": "1.1.0", - "axios": "0.27.2", - "form-data": "4.0.0", - "tweetnacl": "1.0.3" - }, - "engines": { - "node": ">=11.0.0" - } - }, - "node_modules/aptos/node_modules/@noble/hashes": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.1.3.tgz", - "integrity": "sha512-CE0FCR57H2acVI5UOzIGSSIYxZ6v/HOhDR0Ro9VLyhnzLwx0o8W1mmgaqlEUx4049qJDlIBRztv5k+MM8vbO3A==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ] - }, - "node_modules/aptos/node_modules/@scure/bip39": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.1.0.tgz", - "integrity": "sha512-pwrPOS16VeTKg98dYXQyIjJEcWfz7/1YJIwxUEPFfQPtc86Ym/1sVgQ2RLoD43AazMk2l/unK4ITySSpW2+82w==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "dependencies": { - "@noble/hashes": "~1.1.1", - "@scure/base": "~1.1.0" - } - }, - "node_modules/aptos/node_modules/axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", - "dev": true, - "dependencies": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" - } - }, "node_modules/array-back": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", @@ -3176,15 +1661,6 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, - "node_modules/axios": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz", - "integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==", - "dev": true, - "dependencies": { - "follow-redirects": "^1.14.4" - } - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -3220,102 +1696,35 @@ } ] }, - "node_modules/bech32": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", - "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==", - "dev": true - }, - "node_modules/big-integer": { - "version": "1.6.36", - "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.36.tgz", - "integrity": "sha512-t70bfa7HYEA1D9idDbmuv7YbsbVkQ+Hp+8KFSul4aE5e/i1bjCNIRYJZlA8Q8p0r9T8cF/RVvwUgRA//FydEyg==", - "dev": true, - "engines": { - "node": ">=0.6" - } - }, "node_modules/bigint-buffer": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==", "dev": true, - "hasInstallScript": true, - "dependencies": { - "bindings": "^1.3.0" - }, - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/bignumber.js": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", - "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/binary-parser": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/binary-parser/-/binary-parser-2.2.1.tgz", - "integrity": "sha512-5ATpz/uPDgq5GgEDxTB4ouXCde7q2lqAQlSdBRQVl/AJnxmQmhIfyxJx+0MGu//D5rHQifkfGbWWlaysG0o9NA==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "dev": true, - "dependencies": { - "file-uri-to-path": "1.0.0" - } - }, - "node_modules/bip32": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/bip32/-/bip32-2.0.6.tgz", - "integrity": "sha512-HpV5OMLLGTjSVblmrtYRfFFKuQB+GArM0+XP8HGWfJ5vxYBqo+DesvJwOdC2WJ3bCkZShGf0QIfoIpeomVzVdA==", - "dev": true, + "hasInstallScript": true, "dependencies": { - "@types/node": "10.12.18", - "bs58check": "^2.1.1", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "tiny-secp256k1": "^1.1.3", - "typeforce": "^1.11.5", - "wif": "^2.0.6" + "bindings": "^1.3.0" }, "engines": { - "node": ">=6.0.0" + "node": ">= 10.0.0" } }, - "node_modules/bip32/node_modules/@types/node": { - "version": "10.12.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", - "integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==", - "dev": true - }, - "node_modules/bip39": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.1.0.tgz", - "integrity": "sha512-c9kiwdk45Do5GL0vJMe7tS95VjCii65mYAH7DfWl3uW8AVzXKQVUm64i3hzVybBDMp9r7j9iNxR85+ul8MdN/A==", + "node_modules/bignumber.js": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", "dev": true, - "dependencies": { - "@noble/hashes": "^1.2.0" + "engines": { + "node": "*" } }, - "node_modules/bip66": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", - "integrity": "sha512-nemMHz95EmS38a26XbbdxIYj5csHd3RMP3H5bwQknX0WYHF01qhpufP42mLOwVICuH2JmhIhXiWs89MfUGL7Xw==", + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", "dev": true, - "optional": true, "dependencies": { - "safe-buffer": "^5.0.1" + "file-uri-to-path": "1.0.0" } }, "node_modules/bl": { @@ -3353,12 +1762,6 @@ "ieee754": "^1.1.13" } }, - "node_modules/blakejs": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", - "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==", - "dev": true - }, "node_modules/bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", @@ -3401,41 +1804,6 @@ "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", "dev": true }, - "node_modules/browser-headers": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/browser-headers/-/browser-headers-0.4.1.tgz", - "integrity": "sha512-CA9hsySZVo9371qEHjHZtYxV2cFtVj5Wj/ZHi8ooEsrtm4vOnl9Y9HmyYWk9q+05d7K3rdoAE0j3MVEFVvtQtg==", - "dev": true - }, - "node_modules/browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "dependencies": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/bs58": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", - "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", - "dev": true, - "dependencies": { - "base-x": "^4.0.0" - } - }, - "node_modules/bs58/node_modules/base-x": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", - "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==", - "dev": true - }, "node_modules/bs58check": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", @@ -3480,27 +1848,13 @@ "ieee754": "^1.2.1" } }, - "node_modules/buffer-layout": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/buffer-layout/-/buffer-layout-1.2.2.tgz", - "integrity": "sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==", - "dev": true, - "engines": { - "node": ">=4.5" - } - }, - "node_modules/buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", - "dev": true - }, "node_modules/bufferutil": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.8.tgz", "integrity": "sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==", "dev": true, "hasInstallScript": true, + "optional": true, "dependencies": { "node-gyp-build": "^4.3.0" }, @@ -3508,21 +1862,6 @@ "node": ">=6.14.2" } }, - "node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/capability": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/capability/-/capability-0.2.5.tgz", - "integrity": "sha512-rsJZYVCgXd08sPqwmaIqjAd5SUTfonV0z/gDJ8D6cN8wQphky1kkAYEqQ+hmDxTw7UihvBfjUVUSY+DBEe44jg==", - "dev": true - }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -3597,18 +1936,6 @@ "node": ">= 12" } }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "optional": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -3728,99 +2055,12 @@ "node": ">=8" } }, - "node_modules/commander": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-12.0.0.tgz", - "integrity": "sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA==", - "dev": true, - "engines": { - "node": ">=18" - } - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, - "node_modules/copyfiles": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz", - "integrity": "sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==", - "dev": true, - "optional": true, - "dependencies": { - "glob": "^7.0.5", - "minimatch": "^3.0.3", - "mkdirp": "^1.0.4", - "noms": "0.0.0", - "through2": "^2.0.1", - "untildify": "^4.0.0", - "yargs": "^16.1.0" - }, - "bin": { - "copyfiles": "copyfiles", - "copyup": "copyfiles" - } - }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true, - "optional": true - }, - "node_modules/cosmjs-types": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.7.2.tgz", - "integrity": "sha512-vf2uLyktjr/XVAgEq0DjMxeAWh1yYREe7AMHDKd7EiHVqxBPCaBS+qEEQUkXbR9ndnckqr1sUG8BQhazh4X5lA==", - "dev": true, - "optional": true, - "dependencies": { - "long": "^4.0.0", - "protobufjs": "~6.11.2" - } - }, - "node_modules/cosmjs-types/node_modules/protobufjs": { - "version": "6.11.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", - "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" - } - }, - "node_modules/crc-32": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", - "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", - "dev": true, - "optional": true, - "bin": { - "crc32": "bin/crc32.njs" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -3834,65 +2074,6 @@ "sha.js": "^2.4.0" } }, - "node_modules/create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "dependencies": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "node_modules/cross-fetch": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz", - "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==", - "dev": true, - "dependencies": { - "node-fetch": "^2.6.12" - } - }, - "node_modules/crypto-addr-codec": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/crypto-addr-codec/-/crypto-addr-codec-0.1.8.tgz", - "integrity": "sha512-GqAK90iLLgP3FvhNmHbpT3wR6dEdaM8hZyZtLX29SPardh3OA13RFLHDR6sntGCgRWOfiHqW6sIyohpNqOtV/g==", - "dev": true, - "dependencies": { - "base-x": "^3.0.8", - "big-integer": "1.6.36", - "blakejs": "^1.1.0", - "bs58": "^4.0.1", - "ripemd160-min": "0.0.6", - "safe-buffer": "^5.2.0", - "sha3": "^2.1.1" - } - }, - "node_modules/crypto-addr-codec/node_modules/bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", - "dev": true, - "dependencies": { - "base-x": "^3.0.2" - } - }, - "node_modules/crypto-hash": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/crypto-hash/-/crypto-hash-1.3.0.tgz", - "integrity": "sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/crypto-js": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz", @@ -3922,12 +2103,6 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/decimal.js": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", - "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", - "dev": true - }, "node_modules/decompress-response": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", @@ -3952,42 +2127,6 @@ "node": ">=4.0.0" } }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "optional": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/define-properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", - "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "dev": true, - "optional": true, - "dependencies": { - "define-data-property": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/delay": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", @@ -4009,15 +2148,6 @@ "node": ">=0.4.0" } }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/detect-libc": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", @@ -4027,16 +2157,6 @@ "node": ">=8" } }, - "node_modules/dot-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", - "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", - "dev": true, - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, "node_modules/dotenv": { "version": "16.4.5", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", @@ -4049,82 +2169,6 @@ "url": "https://dotenvx.com" } }, - "node_modules/drbg.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", - "integrity": "sha512-F4wZ06PvqxYLFEZKkFxTDcns9oFNk34hvmJSEwdzsxVQ8YI5YaxtACgQatkYgv2VI2CFkUd2Y+xosPQnHv809g==", - "dev": true, - "optional": true, - "dependencies": { - "browserify-aes": "^1.0.6", - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/eccrypto": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/eccrypto/-/eccrypto-1.1.6.tgz", - "integrity": "sha512-d78ivVEzu7Tn0ZphUUaL43+jVPKTMPFGtmgtz1D0LrFn7cY3K8CdrvibuLz2AAkHBLKZtR8DMbB2ukRYFk987A==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "dependencies": { - "acorn": "7.1.1", - "elliptic": "6.5.4", - "es6-promise": "4.2.8", - "nan": "2.14.0" - }, - "optionalDependencies": { - "secp256k1": "3.7.1" - } - }, - "node_modules/eccrypto/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true, - "optional": true - }, - "node_modules/eccrypto/node_modules/elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "dev": true, - "optional": true, - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/eccrypto/node_modules/secp256k1": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.1.tgz", - "integrity": "sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "dependencies": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", - "elliptic": "^6.4.1", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" - }, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/eip55": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/eip55/-/eip55-2.1.1.tgz", @@ -4134,74 +2178,19 @@ "keccak": "^3.0.3" } }, - "node_modules/elliptic": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.5.tgz", - "integrity": "sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw==", - "dev": true, - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/elliptic/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, "node_modules/emoji-regex": { "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/error-polyfill": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/error-polyfill/-/error-polyfill-0.1.3.tgz", - "integrity": "sha512-XHJk60ufE+TG/ydwp4lilOog549iiQF2OAPhkk9DdiYWMrltz5yhDz/xnKuenNwP7gy3dsibssO5QpVhkrSzzg==", - "dev": true, - "dependencies": { - "capability": "^0.2.5", - "o3": "^1.0.3", - "u3": "^0.1.1" - } - }, - "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "dev": true, - "optional": true, - "dependencies": { - "get-intrinsic": "^1.2.4" - }, - "engines": { - "node": ">= 0.4" - } + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dev": true, - "optional": true, - "engines": { - "node": ">= 0.4" + "dependencies": { + "once": "^1.4.0" } }, "node_modules/es6-promise": { @@ -4257,16 +2246,6 @@ "@esbuild/win32-x64": "0.20.2" } }, - "node_modules/escalade": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", - "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", - "dev": true, - "optional": true, - "engines": { - "node": ">=6" - } - }, "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -4276,151 +2255,6 @@ "node": ">=0.8.0" } }, - "node_modules/eth-crypto": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/eth-crypto/-/eth-crypto-2.6.0.tgz", - "integrity": "sha512-GCX4ffFYRUGgnuWR5qxcZIRQJ1KEqPFiyXU9yVy7s6dtXIMlUXZQ2h+5ID6rFaOHWbpJbjfkC6YdhwtwRYCnug==", - "dev": true, - "optional": true, - "dependencies": { - "@babel/runtime": "7.20.13", - "@ethereumjs/tx": "3.5.2", - "@types/bn.js": "5.1.1", - "eccrypto": "1.1.6", - "ethereumjs-util": "7.1.5", - "ethers": "5.7.2", - "secp256k1": "5.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/pubkey" - } - }, - "node_modules/eth-crypto/node_modules/@babel/runtime": { - "version": "7.20.13", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.13.tgz", - "integrity": "sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA==", - "dev": true, - "optional": true, - "dependencies": { - "regenerator-runtime": "^0.13.11" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/eth-crypto/node_modules/node-addon-api": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", - "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==", - "dev": true, - "optional": true - }, - "node_modules/eth-crypto/node_modules/regenerator-runtime": { - "version": "0.13.11", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", - "dev": true, - "optional": true - }, - "node_modules/eth-crypto/node_modules/secp256k1": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-5.0.0.tgz", - "integrity": "sha512-TKWX8xvoGHrxVdqbYeZM9w+izTF4b9z3NhSaDkdn81btvuh+ivbIMGT/zQvDtTFWhRlThpoz6LEYTr7n8A5GcA==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "dependencies": { - "elliptic": "^6.5.4", - "node-addon-api": "^5.0.0", - "node-gyp-build": "^4.2.0" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "dev": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/ethereumjs-abi": { - "version": "0.6.8", - "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz", - "integrity": "sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==", - "dev": true, - "optional": true, - "dependencies": { - "bn.js": "^4.11.8", - "ethereumjs-util": "^6.0.0" - } - }, - "node_modules/ethereumjs-abi/node_modules/@types/bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", - "dev": true, - "optional": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/ethereumjs-abi/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true, - "optional": true - }, - "node_modules/ethereumjs-abi/node_modules/ethereumjs-util": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", - "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", - "dev": true, - "optional": true, - "dependencies": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - }, - "node_modules/ethereumjs-util": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", - "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", - "dev": true, - "dependencies": { - "@types/bn.js": "^5.1.0", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", - "rlp": "^2.2.4" - }, - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/ethers": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", @@ -4469,21 +2303,6 @@ "@ethersproject/wordlists": "5.7.0" } }, - "node_modules/ethjs-util": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", - "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", - "dev": true, - "optional": true, - "dependencies": { - "is-hex-prefixed": "1.0.0", - "strip-hex-prefix": "1.0.0" - }, - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, "node_modules/eventemitter3": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", @@ -4499,16 +2318,6 @@ "node": ">=0.8.x" } }, - "node_modules/evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "dependencies": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, "node_modules/expand-template": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", @@ -4533,13 +2342,6 @@ "integrity": "sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==", "dev": true }, - "node_modules/fastestsmallesttextencoderdecoder": { - "version": "1.0.22", - "resolved": "https://registry.npmjs.org/fastestsmallesttextencoderdecoder/-/fastestsmallesttextencoderdecoder-1.0.22.tgz", - "integrity": "sha512-Pb8d48e+oIuY4MaM64Cd7OW1gt4nxCHs7/ddPPZ/Ic3sg8yVGM7O9wDvZ7us6ScaUupzM+pfBolwtYhN1IxBIw==", - "dev": true, - "peer": true - }, "node_modules/file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", @@ -4632,46 +2434,6 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "optional": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "optional": true, - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "dev": true, - "optional": true, - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/get-tsconfig": { "version": "4.7.5", "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", @@ -4690,95 +2452,12 @@ "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", "dev": true }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "optional": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/globalthis": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", - "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", - "dev": true, - "optional": true, - "dependencies": { - "define-properties": "^1.2.1", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/google-protobuf": { - "version": "3.21.2", - "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.2.tgz", - "integrity": "sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA==", - "dev": true - }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, - "optional": true, - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, - "node_modules/graphql": { - "version": "16.8.1", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz", - "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==", - "dev": true, - "optional": true, - "engines": { - "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" - } - }, - "node_modules/graphql-tag": { - "version": "2.12.6", - "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.12.6.tgz", - "integrity": "sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==", - "dev": true, - "optional": true, - "dependencies": { - "tslib": "^2.1.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "graphql": "^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" - } - }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -4788,45 +2467,6 @@ "node": ">=4" } }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "optional": true, - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "dev": true, - "optional": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "optional": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/hash-base": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", @@ -4851,25 +2491,6 @@ "minimalistic-assert": "^1.0.1" } }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, - "optional": true, - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/hi-base32": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/hi-base32/-/hi-base32-0.5.1.tgz", - "integrity": "sha512-EmBBpvdYh/4XxsnUybsPag6VikPYnN30td+vQk+GI3qpahVEG9+gTkG0aXVxTjBqQ5T6ijbWIu77O+C5WFWsnA==", - "dev": true - }, "node_modules/hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -4881,48 +2502,6 @@ "minimalistic-crypto-utils": "^1.0.1" } }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dev": true, - "optional": true, - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", - "dev": true, - "dependencies": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/http-errors/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/http-status-codes": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/http-status-codes/-/http-status-codes-2.3.0.tgz", - "integrity": "sha512-RJ8XvFvpPM/Dmc5SV+dC4y5PCeOhT3x1Hq0NU3rjGeg5a/CqlhZ7uudknPwZFz4aeAXDcbAyaeP7GAo9lvngtA==", - "dev": true, - "optional": true - }, "node_modules/humanize-ms": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", @@ -4974,16 +2553,6 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, - "node_modules/interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", - "dev": true, - "optional": true, - "engines": { - "node": ">= 0.10" - } - }, "node_modules/invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", @@ -4993,19 +2562,6 @@ "loose-envify": "^1.0.0" } }, - "node_modules/is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", - "dev": true, - "optional": true, - "dependencies": { - "hasown": "^2.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -5015,24 +2571,6 @@ "node": ">=8" } }, - "node_modules/is-hex-prefixed": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", - "integrity": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==", - "dev": true, - "optional": true, - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, - "node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", - "dev": true, - "optional": true - }, "node_modules/isomorphic-ws": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", @@ -5080,28 +2618,10 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, - "node_modules/js-base64": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.7.tgz", - "integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==", - "dev": true - }, - "node_modules/js-sha256": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", - "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==", - "dev": true - }, "node_modules/js-sha3": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", - "dev": true - }, - "node_modules/js-sha512": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/js-sha512/-/js-sha512-0.8.0.tgz", - "integrity": "sha512-PWsmefG6Jkodqt+ePTvBZCSMFgN7Clckjd0O7su3I0+BW2QWUTJNzjktHsztGLhncP2h8mcF9V9Y2Ha59pAViQ==", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", "dev": true }, "node_modules/js-tokens": { @@ -5110,24 +2630,6 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, - "node_modules/jscrypto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/jscrypto/-/jscrypto-1.0.3.tgz", - "integrity": "sha512-lryZl0flhodv4SZHOqyb1bx5sKcJxj0VBo0Kzb4QMAg3L021IC9uGpl0RCZa+9KJwlRGSK2C80ITcwbe19OKLQ==", - "dev": true, - "bin": { - "jscrypto": "bin/cli.js" - } - }, - "node_modules/json-bigint": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", - "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", - "dev": true, - "dependencies": { - "bignumber.js": "^9.0.0" - } - }, "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -5152,16 +2654,6 @@ "node >= 0.2.0" ] }, - "node_modules/jsonschema": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz", - "integrity": "sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==", - "dev": true, - "optional": true, - "engines": { - "node": "*" - } - }, "node_modules/JSONStream": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", @@ -5193,96 +2685,6 @@ "node": ">=10.0.0" } }, - "node_modules/keccak256": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/keccak256/-/keccak256-1.0.6.tgz", - "integrity": "sha512-8GLiM01PkdJVGUhR1e6M/AvWnSqYS0HaERI+K/QtStGDGlSTx2B1zTqZk4Zlqu5TxHJNTxWAdP9Y+WI50OApUw==", - "dev": true, - "optional": true, - "dependencies": { - "bn.js": "^5.2.0", - "buffer": "^6.0.3", - "keccak": "^3.0.2" - } - }, - "node_modules/libsodium": { - "version": "0.7.13", - "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.13.tgz", - "integrity": "sha512-mK8ju0fnrKXXfleL53vtp9xiPq5hKM0zbDQtcxQIsSmxNgSxqCj6R7Hl9PkrNe2j29T4yoDaF7DJLK9/i5iWUw==", - "dev": true, - "optional": true - }, - "node_modules/libsodium-wrappers": { - "version": "0.7.13", - "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.13.tgz", - "integrity": "sha512-kasvDsEi/r1fMzKouIDv7B8I6vNmknXwGiYodErGuESoFTohGSKZplFtVxZqHaoQ217AynyIFgnOVRitpHs0Qw==", - "dev": true, - "optional": true, - "dependencies": { - "libsodium": "^0.7.13" - } - }, - "node_modules/link-module-alias": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/link-module-alias/-/link-module-alias-1.2.0.tgz", - "integrity": "sha512-ahPjXepbSVKbahTB6LxR//VHm8HPfI+QQygCH+E82spBY4HR5VPJTvlhKBc9F7muVxnS6C1rRfoPOXAbWO/fyw==", - "dev": true, - "optional": true, - "dependencies": { - "chalk": "^2.4.1" - }, - "bin": { - "link-module-alias": "index.js" - }, - "engines": { - "node": "> 8.0.0" - } - }, - "node_modules/link-module-alias/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "optional": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/link-module-alias/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "optional": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/link-module-alias/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "optional": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/link-module-alias/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "optional": true - }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -5295,19 +2697,6 @@ "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", "dev": true }, - "node_modules/lodash.values": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.values/-/lodash.values-4.3.0.tgz", - "integrity": "sha512-r0RwvdCv8id9TUblb/O7rYPwVy6lerCbcawrfdo9iC/1t1wsNMJknO79WNBgwkH0hIeJ08jmvvESbFpNb4jH0Q==", - "dev": true, - "optional": true - }, - "node_modules/long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", - "dev": true - }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -5320,28 +2709,6 @@ "loose-envify": "cli.js" } }, - "node_modules/lower-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", - "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", - "dev": true, - "dependencies": { - "tslib": "^2.0.3" - } - }, - "node_modules/map-obj": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", - "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", - "dev": true, - "optional": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -5443,15 +2810,6 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "node_modules/mustache": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", - "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", - "dev": true, - "bin": { - "mustache": "bin/mustache" - } - }, "node_modules/mute-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", @@ -5461,56 +2819,12 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", - "dev": true - }, "node_modules/napi-build-utils": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", "dev": true }, - "node_modules/near-api-js": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/near-api-js/-/near-api-js-1.1.0.tgz", - "integrity": "sha512-qYKv1mYsaDZc2uYndhS+ttDhR9+60qFc+ZjD6lWsAxr3ZskMjRwPffDGQZYhC7BRDQMe1HEbk6d5mf+TVm0Lqg==", - "dev": true, - "dependencies": { - "bn.js": "5.2.1", - "borsh": "^0.7.0", - "bs58": "^4.0.0", - "depd": "^2.0.0", - "error-polyfill": "^0.1.3", - "http-errors": "^1.7.2", - "js-sha256": "^0.9.0", - "mustache": "^4.0.0", - "node-fetch": "^2.6.1", - "text-encoding-utf-8": "^1.0.2", - "tweetnacl": "^1.0.1" - } - }, - "node_modules/near-api-js/node_modules/bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", - "dev": true, - "dependencies": { - "base-x": "^3.0.2" - } - }, - "node_modules/no-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", - "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", - "dev": true, - "dependencies": { - "lower-case": "^2.0.2", - "tslib": "^2.0.3" - } - }, "node_modules/node-abi": { "version": "3.62.0", "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.62.0.tgz", @@ -5584,66 +2898,6 @@ "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", "dev": true }, - "node_modules/noms": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", - "integrity": "sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==", - "dev": true, - "optional": true, - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "~1.0.31" - } - }, - "node_modules/noms/node_modules/readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", - "dev": true, - "optional": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/noms/node_modules/string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", - "dev": true, - "optional": true - }, - "node_modules/o3": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/o3/-/o3-1.0.3.tgz", - "integrity": "sha512-f+4n+vC6s4ysy7YO7O2gslWZBUu8Qj2i2OUJOvjRxQva7jVjYjB29jrr9NCjmxZQR0gzrOcv1RnqoYOeMs5VRQ==", - "dev": true, - "dependencies": { - "capability": "^0.2.5" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "optional": true, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -5653,38 +2907,6 @@ "wrappy": "1" } }, - "node_modules/optimism": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.18.0.tgz", - "integrity": "sha512-tGn8+REwLRNFnb9WmcY5IfpOqeX2kpaYJ1s6Ae3mn12AeydLkR3j+jSCmVQFoXqU8D41PAJ1RG1rCRNWmNZVmQ==", - "dev": true, - "optional": true, - "dependencies": { - "@wry/caches": "^1.0.0", - "@wry/context": "^0.7.0", - "@wry/trie": "^0.4.3", - "tslib": "^2.3.0" - } - }, - "node_modules/optimism/node_modules/@wry/trie": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.4.3.tgz", - "integrity": "sha512-I6bHwH0fSf6RqQcnnXLJKhkSXG45MFral3GxPaY4uAl0LYDZM+YDVDAiU9bYwjTuysy1S0IeecWtmq1SZA3M1w==", - "dev": true, - "optional": true, - "dependencies": { - "tslib": "^2.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pako": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", - "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==", - "dev": true - }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -5694,29 +2916,6 @@ "node": ">=0.10.0" } }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true, - "optional": true - }, - "node_modules/pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", - "dev": true, - "dependencies": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - }, - "engines": { - "node": ">=0.12" - } - }, "node_modules/prebuild-install": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz", @@ -5758,55 +2957,6 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true, - "optional": true - }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dev": true, - "optional": true, - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, - "node_modules/protobufjs": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.0.tgz", - "integrity": "sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/node": ">=13.7.0", - "long": "^5.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/protobufjs/node_modules/long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", - "dev": true - }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", @@ -5823,15 +2973,6 @@ "once": "^1.3.1" } }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, "node_modules/rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -5872,13 +3013,6 @@ "react": "^18.3.1" } }, - "node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "dev": true, - "optional": true - }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -5893,88 +3027,21 @@ "node": ">= 6" } }, - "node_modules/readonly-date": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/readonly-date/-/readonly-date-1.0.0.tgz", - "integrity": "sha512-tMKIV7hlk0h4mO3JTmmVuIlJVXjKk3Sep9Bf5OH0O+758ruuVkUy2J9SttDLm91IEX/WHlXPSpxMGjPj4beMIQ==", - "dev": true, - "optional": true - }, - "node_modules/rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", - "dev": true, - "optional": true, - "dependencies": { - "resolve": "^1.1.6" - }, - "engines": { - "node": ">= 0.10" - } - }, "node_modules/reduce-flatten": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", - "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/regenerator-runtime": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", - "dev": true - }, - "node_modules/rehackt": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/rehackt/-/rehackt-0.1.0.tgz", - "integrity": "sha512-7kRDOuLHB87D/JESKxQoRwv4DzbIdwkAGQ7p6QKGdVlY1IZheUnVhlk/4UZlNUVxdAXpyxikE3URsG067ybVzw==", - "dev": true, - "optional": true, - "peerDependencies": { - "@types/react": "*", - "react": "*" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "react": { - "optional": true - } - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", - "dev": true, - "optional": true, - "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", + "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", + "dev": true, + "engines": { + "node": ">=6" } }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "dev": true + }, "node_modules/resolve-pkg-maps": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", @@ -5984,16 +3051,6 @@ "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" } }, - "node_modules/response-iterator": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/response-iterator/-/response-iterator-0.2.6.tgz", - "integrity": "sha512-pVzEEzrsg23Sh053rmDUvLSkGXluZio0qu8VT6ukrYuvtjVfCbDZH9d6PGXb8HZfzdNZt8feXv/jvUzlhRgLnw==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.8" - } - }, "node_modules/ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -6004,27 +3061,6 @@ "inherits": "^2.0.1" } }, - "node_modules/ripemd160-min": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/ripemd160-min/-/ripemd160-min-0.0.6.tgz", - "integrity": "sha512-+GcJgQivhs6S9qvLogusiTcS9kQUfgR75whKuy5jIhuiOfQuJ8fjqxV6EGD5duH1Y/FawFUMtMhyeq3Fbnib8A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/rlp": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", - "integrity": "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==", - "dev": true, - "dependencies": { - "bn.js": "^5.2.0" - }, - "bin": { - "rlp": "bin/rlp" - } - }, "node_modules/rpc-websockets": { "version": "7.11.1", "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.11.1.tgz", @@ -6109,21 +3145,6 @@ "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", "dev": true }, - "node_modules/secp256k1": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", - "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "elliptic": "^6.5.4", - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/semver": { "version": "7.6.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", @@ -6136,18 +3157,6 @@ "node": ">=10" } }, - "node_modules/setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", - "dev": true - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "dev": true - }, "node_modules/sha.js": { "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", @@ -6161,50 +3170,6 @@ "sha.js": "bin.js" } }, - "node_modules/sha3": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/sha3/-/sha3-2.1.4.tgz", - "integrity": "sha512-S8cNxbyb0UGUM2VhRD4Poe5N58gJnJsLJ5vC7FYWGUmGhcsj4++WaIOBFVDxlG0W3To6xBuiRh+i0Qp2oNCOtg==", - "dev": true, - "dependencies": { - "buffer": "6.0.3" - } - }, - "node_modules/shelljs": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", - "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", - "dev": true, - "optional": true, - "dependencies": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" - }, - "bin": { - "shjs": "bin/shjs" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/shx": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/shx/-/shx-0.3.4.tgz", - "integrity": "sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==", - "dev": true, - "optional": true, - "dependencies": { - "minimist": "^1.2.3", - "shelljs": "^0.8.5" - }, - "bin": { - "shx": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", @@ -6262,47 +3227,6 @@ "simple-concat": "^1.0.0" } }, - "node_modules/snake-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", - "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", - "dev": true, - "dependencies": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/snakecase-keys": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/snakecase-keys/-/snakecase-keys-5.5.0.tgz", - "integrity": "sha512-r3kRtnoPu3FxGJ3fny6PKNnU3pteb29o6qAa0ugzhSseKNWRkw1dw8nIjXMyyKaU9vQxxVIE62Mb3bKbdrgpiw==", - "dev": true, - "optional": true, - "dependencies": { - "map-obj": "^4.1.0", - "snake-case": "^3.0.4", - "type-fest": "^3.12.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/store2": { - "version": "2.14.3", - "resolved": "https://registry.npmjs.org/store2/-/store2-2.14.3.tgz", - "integrity": "sha512-4QcZ+yx7nzEFiV4BMLnr/pRa5HYzNITX2ri0Zh6sT9EyQHbBHacC6YigllUPU9X3D0f/22QCgfokpKs52YRrUg==", - "dev": true, - "optional": true - }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -6344,20 +3268,6 @@ "node": ">=8" } }, - "node_modules/strip-hex-prefix": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", - "integrity": "sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==", - "dev": true, - "optional": true, - "dependencies": { - "is-hex-prefixed": "1.0.0" - }, - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, "node_modules/strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -6388,29 +3298,6 @@ "node": ">=4" } }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "optional": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/symbol-observable": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", - "integrity": "sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10" - } - }, "node_modules/table-layout": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz", @@ -6484,104 +3371,6 @@ "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", "dev": true }, - "node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "optional": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/through2/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true, - "optional": true - }, - "node_modules/through2/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "optional": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/through2/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true, - "optional": true - }, - "node_modules/through2/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "optional": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/tiny-secp256k1": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/tiny-secp256k1/-/tiny-secp256k1-1.1.6.tgz", - "integrity": "sha512-FmqJZGduTyvsr2cF3375fqGHUovSwDi/QytexX1Se4BPuPZpTE5Ftp5fg+EFSuEf3lhZqgCRjEG3ydUQ/aNiwA==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "bindings": "^1.3.0", - "bn.js": "^4.11.8", - "create-hmac": "^1.1.7", - "elliptic": "^6.4.0", - "nan": "^2.13.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/tiny-secp256k1/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, - "node_modules/tmp": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", - "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", - "dev": true, - "engines": { - "node": ">=14.14" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "dev": true, - "engines": { - "node": ">=0.6" - } - }, - "node_modules/toml": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", - "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==", - "dev": true - }, "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", @@ -6612,19 +3401,6 @@ "typescript": ">=3.7.0" } }, - "node_modules/ts-invariant": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.10.3.tgz", - "integrity": "sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==", - "dev": true, - "optional": true, - "dependencies": { - "tslib": "^2.1.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", @@ -6662,32 +3438,6 @@ "node": "*" } }, - "node_modules/tweetnacl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", - "dev": true - }, - "node_modules/tweetnacl-util": { - "version": "0.15.1", - "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", - "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==", - "dev": true, - "optional": true - }, - "node_modules/type-fest": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", - "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", - "dev": true, - "optional": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/typechain": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/typechain/-/typechain-8.3.2.tgz", @@ -6732,12 +3482,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/typeforce": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/typeforce/-/typeforce-1.18.0.tgz", - "integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==", - "dev": true - }, "node_modules/typescript": { "version": "5.4.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", @@ -6760,12 +3504,6 @@ "node": ">=8" } }, - "node_modules/u3": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/u3/-/u3-0.1.1.tgz", - "integrity": "sha512-+J5D5ir763y+Am/QY6hXNRlwljIeRMZMGs0cT6qqZVVzzT3X3nFPXVyPOFRMOR4kupB0T8JnCdpWdp6Q/iXn3w==", - "dev": true - }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", @@ -6781,16 +3519,6 @@ "node": ">= 4.0.0" } }, - "node_modules/untildify": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", - "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", - "dev": true, - "optional": true, - "engines": { - "node": ">=8" - } - }, "node_modules/usb": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/usb/-/usb-2.9.0.tgz", @@ -6818,6 +3546,7 @@ "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", "dev": true, "hasInstallScript": true, + "optional": true, "dependencies": { "node-gyp-build": "^4.3.0" }, @@ -6849,12 +3578,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/vlq": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/vlq/-/vlq-2.0.4.tgz", - "integrity": "sha512-aodjPa2wPQFkra1G8CzJBTHXhgk3EVSwxSWXNPr1fgdFLUb8kvLV1iEb6rFgasIsjP82HWI6dsb5Io26DDnasA==", - "dev": true - }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -6871,15 +3594,6 @@ "webidl-conversions": "^3.0.0" } }, - "node_modules/wif": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/wif/-/wif-2.0.6.tgz", - "integrity": "sha512-HIanZn1zmduSF+BQhkE+YXIbEiH0xPr1012QbFEGB0xsKqJii0/SqJjyn8dFv6y36kOznMgMB+LGcbZTJ1xACQ==", - "dev": true, - "dependencies": { - "bs58check": "<3.0.0" - } - }, "node_modules/wordwrapjs": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.1.tgz", @@ -6902,24 +3616,6 @@ "node": ">=8" } }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "optional": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -6946,93 +3642,6 @@ "optional": true } } - }, - "node_modules/xstream": { - "version": "11.14.0", - "resolved": "https://registry.npmjs.org/xstream/-/xstream-11.14.0.tgz", - "integrity": "sha512-1bLb+kKKtKPbgTK6i/BaoAn03g47PpFstlbe1BA+y3pNS/LfvcaghS5BFf9+EE1J+KwSQsEpfJvFN5GqFtiNmw==", - "dev": true, - "optional": true, - "dependencies": { - "globalthis": "^1.0.1", - "symbol-observable": "^2.0.3" - } - }, - "node_modules/xstream/node_modules/symbol-observable": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-2.0.3.tgz", - "integrity": "sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.4" - } - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "optional": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "optional": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true, - "optional": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/zen-observable": { - "version": "0.8.15", - "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.15.tgz", - "integrity": "sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==", - "dev": true, - "optional": true - }, - "node_modules/zen-observable-ts": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-1.2.5.tgz", - "integrity": "sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg==", - "dev": true, - "optional": true, - "dependencies": { - "zen-observable": "0.8.15" - } } } } diff --git a/deployment/package.json b/deployment/package.json index 74e9068b..7a611d23 100644 --- a/deployment/package.json +++ b/deployment/package.json @@ -6,13 +6,13 @@ }, "author": "", "devDependencies": { - "@certusone/wormhole-sdk": "^0.10.11", "@inquirer/confirm": "^3.1.9", "@solana/web3.js": "^1.92.2", "@typechain/ethers-v5": "^11.1.2", "@types/node": "^20.11.22", + "@wormhole-foundation/sdk-base": "^0.7.0", + "@wormhole-foundation/sdk-definitions": "^0.7.0", "@xlabs-xyz/ledger-signer": "^0.0.4", - "bs58": "^5.0.0", "chalk": "^4.1.2", "dotenv": "^16.4.5", "ethers": "^5.7.2", diff --git a/deployment/scripts/evm/MatchingEngine/bytecode-verification-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/bytecode-verification-matching-engine.ts index 5d582183..75e65453 100644 --- a/deployment/scripts/evm/MatchingEngine/bytecode-verification-matching-engine.ts +++ b/deployment/scripts/evm/MatchingEngine/bytecode-verification-matching-engine.ts @@ -1,6 +1,48 @@ -import { runOnEvms, ChainInfo, LoggerFn } from "../../../helpers"; +import { runOnEvms, ChainInfo, LoggerFn, getContractAddress, getDeploymentArgs, getVerifyCommand } from "../../../helpers"; import { ethers } from "ethers"; +import { execSync } from "child_process"; +import path from "path"; +import chalk from "chalk"; -runOnEvms("", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { +runOnEvms("bytecode-verification-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + // The root path of the foundry project + const rootPath = path.resolve('../evm/'); + // Implementation data + const implementationName = "MatchingEngine"; + const implementationPath = 'src/MatchingEngine/MatchingEngine.sol'; + const implementationAddress = getContractAddress("MatchingEngineImplementation", chain.chainId); + const implementationDeploymentArgs = getDeploymentArgs("MatchingEngineImplementation", chain.chainId); + const implementationConstructorSignature = "constructor(address,address,address,uint24,uint24,uint8,uint8,uint8)"; + const verifyImplementationCommand = getVerifyCommand( + implementationName, + implementationPath, + implementationAddress, + implementationConstructorSignature, + implementationDeploymentArgs, + chain.chainId + ); + + // Proxy data + const proxyName = "ERC1967Proxy"; + const proxyPath = 'lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol'; + const proxyAddress = getContractAddress("MatchingEngineProxy", chain.chainId); + const proxyDeploymentArgs = getDeploymentArgs("MatchingEngineProxy", chain.chainId); + const proxyConstructorSignature = "constructor(address,bytes)"; + const verifyProxyCommand = getVerifyCommand( + proxyName, + proxyPath, + proxyAddress, + proxyConstructorSignature, + proxyDeploymentArgs, + chain.chainId + ); + + log(chalk.green("Verifying implementation bytecode...")); + execSync(verifyImplementationCommand, { stdio: "inherit", cwd: rootPath }); + console.log() + + log(chalk.green("Verifying proxy bytecode...")); + execSync(verifyProxyCommand, { stdio: "inherit", cwd: rootPath }); + console.log() }); \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts index 0062a132..1b993a56 100644 --- a/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts +++ b/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts @@ -1,12 +1,12 @@ import { MatchingEngine } from "../../../contract-bindings"; -import { runOnEvmsSequentially, ChainInfo, LoggerFn, getContractInstance, getContractAddress } from "../../../helpers"; +import { runOnEvmsSequentially, ChainInfo, LoggerFn, getContractInstance, getContractAddress, getFormattedEndpoint } from "../../../helpers"; import { ethers } from "ethers"; import { getConfigurationDifferences, logDiff } from "./utils"; import confirm from '@inquirer/confirm'; runOnEvmsSequentially("config-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { - const matchingEngineAddress = await getContractAddress("MatchingEngineProxy", chain.chainId); - const matchingEgine = (await getContractInstance("MatchingEngine", matchingEngineAddress, chain)) as MatchingEngine; + const matchingEngineAddress = getContractAddress("MatchingEngineProxy", chain.chainId); + const matchingEngine = (await getContractInstance("MatchingEngine", matchingEngineAddress, chain)) as MatchingEngine; const diff = await getConfigurationDifferences(chain); log(`MatchingEngine configuration differences on chain ${chain.chainId}:`); @@ -25,40 +25,37 @@ runOnEvmsSequentially("config-matching-engine", async (chain: ChainInfo, signer: if (Number(feeRecipient.offChain) === 0) throw new Error('Invalid fee recipient address'); - await matchingEgine.updateFeeRecipient(feeRecipient.offChain); + await matchingEngine.updateFeeRecipient(feeRecipient.offChain); log(`Fee recipient updated to ${feeRecipient.offChain}`); } // CCTP allowance if (cctpAllowance.onChain.toString() !== cctpAllowance.offChain.toString()) { - await matchingEgine.setCctpAllowance(cctpAllowance.offChain); + await matchingEngine.setCctpAllowance(cctpAllowance.offChain); log(`CCTP allowance updated to ${cctpAllowance.offChain}`); } // Router endpoints - for (const { chainId, router, mintRecipient, circleDomain } of routerEndpoints) { - const offChainEndpoint = { - router: router.offChain, - mintRecipient: mintRecipient.offChain - }; + for (const { wormholeChainId, router, mintRecipient, circleDomain } of routerEndpoints) { + const offChainEndpoint = getFormattedEndpoint(router.offChain, mintRecipient.offChain); // Add new router endpoint if all values are zero if (Number(router?.onChain) === 0 && Number(mintRecipient?.onChain) === 0 && Number(circleDomain?.onChain) === 0) { - if (chainId === 0) - throw new Error('Invalid chainId when adding new router endpoint'); + if (wormholeChainId === 0) + throw new Error('Invalid wormholeChainId when adding new router endpoint'); if (Number(offChainEndpoint.router) === 0 || Number(offChainEndpoint.mintRecipient) === 0) - throw new Error(`Invalid router or mintRecipient endpoint for chainId ${chainId}`); + throw new Error(`Invalid router or mintRecipient endpoint for wormholeChainId ${wormholeChainId}`); - await matchingEgine.addRouterEndpoint(chainId, offChainEndpoint, circleDomain.offChain); - log(`Router endpoint added for chainId ${chainId}`); + await matchingEngine.addRouterEndpoint(wormholeChainId, offChainEndpoint, circleDomain.offChain); + log(`Router endpoint added for wormholeChainId ${wormholeChainId}`); continue; } // Disable router endpoint, must be the three values zero if (Number(router?.offChain) === 0 && Number(mintRecipient?.offChain) === 0 && Number(circleDomain?.offChain) === 0) { - await matchingEgine.disableRouterEndpoint(chainId); - log(`Router endpoint disabled for chainId ${chainId}`); + await matchingEngine.disableRouterEndpoint(wormholeChainId); + log(`Router endpoint disabled for wormholeChainId ${wormholeChainId}`); continue; } @@ -68,14 +65,14 @@ runOnEvmsSequentially("config-matching-engine", async (chain: ChainInfo, signer: mintRecipient?.onChain.toString() !== mintRecipient?.offChain.toString() || circleDomain?.onChain.toString() !== circleDomain?.offChain.toString() ) { - if (chainId === 0) - throw new Error('Invalid chainId when adding new router endpoint'); + if (wormholeChainId === 0) + throw new Error('Invalid wormholeChainId when adding new router endpoint'); if (Number(offChainEndpoint.router) === 0 || Number(offChainEndpoint.mintRecipient) === 0) - throw new Error(`Invalid router or mintRecipient endpoint for chainId ${chainId}`); + throw new Error(`Invalid router or mintRecipient endpoint for wormholeChainId ${wormholeChainId}`); - await matchingEgine.updateRouterEndpoint(chainId, offChainEndpoint, circleDomain.offChain); - log(`Router endpoint updated for chainId ${chainId}`); + await matchingEngine.updateRouterEndpoint(wormholeChainId, offChainEndpoint, circleDomain.offChain); + log(`Router endpoint updated for wormholeChainId ${wormholeChainId}`); continue; } } diff --git a/deployment/scripts/evm/MatchingEngine/deploy-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/deploy-matching-engine.ts index 3214ddf9..bc997c71 100644 --- a/deployment/scripts/evm/MatchingEngine/deploy-matching-engine.ts +++ b/deployment/scripts/evm/MatchingEngine/deploy-matching-engine.ts @@ -1,14 +1,13 @@ import { ethers } from "ethers"; import { runOnEvms, ChainInfo, LoggerFn, writeDeployedContract } from "../../../helpers"; import { MatchingEngineConfiguration } from "../../../config/config-types"; - -import { ERC1967Proxy__factory } from "@certusone/wormhole-sdk/lib/cjs/ethers-contracts"; import { deployImplementation, getMachingEngineConfiguration } from "./utils"; +import { ERC1967Proxy__factory } from "../../../contract-bindings"; runOnEvms("deploy-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { const config = await getMachingEngineConfiguration(chain); const implementation = await deployImplementation(signer, config, log); - const proxy = await deployProxy(signer, config, implementation, log); + await deployProxy(signer, config, implementation, log); }); async function deployProxy(signer: ethers.Signer, config: MatchingEngineConfiguration, implementation: ethers.Contract, log: LoggerFn) { @@ -33,7 +32,7 @@ async function deployProxy(signer: ethers.Signer, config: MatchingEngineConfigur await deployment.deployed(); log(`MatchingEngineProxy deployed at ${deployment.address}`); - writeDeployedContract(config.chainId, "MatchingEngineProxy", deployment.address); + writeDeployedContract(config.chainId, "MatchingEngineProxy", deployment.address, [implementation.address, encodedCall]); return deployment; } \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/get-config-diff-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/get-config-diff-matching-engine.ts index 796920e3..bba7ccd9 100644 --- a/deployment/scripts/evm/MatchingEngine/get-config-diff-matching-engine.ts +++ b/deployment/scripts/evm/MatchingEngine/get-config-diff-matching-engine.ts @@ -4,7 +4,6 @@ import { getConfigurationDifferences, logDiff } from "./utils"; runOnEvms("get-config-diff-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { const diff = await getConfigurationDifferences(chain); - log(`MatchingEngine configuration differences on chain ${chain.chainId}:`); logDiff(diff, log); }); \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/register-new-token-router.ts b/deployment/scripts/evm/MatchingEngine/register-new-token-router.ts deleted file mode 100644 index 5d582183..00000000 --- a/deployment/scripts/evm/MatchingEngine/register-new-token-router.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { runOnEvms, ChainInfo, LoggerFn } from "../../../helpers"; -import { ethers } from "ethers"; - -runOnEvms("", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { - -}); \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/update-owner-assistant-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/update-owner-assistant-matching-engine.ts new file mode 100644 index 00000000..5b6c0d41 --- /dev/null +++ b/deployment/scripts/evm/MatchingEngine/update-owner-assistant-matching-engine.ts @@ -0,0 +1,35 @@ +import { MatchingEngine } from "../../../contract-bindings"; +import { runOnEvmsSequentially, ChainInfo, LoggerFn, getContractInstance, getContractAddress, logComparision } from "../../../helpers"; +import { ethers } from "ethers"; +import { getConfigurationDifferences } from "./utils"; +import confirm from '@inquirer/confirm'; + +runOnEvmsSequentially("update-owner-assistant-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + const matchingEngineAddress = getContractAddress("MatchingEngineProxy", chain.chainId); + const matchingEngine = (await getContractInstance("MatchingEngine", matchingEngineAddress, chain)) as MatchingEngine; + const diff = await getConfigurationDifferences(chain); + + + log(`MatchingEngine configuration differences on chain ${chain.chainId}:`); + logComparision('OwnerAssistant', diff.ownerAssistant, log); + + if (diff.ownerAssistant.onChain === diff.ownerAssistant.offChain) { + log(`No differences found on chain ${chain.chainId}`); + return; + } + + const updateOwnerAssistant: boolean = await confirm({ message: 'Continue?', default: false }); + if (!updateOwnerAssistant){ + log(`OwnerAssistant update aborted on chain ${chain.chainId}`); + return; + } + + const ownerAddress = await matchingEngine.getOwner(); + const signerAddress = await signer.getAddress(); + if (signerAddress !== ownerAddress) { + throw new Error(`Signer address ${signerAddress} is not the owner of MatchingEngine on chain ${chain.chainId}`); + } + + log(`Updating OwnerAssistant on chain ${chain.chainId}`); + await matchingEngine.updateOwnerAssistant(diff.ownerAssistant.offChain); +}); \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/upgrade-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/upgrade-matching-engine.ts index 0e483dce..4184e1d3 100644 --- a/deployment/scripts/evm/MatchingEngine/upgrade-matching-engine.ts +++ b/deployment/scripts/evm/MatchingEngine/upgrade-matching-engine.ts @@ -5,8 +5,8 @@ import { MatchingEngine } from "../../../contract-bindings"; import { MatchingEngineConfiguration } from "../../../config/config-types"; runOnEvms("upgrade-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { - const currentImplementationAddress = await getContractAddress("MatchingEngineImplementation", chain.chainId); - const proxyAddress = await getContractAddress("MatchingEngineProxy", chain.chainId); + const currentImplementationAddress = getContractAddress("MatchingEngineImplementation", chain.chainId); + const proxyAddress = getContractAddress("MatchingEngineProxy", chain.chainId); const proxy = (await getContractInstance("MatchingEngine", proxyAddress, chain)) as MatchingEngine; const config = await getMachingEngineConfiguration(chain); @@ -37,7 +37,7 @@ async function checkImmutables(matchingEngine: MatchingEngine, config: MatchingE matchingEngine.getAuctionPenaltyBlocks(), ]); - if (token !== tokenAddress) + if (token.toLowerCase() !== tokenAddress.toLowerCase()) throw new Error(`Token is an immutable value and cannot be changed.`); if (userPenaltyRewardBps !== Number(config.userPenaltyRewardBps)) diff --git a/deployment/scripts/evm/MatchingEngine/utils.ts b/deployment/scripts/evm/MatchingEngine/utils.ts index b1b627d7..01de2689 100644 --- a/deployment/scripts/evm/MatchingEngine/utils.ts +++ b/deployment/scripts/evm/MatchingEngine/utils.ts @@ -1,5 +1,5 @@ import { ethers } from "ethers"; -import { MatchingEngineConfiguration, RouterEndpointConfig } from "../../../config/config-types"; +import { MatchingEngineConfiguration } from "../../../config/config-types"; import { MatchingEngine, MatchingEngine__factory } from "../../../contract-bindings"; import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, getRouterEndpointDifferences, logComparision, someoneIsDifferent } from "../../../helpers"; import { ERC20 } from "../../../contract-bindings/out/ERC20"; @@ -10,11 +10,12 @@ export function getMachingEngineConfiguration(chain: ChainInfo): Promise { - const { router, mintRecipient } = await matchingEngine.getRouterEndpoint(chainId); + .map(async ({ wormholeChainId }) => { + const { router, mintRecipient } = await matchingEngine.getRouterEndpoint(wormholeChainId); return { - chainId, + wormholeChainId, endpoint: { router, mintRecipient }, - circleDomain: await matchingEngine.getDomain(chainId) + circleDomain: await matchingEngine.getDomain(wormholeChainId) } })); return { cctpAllowance, feeRecipient, + ownerAssistant, routerEndpoints }; } @@ -116,7 +130,7 @@ export function logDiff(differences: Record, log: LoggerFn) { logComparision('cctpAllowance', differences.cctpAllowance, log); let routersLogged = false; - for (const { chainId, router, mintRecipient, circleDomain } of differences.routerEndpoints) { + for (const { wormholeChainId, router, mintRecipient, circleDomain } of differences.routerEndpoints) { if (!someoneIsDifferent([router, mintRecipient, circleDomain])) continue; @@ -125,7 +139,7 @@ export function logDiff(differences: Record, log: LoggerFn) { routersLogged = true; } - log(`ChainId ${chainId}:`); + log(`WormholeChainId ${wormholeChainId}:`); logComparision('router', router, log); logComparision('mintRecipient', mintRecipient, log); logComparision('circleDomain', circleDomain, log); diff --git a/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts b/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts index 5d582183..d98b89f3 100644 --- a/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts @@ -1,6 +1,48 @@ -import { runOnEvms, ChainInfo, LoggerFn } from "../../../helpers"; +import { runOnEvms, ChainInfo, LoggerFn, getContractAddress, getDeploymentArgs, getVerifyCommand } from "../../../helpers"; import { ethers } from "ethers"; +import { execSync } from "child_process"; +import path from "path"; +import chalk from "chalk"; -runOnEvms("", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { +runOnEvms("bytecode-verification-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + // The root path of the foundry project + const rootPath = path.resolve('../evm/'); + // Implementation data + const implementationName = "TokenRouter"; + const implementationPath = 'src/TokenRouter/TokenRouter.sol'; + const implementationAddress = getContractAddress("TokenRouterImplementation", chain.chainId); + const implementationDeploymentArgs = getDeploymentArgs("TokenRouterImplementation", chain.chainId); + const implementationConstructorSignature = "constructor(address,address,address,uint16,bytes32,bytes32,uint32)"; + const verifyImplementationCommand = getVerifyCommand( + implementationName, + implementationPath, + implementationAddress, + implementationConstructorSignature, + implementationDeploymentArgs, + chain.chainId + ); + + // Proxy data + const proxyName = "ERC1967Proxy"; + const proxyPath = 'lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol'; + const proxyAddress = getContractAddress("TokenRouterProxy", chain.chainId); + const proxyDeploymentArgs = getDeploymentArgs("TokenRouterProxy", chain.chainId); + const proxyConstructorSignature = "constructor(address,bytes)"; + const verifyProxyCommand = getVerifyCommand( + proxyName, + proxyPath, + proxyAddress, + proxyConstructorSignature, + proxyDeploymentArgs, + chain.chainId + ); + + log(chalk.green("Verifying implementation bytecode...")); + execSync(verifyImplementationCommand, { stdio: "inherit", cwd: rootPath }); + console.log() + + log(chalk.green("Verifying proxy bytecode...")); + execSync(verifyProxyCommand, { stdio: "inherit", cwd: rootPath }); + console.log() }); \ No newline at end of file diff --git a/deployment/scripts/evm/TokenRouter/config-token-router.ts b/deployment/scripts/evm/TokenRouter/config-token-router.ts index c13f6da2..0f28176c 100644 --- a/deployment/scripts/evm/TokenRouter/config-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/config-token-router.ts @@ -1,4 +1,4 @@ -import { ChainInfo, LoggerFn, getContractInstance, getContractAddress, runOnEvmsSequentially, ValueDiff } from "../../../helpers"; +import { ChainInfo, LoggerFn, getContractInstance, getContractAddress, runOnEvmsSequentially, ValueDiff, getFormattedEndpoint } from "../../../helpers"; import { ethers } from "ethers"; import { getConfigurationDifferences, logDiff } from "./utils"; import confirm from '@inquirer/confirm'; @@ -6,7 +6,7 @@ import { TokenRouter } from "../../../contract-bindings"; import { FastTransferParametersStruct } from "../../../contract-bindings/evm/out/ITokenRouter"; runOnEvmsSequentially("config-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { - const tokenRouterAddress = await getContractAddress("TokenRouterProxy", chain.chainId); + const tokenRouterAddress = getContractAddress("TokenRouterProxy", chain.chainId); const tokenRouter = (await getContractInstance("TokenRouter", tokenRouterAddress, chain)) as TokenRouter; const diff = await getConfigurationDifferences(chain); @@ -31,29 +31,26 @@ runOnEvmsSequentially("config-token-router", async (chain: ChainInfo, signer: et } // Router endpoints - for (const { chainId, router, mintRecipient, circleDomain } of routerEndpoints) { - const offChainEndpoint = { - router: router.offChain, - mintRecipient: mintRecipient.offChain - }; + for (const { wormholeChainId, router, mintRecipient, circleDomain } of routerEndpoints) { + const offChainEndpoint = getFormattedEndpoint(router.offChain, mintRecipient.offChain); // Add new router endpoint if all values are zero if (Number(router?.onChain) === 0 && Number(mintRecipient?.onChain) === 0 && Number(circleDomain?.onChain) === 0) { - if (chainId === 0) - throw new Error('Invalid chainId when adding new router endpoint'); + if (wormholeChainId === 0) + throw new Error('Invalid wormholeChainId when adding new router endpoint'); if (Number(offChainEndpoint.router) === 0 || Number(offChainEndpoint.mintRecipient) === 0) - throw new Error(`Invalid router or mintRecipient endpoint for chainId ${chainId}`); + throw new Error(`Invalid router or mintRecipient endpoint for wormholeChainId ${wormholeChainId}`); - await tokenRouter.addRouterEndpoint(chainId, offChainEndpoint, circleDomain.offChain); - log(`Router endpoint added for chainId ${chainId}`); + await tokenRouter.addRouterEndpoint(wormholeChainId, offChainEndpoint, circleDomain.offChain); + log(`Router endpoint added for wormholeChainId ${wormholeChainId}`); continue; } // Disable router endpoint, must be the three values zero if (Number(router?.offChain) === 0 && Number(mintRecipient?.offChain) === 0 && Number(circleDomain?.offChain) === 0) { - await tokenRouter.disableRouterEndpoint(chainId); - log(`Router endpoint disabled for chainId ${chainId}`); + await tokenRouter.disableRouterEndpoint(wormholeChainId); + log(`Router endpoint disabled for wormholeChainId ${wormholeChainId}`); continue; } @@ -63,14 +60,14 @@ runOnEvmsSequentially("config-token-router", async (chain: ChainInfo, signer: et mintRecipient?.onChain.toString() !== mintRecipient?.offChain.toString() || circleDomain?.onChain.toString() !== circleDomain?.offChain.toString() ) { - if (chainId === 0) - throw new Error('Invalid chainId when adding new router endpoint'); + if (wormholeChainId === 0) + throw new Error('Invalid wormholeChainId when adding new router endpoint'); if (Number(offChainEndpoint.router) === 0 || Number(offChainEndpoint.mintRecipient) === 0) - throw new Error(`Invalid router or mintRecipient endpoint for chainId ${chainId}`); + throw new Error(`Invalid router or mintRecipient endpoint for chainId ${wormholeChainId}`); - await tokenRouter.updateRouterEndpoint(chainId, offChainEndpoint, circleDomain.offChain); - log(`Router endpoint updated for chainId ${chainId}`); + await tokenRouter.updateRouterEndpoint(wormholeChainId, offChainEndpoint, circleDomain.offChain); + log(`Router endpoint updated for chainId ${wormholeChainId}`); continue; } } diff --git a/deployment/scripts/evm/TokenRouter/deploy-token-router.ts b/deployment/scripts/evm/TokenRouter/deploy-token-router.ts index e8a3eb88..2fea4c5c 100644 --- a/deployment/scripts/evm/TokenRouter/deploy-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/deploy-token-router.ts @@ -1,13 +1,13 @@ import { ethers } from "ethers"; -import { ERC1967Proxy__factory } from "@certusone/wormhole-sdk/lib/cjs/ethers-contracts"; import { runOnEvms, ChainInfo, LoggerFn, writeDeployedContract } from "../../../helpers"; import { TokenRouterConfiguration } from "../../../config/config-types"; import { deployImplementation, getTokenRouterConfiguration } from "./utils"; +import { ERC1967Proxy__factory } from "../../../contract-bindings"; runOnEvms("deploy-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { const config = await getTokenRouterConfiguration(chain); - const implementation = await deployImplementation(signer, config, log); - const proxy = await deployProxy(signer, config, implementation, log); + const implementation = await deployImplementation(chain, signer, config, log); + await deployProxy(signer, config, implementation, log); }); async function deployProxy(signer: ethers.Signer, config: TokenRouterConfiguration, implementation: ethers.Contract, log: LoggerFn) { @@ -32,7 +32,7 @@ async function deployProxy(signer: ethers.Signer, config: TokenRouterConfigurati log(`TokenRouterProxy deployed at ${deployment.address}`); - writeDeployedContract(config.chainId, "TokenRouterProxy", deployment.address); + writeDeployedContract(config.chainId, "TokenRouterProxy", deployment.address, [implementation.address, encodedCall]); return deployment; } diff --git a/deployment/scripts/evm/TokenRouter/update-owner-assistant-token-router.ts b/deployment/scripts/evm/TokenRouter/update-owner-assistant-token-router.ts new file mode 100644 index 00000000..c387c8e8 --- /dev/null +++ b/deployment/scripts/evm/TokenRouter/update-owner-assistant-token-router.ts @@ -0,0 +1,35 @@ +import { TokenRouter } from "../../../contract-bindings"; +import { runOnEvmsSequentially, ChainInfo, LoggerFn, getContractInstance, getContractAddress, logComparision } from "../../../helpers"; +import { ethers } from "ethers"; +import { getConfigurationDifferences } from "./utils"; +import confirm from '@inquirer/confirm'; + +runOnEvmsSequentially("update-owner-assistant-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + const tokenRouterAddress = getContractAddress("TokenRouterProxy", chain.chainId); + const tokenRouter = (await getContractInstance("TokenRouter", tokenRouterAddress, chain)) as TokenRouter; + const diff = await getConfigurationDifferences(chain); + + + log(`TokenRouter configuration differences on chain ${chain.chainId}:`); + logComparision('OwnerAssistant', diff.ownerAssistant, log); + + if (diff.ownerAssistant.onChain === diff.ownerAssistant.offChain) { + log(`No differences found on chain ${chain.chainId}`); + return; + } + + const updateOwnerAssistant: boolean = await confirm({ message: 'Continue?', default: false }); + if (!updateOwnerAssistant){ + log(`OwnerAssistant update aborted on chain ${chain.chainId}`); + return; + } + + const ownerAddress = await tokenRouter.getOwner(); + const signerAddress = await signer.getAddress(); + if (signerAddress !== ownerAddress) { + throw new Error(`Signer address ${signerAddress} is not the owner of TokenRouter on chain ${chain.chainId}`); + } + + log(`Updating OwnerAssistant on chain ${chain.chainId}`); + await tokenRouter.updateOwnerAssistant(diff.ownerAssistant.offChain); +}); \ No newline at end of file diff --git a/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts b/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts index 98e9ae30..d66ea8c0 100644 --- a/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts @@ -1,19 +1,20 @@ -import { runOnEvms, ChainInfo, LoggerFn, getContractInstance, getContractAddress, getDependencyAddress } from "../../../helpers"; +import { runOnEvms, ChainInfo, LoggerFn, getContractInstance, getContractAddress, getDependencyAddress, getAddressType } from "../../../helpers"; import { ethers } from "ethers"; -import { deployImplementation, getAddressAsBytes32, getTokenRouterConfiguration } from "./utils"; +import { deployImplementation, getTokenRouterConfiguration } from "./utils"; import { TokenRouter } from "../../../contract-bindings"; import { TokenRouterConfiguration } from "../../../config/config-types"; +import { UniversalAddress } from "@wormhole-foundation/sdk-definitions"; runOnEvms("upgrade-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { - const currentImplementationAddress = await getContractAddress("TokenRouterImplementation", chain.chainId); - const proxyAddress = await getContractAddress("TokenRouterProxy", chain.chainId); + const currentImplementationAddress = getContractAddress("TokenRouterImplementation", chain.chainId); + const proxyAddress = getContractAddress("TokenRouterProxy", chain.chainId); const proxy = (await getContractInstance("TokenRouter", proxyAddress, chain)) as TokenRouter; const config = await getTokenRouterConfiguration(chain); log(`Checking immutables for TokenRouter`); checkImmutables(proxy, config, chain); - const newImplementation = await deployImplementation(signer, config, log); + const newImplementation = await deployImplementation(chain, signer, config, log); log(`Upgrading TokenRouter implementation from ${currentImplementationAddress} to ${newImplementation.address}`); @@ -35,12 +36,14 @@ async function checkImmutables(tokenRouter: TokenRouter, config: TokenRouterConf tokenRouter.matchingEngineAddress(), ]); - const expectedMatchingEngineMintRecipient = getAddressAsBytes32(config.matchingEngineMintRecipient); - const localMatchingEngineAddress = await getContractAddress("MatchingEngineProxy", chain.chainId); - const expectedMatchingEngineAddress = getAddressAsBytes32(localMatchingEngineAddress); + const mintRecipientAddressType = getAddressType(config.matchingEngineMintRecipient); + const expectedMatchingEngineMintRecipient = (new UniversalAddress(config.matchingEngineMintRecipient, mintRecipientAddressType)).toString(); + const localMatchingEngineAddress = getContractAddress("MatchingEngineProxy", chain.chainId); + const matchingEngineAddressType = getAddressType(localMatchingEngineAddress); + const expectedMatchingEngineAddress = (new UniversalAddress(localMatchingEngineAddress, matchingEngineAddressType)).toString(); const tokenAddress = getDependencyAddress("token", chain.chainId); - if (matchingEngineMintRecipient !== expectedMatchingEngineMintRecipient) + if (matchingEngineMintRecipient.toLowerCase() !== expectedMatchingEngineMintRecipient.toLowerCase()) throw new Error(`MatchingEngineMintRecipient is an immutable value and cannot be changed.`); if (matchingEngineChain !== Number(config.matchingEngineChain)) @@ -49,9 +52,9 @@ async function checkImmutables(tokenRouter: TokenRouter, config: TokenRouterConf if (matchingEngineDomain !== Number(config.matchingEngineDomain)) throw new Error(`MatchingEngineDomain is an immutable value and cannot be changed.`); - if (matchingEngineAddress !== expectedMatchingEngineAddress) + if (matchingEngineAddress.toLowerCase() !== expectedMatchingEngineAddress.toLowerCase()) throw new Error(`MatchingEngineAddress is an immutable value and cannot be changed.`); - if (token !== tokenAddress) + if (token.toLowerCase() !== tokenAddress.toLowerCase()) throw new Error(`Token is an immutable value and cannot be changed.`); } \ No newline at end of file diff --git a/deployment/scripts/evm/TokenRouter/utils.ts b/deployment/scripts/evm/TokenRouter/utils.ts index eb972e75..47b28785 100644 --- a/deployment/scripts/evm/TokenRouter/utils.ts +++ b/deployment/scripts/evm/TokenRouter/utils.ts @@ -1,27 +1,33 @@ -import { ChainId } from "@certusone/wormhole-sdk"; import { ethers } from "ethers"; import { TokenRouterConfiguration } from "../../../config/config-types"; import { TokenRouter, TokenRouter__factory } from "../../../contract-bindings"; -import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, getRouterEndpointDifferences, getAddressAsBytes32, logComparision, someoneIsDifferent } from "../../../helpers"; +import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, getRouterEndpointDifferences, logComparision, someoneIsDifferent, getAddressType } from "../../../helpers"; import { ERC20 } from "../../../contract-bindings/out/ERC20"; +import { chainIdToChain, nativeChainIds } from "@wormhole-foundation/sdk-base"; +import { UniversalAddress } from "@wormhole-foundation/sdk-definitions"; export function getTokenRouterConfiguration(chain: ChainInfo): Promise { return getChainConfig("token-router", chain.chainId); } -export async function deployImplementation(signer: ethers.Signer, config: TokenRouterConfiguration, log: LoggerFn) { +export async function deployImplementation(chain: ChainInfo, signer: ethers.Signer, config: TokenRouterConfiguration, log: LoggerFn) { const factory = new TokenRouter__factory(signer); - const token = getDependencyAddress("token", config.chainId); const wormhole = getDependencyAddress("wormhole", config.chainId); const tokenMessenger = getDependencyAddress("tokenMessenger", config.chainId); - const matchingEngineMintRecipient = getAddressAsBytes32(config.matchingEngineMintRecipient); + const mintRecipientAddressType = getAddressType(config.matchingEngineMintRecipient); + const matchingEngineMintRecipient = (new UniversalAddress(config.matchingEngineMintRecipient, mintRecipientAddressType)).toString(); - let matchingEngineAddress = await getContractAddress( + const { networkChainToNativeChainId } = nativeChainIds; + const chainName = chainIdToChain.get(Number(config.matchingEngineChain)); + const matchingEngineEvmChainId = parseInt(networkChainToNativeChainId.get(chain.type, chainName!)!.toString()); + let matchingEngineAddress = (getContractAddress( "MatchingEngineProxy", - Number(config.matchingEngineChain) as ChainId - ); - matchingEngineAddress = getAddressAsBytes32(matchingEngineAddress); + matchingEngineEvmChainId + )); + + const matchingEgineAdressType = getAddressType(matchingEngineAddress); + matchingEngineAddress = (new UniversalAddress(matchingEngineAddress, matchingEgineAdressType)).toString(); const deployment = await factory.deploy( token, @@ -38,40 +44,52 @@ export async function deployImplementation(signer: ethers.Signer, config: TokenR log(`TokenRouter deployed at ${deployment.address}`); - writeDeployedContract(config.chainId, "TokenRouterImplementation", deployment.address); + const constructorArgs = [ + token, + wormhole, + tokenMessenger, + config.matchingEngineChain, + matchingEngineAddress, + matchingEngineMintRecipient, + config.matchingEngineDomain + ]; + + writeDeployedContract(config.chainId, "TokenRouterImplementation", deployment.address, constructorArgs); return deployment; } export async function getOnChainTokenRouterConfiguration(chain: ChainInfo) { const config = await getTokenRouterConfiguration(chain); - const tokenRouterProxyAddress = await getContractAddress("TokenRouterProxy", chain.chainId); + const tokenRouterProxyAddress = getContractAddress("TokenRouterProxy", chain.chainId); const tokenRouter = (await getContractInstance("TokenRouter", tokenRouterProxyAddress, chain)) as TokenRouter; // Get the allowance for the token messenger const tokenMessengerAddress = getDependencyAddress("tokenMessenger", chain.chainId); const orderTokenAddress = await tokenRouter.orderToken(); const orderToken = (await getContractInstance("ERC20", orderTokenAddress, chain)) as ERC20; - const cctpAllowance = (await orderToken.allowance(tokenRouterProxyAddress, tokenMessengerAddress)).toString(); + const cctpAllowance = await orderToken.allowance(tokenRouterProxyAddress, tokenMessengerAddress); const routerEndpoints = await Promise.all(config .routerEndpoints - .map(async ({ chainId }) => { - const { router, mintRecipient } = await tokenRouter.getRouterEndpoint(chainId); + .map(async ({ wormholeChainId }) => { + const { router, mintRecipient } = await tokenRouter.getRouterEndpoint(wormholeChainId); return { - chainId, + wormholeChainId, endpoint: { router, mintRecipient }, - circleDomain: await tokenRouter.getDomain(chainId) + circleDomain: await tokenRouter.getDomain(wormholeChainId) } })); + const ownerAssistant = await tokenRouter.getOwnerAssistant(); const { enabled, maxAmount, baseFee, initAuctionFee} = await tokenRouter.getFastTransferParameters(); return { cctpAllowance, + ownerAssistant, fastTransferParameters: { enabled, maxAmount: maxAmount.toString(), @@ -125,7 +143,7 @@ export function logDiff(differences: Record, log: LoggerFn) { logComparision('cctpAllowance', differences.cctpAllowance, log); let routersLogged = false; - for (const { chainId, router, mintRecipient, circleDomain } of differences.routerEndpoints) { + for (const { wormholeChainId, router, mintRecipient, circleDomain } of differences.routerEndpoints) { if (!someoneIsDifferent([router, mintRecipient, circleDomain])) continue; @@ -134,7 +152,7 @@ export function logDiff(differences: Record, log: LoggerFn) { routersLogged = true; } - log(`ChainId ${chainId}:`); + log(`WormholeChainId ${wormholeChainId}:`); logComparision('router', router, log); logComparision('mintRecipient', mintRecipient, log); logComparision('circleDomain', circleDomain, log); From 1a533ceca598d3b21e0b7959b76cf28972f10a12 Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Tue, 2 Jul 2024 10:24:37 -0300 Subject: [PATCH 14/80] Add ecosystem json --- deployment/config/testnet/ecosystem.json | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 deployment/config/testnet/ecosystem.json diff --git a/deployment/config/testnet/ecosystem.json b/deployment/config/testnet/ecosystem.json new file mode 100644 index 00000000..1644993f --- /dev/null +++ b/deployment/config/testnet/ecosystem.json @@ -0,0 +1,9 @@ +{ + "evm": { + "operatingChains": [], + "networks": [] + }, + "solana": { + "networks": [] + } +} \ No newline at end of file From 0083a6b730cc57f92b0c9dc286d92e30ecfcf7e9 Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Tue, 2 Jul 2024 11:32:30 -0300 Subject: [PATCH 15/80] Update readme --- deployment/README.md | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/deployment/README.md b/deployment/README.md index 75da104d..f2f7e721 100644 --- a/deployment/README.md +++ b/deployment/README.md @@ -1 +1,39 @@ -# Contracts scrips \ No newline at end of file +# Contracts scrips + +### Before start + +- Install & Build + +``` +npm install +npm run build-evm +``` + +- Add the desired networks where you want to work on the [ecosystem file](./config/testnet/ecosystem.json) with the format: + +``` +type ChainInfo = { + name: string; + chainId: number; // EVM ChainId + rpc: string; + type: "Mainnet" | "Testnet" | "Devnet"; + externalId?: string; +} +``` + +- Configure the dependencies on the [dependencies file](./config/testnet/dependencies.json). + +- Add the config for each chain in the [MatchingEngine](./config/testnet/matching-engine.json) config file or the [TokenRouter](./config/testnet/token-router.json) config file. + + +### EVM scripts + +``` +npx tsx ./scripts/evm//.ts +``` + +### Solana scripts + +``` +npx tsx ./scripts/solana//.ts +``` \ No newline at end of file From 1caa884ab36e4ebf7b6d02d04ff35b1155100f31 Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Tue, 2 Jul 2024 11:38:56 -0300 Subject: [PATCH 16/80] Remove unused var --- deployment/helpers/solana.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/deployment/helpers/solana.ts b/deployment/helpers/solana.ts index 9e63e6a4..2521a1c8 100644 --- a/deployment/helpers/solana.ts +++ b/deployment/helpers/solana.ts @@ -1,7 +1,5 @@ import { PublicKey } from '@solana/web3.js'; -export const SOLANA_ADDRESS_LENGTH = 43; - export function validateSolAddress(address: string){ try { const pubkey = new PublicKey(address); From 8725e68a43b59f0f30bee11ed5e35127689ce599 Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Wed, 10 Jul 2024 14:34:37 -0300 Subject: [PATCH 17/80] Refactor verification scripts --- deployment/config/config-types.ts | 8 +- deployment/helpers/env.ts | 43 +-- deployment/helpers/interfaces.ts | 12 +- deployment/package-lock.json | 244 ++++++++++++++++-- deployment/package.json | 2 + .../bytecode-verification-matching-engine.ts | 7 +- .../bytecode-verification-token-router.ts | 7 +- deployment/scripts/evm/TokenRouter/utils.ts | 6 +- 8 files changed, 263 insertions(+), 66 deletions(-) diff --git a/deployment/config/config-types.ts b/deployment/config/config-types.ts index 1b4e4a59..e8441d60 100644 --- a/deployment/config/config-types.ts +++ b/deployment/config/config-types.ts @@ -11,8 +11,8 @@ export type RouterEndpointConfig = { } export type TokenRouterConfiguration = { - // EVM Chain ID of the token router configuration - chainId: number; + // Wormhole Chain ID of the token router configuration + chainId: ChainId; // Immutable values matchingEngineMintRecipient: string; @@ -32,8 +32,8 @@ export type TokenRouterConfiguration = { }; export type MatchingEngineConfiguration = { - // EVM Chain ID of the matching engine configuration - chainId: number; + // Wormhole Chain ID of the matching engine configuration + chainId: ChainId; // Immutable values userPenaltyRewardBps: string; diff --git a/deployment/helpers/env.ts b/deployment/helpers/env.ts index ef293383..49bd92b5 100644 --- a/deployment/helpers/env.ts +++ b/deployment/helpers/env.ts @@ -5,6 +5,7 @@ import { ChainConfig, ChainInfo, ContractsJson, Dependencies, Ecosystem } from " import { getSigner } from "./evm"; // TODO: support different env files import 'dotenv/config'; +import { ChainId } from "@wormhole-foundation/sdk-base"; export const env = getEnv("ENV"); export const contracts = loadContracts(); @@ -39,46 +40,46 @@ export function getEnv(env: string): string { return v; } -export async function getChainConfig(filename: string, evmChainId: number): Promise { +export async function getChainConfig(filename: string, whChainId: ChainId): Promise { const scriptConfig: T[] = await loadJson(filename); - const chainConfig = scriptConfig.find((x) => x.chainId == evmChainId); + const chainConfig = scriptConfig.find((x) => x.chainId == whChainId); if (!chainConfig) { - throw Error(`Failed to find chain config for chain ${evmChainId}`); + throw Error(`Failed to find chain config for chain ${whChainId}`); } return chainConfig; } -export function getContractAddress(contractName: string, evmChainId: number): string { - const contract = contracts[contractName]?.find((c) => c.chainId === evmChainId)?.address; +export function getContractAddress(contractName: string, whChainId: ChainId): string { + const contract = contracts[contractName]?.find((c) => c.chainId === whChainId)?.address; if (!contract) { - throw new Error(`No ${contractName} contract found for chain ${evmChainId}`); + throw new Error(`No ${contractName} contract found for chain ${whChainId}`); } if (!utils.isAddress(contract) && !validateSolAddress(contract)){ - throw new Error(`Invalid address for ${contractName} contract found for chain ${evmChainId}`); + throw new Error(`Invalid address for ${contractName} contract found for chain ${whChainId}`); } return contract; } -export function getDependencyAddress(dependencyName: string, evmChainId: number): string { - const chainDependencies = dependencies.find((d) => d.chainId === evmChainId); +export function getDependencyAddress(dependencyName: string, whChainId: ChainId): string { + const chainDependencies = dependencies.find((d) => d.chainId === whChainId); if (chainDependencies === undefined ) { - throw new Error(`No dependencies found for chain ${evmChainId}`); + throw new Error(`No dependencies found for chain ${whChainId}`); } const dependency = chainDependencies[dependencyName as keyof Dependencies] as string; if (dependency === undefined) { - throw new Error(`No dependency found for ${dependencyName} for chain ${evmChainId}`); + throw new Error(`No dependency found for ${dependencyName} for chain ${whChainId}`); } if (!utils.isAddress(dependency) && !validateSolAddress(dependency)){ - throw new Error(`Invalid address for ${dependencyName} dependency found for chain ${evmChainId}`); + throw new Error(`Invalid address for ${dependencyName} dependency found for chain ${whChainId}`); } return dependency; @@ -94,30 +95,30 @@ export async function getContractInstance( return factory.connect(contractAddress, signer); } -export function getDeploymentArgs(contractName: string, evmChainId: number): any[] { - const constructorArgs = contracts[contractName]?.find((c) => c.chainId === evmChainId)?.constructorArgs; +export function getDeploymentArgs(contractName: string, whChainId: ChainId): any[] { + const constructorArgs = contracts[contractName]?.find((c) => c.chainId === whChainId)?.constructorArgs; if (!constructorArgs) { - throw new Error(`No constructorArgs found for ${contractName} contract for chain ${evmChainId}`); + throw new Error(`No constructorArgs found for ${contractName} contract for chain ${whChainId}`); } return constructorArgs; } -export function writeDeployedContract(evmChainId: number, contractName: string, address: string, constructorArgs: any[] ) { +export function writeDeployedContract(whChainId: ChainId, contractName: string, address: string, constructorArgs: any[] ) { const contracts = loadContracts(); if (!contracts[contractName]) { - contracts[contractName] = [{ chainId: evmChainId, address, constructorArgs }]; + contracts[contractName] = [{ chainId: whChainId, address, constructorArgs }]; } - else if (!contracts[contractName].find((c) => c.chainId === evmChainId)) { - contracts[contractName].push({ chainId: evmChainId, address, constructorArgs }); + else if (!contracts[contractName].find((c) => c.chainId === whChainId)) { + contracts[contractName].push({ chainId: whChainId, address, constructorArgs }); } else { contracts[contractName] = contracts[contractName].map((c) => { - if (c.chainId === evmChainId) { - return { chainId: evmChainId, address, constructorArgs }; + if (c.chainId === whChainId) { + return { chainId: whChainId, address, constructorArgs }; } return c; diff --git a/deployment/helpers/interfaces.ts b/deployment/helpers/interfaces.ts index 83c7c1d0..8a3e137f 100644 --- a/deployment/helpers/interfaces.ts +++ b/deployment/helpers/interfaces.ts @@ -1,19 +1,21 @@ +import { ChainId } from "@wormhole-foundation/sdk-base"; +import { SolanaLedgerSigner } from "@xlabs-xyz/ledger-signer-solana"; import { ethers } from "ethers"; export type EvmScriptCb = (chain: ChainInfo, signer: ethers.Signer, logFn: LoggerFn) => Promise; +export type SolanaScriptCb = (chain: ChainInfo, signer: SolanaLedgerSigner, logFn: LoggerFn) => Promise; export type LoggerFn = (...args: any[]) => void; export type ChainInfo = { name: string; - chainId: number; // EVM ChainId + chainId: ChainId; // Wormhole ChainId rpc: string; - type: "Mainnet" | "Testnet" | "Devnet"; - externalId?: string; + externalId?: string; // Native ChainId }; export type Deployment = { - chainId: number; // EVM ChainId + chainId: number; // Wormhole ChainId address: string; constructorArgs?: any[]; }; @@ -32,7 +34,7 @@ export type Ecosystem = { export type ContractsJson = Record; export interface ChainConfig { - chainId: number; // EVM ChainId + chainId: ChainId; // Wormhole ChainId } export interface Dependencies extends ChainConfig { diff --git a/deployment/package-lock.json b/deployment/package-lock.json index bd8802b5..87901692 100644 --- a/deployment/package-lock.json +++ b/deployment/package-lock.json @@ -6,6 +6,7 @@ "": { "name": "deployment", "devDependencies": { + "@coral-xyz/anchor": "^0.30.1", "@inquirer/confirm": "^3.1.9", "@solana/web3.js": "^1.92.2", "@typechain/ethers-v5": "^11.1.2", @@ -13,6 +14,7 @@ "@wormhole-foundation/sdk-base": "^0.7.0", "@wormhole-foundation/sdk-definitions": "^0.7.0", "@xlabs-xyz/ledger-signer": "^0.0.4", + "@xlabs-xyz/ledger-signer-solana": "^0.0.1", "chalk": "^4.1.2", "dotenv": "^16.4.5", "ethers": "^5.7.2", @@ -33,6 +35,63 @@ "node": ">=6.9.0" } }, + "node_modules/@coral-xyz/anchor": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@coral-xyz/anchor/-/anchor-0.30.1.tgz", + "integrity": "sha512-gDXFoF5oHgpriXAaLpxyWBHdCs8Awgf/gLHIo6crv7Aqm937CNdY+x+6hoj7QR5vaJV7MxWSQ0NGFzL3kPbWEQ==", + "dev": true, + "dependencies": { + "@coral-xyz/anchor-errors": "^0.30.1", + "@coral-xyz/borsh": "^0.30.1", + "@noble/hashes": "^1.3.1", + "@solana/web3.js": "^1.68.0", + "bn.js": "^5.1.2", + "bs58": "^4.0.1", + "buffer-layout": "^1.2.2", + "camelcase": "^6.3.0", + "cross-fetch": "^3.1.5", + "crypto-hash": "^1.3.0", + "eventemitter3": "^4.0.7", + "pako": "^2.0.3", + "snake-case": "^3.0.4", + "superstruct": "^0.15.4", + "toml": "^3.0.0" + }, + "engines": { + "node": ">=11" + } + }, + "node_modules/@coral-xyz/anchor-errors": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@coral-xyz/anchor-errors/-/anchor-errors-0.30.1.tgz", + "integrity": "sha512-9Mkradf5yS5xiLWrl9WrpjqOrAV+/W2RQHDlbnAZBivoGpOs1ECjoDCkVk4aRG8ZdiFiB8zQEVlxf+8fKkmSfQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/@coral-xyz/anchor/node_modules/superstruct": { + "version": "0.15.5", + "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.15.5.tgz", + "integrity": "sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ==", + "dev": true + }, + "node_modules/@coral-xyz/borsh": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@coral-xyz/borsh/-/borsh-0.30.1.tgz", + "integrity": "sha512-aaxswpPrCFKl8vZTbxLssA2RvwX2zmKLlRCIktJOwW+VpVwYtXRtlWiIP+c2pPRKneiTiWCN2GEMSH9j1zTlWQ==", + "dev": true, + "dependencies": { + "bn.js": "^5.1.2", + "buffer-layout": "^1.2.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@solana/web3.js": "^1.68.0" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", @@ -1319,6 +1378,17 @@ "proxy-from-env": "^1.1.0" } }, + "node_modules/@ledgerhq/hw-app-solana": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-app-solana/-/hw-app-solana-7.1.4.tgz", + "integrity": "sha512-xOrCPKzF6RnqD9eRyjltJkWQDS39/Wev3GxvD4sKYuhERdZ+W8Gg0/nxKK468qGNPwhiDaRj7inPKGSMNCADqQ==", + "dev": true, + "dependencies": { + "@ledgerhq/errors": "^6.16.2", + "@ledgerhq/hw-transport": "^6.30.4", + "bip32-path": "^0.4.2" + } + }, "node_modules/@ledgerhq/hw-transport": { "version": "6.30.6", "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-6.30.6.tgz", @@ -1465,15 +1535,6 @@ "superstruct": "^1.0.4" } }, - "node_modules/@solana/web3.js/node_modules/bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", - "dev": true, - "dependencies": { - "base-x": "^3.0.2" - } - }, "node_modules/@typechain/ethers-v5": { "version": "11.1.2", "resolved": "https://registry.npmjs.org/@typechain/ethers-v5/-/ethers-v5-11.1.2.tgz", @@ -1577,6 +1638,45 @@ "ethers": "^5.7.2" } }, + "node_modules/@xlabs-xyz/ledger-signer-solana": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@xlabs-xyz/ledger-signer-solana/-/ledger-signer-solana-0.0.1.tgz", + "integrity": "sha512-2h9BNc0UYzqbV+S0GDxvh3nV6OSpUOVcbBwQGP0ckl1TAKbwgSzJ+1VYt4xVFJWHLntvfoOpH+DV4LszGWOSNA==", + "dev": true, + "dependencies": { + "@ledgerhq/hw-app-solana": "7.1.4", + "@ledgerhq/hw-transport": "6.30.4", + "@ledgerhq/hw-transport-node-hid": "6.28.4" + } + }, + "node_modules/@xlabs-xyz/ledger-signer-solana/node_modules/@ledgerhq/hw-transport": { + "version": "6.30.4", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-6.30.4.tgz", + "integrity": "sha512-VBcVd7UG8HDrjWMoZI5rqBDz+PBxLHTIPZOGY/fdMoEUwaBbss0Z3MxuJanMyerlfaLqnBSVuL0blz7rOyagkw==", + "dev": true, + "dependencies": { + "@ledgerhq/devices": "^8.2.1", + "@ledgerhq/errors": "^6.16.2", + "@ledgerhq/logs": "^6.12.0", + "events": "^3.3.0" + } + }, + "node_modules/@xlabs-xyz/ledger-signer-solana/node_modules/@ledgerhq/hw-transport-node-hid": { + "version": "6.28.4", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-node-hid/-/hw-transport-node-hid-6.28.4.tgz", + "integrity": "sha512-f6yQvZe4cwg6ibRn1YE9wWTdvpyT7FBIxxYHAd4RKm0l5/WFZS2G8CwdNJQwlOr89iBgGvEswWYh8EhUxM5QYA==", + "dev": true, + "dependencies": { + "@ledgerhq/devices": "^8.2.1", + "@ledgerhq/errors": "^6.16.2", + "@ledgerhq/hw-transport": "^6.30.4", + "@ledgerhq/hw-transport-node-hid-noevents": "^6.29.4", + "@ledgerhq/logs": "^6.12.0", + "lodash": "^4.17.21", + "node-hid": "^2.1.2", + "usb": "2.9.0" + } + }, "node_modules/aes-js": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", @@ -1727,6 +1827,12 @@ "file-uri-to-path": "1.0.0" } }, + "node_modules/bip32-path": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/bip32-path/-/bip32-path-0.4.2.tgz", + "integrity": "sha512-ZBMCELjJfcNMkz5bDuJ1WrYvjlhEF5k6mQ8vUr4N7MbVRsXei7ZOg8VhhwMfNiW68NWmLkgkc6WvTickrLGprQ==", + "dev": true + }, "node_modules/bl": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", @@ -1779,15 +1885,6 @@ "text-encoding-utf-8": "^1.0.2" } }, - "node_modules/borsh/node_modules/bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", - "dev": true, - "dependencies": { - "base-x": "^3.0.2" - } - }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -1804,6 +1901,15 @@ "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", "dev": true }, + "node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dev": true, + "dependencies": { + "base-x": "^3.0.2" + } + }, "node_modules/bs58check": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", @@ -1815,15 +1921,6 @@ "safe-buffer": "^5.1.2" } }, - "node_modules/bs58check/node_modules/bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", - "dev": true, - "dependencies": { - "base-x": "^3.0.2" - } - }, "node_modules/buffer": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", @@ -1848,6 +1945,15 @@ "ieee754": "^1.2.1" } }, + "node_modules/buffer-layout": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/buffer-layout/-/buffer-layout-1.2.2.tgz", + "integrity": "sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==", + "dev": true, + "engines": { + "node": ">=4.5" + } + }, "node_modules/bufferutil": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.8.tgz", @@ -1862,6 +1968,18 @@ "node": ">=6.14.2" } }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -2074,6 +2192,27 @@ "sha.js": "^2.4.0" } }, + "node_modules/cross-fetch": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz", + "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==", + "dev": true, + "dependencies": { + "node-fetch": "^2.6.12" + } + }, + "node_modules/crypto-hash": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/crypto-hash/-/crypto-hash-1.3.0.tgz", + "integrity": "sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/crypto-js": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz", @@ -2157,6 +2296,16 @@ "node": ">=8" } }, + "node_modules/dot-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", + "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", + "dev": true, + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, "node_modules/dotenv": { "version": "16.4.5", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", @@ -2709,6 +2858,15 @@ "loose-envify": "cli.js" } }, + "node_modules/lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "dev": true, + "dependencies": { + "tslib": "^2.0.3" + } + }, "node_modules/md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -2825,6 +2983,16 @@ "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", "dev": true }, + "node_modules/no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "dev": true, + "dependencies": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, "node_modules/node-abi": { "version": "3.62.0", "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.62.0.tgz", @@ -2907,6 +3075,12 @@ "wrappy": "1" } }, + "node_modules/pako": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", + "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==", + "dev": true + }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -3227,6 +3401,16 @@ "simple-concat": "^1.0.0" } }, + "node_modules/snake-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", + "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", + "dev": true, + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -3371,6 +3555,12 @@ "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", "dev": true }, + "node_modules/toml": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", + "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==", + "dev": true + }, "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", diff --git a/deployment/package.json b/deployment/package.json index 7a611d23..f22cb30b 100644 --- a/deployment/package.json +++ b/deployment/package.json @@ -6,6 +6,7 @@ }, "author": "", "devDependencies": { + "@coral-xyz/anchor": "^0.30.1", "@inquirer/confirm": "^3.1.9", "@solana/web3.js": "^1.92.2", "@typechain/ethers-v5": "^11.1.2", @@ -13,6 +14,7 @@ "@wormhole-foundation/sdk-base": "^0.7.0", "@wormhole-foundation/sdk-definitions": "^0.7.0", "@xlabs-xyz/ledger-signer": "^0.0.4", + "@xlabs-xyz/ledger-signer-solana": "^0.0.1", "chalk": "^4.1.2", "dotenv": "^16.4.5", "ethers": "^5.7.2", diff --git a/deployment/scripts/evm/MatchingEngine/bytecode-verification-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/bytecode-verification-matching-engine.ts index 75e65453..122cb965 100644 --- a/deployment/scripts/evm/MatchingEngine/bytecode-verification-matching-engine.ts +++ b/deployment/scripts/evm/MatchingEngine/bytecode-verification-matching-engine.ts @@ -8,6 +8,9 @@ runOnEvms("bytecode-verification-matching-engine", async (chain: ChainInfo, sign // The root path of the foundry project const rootPath = path.resolve('../evm/'); + if (chain.externalId === undefined) + throw new Error(`Chain ${chain.chainId} does not have an external ID`); + // Implementation data const implementationName = "MatchingEngine"; const implementationPath = 'src/MatchingEngine/MatchingEngine.sol'; @@ -20,7 +23,7 @@ runOnEvms("bytecode-verification-matching-engine", async (chain: ChainInfo, sign implementationAddress, implementationConstructorSignature, implementationDeploymentArgs, - chain.chainId + parseInt(chain.externalId) ); // Proxy data @@ -35,7 +38,7 @@ runOnEvms("bytecode-verification-matching-engine", async (chain: ChainInfo, sign proxyAddress, proxyConstructorSignature, proxyDeploymentArgs, - chain.chainId + parseInt(chain.externalId) ); log(chalk.green("Verifying implementation bytecode...")); diff --git a/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts b/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts index d98b89f3..8ca7e0f6 100644 --- a/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts @@ -8,6 +8,9 @@ runOnEvms("bytecode-verification-token-router", async (chain: ChainInfo, signer: // The root path of the foundry project const rootPath = path.resolve('../evm/'); + if (chain.externalId === undefined) + throw new Error(`Chain ${chain.chainId} does not have an external ID`); + // Implementation data const implementationName = "TokenRouter"; const implementationPath = 'src/TokenRouter/TokenRouter.sol'; @@ -20,7 +23,7 @@ runOnEvms("bytecode-verification-token-router", async (chain: ChainInfo, signer: implementationAddress, implementationConstructorSignature, implementationDeploymentArgs, - chain.chainId + parseInt(chain.externalId) ); // Proxy data @@ -35,7 +38,7 @@ runOnEvms("bytecode-verification-token-router", async (chain: ChainInfo, signer: proxyAddress, proxyConstructorSignature, proxyDeploymentArgs, - chain.chainId + parseInt(chain.externalId) ); log(chalk.green("Verifying implementation bytecode...")); diff --git a/deployment/scripts/evm/TokenRouter/utils.ts b/deployment/scripts/evm/TokenRouter/utils.ts index 47b28785..5c038afd 100644 --- a/deployment/scripts/evm/TokenRouter/utils.ts +++ b/deployment/scripts/evm/TokenRouter/utils.ts @@ -3,7 +3,6 @@ import { TokenRouterConfiguration } from "../../../config/config-types"; import { TokenRouter, TokenRouter__factory } from "../../../contract-bindings"; import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, getRouterEndpointDifferences, logComparision, someoneIsDifferent, getAddressType } from "../../../helpers"; import { ERC20 } from "../../../contract-bindings/out/ERC20"; -import { chainIdToChain, nativeChainIds } from "@wormhole-foundation/sdk-base"; import { UniversalAddress } from "@wormhole-foundation/sdk-definitions"; export function getTokenRouterConfiguration(chain: ChainInfo): Promise { @@ -18,12 +17,9 @@ export async function deployImplementation(chain: ChainInfo, signer: ethers.Sign const mintRecipientAddressType = getAddressType(config.matchingEngineMintRecipient); const matchingEngineMintRecipient = (new UniversalAddress(config.matchingEngineMintRecipient, mintRecipientAddressType)).toString(); - const { networkChainToNativeChainId } = nativeChainIds; - const chainName = chainIdToChain.get(Number(config.matchingEngineChain)); - const matchingEngineEvmChainId = parseInt(networkChainToNativeChainId.get(chain.type, chainName!)!.toString()); let matchingEngineAddress = (getContractAddress( "MatchingEngineProxy", - matchingEngineEvmChainId + chain.chainId )); const matchingEgineAdressType = getAddressType(matchingEngineAddress); From dbb637b39a1318ba2493f28cda4bfc7c07f63d2c Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Mon, 15 Jul 2024 11:37:03 -0300 Subject: [PATCH 18/80] Deprecate matching engine evm scripts --- .../bytecode-verification-matching-engine.ts | 97 +++++++++++-------- .../MatchingEngine/config-matching-engine.ts | 34 ++++--- .../MatchingEngine/deploy-matching-engine.ts | 5 + .../disable-router-matching-engine.ts | 37 +++++++ .../get-config-diff-matching-engine.ts | 5 + .../read-config-matching-engine.ts | 5 + .../update-owner-assistant-matching-engine.ts | 5 + .../MatchingEngine/upgrade-matching-engine.ts | 5 + .../scripts/evm/MatchingEngine/utils.ts | 23 ++++- 9 files changed, 159 insertions(+), 57 deletions(-) create mode 100644 deployment/scripts/evm/MatchingEngine/disable-router-matching-engine.ts diff --git a/deployment/scripts/evm/MatchingEngine/bytecode-verification-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/bytecode-verification-matching-engine.ts index 122cb965..3352cf3d 100644 --- a/deployment/scripts/evm/MatchingEngine/bytecode-verification-matching-engine.ts +++ b/deployment/scripts/evm/MatchingEngine/bytecode-verification-matching-engine.ts @@ -1,51 +1,66 @@ -import { runOnEvms, ChainInfo, LoggerFn, getContractAddress, getDeploymentArgs, getVerifyCommand } from "../../../helpers"; +import { runOnEvms, ChainInfo, LoggerFn, getContractAddress, getDeploymentArgs, getVerifyCommand, verificationApiKeys, flattenObject } from "../../../helpers"; import { ethers } from "ethers"; import { execSync } from "child_process"; import path from "path"; import chalk from "chalk"; runOnEvms("bytecode-verification-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + + console.warn(chalk.yellow("This script is deprecated due to the only MatchingEngine contract is deployed in Solana.")) + throw new Error("This script is deprecated due to the only MatchingEngine contract is deployed in Solana."); + // The root path of the foundry project const rootPath = path.resolve('../evm/'); - if (chain.externalId === undefined) - throw new Error(`Chain ${chain.chainId} does not have an external ID`); - - // Implementation data - const implementationName = "MatchingEngine"; - const implementationPath = 'src/MatchingEngine/MatchingEngine.sol'; - const implementationAddress = getContractAddress("MatchingEngineImplementation", chain.chainId); - const implementationDeploymentArgs = getDeploymentArgs("MatchingEngineImplementation", chain.chainId); - const implementationConstructorSignature = "constructor(address,address,address,uint24,uint24,uint8,uint8,uint8)"; - const verifyImplementationCommand = getVerifyCommand( - implementationName, - implementationPath, - implementationAddress, - implementationConstructorSignature, - implementationDeploymentArgs, - parseInt(chain.externalId) - ); - - // Proxy data - const proxyName = "ERC1967Proxy"; - const proxyPath = 'lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol'; - const proxyAddress = getContractAddress("MatchingEngineProxy", chain.chainId); - const proxyDeploymentArgs = getDeploymentArgs("MatchingEngineProxy", chain.chainId); - const proxyConstructorSignature = "constructor(address,bytes)"; - const verifyProxyCommand = getVerifyCommand( - proxyName, - proxyPath, - proxyAddress, - proxyConstructorSignature, - proxyDeploymentArgs, - parseInt(chain.externalId) - ); - - log(chalk.green("Verifying implementation bytecode...")); - execSync(verifyImplementationCommand, { stdio: "inherit", cwd: rootPath }); - console.log() - - log(chalk.green("Verifying proxy bytecode...")); - execSync(verifyProxyCommand, { stdio: "inherit", cwd: rootPath }); - console.log() + + const verifiersData = verificationApiKeys.find((x) => x.chainId == chain.chainId); + const verifiers = flattenObject(verifiersData!); + delete verifiers.chainId; + + + for (let [name, value] of Object.entries(verifiers)) { + name = name.split("-")[0]; + + // Implementation data + const implementationName = "MatchingEngine"; + const implementationPath = 'src/MatchingEngine/MatchingEngine.sol'; + const implementationAddress = getContractAddress("MatchingEngineImplementation", chain.chainId); + const implementationDeploymentArgs = getDeploymentArgs("MatchingEngineImplementation", chain.chainId); + const implementationConstructorSignature = "constructor(address,address,address,uint24,uint24,uint8,uint8,uint8)"; + const verifyImplementationCommand = getVerifyCommand( + chain, + implementationName, + implementationPath, + implementationAddress, + implementationConstructorSignature, + implementationDeploymentArgs, + name, + value + ); + + // Proxy data + const proxyName = "ERC1967Proxy"; + const proxyPath = 'lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol'; + const proxyAddress = getContractAddress("MatchingEngineProxy", chain.chainId); + const proxyDeploymentArgs = getDeploymentArgs("MatchingEngineProxy", chain.chainId); + const proxyConstructorSignature = "constructor(address,bytes)"; + const verifyProxyCommand = getVerifyCommand( + chain, + proxyName, + proxyPath, + proxyAddress, + proxyConstructorSignature, + proxyDeploymentArgs, + name, + value + ); + + log(chalk.green("Verifying implementation bytecode...")); + execSync(verifyImplementationCommand, { stdio: "inherit", cwd: rootPath }); + console.log() + + log(chalk.green("Verifying proxy bytecode...")); + execSync(verifyProxyCommand, { stdio: "inherit", cwd: rootPath }); + console.log() + } }); \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts index 1b993a56..de52ba98 100644 --- a/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts +++ b/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts @@ -3,14 +3,22 @@ import { runOnEvmsSequentially, ChainInfo, LoggerFn, getContractInstance, getCon import { ethers } from "ethers"; import { getConfigurationDifferences, logDiff } from "./utils"; import confirm from '@inquirer/confirm'; +import { inspect } from "util"; +import chalk from "chalk"; runOnEvmsSequentially("config-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + + console.warn(chalk.yellow("This script is deprecated due to the only MatchingEngine contract is deployed in Solana.")) + throw new Error("This script is deprecated due to the only MatchingEngine contract is deployed in Solana."); + const matchingEngineAddress = getContractAddress("MatchingEngineProxy", chain.chainId); const matchingEngine = (await getContractInstance("MatchingEngine", matchingEngineAddress, chain)) as MatchingEngine; const diff = await getConfigurationDifferences(chain); + console.log(inspect(diff, { depth: null, colors: true })); + log(`MatchingEngine configuration differences on chain ${chain.chainId}:`); - logDiff(diff, log); + logDiff(diff, log, ["new", "update"]); const deployConfig: boolean = await confirm({ message: 'Continue?', default: false }); if (!deployConfig){ @@ -37,7 +45,10 @@ runOnEvmsSequentially("config-matching-engine", async (chain: ChainInfo, signer: // Router endpoints for (const { wormholeChainId, router, mintRecipient, circleDomain } of routerEndpoints) { - const offChainEndpoint = getFormattedEndpoint(router.offChain, mintRecipient.offChain); + const offChainEndpoint = { + router: router.offChain, + mintRecipient: mintRecipient.offChain + }; // Add new router endpoint if all values are zero if (Number(router?.onChain) === 0 && Number(mintRecipient?.onChain) === 0 && Number(circleDomain?.onChain) === 0) { @@ -52,19 +63,18 @@ runOnEvmsSequentially("config-matching-engine", async (chain: ChainInfo, signer: continue; } - // Disable router endpoint, must be the three values zero - if (Number(router?.offChain) === 0 && Number(mintRecipient?.offChain) === 0 && Number(circleDomain?.offChain) === 0) { - await matchingEngine.disableRouterEndpoint(wormholeChainId); - log(`Router endpoint disabled for wormholeChainId ${wormholeChainId}`); - continue; - } - // Update router endpoint if ( - router?.onChain.toString() !== router?.offChain.toString() || - mintRecipient?.onChain.toString() !== mintRecipient?.offChain.toString() || + router?.onChain.toString() !== offChainEndpoint.router.toString() || + mintRecipient?.onChain.toString() !== offChainEndpoint.mintRecipient.toString() || circleDomain?.onChain.toString() !== circleDomain?.offChain.toString() - ) { + ) { + + if (Number(router?.offChain) === 0 && Number(mintRecipient?.offChain) === 0 && Number(circleDomain?.offChain) === 0) { + log(`Router endpoint already disabled for wormholeChainId ${wormholeChainId}.`); + continue; + } + if (wormholeChainId === 0) throw new Error('Invalid wormholeChainId when adding new router endpoint'); diff --git a/deployment/scripts/evm/MatchingEngine/deploy-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/deploy-matching-engine.ts index bc997c71..204c8ee6 100644 --- a/deployment/scripts/evm/MatchingEngine/deploy-matching-engine.ts +++ b/deployment/scripts/evm/MatchingEngine/deploy-matching-engine.ts @@ -3,8 +3,13 @@ import { runOnEvms, ChainInfo, LoggerFn, writeDeployedContract } from "../../../ import { MatchingEngineConfiguration } from "../../../config/config-types"; import { deployImplementation, getMachingEngineConfiguration } from "./utils"; import { ERC1967Proxy__factory } from "../../../contract-bindings"; +import chalk from "chalk"; runOnEvms("deploy-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + + console.warn(chalk.yellow("This script is deprecated due to the only MatchingEngine contract is deployed in Solana.")) + throw new Error("This script is deprecated due to the only MatchingEngine contract is deployed in Solana."); + const config = await getMachingEngineConfiguration(chain); const implementation = await deployImplementation(signer, config, log); await deployProxy(signer, config, implementation, log); diff --git a/deployment/scripts/evm/MatchingEngine/disable-router-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/disable-router-matching-engine.ts new file mode 100644 index 00000000..89917adf --- /dev/null +++ b/deployment/scripts/evm/MatchingEngine/disable-router-matching-engine.ts @@ -0,0 +1,37 @@ +import { MatchingEngine } from "../../../contract-bindings"; +import { runOnEvmsSequentially, ChainInfo, LoggerFn, getContractInstance, getContractAddress } from "../../../helpers"; +import { ethers } from "ethers"; +import { getConfigurationDifferences, logRoutersDiff } from "./utils"; +import confirm from '@inquirer/confirm'; +import chalk from "chalk"; + +runOnEvmsSequentially("disable-router-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + + console.warn(chalk.yellow("This script is deprecated due to the only MatchingEngine contract is deployed in Solana.")) + throw new Error("This script is deprecated due to the only MatchingEngine contract is deployed in Solana."); + + const matchingEngineAddress = getContractAddress("MatchingEngineProxy", chain.chainId); + const matchingEngine = (await getContractInstance("MatchingEngine", matchingEngineAddress, chain)) as MatchingEngine; + const diff = await getConfigurationDifferences(chain); + + log(`MatchingEngine configuration differences on chain ${chain.chainId}:`); + logRoutersDiff(diff, log, ["delete"]); + + const deployConfig: boolean = await confirm({ message: 'Continue?', default: false }); + if (!deployConfig){ + log(`Configuration deployment aborted on chain ${chain.chainId}`); + return; + } + + const { routerEndpoints } = diff; + + // Router endpoints + for (const { wormholeChainId, router, mintRecipient, circleDomain } of routerEndpoints) { + + // Disable router endpoint, must be the three values zero + if (Number(router?.offChain) === 0 && Number(mintRecipient?.offChain) === 0 && Number(circleDomain?.offChain) === 0) { + await matchingEngine.disableRouterEndpoint(wormholeChainId); + log(`Router endpoint disabled for wormholeChainId ${wormholeChainId}`); + } + } +}); \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/get-config-diff-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/get-config-diff-matching-engine.ts index bba7ccd9..5bb9a27d 100644 --- a/deployment/scripts/evm/MatchingEngine/get-config-diff-matching-engine.ts +++ b/deployment/scripts/evm/MatchingEngine/get-config-diff-matching-engine.ts @@ -1,8 +1,13 @@ import { runOnEvms, ChainInfo, LoggerFn } from "../../../helpers"; import { ethers } from "ethers"; import { getConfigurationDifferences, logDiff } from "./utils"; +import chalk from "chalk"; runOnEvms("get-config-diff-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + + console.warn(chalk.yellow("This script is deprecated due to the only MatchingEngine contract is deployed in Solana.")) + throw new Error("This script is deprecated due to the only MatchingEngine contract is deployed in Solana."); + const diff = await getConfigurationDifferences(chain); log(`MatchingEngine configuration differences on chain ${chain.chainId}:`); logDiff(diff, log); diff --git a/deployment/scripts/evm/MatchingEngine/read-config-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/read-config-matching-engine.ts index d47e37c9..ef56c305 100644 --- a/deployment/scripts/evm/MatchingEngine/read-config-matching-engine.ts +++ b/deployment/scripts/evm/MatchingEngine/read-config-matching-engine.ts @@ -2,8 +2,13 @@ import { runOnEvms, ChainInfo, LoggerFn } from "../../../helpers"; import { ethers } from "ethers"; import { getOnChainMachingEngineConfiguration } from "./utils"; import { inspect } from "util"; +import chalk from "chalk"; runOnEvms("read-config-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + + console.warn(chalk.yellow("This script is deprecated due to the only MatchingEngine contract is deployed in Solana.")) + throw new Error("This script is deprecated due to the only MatchingEngine contract is deployed in Solana."); + const onChainConfig = await getOnChainMachingEngineConfiguration(chain); log(`MatchingEngine configuration for chainId ${chain.chainId}:`); log(inspect(onChainConfig, { depth: null, colors: true, compact: true })); diff --git a/deployment/scripts/evm/MatchingEngine/update-owner-assistant-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/update-owner-assistant-matching-engine.ts index 5b6c0d41..0c16024e 100644 --- a/deployment/scripts/evm/MatchingEngine/update-owner-assistant-matching-engine.ts +++ b/deployment/scripts/evm/MatchingEngine/update-owner-assistant-matching-engine.ts @@ -3,8 +3,13 @@ import { runOnEvmsSequentially, ChainInfo, LoggerFn, getContractInstance, getCon import { ethers } from "ethers"; import { getConfigurationDifferences } from "./utils"; import confirm from '@inquirer/confirm'; +import chalk from "chalk"; runOnEvmsSequentially("update-owner-assistant-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + + console.warn(chalk.yellow("This script is deprecated due to the only MatchingEngine contract is deployed in Solana.")) + throw new Error("This script is deprecated due to the only MatchingEngine contract is deployed in Solana."); + const matchingEngineAddress = getContractAddress("MatchingEngineProxy", chain.chainId); const matchingEngine = (await getContractInstance("MatchingEngine", matchingEngineAddress, chain)) as MatchingEngine; const diff = await getConfigurationDifferences(chain); diff --git a/deployment/scripts/evm/MatchingEngine/upgrade-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/upgrade-matching-engine.ts index 4184e1d3..90282fd4 100644 --- a/deployment/scripts/evm/MatchingEngine/upgrade-matching-engine.ts +++ b/deployment/scripts/evm/MatchingEngine/upgrade-matching-engine.ts @@ -3,8 +3,13 @@ import { ethers } from "ethers"; import { deployImplementation, getMachingEngineConfiguration } from "./utils"; import { MatchingEngine } from "../../../contract-bindings"; import { MatchingEngineConfiguration } from "../../../config/config-types"; +import chalk from "chalk"; runOnEvms("upgrade-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + + console.warn(chalk.yellow("This script is deprecated due to the only MatchingEngine contract is deployed in Solana.")) + throw new Error("This script is deprecated due to the only MatchingEngine contract is deployed in Solana."); + const currentImplementationAddress = getContractAddress("MatchingEngineImplementation", chain.chainId); const proxyAddress = getContractAddress("MatchingEngineProxy", chain.chainId); const proxy = (await getContractInstance("MatchingEngine", proxyAddress, chain)) as MatchingEngine; diff --git a/deployment/scripts/evm/MatchingEngine/utils.ts b/deployment/scripts/evm/MatchingEngine/utils.ts index 01de2689..22b449cf 100644 --- a/deployment/scripts/evm/MatchingEngine/utils.ts +++ b/deployment/scripts/evm/MatchingEngine/utils.ts @@ -125,23 +125,38 @@ export async function getConfigurationDifferences(chain: ChainInfo) { return differences; } -export function logDiff(differences: Record, log: LoggerFn) { +export function logDiff(differences: Record, log: LoggerFn, valuesToShow?: Array<"new" | "update" | "delete">) { logComparision('feeRecipient', differences.feeRecipient, log); logComparision('cctpAllowance', differences.cctpAllowance, log); + logRoutersDiff(differences, log, valuesToShow); +} + +export function logRoutersDiff(differences: Record, log: LoggerFn, valuesToShow?: Array<"new" | "update" | "delete">) { let routersLogged = false; for (const { wormholeChainId, router, mintRecipient, circleDomain } of differences.routerEndpoints) { + // In no one is different, skip if (!someoneIsDifferent([router, mintRecipient, circleDomain])) continue; + // Edge case: if only mintRecipient is different and the off chain values are 0 (the endpoint is disabled), skip + if ( + someoneIsDifferent([mintRecipient]) && + !someoneIsDifferent([router, circleDomain]) && + (Number(router.onChain) === 0 && Number(circleDomain.onChain) === 0) && + (Number(mintRecipient.offChain) === 0) + ) { + continue; + } + if (!routersLogged) { log('Router endpoints:'); routersLogged = true; } log(`WormholeChainId ${wormholeChainId}:`); - logComparision('router', router, log); - logComparision('mintRecipient', mintRecipient, log); - logComparision('circleDomain', circleDomain, log); + logComparision('router', router, log, valuesToShow); + logComparision('mintRecipient', mintRecipient, log, valuesToShow); + logComparision('circleDomain', circleDomain, log, valuesToShow); } } \ No newline at end of file From 6ce7ad6111b6490750d759d32721148ace62f7c3 Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Wed, 17 Jul 2024 15:18:01 -0300 Subject: [PATCH 19/80] Refactor base fn and add disable script --- deployment/config/config-types.ts | 18 +-- deployment/helpers/evm.ts | 2 +- deployment/helpers/interfaces.ts | 23 +++- deployment/helpers/utils.ts | 117 +++++------------- .../MatchingEngine/config-matching-engine.ts | 2 +- .../scripts/evm/MatchingEngine/utils.ts | 50 +------- .../evm/TokenRouter/config-token-router.ts | 46 +------ .../evm/TokenRouter/deploy-token-router.ts | 1 - .../disable-router-token-router.ts | 36 ++++++ deployment/scripts/evm/TokenRouter/utils.ts | 69 +++-------- 10 files changed, 109 insertions(+), 255 deletions(-) create mode 100644 deployment/scripts/evm/TokenRouter/disable-router-token-router.ts diff --git a/deployment/config/config-types.ts b/deployment/config/config-types.ts index e8441d60..66b90c62 100644 --- a/deployment/config/config-types.ts +++ b/deployment/config/config-types.ts @@ -1,27 +1,11 @@ import { ChainId } from "@wormhole-foundation/sdk-base"; -import { BytesLike } from "ethers"; - -export type RouterEndpointConfig = { - wormholeChainId: ChainId; - endpoint: { - router: BytesLike; - mintRecipient: BytesLike; - }, - circleDomain: number; -} export type TokenRouterConfiguration = { // Wormhole Chain ID of the token router configuration chainId: ChainId; - // Immutable values - matchingEngineMintRecipient: string; - matchingEngineChain: ChainId; // Wormhole Chain ID - matchingEngineDomain: string; - // Mutable values ownerAssistant: string; - routerEndpoints: RouterEndpointConfig[]; fastTransferParameters: { enabled: boolean; maxAmount: number; @@ -29,6 +13,7 @@ export type TokenRouterConfiguration = { initAuctionFee: number; }; cctpAllowance: number; + disableRouterEndpoints?: ChainId[]; }; export type MatchingEngineConfiguration = { @@ -45,6 +30,5 @@ export type MatchingEngineConfiguration = { // Mutable values ownerAssistant: string; feeRecipient: string; - routerEndpoints: RouterEndpointConfig[]; cctpAllowance: number; }; \ No newline at end of file diff --git a/deployment/helpers/evm.ts b/deployment/helpers/evm.ts index 7c2d6512..9ad326c6 100644 --- a/deployment/helpers/evm.ts +++ b/deployment/helpers/evm.ts @@ -45,7 +45,7 @@ export async function runOnEvmsSequentially(scriptName: string, cb: EvmScriptCb) } export function evmOperatingChains() { - const { operatingChains } = ecosystemChains.evm; + const { operatingChains } = ecosystemChains; if (Array.isArray(operatingChains) && operatingChains.length >= 1) { return ecosystemChains.evm.networks.filter((x) => { return operatingChains.includes(x.chainId); diff --git a/deployment/helpers/interfaces.ts b/deployment/helpers/interfaces.ts index 8a3e137f..6a8b44fc 100644 --- a/deployment/helpers/interfaces.ts +++ b/deployment/helpers/interfaces.ts @@ -1,6 +1,6 @@ import { ChainId } from "@wormhole-foundation/sdk-base"; import { SolanaLedgerSigner } from "@xlabs-xyz/ledger-signer-solana"; -import { ethers } from "ethers"; +import { BytesLike, ethers } from "ethers"; export type EvmScriptCb = (chain: ChainInfo, signer: ethers.Signer, logFn: LoggerFn) => Promise; export type SolanaScriptCb = (chain: ChainInfo, signer: SolanaLedgerSigner, logFn: LoggerFn) => Promise; @@ -21,9 +21,8 @@ export type Deployment = { }; export type Ecosystem = { - guardianSetIndex: number; + operatingChains?: number[]; evm: { - operatingChains?: number[]; networks: ChainInfo[]; }, solana: { @@ -46,4 +45,22 @@ export interface Dependencies extends ChainConfig { export interface ValueDiff { onChain: any; offChain: any; +} + +export interface VerificationApiKeys extends ChainConfig { + etherscan: string; + blockscout?: { + mainnet: string; + testnet: string; + }; + sourcify?: string; +} + +export type RouterEndpoint = { + wormholeChainId: ChainId; + endpoint: { + router: BytesLike; + mintRecipient: BytesLike; + }, + circleDomain: number; } \ No newline at end of file diff --git a/deployment/helpers/utils.ts b/deployment/helpers/utils.ts index 3d02dbe7..bb1ca52f 100644 --- a/deployment/helpers/utils.ts +++ b/deployment/helpers/utils.ts @@ -1,8 +1,5 @@ import chalk from 'chalk'; -import { LoggerFn, ValueDiff, getEnv } from '.'; -import { ChainId } from "@wormhole-foundation/sdk-base"; -import { RouterEndpointConfig } from '../config/config-types'; -import { UniversalAddress } from '@wormhole-foundation/sdk-definitions'; +import { ChainInfo, LoggerFn, ValueDiff } from '.'; export const someoneIsDifferent = (values: ValueDiff[]) => values.some((value) => value.onChain.toString() !== value.offChain.toString() && Number(value.onChain) !== Number(value.offChain)); @@ -13,19 +10,16 @@ export function logComparision(name: string, diffValues: any, log: LoggerFn) { return; // If the on chain value is not present or it is zero value, log it as an addition - if (!diffValues.onChain || Number(diffValues.onChain) === 0) { + if (!diffValues.onChain || Number(diffValues.onChain) === 0) log(chalk.green(`+ ${name}: ${diffValues.offChain}`)); - } // If the off chain value is not present or it is zero value, log it as a removal - else if (!diffValues.offChain || Number(diffValues.offChain) === 0) { + else if (!diffValues.offChain || Number(diffValues.offChain) === 0) log(chalk.red(`- ${name}: ${diffValues.onChain}`)); - } // If both values are present and they are different, log it as a change - else { + else log(chalk.yellow(`~ ${name}: `) + chalk.red(`${diffValues.onChain}`) + ' -> ' + chalk.green(`${diffValues.offChain}`)); - } } // Assuming that we'll only have two types of addresses: Ethereum and Solana @@ -33,104 +27,49 @@ export function getAddressType(address: string): 'hex' | 'base58' { const ETHEREUM_ADDRESS_LENGTH = 40; const addressLength = address.length - (address.startsWith("0x") ? 2 : 0); - // TODO: check lenght of solana addresses if (address.length < ETHEREUM_ADDRESS_LENGTH) throw new Error(`Invalid address length: ${address}`); return addressLength === ETHEREUM_ADDRESS_LENGTH ? 'hex' : 'base58'; } -// Router endpoint helpers - -export function getRouterEndpointDifferences(onChainRouterEndpoints: RouterEndpointConfig[], offChainRouterEndpoints: RouterEndpointConfig[]) { - const routerEndpointsDifferences = []; - let onChainIndex = 0; - let offChainIndex = 0; - - onChainRouterEndpoints = onChainRouterEndpoints.sort((a, b) => a.wormholeChainId - b.wormholeChainId); - offChainRouterEndpoints = offChainRouterEndpoints.sort((a, b) => a.wormholeChainId - b.wormholeChainId); - - while (true) { - const onChainEndpoint = onChainRouterEndpoints[onChainIndex]; - const offChainEndpoint = offChainRouterEndpoints[offChainIndex]; - - // If we've reached the end of both arrays, we're done - if (!onChainEndpoint && !offChainEndpoint) { - break; - } - - // If we've reached the end of offChainEndpoints, add the remaining onChainEndpoints - // or if the onChainEndpoint is less than the offChainEndpoint, add the onChainEndpoint - if (!offChainEndpoint || onChainEndpoint?.wormholeChainId < offChainEndpoint?.wormholeChainId) { - routerEndpointsDifferences.push( - routerEndpointConfig(onChainEndpoint.wormholeChainId, onChainEndpoint, {}) - ); - onChainIndex++; - continue; - } - - // If we've reached the end of onChainEndpoints, add the remaining offChainEndpoints - // or if the offChainEndpoint is less than the onChainEndpoint, add the offChainEndpoint - if (!onChainEndpoint || onChainEndpoint?.wormholeChainId > offChainEndpoint?.wormholeChainId) { - routerEndpointsDifferences.push( - routerEndpointConfig(offChainEndpoint.wormholeChainId, {}, offChainEndpoint) - ); - offChainIndex++; - continue; - } - - routerEndpointsDifferences.push( - routerEndpointConfig(onChainEndpoint.wormholeChainId, onChainEndpoint, offChainEndpoint) - ); - - onChainIndex++; - offChainIndex++; +export function flattenObject(obj: Record, parentKey = '', result: Record = {}) { + for (let key in obj) { + if (obj.hasOwnProperty(key)) { + let newKey = parentKey ? `${parentKey}-${key}` : key; + + if (typeof obj[key] === 'object' && obj[key] !== null && !Array.isArray(obj[key])) { + flattenObject(obj[key], newKey, result); + } else { + result[newKey] = obj[key]; + } + } } - - return routerEndpointsDifferences; -} - -const routerEndpointConfig = (wormholeChainId: ChainId, onChain: Partial, offChain: Partial) => ({ - wormholeChainId, - router: { - onChain: onChain?.endpoint?.router, - offChain: offChain?.endpoint?.router - }, - mintRecipient: { - onChain: onChain?.endpoint?.mintRecipient, - offChain: offChain?.endpoint?.mintRecipient - }, - circleDomain: { - onChain: onChain?.circleDomain, - offChain: offChain?.circleDomain - } -}); - -export function getFormattedEndpoint(router: string, mintRecipient: string) { - const routerAddresType = getAddressType(router); - const mintRecipientAddressType = getAddressType(mintRecipient); - - return { - router: (new UniversalAddress(router, routerAddresType)).toString(), - mintRecipient: (new UniversalAddress(mintRecipient, mintRecipientAddressType)).toString() - }; + return result; } /// Verify bytecode helper export function getVerifyCommand( + chain: ChainInfo, contractName: string, contractPath: string, contractAddress: string, constructorSignature: string, constructorArgs: any[], - EvmChainId: number + verifier: string, + apiKey?: string ): string { - const ETHERSCAN_API_KEY = getEnv("ETHERSCAN_API_KEY"); - return ` + if (chain.externalId === undefined) + throw new Error(`Chain ${chain.chainId} does not have an external ID`); + + let command = ` forge verify-contract ${contractAddress} ${contractPath}:${contractName} \ + --verifier ${verifier} \ --watch --constructor-args $(cast abi-encode "${constructorSignature}" "${constructorArgs.join('" "')}") \ - --chain-id ${EvmChainId} \ - --etherscan-api-key ${ETHERSCAN_API_KEY} \ + --chain-id ${chain.externalId} \ + ${ apiKey === undefined || apiKey === "" ? '' : `--etherscan-api-key ${apiKey}` } `; + + return command; } \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts index de52ba98..5ec1bed5 100644 --- a/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts +++ b/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts @@ -1,5 +1,5 @@ import { MatchingEngine } from "../../../contract-bindings"; -import { runOnEvmsSequentially, ChainInfo, LoggerFn, getContractInstance, getContractAddress, getFormattedEndpoint } from "../../../helpers"; +import { runOnEvmsSequentially, ChainInfo, LoggerFn, getContractInstance, getContractAddress } from "../../../helpers"; import { ethers } from "ethers"; import { getConfigurationDifferences, logDiff } from "./utils"; import confirm from '@inquirer/confirm'; diff --git a/deployment/scripts/evm/MatchingEngine/utils.ts b/deployment/scripts/evm/MatchingEngine/utils.ts index 22b449cf..82a8955e 100644 --- a/deployment/scripts/evm/MatchingEngine/utils.ts +++ b/deployment/scripts/evm/MatchingEngine/utils.ts @@ -1,7 +1,7 @@ import { ethers } from "ethers"; import { MatchingEngineConfiguration } from "../../../config/config-types"; import { MatchingEngine, MatchingEngine__factory } from "../../../contract-bindings"; -import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, getRouterEndpointDifferences, logComparision, someoneIsDifferent } from "../../../helpers"; +import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, logComparision, someoneIsDifferent } from "../../../helpers"; import { ERC20 } from "../../../contract-bindings/out/ERC20"; export function getMachingEngineConfiguration(chain: ChainInfo): Promise { @@ -75,25 +75,11 @@ export async function getOnChainMachingEngineConfiguration(chain: ChainInfo) { const feeRecipient = await matchingEngine.feeRecipient(); const ownerAssistant = await matchingEngine.getOwnerAssistant(); - const routerEndpoints = await Promise.all(config - .routerEndpoints - .map(async ({ wormholeChainId }) => { - const { router, mintRecipient } = await matchingEngine.getRouterEndpoint(wormholeChainId); - return { - wormholeChainId, - endpoint: { - router, - mintRecipient - }, - circleDomain: await matchingEngine.getDomain(wormholeChainId) - } - })); return { cctpAllowance, feeRecipient, - ownerAssistant, - routerEndpoints + ownerAssistant }; } @@ -120,8 +106,6 @@ export async function getConfigurationDifferences(chain: ChainInfo) { }; } - differences.routerEndpoints = getRouterEndpointDifferences(onChainConfig.routerEndpoints, offChainConfig.routerEndpoints); - return differences; } @@ -129,34 +113,4 @@ export function logDiff(differences: Record, log: LoggerFn, valuesT logComparision('feeRecipient', differences.feeRecipient, log); logComparision('cctpAllowance', differences.cctpAllowance, log); - logRoutersDiff(differences, log, valuesToShow); -} - -export function logRoutersDiff(differences: Record, log: LoggerFn, valuesToShow?: Array<"new" | "update" | "delete">) { - let routersLogged = false; - for (const { wormholeChainId, router, mintRecipient, circleDomain } of differences.routerEndpoints) { - // In no one is different, skip - if (!someoneIsDifferent([router, mintRecipient, circleDomain])) - continue; - - // Edge case: if only mintRecipient is different and the off chain values are 0 (the endpoint is disabled), skip - if ( - someoneIsDifferent([mintRecipient]) && - !someoneIsDifferent([router, circleDomain]) && - (Number(router.onChain) === 0 && Number(circleDomain.onChain) === 0) && - (Number(mintRecipient.offChain) === 0) - ) { - continue; - } - - if (!routersLogged) { - log('Router endpoints:'); - routersLogged = true; - } - - log(`WormholeChainId ${wormholeChainId}:`); - logComparision('router', router, log, valuesToShow); - logComparision('mintRecipient', mintRecipient, log, valuesToShow); - logComparision('circleDomain', circleDomain, log, valuesToShow); - } } \ No newline at end of file diff --git a/deployment/scripts/evm/TokenRouter/config-token-router.ts b/deployment/scripts/evm/TokenRouter/config-token-router.ts index 0f28176c..ba09fbdd 100644 --- a/deployment/scripts/evm/TokenRouter/config-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/config-token-router.ts @@ -1,4 +1,4 @@ -import { ChainInfo, LoggerFn, getContractInstance, getContractAddress, runOnEvmsSequentially, ValueDiff, getFormattedEndpoint } from "../../../helpers"; +import { ChainInfo, LoggerFn, getContractInstance, getContractAddress, runOnEvmsSequentially, ValueDiff } from "../../../helpers"; import { ethers } from "ethers"; import { getConfigurationDifferences, logDiff } from "./utils"; import confirm from '@inquirer/confirm'; @@ -19,7 +19,7 @@ runOnEvmsSequentially("config-token-router", async (chain: ChainInfo, signer: et return; } - const { cctpAllowance, routerEndpoints, fastTransferParameters } = diff; + const { cctpAllowance, fastTransferParameters } = diff; // Fast transfer parameters await updateFastTransferParameters(tokenRouter, fastTransferParameters, log); @@ -29,48 +29,6 @@ runOnEvmsSequentially("config-token-router", async (chain: ChainInfo, signer: et await tokenRouter.setCctpAllowance(cctpAllowance.offChain); log(`CCTP allowance updated to ${cctpAllowance.offChain}`); } - - // Router endpoints - for (const { wormholeChainId, router, mintRecipient, circleDomain } of routerEndpoints) { - const offChainEndpoint = getFormattedEndpoint(router.offChain, mintRecipient.offChain); - - // Add new router endpoint if all values are zero - if (Number(router?.onChain) === 0 && Number(mintRecipient?.onChain) === 0 && Number(circleDomain?.onChain) === 0) { - if (wormholeChainId === 0) - throw new Error('Invalid wormholeChainId when adding new router endpoint'); - - if (Number(offChainEndpoint.router) === 0 || Number(offChainEndpoint.mintRecipient) === 0) - throw new Error(`Invalid router or mintRecipient endpoint for wormholeChainId ${wormholeChainId}`); - - await tokenRouter.addRouterEndpoint(wormholeChainId, offChainEndpoint, circleDomain.offChain); - log(`Router endpoint added for wormholeChainId ${wormholeChainId}`); - continue; - } - - // Disable router endpoint, must be the three values zero - if (Number(router?.offChain) === 0 && Number(mintRecipient?.offChain) === 0 && Number(circleDomain?.offChain) === 0) { - await tokenRouter.disableRouterEndpoint(wormholeChainId); - log(`Router endpoint disabled for wormholeChainId ${wormholeChainId}`); - continue; - } - - // Update router endpoint - if ( - router?.onChain.toString() !== router?.offChain.toString() || - mintRecipient?.onChain.toString() !== mintRecipient?.offChain.toString() || - circleDomain?.onChain.toString() !== circleDomain?.offChain.toString() - ) { - if (wormholeChainId === 0) - throw new Error('Invalid wormholeChainId when adding new router endpoint'); - - if (Number(offChainEndpoint.router) === 0 || Number(offChainEndpoint.mintRecipient) === 0) - throw new Error(`Invalid router or mintRecipient endpoint for chainId ${wormholeChainId}`); - - await tokenRouter.updateRouterEndpoint(wormholeChainId, offChainEndpoint, circleDomain.offChain); - log(`Router endpoint updated for chainId ${wormholeChainId}`); - continue; - } - } }); async function updateFastTransferParameters(tokenRouter: TokenRouter, params: Record, log: LoggerFn) { diff --git a/deployment/scripts/evm/TokenRouter/deploy-token-router.ts b/deployment/scripts/evm/TokenRouter/deploy-token-router.ts index 2fea4c5c..1dfe1205 100644 --- a/deployment/scripts/evm/TokenRouter/deploy-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/deploy-token-router.ts @@ -31,7 +31,6 @@ async function deployProxy(signer: ethers.Signer, config: TokenRouterConfigurati await deployment.deployed(); log(`TokenRouterProxy deployed at ${deployment.address}`); - writeDeployedContract(config.chainId, "TokenRouterProxy", deployment.address, [implementation.address, encodedCall]); return deployment; diff --git a/deployment/scripts/evm/TokenRouter/disable-router-token-router.ts b/deployment/scripts/evm/TokenRouter/disable-router-token-router.ts new file mode 100644 index 00000000..8a11078f --- /dev/null +++ b/deployment/scripts/evm/TokenRouter/disable-router-token-router.ts @@ -0,0 +1,36 @@ +import { TokenRouter } from "../../../contract-bindings"; +import { ChainInfo, LoggerFn, getContractInstance, getContractAddress, runOnEvms } from "../../../helpers"; +import { ethers } from "ethers"; +import { getTokenRouterConfiguration } from "./utils"; + +runOnEvms("disable-router-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + const tokenRouterAddress = getContractAddress("TokenRouterProxy", chain.chainId); + const tokenRouter = (await getContractInstance("TokenRouter", tokenRouterAddress, chain)) as TokenRouter; + const config = await getTokenRouterConfiguration(chain); + + if (config.disableRouterEndpoints === undefined) + throw new Error(`disableRouterEndpoints not defined in config for chain ${chain.chainId}`); + + const isRouterDisabled = await Promise.all( + config.disableRouterEndpoints.map(async chainId => { + const endpoint = await tokenRouter.getRouterEndpoint(chainId); + const domain = await tokenRouter.getDomain(chainId); + + // When a endpoint is disabled, the router and the domain are set to 0 but the mintRecipient still has a value + return Number(endpoint.router) === 0 && Number(domain) === 0 && Number(endpoint.mintRecipient) !== 0; + }) + ); + + for (const i in config.disableRouterEndpoints) { + const chainId = config.disableRouterEndpoints[i]; + const isDisabled = isRouterDisabled[i]; + + if (isDisabled) { + log(`Router endpoint already disabled for wormholeChainId ${chainId}`); + log('Please remove the chainId from the disableRouterEndpoints array.') + } else { + await tokenRouter.disableRouterEndpoint(chainId); + log(`Router endpoint disabled for wormholeChainId ${chainId}`); + }; + } +}); \ No newline at end of file diff --git a/deployment/scripts/evm/TokenRouter/utils.ts b/deployment/scripts/evm/TokenRouter/utils.ts index 5c038afd..ec3726ef 100644 --- a/deployment/scripts/evm/TokenRouter/utils.ts +++ b/deployment/scripts/evm/TokenRouter/utils.ts @@ -1,7 +1,7 @@ import { ethers } from "ethers"; import { TokenRouterConfiguration } from "../../../config/config-types"; import { TokenRouter, TokenRouter__factory } from "../../../contract-bindings"; -import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, getRouterEndpointDifferences, logComparision, someoneIsDifferent, getAddressType } from "../../../helpers"; +import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, logComparision, someoneIsDifferent } from "../../../helpers"; import { ERC20 } from "../../../contract-bindings/out/ERC20"; import { UniversalAddress } from "@wormhole-foundation/sdk-definitions"; @@ -9,30 +9,34 @@ export function getTokenRouterConfiguration(chain: ChainInfo): Promise("token-router", chain.chainId); } +// TODO +function getMintRecipientAddress() { + return '6y7V8dL673XFzm9QyC5vvh3itWkp7wztahBd2yDqsyrK' +}; + export async function deployImplementation(chain: ChainInfo, signer: ethers.Signer, config: TokenRouterConfiguration, log: LoggerFn) { const factory = new TokenRouter__factory(signer); const token = getDependencyAddress("token", config.chainId); const wormhole = getDependencyAddress("wormhole", config.chainId); const tokenMessenger = getDependencyAddress("tokenMessenger", config.chainId); - const mintRecipientAddressType = getAddressType(config.matchingEngineMintRecipient); - const matchingEngineMintRecipient = (new UniversalAddress(config.matchingEngineMintRecipient, mintRecipientAddressType)).toString(); - + + const matchingEngineMintRecipient = (new UniversalAddress(getMintRecipientAddress(), 'base58')).toString(); + const matchinEngineChain = 1; // Solana wormhole chain id + const matchingEngineDomain = 5; // Solana cctp domain let matchingEngineAddress = (getContractAddress( "MatchingEngineProxy", - chain.chainId + matchinEngineChain )); - - const matchingEgineAdressType = getAddressType(matchingEngineAddress); - matchingEngineAddress = (new UniversalAddress(matchingEngineAddress, matchingEgineAdressType)).toString(); + matchingEngineAddress = (new UniversalAddress(matchingEngineAddress, 'base58')).toString(); const deployment = await factory.deploy( token, wormhole, tokenMessenger, - config.matchingEngineChain, + matchinEngineChain, matchingEngineAddress, matchingEngineMintRecipient, - config.matchingEngineDomain, + matchingEngineDomain, {} // overrides ); @@ -44,10 +48,10 @@ export async function deployImplementation(chain: ChainInfo, signer: ethers.Sign token, wormhole, tokenMessenger, - config.matchingEngineChain, + matchinEngineChain, matchingEngineAddress, matchingEngineMintRecipient, - config.matchingEngineDomain + matchingEngineDomain ]; writeDeployedContract(config.chainId, "TokenRouterImplementation", deployment.address, constructorArgs); @@ -56,7 +60,6 @@ export async function deployImplementation(chain: ChainInfo, signer: ethers.Sign } export async function getOnChainTokenRouterConfiguration(chain: ChainInfo) { - const config = await getTokenRouterConfiguration(chain); const tokenRouterProxyAddress = getContractAddress("TokenRouterProxy", chain.chainId); const tokenRouter = (await getContractInstance("TokenRouter", tokenRouterProxyAddress, chain)) as TokenRouter; @@ -65,21 +68,6 @@ export async function getOnChainTokenRouterConfiguration(chain: ChainInfo) { const orderTokenAddress = await tokenRouter.orderToken(); const orderToken = (await getContractInstance("ERC20", orderTokenAddress, chain)) as ERC20; const cctpAllowance = await orderToken.allowance(tokenRouterProxyAddress, tokenMessengerAddress); - - const routerEndpoints = await Promise.all(config - .routerEndpoints - .map(async ({ wormholeChainId }) => { - const { router, mintRecipient } = await tokenRouter.getRouterEndpoint(wormholeChainId); - return { - wormholeChainId, - endpoint: { - router, - mintRecipient - }, - circleDomain: await tokenRouter.getDomain(wormholeChainId) - } - })); - const ownerAssistant = await tokenRouter.getOwnerAssistant(); const { enabled, maxAmount, baseFee, initAuctionFee} = await tokenRouter.getFastTransferParameters(); @@ -91,8 +79,7 @@ export async function getOnChainTokenRouterConfiguration(chain: ChainInfo) { maxAmount: maxAmount.toString(), baseFee: baseFee.toString(), initAuctionFee: initAuctionFee.toString() - }, - routerEndpoints + } }; } @@ -128,32 +115,12 @@ function compareConfigurations(onChainConfig: Record, offChainConfi export async function getConfigurationDifferences(chain: ChainInfo) { const onChainConfig = await getOnChainTokenRouterConfiguration(chain); const offChainConfig = await getTokenRouterConfiguration(chain); - const differences = compareConfigurations(onChainConfig, offChainConfig); - - differences.routerEndpoints = getRouterEndpointDifferences(onChainConfig.routerEndpoints, offChainConfig.routerEndpoints); - - return differences; + return compareConfigurations(onChainConfig, offChainConfig); } export function logDiff(differences: Record, log: LoggerFn) { logComparision('cctpAllowance', differences.cctpAllowance, log); - let routersLogged = false; - for (const { wormholeChainId, router, mintRecipient, circleDomain } of differences.routerEndpoints) { - if (!someoneIsDifferent([router, mintRecipient, circleDomain])) - continue; - - if (!routersLogged) { - log('Router endpoints:'); - routersLogged = true; - } - - log(`WormholeChainId ${wormholeChainId}:`); - logComparision('router', router, log); - logComparision('mintRecipient', mintRecipient, log); - logComparision('circleDomain', circleDomain, log); - } - const { enabled, maxAmount, baseFee, initAuctionFee } = differences.fastTransferParameters; if (someoneIsDifferent([enabled, maxAmount, baseFee, initAuctionFee])) { log('Fast transfer parameters:'); From 6c913fecfb4fc96bb1fdcd26eb3b9fbcace002ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Fri, 12 Jul 2024 15:39:04 -0300 Subject: [PATCH 20/80] deploy: minor fix in README --- deployment/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/README.md b/deployment/README.md index f2f7e721..08d98721 100644 --- a/deployment/README.md +++ b/deployment/README.md @@ -5,7 +5,7 @@ - Install & Build ``` -npm install +npm ci npm run build-evm ``` From b8dde619eb921fc9fee42e35ad146661013c5162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Fri, 12 Jul 2024 15:39:48 -0300 Subject: [PATCH 21/80] misc: adds `tmp` to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b1b0e059..b945ea48 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ dist .env out cache +tmp From 29fa1714d3272e2ba4b71e20d79bf9363240e663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Wed, 17 Jul 2024 17:48:09 -0300 Subject: [PATCH 22/80] deploy: adds solana as a local package dependency --- deployment/package-lock.json | 44 ++++++++++++++++++++++++++++++++++++ deployment/package.json | 3 ++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/deployment/package-lock.json b/deployment/package-lock.json index 87901692..3b7d45aa 100644 --- a/deployment/package-lock.json +++ b/deployment/package-lock.json @@ -11,6 +11,7 @@ "@solana/web3.js": "^1.92.2", "@typechain/ethers-v5": "^11.1.2", "@types/node": "^20.11.22", + "@wormhole-foundation/example-liquidity-layer-solana": "file:../solana", "@wormhole-foundation/sdk-base": "^0.7.0", "@wormhole-foundation/sdk-definitions": "^0.7.0", "@xlabs-xyz/ledger-signer": "^0.0.4", @@ -23,6 +24,45 @@ "typescript": "^5.4.5" } }, + "../solana": { + "name": "@wormhole-foundation/example-liquidity-layer-solana", + "version": "0.0.1", + "dev": true, + "dependencies": { + "@certusone/wormhole-spydk": "^0.0.1", + "@coral-xyz/anchor": "^0.30.0", + "@solana/spl-token": "^0.4.6", + "@solana/spl-token-group": "^0.0.4", + "@solana/spl-token-metadata": "^0.1.4", + "@solana/web3.js": "^1.91.7", + "@types/node-fetch": "^2.6.11", + "@wormhole-foundation/example-liquidity-layer-definitions": "0.0.1", + "@wormhole-foundation/sdk-base": "^0.7.0-beta.6", + "@wormhole-foundation/sdk-definitions": "^0.7.0-beta.6", + "@wormhole-foundation/sdk-solana": "^0.7.0-beta.6", + "@wormhole-foundation/sdk-solana-core": "^0.7.0-beta.6", + "anchor-0.29.0": "npm:@coral-xyz/anchor@^0.29.0", + "bn.js": "^5.2.1", + "dotenv": "^16.4.1", + "ethers": "^5.7.2", + "sha3": "^2.1.4", + "winston": "^3.13.0", + "yargs": "^17.7.2" + }, + "devDependencies": { + "@types/bn.js": "^5.1.0", + "@types/chai": "^4.3.4", + "@types/chai-as-promised": "^7.1.5", + "@types/mocha": "^10.0.1", + "@types/node": "^18.14.5", + "@types/yargs": "^17.0.24", + "chai": "^4.3.7", + "chai-as-promised": "^7.1.1", + "mocha": "^10.0.0", + "ts-mocha": "^10.0.0", + "ts-results": "^3.3.0" + } + }, "node_modules/@babel/runtime": { "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", @@ -1606,6 +1646,10 @@ "@types/node": "*" } }, + "node_modules/@wormhole-foundation/example-liquidity-layer-solana": { + "resolved": "../solana", + "link": true + }, "node_modules/@wormhole-foundation/sdk-base": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-base/-/sdk-base-0.7.0.tgz", diff --git a/deployment/package.json b/deployment/package.json index f22cb30b..b7647f3c 100644 --- a/deployment/package.json +++ b/deployment/package.json @@ -20,6 +20,7 @@ "ethers": "^5.7.2", "tsx": "^4.7.2", "typechain": "^8.3.2", - "typescript": "^5.4.5" + "typescript": "^5.4.5", + "@wormhole-foundation/example-liquidity-layer-solana": "file:../solana" } } From 6d0fcba53457d43291611aa2f3b4d57c9984b52b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Thu, 18 Jul 2024 18:01:35 -0300 Subject: [PATCH 23/80] deploy: adds spl token package --- deployment/package-lock.json | 527 +++++++++++++++++++++++++---------- deployment/package.json | 7 +- 2 files changed, 391 insertions(+), 143 deletions(-) diff --git a/deployment/package-lock.json b/deployment/package-lock.json index 3b7d45aa..d03bd1aa 100644 --- a/deployment/package-lock.json +++ b/deployment/package-lock.json @@ -5,6 +5,9 @@ "packages": { "": { "name": "deployment", + "dependencies": { + "@solana/spl-token": "^0.4.8" + }, "devDependencies": { "@coral-xyz/anchor": "^0.30.1", "@inquirer/confirm": "^3.1.9", @@ -64,10 +67,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", - "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", - "dev": true, + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.8.tgz", + "integrity": "sha512-5F7SDGs1T72ZczbRwbGO9lQi0NLjQxzl6i4lJxLxfW9U5UluCSyEJeniWvnhl3/euNiqQVbo8zruhsDfid0esA==", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -1308,17 +1310,6 @@ "invariant": "2" } }, - "node_modules/@ledgerhq/cryptoassets/node_modules/axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", - "dev": true, - "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, "node_modules/@ledgerhq/devices": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-8.3.0.tgz", @@ -1346,17 +1337,6 @@ "react-dom": "^18.2.0" } }, - "node_modules/@ledgerhq/domain-service/node_modules/axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", - "dev": true, - "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, "node_modules/@ledgerhq/errors": { "version": "6.16.4", "resolved": "https://registry.npmjs.org/@ledgerhq/errors/-/errors-6.16.4.tgz", @@ -1376,17 +1356,6 @@ "ethers": "5.7.2" } }, - "node_modules/@ledgerhq/evm-tools/node_modules/axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", - "dev": true, - "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, "node_modules/@ledgerhq/hw-app-eth": { "version": "6.36.0", "resolved": "https://registry.npmjs.org/@ledgerhq/hw-app-eth/-/hw-app-eth-6.36.0.tgz", @@ -1407,17 +1376,6 @@ "bignumber.js": "^9.1.2" } }, - "node_modules/@ledgerhq/hw-app-eth/node_modules/axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", - "dev": true, - "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, "node_modules/@ledgerhq/hw-app-solana": { "version": "7.1.4", "resolved": "https://registry.npmjs.org/@ledgerhq/hw-app-solana/-/hw-app-solana-7.1.4.tgz", @@ -1508,10 +1466,9 @@ } }, "node_modules/@noble/curves": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.0.tgz", - "integrity": "sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==", - "dev": true, + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", + "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", "dependencies": { "@noble/hashes": "1.4.0" }, @@ -1523,7 +1480,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", - "dev": true, "engines": { "node": ">= 16" }, @@ -1544,7 +1500,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz", "integrity": "sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==", - "dev": true, "dependencies": { "buffer": "~6.0.3" }, @@ -1552,14 +1507,276 @@ "node": ">=5.10" } }, + "node_modules/@solana/buffer-layout-utils": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@solana/buffer-layout-utils/-/buffer-layout-utils-0.2.0.tgz", + "integrity": "sha512-szG4sxgJGktbuZYDg2FfNmkMi0DYQoVjN2h7ta1W1hPrwzarcFLBq9UpX1UjNXsNpT9dn+chgprtWGioUAr4/g==", + "dependencies": { + "@solana/buffer-layout": "^4.0.0", + "@solana/web3.js": "^1.32.0", + "bigint-buffer": "^1.1.5", + "bignumber.js": "^9.0.1" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@solana/codecs": { + "version": "2.0.0-preview.4", + "resolved": "https://registry.npmjs.org/@solana/codecs/-/codecs-2.0.0-preview.4.tgz", + "integrity": "sha512-gLMupqI4i+G4uPi2SGF/Tc1aXcviZF2ybC81x7Q/fARamNSgNOCUUoSCg9nWu1Gid6+UhA7LH80sWI8XjKaRog==", + "dependencies": { + "@solana/codecs-core": "2.0.0-preview.4", + "@solana/codecs-data-structures": "2.0.0-preview.4", + "@solana/codecs-numbers": "2.0.0-preview.4", + "@solana/codecs-strings": "2.0.0-preview.4", + "@solana/options": "2.0.0-preview.4" + }, + "peerDependencies": { + "typescript": ">=5" + } + }, + "node_modules/@solana/codecs-core": { + "version": "2.0.0-preview.4", + "resolved": "https://registry.npmjs.org/@solana/codecs-core/-/codecs-core-2.0.0-preview.4.tgz", + "integrity": "sha512-A0VVuDDA5kNKZUinOqHxJQK32aKTucaVbvn31YenGzHX1gPqq+SOnFwgaEY6pq4XEopSmaK16w938ZQS8IvCnw==", + "dependencies": { + "@solana/errors": "2.0.0-preview.4" + }, + "peerDependencies": { + "typescript": ">=5" + } + }, + "node_modules/@solana/codecs-data-structures": { + "version": "2.0.0-preview.4", + "resolved": "https://registry.npmjs.org/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-preview.4.tgz", + "integrity": "sha512-nt2k2eTeyzlI/ccutPcG36M/J8NAYfxBPI9h/nQjgJ+M+IgOKi31JV8StDDlG/1XvY0zyqugV3I0r3KAbZRJpA==", + "dependencies": { + "@solana/codecs-core": "2.0.0-preview.4", + "@solana/codecs-numbers": "2.0.0-preview.4", + "@solana/errors": "2.0.0-preview.4" + }, + "peerDependencies": { + "typescript": ">=5" + } + }, + "node_modules/@solana/codecs-numbers": { + "version": "2.0.0-preview.4", + "resolved": "https://registry.npmjs.org/@solana/codecs-numbers/-/codecs-numbers-2.0.0-preview.4.tgz", + "integrity": "sha512-Q061rLtMadsO7uxpguT+Z7G4UHnjQ6moVIxAQxR58nLxDPCC7MB1Pk106/Z7NDhDLHTcd18uO6DZ7ajHZEn2XQ==", + "dependencies": { + "@solana/codecs-core": "2.0.0-preview.4", + "@solana/errors": "2.0.0-preview.4" + }, + "peerDependencies": { + "typescript": ">=5" + } + }, + "node_modules/@solana/codecs-strings": { + "version": "2.0.0-preview.4", + "resolved": "https://registry.npmjs.org/@solana/codecs-strings/-/codecs-strings-2.0.0-preview.4.tgz", + "integrity": "sha512-YDbsQePRWm+xnrfS64losSGRg8Wb76cjK1K6qfR8LPmdwIC3787x9uW5/E4icl/k+9nwgbIRXZ65lpF+ucZUnw==", + "dependencies": { + "@solana/codecs-core": "2.0.0-preview.4", + "@solana/codecs-numbers": "2.0.0-preview.4", + "@solana/errors": "2.0.0-preview.4" + }, + "peerDependencies": { + "fastestsmallesttextencoderdecoder": "^1.0.22", + "typescript": ">=5" + } + }, + "node_modules/@solana/errors": { + "version": "2.0.0-preview.4", + "resolved": "https://registry.npmjs.org/@solana/errors/-/errors-2.0.0-preview.4.tgz", + "integrity": "sha512-kadtlbRv2LCWr8A9V22On15Us7Nn8BvqNaOB4hXsTB3O0fU40D1ru2l+cReqLcRPij4znqlRzW9Xi0m6J5DIhA==", + "dependencies": { + "chalk": "^5.3.0", + "commander": "^12.1.0" + }, + "bin": { + "errors": "bin/cli.mjs" + }, + "peerDependencies": { + "typescript": ">=5" + } + }, + "node_modules/@solana/errors/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@solana/options": { + "version": "2.0.0-preview.4", + "resolved": "https://registry.npmjs.org/@solana/options/-/options-2.0.0-preview.4.tgz", + "integrity": "sha512-tv2O/Frxql/wSe3jbzi5nVicIWIus/BftH+5ZR+r9r3FO0/htEllZS5Q9XdbmSboHu+St87584JXeDx3xm4jaA==", + "dependencies": { + "@solana/codecs-core": "2.0.0-preview.4", + "@solana/codecs-data-structures": "2.0.0-preview.4", + "@solana/codecs-numbers": "2.0.0-preview.4", + "@solana/codecs-strings": "2.0.0-preview.4", + "@solana/errors": "2.0.0-preview.4" + }, + "peerDependencies": { + "typescript": ">=5" + } + }, + "node_modules/@solana/spl-token": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.4.8.tgz", + "integrity": "sha512-RO0JD9vPRi4LsAbMUdNbDJ5/cv2z11MGhtAvFeRzT4+hAGE/FUzRi0tkkWtuCfSIU3twC6CtmAihRp/+XXjWsA==", + "dependencies": { + "@solana/buffer-layout": "^4.0.0", + "@solana/buffer-layout-utils": "^0.2.0", + "@solana/spl-token-group": "^0.0.5", + "@solana/spl-token-metadata": "^0.1.3", + "buffer": "^6.0.3" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "@solana/web3.js": "^1.94.0" + } + }, + "node_modules/@solana/spl-token-group": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@solana/spl-token-group/-/spl-token-group-0.0.5.tgz", + "integrity": "sha512-CLJnWEcdoUBpQJfx9WEbX3h6nTdNiUzswfFdkABUik7HVwSNA98u5AYvBVK2H93d9PGMOHAak2lHW9xr+zAJGQ==", + "dependencies": { + "@solana/codecs": "2.0.0-preview.4", + "@solana/spl-type-length-value": "0.1.0" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "@solana/web3.js": "^1.94.0" + } + }, + "node_modules/@solana/spl-token-metadata": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@solana/spl-token-metadata/-/spl-token-metadata-0.1.4.tgz", + "integrity": "sha512-N3gZ8DlW6NWDV28+vCCDJoTqaCZiF/jDUnk3o8GRkAFzHObiR60Bs1gXHBa8zCPdvOwiG6Z3dg5pg7+RW6XNsQ==", + "dependencies": { + "@solana/codecs": "2.0.0-preview.2", + "@solana/spl-type-length-value": "0.1.0" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "@solana/web3.js": "^1.91.6" + } + }, + "node_modules/@solana/spl-token-metadata/node_modules/@solana/codecs": { + "version": "2.0.0-preview.2", + "resolved": "https://registry.npmjs.org/@solana/codecs/-/codecs-2.0.0-preview.2.tgz", + "integrity": "sha512-4HHzCD5+pOSmSB71X6w9ptweV48Zj1Vqhe732+pcAQ2cMNnN0gMPMdDq7j3YwaZDZ7yrILVV/3+HTnfT77t2yA==", + "dependencies": { + "@solana/codecs-core": "2.0.0-preview.2", + "@solana/codecs-data-structures": "2.0.0-preview.2", + "@solana/codecs-numbers": "2.0.0-preview.2", + "@solana/codecs-strings": "2.0.0-preview.2", + "@solana/options": "2.0.0-preview.2" + } + }, + "node_modules/@solana/spl-token-metadata/node_modules/@solana/codecs-core": { + "version": "2.0.0-preview.2", + "resolved": "https://registry.npmjs.org/@solana/codecs-core/-/codecs-core-2.0.0-preview.2.tgz", + "integrity": "sha512-gLhCJXieSCrAU7acUJjbXl+IbGnqovvxQLlimztPoGgfLQ1wFYu+XJswrEVQqknZYK1pgxpxH3rZ+OKFs0ndQg==", + "dependencies": { + "@solana/errors": "2.0.0-preview.2" + } + }, + "node_modules/@solana/spl-token-metadata/node_modules/@solana/codecs-data-structures": { + "version": "2.0.0-preview.2", + "resolved": "https://registry.npmjs.org/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-preview.2.tgz", + "integrity": "sha512-Xf5vIfromOZo94Q8HbR04TbgTwzigqrKII0GjYr21K7rb3nba4hUW2ir8kguY7HWFBcjHGlU5x3MevKBOLp3Zg==", + "dependencies": { + "@solana/codecs-core": "2.0.0-preview.2", + "@solana/codecs-numbers": "2.0.0-preview.2", + "@solana/errors": "2.0.0-preview.2" + } + }, + "node_modules/@solana/spl-token-metadata/node_modules/@solana/codecs-numbers": { + "version": "2.0.0-preview.2", + "resolved": "https://registry.npmjs.org/@solana/codecs-numbers/-/codecs-numbers-2.0.0-preview.2.tgz", + "integrity": "sha512-aLZnDTf43z4qOnpTcDsUVy1Ci9im1Md8thWipSWbE+WM9ojZAx528oAql+Cv8M8N+6ALKwgVRhPZkto6E59ARw==", + "dependencies": { + "@solana/codecs-core": "2.0.0-preview.2", + "@solana/errors": "2.0.0-preview.2" + } + }, + "node_modules/@solana/spl-token-metadata/node_modules/@solana/codecs-strings": { + "version": "2.0.0-preview.2", + "resolved": "https://registry.npmjs.org/@solana/codecs-strings/-/codecs-strings-2.0.0-preview.2.tgz", + "integrity": "sha512-EgBwY+lIaHHgMJIqVOGHfIfpdmmUDNoNO/GAUGeFPf+q0dF+DtwhJPEMShhzh64X2MeCZcmSO6Kinx0Bvmmz2g==", + "dependencies": { + "@solana/codecs-core": "2.0.0-preview.2", + "@solana/codecs-numbers": "2.0.0-preview.2", + "@solana/errors": "2.0.0-preview.2" + }, + "peerDependencies": { + "fastestsmallesttextencoderdecoder": "^1.0.22" + } + }, + "node_modules/@solana/spl-token-metadata/node_modules/@solana/errors": { + "version": "2.0.0-preview.2", + "resolved": "https://registry.npmjs.org/@solana/errors/-/errors-2.0.0-preview.2.tgz", + "integrity": "sha512-H2DZ1l3iYF5Rp5pPbJpmmtCauWeQXRJapkDg8epQ8BJ7cA2Ut/QEtC3CMmw/iMTcuS6uemFNLcWvlOfoQhvQuA==", + "dependencies": { + "chalk": "^5.3.0", + "commander": "^12.0.0" + }, + "bin": { + "errors": "bin/cli.js" + } + }, + "node_modules/@solana/spl-token-metadata/node_modules/@solana/options": { + "version": "2.0.0-preview.2", + "resolved": "https://registry.npmjs.org/@solana/options/-/options-2.0.0-preview.2.tgz", + "integrity": "sha512-FAHqEeH0cVsUOTzjl5OfUBw2cyT8d5Oekx4xcn5hn+NyPAfQJgM3CEThzgRD6Q/4mM5pVUnND3oK/Mt1RzSE/w==", + "dependencies": { + "@solana/codecs-core": "2.0.0-preview.2", + "@solana/codecs-numbers": "2.0.0-preview.2" + } + }, + "node_modules/@solana/spl-token-metadata/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@solana/spl-type-length-value": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@solana/spl-type-length-value/-/spl-type-length-value-0.1.0.tgz", + "integrity": "sha512-JBMGB0oR4lPttOZ5XiUGyvylwLQjt1CPJa6qQ5oM+MBCndfjz2TKKkw0eATlLLcYmq1jBVsNlJ2cD6ns2GR7lA==", + "dependencies": { + "buffer": "^6.0.3" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/@solana/web3.js": { - "version": "1.92.2", - "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.92.2.tgz", - "integrity": "sha512-dk26IHhtKyBszzsSzAuh6Lj2Z6guGlmdzkBjsOTvMmU/BiZTs5riNb+3eq56zXNLK3qvaMHAvVQPGwi9Po6qZQ==", - "dev": true, + "version": "1.95.1", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.95.1.tgz", + "integrity": "sha512-mRX/AjV6QbiOXpWcy5Rz1ZWEH2lVkwO7T0pcv9t97ACpv3/i3tPiqXwk0JIZgSR3wOSTiT26JfygnJH2ulS6dQ==", "dependencies": { - "@babel/runtime": "^7.24.6", - "@noble/curves": "^1.4.0", + "@babel/runtime": "^7.24.8", + "@noble/curves": "^1.4.2", "@noble/hashes": "^1.4.0", "@solana/buffer-layout": "^4.0.1", "agentkeepalive": "^4.5.0", @@ -1569,10 +1786,18 @@ "bs58": "^4.0.1", "buffer": "6.0.3", "fast-stable-stringify": "^1.0.0", - "jayson": "^4.1.0", + "jayson": "^4.1.1", "node-fetch": "^2.7.0", - "rpc-websockets": "^7.11.1", - "superstruct": "^1.0.4" + "rpc-websockets": "^9.0.2", + "superstruct": "^2.0.2" + } + }, + "node_modules/@swc/helpers": { + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.12.tgz", + "integrity": "sha512-KMZNXiGibsW9kvZAO1Pam2JPTDBm+KSHMMHWdsyI/1DbIZjT2A6Gy3hblVXUMEDvUAKq+e0vL0X0o54owWji7g==", + "dependencies": { + "tslib": "^2.4.0" } }, "node_modules/@typechain/ethers-v5": { @@ -1596,7 +1821,6 @@ "version": "3.4.38", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", - "dev": true, "dependencies": { "@types/node": "*" } @@ -1614,7 +1838,6 @@ "version": "20.14.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", "integrity": "sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==", - "dev": true, "dependencies": { "undici-types": "~5.26.4" } @@ -1625,6 +1848,11 @@ "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==", "dev": true }, + "node_modules/@types/uuid": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", + "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==" + }, "node_modules/@types/w3c-web-usb": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/@types/w3c-web-usb/-/w3c-web-usb-1.0.10.tgz", @@ -1641,7 +1869,6 @@ "version": "7.4.7", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", - "dev": true, "dependencies": { "@types/node": "*" } @@ -1731,7 +1958,6 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==", - "dev": true, "dependencies": { "humanize-ms": "^1.2.1" }, @@ -1805,6 +2031,17 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, + "node_modules/axios": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", + "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -1815,7 +2052,6 @@ "version": "3.0.9", "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", - "dev": true, "dependencies": { "safe-buffer": "^5.0.1" } @@ -1824,7 +2060,6 @@ "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, "funding": [ { "type": "github", @@ -1844,7 +2079,6 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==", - "dev": true, "hasInstallScript": true, "dependencies": { "bindings": "^1.3.0" @@ -1857,7 +2091,6 @@ "version": "9.1.2", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", - "dev": true, "engines": { "node": "*" } @@ -1866,7 +2099,6 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "dev": true, "dependencies": { "file-uri-to-path": "1.0.0" } @@ -1915,14 +2147,12 @@ "node_modules/bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", - "dev": true + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "node_modules/borsh": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.7.0.tgz", "integrity": "sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==", - "dev": true, "dependencies": { "bn.js": "^5.2.0", "bs58": "^4.0.0", @@ -1949,7 +2179,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", - "dev": true, "dependencies": { "base-x": "^3.0.2" } @@ -1969,7 +2198,6 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, "funding": [ { "type": "github", @@ -2002,7 +2230,6 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.8.tgz", "integrity": "sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==", - "dev": true, "hasInstallScript": true, "optional": true, "dependencies": { @@ -2217,6 +2444,14 @@ "node": ">=8" } }, + "node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "engines": { + "node": ">=18" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2314,7 +2549,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==", - "dev": true, "engines": { "node": ">=10" }, @@ -2389,14 +2623,12 @@ "node_modules/es6-promise": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", - "dev": true + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" }, "node_modules/es6-promisify": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==", - "dev": true, "dependencies": { "es6-promise": "^4.0.3" } @@ -2524,7 +2756,6 @@ "version": "0.1.8", "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", "integrity": "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==", - "dev": true, "engines": { "node": "> 0.1.90" } @@ -2532,14 +2763,18 @@ "node_modules/fast-stable-stringify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz", - "integrity": "sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==", - "dev": true + "integrity": "sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==" + }, + "node_modules/fastestsmallesttextencoderdecoder": { + "version": "1.0.22", + "resolved": "https://registry.npmjs.org/fastestsmallesttextencoderdecoder/-/fastestsmallesttextencoderdecoder-1.0.22.tgz", + "integrity": "sha512-Pb8d48e+oIuY4MaM64Cd7OW1gt4nxCHs7/ddPPZ/Ic3sg8yVGM7O9wDvZ7us6ScaUupzM+pfBolwtYhN1IxBIw==", + "peer": true }, "node_modules/file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "dev": true + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, "node_modules/find-replace": { "version": "3.0.0", @@ -2699,7 +2934,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", - "dev": true, "dependencies": { "ms": "^2.0.0" } @@ -2708,7 +2942,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, "funding": [ { "type": "github", @@ -2768,16 +3001,14 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", - "dev": true, "peerDependencies": { "ws": "*" } }, "node_modules/jayson": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/jayson/-/jayson-4.1.0.tgz", - "integrity": "sha512-R6JlbyLN53Mjku329XoRT2zJAE6ZgOQ8f91ucYdMCD4nkGCF9kZSrcGXpHIU4jeKj58zUZke2p+cdQchU7Ly7A==", - "dev": true, + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/jayson/-/jayson-4.1.1.tgz", + "integrity": "sha512-5ZWm4Q/0DHPyeMfAsrwViwUS2DMVsQgWh8bEEIVTkfb3DzHZ2L3G5WUnF+AKmGjjM9r1uAv73SaqC1/U4RL45w==", "dependencies": { "@types/connect": "^3.4.33", "@types/node": "^12.12.54", @@ -2790,7 +3021,7 @@ "json-stringify-safe": "^5.0.1", "JSONStream": "^1.3.5", "uuid": "^8.3.2", - "ws": "^7.4.5" + "ws": "^7.5.10" }, "bin": { "jayson": "bin/jayson.js" @@ -2802,14 +3033,32 @@ "node_modules/jayson/node_modules/@types/node": { "version": "12.20.55", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", - "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", - "dev": true + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==" }, "node_modules/jayson/node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "node_modules/jayson/node_modules/ws": { + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } }, "node_modules/js-sha3": { "version": "0.8.0", @@ -2826,8 +3075,7 @@ "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" }, "node_modules/jsonfile": { "version": "4.0.0", @@ -2842,7 +3090,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", - "dev": true, "engines": [ "node >= 0.2.0" ] @@ -2851,7 +3098,6 @@ "version": "1.3.5", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "dev": true, "dependencies": { "jsonparse": "^1.2.0", "through": ">=2.2.7 <3" @@ -3009,8 +3255,7 @@ "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/mute-stream": { "version": "1.0.0", @@ -3059,7 +3304,6 @@ "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dev": true, "dependencies": { "whatwg-url": "^5.0.0" }, @@ -3079,7 +3323,7 @@ "version": "4.8.1", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.1.tgz", "integrity": "sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==", - "dev": true, + "devOptional": true, "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -3257,8 +3501,7 @@ "node_modules/regenerator-runtime": { "version": "0.14.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", - "dev": true + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" }, "node_modules/resolve-pkg-maps": { "version": "1.0.0", @@ -3280,12 +3523,15 @@ } }, "node_modules/rpc-websockets": { - "version": "7.11.1", - "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.11.1.tgz", - "integrity": "sha512-ePm9GVlk1D1p1B35iU1AiAr9lMKUpSqU9wjYoUb9YaoabfLAcQ7DG6IfQvyam2nDJ0FOSB00AgEA4pGm/wSD5A==", - "dev": true, - "dependencies": { - "eventemitter3": "^4.0.7", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-9.0.2.tgz", + "integrity": "sha512-YzggvfItxMY3Lwuax5rC18inhbjJv9Py7JXRHxTIi94JOLrqBsSsUUc5bbl5W6c11tXhdfpDPK0KzBhoGe8jjw==", + "dependencies": { + "@swc/helpers": "^0.5.11", + "@types/uuid": "^8.3.4", + "@types/ws": "^8.2.2", + "buffer": "^6.0.3", + "eventemitter3": "^5.0.1", "uuid": "^8.3.2", "ws": "^8.5.0" }, @@ -3298,11 +3544,23 @@ "utf-8-validate": "^5.0.2" } }, + "node_modules/rpc-websockets/node_modules/@types/ws": { + "version": "8.5.11", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.11.tgz", + "integrity": "sha512-4+q7P5h3SpJxaBft0Dzpbr6lmMaqh0Jr2tbhJZ/luAwvD7ohSCniYkwz/pLxuT2h0EOa6QADgJj1Ko+TzRfZ+w==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/rpc-websockets/node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" + }, "node_modules/rpc-websockets/node_modules/ws": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.0.tgz", - "integrity": "sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==", - "dev": true, + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "engines": { "node": ">=10.0.0" }, @@ -3332,7 +3590,6 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, "funding": [ { "type": "github", @@ -3506,10 +3763,9 @@ } }, "node_modules/superstruct": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-1.0.4.tgz", - "integrity": "sha512-7JpaAoX2NGyoFlI9NBh66BQXGONc+uE+MRS5i2iOBKuS4e+ccgMDjATgZldkah+33DakBxDHiss9kvUcGAO8UQ==", - "dev": true, + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-2.0.2.tgz", + "integrity": "sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==", "engines": { "node": ">=14.0.0" } @@ -3590,14 +3846,12 @@ "node_modules/text-encoding-utf-8": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz", - "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==", - "dev": true + "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==" }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" }, "node_modules/toml": { "version": "3.0.0", @@ -3608,8 +3862,7 @@ "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, "node_modules/ts-command-line-args": { "version": "2.5.1", @@ -3638,8 +3891,7 @@ "node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, "node_modules/tsx": { "version": "4.9.4", @@ -3720,7 +3972,6 @@ "version": "5.4.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", - "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -3741,8 +3992,7 @@ "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "node_modules/universalify": { "version": "0.1.2", @@ -3778,7 +4028,6 @@ "version": "5.0.10", "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", - "dev": true, "hasInstallScript": true, "optional": true, "dependencies": { @@ -3807,7 +4056,6 @@ "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, "bin": { "uuid": "dist/bin/uuid" } @@ -3815,14 +4063,12 @@ "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dev": true, "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -3860,7 +4106,6 @@ "version": "7.4.6", "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", - "dev": true, "engines": { "node": ">=8.3.0" }, diff --git a/deployment/package.json b/deployment/package.json index b7647f3c..223d9c8b 100644 --- a/deployment/package.json +++ b/deployment/package.json @@ -11,6 +11,7 @@ "@solana/web3.js": "^1.92.2", "@typechain/ethers-v5": "^11.1.2", "@types/node": "^20.11.22", + "@wormhole-foundation/example-liquidity-layer-solana": "file:../solana", "@wormhole-foundation/sdk-base": "^0.7.0", "@wormhole-foundation/sdk-definitions": "^0.7.0", "@xlabs-xyz/ledger-signer": "^0.0.4", @@ -20,7 +21,9 @@ "ethers": "^5.7.2", "tsx": "^4.7.2", "typechain": "^8.3.2", - "typescript": "^5.4.5", - "@wormhole-foundation/example-liquidity-layer-solana": "file:../solana" + "typescript": "^5.4.5" + }, + "dependencies": { + "@solana/spl-token": "^0.4.8" } } From f18d73c80dfd60323c2afa24097d27573ff39c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Thu, 18 Jul 2024 18:02:41 -0300 Subject: [PATCH 24/80] deploy: adds solana matching engine initialize script --- deployment/helpers/solana.ts | 82 ++++++++++++++++++- deployment/scripts/evm/TokenRouter/utils.ts | 2 +- .../solana/initializeMatchingEngine.ts | 74 +++++++++++++++++ 3 files changed, 156 insertions(+), 2 deletions(-) create mode 100644 deployment/scripts/solana/initializeMatchingEngine.ts diff --git a/deployment/helpers/solana.ts b/deployment/helpers/solana.ts index 2521a1c8..2f4a3795 100644 --- a/deployment/helpers/solana.ts +++ b/deployment/helpers/solana.ts @@ -1,4 +1,17 @@ -import { PublicKey } from '@solana/web3.js'; +import { + Transaction, + TransactionInstruction, + Keypair, + PublicKey, + Connection, + Commitment +} from "@solana/web3.js"; +import { SolanaLedgerSigner } from "@xlabs-xyz/ledger-signer-solana"; +import { ecosystemChains, getEnv } from "./env"; +import type { SolanaScriptCb } from "./interfaces"; +import { inspect } from "util"; + +export const connectionCommitmentLevel = (process.env.SOLANA_COMMITMENT || "confirmed") as Commitment; export function validateSolAddress(address: string){ try { @@ -7,4 +20,71 @@ export function validateSolAddress(address: string){ } catch (error) { return false; } +} + +export function solanaOperatingChains() { + const { operatingChains } = ecosystemChains; + if (Array.isArray(operatingChains) && operatingChains.length >= 1) { + return ecosystemChains.solana.networks.filter((x) => { + return operatingChains.includes(x.chainId); + }); + } + return ecosystemChains.solana.networks; +}; + +export async function runOnSolana(scriptName: string, cb: SolanaScriptCb) { + const chains = solanaOperatingChains(); + + console.log(`Running script on Solana:`, scriptName); + + const result = chains.map(async chain => { + const log = (...args: any[]) => console.log(`[${chain.chainId}]`, ...args); + const signer = await getSigner(); + log(`Starting script. Signer: ${await signer.getAddress()}`); + + try { + await cb(chain, signer, log); + log("Success"); + } catch (error) { + log("Error: ", (error as any)?.stack || inspect(error, {depth: 5})); + } + console.log(); + }); + + await Promise.all(result); +} + +let signer: SolanaLedgerSigner | null; +export async function getSigner(): Promise { + if (!signer) { + const derivationPath = getEnv("LEDGER_BIP32_PATH"); + signer = await SolanaLedgerSigner.create(derivationPath); + } + + return signer; +} + +export async function ledgerSignAndSend(connection: Connection, instructions: TransactionInstruction[], signers: Keypair[]) { + const deployerSigner = await getSigner(); + const deployerPk = new PublicKey(await deployerSigner.getAddress()); + + const tx = new Transaction(); + + tx.add(...instructions); + + const recentBlockHash = await connection.getLatestBlockhash(); + + tx.recentBlockhash = recentBlockHash.blockhash; + tx.feePayer = deployerPk; + + signers.forEach((signer) => tx.partialSign(signer)); + + await addLedgerSignature(tx, deployerSigner, deployerPk); + + return connection.sendRawTransaction(tx.serialize()); +} + +async function addLedgerSignature(tx: Transaction, signer: SolanaLedgerSigner, signerPk: PublicKey) { + const signedByPayer = await signer.signTransaction(tx.compileMessage().serialize()); + tx.addSignature(signerPk, signedByPayer); } \ No newline at end of file diff --git a/deployment/scripts/evm/TokenRouter/utils.ts b/deployment/scripts/evm/TokenRouter/utils.ts index ec3726ef..307fff75 100644 --- a/deployment/scripts/evm/TokenRouter/utils.ts +++ b/deployment/scripts/evm/TokenRouter/utils.ts @@ -22,7 +22,7 @@ export async function deployImplementation(chain: ChainInfo, signer: ethers.Sign const matchingEngineMintRecipient = (new UniversalAddress(getMintRecipientAddress(), 'base58')).toString(); const matchinEngineChain = 1; // Solana wormhole chain id - const matchingEngineDomain = 5; // Solana cctp domain + const matchingEngineDomain = 5; // Solana cctp domain let matchingEngineAddress = (getContractAddress( "MatchingEngineProxy", matchinEngineChain diff --git a/deployment/scripts/solana/initializeMatchingEngine.ts b/deployment/scripts/solana/initializeMatchingEngine.ts new file mode 100644 index 00000000..243738fe --- /dev/null +++ b/deployment/scripts/solana/initializeMatchingEngine.ts @@ -0,0 +1,74 @@ +import { + ComputeBudgetProgram, + Connection, + PublicKey, +} from "@solana/web3.js"; +import "dotenv/config"; +import { uint64ToBN } from "@wormhole-foundation/example-liquidity-layer-solana/common"; +import { AuctionParameters, MatchingEngineProgram } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; +import { LoggerFn, connectionCommitmentLevel, getChainConfig, getContractAddress, ledgerSignAndSend, runOnSolana } from "../../helpers"; +import { MatchingEngineConfiguration } from "../../config/config-types"; +import { ProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; +import { SolanaLedgerSigner } from "@xlabs-xyz/ledger-signer-solana"; +import { circle } from "@wormhole-foundation/sdk-base"; + + +const AUCTION_PARAMS: AuctionParameters = { + userPenaltyRewardBps: 400000, // 40% + initialPenaltyBps: 250000, // 25% + duration: 5, // slots + gracePeriod: 10, // slots + penaltyPeriod: 20, // slots + minOfferDeltaBps: 50000, // 5% + securityDepositBase: uint64ToBN(1000000n), // 1 USDC + securityDepositBps: 5000, // 0.5% +}; + +runOnSolana("deploy-matching-engine", async (chain, signer, log) => { + const config = await getChainConfig("matching-engine", chain.chainId); + const matchingEngineId = getContractAddress("MatchingEngine", chain.chainId) as ProgramId; + + const env = "Mainnet"; + const usdcMint = new PublicKey(circle.usdcContract(env, "Solana")); + const connection = new Connection(chain.rpc, connectionCommitmentLevel); + const matchingEngine = new MatchingEngineProgram(connection, matchingEngineId, usdcMint); + + await initialize(matchingEngine, signer, log, config, usdcMint); +}); + +async function initialize(matchingEngine: MatchingEngineProgram, signer: SolanaLedgerSigner, log: LoggerFn, config: MatchingEngineConfiguration, usdcMint: PublicKey) { + const connection = matchingEngine.program.provider.connection; + + const custodian = matchingEngine.custodianAddress(); + log("custodian", custodian.toString()); + + const exists = await connection.getAccountInfo(custodian).then((acct) => acct != null); + if (exists) { + log("already initialized"); + return; + } + + const signerPubkey = new PublicKey(await signer.getAddress()); + const initializeIx = await matchingEngine.initializeIx( + { + owner: signerPubkey, + ownerAssistant: signerPubkey, + feeRecipient: signerPubkey, + }, + AUCTION_PARAMS, + ); + + const splToken = await import("@solana/spl-token"); + const assocciatedTokenProgramId = splToken.ASSOCIATED_TOKEN_PROGRAM_ID; + const associatedToken = splToken.getAssociatedTokenAddressSync(usdcMint, signerPubkey, undefined, usdcMint, assocciatedTokenProgramId); + const createAtaInstructions = []; + createAtaInstructions.push(splToken.createAssociatedTokenAccountInstruction(signerPubkey, associatedToken, signerPubkey, usdcMint)); + createAtaInstructions.push(ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 1 })); + + const createAtaTxid = await ledgerSignAndSend(connection, createAtaInstructions, []); + log(`CreateAtaTxid ${createAtaTxid}`); + + const initializeTxid = await ledgerSignAndSend(connection, [initializeIx], []); + log(`InitializeTxid ${initializeTxid}`); +} + From 5994efbcac664ff26ef0a8ec99197534ca18a12c Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Fri, 19 Jul 2024 14:08:58 -0300 Subject: [PATCH 25/80] WIP scripts --- deployment/config/config-types.ts | 4 +- deployment/helpers/env.ts | 7 +- deployment/helpers/interfaces.ts | 28 ++++-- deployment/helpers/utils.ts | 6 +- .../bytecode-verification-token-router.ts | 87 +++++++++++-------- .../cross-registration-token-router.ts | 37 ++++++++ 6 files changed, 121 insertions(+), 48 deletions(-) create mode 100644 deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts diff --git a/deployment/config/config-types.ts b/deployment/config/config-types.ts index 66b90c62..e438b93d 100644 --- a/deployment/config/config-types.ts +++ b/deployment/config/config-types.ts @@ -12,7 +12,7 @@ export type TokenRouterConfiguration = { baseFee: number; initAuctionFee: number; }; - cctpAllowance: number; + cctpAllowance: string; disableRouterEndpoints?: ChainId[]; }; @@ -30,5 +30,5 @@ export type MatchingEngineConfiguration = { // Mutable values ownerAssistant: string; feeRecipient: string; - cctpAllowance: number; + cctpAllowance: string; }; \ No newline at end of file diff --git a/deployment/helpers/env.ts b/deployment/helpers/env.ts index 49bd92b5..707c68a3 100644 --- a/deployment/helpers/env.ts +++ b/deployment/helpers/env.ts @@ -1,7 +1,7 @@ import fs from "fs"; import { ethers, utils } from "ethers"; import { validateSolAddress } from "./solana"; -import { ChainConfig, ChainInfo, ContractsJson, Dependencies, Ecosystem } from "./interfaces"; +import { ChainConfig, ChainInfo, ContractsJson, Dependencies, Ecosystem, VerificationApiKeys } from "./interfaces"; import { getSigner } from "./evm"; // TODO: support different env files import 'dotenv/config'; @@ -11,6 +11,7 @@ export const env = getEnv("ENV"); export const contracts = loadContracts(); export const dependencies = loadDependencies(); export const ecosystemChains = loadEcosystem(); +export const verificationApiKeys = loadVerificationApiKeys(); function loadJson(filename: string): T { const fileContent = fs.readFileSync( @@ -32,6 +33,10 @@ function loadEcosystem(): Ecosystem { return loadJson("ecosystem"); } +function loadVerificationApiKeys() { + return loadJson("verification-api-keys"); +} + export function getEnv(env: string): string { const v = process.env[env]; if (!v) { diff --git a/deployment/helpers/interfaces.ts b/deployment/helpers/interfaces.ts index 6a8b44fc..62916c9a 100644 --- a/deployment/helpers/interfaces.ts +++ b/deployment/helpers/interfaces.ts @@ -1,4 +1,4 @@ -import { ChainId } from "@wormhole-foundation/sdk-base"; +import { ChainId, Network } from "@wormhole-foundation/sdk-base"; import { SolanaLedgerSigner } from "@xlabs-xyz/ledger-signer-solana"; import { BytesLike, ethers } from "ethers"; @@ -9,13 +9,23 @@ export type LoggerFn = (...args: any[]) => void; export type ChainInfo = { name: string; - chainId: ChainId; // Wormhole ChainId + /** + * Wormhole ChainId + */ + chainId: ChainId; rpc: string; - externalId?: string; // Native ChainId + /** + * Native ChainId + */ + externalId?: string; + network: Network; }; export type Deployment = { - chainId: number; // Wormhole ChainId + /** + * Wormhole ChainId + */ + chainId: number; address: string; constructorArgs?: any[]; }; @@ -33,7 +43,10 @@ export type Ecosystem = { export type ContractsJson = Record; export interface ChainConfig { - chainId: ChainId; // Wormhole ChainId + /** + * Wormhole ChainId + */ + chainId: ChainId; } export interface Dependencies extends ChainConfig { @@ -57,7 +70,10 @@ export interface VerificationApiKeys extends ChainConfig { } export type RouterEndpoint = { - wormholeChainId: ChainId; + /** + * Wormhole ChainId + */ + chainId: ChainId; endpoint: { router: BytesLike; mintRecipient: BytesLike; diff --git a/deployment/helpers/utils.ts b/deployment/helpers/utils.ts index bb1ca52f..de4764cb 100644 --- a/deployment/helpers/utils.ts +++ b/deployment/helpers/utils.ts @@ -1,5 +1,6 @@ import chalk from 'chalk'; import { ChainInfo, LoggerFn, ValueDiff } from '.'; +import { UniversalAddress } from '@wormhole-foundation/sdk-definitions'; export const someoneIsDifferent = (values: ValueDiff[]) => values.some((value) => value.onChain.toString() !== value.offChain.toString() && Number(value.onChain) !== Number(value.offChain)); @@ -48,7 +49,10 @@ export function flattenObject(obj: Record, parentKey = '', result: return result; } -/// Verify bytecode helper +export function getUniversalAddress(address: string): string { + const type = getAddressType(address); + return new UniversalAddress(address, type).toString() +} export function getVerifyCommand( chain: ChainInfo, diff --git a/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts b/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts index 8ca7e0f6..db45f653 100644 --- a/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts @@ -1,4 +1,4 @@ -import { runOnEvms, ChainInfo, LoggerFn, getContractAddress, getDeploymentArgs, getVerifyCommand } from "../../../helpers"; +import { runOnEvms, ChainInfo, LoggerFn, getContractAddress, getDeploymentArgs, getVerifyCommand, verificationApiKeys, flattenObject } from "../../../helpers"; import { ethers } from "ethers"; import { execSync } from "child_process"; import path from "path"; @@ -8,44 +8,55 @@ runOnEvms("bytecode-verification-token-router", async (chain: ChainInfo, signer: // The root path of the foundry project const rootPath = path.resolve('../evm/'); - if (chain.externalId === undefined) - throw new Error(`Chain ${chain.chainId} does not have an external ID`); - // Implementation data - const implementationName = "TokenRouter"; - const implementationPath = 'src/TokenRouter/TokenRouter.sol'; - const implementationAddress = getContractAddress("TokenRouterImplementation", chain.chainId); - const implementationDeploymentArgs = getDeploymentArgs("TokenRouterImplementation", chain.chainId); - const implementationConstructorSignature = "constructor(address,address,address,uint16,bytes32,bytes32,uint32)"; - const verifyImplementationCommand = getVerifyCommand( - implementationName, - implementationPath, - implementationAddress, - implementationConstructorSignature, - implementationDeploymentArgs, - parseInt(chain.externalId) - ); - - // Proxy data - const proxyName = "ERC1967Proxy"; - const proxyPath = 'lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol'; - const proxyAddress = getContractAddress("TokenRouterProxy", chain.chainId); - const proxyDeploymentArgs = getDeploymentArgs("TokenRouterProxy", chain.chainId); - const proxyConstructorSignature = "constructor(address,bytes)"; - const verifyProxyCommand = getVerifyCommand( - proxyName, - proxyPath, - proxyAddress, - proxyConstructorSignature, - proxyDeploymentArgs, - parseInt(chain.externalId) - ); + const verifiersData = verificationApiKeys.find((x) => x.chainId == chain.chainId); + const verifiers = flattenObject(verifiersData!); + delete verifiers.chainId; - log(chalk.green("Verifying implementation bytecode...")); - execSync(verifyImplementationCommand, { stdio: "inherit", cwd: rootPath }); - console.log() + for (let [name, apiKey] of Object.entries(verifiers)) { + name = name.split("-")[0]; - log(chalk.green("Verifying proxy bytecode...")); - execSync(verifyProxyCommand, { stdio: "inherit", cwd: rootPath }); - console.log() + // Implementation data + const implementationName = "MatchingEngine"; + const implementationPath = 'src/MatchingEngine/MatchingEngine.sol'; + const implementationAddress = getContractAddress("MatchingEngineImplementation", chain.chainId); + const implementationDeploymentArgs = getDeploymentArgs("MatchingEngineImplementation", chain.chainId); + const implementationConstructorSignature = "constructor(address,address,address,uint24,uint24,uint8,uint8,uint8)"; + const verifyImplementationCommand = getVerifyCommand( + chain, + implementationName, + implementationPath, + implementationAddress, + implementationConstructorSignature, + implementationDeploymentArgs, + name, + apiKey + ); + + // Proxy data + const proxyName = "ERC1967Proxy"; + const proxyPath = 'lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol'; + const proxyAddress = getContractAddress("MatchingEngineProxy", chain.chainId); + const proxyDeploymentArgs = getDeploymentArgs("MatchingEngineProxy", chain.chainId); + const proxyConstructorSignature = "constructor(address,bytes)"; + const verifyProxyCommand = getVerifyCommand( + chain, + proxyName, + proxyPath, + proxyAddress, + proxyConstructorSignature, + proxyDeploymentArgs, + name, + apiKey + ); + + log(chalk.green(`Verifying bytecode on ${name}...`)); + log(chalk.green("Verifying implementation bytecode...")); + execSync(verifyImplementationCommand, { stdio: "inherit", cwd: rootPath }); + console.log() + + log(chalk.green("Verifying proxy bytecode...")); + execSync(verifyProxyCommand, { stdio: "inherit", cwd: rootPath }); + console.log() + } }); \ No newline at end of file diff --git a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts new file mode 100644 index 00000000..8dd5af6d --- /dev/null +++ b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts @@ -0,0 +1,37 @@ +import { ChainInfo, LoggerFn, getContractInstance, getContractAddress, runOnEvms, contracts, getUniversalAddress } from "../../../helpers"; +import { ethers } from "ethers"; +import { TokenRouter } from "../../../contract-bindings"; +import { circle } from "@wormhole-foundation/sdk-base"; + +runOnEvms("cross-registration-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { + const tokenRouterAddress = getContractAddress("TokenRouterProxy", chain.chainId); + const tokenRouter = (await getContractInstance("TokenRouter", tokenRouterAddress, chain)) as TokenRouter; + const deployedTokenRouters = contracts['TokenRouterProxy'].filter((router) => router.chainId !== chain.chainId); + + for (const router of deployedTokenRouters) { + const circleDomain = circle.toCircleChainId(chain.network, router.chainId); + const endpoint = { + router: getUniversalAddress(router.address), + mintRecipient: getUniversalAddress(router.address) + }; + + + // check if is already registered + + if (router.chainId === 0) + throw new Error('Invalid chainId when register new router endpoint'); + + if (Number(router.address) === 0) + throw new Error(`Invalid router address for chainId ${router.chainId}`); + + const isAlreadyRegistered = + + await tokenRouter.addRouterEndpoint(router.chainId, endpoint, circleDomain); + log(`Router endpoint added for chainId ${router.chainId}`); + } +}); + +function isRouterEndpointRegistered(router: TokenRouter, chainId: number, endpoint: { router: string; mintRecipient: string }) { + const mintRecipient = await tokenRouter.getMintRecipient(router.chainId, endpoint); + return Number(mintRecipient) !== 0; +} \ No newline at end of file From 48a442d0f12d2664fe6caf944aa269d055e05c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Fri, 19 Jul 2024 15:13:50 -0300 Subject: [PATCH 26/80] deploy: adds register router script for solana matching engine --- .../solana/registerRoutersInMatchingEngine.ts | 193 ++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100644 deployment/scripts/solana/registerRoutersInMatchingEngine.ts diff --git a/deployment/scripts/solana/registerRoutersInMatchingEngine.ts b/deployment/scripts/solana/registerRoutersInMatchingEngine.ts new file mode 100644 index 00000000..6d10e101 --- /dev/null +++ b/deployment/scripts/solana/registerRoutersInMatchingEngine.ts @@ -0,0 +1,193 @@ +import { + ComputeBudgetProgram, + Connection, + PublicKey, +} from "@solana/web3.js"; +import "dotenv/config"; +import { MatchingEngineProgram } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; +import { LoggerFn, connectionCommitmentLevel, contracts, getContractAddress, ledgerSignAndSend, runOnSolana } from "../../helpers"; +import { ProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; +import { SolanaLedgerSigner } from "@xlabs-xyz/ledger-signer-solana"; +import { Chain, chainToPlatform, circle, toChain, toChainId } from "@wormhole-foundation/sdk-base"; +import { toUniversal } from "@wormhole-foundation/sdk-definitions"; +import { TokenRouterProgram } from "@wormhole-foundation/example-liquidity-layer-solana/tokenRouter"; + + +runOnSolana("register-routers-matching-engine", async (chain, signer, log) => { + const matchingEngineId = getContractAddress("MatchingEngine", chain.chainId) as ProgramId; + + const env = "Mainnet"; + const usdcMint = new PublicKey(circle.usdcContract(env, "Solana")); + const connection = new Connection(chain.rpc, connectionCommitmentLevel); + const matchingEngine = new MatchingEngineProgram(connection, matchingEngineId, usdcMint); + + const deployedTokenRouters = contracts['TokenRouterProxy']; + + for (const router of deployedTokenRouters) { + const circleDomain = circle.toCircleChainId(chain.network, router.chainId); + const routerChain = toChain(router.chainId); + const routerAddress = toUniversal(routerChain, router.address); + + // check if it is already registered + + if (router.chainId === 0) + throw new Error('Invalid chainId when registering new router endpoint'); + + + if (Number(router.address) === 0) + throw new Error(`Invalid router address for chainId ${router.chainId}`); + + const chainName = toChain(chain.chainId); + if (chain.chainId === toChainId("Solana")) { + throw new Error("not implemented"); + // await addSolanaCctpRouterEndpoint(matchingEngine, signer, tokenRouter) + } else if (chainToPlatform(chainName) === "Evm") { + await addCctpRouterEndpoint(matchingEngine, signer, chainName, circleDomain, routerAddress.toString(), null, log); + } else { + throw new Error(`Router registrations not implemented for ${chainName}`); + } + log(`Router endpoint added for chainId ${router.chainId}`); + } +}); + + +async function addCctpRouterEndpoint( + matchingEngine: MatchingEngineProgram, + signer: SolanaLedgerSigner, + foreignChain: Chain, + cctpDomain: number, + foreignEmitter: string, + foreignMintRecipient: string | null, + log: LoggerFn, +) { + await matchingEngine.fetchCustodian().catch((_) => { + throw new Error("no custodian found"); + }); + + const connection = matchingEngine.program.provider.connection; + + const foreignChainId = toChainId(foreignChain); + const endpoint = matchingEngine.routerEndpointAddress(foreignChainId); + const exists = await connection.getAccountInfo(endpoint).then((acct) => acct != null); + + const endpointAddress = Array.from(toUniversal(foreignChain, foreignEmitter).unwrap()); + const endpointMintRecipient = + foreignMintRecipient === null + ? null + : Array.from(toUniversal(foreignChain, foreignMintRecipient).unwrap()); + + const signerPubkey = new PublicKey(await signer.getAddress()); + + const [registerIx, action] = await (async () => { + if (exists) { + const { address, mintRecipient } = await matchingEngine.fetchRouterEndpointInfo(foreignChainId); + if ( + Buffer.from(address).equals(Buffer.from(endpointAddress)) && + Buffer.from(mintRecipient).equals( + Buffer.from(endpointMintRecipient ?? endpointAddress), + ) + ) { + return [null, "already exists"] as const; + } else { + // TODO: check that signer pubkey is owner + const registerIx = await matchingEngine.updateCctpRouterEndpointIx( + { owner: signerPubkey }, + { + chain: foreignChainId, + address: endpointAddress, + mintRecipient: endpointMintRecipient, + cctpDomain, + }, + ); + return [registerIx, "updated"] as const; + } + } else { + const registerIx = await matchingEngine.addCctpRouterEndpointIx( + { + ownerOrAssistant: signerPubkey, + }, + { + chain: foreignChainId, + address: endpointAddress, + mintRecipient: endpointMintRecipient, + cctpDomain, + }, + ); + return [registerIx, "added"] as const; + } + })(); + + if (action === "already exists") { + log( + "endpoint already exists", + foreignChain, + "addr", + foreignEmitter, + "domain", + cctpDomain, + "mintRecipient", + foreignMintRecipient, + ); + } else { + const priorityFeeIx = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 1 }); + const instructions = [registerIx, priorityFeeIx] + const txSig = await ledgerSignAndSend(connection, instructions, []); + log( + `${action} endpoint`, + txSig, + "foreignChain", + foreignChain, + "addr", + foreignEmitter, + "domain", + cctpDomain, + "mintRecipient", + foreignMintRecipient, + ); + } +} + +async function addSolanaCctpRouterEndpoint( + matchingEngine: MatchingEngineProgram, + signer: SolanaLedgerSigner, + tokenRouter: TokenRouterProgram, + log: LoggerFn, +) { + await matchingEngine.fetchCustodian().catch((_) => { + throw new Error("no custodian found"); + }); + + const connection = matchingEngine.program.provider.connection; + + const chain = toChainId("Solana"); + const endpoint = matchingEngine.routerEndpointAddress(chain); + const exists = await connection.getAccountInfo(endpoint).then((acct) => acct != null); + + const endpointAddress = Array.from( + toUniversal("Solana", tokenRouter.custodianAddress().toString()).unwrap(), + ); + const endpointMintRecipient = Array.from( + toUniversal("Solana", tokenRouter.cctpMintRecipientAddress().toString()).unwrap(), + ); + + if (exists) { + const { address, mintRecipient } = await matchingEngine.fetchRouterEndpointInfo(chain); + if ( + Buffer.from(address).equals(Buffer.from(endpointAddress)) && + Buffer.from(mintRecipient).equals(Buffer.from(endpointMintRecipient ?? endpointAddress)) + ) { + log("local endpoint already exists", endpoint.toString()); + return; + } + } + + const signerPubkey = new PublicKey(await signer.getAddress()); + const registerIx = await matchingEngine.addLocalRouterEndpointIx({ + ownerOrAssistant: signerPubkey, + tokenRouterProgram: tokenRouter.ID, + }); + const priorityFeeIx = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 1 }); + const instructions = [registerIx, priorityFeeIx]; + const txSig = await ledgerSignAndSend(connection, instructions, []); + log("added local endpoint", txSig, "router", tokenRouter.ID.toString()); +} \ No newline at end of file From 84ef0f860d9b61377c9ee44ffb80ed2c3047eba8 Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Mon, 22 Jul 2024 14:05:14 -0300 Subject: [PATCH 27/80] Finished cross registration script --- .../cross-registration-token-router.ts | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts index 8dd5af6d..9833a2f2 100644 --- a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts @@ -1,7 +1,7 @@ import { ChainInfo, LoggerFn, getContractInstance, getContractAddress, runOnEvms, contracts, getUniversalAddress } from "../../../helpers"; import { ethers } from "ethers"; import { TokenRouter } from "../../../contract-bindings"; -import { circle } from "@wormhole-foundation/sdk-base"; +import { circle, toChain } from "@wormhole-foundation/sdk-base"; runOnEvms("cross-registration-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { const tokenRouterAddress = getContractAddress("TokenRouterProxy", chain.chainId); @@ -9,29 +9,25 @@ runOnEvms("cross-registration-token-router", async (chain: ChainInfo, signer: et const deployedTokenRouters = contracts['TokenRouterProxy'].filter((router) => router.chainId !== chain.chainId); for (const router of deployedTokenRouters) { - const circleDomain = circle.toCircleChainId(chain.network, router.chainId); + const circleDomain = circle.toCircleChainId(chain.network, toChain(router.chainId)); const endpoint = { router: getUniversalAddress(router.address), mintRecipient: getUniversalAddress(router.address) }; - - // check if is already registered - if (router.chainId === 0) throw new Error('Invalid chainId when register new router endpoint'); if (Number(router.address) === 0) throw new Error(`Invalid router address for chainId ${router.chainId}`); - const isAlreadyRegistered = + const currentMintRecipient = await tokenRouter.getMintRecipient(router.chainId); + if (Number(currentMintRecipient) !== 0) { + log(`Router endpoint already registered for chainId ${router.chainId}`); + continue; + } await tokenRouter.addRouterEndpoint(router.chainId, endpoint, circleDomain); log(`Router endpoint added for chainId ${router.chainId}`); } }); - -function isRouterEndpointRegistered(router: TokenRouter, chainId: number, endpoint: { router: string; mintRecipient: string }) { - const mintRecipient = await tokenRouter.getMintRecipient(router.chainId, endpoint); - return Number(mintRecipient) !== 0; -} \ No newline at end of file From 77f08a438014d39aad53c5ba18f8179fcba8b8c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Mon, 22 Jul 2024 16:08:33 -0300 Subject: [PATCH 28/80] deploy: build only proxy contract from openzeppelin --- deployment/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/package.json b/deployment/package.json index 223d9c8b..3c3b63a9 100644 --- a/deployment/package.json +++ b/deployment/package.json @@ -1,7 +1,7 @@ { "name": "deployment", "scripts": { - "evm-deps": "forge build -C $(dirname $(pwd))/evm/lib/openzeppelin-contracts/contracts", + "evm-deps": "forge build --contracts $(dirname $(pwd))/evm/lib/openzeppelin-contracts/contracts/proxy", "build-evm": "npm run evm-deps && npx typechain --target=ethers-v5 --out-dir=./contract-bindings ../evm/out/*/*.json ../out/*/*.json" }, "author": "", From d18f3548f1f676826de3a288260460dc201763ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Mon, 22 Jul 2024 16:10:08 -0300 Subject: [PATCH 29/80] deploy: adds Solana config --- deployment/config/config-types.ts | 75 +++++++++++++++++-- .../config/testnet/matching-engine.json | 12 +-- .../solana/initializeMatchingEngine.ts | 35 +++++---- 3 files changed, 96 insertions(+), 26 deletions(-) diff --git a/deployment/config/config-types.ts b/deployment/config/config-types.ts index e438b93d..2bff6cd0 100644 --- a/deployment/config/config-types.ts +++ b/deployment/config/config-types.ts @@ -1,34 +1,99 @@ import { ChainId } from "@wormhole-foundation/sdk-base"; +// TODO: check if solana has different needs for the TokenRouter export type TokenRouterConfiguration = { // Wormhole Chain ID of the token router configuration chainId: ChainId; // Mutable values + /** + * Account with the authority to add + * new token routers among other operations. + */ ownerAssistant: string; fastTransferParameters: { enabled: boolean; - maxAmount: number; - baseFee: number; - initAuctionFee: number; + /** + * Expressed in μUSDC. + * E.g. 1000000000 is 1000 USDC. + */ + maxAmount: string; + /** + * Expressed in μUSDC. + * E.g. 1250000 is 1.25 USDC. + */ + baseFee: string; + /** + * Expressed in μUSDC. + * E.g. 950000 is 0.95 USDC. + */ + initAuctionFee: string; }; cctpAllowance: string; disableRouterEndpoints?: ChainId[]; }; export type MatchingEngineConfiguration = { - // Wormhole Chain ID of the matching engine configuration + /** + * Wormhole Chain ID of the matching engine configuration + */ chainId: ChainId; // Immutable values + /** + * The part of the penalty that is awarded to the user when the auction is completed. + * E.g. 400000 is 40%. + */ userPenaltyRewardBps: string; + /** + * The initial penalty proportion that is incurred once the grace period is over. + * E.g. 250000 is 25%. + */ initialPenaltyBps: string; + /** + * Auction duration in Solana slots. + */ auctionDuration: string; + /** + * Auction grace period in Solana slots. + * The grace period of the auction in slots. This is the number of slots the highest bidder + * has to execute the fast order before incurring a penalty. + * This value INCLUDES the `auctionDuration`. + */ auctionGracePeriod: string; - auctionPenaltyBlocks: string; + /** + * The `securityDeposit` decays over this period. + * Expressed in Solana slots. + */ + auctionPenaltySlots: string; + /** + * minimum offer increment for auctions. + * New offers need to surpass a threshold given by this parameter. + * E.g. 50000 is 5%. + */ + minOfferDeltaBps: string; + /** + * The base security deposit, which will the the additional amount an auction participant must + * deposit to participate in an auction. Expressed in μUSDC. + * E.g. 1000000 is 1 USDC. + */ + securityDepositBase: string; + /** + * Additional security deposit based on the notional of the order amount. + * E.g. 5000 is 0.5%. + */ + securityDepositBps: string; // Mutable values + /** + * Solana account with the authority to add + * new token routers among other operations. + */ ownerAssistant: string; + /** + * Fee recipient for relayer service of slow orders, i.e. those that do not + * have an associated auction. + */ feeRecipient: string; cctpAllowance: string; }; \ No newline at end of file diff --git a/deployment/config/testnet/matching-engine.json b/deployment/config/testnet/matching-engine.json index ad6fe13a..7b04f2b7 100644 --- a/deployment/config/testnet/matching-engine.json +++ b/deployment/config/testnet/matching-engine.json @@ -7,7 +7,7 @@ "initialPenaltyBps": "", "auctionDuration": "", "auctionGracePeriod": "", - "auctionPenaltyBlocks": "" + "auctionPenaltySlots": "" }, { "chainId": 5, @@ -17,7 +17,7 @@ "initialPenaltyBps": "", "auctionDuration": "", "auctionGracePeriod": "", - "auctionPenaltyBlocks": "" + "auctionPenaltySlots": "" }, { "chainId": 6, @@ -27,7 +27,7 @@ "initialPenaltyBps": "", "auctionDuration": "", "auctionGracePeriod": "", - "auctionPenaltyBlocks": "" + "auctionPenaltySlots": "" }, { "chainId": 23, @@ -37,7 +37,7 @@ "initialPenaltyBps": "", "auctionDuration": "", "auctionGracePeriod": "", - "auctionPenaltyBlocks": "" + "auctionPenaltySlots": "" }, { "chainId": 24, @@ -47,7 +47,7 @@ "initialPenaltyBps": "", "auctionDuration": "", "auctionGracePeriod": "", - "auctionPenaltyBlocks": "" + "auctionPenaltySlots": "" }, { "chainId": 30, @@ -57,6 +57,6 @@ "initialPenaltyBps": "", "auctionDuration": "", "auctionGracePeriod": "", - "auctionPenaltyBlocks": "" + "auctionPenaltySlots": "" } ] \ No newline at end of file diff --git a/deployment/scripts/solana/initializeMatchingEngine.ts b/deployment/scripts/solana/initializeMatchingEngine.ts index 243738fe..75e3f8a5 100644 --- a/deployment/scripts/solana/initializeMatchingEngine.ts +++ b/deployment/scripts/solana/initializeMatchingEngine.ts @@ -12,18 +12,6 @@ import { ProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/m import { SolanaLedgerSigner } from "@xlabs-xyz/ledger-signer-solana"; import { circle } from "@wormhole-foundation/sdk-base"; - -const AUCTION_PARAMS: AuctionParameters = { - userPenaltyRewardBps: 400000, // 40% - initialPenaltyBps: 250000, // 25% - duration: 5, // slots - gracePeriod: 10, // slots - penaltyPeriod: 20, // slots - minOfferDeltaBps: 50000, // 5% - securityDepositBase: uint64ToBN(1000000n), // 1 USDC - securityDepositBps: 5000, // 0.5% -}; - runOnSolana("deploy-matching-engine", async (chain, signer, log) => { const config = await getChainConfig("matching-engine", chain.chainId); const matchingEngineId = getContractAddress("MatchingEngine", chain.chainId) as ProgramId; @@ -49,13 +37,23 @@ async function initialize(matchingEngine: MatchingEngineProgram, signer: SolanaL } const signerPubkey = new PublicKey(await signer.getAddress()); + const auctionParams: AuctionParameters = { + userPenaltyRewardBps: toIntegerNumber(config.userPenaltyRewardBps, "userPenaltyRewardBps"), + initialPenaltyBps: toIntegerNumber(config.initialPenaltyBps, "initialPenaltyBps"), + duration: toIntegerNumber(config.auctionDuration, "duration"), + gracePeriod: toIntegerNumber(config.auctionGracePeriod, "gracePeriod"), + penaltyPeriod: toIntegerNumber(config.auctionPenaltySlots, "penaltyPeriod"), + minOfferDeltaBps: toIntegerNumber(config.minOfferDeltaBps, "minOfferDeltaBps"), + securityDepositBase: uint64ToBN(BigInt(config.securityDepositBase)), + securityDepositBps: toIntegerNumber(config.securityDepositBps, "securityDepositBps"), + } const initializeIx = await matchingEngine.initializeIx( { owner: signerPubkey, - ownerAssistant: signerPubkey, - feeRecipient: signerPubkey, + ownerAssistant: new PublicKey(config.ownerAssistant), + feeRecipient: new PublicKey(config.feeRecipient), }, - AUCTION_PARAMS, + auctionParams ); const splToken = await import("@solana/spl-token"); @@ -72,3 +70,10 @@ async function initialize(matchingEngine: MatchingEngineProgram, signer: SolanaL log(`InitializeTxid ${initializeTxid}`); } +function toIntegerNumber(text: string, name: string): number { + const res = Number(text); + if (!Number.isSafeInteger(res)) { + throw new Error(`${name} is not a safe integer. Received ${text}`) + } + return res; +} \ No newline at end of file From b779b4608d895141fc2f234adac03c535add2820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Mon, 22 Jul 2024 16:11:37 -0300 Subject: [PATCH 30/80] deploy: mainnet configuration --- deployment/config/mainnet/dependencies.json | 14 +++++++++++ deployment/config/mainnet/ecosystem.json | 22 +++++++++++++++++ .../config/mainnet/matching-engine.json | 16 +++++++++++++ deployment/config/mainnet/token-router.json | 24 +++++++++++++++++++ 4 files changed, 76 insertions(+) create mode 100644 deployment/config/mainnet/dependencies.json create mode 100644 deployment/config/mainnet/ecosystem.json create mode 100644 deployment/config/mainnet/matching-engine.json create mode 100644 deployment/config/mainnet/token-router.json diff --git a/deployment/config/mainnet/dependencies.json b/deployment/config/mainnet/dependencies.json new file mode 100644 index 00000000..eefb9ab6 --- /dev/null +++ b/deployment/config/mainnet/dependencies.json @@ -0,0 +1,14 @@ +[ + { + "chainId": 23, + "wormhole": "0xa5f208e072434bC67592E4C49C1B991BA79BCA46", + "token": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + "tokenMessenger": "0x19330d10D9Cc8751218eaf51E8885D058642E08A" + }, + { + "chainId": 30, + "wormhole": "0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6", + "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "tokenMessenger": "0x1682Ae6375C4E4A97e4B583BC394c861A46D8962" + } +] \ No newline at end of file diff --git a/deployment/config/mainnet/ecosystem.json b/deployment/config/mainnet/ecosystem.json new file mode 100644 index 00000000..83fa7bd3 --- /dev/null +++ b/deployment/config/mainnet/ecosystem.json @@ -0,0 +1,22 @@ +{ + "operatingChains": [23, 30], + "evm": { + "networks": [ + { + "name": "Arbitrum", + "externalId": "42161", + "chainId": 23, + "rpc": "https://rpc.ankr.com/arbitrum" + }, + { + "name": "Base", + "externalId": "8453", + "chainId": 30, + "rpc": "https://mainnet.base.org" + } + ] + }, + "solana": { + "networks": [] + } +} \ No newline at end of file diff --git a/deployment/config/mainnet/matching-engine.json b/deployment/config/mainnet/matching-engine.json new file mode 100644 index 00000000..6866d7f2 --- /dev/null +++ b/deployment/config/mainnet/matching-engine.json @@ -0,0 +1,16 @@ +[ + { + "chainId": 1, + "ownerAssistant": "", + "feeRecipient": "AdAVF5KmmGmpNQhjY7FL96wZLEynD6Mx3VXJTZf2yFps", + "userPenaltyRewardBps": "100", + "initialPenaltyBps": "100", + "auctionDuration": "20", + "auctionGracePeriod": "20", + "auctionPenaltySlots": "5", + "minOfferDeltaBps": "50000", + "securityDepositBase": "1000000", + "securityDepositBps": "1000", + "cctpAllowance": "115792089237316195423570985008687907853269984665640564039457584007913129639935" + } +] \ No newline at end of file diff --git a/deployment/config/mainnet/token-router.json b/deployment/config/mainnet/token-router.json new file mode 100644 index 00000000..f9cfa034 --- /dev/null +++ b/deployment/config/mainnet/token-router.json @@ -0,0 +1,24 @@ +[ + { + "chainId": 23, + "ownerAssistant": "", + "fastTransferParameters": { + "enabled": true, + "maxAmount": "1000000000", + "baseFee": "1250000", + "initAuctionFee": "950000" + }, + "cctpAllowance": "115792089237316195423570985008687907853269984665640564039457584007913129639935" + }, + { + "chainId": 30, + "ownerAssistant": "", + "fastTransferParameters": { + "enabled": true, + "maxAmount": "1000000000", + "baseFee": "1250000", + "initAuctionFee": "950000" + }, + "cctpAllowance": "115792089237316195423570985008687907853269984665640564039457584007913129639935" + } +] \ No newline at end of file From cf092cbfbbd6dfe508cdde302312ab73a51621d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Mon, 22 Jul 2024 16:13:31 -0300 Subject: [PATCH 31/80] deploy: removes matching engine code for EVM --- .../bytecode-verification-matching-engine.ts | 66 ---------- .../MatchingEngine/config-matching-engine.ts | 89 -------------- .../MatchingEngine/deploy-matching-engine.ts | 43 ------- .../disable-router-matching-engine.ts | 37 ------ .../get-config-diff-matching-engine.ts | 14 --- .../read-config-matching-engine.ts | 15 --- .../update-owner-assistant-matching-engine.ts | 40 ------ .../MatchingEngine/upgrade-matching-engine.ts | 62 ---------- .../scripts/evm/MatchingEngine/utils.ts | 116 ------------------ 9 files changed, 482 deletions(-) delete mode 100644 deployment/scripts/evm/MatchingEngine/bytecode-verification-matching-engine.ts delete mode 100644 deployment/scripts/evm/MatchingEngine/config-matching-engine.ts delete mode 100644 deployment/scripts/evm/MatchingEngine/deploy-matching-engine.ts delete mode 100644 deployment/scripts/evm/MatchingEngine/disable-router-matching-engine.ts delete mode 100644 deployment/scripts/evm/MatchingEngine/get-config-diff-matching-engine.ts delete mode 100644 deployment/scripts/evm/MatchingEngine/read-config-matching-engine.ts delete mode 100644 deployment/scripts/evm/MatchingEngine/update-owner-assistant-matching-engine.ts delete mode 100644 deployment/scripts/evm/MatchingEngine/upgrade-matching-engine.ts delete mode 100644 deployment/scripts/evm/MatchingEngine/utils.ts diff --git a/deployment/scripts/evm/MatchingEngine/bytecode-verification-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/bytecode-verification-matching-engine.ts deleted file mode 100644 index 3352cf3d..00000000 --- a/deployment/scripts/evm/MatchingEngine/bytecode-verification-matching-engine.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { runOnEvms, ChainInfo, LoggerFn, getContractAddress, getDeploymentArgs, getVerifyCommand, verificationApiKeys, flattenObject } from "../../../helpers"; -import { ethers } from "ethers"; -import { execSync } from "child_process"; -import path from "path"; -import chalk from "chalk"; - -runOnEvms("bytecode-verification-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { - - console.warn(chalk.yellow("This script is deprecated due to the only MatchingEngine contract is deployed in Solana.")) - throw new Error("This script is deprecated due to the only MatchingEngine contract is deployed in Solana."); - - // The root path of the foundry project - const rootPath = path.resolve('../evm/'); - - - const verifiersData = verificationApiKeys.find((x) => x.chainId == chain.chainId); - const verifiers = flattenObject(verifiersData!); - delete verifiers.chainId; - - - for (let [name, value] of Object.entries(verifiers)) { - name = name.split("-")[0]; - - // Implementation data - const implementationName = "MatchingEngine"; - const implementationPath = 'src/MatchingEngine/MatchingEngine.sol'; - const implementationAddress = getContractAddress("MatchingEngineImplementation", chain.chainId); - const implementationDeploymentArgs = getDeploymentArgs("MatchingEngineImplementation", chain.chainId); - const implementationConstructorSignature = "constructor(address,address,address,uint24,uint24,uint8,uint8,uint8)"; - const verifyImplementationCommand = getVerifyCommand( - chain, - implementationName, - implementationPath, - implementationAddress, - implementationConstructorSignature, - implementationDeploymentArgs, - name, - value - ); - - // Proxy data - const proxyName = "ERC1967Proxy"; - const proxyPath = 'lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol'; - const proxyAddress = getContractAddress("MatchingEngineProxy", chain.chainId); - const proxyDeploymentArgs = getDeploymentArgs("MatchingEngineProxy", chain.chainId); - const proxyConstructorSignature = "constructor(address,bytes)"; - const verifyProxyCommand = getVerifyCommand( - chain, - proxyName, - proxyPath, - proxyAddress, - proxyConstructorSignature, - proxyDeploymentArgs, - name, - value - ); - - log(chalk.green("Verifying implementation bytecode...")); - execSync(verifyImplementationCommand, { stdio: "inherit", cwd: rootPath }); - console.log() - - log(chalk.green("Verifying proxy bytecode...")); - execSync(verifyProxyCommand, { stdio: "inherit", cwd: rootPath }); - console.log() - } -}); \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts deleted file mode 100644 index 5ec1bed5..00000000 --- a/deployment/scripts/evm/MatchingEngine/config-matching-engine.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { MatchingEngine } from "../../../contract-bindings"; -import { runOnEvmsSequentially, ChainInfo, LoggerFn, getContractInstance, getContractAddress } from "../../../helpers"; -import { ethers } from "ethers"; -import { getConfigurationDifferences, logDiff } from "./utils"; -import confirm from '@inquirer/confirm'; -import { inspect } from "util"; -import chalk from "chalk"; - -runOnEvmsSequentially("config-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { - - console.warn(chalk.yellow("This script is deprecated due to the only MatchingEngine contract is deployed in Solana.")) - throw new Error("This script is deprecated due to the only MatchingEngine contract is deployed in Solana."); - - const matchingEngineAddress = getContractAddress("MatchingEngineProxy", chain.chainId); - const matchingEngine = (await getContractInstance("MatchingEngine", matchingEngineAddress, chain)) as MatchingEngine; - const diff = await getConfigurationDifferences(chain); - - console.log(inspect(diff, { depth: null, colors: true })); - - log(`MatchingEngine configuration differences on chain ${chain.chainId}:`); - logDiff(diff, log, ["new", "update"]); - - const deployConfig: boolean = await confirm({ message: 'Continue?', default: false }); - if (!deployConfig){ - log(`Configuration deployment aborted on chain ${chain.chainId}`); - return; - } - - const { feeRecipient, cctpAllowance, routerEndpoints } = diff; - - // Fee recipient - if (feeRecipient.onChain !== feeRecipient.offChain) { - if (Number(feeRecipient.offChain) === 0) - throw new Error('Invalid fee recipient address'); - - await matchingEngine.updateFeeRecipient(feeRecipient.offChain); - log(`Fee recipient updated to ${feeRecipient.offChain}`); - } - - // CCTP allowance - if (cctpAllowance.onChain.toString() !== cctpAllowance.offChain.toString()) { - await matchingEngine.setCctpAllowance(cctpAllowance.offChain); - log(`CCTP allowance updated to ${cctpAllowance.offChain}`); - } - - // Router endpoints - for (const { wormholeChainId, router, mintRecipient, circleDomain } of routerEndpoints) { - const offChainEndpoint = { - router: router.offChain, - mintRecipient: mintRecipient.offChain - }; - - // Add new router endpoint if all values are zero - if (Number(router?.onChain) === 0 && Number(mintRecipient?.onChain) === 0 && Number(circleDomain?.onChain) === 0) { - if (wormholeChainId === 0) - throw new Error('Invalid wormholeChainId when adding new router endpoint'); - - if (Number(offChainEndpoint.router) === 0 || Number(offChainEndpoint.mintRecipient) === 0) - throw new Error(`Invalid router or mintRecipient endpoint for wormholeChainId ${wormholeChainId}`); - - await matchingEngine.addRouterEndpoint(wormholeChainId, offChainEndpoint, circleDomain.offChain); - log(`Router endpoint added for wormholeChainId ${wormholeChainId}`); - continue; - } - - // Update router endpoint - if ( - router?.onChain.toString() !== offChainEndpoint.router.toString() || - mintRecipient?.onChain.toString() !== offChainEndpoint.mintRecipient.toString() || - circleDomain?.onChain.toString() !== circleDomain?.offChain.toString() - ) { - - if (Number(router?.offChain) === 0 && Number(mintRecipient?.offChain) === 0 && Number(circleDomain?.offChain) === 0) { - log(`Router endpoint already disabled for wormholeChainId ${wormholeChainId}.`); - continue; - } - - if (wormholeChainId === 0) - throw new Error('Invalid wormholeChainId when adding new router endpoint'); - - if (Number(offChainEndpoint.router) === 0 || Number(offChainEndpoint.mintRecipient) === 0) - throw new Error(`Invalid router or mintRecipient endpoint for wormholeChainId ${wormholeChainId}`); - - await matchingEngine.updateRouterEndpoint(wormholeChainId, offChainEndpoint, circleDomain.offChain); - log(`Router endpoint updated for wormholeChainId ${wormholeChainId}`); - continue; - } - } -}); \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/deploy-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/deploy-matching-engine.ts deleted file mode 100644 index 204c8ee6..00000000 --- a/deployment/scripts/evm/MatchingEngine/deploy-matching-engine.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { ethers } from "ethers"; -import { runOnEvms, ChainInfo, LoggerFn, writeDeployedContract } from "../../../helpers"; -import { MatchingEngineConfiguration } from "../../../config/config-types"; -import { deployImplementation, getMachingEngineConfiguration } from "./utils"; -import { ERC1967Proxy__factory } from "../../../contract-bindings"; -import chalk from "chalk"; - -runOnEvms("deploy-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { - - console.warn(chalk.yellow("This script is deprecated due to the only MatchingEngine contract is deployed in Solana.")) - throw new Error("This script is deprecated due to the only MatchingEngine contract is deployed in Solana."); - - const config = await getMachingEngineConfiguration(chain); - const implementation = await deployImplementation(signer, config, log); - await deployProxy(signer, config, implementation, log); -}); - -async function deployProxy(signer: ethers.Signer, config: MatchingEngineConfiguration, implementation: ethers.Contract, log: LoggerFn) { - const factory = new ERC1967Proxy__factory(signer); - const abi = ["function initialize(bytes)"]; - const iface = new ethers.utils.Interface(abi); - const data = [config.ownerAssistant, config.feeRecipient]; - - // Validate if the addresses are valid and not zero - for (const value of data) - if (!ethers.utils.isAddress(value) || Number(value) === 0) - throw new Error(`Invalid value: ${value}`); - - const encodedData = ethers.utils.solidityPack(["address", "address"], data); - const encodedCall = iface.encodeFunctionData("initialize", [encodedData]); - - const deployment = await factory.deploy( - implementation.address, - encodedCall, - ); - - await deployment.deployed(); - - log(`MatchingEngineProxy deployed at ${deployment.address}`); - writeDeployedContract(config.chainId, "MatchingEngineProxy", deployment.address, [implementation.address, encodedCall]); - - return deployment; -} \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/disable-router-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/disable-router-matching-engine.ts deleted file mode 100644 index 89917adf..00000000 --- a/deployment/scripts/evm/MatchingEngine/disable-router-matching-engine.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { MatchingEngine } from "../../../contract-bindings"; -import { runOnEvmsSequentially, ChainInfo, LoggerFn, getContractInstance, getContractAddress } from "../../../helpers"; -import { ethers } from "ethers"; -import { getConfigurationDifferences, logRoutersDiff } from "./utils"; -import confirm from '@inquirer/confirm'; -import chalk from "chalk"; - -runOnEvmsSequentially("disable-router-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { - - console.warn(chalk.yellow("This script is deprecated due to the only MatchingEngine contract is deployed in Solana.")) - throw new Error("This script is deprecated due to the only MatchingEngine contract is deployed in Solana."); - - const matchingEngineAddress = getContractAddress("MatchingEngineProxy", chain.chainId); - const matchingEngine = (await getContractInstance("MatchingEngine", matchingEngineAddress, chain)) as MatchingEngine; - const diff = await getConfigurationDifferences(chain); - - log(`MatchingEngine configuration differences on chain ${chain.chainId}:`); - logRoutersDiff(diff, log, ["delete"]); - - const deployConfig: boolean = await confirm({ message: 'Continue?', default: false }); - if (!deployConfig){ - log(`Configuration deployment aborted on chain ${chain.chainId}`); - return; - } - - const { routerEndpoints } = diff; - - // Router endpoints - for (const { wormholeChainId, router, mintRecipient, circleDomain } of routerEndpoints) { - - // Disable router endpoint, must be the three values zero - if (Number(router?.offChain) === 0 && Number(mintRecipient?.offChain) === 0 && Number(circleDomain?.offChain) === 0) { - await matchingEngine.disableRouterEndpoint(wormholeChainId); - log(`Router endpoint disabled for wormholeChainId ${wormholeChainId}`); - } - } -}); \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/get-config-diff-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/get-config-diff-matching-engine.ts deleted file mode 100644 index 5bb9a27d..00000000 --- a/deployment/scripts/evm/MatchingEngine/get-config-diff-matching-engine.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { runOnEvms, ChainInfo, LoggerFn } from "../../../helpers"; -import { ethers } from "ethers"; -import { getConfigurationDifferences, logDiff } from "./utils"; -import chalk from "chalk"; - -runOnEvms("get-config-diff-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { - - console.warn(chalk.yellow("This script is deprecated due to the only MatchingEngine contract is deployed in Solana.")) - throw new Error("This script is deprecated due to the only MatchingEngine contract is deployed in Solana."); - - const diff = await getConfigurationDifferences(chain); - log(`MatchingEngine configuration differences on chain ${chain.chainId}:`); - logDiff(diff, log); -}); \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/read-config-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/read-config-matching-engine.ts deleted file mode 100644 index ef56c305..00000000 --- a/deployment/scripts/evm/MatchingEngine/read-config-matching-engine.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { runOnEvms, ChainInfo, LoggerFn } from "../../../helpers"; -import { ethers } from "ethers"; -import { getOnChainMachingEngineConfiguration } from "./utils"; -import { inspect } from "util"; -import chalk from "chalk"; - -runOnEvms("read-config-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { - - console.warn(chalk.yellow("This script is deprecated due to the only MatchingEngine contract is deployed in Solana.")) - throw new Error("This script is deprecated due to the only MatchingEngine contract is deployed in Solana."); - - const onChainConfig = await getOnChainMachingEngineConfiguration(chain); - log(`MatchingEngine configuration for chainId ${chain.chainId}:`); - log(inspect(onChainConfig, { depth: null, colors: true, compact: true })); -}); \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/update-owner-assistant-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/update-owner-assistant-matching-engine.ts deleted file mode 100644 index 0c16024e..00000000 --- a/deployment/scripts/evm/MatchingEngine/update-owner-assistant-matching-engine.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { MatchingEngine } from "../../../contract-bindings"; -import { runOnEvmsSequentially, ChainInfo, LoggerFn, getContractInstance, getContractAddress, logComparision } from "../../../helpers"; -import { ethers } from "ethers"; -import { getConfigurationDifferences } from "./utils"; -import confirm from '@inquirer/confirm'; -import chalk from "chalk"; - -runOnEvmsSequentially("update-owner-assistant-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { - - console.warn(chalk.yellow("This script is deprecated due to the only MatchingEngine contract is deployed in Solana.")) - throw new Error("This script is deprecated due to the only MatchingEngine contract is deployed in Solana."); - - const matchingEngineAddress = getContractAddress("MatchingEngineProxy", chain.chainId); - const matchingEngine = (await getContractInstance("MatchingEngine", matchingEngineAddress, chain)) as MatchingEngine; - const diff = await getConfigurationDifferences(chain); - - - log(`MatchingEngine configuration differences on chain ${chain.chainId}:`); - logComparision('OwnerAssistant', diff.ownerAssistant, log); - - if (diff.ownerAssistant.onChain === diff.ownerAssistant.offChain) { - log(`No differences found on chain ${chain.chainId}`); - return; - } - - const updateOwnerAssistant: boolean = await confirm({ message: 'Continue?', default: false }); - if (!updateOwnerAssistant){ - log(`OwnerAssistant update aborted on chain ${chain.chainId}`); - return; - } - - const ownerAddress = await matchingEngine.getOwner(); - const signerAddress = await signer.getAddress(); - if (signerAddress !== ownerAddress) { - throw new Error(`Signer address ${signerAddress} is not the owner of MatchingEngine on chain ${chain.chainId}`); - } - - log(`Updating OwnerAssistant on chain ${chain.chainId}`); - await matchingEngine.updateOwnerAssistant(diff.ownerAssistant.offChain); -}); \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/upgrade-matching-engine.ts b/deployment/scripts/evm/MatchingEngine/upgrade-matching-engine.ts deleted file mode 100644 index 90282fd4..00000000 --- a/deployment/scripts/evm/MatchingEngine/upgrade-matching-engine.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { runOnEvms, ChainInfo, LoggerFn, getContractInstance, getContractAddress, getDependencyAddress } from "../../../helpers"; -import { ethers } from "ethers"; -import { deployImplementation, getMachingEngineConfiguration } from "./utils"; -import { MatchingEngine } from "../../../contract-bindings"; -import { MatchingEngineConfiguration } from "../../../config/config-types"; -import chalk from "chalk"; - -runOnEvms("upgrade-matching-engine", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { - - console.warn(chalk.yellow("This script is deprecated due to the only MatchingEngine contract is deployed in Solana.")) - throw new Error("This script is deprecated due to the only MatchingEngine contract is deployed in Solana."); - - const currentImplementationAddress = getContractAddress("MatchingEngineImplementation", chain.chainId); - const proxyAddress = getContractAddress("MatchingEngineProxy", chain.chainId); - const proxy = (await getContractInstance("MatchingEngine", proxyAddress, chain)) as MatchingEngine; - const config = await getMachingEngineConfiguration(chain); - - log(`Checking immutables for MatchingEngine...`); - await checkImmutables(proxy, config, chain); - - const newImplementation = await deployImplementation(signer, config, log); - - log(`Upgrading MatchingEngineImplementation implementation from ${currentImplementationAddress} to ${newImplementation.address}`); - await proxy.upgradeContract(newImplementation.address); -}); - -async function checkImmutables(matchingEngine: MatchingEngine, config: MatchingEngineConfiguration, chain: ChainInfo) { - const tokenAddress = getDependencyAddress("token", chain.chainId); - const [ - token, - userPenaltyRewardBps, - initialPenaltyBps, - auctionDuration, - auctionGracePeriod, - auctionPenaltyBlocks, - ] = await Promise.all([ - matchingEngine.token(), - matchingEngine.getUserPenaltyRewardBps(), - matchingEngine.getInitialPenaltyBps(), - matchingEngine.getAuctionDuration(), - matchingEngine.getAuctionGracePeriod(), - matchingEngine.getAuctionPenaltyBlocks(), - ]); - - if (token.toLowerCase() !== tokenAddress.toLowerCase()) - throw new Error(`Token is an immutable value and cannot be changed.`); - - if (userPenaltyRewardBps !== Number(config.userPenaltyRewardBps)) - throw new Error(`UserPenaltyRewardBps is an immutable value and cannot be changed.`); - - if (initialPenaltyBps !== Number(config.initialPenaltyBps)) - throw new Error(`InitialPenaltyBps is an immutable value and cannot be changed.`); - - if (auctionDuration !== Number(config.auctionDuration)) - throw new Error(`AuctionDuration is an immutable value and cannot be changed.`); - - if (auctionGracePeriod !== Number(config.auctionGracePeriod)) - throw new Error(`AuctionGracePeriod is an immutable value and cannot be changed.`); - - if (auctionPenaltyBlocks !== Number(config.auctionPenaltyBlocks)) - throw new Error(`AuctionPenaltyBlocks is an immutable value and cannot be changed.`); -} \ No newline at end of file diff --git a/deployment/scripts/evm/MatchingEngine/utils.ts b/deployment/scripts/evm/MatchingEngine/utils.ts deleted file mode 100644 index 82a8955e..00000000 --- a/deployment/scripts/evm/MatchingEngine/utils.ts +++ /dev/null @@ -1,116 +0,0 @@ -import { ethers } from "ethers"; -import { MatchingEngineConfiguration } from "../../../config/config-types"; -import { MatchingEngine, MatchingEngine__factory } from "../../../contract-bindings"; -import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, logComparision, someoneIsDifferent } from "../../../helpers"; -import { ERC20 } from "../../../contract-bindings/out/ERC20"; - -export function getMachingEngineConfiguration(chain: ChainInfo): Promise { - return getChainConfig("matching-engine", chain.chainId); -} - -export async function deployImplementation(signer: ethers.Signer, config: MatchingEngineConfiguration, log: LoggerFn) { - const factory = new MatchingEngine__factory(signer); - const token = getDependencyAddress("token", config.chainId).toString(); - const wormhole = getDependencyAddress("wormhole", config.chainId).toString(); - const tokenMessenger = getDependencyAddress("tokenMessenger", config.chainId).toString(); - const MAX_BPS_FEE = 1000000; - - // State validations - if (Number(config.auctionDuration) === 0) { - throw new Error(`Auction duration must be greater than 0.`); - } - if (Number(config.auctionGracePeriod) <= Number(config.auctionDuration)) { - throw new Error(`Auction grace period must be greater than auction duration.`); - } - if (Number(config.userPenaltyRewardBps) > MAX_BPS_FEE) { - throw new Error(`User penalty reward bps must be less than or equal to ${MAX_BPS_FEE}.`); - } - if (Number(config.initialPenaltyBps) > MAX_BPS_FEE) { - throw new Error(`Initial penalty bps must be less than or equal to ${MAX_BPS_FEE}.`); - } - - const deployment = await factory.deploy( - token, - wormhole, - tokenMessenger, - config.userPenaltyRewardBps, - config.initialPenaltyBps, - config.auctionDuration, - config.auctionGracePeriod, - config.auctionPenaltyBlocks, - {} // overrides - ); - - await deployment.deployed(); - - log(`MatchingEngine deployed at ${deployment.address}`); - - const constructorArgs = [ - token, - wormhole, - tokenMessenger, - config.userPenaltyRewardBps, - config.initialPenaltyBps, - config.auctionDuration, - config.auctionGracePeriod, - config.auctionPenaltyBlocks - ]; - - writeDeployedContract(config.chainId, "MatchingEngineImplementation", deployment.address, constructorArgs); - - return deployment; -} - -export async function getOnChainMachingEngineConfiguration(chain: ChainInfo) { - const config = await getMachingEngineConfiguration(chain); - const matchingEngineProxyAddress = getContractAddress("MatchingEngineProxy", chain.chainId); - const matchingEngine = (await getContractInstance("MatchingEngine", matchingEngineProxyAddress, chain)) as MatchingEngine; - - // Get the allowance for the token messenger - const tokenMessengerAddress = getDependencyAddress("tokenMessenger", chain.chainId); - const tokenAddress = await matchingEngine.token(); - const token = (await getContractInstance("ERC20", tokenAddress, chain)) as ERC20; - const cctpAllowance = (await token.allowance(matchingEngineProxyAddress, tokenMessengerAddress)).toString(); - - const feeRecipient = await matchingEngine.feeRecipient(); - const ownerAssistant = await matchingEngine.getOwnerAssistant(); - - - return { - cctpAllowance, - feeRecipient, - ownerAssistant - }; -} - -export async function getConfigurationDifferences(chain: ChainInfo) { - const differences = {} as Record; - const onChainConfig = await getOnChainMachingEngineConfiguration(chain); - const offChainConfig = await getMachingEngineConfiguration(chain); - - // Compare non-array values - for (const key of Object.keys(onChainConfig)) { - const offChainValue = offChainConfig[key as keyof typeof offChainConfig]; - const onChainValue = onChainConfig[key as keyof typeof onChainConfig]; - - if (offChainValue === undefined) - throw new Error(`${key} not found in offChainConfig`); - - // Ignore key if it's an array - if (Array.isArray(offChainValue)) - continue; - - differences[key] = { - offChain: offChainValue, - onChain: onChainValue - }; - } - - return differences; -} - -export function logDiff(differences: Record, log: LoggerFn, valuesToShow?: Array<"new" | "update" | "delete">) { - logComparision('feeRecipient', differences.feeRecipient, log); - logComparision('cctpAllowance', differences.cctpAllowance, log); - -} \ No newline at end of file From 7051e80d80029819dab80ccae5bc5a0659f3bc34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Mon, 22 Jul 2024 16:58:35 -0300 Subject: [PATCH 32/80] deploy: adds tsconfig.json and simplifies contract build pipeline --- deployment/package.json | 4 ++-- deployment/scripts/evm/TokenRouter/config-token-router.ts | 2 +- deployment/scripts/evm/TokenRouter/utils.ts | 2 +- deployment/tsconfig.json | 7 +++++++ tsconfig.json | 2 ++ 5 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 deployment/tsconfig.json diff --git a/deployment/package.json b/deployment/package.json index 3c3b63a9..9a38b663 100644 --- a/deployment/package.json +++ b/deployment/package.json @@ -1,8 +1,8 @@ { "name": "deployment", "scripts": { - "evm-deps": "forge build --contracts $(dirname $(pwd))/evm/lib/openzeppelin-contracts/contracts/proxy", - "build-evm": "npm run evm-deps && npx typechain --target=ethers-v5 --out-dir=./contract-bindings ../evm/out/*/*.json ../out/*/*.json" + "evm-deps": "forge build --contracts ../evm/lib/openzeppelin-contracts/contracts/proxy && forge build --config-path ../evm/foundry.toml", + "build-evm": "npm run evm-deps && npx typechain --target=ethers-v5 --out-dir=./contract-bindings ../evm/out/*/*.json" }, "author": "", "devDependencies": { diff --git a/deployment/scripts/evm/TokenRouter/config-token-router.ts b/deployment/scripts/evm/TokenRouter/config-token-router.ts index ba09fbdd..40330441 100644 --- a/deployment/scripts/evm/TokenRouter/config-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/config-token-router.ts @@ -3,7 +3,7 @@ import { ethers } from "ethers"; import { getConfigurationDifferences, logDiff } from "./utils"; import confirm from '@inquirer/confirm'; import { TokenRouter } from "../../../contract-bindings"; -import { FastTransferParametersStruct } from "../../../contract-bindings/evm/out/ITokenRouter"; +import { FastTransferParametersStruct } from "../../../contract-bindings/ITokenRouter"; runOnEvmsSequentially("config-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { const tokenRouterAddress = getContractAddress("TokenRouterProxy", chain.chainId); diff --git a/deployment/scripts/evm/TokenRouter/utils.ts b/deployment/scripts/evm/TokenRouter/utils.ts index 307fff75..263ff0ee 100644 --- a/deployment/scripts/evm/TokenRouter/utils.ts +++ b/deployment/scripts/evm/TokenRouter/utils.ts @@ -2,7 +2,7 @@ import { ethers } from "ethers"; import { TokenRouterConfiguration } from "../../../config/config-types"; import { TokenRouter, TokenRouter__factory } from "../../../contract-bindings"; import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, logComparision, someoneIsDifferent } from "../../../helpers"; -import { ERC20 } from "../../../contract-bindings/out/ERC20"; +import { ERC20 } from "../../../contract-bindings/ERC20"; import { UniversalAddress } from "@wormhole-foundation/sdk-definitions"; export function getTokenRouterConfiguration(chain: ChainInfo): Promise { diff --git a/deployment/tsconfig.json b/deployment/tsconfig.json new file mode 100644 index 00000000..cefc3366 --- /dev/null +++ b/deployment/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../tsconfig.json", + "include": ["scripts/**/*.ts", "scripts/**/*.json", "helpers/**/*.ts", "config/**/*.ts", "config/**/*.json", "contract-bindings/**/*.ts"], + "references": [ + { "path": "../solana" }, + ] +} diff --git a/tsconfig.json b/tsconfig.json index dfe3659a..8ce3cdda 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,6 +13,8 @@ "sourceMap": true, "skipLibCheck": true, "noErrorTruncation": true, + "outDir": "ts-build", + "resolveJsonModule": true, // Strict Checks // "alwaysStrict": true, // "noImplicitAny": true, From 1455ff895319d635c14fc02559aabc3d8e990aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Mon, 22 Jul 2024 17:09:51 -0300 Subject: [PATCH 33/80] deploy: cleans up helper exports to avoid name collisions --- deployment/helpers/index.ts | 4 ++-- .../TokenRouter/bytecode-verification-token-router.ts | 5 ++--- .../scripts/evm/TokenRouter/config-token-router.ts | 5 ++--- .../evm/TokenRouter/cross-registration-token-router.ts | 5 ++--- .../scripts/evm/TokenRouter/deploy-token-router.ts | 4 ++-- .../evm/TokenRouter/disable-router-token-router.ts | 5 ++--- .../evm/TokenRouter/get-config-diff-token-router.ts | 5 ++--- .../evm/TokenRouter/read-config-token-router.ts | 5 ++--- .../TokenRouter/update-owner-assistant-token-router.ts | 6 ++---- .../scripts/evm/TokenRouter/upgrade-token-router.ts | 5 ++--- deployment/scripts/solana/initializeMatchingEngine.ts | 10 +++++----- .../scripts/solana/registerRoutersInMatchingEngine.ts | 10 +++++----- 12 files changed, 30 insertions(+), 39 deletions(-) diff --git a/deployment/helpers/index.ts b/deployment/helpers/index.ts index 8d3435c4..90135deb 100644 --- a/deployment/helpers/index.ts +++ b/deployment/helpers/index.ts @@ -1,5 +1,5 @@ export * from "./env"; -export * from "./evm"; -export * from "./solana"; +export * as evm from "./evm"; +export * as solana from "./solana"; export * from "./interfaces"; export * from "./utils"; \ No newline at end of file diff --git a/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts b/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts index db45f653..7a97bc4a 100644 --- a/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts @@ -1,10 +1,9 @@ -import { runOnEvms, ChainInfo, LoggerFn, getContractAddress, getDeploymentArgs, getVerifyCommand, verificationApiKeys, flattenObject } from "../../../helpers"; -import { ethers } from "ethers"; +import { evm, getContractAddress, getDeploymentArgs, getVerifyCommand, verificationApiKeys, flattenObject } from "../../../helpers"; import { execSync } from "child_process"; import path from "path"; import chalk from "chalk"; -runOnEvms("bytecode-verification-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { +evm.runOnEvms("bytecode-verification-token-router", async (chain, signer, log) => { // The root path of the foundry project const rootPath = path.resolve('../evm/'); diff --git a/deployment/scripts/evm/TokenRouter/config-token-router.ts b/deployment/scripts/evm/TokenRouter/config-token-router.ts index 40330441..718ddd93 100644 --- a/deployment/scripts/evm/TokenRouter/config-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/config-token-router.ts @@ -1,11 +1,10 @@ -import { ChainInfo, LoggerFn, getContractInstance, getContractAddress, runOnEvmsSequentially, ValueDiff } from "../../../helpers"; -import { ethers } from "ethers"; +import { evm, LoggerFn, getContractInstance, getContractAddress, ValueDiff } from "../../../helpers"; import { getConfigurationDifferences, logDiff } from "./utils"; import confirm from '@inquirer/confirm'; import { TokenRouter } from "../../../contract-bindings"; import { FastTransferParametersStruct } from "../../../contract-bindings/ITokenRouter"; -runOnEvmsSequentially("config-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { +evm.runOnEvmsSequentially("config-token-router", async (chain, signer, log) => { const tokenRouterAddress = getContractAddress("TokenRouterProxy", chain.chainId); const tokenRouter = (await getContractInstance("TokenRouter", tokenRouterAddress, chain)) as TokenRouter; const diff = await getConfigurationDifferences(chain); diff --git a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts index 9833a2f2..296be0f7 100644 --- a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts @@ -1,9 +1,8 @@ -import { ChainInfo, LoggerFn, getContractInstance, getContractAddress, runOnEvms, contracts, getUniversalAddress } from "../../../helpers"; -import { ethers } from "ethers"; +import { evm, getContractInstance, getContractAddress, contracts, getUniversalAddress } from "../../../helpers"; import { TokenRouter } from "../../../contract-bindings"; import { circle, toChain } from "@wormhole-foundation/sdk-base"; -runOnEvms("cross-registration-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { +evm.runOnEvms("cross-registration-token-router", async (chain, signer, log) => { const tokenRouterAddress = getContractAddress("TokenRouterProxy", chain.chainId); const tokenRouter = (await getContractInstance("TokenRouter", tokenRouterAddress, chain)) as TokenRouter; const deployedTokenRouters = contracts['TokenRouterProxy'].filter((router) => router.chainId !== chain.chainId); diff --git a/deployment/scripts/evm/TokenRouter/deploy-token-router.ts b/deployment/scripts/evm/TokenRouter/deploy-token-router.ts index 1dfe1205..d8ca65e1 100644 --- a/deployment/scripts/evm/TokenRouter/deploy-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/deploy-token-router.ts @@ -1,10 +1,10 @@ import { ethers } from "ethers"; -import { runOnEvms, ChainInfo, LoggerFn, writeDeployedContract } from "../../../helpers"; +import { evm, LoggerFn, writeDeployedContract } from "../../../helpers"; import { TokenRouterConfiguration } from "../../../config/config-types"; import { deployImplementation, getTokenRouterConfiguration } from "./utils"; import { ERC1967Proxy__factory } from "../../../contract-bindings"; -runOnEvms("deploy-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { +evm.runOnEvms("deploy-token-router", async (chain, signer, log) => { const config = await getTokenRouterConfiguration(chain); const implementation = await deployImplementation(chain, signer, config, log); await deployProxy(signer, config, implementation, log); diff --git a/deployment/scripts/evm/TokenRouter/disable-router-token-router.ts b/deployment/scripts/evm/TokenRouter/disable-router-token-router.ts index 8a11078f..cba0d540 100644 --- a/deployment/scripts/evm/TokenRouter/disable-router-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/disable-router-token-router.ts @@ -1,9 +1,8 @@ import { TokenRouter } from "../../../contract-bindings"; -import { ChainInfo, LoggerFn, getContractInstance, getContractAddress, runOnEvms } from "../../../helpers"; -import { ethers } from "ethers"; +import { evm, getContractInstance, getContractAddress } from "../../../helpers"; import { getTokenRouterConfiguration } from "./utils"; -runOnEvms("disable-router-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { +evm.runOnEvms("disable-router-token-router", async (chain, signer, log) => { const tokenRouterAddress = getContractAddress("TokenRouterProxy", chain.chainId); const tokenRouter = (await getContractInstance("TokenRouter", tokenRouterAddress, chain)) as TokenRouter; const config = await getTokenRouterConfiguration(chain); diff --git a/deployment/scripts/evm/TokenRouter/get-config-diff-token-router.ts b/deployment/scripts/evm/TokenRouter/get-config-diff-token-router.ts index 5b82d7ae..b218c87a 100644 --- a/deployment/scripts/evm/TokenRouter/get-config-diff-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/get-config-diff-token-router.ts @@ -1,8 +1,7 @@ -import { runOnEvms, ChainInfo, LoggerFn } from "../../../helpers"; -import { ethers } from "ethers"; +import { evm } from "../../../helpers"; import { getConfigurationDifferences, logDiff } from "./utils"; -runOnEvms("get-config-diff-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { +evm.runOnEvms("get-config-diff-token-router", async (chain, signer, log) => { const diff = await getConfigurationDifferences(chain); log(`TokenRouter configuration differences on chain ${chain.chainId}:`); diff --git a/deployment/scripts/evm/TokenRouter/read-config-token-router.ts b/deployment/scripts/evm/TokenRouter/read-config-token-router.ts index 8449246c..0c8b2f82 100644 --- a/deployment/scripts/evm/TokenRouter/read-config-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/read-config-token-router.ts @@ -1,9 +1,8 @@ -import { runOnEvms, ChainInfo, LoggerFn } from "../../../helpers"; -import { ethers } from "ethers"; +import { evm } from "../../../helpers"; import { getOnChainTokenRouterConfiguration } from "./utils"; import { inspect } from "util"; -runOnEvms("read-config-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { +evm.runOnEvms("read-config-token-router", async (chain, signer, log) => { const onChainConfig = await getOnChainTokenRouterConfiguration(chain); log(`TokenRouter configuration for chainId ${chain.chainId}:`); log(inspect(onChainConfig, { depth: null, colors: true, compact: true })); diff --git a/deployment/scripts/evm/TokenRouter/update-owner-assistant-token-router.ts b/deployment/scripts/evm/TokenRouter/update-owner-assistant-token-router.ts index c387c8e8..87ef5306 100644 --- a/deployment/scripts/evm/TokenRouter/update-owner-assistant-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/update-owner-assistant-token-router.ts @@ -1,15 +1,13 @@ import { TokenRouter } from "../../../contract-bindings"; -import { runOnEvmsSequentially, ChainInfo, LoggerFn, getContractInstance, getContractAddress, logComparision } from "../../../helpers"; -import { ethers } from "ethers"; +import { evm, getContractInstance, getContractAddress, logComparision } from "../../../helpers"; import { getConfigurationDifferences } from "./utils"; import confirm from '@inquirer/confirm'; -runOnEvmsSequentially("update-owner-assistant-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { +evm.runOnEvmsSequentially("update-owner-assistant-token-router", async (chain, signer, log) => { const tokenRouterAddress = getContractAddress("TokenRouterProxy", chain.chainId); const tokenRouter = (await getContractInstance("TokenRouter", tokenRouterAddress, chain)) as TokenRouter; const diff = await getConfigurationDifferences(chain); - log(`TokenRouter configuration differences on chain ${chain.chainId}:`); logComparision('OwnerAssistant', diff.ownerAssistant, log); diff --git a/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts b/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts index d66ea8c0..9ae9fab0 100644 --- a/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts @@ -1,11 +1,10 @@ -import { runOnEvms, ChainInfo, LoggerFn, getContractInstance, getContractAddress, getDependencyAddress, getAddressType } from "../../../helpers"; -import { ethers } from "ethers"; +import { evm, ChainInfo, getContractInstance, getContractAddress, getDependencyAddress, getAddressType } from "../../../helpers"; import { deployImplementation, getTokenRouterConfiguration } from "./utils"; import { TokenRouter } from "../../../contract-bindings"; import { TokenRouterConfiguration } from "../../../config/config-types"; import { UniversalAddress } from "@wormhole-foundation/sdk-definitions"; -runOnEvms("upgrade-token-router", async (chain: ChainInfo, signer: ethers.Signer, log: LoggerFn) => { +evm.runOnEvms("upgrade-token-router", async (chain, signer, log) => { const currentImplementationAddress = getContractAddress("TokenRouterImplementation", chain.chainId); const proxyAddress = getContractAddress("TokenRouterProxy", chain.chainId); const proxy = (await getContractInstance("TokenRouter", proxyAddress, chain)) as TokenRouter; diff --git a/deployment/scripts/solana/initializeMatchingEngine.ts b/deployment/scripts/solana/initializeMatchingEngine.ts index 75e3f8a5..d8cb1255 100644 --- a/deployment/scripts/solana/initializeMatchingEngine.ts +++ b/deployment/scripts/solana/initializeMatchingEngine.ts @@ -6,19 +6,19 @@ import { import "dotenv/config"; import { uint64ToBN } from "@wormhole-foundation/example-liquidity-layer-solana/common"; import { AuctionParameters, MatchingEngineProgram } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; -import { LoggerFn, connectionCommitmentLevel, getChainConfig, getContractAddress, ledgerSignAndSend, runOnSolana } from "../../helpers"; +import { solana, LoggerFn, getChainConfig, getContractAddress } from "../../helpers"; import { MatchingEngineConfiguration } from "../../config/config-types"; import { ProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; import { SolanaLedgerSigner } from "@xlabs-xyz/ledger-signer-solana"; import { circle } from "@wormhole-foundation/sdk-base"; -runOnSolana("deploy-matching-engine", async (chain, signer, log) => { +solana.runOnSolana("deploy-matching-engine", async (chain, signer, log) => { const config = await getChainConfig("matching-engine", chain.chainId); const matchingEngineId = getContractAddress("MatchingEngine", chain.chainId) as ProgramId; const env = "Mainnet"; const usdcMint = new PublicKey(circle.usdcContract(env, "Solana")); - const connection = new Connection(chain.rpc, connectionCommitmentLevel); + const connection = new Connection(chain.rpc, solana.connectionCommitmentLevel); const matchingEngine = new MatchingEngineProgram(connection, matchingEngineId, usdcMint); await initialize(matchingEngine, signer, log, config, usdcMint); @@ -63,10 +63,10 @@ async function initialize(matchingEngine: MatchingEngineProgram, signer: SolanaL createAtaInstructions.push(splToken.createAssociatedTokenAccountInstruction(signerPubkey, associatedToken, signerPubkey, usdcMint)); createAtaInstructions.push(ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 1 })); - const createAtaTxid = await ledgerSignAndSend(connection, createAtaInstructions, []); + const createAtaTxid = await solana.ledgerSignAndSend(connection, createAtaInstructions, []); log(`CreateAtaTxid ${createAtaTxid}`); - const initializeTxid = await ledgerSignAndSend(connection, [initializeIx], []); + const initializeTxid = await solana.ledgerSignAndSend(connection, [initializeIx], []); log(`InitializeTxid ${initializeTxid}`); } diff --git a/deployment/scripts/solana/registerRoutersInMatchingEngine.ts b/deployment/scripts/solana/registerRoutersInMatchingEngine.ts index 6d10e101..be7d428f 100644 --- a/deployment/scripts/solana/registerRoutersInMatchingEngine.ts +++ b/deployment/scripts/solana/registerRoutersInMatchingEngine.ts @@ -5,7 +5,7 @@ import { } from "@solana/web3.js"; import "dotenv/config"; import { MatchingEngineProgram } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; -import { LoggerFn, connectionCommitmentLevel, contracts, getContractAddress, ledgerSignAndSend, runOnSolana } from "../../helpers"; +import { solana, LoggerFn, contracts, getContractAddress } from "../../helpers"; import { ProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; import { SolanaLedgerSigner } from "@xlabs-xyz/ledger-signer-solana"; import { Chain, chainToPlatform, circle, toChain, toChainId } from "@wormhole-foundation/sdk-base"; @@ -13,12 +13,12 @@ import { toUniversal } from "@wormhole-foundation/sdk-definitions"; import { TokenRouterProgram } from "@wormhole-foundation/example-liquidity-layer-solana/tokenRouter"; -runOnSolana("register-routers-matching-engine", async (chain, signer, log) => { +solana.runOnSolana("register-routers-matching-engine", async (chain, signer, log) => { const matchingEngineId = getContractAddress("MatchingEngine", chain.chainId) as ProgramId; const env = "Mainnet"; const usdcMint = new PublicKey(circle.usdcContract(env, "Solana")); - const connection = new Connection(chain.rpc, connectionCommitmentLevel); + const connection = new Connection(chain.rpc, solana.connectionCommitmentLevel); const matchingEngine = new MatchingEngineProgram(connection, matchingEngineId, usdcMint); const deployedTokenRouters = contracts['TokenRouterProxy']; @@ -131,7 +131,7 @@ async function addCctpRouterEndpoint( } else { const priorityFeeIx = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 1 }); const instructions = [registerIx, priorityFeeIx] - const txSig = await ledgerSignAndSend(connection, instructions, []); + const txSig = await solana.ledgerSignAndSend(connection, instructions, []); log( `${action} endpoint`, txSig, @@ -188,6 +188,6 @@ async function addSolanaCctpRouterEndpoint( }); const priorityFeeIx = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 1 }); const instructions = [registerIx, priorityFeeIx]; - const txSig = await ledgerSignAndSend(connection, instructions, []); + const txSig = await solana.ledgerSignAndSend(connection, instructions, []); log("added local endpoint", txSig, "router", tokenRouter.ID.toString()); } \ No newline at end of file From 23dc77e5bb44f5626cbe2ab16d1df87098c90996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Mon, 22 Jul 2024 17:12:18 -0300 Subject: [PATCH 34/80] deploy: renames helper function --- deployment/helpers/utils.ts | 2 +- .../evm/TokenRouter/update-owner-assistant-token-router.ts | 4 ++-- deployment/scripts/evm/TokenRouter/utils.ts | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/deployment/helpers/utils.ts b/deployment/helpers/utils.ts index de4764cb..d6862e2a 100644 --- a/deployment/helpers/utils.ts +++ b/deployment/helpers/utils.ts @@ -4,7 +4,7 @@ import { UniversalAddress } from '@wormhole-foundation/sdk-definitions'; export const someoneIsDifferent = (values: ValueDiff[]) => values.some((value) => value.onChain.toString() !== value.offChain.toString() && Number(value.onChain) !== Number(value.offChain)); -export function logComparision(name: string, diffValues: any, log: LoggerFn) { +export function logComparison(name: string, diffValues: any, log: LoggerFn) { // If the values are the same, do nothing if (diffValues.onChain.toString() === diffValues.offChain.toString() || Number(diffValues.onChain) === Number(diffValues.offChain)) diff --git a/deployment/scripts/evm/TokenRouter/update-owner-assistant-token-router.ts b/deployment/scripts/evm/TokenRouter/update-owner-assistant-token-router.ts index 87ef5306..bb557c8c 100644 --- a/deployment/scripts/evm/TokenRouter/update-owner-assistant-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/update-owner-assistant-token-router.ts @@ -1,5 +1,5 @@ import { TokenRouter } from "../../../contract-bindings"; -import { evm, getContractInstance, getContractAddress, logComparision } from "../../../helpers"; +import { evm, getContractInstance, getContractAddress, logComparison } from "../../../helpers"; import { getConfigurationDifferences } from "./utils"; import confirm from '@inquirer/confirm'; @@ -9,7 +9,7 @@ evm.runOnEvmsSequentially("update-owner-assistant-token-router", async (chain, s const diff = await getConfigurationDifferences(chain); log(`TokenRouter configuration differences on chain ${chain.chainId}:`); - logComparision('OwnerAssistant', diff.ownerAssistant, log); + logComparison('OwnerAssistant', diff.ownerAssistant, log); if (diff.ownerAssistant.onChain === diff.ownerAssistant.offChain) { log(`No differences found on chain ${chain.chainId}`); diff --git a/deployment/scripts/evm/TokenRouter/utils.ts b/deployment/scripts/evm/TokenRouter/utils.ts index 263ff0ee..6e560149 100644 --- a/deployment/scripts/evm/TokenRouter/utils.ts +++ b/deployment/scripts/evm/TokenRouter/utils.ts @@ -1,7 +1,7 @@ import { ethers } from "ethers"; import { TokenRouterConfiguration } from "../../../config/config-types"; import { TokenRouter, TokenRouter__factory } from "../../../contract-bindings"; -import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, logComparision, someoneIsDifferent } from "../../../helpers"; +import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, logComparison, someoneIsDifferent } from "../../../helpers"; import { ERC20 } from "../../../contract-bindings/ERC20"; import { UniversalAddress } from "@wormhole-foundation/sdk-definitions"; @@ -119,13 +119,13 @@ export async function getConfigurationDifferences(chain: ChainInfo) { } export function logDiff(differences: Record, log: LoggerFn) { - logComparision('cctpAllowance', differences.cctpAllowance, log); + logComparison('cctpAllowance', differences.cctpAllowance, log); const { enabled, maxAmount, baseFee, initAuctionFee } = differences.fastTransferParameters; if (someoneIsDifferent([enabled, maxAmount, baseFee, initAuctionFee])) { log('Fast transfer parameters:'); for (const [key, value] of Object.entries(differences.fastTransferParameters)) { - logComparision(key, value, log); + logComparison(key, value, log); } } } \ No newline at end of file From 0a370c7d1e598a6fd3bff49b8c105482a8a4475a Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Tue, 23 Jul 2024 14:17:20 -0300 Subject: [PATCH 35/80] Fix ts errors --- deployment/helpers/utils.ts | 5 --- deployment/package.json | 3 +- .../bytecode-verification-token-router.ts | 11 +++--- .../cross-registration-token-router.ts | 12 +++--- .../evm/TokenRouter/upgrade-token-router.ts | 35 ++++++++---------- deployment/scripts/evm/TokenRouter/utils.ts | 37 ++++++++++++------- .../solana/initializeMatchingEngine.ts | 9 +++-- .../solana/registerRoutersInMatchingEngine.ts | 21 ++++++----- 8 files changed, 70 insertions(+), 63 deletions(-) diff --git a/deployment/helpers/utils.ts b/deployment/helpers/utils.ts index d6862e2a..785a97a1 100644 --- a/deployment/helpers/utils.ts +++ b/deployment/helpers/utils.ts @@ -49,11 +49,6 @@ export function flattenObject(obj: Record, parentKey = '', result: return result; } -export function getUniversalAddress(address: string): string { - const type = getAddressType(address); - return new UniversalAddress(address, type).toString() -} - export function getVerifyCommand( chain: ChainInfo, contractName: string, diff --git a/deployment/package.json b/deployment/package.json index 9a38b663..47150f02 100644 --- a/deployment/package.json +++ b/deployment/package.json @@ -2,7 +2,8 @@ "name": "deployment", "scripts": { "evm-deps": "forge build --contracts ../evm/lib/openzeppelin-contracts/contracts/proxy && forge build --config-path ../evm/foundry.toml", - "build-evm": "npm run evm-deps && npx typechain --target=ethers-v5 --out-dir=./contract-bindings ../evm/out/*/*.json" + "build-evm": "npm run evm-deps && npx typechain --target=ethers-v5 --out-dir=./contract-bindings ../evm/out/*/*.json", + "check": "npx tsc --noEmit" }, "author": "", "devDependencies": { diff --git a/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts b/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts index 7a97bc4a..0b42b062 100644 --- a/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts @@ -7,7 +7,6 @@ evm.runOnEvms("bytecode-verification-token-router", async (chain, signer, log) = // The root path of the foundry project const rootPath = path.resolve('../evm/'); - const verifiersData = verificationApiKeys.find((x) => x.chainId == chain.chainId); const verifiers = flattenObject(verifiersData!); delete verifiers.chainId; @@ -16,11 +15,11 @@ evm.runOnEvms("bytecode-verification-token-router", async (chain, signer, log) = name = name.split("-")[0]; // Implementation data - const implementationName = "MatchingEngine"; - const implementationPath = 'src/MatchingEngine/MatchingEngine.sol'; - const implementationAddress = getContractAddress("MatchingEngineImplementation", chain.chainId); - const implementationDeploymentArgs = getDeploymentArgs("MatchingEngineImplementation", chain.chainId); - const implementationConstructorSignature = "constructor(address,address,address,uint24,uint24,uint8,uint8,uint8)"; + const implementationName = "TokenRouter"; + const implementationPath = 'src/TokenRouter/TokenRouter.sol'; + const implementationAddress = getContractAddress("TokenRouterImplementation", chain.chainId); + const implementationDeploymentArgs = getDeploymentArgs("TokenRouterImplementation", chain.chainId); + const implementationConstructorSignature = "constructor(address,address,address,uint16,bytes32,bytes32,uint32)"; const verifyImplementationCommand = getVerifyCommand( chain, implementationName, diff --git a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts index 296be0f7..188e312b 100644 --- a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts @@ -1,17 +1,19 @@ -import { evm, getContractInstance, getContractAddress, contracts, getUniversalAddress } from "../../../helpers"; +import { evm, getContractInstance, getContractAddress, contracts } from "../../../helpers"; import { TokenRouter } from "../../../contract-bindings"; import { circle, toChain } from "@wormhole-foundation/sdk-base"; +import { toUniversal } from "@wormhole-foundation/sdk-definitions"; -evm.runOnEvms("cross-registration-token-router", async (chain, signer, log) => { +evm.runOnEvms("cross-registration-token-router", async (chain, _, log) => { const tokenRouterAddress = getContractAddress("TokenRouterProxy", chain.chainId); const tokenRouter = (await getContractInstance("TokenRouter", tokenRouterAddress, chain)) as TokenRouter; const deployedTokenRouters = contracts['TokenRouterProxy'].filter((router) => router.chainId !== chain.chainId); - + const chainName = toChain(chain.chainId); + for (const router of deployedTokenRouters) { const circleDomain = circle.toCircleChainId(chain.network, toChain(router.chainId)); const endpoint = { - router: getUniversalAddress(router.address), - mintRecipient: getUniversalAddress(router.address) + router: toUniversal(chainName, router.address).toString(), + mintRecipient: toUniversal(chainName, router.address).toString() }; if (router.chainId === 0) diff --git a/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts b/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts index 9ae9fab0..8fa9508b 100644 --- a/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts @@ -1,8 +1,7 @@ -import { evm, ChainInfo, getContractInstance, getContractAddress, getDependencyAddress, getAddressType } from "../../../helpers"; -import { deployImplementation, getTokenRouterConfiguration } from "./utils"; +import { evm, ChainInfo, getContractInstance, getContractAddress, getDependencyAddress } from "../../../helpers"; +import { deployImplementation, getMintRecipientAddress, getTokenRouterConfiguration, matchingEngineChain, matchingEngineDomain } from "./utils"; import { TokenRouter } from "../../../contract-bindings"; -import { TokenRouterConfiguration } from "../../../config/config-types"; -import { UniversalAddress } from "@wormhole-foundation/sdk-definitions"; +import { toUniversal } from "@wormhole-foundation/sdk-definitions"; evm.runOnEvms("upgrade-token-router", async (chain, signer, log) => { const currentImplementationAddress = getContractAddress("TokenRouterImplementation", chain.chainId); @@ -11,7 +10,7 @@ evm.runOnEvms("upgrade-token-router", async (chain, signer, log) => { const config = await getTokenRouterConfiguration(chain); log(`Checking immutables for TokenRouter`); - checkImmutables(proxy, config, chain); + checkImmutables(proxy, chain); const newImplementation = await deployImplementation(chain, signer, config, log); @@ -20,13 +19,13 @@ evm.runOnEvms("upgrade-token-router", async (chain, signer, log) => { await proxy.upgradeContract(newImplementation.address); }); -async function checkImmutables(tokenRouter: TokenRouter, config: TokenRouterConfiguration, chain: ChainInfo) { +async function checkImmutables(tokenRouter: TokenRouter, chain: ChainInfo) { const [ token, - matchingEngineMintRecipient, - matchingEngineChain, - matchingEngineDomain, - matchingEngineAddress, + savedMatchingEngineMintRecipient, + savedMatchingEngineChain, + savedMatchingEngineDomain, + savedMatchingEngineAddress, ] = await Promise.all([ tokenRouter.orderToken(), tokenRouter.matchingEngineMintRecipient(), @@ -35,23 +34,21 @@ async function checkImmutables(tokenRouter: TokenRouter, config: TokenRouterConf tokenRouter.matchingEngineAddress(), ]); - const mintRecipientAddressType = getAddressType(config.matchingEngineMintRecipient); - const expectedMatchingEngineMintRecipient = (new UniversalAddress(config.matchingEngineMintRecipient, mintRecipientAddressType)).toString(); - const localMatchingEngineAddress = getContractAddress("MatchingEngineProxy", chain.chainId); - const matchingEngineAddressType = getAddressType(localMatchingEngineAddress); - const expectedMatchingEngineAddress = (new UniversalAddress(localMatchingEngineAddress, matchingEngineAddressType)).toString(); + const matchingEngineMintRecipient = toUniversal("Solana", getMintRecipientAddress()).toString(); + const localMatchingEngineAddress = getContractAddress("MatchingEngineProxy", matchingEngineChain); + const matchingEngineAddress = toUniversal("Solana", localMatchingEngineAddress).toString(); const tokenAddress = getDependencyAddress("token", chain.chainId); - if (matchingEngineMintRecipient.toLowerCase() !== expectedMatchingEngineMintRecipient.toLowerCase()) + if (savedMatchingEngineMintRecipient.toLowerCase() !== matchingEngineMintRecipient.toLowerCase()) throw new Error(`MatchingEngineMintRecipient is an immutable value and cannot be changed.`); - if (matchingEngineChain !== Number(config.matchingEngineChain)) + if (savedMatchingEngineChain !== matchingEngineChain) throw new Error(`MatchingEngineChain is an immutable value and cannot be changed.`); - if (matchingEngineDomain !== Number(config.matchingEngineDomain)) + if (savedMatchingEngineDomain !== matchingEngineDomain) throw new Error(`MatchingEngineDomain is an immutable value and cannot be changed.`); - if (matchingEngineAddress.toLowerCase() !== expectedMatchingEngineAddress.toLowerCase()) + if (savedMatchingEngineAddress.toLowerCase() !== matchingEngineAddress.toLowerCase()) throw new Error(`MatchingEngineAddress is an immutable value and cannot be changed.`); if (token.toLowerCase() !== tokenAddress.toLowerCase()) diff --git a/deployment/scripts/evm/TokenRouter/utils.ts b/deployment/scripts/evm/TokenRouter/utils.ts index 6e560149..ca02b5bc 100644 --- a/deployment/scripts/evm/TokenRouter/utils.ts +++ b/deployment/scripts/evm/TokenRouter/utils.ts @@ -2,38 +2,47 @@ import { ethers } from "ethers"; import { TokenRouterConfiguration } from "../../../config/config-types"; import { TokenRouter, TokenRouter__factory } from "../../../contract-bindings"; import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, logComparison, someoneIsDifferent } from "../../../helpers"; -import { ERC20 } from "../../../contract-bindings/ERC20"; -import { UniversalAddress } from "@wormhole-foundation/sdk-definitions"; +import { IERC20 } from "../../../contract-bindings"; +import { UniversalAddress, toUniversal } from "@wormhole-foundation/sdk-definitions"; +import { toChain } from "@wormhole-foundation/sdk-base"; -export function getTokenRouterConfiguration(chain: ChainInfo): Promise { - return getChainConfig("token-router", chain.chainId); -} +/** + * Chain ID for the Solana wormhole chain + */ +export const matchingEngineChain = 1; + +/** + * CCTP Domain for Solana + */ +export const matchingEngineDomain = 5; // TODO -function getMintRecipientAddress() { +export function getMintRecipientAddress() { return '6y7V8dL673XFzm9QyC5vvh3itWkp7wztahBd2yDqsyrK' }; +export function getTokenRouterConfiguration(chain: ChainInfo): Promise { + return getChainConfig("token-router", chain.chainId); +} + export async function deployImplementation(chain: ChainInfo, signer: ethers.Signer, config: TokenRouterConfiguration, log: LoggerFn) { const factory = new TokenRouter__factory(signer); const token = getDependencyAddress("token", config.chainId); const wormhole = getDependencyAddress("wormhole", config.chainId); const tokenMessenger = getDependencyAddress("tokenMessenger", config.chainId); - const matchingEngineMintRecipient = (new UniversalAddress(getMintRecipientAddress(), 'base58')).toString(); - const matchinEngineChain = 1; // Solana wormhole chain id - const matchingEngineDomain = 5; // Solana cctp domain + const matchingEngineMintRecipient = toUniversal("Solana", getMintRecipientAddress()).toString(); let matchingEngineAddress = (getContractAddress( "MatchingEngineProxy", - matchinEngineChain + matchingEngineChain )); - matchingEngineAddress = (new UniversalAddress(matchingEngineAddress, 'base58')).toString(); + matchingEngineAddress = toUniversal("Solana", matchingEngineAddress).toString(); const deployment = await factory.deploy( token, wormhole, tokenMessenger, - matchinEngineChain, + matchingEngineChain, matchingEngineAddress, matchingEngineMintRecipient, matchingEngineDomain, @@ -48,7 +57,7 @@ export async function deployImplementation(chain: ChainInfo, signer: ethers.Sign token, wormhole, tokenMessenger, - matchinEngineChain, + matchingEngineChain, matchingEngineAddress, matchingEngineMintRecipient, matchingEngineDomain @@ -66,7 +75,7 @@ export async function getOnChainTokenRouterConfiguration(chain: ChainInfo) { // Get the allowance for the token messenger const tokenMessengerAddress = getDependencyAddress("tokenMessenger", chain.chainId); const orderTokenAddress = await tokenRouter.orderToken(); - const orderToken = (await getContractInstance("ERC20", orderTokenAddress, chain)) as ERC20; + const orderToken = (await getContractInstance("IERC20", orderTokenAddress, chain)) as IERC20; const cctpAllowance = await orderToken.allowance(tokenRouterProxyAddress, tokenMessengerAddress); const ownerAssistant = await tokenRouter.getOwnerAssistant(); const { enabled, maxAmount, baseFee, initAuctionFee} = await tokenRouter.getFastTransferParameters(); diff --git a/deployment/scripts/solana/initializeMatchingEngine.ts b/deployment/scripts/solana/initializeMatchingEngine.ts index d8cb1255..7b139d0c 100644 --- a/deployment/scripts/solana/initializeMatchingEngine.ts +++ b/deployment/scripts/solana/initializeMatchingEngine.ts @@ -1,7 +1,8 @@ import { - ComputeBudgetProgram, - Connection, - PublicKey, + AccountInfo, + ComputeBudgetProgram, + Connection, + PublicKey, } from "@solana/web3.js"; import "dotenv/config"; import { uint64ToBN } from "@wormhole-foundation/example-liquidity-layer-solana/common"; @@ -30,7 +31,7 @@ async function initialize(matchingEngine: MatchingEngineProgram, signer: SolanaL const custodian = matchingEngine.custodianAddress(); log("custodian", custodian.toString()); - const exists = await connection.getAccountInfo(custodian).then((acct) => acct != null); + const exists = await connection.getAccountInfo(custodian).then((acct: null | AccountInfo) => acct != null); if (exists) { log("already initialized"); return; diff --git a/deployment/scripts/solana/registerRoutersInMatchingEngine.ts b/deployment/scripts/solana/registerRoutersInMatchingEngine.ts index be7d428f..c65bc086 100644 --- a/deployment/scripts/solana/registerRoutersInMatchingEngine.ts +++ b/deployment/scripts/solana/registerRoutersInMatchingEngine.ts @@ -1,7 +1,8 @@ import { - ComputeBudgetProgram, - Connection, - PublicKey, + AccountInfo, + ComputeBudgetProgram, + Connection, + PublicKey, } from "@solana/web3.js"; import "dotenv/config"; import { MatchingEngineProgram } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; @@ -16,8 +17,10 @@ import { TokenRouterProgram } from "@wormhole-foundation/example-liquidity-layer solana.runOnSolana("register-routers-matching-engine", async (chain, signer, log) => { const matchingEngineId = getContractAddress("MatchingEngine", chain.chainId) as ProgramId; - const env = "Mainnet"; - const usdcMint = new PublicKey(circle.usdcContract(env, "Solana")); + if (chain.network === "Devnet") + throw new Error("Devnet is not supported by USDC. Use Mainnet or Testnet."); + + const usdcMint = new PublicKey(circle.usdcContract(chain.network, "Solana")); const connection = new Connection(chain.rpc, solana.connectionCommitmentLevel); const matchingEngine = new MatchingEngineProgram(connection, matchingEngineId, usdcMint); @@ -60,7 +63,7 @@ async function addCctpRouterEndpoint( foreignMintRecipient: string | null, log: LoggerFn, ) { - await matchingEngine.fetchCustodian().catch((_) => { + await matchingEngine.fetchCustodian().catch((_: unknown) => { throw new Error("no custodian found"); }); @@ -68,7 +71,7 @@ async function addCctpRouterEndpoint( const foreignChainId = toChainId(foreignChain); const endpoint = matchingEngine.routerEndpointAddress(foreignChainId); - const exists = await connection.getAccountInfo(endpoint).then((acct) => acct != null); + const exists = await connection.getAccountInfo(endpoint).then((acct: null | AccountInfo) => acct != null); const endpointAddress = Array.from(toUniversal(foreignChain, foreignEmitter).unwrap()); const endpointMintRecipient = @@ -153,7 +156,7 @@ async function addSolanaCctpRouterEndpoint( tokenRouter: TokenRouterProgram, log: LoggerFn, ) { - await matchingEngine.fetchCustodian().catch((_) => { + await matchingEngine.fetchCustodian().catch((_: unknown) => { throw new Error("no custodian found"); }); @@ -161,7 +164,7 @@ async function addSolanaCctpRouterEndpoint( const chain = toChainId("Solana"); const endpoint = matchingEngine.routerEndpointAddress(chain); - const exists = await connection.getAccountInfo(endpoint).then((acct) => acct != null); + const exists = await connection.getAccountInfo(endpoint).then((acct: null | AccountInfo) => acct != null); const endpointAddress = Array.from( toUniversal("Solana", tokenRouter.custodianAddress().toString()).unwrap(), From e43bf138a04a2d4848ddabbb4858b08ba1050a34 Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Wed, 24 Jul 2024 09:20:43 -0300 Subject: [PATCH 36/80] Finish bytecode verification script --- .../config/mainnet/verification-api-keys.json | 1 + .../config/verification-api-keys.sample.json | 7 +++ deployment/helpers/evm.ts | 3 +- deployment/helpers/utils.ts | 19 ++++++- .../bytecode-verification-token-router.ts | 53 ++++++++++--------- 5 files changed, 56 insertions(+), 27 deletions(-) create mode 100644 deployment/config/mainnet/verification-api-keys.json create mode 100644 deployment/config/verification-api-keys.sample.json diff --git a/deployment/config/mainnet/verification-api-keys.json b/deployment/config/mainnet/verification-api-keys.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/deployment/config/mainnet/verification-api-keys.json @@ -0,0 +1 @@ +{} diff --git a/deployment/config/verification-api-keys.sample.json b/deployment/config/verification-api-keys.sample.json new file mode 100644 index 00000000..377e93f8 --- /dev/null +++ b/deployment/config/verification-api-keys.sample.json @@ -0,0 +1,7 @@ +{ + "": { "etherscan": "", "blockscout": {"key": "", "apiUrl": "https://.blockscout.com/api"}, "sourcify": ""}, + "": { "etherscan": "", "blockscout": {"key": "", "apiUrl": "https://.blockscout.com/api"}}, + "": { "blockscout": {"key": "", "apiUrl": "https://.blockscout.com/api"}, "sourcify": ""}, + "": { "etherscan": "", "sourcify": ""}, + "": { "etherscan": ""} +} diff --git a/deployment/helpers/evm.ts b/deployment/helpers/evm.ts index 9ad326c6..86d84672 100644 --- a/deployment/helpers/evm.ts +++ b/deployment/helpers/evm.ts @@ -1,6 +1,7 @@ import { LedgerSigner } from "@xlabs-xyz/ledger-signer"; import { ethers } from "ethers"; import { ChainInfo, ecosystemChains, EvmScriptCb, getEnv } from "./index"; +import { toChain } from "@wormhole-foundation/sdk-base"; export async function runOnEvms(scriptName: string, cb: EvmScriptCb) { const chains = evmOperatingChains(); @@ -10,7 +11,7 @@ export async function runOnEvms(scriptName: string, cb: EvmScriptCb) { const result = chains.map(async chain => { const log = (...args: any[]) => console.log(`[${chain.chainId}]`, ...args); const signer = await getSigner(chain); - log(`Starting script. Signer: ${await signer.getAddress()}`); + log(`Starting script. Signer: ${await signer.getAddress()}. Chain: ${toChain(chain.chainId)}`); try { await cb(chain, signer, log); diff --git a/deployment/helpers/utils.ts b/deployment/helpers/utils.ts index 785a97a1..f1de1425 100644 --- a/deployment/helpers/utils.ts +++ b/deployment/helpers/utils.ts @@ -49,7 +49,17 @@ export function flattenObject(obj: Record, parentKey = '', result: return result; } -export function getVerifyCommand( +export function getVerifyCommand({ + chain, + contractName, + contractPath, + contractAddress, + constructorSignature, + constructorArgs, + verifier, + verifierUrl, + apiKey +}: { chain: ChainInfo, contractName: string, contractPath: string, @@ -57,14 +67,19 @@ export function getVerifyCommand( constructorSignature: string, constructorArgs: any[], verifier: string, + verifierUrl?: string, apiKey?: string -): string { +}): string { if (chain.externalId === undefined) throw new Error(`Chain ${chain.chainId} does not have an external ID`); + if (verifier === "blockscout" && verifierUrl === undefined) + throw new Error(`Verifier URL is required for Blockscout verifier`); + let command = ` forge verify-contract ${contractAddress} ${contractPath}:${contractName} \ --verifier ${verifier} \ + ${ verifier === "blockscout" ? `--verifier-url ${verifierUrl}` : ''} \ --watch --constructor-args $(cast abi-encode "${constructorSignature}" "${constructorArgs.join('" "')}") \ --chain-id ${chain.externalId} \ ${ apiKey === undefined || apiKey === "" ? '' : `--etherscan-api-key ${apiKey}` } diff --git a/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts b/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts index 0b42b062..df0f1e4a 100644 --- a/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/bytecode-verification-token-router.ts @@ -7,12 +7,15 @@ evm.runOnEvms("bytecode-verification-token-router", async (chain, signer, log) = // The root path of the foundry project const rootPath = path.resolve('../evm/'); - const verifiersData = verificationApiKeys.find((x) => x.chainId == chain.chainId); - const verifiers = flattenObject(verifiersData!); - delete verifiers.chainId; + const verifiers = verificationApiKeys[chain.chainId]; + if (!verifiers) { + log(chalk.red(`No verifiers found for chain ${chain.chainId}`)); + return; + } - for (let [name, apiKey] of Object.entries(verifiers)) { - name = name.split("-")[0]; + for (let [verifier, data] of Object.entries(verifiers)) { + const apiKey = typeof data === 'string' ? data : data.key; + const verifierUrl = typeof data === 'string' ? undefined : data.apiUrl; // Implementation data const implementationName = "TokenRouter"; @@ -20,35 +23,37 @@ evm.runOnEvms("bytecode-verification-token-router", async (chain, signer, log) = const implementationAddress = getContractAddress("TokenRouterImplementation", chain.chainId); const implementationDeploymentArgs = getDeploymentArgs("TokenRouterImplementation", chain.chainId); const implementationConstructorSignature = "constructor(address,address,address,uint16,bytes32,bytes32,uint32)"; - const verifyImplementationCommand = getVerifyCommand( + const verifyImplementationCommand = getVerifyCommand({ chain, - implementationName, - implementationPath, - implementationAddress, - implementationConstructorSignature, - implementationDeploymentArgs, - name, + contractName: implementationName, + contractPath: implementationPath, + contractAddress: implementationAddress, + constructorSignature: implementationConstructorSignature, + constructorArgs: implementationDeploymentArgs, + verifier, + verifierUrl, apiKey - ); + }); // Proxy data const proxyName = "ERC1967Proxy"; const proxyPath = 'lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol'; - const proxyAddress = getContractAddress("MatchingEngineProxy", chain.chainId); - const proxyDeploymentArgs = getDeploymentArgs("MatchingEngineProxy", chain.chainId); + const proxyAddress = getContractAddress("TokenRouterProxy", chain.chainId); + const proxyDeploymentArgs = getDeploymentArgs("TokenRouterProxy", chain.chainId); const proxyConstructorSignature = "constructor(address,bytes)"; - const verifyProxyCommand = getVerifyCommand( + const verifyProxyCommand = getVerifyCommand({ chain, - proxyName, - proxyPath, - proxyAddress, - proxyConstructorSignature, - proxyDeploymentArgs, - name, + contractName: proxyName, + contractPath: proxyPath, + contractAddress: proxyAddress, + constructorSignature: proxyConstructorSignature, + constructorArgs: proxyDeploymentArgs, + verifier, + verifierUrl, apiKey - ); + }); - log(chalk.green(`Verifying bytecode on ${name}...`)); + log(chalk.green(`Verifying bytecode on ${verifier}...`)); log(chalk.green("Verifying implementation bytecode...")); execSync(verifyImplementationCommand, { stdio: "inherit", cwd: rootPath }); console.log() From 7f957196ce729b8bcd57a9d9e1ce44205dcbecea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Wed, 24 Jul 2024 10:22:14 -0300 Subject: [PATCH 37/80] deploy: adds addresses to mainnet config --- deployment/config/mainnet/matching-engine.json | 2 +- deployment/config/mainnet/token-router.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deployment/config/mainnet/matching-engine.json b/deployment/config/mainnet/matching-engine.json index 6866d7f2..b32b8bb0 100644 --- a/deployment/config/mainnet/matching-engine.json +++ b/deployment/config/mainnet/matching-engine.json @@ -1,7 +1,7 @@ [ { "chainId": 1, - "ownerAssistant": "", + "ownerAssistant": "DNuVesmYQizpEVXYJZGECSeshqAxHB4fbqX2UC6ehpK4", "feeRecipient": "AdAVF5KmmGmpNQhjY7FL96wZLEynD6Mx3VXJTZf2yFps", "userPenaltyRewardBps": "100", "initialPenaltyBps": "100", diff --git a/deployment/config/mainnet/token-router.json b/deployment/config/mainnet/token-router.json index f9cfa034..148fd702 100644 --- a/deployment/config/mainnet/token-router.json +++ b/deployment/config/mainnet/token-router.json @@ -1,7 +1,7 @@ [ { "chainId": 23, - "ownerAssistant": "", + "ownerAssistant": "0x420E8AA32c31626F7F31D6fcC154eeccd6E6e9cB", "fastTransferParameters": { "enabled": true, "maxAmount": "1000000000", @@ -12,7 +12,7 @@ }, { "chainId": 30, - "ownerAssistant": "", + "ownerAssistant": "0x420E8AA32c31626F7F31D6fcC154eeccd6E6e9cB", "fastTransferParameters": { "enabled": true, "maxAmount": "1000000000", From 824587302f557d97df93bac27827b7af362fd81e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Wed, 24 Jul 2024 19:01:07 -0300 Subject: [PATCH 38/80] deploy: retrieves mint recipient from solana sdk --- deployment/helpers/interfaces.ts | 2 +- .../cross-registration-token-router.ts | 7 ++--- .../evm/TokenRouter/deploy-token-router.ts | 17 +++++++++--- .../evm/TokenRouter/upgrade-token-router.ts | 27 ++++++++++++------- deployment/scripts/evm/TokenRouter/utils.ts | 24 ++++++++++------- 5 files changed, 51 insertions(+), 26 deletions(-) diff --git a/deployment/helpers/interfaces.ts b/deployment/helpers/interfaces.ts index 62916c9a..bc70dc3c 100644 --- a/deployment/helpers/interfaces.ts +++ b/deployment/helpers/interfaces.ts @@ -15,7 +15,7 @@ export type ChainInfo = { chainId: ChainId; rpc: string; /** - * Native ChainId + * Native (e.g. EIP-155) ChainId */ externalId?: string; network: Network; diff --git a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts index 188e312b..330fb562 100644 --- a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts @@ -7,13 +7,14 @@ evm.runOnEvms("cross-registration-token-router", async (chain, _, log) => { const tokenRouterAddress = getContractAddress("TokenRouterProxy", chain.chainId); const tokenRouter = (await getContractInstance("TokenRouter", tokenRouterAddress, chain)) as TokenRouter; const deployedTokenRouters = contracts['TokenRouterProxy'].filter((router) => router.chainId !== chain.chainId); - const chainName = toChain(chain.chainId); for (const router of deployedTokenRouters) { const circleDomain = circle.toCircleChainId(chain.network, toChain(router.chainId)); + // TODO: handle Solana registrations correctly in regards to mintRecipient + const routerChain = toChain(router.chainId); const endpoint = { - router: toUniversal(chainName, router.address).toString(), - mintRecipient: toUniversal(chainName, router.address).toString() + router: toUniversal(routerChain, router.address).toString(), + mintRecipient: toUniversal(routerChain, router.address).toString() }; if (router.chainId === 0) diff --git a/deployment/scripts/evm/TokenRouter/deploy-token-router.ts b/deployment/scripts/evm/TokenRouter/deploy-token-router.ts index d8ca65e1..e4981b11 100644 --- a/deployment/scripts/evm/TokenRouter/deploy-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/deploy-token-router.ts @@ -1,12 +1,23 @@ import { ethers } from "ethers"; -import { evm, LoggerFn, writeDeployedContract } from "../../../helpers"; +import { ecosystemChains, evm, LoggerFn, solana, writeDeployedContract } from "../../../helpers"; import { TokenRouterConfiguration } from "../../../config/config-types"; -import { deployImplementation, getTokenRouterConfiguration } from "./utils"; +import { deployImplementation, getMatchingEngineMintRecipientAddress, getTokenRouterConfiguration } from "./utils"; import { ERC1967Proxy__factory } from "../../../contract-bindings"; +import { toUniversal } from "@wormhole-foundation/sdk-definitions"; +import { Connection } from "@solana/web3.js"; evm.runOnEvms("deploy-token-router", async (chain, signer, log) => { const config = await getTokenRouterConfiguration(chain); - const implementation = await deployImplementation(chain, signer, config, log); + + // TODO: write a `getChain(chainId: ChainId): ChainInfo` function to replace these lines + if (ecosystemChains.solana.networks.length !== 1) { + throw Error("Unexpected number of Solana networks."); + } + const solanaRpc = ecosystemChains.solana.networks[0].rpc; + + const solanaConnection = new Connection(solanaRpc, solana.connectionCommitmentLevel); + const matchingEngineMintRecipient = toUniversal("Solana", getMatchingEngineMintRecipientAddress(solanaConnection)); + const implementation = await deployImplementation(signer, config, matchingEngineMintRecipient, log); await deployProxy(signer, config, implementation, log); }); diff --git a/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts b/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts index 8fa9508b..6b965376 100644 --- a/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts @@ -1,7 +1,8 @@ -import { evm, ChainInfo, getContractInstance, getContractAddress, getDependencyAddress } from "../../../helpers"; -import { deployImplementation, getMintRecipientAddress, getTokenRouterConfiguration, matchingEngineChain, matchingEngineDomain } from "./utils"; +import { evm, ChainInfo, getContractInstance, getContractAddress, getDependencyAddress, ecosystemChains, solana } from "../../../helpers"; +import { deployImplementation, getMatchingEngineMintRecipientAddress, getTokenRouterConfiguration, matchingEngineChain, matchingEngineDomain } from "./utils"; import { TokenRouter } from "../../../contract-bindings"; -import { toUniversal } from "@wormhole-foundation/sdk-definitions"; +import { UniversalAddress, toUniversal } from "@wormhole-foundation/sdk-definitions"; +import { Connection } from "@solana/web3.js"; evm.runOnEvms("upgrade-token-router", async (chain, signer, log) => { const currentImplementationAddress = getContractAddress("TokenRouterImplementation", chain.chainId); @@ -9,17 +10,26 @@ evm.runOnEvms("upgrade-token-router", async (chain, signer, log) => { const proxy = (await getContractInstance("TokenRouter", proxyAddress, chain)) as TokenRouter; const config = await getTokenRouterConfiguration(chain); + // TODO: write a `getChain(chainId: ChainId): ChainInfo` function to replace these lines + if (ecosystemChains.solana.networks.length !== 1) { + throw Error("Unexpected number of Solana networks."); + } + const solanaRpc = ecosystemChains.solana.networks[0].rpc; + + const solanaConnection = new Connection(solanaRpc, solana.connectionCommitmentLevel); + const matchingEngineMintRecipient = toUniversal("Solana", getMatchingEngineMintRecipientAddress(solanaConnection)); + log(`Checking immutables for TokenRouter`); - checkImmutables(proxy, chain); + checkImmutables(proxy, chain, matchingEngineMintRecipient); - const newImplementation = await deployImplementation(chain, signer, config, log); + const newImplementation = await deployImplementation(signer, config, matchingEngineMintRecipient, log); log(`Upgrading TokenRouter implementation from ${currentImplementationAddress} to ${newImplementation.address}`); - + await proxy.upgradeContract(newImplementation.address); }); -async function checkImmutables(tokenRouter: TokenRouter, chain: ChainInfo) { +async function checkImmutables(tokenRouter: TokenRouter, chain: ChainInfo, matchingEngineMintRecipient: UniversalAddress) { const [ token, savedMatchingEngineMintRecipient, @@ -34,12 +44,11 @@ async function checkImmutables(tokenRouter: TokenRouter, chain: ChainInfo) { tokenRouter.matchingEngineAddress(), ]); - const matchingEngineMintRecipient = toUniversal("Solana", getMintRecipientAddress()).toString(); const localMatchingEngineAddress = getContractAddress("MatchingEngineProxy", matchingEngineChain); const matchingEngineAddress = toUniversal("Solana", localMatchingEngineAddress).toString(); const tokenAddress = getDependencyAddress("token", chain.chainId); - if (savedMatchingEngineMintRecipient.toLowerCase() !== matchingEngineMintRecipient.toLowerCase()) + if (savedMatchingEngineMintRecipient.toLowerCase() !== matchingEngineMintRecipient.toString().toLowerCase()) throw new Error(`MatchingEngineMintRecipient is an immutable value and cannot be changed.`); if (savedMatchingEngineChain !== matchingEngineChain) diff --git a/deployment/scripts/evm/TokenRouter/utils.ts b/deployment/scripts/evm/TokenRouter/utils.ts index ca02b5bc..6bc8b668 100644 --- a/deployment/scripts/evm/TokenRouter/utils.ts +++ b/deployment/scripts/evm/TokenRouter/utils.ts @@ -4,7 +4,9 @@ import { TokenRouter, TokenRouter__factory } from "../../../contract-bindings"; import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, logComparison, someoneIsDifferent } from "../../../helpers"; import { IERC20 } from "../../../contract-bindings"; import { UniversalAddress, toUniversal } from "@wormhole-foundation/sdk-definitions"; -import { toChain } from "@wormhole-foundation/sdk-base"; +import { circle, toChain, toChainId } from "@wormhole-foundation/sdk-base"; +import { MatchingEngineProgram, ProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; +import { Connection, PublicKey } from "@solana/web3.js"; /** * Chain ID for the Solana wormhole chain @@ -16,27 +18,29 @@ export const matchingEngineChain = 1; */ export const matchingEngineDomain = 5; -// TODO -export function getMintRecipientAddress() { - return '6y7V8dL673XFzm9QyC5vvh3itWkp7wztahBd2yDqsyrK' +export function getMatchingEngineMintRecipientAddress(connection: Connection) { + const matchingEngineId = getContractAddress("MatchingEngineProxy", toChainId("Solana")) as ProgramId; + + const env = "Mainnet"; + const usdcMint = new PublicKey(circle.usdcContract(env, "Solana")); + const matchingEngine = new MatchingEngineProgram(connection, matchingEngineId, usdcMint); + return matchingEngine.cctpMintRecipientAddress().toBytes(); }; export function getTokenRouterConfiguration(chain: ChainInfo): Promise { return getChainConfig("token-router", chain.chainId); } -export async function deployImplementation(chain: ChainInfo, signer: ethers.Signer, config: TokenRouterConfiguration, log: LoggerFn) { +export async function deployImplementation(signer: ethers.Signer, config: TokenRouterConfiguration, matchingEngineMintRecipient: UniversalAddress, log: LoggerFn) { const factory = new TokenRouter__factory(signer); const token = getDependencyAddress("token", config.chainId); const wormhole = getDependencyAddress("wormhole", config.chainId); const tokenMessenger = getDependencyAddress("tokenMessenger", config.chainId); - const matchingEngineMintRecipient = toUniversal("Solana", getMintRecipientAddress()).toString(); - let matchingEngineAddress = (getContractAddress( + const matchingEngineAddress = toUniversal("Solana", (getContractAddress( "MatchingEngineProxy", matchingEngineChain - )); - matchingEngineAddress = toUniversal("Solana", matchingEngineAddress).toString(); + ))).toString(); const deployment = await factory.deploy( token, @@ -44,7 +48,7 @@ export async function deployImplementation(chain: ChainInfo, signer: ethers.Sign tokenMessenger, matchingEngineChain, matchingEngineAddress, - matchingEngineMintRecipient, + matchingEngineMintRecipient.toString(), matchingEngineDomain, {} // overrides ); From 08bc576b0897781246f8d2896f5dff3eb09f8e8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Thu, 25 Jul 2024 12:27:11 -0300 Subject: [PATCH 39/80] deploy: several adjustments to `initialize` script --- deployment/config/mainnet/ecosystem.json | 10 ++++++++-- deployment/helpers/evm.ts | 2 +- deployment/helpers/solana.ts | 6 ++++-- .../scripts/evm/TokenRouter/upgrade-token-router.ts | 2 +- deployment/scripts/evm/TokenRouter/utils.ts | 4 ++-- deployment/scripts/solana/initializeMatchingEngine.ts | 3 ++- 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/deployment/config/mainnet/ecosystem.json b/deployment/config/mainnet/ecosystem.json index 83fa7bd3..7cac2a63 100644 --- a/deployment/config/mainnet/ecosystem.json +++ b/deployment/config/mainnet/ecosystem.json @@ -1,5 +1,5 @@ { - "operatingChains": [23, 30], + "operatingChains": [1, 23, 30], "evm": { "networks": [ { @@ -17,6 +17,12 @@ ] }, "solana": { - "networks": [] + "networks": [ + { + "name": "Solana", + "chainId": 1, + "rpc": "https://api.mainnet-beta.solana.com" + } + ] } } \ No newline at end of file diff --git a/deployment/helpers/evm.ts b/deployment/helpers/evm.ts index 86d84672..9d506068 100644 --- a/deployment/helpers/evm.ts +++ b/deployment/helpers/evm.ts @@ -56,7 +56,7 @@ export function evmOperatingChains() { }; export async function getSigner(chain: ChainInfo): Promise { - const derivationPath = getEnv("LEDGER_BIP32_PATH"); + const derivationPath = getEnv("EVM_LEDGER_BIP32_PATH"); const provider = getProvider(chain); return LedgerSigner.create(provider, derivationPath); } diff --git a/deployment/helpers/solana.ts b/deployment/helpers/solana.ts index 2f4a3795..319baffe 100644 --- a/deployment/helpers/solana.ts +++ b/deployment/helpers/solana.ts @@ -12,6 +12,7 @@ import type { SolanaScriptCb } from "./interfaces"; import { inspect } from "util"; export const connectionCommitmentLevel = (process.env.SOLANA_COMMITMENT || "confirmed") as Commitment; +export const priorityMicrolamports = process.env.PRIORITY_MICROLAMPORTS !== "undefined" ? Number(process.env.PRIORITY_MICROLAMPORTS) : 1; export function validateSolAddress(address: string){ try { @@ -40,7 +41,8 @@ export async function runOnSolana(scriptName: string, cb: SolanaScriptCb) { const result = chains.map(async chain => { const log = (...args: any[]) => console.log(`[${chain.chainId}]`, ...args); const signer = await getSigner(); - log(`Starting script. Signer: ${await signer.getAddress()}`); + // TODO: encode in base58 + log(`Starting script. Signer: ${(await signer.getAddress()).toString("hex")}`); try { await cb(chain, signer, log); @@ -57,7 +59,7 @@ export async function runOnSolana(scriptName: string, cb: SolanaScriptCb) { let signer: SolanaLedgerSigner | null; export async function getSigner(): Promise { if (!signer) { - const derivationPath = getEnv("LEDGER_BIP32_PATH"); + const derivationPath = getEnv("SOLANA_LEDGER_BIP32_PATH"); signer = await SolanaLedgerSigner.create(derivationPath); } diff --git a/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts b/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts index 6b965376..a30d4c23 100644 --- a/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts @@ -44,7 +44,7 @@ async function checkImmutables(tokenRouter: TokenRouter, chain: ChainInfo, match tokenRouter.matchingEngineAddress(), ]); - const localMatchingEngineAddress = getContractAddress("MatchingEngineProxy", matchingEngineChain); + const localMatchingEngineAddress = getContractAddress("MatchingEngine", matchingEngineChain); const matchingEngineAddress = toUniversal("Solana", localMatchingEngineAddress).toString(); const tokenAddress = getDependencyAddress("token", chain.chainId); diff --git a/deployment/scripts/evm/TokenRouter/utils.ts b/deployment/scripts/evm/TokenRouter/utils.ts index 6bc8b668..71094d04 100644 --- a/deployment/scripts/evm/TokenRouter/utils.ts +++ b/deployment/scripts/evm/TokenRouter/utils.ts @@ -19,7 +19,7 @@ export const matchingEngineChain = 1; export const matchingEngineDomain = 5; export function getMatchingEngineMintRecipientAddress(connection: Connection) { - const matchingEngineId = getContractAddress("MatchingEngineProxy", toChainId("Solana")) as ProgramId; + const matchingEngineId = getContractAddress("MatchingEngine", toChainId("Solana")) as ProgramId; const env = "Mainnet"; const usdcMint = new PublicKey(circle.usdcContract(env, "Solana")); @@ -38,7 +38,7 @@ export async function deployImplementation(signer: ethers.Signer, config: TokenR const tokenMessenger = getDependencyAddress("tokenMessenger", config.chainId); const matchingEngineAddress = toUniversal("Solana", (getContractAddress( - "MatchingEngineProxy", + "MatchingEngine", matchingEngineChain ))).toString(); diff --git a/deployment/scripts/solana/initializeMatchingEngine.ts b/deployment/scripts/solana/initializeMatchingEngine.ts index 7b139d0c..7bbab853 100644 --- a/deployment/scripts/solana/initializeMatchingEngine.ts +++ b/deployment/scripts/solana/initializeMatchingEngine.ts @@ -57,12 +57,13 @@ async function initialize(matchingEngine: MatchingEngineProgram, signer: SolanaL auctionParams ); + // TODO: this doesn't check if the ATA already exists const splToken = await import("@solana/spl-token"); const assocciatedTokenProgramId = splToken.ASSOCIATED_TOKEN_PROGRAM_ID; const associatedToken = splToken.getAssociatedTokenAddressSync(usdcMint, signerPubkey, undefined, usdcMint, assocciatedTokenProgramId); const createAtaInstructions = []; createAtaInstructions.push(splToken.createAssociatedTokenAccountInstruction(signerPubkey, associatedToken, signerPubkey, usdcMint)); - createAtaInstructions.push(ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 1 })); + createAtaInstructions.push(ComputeBudgetProgram.setComputeUnitPrice({ microLamports: solana.priorityMicrolamports })); const createAtaTxid = await solana.ledgerSignAndSend(connection, createAtaInstructions, []); log(`CreateAtaTxid ${createAtaTxid}`); From 063c6caae9057a792c67d8949e4b60d4ecc8aaab Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Thu, 25 Jul 2024 15:23:44 -0300 Subject: [PATCH 40/80] Add solana programs helpers --- deployment/helpers/env.ts | 18 +++++++++++++++ deployment/helpers/interfaces.ts | 2 ++ deployment/helpers/solana.ts | 23 +++++++++++++++++-- deployment/helpers/utils.ts | 1 - .../cross-registration-token-router.ts | 23 +++++++++++++++---- .../evm/TokenRouter/deploy-token-router.ts | 12 ++++------ .../evm/TokenRouter/upgrade-token-router.ts | 14 ++++------- deployment/scripts/evm/TokenRouter/utils.ts | 11 +++------ 8 files changed, 71 insertions(+), 33 deletions(-) diff --git a/deployment/helpers/env.ts b/deployment/helpers/env.ts index 707c68a3..46bc09a5 100644 --- a/deployment/helpers/env.ts +++ b/deployment/helpers/env.ts @@ -45,6 +45,24 @@ export function getEnv(env: string): string { return v; } +export function getChainInfo(chainId: ChainId): ChainInfo { + if (ecosystemChains.solana.networks.length > 1) { + throw Error("Unexpected number of Solana networks."); + } + + const chains = [ + ...ecosystemChains.evm.networks, + ...ecosystemChains.solana.networks, + ]; + + const chain = chains.find((c) => c.chainId === chainId); + if (chain === undefined) { + throw Error(`Failed to find chain info for chain id: ${chainId}`); + } + + return chain; +} + export async function getChainConfig(filename: string, whChainId: ChainId): Promise { const scriptConfig: T[] = await loadJson(filename); diff --git a/deployment/helpers/interfaces.ts b/deployment/helpers/interfaces.ts index bc70dc3c..230f37dc 100644 --- a/deployment/helpers/interfaces.ts +++ b/deployment/helpers/interfaces.ts @@ -1,3 +1,4 @@ +import { Commitment } from "@solana/web3.js"; import { ChainId, Network } from "@wormhole-foundation/sdk-base"; import { SolanaLedgerSigner } from "@xlabs-xyz/ledger-signer-solana"; import { BytesLike, ethers } from "ethers"; @@ -19,6 +20,7 @@ export type ChainInfo = { */ externalId?: string; network: Network; + commitmentLevel?: Commitment; }; export type Deployment = { diff --git a/deployment/helpers/solana.ts b/deployment/helpers/solana.ts index 319baffe..3df4d892 100644 --- a/deployment/helpers/solana.ts +++ b/deployment/helpers/solana.ts @@ -7,9 +7,12 @@ import { Commitment } from "@solana/web3.js"; import { SolanaLedgerSigner } from "@xlabs-xyz/ledger-signer-solana"; -import { ecosystemChains, getEnv } from "./env"; +import { ecosystemChains, env, getContractAddress, getEnv } from "./env"; import type { SolanaScriptCb } from "./interfaces"; import { inspect } from "util"; +import { circle, toChainId } from "@wormhole-foundation/sdk-base"; +import { MatchingEngineProgram, ProgramId as MatchingEngineProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; +import { TokenRouterProgram, ProgramId as TokenRouterProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/tokenRouter"; export const connectionCommitmentLevel = (process.env.SOLANA_COMMITMENT || "confirmed") as Commitment; export const priorityMicrolamports = process.env.PRIORITY_MICROLAMPORTS !== "undefined" ? Number(process.env.PRIORITY_MICROLAMPORTS) : 1; @@ -89,4 +92,20 @@ export async function ledgerSignAndSend(connection: Connection, instructions: Tr async function addLedgerSignature(tx: Transaction, signer: SolanaLedgerSigner, signerPk: PublicKey) { const signedByPayer = await signer.signTransaction(tx.compileMessage().serialize()); tx.addSignature(signerPk, signedByPayer); -} \ No newline at end of file +} + +export function getMatchingEngineProgram(connection: Connection) { + const matchingEngineId = getContractAddress("MatchingEngine", toChainId("Solana")) as MatchingEngineProgramId; + const network = env === "mainnet" ? "Mainnet" : "Testnet"; + + const usdcMint = new PublicKey(circle.usdcContract(network, "Solana")); + return new MatchingEngineProgram(connection, matchingEngineId, usdcMint); +}; + +export function getTokenRouterProgram(connection: Connection) { + const tokenRouterId = getContractAddress("TokenRouter", toChainId("Solana")) as TokenRouterProgramId; + const network = env === "mainnet" ? "Mainnet" : "Testnet"; + + const usdcMint = new PublicKey(circle.usdcContract(network, "Solana")); + return new TokenRouterProgram(connection, tokenRouterId, usdcMint); +}; \ No newline at end of file diff --git a/deployment/helpers/utils.ts b/deployment/helpers/utils.ts index f1de1425..89b869b6 100644 --- a/deployment/helpers/utils.ts +++ b/deployment/helpers/utils.ts @@ -1,6 +1,5 @@ import chalk from 'chalk'; import { ChainInfo, LoggerFn, ValueDiff } from '.'; -import { UniversalAddress } from '@wormhole-foundation/sdk-definitions'; export const someoneIsDifferent = (values: ValueDiff[]) => values.some((value) => value.onChain.toString() !== value.offChain.toString() && Number(value.onChain) !== Number(value.offChain)); diff --git a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts index 330fb562..0dbbad8e 100644 --- a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts @@ -1,7 +1,9 @@ -import { evm, getContractInstance, getContractAddress, contracts } from "../../../helpers"; +import { evm, getContractInstance, getContractAddress, contracts, getChainInfo } from "../../../helpers"; import { TokenRouter } from "../../../contract-bindings"; -import { circle, toChain } from "@wormhole-foundation/sdk-base"; +import { circle, toChain, toChainId } from "@wormhole-foundation/sdk-base"; import { toUniversal } from "@wormhole-foundation/sdk-definitions"; +import { getTokenRouterProgram } from "../../../helpers/solana"; +import { Connection } from "@solana/web3.js"; evm.runOnEvms("cross-registration-token-router", async (chain, _, log) => { const tokenRouterAddress = getContractAddress("TokenRouterProxy", chain.chainId); @@ -10,11 +12,12 @@ evm.runOnEvms("cross-registration-token-router", async (chain, _, log) => { for (const router of deployedTokenRouters) { const circleDomain = circle.toCircleChainId(chain.network, toChain(router.chainId)); - // TODO: handle Solana registrations correctly in regards to mintRecipient const routerChain = toChain(router.chainId); + const routerAddress = toUniversal(routerChain, router.address).toString(); + const mintRecipient = routerChain === "Solana" ? getSolanaMintRecipient() : routerAddress; const endpoint = { - router: toUniversal(routerChain, router.address).toString(), - mintRecipient: toUniversal(routerChain, router.address).toString() + router: routerAddress, + mintRecipient }; if (router.chainId === 0) @@ -33,3 +36,13 @@ evm.runOnEvms("cross-registration-token-router", async (chain, _, log) => { log(`Router endpoint added for chainId ${router.chainId}`); } }); + + +function getSolanaMintRecipient(): string { + const chain = "Solana"; + const chainInfo = getChainInfo(toChainId(chain)); + const connection = new Connection(chainInfo.rpc, chainInfo.commitmentLevel || "confirmed"); + const tokenRouter = getTokenRouterProgram(connection); + + return toUniversal(chain, tokenRouter.custodianAddress().toBytes()).toString(); +} \ No newline at end of file diff --git a/deployment/scripts/evm/TokenRouter/deploy-token-router.ts b/deployment/scripts/evm/TokenRouter/deploy-token-router.ts index e4981b11..23638de0 100644 --- a/deployment/scripts/evm/TokenRouter/deploy-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/deploy-token-router.ts @@ -1,21 +1,17 @@ import { ethers } from "ethers"; -import { ecosystemChains, evm, LoggerFn, solana, writeDeployedContract } from "../../../helpers"; +import { evm, getChainInfo, LoggerFn, writeDeployedContract } from "../../../helpers"; import { TokenRouterConfiguration } from "../../../config/config-types"; import { deployImplementation, getMatchingEngineMintRecipientAddress, getTokenRouterConfiguration } from "./utils"; import { ERC1967Proxy__factory } from "../../../contract-bindings"; import { toUniversal } from "@wormhole-foundation/sdk-definitions"; import { Connection } from "@solana/web3.js"; +import { toChainId } from "@wormhole-foundation/sdk-base"; evm.runOnEvms("deploy-token-router", async (chain, signer, log) => { const config = await getTokenRouterConfiguration(chain); + const solanaChainInfo = getChainInfo(toChainId("Solana")); + const solanaConnection = new Connection(solanaChainInfo.rpc, solanaChainInfo.commitmentLevel || "confirmed"); - // TODO: write a `getChain(chainId: ChainId): ChainInfo` function to replace these lines - if (ecosystemChains.solana.networks.length !== 1) { - throw Error("Unexpected number of Solana networks."); - } - const solanaRpc = ecosystemChains.solana.networks[0].rpc; - - const solanaConnection = new Connection(solanaRpc, solana.connectionCommitmentLevel); const matchingEngineMintRecipient = toUniversal("Solana", getMatchingEngineMintRecipientAddress(solanaConnection)); const implementation = await deployImplementation(signer, config, matchingEngineMintRecipient, log); await deployProxy(signer, config, implementation, log); diff --git a/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts b/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts index a30d4c23..83513602 100644 --- a/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts @@ -1,22 +1,18 @@ -import { evm, ChainInfo, getContractInstance, getContractAddress, getDependencyAddress, ecosystemChains, solana } from "../../../helpers"; +import { evm, ChainInfo, getContractInstance, getContractAddress, getDependencyAddress, getChainInfo } from "../../../helpers"; import { deployImplementation, getMatchingEngineMintRecipientAddress, getTokenRouterConfiguration, matchingEngineChain, matchingEngineDomain } from "./utils"; import { TokenRouter } from "../../../contract-bindings"; import { UniversalAddress, toUniversal } from "@wormhole-foundation/sdk-definitions"; import { Connection } from "@solana/web3.js"; +import { toChainId } from "@wormhole-foundation/sdk-base"; evm.runOnEvms("upgrade-token-router", async (chain, signer, log) => { const currentImplementationAddress = getContractAddress("TokenRouterImplementation", chain.chainId); const proxyAddress = getContractAddress("TokenRouterProxy", chain.chainId); const proxy = (await getContractInstance("TokenRouter", proxyAddress, chain)) as TokenRouter; const config = await getTokenRouterConfiguration(chain); - - // TODO: write a `getChain(chainId: ChainId): ChainInfo` function to replace these lines - if (ecosystemChains.solana.networks.length !== 1) { - throw Error("Unexpected number of Solana networks."); - } - const solanaRpc = ecosystemChains.solana.networks[0].rpc; - - const solanaConnection = new Connection(solanaRpc, solana.connectionCommitmentLevel); + + const solanaChainInfo = getChainInfo(toChainId("Solana")); + const solanaConnection = new Connection(solanaChainInfo.rpc, solanaChainInfo.commitmentLevel || "confirmed"); const matchingEngineMintRecipient = toUniversal("Solana", getMatchingEngineMintRecipientAddress(solanaConnection)); log(`Checking immutables for TokenRouter`); diff --git a/deployment/scripts/evm/TokenRouter/utils.ts b/deployment/scripts/evm/TokenRouter/utils.ts index 71094d04..c718773b 100644 --- a/deployment/scripts/evm/TokenRouter/utils.ts +++ b/deployment/scripts/evm/TokenRouter/utils.ts @@ -4,9 +4,8 @@ import { TokenRouter, TokenRouter__factory } from "../../../contract-bindings"; import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, logComparison, someoneIsDifferent } from "../../../helpers"; import { IERC20 } from "../../../contract-bindings"; import { UniversalAddress, toUniversal } from "@wormhole-foundation/sdk-definitions"; -import { circle, toChain, toChainId } from "@wormhole-foundation/sdk-base"; -import { MatchingEngineProgram, ProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; -import { Connection, PublicKey } from "@solana/web3.js"; +import { Connection } from "@solana/web3.js"; +import { getMatchingEngineProgram } from "../../../helpers/solana"; /** * Chain ID for the Solana wormhole chain @@ -19,11 +18,7 @@ export const matchingEngineChain = 1; export const matchingEngineDomain = 5; export function getMatchingEngineMintRecipientAddress(connection: Connection) { - const matchingEngineId = getContractAddress("MatchingEngine", toChainId("Solana")) as ProgramId; - - const env = "Mainnet"; - const usdcMint = new PublicKey(circle.usdcContract(env, "Solana")); - const matchingEngine = new MatchingEngineProgram(connection, matchingEngineId, usdcMint); + const matchingEngine = getMatchingEngineProgram(connection); return matchingEngine.cctpMintRecipientAddress().toBytes(); }; From 038fb14aeaa6adaf508bc0405bec5072e0bd89e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Thu, 25 Jul 2024 15:53:57 -0300 Subject: [PATCH 41/80] deploy: adds priority fee to `initialize` instruction --- deployment/scripts/solana/initializeMatchingEngine.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/deployment/scripts/solana/initializeMatchingEngine.ts b/deployment/scripts/solana/initializeMatchingEngine.ts index 7bbab853..5b19f740 100644 --- a/deployment/scripts/solana/initializeMatchingEngine.ts +++ b/deployment/scripts/solana/initializeMatchingEngine.ts @@ -48,14 +48,17 @@ async function initialize(matchingEngine: MatchingEngineProgram, signer: SolanaL securityDepositBase: uint64ToBN(BigInt(config.securityDepositBase)), securityDepositBps: toIntegerNumber(config.securityDepositBps, "securityDepositBps"), } - const initializeIx = await matchingEngine.initializeIx( + const initializeInstructions = []; + const priorityFee = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: solana.priorityMicrolamports }); + initializeInstructions.push(await matchingEngine.initializeIx( { owner: signerPubkey, ownerAssistant: new PublicKey(config.ownerAssistant), feeRecipient: new PublicKey(config.feeRecipient), }, auctionParams - ); + )); + initializeInstructions.push(priorityFee); // TODO: this doesn't check if the ATA already exists const splToken = await import("@solana/spl-token"); @@ -63,12 +66,12 @@ async function initialize(matchingEngine: MatchingEngineProgram, signer: SolanaL const associatedToken = splToken.getAssociatedTokenAddressSync(usdcMint, signerPubkey, undefined, usdcMint, assocciatedTokenProgramId); const createAtaInstructions = []; createAtaInstructions.push(splToken.createAssociatedTokenAccountInstruction(signerPubkey, associatedToken, signerPubkey, usdcMint)); - createAtaInstructions.push(ComputeBudgetProgram.setComputeUnitPrice({ microLamports: solana.priorityMicrolamports })); + createAtaInstructions.push(priorityFee); const createAtaTxid = await solana.ledgerSignAndSend(connection, createAtaInstructions, []); log(`CreateAtaTxid ${createAtaTxid}`); - const initializeTxid = await solana.ledgerSignAndSend(connection, [initializeIx], []); + const initializeTxid = await solana.ledgerSignAndSend(connection, initializeInstructions, []); log(`InitializeTxid ${initializeTxid}`); } From 43d92e960321e2ef17419b1f6093216b225da56f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Thu, 25 Jul 2024 15:54:38 -0300 Subject: [PATCH 42/80] deploy: adds token router initialize script --- .../scripts/solana/initializeTokenRouter.ts | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 deployment/scripts/solana/initializeTokenRouter.ts diff --git a/deployment/scripts/solana/initializeTokenRouter.ts b/deployment/scripts/solana/initializeTokenRouter.ts new file mode 100644 index 00000000..1cdd4daf --- /dev/null +++ b/deployment/scripts/solana/initializeTokenRouter.ts @@ -0,0 +1,48 @@ +import { + ComputeBudgetProgram, + Connection, + PublicKey, +} from "@solana/web3.js"; +import "dotenv/config"; +import { solana, LoggerFn, getChainConfig, getContractAddress } from "../../helpers"; +import { TokenRouterConfiguration } from "../../config/config-types"; +import { ProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/tokenRouter"; +import { SolanaLedgerSigner } from "@xlabs-xyz/ledger-signer-solana"; +import { circle } from "@wormhole-foundation/sdk-base"; +import { TokenRouterProgram } from "@wormhole-foundation/example-liquidity-layer-solana/tokenRouter"; +import { ledgerSignAndSend } from "../../helpers/solana"; + +solana.runOnSolana("deploy-token-router", async (chain, signer, log) => { + const config = await getChainConfig("token-router", chain.chainId); + const tokenRouterId = getContractAddress("TokenRouterProgram", chain.chainId) as ProgramId; + + const env = "Mainnet"; + const usdcMint = new PublicKey(circle.usdcContract(env, "Solana")); + const connection = new Connection(chain.rpc, solana.connectionCommitmentLevel); + const tokenRouter = new TokenRouterProgram(connection, tokenRouterId, usdcMint); + + await initialize(tokenRouter, signer, log, config); +}); + +async function initialize(tokenRouter: TokenRouterProgram, signer: SolanaLedgerSigner, log: LoggerFn, config: TokenRouterConfiguration) { + const connection = tokenRouter.program.provider.connection; + + const custodian = tokenRouter.custodianAddress(); + log("custodian", custodian.toString()); + + const exists = await connection.getAccountInfo(custodian).then((acct) => acct != null); + if (exists) { + log("already initialized"); + return; + } + + const signerPubkey = new PublicKey(await signer.getAddress()); + const initializeIx = await tokenRouter.initializeIx({ + owner: signerPubkey, + ownerAssistant: new PublicKey(config.ownerAssistant), + }); + const priorityFee = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: solana.priorityMicrolamports }); + + const txSig = await ledgerSignAndSend(connection, [initializeIx, priorityFee], []); + log("intialize", txSig); +} \ No newline at end of file From 9cd7c1af77e06c3aa8ae54c3c282b0e971c73531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Thu, 25 Jul 2024 16:11:50 -0300 Subject: [PATCH 43/80] misc: adds ts-build to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b945ea48..41017a1e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ dist out cache tmp +ts-build From 3b25e04f0fa83ef5eb94da23068c7346b4425f2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Thu, 25 Jul 2024 16:22:13 -0300 Subject: [PATCH 44/80] solana: adds mainnet support in a few program getter functions --- solana/ts/src/tokenRouter/index.ts | 8 +++++++- solana/ts/src/upgradeManager/index.ts | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/solana/ts/src/tokenRouter/index.ts b/solana/ts/src/tokenRouter/index.ts index 20667b7c..76f45c80 100644 --- a/solana/ts/src/tokenRouter/index.ts +++ b/solana/ts/src/tokenRouter/index.ts @@ -24,7 +24,7 @@ import { uint64ToBN, } from "../common"; import * as matchingEngineSdk from "../matchingEngine"; -import { UpgradeManagerProgram } from "../upgradeManager"; +import { UpgradeManagerProgram, mainnet as mainnetUpgradeProgramId } from "../upgradeManager"; import { BPF_LOADER_UPGRADEABLE_PROGRAM_ID, programDataAddress } from "../utils"; import { VaaAccount } from "../wormhole"; import { Custodian, PreparedFill, PreparedOrder } from "./state"; @@ -912,6 +912,12 @@ export class TokenRouterProgram { "UpgradeManager11111111111111111111111111111", ); } + case mainnet(): { + return new UpgradeManagerProgram( + this.program.provider.connection, + mainnetUpgradeProgramId(), + ); + } default: { throw new Error("unsupported network"); } diff --git a/solana/ts/src/upgradeManager/index.ts b/solana/ts/src/upgradeManager/index.ts index 4f58b227..f0f0202a 100644 --- a/solana/ts/src/upgradeManager/index.ts +++ b/solana/ts/src/upgradeManager/index.ts @@ -208,6 +208,13 @@ export class UpgradeManagerProgram { PublicKey.default, ); } + case mainnet(): { + return new matchingEngineSdk.MatchingEngineProgram( + this.program.provider.connection, + matchingEngineSdk.mainnet(), + PublicKey.default, + ); + } default: { throw new Error("unsupported network"); } @@ -230,6 +237,13 @@ export class UpgradeManagerProgram { PublicKey.default, ); } + case mainnet(): { + return new tokenRouterSdk.TokenRouterProgram( + this.program.provider.connection, + tokenRouterSdk.mainnet(), + PublicKey.default, + ); + } default: { throw new Error("unsupported network"); } From e761480e91c611b1c3aea6f1224974d4646255c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Fri, 26 Jul 2024 16:17:54 -0300 Subject: [PATCH 45/80] deploy: a few fixes for the initialize matching engine script --- deployment/helpers/solana.ts | 7 ++++--- .../scripts/evm/TokenRouter/upgrade-token-router.ts | 2 +- deployment/scripts/evm/TokenRouter/utils.ts | 2 +- deployment/scripts/solana/initializeMatchingEngine.ts | 9 +++++---- .../scripts/solana/registerRoutersInMatchingEngine.ts | 2 +- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/deployment/helpers/solana.ts b/deployment/helpers/solana.ts index 3df4d892..31cc07ee 100644 --- a/deployment/helpers/solana.ts +++ b/deployment/helpers/solana.ts @@ -45,7 +45,8 @@ export async function runOnSolana(scriptName: string, cb: SolanaScriptCb) { const log = (...args: any[]) => console.log(`[${chain.chainId}]`, ...args); const signer = await getSigner(); // TODO: encode in base58 - log(`Starting script. Signer: ${(await signer.getAddress()).toString("hex")}`); + const signerPubkey = new PublicKey(await signer.getAddress()).toBase58(); + log(`Starting script. Signer: ${signerPubkey}`); try { await cb(chain, signer, log); @@ -95,7 +96,7 @@ async function addLedgerSignature(tx: Transaction, signer: SolanaLedgerSigner, s } export function getMatchingEngineProgram(connection: Connection) { - const matchingEngineId = getContractAddress("MatchingEngine", toChainId("Solana")) as MatchingEngineProgramId; + const matchingEngineId = getContractAddress("MatchingEngineProxy", toChainId("Solana")) as MatchingEngineProgramId; const network = env === "mainnet" ? "Mainnet" : "Testnet"; const usdcMint = new PublicKey(circle.usdcContract(network, "Solana")); @@ -103,7 +104,7 @@ export function getMatchingEngineProgram(connection: Connection) { }; export function getTokenRouterProgram(connection: Connection) { - const tokenRouterId = getContractAddress("TokenRouter", toChainId("Solana")) as TokenRouterProgramId; + const tokenRouterId = getContractAddress("TokenRouterProxy", toChainId("Solana")) as TokenRouterProgramId; const network = env === "mainnet" ? "Mainnet" : "Testnet"; const usdcMint = new PublicKey(circle.usdcContract(network, "Solana")); diff --git a/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts b/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts index 83513602..2b85a8f5 100644 --- a/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts @@ -40,7 +40,7 @@ async function checkImmutables(tokenRouter: TokenRouter, chain: ChainInfo, match tokenRouter.matchingEngineAddress(), ]); - const localMatchingEngineAddress = getContractAddress("MatchingEngine", matchingEngineChain); + const localMatchingEngineAddress = getContractAddress("MatchingEngineProxy", matchingEngineChain); const matchingEngineAddress = toUniversal("Solana", localMatchingEngineAddress).toString(); const tokenAddress = getDependencyAddress("token", chain.chainId); diff --git a/deployment/scripts/evm/TokenRouter/utils.ts b/deployment/scripts/evm/TokenRouter/utils.ts index c718773b..d62126f6 100644 --- a/deployment/scripts/evm/TokenRouter/utils.ts +++ b/deployment/scripts/evm/TokenRouter/utils.ts @@ -33,7 +33,7 @@ export async function deployImplementation(signer: ethers.Signer, config: TokenR const tokenMessenger = getDependencyAddress("tokenMessenger", config.chainId); const matchingEngineAddress = toUniversal("Solana", (getContractAddress( - "MatchingEngine", + "MatchingEngineProxy", matchingEngineChain ))).toString(); diff --git a/deployment/scripts/solana/initializeMatchingEngine.ts b/deployment/scripts/solana/initializeMatchingEngine.ts index 5b19f740..74d289ed 100644 --- a/deployment/scripts/solana/initializeMatchingEngine.ts +++ b/deployment/scripts/solana/initializeMatchingEngine.ts @@ -15,7 +15,7 @@ import { circle } from "@wormhole-foundation/sdk-base"; solana.runOnSolana("deploy-matching-engine", async (chain, signer, log) => { const config = await getChainConfig("matching-engine", chain.chainId); - const matchingEngineId = getContractAddress("MatchingEngine", chain.chainId) as ProgramId; + const matchingEngineId = getContractAddress("MatchingEngineProxy", chain.chainId) as ProgramId; const env = "Mainnet"; const usdcMint = new PublicKey(circle.usdcContract(env, "Solana")); @@ -50,11 +50,12 @@ async function initialize(matchingEngine: MatchingEngineProgram, signer: SolanaL } const initializeInstructions = []; const priorityFee = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: solana.priorityMicrolamports }); + const feeRecipient = new PublicKey(config.feeRecipient); initializeInstructions.push(await matchingEngine.initializeIx( { owner: signerPubkey, ownerAssistant: new PublicKey(config.ownerAssistant), - feeRecipient: new PublicKey(config.feeRecipient), + feeRecipient, }, auctionParams )); @@ -63,9 +64,9 @@ async function initialize(matchingEngine: MatchingEngineProgram, signer: SolanaL // TODO: this doesn't check if the ATA already exists const splToken = await import("@solana/spl-token"); const assocciatedTokenProgramId = splToken.ASSOCIATED_TOKEN_PROGRAM_ID; - const associatedToken = splToken.getAssociatedTokenAddressSync(usdcMint, signerPubkey, undefined, usdcMint, assocciatedTokenProgramId); + const associatedToken = splToken.getAssociatedTokenAddressSync(usdcMint, feeRecipient, undefined, usdcMint, assocciatedTokenProgramId); const createAtaInstructions = []; - createAtaInstructions.push(splToken.createAssociatedTokenAccountInstruction(signerPubkey, associatedToken, signerPubkey, usdcMint)); + createAtaInstructions.push(splToken.createAssociatedTokenAccountInstruction(signerPubkey, associatedToken, feeRecipient, usdcMint)); createAtaInstructions.push(priorityFee); const createAtaTxid = await solana.ledgerSignAndSend(connection, createAtaInstructions, []); diff --git a/deployment/scripts/solana/registerRoutersInMatchingEngine.ts b/deployment/scripts/solana/registerRoutersInMatchingEngine.ts index c65bc086..eb637d7b 100644 --- a/deployment/scripts/solana/registerRoutersInMatchingEngine.ts +++ b/deployment/scripts/solana/registerRoutersInMatchingEngine.ts @@ -15,7 +15,7 @@ import { TokenRouterProgram } from "@wormhole-foundation/example-liquidity-layer solana.runOnSolana("register-routers-matching-engine", async (chain, signer, log) => { - const matchingEngineId = getContractAddress("MatchingEngine", chain.chainId) as ProgramId; + const matchingEngineId = getContractAddress("MatchingEngineProxy", chain.chainId) as ProgramId; if (chain.network === "Devnet") throw new Error("Devnet is not supported by USDC. Use Mainnet or Testnet."); From 7497b030c3af4c526438608ef16972adedd1f4fa Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Mon, 29 Jul 2024 12:24:48 -0300 Subject: [PATCH 46/80] Assert local deps with connect deps --- deployment/helpers/env.ts | 48 +++++++++++++++---- deployment/helpers/interfaces.ts | 4 +- .../cross-registration-token-router.ts | 11 +++-- .../evm/TokenRouter/deploy-token-router.ts | 2 +- .../evm/TokenRouter/upgrade-token-router.ts | 4 +- deployment/scripts/evm/TokenRouter/utils.ts | 14 ++++-- 6 files changed, 62 insertions(+), 21 deletions(-) diff --git a/deployment/helpers/env.ts b/deployment/helpers/env.ts index 46bc09a5..7b7347b4 100644 --- a/deployment/helpers/env.ts +++ b/deployment/helpers/env.ts @@ -1,11 +1,12 @@ import fs from "fs"; import { ethers, utils } from "ethers"; import { validateSolAddress } from "./solana"; -import { ChainConfig, ChainInfo, ContractsJson, Dependencies, Ecosystem, VerificationApiKeys } from "./interfaces"; +import { ChainConfig, ChainInfo, ContractsJson, Dependencies, DependenciesConfig, Ecosystem, VerificationApiKeys } from "./interfaces"; import { getSigner } from "./evm"; // TODO: support different env files import 'dotenv/config'; -import { ChainId } from "@wormhole-foundation/sdk-base"; +import { ChainId, Token, contracts as connectDependencies, toChain } from "@wormhole-foundation/sdk-base"; +import { getTokensBySymbol } from "@wormhole-foundation/sdk-base/tokens"; export const env = getEnv("ENV"); export const contracts = loadContracts(); @@ -21,8 +22,8 @@ function loadJson(filename: string): T { return JSON.parse(fileContent.toString()) as T; } -function loadDependencies(): Dependencies[] { - return loadJson("dependencies"); +function loadDependencies(): DependenciesConfig[] { + return loadJson("dependencies"); } function loadContracts() { @@ -89,25 +90,54 @@ export function getContractAddress(contractName: string, whChainId: ChainId): st return contract; } -export function getDependencyAddress(dependencyName: string, whChainId: ChainId): string { - const chainDependencies = dependencies.find((d) => d.chainId === whChainId); +export function getLocalDependencyAddress(dependencyName: keyof Dependencies, chain: ChainInfo): string { + const chainDependencies = dependencies.find((d) => d.chainId === chain.chainId); if (chainDependencies === undefined ) { - throw new Error(`No dependencies found for chain ${whChainId}`); + throw new Error(`No dependencies found for chain ${chain.chainId}`); } const dependency = chainDependencies[dependencyName as keyof Dependencies] as string; if (dependency === undefined) { - throw new Error(`No dependency found for ${dependencyName} for chain ${whChainId}`); + throw new Error(`No dependency found for ${dependencyName} for chain ${chain.chainId}`); } if (!utils.isAddress(dependency) && !validateSolAddress(dependency)){ - throw new Error(`Invalid address for ${dependencyName} dependency found for chain ${whChainId}`); + throw new Error(`Invalid address for ${dependencyName} dependency found for chain ${chain.chainId}`); } return dependency; } +export function getDependencyAddress(dependencyName: keyof Dependencies, chain: ChainInfo): string { + const { + coreBridge, + circleContracts + } = connectDependencies; + + const symbol = "USDC"; + const nativeUSDC = (t: Token) => t.symbol === symbol && t.original === undefined + const token = getTokensBySymbol(chain.network, toChain(chain.chainId), symbol)?.find(nativeUSDC)?.address; + + const dependencies = { + wormhole: coreBridge.get(chain.network, toChain(chain.chainId)), + tokenMessenger: circleContracts.get(chain.network, toChain(chain.chainId))?.tokenMessenger, + token + } as Dependencies; + const connectDependency = dependencies[dependencyName as keyof Dependencies]; + + try { + const localDependency = getLocalDependencyAddress(dependencyName, chain); + return localDependency === connectDependency ? connectDependency : localDependency; + } catch (e) { + if (connectDependency === undefined) { + throw new Error(`No dependency found for ${dependencyName} for chain ${chain.chainId} on connect sdk`); + } + + return connectDependency; + } +} + export async function getContractInstance( contractName: string, contractAddress: string, diff --git a/deployment/helpers/interfaces.ts b/deployment/helpers/interfaces.ts index 230f37dc..acf18e97 100644 --- a/deployment/helpers/interfaces.ts +++ b/deployment/helpers/interfaces.ts @@ -51,12 +51,14 @@ export interface ChainConfig { chainId: ChainId; } -export interface Dependencies extends ChainConfig { +export interface Dependencies { wormhole: string; token: string; tokenMessenger: string; }; +export interface DependenciesConfig extends ChainConfig, Dependencies {}; + export interface ValueDiff { onChain: any; offChain: any; diff --git a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts index 0dbbad8e..7f44acbd 100644 --- a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts @@ -1,6 +1,6 @@ import { evm, getContractInstance, getContractAddress, contracts, getChainInfo } from "../../../helpers"; import { TokenRouter } from "../../../contract-bindings"; -import { circle, toChain, toChainId } from "@wormhole-foundation/sdk-base"; +import { ChainId, chainToPlatform, circle, toChain, toChainId } from "@wormhole-foundation/sdk-base"; import { toUniversal } from "@wormhole-foundation/sdk-definitions"; import { getTokenRouterProgram } from "../../../helpers/solana"; import { Connection } from "@solana/web3.js"; @@ -14,7 +14,7 @@ evm.runOnEvms("cross-registration-token-router", async (chain, _, log) => { const circleDomain = circle.toCircleChainId(chain.network, toChain(router.chainId)); const routerChain = toChain(router.chainId); const routerAddress = toUniversal(routerChain, router.address).toString(); - const mintRecipient = routerChain === "Solana" ? getSolanaMintRecipient() : routerAddress; + const mintRecipient = getMintRecipient(chain.chainId, routerAddress); const endpoint = { router: routerAddress, mintRecipient @@ -38,7 +38,12 @@ evm.runOnEvms("cross-registration-token-router", async (chain, _, log) => { }); -function getSolanaMintRecipient(): string { +function getMintRecipient(chainId: ChainId, routerAddress: string): string { + const platform = chainToPlatform(toChain(chainId)); + + if (platform === "Evm") + return routerAddress; + const chain = "Solana"; const chainInfo = getChainInfo(toChainId(chain)); const connection = new Connection(chainInfo.rpc, chainInfo.commitmentLevel || "confirmed"); diff --git a/deployment/scripts/evm/TokenRouter/deploy-token-router.ts b/deployment/scripts/evm/TokenRouter/deploy-token-router.ts index 23638de0..7ad95d37 100644 --- a/deployment/scripts/evm/TokenRouter/deploy-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/deploy-token-router.ts @@ -13,7 +13,7 @@ evm.runOnEvms("deploy-token-router", async (chain, signer, log) => { const solanaConnection = new Connection(solanaChainInfo.rpc, solanaChainInfo.commitmentLevel || "confirmed"); const matchingEngineMintRecipient = toUniversal("Solana", getMatchingEngineMintRecipientAddress(solanaConnection)); - const implementation = await deployImplementation(signer, config, matchingEngineMintRecipient, log); + const implementation = await deployImplementation(chain, signer, config, matchingEngineMintRecipient, log); await deployProxy(signer, config, implementation, log); }); diff --git a/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts b/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts index 2b85a8f5..cff39731 100644 --- a/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts @@ -18,7 +18,7 @@ evm.runOnEvms("upgrade-token-router", async (chain, signer, log) => { log(`Checking immutables for TokenRouter`); checkImmutables(proxy, chain, matchingEngineMintRecipient); - const newImplementation = await deployImplementation(signer, config, matchingEngineMintRecipient, log); + const newImplementation = await deployImplementation(chain, signer, config, matchingEngineMintRecipient, log); log(`Upgrading TokenRouter implementation from ${currentImplementationAddress} to ${newImplementation.address}`); @@ -42,7 +42,7 @@ async function checkImmutables(tokenRouter: TokenRouter, chain: ChainInfo, match const localMatchingEngineAddress = getContractAddress("MatchingEngineProxy", matchingEngineChain); const matchingEngineAddress = toUniversal("Solana", localMatchingEngineAddress).toString(); - const tokenAddress = getDependencyAddress("token", chain.chainId); + const tokenAddress = getDependencyAddress("token", chain); if (savedMatchingEngineMintRecipient.toLowerCase() !== matchingEngineMintRecipient.toString().toLowerCase()) throw new Error(`MatchingEngineMintRecipient is an immutable value and cannot be changed.`); diff --git a/deployment/scripts/evm/TokenRouter/utils.ts b/deployment/scripts/evm/TokenRouter/utils.ts index d62126f6..ef331739 100644 --- a/deployment/scripts/evm/TokenRouter/utils.ts +++ b/deployment/scripts/evm/TokenRouter/utils.ts @@ -26,11 +26,15 @@ export function getTokenRouterConfiguration(chain: ChainInfo): Promise("token-router", chain.chainId); } -export async function deployImplementation(signer: ethers.Signer, config: TokenRouterConfiguration, matchingEngineMintRecipient: UniversalAddress, log: LoggerFn) { +export async function deployImplementation(chain: ChainInfo, signer: ethers.Signer, config: TokenRouterConfiguration, matchingEngineMintRecipient: UniversalAddress, log: LoggerFn) { + if (config.chainId !== chain.chainId) { + throw new Error(`Chain ID mismatch: ${config.chainId} !== ${chain.chainId}`); + } + const factory = new TokenRouter__factory(signer); - const token = getDependencyAddress("token", config.chainId); - const wormhole = getDependencyAddress("wormhole", config.chainId); - const tokenMessenger = getDependencyAddress("tokenMessenger", config.chainId); + const token = getDependencyAddress("token", chain); + const wormhole = getDependencyAddress("wormhole", chain); + const tokenMessenger = getDependencyAddress("tokenMessenger", chain); const matchingEngineAddress = toUniversal("Solana", (getContractAddress( "MatchingEngineProxy", @@ -72,7 +76,7 @@ export async function getOnChainTokenRouterConfiguration(chain: ChainInfo) { const tokenRouter = (await getContractInstance("TokenRouter", tokenRouterProxyAddress, chain)) as TokenRouter; // Get the allowance for the token messenger - const tokenMessengerAddress = getDependencyAddress("tokenMessenger", chain.chainId); + const tokenMessengerAddress = getDependencyAddress("tokenMessenger", chain); const orderTokenAddress = await tokenRouter.orderToken(); const orderToken = (await getContractInstance("IERC20", orderTokenAddress, chain)) as IERC20; const cctpAllowance = await orderToken.allowance(tokenRouterProxyAddress, tokenMessengerAddress); From 8c9bad1baa02cc165f6f3e286fb4174ff295b78f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Tue, 30 Jul 2024 12:42:35 -0300 Subject: [PATCH 47/80] deploy: adds mainnet solana token router config --- deployment/config/mainnet/token-router.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/deployment/config/mainnet/token-router.json b/deployment/config/mainnet/token-router.json index 148fd702..444ae3d9 100644 --- a/deployment/config/mainnet/token-router.json +++ b/deployment/config/mainnet/token-router.json @@ -1,4 +1,15 @@ [ + { + "chainId": 1, + "ownerAssistant": "DNuVesmYQizpEVXYJZGECSeshqAxHB4fbqX2UC6ehpK4", + "fastTransferParameters": { + "enabled": true, + "maxAmount": "1000000000", + "baseFee": "1250000", + "initAuctionFee": "950000" + }, + "cctpAllowance": "18446744073709551615" + }, { "chainId": 23, "ownerAssistant": "0x420E8AA32c31626F7F31D6fcC154eeccd6E6e9cB", From 898dde9ce7d42b13d6fe2a0963be1f71ab9ef12a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Tue, 30 Jul 2024 12:46:39 -0300 Subject: [PATCH 48/80] deploy: cleans up imports --- deployment/scripts/evm/TokenRouter/utils.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/deployment/scripts/evm/TokenRouter/utils.ts b/deployment/scripts/evm/TokenRouter/utils.ts index ef331739..9719be05 100644 --- a/deployment/scripts/evm/TokenRouter/utils.ts +++ b/deployment/scripts/evm/TokenRouter/utils.ts @@ -1,8 +1,7 @@ import { ethers } from "ethers"; import { TokenRouterConfiguration } from "../../../config/config-types"; -import { TokenRouter, TokenRouter__factory } from "../../../contract-bindings"; +import { TokenRouter, TokenRouter__factory, IERC20 } from "../../../contract-bindings"; import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, logComparison, someoneIsDifferent } from "../../../helpers"; -import { IERC20 } from "../../../contract-bindings"; import { UniversalAddress, toUniversal } from "@wormhole-foundation/sdk-definitions"; import { Connection } from "@solana/web3.js"; import { getMatchingEngineProgram } from "../../../helpers/solana"; From 833cb0e8c487bd9f59fd0e42a942425263fc34c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Tue, 30 Jul 2024 12:46:55 -0300 Subject: [PATCH 49/80] deploy: fixes token router config query --- deployment/scripts/solana/initializeTokenRouter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/scripts/solana/initializeTokenRouter.ts b/deployment/scripts/solana/initializeTokenRouter.ts index 1cdd4daf..89ebd96a 100644 --- a/deployment/scripts/solana/initializeTokenRouter.ts +++ b/deployment/scripts/solana/initializeTokenRouter.ts @@ -14,7 +14,7 @@ import { ledgerSignAndSend } from "../../helpers/solana"; solana.runOnSolana("deploy-token-router", async (chain, signer, log) => { const config = await getChainConfig("token-router", chain.chainId); - const tokenRouterId = getContractAddress("TokenRouterProgram", chain.chainId) as ProgramId; + const tokenRouterId = getContractAddress("TokenRouterProxy", chain.chainId) as ProgramId; const env = "Mainnet"; const usdcMint = new PublicKey(circle.usdcContract(env, "Solana")); From e3ea8060b6dba86e3d5dae5d8fc20e9c51aa73d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Tue, 30 Jul 2024 12:50:21 -0300 Subject: [PATCH 50/80] deploy: use commonjs reference for solana bindings in tsconfig --- deployment/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/tsconfig.json b/deployment/tsconfig.json index cefc3366..0e89e60c 100644 --- a/deployment/tsconfig.json +++ b/deployment/tsconfig.json @@ -2,6 +2,6 @@ "extends": "../tsconfig.json", "include": ["scripts/**/*.ts", "scripts/**/*.json", "helpers/**/*.ts", "config/**/*.ts", "config/**/*.json", "contract-bindings/**/*.ts"], "references": [ - { "path": "../solana" }, + { "path": "../solana/tsconfig.cjs.json" }, ] } From 8a7982f5026437ed77e26d862b7c2148ee088dd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Tue, 30 Jul 2024 15:01:15 -0300 Subject: [PATCH 51/80] deploy: adds "Mainnet" marker to config --- deployment/config/mainnet/ecosystem.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deployment/config/mainnet/ecosystem.json b/deployment/config/mainnet/ecosystem.json index 7cac2a63..9d27720e 100644 --- a/deployment/config/mainnet/ecosystem.json +++ b/deployment/config/mainnet/ecosystem.json @@ -4,12 +4,14 @@ "networks": [ { "name": "Arbitrum", + "network": "Mainnet", "externalId": "42161", "chainId": 23, "rpc": "https://rpc.ankr.com/arbitrum" }, { "name": "Base", + "network": "Mainnet", "externalId": "8453", "chainId": 30, "rpc": "https://mainnet.base.org" @@ -20,6 +22,7 @@ "networks": [ { "name": "Solana", + "network": "Mainnet", "chainId": 1, "rpc": "https://api.mainnet-beta.solana.com" } From 9f18aab8bb2883be0be794a39b3a6139ad8e7dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Tue, 30 Jul 2024 15:01:42 -0300 Subject: [PATCH 52/80] deploy: prints error stack if available --- deployment/helpers/evm.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/helpers/evm.ts b/deployment/helpers/evm.ts index 9d506068..3a0c6090 100644 --- a/deployment/helpers/evm.ts +++ b/deployment/helpers/evm.ts @@ -17,7 +17,7 @@ export async function runOnEvms(scriptName: string, cb: EvmScriptCb) { await cb(chain, signer, log); log("Success"); } catch (error) { - log("Error: ", error); + log("Error: ", (error as any)?.stack || error); } console.log(); }); @@ -39,7 +39,7 @@ export async function runOnEvmsSequentially(scriptName: string, cb: EvmScriptCb) await cb(chain, signer, log); log("Success"); } catch (error) { - log("Error: ", error); + log("Error: ", (error as any)?.stack || error); } console.log(); } From 56c9d47ec2f478549cd778bd60fcb6410d42ab5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Tue, 30 Jul 2024 18:30:24 -0300 Subject: [PATCH 53/80] deploy: adds type alias for constructor arguments --- deployment/helpers/env.ts | 6 +++--- deployment/helpers/interfaces.ts | 6 ++++-- deployment/helpers/utils.ts | 4 ++-- deployment/scripts/evm/TokenRouter/utils.ts | 18 +++++++----------- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/deployment/helpers/env.ts b/deployment/helpers/env.ts index 7b7347b4..4f78d427 100644 --- a/deployment/helpers/env.ts +++ b/deployment/helpers/env.ts @@ -1,7 +1,7 @@ import fs from "fs"; import { ethers, utils } from "ethers"; import { validateSolAddress } from "./solana"; -import { ChainConfig, ChainInfo, ContractsJson, Dependencies, DependenciesConfig, Ecosystem, VerificationApiKeys } from "./interfaces"; +import { ChainConfig, ChainInfo, ContractsJson, Dependencies, DependenciesConfig, Ecosystem, UncheckedConstructorArgs, VerificationApiKeys } from "./interfaces"; import { getSigner } from "./evm"; // TODO: support different env files import 'dotenv/config'; @@ -148,7 +148,7 @@ export async function getContractInstance( return factory.connect(contractAddress, signer); } -export function getDeploymentArgs(contractName: string, whChainId: ChainId): any[] { +export function getDeploymentArgs(contractName: string, whChainId: ChainId): UncheckedConstructorArgs { const constructorArgs = contracts[contractName]?.find((c) => c.chainId === whChainId)?.constructorArgs; if (!constructorArgs) { @@ -158,7 +158,7 @@ export function getDeploymentArgs(contractName: string, whChainId: ChainId): any return constructorArgs; } -export function writeDeployedContract(whChainId: ChainId, contractName: string, address: string, constructorArgs: any[] ) { +export function writeDeployedContract(whChainId: ChainId, contractName: string, address: string, constructorArgs: UncheckedConstructorArgs ) { const contracts = loadContracts(); if (!contracts[contractName]) { contracts[contractName] = [{ chainId: whChainId, address, constructorArgs }]; diff --git a/deployment/helpers/interfaces.ts b/deployment/helpers/interfaces.ts index acf18e97..6fcf0564 100644 --- a/deployment/helpers/interfaces.ts +++ b/deployment/helpers/interfaces.ts @@ -29,7 +29,7 @@ export type Deployment = { */ chainId: number; address: string; - constructorArgs?: any[]; + constructorArgs?: UncheckedConstructorArgs; }; export type Ecosystem = { @@ -83,4 +83,6 @@ export type RouterEndpoint = { mintRecipient: BytesLike; }, circleDomain: number; -} \ No newline at end of file +} + +export type UncheckedConstructorArgs = readonly any[]; \ No newline at end of file diff --git a/deployment/helpers/utils.ts b/deployment/helpers/utils.ts index 89b869b6..85c68b53 100644 --- a/deployment/helpers/utils.ts +++ b/deployment/helpers/utils.ts @@ -1,5 +1,5 @@ import chalk from 'chalk'; -import { ChainInfo, LoggerFn, ValueDiff } from '.'; +import { ChainInfo, LoggerFn, UncheckedConstructorArgs, ValueDiff } from '.'; export const someoneIsDifferent = (values: ValueDiff[]) => values.some((value) => value.onChain.toString() !== value.offChain.toString() && Number(value.onChain) !== Number(value.offChain)); @@ -64,7 +64,7 @@ export function getVerifyCommand({ contractPath: string, contractAddress: string, constructorSignature: string, - constructorArgs: any[], + constructorArgs: UncheckedConstructorArgs, verifier: string, verifierUrl?: string, apiKey?: string diff --git a/deployment/scripts/evm/TokenRouter/utils.ts b/deployment/scripts/evm/TokenRouter/utils.ts index 9719be05..c8a59294 100644 --- a/deployment/scripts/evm/TokenRouter/utils.ts +++ b/deployment/scripts/evm/TokenRouter/utils.ts @@ -40,7 +40,7 @@ export async function deployImplementation(chain: ChainInfo, signer: ethers.Sign matchingEngineChain ))).toString(); - const deployment = await factory.deploy( + const constructorArgs = [ token, wormhole, tokenMessenger, @@ -48,22 +48,18 @@ export async function deployImplementation(chain: ChainInfo, signer: ethers.Sign matchingEngineAddress, matchingEngineMintRecipient.toString(), matchingEngineDomain, - {} // overrides + ] as const; + const overrides = {}; + + const deployment = await factory.deploy( + ...constructorArgs, + overrides, ); await deployment.deployed(); log(`TokenRouter deployed at ${deployment.address}`); - const constructorArgs = [ - token, - wormhole, - tokenMessenger, - matchingEngineChain, - matchingEngineAddress, - matchingEngineMintRecipient, - matchingEngineDomain - ]; writeDeployedContract(config.chainId, "TokenRouterImplementation", deployment.address, constructorArgs); From 1785320b1cc8b24730cadc0ebbde720354cac185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Tue, 30 Jul 2024 18:35:06 -0300 Subject: [PATCH 54/80] deploy: creates type for token router state --- deployment/helpers/interfaces.ts | 12 ++++-- deployment/helpers/utils.ts | 2 +- .../evm/TokenRouter/config-token-router.ts | 22 +++++----- deployment/scripts/evm/TokenRouter/utils.ts | 43 ++++++++++++++----- 4 files changed, 52 insertions(+), 27 deletions(-) diff --git a/deployment/helpers/interfaces.ts b/deployment/helpers/interfaces.ts index 6fcf0564..2bbaab52 100644 --- a/deployment/helpers/interfaces.ts +++ b/deployment/helpers/interfaces.ts @@ -1,7 +1,7 @@ import { Commitment } from "@solana/web3.js"; import { ChainId, Network } from "@wormhole-foundation/sdk-base"; import { SolanaLedgerSigner } from "@xlabs-xyz/ledger-signer-solana"; -import { BytesLike, ethers } from "ethers"; +import { BigNumber, BytesLike, ethers } from "ethers"; export type EvmScriptCb = (chain: ChainInfo, signer: ethers.Signer, logFn: LoggerFn) => Promise; export type SolanaScriptCb = (chain: ChainInfo, signer: SolanaLedgerSigner, logFn: LoggerFn) => Promise; @@ -59,11 +59,15 @@ export interface Dependencies { export interface DependenciesConfig extends ChainConfig, Dependencies {}; -export interface ValueDiff { - onChain: any; - offChain: any; +export interface ValueDiff { + onChain: T; + offChain: T; } +export type BooleanDiff = ValueDiff; +export type BigNumberDiff = ValueDiff; +export type StringDiff = ValueDiff; + export interface VerificationApiKeys extends ChainConfig { etherscan: string; blockscout?: { diff --git a/deployment/helpers/utils.ts b/deployment/helpers/utils.ts index 85c68b53..829616ad 100644 --- a/deployment/helpers/utils.ts +++ b/deployment/helpers/utils.ts @@ -3,7 +3,7 @@ import { ChainInfo, LoggerFn, UncheckedConstructorArgs, ValueDiff } from '.'; export const someoneIsDifferent = (values: ValueDiff[]) => values.some((value) => value.onChain.toString() !== value.offChain.toString() && Number(value.onChain) !== Number(value.offChain)); -export function logComparison(name: string, diffValues: any, log: LoggerFn) { +export function logComparison(name: string, diffValues: ValueDiff, log: LoggerFn) { // If the values are the same, do nothing if (diffValues.onChain.toString() === diffValues.offChain.toString() || Number(diffValues.onChain) === Number(diffValues.offChain)) diff --git a/deployment/scripts/evm/TokenRouter/config-token-router.ts b/deployment/scripts/evm/TokenRouter/config-token-router.ts index 718ddd93..69796ebc 100644 --- a/deployment/scripts/evm/TokenRouter/config-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/config-token-router.ts @@ -1,5 +1,5 @@ -import { evm, LoggerFn, getContractInstance, getContractAddress, ValueDiff } from "../../../helpers"; -import { getConfigurationDifferences, logDiff } from "./utils"; +import { evm, LoggerFn, getContractInstance, getContractAddress } from "../../../helpers"; +import { TokenRouterState, getConfigurationDifferences, logDiff } from "./utils"; import confirm from '@inquirer/confirm'; import { TokenRouter } from "../../../contract-bindings"; import { FastTransferParametersStruct } from "../../../contract-bindings/ITokenRouter"; @@ -24,18 +24,18 @@ evm.runOnEvmsSequentially("config-token-router", async (chain, signer, log) => { await updateFastTransferParameters(tokenRouter, fastTransferParameters, log); // CCTP allowance - if (cctpAllowance.onChain.toString() !== cctpAllowance.offChain.toString()) { + if (!cctpAllowance.onChain.eq(cctpAllowance.offChain)) { await tokenRouter.setCctpAllowance(cctpAllowance.offChain); log(`CCTP allowance updated to ${cctpAllowance.offChain}`); } }); -async function updateFastTransferParameters(tokenRouter: TokenRouter, params: Record, log: LoggerFn) { +async function updateFastTransferParameters(tokenRouter: TokenRouter, fastTransferParams: TokenRouterState["fastTransferParameters"], log: LoggerFn) { let enableFastTransfers = false; let updatedFastTransferParameters = false; // Check if any of the fast transfer parameters have changed - for (const [key, value] of Object.entries(params)) { + for (const [key, value] of Object.entries(fastTransferParams)) { if (value.onChain.toString() !== value.offChain.toString()) { // Check if we are updating the enabled flag if (key === "enabled") { @@ -49,21 +49,21 @@ async function updateFastTransferParameters(tokenRouter: TokenRouter, params: Re // Update fast transfer parameters if any of the values have changed (except for the enabled flag) if (updatedFastTransferParameters) { - if (params.maxAmount.offChain <= params.baseFee.offChain + params.initAuctionFee.offChain) + if (fastTransferParams.maxAmount.offChain.lte(fastTransferParams.baseFee.offChain.add(fastTransferParams.initAuctionFee.offChain))) throw new Error(`Invalid fast transfer parameters: maxAmount must be greater than baseFee + initAuctionFee`); await tokenRouter.updateFastTransferParameters({ - enabled: params.enabled.offChain, - baseFee: params.baseFee.offChain, - maxAmount: params.maxAmount.offChain, - initAuctionFee: params.initAuctionFee.offChain + enabled: fastTransferParams.enabled.offChain, + baseFee: fastTransferParams.baseFee.offChain, + maxAmount: fastTransferParams.maxAmount.offChain, + initAuctionFee: fastTransferParams.initAuctionFee.offChain } as FastTransferParametersStruct); log(`Fast transfer parameters updated`); } // Enable / Disable fast transfers if only the enabled flag has changed else if (enableFastTransfers) { - const enabled = params.enabled.offChain; + const enabled = fastTransferParams.enabled.offChain; await tokenRouter.enableFastTransfers(enabled); if (enabled) log(`Fast transfers enabled`); diff --git a/deployment/scripts/evm/TokenRouter/utils.ts b/deployment/scripts/evm/TokenRouter/utils.ts index c8a59294..170ca638 100644 --- a/deployment/scripts/evm/TokenRouter/utils.ts +++ b/deployment/scripts/evm/TokenRouter/utils.ts @@ -1,11 +1,22 @@ -import { ethers } from "ethers"; +import { BigNumber, ethers } from "ethers"; import { TokenRouterConfiguration } from "../../../config/config-types"; import { TokenRouter, TokenRouter__factory, IERC20 } from "../../../contract-bindings"; -import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, logComparison, someoneIsDifferent } from "../../../helpers"; +import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, logComparison, someoneIsDifferent, ValueDiff, BigNumberDiff, StringDiff, BooleanDiff } from "../../../helpers"; import { UniversalAddress, toUniversal } from "@wormhole-foundation/sdk-definitions"; import { Connection } from "@solana/web3.js"; import { getMatchingEngineProgram } from "../../../helpers/solana"; +export interface TokenRouterState { + cctpAllowance: BigNumberDiff; + ownerAssistant: StringDiff; + fastTransferParameters: { + enabled: BooleanDiff; + maxAmount: BigNumberDiff; + baseFee: BigNumberDiff; + initAuctionFee: BigNumberDiff; + }; +} + /** * Chain ID for the Solana wormhole chain */ @@ -83,15 +94,15 @@ export async function getOnChainTokenRouterConfiguration(chain: ChainInfo) { ownerAssistant, fastTransferParameters: { enabled, - maxAmount: maxAmount.toString(), - baseFee: baseFee.toString(), - initAuctionFee: initAuctionFee.toString() + maxAmount, + baseFee, + initAuctionFee } }; } function compareConfigurations(onChainConfig: Record, offChainConfig: Record) { - const differences = {} as Record; + const differences = {} as Record; for (const key of Object.keys(onChainConfig)) { const offChainValue = offChainConfig[key as keyof typeof offChainConfig]; @@ -103,10 +114,10 @@ function compareConfigurations(onChainConfig: Record, offChainConfi // Ignore key if it's an array if (Array.isArray(offChainValue)) continue; - + // If the values are objects, compare them - if (typeof offChainValue === 'object' && typeof onChainValue === 'object') { - differences[key] = compareConfigurations(onChainValue, offChainValue); + if (!BigNumber.isBigNumber(offChainValue) && typeof offChainValue === 'object' && typeof onChainValue === 'object') { + differences[key] = compareConfigurations(onChainValue, offChainValue) as unknown as ValueDiff; continue; } @@ -122,10 +133,20 @@ function compareConfigurations(onChainConfig: Record, offChainConfi export async function getConfigurationDifferences(chain: ChainInfo) { const onChainConfig = await getOnChainTokenRouterConfiguration(chain); const offChainConfig = await getTokenRouterConfiguration(chain); - return compareConfigurations(onChainConfig, offChainConfig); + const offChainDesiredState = { + cctpAllowance: BigNumber.from(offChainConfig.cctpAllowance), + ownerAssistant: offChainConfig.ownerAssistant, + fastTransferParameters: { + enabled: offChainConfig.fastTransferParameters.enabled, + maxAmount: BigNumber.from(offChainConfig.fastTransferParameters.maxAmount), + baseFee: BigNumber.from(offChainConfig.fastTransferParameters.baseFee), + initAuctionFee: BigNumber.from(offChainConfig.fastTransferParameters.initAuctionFee), + }, + } satisfies typeof onChainConfig; + return compareConfigurations(onChainConfig, offChainDesiredState) as unknown as TokenRouterState; } -export function logDiff(differences: Record, log: LoggerFn) { +export function logDiff(differences: TokenRouterState, log: LoggerFn) { logComparison('cctpAllowance', differences.cctpAllowance, log); const { enabled, maxAmount, baseFee, initAuctionFee } = differences.fastTransferParameters; From c1111b8b737106a1df0d94ddc9a5914f52f21c1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Tue, 30 Jul 2024 18:35:53 -0300 Subject: [PATCH 55/80] deploy: fixes token router registration script in Solana --- .../solana/registerRoutersInMatchingEngine.ts | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/deployment/scripts/solana/registerRoutersInMatchingEngine.ts b/deployment/scripts/solana/registerRoutersInMatchingEngine.ts index eb637d7b..cf952718 100644 --- a/deployment/scripts/solana/registerRoutersInMatchingEngine.ts +++ b/deployment/scripts/solana/registerRoutersInMatchingEngine.ts @@ -7,11 +7,13 @@ import { import "dotenv/config"; import { MatchingEngineProgram } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; import { solana, LoggerFn, contracts, getContractAddress } from "../../helpers"; +import { ProgramId as TokenRouterProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/tokenRouter"; import { ProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; import { SolanaLedgerSigner } from "@xlabs-xyz/ledger-signer-solana"; import { Chain, chainToPlatform, circle, toChain, toChainId } from "@wormhole-foundation/sdk-base"; import { toUniversal } from "@wormhole-foundation/sdk-definitions"; import { TokenRouterProgram } from "@wormhole-foundation/example-liquidity-layer-solana/tokenRouter"; +import { priorityMicrolamports } from "../../helpers/solana"; solana.runOnSolana("register-routers-matching-engine", async (chain, signer, log) => { @@ -27,8 +29,8 @@ solana.runOnSolana("register-routers-matching-engine", async (chain, signer, log const deployedTokenRouters = contracts['TokenRouterProxy']; for (const router of deployedTokenRouters) { - const circleDomain = circle.toCircleChainId(chain.network, router.chainId); const routerChain = toChain(router.chainId); + const circleDomain = circle.toCircleChainId(chain.network, routerChain); const routerAddress = toUniversal(routerChain, router.address); // check if it is already registered @@ -40,14 +42,16 @@ solana.runOnSolana("register-routers-matching-engine", async (chain, signer, log if (Number(router.address) === 0) throw new Error(`Invalid router address for chainId ${router.chainId}`); - const chainName = toChain(chain.chainId); - if (chain.chainId === toChainId("Solana")) { - throw new Error("not implemented"); - // await addSolanaCctpRouterEndpoint(matchingEngine, signer, tokenRouter) - } else if (chainToPlatform(chainName) === "Evm") { - await addCctpRouterEndpoint(matchingEngine, signer, chainName, circleDomain, routerAddress.toString(), null, log); + if (router.chainId === toChainId("Solana")) { + // throw new Error("not implemented"); + const tokenRouterId = router.address as TokenRouterProgramId; + const tokenRouter = new TokenRouterProgram(connection, tokenRouterId, usdcMint); + await addSolanaCctpRouterEndpoint(matchingEngine, signer, tokenRouter, log); + } else if (chainToPlatform(routerChain) === "Evm") { + await addCctpRouterEndpoint(matchingEngine, signer, routerChain, circleDomain, routerAddress.toString(), null, log); } else { - throw new Error(`Router registrations not implemented for ${chainName}`); + const operatingChain = toChain(chain.chainId); + throw new Error(`Router registrations not implemented for operating chain ${operatingChain}, target chain ${routerChain}`); } log(`Router endpoint added for chainId ${router.chainId}`); } @@ -132,7 +136,7 @@ async function addCctpRouterEndpoint( foreignMintRecipient, ); } else { - const priorityFeeIx = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 1 }); + const priorityFeeIx = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: priorityMicrolamports }); const instructions = [registerIx, priorityFeeIx] const txSig = await solana.ledgerSignAndSend(connection, instructions, []); log( @@ -189,7 +193,7 @@ async function addSolanaCctpRouterEndpoint( ownerOrAssistant: signerPubkey, tokenRouterProgram: tokenRouter.ID, }); - const priorityFeeIx = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 1 }); + const priorityFeeIx = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: priorityMicrolamports }); const instructions = [registerIx, priorityFeeIx]; const txSig = await solana.ledgerSignAndSend(connection, instructions, []); log("added local endpoint", txSig, "router", tokenRouter.ID.toString()); From 2aaa627106867952f5f878cdcf04fb4ce2711da2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Tue, 30 Jul 2024 18:37:43 -0300 Subject: [PATCH 56/80] deploy: adds mainnet deployment output --- deployment/config/mainnet/contracts.json | 55 ++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 deployment/config/mainnet/contracts.json diff --git a/deployment/config/mainnet/contracts.json b/deployment/config/mainnet/contracts.json new file mode 100644 index 00000000..ff0a98a9 --- /dev/null +++ b/deployment/config/mainnet/contracts.json @@ -0,0 +1,55 @@ +{ + "MatchingEngineProxy": [ + { "chainId": 1, "address": "HtkeCDdYY4i9ncAxXKjYTx8Uu3WM8JbtiLRYjtHwaVXb" } + ], + "TokenRouterProxy": [ + { "chainId": 1, "address": "28topqjtJzMnPaGFmmZk68tzGmj9W9aMntaEK3QkgtRe" }, + { + "chainId": 30, + "address": "0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47", + "constructorArgs": [ + "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965", + "0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000" + ] + }, + { + "chainId": 23, + "address": "0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47", + "constructorArgs": [ + "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965", + "0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000" + ] + } + ], + "UpgradeManager": [ + { "chainId": 1, "address": "4jyJ7EEsYa72REdD8ZMBvHFTXZ4VYGQPUHaJTajsK8SN" } + ], + "TokenRouterImplementation": [ + { + "chainId": 30, + "address": "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965", + "constructorArgs": [ + "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6", + "0x1682Ae6375C4E4A97e4B583BC394c861A46D8962", + 1, + "0xfafcf519890f25d6acebbc63599e3d7101b4013ed449dae26bd542cd982ddc26", + "0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6", + 5 + ] + }, + { + "chainId": 23, + "address": "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965", + "constructorArgs": [ + "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + "0xa5f208e072434bC67592E4C49C1B991BA79BCA46", + "0x19330d10D9Cc8751218eaf51E8885D058642E08A", + 1, + "0xfafcf519890f25d6acebbc63599e3d7101b4013ed449dae26bd542cd982ddc26", + "0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6", + 5 + ] + } + ] +} From b7b0a59517711b168418d032d5b4576be7757c40 Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Thu, 22 Aug 2024 10:35:18 -0300 Subject: [PATCH 57/80] Token router config hotfix --- deployment/config/mainnet/contracts.json | 6 ++++++ .../evm/TokenRouter/deploy-token-router.ts | 7 +------ .../evm/TokenRouter/upgrade-token-router.ts | 13 +++++-------- deployment/scripts/evm/TokenRouter/utils.ts | 18 +++++++++++------- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/deployment/config/mainnet/contracts.json b/deployment/config/mainnet/contracts.json index ff0a98a9..5565ec7b 100644 --- a/deployment/config/mainnet/contracts.json +++ b/deployment/config/mainnet/contracts.json @@ -2,6 +2,12 @@ "MatchingEngineProxy": [ { "chainId": 1, "address": "HtkeCDdYY4i9ncAxXKjYTx8Uu3WM8JbtiLRYjtHwaVXb" } ], + "CustodianMatchingEngine": [ + { "chainId": 1, "address": "8sLeDrpnUfSv69KXzKMKMVTpxP7D8iPue5QrHJgyu5XP" } + ], + "MatchingEngineMintRecipient": [ + { "chainId": 1, "address": "BvKLsJ3s3T6jki9XmvvZN33VRtzrKMykyqBwm9q8xTWp" } + ], "TokenRouterProxy": [ { "chainId": 1, "address": "28topqjtJzMnPaGFmmZk68tzGmj9W9aMntaEK3QkgtRe" }, { diff --git a/deployment/scripts/evm/TokenRouter/deploy-token-router.ts b/deployment/scripts/evm/TokenRouter/deploy-token-router.ts index 7ad95d37..a68a1cbf 100644 --- a/deployment/scripts/evm/TokenRouter/deploy-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/deploy-token-router.ts @@ -3,16 +3,11 @@ import { evm, getChainInfo, LoggerFn, writeDeployedContract } from "../../../hel import { TokenRouterConfiguration } from "../../../config/config-types"; import { deployImplementation, getMatchingEngineMintRecipientAddress, getTokenRouterConfiguration } from "./utils"; import { ERC1967Proxy__factory } from "../../../contract-bindings"; -import { toUniversal } from "@wormhole-foundation/sdk-definitions"; -import { Connection } from "@solana/web3.js"; -import { toChainId } from "@wormhole-foundation/sdk-base"; evm.runOnEvms("deploy-token-router", async (chain, signer, log) => { const config = await getTokenRouterConfiguration(chain); - const solanaChainInfo = getChainInfo(toChainId("Solana")); - const solanaConnection = new Connection(solanaChainInfo.rpc, solanaChainInfo.commitmentLevel || "confirmed"); - const matchingEngineMintRecipient = toUniversal("Solana", getMatchingEngineMintRecipientAddress(solanaConnection)); + const matchingEngineMintRecipient = getMatchingEngineMintRecipientAddress(); const implementation = await deployImplementation(chain, signer, config, matchingEngineMintRecipient, log); await deployProxy(signer, config, implementation, log); }); diff --git a/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts b/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts index cff39731..7f40db4c 100644 --- a/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/upgrade-token-router.ts @@ -2,18 +2,15 @@ import { evm, ChainInfo, getContractInstance, getContractAddress, getDependencyA import { deployImplementation, getMatchingEngineMintRecipientAddress, getTokenRouterConfiguration, matchingEngineChain, matchingEngineDomain } from "./utils"; import { TokenRouter } from "../../../contract-bindings"; import { UniversalAddress, toUniversal } from "@wormhole-foundation/sdk-definitions"; -import { Connection } from "@solana/web3.js"; -import { toChainId } from "@wormhole-foundation/sdk-base"; + evm.runOnEvms("upgrade-token-router", async (chain, signer, log) => { const currentImplementationAddress = getContractAddress("TokenRouterImplementation", chain.chainId); const proxyAddress = getContractAddress("TokenRouterProxy", chain.chainId); const proxy = (await getContractInstance("TokenRouter", proxyAddress, chain)) as TokenRouter; const config = await getTokenRouterConfiguration(chain); - - const solanaChainInfo = getChainInfo(toChainId("Solana")); - const solanaConnection = new Connection(solanaChainInfo.rpc, solanaChainInfo.commitmentLevel || "confirmed"); - const matchingEngineMintRecipient = toUniversal("Solana", getMatchingEngineMintRecipientAddress(solanaConnection)); + + const matchingEngineMintRecipient = getMatchingEngineMintRecipientAddress(); log(`Checking immutables for TokenRouter`); checkImmutables(proxy, chain, matchingEngineMintRecipient); @@ -25,7 +22,7 @@ evm.runOnEvms("upgrade-token-router", async (chain, signer, log) => { await proxy.upgradeContract(newImplementation.address); }); -async function checkImmutables(tokenRouter: TokenRouter, chain: ChainInfo, matchingEngineMintRecipient: UniversalAddress) { +async function checkImmutables(tokenRouter: TokenRouter, chain: ChainInfo, matchingEngineMintRecipient: string) { const [ token, savedMatchingEngineMintRecipient, @@ -44,7 +41,7 @@ async function checkImmutables(tokenRouter: TokenRouter, chain: ChainInfo, match const matchingEngineAddress = toUniversal("Solana", localMatchingEngineAddress).toString(); const tokenAddress = getDependencyAddress("token", chain); - if (savedMatchingEngineMintRecipient.toLowerCase() !== matchingEngineMintRecipient.toString().toLowerCase()) + if (savedMatchingEngineMintRecipient.toLowerCase() !== matchingEngineMintRecipient.toLowerCase()) throw new Error(`MatchingEngineMintRecipient is an immutable value and cannot be changed.`); if (savedMatchingEngineChain !== matchingEngineChain) diff --git a/deployment/scripts/evm/TokenRouter/utils.ts b/deployment/scripts/evm/TokenRouter/utils.ts index 170ca638..85077728 100644 --- a/deployment/scripts/evm/TokenRouter/utils.ts +++ b/deployment/scripts/evm/TokenRouter/utils.ts @@ -27,16 +27,20 @@ export const matchingEngineChain = 1; */ export const matchingEngineDomain = 5; -export function getMatchingEngineMintRecipientAddress(connection: Connection) { - const matchingEngine = getMatchingEngineProgram(connection); - return matchingEngine.cctpMintRecipientAddress().toBytes(); + +// TODO: move matching engine configurations from contracts.json to a separate file +export function getMatchingEngineMintRecipientAddress(): string { + return toUniversal("Solana", (getContractAddress( + "MatchingEngineMintRecipient", // i.e. Custodian feeRecipientToken + matchingEngineChain + ))).toString(); }; export function getTokenRouterConfiguration(chain: ChainInfo): Promise { return getChainConfig("token-router", chain.chainId); } -export async function deployImplementation(chain: ChainInfo, signer: ethers.Signer, config: TokenRouterConfiguration, matchingEngineMintRecipient: UniversalAddress, log: LoggerFn) { +export async function deployImplementation(chain: ChainInfo, signer: ethers.Signer, config: TokenRouterConfiguration, matchingEngineMintRecipient: string, log: LoggerFn) { if (config.chainId !== chain.chainId) { throw new Error(`Chain ID mismatch: ${config.chainId} !== ${chain.chainId}`); } @@ -46,8 +50,9 @@ export async function deployImplementation(chain: ChainInfo, signer: ethers.Sign const wormhole = getDependencyAddress("wormhole", chain); const tokenMessenger = getDependencyAddress("tokenMessenger", chain); + // this should be of the program's emitter address (custodian) const matchingEngineAddress = toUniversal("Solana", (getContractAddress( - "MatchingEngineProxy", + "CustodianMatchingEngine", matchingEngineChain ))).toString(); @@ -57,7 +62,7 @@ export async function deployImplementation(chain: ChainInfo, signer: ethers.Sign tokenMessenger, matchingEngineChain, matchingEngineAddress, - matchingEngineMintRecipient.toString(), + matchingEngineMintRecipient, matchingEngineDomain, ] as const; const overrides = {}; @@ -71,7 +76,6 @@ export async function deployImplementation(chain: ChainInfo, signer: ethers.Sign log(`TokenRouter deployed at ${deployment.address}`); - writeDeployedContract(config.chainId, "TokenRouterImplementation", deployment.address, constructorArgs); return deployment; From 11abed5517a6d4cb9ec48451195f554cf54766fd Mon Sep 17 00:00:00 2001 From: nonergodic Date: Thu, 22 Aug 2024 20:13:41 -0700 Subject: [PATCH 58/80] fix cross-registration deployment script - use mintRecipientAddress not custodian --- .../scripts/evm/TokenRouter/cross-registration-token-router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts index 7f44acbd..f583983e 100644 --- a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts @@ -49,5 +49,5 @@ function getMintRecipient(chainId: ChainId, routerAddress: string): string { const connection = new Connection(chainInfo.rpc, chainInfo.commitmentLevel || "confirmed"); const tokenRouter = getTokenRouterProgram(connection); - return toUniversal(chain, tokenRouter.custodianAddress().toBytes()).toString(); + return toUniversal(chain, tokenRouter.cctpMintRecipientAddress().toBytes()).toString(); } \ No newline at end of file From 510d7d841eabb0b5234e55f9b7a0779b86aa6708 Mon Sep 17 00:00:00 2001 From: solanoe Date: Thu, 22 Aug 2024 16:39:40 -0300 Subject: [PATCH 59/80] updates mainnet matching engine mint recipient address --- deployment/config/mainnet/contracts.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/config/mainnet/contracts.json b/deployment/config/mainnet/contracts.json index 5565ec7b..e3bafc5a 100644 --- a/deployment/config/mainnet/contracts.json +++ b/deployment/config/mainnet/contracts.json @@ -6,7 +6,7 @@ { "chainId": 1, "address": "8sLeDrpnUfSv69KXzKMKMVTpxP7D8iPue5QrHJgyu5XP" } ], "MatchingEngineMintRecipient": [ - { "chainId": 1, "address": "BvKLsJ3s3T6jki9XmvvZN33VRtzrKMykyqBwm9q8xTWp" } + { "chainId": 1, "address": "HUXc7MBf55vWrrkevVbmJN8HAyfFtjLcPLBt9yWngKzm" } ], "TokenRouterProxy": [ { "chainId": 1, "address": "28topqjtJzMnPaGFmmZk68tzGmj9W9aMntaEK3QkgtRe" }, From bb6efcc26f1c4f6c596b92b843d94725d817857a Mon Sep 17 00:00:00 2001 From: solanoe Date: Thu, 22 Aug 2024 19:06:32 -0300 Subject: [PATCH 60/80] deployment: ignor build-info files --- deployment/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/package.json b/deployment/package.json index 47150f02..6589eb11 100644 --- a/deployment/package.json +++ b/deployment/package.json @@ -2,7 +2,7 @@ "name": "deployment", "scripts": { "evm-deps": "forge build --contracts ../evm/lib/openzeppelin-contracts/contracts/proxy && forge build --config-path ../evm/foundry.toml", - "build-evm": "npm run evm-deps && npx typechain --target=ethers-v5 --out-dir=./contract-bindings ../evm/out/*/*.json", + "build-evm": "npm run evm-deps && npx typechain --target=ethers-v5 --out-dir=./contract-bindings ../evm/out/[!build-info]*/*.json", "check": "npx tsc --noEmit" }, "author": "", From 29fc5ad87315571ddafe5b636f8577833231e563 Mon Sep 17 00:00:00 2001 From: solanoe Date: Fri, 23 Aug 2024 11:18:24 -0300 Subject: [PATCH 61/80] deployment: cross-registration - get mint recipient always from solana --- .../TokenRouter/cross-registration-token-router.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts index f583983e..eeb8db11 100644 --- a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts @@ -9,12 +9,12 @@ evm.runOnEvms("cross-registration-token-router", async (chain, _, log) => { const tokenRouterAddress = getContractAddress("TokenRouterProxy", chain.chainId); const tokenRouter = (await getContractInstance("TokenRouter", tokenRouterAddress, chain)) as TokenRouter; const deployedTokenRouters = contracts['TokenRouterProxy'].filter((router) => router.chainId !== chain.chainId); - for (const router of deployedTokenRouters) { + log("Processing router for target: ", router.chainId); const circleDomain = circle.toCircleChainId(chain.network, toChain(router.chainId)); const routerChain = toChain(router.chainId); const routerAddress = toUniversal(routerChain, router.address).toString(); - const mintRecipient = getMintRecipient(chain.chainId, routerAddress); + const mintRecipient = getMintRecipient(); const endpoint = { router: routerAddress, mintRecipient @@ -38,16 +38,11 @@ evm.runOnEvms("cross-registration-token-router", async (chain, _, log) => { }); -function getMintRecipient(chainId: ChainId, routerAddress: string): string { - const platform = chainToPlatform(toChain(chainId)); - - if (platform === "Evm") - return routerAddress; - +function getMintRecipient(): string { const chain = "Solana"; const chainInfo = getChainInfo(toChainId(chain)); const connection = new Connection(chainInfo.rpc, chainInfo.commitmentLevel || "confirmed"); const tokenRouter = getTokenRouterProgram(connection); return toUniversal(chain, tokenRouter.cctpMintRecipientAddress().toBytes()).toString(); -} \ No newline at end of file +} From 3c23ee7ed4caec423bcc8e4e2c3e7ce5397f34d6 Mon Sep 17 00:00:00 2001 From: solanoe Date: Fri, 23 Aug 2024 11:19:02 -0300 Subject: [PATCH 62/80] deployment: cross-registration - update router endpoint if it already exists --- .../evm/TokenRouter/cross-registration-token-router.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts index eeb8db11..64b7b13e 100644 --- a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts @@ -25,15 +25,17 @@ evm.runOnEvms("cross-registration-token-router", async (chain, _, log) => { if (Number(router.address) === 0) throw new Error(`Invalid router address for chainId ${router.chainId}`); - + const currentMintRecipient = await tokenRouter.getMintRecipient(router.chainId); + if (Number(currentMintRecipient) !== 0) { - log(`Router endpoint already registered for chainId ${router.chainId}`); + log(`Router endpoint already registered for chainId ${router.chainId}. Updating...`); + await tokenRouter.updateRouterEndpoint(router.chainId, endpoint, circleDomain); continue; } + log(`Adding router endpoint for chainId ${router.chainId}. Endpoint: ${JSON.stringify(endpoint)}`); await tokenRouter.addRouterEndpoint(router.chainId, endpoint, circleDomain); - log(`Router endpoint added for chainId ${router.chainId}`); } }); From 2d0216c9130e644ca150a431e06fac33d6c06813 Mon Sep 17 00:00:00 2001 From: solanoe Date: Fri, 23 Aug 2024 11:33:10 -0300 Subject: [PATCH 63/80] Revert "deployment: cross-registration - get mint recipient always from solana" This reverts commit 29fc5ad87315571ddafe5b636f8577833231e563. --- .../TokenRouter/cross-registration-token-router.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts index 64b7b13e..630e283c 100644 --- a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts @@ -9,12 +9,12 @@ evm.runOnEvms("cross-registration-token-router", async (chain, _, log) => { const tokenRouterAddress = getContractAddress("TokenRouterProxy", chain.chainId); const tokenRouter = (await getContractInstance("TokenRouter", tokenRouterAddress, chain)) as TokenRouter; const deployedTokenRouters = contracts['TokenRouterProxy'].filter((router) => router.chainId !== chain.chainId); + for (const router of deployedTokenRouters) { - log("Processing router for target: ", router.chainId); const circleDomain = circle.toCircleChainId(chain.network, toChain(router.chainId)); const routerChain = toChain(router.chainId); const routerAddress = toUniversal(routerChain, router.address).toString(); - const mintRecipient = getMintRecipient(); + const mintRecipient = getMintRecipient(chain.chainId, routerAddress); const endpoint = { router: routerAddress, mintRecipient @@ -40,11 +40,16 @@ evm.runOnEvms("cross-registration-token-router", async (chain, _, log) => { }); -function getMintRecipient(): string { +function getMintRecipient(chainId: ChainId, routerAddress: string): string { + const platform = chainToPlatform(toChain(chainId)); + + if (platform === "Evm") + return routerAddress; + const chain = "Solana"; const chainInfo = getChainInfo(toChainId(chain)); const connection = new Connection(chainInfo.rpc, chainInfo.commitmentLevel || "confirmed"); const tokenRouter = getTokenRouterProgram(connection); return toUniversal(chain, tokenRouter.cctpMintRecipientAddress().toBytes()).toString(); -} +} \ No newline at end of file From c6c766ffc7a9c59d36cf0740bf84031ee9ee585a Mon Sep 17 00:00:00 2001 From: solanoe Date: Fri, 23 Aug 2024 11:37:47 -0300 Subject: [PATCH 64/80] deployment: cross-registration - get mint reecipient based on the target --- .../scripts/evm/TokenRouter/cross-registration-token-router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts index 630e283c..d11a3257 100644 --- a/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts +++ b/deployment/scripts/evm/TokenRouter/cross-registration-token-router.ts @@ -14,7 +14,7 @@ evm.runOnEvms("cross-registration-token-router", async (chain, _, log) => { const circleDomain = circle.toCircleChainId(chain.network, toChain(router.chainId)); const routerChain = toChain(router.chainId); const routerAddress = toUniversal(routerChain, router.address).toString(); - const mintRecipient = getMintRecipient(chain.chainId, routerAddress); + const mintRecipient = getMintRecipient(router.chainId as ChainId, routerAddress); const endpoint = { router: routerAddress, mintRecipient From 850a596f922d4c636a6336f50324cbc3e70c9e15 Mon Sep 17 00:00:00 2001 From: solanoe Date: Fri, 23 Aug 2024 16:25:06 -0300 Subject: [PATCH 65/80] deployment: updates mainnet addresses --- deployment/config/mainnet/contracts.json | 62 +----------------------- 1 file changed, 1 insertion(+), 61 deletions(-) diff --git a/deployment/config/mainnet/contracts.json b/deployment/config/mainnet/contracts.json index e3bafc5a..e691e0af 100644 --- a/deployment/config/mainnet/contracts.json +++ b/deployment/config/mainnet/contracts.json @@ -1,61 +1 @@ -{ - "MatchingEngineProxy": [ - { "chainId": 1, "address": "HtkeCDdYY4i9ncAxXKjYTx8Uu3WM8JbtiLRYjtHwaVXb" } - ], - "CustodianMatchingEngine": [ - { "chainId": 1, "address": "8sLeDrpnUfSv69KXzKMKMVTpxP7D8iPue5QrHJgyu5XP" } - ], - "MatchingEngineMintRecipient": [ - { "chainId": 1, "address": "HUXc7MBf55vWrrkevVbmJN8HAyfFtjLcPLBt9yWngKzm" } - ], - "TokenRouterProxy": [ - { "chainId": 1, "address": "28topqjtJzMnPaGFmmZk68tzGmj9W9aMntaEK3QkgtRe" }, - { - "chainId": 30, - "address": "0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47", - "constructorArgs": [ - "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965", - "0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000" - ] - }, - { - "chainId": 23, - "address": "0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47", - "constructorArgs": [ - "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965", - "0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000" - ] - } - ], - "UpgradeManager": [ - { "chainId": 1, "address": "4jyJ7EEsYa72REdD8ZMBvHFTXZ4VYGQPUHaJTajsK8SN" } - ], - "TokenRouterImplementation": [ - { - "chainId": 30, - "address": "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965", - "constructorArgs": [ - "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", - "0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6", - "0x1682Ae6375C4E4A97e4B583BC394c861A46D8962", - 1, - "0xfafcf519890f25d6acebbc63599e3d7101b4013ed449dae26bd542cd982ddc26", - "0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6", - 5 - ] - }, - { - "chainId": 23, - "address": "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965", - "constructorArgs": [ - "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", - "0xa5f208e072434bC67592E4C49C1B991BA79BCA46", - "0x19330d10D9Cc8751218eaf51E8885D058642E08A", - 1, - "0xfafcf519890f25d6acebbc63599e3d7101b4013ed449dae26bd542cd982ddc26", - "0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6", - 5 - ] - } - ] -} +{"MatchingEngineProxy":[{"chainId":1,"address":"HtkeCDdYY4i9ncAxXKjYTx8Uu3WM8JbtiLRYjtHwaVXb"}],"CustodianMatchingEngine":[{"chainId":1,"address":"8sLeDrpnUfSv69KXzKMKMVTpxP7D8iPue5QrHJgyu5XP"}],"MatchingEngineMintRecipient":[{"chainId":1,"address":"HUXc7MBf55vWrrkevVbmJN8HAyfFtjLcPLBt9yWngKzm"}],"TokenRouterProxy":[{"chainId":1,"address":"28topqjtJzMnPaGFmmZk68tzGmj9W9aMntaEK3QkgtRe"},{"chainId":30,"address":"0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47","constructorArgs":["0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965","0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000"]},{"chainId":23,"address":"0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47","constructorArgs":["0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965","0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000"]}],"UpgradeManager":[{"chainId":1,"address":"4jyJ7EEsYa72REdD8ZMBvHFTXZ4VYGQPUHaJTajsK8SN"}],"TokenRouterImplementation":[{"chainId":30,"address":"0xB2BCa2A79f7C99aA684A14303d368ffDbc4307e9","constructorArgs":["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6","0x1682Ae6375C4E4A97e4B583BC394c861A46D8962",1,"0x74e70ed52464f997369bbefd141d8a2d9dd3cd15e1f21b37bce18f45e0e923b2","0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6",5]},{"chainId":23,"address":"0xB2BCa2A79f7C99aA684A14303d368ffDbc4307e9","constructorArgs":["0xaf88d065e77c8cC2239327C5EDb3A432268e5831","0xa5f208e072434bC67592E4C49C1B991BA79BCA46","0x19330d10D9Cc8751218eaf51E8885D058642E08A",1,"0x74e70ed52464f997369bbefd141d8a2d9dd3cd15e1f21b37bce18f45e0e923b2","0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6",5]}]} \ No newline at end of file From 7cda36638afe3c83cba4db8d2dcbf8d3d7fa00f6 Mon Sep 17 00:00:00 2001 From: solanoe Date: Mon, 26 Aug 2024 17:25:14 -0300 Subject: [PATCH 66/80] mainnet upgrade --- deployment/config/mainnet/contracts.json | 77 +++++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/deployment/config/mainnet/contracts.json b/deployment/config/mainnet/contracts.json index e691e0af..e977ea3b 100644 --- a/deployment/config/mainnet/contracts.json +++ b/deployment/config/mainnet/contracts.json @@ -1 +1,76 @@ -{"MatchingEngineProxy":[{"chainId":1,"address":"HtkeCDdYY4i9ncAxXKjYTx8Uu3WM8JbtiLRYjtHwaVXb"}],"CustodianMatchingEngine":[{"chainId":1,"address":"8sLeDrpnUfSv69KXzKMKMVTpxP7D8iPue5QrHJgyu5XP"}],"MatchingEngineMintRecipient":[{"chainId":1,"address":"HUXc7MBf55vWrrkevVbmJN8HAyfFtjLcPLBt9yWngKzm"}],"TokenRouterProxy":[{"chainId":1,"address":"28topqjtJzMnPaGFmmZk68tzGmj9W9aMntaEK3QkgtRe"},{"chainId":30,"address":"0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47","constructorArgs":["0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965","0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000"]},{"chainId":23,"address":"0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47","constructorArgs":["0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965","0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000"]}],"UpgradeManager":[{"chainId":1,"address":"4jyJ7EEsYa72REdD8ZMBvHFTXZ4VYGQPUHaJTajsK8SN"}],"TokenRouterImplementation":[{"chainId":30,"address":"0xB2BCa2A79f7C99aA684A14303d368ffDbc4307e9","constructorArgs":["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6","0x1682Ae6375C4E4A97e4B583BC394c861A46D8962",1,"0x74e70ed52464f997369bbefd141d8a2d9dd3cd15e1f21b37bce18f45e0e923b2","0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6",5]},{"chainId":23,"address":"0xB2BCa2A79f7C99aA684A14303d368ffDbc4307e9","constructorArgs":["0xaf88d065e77c8cC2239327C5EDb3A432268e5831","0xa5f208e072434bC67592E4C49C1B991BA79BCA46","0x19330d10D9Cc8751218eaf51E8885D058642E08A",1,"0x74e70ed52464f997369bbefd141d8a2d9dd3cd15e1f21b37bce18f45e0e923b2","0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6",5]}]} \ No newline at end of file +{ + "MatchingEngineProxy": [ + { + "chainId": 1, + "address": "HtkeCDdYY4i9ncAxXKjYTx8Uu3WM8JbtiLRYjtHwaVXb" + } + ], + "CustodianMatchingEngine": [ + { + "chainId": 1, + "address": "8sLeDrpnUfSv69KXzKMKMVTpxP7D8iPue5QrHJgyu5XP" + } + ], + "MatchingEngineMintRecipient": [ + { + "chainId": 1, + "address": "HUXc7MBf55vWrrkevVbmJN8HAyfFtjLcPLBt9yWngKzm" + } + ], + "TokenRouterProxy": [ + { + "chainId": 1, + "address": "28topqjtJzMnPaGFmmZk68tzGmj9W9aMntaEK3QkgtRe" + }, + { + "chainId": 30, + "address": "0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47", + "constructorArgs": [ + "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965", + "0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000" + ] + }, + { + "chainId": 23, + "address": "0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47", + "constructorArgs": [ + "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965", + "0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000" + ] + } + ], + "UpgradeManager": [ + { + "chainId": 1, + "address": "4jyJ7EEsYa72REdD8ZMBvHFTXZ4VYGQPUHaJTajsK8SN" + } + ], + "TokenRouterImplementation": [ + { + "chainId": 30, + "address": "0xB2BCa2A79f7C99aA684A14303d368ffDbc4307e9", + "constructorArgs": [ + "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6", + "0x1682Ae6375C4E4A97e4B583BC394c861A46D8962", + 1, + "0x74e70ed52464f997369bbefd141d8a2d9dd3cd15e1f21b37bce18f45e0e923b2", + "0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6", + 5 + ] + }, + { + "chainId": 23, + "address": "0xB2BCa2A79f7C99aA684A14303d368ffDbc4307e9", + "constructorArgs": [ + "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + "0xa5f208e072434bC67592E4C49C1B991BA79BCA46", + "0x19330d10D9Cc8751218eaf51E8885D058642E08A", + 1, + "0x74e70ed52464f997369bbefd141d8a2d9dd3cd15e1f21b37bce18f45e0e923b2", + "0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6", + 5 + ] + } + ] +} \ No newline at end of file From 9f44a3b03e6ea76ea173342b702cb8a8138e0275 Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Tue, 8 Oct 2024 13:47:57 -0300 Subject: [PATCH 67/80] take matchingEngine data froms deps --- deployment/helpers/env.ts | 6 +----- deployment/helpers/solana.ts | 6 +++--- deployment/scripts/evm/TokenRouter/utils.ts | 20 ++++++++----------- .../solana/initializeMatchingEngine.ts | 4 ++-- .../solana/registerRoutersInMatchingEngine.ts | 4 ++-- 5 files changed, 16 insertions(+), 24 deletions(-) diff --git a/deployment/helpers/env.ts b/deployment/helpers/env.ts index 4f78d427..c758631b 100644 --- a/deployment/helpers/env.ts +++ b/deployment/helpers/env.ts @@ -90,7 +90,7 @@ export function getContractAddress(contractName: string, whChainId: ChainId): st return contract; } -export function getLocalDependencyAddress(dependencyName: keyof Dependencies, chain: ChainInfo): string { +export function getLocalDependencyAddress(dependencyName: string, chain: ChainInfo): string { const chainDependencies = dependencies.find((d) => d.chainId === chain.chainId); if (chainDependencies === undefined ) { @@ -102,10 +102,6 @@ export function getLocalDependencyAddress(dependencyName: keyof Dependencies, ch throw new Error(`No dependency found for ${dependencyName} for chain ${chain.chainId}`); } - if (!utils.isAddress(dependency) && !validateSolAddress(dependency)){ - throw new Error(`Invalid address for ${dependencyName} dependency found for chain ${chain.chainId}`); - } - return dependency; } diff --git a/deployment/helpers/solana.ts b/deployment/helpers/solana.ts index 31cc07ee..f39cc76b 100644 --- a/deployment/helpers/solana.ts +++ b/deployment/helpers/solana.ts @@ -7,8 +7,8 @@ import { Commitment } from "@solana/web3.js"; import { SolanaLedgerSigner } from "@xlabs-xyz/ledger-signer-solana"; -import { ecosystemChains, env, getContractAddress, getEnv } from "./env"; -import type { SolanaScriptCb } from "./interfaces"; +import { ecosystemChains, env, getContractAddress, getEnv, getLocalDependencyAddress } from "./env"; +import type { ChainInfo, SolanaScriptCb } from "./interfaces"; import { inspect } from "util"; import { circle, toChainId } from "@wormhole-foundation/sdk-base"; import { MatchingEngineProgram, ProgramId as MatchingEngineProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; @@ -96,7 +96,7 @@ async function addLedgerSignature(tx: Transaction, signer: SolanaLedgerSigner, s } export function getMatchingEngineProgram(connection: Connection) { - const matchingEngineId = getContractAddress("MatchingEngineProxy", toChainId("Solana")) as MatchingEngineProgramId; + const matchingEngineId = getLocalDependencyAddress("matchingEngineProxy", { chainId: toChainId("Solana")} as ChainInfo) as MatchingEngineProgramId; const network = env === "mainnet" ? "Mainnet" : "Testnet"; const usdcMint = new PublicKey(circle.usdcContract(network, "Solana")); diff --git a/deployment/scripts/evm/TokenRouter/utils.ts b/deployment/scripts/evm/TokenRouter/utils.ts index 85077728..d4a3e00f 100644 --- a/deployment/scripts/evm/TokenRouter/utils.ts +++ b/deployment/scripts/evm/TokenRouter/utils.ts @@ -1,10 +1,8 @@ import { BigNumber, ethers } from "ethers"; import { TokenRouterConfiguration } from "../../../config/config-types"; import { TokenRouter, TokenRouter__factory, IERC20 } from "../../../contract-bindings"; -import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, logComparison, someoneIsDifferent, ValueDiff, BigNumberDiff, StringDiff, BooleanDiff } from "../../../helpers"; -import { UniversalAddress, toUniversal } from "@wormhole-foundation/sdk-definitions"; -import { Connection } from "@solana/web3.js"; -import { getMatchingEngineProgram } from "../../../helpers/solana"; +import { ChainInfo, getChainConfig, LoggerFn, getDependencyAddress, writeDeployedContract, getContractAddress, getContractInstance, logComparison, someoneIsDifferent, ValueDiff, BigNumberDiff, StringDiff, BooleanDiff, getLocalDependencyAddress } from "../../../helpers"; +import { toUniversal } from "@wormhole-foundation/sdk-definitions"; export interface TokenRouterState { cctpAllowance: BigNumberDiff; @@ -27,12 +25,10 @@ export const matchingEngineChain = 1; */ export const matchingEngineDomain = 5; - -// TODO: move matching engine configurations from contracts.json to a separate file export function getMatchingEngineMintRecipientAddress(): string { - return toUniversal("Solana", (getContractAddress( - "MatchingEngineMintRecipient", // i.e. Custodian feeRecipientToken - matchingEngineChain + return toUniversal("Solana", (getLocalDependencyAddress( + "matchingEngineMintRecipient", // i.e. Custodian Matching Engine Mint Recipient + { chainId: matchingEngineChain } as ChainInfo ))).toString(); }; @@ -51,9 +47,9 @@ export async function deployImplementation(chain: ChainInfo, signer: ethers.Sign const tokenMessenger = getDependencyAddress("tokenMessenger", chain); // this should be of the program's emitter address (custodian) - const matchingEngineAddress = toUniversal("Solana", (getContractAddress( - "CustodianMatchingEngine", - matchingEngineChain + const matchingEngineAddress = toUniversal("Solana", (getLocalDependencyAddress( + "custodianMatchingEngine", + { chainId: matchingEngineChain } as ChainInfo ))).toString(); const constructorArgs = [ diff --git a/deployment/scripts/solana/initializeMatchingEngine.ts b/deployment/scripts/solana/initializeMatchingEngine.ts index 74d289ed..042af75e 100644 --- a/deployment/scripts/solana/initializeMatchingEngine.ts +++ b/deployment/scripts/solana/initializeMatchingEngine.ts @@ -7,7 +7,7 @@ import { import "dotenv/config"; import { uint64ToBN } from "@wormhole-foundation/example-liquidity-layer-solana/common"; import { AuctionParameters, MatchingEngineProgram } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; -import { solana, LoggerFn, getChainConfig, getContractAddress } from "../../helpers"; +import { solana, LoggerFn, getChainConfig, getContractAddress, getLocalDependencyAddress } from "../../helpers"; import { MatchingEngineConfiguration } from "../../config/config-types"; import { ProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; import { SolanaLedgerSigner } from "@xlabs-xyz/ledger-signer-solana"; @@ -15,7 +15,7 @@ import { circle } from "@wormhole-foundation/sdk-base"; solana.runOnSolana("deploy-matching-engine", async (chain, signer, log) => { const config = await getChainConfig("matching-engine", chain.chainId); - const matchingEngineId = getContractAddress("MatchingEngineProxy", chain.chainId) as ProgramId; + const matchingEngineId = getLocalDependencyAddress("MatchingEngineProxy", chain) as ProgramId; const env = "Mainnet"; const usdcMint = new PublicKey(circle.usdcContract(env, "Solana")); diff --git a/deployment/scripts/solana/registerRoutersInMatchingEngine.ts b/deployment/scripts/solana/registerRoutersInMatchingEngine.ts index cf952718..917c0548 100644 --- a/deployment/scripts/solana/registerRoutersInMatchingEngine.ts +++ b/deployment/scripts/solana/registerRoutersInMatchingEngine.ts @@ -6,7 +6,7 @@ import { } from "@solana/web3.js"; import "dotenv/config"; import { MatchingEngineProgram } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; -import { solana, LoggerFn, contracts, getContractAddress } from "../../helpers"; +import { solana, LoggerFn, contracts, getLocalDependencyAddress } from "../../helpers"; import { ProgramId as TokenRouterProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/tokenRouter"; import { ProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; import { SolanaLedgerSigner } from "@xlabs-xyz/ledger-signer-solana"; @@ -17,7 +17,7 @@ import { priorityMicrolamports } from "../../helpers/solana"; solana.runOnSolana("register-routers-matching-engine", async (chain, signer, log) => { - const matchingEngineId = getContractAddress("MatchingEngineProxy", chain.chainId) as ProgramId; + const matchingEngineId = getLocalDependencyAddress("MatchingEngineProxy", chain) as ProgramId; if (chain.network === "Devnet") throw new Error("Devnet is not supported by USDC. Use Mainnet or Testnet."); From f1e8653cf8309846648e6338f816dc7625aacb65 Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Tue, 8 Oct 2024 13:49:08 -0300 Subject: [PATCH 68/80] add config for new evm chains --- deployment/config/mainnet/contracts.json | 18 --------- deployment/config/mainnet/dependencies.json | 30 ++++++++++++++ deployment/config/mainnet/ecosystem.json | 30 +++++++++++++- deployment/config/mainnet/token-router.json | 44 +++++++++++++++++++++ 4 files changed, 103 insertions(+), 19 deletions(-) diff --git a/deployment/config/mainnet/contracts.json b/deployment/config/mainnet/contracts.json index e977ea3b..a1377e45 100644 --- a/deployment/config/mainnet/contracts.json +++ b/deployment/config/mainnet/contracts.json @@ -1,22 +1,4 @@ { - "MatchingEngineProxy": [ - { - "chainId": 1, - "address": "HtkeCDdYY4i9ncAxXKjYTx8Uu3WM8JbtiLRYjtHwaVXb" - } - ], - "CustodianMatchingEngine": [ - { - "chainId": 1, - "address": "8sLeDrpnUfSv69KXzKMKMVTpxP7D8iPue5QrHJgyu5XP" - } - ], - "MatchingEngineMintRecipient": [ - { - "chainId": 1, - "address": "HUXc7MBf55vWrrkevVbmJN8HAyfFtjLcPLBt9yWngKzm" - } - ], "TokenRouterProxy": [ { "chainId": 1, diff --git a/deployment/config/mainnet/dependencies.json b/deployment/config/mainnet/dependencies.json index eefb9ab6..518cfa9c 100644 --- a/deployment/config/mainnet/dependencies.json +++ b/deployment/config/mainnet/dependencies.json @@ -1,10 +1,40 @@ [ + { + "chainId": 1, + "matchingEngineProxy": "HtkeCDdYY4i9ncAxXKjYTx8Uu3WM8JbtiLRYjtHwaVXb", + "custodianMatchingEngine": "8sLeDrpnUfSv69KXzKMKMVTpxP7D8iPue5QrHJgyu5XP", + "matchingEngineMintRecipient": "HUXc7MBf55vWrrkevVbmJN8HAyfFtjLcPLBt9yWngKzm" + }, + { + "chainId": 2, + "wormhole": "0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B", + "token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + "tokenMessenger": "0xBd3fa81B58Ba92a82136038B25aDec7066af3155" + }, + { + "chainId": 5, + "wormhole": "0x7A4B5a56256163F07b2C80A7cA55aBE66c4ec4d7", + "token": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359", + "tokenMessenger": "0x9daF8c91AEFAE50b9c0E69629D3F6Ca40cA3B3FE" + }, + { + "chainId": 6, + "wormhole": "0x54a8e5f9c4CbA08F9943965859F6c34eAF03E26c", + "token": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + "tokenMessenger": "0x6B25532e1060CE10cc3B0A99e5683b91BFDe6982" + }, { "chainId": 23, "wormhole": "0xa5f208e072434bC67592E4C49C1B991BA79BCA46", "token": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", "tokenMessenger": "0x19330d10D9Cc8751218eaf51E8885D058642E08A" }, + { + "chainId": 24, + "wormhole": "0xEe91C335eab126dF5fDB3797EA9d6aD93aeC9722", + "token": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85", + "tokenMessenger": "0x2B4069517957735bE00ceE0fadAE88a26365528f" + }, { "chainId": 30, "wormhole": "0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6", diff --git a/deployment/config/mainnet/ecosystem.json b/deployment/config/mainnet/ecosystem.json index 9d27720e..bba3fdd4 100644 --- a/deployment/config/mainnet/ecosystem.json +++ b/deployment/config/mainnet/ecosystem.json @@ -1,7 +1,28 @@ { - "operatingChains": [1, 23, 30], + "operatingChains": [2, 5, 6, 24], "evm": { "networks": [ + { + "name": "Ethereum", + "network": "Mainnet", + "externalId": "1", + "chainId": 2, + "rpc": "https://rpc.ankr.com/eth" + }, + { + "name": "Polygon", + "network": "Mainnet", + "externalId": "137", + "chainId": 5, + "rpc": "https://rpc.ankr.com/polygon" + }, + { + "name": "Avalanche", + "network": "Mainnet", + "externalId": "43114", + "chainId": 6, + "rpc": "https://rpc.ankr.com/avalanche" + }, { "name": "Arbitrum", "network": "Mainnet", @@ -9,6 +30,13 @@ "chainId": 23, "rpc": "https://rpc.ankr.com/arbitrum" }, + { + "name": "Optimism", + "network": "Mainnet", + "externalId": "10", + "chainId": 24, + "rpc": "https://rpc.ankr.com/optimism" + }, { "name": "Base", "network": "Mainnet", diff --git a/deployment/config/mainnet/token-router.json b/deployment/config/mainnet/token-router.json index 444ae3d9..0ff350ad 100644 --- a/deployment/config/mainnet/token-router.json +++ b/deployment/config/mainnet/token-router.json @@ -10,6 +10,39 @@ }, "cctpAllowance": "18446744073709551615" }, + { + "chainId": 2, + "ownerAssistant": "0x420E8AA32c31626F7F31D6fcC154eeccd6E6e9cB", + "fastTransferParameters": { + "enabled": true, + "maxAmount": "1000000000", + "baseFee": "1250000", + "initAuctionFee": "950000" + }, + "cctpAllowance": "115792089237316195423570985008687907853269984665640564039457584007913129639935" + }, + { + "chainId": 5, + "ownerAssistant": "0x420E8AA32c31626F7F31D6fcC154eeccd6E6e9cB", + "fastTransferParameters": { + "enabled": true, + "maxAmount": "1000000000", + "baseFee": "1250000", + "initAuctionFee": "950000" + }, + "cctpAllowance": "115792089237316195423570985008687907853269984665640564039457584007913129639935" + }, + { + "chainId": 6, + "ownerAssistant": "0x420E8AA32c31626F7F31D6fcC154eeccd6E6e9cB", + "fastTransferParameters": { + "enabled": true, + "maxAmount": "1000000000", + "baseFee": "1250000", + "initAuctionFee": "950000" + }, + "cctpAllowance": "115792089237316195423570985008687907853269984665640564039457584007913129639935" + }, { "chainId": 23, "ownerAssistant": "0x420E8AA32c31626F7F31D6fcC154eeccd6E6e9cB", @@ -21,6 +54,17 @@ }, "cctpAllowance": "115792089237316195423570985008687907853269984665640564039457584007913129639935" }, + { + "chainId": 24, + "ownerAssistant": "0x420E8AA32c31626F7F31D6fcC154eeccd6E6e9cB", + "fastTransferParameters": { + "enabled": true, + "maxAmount": "1000000000", + "baseFee": "1250000", + "initAuctionFee": "950000" + }, + "cctpAllowance": "115792089237316195423570985008687907853269984665640564039457584007913129639935" + }, { "chainId": 30, "ownerAssistant": "0x420E8AA32c31626F7F31D6fcC154eeccd6E6e9cB", From 6f40011a637eaae3ff7b4fb238b31d0d7036ffef Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Fri, 18 Oct 2024 12:39:55 -0300 Subject: [PATCH 69/80] add solana upgradeMainnet script --- solana/ts/scripts/upgradeMainnet.ts | 139 ++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 solana/ts/scripts/upgradeMainnet.ts diff --git a/solana/ts/scripts/upgradeMainnet.ts b/solana/ts/scripts/upgradeMainnet.ts new file mode 100644 index 00000000..2a9b3081 --- /dev/null +++ b/solana/ts/scripts/upgradeMainnet.ts @@ -0,0 +1,139 @@ +import { + Connection, + Keypair, + PublicKey, + Transaction, + sendAndConfirmTransaction, +} from "@solana/web3.js"; +import "dotenv/config"; +import { UpgradeManagerProgram } from "../src/upgradeManager"; + +const UPGRADE_MANAGER_ID = "4jyJ7EEsYa72REdD8ZMBvHFTXZ4VYGQPUHaJTajsK8SN"; + +// Here we go. +main(); + +// impl + +async function main() { + const connection = new Connection("https://api.mainnet.solana.com", "confirmed"); + const upgradeManager = new UpgradeManagerProgram(connection, UPGRADE_MANAGER_ID); + + if (process.env.SOLANA_PRIVATE_KEY === undefined) { + throw new Error("SOLANA_PRIVATE_KEY is undefined"); + } + const payer = Keypair.fromSecretKey(Buffer.from(process.env.SOLANA_PRIVATE_KEY, "base64")); + + // TODO: update the buffer addresses + // { + // const buffer = new PublicKey("7Ug82c9aZDCNBpjyBsYyZWuBFnphM2K3tSJmYQw6Huev"); + // await upgradeMatchingEngine(upgradeManager, payer, buffer); + // } + + // { + // const buffer = new PublicKey("2ZKYhV56iaFpHQsdGc2TXdnomVCf3KytCb8ZnjxnLBPN"); + // await upgradeTokenRouter(upgradeManager, payer, buffer); + // } +} + +async function upgradeMatchingEngine( + upgradeManager: UpgradeManagerProgram, + owner: Keypair, + matchingEngineBuffer: PublicKey, +) { + const connection = upgradeManager.program.provider.connection; + + const accInfo = await connection.getAccountInfo(matchingEngineBuffer, { + dataSlice: { offset: 0, length: 8 }, + }); + if (accInfo === null) { + throw new Error("no buffer found"); + } + + const executeIx = await upgradeManager.executeMatchingEngineUpgradeIx({ + owner: owner.publicKey, + matchingEngineBuffer, + }); + + const executeTxSig = await sendAndConfirmTransaction( + connection, + new Transaction().add(executeIx), + [owner], + { + commitment: "finalized", + }, + ).catch((err) => { + console.log(err); + throw err; + }); + console.log("executed upgrade", executeTxSig); + + const commitIx = await upgradeManager.commitMatchingEngineUpgradeIx({ + owner: owner.publicKey, + }); + + let commitTxSig: string | null = null; + while (commitTxSig === null) { + console.log("attempting to commit..."); + await new Promise((r) => setTimeout(r, 2000)); + + commitTxSig = await sendAndConfirmTransaction(connection, new Transaction().add(commitIx), [ + owner, + ]).catch((err) => { + console.log(err); + return null; + }); + } + console.log("committed upgrade", commitTxSig); +} + +async function upgradeTokenRouter( + upgradeManager: UpgradeManagerProgram, + owner: Keypair, + tokenRouterBuffer: PublicKey, +) { + const connection = upgradeManager.program.provider.connection; + + const accInfo = await connection.getAccountInfo(tokenRouterBuffer, { + dataSlice: { offset: 0, length: 8 }, + }); + if (accInfo === null) { + throw new Error("no buffer found"); + } + + const executeIx = await upgradeManager.executeTokenRouterUpgradeIx({ + owner: owner.publicKey, + tokenRouterBuffer, + }); + + const executeTxSig = await sendAndConfirmTransaction( + connection, + new Transaction().add(executeIx), + [owner], + { + commitment: "finalized", + }, + ).catch((err) => { + console.log(err); + throw err; + }); + console.log("executed upgrade", executeTxSig); + + const commitIx = await upgradeManager.commitTokenRouterUpgradeIx({ + owner: owner.publicKey, + }); + + let commitTxSig: string | null = null; + while (commitTxSig === null) { + console.log("attempting to commit..."); + await new Promise((r) => setTimeout(r, 2000)); + + commitTxSig = await sendAndConfirmTransaction(connection, new Transaction().add(commitIx), [ + owner, + ]).catch((err) => { + console.log(err); + return null; + }); + } + console.log("committed upgrade", commitTxSig); +} From 9160e40b5a0a908117ff2361fc599a2a514915d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Fri, 18 Oct 2024 15:06:09 -0300 Subject: [PATCH 70/80] deployment: pins `@solana/web3.js` to match the rest of the workspaces --- deployment/package-lock.json | 41 +++++++++++++++++++----------------- deployment/package.json | 2 +- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/deployment/package-lock.json b/deployment/package-lock.json index d03bd1aa..a71e476f 100644 --- a/deployment/package-lock.json +++ b/deployment/package-lock.json @@ -11,7 +11,7 @@ "devDependencies": { "@coral-xyz/anchor": "^0.30.1", "@inquirer/confirm": "^3.1.9", - "@solana/web3.js": "^1.92.2", + "@solana/web3.js": "1.95.3", "@typechain/ethers-v5": "^11.1.2", "@types/node": "^20.11.22", "@wormhole-foundation/example-liquidity-layer-solana": "file:../solana", @@ -33,21 +33,21 @@ "dev": true, "dependencies": { "@certusone/wormhole-spydk": "^0.0.1", - "@coral-xyz/anchor": "^0.30.0", - "@solana/spl-token": "^0.4.6", - "@solana/spl-token-group": "^0.0.4", - "@solana/spl-token-metadata": "^0.1.4", - "@solana/web3.js": "^1.91.7", + "@coral-xyz/anchor": "^0.30.1", + "@solana/spl-token": "^0.4.8", + "@solana/spl-token-group": "^0.0.6", + "@solana/spl-token-metadata": "^0.1.5", + "@solana/web3.js": "^1.95.3", "@types/node-fetch": "^2.6.11", "@wormhole-foundation/example-liquidity-layer-definitions": "0.0.1", - "@wormhole-foundation/sdk-base": "^0.7.0-beta.6", - "@wormhole-foundation/sdk-definitions": "^0.7.0-beta.6", - "@wormhole-foundation/sdk-solana": "^0.7.0-beta.6", - "@wormhole-foundation/sdk-solana-core": "^0.7.0-beta.6", + "@wormhole-foundation/sdk-base": "^0.10.9", + "@wormhole-foundation/sdk-definitions": "^0.10.9", + "@wormhole-foundation/sdk-evm": "^0.10.9", + "@wormhole-foundation/sdk-solana": "^0.10.9", + "@wormhole-foundation/sdk-solana-core": "^0.10.9", "anchor-0.29.0": "npm:@coral-xyz/anchor@^0.29.0", "bn.js": "^5.2.1", "dotenv": "^16.4.1", - "ethers": "^5.7.2", "sha3": "^2.1.4", "winston": "^3.13.0", "yargs": "^17.7.2" @@ -67,9 +67,10 @@ } }, "node_modules/@babel/runtime": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.8.tgz", - "integrity": "sha512-5F7SDGs1T72ZczbRwbGO9lQi0NLjQxzl6i4lJxLxfW9U5UluCSyEJeniWvnhl3/euNiqQVbo8zruhsDfid0esA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.7.tgz", + "integrity": "sha512-FjoyLe754PMiYsFaN5C94ttGiOmBNYTf6pLr4xXHAT5uctHb092PBszndLDR5XA/jghQvn4n7JMHl7dmTgbm9w==", + "license": "MIT", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -1771,11 +1772,12 @@ } }, "node_modules/@solana/web3.js": { - "version": "1.95.1", - "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.95.1.tgz", - "integrity": "sha512-mRX/AjV6QbiOXpWcy5Rz1ZWEH2lVkwO7T0pcv9t97ACpv3/i3tPiqXwk0JIZgSR3wOSTiT26JfygnJH2ulS6dQ==", + "version": "1.95.3", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.95.3.tgz", + "integrity": "sha512-O6rPUN0w2fkNqx/Z3QJMB9L225Ex10PRDH8bTaIUPZXMPV0QP8ZpPvjQnXK+upUczlRgzHzd6SjKIha1p+I6og==", + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.24.8", + "@babel/runtime": "^7.25.0", "@noble/curves": "^1.4.2", "@noble/hashes": "^1.4.0", "@solana/buffer-layout": "^4.0.1", @@ -3501,7 +3503,8 @@ "node_modules/regenerator-runtime": { "version": "0.14.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "license": "MIT" }, "node_modules/resolve-pkg-maps": { "version": "1.0.0", diff --git a/deployment/package.json b/deployment/package.json index 6589eb11..be58c181 100644 --- a/deployment/package.json +++ b/deployment/package.json @@ -9,7 +9,7 @@ "devDependencies": { "@coral-xyz/anchor": "^0.30.1", "@inquirer/confirm": "^3.1.9", - "@solana/web3.js": "^1.92.2", + "@solana/web3.js": "1.95.3", "@typechain/ethers-v5": "^11.1.2", "@types/node": "^20.11.22", "@wormhole-foundation/example-liquidity-layer-solana": "file:../solana", From 6d7c26c2307c2f63b57c071c07139b11e795523d Mon Sep 17 00:00:00 2001 From: solanoe Date: Fri, 18 Oct 2024 15:26:44 -0300 Subject: [PATCH 71/80] adds solana upgrade scripts --- .../scripts/solana/upgrade-matching-engine.ts | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 deployment/scripts/solana/upgrade-matching-engine.ts diff --git a/deployment/scripts/solana/upgrade-matching-engine.ts b/deployment/scripts/solana/upgrade-matching-engine.ts new file mode 100644 index 00000000..ef154fc3 --- /dev/null +++ b/deployment/scripts/solana/upgrade-matching-engine.ts @@ -0,0 +1,44 @@ +import { Connection, PublicKey } from "@solana/web3.js"; +import "dotenv/config"; +import { + UpgradeManagerProgram, + ProgramId as UpgradeManagerProgramId, +} from "@wormhole-foundation/example-liquidity-layer-solana/upgradeManager"; + +import { + solana, + getContractAddress, + getEnv, +} from "../../helpers"; + +solana.runOnSolana("upgrade-matching-engine", async (chain, signer, log) => { + const connection = new Connection(chain.rpc, solana.connectionCommitmentLevel); + const upgradeManagerProgramId = getContractAddress( + "UpgradeManager", + chain.chainId, + ) as UpgradeManagerProgramId; + + const upgradeManager = new UpgradeManagerProgram(connection, upgradeManagerProgramId); + + const buffer = new PublicKey(getEnv("MATCHING_ENGINE_UPGRADE_BUFFER_ACCOUNT")); + + await checkBufferExists(buffer, connection); + + const upgradeIx = await upgradeManager.executeMatchingEngineUpgradeIx({ + owner: new PublicKey(await signer.getAddress()), + matchingEngineBuffer: buffer, + }); + + const txId = await solana.ledgerSignAndSend(connection, [upgradeIx], []); + log(`Succesfully upgraded on tx -> ${txId}`); +}); + +async function checkBufferExists(buffer: PublicKey, connection: Connection) { + const accInfo = await connection.getAccountInfo(buffer, { + dataSlice: { offset: 0, length: 8 }, + }); + + if (accInfo === null) { + throw new Error(`Buffer at ${buffer.toString()} not found`); + } +} From d80fbfd24a87906f19b37b8bd6896005b657b65c Mon Sep 17 00:00:00 2001 From: solanoe Date: Fri, 18 Oct 2024 15:27:06 -0300 Subject: [PATCH 72/80] solana upgrade token router script --- .../scripts/solana/upgrade-token-router.ts | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 deployment/scripts/solana/upgrade-token-router.ts diff --git a/deployment/scripts/solana/upgrade-token-router.ts b/deployment/scripts/solana/upgrade-token-router.ts new file mode 100644 index 00000000..769d7608 --- /dev/null +++ b/deployment/scripts/solana/upgrade-token-router.ts @@ -0,0 +1,45 @@ +import { Connection, PublicKey } from "@solana/web3.js"; +import "dotenv/config"; +import { + UpgradeManagerProgram, + ProgramId as UpgradeManagerProgramId, +} from "@wormhole-foundation/example-liquidity-layer-solana/upgradeManager"; + +import { + solana, + getContractAddress, + getEnv, +} from "../../helpers"; + +solana.runOnSolana("upgrade-token-router", async (chain, signer, log) => { + const connection = new Connection(chain.rpc, solana.connectionCommitmentLevel); + const upgradeManagerProgramId = getContractAddress( + "UpgradeManager", + chain.chainId, + ) as UpgradeManagerProgramId; + const a = new PublicKey(await signer.getAddress()); + + const upgradeManager = new UpgradeManagerProgram(connection, upgradeManagerProgramId); + + const buffer = new PublicKey(getEnv("TOKEN_ROUTER_UPGRADE_BUFFER_ACCOUNT")); + + await checkBufferExists(buffer, connection); + + const upgradeIx = await upgradeManager.executeTokenRouterUpgradeIx({ + owner: new PublicKey((await signer.getAddress()).toString()), + tokenRouterBuffer: buffer, + }); + + const txId = await solana.ledgerSignAndSend(connection, [upgradeIx], []); + log(`Succesfully upgraded on tx -> ${txId}`); +}); + +async function checkBufferExists(buffer: PublicKey, connection: Connection) { + const accInfo = await connection.getAccountInfo(buffer, { + dataSlice: { offset: 0, length: 8 }, + }); + + if (accInfo === null) { + throw new Error(`Buffer at ${buffer.toString()} not found`); + } +} From c65512ed1dd893c77e3b2a5000365be3aa166891 Mon Sep 17 00:00:00 2001 From: solanoe Date: Fri, 18 Oct 2024 17:56:55 -0300 Subject: [PATCH 73/80] Deployed to new chains: 2, 5, 6, 24 --- deployment/config/mainnet/contracts.json | 84 ++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/deployment/config/mainnet/contracts.json b/deployment/config/mainnet/contracts.json index a1377e45..504b16dc 100644 --- a/deployment/config/mainnet/contracts.json +++ b/deployment/config/mainnet/contracts.json @@ -19,6 +19,38 @@ "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965", "0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000" ] + }, + { + "chainId": 24, + "address": "0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47", + "constructorArgs": [ + "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965", + "0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000" + ] + }, + { + "chainId": 6, + "address": "0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47", + "constructorArgs": [ + "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965", + "0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000" + ] + }, + { + "chainId": 2, + "address": "0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47", + "constructorArgs": [ + "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965", + "0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000" + ] + }, + { + "chainId": 5, + "address": "0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47", + "constructorArgs": [ + "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965", + "0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000" + ] } ], "UpgradeManager": [ @@ -53,6 +85,58 @@ "0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6", 5 ] + }, + { + "chainId": 2, + "address": "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965", + "constructorArgs": [ + "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + "0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B", + "0xBd3fa81B58Ba92a82136038B25aDec7066af3155", + 1, + "0x74e70ed52464f997369bbefd141d8a2d9dd3cd15e1f21b37bce18f45e0e923b2", + "0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6", + 5 + ] + }, + { + "chainId": 6, + "address": "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965", + "constructorArgs": [ + "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + "0x54a8e5f9c4CbA08F9943965859F6c34eAF03E26c", + "0x6B25532e1060CE10cc3B0A99e5683b91BFDe6982", + 1, + "0x74e70ed52464f997369bbefd141d8a2d9dd3cd15e1f21b37bce18f45e0e923b2", + "0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6", + 5 + ] + }, + { + "chainId": 24, + "address": "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965", + "constructorArgs": [ + "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85", + "0xEe91C335eab126dF5fDB3797EA9d6aD93aeC9722", + "0x2B4069517957735bE00ceE0fadAE88a26365528f", + 1, + "0x74e70ed52464f997369bbefd141d8a2d9dd3cd15e1f21b37bce18f45e0e923b2", + "0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6", + 5 + ] + }, + { + "chainId": 5, + "address": "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965", + "constructorArgs": [ + "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359", + "0x7A4B5a56256163F07b2C80A7cA55aBE66c4ec4d7", + "0x9daF8c91AEFAE50b9c0E69629D3F6Ca40cA3B3FE", + 1, + "0x74e70ed52464f997369bbefd141d8a2d9dd3cd15e1f21b37bce18f45e0e923b2", + "0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6", + 5 + ] } ] } \ No newline at end of file From 4505cb617017296850fa159e85d4554f79b78d2f Mon Sep 17 00:00:00 2001 From: solanoe Date: Fri, 18 Oct 2024 17:57:22 -0300 Subject: [PATCH 74/80] minor fixes to solana deployment/upgrade scripts --- deployment/helpers/solana.ts | 2 +- deployment/scripts/solana/registerRoutersInMatchingEngine.ts | 2 +- deployment/scripts/solana/upgrade-matching-engine.ts | 2 +- deployment/scripts/solana/upgrade-token-router.ts | 5 ++--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/deployment/helpers/solana.ts b/deployment/helpers/solana.ts index f39cc76b..96020c32 100644 --- a/deployment/helpers/solana.ts +++ b/deployment/helpers/solana.ts @@ -15,7 +15,7 @@ import { MatchingEngineProgram, ProgramId as MatchingEngineProgramId } from "@wo import { TokenRouterProgram, ProgramId as TokenRouterProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/tokenRouter"; export const connectionCommitmentLevel = (process.env.SOLANA_COMMITMENT || "confirmed") as Commitment; -export const priorityMicrolamports = process.env.PRIORITY_MICROLAMPORTS !== "undefined" ? Number(process.env.PRIORITY_MICROLAMPORTS) : 1; +export const priorityMicrolamports = process.env.PRIORITY_MICROLAMPORTS !== undefined? Number(process.env.PRIORITY_MICROLAMPORTS) : 1; export function validateSolAddress(address: string){ try { diff --git a/deployment/scripts/solana/registerRoutersInMatchingEngine.ts b/deployment/scripts/solana/registerRoutersInMatchingEngine.ts index 917c0548..1883113f 100644 --- a/deployment/scripts/solana/registerRoutersInMatchingEngine.ts +++ b/deployment/scripts/solana/registerRoutersInMatchingEngine.ts @@ -17,7 +17,7 @@ import { priorityMicrolamports } from "../../helpers/solana"; solana.runOnSolana("register-routers-matching-engine", async (chain, signer, log) => { - const matchingEngineId = getLocalDependencyAddress("MatchingEngineProxy", chain) as ProgramId; + const matchingEngineId = getLocalDependencyAddress("matchingEngineProxy", chain) as ProgramId; if (chain.network === "Devnet") throw new Error("Devnet is not supported by USDC. Use Mainnet or Testnet."); diff --git a/deployment/scripts/solana/upgrade-matching-engine.ts b/deployment/scripts/solana/upgrade-matching-engine.ts index ef154fc3..ed076cee 100644 --- a/deployment/scripts/solana/upgrade-matching-engine.ts +++ b/deployment/scripts/solana/upgrade-matching-engine.ts @@ -20,7 +20,7 @@ solana.runOnSolana("upgrade-matching-engine", async (chain, signer, log) => { const upgradeManager = new UpgradeManagerProgram(connection, upgradeManagerProgramId); - const buffer = new PublicKey(getEnv("MATCHING_ENGINE_UPGRADE_BUFFER_ACCOUNT")); + const buffer = new PublicKey(getEnv("MATCHING_ENGINE_BUFFER_ACCOUNT")); await checkBufferExists(buffer, connection); diff --git a/deployment/scripts/solana/upgrade-token-router.ts b/deployment/scripts/solana/upgrade-token-router.ts index 769d7608..054f81ac 100644 --- a/deployment/scripts/solana/upgrade-token-router.ts +++ b/deployment/scripts/solana/upgrade-token-router.ts @@ -17,16 +17,15 @@ solana.runOnSolana("upgrade-token-router", async (chain, signer, log) => { "UpgradeManager", chain.chainId, ) as UpgradeManagerProgramId; - const a = new PublicKey(await signer.getAddress()); const upgradeManager = new UpgradeManagerProgram(connection, upgradeManagerProgramId); - const buffer = new PublicKey(getEnv("TOKEN_ROUTER_UPGRADE_BUFFER_ACCOUNT")); + const buffer = new PublicKey(getEnv("TOKEN_ROUTER_BUFFER_ACCOUNT")); await checkBufferExists(buffer, connection); const upgradeIx = await upgradeManager.executeTokenRouterUpgradeIx({ - owner: new PublicKey((await signer.getAddress()).toString()), + owner: new PublicKey(await signer.getAddress()), tokenRouterBuffer: buffer, }); From bf66561da2fbee1ee8fd28f4a855b10de2ab883c Mon Sep 17 00:00:00 2001 From: hernandp Date: Wed, 8 Jan 2025 18:02:08 -0300 Subject: [PATCH 75/80] updateAuctionParameters script + small fixes. --- deployment/config/mainnet/ecosystem.json | 2 +- .../config/mainnet/matching-engine.json | 4 +- deployment/helpers/env.ts | 28 ++++++- deployment/helpers/solana.ts | 5 ++ .../scripts/solana/updateAuctionParameters.ts | 78 +++++++++++++++++++ 5 files changed, 113 insertions(+), 4 deletions(-) create mode 100644 deployment/scripts/solana/updateAuctionParameters.ts diff --git a/deployment/config/mainnet/ecosystem.json b/deployment/config/mainnet/ecosystem.json index bba3fdd4..4938b455 100644 --- a/deployment/config/mainnet/ecosystem.json +++ b/deployment/config/mainnet/ecosystem.json @@ -1,5 +1,5 @@ { - "operatingChains": [2, 5, 6, 24], + "operatingChains": [1], "evm": { "networks": [ { diff --git a/deployment/config/mainnet/matching-engine.json b/deployment/config/mainnet/matching-engine.json index b32b8bb0..4ea472c4 100644 --- a/deployment/config/mainnet/matching-engine.json +++ b/deployment/config/mainnet/matching-engine.json @@ -5,9 +5,9 @@ "feeRecipient": "AdAVF5KmmGmpNQhjY7FL96wZLEynD6Mx3VXJTZf2yFps", "userPenaltyRewardBps": "100", "initialPenaltyBps": "100", - "auctionDuration": "20", + "auctionDuration": "10", "auctionGracePeriod": "20", - "auctionPenaltySlots": "5", + "auctionPenaltySlots": "20", "minOfferDeltaBps": "50000", "securityDepositBase": "1000000", "securityDepositBps": "1000", diff --git a/deployment/helpers/env.ts b/deployment/helpers/env.ts index c758631b..aad24447 100644 --- a/deployment/helpers/env.ts +++ b/deployment/helpers/env.ts @@ -7,12 +7,16 @@ import { getSigner } from "./evm"; import 'dotenv/config'; import { ChainId, Token, contracts as connectDependencies, toChain } from "@wormhole-foundation/sdk-base"; import { getTokensBySymbol } from "@wormhole-foundation/sdk-base/tokens"; +import { MatchingEngineConfiguration } from "../config/config-types"; +import { AuctionParameters } from "../../solana/ts/src/matchingEngine/state/AuctionConfig"; +import { BN } from "@coral-xyz/anchor"; export const env = getEnv("ENV"); export const contracts = loadContracts(); export const dependencies = loadDependencies(); export const ecosystemChains = loadEcosystem(); export const verificationApiKeys = loadVerificationApiKeys(); +export const matchingEngineParameters = loadMatchingEngineParameters(); function loadJson(filename: string): T { const fileContent = fs.readFileSync( @@ -38,6 +42,10 @@ function loadVerificationApiKeys() { return loadJson("verification-api-keys"); } +function loadMatchingEngineParameters(): MatchingEngineConfiguration[] { + return loadJson("matching-engine"); +} + export function getEnv(env: string): string { const v = process.env[env]; if (!v) { @@ -88,8 +96,8 @@ export function getContractAddress(contractName: string, whChainId: ChainId): st } return contract; + } - export function getLocalDependencyAddress(dependencyName: string, chain: ChainInfo): string { const chainDependencies = dependencies.find((d) => d.chainId === chain.chainId); @@ -154,6 +162,24 @@ export function getDeploymentArgs(contractName: string, whChainId: ChainId): Unc return constructorArgs; } +export function getMatchingEngineAuctionParameters(chain: ChainInfo): AuctionParameters { + const engineParameters = matchingEngineParameters.find((x) => x.chainId === chain.chainId); + if (engineParameters === undefined) { + throw Error(`Failed to find matching engine parameters for chain ${chain.chainId}`); + } + + return { + userPenaltyRewardBps: Number(engineParameters.userPenaltyRewardBps), + initialPenaltyBps: Number(engineParameters.initialPenaltyBps), + duration: Number(engineParameters.auctionDuration), + gracePeriod: Number(engineParameters.auctionGracePeriod), + penaltyPeriod: Number(engineParameters.auctionPenaltySlots), + minOfferDeltaBps: Number(engineParameters.minOfferDeltaBps), + securityDepositBase: new BN(engineParameters.securityDepositBase), + securityDepositBps: Number(engineParameters.securityDepositBps) + } +} + export function writeDeployedContract(whChainId: ChainId, contractName: string, address: string, constructorArgs: UncheckedConstructorArgs ) { const contracts = loadContracts(); if (!contracts[contractName]) { diff --git a/deployment/helpers/solana.ts b/deployment/helpers/solana.ts index 96020c32..d8b2303a 100644 --- a/deployment/helpers/solana.ts +++ b/deployment/helpers/solana.ts @@ -39,6 +39,11 @@ export function solanaOperatingChains() { export async function runOnSolana(scriptName: string, cb: SolanaScriptCb) { const chains = solanaOperatingChains(); + if (chains.length === 0) { + console.log("No operating Solana chains found, check your ecosystem config file."); + return; + } + console.log(`Running script on Solana:`, scriptName); const result = chains.map(async chain => { diff --git a/deployment/scripts/solana/updateAuctionParameters.ts b/deployment/scripts/solana/updateAuctionParameters.ts new file mode 100644 index 00000000..093ac071 --- /dev/null +++ b/deployment/scripts/solana/updateAuctionParameters.ts @@ -0,0 +1,78 @@ +import { + AccountInfo, + ComputeBudgetProgram, + Connection, + PublicKey, +} from "@solana/web3.js"; +import "dotenv/config"; +import { uint64ToBN } from "@wormhole-foundation/example-liquidity-layer-solana/common"; +import { AuctionParameters, MatchingEngineProgram } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; +import { solana, LoggerFn, getChainConfig, getContractAddress, getLocalDependencyAddress, getMatchingEngineAuctionParameters as getAuctionEngineParameters, env, getMatchingEngineAuctionParameters } from "../../helpers"; +import { MatchingEngineConfiguration } from "../../config/config-types"; +import { ProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; +import { SolanaLedgerSigner } from "@xlabs-xyz/ledger-signer-solana"; +import { circle } from "@wormhole-foundation/sdk-base"; + +solana.runOnSolana("update-auction-parameters", async (chain, signer, log) => { + const config = await getChainConfig("matching-engine", chain.chainId); + const matchingEngineId = getLocalDependencyAddress("matchingEngineProxy", chain) as ProgramId; + + const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1).toLowerCase(); + const canonicalEnv = capitalize(env); + + if (canonicalEnv !== "Mainnet" && canonicalEnv !== "Testnet") { + throw new Error(`Unsupported environment: ${env} must be Mainnet or Testnet`); + } + + const usdcMint = new PublicKey(circle.usdcContract(canonicalEnv, "Solana")); + const connection = new Connection(chain.rpc, solana.connectionCommitmentLevel); + const matchingEngine = new MatchingEngineProgram(connection, matchingEngineId, usdcMint); + + log('Matching Engine Program ID:', matchingEngineId.toString()); + log('Current Matching Engine Auction parameters:', await matchingEngine.fetchAuctionParameters()); + log('\nTo-be-updated Matching Engine Auction parameters:', getMatchingEngineAuctionParameters(chain)); + + log('Proposing new Matching Engine Auction parameters...') + + const priorityFee = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: solana.priorityMicrolamports }); + const ownerOrAssistant = new PublicKey(await signer.getAddress()); + const custodian = matchingEngine.custodianAddress(); + + const exists = await connection.getAccountInfo(custodian).then((acct: null | AccountInfo) => acct != null); + if (exists) { + log("Notice: proposal account already initialized"); + } + else { + + const proposeInstructions = []; + const proposeIx = await matchingEngine.proposeAuctionParametersIx({ + ownerOrAssistant, + }, getMatchingEngineAuctionParameters(chain)); + + proposeInstructions.push(proposeIx, priorityFee); + const proposeTxSig = await solana.ledgerSignAndSend(connection, proposeInstructions, []); + + console.log(`Propose Transaction ID: ${proposeTxSig}, wait for confirmation...`); + + await connection.confirmTransaction(proposeTxSig, 'confirmed'); + } + + const updateInstructions = []; + const updateIx = await matchingEngine.updateAuctionParametersIx({ + owner: ownerOrAssistant, + }); + updateInstructions.push(updateIx, priorityFee); + const updateTxSig = await solana.ledgerSignAndSend(connection, updateInstructions, []); + + await connection.confirmTransaction(updateTxSig, 'confirmed'); + + console.log(`Update Transaction ID: ${updateTxSig}, wait for confirmation...`); +}); + +function toIntegerNumber(text: string, name: string): number { + const res = Number(text); + if (!Number.isSafeInteger(res)) { + throw new Error(`${name} is not a safe integer. Received ${text}`) + } + return res; +} \ No newline at end of file From 7b13d16c316213d5312518d9a17e46816f9dd754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Wed, 8 Jan 2025 18:23:07 -0300 Subject: [PATCH 76/80] deployment: fixes solana upgrade scripts --- deployment/scripts/solana/upgrade-matching-engine.ts | 9 ++++++++- deployment/scripts/solana/upgrade-token-router.ts | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/deployment/scripts/solana/upgrade-matching-engine.ts b/deployment/scripts/solana/upgrade-matching-engine.ts index ed076cee..b072e584 100644 --- a/deployment/scripts/solana/upgrade-matching-engine.ts +++ b/deployment/scripts/solana/upgrade-matching-engine.ts @@ -24,13 +24,20 @@ solana.runOnSolana("upgrade-matching-engine", async (chain, signer, log) => { await checkBufferExists(buffer, connection); + const owner = new PublicKey(await signer.getAddress()); const upgradeIx = await upgradeManager.executeMatchingEngineUpgradeIx({ - owner: new PublicKey(await signer.getAddress()), + owner, matchingEngineBuffer: buffer, }); const txId = await solana.ledgerSignAndSend(connection, [upgradeIx], []); log(`Succesfully upgraded on tx -> ${txId}`); + + const commitUpgradeIx = await upgradeManager.commitMatchingEngineUpgradeIx({ + owner + }); + const txIdCommit = await solana.ledgerSignAndSend(connection, [commitUpgradeIx], []); + log(`Succesfully commited upgrade on tx -> ${txIdCommit}`); }); async function checkBufferExists(buffer: PublicKey, connection: Connection) { diff --git a/deployment/scripts/solana/upgrade-token-router.ts b/deployment/scripts/solana/upgrade-token-router.ts index 054f81ac..e1eb7882 100644 --- a/deployment/scripts/solana/upgrade-token-router.ts +++ b/deployment/scripts/solana/upgrade-token-router.ts @@ -24,13 +24,20 @@ solana.runOnSolana("upgrade-token-router", async (chain, signer, log) => { await checkBufferExists(buffer, connection); + const owner = new PublicKey(await signer.getAddress()); const upgradeIx = await upgradeManager.executeTokenRouterUpgradeIx({ - owner: new PublicKey(await signer.getAddress()), + owner, tokenRouterBuffer: buffer, }); const txId = await solana.ledgerSignAndSend(connection, [upgradeIx], []); log(`Succesfully upgraded on tx -> ${txId}`); + + const commitUpgradeIx = await upgradeManager.commitTokenRouterUpgradeIx({ + owner + }); + const txIdCommit = await solana.ledgerSignAndSend(connection, [commitUpgradeIx], []); + log(`Succesfully committed upgrade on tx -> ${txIdCommit}`); }); async function checkBufferExists(buffer: PublicKey, connection: Connection) { From 774808b2fc388e53e77f9aed8366c3de8367a143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Wed, 8 Jan 2025 18:24:02 -0300 Subject: [PATCH 77/80] deployment: adds solana commit upgrade script --- deployment/scripts/solana/commit-upgrades.ts | 35 ++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 deployment/scripts/solana/commit-upgrades.ts diff --git a/deployment/scripts/solana/commit-upgrades.ts b/deployment/scripts/solana/commit-upgrades.ts new file mode 100644 index 00000000..b54c0f7d --- /dev/null +++ b/deployment/scripts/solana/commit-upgrades.ts @@ -0,0 +1,35 @@ +import { Connection, PublicKey } from "@solana/web3.js"; +import "dotenv/config"; +import { + UpgradeManagerProgram, + ProgramId as UpgradeManagerProgramId, +} from "@wormhole-foundation/example-liquidity-layer-solana/upgradeManager"; + +import { + solana, + getContractAddress, +} from "../../helpers"; + +solana.runOnSolana("upgrade-matching-engine", async (chain, signer, log) => { + const connection = new Connection(chain.rpc, solana.connectionCommitmentLevel); + const upgradeManagerProgramId = getContractAddress( + "UpgradeManager", + chain.chainId, + ) as UpgradeManagerProgramId; + + const upgradeManager = new UpgradeManagerProgram(connection, upgradeManagerProgramId); + + const owner = new PublicKey(await signer.getAddress()); + + const meCommitUpgradeIx = await upgradeManager.commitMatchingEngineUpgradeIx({ + owner + }); + const meTxIdCommit = await solana.ledgerSignAndSend(connection, [meCommitUpgradeIx], []); + log(`Succesfully commited matching engine upgrade on tx -> ${meTxIdCommit}`); + + const trCommitUpgradeIx = await upgradeManager.commitTokenRouterUpgradeIx({ + owner + }); + const trTxIdCommit = await solana.ledgerSignAndSend(connection, [trCommitUpgradeIx], []); + log(`Succesfully committed token router upgrade on tx -> ${trTxIdCommit}`); +}); From 354e58af0b3d49e9a319119a5e5dd783adf6e982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Wed, 8 Jan 2025 18:43:43 -0300 Subject: [PATCH 78/80] deployment: cleans up solana script --- deployment/helpers/env.ts | 16 ++++++++-------- .../scripts/solana/updateAuctionParameters.ts | 16 ++-------------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/deployment/helpers/env.ts b/deployment/helpers/env.ts index aad24447..10a0c128 100644 --- a/deployment/helpers/env.ts +++ b/deployment/helpers/env.ts @@ -169,14 +169,14 @@ export function getMatchingEngineAuctionParameters(chain: ChainInfo): AuctionPar } return { - userPenaltyRewardBps: Number(engineParameters.userPenaltyRewardBps), - initialPenaltyBps: Number(engineParameters.initialPenaltyBps), - duration: Number(engineParameters.auctionDuration), - gracePeriod: Number(engineParameters.auctionGracePeriod), - penaltyPeriod: Number(engineParameters.auctionPenaltySlots), - minOfferDeltaBps: Number(engineParameters.minOfferDeltaBps), - securityDepositBase: new BN(engineParameters.securityDepositBase), - securityDepositBps: Number(engineParameters.securityDepositBps) + userPenaltyRewardBps: Number(engineParameters.userPenaltyRewardBps), + initialPenaltyBps: Number(engineParameters.initialPenaltyBps), + duration: Number(engineParameters.auctionDuration), + gracePeriod: Number(engineParameters.auctionGracePeriod), + penaltyPeriod: Number(engineParameters.auctionPenaltySlots), + minOfferDeltaBps: Number(engineParameters.minOfferDeltaBps), + securityDepositBase: new BN(engineParameters.securityDepositBase), + securityDepositBps: Number(engineParameters.securityDepositBps) } } diff --git a/deployment/scripts/solana/updateAuctionParameters.ts b/deployment/scripts/solana/updateAuctionParameters.ts index 093ac071..e8a69162 100644 --- a/deployment/scripts/solana/updateAuctionParameters.ts +++ b/deployment/scripts/solana/updateAuctionParameters.ts @@ -5,16 +5,12 @@ import { PublicKey, } from "@solana/web3.js"; import "dotenv/config"; -import { uint64ToBN } from "@wormhole-foundation/example-liquidity-layer-solana/common"; -import { AuctionParameters, MatchingEngineProgram } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; -import { solana, LoggerFn, getChainConfig, getContractAddress, getLocalDependencyAddress, getMatchingEngineAuctionParameters as getAuctionEngineParameters, env, getMatchingEngineAuctionParameters } from "../../helpers"; -import { MatchingEngineConfiguration } from "../../config/config-types"; +import { MatchingEngineProgram } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; +import { solana, getLocalDependencyAddress, env, getMatchingEngineAuctionParameters } from "../../helpers"; import { ProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; -import { SolanaLedgerSigner } from "@xlabs-xyz/ledger-signer-solana"; import { circle } from "@wormhole-foundation/sdk-base"; solana.runOnSolana("update-auction-parameters", async (chain, signer, log) => { - const config = await getChainConfig("matching-engine", chain.chainId); const matchingEngineId = getLocalDependencyAddress("matchingEngineProxy", chain) as ProgramId; const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1).toLowerCase(); @@ -68,11 +64,3 @@ solana.runOnSolana("update-auction-parameters", async (chain, signer, log) => { console.log(`Update Transaction ID: ${updateTxSig}, wait for confirmation...`); }); - -function toIntegerNumber(text: string, name: string): number { - const res = Number(text); - if (!Number.isSafeInteger(res)) { - throw new Error(`${name} is not a safe integer. Received ${text}`) - } - return res; -} \ No newline at end of file From 5af3f4ddd30a134598a42a88604a36867526fa41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Claudio=20Nale?= Date: Wed, 8 Jan 2025 18:54:56 -0300 Subject: [PATCH 79/80] deployment: removes wrong check from update auction parameters --- .../scripts/solana/updateAuctionParameters.ts | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/deployment/scripts/solana/updateAuctionParameters.ts b/deployment/scripts/solana/updateAuctionParameters.ts index e8a69162..79ec4bce 100644 --- a/deployment/scripts/solana/updateAuctionParameters.ts +++ b/deployment/scripts/solana/updateAuctionParameters.ts @@ -1,5 +1,4 @@ import { - AccountInfo, ComputeBudgetProgram, Connection, PublicKey, @@ -32,26 +31,18 @@ solana.runOnSolana("update-auction-parameters", async (chain, signer, log) => { const priorityFee = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: solana.priorityMicrolamports }); const ownerOrAssistant = new PublicKey(await signer.getAddress()); - const custodian = matchingEngine.custodianAddress(); - const exists = await connection.getAccountInfo(custodian).then((acct: null | AccountInfo) => acct != null); - if (exists) { - log("Notice: proposal account already initialized"); - } - else { - - const proposeInstructions = []; - const proposeIx = await matchingEngine.proposeAuctionParametersIx({ - ownerOrAssistant, - }, getMatchingEngineAuctionParameters(chain)); + const proposeInstructions = []; + const proposeIx = await matchingEngine.proposeAuctionParametersIx({ + ownerOrAssistant, + }, getMatchingEngineAuctionParameters(chain)); - proposeInstructions.push(proposeIx, priorityFee); - const proposeTxSig = await solana.ledgerSignAndSend(connection, proposeInstructions, []); + proposeInstructions.push(proposeIx, priorityFee); + const proposeTxSig = await solana.ledgerSignAndSend(connection, proposeInstructions, []); - console.log(`Propose Transaction ID: ${proposeTxSig}, wait for confirmation...`); + console.log(`Propose Transaction ID: ${proposeTxSig}, wait for confirmation...`); - await connection.confirmTransaction(proposeTxSig, 'confirmed'); - } + await connection.confirmTransaction(proposeTxSig, 'confirmed'); const updateInstructions = []; const updateIx = await matchingEngine.updateAuctionParametersIx({ From ca961b11d5cb9ce1bb3046565d7f0f91f9dbd1a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A1n=20Di=20Pietro?= Date: Fri, 10 Jan 2025 21:35:31 -0300 Subject: [PATCH 80/80] matchingEngine Auction parameters mgmt scripts (#206) --- deployment/helpers/utils.ts | 4 +- deployment/scripts/solana/closeProposal.ts | 45 ++++++++++ deployment/scripts/solana/fetchProposal.ts | 35 ++++++++ .../solana/proposeAuctionParameters.ts | 49 +++++++++++ .../scripts/solana/updateAuctionParameters.ts | 86 ++++++++----------- 5 files changed, 168 insertions(+), 51 deletions(-) create mode 100644 deployment/scripts/solana/closeProposal.ts create mode 100644 deployment/scripts/solana/fetchProposal.ts create mode 100644 deployment/scripts/solana/proposeAuctionParameters.ts diff --git a/deployment/helpers/utils.ts b/deployment/helpers/utils.ts index 829616ad..f8348120 100644 --- a/deployment/helpers/utils.ts +++ b/deployment/helpers/utils.ts @@ -85,4 +85,6 @@ export function getVerifyCommand({ `; return command; -} \ No newline at end of file +} + +export const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1).toLowerCase(); diff --git a/deployment/scripts/solana/closeProposal.ts b/deployment/scripts/solana/closeProposal.ts new file mode 100644 index 00000000..56bf1289 --- /dev/null +++ b/deployment/scripts/solana/closeProposal.ts @@ -0,0 +1,45 @@ +import { + ComputeBudgetProgram, + Connection, + PublicKey, +} from "@solana/web3.js"; +import "dotenv/config"; +import { MatchingEngineProgram, ProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; +import { solana, getLocalDependencyAddress, env } from "../../helpers"; +import { capitalize } from "../../helpers/utils"; +import { circle } from "@wormhole-foundation/sdk-base"; + +solana.runOnSolana("close-proposal", async (chain, signer, log) => { + const matchingEngineId = getLocalDependencyAddress("matchingEngineProxy", chain) as ProgramId; + const canonicalEnv = capitalize(env); + if (canonicalEnv !== "Mainnet" && canonicalEnv !== "Testnet") { + throw new Error(`Unsupported environment: ${env} must be Mainnet or Testnet`); + } + + const usdcMint = new PublicKey(circle.usdcContract(canonicalEnv, "Solana")); + const connection = new Connection(chain.rpc, solana.connectionCommitmentLevel); + const matchingEngine = new MatchingEngineProgram(connection, matchingEngineId, usdcMint); + + log('Matching Engine Program ID:', matchingEngineId.toString()); + + log("Proposal to be closed", await matchingEngine.fetchProposal()); + + if (solana.priorityMicrolamports === undefined || solana.priorityMicrolamports === 0) { + log(`(!) PRIORITY_MICROLAMPORTS is undefined or zero, your transaction may not land during congestion.`) + } + + const priorityFee = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: solana.priorityMicrolamports }); + const ownerOrAssistant = new PublicKey(await signer.getAddress()); + + const closeProposalIx = await matchingEngine.closeProposalIx({ + ownerOrAssistant, + }); + + try { + const closeTxSig = await solana.ledgerSignAndSend(connection, [closeProposalIx, priorityFee], []); + console.log(`Close Proposal Transaction ID: ${closeTxSig}`); + } catch (error) { + console.error('Failed to close proposal:', error); + } + +}); diff --git a/deployment/scripts/solana/fetchProposal.ts b/deployment/scripts/solana/fetchProposal.ts new file mode 100644 index 00000000..bdd3d3d3 --- /dev/null +++ b/deployment/scripts/solana/fetchProposal.ts @@ -0,0 +1,35 @@ +import { + ComputeBudgetProgram, + Connection, + PublicKey, +} from "@solana/web3.js"; +import "dotenv/config"; +import { MatchingEngineProgram } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; +import { solana, getLocalDependencyAddress, env, capitalize } from "../../helpers"; +import { ProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; +import { circle } from "@wormhole-foundation/sdk-base"; + +solana.runOnSolana("fetch-proposal", async (chain, signer, log) => { + const matchingEngineId = getLocalDependencyAddress("matchingEngineProxy", chain) as ProgramId; + + const canonicalEnv = capitalize(env); + + if (canonicalEnv !== "Mainnet" && canonicalEnv !== "Testnet") { + throw new Error(`Unsupported environment: ${env} must be Mainnet or Testnet.`); + } + + const usdcMint = new PublicKey(circle.usdcContract(canonicalEnv, "Solana")); + const connection = new Connection(chain.rpc, solana.connectionCommitmentLevel); + const matchingEngine = new MatchingEngineProgram(connection, matchingEngineId, usdcMint); + + log('Matching Engine Program ID:', matchingEngineId.toString()); + + const proposal = await matchingEngine.fetchProposal(); + log('Proposal:', proposal); + + if (proposal.slotEnactedAt !== null) { + log(`Proposal has already been enacted at slot ${proposal.slotEnactedAt.toNumber()}`); + } else { + log('Proposal has not been enacted yet. Update must be submitted after slot ' + proposal.slotEnactDelay.toNumber()); + } +}); diff --git a/deployment/scripts/solana/proposeAuctionParameters.ts b/deployment/scripts/solana/proposeAuctionParameters.ts new file mode 100644 index 00000000..7acdac9e --- /dev/null +++ b/deployment/scripts/solana/proposeAuctionParameters.ts @@ -0,0 +1,49 @@ +import { + ComputeBudgetProgram, + Connection, + PublicKey, +} from "@solana/web3.js"; +import "dotenv/config"; +import { MatchingEngineProgram, ProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; +import { capitalize, env, getLocalDependencyAddress, getMatchingEngineAuctionParameters, solana } from "../../helpers"; +import { circle } from "@wormhole-foundation/sdk-base"; + +solana.runOnSolana("propose-auction-parameters", async (chain, signer, log) => { + const matchingEngineId = getLocalDependencyAddress("matchingEngineProxy", chain) as ProgramId; + const canonicalEnv = capitalize(env); + if (canonicalEnv !== "Mainnet" && canonicalEnv !== "Testnet") { + throw new Error(`Unsupported environment: ${env}. Must be Mainnet or Testnet.`); + } + + const usdcMint = new PublicKey(circle.usdcContract(canonicalEnv, "Solana")); + const connection = new Connection(chain.rpc, solana.connectionCommitmentLevel); + const matchingEngine = new MatchingEngineProgram(connection, matchingEngineId, usdcMint); + + log('Matching Engine Program ID:', matchingEngineId.toString()); + log('Current Matching Engine Auction parameters:', await matchingEngine.fetchAuctionParameters()); + log('\nTo-be-proposed Matching Engine Auction parameters:', getMatchingEngineAuctionParameters(chain)); + + if (solana.priorityMicrolamports === undefined || solana.priorityMicrolamports === 0) { + log(`(!) PRIORITY_MICROLAMPORTS is undefined or zero, your transaction may not land during congestion.`); + } + + const priorityFee = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: solana.priorityMicrolamports }); + const ownerOrAssistant = new PublicKey(await signer.getAddress()); + + const proposeIx = await matchingEngine.proposeAuctionParametersIx({ + ownerOrAssistant, + }, getMatchingEngineAuctionParameters(chain)); + + try { + const proposeTxSig = await solana.ledgerSignAndSend(connection, [proposeIx, priorityFee], []); + log(`Propose Transaction ID: ${proposeTxSig}.`) + + const proposal = await matchingEngine.fetchProposal(); + log(`The proposal has been published at slot ${proposal.slotProposedAt.toNumber()}.`); + log(`You must wait up to slot ${proposal.slotEnactDelay.toNumber()} to submit the auction parameters update.`); + } + catch (error) { + console.error('Failed to send transaction:', error); + } + +}); diff --git a/deployment/scripts/solana/updateAuctionParameters.ts b/deployment/scripts/solana/updateAuctionParameters.ts index 79ec4bce..e7cb5edb 100644 --- a/deployment/scripts/solana/updateAuctionParameters.ts +++ b/deployment/scripts/solana/updateAuctionParameters.ts @@ -1,57 +1,43 @@ import { - ComputeBudgetProgram, - Connection, - PublicKey, + ComputeBudgetProgram, + Connection, + PublicKey, } from "@solana/web3.js"; import "dotenv/config"; -import { MatchingEngineProgram } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; -import { solana, getLocalDependencyAddress, env, getMatchingEngineAuctionParameters } from "../../helpers"; -import { ProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; +import { MatchingEngineProgram, ProgramId } from "@wormhole-foundation/example-liquidity-layer-solana/matchingEngine"; +import { env, getLocalDependencyAddress, getMatchingEngineAuctionParameters, solana } from "../../helpers"; +import { capitalize } from "../../helpers/utils"; import { circle } from "@wormhole-foundation/sdk-base"; solana.runOnSolana("update-auction-parameters", async (chain, signer, log) => { - const matchingEngineId = getLocalDependencyAddress("matchingEngineProxy", chain) as ProgramId; - - const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1).toLowerCase(); - const canonicalEnv = capitalize(env); - - if (canonicalEnv !== "Mainnet" && canonicalEnv !== "Testnet") { - throw new Error(`Unsupported environment: ${env} must be Mainnet or Testnet`); - } - - const usdcMint = new PublicKey(circle.usdcContract(canonicalEnv, "Solana")); - const connection = new Connection(chain.rpc, solana.connectionCommitmentLevel); - const matchingEngine = new MatchingEngineProgram(connection, matchingEngineId, usdcMint); - - log('Matching Engine Program ID:', matchingEngineId.toString()); - log('Current Matching Engine Auction parameters:', await matchingEngine.fetchAuctionParameters()); - log('\nTo-be-updated Matching Engine Auction parameters:', getMatchingEngineAuctionParameters(chain)); - - log('Proposing new Matching Engine Auction parameters...') - - const priorityFee = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: solana.priorityMicrolamports }); - const ownerOrAssistant = new PublicKey(await signer.getAddress()); - - const proposeInstructions = []; - const proposeIx = await matchingEngine.proposeAuctionParametersIx({ - ownerOrAssistant, - }, getMatchingEngineAuctionParameters(chain)); - - proposeInstructions.push(proposeIx, priorityFee); - const proposeTxSig = await solana.ledgerSignAndSend(connection, proposeInstructions, []); - - console.log(`Propose Transaction ID: ${proposeTxSig}, wait for confirmation...`); - - await connection.confirmTransaction(proposeTxSig, 'confirmed'); - - const updateInstructions = []; - const updateIx = await matchingEngine.updateAuctionParametersIx({ - owner: ownerOrAssistant, - }); - updateInstructions.push(updateIx, priorityFee); - const updateTxSig = await solana.ledgerSignAndSend(connection, updateInstructions, []); - - await connection.confirmTransaction(updateTxSig, 'confirmed'); - - console.log(`Update Transaction ID: ${updateTxSig}, wait for confirmation...`); + const matchingEngineId = getLocalDependencyAddress("matchingEngineProxy", chain) as ProgramId; + const canonicalEnv = capitalize(env); + if (canonicalEnv !== "Mainnet" && canonicalEnv !== "Testnet") { + throw new Error(`Unsupported environment: ${env} must be Mainnet or Testnet`); + } + + const usdcMint = new PublicKey(circle.usdcContract(canonicalEnv, "Solana")); + const connection = new Connection(chain.rpc, solana.connectionCommitmentLevel); + const matchingEngine = new MatchingEngineProgram(connection, matchingEngineId, usdcMint); + + log('Matching Engine Program ID:', matchingEngineId.toString()); + log('Current Matching Engine Auction parameters:', await matchingEngine.fetchAuctionParameters()); + log('\nTo-be-proposed Matching Engine Auction parameters:', getMatchingEngineAuctionParameters(chain)); + + if (solana.priorityMicrolamports === undefined || solana.priorityMicrolamports === 0) { + log(`(!) PRIORITY_MICROLAMPORTS is undefined or zero, your transaction may not land during congestion.`) + } + + const priorityFee = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: solana.priorityMicrolamports }); + + const ownerOrAssistant = new PublicKey(await signer.getAddress()); + const updateIx = await matchingEngine.updateAuctionParametersIx({ + owner: ownerOrAssistant, + }); + try { + const updateTxSig = await solana.ledgerSignAndSend(connection, [updateIx, priorityFee], []); + log(`Update Transaction ID: ${updateTxSig}`); + } catch (error) { + console.error('Failed to send transaction:', error); + } });