@@ -30,7 +30,8 @@ import {
3030 singletonPaymaster07Abi ,
3131 singletonPaymaster08Abi
3232} from "./helpers/abi.js"
33- import type { PaymasterMode } from "./helpers/utils.js"
33+ import { getPaymasterUtilityWallet } from "./helpers/erc20-utils.js"
34+ import { type PaymasterMode , getPublicClient } from "./helpers/utils.js"
3435
3536export const getDummyPaymasterData = ( {
3637 is06,
@@ -240,13 +241,14 @@ export const getSignedPaymasterData = async ({
240241}
241242
242243export const deployPaymasters = async ( {
243- walletClient ,
244- publicClient
244+ anvilRpc ,
245+ paymasterSigner
245246} : {
246- walletClient : WalletClient < Transport , Chain , Account >
247- publicClient : PublicClient < Transport , Chain >
247+ anvilRpc : string
248+ paymasterSigner : Address
248249} ) => {
249- const owner = walletClient . account . address
250+ const walletClient = await getPaymasterUtilityWallet ( anvilRpc )
251+ const publicClient = await getPublicClient ( anvilRpc )
250252
251253 let nonce = await publicClient . getTransactionCount ( {
252254 address : walletClient . account . address
@@ -257,7 +259,7 @@ export const deployPaymasters = async ({
257259 to : constants . deterministicDeployer ,
258260 data : concat ( [
259261 constants . create2Salt ,
260- getSingletonPaymaster06InitCode ( walletClient . account . address )
262+ getSingletonPaymaster06InitCode ( paymasterSigner )
261263 ] ) ,
262264 nonce : nonce ++
263265 } )
@@ -267,7 +269,7 @@ export const deployPaymasters = async ({
267269 to : constants . deterministicDeployer ,
268270 data : concat ( [
269271 constants . create2Salt ,
270- getSingletonPaymaster07InitCode ( walletClient . account . address )
272+ getSingletonPaymaster07InitCode ( paymasterSigner )
271273 ] ) ,
272274 nonce : nonce ++
273275 } )
@@ -277,25 +279,25 @@ export const deployPaymasters = async ({
277279 to : constants . deterministicDeployer ,
278280 data : concat ( [
279281 constants . create2Salt ,
280- getSingletonPaymaster08InitCode ( walletClient . account . address )
282+ getSingletonPaymaster08InitCode ( paymasterSigner )
281283 ] ) ,
282284 nonce : nonce ++
283285 } )
284286
285287 // Initialize contract instances.
286288 const [ singletonPaymaster06 , singletonPaymaster07 , singletonPaymaster08 ] = [
287289 getContract ( {
288- address : getSingletonPaymaster06Address ( owner ) ,
290+ address : getSingletonPaymaster06Address ( paymasterSigner ) ,
289291 abi : singletonPaymaster06Abi ,
290292 client : walletClient
291293 } ) ,
292294 getContract ( {
293- address : getSingletonPaymaster07Address ( owner ) ,
295+ address : getSingletonPaymaster07Address ( paymasterSigner ) ,
294296 abi : singletonPaymaster07Abi ,
295297 client : walletClient
296298 } ) ,
297299 getContract ( {
298- address : getSingletonPaymaster08Address ( owner ) ,
300+ address : getSingletonPaymaster08Address ( paymasterSigner ) ,
299301 abi : singletonPaymaster08Abi ,
300302 client : walletClient
301303 } )
0 commit comments