DatingDapp

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

Missing Event Emission in matchRewards Function

Root + Impact

Description

  • The `matchRewards()` function performs critical operations (deploying a multisig wallet and transferring funds) but does not emit any events. This makes it difficult to track multisig deployments and fund transfers off-chain, reducing transparency and making it harder to monitor protocol activity.

    ```solidity

    function matchRewards(address from, address to) internal {

    // ... calculations ...

    // @> No event emitted for multisig deployment

    MultiSigWallet multiSigWallet = new MultiSigWallet(from, to);

    // @> No event emitted for fund transfer

    (bool success,) = payable(address(multiSigWallet)).call{value: rewards}("");

    require(success, "Transfer failed");

    }

    ```

    ### Root Cause

    The function is internal and doesn't emit events for the multisig deployment or the fund transfer, relying only on the `Matched` event from the calling function.


Risk

Likelihood:

  • * This occurs on every match - events are always missing

    * Off-chain systems cannot track multisig deployments

    * No way to monitor fund transfers to multisig wallets

Impact:

  • * Reduced transparency and observability

    * Difficult to track multisig wallet addresses off-chain

    * Harder to audit and monitor protocol activity

    * Frontend applications cannot easily display multisig information

Proof of Concept

```solidity
// Match occurs, Matched event is emitted
// But no event for:
// - Multisig wallet address
// - Amount transferred to multisig
// - Fee amount deducted
// Off-chain systems must calculate or query contract state
```

Recommended Mitigation

```diff
+ event MatchRewardsDistributed(
+ address indexed user1,
+ address indexed user2,
+ address indexed multisigWallet,
+ uint256 totalRewards,
+ uint256 fees,
+ uint256 rewardsTransferred
+ );
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;
MultiSigWallet multiSigWallet = new MultiSigWallet(from, to);
(bool success,) = payable(address(multiSigWallet)).call{value: rewards}("");
require(success, "Transfer failed");
+
+ emit MatchRewardsDistributed(
+ from,
+ to,
+ address(multiSigWallet),
+ totalRewards,
+ matchingFees,
+ rewards
+ );
}
```
Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge 16 days 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!