diff --git a/README.md b/README.md index 075980fe..64f670a0 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,12 @@ Or follow the steps below: "enforceGasPrice": false, # do not bundle userops with low gas prices "enforceGasPriceThreshold": 1000, # gas price threshold in bps. If set to 500, userops' gas price is allowed to be 5% lower than the network's gas price "eip2930": false, # enables eip-2930 - "useropsTTL": 300 # Userops time to live (in seconds) + "useropsTTL": 300, # Userops time to live (in seconds) + "whitelistedEntities": { # Entities that bypass stake and opcode validation (array of addresses) + "factory": [], + "paymaster": [], + "account": [] + } } } } diff --git a/lerna.json b/lerna.json index 193089df..10b47daf 100644 --- a/lerna.json +++ b/lerna.json @@ -4,7 +4,7 @@ ], "npmClient": "yarn", "useWorkspaces": true, - "version": "1.0.21-alpha", + "version": "1.0.22-alpha", "stream": "true", "command": { "version": { diff --git a/package.json b/package.json index 0d71552d..e55eced3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "root", "private": true, - "version": "1.0.21-alpha", + "version": "1.0.22-alpha", "engines": { "node": ">=18.0.0" }, diff --git a/packages/api/package.json b/packages/api/package.json index cf53a169..ac53d6a4 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -1,6 +1,6 @@ { "name": "api", - "version": "1.0.21-alpha", + "version": "1.0.22-alpha", "description": "The API module of Etherspot bundler client", "author": "Etherspot", "homepage": "https://https://github.com/etherspot/skandha#readme", @@ -35,13 +35,13 @@ "class-transformer": "0.5.1", "class-validator": "0.14.0", "ethers": "5.7.2", - "executor": "^1.0.21-alpha", + "executor": "^1.0.22-alpha", "fastify": "4.14.1", - "monitoring": "^1.0.21-alpha", + "monitoring": "^1.0.22-alpha", "pino": "8.11.0", "pino-pretty": "10.0.0", "reflect-metadata": "0.1.13", - "types": "^1.0.21-alpha" + "types": "^1.0.22-alpha" }, "devDependencies": { "@types/connect": "3.4.35" diff --git a/packages/api/src/modules/redirect.ts b/packages/api/src/modules/redirect.ts index 4231d536..c3f9dc62 100644 --- a/packages/api/src/modules/redirect.ts +++ b/packages/api/src/modules/redirect.ts @@ -1,6 +1,6 @@ import { providers } from "ethers"; import { Config } from "executor/lib/config"; -import { NetworkName } from "types/src"; +import { NetworkName } from "types/lib"; export class RedirectAPI { private provider: providers.JsonRpcProvider; diff --git a/packages/cli/package.json b/packages/cli/package.json index 3e76fa4b..5ef465d5 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "cli", - "version": "1.0.21-alpha", + "version": "1.0.22-alpha", "description": "> TODO: description", "author": "zincoshine ", "homepage": "https://https://github.com/etherspot/skandha#readme", @@ -38,15 +38,15 @@ "@libp2p/peer-id-factory": "2.0.1", "@libp2p/prometheus-metrics": "1.1.3", "@multiformats/multiaddr": "12.1.3", - "api": "^1.0.21-alpha", - "db": "^1.0.21-alpha", - "executor": "^1.0.21-alpha", + "api": "^1.0.22-alpha", + "db": "^1.0.22-alpha", + "executor": "^1.0.22-alpha", "find-up": "5.0.0", "got": "12.5.3", "js-yaml": "4.1.0", - "monitoring": "^1.0.21-alpha", - "node": "^1.0.21-alpha", - "types": "^1.0.21-alpha", + "monitoring": "^1.0.22-alpha", + "node": "^1.0.22-alpha", + "types": "^1.0.22-alpha", "yargs": "17.6.2" }, "devDependencies": { diff --git a/packages/db/package.json b/packages/db/package.json index e96a339a..1a46ab25 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -1,6 +1,6 @@ { "name": "db", - "version": "1.0.21-alpha", + "version": "1.0.22-alpha", "description": "The DB module of Etherspot bundler client", "author": "Etherspot", "homepage": "https://github.com/etherspot/etherspot-bundler#readme", @@ -33,7 +33,7 @@ "dependencies": { "@chainsafe/ssz": "0.10.1", "@farcaster/rocksdb": "5.5.0", - "types": "^1.0.21-alpha" + "types": "^1.0.22-alpha" }, "devDependencies": { "@types/rocksdb": "3.0.1", diff --git a/packages/executor/package.json b/packages/executor/package.json index ae9cf749..60421fc5 100644 --- a/packages/executor/package.json +++ b/packages/executor/package.json @@ -1,6 +1,6 @@ { "name": "executor", - "version": "1.0.21-alpha", + "version": "1.0.22-alpha", "description": "The Relayer module of Etherspot bundler client", "author": "Etherspot", "homepage": "https://https://github.com/etherspot/skandha#readme", @@ -33,8 +33,8 @@ "dependencies": { "async-mutex": "0.4.0", "ethers": "5.7.2", - "monitoring": "^1.0.21-alpha", - "params": "^1.0.21-alpha", - "types": "^1.0.21-alpha" + "monitoring": "^1.0.22-alpha", + "params": "^1.0.22-alpha", + "types": "^1.0.22-alpha" } } diff --git a/packages/executor/src/config.ts b/packages/executor/src/config.ts index cbf05c93..47c865fd 100644 --- a/packages/executor/src/config.ts +++ b/packages/executor/src/config.ts @@ -1,6 +1,8 @@ // TODO: create a new package "config" instead of this file and refactor import { Wallet, providers, utils } from "ethers"; import { NetworkName } from "types/lib"; +import { IEntity } from "types/lib/executor"; +import { getAddress } from "ethers/lib/utils"; import { BundlerConfig, ConfigOptions, @@ -150,11 +152,19 @@ export class Config { if (!conf) { conf = {} as NetworkConfig; } - const entryPoints = ENTRYPOINTS_ENV(network); - conf.entryPoints = entryPoints || conf.entryPoints; - conf.relayer = fromEnvVar(network, "RELAYER", conf.relayer); - conf.beneficiary = fromEnvVar(network, "BENEFICIARY", conf.beneficiary); - conf.rpcEndpoint = fromEnvVar(network, "RPC", conf.rpcEndpoint); + conf.entryPoints = fromEnvVar( + network, + "ENTRYPOINTS", + conf.entryPoints, + true + ) as string[]; + conf.relayer = fromEnvVar(network, "RELAYER", conf.relayer) as string; + conf.beneficiary = fromEnvVar( + network, + "BENEFICIARY", + conf.beneficiary + ) as string; + conf.rpcEndpoint = fromEnvVar(network, "RPC", conf.rpcEndpoint) as string; if (this.testingMode && !conf.rpcEndpoint) { conf.rpcEndpoint = "http://localhost:8545"; // local geth @@ -164,7 +174,7 @@ export class Config { network, "ETHERSCAN_API_KEY", conf.etherscanApiKey || bundlerDefaultConfigs.etherscanApiKey - ); + ) as string; conf.receiptLookupRange = Number( fromEnvVar( network, @@ -184,7 +194,7 @@ export class Config { network, "RPC_SUBMIT", conf.rpcEndpointSubmit || bundlerDefaultConfigs.rpcEndpointSubmit - ); + ) as string; conf.gasPriceMarkup = Number( fromEnvVar( network, @@ -230,6 +240,32 @@ export class Config { ) ); + if (!conf.whitelistedEntities) { + conf.whitelistedEntities = bundlerDefaultConfigs.whitelistedEntities; + } + + /** + * validate whitelist addresses + */ + for (const entity of ["paymaster", "account", "factory"]) { + conf.whitelistedEntities[entity as IEntity] = fromEnvVar( + network, + `WL_${entity.toUpperCase()}`, + conf.whitelistedEntities[entity as IEntity], + true + ) as string[]; + const entities = conf.whitelistedEntities[entity as IEntity]; + if (typeof entities != "undefined" && typeof entities != "object") { + throw new Error("Invalid config"); + } + if (typeof entities == "object") { + for (const address of entities) { + // will throw error if the address is invalid + getAddress(address); + } + } + } + return Object.assign({}, bundlerDefaultConfigs, conf); } } @@ -251,6 +287,7 @@ const bundlerDefaultConfigs: BundlerConfig = { enforceGasPriceThreshold: 1000, eip2930: false, useropsTTL: 300, // 5 minutes + whitelistedEntities: { paymaster: [], account: [], factory: [] }, }; const NETWORKS_ENV = (): string[] | undefined => { @@ -260,13 +297,6 @@ const NETWORKS_ENV = (): string[] | undefined => { } return undefined; }; -const ENTRYPOINTS_ENV = (network: string): string[] | undefined => { - const entryPoints = fromEnvVar(network, "ENTRYPOINTS", ""); - if (entryPoints) { - return entryPoints.toLowerCase().replace(/ /g, "").split(","); - } - return undefined; -}; /** * str = baseGoerli => SKANDHA_BASE_GOERLI @@ -290,8 +320,16 @@ function getEnvVar(envVar: string, fallback: T): T | string { function fromEnvVar( networkName: string, suffix = "", - fallback: T -): T | string { - const envVar = strToEnv(networkName, suffix); - return getEnvVar(envVar, fallback); + fallback: T, + isArray = false +): T | string | string[] { + const envVarName = strToEnv(networkName, suffix); + const envVarOrFallback = getEnvVar(envVarName, fallback); + if (isArray && typeof envVarOrFallback === "string") { + return (envVarOrFallback as string) + .toLowerCase() + .replace(/ /g, "") + .split(","); + } + return envVarOrFallback; } diff --git a/packages/executor/src/interfaces.ts b/packages/executor/src/interfaces.ts index e56da370..3fba9c05 100644 --- a/packages/executor/src/interfaces.ts +++ b/packages/executor/src/interfaces.ts @@ -1,5 +1,6 @@ import { BigNumber, BigNumberish, BytesLike } from "ethers"; import { NetworkName } from "types/lib"; +import { IWhitelistedEntities } from "types/lib/executor"; import { Executor } from "./executor"; import { MempoolEntry } from "./entities/MempoolEntry"; @@ -119,6 +120,9 @@ export interface NetworkConfig { // default is 300 (5 minutes) // after ttl you can replace a userop without increasing gas fees useropsTTL: number; + // Entities that bypass stake and opcode validation + // https://eips.ethereum.org/EIPS/eip-4337#alternative-mempools + whitelistedEntities: IWhitelistedEntities; } export type BundlerConfig = Omit< diff --git a/packages/executor/src/modules/skandha.ts b/packages/executor/src/modules/skandha.ts index eeb63bba..146dc1af 100644 --- a/packages/executor/src/modules/skandha.ts +++ b/packages/executor/src/modules/skandha.ts @@ -113,6 +113,8 @@ export class Skandha { this.networkConfig.enforceGasPriceThreshold ).toNumber(), eip2930: this.networkConfig.eip2930, + useropsTTL: this.networkConfig.useropsTTL, + whitelistedEntities: this.networkConfig.whitelistedEntities, }; } diff --git a/packages/executor/src/services/UserOpValidation/service.ts b/packages/executor/src/services/UserOpValidation/service.ts index 24f05727..725e55b2 100644 --- a/packages/executor/src/services/UserOpValidation/service.ts +++ b/packages/executor/src/services/UserOpValidation/service.ts @@ -42,6 +42,7 @@ export class UserOpValidationService { this.provider, this.reputationService, this.chainId, + this.networkConfig, this.network, this.logger ); diff --git a/packages/executor/src/services/UserOpValidation/validators/safe.ts b/packages/executor/src/services/UserOpValidation/validators/safe.ts index 6fbd6f3b..f54a1aed 100644 --- a/packages/executor/src/services/UserOpValidation/validators/safe.ts +++ b/packages/executor/src/services/UserOpValidation/validators/safe.ts @@ -7,13 +7,13 @@ import { BigNumber, ethers, providers } from "ethers"; import { BundlerCollectorReturn, ExitInfo } from "types/lib/executor"; import RpcError from "types/lib/api/errors/rpc-error"; import * as RpcErrorCodes from "types/lib/api/errors/rpc-error-codes"; -import { WhitelistedEntities } from "params/lib/whitelisted-entities"; import { NetworkName, Logger } from "types/lib"; +import { IWhitelistedEntities } from "types/lib/executor"; import { - IWhitelistedEntities, - IWhitelistedEntity, -} from "params/lib/types/IWhitelistedEntities"; -import { StorageMap, UserOpValidationResult } from "../../../interfaces"; + NetworkConfig, + StorageMap, + UserOpValidationResult, +} from "../../../interfaces"; import { GethTracer } from "../GethTracer"; import { callsFromEntryPointMethodSigs, @@ -58,6 +58,7 @@ export class SafeValidationService { private provider: providers.Provider, private reputationService: ReputationService, private chainId: number, + private networkConfig: NetworkConfig, private network: NetworkName, private logger: Logger ) { @@ -255,15 +256,18 @@ export class SafeValidationService { ); } - const whitelist: IWhitelistedEntity | undefined = - WhitelistedEntities[entityTitle as keyof IWhitelistedEntities]; + const whitelist = + this.networkConfig.whitelistedEntities[ + entityTitle as keyof IWhitelistedEntities + ]; if ( entityAddr && whitelist != null && // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions - whitelist[this.chainId] && - whitelist[this.chainId]!.some( - (addr) => addr === ethers.utils.getAddress(entityAddr) + whitelist.some( + (addr) => + ethers.utils.getAddress(addr) === + ethers.utils.getAddress(entityAddr) ) ) { this.logger.debug( diff --git a/packages/monitoring/package.json b/packages/monitoring/package.json index dfb3bbdf..b5c7423c 100644 --- a/packages/monitoring/package.json +++ b/packages/monitoring/package.json @@ -1,6 +1,6 @@ { "name": "monitoring", - "version": "1.0.21-alpha", + "version": "1.0.22-alpha", "description": "The Monitoring module of Etherspot bundler client", "author": "Etherspot", "homepage": "https://github.com/etherspot/etherspot-bundler#readme", @@ -32,6 +32,6 @@ }, "dependencies": { "prom-client": "^14.2.0", - "types": "^1.0.21-alpha" + "types": "^1.0.22-alpha" } } diff --git a/packages/node/package.json b/packages/node/package.json index 27ea8320..dfabcf53 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -1,6 +1,6 @@ { "name": "node", - "version": "1.0.21-alpha", + "version": "1.0.22-alpha", "description": "The bundler node module of Etherspot bundler client", "author": "Etherspot", "homepage": "https://https://github.com/etherspot/skandha#readme", @@ -56,25 +56,25 @@ "@libp2p/tcp": "6.1.0", "@multiformats/multiaddr": "11.4.0", "abstract-leveldown": "7.2.0", - "api": "^1.0.21-alpha", + "api": "^1.0.22-alpha", "datastore-core": "8.0.1", - "db": "^1.0.21-alpha", + "db": "^1.0.22-alpha", "ethers": "5.7.2", - "executor": "^1.0.21-alpha", + "executor": "^1.0.22-alpha", "it-filter": "1.0.2", "it-map": "1.0.5", "it-sort": "1.0.0", "it-take": "1.0.1", "libp2p": "0.42.2", - "monitoring": "^1.0.21-alpha", - "params": "^1.0.21-alpha", + "monitoring": "^1.0.22-alpha", + "params": "^1.0.22-alpha", "prettier": "2.8.4", "snappy": "7.2.2", "snappyjs": "0.7.0", "stream-to-it": "0.2.4", "strict-event-emitter-types": "2.0.0", - "types": "^1.0.21-alpha", - "utils": "^1.0.21-alpha", + "types": "^1.0.22-alpha", + "utils": "^1.0.22-alpha", "varint": "6.0.0", "xxhash-wasm": "1.0.2" }, diff --git a/packages/params/package.json b/packages/params/package.json index c852600e..477bfa15 100644 --- a/packages/params/package.json +++ b/packages/params/package.json @@ -1,6 +1,6 @@ { "name": "params", - "version": "1.0.21-alpha", + "version": "1.0.22-alpha", "description": "Various bundler parameters", "author": "Etherspot", "homepage": "https://github.com/etherspot/skandha#readme", @@ -26,8 +26,8 @@ "@eth-optimism/sdk": "3.0.0", "@mantleio/sdk": "0.2.1", "ethers": "5.7.2", - "types": "^1.0.21-alpha", - "utils": "^1.0.21-alpha" + "types": "^1.0.22-alpha", + "utils": "^1.0.22-alpha" }, "scripts": { "clean": "rm -rf lib && rm -f *.tsbuildinfo", diff --git a/packages/params/src/types/IWhitelistedEntities.ts b/packages/params/src/types/IWhitelistedEntities.ts deleted file mode 100644 index bae3af57..00000000 --- a/packages/params/src/types/IWhitelistedEntities.ts +++ /dev/null @@ -1,9 +0,0 @@ -export type IEntity = "paymaster" | "account" | "factory"; - -export type IWhitelistedEntity = { - [chainId: number]: string[]; -}; - -export type IWhitelistedEntities = { - [entity in IEntity]: IWhitelistedEntity; -}; diff --git a/packages/params/src/whitelisted-entities/accounts.ts b/packages/params/src/whitelisted-entities/accounts.ts deleted file mode 100644 index 80b1b914..00000000 --- a/packages/params/src/whitelisted-entities/accounts.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IWhitelistedEntity } from "../types/IWhitelistedEntities"; - -export const WhitelistedAccounts: IWhitelistedEntity = {}; diff --git a/packages/params/src/whitelisted-entities/factories.ts b/packages/params/src/whitelisted-entities/factories.ts deleted file mode 100644 index 7c36c76a..00000000 --- a/packages/params/src/whitelisted-entities/factories.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { getAddress } from "ethers/lib/utils"; -import { IWhitelistedEntity } from "../types/IWhitelistedEntities"; - -export const WhitelistedFactories: IWhitelistedEntity = { - // Etherspot Paymasters - // ref: https://github.com/etherspot/etherspot-prime-contracts/blob/master/DEPLOYMENTS.md - 1: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 42161: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 10: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 137: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 122: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 100: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 5000: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 43114: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 56: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 8453: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 59144: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 5: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 11155111: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 421613: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 420: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 80001: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 123: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 84531: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 10200: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 43113: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 97: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 59140: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 534351: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 5001: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 14: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 16: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 114: [getAddress("0x7f6d8F107fE8551160BD5351d5F1514A6aD5d40E")], - 3068: [getAddress("0x527bAb8bDC50A809d7c35D0129173BBed55C5EAE")], - 49088: [getAddress("0x527bAb8bDC50A809d7c35D0129173BBed55C5EAE")], -}; diff --git a/packages/params/src/whitelisted-entities/index.ts b/packages/params/src/whitelisted-entities/index.ts deleted file mode 100644 index 3be49971..00000000 --- a/packages/params/src/whitelisted-entities/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { IWhitelistedEntities } from "../types/IWhitelistedEntities"; -import { WhitelistedAccounts } from "./accounts"; -import { WhitelistedFactories } from "./factories"; -import { WhitelistedPaymasters } from "./paymasters"; - -export const WhitelistedEntities: IWhitelistedEntities = { - factory: WhitelistedFactories, - account: WhitelistedAccounts, - paymaster: WhitelistedPaymasters, -}; diff --git a/packages/params/src/whitelisted-entities/paymasters.ts b/packages/params/src/whitelisted-entities/paymasters.ts deleted file mode 100644 index 857a3621..00000000 --- a/packages/params/src/whitelisted-entities/paymasters.ts +++ /dev/null @@ -1,149 +0,0 @@ -import { getAddress } from "ethers/lib/utils"; -import { IWhitelistedEntity } from "../types/IWhitelistedEntities"; - -export const WhitelistedPaymasters: IWhitelistedEntity = { - 1: [ - // Stackup - // https://docs.stackup.sh/docs/entity-addresses - getAddress("0xE93ECa6595fe94091DC1af46aaC2A8b5D7990770"), - ], - 137: [ - // Pimlico - // https://docs.pimlico.io/reference/erc20-paymaster/contracts - getAddress("0xa683b47e447De6c8A007d9e294e87B6Db333Eb18"), - - // Stackup - // https://docs.stackup.sh/docs/entity-addresses - getAddress("0x474Ea64BEdDE53aaD1084210BD60eeF2989bF80f"), - getAddress("0xE93ECa6595fe94091DC1af46aaC2A8b5D7990770"), - getAddress("0x3870419Ba2BBf0127060bCB37f69A1b1C090992B"), - ], - // Arbitrum - 42161: [ - // Pimlico - // https://docs.pimlico.io/reference/erc20-paymaster/contracts - getAddress("0x49EE41bC335Fb36be46A17307dcFe536A3494644"), - - // Stackup - // https://docs.stackup.sh/docs/entity-addresses - getAddress("0xE93ECa6595fe94091DC1af46aaC2A8b5D7990770"), - - // Testing - getAddress("0xA1748d4A93e361e186B7bC19a733f79601315aDe"), - getAddress("0xB55B04045fA72374bF94FCB32cDd63bD81cC4b07"), - getAddress("0x667d2fc02c34a557A87EC7F62FeAe3CA2BabD5d3"), - getAddress("0xde07AF31A650cd77c5F2A69501e7d90c4836F660"), - getAddress("0xE0221Db5bF2F3C22d6639a749B764f52f5B05dfb"), - ], - 56: [ - // Stackup - // https://docs.stackup.sh/docs/entity-addresses - getAddress("0xE93ECa6595fe94091DC1af46aaC2A8b5D7990770"), - ], - // Optimism - 10: [ - // Stackup - // https://docs.stackup.sh/docs/entity-addresses - getAddress("0xE93ECa6595fe94091DC1af46aaC2A8b5D7990770"), - - // Testing - getAddress("0x071Cdd89455eD5e8f09215709bf1fe6DB0ba8249"), - getAddress("0x99fB8d618F52a42049776899D5c07241D344a8A4"), - getAddress("0x3bE5380ec8cfe159f0525d16d11E9Baba516C40c"), - getAddress("0x9102889001d0901b3d9123651d492e52ce772C6b"), - getAddress("0x875329626E55Cc890b6444b497B1E369f45379F9"), - getAddress("0xD5FD5b4AeF90055a55Dd97A3cCA10c18A653E16b"), - getAddress("0xC016585AbCdBD09AB2b9E1C782486B06b8bbEeF7"), - getAddress("0x950BD6AF4EEe695c1Be4D4335E8710B511356e59"), - ], - 100: [ - // Stackup - // https://docs.stackup.sh/docs/entity-addresses - getAddress("0xE93ECa6595fe94091DC1af46aaC2A8b5D7990770"), - ], - // Flare - 14: [ - // eUSDT - getAddress("0x6Bb048981E67f1a0aD41c0BD05635244d3ADaA2c"), - ], - // Mantle - 5000: [ - getAddress("0x5E23Cf2A0218fA9C23FFF1BD533061927D393926"), - getAddress("0xa5Eec6090Eb116a9069190069bA02bFc1Da90C25"), - getAddress("0xa44dD89317304BcC47775c18eab6e8fbe575b782"), - getAddress("0xAc1145E62BD80FCd5A11c930a99DeB57CE665D4D"), - getAddress("0x0D8224e05f4B3020A629e8f4708F4C31bb860c22"), - ], - - /* ====== TESTNETS ====== */ - 5: [ - // Pimlico - // https://docs.pimlico.io/reference/erc20-paymaster/contracts - getAddress("0xEc43912D8C772A0Eba5a27ea5804Ba14ab502009"), - - // Stackup - // https://docs.stackup.sh/docs/entity-addresses - getAddress("0xE93ECa6595fe94091DC1af46aaC2A8b5D7990770"), - getAddress("0x3870419Ba2BBf0127060bCB37f69A1b1C090992B"), - ], - 80001: [ - // Pimlico - // https://docs.pimlico.io/reference/erc20-paymaster/contracts - getAddress("0x32aCDFeA07a614E52403d2c1feB747aa8079A353"), - - // Stackup - // https://docs.stackup.sh/docs/entity-addresses - getAddress("0xE93ECa6595fe94091DC1af46aaC2A8b5D7990770"), - getAddress("0x3870419Ba2BBf0127060bCB37f69A1b1C090992B"), - ], - 84531: [ - // Pimlico - // https://docs.pimlico.io/reference/erc20-paymaster/contracts - getAddress("0x13f490FafBb206440F25760A10C21A6220017fFa"), - - // Stackup - // https://docs.stackup.sh/docs/entity-addresses - getAddress("0xE93ECa6595fe94091DC1af46aaC2A8b5D7990770"), - getAddress("0x3870419Ba2BBf0127060bCB37f69A1b1C090992B"), - ], - 97: [ - // Stackup - // https://docs.stackup.sh/docs/entity-addresses - getAddress("0xE93ECa6595fe94091DC1af46aaC2A8b5D7990770"), - getAddress("0x3870419Ba2BBf0127060bCB37f69A1b1C090992B"), - ], - // Optimism Goerli - 420: [ - // Stackup - // https://docs.stackup.sh/docs/entity-addresses - getAddress("0xE93ECa6595fe94091DC1af46aaC2A8b5D7990770"), - getAddress("0x3870419Ba2BBf0127060bCB37f69A1b1C090992B"), - - // Testing - getAddress("0x53F48579309f8dBfFE4edE921C50200861C2482a"), - ], - 11155111: [ - // Stackup - // https://docs.stackup.sh/docs/entity-addresses - getAddress("0xE93ECa6595fe94091DC1af46aaC2A8b5D7990770"), - getAddress("0x3870419Ba2BBf0127060bCB37f69A1b1C090992B"), - ], - // Arbitrum testnet - 421613: [ - // Stackup - // https://docs.stackup.sh/docs/entity-addresses - getAddress("0xE93ECa6595fe94091DC1af46aaC2A8b5D7990770"), - getAddress("0x3870419Ba2BBf0127060bCB37f69A1b1C090992B"), - - // Testing - getAddress("0x0a6Aa1Bd30D6954cA525315287AdeeEcbb6eFB59"), - ], - // Coston 2 - 114: [ - // USDC/ETH - getAddress("0x8b067387ec0B922483Eadb771bc9290194685522"), - ], - - // Mantle testnet - 5001: [getAddress("0x6Ea25cbb60360243E871dD935225A293a78704a8")], -}; diff --git a/packages/types/package.json b/packages/types/package.json index 97fba08d..01799f05 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "types", - "version": "1.0.21-alpha", + "version": "1.0.22-alpha", "description": "The types of Etherspot bundler client", "author": "Etherspot", "homepage": "https://https://github.com/etherspot/skandha#readme", diff --git a/packages/types/src/api/interfaces.ts b/packages/types/src/api/interfaces.ts index 4705bbff..29589a69 100644 --- a/packages/types/src/api/interfaces.ts +++ b/packages/types/src/api/interfaces.ts @@ -1,5 +1,6 @@ import { BigNumberish, providers } from "ethers"; import { UserOperationStruct } from "../executor/contracts/EntryPoint"; +import { IWhitelistedEntities } from "../executor"; export type EstimatedUserOperationGas = | { @@ -69,6 +70,8 @@ export type GetConfigResponse = { enforceGasPrice: boolean; enforceGasPriceThreshold: number; eip2930: boolean; + useropsTTL: number; + whitelistedEntities: IWhitelistedEntities; }; export type SupportedEntryPoints = string[]; diff --git a/packages/types/src/executor/IWhitelistedEntities.ts b/packages/types/src/executor/IWhitelistedEntities.ts new file mode 100644 index 00000000..37e51f6c --- /dev/null +++ b/packages/types/src/executor/IWhitelistedEntities.ts @@ -0,0 +1,5 @@ +export type IEntity = "paymaster" | "account" | "factory"; + +export type IWhitelistedEntities = { + [entity in IEntity]?: string[]; +}; diff --git a/packages/types/src/executor/index.ts b/packages/types/src/executor/index.ts index 2041c8cf..2e59b370 100644 --- a/packages/types/src/executor/index.ts +++ b/packages/types/src/executor/index.ts @@ -10,3 +10,4 @@ export enum ReputationStatus { } export * from "./validation"; +export * from "./IWhitelistedEntities"; diff --git a/packages/utils/package.json b/packages/utils/package.json index 0d73c2f9..2f9eb97b 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "utils", - "version": "1.0.21-alpha", + "version": "1.0.22-alpha", "description": "utils of Etherspot bundler client", "author": "Etherspot", "homepage": "https://https://github.com/etherspot/skandha#readme", @@ -37,6 +37,6 @@ "case": "^1.6.3", "pino": "8.11.0", "pino-pretty": "10.0.0", - "types": "^1.0.21-alpha" + "types": "^1.0.22-alpha" } }