> 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/immunefi-arbitration/29484-sc-insight-potential-loss-of-precision-in-conversion-from-....md).

# 29484 - \[SC - Insight] Potential Loss of Precision in Conversion from ...

Submitted on Mar 20th 2024 at 23:27:54 UTC by @Flare for [Boost | Immunefi Arbitration](https://immunefi.com/bounty/immunefiarbitration-boost/)

Report ID: #29484

Report type: Smart Contract

Report severity: Insight

Target: <https://github.com/immunefi-team/vaults/blob/main/src/WithdrawalSystem.sol>

Impacts:

* Precision

## Description

## Brief/Intro

The `setUp` function in the `WithdrawalSystem` contract involves converting a `uint256` value to a `uint32` for setting the cooldown period for withdrawals. This conversion may lead to a loss of precision and unexpected behavior if the original value exceeds the range representable by a `uint32`

## Vulnerability Details

<https://github.com/immunefi-team/vaults/blob/main/src/WithdrawalSystem.sol?utm\\_source=immunefi#L28C5-L44C6>

The `setUp` function in the `withdrawlSystem` contract accepts parameters, including `_txCooldown`, which represents the cooldown period for withdrawals. Within the function, the `_txCooldown` value is cast from uint256 to uint32 before being passed to the `_setTxCooldown` function. This type conversion can potentially lead to issues due to loss of precision if the original value is larger than what can be represented by a uint32

## Impact Details

the impact of the potential loss of precision in the conversion from `uint256` to `uint32`

## References

change input var \_txCooldown as uint32 in `setUp` function

## Proof of Concept


---

# 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/immunefi-arbitration/29484-sc-insight-potential-loss-of-precision-in-conversion-from-....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.
