#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[non_exhaustive]
pub struct Deployment {
pub chain_id: i64,
pub network: &'static str,
pub name: &'static str,
pub api_network: Option<&'static str>,
pub fyuz: &'static str,
pub liquidity_manager: Option<&'static str>,
pub distributor: Option<&'static str>,
pub currency: &'static str,
pub currency_decimals: u32,
pub rpc_url: &'static str,
pub explorer_url: &'static str,
}
pub const BSC: Deployment = Deployment {
chain_id: 56,
network: "bsc",
name: "BNB Smart Chain",
api_network: Some("bsc"),
fyuz: "0x33a98bef6496684a8dac83734d9ceb0cefc7019c",
liquidity_manager: Some("0x5220da0b1a778c0d414f082a5ea3670b70d59b00"),
distributor: Some("0x2c88255f6a80296a3aa8c328e5ff308d74615c7b"),
currency: "BNB",
currency_decimals: 18,
rpc_url: "https://bsc-dataseed.bnbchain.org",
explorer_url: "https://bscscan.com",
};
pub const BSC_TESTNET: Deployment = Deployment {
chain_id: 97,
network: "bsc-testnet",
name: "BNB Smart Chain Testnet",
api_network: None,
fyuz: "0x24febdcc41c804873dbbfe703cd9d2d4b771c236",
liquidity_manager: Some("0x7a5572709523af016d8b8ce22d6cec49b08a30da"),
distributor: None,
currency: "tBNB",
currency_decimals: 18,
rpc_url: "https://bsc-testnet-rpc.publicnode.com",
explorer_url: "https://testnet.bscscan.com",
};
pub const DEPLOYMENTS: &[Deployment] = &[BSC, BSC_TESTNET];
pub fn deployment_for_chain_id(chain_id: i64) -> Option<&'static Deployment> {
DEPLOYMENTS.iter().find(|d| d.chain_id == chain_id)
}
pub fn deployment_for_network(network: &str) -> Option<&'static Deployment> {
DEPLOYMENTS
.iter()
.find(|d| d.network == network || d.api_network == Some(network))
.or_else(|| network.parse().ok().and_then(deployment_for_chain_id))
}