Skip to content

Commit

Permalink
Update Utils.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
Phanco committed Jul 9, 2024
1 parent 6a85e8d commit b7c617e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions script/contracts/Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ contract Utils is Script {
l1AddressesConfig.L1VestingWalletImplementation = l1VestingWalletImplementation;
} catch { }

try vm.parseJsonAddress(addressJson, ".L1VestingWalletPaused") returns (address l1VestingWalletPaused) {
l1AddressesConfig.L1VestingWalletPaused = l1VestingWalletPaused;
} catch { }

return l1AddressesConfig;
}

Expand All @@ -165,8 +169,8 @@ contract Utils is Script {
function writeL1AddressesFile(L1AddressesConfig memory cfg, string memory filePath) external {
string memory json = "";
vm.serializeAddress(json, "L1LiskToken", cfg.L1LiskToken);
string memory finalJson =
vm.serializeAddress(json, "L1VestingWalletImplementation", cfg.L1VestingWalletImplementation);
vm.serializeAddress(json, "L1VestingWalletImplementation", cfg.L1VestingWalletImplementation);
string memory finalJson = vm.serializeAddress(json, "L1VestingWalletPaused", cfg.L1VestingWalletPaused);
finalJson.write(filePath);
}

Expand Down Expand Up @@ -254,6 +258,10 @@ contract Utils is Script {
l2AddressesConfig.L2VestingWalletImplementation = l2VestingWalletImplementation;
} catch { }

try vm.parseJsonAddress(addressJson, ".L2VestingWalletPaused") returns (address l2VestingWalletPaused) {
l2AddressesConfig.L2VestingWalletPaused = l2VestingWalletPaused;
} catch { }

try vm.parseJsonAddress(addressJson, ".L2VotingPower") returns (address l2VotingPower) {
l2AddressesConfig.L2VotingPower = l2VotingPower;
} catch { }
Expand Down Expand Up @@ -293,6 +301,7 @@ contract Utils is Script {
vm.serializeAddress(json, "L2StakingImplementation", cfg.L2StakingImplementation);
vm.serializeAddress(json, "L2TimelockController", cfg.L2TimelockController);
vm.serializeAddress(json, "L2VestingWalletImplementation", cfg.L2VestingWalletImplementation);
vm.serializeAddress(json, "L2VestingWalletPaused", cfg.L2VestingWalletPaused);
vm.serializeAddress(json, "L2VotingPower", cfg.L2VotingPower);
vm.serializeAddress(json, "L2VotingPowerImplementation", cfg.L2VotingPowerImplementation);
string memory finalJson = vm.serializeAddress(json, "L2VotingPowerPaused", cfg.L2VotingPowerPaused);
Expand Down

0 comments on commit b7c617e

Please sign in to comment.