From 25eb6777fe25e39ee0f50a7cfcbf50c260abf508 Mon Sep 17 00:00:00 2001 From: Olexandr88 Date: Wed, 9 Apr 2025 01:53:06 +0300 Subject: [PATCH 1/7] Add github release tag to readme. (#5627) Co-authored-by: Hadrien Croubois --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 60d0a430a1d..2f92281b3bf 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # OpenZeppelin +[![Github Release](https://img.shields.io/github/v/tag/OpenZeppelin/openzeppelin-contracts.svg?filter=v*&sort=semver&label=github)](https://github.com/OpenZeppelin/openzeppelin-contracts/releases/latest) [![NPM Package](https://img.shields.io/npm/v/@openzeppelin/contracts.svg)](https://www.npmjs.org/package/@openzeppelin/contracts) [![Coverage Status](https://codecov.io/gh/OpenZeppelin/openzeppelin-contracts/graph/badge.svg)](https://codecov.io/gh/OpenZeppelin/openzeppelin-contracts) [![GitPOAPs](https://public-api.gitpoap.io/v1/repo/OpenZeppelin/openzeppelin-contracts/badge)](https://www.gitpoap.io/gh/OpenZeppelin/openzeppelin-contracts) From fba8c4f58e1c8c1ddc60e61912b0cdbf479f3ac3 Mon Sep 17 00:00:00 2001 From: Maxim Tiron Date: Fri, 9 May 2025 18:48:05 +0300 Subject: [PATCH 2/7] Update hardhat.config.js (#5675) --- hardhat.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardhat.config.js b/hardhat.config.js index 17ebf45eeb7..8f326b5a58c 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -1,5 +1,5 @@ /// ENVVAR -// - COMPILER: compiler version (default: 0.8.24) +// - COMPILER: compiler version (default: 0.8.27) // - SRC: contracts folder to compile (default: contracts) // - RUNS: number of optimization runs (default: 200) // - IR: enable IR compilation (default: false) From 5702d954c6382ca65252c7c33f7838e079a54384 Mon Sep 17 00:00:00 2001 From: Gonzalo Othacehe Date: Mon, 23 Jun 2025 21:08:42 -0300 Subject: [PATCH 3/7] fix: change SlotDerivation usage to 'for *' in template and generated code --- contracts/utils/SlotDerivation.sol | 2 +- scripts/generate/templates/SlotDerivation.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/utils/SlotDerivation.sol b/contracts/utils/SlotDerivation.sol index df23efa284a..74dfbbded44 100644 --- a/contracts/utils/SlotDerivation.sol +++ b/contracts/utils/SlotDerivation.sol @@ -16,7 +16,7 @@ pragma solidity ^0.8.20; * contract Example { * // Add the library methods * using StorageSlot for bytes32; - * using SlotDerivation for bytes32; + * using SlotDerivation for *; * * // Declare a namespace * string private constant _NAMESPACE = ""; // eg. OpenZeppelin.Slot diff --git a/scripts/generate/templates/SlotDerivation.js b/scripts/generate/templates/SlotDerivation.js index a00e98167f6..931c9fc25e8 100644 --- a/scripts/generate/templates/SlotDerivation.js +++ b/scripts/generate/templates/SlotDerivation.js @@ -17,7 +17,7 @@ pragma solidity ^0.8.20; * contract Example { * // Add the library methods * using StorageSlot for bytes32; - * using SlotDerivation for bytes32; + * using SlotDerivation for *; * * // Declare a namespace * string private constant _NAMESPACE = ""; // eg. OpenZeppelin.Slot From 659d4b2ff882c24a24f05881bd1ab6220081b558 Mon Sep 17 00:00:00 2001 From: Gonzalo Othacehe Date: Mon, 23 Jun 2025 20:58:36 -0300 Subject: [PATCH 4/7] Merge branch 'typo-fixes' of github.com:OpenZeppelin/openzeppelin-contracts into typo-fixes --- README.md | 2 +- contracts/utils/cryptography/ECDSA.sol | 1 + contracts/utils/cryptography/README.adoc | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2f92281b3bf..2cb5e35ce70 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ To keep your system secure, you should **always** use the installed code as-is, The guides in the [documentation site](https://docs.openzeppelin.com/contracts) will teach about different concepts, and how to use the related contracts that OpenZeppelin Contracts provides: * [Access Control](https://docs.openzeppelin.com/contracts/access-control): decide who can perform each of the actions on your system. -* [Tokens](https://docs.openzeppelin.com/contracts/tokens): create tradeable assets or collectives, and distribute them via [Crowdsales](https://docs.openzeppelin.com/contracts/crowdsales). +* [Tokens](https://docs.openzeppelin.com/contracts/tokens): create tradeable assets or collectives. * [Utilities](https://docs.openzeppelin.com/contracts/utilities): generic useful tools including non-overflowing math, signature verification, and trustless paying systems. The [full API](https://docs.openzeppelin.com/contracts/api/token/ERC20) is also thoroughly documented, and serves as a great reference when developing your smart contract application. You can also ask for help or follow Contracts' development in the [community forum](https://forum.openzeppelin.com). diff --git a/contracts/utils/cryptography/ECDSA.sol b/contracts/utils/cryptography/ECDSA.sol index 6493f56338a..f2fc24e6e87 100644 --- a/contracts/utils/cryptography/ECDSA.sol +++ b/contracts/utils/cryptography/ECDSA.sol @@ -50,6 +50,7 @@ library ECDSA { * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it. * * Documentation for signature generation: + * * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] */ diff --git a/contracts/utils/cryptography/README.adoc b/contracts/utils/cryptography/README.adoc index 37a982448ec..c87446de76e 100644 --- a/contracts/utils/cryptography/README.adoc +++ b/contracts/utils/cryptography/README.adoc @@ -1,7 +1,7 @@ = Cryptography [.readme-notice] -NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/utils/cryptography +NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/utils#cryptography A collection of contracts and libraries that implement various signature validation schemes and cryptographic primitives. These utilities enable secure authentication, multisignature operations, and advanced cryptographic operations in smart contracts. From 6caac66f0297de6fed6f021d1f27aeb33253bb2f Mon Sep 17 00:00:00 2001 From: sellskin Date: Tue, 1 Jul 2025 16:17:51 +0800 Subject: [PATCH 5/7] chore: remove redundant word (#5774) Signed-off-by: sellskin Co-authored-by: Hadrien Croubois --- contracts/utils/cryptography/draft-ERC7739Utils.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/utils/cryptography/draft-ERC7739Utils.sol b/contracts/utils/cryptography/draft-ERC7739Utils.sol index ec79fdd224c..e4df5d60206 100644 --- a/contracts/utils/cryptography/draft-ERC7739Utils.sol +++ b/contracts/utils/cryptography/draft-ERC7739Utils.sol @@ -57,7 +57,7 @@ library ERC7739Utils { * - `APP_DOMAIN_SEPARATOR` is the EIP-712 {EIP712-_domainSeparatorV4} of the application smart contract that is * requesting the signature verification (though ERC-1271). * - `contentsHash` is the hash of the underlying data structure or message. - * - `contentsDescr` is a descriptor of the "contents" part of the the EIP-712 type of the nested signature. + * - `contentsDescr` is a descriptor of the "contents" part of the EIP-712 type of the nested signature. * * NOTE: This function returns empty if the input format is invalid instead of reverting. * data instead. From 33513d1763e9261fc16cb1d78626aba8d2c4eb18 Mon Sep 17 00:00:00 2001 From: Micke <155267459+reallesee@users.noreply.github.com> Date: Sat, 12 Jul 2025 22:54:50 +0200 Subject: [PATCH 6/7] Explicit Initialization of Loop Counter in escapeJSON Function (#5796) Co-authored-by: Hadrien Croubois --- contracts/utils/Strings.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/utils/Strings.sol b/contracts/utils/Strings.sol index c67bff5a1b1..678315bcf7f 100644 --- a/contracts/utils/Strings.sol +++ b/contracts/utils/Strings.sol @@ -465,7 +465,7 @@ library Strings { bytes memory output = new bytes(2 * buffer.length); // worst case scenario uint256 outputLength = 0; - for (uint256 i; i < buffer.length; ++i) { + for (uint256 i = 0; i < buffer.length; ++i) { bytes1 char = bytes1(_unsafeReadBytesOffset(buffer, i)); if (((SPECIAL_CHARS_LOOKUP & (1 << uint8(char))) != 0)) { output[outputLength++] = "\\"; From 7d823fe06e72a4c0ec59f9c4fcc8417cc87b98ca Mon Sep 17 00:00:00 2001 From: DeFi Warlock Date: Mon, 21 Jul 2025 16:11:44 +0200 Subject: [PATCH 7/7] chore: fix typos (#5807) Co-authored-by: Hadrien Croubois --- docs/modules/ROOT/pages/utilities.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/ROOT/pages/utilities.adoc b/docs/modules/ROOT/pages/utilities.adoc index f0114726f2f..e2c8772fa2a 100644 --- a/docs/modules/ROOT/pages/utilities.adoc +++ b/docs/modules/ROOT/pages/utilities.adoc @@ -263,7 +263,7 @@ Some use cases require more powerful data structures than arrays and mappings of - xref:api:utils.adoc#EnumerableSet[`EnumerableSet`]: A https://en.wikipedia.org/wiki/Set_(abstract_data_type)[set] with enumeration capabilities. - xref:api:utils.adoc#EnumerableMap[`EnumerableMap`]: A `mapping` variant with enumeration capabilities. - xref:api:utils.adoc#MerkleTree[`MerkleTree`]: An on-chain https://wikipedia.org/wiki/Merkle_Tree[Merkle Tree] with helper functions. -- xref:api:utils.adoc#Heap.sol[`Heap`]: A https://en.wikipedia.org/wiki/Binary_heap[binary heap] to store elements with priority defined by a compartor function. +- xref:api:utils.adoc#Heap.sol[`Heap`]: A https://en.wikipedia.org/wiki/Binary_heap[binary heap] to store elements with priority defined by a comparator function. The `Enumerable*` structures are similar to mappings in that they store and remove elements in constant time and don't allow for repeated entries, but they also support _enumeration_, which means you can easily query all stored entries both on and off-chain.