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

Adding a Role check to `Laundrette::putGunsInTheSuspendedCeiling` function ensures that weapons stay in the gang

Description

godFather assigns weapons to GangMembers using the Laundrette::putGunsInTheSuspendedCeiling function but with no role checks there is a possibility that weapons may be assigned to non gangmembers

Impact

Weapons may be improperly assigned leading to discrepancies

Proof of Concept

No checks for account's Role in the function

Poc
​
function test_DepositGunsNoAddressZeroCheck() public {
vm.prank(godFather);
laundrette.putGunsInTheSuspendedCeiling(address(0), 3);
}
​

Recommended Mitigation

make the following changes in the function to mitigate the issue

​
function putGunsInTheSuspendedCeiling(address account, uint256 amount) external isGodFather {
+ require(kernel.hasRole(account, Role.wrap("gangmember")), "Account doesn't Belong to a GangMember");
weaponShelf.deposit(account, amount);
}
​
​
Updates

Lead Judging Commences

n0kto Lead Judge over 2 years ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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

Give us feedback!