@@ -18,7 +18,7 @@ import {AmountCap, AmountCapLib} from "evk/EVault/shared/types/AmountCap.sol";
18
18
import {IEVC} from "ethereum-vault-connector/interfaces/IEthereumVaultConnector.sol " ;
19
19
import {IEVault, IGovernance} from "evk/EVault/IEVault.sol " ;
20
20
import {EulerRouter, Governable} from "euler-price-oracle/EulerRouter.sol " ;
21
- import {SafeTransaction} from "./SafeUtils.s.sol " ;
21
+ import {SafeTransaction, SafeUtil } from "./SafeUtils.s.sol " ;
22
22
import {BaseFactory} from "../../src/BaseFactory/BaseFactory.sol " ;
23
23
import {SnapshotRegistry} from "../../src/SnapshotRegistry/SnapshotRegistry.sol " ;
24
24
import {BasePerspective} from "../../src/Perspectives/implementation/BasePerspective.sol " ;
@@ -407,7 +407,7 @@ abstract contract ScriptUtils is
407
407
TokenAddresses internal tokenAddresses;
408
408
GovernorAddresses internal governorAddresses;
409
409
EulerSwapAddresses internal eulerSwapAddresses;
410
- uint256 internal safeNonce = getSafeNonce () ;
410
+ uint256 internal safeNonce;
411
411
412
412
constructor () {
413
413
multisigAddresses = deserializeMultisigAddresses (getAddressesJson ("MultisigAddresses.json " ));
@@ -419,6 +419,12 @@ abstract contract ScriptUtils is
419
419
governorAddresses = deserializeGovernorAddresses (getAddressesJson ("GovernorAddresses.json " ));
420
420
eulerSwapAddresses = deserializeEulerSwapAddresses (getAddressesJson ("EulerSwapAddresses.json " ));
421
421
deserializeBridgeConfigCache (getBridgeConfigCacheJson ("BridgeConfigCache.json " ));
422
+
423
+ safeNonce = getSafeNonce ();
424
+ if (safeNonce == 0 ) {
425
+ SafeUtil util = new SafeUtil ();
426
+ safeNonce = util.getNextNonce (getSafe ());
427
+ }
422
428
}
423
429
424
430
modifier broadcast () {
@@ -944,8 +950,6 @@ abstract contract BatchBuilder is ScriptUtils {
944
950
945
951
dumpBatch (safe);
946
952
947
- safeNonce = safeNonce == 0 ? transaction.getNextNonce (safe) : safeNonce;
948
-
949
953
if (timelock == address (0 ) || ! allowTimelock) {
950
954
console.log ("Executing the batch via Safe (%s) using the EVC (%s)\n " , safe, coreAddresses.evc);
951
955
transaction.create (true , safe, coreAddresses.evc, getBatchValue (), getBatchCalldata (), safeNonce++ );
0 commit comments