Skip to content

Sherlock

Real Wagmi #2

Every publicly disclosed report for Real Wagmi #2 and what kind of bugs they were.

disclosed reports
21
most reported class
Business logic
bug classes found
4
first disclosure
2023
Find Real Wagmi #2 on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Real Wagmi #2 chose to make public.

DoS

Blacklisted creditor can block all repayment besides emergency closure

The fee transfer to the creditor during loan repayment reverts if the creditor is blacklisted for the hold token, preventing all repayments and forcing the borrower to default. Lenders can only recover funds after default and emergency closure.

Real Wagmi #2

Medium
DoS

DoS of lenders and gas griefing by packing tokenIdToBorrowingKeys arrays

The contract stores borrowing keys in an array per LP token, and every repay, liquidation, or takeover iterates over this array. An attacker can create many tiny borrows to make the array very long, so later legitimate transactions run out of gas and funds are locked.

Real Wagmi #2

Medium
DoS

`computePoolAddress()` will not work on ZkSync Era

The contract computes Uniswap v3 pool addresses using a method that does not match ZkSync Era's address derivation, so the callback check fails and swaps revert. This could prevent borrowers and liquidators from closing positions if the custom router is removed, leading to a short-term denial of service and extra fees.

Real Wagmi #2

Medium
Business logic

Wrong `accLoanRatePerSeconds` in `repay()` can lead to underflow

The repay() function in emergency mode computes a percentage using the remaining borrowed amount instead of the initial amount, which can make the percentage larger than accLoanRatePerSeconds and cause an underflow. This reverts the call, preventing the lender from recovering their tokens via emergency repayment.

Real Wagmi #2

Medium
Race condition

Adversary can reenter takeOverDebt() during liquidation to steal vault funds

The takeOverDebt() function lacked a reentrancy guard, allowing an attacker to reenter it during a liquidation repayment via a malicious token. This let the attacker duplicate a liquidatable position, causing the vault to repay liquidity providers twice and draining funds.

Real Wagmi #2

High
DoS

fee calculations

The fee calculation in the contract uses checked arithmetic, but the original Uniswap V3 code relies on unchecked underflow/overflow to correctly compute fees. This could cause some user transactions to revert.

Real Wagmi #2

Medium
Smart contracts

Possible precision loss in `_checkpositionsRange` function

The `_checkpositionsRange` function divides a signed integer range by two before a modulo check, so the fractional part is truncated and the comparison can be wrong. This could let an invalid positions range pass validation.

Real Wagmi #2

Medium
Business logic

No slippage protection when withdrawing and providing liquidity in rebalanceAll

The rebalanceAll function withdraws and deposits liquidity without slippage protection, exposing LPs to losses from price movements during the transaction. An attacker could exploit this by manipulating prices to cause the protocol to receive less liquidity than expected.

Real Wagmi #2

High
Business logic

Wrong calculation of `tickCumulatives` due to hardcoded pool fees

The contract hardcoded a 500 fee tier when reading tick cumulatives from a Uniswap V3 pool, so for tokens whose liquidity sits in other fee tiers the time-weighted price data was wrong. That produced an incorrect slippage check, raising the risk that a rebalance transaction would execute at a bad price.

Real Wagmi #2

High
Business logic

The `_estimateWithdrawalLp` function might return a very large value, result in users losing significant incentives or being unable to withdraw from the Dispatcher contract

The `_estimateWithdrawalLp` function calculates LP shares using an average of token ratios, which can return an inflated value when the underlying Uniswap V3 pool reserves fluctuate. This can cause underflow reverts, preventing users from depositing or withdrawing, or lead to excessive LP withdrawals.

Real Wagmi #2

High
Race condition

Deposit transactions lose funds to front-running when multiple fee tiers are available

The deposit function in a multipool contract lacks a minimum LP token output parameter, only checking minimum token amounts. An attacker could front-run a deposit by manipulating prices across multiple fee tiers to inflate reserves, causing the victim to receive fewer LP tokens and lose funds.

Real Wagmi #2

High