From 00df20ac893255693fa921b47a587c1f5cc3fc8b Mon Sep 17 00:00:00 2001 From: MozirDmitriy Date: Thu, 13 Nov 2025 23:04:33 +0300 Subject: [PATCH 1/2] chore: fix typos --- contracts/utils/Arrays.sol | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contracts/utils/Arrays.sol b/contracts/utils/Arrays.sol index e49be484d80..cd01b21c561 100644 --- a/contracts/utils/Arrays.sol +++ b/contracts/utils/Arrays.sol @@ -681,7 +681,7 @@ library Arrays { /** * @dev Helper to set the length of a dynamic array. Directly writing to `.length` is forbidden. * - * WARNING: this does not clear elements if length is reduced, of initialize elements if length is increased. + * WARNING: this does not clear elements if length is reduced, or initialize elements if length is increased. */ function unsafeSetLength(address[] storage array, uint256 len) internal { assembly ("memory-safe") { @@ -692,7 +692,7 @@ library Arrays { /** * @dev Helper to set the length of a dynamic array. Directly writing to `.length` is forbidden. * - * WARNING: this does not clear elements if length is reduced, of initialize elements if length is increased. + * WARNING: this does not clear elements if length is reduced, or initialize elements if length is increased. */ function unsafeSetLength(bytes32[] storage array, uint256 len) internal { assembly ("memory-safe") { @@ -703,7 +703,7 @@ library Arrays { /** * @dev Helper to set the length of a dynamic array. Directly writing to `.length` is forbidden. * - * WARNING: this does not clear elements if length is reduced, of initialize elements if length is increased. + * WARNING: this does not clear elements if length is reduced, or initialize elements if length is increased. */ function unsafeSetLength(uint256[] storage array, uint256 len) internal { assembly ("memory-safe") { @@ -714,7 +714,7 @@ library Arrays { /** * @dev Helper to set the length of a dynamic array. Directly writing to `.length` is forbidden. * - * WARNING: this does not clear elements if length is reduced, of initialize elements if length is increased. + * WARNING: this does not clear elements if length is reduced, or initialize elements if length is increased. */ function unsafeSetLength(bytes[] storage array, uint256 len) internal { assembly ("memory-safe") { @@ -725,7 +725,7 @@ library Arrays { /** * @dev Helper to set the length of a dynamic array. Directly writing to `.length` is forbidden. * - * WARNING: this does not clear elements if length is reduced, of initialize elements if length is increased. + * WARNING: this does not clear elements if length is reduced, or initialize elements if length is increased. */ function unsafeSetLength(string[] storage array, uint256 len) internal { assembly ("memory-safe") { From 9ca2ed96012100259a1d254bcfc3f72f5c5ebb0f Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 27 Nov 2025 18:04:02 +0100 Subject: [PATCH 2/2] Fix warning in unsafeSetLength documentation Correct warning message about length adjustment behavior. --- scripts/generate/templates/Arrays.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/generate/templates/Arrays.js b/scripts/generate/templates/Arrays.js index ff618025c8f..d2346d687d5 100644 --- a/scripts/generate/templates/Arrays.js +++ b/scripts/generate/templates/Arrays.js @@ -350,7 +350,7 @@ const unsafeSetLength = type => `\ /** * @dev Helper to set the length of a dynamic array. Directly writing to \`.length\` is forbidden. * - * WARNING: this does not clear elements if length is reduced, of initialize elements if length is increased. + * WARNING: this does not clear elements if length is reduced, or initialize elements if length is increased. */ function unsafeSetLength(${type.name}[] storage array, uint256 len) internal { assembly ("memory-safe") {