Skip to content

Commit

Permalink
Improve token deployment process
Browse files Browse the repository at this point in the history
  • Loading branch information
karim-en committed Jan 16, 2025
1 parent e6880b0 commit 5c8d456
Show file tree
Hide file tree
Showing 10 changed files with 472 additions and 506 deletions.
676 changes: 270 additions & 406 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
base64 = "0.22"
near-token = "0.3"
near-contract-standards = "5.5"
omni-types = { git = "https://github.com/near-one/omni-bridge", package = "omni-types", rev = "11ffdb63706ceba175f7581585bd837aad9f1559" }
omni-types = { git = "https://github.com/near-one/omni-bridge", package = "omni-types", rev = "7ca34034de19dfdfab9e7709c2af731b2525228e" }
solana-sdk = "2.0.13"
solana-client = "2.0.13"
spl-token = "7.0.0"
Expand Down
1 change: 1 addition & 0 deletions bridge-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ omni-connector = { path = "../bridge-sdk/connectors/omni-connector" }
near-bridge-client = { path = "../bridge-sdk/bridge-clients/near-bridge-client" }
evm-bridge-client = { path = "../bridge-sdk/bridge-clients/evm-bridge-client" }
solana-bridge-client = { path = "../bridge-sdk/bridge-clients/solana-bridge-client" }
wormhole-bridge-client = { path = "../bridge-sdk/bridge-clients/wormhole-bridge-client" }
16 changes: 9 additions & 7 deletions bridge-cli/src/defaults.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// Mainnet
pub const NEAR_RPC_MAINNET: &str = "https://rpc.mainnet.near.org/";
pub const NEAR_TOKEN_LOCKER_ID_MAINNET: &str = "omni-locker.near";
pub const NEAR_TOKEN_LOCKER_ID_MAINNET: &str = "omni.bridge.near";
pub const NEAR_LIGHT_CLIENT_ETH_ADDRESS_MAINNET: &str =
"0x3FEFc5A4B1c02f21cBc8D3613643ba0635b9a873";

Expand All @@ -11,17 +11,17 @@ pub const ETH_BRIDGE_TOKEN_FACTORY_ADDRESS_MAINNET: &str =
pub const ETH_CONNECTOR_ACCOUNT_ID_MAINNET: &str = "aurora";
pub const ETH_CUSTODIAN_ADDRESS_MAINNET: &str = "0x6BFaD42cFC4EfC96f529D786D643Ff4A8B89FA52";

pub const BASE_RPC_MAINNET: &str = "";
pub const BASE_RPC_MAINNET: &str = "https://base.llamarpc.com";
pub const BASE_CHAIN_ID_MAINNET: u64 = 8453;
pub const BASE_BRIDGE_TOKEN_FACTORY_ADDRESS_MAINNET: &str = "";
pub const BASE_BRIDGE_TOKEN_FACTORY_ADDRESS_MAINNET: &str = "0xd025b38762B4A4E36F0Cde483b86CB13ea00D989";

pub const ARB_RPC_MAINNET: &str = "";
pub const ARB_RPC_MAINNET: &str = "https://arbitrum.llamarpc.com";
pub const ARB_CHAIN_ID_MAINNET: u64 = 42161;
pub const ARB_BRIDGE_TOKEN_FACTORY_ADDRESS_MAINNET: &str = "";
pub const ARB_BRIDGE_TOKEN_FACTORY_ADDRESS_MAINNET: &str = "0xd025b38762B4A4E36F0Cde483b86CB13ea00D989";

pub const SOLANA_RPC_MAINNET: &str = "https://api.mainnet-beta.solana.com";
pub const SOLANA_BRIDGE_ADDRESS_MAINNET: &str = "";
pub const SOLANA_WORMHOLE_ADDRESS_MAINNET: &str = "";
pub const SOLANA_BRIDGE_ADDRESS_MAINNET: &str = "dahPEoZGXfyV58JqqH85okdHmpN8U2q8owgPUXSCPxe";
pub const SOLANA_WORMHOLE_ADDRESS_MAINNET: &str = "worm2ZoG2kUd4vFXhvjh93UUH596ayRfgQ2MgjNMTth";

pub const FAST_BRIDGE_ACCOUNT_ID_MAINNET: &str = "fast.bridge.near";
pub const FAST_BRIDGE_ADDRESS_MAINNET: &str = "0xC5E985976d9b521904AD96306356ECA0fE4F3a1f";
Expand Down Expand Up @@ -55,3 +55,5 @@ pub const SOLANA_WORMHOLE_ADDRESS_TESTNET: &str = "3u8hJUVTA4jH1wYAyUur7FFZVQ8H6

pub const FAST_BRIDGE_ACCOUNT_ID_TESTNET: &str = "fastbridge.testnet";
pub const FAST_BRIDGE_ADDRESS_TESTNET: &str = "0x0B2C4871C9bAD795746C05c1539A8B1f26c26357";

pub const WORMHOLE_API: &str = "https://api.wormholescan.io";
11 changes: 11 additions & 0 deletions bridge-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ struct CliConfig {
#[arg(long)]
fast_bridge_address: Option<String>,

#[arg(long)]
wormhole_api: Option<String>,

#[arg(long)]
config_file: Option<String>,
}
Expand Down Expand Up @@ -122,6 +125,8 @@ impl CliConfig {
fast_bridge_account_id: self.fast_bridge_account_id.or(other.fast_bridge_account_id),
fast_bridge_address: self.fast_bridge_address.or(other.fast_bridge_address),

wormhole_api: self.wormhole_api.or(other.wormhole_api),

config_file: self.config_file.or(other.config_file),
}
}
Expand Down Expand Up @@ -166,6 +171,8 @@ fn env_config() -> CliConfig {
fast_bridge_account_id: env::var("FAST_BRIDGE_ACCOUNT_ID").ok(),
fast_bridge_address: env::var("FAST_BRIDGE_ADDRESS").ok(),

wormhole_api: env::var("WORMHOLE_API").ok(),

config_file: None,
}
}
Expand Down Expand Up @@ -212,6 +219,8 @@ fn default_config(network: Network) -> CliConfig {
fast_bridge_account_id: Some(defaults::FAST_BRIDGE_ACCOUNT_ID_MAINNET.to_owned()),
fast_bridge_address: Some(defaults::FAST_BRIDGE_ADDRESS_MAINNET.to_owned()),

wormhole_api: Some(defaults::WORMHOLE_API.to_owned()),

config_file: None,
},
Network::Testnet => CliConfig {
Expand Down Expand Up @@ -254,6 +263,8 @@ fn default_config(network: Network) -> CliConfig {
fast_bridge_account_id: Some(defaults::FAST_BRIDGE_ACCOUNT_ID_TESTNET.to_owned()),
fast_bridge_address: Some(defaults::FAST_BRIDGE_ADDRESS_TESTNET.to_owned()),

wormhole_api: Some(defaults::WORMHOLE_API.to_owned()),

config_file: None,
},
}
Expand Down
Loading

0 comments on commit 5c8d456

Please sign in to comment.