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

Test case for owner can read password is missing

Summary

Test suite is missing a test to confirm the owner can read the proper password back after setting it during initial contract deployment.

Impact

This test confirms that the contract properly returns the expected password after deployment.

Tools Used

  • foundry

Recommendations

Create new test case:

// Tests that owner can read the proper password back
function test_owner_can_read_password() public {
// msg.sender will be set to the owner
vm.startPrank(owner);
// The expected password, this should match initial deployed password
string memory expectedPassword = "myPassword";
// Read the password from the contract
string memory password = passwordStore.getPassword();
// Assert that the expected and returned password are equal
assertEq(expectedPassword, password);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge
about 2 years ago
inallhonesty Lead Judge about 2 years ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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