Skip to content
Business logic Audit finding Intermediate

wrong minting amount

The RebaseProxy contract's minting function used the proxy's total base balance instead of the amount being minted, causing an incorrect number of tokens to be minted. An attacker could potentially exploit this to mint an excessive amount of tokens.

danb Follow

Originally disclosed on Code4rena

Submitted by danb

https://github.com/code-423n4/2022-01-behodler/blob/main/contracts/TokenProxies/RebaseProxy.sol#L36

uint256 proxy = (baseBalance * ONE) / _redeemRate;

should be:

uint256 proxy = (amount * ONE) / _redeemRate;

gititGoro (Behodler) confirmed, but disagreed with High severity and commented:

Should be a balanceBefore and balanceAfter calculation with the diff being wrapped.

Jack the Pug (judge) commented:

Valid high. The issue description can be more comprehensive though.


The original report as published on Code4rena, by danb. 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

What the attacker needed

Access to the mint function

The fix

The calculation should use the amount parameter instead of baseBalance, and the sponsor suggested using balanceBefore and balanceAfter with the difference being wrapped.

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 bug where a calculation used the wrong number. The code multiplied the contract's total balance instead of the amount the user wanted to mint, so users could get far more tokens than they should.

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 danb

View all

12 more disclosed reports, best first.

More from Behodler 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.