The matchRewards()
function creates a new MultiSigWallet contract every time a match occurs. This permanently deploys multiple duplicate wallets on-chain, leading to high gas costs, redundant storage, and potential loss of funds.
matchRewards()
in LikeRegistry.sol
Problem:
Every match deploys a new MultiSigWallet contract on-chain.
Users who match multiple times will generate multiple redundant wallets.
Old wallets remain permanently deployed, wasting gas & blockchain storage.
Funds can get stuck in unused wallets, as users may not track all deployed wallets.
PoC
1.Alice and Bob match the first time.
A new MultiSigWallet is deployed.
MultiSigWallet #1 is created.
2.Alice and Bob match again later.
Another MultiSigWallet is deployed.
MultiSigWallet #2 is created.
3.Both wallets exist permanently, increasing gas costs and on-chain clutter.
Unexpected Result: Alice and Bob now have two separate wallets for the same match, making it hard to track funds!
Permanent blockchain clutter: Every match deploys a new contract forever.
High gas fees: Unnecessary deployments waste user funds.
Lost funds risk: Users may not track multiple wallets, losing access to their funds.
Manual Review
Use a Mapping to Store Existing Wallets.
Modify matchRewards()
to check if a wallet already exists before creating a new one.
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.