> For the complete documentation index, see [llms.txt](https://reports.immunefi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://reports.immunefi.com/alchemix/31226-sc-insight-missing-revert-message-in-require-statement-lea....md).

# 31226 - \[SC - Insight] Missing Revert Message in require statement lea...

Submitted on May 15th 2024 at 08:49:18 UTC by @Wizard for [Boost | Alchemix](https://immunefi.com/bounty/alchemix-boost/)

Report ID: #31226

Report type: Smart Contract

Report severity: Insight

Target: <https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/Bribe.sol>

Impacts:

* missing revert message leading to difficulty in debugging

## Description

## Brief/Intro

require statement in the `deposit`, `withdraw`, and `restVoting` functions does not include a revert message.

## Vulnerability Details

The require statement in the `deposit`, `withdraw`, and `restVoting` functions does not include a revert message, this would make it harder to debug and understand why a transaction is reverting for both developers and protocol users.

## Impact Details

the lack of feedback on reverting functions would make it harder to trace back the errors and know where the execution is going wrong, this doesn't have a direct security impact on the contract, but it can make things easier to debug as those three functions are important functions in the protocol.

## References

<https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/Bribe.sol?utm\\_source=immunefi#L303>

<https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/Bribe.sol?utm\\_source=immunefi#L319>

<https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/Bribe.sol?utm\\_source=immunefi#L332>

## Proof of Concept

````
/// @inheritdoc IBribe
    function deposit(uint256 amount, uint256 tokenId) external {
        //@audit missing revert message
      --  require(msg.sender == voter);
      ++  require(msg.sender == voter, " not a voter");
        totalSupply += amount;
        balanceOf[tokenId] += amount;

        totalVoting += amount;

        _writeCheckpoint(tokenId, balanceOf[tokenId]);
        _writeSupplyCheckpoint();
        _writeVotingCheckpoint();

        emit Deposit(msg.sender, tokenId, amount);
    }

    /// @inheritdoc IBribe
    function withdraw(uint256 amount, uint256 tokenId) external {
         -- require(msg.sender == voter);
       ++  require(msg.sender == voter, " not a voter");

        totalSupply -= amount;
        balanceOf[tokenId] -= amount;

        _writeCheckpoint(tokenId, balanceOf[tokenId]);
        _writeSupplyCheckpoint();

        emit Withdraw(msg.sender, tokenId, amount);
    }

    /// @inheritdoc IBribe
    function resetVoting() external {
      require(msg.sender == voter);
  ++  require(msg.sender == voter, " not a voter");

        totalVoting = 0;
    }```
````


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://reports.immunefi.com/alchemix/31226-sc-insight-missing-revert-message-in-require-statement-lea....md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
