Update contracts to support Solidity 0.8.x (#2442)

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
This commit is contained in:
Andre Korol
2021-01-14 22:38:53 +00:00
committed by GitHub
parent 6be0b410dc
commit 974c534210
159 changed files with 338 additions and 509 deletions

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
pragma solidity ^0.8.0;
/**
* @dev String operations.
@ -23,10 +23,10 @@ library Strings {
temp /= 10;
}
bytes memory buffer = new bytes(digits);
uint256 index = digits - 1;
uint256 index = digits;
temp = value;
while (temp != 0) {
buffer[index--] = bytes1(uint8(48 + temp % 10));
buffer[--index] = bytes1(uint8(48 + uint256(temp % 10)));
temp /= 10;
}
return string(buffer);