From 7cc48465c2b62b5c0e1f6bee46b0efb64195a418 Mon Sep 17 00:00:00 2001 From: Franco NG Date: Fri, 8 Dec 2023 15:11:18 +0100 Subject: [PATCH] Update Utils.sol --- script/Utils.sol | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/script/Utils.sol b/script/Utils.sol index a2491cc3..04fe1b44 100644 --- a/script/Utils.sol +++ b/script/Utils.sol @@ -70,16 +70,6 @@ contract Utils is Script { return abi.decode(addressRaw, (L2AddressesConfig)); } - /// @notice This function reads MerkleTree from JSON file. - /// @return L2ClaimConfig struct containing merkle root. - function readMerkleTreeFile() external view returns (MerkleTree memory) { - string memory root = vm.projectRoot(); - string memory addressPath = string.concat(root, "/deployment/merkleTree.json"); - string memory addressJson = vm.readFile(addressPath); - bytes memory addressRaw = vm.parseJson(addressJson); - return abi.decode(addressRaw, (MerkleTree)); - } - /// @notice This function writes L2 addresses to JSON file. /// @param cfg L2AddressesConfig struct containing L2 addresses which will be written to JSON file. function writeL2AddressesFile(L2AddressesConfig memory cfg) external { @@ -88,4 +78,15 @@ contract Utils is Script { string memory finalJson = vm.serializeAddress(json, "L2LiskToken", cfg.L2LiskToken); finalJson.write(string.concat("deployment/l2addresses.json")); } + + + /// @notice This function reads MerkleTree from JSON file. + /// @return L2ClaimConfig struct containing merkle root. + function readMerkleTreeFile() external view returns (MerkleTree memory) { + string memory root = vm.projectRoot(); + string memory addressPath = string.concat(root, "/script/merkleTree.json"); + string memory addressJson = vm.readFile(addressPath); + bytes memory addressRaw = vm.parseJson(addressJson); + return abi.decode(addressRaw, (MerkleTree)); + } }