Skip to content

Commit

Permalink
feat: Add DeploySimplePlusAccountFactory script
Browse files Browse the repository at this point in the history
  • Loading branch information
jpgonzalezra committed May 23, 2024
1 parent 325cdc5 commit ac98f8d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions script/DeploySimplePlusAccountFactory.s.sol
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();
}
}

0 comments on commit ac98f8d

Please sign in to comment.