Skip to content
Merged

fmt #19

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ npm run upgrade-vault

## 📄 License

This project is licensed under the Business Source License 1.1 (BUSL-1.1). See the [LICENSE](LICENSE) file for details.
This project is licensed under the Business Source License 1.1 (BUSL-1.1). See the [LICENSE](https://spdx.org/licenses/BUSL-1.1.html) file for details.

---

Expand Down
22 changes: 9 additions & 13 deletions script/BaseScript.s.sol
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.25;
/*
______ __ __
/ \ / | / |
/$$$$$$ |$$ | ______ ______ $$ |____
$$ |__$$ |$$ | / \ / \ $$ \
______ __ __
/ \ / | / |
/$$$$$$ |$$ | ______ ______ $$ |____
$$ |__$$ |$$ | / \ / \ $$ \
$$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ |
$$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ |
$$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ |
$$ | $$ |$$ |$$ |$$ $$/ $$ | $$ |
$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/
$$ |
$$ |
$$/
$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/
$$ |
$$ |
$$/
*/

import {Script, console} from "forge-std/Script.sol";
Expand Down Expand Up @@ -98,11 +98,7 @@ abstract contract BaseScript is Script {
return _beacon;
}

function _getFactoryProxyOwner(string memory _chainId, string memory _environment)
internal
view
returns (address)
{
function _getFactoryProxyOwner(string memory _chainId, string memory _environment) internal view returns (address) {
string memory _deploymentConfig = vm.readFile(_getDeploymentConfigFilePath());
string memory _proxyOwnerKey = string.concat(".", _chainId, ".", _environment, ".factoryProxyOwner");
address _proxyOwner = vm.parseJsonAddress(_deploymentConfig, _proxyOwnerKey);
Expand Down
17 changes: 9 additions & 8 deletions script/DeploymentScripts/DeployAccountant.s.sol
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.25;
/*
______ __ __
/ \ / | / |
/$$$$$$ |$$ | ______ ______ $$ |____
$$ |__$$ |$$ | / \ / \ $$ \
______ __ __
/ \ / | / |
/$$$$$$ |$$ | ______ ______ $$ |____
$$ |__$$ |$$ | / \ / \ $$ \
$$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ |
$$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ |
$$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ |
$$ | $$ |$$ |$$ |$$ $$/ $$ | $$ |
$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/
$$ |
$$ |
$$/
$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/
$$ |
$$ |
$$/
*/

import {Script, console} from "forge-std/Script.sol";
Expand All @@ -24,6 +24,7 @@ import {
import {BaseScript} from "@aleph-script/BaseScript.s.sol";
import {IAccountant} from "@aleph-vault/interfaces/IAccountant.sol";
import {Accountant} from "@aleph-vault/Accountant.sol";

/**
* @author Othentic Labs LTD.
* @notice Terms of Service: https://aleph.finance/terms-of-service
Expand Down
22 changes: 12 additions & 10 deletions script/DeploymentScripts/DeployAlephVault.s.sol
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.25;
/*
______ __ __
/ \ / | / |
/$$$$$$ |$$ | ______ ______ $$ |____
$$ |__$$ |$$ | / \ / \ $$ \
______ __ __
/ \ / | / |
/$$$$$$ |$$ | ______ ______ $$ |____
$$ |__$$ |$$ | / \ / \ $$ \
$$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ |
$$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ |
$$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ |
$$ | $$ |$$ |$$ |$$ $$/ $$ | $$ |
$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/
$$ |
$$ |
$$/
$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/
$$ |
$$ |
$$/
*/

import {Script, console} from "forge-std/Script.sol";
Expand All @@ -22,6 +22,7 @@ import {BaseScript} from "@aleph-script/BaseScript.s.sol";
import {IAlephVault} from "@aleph-vault/interfaces/IAlephVault.sol";
import {IAlephVaultFactory} from "@aleph-vault/interfaces/IAlephVaultFactory.sol";
import {AuthLibrary} from "@aleph-vault/libraries/AuthLibrary.sol";

/**
* @author Othentic Labs LTD.
* @notice Terms of Service: https://aleph.finance/terms-of-service
Expand Down Expand Up @@ -82,8 +83,9 @@ contract DeployAlephVault is BaseScript {
string memory _vaultName,
string memory _vaultConfigId
) internal view returns (AuthLibrary.AuthSignature memory) {
bytes32 _authMessage =
keccak256(abi.encode(_vaultManager, _factory, _vaultName, _vaultConfigId, block.chainid, type(uint256).max));
bytes32 _authMessage = keccak256(
abi.encode(_vaultManager, _factory, _vaultName, _vaultConfigId, block.chainid, type(uint256).max)
);
bytes32 _ethSignedMessage = _authMessage.toEthSignedMessageHash();
uint256 _authSignerPrivateKey = _getAuthSignerPrivateKey();
(uint8 _v, bytes32 _r, bytes32 _s) = vm.sign(_authSignerPrivateKey, _ethSignedMessage);
Expand Down
17 changes: 9 additions & 8 deletions script/DeploymentScripts/DeployAlephVaultBeacon.s.sol
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.25;
/*
______ __ __
/ \ / | / |
/$$$$$$ |$$ | ______ ______ $$ |____
$$ |__$$ |$$ | / \ / \ $$ \
______ __ __
/ \ / | / |
/$$$$$$ |$$ | ______ ______ $$ |____
$$ |__$$ |$$ | / \ / \ $$ \
$$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ |
$$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ |
$$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ |
$$ | $$ |$$ |$$ |$$ $$/ $$ | $$ |
$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/
$$ |
$$ |
$$/
$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/
$$ |
$$ |
$$/
*/

import {Script, console} from "forge-std/Script.sol";
import {console} from "forge-std/console.sol";
import {UpgradeableBeacon} from "lib/openzeppelin-contracts/contracts/proxy/beacon/UpgradeableBeacon.sol";
import {BaseScript} from "@aleph-script/BaseScript.s.sol";

/**
* @author Othentic Labs LTD.
* @notice Terms of Service: https://aleph.finance/terms-of-service
Expand Down
27 changes: 16 additions & 11 deletions script/DeploymentScripts/DeployAlephVaultFactory.s.sol
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.25;
/*
______ __ __
/ \ / | / |
/$$$$$$ |$$ | ______ ______ $$ |____
$$ |__$$ |$$ | / \ / \ $$ \
______ __ __
/ \ / | / |
/$$$$$$ |$$ | ______ ______ $$ |____
$$ |__$$ |$$ | / \ / \ $$ \
$$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ |
$$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ |
$$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ |
$$ | $$ |$$ |$$ |$$ $$/ $$ | $$ |
$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/
$$ |
$$ |
$$/
$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/
$$ |
$$ |
$$/
*/

import {Script, console} from "forge-std/Script.sol";
Expand All @@ -24,6 +24,7 @@ import {
import {BaseScript} from "@aleph-script/BaseScript.s.sol";
import {IAlephVaultFactory} from "@aleph-vault/interfaces/IAlephVaultFactory.sol";
import {AlephVaultFactory} from "@aleph-vault/factory/AlephVaultFactory.sol";

/**
* @author Othentic Labs LTD.
* @notice Terms of Service: https://aleph.finance/terms-of-service
Expand Down Expand Up @@ -87,7 +88,9 @@ contract DeployAlephVaultFactory is BaseScript {
),
oracle: vm.parseJsonAddress(_factoryConfig, string.concat(".", _chainId, ".", _environment, ".oracle")),
guardian: vm.parseJsonAddress(_factoryConfig, string.concat(".", _chainId, ".", _environment, ".guardian")),
authSigner: vm.parseJsonAddress(_factoryConfig, string.concat(".", _chainId, ".", _environment, ".authSigner")),
authSigner: vm.parseJsonAddress(
_factoryConfig, string.concat(".", _chainId, ".", _environment, ".authSigner")
),
accountant: vm.parseJsonAddress(
_deploymentConfig, string.concat(".", _chainId, ".", _environment, ".accountantProxyAddress")
),
Expand All @@ -98,13 +101,15 @@ contract DeployAlephVaultFactory is BaseScript {
_deploymentConfig, string.concat(".", _chainId, ".", _environment, ".vaultRedeemImplementationAddress")
),
alephVaultSettlementImplementation: vm.parseJsonAddress(
_deploymentConfig, string.concat(".", _chainId, ".", _environment, ".vaultSettlementImplementationAddress")
_deploymentConfig,
string.concat(".", _chainId, ".", _environment, ".vaultSettlementImplementationAddress")
),
feeManagerImplementation: vm.parseJsonAddress(
_deploymentConfig, string.concat(".", _chainId, ".", _environment, ".feeManagerImplementationAddress")
),
migrationManagerImplementation: vm.parseJsonAddress(
_deploymentConfig, string.concat(".", _chainId, ".", _environment, ".migrationManagerImplementationAddress")
_deploymentConfig,
string.concat(".", _chainId, ".", _environment, ".migrationManagerImplementationAddress")
)
});
}
Expand Down
17 changes: 9 additions & 8 deletions script/DeploymentScripts/DeployAlephVaultImplementation.s.sol
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.25;
/*
______ __ __
/ \ / | / |
/$$$$$$ |$$ | ______ ______ $$ |____
$$ |__$$ |$$ | / \ / \ $$ \
______ __ __
/ \ / | / |
/$$$$$$ |$$ | ______ ______ $$ |____
$$ |__$$ |$$ | / \ / \ $$ \
$$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ |
$$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ |
$$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ |
$$ | $$ |$$ |$$ |$$ $$/ $$ | $$ |
$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/
$$ |
$$ |
$$/
$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/
$$ |
$$ |
$$/
*/

import {Script, console} from "forge-std/Script.sol";
Expand All @@ -28,6 +28,7 @@ import {AlephVaultSettlement} from "@aleph-vault/modules/AlephVaultSettlement.so
import {FeeManager} from "@aleph-vault/modules/FeeManager.sol";
import {MigrationManager} from "@aleph-vault/modules/MigrationManager.sol";
import {AlephVault} from "@aleph-vault/AlephVault.sol";

/**
* @author Othentic Labs LTD.
* @notice Terms of Service: https://aleph.finance/terms-of-service
Expand Down
16 changes: 8 additions & 8 deletions script/Migrations/SetVaultFactory.sol
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.25;
/*
______ __ __
/ \ / | / |
/$$$$$$ |$$ | ______ ______ $$ |____
$$ |__$$ |$$ | / \ / \ $$ \
______ __ __
/ \ / | / |
/$$$$$$ |$$ | ______ ______ $$ |____
$$ |__$$ |$$ | / \ / \ $$ \
$$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ |
$$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ |
$$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ |
$$ | $$ |$$ |$$ |$$ $$/ $$ | $$ |
$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/
$$ |
$$ |
$$/
$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/
$$ |
$$ |
$$/
*/

import {Script, console} from "forge-std/Script.sol";
Expand Down
21 changes: 10 additions & 11 deletions script/UpgradeScripts/UpgradeAccountant.s.sol
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.25;
/*
______ __ __
/ \ / | / |
/$$$$$$ |$$ | ______ ______ $$ |____
$$ |__$$ |$$ | / \ / \ $$ \
______ __ __
/ \ / | / |
/$$$$$$ |$$ | ______ ______ $$ |____
$$ |__$$ |$$ | / \ / \ $$ \
$$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ |
$$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ |
$$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ |
$$ | $$ |$$ |$$ |$$ $$/ $$ | $$ |
$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/
$$ |
$$ |
$$/
$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/
$$ |
$$ |
$$/
*/

import {Script, console} from "forge-std/Script.sol";
Expand Down Expand Up @@ -48,9 +48,8 @@ contract UpgradeAccountant is BaseScript {

address _proxyAdmin = address(uint160(uint256(vm.load(_proxy, ADMIN_SLOT))));

ProxyAdmin(_proxyAdmin).upgradeAndCall(
ITransparentUpgradeableProxy(payable(_proxy)), address(_accountantImpl), ""
);
ProxyAdmin(_proxyAdmin)
.upgradeAndCall(ITransparentUpgradeableProxy(payable(_proxy)), address(_accountantImpl), "");
console.log("Accountant upgraded to", address(_accountantImpl));

_writeDeploymentConfig(
Expand Down
37 changes: 17 additions & 20 deletions script/UpgradeScripts/UpgradeAlephVault.s.sol
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.25;
/*
______ __ __
/ \ / | / |
/$$$$$$ |$$ | ______ ______ $$ |____
$$ |__$$ |$$ | / \ / \ $$ \
______ __ __
/ \ / | / |
/$$$$$$ |$$ | ______ ______ $$ |____
$$ |__$$ |$$ | / \ / \ $$ \
$$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ |
$$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ |
$$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ |
$$ | $$ |$$ |$$ |$$ $$/ $$ | $$ |
$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/
$$ |
$$ |
$$/
$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/
$$ |
$$ |
$$/
*/

import {Script, console} from "forge-std/Script.sol";
Expand All @@ -23,6 +23,7 @@ import {IAlephVault} from "@aleph-vault/interfaces/IAlephVault.sol";
import {IAlephVaultFactory} from "@aleph-vault/interfaces/IAlephVaultFactory.sol";
import {ModulesLibrary} from "@aleph-vault/libraries/ModulesLibrary.sol";
import {AlephVault} from "@aleph-vault/AlephVault.sol";

/**
* @author Othentic Labs LTD.
* @notice Terms of Service: https://aleph.finance/terms-of-service
Expand Down Expand Up @@ -64,18 +65,14 @@ contract UpgradeAlephVault is BaseScript {
address _migrationManagerImplementation =
_getModuleImplementation(_chainId, _environment, "migrationManagerImplementationAddress");

IAlephVaultFactory(_vaultFactory).setModuleImplementation(
ModulesLibrary.ALEPH_VAULT_DEPOSIT, _vaultDepositImplementation
);
IAlephVaultFactory(_vaultFactory).setModuleImplementation(
ModulesLibrary.ALEPH_VAULT_REDEEM, _vaultRedeemImplementation
);
IAlephVaultFactory(_vaultFactory).setModuleImplementation(
ModulesLibrary.ALEPH_VAULT_SETTLEMENT, _vaultSettlementImplementation
);
IAlephVaultFactory(_vaultFactory)
.setModuleImplementation(ModulesLibrary.ALEPH_VAULT_DEPOSIT, _vaultDepositImplementation);
IAlephVaultFactory(_vaultFactory)
.setModuleImplementation(ModulesLibrary.ALEPH_VAULT_REDEEM, _vaultRedeemImplementation);
IAlephVaultFactory(_vaultFactory)
.setModuleImplementation(ModulesLibrary.ALEPH_VAULT_SETTLEMENT, _vaultSettlementImplementation);
IAlephVaultFactory(_vaultFactory).setModuleImplementation(ModulesLibrary.FEE_MANAGER, _feeManagerImplementation);
IAlephVaultFactory(_vaultFactory).setModuleImplementation(
ModulesLibrary.MIGRATION_MANAGER, _migrationManagerImplementation
);
IAlephVaultFactory(_vaultFactory)
.setModuleImplementation(ModulesLibrary.MIGRATION_MANAGER, _migrationManagerImplementation);
}
}
Loading