generated from PaulRBerg/foundry-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add DeploySimplePlusAccountFactory script
- Loading branch information
1 parent
325cdc5
commit ac98f8d
Showing
1 changed file
with
34 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity ^0.8.25; | ||
|
||
import { Script, console } from "forge-std/src/Script.sol"; | ||
import { EntryPoint } from "@account-abstraction/contracts/core/EntryPoint.sol"; | ||
import { SimplePlusAccountFactory } from "../src/SimplePlusAccountFactory.sol"; | ||
|
||
contract DeploySimplePlusAccountFactory is Script { | ||
// Load entrypoint from env | ||
address public entryPointAddr = vm.envAddress("ENTRYPOINT"); | ||
EntryPoint public entryPoint = EntryPoint(payable(entryPointAddr)); | ||
|
||
function run() public { | ||
// Start broadcasting transactions using the deployer's private key | ||
vm.startBroadcast(); | ||
|
||
// Log entrypoint address | ||
console.log("Entrypoint:", address(entryPoint)); | ||
// --- | ||
console.log("Deploying:"); | ||
console.log(""); | ||
|
||
// Deploy the factory contract | ||
SimplePlusAccountFactory factory = new SimplePlusAccountFactory(entryPoint); | ||
|
||
// Log addresses of the deployed factory and the account implementation | ||
console.log("SimplePlusAccountFactory:", address(factory)); | ||
console.log("SimplePlusAccount:", address(factory.accountImplementation())); | ||
console.log(); | ||
|
||
// Stop broadcasting transactions | ||
vm.stopBroadcast(); | ||
} | ||
} |