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

Mode mainnet deploy #103

Merged
merged 8 commits into from
Jan 8, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
mode full deploy done
vminkov committed Jan 4, 2024

Verified

This commit was signed with the committer’s verified signature.
evenyag Yingwen
commit 8af7f96257445d656350e478bf7a859ca893e503
102 changes: 102 additions & 0 deletions packages/chains/deployments/mode.json
Original file line number Diff line number Diff line change
@@ -2,6 +2,24 @@
"name": "mode",
"chainId": "34443",
"contracts": {
"AddressesProvider": {
"address": "0xb0033576a9E444Dd801d5B69e1b63DBC459A6115"
},
"AddressesProvider_Implementation": {
"address": "0x8D5B096c99B26d07c7F8D8a8f25BE97427687F73"
},
"AddressesProvider_Proxy": {
"address": "0xb0033576a9E444Dd801d5B69e1b63DBC459A6115"
},
"AuthoritiesRegistry": {
"address": "0xC3cEc17c135d3C5d6BadC284AFF08f396447DaaC"
},
"AuthoritiesRegistry_Implementation": {
"address": "0x5d74800e977bFc8E14Eca28C9405BacbD091738E"
},
"AuthoritiesRegistry_Proxy": {
"address": "0xC3cEc17c135d3C5d6BadC284AFF08f396447DaaC"
},
"CErc20Delegate": {
"address": "0xb3788b3C421348E43beEa88551acC16d2f6a6332"
},
@@ -35,6 +53,66 @@
"FeeDistributor_Proxy": {
"address": "0x8ea3fc79D9E463464C5159578d38870b770f6E57"
},
"FixedNativePriceOracle": {
"address": "0x1D7669b6BDfdb83066dd7C0aDa4B630b25cBc28a"
},
"IonicFlywheelLensRouter": {
"address": "0xa6BA5F1164dc66F9C5bDCE33A6d2fC70bE8Da108"
},
"IonicLiquidator_Implementation": {
"address": "0x48bf6bd4B3d8b4E75863B5340b977E888BacE19a"
},
"JumpRateModel": {
"address": "0x21a455cEd9C79BC523D4E340c2B97521F4217817"
},
"LeveredPositionFactory": {
"address": "0x9B506A03bBFf2a842866b10BC6732da72640cd45"
},
"LeveredPositionFactoryFirstExtension": {
"address": "0x4e20eB2AF6bE30660323cB25204e071116737FEA"
},
"LeveredPositionFactorySecondExtension": {
"address": "0x2Afb71C0fe11A2315eba9A501a48700B83C19E33"
},
"LeveredPositionsLens": {
"address": "0x1DD45c9fB4C8CcB678781982774F006F24b8EaC1"
},
"LeveredPositionsLens_Implementation": {
"address": "0xD9a5677594694819F69D0907C3094EAb480F3a28"
},
"LeveredPositionsLens_Proxy": {
"address": "0x1DD45c9fB4C8CcB678781982774F006F24b8EaC1"
},
"LiquidatorsRegistry": {
"address": "0xc71B968C6C23e2723Bae32957D815C9bE3ca1b34"
},
"LiquidatorsRegistryExtension": {
"address": "0xdd7F712Af76074993F05C0d544331792997Bd39b"
},
"LiquidatorsRegistrySecondExtension": {
"address": "0x45A4a3eBb986083597Ac3B34ee2d7dcC3Be8c5C1"
},
"LooplessFlywheelBooster": {
"address": "0x1D89E5ba287E67AC0046D2218Be5fE1382cE47b4"
},
"MasterPriceOracle": {
"address": "0x2BAF3A2B667A5027a83101d218A9e8B73577F117"
},
"MasterPriceOracle_Implementation": {
"address": "0x4e7676B20B86Beea9c197bE756361680FaE3C9AE"
},
"MasterPriceOracle_Proxy": {
"address": "0x2BAF3A2B667A5027a83101d218A9e8B73577F117"
},
"OptimizedVaultsRegistry": {
"address": "0xA90f1c28F8Bc9C92113e54d0b7d007647Ee216a4"
},
"OptimizedVaultsRegistry_Implementation": {
"address": "0x2DDF3DdFE856D1A4E5DBcb324194E2a622AeD83C"
},
"OptimizedVaultsRegistry_Proxy": {
"address": "0xA90f1c28F8Bc9C92113e54d0b7d007647Ee216a4"
},
"PoolDirectory": {
"address": "0x39C353Cf9041CcF467A04d0e78B63d961E81458a"
},
@@ -43,6 +121,30 @@
},
"PoolDirectory_Proxy": {
"address": "0x39C353Cf9041CcF467A04d0e78B63d961E81458a"
},
"PoolLens": {
"address": "0x431C87E08e2636733a945D742d25Ba77577ED480"
},
"PoolLensSecondary": {
"address": "0x7Ea7BB80F3bBEE9b52e6Ed3775bA06C9C80D4154"
},
"PythPriceOracle": {
"address": "0x52Ee6E740C1785412e51A381B0d87fb1692a7b23"
},
"PythPriceOracle_Implementation": {
"address": "0x13fD2701C3017bCc375Ad14Dd8433c6d7a441794"
},
"PythPriceOracle_Proxy": {
"address": "0x52Ee6E740C1785412e51A381B0d87fb1692a7b23"
},
"SimplePriceOracle": {
"address": "0x5f0369AA93f36cA6a8B5ed7aAc47bf9e76086D03"
},
"SimplePriceOracle_Implementation": {
"address": "0xcD4D7c8e2bA627684a9B18F7fe88239341D3ba5c"
},
"SimplePriceOracle_Proxy": {
"address": "0x5f0369AA93f36cA6a8B5ed7aAc47bf9e76086D03"
}
}
}
3 changes: 2 additions & 1 deletion packages/sdk/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@
const FORK_CHAIN_ID = process.env.FORK_CHAIN_ID;
const FORK_BLOCK_NUMBER = process.env.FORK_BLOCK_NUMBER;

