matchRewards(address from, address to) is intended to reward both matched users by deploying MultiSigWallet(from, to) where from represents the initiating liker (owner1) and to represents the liked party (owner2).
The call site in likeUser passes liked as from and msg.sender (the liker) as to, permanently inverting the ownership roles. The account that pressed "like" to trigger the match becomes owner2 of the shared wallet instead of owner1.
Likelihood:
Every successful match triggers matchRewards — 100% of deployed MultiSig wallets have inverted ownership roles.
Impact:
Off-chain tooling, front-end displays, and any protocol logic keyed to owner1 being the liker will behave incorrectly for every match.
Once H-2 is fixed and real ETH flows into wallets, affected users interacting with the wrong role could face UX failures or unexpected permission assignments.
This test demonstrates the ownership inversion by reading owner1 and owner2 directly from the deployed MultiSigWallet after a match:
Setup — Bob likes Alice first (Bob is the first liker). Alice is funded and likes Bob second, which triggers the match.
likeUser fires — Inside likeUser, msg.sender = alice and liked = bob. The call is matchRewards(liked=bob, msg.sender=alice), so from = bob and to = alice.
MultiSig deployed — new MultiSigWallet(bob, alice) is called, making owner1 = bob (the previously-liked party) and owner2 = alice (the one who triggered the match).
Expected versus actual — Alice initiated the match-triggering call, so she should logically be owner1. Instead she is owner2. The roles are swapped for every matched pair in the protocol.
To run: forge test --match-test test_ownershipInvertedInMultiSig -vvvv
Swap the argument order to match the intended semantics:
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.