Skip to content

Commit

Permalink
chore: merge feat/sopolia
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoujia6139 committed Dec 22, 2023
2 parents d5f41e5 + 20a316f commit cb918dd
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 10 deletions.
2 changes: 1 addition & 1 deletion helper-hardhat-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const NETWORKS_RPC_URL: iParamsPerNetwork<string> = {
[eEthereumNetwork.paraxDev]:
L2_RPC_URL ||
RPC_URL ||
`https://nitrorpc-compact-lime-moose-5r7g6fkl78.t.conduit.xyz`,
`https://rpc-surprised-harlequin-bonobo-fvcy2k9oqh.t.conduit.xyz`,
[eEthereumNetwork.polygon]:
RPC_URL || `https://polygon-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}`,
[eEthereumNetwork.polygonMumbai]:
Expand Down
6 changes: 3 additions & 3 deletions helpers/hardhat-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const SEPOLIA_CHAINID = 11155111;
export const FORK_CHAINID = 522;
export const MAINNET_CHAINID = 1;
export const PARALLEL_CHAINID = 1592;
export const PARAX_DEV_CHAINID = 3163830386846714;
export const PARAX_DEV_CHAINID = 2982896226593698;
export const MOONBEAM_CHAINID = 1284;
export const MOONBASE_CHAINID = 1287;
export const ARBITRUM_ONE_CHAINID = 42161;
Expand Down Expand Up @@ -136,7 +136,7 @@ export const ETHERSCAN_APIS = {
arbitrumGoerli: "https://api-goerli.arbiscan.io/api",
arbitrumSepolia: "https://api-sepolia.arbiscan.io/api",
paraxDev:
"https://explorerl2new-widespread-brown-mosquito-de4v5k1jm5.t.conduit.xyz/api",
"https://explorerl2new-surprised-harlequin-bonobo-fvcy2k9oqh.t.conduit.xyz/api",
polygon: "https://api.polygonscan.com/api",
matic: "https://api.polygonscan.com/api",
polygonMumbai: "https://api-mumbai.polygonscan.com/api",
Expand All @@ -160,7 +160,7 @@ export const BROWSER_URLS = {
polygonZkevm: "https://zkevm.polygonscan.com",
polygonZkevmGoerli: "https://testnet-zkevm.polygonscan.com",
paraxDev:
"https://explorerl2new-widespread-brown-mosquito-de4v5k1jm5.t.conduit.xyz",
"https://explorerl2new-surprised-harlequin-bonobo-fvcy2k9oqh.t.conduit.xyz",
polygon: "https://polygonscan.com",
matic: "https://polygonscan.com",
polygonMumbai: "https://mumbai.polygonscan.com",
Expand Down
3 changes: 2 additions & 1 deletion helpers/init-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@ export const initReservesByHelper = async (
variableDebtTokenToUse = stKSMVariableDebtTokenImplementationAddress;
} else if (
reserveSymbol === ERC20TokenContractId.aWETH ||
reserveSymbol === ERC20TokenContractId.awstETH
reserveSymbol === ERC20TokenContractId.awstETH ||
reserveSymbol === ERC20TokenContractId.aUSDC
) {
if (!pTokenATokenImplementationAddress) {
pTokenATokenImplementationAddress = (
Expand Down
1 change: 1 addition & 0 deletions helpers/misc-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const isPublicTestnet = (): boolean => {
].includes(DRE.network.config.chainId!) ||
[
eEthereumNetwork.goerli,
eEthereumNetwork.sepolia,
eEthereumNetwork.arbitrumGoerli,
eEthereumNetwork.arbitrumSepolia,
eEthereumNetwork.paraxDev,
Expand Down
2 changes: 2 additions & 0 deletions helpers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ export interface iAssetBase<T> {
DAI: T;
WETH: T;
USDC: T;
aUSDC: T;
USDT: T;
FRAX: T;
WBTC: T;
Expand Down Expand Up @@ -592,6 +593,7 @@ export enum ERC20TokenContractId {
DAI = "DAI",
WETH = "WETH",
USDC = "USDC",
aUSDC = "aUSDC",
USDT = "USDT",
FRAX = "FRAX",
WBTC = "WBTC",
Expand Down
10 changes: 9 additions & 1 deletion market-config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ import {
strategyEXRP,
strategyuBAYC,
strategyuPPG,
strategyAUSDC,
} from "./reservesConfigs";

export const CommonConfig: Pick<
Expand Down Expand Up @@ -667,9 +668,15 @@ export const ParaxDevConfig: IParaSpaceConfiguration = {
...CommonConfig,
ParaSpaceTeam: "0x018281853eCC543Aa251732e8FDaa7323247eBeB",
Treasury: "0x018281853eCC543Aa251732e8FDaa7323247eBeB",
ParaSpaceAdmin: "0x28abAC3E3F1fbC8Aa4Ded74C1589026038f889d8",
EmergencyAdmins: ["0x28abAC3E3F1fbC8Aa4Ded74C1589026038f889d8"],
RiskAdmin: "0x28abAC3E3F1fbC8Aa4Ded74C1589026038f889d8",
GatewayAdmin: "0x28abAC3E3F1fbC8Aa4Ded74C1589026038f889d8",
YogaLabs: {},
Uniswap: {},
Tokens: {},
Tokens: {
aUSDC: "0x259CdA67f5a3836aEBb207b94f0b57f548921631",
},
Marketplace: {},
Chainlink: {},
BendDAO: {},
Expand All @@ -694,6 +701,7 @@ export const ParaxDevConfig: IParaSpaceConfiguration = {
BLOCKS: strategyBLOCKS,
SEWER: strategySEWER,
PPG: strategyPudgyPenguins,
aUSDC: strategyAUSDC,
},
};

Expand Down
2 changes: 2 additions & 0 deletions market-config/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const MOCK_CHAINLINK_AGGREGATORS_PRICES = {
// ERC20
DAI: parseEther("0.000908578801039414").toString(),
USDC: parseEther("0.000915952223931999").toString(),
aUSDC: parseEther("0.000477910115122588").toString(),
USDT: parseEther("0.000915952223931999").toString(),
FRAX: parseEther("0.000915952223931999").toString(),
WETH: parseEther("1").toString(),
Expand Down Expand Up @@ -72,6 +73,7 @@ export const MOCK_CHAINLINK_AGGREGATORS_USD_PRICES = {
// ERC20
DAI: parseUnits("1", 8).toString(),
USDC: parseUnits("1", 8).toString(),
aUSDC: parseUnits("1", 8).toString(),
USDT: parseUnits("1", 8).toString(),
FRAX: parseUnits("1", 8).toString(),
WETH: parseUnits("1896", 8).toString(),
Expand Down
8 changes: 8 additions & 0 deletions market-config/rateStrategies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ export const rateStrategyUSDC: IInterestRateStrategyParams = {
variableRateSlope2: utils.parseUnits("0.60", 27).toString(),
};

export const rateStrategyaUSDC: IInterestRateStrategyParams = {
name: "rateStrategyaUSDC",
optimalUsageRatio: utils.parseUnits("0.9", 27).toString(),
baseVariableBorrowRate: utils.parseUnits("0", 27).toString(),
variableRateSlope1: utils.parseUnits("0.04", 27).toString(),
variableRateSlope2: utils.parseUnits("0.60", 27).toString(),
};

export const rateStrategyUSDT: IInterestRateStrategyParams = {
name: "rateStrategyUSDT",
optimalUsageRatio: utils.parseUnits("0.9", 27).toString(),
Expand Down
18 changes: 18 additions & 0 deletions market-config/reservesConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
rateStrategyAAVE,
rateStrategyAPE,
rateStrategyARB,
rateStrategyaUSDC,
rateStrategyBAL,
rateStrategyBLUR,
rateStrategyCRV,
Expand Down Expand Up @@ -114,6 +115,7 @@ import {
timeLockStrategyEXRP,
timeLockStrategyuPPG,
timeLockStrategyuBAYC,
timeLockStrategyaUSDC,
} from "./timeLockStrategies";

export const strategyDAI: IReserveParams = {
Expand Down Expand Up @@ -148,6 +150,22 @@ export const strategyUSDC: IReserveParams = {
supplyCap: "0",
};

export const strategyAUSDC: IReserveParams = {
strategy: rateStrategyaUSDC,
auctionStrategy: auctionStrategyZero,
timeLockStrategy: timeLockStrategyaUSDC,
baseLTVAsCollateral: "8700",
liquidationThreshold: "8900",
liquidationProtocolFeePercentage: "0",
liquidationBonus: "10450",
borrowingEnabled: true,
reserveDecimals: "6",
xTokenImpl: eContractid.PTokenATokenImpl,
reserveFactor: "1000",
borrowCap: "0",
supplyCap: "0",
};

export const strategyUSDT: IReserveParams = {
strategy: rateStrategyUSDT,
auctionStrategy: auctionStrategyZero,
Expand Down
12 changes: 12 additions & 0 deletions market-config/timeLockStrategies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ export const timeLockStrategyUSDC: ITimeLockStrategyParams = {
period: "86400",
};

export const timeLockStrategyaUSDC: ITimeLockStrategyParams = {
name: "timeLockStrategyaUSDC",
minThreshold: parseUnits("105000", 6).toString(),
midThreshold: parseUnits("400000", 6).toString(),
minWaitTime: "12",
midWaitTime: "7200",
maxWaitTime: "21600",
poolPeriodWaitTime: "600",
poolPeriodLimit: parseUnits("1875000", 6).toString(),
period: "86400",
};

export const timeLockStrategyUSDT: ITimeLockStrategyParams = {
name: "timeLockStrategyUSDT",
minThreshold: parseUnits("105000", 6).toString(),
Expand Down
10 changes: 6 additions & 4 deletions scripts/upgrade/accountAbstraction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ import {getAccountRegistry} from "../../helpers/contracts-getters";
import {dryRunEncodedData} from "../../helpers/contracts-helpers";
import {DRY_RUN, GLOBAL_OVERRIDES} from "../../helpers/hardhat-constants";
import {getParaSpaceConfig, waitForTx} from "../../helpers/misc-utils";
import {ZERO_ADDRESS} from "../../helpers/constants";

export const upgradeAccountAbstraction = async (verify = false) => {
console.time("deploy AccountAbstraction");
const paraSpaceConfig = getParaSpaceConfig();
const client = Client.init(paraSpaceConfig.AccountAbstraction.rpcUrl);
const accountRegistry = await getAccountRegistry();

const account = await deployAccount(
(
await client
).entryPoint.address,
paraSpaceConfig.AccountAbstraction?.rpcUrl
? (
await Client.init(paraSpaceConfig.AccountAbstraction.rpcUrl)
).entryPoint.address
: ZERO_ADDRESS,
verify
);

Expand Down

0 comments on commit cb918dd

Please sign in to comment.