Skip to content

Commit

Permalink
fix: mul before div to avoid precision loss
Browse files Browse the repository at this point in the history
  • Loading branch information
fmorisan committed Mar 30, 2023
1 parent de0fb67 commit abfe401
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/DAIInterestRateModelV4.sol
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ contract DAIInterestRateModelV4 is JumpRateModelV2 {
*/
function dsrPerBlock() public view returns (uint) {
return (pot.dsr() - RAY_BASE) // scaled RAY_BASE aka RAY, and includes an extra "ONE" before subtraction
/ RAY_TO_BASE_SCALE // descale to BASE
* SECONDS_PER_BLOCK; // seconds per block
/ RAY_TO_BASE_SCALE // descale to BASE
}

/**
Expand Down

0 comments on commit abfe401

Please sign in to comment.