Flat Money - Audit Report

From 01/22/24 to 02/04/24 - (13 days) on Sherlock

Overview

The Flat Money protocol allows people to deposit Rocket Pool ETH (rETH) and mint UNIT, a decentralized delta-neutral flatcoin designed to outpace inflation. Flat Money also offers Leverage Traders the ability to deposit rETH and open rETH leveraged long positions through perpetual futures contracts.

Infos

DetailsFindingsnSLOCPayoutPlatformCategory
Flat Money1M2215$41.11SherlockPerps
RankingStartEndDurationReport
#31 of 25701/22/2402/04/2413 days📄

Findings

IdSeverityPaymentDupsReport
M-1Medium$41.1110📄

Achievement

With less than one month working as smart contract security researcher, I managed to find a medium severity issue, in my first audit contest. I was rewarded with $41,11 and placed 31/257 in Flat Money contest on Sherlock (see sherlock's tweet with my classification at 31st).

Medium findings

[M-1] Malicious actors can accumulate a huge amount of internal points (FMP) and inflate their value

Summary

Malicious actors can take advantage of the absence of a time restriction (or penalty) mechanism for withdrawing collateral to earn internal points (FMP) at a very low rate (only the 0.3% withdraw fee), inflating their value.

Vulnerability Detail

A bad actor can deposit collateral, earning FMP points and withdraw all the collateral deposited instantly, paying only the small withdraw fee (0.3% - keeper fees can be avoided if the order is executed by the user). Once there is no time restriction to earn points or a penalty mechanism to reduce points when withdrawing collateral, the bad actor can repeat this process (almost) indefinitely (until all its collateral is spent paying the withdraw fee), accumulating FMP points and inflating their value.

Impact

Malicious users can accumulate a huge amount of FMP, inflating their value.

Code Snippet

Tool used

Foundry

Recommendation

Implement a mechanism that restricts the FMP earnings by time and/or reduces the point quantity when a user withdraws collateral.