Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

Commit c8cc8be

Browse files
authored
Merge pull request #111 from morpho-org/refactor/constant-comments
Refactor constant comments
2 parents 7141ef6 + 61edcbd commit c8cc8be

5 files changed

Lines changed: 7 additions & 5 deletions

File tree

certora/specs/wadRayMath.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ rule wadToRaySafety(uint256 a) {
215215
rule wadToRayLiveness(uint256 a) {
216216
wadToRay@withrevert(a);
217217

218-
assert lastReverted <=> a * WADTORAY() > UINT_LIMIT();
218+
assert lastReverted <=> a * WADTORAY() >= UINT_LIMIT();
219219
}
220220

221221
/// wadWeightedAvg ///

src/math/CompoundMath.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ pragma solidity ^0.8.0;
77
/// @dev Library to perform Compound's multiplication and division in an efficient way.
88
library CompoundMath {
99
/* CONSTANTS */
10-
1110
// Only direct number constants and references to such constants are supported by inline assembly.
11+
1212
uint256 internal constant WAD = 1e18;
1313
uint256 internal constant MAX_UINT256 = 2 ** 256 - 1;
1414

src/math/Math.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ pragma solidity ^0.8.0;
77
/// @dev Library to perform simple math manipulations.
88
library Math {
99
/* CONSTANTS */
10-
1110
// Only direct number constants and references to such constants are supported by inline assembly.
11+
1212
int256 internal constant MIN_INT256 = -2 ** 255;
1313

14+
/* INTERNAL */
15+
1416
function abs(int256 x) internal pure returns (int256 y) {
1517
assembly {
1618
let mask := sar(255, x)

src/math/PercentageMath.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ pragma solidity ^0.8.0;
77
/// @notice Optimized version of Aave V3 math library PercentageMath to conduct percentage manipulations: https://github.com/aave/aave-v3-core/blob/master/contracts/protocol/libraries/math/PercentageMath.sol
88
library PercentageMath {
99
/* CONSTANTS */
10-
1110
// Only direct number constants and references to such constants are supported by inline assembly.
11+
1212
uint256 internal constant PERCENTAGE_FACTOR = 100_00;
1313
uint256 internal constant HALF_PERCENTAGE_FACTOR = 50_00;
1414
uint256 internal constant PERCENTAGE_FACTOR_MINUS_ONE = 100_00 - 1;

src/math/WadRayMath.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ pragma solidity ^0.8.0;
77
/// @notice Optimized version of Aave V3 math library WadRayMath to conduct wad and ray manipulations: https://github.com/aave/aave-v3-core/blob/master/contracts/protocol/libraries/math/WadRayMath.sol
88
library WadRayMath {
99
/* CONSTANTS */
10-
1110
// Only direct number constants and references to such constants are supported by inline assembly.
11+
1212
uint256 internal constant WAD = 1e18;
1313
uint256 internal constant HALF_WAD = 0.5e18;
1414
uint256 internal constant WAD_MINUS_ONE = 1e18 - 1;

0 commit comments

Comments
 (0)