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.
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
payablekeyword. Preventing any users from adding reserves using native ether.
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.