Skip to content

Commit

Permalink
feat: add frax and zora defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-miao committed Apr 22, 2024
1 parent e57aaa5 commit 4828332
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 10 deletions.
5 changes: 5 additions & 0 deletions packages/accounts/plugindefs/multi-owner/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
polygonMumbai,
sepolia,
} from "@alchemy/aa-core";
import { fraxtal, fraxtalTestnet, zora, zoraSepolia } from "viem/chains";
import { parseAbiParameters } from "viem";
import type { PluginGenConfig } from "../types";
import { MultiOwnerPluginAbi } from "./abi.js";
Expand All @@ -29,6 +30,10 @@ export const MultiOwnerPluginGenConfig: PluginGenConfig = {
[arbitrumSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
[base.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
[baseSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
[fraxtal.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
[fraxtalTestnet.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
[zora.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
[zoraSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
},
chain: sepolia,
installConfig: {
Expand Down
5 changes: 5 additions & 0 deletions packages/accounts/plugindefs/multisig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
arbitrumSepolia,
base,
} from "@alchemy/aa-core";
import { fraxtal, fraxtalTestnet, zora, zoraSepolia } from "viem/chains";
import { parseAbiParameters } from "viem";
import type { PluginGenConfig } from "../types";
import { MultisigPluginAbi } from "./abi.js";
Expand All @@ -28,6 +29,10 @@ export const MultisigPluginGenConfig: PluginGenConfig = {
[arbitrum.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
[arbitrumSepolia.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
[base.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
[fraxtal.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
[fraxtalTestnet.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
[zora.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
[zoraSepolia.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
},
chain: sepolia,
installConfig: {
Expand Down
5 changes: 5 additions & 0 deletions packages/accounts/plugindefs/session-key/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
polygonMumbai,
sepolia,
} from "@alchemy/aa-core";
import { fraxtal, fraxtalTestnet, zora, zoraSepolia } from "viem/chains";
import { parseAbiParameters } from "viem";
import { MultiOwnerPluginGenConfig } from "../multi-owner/config.js";
import type { PluginGenConfig } from "../types";
Expand All @@ -30,6 +31,10 @@ export const SessionKeyPluginGenConfig: PluginGenConfig = {
[arbitrumSepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
[base.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
[baseSepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
[fraxtal.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
[fraxtalTestnet.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
[zora.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
[zoraSepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
},
chain: sepolia,
installConfig: {
Expand Down
5 changes: 5 additions & 0 deletions packages/accounts/src/light-account/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
toRecord,
type SmartContractAccount,
} from "@alchemy/aa-core";
import { fraxtal, fraxtalTestnet, zora, zoraSepolia } from "viem/chains";
import { fromHex, type Address, type Chain } from "viem";
import type { LightAccountBase } from "./accounts/base";
import type {
Expand All @@ -43,6 +44,10 @@ export const supportedChains: Chain[] = [
base,
baseGoerli,
baseSepolia,
fraxtal,
fraxtalTestnet,
zora,
zoraSepolia,
];

export const AccountVersionRegistry: IAccountVersionRegistry = {
Expand Down
5 changes: 5 additions & 0 deletions packages/accounts/src/msca/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
type SmartContractAccountWithSigner,
type UpgradeToData,
} from "@alchemy/aa-core";
import { fraxtal, fraxtalTestnet, zora, zoraSepolia } from "viem/chains";
import type { Address, Chain, Transport } from "viem";
import {
custom,
Expand Down Expand Up @@ -97,6 +98,10 @@ export const getDefaultMultiOwnerModularAccountFactoryAddress = (
case arbitrumSepolia.id:
case base.id:
case baseGoerli.id:
case fraxtal.id:
case fraxtalTestnet.id:
case zora.id:
case zoraSepolia.id:
return "0x000000e92D78D90000007F0082006FDA09BD5f11";
}
throw new DefaultFactoryNotDefinedError(
Expand Down
9 changes: 3 additions & 6 deletions packages/alchemy/src/gas-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ import {
arbitrumSepolia,
base,
baseSepolia,
fraxtal,
fraxtalTestnet,
mainnet,
sepolia,
optimism,
optimismSepolia,
polygon,
polygonAmoy,
polygonMumbai,
sepolia,
zora,
zoraSepolia,
} from "viem/chains";
} from "@alchemy/aa-core";
import { fraxtal, fraxtalTestnet, zora, zoraSepolia } from "viem/chains";

export const AlchemyPaymasterAddressV3 =
"0x4f84a207A80c39E9e8BaE717c1F25bA7AD1fB08F";
Expand Down
7 changes: 6 additions & 1 deletion packages/core/src/entrypoint/0.6.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import {
polygonAmoy,
polygonMumbai,
sepolia,
} from "viem/chains";
} from "@alchemy/aa-core";
import { fraxtal, fraxtalTestnet, zora, zoraSepolia } from "viem/chains";
import { EntryPointAbi_v6 } from "../abis/EntryPointAbi_v6.js";
import type { UserOperationRequest } from "../types.js";
import type { SupportedEntryPoint } from "./types.js";
Expand Down Expand Up @@ -80,6 +81,10 @@ export default {
[base.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
[baseGoerli.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
[baseSepolia.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
[fraxtal.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
[fraxtalTestnet.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
[zora.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
[zoraSepolia.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
},

abi: EntryPointAbi_v6,
Expand Down
7 changes: 6 additions & 1 deletion packages/core/src/entrypoint/0.7.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import {
polygonAmoy,
polygonMumbai,
sepolia,
} from "viem/chains";
} from "@alchemy/aa-core";
import { fraxtal, fraxtalTestnet, zora, zoraSepolia } from "viem/chains";
import { EntryPointAbi_v7 } from "../abis/EntryPointAbi_v7.js";
import type {
UserOperationRequest,
Expand Down Expand Up @@ -113,6 +114,10 @@ export default {
[base.id]: "0x0000000071727De22E5E9d8BAf0edAc6f37da032",
[baseGoerli.id]: "0x0000000071727De22E5E9d8BAf0edAc6f37da032",
[baseSepolia.id]: "0x0000000071727De22E5E9d8BAf0edAc6f37da032",
[fraxtal.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
[fraxtalTestnet.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
[zora.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
[zoraSepolia.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
},

abi: EntryPointAbi_v7,
Expand Down
13 changes: 11 additions & 2 deletions packages/core/src/utils/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
polygonMumbai,
sepolia,
} from "../chains/index.js";
import { fraxtal, fraxtalTestnet, zora, zoraSepolia } from "viem/chains";
import { defaultEntryPointVersion } from "../entrypoint/index.js";
import type { EntryPointVersion } from "../entrypoint/types.js";
import { DefaultFactoryNotDefinedError } from "../errors/account.js";
Expand All @@ -37,18 +38,22 @@ export const getDefaultSimpleAccountFactoryAddress = (
switch (chain.id) {
case mainnet.id:
case polygon.id:
case polygonAmoy.id:
case optimism.id:
case optimismSepolia.id:
case arbitrum.id:
case arbitrumSepolia.id:
case base.id:
case baseGoerli.id:
case baseSepolia.id:
case arbitrumSepolia.id:
case fraxtal.id:
case fraxtalTestnet.id:
case zora.id:
case zoraSepolia.id:
return "0x15Ba39375ee2Ab563E8873C8390be6f2E2F50232";
case sepolia.id:
case goerli.id:
case polygonMumbai.id:
case polygonAmoy.id:
case optimismGoerli.id:
case arbitrumGoerli.id:
return "0x9406Cc6185a346906296840746125a0E44976454";
Expand All @@ -69,6 +74,10 @@ export const getDefaultSimpleAccountFactoryAddress = (
case base.id:
case baseSepolia.id:
case sepolia.id:
case fraxtal.id:
case fraxtalTestnet.id:
case zora.id:
case zoraSepolia.id:
return "0x91E60e0613810449d098b0b5Ec8b51A0FE8c8985";
default:
break;
Expand Down

0 comments on commit 4828332

Please sign in to comment.