addShop
function can add the same shop address multiple times which create a duplicate entry in the s_kittyShops
array ans also we can not remove the shop address from the s_kittyShops
array if it is added multiple times.
addShop
function can add the same shop address multiple times which create a duplicate entry in the s_kittyShops
array ans also we can not remove the shop address from the s_kittyShops
array if it is added multiple times.
So, we can put a check in the addShop
function to check if the shop address is already added or not. If it is already added then we can revert the transaction.
Paste this POC code in the KittyTest.t.sol
.
Run this test by this command.
leads to the duplicate entry in the s_kittyShops
array.
we can not remove the shop address from the s_kittyShops
array if it is added multiple times.
Manual review
Here, we add a check in addShop
funtion to check the shop address is already added or not. If it is already added then we can revert the transaction.
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.