diff --git a/script/contracts/L1/L1FundVesting.s.sol b/script/contracts/L1/L1FundVesting.s.sol index 225bd822..a5ae0477 100644 --- a/script/contracts/L1/L1FundVesting.s.sol +++ b/script/contracts/L1/L1FundVesting.s.sol @@ -33,7 +33,8 @@ contract L1FundVestingScript is Script { Utils.VestingPlan[] memory plans = utils.readVestingPlansFile(layer); for (uint256 i; i < plans.length; i++) { Utils.VestingPlan memory vestingPlan = plans[i]; - address vestingWalletAddress = utils.readVestingWalletAddress(vestingPlan.name, layer); + address vestingWalletAddress = + utils.readVestingWalletAddress(vestingPlan.name, utils.getVestingWalletsFilePath(layer)); console2.log( "Transferring %s Lisk tokens to the vesting wallet %s ... on L1", diff --git a/script/contracts/L1/L1VestingWallet.s.sol b/script/contracts/L1/L1VestingWallet.s.sol index a854bbac..cae507cf 100644 --- a/script/contracts/L1/L1VestingWallet.s.sol +++ b/script/contracts/L1/L1VestingWallet.s.sol @@ -80,7 +80,7 @@ contract L1VestingWalletScript is Script { } // Write all Vesting Contract addresses to vestingWallets_L1.json - utils.writeVestingWalletsFile(vestingWallets, layer); + utils.writeVestingWalletsFile(vestingWallets, utils.getVestingWalletsFilePath(layer)); // write L1VestingWallet address to l1addresses.json l1AddressesConfig.L1VestingWalletImplementation = address(l1VestingWalletImplementation); diff --git a/script/contracts/L2/L2FundVestingAndDAO.s.sol b/script/contracts/L2/L2FundVestingAndDAO.s.sol index a4139714..2366ef41 100644 --- a/script/contracts/L2/L2FundVestingAndDAO.s.sol +++ b/script/contracts/L2/L2FundVestingAndDAO.s.sol @@ -72,7 +72,8 @@ contract FundVestingAndDAOScript is Script { for (uint256 i; i < plans.length; i++) { Utils.VestingPlan memory vestingPlan = plans[i]; - address vestingWalletAddress = utils.readVestingWalletAddress(vestingPlan.name, layer); + address vestingWalletAddress = + utils.readVestingWalletAddress(vestingPlan.name, utils.getVestingWalletsFilePath(layer)); console2.log( "Transferring %s Lisk tokens to the vesting wallet %s ... on L2", diff --git a/script/contracts/L2/L2VestingWallet.s.sol b/script/contracts/L2/L2VestingWallet.s.sol index de1683f8..49e730c0 100644 --- a/script/contracts/L2/L2VestingWallet.s.sol +++ b/script/contracts/L2/L2VestingWallet.s.sol @@ -87,7 +87,7 @@ contract L2VestingWalletScript is Script { } // Write all Vesting Contract addresses to vestingWallets_L2.json - utils.writeVestingWalletsFile(vestingWallets, layer); + utils.writeVestingWalletsFile(vestingWallets, utils.getVestingWalletsFilePath(layer)); // write L2VestingWallet address to l2addresses.json l2AddressesConfig.L2VestingWalletImplementation = address(l2VestingWalletImplementation); diff --git a/script/contracts/Utils.sol b/script/contracts/Utils.sol index adf415f7..c192d5aa 100644 --- a/script/contracts/Utils.sol +++ b/script/contracts/Utils.sol @@ -123,13 +123,15 @@ contract Utils is Script { /// @notice This function returns the path for L1 addresses JSON file. /// @return string containing file path to L1 addresses JSON. function getL1AddressesFilePath() external view returns (string memory) { - return string.concat(vm.projectRoot(), "/deployment/", getNetworkType(), "/l1addresses.json"); + return + string.concat(vm.projectRoot(), "/deployment/artifacts/contracts/", getNetworkType(), "/l1addresses.json"); } /// @notice This function returns the path for L2 addresses JSON file. /// @return string containing file path to L2 addresses JSON. function getL2AddressesFilePath() external view returns (string memory) { - return string.concat(vm.projectRoot(), "/deployment/", getNetworkType(), "/l2addresses.json"); + return + string.concat(vm.projectRoot(), "/deployment/artifacts/contracts/", getNetworkType(), "/l2addresses.json"); } /// @notice This function reads L1 addresses from JSON file. @@ -295,10 +297,12 @@ contract Utils is Script { } /// @notice This function returns the path for the vesting wallets JSON file for the provided network layer. - /// @param _layer Network layer of the runnins script, either be "L1" or "L2". + /// @param _layer Network layer of the running script, either be "L1" or "L2". /// @return string containing file path to vesting wallets. function getVestingWalletsFilePath(string memory _layer) external view returns (string memory) { - return string.concat(vm.projectRoot(), "/deployment/", getNetworkType(), "/vestingWallets_", _layer, ".json"); + return string.concat( + vm.projectRoot(), "/deployment/artifacts/contracts/", getNetworkType(), "/vestingWallets_", _layer, ".json" + ); } /// @notice This function writes Vesting Wallets to JSON file. diff --git a/test/utils/Utils.t.sol b/test/utils/Utils.t.sol index 8dec7c0a..034997f5 100644 --- a/test/utils/Utils.t.sol +++ b/test/utils/Utils.t.sol @@ -136,21 +136,21 @@ contract UtilsTest is Test { function test_getL1AddressesFilePath() public view { assertEq( utils.getL1AddressesFilePath(), - string.concat(vm.projectRoot(), "/deployment/", network, "/l1addresses.json") + string.concat(vm.projectRoot(), "/deployment/artifacts/contracts/", network, "/l1addresses.json") ); } function test_getL2AddressesFilePath() public view { assertEq( utils.getL2AddressesFilePath(), - string.concat(vm.projectRoot(), "/deployment/", network, "/l2addresses.json") + string.concat(vm.projectRoot(), "/deployment/artifacts/contracts/", network, "/l2addresses.json") ); } function test_getVestingWalletsFilePath() public view { assertEq( utils.getVestingWalletsFilePath("l1"), - string.concat(vm.projectRoot(), "/deployment/", network, "/vestingWallets_l1.json") + string.concat(vm.projectRoot(), "/deployment/artifacts/contracts/", network, "/vestingWallets_l1.json") ); }