Skip to content
Business logic Audit finding Beginner

Discrepancy between document and codebase

danial Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

#49413 [SC-Insight] discrepancy between document and codebase

Submitted on Jul 15th 2025 at 16:27:45 UTC by @danial for Audit Comp | Folks Smart Contract Library

Description

Brief/Intro

discrepancy in code base and document

Vulnerability Details

the document says this about _fill_amount in RateLimiter.py

_fill_amount(byte[32] bucket_id, uint64 amount) returns void. Fills an amount inside a bucket. Will not exceed the bucket’s limit. It emits the BucketFilled event.

says this functioni will get uint64 as amount input however in the codebase it takes uint256:

Python
 def _fill_amount(self, bucket_id: Bytes32, amount: UInt256) -> None:

also about get_rate_duration document says it should return uint256

get_rate_duration(byte[32] bucket_id) returns uint256. Returns the rate duration of the given bucket.

but codebase returns uint64:

Python
get_rate_duration(byte[32] bucket_id) returns uint256. Returns the rate duration of the given bucket.

Impact Details

although this doesnt make direct risk but its a discrepancy that should be fixed hence reported Low severity that might cause issue

References

(https://github.com/Folks-Finance/algorand-smart-contract-library/blob/7673a43fa5183af736b65f17d1a297fdea672059/contracts/library/RateLimiter.py#L96-L97)

(https://github.com/Folks-Finance/algorand-smart-contract-library/blob/7673a43fa5183af736b65f17d1a297fdea672059/contracts/library/RateLimiter.py#L222-L223)

Proof of Concept

Proof of Concept

discrepancy in code base and document

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

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

What is known

A business logic bug in https://github.com/Folks-Finance/algorand-smart-contract-library/blob/main/contracts/library/RateLimiter.py. Immunefi made it public on 15 July 2025.

About Business logic

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

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

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 danial

View all

2 more disclosed reports, best first.

More from Folks Smart Contract Library

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.