Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

Commit

Permalink
Merge e31e9e9 into 8c6a1cc
Browse files Browse the repository at this point in the history
  • Loading branch information
sarangparikh22 committed May 18, 2022
2 parents 8c6a1cc + e31e9e9 commit 3abab32
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions contracts/base/FuroStream.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ contract FuroStream is
error InvalidEndTime();
error InvalidWithdrawTooMuch();
error NotSender();
error Overflow();

constructor(IBentoBoxMinimal _bentoBox, address _wETH) {
bentoBox = _bentoBox;
Expand Down Expand Up @@ -247,12 +248,15 @@ contract FuroStream is

address recipient = ownerOf[streamId];

(, uint256 recipientBalance) = _streamBalanceOf(stream);
(uint256 senderBalance, uint256 recipientBalance) = _streamBalanceOf(
stream
);

stream.startTime = uint64(block.timestamp);
stream.withdrawnShares = 0;
stream.depositedShares -= uint128(recipientBalance);
stream.depositedShares += uint128(depositedShares);
uint256 newDepositedShares = senderBalance + depositedShares;
if (newDepositedShares > type(uint128).max) revert Overflow();
stream.depositedShares += uint128(newDepositedShares);
stream.endTime += extendTime;

_transferToken(
Expand Down

0 comments on commit 3abab32

Please sign in to comment.