Skip to content

Commit

Permalink
update(Ticket): cast amounts to uint208 when calling TwabLib
Browse files Browse the repository at this point in the history
  • Loading branch information
kamescg authored and asselstine committed Oct 6, 2021
1 parent 8d6b99a commit f239352
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/libraries/TwabLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ library TwabLib {
*/
function decreaseBalance(
Account storage _account,
uint256 _amount,
uint208 _amount,
string memory _revertMessage,
uint32 _currentTime
)
Expand All @@ -113,7 +113,7 @@ library TwabLib {
require(_accountDetails.balance >= _amount, _revertMessage);

(accountDetails, twab, isNew) = _nextTwab(_account.twabs, _accountDetails, _currentTime);
accountDetails.balance = (_accountDetails.balance - _amount).toUint208();
accountDetails.balance = _accountDetails.balance - _amount;
}

/** @notice Calculates the average balance held by a user for a given time frame.
Expand Down

0 comments on commit f239352

Please sign in to comment.