Skip to content

Commit

Permalink
✅ Use initializeBase
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyrharper committed Jul 9, 2024
1 parent 2bde7af commit 32bd332
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/MarginPaymaster.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ contract MarginPaymasterTest is Bootstrap {
/// at a specific block number
vm.rollFork(BASE_BLOCK_NUMBER);

initializeLocal();
initializeBase();

entryPoint = new EntryPoint();
accountFactory = new AccountFactory();
Expand Down
16 changes: 14 additions & 2 deletions test/utils/Bootstrap.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity 0.8.25;
import {EntryPoint, UserOperation} from "lib/account-abstraction/contracts/core/EntryPoint.sol";
import {IEntryPoint} from "lib/account-abstraction/contracts/interfaces/IEntryPoint.sol";

import {MarginPaymaster, OptimismGoerliParameters, OptimismParameters, Setup} from "script/Deploy.s.sol";
import {MarginPaymaster, OptimismGoerliParameters, OptimismParameters, BaseParameters, Setup} from "script/Deploy.s.sol";
import {AccountFactory, Account} from "src/Account.sol";
import {Test} from "lib/forge-std/src/Test.sol";
import {console} from "lib/forge-std/src/console.sol";
Expand Down Expand Up @@ -35,14 +35,18 @@ contract Bootstrap is Test {
function initializeOptimismGoerli() internal {
BootstrapOptimismGoerli bootstrap = new BootstrapOptimismGoerli();
marginPaymasterAddress = bootstrap.init();

marginPaymaster = MarginPaymaster(marginPaymasterAddress);
}

function initializeOptimism() internal {
BootstrapOptimismGoerli bootstrap = new BootstrapOptimismGoerli();
marginPaymasterAddress = bootstrap.init();
marginPaymaster = MarginPaymaster(marginPaymasterAddress);
}

function initializeBase() internal {
BootstrapBase bootstrap = new BootstrapBase();
marginPaymasterAddress = bootstrap.init();
marginPaymaster = MarginPaymaster(marginPaymasterAddress);
}

Expand Down Expand Up @@ -73,4 +77,12 @@ contract BootstrapOptimismGoerli is Setup, OptimismGoerliParameters {
}
}

contract BootstrapBase is Setup, BaseParameters {
function init() public returns (address) {
address marginPaymasterAddress = Setup.deploySystem();

return marginPaymasterAddress;
}
}

// add other networks here as needed (ex: Base, BaseGoerli)

0 comments on commit 32bd332

Please sign in to comment.