Skip to content
Business logic Audit finding Beginner

Possible locked-ether (funds) Issue in RCOrderbook.sol

The RCOrderbook contract has a payable function that can receive native currency but lacks a way to withdraw it, potentially locking funds. An attacker could send funds to the contract, and they would be stuck.

maplesyrup Follow

Originally disclosed on Code4rena

Submitted by maplesyrup (heiho1 and thisguy__)

When running the analyzer code, the following functions were found in RCOrderbook.sol to possibly lock funds due to it being a payable function with no withdraw function associated. See Issue #43 for more details.

Splidge (Reality Cards) confirmed initially and then disputed:

I initially confirmed this because we aren’t using the native currency on Matic/Polygon. However I think this should be disputed mainly because this function is used to call other functions which might be payable, although I admit currently we don’t have payable functions, we might add them in the future. This library is used across all our contracts, had we put a payable function in the Treasury for instance, would this be considered a flaw to have this same library imported into the Orderbook?

Splidge (Reality Cards) commented:

Note that the duplicate issue #51 was submitted by the same user.

dmvt (Judge) commented:

Agree with the sponsor’s explanation, but the issue exists regardless. Adding a way to retrieve locked funds would mitigate the issue.

The original report as published on Code4rena, by maplesyrup. 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 includes a payable function without a corresponding withdrawal mechanism, so any native currency sent to it cannot be recovered.

Impact

Funds sent to the contract could be permanently locked, but the sponsor notes that the native currency is not used on Matic/Polygon, so the practical impact may be limited.

What the attacker needed

None

The fix

The issue should be fixed by adding a way to retrieve locked funds.

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 can have functions that accept cryptocurrency payments. If there is no function to send that money out, any funds sent become stuck forever. This report points out such a function in a contract.

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 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.