The LikeRegistry
contract deploys a new MultiSigWallet
for each mutual match but fails to provide a straightforward way for users to retrieve the address of the multisig wallet associated with their match. While the state can be read directly from the blockchain, the lack of a user-friendly mechanism to track and retrieve multisig wallet addresses creates a poor user experience.
Root Cause:
When a mutual match occurs, the matchRewards
function deploys a new MultiSigWallet
but does not store or provide a simple way to retrieve its address. Although the multisig wallet address can technically be read from the blockchain (e.g., by parsing events or transaction logs), this requires significant effort and technical expertise, which most users lack.
Example Scenario:
User A and User B mutually like each other, triggering the matchRewards
function.
A new MultiSigWallet
is deployed for A and B, and ETH is sent to it.
User A wants to interact with the multisig wallet but cannot easily retrieve its address because the contract does not provide a helper function to do so.
Poor User Experience: Users cannot easily retrieve the address of the multisig wallet associated with their match, making it difficult to interact with the matched funds.
Increased Complexity: Users must rely on off-chain tools or manually parse blockchain data to retrieve the multisig wallet address, which is not practical for non-technical users.
Reduced Trust in the Protocol: The lack of a user-friendly mechanism to track multisig wallets may lead to frustration and loss of trust in the protocol.
To address this issue, implement a helper function that allows users to easily retrieve the multisig wallet address for a specific match, regardless of the order in which the addresses are provided.
Step 1: Add a Mapping to Track Multisig Wallets
Store the address of each deployed multisig wallet in a mapping, using the matched users’ addresses as the key:
Step 2: Update matchRewards
to Track Wallets
Modify the matchRewards
function to store the multisig wallet address in the mapping for both combinations ([user1][user2]
and [user2][user1]
):
Step 3: Add a Helper Function for Retrieval
Provide a function for users to retrieve the multisig wallet address for a specific match, handling both combinations of addresses:
Step 4: Emit an Event for Transparency
Emit an event when a multisig wallet is created:
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
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.