Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Parameter in Redeemed Event Emission #71

Open
hats-bug-reporter bot opened this issue Jun 29, 2024 · 1 comment
Open

Incorrect Parameter in Redeemed Event Emission #71

hats-bug-reporter bot opened this issue Jun 29, 2024 · 1 comment
Labels
bug Something isn't working Minor

Comments

@hats-bug-reporter
Copy link

Github username: --
Twitter username: --
Submission hash (on-chain): 0xfe48c86ee5fde1eaae0770dab56021baee6c579c2aa94c61a309134d82982c86
Severity: low

Description:
Description
In the _redeem function of the EthMultiVault contract, there's a minor discrepancy between the declared event signature and the actual event emission. The Redeemed event is designed to include the vault's total balance, but the implementation incorrectly emits the owner's balance instead. This inconsistency could lead to confusion for off-chain systems monitoring these events and potentially cause issues with data integrity in external applications relying on this information.

Attack Scenario
While this is not directly exploitable, it could lead to the following issues:

  1. Off-chain systems or dApps relying on the Redeemed event for tracking the vault's total balance will receive incorrect data.
  2. This could result in misrepresentation of the vault's state in user interfaces or analytics platforms.
  3. In a worst-case scenario, it might lead to incorrect decision-making by users or automated systems if they assume the emitted value represents the total vault balance.

Attachments

  1. Proof of Concept (PoC) File

    emit Redeemed(msg.sender, owner, vaults[id].balanceOf[owner], assetsForReceiver, shares, exitFee, id);

  2. Revised Code File (Optional)

function _redeem(uint256 id, address owner, uint256 shares) internal returns (uint256, uint256) {
    // ... (previous code remains the same)

    _burn(owner, id, shares);

    // Corrected: Use totalShares instead of owner's balance
    emit Redeemed(msg.sender, owner, vaults[id].totalShares, assetsForReceiver, shares, exitFee, id);

    return (assetsForReceiver, protocolFee);
}
@hats-bug-reporter hats-bug-reporter bot added the bug Something isn't working label Jun 29, 2024
@mihailo-maksa mihailo-maksa added invalid This doesn't seem right Minor and removed invalid This doesn't seem right labels Jul 1, 2024
@mihailo-maksa
Copy link
Collaborator

The report indicates a discrepancy in the _redeem function where the Redeemed event emits the owner's balance instead of the total vault balance.

Label: minor

Comment:
This issue has been identified internally since the start of the competition and has been fixed. However, since it’s a valuable enhancement suggestion, we can still consider a lower payout as a minor issue.

Comment on the issue:
This issue has been identified internally and fixed. Nonetheless, it's a valuable enhancement suggestion, and we will consider a lower payout as a minor issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Minor
Projects
None yet
Development

No branches or pull requests

1 participant