Skip to content

Commit

Permalink
chore: fix parax dev deployment
Browse files Browse the repository at this point in the history
Signed-off-by: GopherJ <[email protected]>
  • Loading branch information
GopherJ committed Nov 28, 2023
1 parent d986b8b commit 7d78010
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 14 deletions.
2 changes: 2 additions & 0 deletions helpers/hardhat-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,3 +517,5 @@ export const XTOKEN_TYPE_UPGRADE_WHITELIST =
.map((x) => +x);
export const XTOKEN_SYMBOL_UPGRADE_WHITELIST =
process.env.XTOKEN_SYMBOL_UPGRADE_WHITELIST?.trim().split(/\s?,\s?/);

export const STACKUP_KEY = process.env.STACKUP_KEY || "";
2 changes: 1 addition & 1 deletion helpers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ export interface ICommonConfiguration {

Governance: IGovernanceConfig;

AccountAbstraction: IAccountAbstraction;
AccountAbstraction: IAccountAbstraction | undefined;
}

export interface IParaSpaceConfiguration extends ICommonConfiguration {
Expand Down
11 changes: 6 additions & 5 deletions market-config/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {ZERO_ADDRESS} from "../helpers/constants";
import {MULTI_SEND, MULTI_SIG} from "../helpers/hardhat-constants";
import {MULTI_SEND, MULTI_SIG, STACKUP_KEY} from "../helpers/hardhat-constants";
import {
eEthereumNetwork,
ERC20TokenContractId,
Expand Down Expand Up @@ -137,10 +137,7 @@ export const CommonConfig: Pick<
},
// ParaSpaceV1
ParaSpaceV1: undefined,
AccountAbstraction: {
rpcUrl: `https://api.stackup.sh/v1/node/${process.env.STACKUP_KEY}`,
paymasterUrl: `https://api.stackup.sh/v1/paymaster/${process.env.STACKUP_KEY}`,
},
AccountAbstraction: undefined,
};

export const HardhatConfig: IParaSpaceConfiguration = {
Expand Down Expand Up @@ -1078,6 +1075,10 @@ export const MainnetConfig: IParaSpaceConfiguration = {
TimeLockV1: "0x59B72FdB45B3182c8502cC297167FE4f821f332d",
P2PPairStakingV1: "0xf090Eb4c2B63e7B26E8Bb09e6Fc0cC3A7586263B",
},
AccountAbstraction: {
rpcUrl: `https://api.stackup.sh/v1/node/${STACKUP_KEY}`,
paymasterUrl: `https://api.stackup.sh/v1/paymaster/${STACKUP_KEY}`,
},
};

export const ParaSpaceConfigs: Partial<
Expand Down
10 changes: 6 additions & 4 deletions scripts/deployments/steps/10_allAggregators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ import {
getAllTokens,
getFirstSigner,
getPoolAddressesProvider,
getPriceOracle,
} from "../../../helpers/contracts-getters";
import {getEthersSignersAddresses} from "../../../helpers/contracts-helpers";
import {
getContractAddressInDb,
getEthersSignersAddresses,
} from "../../../helpers/contracts-helpers";
import {GLOBAL_OVERRIDES} from "../../../helpers/hardhat-constants";
import {getParaSpaceConfig, waitForTx} from "../../../helpers/misc-utils";
import {
Expand All @@ -23,6 +25,7 @@ import {
import {
ERC20TokenContractId,
ERC721TokenContractId,
eContractid,
} from "../../../helpers/types";

export const deployNftOracle = async (verify = false) => {
Expand Down Expand Up @@ -69,7 +72,6 @@ export const step_10 = async (verify = false) => {
try {
const allTokens = await getAllTokens();
const addressesProvider = await getPoolAddressesProvider();
const fallbackOracle = await getPriceOracle();
const paraSpaceConfig = getParaSpaceConfig();
const oracleConfig = paraSpaceConfig.Oracle;
const chainlinkConfig = paraSpaceConfig.Chainlink;
Expand All @@ -93,7 +95,7 @@ export const step_10 = async (verify = false) => {
addressesProvider.address,
tokens,
aggregators,
fallbackOracle.address,
(await getContractAddressInDb(eContractid.PriceOracle)) || ZERO_ADDRESS,
oracleConfig.BaseCurrency == ZERO_ADDRESS
? oracleConfig.BaseCurrency
: allTokens[oracleConfig.BaseCurrency].address,
Expand Down
13 changes: 9 additions & 4 deletions scripts/deployments/steps/24_accountAbstraction.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {ZERO_ADDRESS} from "../../../helpers/constants";
import {deployAccountFactory} from "../../../helpers/contracts-deployments";
import {getParaSpaceConfig, isLocalTestnet} from "../../../helpers/misc-utils";
import {Client} from "userop";
Expand All @@ -6,10 +7,14 @@ export const step_24 = async (verify = false) => {
const paraSpaceConfig = getParaSpaceConfig();
try {
if (!isLocalTestnet()) {
const client = Client.init(paraSpaceConfig.AccountAbstraction.rpcUrl);

const entryPoint = (await client).entryPoint.address;
await deployAccountFactory(entryPoint, verify);
await deployAccountFactory(
paraSpaceConfig.AccountAbstraction?.rpcUrl
? (
await Client.init(paraSpaceConfig.AccountAbstraction.rpcUrl)
).entryPoint.address
: ZERO_ADDRESS,
verify
);
}
} catch (error) {
console.error(error);
Expand Down

0 comments on commit 7d78010

Please sign in to comment.