Steadefi

Steadefi
DeFiHardhatFoundryOracle
35,000 USDC
View results
Submission Details
Severity: low
Valid

Asset like UNI can revert on Large Approvals & Transfers

Summary

As per the protocol documentation, assets like UNI are to be used. However, these types of asset are programmed to revert transactions that involve large approvals and transfers.

Vulnerability Details

According to the documentation https://github.com/d-xo/weird-erc20. UNI reverts if the value passed to approve or transfer is larger than uint96. When constructing the Vault, many large approves are made :

_store.tokenA.approve(address(_store.router), type(uint256).max);
_store.tokenB.approve(address(_store.router), type(uint256).max);
_store.lpToken.approve(address(_store.router), type(uint256).max);
_store.tokenA.approve(address(_store.depositVault), type(uint256).max);
_store.tokenB.approve(address(_store.depositVault), type(uint256).max);
_store.lpToken.approve(address(_store.withdrawalVault), type(uint256).max);
_store.tokenA.approve(address(_store.tokenALendingVault), type(uint256).max);
_store.tokenB.approve(address(_store.tokenBLendingVault), type(uint256).max);

There can also be large transfer amount at one point, for example if an emergencyPause, emergencyClose or emergencyResume happen.

Impact

At the very least disrupting the contract creation or worse blocking the vault when large transfers happen.

Tools Used

Manual review

Recommendations

  • limit max transfer/approve amounts to type(uint96).max

Updates

Lead Judging Commences

hans Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

UNI token transfer limit 2^96

The likelihood is very low.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.