Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bsc testnet deployment #310

Draft
wants to merge 16 commits into
base: spablob/bsc-deployment
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
MAINNET_MNEMONIC=
KOVAN_MNEMONIC=
BSC_MAINNET_MNEMONIC=
BSC_TESTNET_MNEMONIC=
AVAX_MNEMONIC=
FUJI_MNEMONIC=
MAINNET_URI=
KOVAN_URI=
BSC_MAINNET_URI="https://bsc-mainnet.public.blastapi.io"
BSC_TESTNET_URI="https://data-seed-prebsc-2-s1.binance.org:8545"
TEST_URI=
AVAX_URI="https://api.avax.network/ext/bc/C/rpc"
FUJI_URI="https://api.avax-test.network/ext/bc/C/rpc"
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ jobs:
MAINNET_MNEMONIC: ${{ secrets.MAINNET_MNEMONIC }}
BSC_MAINNET_URI: "https://bsc-mainnet.public.blastapi.io"
BSC_MAINNET_MNEMONIC: ${{ secrets.BSC_MAINNET_MNEMONIC }}
BSC_TESTNET_URI: "https://data-seed-prebsc-2-s1.binance.org:8545"
BSC_TESTNET_MNEMONIC: ${{ secrets.BSC_TESTNET_MNEMONIC }}
AVAX_URI: "https://api.avax.network/ext/bc/C/rpc"
AVAX_MNEMONIC: ${{ secrets.AVAX_MNEMONIC }}
FUJI_URI: "https://api.avax-test.network/ext/bc/C/rpc"
Expand All @@ -55,6 +57,8 @@ jobs:
MAINNET_MNEMONIC: ${{ secrets.MAINNET_MNEMONIC }}
BSC_MAINNET_URI: "https://bsc-mainnet.public.blastapi.io"
BSC_MAINNET_MNEMONIC: ${{ secrets.BSC_MAINNET_MNEMONIC }}
BSC_TESTNET_URI: "https://data-seed-prebsc-2-s1.binance.org:8545"
BSC_TESTNET_MNEMONIC: ${{ secrets.BSC_TESTNET_MNEMONIC }}
AVAX_URI: "https://api.avax.network/ext/bc/C/rpc"
AVAX_MNEMONIC: ${{ secrets.AVAX_MNEMONIC }}
FUJI_URI: "https://api.avax-test.network/ext/bc/C/rpc"
Expand Down
15 changes: 15 additions & 0 deletions constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export enum CHAINID {
ETH_MAINNET = 1, // eslint-disable-line no-unused-vars
ETH_KOVAN = 42, // eslint-disable-line no-unused-vars
BSC_MAINNET = 56, // eslint-disable-line no-unused-vars
BSC_TESTNET = 97, // eslint-disable-line no-unused-vars
AVAX_MAINNET = 43114, // eslint-disable-line no-unused-vars
AVAX_FUJI = 43113, // eslint-disable-line no-unused-vars
}
Expand All @@ -15,6 +16,7 @@ export enum CHAINID {
export const BLOCK_NUMBER = {
[CHAINID.ETH_MAINNET]: 14448950,
[CHAINID.BSC_MAINNET]: 25147759,
[CHAINID.BSC_TESTNET]: 27868652,
[CHAINID.AVAX_MAINNET]: 11518500,
[CHAINID.AVAX_FUJI]: 2823963,
};
Expand All @@ -34,6 +36,7 @@ export const WETH_ADDRESS = {
[CHAINID.ETH_MAINNET]: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
[CHAINID.ETH_KOVAN]: "0xd0A1E359811322d97991E03f863a0C30C2cF029C",
[CHAINID.BSC_MAINNET]: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", // NOTE: Wrapped BNB token address, not ETH
[CHAINID.BSC_TESTNET]: "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", // NOTE: Wrapped BNB token address, not ETH
[CHAINID.AVAX_MAINNET]: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", // NOTE: Wrapped AVAX token address, not ETH
[CHAINID.AVAX_FUJI]: "0xD9D01A9F7C810EC035C0e42cB9E80Ef44D7f8692", // NOTE: Wrapped AVAX token address, not ETH
};
Expand All @@ -56,6 +59,7 @@ export const USDC_ADDRESS = {
[CHAINID.ETH_MAINNET]: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
[CHAINID.ETH_KOVAN]: "0x7e6edA50d1c833bE936492BF42C1BF376239E9e2",
[CHAINID.BSC_MAINNET]: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
[CHAINID.BSC_TESTNET]: "0x337610d27c682E347C9cD60BD4b3b107C9d34dDd", // USDT not USDC
[CHAINID.AVAX_MAINNET]: "0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664",
[CHAINID.AVAX_FUJI]: "0x6275B63A4eE560004c34431e573314426906cee9",
};
Expand All @@ -64,6 +68,7 @@ export const USDC_OWNER_ADDRESS = {
[CHAINID.ETH_MAINNET]: "0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503",
[CHAINID.ETH_KOVAN]: "0xf668606B896389066a39B132741763e1ca6d76a2",
[CHAINID.BSC_MAINNET]: "0xf68a4b64162906eff0ff6ae34e2bb1cd42fef62d",
[CHAINID.BSC_TESTNET]: "0x082A2027DC16F42d6e69bE8FA13C94C17c910EbE", // USDT not USDC
[CHAINID.AVAX_MAINNET]: "0x50ff3b278fcc70ec7a9465063d68029ab460ea04",
[CHAINID.AVAX_FUJI]: "0x61a74365315d57a79a9c72a8394a8a959a29b9c1",
};
Expand Down Expand Up @@ -183,6 +188,7 @@ export const ETH_PRICE_ORACLE = {
[CHAINID.ETH_MAINNET]: "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419",
[CHAINID.ETH_KOVAN]: "0x9326BFA02ADD2366b30bacB125260Af641031331",
[CHAINID.BSC_MAINNET]: "0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE", // NOTE: BNB/USD Chainlink Oracle
[CHAINID.BSC_TESTNET]: "0x2514895c72f50D8bd4B4F9b1110F0D6bD2c97526", // NOTE: BNB/USD Chainlink Oracle
[CHAINID.AVAX_MAINNET]: "0x0A77230d17318075983913bC2145DB16C7366156", // NOTE: AVAX/USD Chainlink Oracle
[CHAINID.AVAX_FUJI]: "0x5498BB86BC934c8D34FDA08E81D444153d0D06aD", // NOTE: AVAX/USD Chainlink Oracle
};
Expand All @@ -198,6 +204,7 @@ export const USDC_PRICE_ORACLE = {
[CHAINID.ETH_MAINNET]: "0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6",
[CHAINID.ETH_KOVAN]: "0x9211c6b3BF41A10F78539810Cf5c64e1BB78Ec60",
[CHAINID.BSC_MAINNET]: "0x51597f405303C4377E36123cBc172b13269EA163",
[CHAINID.BSC_TESTNET]: "0xEca2605f0BCF2BA5966372C99837b1F182d3D620", // NOTE: USDT not USDC
[CHAINID.AVAX_MAINNET]: "0xF096872672F44d6EBA71458D74fe67F9a77a23B9",
[CHAINID.AVAX_FUJI]: "0x7898AcCC83587C3C55116c5230C17a6Cd9C71bad", // NOTE: This is the USDT oracle, no USDC oracle is on avax testnet
};
Expand Down Expand Up @@ -269,6 +276,7 @@ export const OTOKEN_FACTORY = {
[CHAINID.ETH_MAINNET]: "0x7C06792Af1632E77cb27a558Dc0885338F4Bdf8E",
[CHAINID.ETH_KOVAN]: "0xb9D17Ab06e27f63d0FD75099d5874a194eE623e2",
[CHAINID.BSC_MAINNET]: "0x944740e4432e48429520cED81a750d9CA666F8eF",
[CHAINID.BSC_TESTNET]: "0x86160c48A0fAdC9b5dc0EDF32a6CF8c2332b1782",
[CHAINID.AVAX_MAINNET]: "0x25bC1cD298512885F0e452833198BCBb149f66a5",
[CHAINID.AVAX_FUJI]: "0x3aB375D57EbB733E735a17eDFd3F973f6BC5de21",
};
Expand All @@ -277,6 +285,7 @@ export const MARGIN_POOL = {
[CHAINID.ETH_MAINNET]: "0x5934807cC0654d46755eBd2848840b616256C6Ef",
[CHAINID.ETH_KOVAN]: "0x8c7C60d766951c5C570bBb7065C993070061b795",
[CHAINID.BSC_MAINNET]: "0x3Be589d20881315AF1a1dA02F432d5214B763d6f",
[CHAINID.BSC_TESTNET]: "0xc33C3DB6600aeaC6831f2Dd5494F87403cEb6A0c",
[CHAINID.AVAX_MAINNET]: "0xCCF6629aEaB734E621Cc59EBb0297196774fDb9D",
[CHAINID.AVAX_FUJI]: "0x9EBC603bBf8309E1715a1678B5C13A4aE6c26452",
};
Expand All @@ -285,6 +294,7 @@ export const GAMMA_ORACLE = {
[CHAINID.ETH_MAINNET]: "0x789cD7AB3742e23Ce0952F6Bc3Eb3A73A0E08833",
[CHAINID.ETH_KOVAN]: "0x32724C61e948892A906f5EB8892B1E7e6583ba1f",
[CHAINID.BSC_MAINNET]: "0x107412A5fa2DFd630ca8b5546F5649e7363f40Cd",
[CHAINID.BSC_TESTNET]: "0xe764036e7e6BB4Ad031fa2468A3Ab60b43d55f30",
[CHAINID.AVAX_MAINNET]: "0x108abfBa5AD61bd61A930BFe73394558d60f0b10",
[CHAINID.AVAX_FUJI]: "0x380bB2d01DC2783AB8e98f86DFaBe35DcEF0c066",
};
Expand All @@ -293,13 +303,15 @@ export const GAMMA_WHITELIST = {
[CHAINID.ETH_MAINNET]: "0xa5EA18ac6865f315ff5dD9f1a7fb1d41A30a6779",
[CHAINID.ETH_KOVAN]: "0x9164eB40a1b59512F1803aB4C2d1dE4B89627A93",
[CHAINID.BSC_MAINNET]: "0xe4F23fa9067068063a5190fdc41e47AaA4ab6A5E",
[CHAINID.BSC_TESTNET]: "0xc571D18aDDd66E7503E364f13BD7570E25535985",
[CHAINID.AVAX_MAINNET]: "0xe9963AFfc9a53e293c9bB547c52902071e6087c9",
[CHAINID.AVAX_FUJI]: "0xDE24B2364eF695586cAFF591FB24d1576F69894a",
};

export const GAMMA_WHITELIST_OWNER = {
[CHAINID.ETH_MAINNET]: "0x2FCb2fc8dD68c48F406825255B4446EDFbD3e140",
[CHAINID.BSC_MAINNET]: "0xf8368119bb1073cf01b841848725d81b542a4c19",
[CHAINID.BSC_TESTNET]: "0xf8368119bb1073cf01b841848725d81b542a4c19",
[CHAINID.AVAX_MAINNET]: "0x5e99297289c4a4afe26bc94702458a86e51c8d53",
[CHAINID.AVAX_FUJI]: "0x004fcf8052d3c7ecb7558ac0068882425a055528",
};
Expand All @@ -308,6 +320,7 @@ export const GAMMA_CONTROLLER = {
[CHAINID.ETH_MAINNET]: "0x4ccc2339F87F6c59c6893E1A678c2266cA58dC72",
[CHAINID.ETH_KOVAN]: "0xdEE7D0f8CcC0f7AC7e45Af454e5e7ec1552E8e4e",
[CHAINID.BSC_MAINNET]: "0xE2a65c4CCD295524080ea9fd2F00Aed038c55e8F",
[CHAINID.BSC_TESTNET]: "0x89a3c05e60f1D71A09FB16e363361a9291100219",
// NOTE: We need to use the Gamma Controller Proxy, I found it in the snowtrace logs
// https://testnet.snowtrace.io/tx/0x512a8d6e7121546a2347bc87e540e344ae750cef1ef0ba58966f48e49c4bcdfb#eventlog
[CHAINID.AVAX_MAINNET]: "0x9e3b94819aaF6de606C4Aa844E3215725b997064",
Expand All @@ -318,6 +331,7 @@ export const ORACLE_OWNER = {
[CHAINID.ETH_MAINNET]: "0x2FCb2fc8dD68c48F406825255B4446EDFbD3e140",
[CHAINID.ETH_KOVAN]: "0x5599b4EAdDd319e2F462b27fC8378B0BFaD309CA",
[CHAINID.BSC_MAINNET]: "0xf8368119bb1073cf01b841848725d81b542a4c19",
[CHAINID.BSC_TESTNET]: "0xf8368119bb1073cf01b841848725d81b542a4c19",
[CHAINID.AVAX_MAINNET]: "0xce560126fcfae6757071d80ca68a1f6760b68fd2",
[CHAINID.AVAX_FUJI]: "0x004fcf8052d3c7ecb7558ac0068882425a055528",
};
Expand Down Expand Up @@ -367,6 +381,7 @@ export const CHAINLINK_WETH_PRICER_STETH =
export const CHAINLINK_WETH_PRICER = {
[CHAINID.ETH_MAINNET]: "0x128cE9B4D97A6550905dE7d9Abc2b8C747b0996C",
[CHAINID.BSC_MAINNET]: "0xE407429d4c1f25ee37E119343Bd7B48Da26ab33B",
[CHAINID.BSC_TESTNET]: "0x08Dff0F844f2c2552A901713bDBed4897ca8AD0c",
[CHAINID.AVAX_MAINNET]: "0x1E5e27df661323fba0068028a8d1110A3030f34E",
[CHAINID.AVAX_FUJI]: "0x1fAEa5e3429DBabE04Bbb36D1f0A0D918640a2e9",
};
Expand Down
1 change: 1 addition & 0 deletions deployments/bsc_testnet/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
97
Loading