From 266d6dca9081363728882e1e98959221e6e0f8ee Mon Sep 17 00:00:00 2001 From: sujithsomraaj Date: Mon, 8 Jan 2024 13:22:30 +0530 Subject: [PATCH 1/2] chore: remove indexed keyword from bytes --- src/crosschain-data/BaseStateRegistry.sol | 3 +-- .../adapters/layerzero/LayerzeroImplementation.sol | 5 ++--- src/interfaces/IBaseStateRegistry.sol | 2 +- src/interfaces/IPaymentHelper.sol | 3 +-- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/crosschain-data/BaseStateRegistry.sol b/src/crosschain-data/BaseStateRegistry.sol index 6cae8cdb9..d8b10261c 100644 --- a/src/crosschain-data/BaseStateRegistry.sol +++ b/src/crosschain-data/BaseStateRegistry.sol @@ -16,7 +16,6 @@ import { PayloadState, AMBMessage, AMBExtraData } from "src/types/DataTypes.sol" /// mechanisms. /// @author Zeropoint Labs abstract contract BaseStateRegistry is IBaseStateRegistry { - using ProofLib for AMBMessage; using ProofLib for bytes; @@ -117,7 +116,7 @@ abstract contract BaseStateRegistry is IBaseStateRegistry { bytes32 proofHash = abi.decode(data.params, (bytes32)); ++messageQuorum[proofHash]; - emit ProofReceived(data.params); + emit ProofReceived(proofHash); } else { /// @dev if message, store header and body of it ++payloadsCount; diff --git a/src/crosschain-data/adapters/layerzero/LayerzeroImplementation.sol b/src/crosschain-data/adapters/layerzero/LayerzeroImplementation.sol index bf4ff4037..6b7efc86e 100644 --- a/src/crosschain-data/adapters/layerzero/LayerzeroImplementation.sol +++ b/src/crosschain-data/adapters/layerzero/LayerzeroImplementation.sol @@ -16,7 +16,6 @@ import { ILayerZeroUserApplicationConfig } from "src/vendor/layerzero/ILayerZero /// @dev Allows state registries to use Layerzero for crosschain communication /// @author Zeropoint Labs contract LayerzeroImplementation is IAmbImplementation, ILayerZeroUserApplicationConfig, ILayerZeroReceiver { - using DataLib for uint256; ////////////////////////////////////////////////////////////// @@ -41,8 +40,8 @@ contract LayerzeroImplementation is IAmbImplementation, ILayerZeroUserApplicatio ////////////////////////////////////////////////////////////// event EndpointUpdated(address indexed oldEndpoint_, address indexed newEndpoint_); - event MessageFailed(uint16 indexed srcChainId_, bytes indexed srcAddress_, uint64 indexed nonce_, bytes payload_); - event SetTrustedRemote(uint16 indexed srcChainId_, bytes indexed srcAddress_); + event MessageFailed(uint16 indexed srcChainId_, bytes srcAddress_, uint64 indexed nonce_, bytes payload_); + event SetTrustedRemote(uint16 indexed srcChainId_, bytes srcAddress_); ////////////////////////////////////////////////////////////// // MODIFIERS // diff --git a/src/interfaces/IBaseStateRegistry.sol b/src/interfaces/IBaseStateRegistry.sol index 4b43277ed..c625d47ee 100644 --- a/src/interfaces/IBaseStateRegistry.sol +++ b/src/interfaces/IBaseStateRegistry.sol @@ -16,7 +16,7 @@ interface IBaseStateRegistry { /// @dev is emitted when a cross-chain proof is received in the state registry /// NOTE: comes handy if quorum required is more than 0 - event ProofReceived(bytes indexed proof); + event ProofReceived(bytes32 indexed proof); /// @dev is emitted when a payload id gets updated event PayloadUpdated(uint256 indexed payloadId); diff --git a/src/interfaces/IPaymentHelper.sol b/src/interfaces/IPaymentHelper.sol index c84019d6d..df07181e8 100644 --- a/src/interfaces/IPaymentHelper.sol +++ b/src/interfaces/IPaymentHelper.sol @@ -14,7 +14,6 @@ import { /// @dev Interface for PaymentHelper /// @author ZeroPoint Labs interface IPaymentHelper { - ////////////////////////////////////////////////////////////// // STRUCTS // ////////////////////////////////////////////////////////////// @@ -50,7 +49,7 @@ interface IPaymentHelper { // EVENTS // ////////////////////////////////////////////////////////////// - event ChainConfigUpdated(uint64 indexed chainId_, uint256 indexed configType_, bytes indexed config_); + event ChainConfigUpdated(uint64 indexed chainId_, uint256 indexed configType_, bytes config_); event ChainConfigAdded(uint64 chainId_, PaymentHelperConfig config_); ////////////////////////////////////////////////////////////// From f6c0398d5e82523c85c74a1a48c3177a9c2acab3 Mon Sep 17 00:00:00 2001 From: sujithsomraaj Date: Tue, 9 Jan 2024 19:32:33 +0530 Subject: [PATCH 2/2] fix: indexed in dynamic types --- src/interfaces/ICoreStateRegistry.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interfaces/ICoreStateRegistry.sol b/src/interfaces/ICoreStateRegistry.sol index d9614a9d4..953130499 100644 --- a/src/interfaces/ICoreStateRegistry.sol +++ b/src/interfaces/ICoreStateRegistry.sol @@ -35,8 +35,8 @@ interface ICoreStateRegistry { /// @dev is emitted when a rescue is proposed for failed deposits in a payload event RescueProposed( uint256 indexed payloadId, - uint256[] indexed superformIds, - uint256[] indexed proposedAmount, + uint256[] superformIds, + uint256[] proposedAmount, uint256 proposedTime );