Hedgehog

QuantstampFiles named in the report

Quantstamp reviewed Liqui (Hedgehog) on 26 Oct 2021: 13 findings, 0 critical; 11 marked fixed, 1 acknowledged, 1 open.

No open critical findings
Open the reportOpen Liqui’s security record

Report hosted on certificate.quantstamp.com.

Trustblock does not review code.

Findings13

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High001
Medium104
Low016
HighAddress of the Parimutuel Program not VerifiedFixed

In the `lib.rs` file (L2677), located in `hh-paramitiuel` module, the address of the parimutuel is not verified; thus an attacker can execute remote code .

MediumOverflow In The Find_User_Reward FunctionFixed

The `find_user_reward` function in `hh-parimutuel/src/lib.rs` calculates the reward user, but in line 1722 it compares two variables: `FINAL_LEADERBOARD_LENGTH` and `counter + n`. The problem is that the addition is done with the `+` operator, which can cause an overflow. If one uses the debug build it can cause a panic; however in release build it will overflow silently. Same issue on L1741.

MediumOverflow in the Output Reward Sources VariableFixed

In the `init_reward_info` function (see file `hh-vault/src/lib.rs` file, L1038), the `vault.reward_sources` is incremented by one using the `+` operator, which can cause an overflow. If one uses the debug build, it can cause a panic; however, in release build it will overflow silently.

MediumOverflow in the Sponsor_Token_Amount and Amount VariableFixed

In the `handle_deposit` function (file `/hh-vault/src/lib.rs`, L2994 and 2995), the `state.sponsor_tokens_owned` and `state.amount` variables are incremented using the `+` operator, which can cause an overflow. If one uses the debug build, it can cause a panic; however, in release build it will overflow silently.

MediumOverflow/Underflow In The Total Amount Deposited and SponsoredFixed

In the `deposit_to_vault/withdraw_from_vault` function, the `vault.total_amount_deposited` and `vault.total_amount_sponsored` variables are incremented/decremented using the `+/-` operators, which can cause an overflow and underflow, respectively. If one uses the debug build, it can cause a panic; however, in release build it will overflow silently. This appears in `/hh-vault/src/lib.rs`, lines 1856, 1858, 2326, and 2328.

LowComments Left In the CodeFixed

The `lib.rs` file, located in the `hh-vault` module, contains code that is completely commented out--see L883 and 1441. This is currently dead code.

LowDeprecated Functions Left In the CodeFixed

We found some functions marked as deprecated; if these functions are not used anymore, the team should consider removing them. This appears in `hh-vault/src/lib.rs`, on lines 843, 919, 1315, 2538, 2562, and 2777.

LowLack of Verifcation on the Amount VariableFixed

In the `enter_prediction ` function in `lib.rs` file (L256), located in the `hh-paramitiuel` module, one enters a prediction for a specified market, as well as an amount. The amount variable, however, is not verified and it can be given the zero value.

LowLack of Verification in the Amount and Pool IDFixed

The `add_user_and_deposit_full`function in `hh-vault/src/apricot.rs` takes two parameters, `amount` and `pool_id`. These parameters are not verified; also, one can inject an ID of a non-existent pool . See lines 60, 61, 102, and 103.

LowLack of Verification in the LockUp ExpiryFixed

The `lib.rs` file (L39), located in the `hh-vault` module, contains the `init_vault` public function. With the help of this function one can initialize a vault with some parameters. Amongst these parameters is the `_lockup_expiry`, which is a timestamp . The problem here is that there is no verification of this variable; in fact one can initialize a vault with a `_lockup_expiry` lower than the current time. In the latter case, one can harm the logic of the program.

Show 1 more
LowLack of Verification in the Market ExpiryFixed

The `lib.rs` file (L199), located in `hh-paramitiuel ` module, contains the `init_market` public function. With the help of this function, one can initialize a market with some parameters. Amongst these parameters, we have the `_expiry_unix`, which is a timestamp that refers to the state of the market . The problem here is that there is no verification of the value of this variable; in fact, one can initialize the market with a `expiry_unix` that is lower than the current time. In the latter case, one will harm the logic of the program.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (4)

  • programs/hh-vault/src/lib.rs
  • programs/hh-parimutuel/src/lib.rs
  • programs/hh-vault/src/apricot.rs
  • programs/hh-vault/src/port_finance.rs

Part of Liqui’s security record

Liqui
Audits1 audit by 1 firmLast audit Oct 2021, by Quantstamp.
Critical findingsNo open critical findingsIn 1 report.
Open Liqui’s security record

Security firm

Quantstamp

236 projects reviewed · 332 reports · latest Oct 2026

See Quantstamp’s audits

Something wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.

Tell us