Skip to content

Commit

Permalink
rename deployment json file
Browse files Browse the repository at this point in the history
  • Loading branch information
danoctavian committed Apr 12, 2024
1 parent f77f43d commit aba040c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions script/DeployPooledDepositsVaults.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ contract Upgrade is BaseScript {
// ynETH.sol ROLES
ActorAddresses.Actors memory actors = getActors();

PooledDepositsVault[] memory pooledDepositsVaults = new PooledDepositsVault[](5); // Renamed from PooledDeposits to PooledDepositsVault
uint256 vaultCount = 5;

PooledDepositsVault[] memory pooledDepositsVaults = new PooledDepositsVault[](vaultCount); // Renamed from PooledDeposits to PooledDepositsVault
vm.startBroadcast(deployerPrivateKey);

PooledDepositsVault pooledDepositsVaultImplementation = new PooledDepositsVault(); // Renamed from PooledDeposits to PooledDepositsVault
for (uint i = 0; i < 5; i++) {
for (uint i = 0; i < vaultCount; i++) {
bytes memory initData = abi.encodeWithSelector(PooledDepositsVault.initialize.selector, actors.POOLED_DEPOSITS_OWNER); // Renamed from PooledDeposits to PooledDepositsVault
TransparentUpgradeableProxy pooledDepositsVaultProxy = new TransparentUpgradeableProxy(address(pooledDepositsVaultImplementation), actors.PROXY_ADMIN_OWNER, initData);
PooledDepositsVault pooledDepositsVault = PooledDepositsVault(payable(address(pooledDepositsVaultProxy))); // Renamed from PooledDeposits to PooledDepositsVault
Expand All @@ -31,11 +33,16 @@ contract Upgrade is BaseScript {
vm.stopBroadcast();
}

function getVaultsDeploymentFile() internal view returns (string memory) {
string memory root = vm.projectRoot();
return string.concat(root, "/deployments/PooledDepositsVaults-", vm.toString(block.chainid), ".json");
}

function savePooledDepositsDeployment(PooledDepositsVault[] memory pooledDepositsVaults) internal { // Renamed from PooledDeposits to PooledDepositsVault
string memory json = "pooledDepositsVaultsDeployment";
for (uint i = 0; i < pooledDepositsVaults.length; i++) {
vm.serializeAddress(json, vm.toString(i), address(pooledDepositsVaults[i]));
}
vm.writeJson(json, getDeploymentFile());
vm.writeJson(json, getVaultsDeploymentFile());
}
}

0 comments on commit aba040c

Please sign in to comment.