Interesting Mulberry Eagle
Medium
The sendETHToTreasury()
function in the StreamEscrow
contract uses call{value: amount}()
this, which transfers ETH, but it does not provide a sufficient gas stipend. This leads to failed ETH transfers when the recipient contract needs more than the default 2300 gas. This makes the whole transaction revert, and hence, the functions forwardAll()
, fastForwardStream()
, and createStream()
are unusable under certain conditions.
No response
No response
No response
-
Alice makes a call to the
forwardAll()
function, forwarding all pending ETH streams to Bob. -
In the function it is first checked if
minimumTickDuration
has passed since the last forward. If it hasn't, then it silently returns without doing anything. -
If the time elapsed is adequate, Alice updates the
lastForwardTimestamp
and goes ahead to call the functionsendETHToTreasury()
, transferringethStreamedPerTick
(1 ETH in our example) to Bob. -
Bob's contract contains logic such as emitting events or updating storage, that uses a lot more than the base 2300 gas stipend. That will cause the transfer to fail.
-
The failure causes the entirety of Alice's
forwardAll()
transaction to revert, thus preventing Bob from getting the ETH and disrupting the funds flow as intended.
These functions become unusable when handling large amounts of ETH or complex recipient logic. It will often result in failed transactions and operations, causing blocked critical transfers to the treasury.
No response
Update the call
invocation to include a sufficient gas stipend or a dynamic gas allocation:
(bool sent, ) = ethRecipient.call{ value: amount, gas: customGasLimit }('');