Skip to content

Commit 83b829e

Browse files
ernestognwAmxx
authored andcommitted
Address 5.4 audit documentation improvements (#5779)
Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>
1 parent 2e152ba commit 83b829e

File tree

6 files changed

+35
-24
lines changed

6 files changed

+35
-24
lines changed

contracts/governance/extensions/GovernorNoncesKeyed.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {NoncesKeyed} from "../../utils/NoncesKeyed.sol";
99
import {SignatureChecker} from "../../utils/cryptography/SignatureChecker.sol";
1010

1111
/**
12-
* @dev An extension of {Governor} that extends existing nonce management to use {NoncesKeyed}, where the key is the first 192 bits of the `proposalId`.
12+
* @dev An extension of {Governor} that extends existing nonce management to use {NoncesKeyed}, where the key is the low-order 192 bits of the `proposalId`.
1313
* This is useful for voting by signature while maintaining separate sequences of nonces for each proposal.
1414
*
1515
* NOTE: Traditional (un-keyed) nonces are still supported and can continue to be used as if this extension was not present.

contracts/utils/cryptography/signers/MultiSignerERC7913.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ abstract contract MultiSignerERC7913 is AbstractSigner {
226226
*
227227
* Requirements:
228228
*
229-
* * The `signatures` arrays must be at least as large as the `signers` arrays. Panics otherwise.
229+
* * The `signatures` and `signers` arrays must be equal in length. Returns false otherwise.
230230
*/
231231
function _validateSignatures(
232232
bytes32 hash,

contracts/utils/structs/EnumerableMap.sol

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,9 @@ library EnumerableMap {
220220
/**
221221
* @dev Removes all the entries from a map. O(n).
222222
*
223-
* WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the
224-
* function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block.
223+
* WARNING: This function has an unbounded cost that scales with map size. Developers should keep in mind that
224+
* using it may render the function uncallable if the map grows to the point where clearing it consumes too much
225+
* gas to fit in a block.
225226
*/
226227
function clear(UintToUintMap storage map) internal {
227228
clear(map._inner);
@@ -342,8 +343,9 @@ library EnumerableMap {
342343
/**
343344
* @dev Removes all the entries from a map. O(n).
344345
*
345-
* WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the
346-
* function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block.
346+
* WARNING: This function has an unbounded cost that scales with map size. Developers should keep in mind that
347+
* using it may render the function uncallable if the map grows to the point where clearing it consumes too much
348+
* gas to fit in a block.
347349
*/
348350
function clear(UintToAddressMap storage map) internal {
349351
clear(map._inner);
@@ -464,8 +466,9 @@ library EnumerableMap {
464466
/**
465467
* @dev Removes all the entries from a map. O(n).
466468
*
467-
* WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the
468-
* function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block.
469+
* WARNING: This function has an unbounded cost that scales with map size. Developers should keep in mind that
470+
* using it may render the function uncallable if the map grows to the point where clearing it consumes too much
471+
* gas to fit in a block.
469472
*/
470473
function clear(UintToBytes32Map storage map) internal {
471474
clear(map._inner);
@@ -586,8 +589,9 @@ library EnumerableMap {
586589
/**
587590
* @dev Removes all the entries from a map. O(n).
588591
*
589-
* WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the
590-
* function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block.
592+
* WARNING: This function has an unbounded cost that scales with map size. Developers should keep in mind that
593+
* using it may render the function uncallable if the map grows to the point where clearing it consumes too much
594+
* gas to fit in a block.
591595
*/
592596
function clear(AddressToUintMap storage map) internal {
593597
clear(map._inner);
@@ -708,8 +712,9 @@ library EnumerableMap {
708712
/**
709713
* @dev Removes all the entries from a map. O(n).
710714
*
711-
* WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the
712-
* function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block.
715+
* WARNING: This function has an unbounded cost that scales with map size. Developers should keep in mind that
716+
* using it may render the function uncallable if the map grows to the point where clearing it consumes too much
717+
* gas to fit in a block.
713718
*/
714719
function clear(AddressToAddressMap storage map) internal {
715720
clear(map._inner);
@@ -834,8 +839,9 @@ library EnumerableMap {
834839
/**
835840
* @dev Removes all the entries from a map. O(n).
836841
*
837-
* WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the
838-
* function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block.
842+
* WARNING: This function has an unbounded cost that scales with map size. Developers should keep in mind that
843+
* using it may render the function uncallable if the map grows to the point where clearing it consumes too much
844+
* gas to fit in a block.
839845
*/
840846
function clear(AddressToBytes32Map storage map) internal {
841847
clear(map._inner);
@@ -960,8 +966,9 @@ library EnumerableMap {
960966
/**
961967
* @dev Removes all the entries from a map. O(n).
962968
*
963-
* WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the
964-
* function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block.
969+
* WARNING: This function has an unbounded cost that scales with map size. Developers should keep in mind that
970+
* using it may render the function uncallable if the map grows to the point where clearing it consumes too much
971+
* gas to fit in a block.
965972
*/
966973
function clear(Bytes32ToUintMap storage map) internal {
967974
clear(map._inner);
@@ -1082,8 +1089,9 @@ library EnumerableMap {
10821089
/**
10831090
* @dev Removes all the entries from a map. O(n).
10841091
*
1085-
* WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the
1086-
* function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block.
1092+
* WARNING: This function has an unbounded cost that scales with map size. Developers should keep in mind that
1093+
* using it may render the function uncallable if the map grows to the point where clearing it consumes too much
1094+
* gas to fit in a block.
10871095
*/
10881096
function clear(Bytes32ToAddressMap storage map) internal {
10891097
clear(map._inner);

contracts/utils/structs/EnumerableSet.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,9 @@ library EnumerableSet {
126126
/**
127127
* @dev Removes all the values from a set. O(n).
128128
*
129-
* WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the
130-
* function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block.
129+
* WARNING: This function has an unbounded cost that scales with set size. Developers should keep in mind that
130+
* using it may render the function uncallable if the set grows to the point where clearing it consumes too much
131+
* gas to fit in a block.
131132
*/
132133
function _clear(Set storage set) private {
133134
uint256 len = _length(set);

scripts/generate/templates/EnumerableMap.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,9 @@ function remove(${name} storage map, ${key.type} key) internal returns (bool) {
219219
/**
220220
* @dev Removes all the entries from a map. O(n).
221221
*
222-
* WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the
223-
* function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block.
222+
* WARNING: This function has an unbounded cost that scales with map size. Developers should keep in mind that
223+
* using it may render the function uncallable if the map grows to the point where clearing it consumes too much
224+
* gas to fit in a block.
224225
*/
225226
function clear(${name} storage map) internal {
226227
clear(map._inner);

scripts/generate/templates/EnumerableSet.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,9 @@ function _remove(Set storage set, bytes32 value) private returns (bool) {
130130
/**
131131
* @dev Removes all the values from a set. O(n).
132132
*
133-
* WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the
134-
* function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block.
133+
* WARNING: This function has an unbounded cost that scales with set size. Developers should keep in mind that
134+
* using it may render the function uncallable if the set grows to the point where clearing it consumes too much
135+
* gas to fit in a block.
135136
*/
136137
function _clear(Set storage set) private {
137138
uint256 len = _length(set);

0 commit comments

Comments
 (0)