Skip to content
Business logic Audit finding Intermediate

Wrong calculation on _collectRentAction

The smart contract function `_collectRentAction` incorrectly calculates a refund time using the current block timestamp instead of the user's foreclosure time. This miscalculation could allow an attacker to drain funds.

[a Follow

Originally disclosed on Code4rena

*Submitted by a*dlamo_

The method _collectRentAction contains the following code:

in case 6, it is doing:

_refundTime = block.timestamp - marketLockingTime;

instead of:

_refundTime = _timeUserForeclosed - marketLockingTime;

This could lead to funds being drained by the miscalculation.

mcplums (Reality Cards) commented:

This is a really great find!!

Splidge (Reality Cards) confirmed and resolved:

Fix implemented here

The original report as published on Code4rena, by [a. 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 code used `block.timestamp` instead of the stored `_timeUserForeclosed` variable when computing `_refundTime`.

What the attacker needed

None

The fix

The issue was fixed by the project team.

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.

A smart contract had a bug in how it calculated a refund time. It used the current time instead of the time when a user was foreclosed, which could let someone take more money 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 [a

View all

1 more disclosed report, best first.

More from Reality Cards (round 2)

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.