Skip to content
Business logic Audit finding Intermediate

Users who deposit Lyra LP as collateral will lose OP vault rewards

When users deposit Lyra LP tokens as collateral, the tokens are transferred to a vault that does not implement a method to claim or distribute OP rewards. As a result, users lose all OP rewards they would have earned.

0x52 Follow

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2022-11-isomorph-judging/issues/78

Found by

0x52

Summary

Optimism currently offers yield farming opportunities for Lyra LPs, see OP Reward Announcement. Every 2 weeks Lyra LPs split a claimable pool. When they use their Lyra LP as collateral, it is transferred to the Lyra vault which means that all OP will be instead claimable by the vault. The vault currently doesn't implement any method to claim or distribute those tokens. The result is a loss of user yield on their Lyra tokens. Aside from the loss of funds, it also highly disincentivizes users from using Lyra tokens as collateral.

Vulnerability Detail

See summary.

Impact

Lyra LPs that use their tokens as collateral will lose all their OP rewards

Code Snippet

Vault_Lyra.sol

Tool used

Manual Review

Recommendation

It's unclear how long OP rewards will continue but it seems like other protocols have been getting 6 months of incentives. Since they are temporary I would recommend not integrating reward distribution directly into the contract. I would recommend adding a function to claim rewards to the Isomorph treasury. After the rewards end, the Isomorph should create an airdrop to distribute those tokens to users during that period of time.

Discussion

kree-dotcom

Fixed, https://github.com/kree-dotcom/isomorph/commit/f1b5bbcb10909041f2da6b0074518142790919c6 .

Added a function claimLyraRewards which allows the Vault to claim any token rewards it is eligible for. These are then sent to the admin and will be allocated to end users using a similar system that Lyra currently has of off-chain balance snapshots and a MultiDistributor.sol contract by which users claim their rewards.

0x00052

Fixes look good. Adds an admin only function that allow OP rewards to be claimed and later distributed

The original report as published on Sherlock, by 0x52. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The vault contract lacks a function to claim and distribute OP rewards earned by the deposited Lyra LP tokens.

Impact

Lyra LPs that use their tokens as collateral will lose all their OP rewards.

What the attacker needed

User deposits Lyra LP tokens as collateral

The fix

The vault was fixed by adding a function to claim Lyra rewards, which are sent to the admin for later distribution to users.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Lyra LP tokens represent a share in a liquidity pool and earn OP rewards. When you use them as collateral, they are moved to a vault. The vault has no way to claim those OP rewards, so the rewards are lost.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by 0x52

View all

211 more disclosed reports, best first.

More from Isomorph

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.