Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.

Commit 18d7a34

Browse files
solana: add new IDs (#192)
Co-authored-by: A5 Pickle <[email protected]> Co-authored-by: Abhishek Rajput <[email protected]>
1 parent b1593e0 commit 18d7a34

File tree

21 files changed

+240
-75
lines changed

21 files changed

+240
-75
lines changed

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

solana/Anchor.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ token_router = "tD8RmtdcV7bzBeuFgyrFc8wvayj988ChccEzRQzo6md"
2323
matching_engine = "mPydpGUWxzERTNpyvTKdvS7v8kvw5sgwfiP8WQFrXVS"
2424
upgrade_manager = "ucdP9ktgrXgEUnn6roqD2SfdGMR2JSiWHUKv23oXwxt"
2525

26+
[programs.mainnet]
27+
token_router = "28topqjtJzMnPaGFmmZk68tzGmj9W9aMntaEK3QkgtRe"
28+
matching_engine = "HtkeCDdYY4i9ncAxXKjYTx8Uu3WM8JbtiLRYjtHwaVXb"
29+
upgrade_manager = "4jyJ7EEsYa72REdD8ZMBvHFTXZ4VYGQPUHaJTajsK8SN"
30+
2631
[registry]
2732
url = "https://api.apr.dev"
2833

solana/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ cargo-test:
3030
cargo-test-all:
3131
NETWORK=localnet $(MAKE) cargo-test
3232
NETWORK=testnet $(MAKE) cargo-test
33+
NETWORK=mainnet $(MAKE) cargo-test
3334

3435
.PHONY: build
3536
build:
@@ -79,6 +80,7 @@ lint:
7980
cargo fmt --check
8081
NETWORK=localnet $(MAKE) clippy
8182
NETWORK=testnet $(MAKE) clippy
83+
NETWORK=mainnet $(MAKE) clippy
8284

8385
ts/tests/artifacts:
8486
mkdir ts/tests/artifacts

solana/modules/common/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ repository.workspace = true
1010
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1111

1212
[features]
13+
mainnet = ["wormhole-solana-consts/mainnet", "wormhole-cctp-solana/mainnet"]
1314
testnet = ["wormhole-solana-consts/testnet", "wormhole-cctp-solana/testnet"]
1415
localnet = ["wormhole-solana-consts/mainnet", "wormhole-cctp-solana/mainnet"]
1516
idl-build = ["localnet", "anchor-lang/idl-build"]

solana/modules/common/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ pub use wormhole_solana_consts::USDC_MINT;
1717
use solana_program::{pubkey, pubkey::Pubkey};
1818

1919
cfg_if::cfg_if! {
20-
if #[cfg(feature = "testnet")] {
20+
if #[cfg(feature = "mainnet")] {
21+
pub const UPGRADE_MANAGER_PROGRAM_ID: Pubkey = pubkey!("4jyJ7EEsYa72REdD8ZMBvHFTXZ4VYGQPUHaJTajsK8SN");
22+
pub const UPGRADE_MANAGER_AUTHORITY: Pubkey = pubkey!("Ag7BnUJ6C3mFXTaJfL2v9eJM2QbQ7GNLsDyewdCCLY8r");
23+
} else if #[cfg(feature = "testnet")] {
2124
pub const UPGRADE_MANAGER_PROGRAM_ID: Pubkey = pubkey!("ucdP9ktgrXgEUnn6roqD2SfdGMR2JSiWHUKv23oXwxt");
2225
pub const UPGRADE_MANAGER_AUTHORITY: Pubkey = pubkey!("2sxpm9pvWmNWFzhgWtmxkMsdWk2uSNT9MoKvww53po1M");
2326
} else if #[cfg(feature = "localnet")] {

solana/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"@wormhole-foundation/example-liquidity-layer-definitions": "0.0.1",
4040
"@wormhole-foundation/sdk-base": "^0.7.0-beta.6",
4141
"@wormhole-foundation/sdk-definitions": "^0.7.0-beta.6",
42+
"@wormhole-foundation/sdk-evm": "^0.7.0-beta.6",
4243
"@wormhole-foundation/sdk-solana": "^0.7.0-beta.6",
4344
"@wormhole-foundation/sdk-solana-core": "^0.7.0-beta.6",
4445
"anchor-0.29.0": "npm:@coral-xyz/anchor@^0.29.0",

solana/programs/matching-engine/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ no-entrypoint = []
1717
no-idl = []
1818
no-log-ix-name = []
1919
cpi = ["no-entrypoint"]
20+
mainnet = ["common/mainnet"]
2021
testnet = ["common/testnet"]
2122
localnet = ["common/localnet"]
2223
integration-test = ["localnet"]

solana/programs/matching-engine/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ pub use utils::admin::AddCctpRouterEndpointArgs;
1818
use anchor_lang::{prelude::*, solana_program::pubkey};
1919

2020
cfg_if::cfg_if! {
21-
if #[cfg(feature = "testnet")] {
21+
if #[cfg(feature = "mainnet")] {
22+
declare_id!("HtkeCDdYY4i9ncAxXKjYTx8Uu3WM8JbtiLRYjtHwaVXb");
23+
24+
const CUSTODIAN_BUMP: u8 = 254;
25+
const CCTP_MINT_RECIPIENT: Pubkey = pubkey!("HUXc7MBf55vWrrkevVbmJN8HAyfFtjLcPLBt9yWngKzm");
26+
} else if #[cfg(feature = "testnet")] {
2227
declare_id!("mPydpGUWxzERTNpyvTKdvS7v8kvw5sgwfiP8WQFrXVS");
2328

2429
const CUSTODIAN_BUMP: u8 = 254;

solana/programs/matching-engine/src/processor/admin/initialize.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pub struct Initialize<'info> {
8686
program_data.upgrade_authority_address.is_some()
8787
} @ MatchingEngineError::ImmutableProgram
8888
)]
89-
program_data: Account<'info, ProgramData>,
89+
program_data: Box<Account<'info, ProgramData>>,
9090

9191
/// CHECK: This program PDA will be the upgrade authority for the Token Router program.
9292
#[account(address = common::UPGRADE_MANAGER_AUTHORITY)]
@@ -110,7 +110,7 @@ pub struct InitializeArgs {
110110
}
111111

112112
pub fn initialize(ctx: Context<Initialize>, args: InitializeArgs) -> Result<()> {
113-
let owner: Pubkey = ctx.accounts.owner.key();
113+
let owner = ctx.accounts.owner.key();
114114
let auction_config_id = 0;
115115

116116
// We need to check that the upgrade authority is the owner passed into the account context.

solana/programs/token-router/Cargo.toml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,18 @@ no-entrypoint = []
1717
no-idl = []
1818
no-log-ix-name = []
1919
cpi = ["no-entrypoint"]
20-
testnet = ["common/testnet", "matching-engine/testnet"]
21-
localnet = ["common/localnet", "matching-engine/localnet"]
20+
mainnet = [
21+
"common/mainnet",
22+
"matching-engine/mainnet"
23+
]
24+
testnet = [
25+
"common/testnet",
26+
"matching-engine/testnet"
27+
]
28+
localnet = [
29+
"common/localnet",
30+
"matching-engine/localnet"
31+
]
2232
integration-test = ["localnet"]
2333
idl-build = [
2434
"localnet",

0 commit comments

Comments
 (0)