From 476a632ee465cd6a73d95a1a3c3a9585ad09deea Mon Sep 17 00:00:00 2001 From: LE0xUL Date: Sat, 23 Sep 2023 17:23:01 -0500 Subject: [PATCH] Update mappins to return dataEvent --- contracts/factory/MeetdAppFactory.sol | 13 +++++-------- contracts/utils/constans.sol | 2 ++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/contracts/factory/MeetdAppFactory.sol b/contracts/factory/MeetdAppFactory.sol index 39c5e4c..7028eaa 100644 --- a/contracts/factory/MeetdAppFactory.sol +++ b/contracts/factory/MeetdAppFactory.sol @@ -14,17 +14,14 @@ contract MeetdAppFactory { /// @notice Store the number of created events uint256 public numEvents; -/// @notice Mapping to store all the created houses numEvents -> dataEvent + /// @notice Mapping to store all the created houses numEvents -> dataEvent mapping(uint256 => dataEvent) public mapNumEvent; /// @notice Relation between eventId (hash nanoId) and dataEvent mapping(bytes32 => dataEvent) public mapIdEvent; - /// @notice Relation between eventId (hash nanoId) and numEvents - mapping(bytes32 => uint256) public mapIdEventNum; - - /// @notice Relation between event Address and numEvents - mapping(address => uint256) public mapAddrEventNum; + /// @notice Relation between event Address and dataEvent + mapping(address => dataEvent) public mapAddrEventNum; event createdEvent( @@ -77,8 +74,8 @@ contract MeetdAppFactory { hashId: hashEventId }); - - mapIdEvent[hashEventId] = MeetdAppEvent(address(eventNew)); + mapIdEvent[hashEventId] = mapNumEvent[numEvents]; + mapAddrEventNum[address(eventNew)] = mapNumEvent[numEvents]; emit createdEvent( numEvents, diff --git a/contracts/utils/constans.sol b/contracts/utils/constans.sol index b05f2ec..0188111 100644 --- a/contracts/utils/constans.sol +++ b/contracts/utils/constans.sol @@ -25,6 +25,8 @@ enum consVarAdr { struct dataEvent { bool active; + uint256 eventNum; string eventId; MeetdAppEvent eventAddr; + bytes32 hashId; }