The setAuctionConfig() function in the DaiGoldAuction contract is responsible for setting the auction configuration. However, the function emits an AuctionConfigSet event with the _currentEpochId, which refers to the last epoch ID instead of the current one. This can lead to confusion and potential errors in tracking the configuration changes, as the emitted event will reference an outdated epoch ID.
Emitting the last epochId instead of the current one has several potential impacts:
Tracking and Debugging: It can make it difficult to track and debug the configuration changes, as the emitted event references an outdated epoch ID.
Data Integrity: Misleading event data can compromise the integrity of the information being tracked, leading to incorrect assumptions and decisions based on the event logs.
User Confusion: Users and developers relying on event logs for accurate and up-to-date information may face confusion and errors, affecting their interaction with the contract.
Below is the setAuctionConfig() function as it currently stands, emitting the _currentEpochId:
Recommended Mitigation:
To address this issue, it is recommended to ensure that the correct, current epoch ID is emitted in the AuctionConfigSet event. This can be achieved by updating the _currentEpochId after the current epoch has ended, and then emitting the updated epoch ID in the event.
Here is an example of how this can be implemented:
Update the Function to Emit the Correct Epoch ID:
By updating the _currentEpochId before emitting the event, the contract ensures that the correct, current epoch ID is emitted, enhancing the accuracy and reliability of the event logs.
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.