-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into retry-logic
- Loading branch information
Showing
63 changed files
with
3,060 additions
and
1,466 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule account-abstraction
added at
abff2a
Submodule openzeppelin-contracts
added at
fd81a9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { PimlicoEntryPointSimulationsDeployBytecode } from "@alto/types" | ||
import { | ||
type Chain, | ||
createWalletClient, | ||
type Hex, | ||
http, | ||
type PublicClient, | ||
type Transport | ||
} from "viem" | ||
import type { CamelCasedProperties } from "./parseArgs" | ||
import type { IOptions } from "@alto/cli" | ||
|
||
export const deploySimulationsContract = async ({ | ||
args, | ||
publicClient | ||
}: { | ||
args: CamelCasedProperties<IOptions> | ||
publicClient: PublicClient<Transport, Chain> | ||
}): Promise<Hex> => { | ||
const utilityPrivateKey = args.utilityPrivateKey | ||
if (!utilityPrivateKey) { | ||
throw new Error( | ||
"Cannot deploy entryPoint simulations without utility-private-key" | ||
) | ||
} | ||
|
||
const walletClient = createWalletClient({ | ||
transport: http(args.rpcUrl), | ||
account: utilityPrivateKey | ||
}) | ||
|
||
const deployHash = await walletClient.deployContract({ | ||
chain: publicClient.chain, | ||
abi: [], | ||
bytecode: PimlicoEntryPointSimulationsDeployBytecode | ||
}) | ||
|
||
const receipt = await publicClient.getTransactionReceipt({ | ||
hash: deployHash | ||
}) | ||
|
||
const simulationsContract = receipt.contractAddress | ||
|
||
if (simulationsContract === null || simulationsContract === undefined) { | ||
throw new Error("Failed to deploy simulationsContract") | ||
} | ||
|
||
return simulationsContract | ||
} |
Oops, something went wrong.