Update Prettier Solidity (#3898)

This commit is contained in:
Francisco
2022-12-23 22:28:05 -03:00
committed by GitHub
parent 4072e853fe
commit b709eae01d
103 changed files with 419 additions and 1167 deletions

View File

@ -52,11 +52,7 @@ library Math {
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
@ -137,12 +133,7 @@ library Math {
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator,
Rounding rounding
) internal pure returns (uint256) {
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
@ -258,31 +249,31 @@ library Math {
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10**64) {
value /= 10**64;
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10**32) {
value /= 10**32;
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10**16) {
value /= 10**16;
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10**8) {
value /= 10**8;
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10**4) {
value /= 10**4;
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10**2) {
value /= 10**2;
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10**1) {
if (value >= 10 ** 1) {
result += 1;
}
}
@ -296,7 +287,7 @@ library Math {
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}

View File

@ -165,11 +165,7 @@ library SafeMath {
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
@ -188,11 +184,7 @@ library SafeMath {
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
@ -214,11 +206,7 @@ library SafeMath {
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;