Signed-off-by: T-Hax <>
This commit is contained in:
T-Hax 2023-04-08 18:46:18 +00:00
commit 735546619e
No known key found for this signature in database
828 changed files with 222925 additions and 0 deletions

View file

@ -0,0 +1,17 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.7.6;
import '../libraries/UnsafeMath.sol';
contract UnsafeMathEchidnaTest {
function checkDivRoundingUp(uint256 x, uint256 d) external pure {
require(d > 0);
uint256 z = UnsafeMath.divRoundingUp(x, d);
uint256 diff = z - (x / d);
if (x % d == 0) {
assert(diff == 0);
} else {
assert(diff == 1);
}
}
}