In the createMarketPlace function, the event CreateMarketPlaceInfo is emitted with the marketPlaceName string marked as indexed. However, according to Solidity documentation, when a non-value type like a string is indexed in an event, a Keccak-256 hash of the value is stored instead of the actual string. This results in the marketPlaceName being lost in the event data, leading to potential integration issues and increased complexity for users and front-end developers.
Note: This is the same for marketPlaceName in event UpdateMarket.
In the createMarketPlace function, the event CreateMarketPlaceInfo is emitted as follows:
The CreateMarketPlaceInfo event is defined as:
It is noted that string marketPlaceName is indexed.
Here, the marketPlaceName is indexed, which, according to the Solidity documentation, means that instead of storing the string directly, a Keccak-256 hash of the string is stored. Consequently, the actual marketPlaceName is lost in the event emission.
This introduces several problems:
Data Loss: The actual marketPlaceName is not directly retrievable from the event logs.
Increased Complexity: Users and front-end developers must hash all known marketPlaceName strings and compare them with the emitted hash to determine the original value. This adds unnecessary complexity and workload.
The data loss of marketPlaceName in the emitted event could lead to difficulties in integrating with the contract, as the original string is not directly accessible from the event logs. Although it’s possible to
NOTE:
Similar issues are also marked as Valid/Low in the following:
Manual, Solidity DOC
To mitigate this issue, it is recommended to remove the indexed keyword for marketPlaceName.
Invalid, known issue [Low-24](https://github.com/Cyfrin/2024-08-tadle/issues/1)
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.