In the inherit function, no checks are done to see if the address/addresses calling the function are even beneficiaries.
Anyone can call the function and either become the owner or switch isInherited to true, leading to further problems.
The test below does the following:
Owner is pranked and they add user1 as a beneficiary.
90 days later, user2 calls inherit and becomes the owner as proven in the assertEq.
Add the following code to InheritanceManagerTest.t.sol:
Manual review, Foundry
A mapping can be added which allows a gas efficient check to be done to ensure caller is a beneficiary.
Add the following mapping to the codebase:
Add the following to addBeneficiary tp update the mapping:
Make sure to set isBeneficiary to False in removeBeneficiary.
Add the following code to inherit:
Add error NotABeneficiary(); to codebase.
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.