Skip to content

Commit

Permalink
chore: refactor to use _getSaltOrZero() when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Zer0dot committed Dec 11, 2024
1 parent 63b4c96 commit 209ed33
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion script/DeployFactory.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ contract DeployFactoryScript is ScriptBase, Artifacts {

// Load the expected address and salt from env vars.
expectedFactoryAddr = vm.envOr("ACCOUNT_FACTORY", address(0));
factorySalt = vm.envOr("ACCOUNT_FACTORY_SALT", uint256(0));
factorySalt = _getSaltOrZero("ACCOUNT_FACTORY");
}

function run() public onlyProfile("optimized-build") {
Expand Down
14 changes: 7 additions & 7 deletions script/PredictAddresses.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ contract PredictAddressScript is ScriptBase, Artifacts {
function setUp() public {
// Load the salts from env vars.

allowlistModuleSalt = vm.envOr("ALLOWLIST_MODULE_SALT", uint256(0));
nativeTokenLimitModuleSalt = vm.envOr("NATIVE_TOKEN_LIMIT_MODULE_SALT", uint256(0));
paymasterGuardModuleSalt = vm.envOr("PAYMASTER_GUARD_MODULE_SALT", uint256(0));
singleSignerValidationModuleSalt = vm.envOr("SINGLE_SIGNER_VALIDATION_MODULE_SALT", uint256(0));
timeRangeModuleSalt = vm.envOr("TIME_RANGE_MODULE_SALT", uint256(0));
webAuthnValidationModuleSalt = vm.envOr("WEBAUTHN_VALIDATION_MODULE_SALT", uint256(0));
factorySalt = vm.envOr("ACCOUNT_FACTORY_SALT", uint256(0));
allowlistModuleSalt = _getSaltOrZero("ALLOWLIST_MODULE");
nativeTokenLimitModuleSalt = _getSaltOrZero("NATIVE_TOKEN_LIMIT_MODULE");
paymasterGuardModuleSalt = _getSaltOrZero("PAYMASTER_GUARD_MODULE");
singleSignerValidationModuleSalt = _getSaltOrZero("SINGLE_SIGNER_VALIDATION_MODULE");
timeRangeModuleSalt = _getSaltOrZero("TIME_RANGE_MODULE");
webAuthnValidationModuleSalt = _getSaltOrZero("WEBAUTHN_VALIDATION_MODULE");
factorySalt = _getSaltOrZero("ACCOUNT_FACTORY");
executionInstallDelegateSalt = _getSaltOrZero("EXECUTION_INSTALL_DELEGATE");
modularAccountImplSalt = _getSaltOrZero("MODULAR_ACCOUNT_IMPL");
semiModularAccountBytecodeImplSalt = _getSaltOrZero("SEMI_MODULAR_ACCOUNT_BYTECODE_IMPL");
Expand Down

0 comments on commit 209ed33

Please sign in to comment.