Skip to content

Commit

Permalink
Merge branch 'main' into osiris/rundler-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
0xOsiris committed Feb 4, 2025
2 parents 79d53ce + b97a5a3 commit 9ff05bd
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
59 changes: 59 additions & 0 deletions contracts/scripts/DeploySepolia.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;

import {Script} from "@forge-std/Script.sol";
import {PBHEntryPoint} from "../src/PBHEntryPoint.sol";
import {PBHEntryPointImplV1} from "../src/PBHEntryPointImplV1.sol";
import {PBHSignatureAggregator} from "../src/PBHSignatureAggregator.sol";
import {console} from "forge-std/console.sol";
import {IWorldID} from "@world-id-contracts/interfaces/IWorldID.sol";
import {IPBHEntryPoint} from "../src/interfaces/IPBHEntryPoint.sol";
import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol";

contract DeployDevnet is Script {
address public pbhEntryPoint;
address public pbhEntryPointImpl;
address public pbhSignatureAggregator;

address internal constant WORLD_ID = address(0);
address internal constant MULTICALL3_ADDRESS = 0xcA11bde05977b3631167028862bE2a173976CA11;
address internal constant ENTRY_POINT = 0x0000000071727De22E5E9d8BAf0edAc6f37da032;
uint256 internal constant MAX_PBH_GAS_LIMIT = 10500000; // 10.5M 70% of 15M
uint8 internal constant PBH_NONCE_LIMIT = 30;

function run() public {
console.log(
"Deploying: PBHEntryPoint, PBHEntryPointImplV1, PBHSignatureAggregator"
);

uint256 privateKey = vm.envUint("PRIVATE_KEY");
vm.startBroadcast(privateKey);
deployPBHEntryPoint();
deployPBHSignatureAggregator();
vm.stopBroadcast();
}

function deployPBHEntryPoint() public {
pbhEntryPointImpl = address(new PBHEntryPointImplV1());
console.log("PBHEntryPointImplV1 Deployed at: ", pbhEntryPointImpl);
bytes memory initCallData = abi.encodeCall(
PBHEntryPointImplV1.initialize,
(
IWorldID(WORLD_ID),
IEntryPoint(ENTRY_POINT),
PBH_NONCE_LIMIT,
MULTICALL3_ADDRESS,
MAX_PBH_GAS_LIMIT
)
);
pbhEntryPoint = address(
new PBHEntryPoint(pbhEntryPointImpl, initCallData)
);
console.log("PBHEntryPoint Deployed at: ", pbhEntryPoint);
}

function deployPBHSignatureAggregator() public {
pbhSignatureAggregator = address(new PBHSignatureAggregator(pbhEntryPoint, WORLD_ID));
console.log("PBHSignatureAggregator Deployed at: ", pbhSignatureAggregator);
}
}
2 changes: 1 addition & 1 deletion contracts/src/PBHEntryPointImplV1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ contract PBHEntryPointImplV1 is IPBHEntryPoint, WorldIDImpl, ReentrancyGuardTran
/// upgrading. Create a separate initializer function instead.
///
/// @param _worldId The World ID instance that will be used for verifying proofs. If set to the
/// 0 addess, then it will be assumed that verification will take place off chain.
/// 0 address, then it will be assumed that verification will take place off chain.
/// @param _entryPoint The ERC-4337 Entry Point.
/// @param _numPbhPerMonth The number of allowed PBH transactions per month.
/// @param multicall3 Address of the Multicall3 implementation.
Expand Down

0 comments on commit 9ff05bd

Please sign in to comment.