diff --git a/helpers/hardhat-constants.ts b/helpers/hardhat-constants.ts index 79f91da3..93a986c2 100644 --- a/helpers/hardhat-constants.ts +++ b/helpers/hardhat-constants.ts @@ -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 || ""; diff --git a/helpers/types.ts b/helpers/types.ts index e6317c71..7cdf7da7 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -953,7 +953,7 @@ export interface ICommonConfiguration { Governance: IGovernanceConfig; - AccountAbstraction: IAccountAbstraction; + AccountAbstraction: IAccountAbstraction | undefined; } export interface IParaSpaceConfiguration extends ICommonConfiguration { diff --git a/market-config/index.ts b/market-config/index.ts index 4e8e5930..f18fda77 100644 --- a/market-config/index.ts +++ b/market-config/index.ts @@ -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, @@ -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 = { @@ -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< diff --git a/scripts/deployments/steps/10_allAggregators.ts b/scripts/deployments/steps/10_allAggregators.ts index 39469b58..0280a8b3 100644 --- a/scripts/deployments/steps/10_allAggregators.ts +++ b/scripts/deployments/steps/10_allAggregators.ts @@ -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 { @@ -23,6 +25,7 @@ import { import { ERC20TokenContractId, ERC721TokenContractId, + eContractid, } from "../../../helpers/types"; export const deployNftOracle = async (verify = false) => { @@ -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; @@ -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, diff --git a/scripts/deployments/steps/24_accountAbstraction.ts b/scripts/deployments/steps/24_accountAbstraction.ts index 46399bdb..e95edad2 100644 --- a/scripts/deployments/steps/24_accountAbstraction.ts +++ b/scripts/deployments/steps/24_accountAbstraction.ts @@ -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"; @@ -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);