DatingDapp

AI First Flight #6
Beginner FriendlyFoundrySolidityNFT
EXP
View results
Submission Details
Impact: high
Likelihood: high
Invalid

Users cannot easily know their multi-sig wallet address, so they cannot use their multi-sig wallet funds together as intended

Users cannot easily know their multi-sig wallet address, so they cannot use their multi-sig wallet funds together as intended

Description

  • Users has no way to easily know their multi-sig wallet address, the LikeRegistry contract do not provide a way for users to check their multi-sig wallet address if they are matched!

function matchRewards(address from, address to) internal {
uint256 matchUserOne = userBalances[from];
uint256 matchUserTwo = userBalances[to];
userBalances[from] = 0;
userBalances[to] = 0;
uint256 totalRewards = matchUserOne + matchUserTwo;
uint256 matchingFees = (totalRewards * FIXEDFEE) / 100;
uint256 rewards = totalRewards - matchingFees;
totalFees += matchingFees;
// Deploy a MultiSig contract for the matched users
@> MultiSigWallet multiSigWallet = new MultiSigWallet(from, to);
// Send ETH to the deployed multisig wallet
(bool success,) = payable(address(multiSigWallet)).call{value: rewards}("");
require(success, "Transfer failed");
}

Risk

Likelihood: High

  • This is one hundred percentage to happen!

Impact: High

  • Users cannot easily know their multi-sig wallet address, so they cannot use their multi-sig wallet funds together as intended!!!

Proof of Concept

  1. User Alice and Bob mint their profiles

  2. Alice and Bob both pay 1 eth to like each other

  3. Alice and Bob are matched, so their eth(90% of them) are transfer to their multi-sig wallet

  4. Alice and Bob can not get to know their multi-sig address

function testUserMatch() public {
hoax(user2);
soulboundNFT.mintProfile("Bob", 28, "ipfs://profileImage/Bob");
startHoax(user);
soulboundNFT.mintProfile("Alice", 25, "ipfs://profileImage/Alice");
likeRegistry.likeUser{value: 1 ether}(user2);
vm.stopPrank();
vm.prank(user2);
likeRegistry.likeUser{value: 1 ether}(user);
...
// no way to know their multi-sig wallet address
}

Recommended Mitigation

Add a mapping(address user => mapping(address matcher => address multiSigWallet)) to track users' multi-sig wallet address if they get matched. And, provide a external view function to allow user to easily retrieve their multi-sig wallet address.

+ mapping(address user => mapping(address matcher => address multiSigWallet)) public userMultiSigWallets;
...
MultiSigWallet multiSigWallet = new MultiSigWallet(from, to);
+ userMultiSigWallets[from][to] = address(multiSigWallet);
+ userMultiSigWallets[to][from] = address(multiSigWallet);
// Send ETH to the deployed multisig wallet
(bool success,) = payable(address(multiSigWallet)).call{value: rewards}("");
require(success, "Transfer failed");
...
+ function getUserMultiSigWallet(address owner1, address owner2) external view returns (address) {
+ return userMultiSigWallets[owner1][owner2];
+ }
Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 10 hours ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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

Give us feedback!