Skip to content
Business logic Audit finding Intermediate

hard to clear balance

The contract does not allow users to transfer shares directly, making it difficult to clear all shares. Users interacting via MetaMask may see the price per share increase after transactions, which the reporter considers a medium-risk issue.

jonah1005 Follow

Originally disclosed on Code4rena

Submitted by jonah1005

The contract does not allow users to transfer by share. Therefore, It is hard for users to clear out all the shares. There will be users using this token with Metamask and it is likely the pricePerShare would increase after the user sends transactions. I consider this is a medium-risk issue.

Proof of Concept

WrappedIbbtc.sol#L110-L118

Recommended Mitigation Steps

A new transferShares beside the original transfer() would build a better UX. sushi’s bento box would be a good ref BentoBox.sol

dapp-whisperer (BadgerDAO) confirmed

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

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

Likely the contract lacks a function to transfer shares directly, only allowing token transfers which may not fully clear shares due to rounding or price changes.

Impact

Users may find it hard to clear all their shares, and the price per share could increase after transactions, potentially causing confusion or minor financial loss.

What the attacker needed

Users interact with the contract via MetaMask

The fix

A new `transferShares` function should be added alongside the existing `transfer()` to improve user experience.

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.

This is a smart contract that represents shares of a pool. Users can transfer tokens but not the underlying shares directly, so they might get stuck with small amounts they cannot easily clear. The reporter suggests adding a function to transfer shares for better usability.

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 jonah1005

View all

39 more disclosed reports, best first.

More from BadgerDAO ibBTC Wrapper contest

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.