Beginner FriendlyDeFiFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

L-03. Unnecessary modifier for takeGuns

Summary

The method Laundrette::takeGuns has useless modifier onlyRole("gangmember") because it already has isAuthorizedOrRevert(account) and guns are given only to gang members.

Vulnerability Details

Since the modifier isAuthorizedOrRevert(account) modifier checks if the user is the one who is meant to take guns given to him/herand also checks if the transaction sender is GodFather, then it's useless to haveonlyRole("gangmember")` modifier for the method.

Impact

Unnecessary code.

Tools Used

Manual Review

Recommendations

Remove the onlyRole("gangmember") for Laundrette::addToTheGang.

- function takeGuns(address account, uint256 amount) external onlyRole("gangmember") isAuthorizedOrRevert(account) {
+ function takeGuns(address account, uint256 amount) external isAuthorizedOrRevert(account) {
weaponShelf.withdraw(account, amount);
}
Updates

Lead Judging Commences

n0kto Lead Judge about 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.