File tree Expand file tree Collapse file tree 2 files changed +24
-12
lines changed
Expand file tree Collapse file tree 2 files changed +24
-12
lines changed Original file line number Diff line number Diff line change @@ -53,11 +53,16 @@ contract Deploy_LightAccountFactory is Script {
5353 uint256 requiredStakeAmount = vm.envUint ("REQUIRED_STAKE_AMOUNT " );
5454 uint256 currentStakedAmount = entryPoint.getDepositInfo (factoryAddr).stake;
5555 uint256 stakeAmount = requiredStakeAmount - currentStakedAmount;
56- LightAccountFactory (payable (factoryAddr)).addStake {value: stakeAmount}(unstakeDelaySec, stakeAmount);
57- console.log ("******** Add Stake Verify ********* " );
58- console.log ("Staked factory: " , factoryAddr);
59- console.log ("Stake amount: " , entryPoint.getDepositInfo (factoryAddr).stake);
60- console.log ("Unstake delay: " , entryPoint.getDepositInfo (factoryAddr).unstakeDelaySec);
61- console.log ("******** Stake Verify Done ********* " );
56+
57+ if (stakeAmount > 0 ) {
58+ LightAccountFactory (payable (factoryAddr)).addStake {value: stakeAmount}(unstakeDelaySec, stakeAmount);
59+ console.log ("******** Add Stake Verify ********* " );
60+ console.log ("Staked factory: " , factoryAddr);
61+ console.log ("Stake amount: " , entryPoint.getDepositInfo (factoryAddr).stake);
62+ console.log ("Unstake delay: " , entryPoint.getDepositInfo (factoryAddr).unstakeDelaySec);
63+ console.log ("******** Stake Verify Done! ********* " );
64+ } else {
65+ console.log ("No stake needed for factory " );
66+ }
6267 }
6368}
Original file line number Diff line number Diff line change @@ -53,11 +53,18 @@ contract Deploy_MultiOwnerLightAccountFactory is Script {
5353 uint256 requiredStakeAmount = vm.envUint ("REQUIRED_STAKE_AMOUNT " );
5454 uint256 currentStakedAmount = entryPoint.getDepositInfo (factoryAddr).stake;
5555 uint256 stakeAmount = requiredStakeAmount - currentStakedAmount;
56- MultiOwnerLightAccountFactory (payable (factoryAddr)).addStake {value: stakeAmount}(unstakeDelaySec, stakeAmount);
57- console.log ("******** Add Stake Verify ********* " );
58- console.log ("Staked factory: " , factoryAddr);
59- console.log ("Stake amount: " , entryPoint.getDepositInfo (factoryAddr).stake);
60- console.log ("Unstake delay: " , entryPoint.getDepositInfo (factoryAddr).unstakeDelaySec);
61- console.log ("******** Stake Verify Done ********* " );
56+
57+ if (stakeAmount > 0 ) {
58+ MultiOwnerLightAccountFactory (payable (factoryAddr)).addStake {value: stakeAmount}(
59+ unstakeDelaySec, stakeAmount
60+ );
61+ console.log ("******** Add Stake Verify ********* " );
62+ console.log ("Staked factory: " , factoryAddr);
63+ console.log ("Stake amount: " , entryPoint.getDepositInfo (factoryAddr).stake);
64+ console.log ("Unstake delay: " , entryPoint.getDepositInfo (factoryAddr).unstakeDelaySec);
65+ console.log ("******** Stake Verify Done! ********* " );
66+ } else {
67+ console.log ("No stake needed for factory " );
68+ }
6269 }
6370}
You can’t perform that action at this time.
0 commit comments