Fix small bugs after migration to solidity 0.8.x

pull/2861/head
vzotova 2021-11-30 17:55:56 +03:00 committed by Kieran Prasch
parent 1c10b9bf54
commit cc332a5436
3 changed files with 5 additions and 5 deletions

View File

@ -105,9 +105,9 @@ contract PolicyManager is Upgradeable {
bytes16 internal constant RESERVED_POLICY_ID = bytes16(0);
address internal constant RESERVED_NODE = address(0);
uint256 internal constant MAX_BALANCE = uint256(uint128(0) - 1);
uint256 internal constant MAX_BALANCE = uint256(type(uint128).max);
// controlled overflow to get max int256
int256 public constant DEFAULT_FEE_DELTA = int256((uint256(0) - 1) >> 1);
int256 public constant DEFAULT_FEE_DELTA = int256((type(uint256).max) >> 1);
IStakingEscrow public immutable escrow;
uint32 public immutable genesisSecondsPerPeriod;

View File

@ -353,7 +353,7 @@ contract WorkLock is Ownable {
function internalShutdown() internal {
startBidDate = 0;
endBidDate = 0;
endCancellationDate = uint256(0) - 1; // "infinite" cancellation window
endCancellationDate = type(uint256).max; // "infinite" cancellation window
token.safeTransfer(owner(), tokenSupply);
emit Shutdown(msg.sender);
}

View File

@ -122,9 +122,9 @@ library SignatureVerifier {
}
bytes memory lengthAsText = new bytes(digits);
length = _message.length;
uint256 index = digits - 1;
uint256 index = digits;
while (length != 0) {
lengthAsText[index--] = bytes1(uint8(48 + length % 10));
lengthAsText[--index] = bytes1(uint8(48 + length % 10));
length /= 10;
}