console.info({

Check warning on line 33 in packages/sdk/hardhat.config.ts

GitHub Actions / build-lint-and-test-local

Unexpected console statement
OVERRIDE_RPC_URL,
FORK_RPC_URL,
FORK_CHAIN_ID,
@@ -175,7 +175,8 @@
mode: {
url: OVERRIDE_RPC_URL || `https://mainnet.mode.network/`,
accounts: { mnemonic },
chainId: 34443
chainId: 34443,
gasPrice: 101
}
}
};
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@
"deploy:arbitrum": "hardhat --network arbitrum deploy --tags prod --no-compile",
"deploy:neon": "hardhat --network neon deploy --tags prod --no-compile",
"deploy:linea": "hardhat --network linea deploy --tags prod --no-compile",
"deploy:mode": "hardhat --network mode deploy --tags prod --no-compile",
"deploy:mode": "hardhat --network mode deploy --tags prod --no-compile --gasprice 100",
"deploy:zkevm": "hardhat --network zkevm deploy --tags prod --no-compile",
"deploy:localhost": "hardhat --network localhost deploy --tags prod --no-compile",
"deploy:localeth": "hardhat --network localeth deploy --tags prod --no-compile",
4 changes: 2 additions & 2 deletions packages/sdk/tasks/admin/transaction.ts
Original file line number Diff line number Diff line change
@@ -39,8 +39,8 @@
maxFeePerGas = ethers.utils.parseUnits("300", "gwei");
maxPriorityFeePerGas = ethers.utils.parseUnits("120", "gwei");
} else if (chainid == 34443) {
maxFeePerGas = 52;
maxPriorityFeePerGas = 1;
maxFeePerGas = 166;
maxPriorityFeePerGas = 13;
} else {
throw new Error(`configure the max gas fees for the chain`);
}
@@ -52,7 +52,7 @@
value: 0,
nonce,
maxFeePerGas,
maxPriorityFeePerGas,

