Skip to content

Commit

Permalink
Update mappins to return dataEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
LE0xUL committed Sep 23, 2023
1 parent 58cb149 commit 476a632
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 5 additions & 8 deletions contracts/factory/MeetdAppFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions contracts/utils/constans.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ enum consVarAdr {

struct dataEvent {
bool active;
uint256 eventNum;
string eventId;
MeetdAppEvent eventAddr;
bytes32 hashId;
}

0 comments on commit 476a632

Please sign in to comment.