First Flight #12: Kitty Connect

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

The same shop partner can be added twice in `KittyConnect:addShop()`

Severity

Impact: Medium, since a "bad" shop partner can be allowed twice

Likelihood: Low, since only authorized user can perform such activity

Description

KittyConnect:addShop() allows an admin to register a new shop partner in the KittyConnect protocol.
However, this function, doesn't check if a shop partner is already allowed before pushing it in the array of allowed partners.

function addShop(address shopAddress) external onlyKittyConnectOwner {
s_isKittyShop[shopAddress] = true;
s_kittyShops.push(shopAddress);
emit ShopPartnerAdded(shopAddress);
}

Recommendations

Change the function like this:

function addShop(address shopAddress) external onlyKittyConnectOwner {
+ if (s_isKittyShop[shopAddress])
+ revert KittyConnect__ShopAlreadyRegistered();
s_isKittyShop[shopAddress] = true;
s_kittyShops.push(shopAddress);
emit ShopPartnerAdded(shopAddress);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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