init
Signed-off-by: T-Hax <>
This commit is contained in:
commit
735546619e
828 changed files with 222925 additions and 0 deletions
17
lib/v3-core/contracts/test/UnsafeMathEchidnaTest.sol
Normal file
17
lib/v3-core/contracts/test/UnsafeMathEchidnaTest.sol
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue