Default value uint256 is 0 for the ownerToId mapping in the Soulmate contract. Hence, the lack of access control within the readMessageInSharedSpace and writeMessageInSharedSpace allows uninitialized addresses in the ownerToId mapping to read and write messages within the shared space.
Within your foundry test suite, set up your Test based contract and initialize Soulmate contract and paste the below code blocks.
Run the test with the command below:
Failed result output:
Soulmates with NFT ID == 0 cannot enjoy the shared space privilege since some uninitialized address in ownerToId mapping can participate.
Foundry
Manual Code Review
Medium Severity, This has an indirect impact and influence on the possibility of divorce between soulmates owning the first soulmate NFT id0, leading to permanent loss of ability to earn airdrops/staking rewards.
Medium Severity, This has an indirect impact and influence on the possibility of divorce between soulmates owning the first soulmate NFT id0, leading to permanent loss of ability to earn airdrops/staking rewards.
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.