Skip to content
Smart contracts Audit finding Beginner

Missing payable

A function in a smart contract uses msg.value but is not marked payable, so users cannot send native ether to it. This prevents users from adding reserves using native ether.

robee Follow

Originally disclosed on Code4rena

Submitted by robee

The following functions are not payable but uses msg.value - therefore the function must be payable. This can lead to undesired behavior.

    LPool.sol, addReserves should be payable since using msg.value

ColaM12 (OpenLeverage) confirmed and resolved

0xleastwood (judge) commented:

Nice find! The warden has identified a function which is missing the payable keyword. Preventing any users from adding reserves using native ether.


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

The function addReserves uses msg.value but lacks the payable modifier.

Impact

Users are prevented from adding reserves using native ether.

What the attacker needed

None

The fix

The function should be marked payable.

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.

In Ethereum smart contracts, a function must be marked 'payable' to accept ether. This function tried to use the ether sent (msg.value) but wasn't payable, so any attempt to send ether would fail. As a result, users couldn't add reserves using native ether.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

More by robee

View all

6 more disclosed reports, best first.

More from OpenLeverage contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.