Lucene search

K
code423n4Code4renaCODE423N4:2022-04-PHUTURE-FINDINGS-ISSUES-33
HistoryApr 21, 2022 - 12:00 a.m.

Index Minting and Redemption Can Be Frontrun

2022-04-2100:00:00
Code4rena
github.com
4

Lines of code
<https://github.com/code-423n4/2022-04-phuture/blob/594459d0865fb6603ba388b53f3f01648f5bb6fb/contracts/IndexLogic.sol#L96&gt;
<https://github.com/code-423n4/2022-04-phuture/blob/594459d0865fb6603ba388b53f3f01648f5bb6fb/contracts/BaseIndex.sol#L43&gt;
<https://github.com/code-423n4/2022-04-phuture/blob/594459d0865fb6603ba388b53f3f01648f5bb6fb/contracts/BaseIndex.sol#L59&gt;

Vulnerability details

Impact

According to the provided source code, the user must transfer the underlying asset to the contract prior to calling mint() or the index token before to calling burn(). If these two actions are performed on the difference block, it introduces the risk that someone could frontrun the transaction by calling mint() or burn() immediately after a user transfers tokens to the contract, so claiming over the user’s funds.

Proof of Concept

Due to the fact that the source code provided is incomplete, it is unclear when and how the token is transferred to the contract. However, I chose to submit this issue in case the team is still unaware of it.

Tools Used

None

Recommended Mitigation Steps

It is recommended that two actions must be executed in one transaction to eliminate the frontrun risk.


The text was updated successfully, but these errors were encountered:

All reactions