From 031844b41580311fed5f8ef42a7013cccbdbb81f Mon Sep 17 00:00:00 2001 From: Brandon Chuah Date: Fri, 24 Nov 2023 18:53:58 +0800 Subject: [PATCH] fix: lint --- .prettierrc.json | 2 +- .solhint.json | 2 +- contracts/rnglib/RNGLib.sol | 15 +++++++++------ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.prettierrc.json b/.prettierrc.json index 7652206..8378666 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -3,7 +3,7 @@ { "files": "*.sol", "options": { - "compiler": "0.8.18" + "compiler": "^0.8.0" } } ] diff --git a/.solhint.json b/.solhint.json index 347660f..8cc428f 100644 --- a/.solhint.json +++ b/.solhint.json @@ -32,7 +32,7 @@ "avoid-throw": "error", "avoid-tx-origin": "off", "check-send-result": "error", - "compiler-version": ["error", "0.8.18"], + "compiler-version": ["error", "^0.8.0"], "mark-callable-contracts": "off", "func-visibility": ["error", { "ignoreConstructors": true }], "multiple-sends": "error", diff --git a/contracts/rnglib/RNGLib.sol b/contracts/rnglib/RNGLib.sol index de20171..d6848ce 100644 --- a/contracts/rnglib/RNGLib.sol +++ b/contracts/rnglib/RNGLib.sol @@ -1,8 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -/// @title RNGLib -/// @dev Library providing a simple interface to manage a contract-internal PRNG and pull random numbers from it. +/** + * @title RNGLib + * @dev Library providing a simple interface to manage a + * contract-internal PRNG and pull random numbers from it. + */ library RNGLib { /// @dev Structure to hold the state of the random number generator (RNG). struct RNGState { @@ -10,9 +13,9 @@ library RNGLib { uint256 counter; } - /// @notice Seed a new random number generator (RNG) based on a value from a public randomness beacon. - /// @dev To ensure domain separation, at least one of randomness, chain id, current contract address, - /// or the domain string must be different between two different RNGs. + /// @notice Seed a new RNG based on value from a public randomness beacon. + /// @dev To ensure domain separation, at least one of randomness, chain id, current contract + /// address, or the domain string must be different between two different RNGs. /// @param randomness The value from a public randomness beacon. /// @param domain A string that contributes to domain separation. /// @return st The initialized RNGState struct. @@ -39,7 +42,7 @@ library RNGLib { } } - /// @notice Generate a distinct, uniformly distributed number less than max, and advance the RNG. + /// @notice Generate a distinct, uniformly distributed number less than max, and advance the RNG /// @dev Max is limited to uint224 to ensure modulo bias probability is negligible. /// @param st The RNGState struct representing the state of the RNG. /// @param max The upper limit for the generated random number (exclusive).