Skip to content

Commit

Permalink
fix 7560stakeManager, nonceManager addresses
Browse files Browse the repository at this point in the history
using different compiler settings.
also, sanity-check addresses
  • Loading branch information
drortirosh committed Feb 19, 2025
1 parent c85351a commit 4d022d8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
17 changes: 14 additions & 3 deletions packages/bundler/src/runBundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ import { MethodHandlerERC4337 } from './MethodHandlerERC4337'

import { initServer } from './modules/initServer'
import { DebugMethodHandler } from './DebugMethodHandler'
import { supportsDebugTraceCall, supportsNativeTracer } from '@account-abstraction/validation-manager'
import {
AA_NONCE_MANAGER,
AA_STAKE_MANAGER,
supportsDebugTraceCall,
supportsNativeTracer
} from '@account-abstraction/validation-manager'
import { resolveConfiguration } from './Config'
import { bundlerConfigDefault } from './BundlerConfig'
import { parseEther } from 'ethers/lib/utils'
Expand Down Expand Up @@ -155,8 +160,14 @@ export async function runBundler (argv: string[], overrideExit = true): Promise<

if (config.rip7560) {
try {
await deployNonceManager(provider, wallet as any)
await deployStakeManager(provider, wallet as any)
const nonceManager = await deployNonceManager(provider, wallet as any)
if (nonceManager.address !== AA_NONCE_MANAGER) {
throw new Error(`NonceManager deployed at ${nonceManager.address} does not match constant AA_NONCE_MANAGER=${AA_NONCE_MANAGER}`)
}
const stakeManager = await deployStakeManager(provider, wallet as any)
if (stakeManager.address !== AA_STAKE_MANAGER) {
throw new Error(`StakeManager deployed at ${stakeManager.address} does not match constant AA_STAKE_MANAGER=${AA_NONCE_MANAGER}`)
}
} catch (e: any) {
console.warn(e)
if (!(e.message as string).includes('replacement fee too low') && !(e.message as string).includes('already known')) throw e
Expand Down
3 changes: 2 additions & 1 deletion packages/utils/src/RIP7712NonceManagerUtils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { JsonRpcProvider } from '@ethersproject/providers'

import { bytecode as nonceManagerByteCode } from '../artifacts/@account-abstraction/rip7560/contracts/predeploys/NonceManager.sol/NonceManager.json'
import { bytecode as nonceManagerByteCode } from '@account-abstraction/rip7560/artifacts/contracts/predeploys/NonceManager.sol/NonceManager.json'

import { DeterministicDeployer } from './DeterministicDeployer'
import { NonceManager__factory } from './types/factories/@account-abstraction/rip7560/contracts/predeploys'
import { NonceManager } from './types/@account-abstraction/rip7560/contracts/predeploys'
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/deployStakeManager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { JsonRpcProvider } from '@ethersproject/providers'

import { bytecode as stakeManagerByteCode } from '../artifacts/@account-abstraction/rip7560/contracts/predeploys/Rip7560StakeManager.sol/Rip7560StakeManager.json'
import { bytecode as stakeManagerByteCode } from '@account-abstraction/rip7560/artifacts/contracts/predeploys/Rip7560StakeManager.sol/Rip7560StakeManager.json'
import { DeterministicDeployer } from './DeterministicDeployer'
import { Rip7560StakeManager__factory, Rip7560StakeManager } from './types'

Expand Down
4 changes: 2 additions & 2 deletions packages/validation-manager/src/ValidationManagerRIP7560.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { ERC7562Parser } from './ERC7562Parser'

export const AA_ENTRY_POINT = '0x0000000000000000000000000000000000007560'
export const AA_SENDER_CREATOR = '0x00000000000000000000000000000000ffff7560'
export const AA_STAKE_MANAGER = '0x2F9d2b9Af343dA0288Fc8270354e4c47b63817f3'
export const AA_NONCE_MANAGER = '0x3D45A0363baBA693432f9Cb82c60BE9410A5Fd8f'
export const AA_STAKE_MANAGER = '0x46A51792B6894132b50c0AD5A1E32F06d6961f08'
export const AA_NONCE_MANAGER = '0x2BdDd4c0FBb0D8ff3108dbd6d377877a7D5e2DE1'

export class ValidationManagerRIP7560 implements IValidationManager {
constructor (
Expand Down

0 comments on commit 4d022d8

Please sign in to comment.