Submitted by farman1094
https://github.com/code-423n4/2024-12-flex-perpetuals/blob/b84a0812c3368866964b8a16e7c36f6e7a50b655/src/staking/FTCHook.sol#L61
Malicious actor can collect the most reward which supposed to be share between genuine traders.
There is feature of flex protocol of Flex Trade Credit the user will earn FTC as they trade on the Flex Perpetual. As the position increases the token minted by FTCHook, its staked in the TLC Staking for that specific epoch under the user name which increased the position. For that staking, the reward will be issued to the trader in form of USDbC. Instead of opening the position for trading, the user opens the position just for the token and closes it instantly in the same block. As for increasing the position, he would be awarded by FTC but as he closed, instantly no effect on FTC. Because we are doing nothing while decreasing the position.
https://github.com/code-423n4/2024-12-flex-perpetuals/blob/b84a0812c3368866964b8a16e7c36f6e7a50b655/src/staking/FTCHook.sol#L61C1-L69C6
So what happen is, the reward supposed to be shared between all the Genuine traders. Some malicious actor can target it after checking the specific epoch which benefit him most and mint the stake reward as much as possible for small fees. 
Practical example: 
This is mere an example, trader can do this in small and big scale as well.
The total fee trader paid for this 250,000 FTC is $201; this way trader can earn the gurranteed profit in small fees. When the rewards came, this traders get the most reward of because of his big number of share. This reward is supposed to be share between all the traders whos risking their collateral. 
Most of the part of this test is taken by another tests. Current in the setUp weight is set to 1x instead of 2.5x. The tlc (FTC) is supposed to be 250,000.
We need to make the changes in the src/staking/FTCHook.
We need to set some timeFrame if user choose to close the position instantly or within that time frame. The TLC token should be taken back. Like were doing in TradingStakingHook::onDecreasePosition.
flexdev (Flex Perpetuals) commented:
0xsomeone (judge) commented:
ZanyBonzy (warden) commented:
Aamir (warden) commented:
ABAIKUNANBAEV (warden) commented:
0xsomeone (judge) commented:
fpcrypto-y (Flex Perpetuals) disputed and commented:
0xsomeone (judge) commented:
fpcrypto-y (Flex Perpetuals) commented:
0xsomeone (judge) commented:
fpcrypto-y (Flex Perpetuals) commented:
0xsomeone (judge) commented:
For this audit, 1 report was submitted by wardens detailing low risk and non-critical issues. The report highlighted below by Sparrow received the top score from the judge.