Check failure on line 55 in packages/sdk/tasks/admin/transaction.ts

GitHub Actions / build-lint-and-test-local

Delete `,`
});
console.log(`cancelling tx hash ${tx.hash}`);
await tx.wait();

Unchanged files with check annotations Beta

import { assetSymbols, FundingStrategy, FundingStrategyContract, underlying } from "@ionicprotocol/types";

Check warning on line 1 in packages/chains/src/arbitrum/fundingStrategies.ts

GitHub Actions / release

'assetSymbols' is defined but never used

Check warning on line 1 in packages/chains/src/arbitrum/fundingStrategies.ts

GitHub Actions / release

'FundingStrategyContract' is defined but never used

Check warning on line 1 in packages/chains/src/arbitrum/fundingStrategies.ts

GitHub Actions / release

'underlying' is defined but never used
import { assets } from "./assets";

Check warning on line 3 in packages/chains/src/arbitrum/fundingStrategies.ts

GitHub Actions / release

'assets' is defined but never used
const fundingStrategies: FundingStrategy[] = [];
import deployments from "../../deployments/arbitrum.json";
import chainAddresses from "./addresses";
import assets from "./assets";

Check warning on line 6 in packages/chains/src/arbitrum/index.ts

GitHub Actions / release

Using exported name 'assets' as identifier for default export
import fundingStrategies from "./fundingStrategies";
import irms from "./irms";
import leveragePairs from "./leveragePairs";
import { BigNumber } from "ethers";
import chainAddresses from "./addresses";
import assets from "./assets";

Check warning on line 5 in packages/chains/src/arbitrum/params.ts

GitHub Actions / release

