From df948e33ecd0a42d5081dc35eac19882e75952fe Mon Sep 17 00:00:00 2001 From: Mark Toda Date: Tue, 5 Nov 2024 21:42:50 -0800 Subject: [PATCH] fix: add rules to natspec --- src/libraries/VanityAddressLib.sol | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/libraries/VanityAddressLib.sol b/src/libraries/VanityAddressLib.sol index 4f0d0fcc..a3ad995a 100644 --- a/src/libraries/VanityAddressLib.sol +++ b/src/libraries/VanityAddressLib.sol @@ -13,17 +13,16 @@ library VanityAddressLib { } /// @notice Scores an address based on its vanity + /// @dev Scoring rules: + /// Requirement: The first nonzero nibble must be 4 + /// 10 points for every leading 0 nibble + /// 40 points if the first 4 is followed by 3 more 4s + /// 20 points if the first nibble after the 4 4s is NOT a 4 + /// 20 points if the last 4 nibbles are 4s + /// 1 point for every 4 /// @param addr The address to score /// @return calculatedScore The vanity score of the address function score(address addr) internal pure returns (uint256 calculatedScore) { - // Scoring rules: - // Requirement: The first nonzero nibble must be 4 - // 10 points for every leading 0 nibble - // 40 points if the first 4 is followed by 3 more 4s - // 20 points if the first nibble after the 4 4s is NOT a 4 - // 20 points if the last 4 nibbles are 4s - // 1 point for every 4 - // convert the address to bytes for easier parsing bytes20 addrBytes = bytes20(addr);