Skip to content

Commit

Permalink
Merge branch 'main' into v1-v2-split
Browse files Browse the repository at this point in the history
  • Loading branch information
skosito committed Aug 2, 2024
2 parents 5f2ea3c + 9157fd7 commit ab656a2
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 17 deletions.
34 changes: 20 additions & 14 deletions v1/lib/address.tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,17 @@ export declare type ZetaZEVMAddress =

export declare type ZetaProtocolTestNetwork =
| "amoy_testnet"
| "baobab_testnet"
| "bsc_testnet"
| "btc_testnet"
| "goerli_testnet"
| "mumbai_testnet"
| "sepolia_testnet"
| "zeta_testnet";

export const zetaProtocolTestNetworks: ZetaProtocolTestNetwork[] = [
"baobab_testnet",
"amoy_testnet",
"bsc_testnet",
"btc_testnet",
"goerli_testnet",
"sepolia_testnet",
"mumbai_testnet",
"zeta_testnet",
"amoy_testnet",
];

export declare type NonZetaAddress =
Expand All @@ -66,23 +60,35 @@ export const nonZetaAddress: NonZetaAddress[] = [
"weth9",
];

export declare type ZetaProtocolMainNetwork = "bsc_mainnet" | "eth_mainnet" | "zeta_mainnet";
export const zetaProtocolMainNetworks: ZetaProtocolMainNetwork[] = ["eth_mainnet", "bsc_mainnet", "zeta_mainnet"];
export declare type ZetaProtocolMainNetwork =
| "bsc_mainnet"
| "btc_mainnet"
| "eth_mainnet"
| "polygon_mainnet"
| "zeta_mainnet";

export const zetaProtocolMainNetworks: ZetaProtocolMainNetwork[] = [
"bsc_mainnet",
"btc_mainnet",
"eth_mainnet",
"polygon_mainnet",
"zeta_mainnet",
];

export declare type ZetaProtocolNetwork = ZetaProtocolMainNetwork | ZetaProtocolTestNetwork;
export const zetaProtocolNetworks: ZetaProtocolNetwork[] = [...zetaProtocolTestNetworks, ...zetaProtocolMainNetworks];

export declare type ZetaProtocolEnviroment = "mainnet" | "testnet";
export declare type ZetaProtocolEnvironment = "mainnet" | "testnet";

export const isProtocolNetworkName = (str: string): str is ZetaProtocolNetwork =>
zetaProtocolNetworks.includes(str as ZetaProtocolNetwork);

export const isTestnetNetwork = (network: ZetaProtocolTestNetwork): boolean => {
return zetaProtocolTestNetworks.includes(network);
export const isTestnetNetwork = (network: string): boolean => {
return zetaProtocolTestNetworks.includes(network as ZetaProtocolTestNetwork);
};

export const isMainnetNetwork = (network: ZetaProtocolTestNetwork): boolean => {
return false;
export const isMainnetNetwork = (network: string): boolean => {
return zetaProtocolMainNetworks.includes(network as ZetaProtocolMainNetwork);
};

export const getZRC20Address = (network: ZetaProtocolNetwork): string => {
Expand Down
6 changes: 6 additions & 0 deletions v1/lib/contracts.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ export const MAX_ETH_ADDRESS = "0xffffffffffffffffffffffffffffffffffffffff";

// dev: this values should be calculated using get-salt script
const SALT_NUMBERS = {
polygon_mainnet: {
zetaConnector: "0",
zetaConsumer: "0",
zetaERC20Custody: "0",
zetaToken: "0",
},
baobab_testnet: {
zetaConnector: "71733",
zetaConsumer: "0",
Expand Down
43 changes: 40 additions & 3 deletions v1/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,41 @@
export type ParamSymbol = "USDC.BSC" | "USDC.ETH" | "BTC.BTC" | "PEPE.ETH" | "BNB.BSC" | "SHIB.ETH" | "USDT.ETH" | "USDT.BSC" | "POL.POLYGON" | "DAI.ETH" | "ETH.ETH" | "sETH.SEPOLIA" | "USDC" | "gETH" | "tMATIC" | "tBTC" | "MATIC.AMOY" | "USDC.SEPOLIA" | "tBNB";
export type ParamChainName = "eth_mainnet" | "bsc_mainnet" | "polygon_mainnet" | "zeta_mainnet" | "btc_mainnet" | "bsc_testnet" | "zeta_testnet" | "btc_testnet" | "amoy_testnet" | "sepolia_testnet";
export type ParamType = "connector" | "erc20Custody" | "pauser" | "tss" | "tssUpdater" | "uniswapV2Factory" | "uniswapV2Router02" | "uniswapV3Factory" | "uniswapV3Router" | "weth9" | "zetaToken" | "fungibleModule" | "systemContract" | "zrc20" | "zetaTokenConsumerUniV3";
import { ZetaProtocolNetwork } from "./address.tools";

export type ParamSymbol =
| "BNB.BSC"
| "BTC.BTC"
| "DAI.ETH"
| "ETH.ETH"
| "gETH"
| "MATIC.AMOY"
| "PEPE.ETH"
| "POL.POLYGON"
| "sETH.SEPOLIA"
| "SHIB.ETH"
| "tBNB"
| "tBTC"
| "tMATIC"
| "USDC.BSC"
| "USDC.ETH"
| "USDC.SEPOLIA"
| "USDC"
| "USDT.BSC"
| "USDT.ETH";

export type ParamChainName = ZetaProtocolNetwork;

export type ParamType =
| "connector"
| "erc20Custody"
| "fungibleModule"
| "pauser"
| "systemContract"
| "tss"
| "tssUpdater"
| "uniswapV2Factory"
| "uniswapV2Router02"
| "uniswapV3Factory"
| "uniswapV3Router"
| "weth9"
| "zetaToken"
| "zetaTokenConsumerUniV3"
| "zrc20";

0 comments on commit ab656a2

Please sign in to comment.