Using exported name 'assets' as identifier for default export
const specificParams: ChainParams = {
blocksPerYear: BigNumber.from((4 * 24 * 365 * 60).toString()),
import { assetSymbols, DeployedPlugins, Strategy, underlying } from "@ionicprotocol/types";

Check warning on line 1 in packages/chains/src/bsc/plugins.ts

GitHub Actions / release

'assetSymbols' is defined but never used

Check warning on line 1 in packages/chains/src/bsc/plugins.ts

GitHub Actions / release

'Strategy' is defined but never used

Check warning on line 1 in packages/chains/src/bsc/plugins.ts

GitHub Actions / release

'underlying' is defined but never used
import assets from "./assets";

Check warning on line 3 in packages/chains/src/bsc/plugins.ts

GitHub Actions / release

'assets' is defined but never used
const deployedPlugins: DeployedPlugins = {};
}
};
export const getAssetPriceCacheData = async (asset_address: string): Promise<[AssetPriceCache | null, any]> => {

Check warning on line 44 in packages/monitors/oracle/src/controllers/assetPriceCache.ts

GitHub Actions / lint-bots

Unexpected any. Specify a different type
const supabase = getSupabaseClient();
try {
import { pythConfig as lineaPythConfig } from './linea';
import { pythConfig as neonPythConfig } from './neon';
import { pythConfig as zkevmPythConfig } from './zkevm';
import { pythConfig as modePythConfig } from './mode';

Check failure on line 6 in packages/bots/pyth-updater/src/config/index.ts

GitHub Actions / lint-bots

`./mode` import should occur before import of `./neon`
export const chainIdToConfig = {
[neon.chainId]: neonPythConfig,
import {PythAssetConfig} from "../types";

Check failure on line 1 in packages/bots/pyth-updater/src/config/mode.ts

GitHub Actions / lint-bots

Replace `PythAssetConfig}·from·"../types"` with `·PythAssetConfig·}·from·'../types'`
// TODO
export const pythConfig: PythAssetConfig[] = []

Check failure on line 4 in packages/bots/pyth-updater/src/config/mode.ts

GitHub Actions / lint-bots

Insert `;`
this.alert.sendLiquidationFetchingFailure(erroredPools, msg);
}
return liquidatablePools;
} catch (error: any) {

Check warning on line 31 in packages/bots/liquidator/src/services/liquidator.ts

GitHub Actions / lint-bots

Unexpected any. Specify a different type
if (!Object.values(EXCLUDED_ERROR_CODES).includes(error.code)) {
logger.error(`Error fetching liquidations: ${error}`);
}
deployments,
assets,
certificateAssetSymbol
}: aXXXcDeployParams): Promise<{ ankrCertificateTokenPriceOracle: any }> => {

Check warning on line 13 in packages/sdk/chainDeploy/helpers/oracles/aXXXc.ts

GitHub Actions / build-lint-and-test-local

Unexpected any. Specify a different type
const { deployer } = await getNamedAccounts();
const mpo = await ethers.getContract("MasterPriceOracle", deployer);

Check warning on line 16 in packages/sdk/chainDeploy/helpers/oracles/chainlink.ts

GitHub Actions / build-lint-and-test-local

Unexpected any. Specify a different type

Check warning on line 16 in packages/sdk/chainDeploy/helpers/oracles/chainlink.ts

GitHub Actions / build-lint-and-test-local

Unexpected any. Specify a different type
getNamedAccounts,
deployments,
assets
}: stkBNBOracleDeployParams): Promise<{ stkBNBOracle: any }> => {

Check warning on line 12 in packages/sdk/chainDeploy/helpers/oracles/stkBNBOracle.ts

GitHub Actions / build-lint-and-test-local

Unexpected any. Specify a different type
const { deployer } = await getNamedAccounts();
const mpo = await ethers.getContract("MasterPriceOracle", deployer);
import { deploy as deploy1101, deployConfig as deployConfig1101 } from "./mainnets/zkevm";
import { deploy as deploy97, deployConfig as deployConfig97 } from "./testnets/chapel";
export const chainDeployConfig: Record<number, { config: ChainDeployConfig; deployFunc: any }> = {

Check warning on line 13 in packages/sdk/chainDeploy/index.ts

GitHub Actions / build-lint-and-test-local

Unexpected any. Specify a different type
// mainnets
1: { config: deployConfig1, deployFunc: deploy1 },
56: { config: deployConfig56, deployFunc: deploy56 },
import {
ChainDeployConfig,
deployAlgebraPriceOracle,

Check warning on line 7 in packages/sdk/chainDeploy/mainnets/linea.ts

GitHub Actions / build-lint-and-test-local

'deployAlgebraPriceOracle' is defined but never used
deployKyberSwapPriceOracle,
deployPythPriceOracle,

Check warning on line 9 in packages/sdk/chainDeploy/mainnets/linea.ts

GitHub Actions / build-lint-and-test-local

'deployPythPriceOracle' is defined but never used
deployUmbrellaOracle
} from "../helpers";
import { ConcentratedLiquidityOracleConfig, UmbrellaAsset } from "../helpers/types";
// ];
export const deploy = async ({ run, ethers, getNamedAccounts, deployments }): Promise<void> => {
const { deployer } = await getNamedAccounts();

Check warning on line 82 in packages/sdk/chainDeploy/mainnets/linea.ts

GitHub Actions / build-lint-and-test-local

'deployer' is assigned a value but never used
await deployUmbrellaOracle({
run,
ethers,
if (!chainDeployConfig[chainId]) {
throw new Error(`Config invalid for ${chainId}`);
}
const { config: chainDeployParams, deployFunc }: { config: ChainDeployConfig; deployFunc: any } =

Check warning on line 34 in packages/sdk/deploy/deploy.ts

GitHub Actions / build-lint-and-test-local

Unexpected any. Specify a different type
chainDeployConfig[chainId];
console.log("chainDeployParams: ", chainDeployParams);