diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 5c4dd973..6c6afb95 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -150,7 +150,7 @@ contract DeployScript is Script { if (stakeToAdd > 0) { console.log("Adding stake: ", stakeToAdd); - AccountFactory(factory).addStake{value: stakeAmount}(unstakeDelay); + AccountFactory(factory).addStake{value: stakeToAdd}(unstakeDelay); console.log("Staked factory: ", address(factory)); console.log("Total stake amount: ", entryPoint.getDepositInfo(address(factory)).stake); console.log("Unstake delay: ", entryPoint.getDepositInfo(address(factory)).unstakeDelaySec); diff --git a/test/script/Deploy.s.t.sol b/test/script/Deploy.s.t.sol index a0789e54..b25bf7fe 100644 --- a/test/script/Deploy.s.t.sol +++ b/test/script/Deploy.s.t.sol @@ -90,4 +90,20 @@ contract DeployTest is Test { assertEq(depositInfo.stake, 0.1 ether, "Unexpected factory stake amount"); assertEq(depositInfo.unstakeDelaySec, 1 days, "Unexpected factory unstake delay"); } + + function test_deployScript_addStake() public { + test_deployScript_run(); + + vm.setEnv("STAKE_AMOUNT", vm.toString(uint256(0.3 ether))); + + // Refresh script's env vars + + _deployScript = new DeployScript(); + + _deployScript.run(); + + IStakeManager.DepositInfo memory depositInfo = _entryPoint.getDepositInfo(_factory); + + assertEq(depositInfo.stake, 0.3 ether, "Unexpected factory stake amount"); + } }