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

Gang members modifier as access control to the `addToTheGang` function.

Summary

Modifier onlyRole (“gangmember”) in the addToTheGang function

Vulnerability Details

From the documentation adding new members is not among the functions allowed to gang members

GodFather: Owner, has all the rights.
GangMember:
Deposit USDC and withdraw USDC in exchange for CrimeMoney
Transfer CrimeMoney between members and godfather.
Take weapons that GodFather assigned to the member.
External users: can only call view functions and deposit USDC.

Impact

Only the Godfather should be able to add all new gang members.

Tools Used

Manual review

Recommendations

Make this change to the code:

- function addToTheGang(address account) external onlyRole("gangmember") isGodFather {
+ function addToTheGang(address account) external isGodFather {
kernel.grantRole(Role.wrap("gangmember"), account);
}
Updates

Lead Judging Commences

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