|
2 | 2 | import { EventManager } from '../eventManager'
|
3 | 3 | import type { Transaction as InternalTransaction } from './txRunner'
|
4 | 4 | import { Web3 } from 'web3'
|
5 |
| -import { BrowserProvider } from 'ethers' |
| 5 | +import { BrowserProvider, getAddress } from 'ethers' |
6 | 6 | import { normalizeHexAddress } from '../helpers/uiHelper'
|
7 | 7 | import { aaSupportedNetworks, aaLocalStorageKey, getPimlicoBundlerURL, aaDeterminiticProxyAddress } from '../helpers/aaConstants'
|
8 |
| -import { toBigInt, toHex, toChecksumAddress } from 'web3-utils' |
9 | 8 | import { randomBytes } from 'crypto'
|
10 | 9 | import "viem/window"
|
11 |
| -import { custom, http, createWalletClient, createPublicClient, encodePacked, getContractAddress } from "viem" |
| 10 | +import { custom, http, createWalletClient, createPublicClient, encodePacked, getContractAddress, toHex } from "viem" |
12 | 11 | import * as chains from "viem/chains"
|
13 | 12 | import { entryPoint07Address } from "viem/account-abstraction"
|
14 | 13 | const { createSmartAccountClient } = require("permissionless")
|
@@ -70,7 +69,7 @@ export class TxRunnerWeb3 {
|
70 | 69 | if (receipt.logs && receipt.logs.length) {
|
71 | 70 | receipt.logs.map((log) => {
|
72 | 71 | if (log.topics[0] === '0xa1fb700aaee2ae4a2ff6f91ce7eba292f89c2f5488b8ec4c5c5c8150692595c3') {
|
73 |
| - (receipt as any).contractAddress = toChecksumAddress(normalizeHexAddress(toHex(log.topics[2]))) |
| 72 | + (receipt as any).contractAddress = getAddress(normalizeHexAddress(toHex(log.topics[2]))) |
74 | 73 | }
|
75 | 74 | })
|
76 | 75 | }
|
@@ -165,7 +164,7 @@ export class TxRunnerWeb3 {
|
165 | 164 | // the sending stack (web3.js / metamask need to have the type defined)
|
166 | 165 | // this is to avoid the following issue: https://github.com/MetaMask/metamask-extension/issues/11824
|
167 | 166 | txCopy.type = '0x2'
|
168 |
| - txCopy.maxFeePerGas = Math.ceil(Number((toBigInt(network.lastBlock.baseFeePerGas) + toBigInt(network.lastBlock.baseFeePerGas) / BigInt(3)).toString())) |
| 167 | + txCopy.maxFeePerGas = Math.ceil(Number((BigInt(network.lastBlock.baseFeePerGas) + BigInt(network.lastBlock.baseFeePerGas) / BigInt(3)).toString())) |
169 | 168 | } else {
|
170 | 169 | txCopy.type = '0x1'
|
171 | 170 | txCopy.gasPrice = undefined
|
|
0 commit comments