96cad7de9c
* tests: reorganize testing packages * gitignore and minor changes
14 lines
340 B
Solidity
14 lines
340 B
Solidity
pragma solidity ^0.4.24;
|
|
|
|
|
|
library Uint256Helpers {
|
|
uint256 private constant MAX_UINT64 = uint64(-1);
|
|
|
|
string private constant ERROR_NUMBER_TOO_BIG = "UINT64_NUMBER_TOO_BIG";
|
|
|
|
function toUint64(uint256 a) internal pure returns (uint64) {
|
|
require(a <= MAX_UINT64, ERROR_NUMBER_TOO_BIG);
|
|
return uint64(a);
|
|
}
|
|
}
|