Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: medium
Invalid

uneven beneficiary split when added multiple times

Summary:

Current setup allows for an address/beneficiery to be added multiple times

Vulnerability Details

function test_addBeneficiaryMultipleTimes() public {
vm.deal(address(im), 10e18);
vm.startPrank(owner);
im.addBeneficiery(user1);
im.addBeneficiery(user1);
im.addBeneficiery(user1);
im.addBeneficiery(user1);
im.addBeneficiery(user2);
im.removeBeneficiary(user1);
vm.warp(block.timestamp + 92 days);
im.inherit();
im.withdrawInheritedFunds(address(0));
vm.stopPrank();
console.log("balance user1", user1.balance);
}

Impact
with this setup the user1 and user2 would incorrectly be considered that amountPerBeneficiary is 2 eth, while it should be 5 eth each, since one of the addresses is present multiple times. user2 share can be furtehr diluted if even more repeating instances of user1 occur.

Tools Used

foundry

Recommendations:

Check and make sure in addBeneficeirysame addresses cannot be added multiple times

Updates

Lead Judging Commences

0xtimefliez Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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