The Sablier protocol allows streaming payments using rebasing tokens (such as Ampleforth (AMPL)). If the rebase token increases during the period the yield generated with these tokens inside the Sablier contracts will be lost. This is a known and accepted behaviour by the Sablier team.
But if the rebase token decreases during the stream period the protocol distributes unequal amounts of tokens to recipients (early withdrawals benefit at the expense of later ones).
The Sablier protocol allows streaming payments using rebasing tokens. Rebasing tokens periodically adjust their circulating supply to achieve price stability, with positive rebases increasing the supply and negative rebases decreasing it.
During periods of negative rebase, the overall supply of the token decreases, reducing the amount of tokens held by the smart contract. The contract's logic does not account for these supply changes, so early withdrawals can deplete a disproportionate amount of the contract's holdings, leaving subsequent withdrawals with less than anticipated.
The Sablier protocol deploy the single Lockup contract (for example a LockupLinear) so everyone that wants to create a LockupLinear stream would call this single contract that have been deployed by Sablier and the contract will create a stream for them (basically a struct data structure) with the details of stream. This contract deployed by Sablier (in our example the LockupLinear contract) will be the one to manage every Linear stream and keeps all of the token that are being streamed.
Now let's say:
Alice creates a 10 AMPL stream for Bob with a duration of 1 month.
Alice creates another 10 AMPL stream for Steve with a duration of 1 month.
The LockupLinear smart contract has a balance of 20 AMPL.
During the month the AMPL decreases. The balance of the smart contract reduce consequently to (let's say) 18 AMPL.
The LockupLinear smart contract streams 10AMPL to Alice and 10AMPL to Bob.
If Bob withdraws their stream for first he receives 10AMPL (The first person to withdraw gets to withdraw fully). When Steve will go to withdraw his stream he will receive only 8AMPL.
So instead of being able to withdraw 9 AMPL each, Bob receives 10 and Steve receive only 8. The stream distribution is unfair.
Manual review
Implement logic within the smart contract to dynamically adjust withdrawal amounts based on the current token supply, ensuring fair distribution regardless of rebase events.
https://www.codehawks.com/contests/clvb9njmy00012dqjyaavpl44
https://www.codehawks.com/contests/clvb9njmy00012dqjyaavpl44
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.