Native fee cannot be paid because the withdraw function is not payable
Summary
The _nativeFee is paid in Ether and it is expected the Ether to be passed to the withdraw function, however the function is not payable, which prevents it from receiving Ether (msg.value). This limitation impacts the function's ability to transfer funds to pay required messaging fees and will make the transaction revert.
Root Cause
The _lzSend function, invoked within withdraw, requires Ether to pay the native messaging fee. This fee is determined within _payNative, which verifies that either msg.value or the contract’s balance is sufficient to cover _nativeFee. Since withdraw lacks the payable modifier, the caller cannot set msg.value.
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
No response
Impact
When the contract's balance is insufficient, _nativeFee cannot be paid because the withdraw function is not payable.
Orbiting Tweed Shell
Medium
Native fee cannot be paid because the
withdraw
function is not payableSummary
The
_nativeFee
is paid in Ether and it is expected the Ether to be passed to thewithdraw
function, however the function is not payable, which prevents it from receiving Ether (msg.value). This limitation impacts the function's ability to transfer funds to pay required messaging fees and will make the transaction revert.Root Cause
The _lzSend function, invoked within
withdraw
, requires Ether to pay the native messaging fee. This fee is determined within _payNative, which verifies that either msg.value or the contract’s balance is sufficient to cover_nativeFee
. Since withdraw lacks the payable modifier, the caller cannot set msg.value.Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
No response
Impact
When the contract's balance is insufficient,
_nativeFee
cannot be paid because thewithdraw
function is not payable.PoC
No response
Mitigation
Make the
withdraw
function payable