First Flight #12: Kitty Connect

First Flight #12: Kitty Connect
Beginner FriendlyFoundryNFTGameFi
100 EXP
View results
Submission Details
Severity: medium
Invalid

Initial Shop Partners missing events

Summary

No ShopPartnerAdded event emitted on initShops creations in KittyConnect::constructor.

Vulnerability Details

Shops added in KittyConnect::constructor via the initShops param do not have events emitted for their addition.

Impact

Missing these events causes discrepancies between the true state of the protocol and the events representing it. Leading to potential confusion for users, and errors caused by trusting that information for further computation.

Tools Used

Manual Review

Recommendations

An initialize function could be added which would be called after the initial deployment that emits these missed events
In KittyConnect.sol

+ // Initializer
+ /**
+ * @notice Emits events missed in the constructor
+ * @dev This function is called by the deployer script to emit events for the initial shop creations
+ */
+ function init() external onlyKittyConnectOwner {
+ for (uint256 i = 0; i < s_kittyShops.length; i++) {
+ emit ShopPartnerAdded(s_kittyShops[i]);
+ }
+ }

In DeployKittyConnect.s.sol

KittyConnect kittyConnect =
new KittyConnect(networkConfig.initShopPartners, networkConfig.router, networkConfig.link);
+ kittyConnect.init();
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.