From d80be81b988318cb01cecb0c3ffa79a38d797c2e Mon Sep 17 00:00:00 2001 From: "david.ding" Date: Wed, 3 Jan 2024 12:14:04 +0800 Subject: [PATCH] fix compiler error --- .../BaseSecurityControlModule.sol | 0 .../IBaseSecurityControlModule.sol | 0 .../SecurityControlModule.sol | 0 .../ITrustedContractManager.sol | 0 .../TrustedContractManager.sol | 0 .../trustedHookManager/TrustedHookManager.sol | 0 .../TrustedModuleManager.sol | 0 .../TrustedValidatorManager.sol | 0 .../modules/{Upgrade => upgrade}/IUpgrade.sol | 0 .../{Upgrade => upgrade}/UpgradeModule.sol | 0 ...oreValidator.sol => KeyStoreValidator.sol} | 44 +++++++++---------- 11 files changed, 20 insertions(+), 24 deletions(-) rename contracts/modules/{SecurityControlModule => securityControlModule}/BaseSecurityControlModule.sol (100%) rename contracts/modules/{SecurityControlModule => securityControlModule}/IBaseSecurityControlModule.sol (100%) rename contracts/modules/{SecurityControlModule => securityControlModule}/SecurityControlModule.sol (100%) rename contracts/modules/{SecurityControlModule => securityControlModule}/trustedContractManager/ITrustedContractManager.sol (100%) rename contracts/modules/{SecurityControlModule => securityControlModule}/trustedContractManager/TrustedContractManager.sol (100%) rename contracts/modules/{SecurityControlModule => securityControlModule}/trustedContractManager/trustedHookManager/TrustedHookManager.sol (100%) rename contracts/modules/{SecurityControlModule => securityControlModule}/trustedContractManager/trustedModuleManager/TrustedModuleManager.sol (100%) rename contracts/modules/{SecurityControlModule => securityControlModule}/trustedContractManager/trustedValidatorManager/TrustedValidatorManager.sol (100%) rename contracts/modules/{Upgrade => upgrade}/IUpgrade.sol (100%) rename contracts/modules/{Upgrade => upgrade}/UpgradeModule.sol (100%) rename contracts/validator/{KeystoreValidator.sol => KeyStoreValidator.sol} (67%) diff --git a/contracts/modules/SecurityControlModule/BaseSecurityControlModule.sol b/contracts/modules/securityControlModule/BaseSecurityControlModule.sol similarity index 100% rename from contracts/modules/SecurityControlModule/BaseSecurityControlModule.sol rename to contracts/modules/securityControlModule/BaseSecurityControlModule.sol diff --git a/contracts/modules/SecurityControlModule/IBaseSecurityControlModule.sol b/contracts/modules/securityControlModule/IBaseSecurityControlModule.sol similarity index 100% rename from contracts/modules/SecurityControlModule/IBaseSecurityControlModule.sol rename to contracts/modules/securityControlModule/IBaseSecurityControlModule.sol diff --git a/contracts/modules/SecurityControlModule/SecurityControlModule.sol b/contracts/modules/securityControlModule/SecurityControlModule.sol similarity index 100% rename from contracts/modules/SecurityControlModule/SecurityControlModule.sol rename to contracts/modules/securityControlModule/SecurityControlModule.sol diff --git a/contracts/modules/SecurityControlModule/trustedContractManager/ITrustedContractManager.sol b/contracts/modules/securityControlModule/trustedContractManager/ITrustedContractManager.sol similarity index 100% rename from contracts/modules/SecurityControlModule/trustedContractManager/ITrustedContractManager.sol rename to contracts/modules/securityControlModule/trustedContractManager/ITrustedContractManager.sol diff --git a/contracts/modules/SecurityControlModule/trustedContractManager/TrustedContractManager.sol b/contracts/modules/securityControlModule/trustedContractManager/TrustedContractManager.sol similarity index 100% rename from contracts/modules/SecurityControlModule/trustedContractManager/TrustedContractManager.sol rename to contracts/modules/securityControlModule/trustedContractManager/TrustedContractManager.sol diff --git a/contracts/modules/SecurityControlModule/trustedContractManager/trustedHookManager/TrustedHookManager.sol b/contracts/modules/securityControlModule/trustedContractManager/trustedHookManager/TrustedHookManager.sol similarity index 100% rename from contracts/modules/SecurityControlModule/trustedContractManager/trustedHookManager/TrustedHookManager.sol rename to contracts/modules/securityControlModule/trustedContractManager/trustedHookManager/TrustedHookManager.sol diff --git a/contracts/modules/SecurityControlModule/trustedContractManager/trustedModuleManager/TrustedModuleManager.sol b/contracts/modules/securityControlModule/trustedContractManager/trustedModuleManager/TrustedModuleManager.sol similarity index 100% rename from contracts/modules/SecurityControlModule/trustedContractManager/trustedModuleManager/TrustedModuleManager.sol rename to contracts/modules/securityControlModule/trustedContractManager/trustedModuleManager/TrustedModuleManager.sol diff --git a/contracts/modules/SecurityControlModule/trustedContractManager/trustedValidatorManager/TrustedValidatorManager.sol b/contracts/modules/securityControlModule/trustedContractManager/trustedValidatorManager/TrustedValidatorManager.sol similarity index 100% rename from contracts/modules/SecurityControlModule/trustedContractManager/trustedValidatorManager/TrustedValidatorManager.sol rename to contracts/modules/securityControlModule/trustedContractManager/trustedValidatorManager/TrustedValidatorManager.sol diff --git a/contracts/modules/Upgrade/IUpgrade.sol b/contracts/modules/upgrade/IUpgrade.sol similarity index 100% rename from contracts/modules/Upgrade/IUpgrade.sol rename to contracts/modules/upgrade/IUpgrade.sol diff --git a/contracts/modules/Upgrade/UpgradeModule.sol b/contracts/modules/upgrade/UpgradeModule.sol similarity index 100% rename from contracts/modules/Upgrade/UpgradeModule.sol rename to contracts/modules/upgrade/UpgradeModule.sol diff --git a/contracts/validator/KeystoreValidator.sol b/contracts/validator/KeyStoreValidator.sol similarity index 67% rename from contracts/validator/KeystoreValidator.sol rename to contracts/validator/KeyStoreValidator.sol index a205679d..9f9ea1c8 100644 --- a/contracts/validator/KeystoreValidator.sol +++ b/contracts/validator/KeyStoreValidator.sol @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.20; + import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "../keystore/L1/interfaces/IKeyStoreValidator.sol"; import "./libraries/ValidatorSigDecoder.sol"; @@ -7,33 +8,29 @@ import "../libraries/WebAuthn.sol"; import "../libraries/Errors.sol"; import "../libraries/TypeConversion.sol"; -contract KeyStoreValidator is IKeyStoreValidator{ +contract KeyStoreValidator is IKeyStoreValidator { using TypeConversion for address; - function recoverSignature( - bytes32 rawHash, - bytes calldata rawSignature - ) external view returns (bytes32 recovered, bool success) { + function recoverSignature(bytes32 rawHash, bytes calldata rawSignature) + external + view + returns (bytes32 recovered, bool success) + { uint8 signatureType; bytes calldata signature; uint256 validationData; - (signatureType, validationData, signature) = ValidatorSigDecoder - .decodeValidatorSignature(rawSignature); + (signatureType, validationData, signature) = ValidatorSigDecoder.decodeValidatorSignature(rawSignature); - bytes32 hash = _packSignatureHash( - rawHash, - signatureType, - validationData - ); + bytes32 hash = _packSignatureHash(rawHash, signatureType, validationData); (recovered, success) = recover(signatureType, hash, signature); } - function _packSignatureHash( - bytes32 _hash, - uint8 signatureType, - uint256 validationData - ) internal pure returns (bytes32 packedHash) { + function _packSignatureHash(bytes32 _hash, uint8 signatureType, uint256 validationData) + internal + pure + returns (bytes32 packedHash) + { if (signatureType == 0x0) { packedHash = _hash; } else if (signatureType == 0x1) { @@ -47,15 +44,14 @@ contract KeyStoreValidator is IKeyStoreValidator{ } } - function recover( - uint8 signatureType, - bytes32 rawHash, - bytes calldata rawSignature - ) internal view returns (bytes32 recovered, bool success) { + function recover(uint8 signatureType, bytes32 rawHash, bytes calldata rawSignature) + internal + view + returns (bytes32 recovered, bool success) + { if (signatureType == 0x0 || signatureType == 0x1) { //ecdas recover - (address recoveredAddr, ECDSA.RecoverError error, ) = ECDSA - .tryRecover(rawHash, rawSignature); + (address recoveredAddr, ECDSA.RecoverError error,) = ECDSA.tryRecover(rawHash, rawSignature); if (error != ECDSA.RecoverError.NoError) { success = false; } else {