diff --git a/scripts/src/commands/sol/base-relayer/initialize.handler.ts b/scripts/src/commands/sol/base-relayer/initialize.handler.ts index cfc74363..bd03bfc3 100644 --- a/scripts/src/commands/sol/base-relayer/initialize.handler.ts +++ b/scripts/src/commands/sol/base-relayer/initialize.handler.ts @@ -1,9 +1,7 @@ import { z } from "zod"; import { getProgramDerivedAddress, - devnet, type Address as SolanaAddress, - type KeyPairSigner, createSolanaRpc, address as solanaAddress, } from "@solana/kit"; diff --git a/scripts/src/commands/sol/bridge/base-to-solana/prove-message.handler.ts b/scripts/src/commands/sol/bridge/base-to-solana/prove-message.handler.ts index 88c91b9c..98330189 100644 --- a/scripts/src/commands/sol/bridge/base-to-solana/prove-message.handler.ts +++ b/scripts/src/commands/sol/bridge/base-to-solana/prove-message.handler.ts @@ -4,7 +4,6 @@ import { getProgramDerivedAddress, getU64Encoder, createSolanaRpc, - devnet, } from "@solana/kit"; import { SYSTEM_PROGRAM_ADDRESS } from "@solana-program/system"; import { @@ -17,10 +16,7 @@ import { import { baseSepolia } from "viem/chains"; import { decodeEventLog } from "viem/utils"; -import { - fetchBridge, - getProveMessageInstruction, -} from "@base/bridge/bridge"; +import { fetchBridge, getProveMessageInstruction } from "@base/bridge/bridge"; import { logger } from "@internal/logger"; import { @@ -171,7 +167,7 @@ async function generateProof( topics: log.topics, }); - return decodedLog.eventName === "MessageRegistered" + return decodedLog.eventName === "MessageInitiated" ? { messageHash: decodedLog.args.messageHash, mmrRoot: decodedLog.args.mmrRoot, diff --git a/scripts/src/commands/sol/bridge/base-to-solana/relay-message.handler.ts b/scripts/src/commands/sol/bridge/base-to-solana/relay-message.handler.ts index 276b2521..49bbafc7 100644 --- a/scripts/src/commands/sol/bridge/base-to-solana/relay-message.handler.ts +++ b/scripts/src/commands/sol/bridge/base-to-solana/relay-message.handler.ts @@ -1,7 +1,6 @@ import { z } from "zod"; import { createSolanaRpc, - devnet, getProgramDerivedAddress, type AccountMeta, type Address as SolanaAddress, @@ -14,7 +13,6 @@ import { TOKEN_2022_PROGRAM_ADDRESS } from "@solana-program/token-2022"; import { toBytes, toHex } from "viem"; import { - fetchBridge, fetchIncomingMessage, getRelayMessageInstruction, type BridgeBaseToSolanaStateIncomingMessageMessage, diff --git a/scripts/src/commands/sol/bridge/initialize.handler.ts b/scripts/src/commands/sol/bridge/initialize.handler.ts index 8afe6ed4..af1067ca 100644 --- a/scripts/src/commands/sol/bridge/initialize.handler.ts +++ b/scripts/src/commands/sol/bridge/initialize.handler.ts @@ -1,7 +1,6 @@ import { z } from "zod"; import { getProgramDerivedAddress, - devnet, type Address as SolanaAddress, createSolanaRpc, address as solanaAddress, diff --git a/scripts/src/commands/sol/bridge/solana-to-base/bridge-sol.handler.ts b/scripts/src/commands/sol/bridge/solana-to-base/bridge-sol.handler.ts index ecb81a21..f02f1acb 100644 --- a/scripts/src/commands/sol/bridge/solana-to-base/bridge-sol.handler.ts +++ b/scripts/src/commands/sol/bridge/solana-to-base/bridge-sol.handler.ts @@ -5,7 +5,7 @@ import { createSolanaRpc, } from "@solana/kit"; import { SYSTEM_PROGRAM_ADDRESS } from "@solana-program/system"; -import { toBytes, isAddress as isEvmAddress, toHex } from "viem"; +import { toBytes, isAddress as isEvmAddress } from "viem"; import { fetchBridge, getBridgeSolInstruction } from "@base/bridge/bridge"; diff --git a/scripts/src/commands/sol/bridge/solana-to-base/bridge-spl.command.ts b/scripts/src/commands/sol/bridge/solana-to-base/bridge-spl.command.ts index b6785ebe..7f3260cd 100644 --- a/scripts/src/commands/sol/bridge/solana-to-base/bridge-spl.command.ts +++ b/scripts/src/commands/sol/bridge/solana-to-base/bridge-spl.command.ts @@ -8,6 +8,7 @@ import { getOrPromptFilePath, getOrPromptDeployEnv, validateAndExecute, + getInteractiveSelect, } from "@internal/utils/cli"; import { argsSchema, handleBridgeSpl } from "./bridge-spl.handler"; diff --git a/scripts/src/commands/sol/bridge/solana-to-base/bridge-wrapped-token.handler.ts b/scripts/src/commands/sol/bridge/solana-to-base/bridge-wrapped-token.handler.ts index 794686d1..2becbab0 100644 --- a/scripts/src/commands/sol/bridge/solana-to-base/bridge-wrapped-token.handler.ts +++ b/scripts/src/commands/sol/bridge/solana-to-base/bridge-wrapped-token.handler.ts @@ -1,7 +1,6 @@ import { z } from "zod"; import { getProgramDerivedAddress, - devnet, address, createSolanaRpc, type Account, diff --git a/scripts/src/commands/sol/bridge/solana-to-base/wrap-token.command.ts b/scripts/src/commands/sol/bridge/solana-to-base/wrap-token.command.ts index 0f8dcb0c..0d1e0a8a 100644 --- a/scripts/src/commands/sol/bridge/solana-to-base/wrap-token.command.ts +++ b/scripts/src/commands/sol/bridge/solana-to-base/wrap-token.command.ts @@ -8,6 +8,7 @@ import { getOrPromptFilePath, getOrPromptDeployEnv, validateAndExecute, + getInteractiveSelect, } from "@internal/utils/cli"; import { argsSchema, handleWrapToken } from "./wrap-token.handler"; diff --git a/scripts/src/commands/sol/bridge/solana-to-base/wrap-token.handler.ts b/scripts/src/commands/sol/bridge/solana-to-base/wrap-token.handler.ts index ab3fa1ec..fd4dc02f 100644 --- a/scripts/src/commands/sol/bridge/solana-to-base/wrap-token.handler.ts +++ b/scripts/src/commands/sol/bridge/solana-to-base/wrap-token.handler.ts @@ -3,7 +3,6 @@ import { getProgramDerivedAddress, getU8Codec, createSolanaRpc, - devnet, type Instruction, getU64Encoder, Endian, diff --git a/scripts/src/commands/sol/spl/create-ata.handler.ts b/scripts/src/commands/sol/spl/create-ata.handler.ts index 84d5cb96..ff6bad0e 100644 --- a/scripts/src/commands/sol/spl/create-ata.handler.ts +++ b/scripts/src/commands/sol/spl/create-ata.handler.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { address, createSolanaRpc, devnet } from "@solana/kit"; +import { address, createSolanaRpc } from "@solana/kit"; import { fetchMaybeToken, getCreateAssociatedTokenIdempotentInstruction, diff --git a/scripts/src/commands/sol/spl/create-mint.handler.ts b/scripts/src/commands/sol/spl/create-mint.handler.ts index 8fee2439..ebe85d07 100644 --- a/scripts/src/commands/sol/spl/create-mint.handler.ts +++ b/scripts/src/commands/sol/spl/create-mint.handler.ts @@ -4,7 +4,6 @@ import { generateKeyPair, address, createSolanaRpc, - devnet, } from "@solana/kit"; import { getCreateAccountInstruction } from "@solana-program/system"; import { diff --git a/scripts/src/commands/sol/spl/mint.handler.ts b/scripts/src/commands/sol/spl/mint.handler.ts index fd481379..1126b302 100644 --- a/scripts/src/commands/sol/spl/mint.handler.ts +++ b/scripts/src/commands/sol/spl/mint.handler.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { address, devnet, createSolanaRpc, type Account } from "@solana/kit"; +import { address, createSolanaRpc, type Account } from "@solana/kit"; import { getMintToInstruction, fetchMaybeMint, diff --git a/scripts/src/internal/base/abi/bridge-validator.abi.ts b/scripts/src/internal/base/abi/bridge-validator.abi.ts index fb97d6cb..4760e9d8 100644 --- a/scripts/src/internal/base/abi/bridge-validator.abi.ts +++ b/scripts/src/internal/base/abi/bridge-validator.abi.ts @@ -69,26 +69,26 @@ export const BRIDGE_VALIDATOR_ABI = [ }, { type: "function", - name: "addValidator", - inputs: [ + name: "getBaseThreshold", + inputs: [], + outputs: [ { - name: "validator", - type: "address", - internalType: "address", + name: "", + type: "uint128", + internalType: "uint128", }, ], - outputs: [], - stateMutability: "nonpayable", + stateMutability: "view", }, { type: "function", - name: "getBaseThreshold", + name: "getBaseValidatorCount", inputs: [], outputs: [ { name: "", - type: "uint128", - internalType: "uint128", + type: "uint256", + internalType: "uint256", }, ], stateMutability: "view", @@ -116,6 +116,25 @@ export const BRIDGE_VALIDATOR_ABI = [ outputs: [], stateMutability: "nonpayable", }, + { + type: "function", + name: "isBaseValidator", + inputs: [ + { + name: "validator", + type: "address", + internalType: "address", + }, + ], + outputs: [ + { + name: "", + type: "bool", + internalType: "bool", + }, + ], + stateMutability: "view", + }, { type: "function", name: "nextNonce", @@ -172,45 +191,6 @@ export const BRIDGE_VALIDATOR_ABI = [ outputs: [], stateMutability: "nonpayable", }, - { - type: "function", - name: "removeValidator", - inputs: [ - { - name: "validator", - type: "address", - internalType: "address", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "setPartnerThreshold", - inputs: [ - { - name: "newThreshold", - type: "uint256", - internalType: "uint256", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "setThreshold", - inputs: [ - { - name: "newThreshold", - type: "uint256", - internalType: "uint256", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, { type: "function", name: "validMessages", @@ -281,45 +261,6 @@ export const BRIDGE_VALIDATOR_ABI = [ ], anonymous: false, }, - { - type: "event", - name: "ThresholdUpdated", - inputs: [ - { - name: "newThreshold", - type: "uint256", - indexed: false, - internalType: "uint256", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "ValidatorAdded", - inputs: [ - { - name: "validator", - type: "address", - indexed: false, - internalType: "address", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "ValidatorRemoved", - inputs: [ - { - name: "validator", - type: "address", - indexed: false, - internalType: "address", - }, - ], - anonymous: false, - }, { type: "error", name: "BaseSignerCountTooHigh", @@ -395,16 +336,6 @@ export const BRIDGE_VALIDATOR_ABI = [ name: "ValidatorAlreadyAdded", inputs: [], }, - { - type: "error", - name: "ValidatorCountLessThanThreshold", - inputs: [], - }, - { - type: "error", - name: "ValidatorNotExisted", - inputs: [], - }, { type: "error", name: "ZeroAddress", diff --git a/scripts/src/internal/base/abi/bridge.abi.ts b/scripts/src/internal/base/abi/bridge.abi.ts index 9077cd87..69fe85a6 100644 --- a/scripts/src/internal/base/abi/bridge.abi.ts +++ b/scripts/src/internal/base/abi/bridge.abi.ts @@ -760,7 +760,7 @@ export const BRIDGE_ABI = [ }, { type: "event", - name: "MessageRegistered", + name: "MessageInitiated", inputs: [ { name: "messageHash", @@ -963,6 +963,11 @@ export const BRIDGE_ABI = [ name: "AlreadyInitialized", inputs: [], }, + { + type: "error", + name: "CumulativeDepositExceedsU64", + inputs: [], + }, { type: "error", name: "EmptyMMR", diff --git a/scripts/src/internal/sol/base-relayer.ts b/scripts/src/internal/sol/base-relayer.ts index 3e62ef46..22040957 100644 --- a/scripts/src/internal/sol/base-relayer.ts +++ b/scripts/src/internal/sol/base-relayer.ts @@ -1,6 +1,5 @@ import { createSolanaRpc, - devnet, getProgramDerivedAddress, type Address, type KeyPairSigner, diff --git a/scripts/src/internal/sol/base.ts b/scripts/src/internal/sol/base.ts index 0d77fab9..709e7089 100644 --- a/scripts/src/internal/sol/base.ts +++ b/scripts/src/internal/sol/base.ts @@ -1,7 +1,6 @@ import { sleep } from "bun"; import { createSolanaRpc, - devnet, getBase58Codec, getBase58Encoder, type Address as SolAddress, diff --git a/scripts/src/internal/sol/transaction.ts b/scripts/src/internal/sol/transaction.ts index 1ffc7cdc..1abbc8fe 100644 --- a/scripts/src/internal/sol/transaction.ts +++ b/scripts/src/internal/sol/transaction.ts @@ -5,7 +5,6 @@ import { createSolanaRpc, createSolanaRpcSubscriptions, createTransactionMessage, - devnet, getSignatureFromTransaction, pipe, sendAndConfirmTransactionFactory, diff --git a/scripts/src/internal/utils/cli.ts b/scripts/src/internal/utils/cli.ts index 1121c9e4..a4edc25b 100644 --- a/scripts/src/internal/utils/cli.ts +++ b/scripts/src/internal/utils/cli.ts @@ -22,7 +22,7 @@ import { isAddress as isEvmAddress, isHash } from "viem"; import { z } from "zod"; import { logger } from "@internal/logger"; -import { DEPLOY_ENVS, type DeployEnv } from "@internal/constants"; +import { type DeployEnv } from "@internal/constants"; export const bigintSchema = z .string()