Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonchuah committed Nov 24, 2023
1 parent 2c8ae02 commit 031844b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"files": "*.sol",
"options": {
"compiler": "0.8.18"
"compiler": "^0.8.0"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion .solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
15 changes: 9 additions & 6 deletions contracts/rnglib/RNGLib.sol
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
// 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 {
bytes32 seed;
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.
Expand All @@ -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).
Expand Down

0 comments on commit 031844b

Please sign in to comment.