Skip to content

Commit

Permalink
udpate to use config helper
Browse files Browse the repository at this point in the history
  • Loading branch information
ezynda3 committed Jan 29, 2025
1 parent 636e112 commit a787ff8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
8 changes: 5 additions & 3 deletions script/deploy/zksync/DeployLiFiDEXAggregator.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ contract DeployScript is DeployScriptBase {

function getConstructorArgs() internal override returns (bytes memory) {
string memory path = string.concat(root, "/config/global.json");
string memory json = vm.readFile(path);

address[] memory priviledgedUsers = new address[](1);
priviledgedUsers[0] = json.readAddress(".pauserWallet");
priviledgedUsers[0] = _getConfigContractAddress(path, ".pauserWallet");

// the original RouteProcessor4.sol is also deployed with address(0) for _bentoBox
address withdrawWalletAddress = json.readAddress(".withdrawWallet");
address withdrawWalletAddress = _getConfigContractAddress(
path,
".withdrawWallet"
);
return abi.encode(address(0), priviledgedUsers, withdrawWalletAddress);
}
}
10 changes: 5 additions & 5 deletions script/deploy/zksync/DeployReceiverStargateV2.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ contract DeployScript is DeployScriptBase {

// obtain address of LayerZero's EndPointV2 contract in current network from config file
string memory path = string.concat(root, "/config/stargate.json");
string memory json = vm.readFile(path);

address endpointV2 = json.readAddress(
address endpointV2 = _getConfigContractAddress(
path,
string.concat(".endpointV2.", network)
);
address tokenMessaging = json.readAddress(
address tokenMessaging = _getConfigContractAddress(
path,
string.concat(".tokenMessaging.", network)
);

Expand All @@ -56,8 +57,7 @@ contract DeployScript is DeployScriptBase {
fileSuffix,
"json"
);
json = vm.readFile(path);
address executor = json.readAddress(".Executor");
address executor = _getConfigContractAddress(path, ".Executor");

return
abi.encode(
Expand Down
4 changes: 2 additions & 2 deletions script/deploy/zksync/DeployStargateFacetV2.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ contract DeployScript is DeployScriptBase {

function getConstructorArgs() internal override returns (bytes memory) {
string memory path = string.concat(root, "/config/stargate.json");
string memory json = vm.readFile(path);

address tokenMessaging = json.readAddress(
address tokenMessaging = _getConfigContractAddress(
path,
string.concat(".tokenMessaging.", network)
);

Expand Down

0 comments on commit a787ff8

Please sign in to comment.