Skip to content
Open
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
25eb677
Add github release tag to readme. (#5627)
Olexandr88 Apr 8, 2025
a7fb048
Merge branch 'master' into typo-fixes
arr00 May 9, 2025
fba8c4f
Update hardhat.config.js (#5675)
XZSt4nce May 9, 2025
d43e45b
Merge branch 'master' of github.com:OpenZeppelin/openzeppelin-contrac…
gonzaotc Jun 23, 2025
5702d95
fix: change SlotDerivation usage to 'for *' in template and generated…
gonzaotc Jun 24, 2025
659d4b2
Merge branch 'typo-fixes' of github.com:OpenZeppelin/openzeppelin-con…
gonzaotc Jun 23, 2025
0b9edd4
Merge branch 'master' into typo-fixes
Amxx Jul 1, 2025
6caac66
chore: remove redundant word (#5774)
sellskin Jul 1, 2025
98a43df
Merge branch 'master' into typo-fixes
Amxx Jul 8, 2025
337211c
Merge branch 'master' into typo-fixes
Amxx Jul 12, 2025
33513d1
Explicit Initialization of Loop Counter in escapeJSON Function (#5796)
reallesee Jul 12, 2025
fe20e98
Merge branch 'master' into typo-fixes
Amxx Jul 21, 2025
7d823fe
chore: fix typos (#5807)
solanaXpeter Jul 21, 2025
a774572
Merge branch 'master' into typo-fixes
Amxx Jul 23, 2025
a909a7d
Improve Math.sol NatSpec documentation (#5813)
aviggiano Jul 23, 2025
2c0d228
fix: typos (#5811)
crStiv Jul 24, 2025
2bb691a
Merge branch 'master' into typo-fixes
Amxx Jul 24, 2025
0f5566d
Merge branch 'master' into typo-fixes
Amxx Jul 31, 2025
7dcf761
Fix typos and inaccuracies in documentation (#5815)
torrpriius Aug 4, 2025
0b388b0
Merge branch 'master' into typo-fixes
ernestognw Aug 4, 2025
2050256
up
gap-editor Aug 3, 2025
95c41d2
fix: couple of typos (#5833)
CreeptoGengar Aug 6, 2025
58cbf7b
Remove duplicate word in ERC7821 comment (#5839)
aso20455 Aug 9, 2025
96ff826
Merge branch 'master' into typo-fixes
arr00 Aug 15, 2025
61641da
polishing docs: error fixes for clarity (#5857)
aso20455 Aug 15, 2025
e7347d7
Remove OpenZeppelin Defender link from README.md (#5812)
DeVikingMark Aug 16, 2025
af092bc
Remove Crowdsale link from README (#5827)
destinyae Aug 16, 2025
d440275
Fix typos and grammar in docs and comments (#5840)
wedjob0X Aug 18, 2025
9f882bf
Merge branch 'master' into typo-fixes
Amxx Aug 18, 2025
4c56d07
docs(ERC20): link ERC20Votes to governance guide minimal example (#5860)
anil2ec4 Aug 20, 2025
fc31086
Merge branch 'master' into typo-fixes
Amxx Aug 20, 2025
a40af03
Rewrite assertion chains (#5867)
fifalodm Aug 20, 2025
a5e1d21
Merge branch 'master' into typo-fixes
Amxx Aug 21, 2025
590d13d
Fix IERC165 import path (#5871)
Galoretka Aug 21, 2025
3ca99da
Merge branch 'master' into typo-fixes
ernestognw Aug 21, 2025
e0486a9
docs(contracts): fix typos and grammar in NatSpec comments (#5873)
radik878 Aug 21, 2025
8134a56
Merge branch 'master' into typo-fixes
Amxx Aug 22, 2025
1978ed2
docs: fix typos and grammar in Solidity source comments (#5875)
GarmashAlex Aug 22, 2025
142d9a2
Merge branch 'master' into typo-fixes
Amxx Aug 25, 2025
197d228
docs: fix typos and grammar in comments (#5879)
VolodymyrBg Aug 25, 2025
29eeb96
docs: fix typos in Solidity comments and documentation (#5885)
MozirDmitriy Aug 25, 2025
f32cfdb
Merge branch 'master' into typo-fixes
arr00 Aug 28, 2025
4ccb299
docs: fix grammar and typos across multiple pages (#5905)
Fibonacci747 Aug 28, 2025
7416a7f
chore: fix typos and clarify role naming (#5895)
sashass1315 Sep 1, 2025
57201f9
fix(docs): correct filename punctuation in README installation instru…
strmfos Sep 1, 2025
99e69fa
fix: correct grammar in function documentation comments (#5911)
reallesee Sep 4, 2025
94675b4
docs: fix grammar and clarity in documentation (#5909)
Forostovec Sep 4, 2025
362d9ad
Merge branch 'master' into typo-fixes
Amxx Sep 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

:mage: **Not sure how to get started?** Check out [Contracts Wizard](https://wizard.openzeppelin.com/) — an interactive smart contract generator.

:building_construction: **Want to scale your decentralized application?** Check out [OpenZeppelin Defender](https://openzeppelin.com/defender) — a mission-critical developer security platform to code, audit, deploy, monitor, and operate with confidence.

> [!IMPORTANT]
> OpenZeppelin Contracts uses semantic versioning to communicate backwards compatibility of its API and storage layout. For upgradeable contracts, the storage layout of different major versions should be assumed incompatible, for example, it is unsafe to upgrade from 4.9.3 to 5.0.0. Learn more at [Backwards Compatibility](https://docs.openzeppelin.com/contracts/backwards-compatibility).

Expand Down Expand Up @@ -68,7 +66,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 for popular ERC standards like ERC-20, ERC-721, ERC-1155, and ERC-6909.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Typo: “collectives” → “collectibles”.

Correct terminology for token items.

-* [Tokens](https://docs.openzeppelin.com/contracts/tokens): create tradeable assets or collectives for popular ERC standards like ERC-20, ERC-721, ERC-1155, and ERC-6909.
+* [Tokens](https://docs.openzeppelin.com/contracts/tokens): create tradeable assets or collectibles for popular ERC standards like ERC-20, ERC-721, ERC-1155, and ERC-6909.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* [Tokens](https://docs.openzeppelin.com/contracts/tokens): create tradeable assets or collectives for popular ERC standards like ERC-20, ERC-721, ERC-1155, and ERC-6909.
* [Tokens](https://docs.openzeppelin.com/contracts/tokens): create tradeable assets or collectibles for popular ERC standards like ERC-20, ERC-721, ERC-1155, and ERC-6909.
🧰 Tools
🪛 LanguageTool

[grammar] ~69-~69: There might be a mistake here.
Context: ...ERC-20, ERC-721, ERC-1155, and ERC-6909. * [Utilities](https://docs.openzeppelin.com...

(QB_NEW_EN)

🤖 Prompt for AI Agents
In README.md around line 69, the word "collectives" is a typo and should be
"collectibles"; update the sentence to use "collectibles" so it reads "...create
tradeable assets or collectibles for popular ERC standards..." ensuring correct
terminology for token items.

* [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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {AccessControl, IAccessControl} from "../AccessControl.sol";
import {SafeCast} from "../../utils/math/SafeCast.sol";
import {Math} from "../../utils/math/Math.sol";
import {IERC5313} from "../../interfaces/IERC5313.sol";
import {IERC165} from "../../utils/introspection/ERC165.sol";
import {IERC165} from "../../utils/introspection/IERC165.sol";

/**
* @dev Extension of {AccessControl} that allows specifying special rules to manage
Expand Down Expand Up @@ -357,14 +357,14 @@ abstract contract AccessControlDefaultAdminRules is IAccessControlDefaultAdminRu
///

/**
* @dev Defines if an `schedule` is considered set. For consistency purposes.
* @dev Defines if a `schedule` is considered set. For consistency purposes.
*/
function _isScheduleSet(uint48 schedule) private pure returns (bool) {
return schedule != 0;
}

/**
* @dev Defines if an `schedule` is considered passed. For consistency purposes.
* @dev Defines if a `schedule` is considered passed. For consistency purposes.
*/
function _hasSchedulePassed(uint48 schedule) private view returns (bool) {
return schedule < block.timestamp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ interface IAccessControlDefaultAdminRules is IAccessControl {
* When the {defaultAdminDelay} is scheduled to be increased, it goes into effect after the new delay has passed with
* the purpose of giving enough time for reverting any accidental change (i.e. using milliseconds instead of seconds)
* that may lock the contract. However, to avoid excessive schedules, the wait is capped by this function and it can
* be overrode for a custom {defaultAdminDelay} increase scheduling.
* be overridden for a custom {defaultAdminDelay} increase scheduling.
*
* IMPORTANT: Make sure to add a reasonable amount of time while overriding this value, otherwise,
* there's a risk of setting a high new delay that goes into effect almost immediately without the
Expand Down
2 changes: 1 addition & 1 deletion contracts/access/manager/AccessManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ contract AccessManager is Context, Multicall, IAccessManager {
bool closed;
}

// Structure that stores the details for a role/account pair. This structures fit into a single slot.
// Structure that stores the details for a role/account pair. This structure fits into a single slot.
struct Access {
// Timepoint at which the user gets the permission.
// If this is either 0 or in the future, then the role permission is not available.
Expand Down
6 changes: 3 additions & 3 deletions contracts/access/manager/IAccessManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ interface IAccessManager {

/**
* @dev Minimum setback for all delay updates, with the exception of execution delays. It
* can be increased without setback (and reset via {revokeRole} in the case event of an
* can be increased without setback (and reset via {revokeRole} in the event of an
* accidental increase). Defaults to 5 days.
*/
function minSetback() external view returns (uint32);
Expand Down Expand Up @@ -170,7 +170,7 @@ interface IAccessManager {

/**
* @dev Get the access details for a given account for a given role. These details include the timepoint at which
* membership becomes active, and the delay applied to all operation by this user that requires this permission
* membership becomes active, and the delay applied to all operations by this user that requires this permission
* level.
*
* Returns:
Expand Down Expand Up @@ -376,7 +376,7 @@ interface IAccessManager {
* @dev Consume a scheduled operation targeting the caller. If such an operation exists, mark it as consumed
* (emit an {OperationExecuted} event and clean the state). Otherwise, throw an error.
*
* This is useful for contract that want to enforce that calls targeting them were scheduled on the manager,
* This is useful for contracts that want to enforce that calls targeting them were scheduled on the manager,
* with all the verifications that it implies.
*
* Emit a {OperationExecuted} event.
Expand Down
2 changes: 1 addition & 1 deletion contracts/account/extensions/draft-ERC7821.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {Account} from "../Account.sol";
/**
* @dev Minimal batch executor following ERC-7821.
*
* Only supports supports single batch mode (`0x01000000000000000000`). Does not support optional "opData".
* Only supports single batch mode (`0x01000000000000000000`). Does not support optional "opData".
*
* @custom:stateless
*/
Expand Down
2 changes: 1 addition & 1 deletion contracts/account/utils/EIP7702Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ library EIP7702Utils {
bytes3 internal constant EIP7702_PREFIX = 0xef0100;

/**
* @dev Returns the address of the delegate if `account` as an EIP-7702 delegation setup, or address(0) otherwise.
* @dev Returns the address of the delegate if `account` has an EIP-7702 delegation setup, or address(0) otherwise.
*/
function fetchDelegate(address account) internal view returns (address) {
bytes23 delegation = bytes23(account.code);
Expand Down
2 changes: 1 addition & 1 deletion contracts/finance/VestingWallet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ contract VestingWallet is Context, Ownable {
}

/**
* @dev Release the native token (ether) that have already vested.
* @dev Release the native token (ether) that has already vested.
*
* Emits a {EtherReleased} event.
*/
Expand Down
2 changes: 1 addition & 1 deletion contracts/governance/Governor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72
}

/**
* @dev Address through which the governor executes action. Will be overloaded by module that execute actions
* @dev Address through which the governor executes action. Will be overloaded by module that executes actions
* through another contract such as a timelock.
*/
function _executor() internal view virtual returns (address) {
Expand Down
2 changes: 1 addition & 1 deletion contracts/governance/IGovernor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ interface IGovernor is IERC165, IERC6372 {
function hasVoted(uint256 proposalId, address account) external view returns (bool);

/**
* @dev Create a new proposal. Vote start after a delay specified by {IGovernor-votingDelay} and lasts for a
* @dev Create a new proposal. Vote starts after a delay specified by {IGovernor-votingDelay} and lasts for a
* duration specified by {IGovernor-votingPeriod}.
*
* Emits a {ProposalCreated} event.
Expand Down
2 changes: 1 addition & 1 deletion contracts/governance/extensions/GovernorStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pragma solidity ^0.8.24;
import {Governor} from "../Governor.sol";

/**
* @dev Extension of {Governor} that implements storage of proposal details. This modules also provides primitives for
* @dev Extension of {Governor} that implements storage of proposal details. This module also provides primitives for
* the enumerability of proposals.
*
* Use cases for this module include:
Expand Down
8 changes: 4 additions & 4 deletions contracts/governance/extensions/GovernorTimelockControl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {SafeCast} from "../../utils/math/SafeCast.sol";

/**
* @dev Extension of {Governor} that binds the execution process to an instance of {TimelockController}. This adds a
* delay, enforced by the {TimelockController} to all successful proposal (in addition to the voting duration). The
* delay, enforced by the {TimelockController} to all successful proposals (in addition to the voting duration). The
* {Governor} needs the proposer (and ideally the executor and canceller) roles for the {Governor} to work properly.
*
* Using this model means the proposal will be operated by the {TimelockController} and not by the {Governor}. Thus,
Expand Down Expand Up @@ -47,10 +47,10 @@ abstract contract GovernorTimelockControl is Governor {
return currentState;
}

bytes32 queueid = _timelockIds[proposalId];
if (_timelock.isOperationPending(queueid)) {
bytes32 queueId = _timelockIds[proposalId];
if (_timelock.isOperationPending(queueId)) {
return ProposalState.Queued;
} else if (_timelock.isOperationDone(queueid)) {
} else if (_timelock.isOperationDone(queueId)) {
// This can happen if the proposal is executed directly on the timelock.
return ProposalState.Executed;
} else {
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IERC3156FlashLender.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {IERC3156FlashBorrower} from "./IERC3156FlashBorrower.sol";
*/
interface IERC3156FlashLender {
/**
* @dev The amount of currency available to be lended.
* @dev The amount of currency available to be lent.
* @param token The loan currency.
* @return The amount of `token` that can be borrowed.
*/
Expand Down
2 changes: 1 addition & 1 deletion contracts/metatx/ERC2771Context.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {Context} from "../utils/Context.sol";
/**
* @dev Context variant with ERC-2771 support.
*
* WARNING: Avoid using this pattern in contracts that rely in a specific calldata length as they'll
* WARNING: Avoid using this pattern in contracts that rely on a specific calldata length as they'll
* be affected by any forwarder whose `msg.data` is suffixed with the `from` address according to the ERC-2771
* specification adding the address size in bytes (20) to the calldata size. An example of an unexpected
* behavior could be an unintended fallback (or another function) invocation while trying to invoke the `receive`
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/TimelockReentrant.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ contract TimelockReentrant {
_reentered = true;
}

function enableRentrancy(address target, bytes calldata data) external {
function enableReentrancy(address target, bytes calldata data) external {
_reenterTarget = target;
_reenterData = data;
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/docs/ERC4626Fees.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ abstract contract ERC4626Fees is ERC4626 {
return assets + _feeOnRaw(assets, _entryFeeBasisPoints());
}

/// @dev Preview adding an exit fee on withdraw. See {IERC4626-previewWithdraw}.
/// @dev Preview adding an exit fee on withdrawal. See {IERC4626-previewWithdraw}.
function previewWithdraw(uint256 assets) public view virtual override returns (uint256) {
uint256 fee = _feeOnRaw(assets, _exitFeeBasisPoints());
return super.previewWithdraw(assets + fee);
Expand Down
2 changes: 1 addition & 1 deletion contracts/token/ERC20/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Additionally there are multiple custom extensions, including:
* {ERC20Capped}: enforcement of a cap to the total supply when minting tokens.
* {ERC20Pausable}: ability to pause token transfers.
* {ERC20FlashMint}: token level support for flash loans through the minting and burning of ephemeral tokens (standardized as ERC-3156).
* {ERC20Votes}: support for voting and vote delegation.
* {ERC20Votes}: support for voting and vote delegation. xref:governance.adoc#token[See the governance guide for a minimal example (with the required overrides when combining ERC20 + ERC20Permit + ERC20Votes)].
* {ERC20Wrapper}: wrapper to create an ERC-20 backed by another ERC-20, with deposit and withdraw methods. Useful in conjunction with {ERC20Votes}.
* {ERC20TemporaryApproval}: support for approvals lasting for only one transaction, as defined in ERC-7674.
* {ERC1363}: support for calling the target of a transfer or approval, enabling code execution on the receiver within a single transaction.
Expand Down
2 changes: 1 addition & 1 deletion contracts/token/ERC721/extensions/ERC721Consecutive.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {Checkpoints} from "../../../utils/structs/Checkpoints.sol";
* regained after construction. During construction, only batch minting is allowed.
*
* IMPORTANT: This extension does not call the {_update} function for tokens minted in batch. Any logic added to this
* function through overrides will not be triggered when token are minted in batch. You may want to also override
* function through overrides will not be triggered when tokens are minted in batch. You may want to also override
* {_increaseBalance} or {_mintConsecutive} to account for these mints.
*
* IMPORTANT: When overriding {_mintConsecutive}, be careful about call ordering. {ownerOf} may return invalid
Expand Down
2 changes: 1 addition & 1 deletion contracts/token/ERC721/utils/ERC721Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {IERC721Receiver} from "../IERC721Receiver.sol";
import {IERC721Errors} from "../../../interfaces/draft-IERC6093.sol";

/**
* @dev Library that provide common ERC-721 utility functions.
* @dev Library that provides common ERC-721 utility functions.
*
* See https://eips.ethereum.org/EIPS/eip-721[ERC-721].
*
Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/Base64.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ library Base64 {
*/
function _encode(bytes memory data, string memory table, bool withPadding) private pure returns (string memory) {
/**
* Inspired by Brecht Devos (Brechtpd) implementation - MIT licence
* Inspired by Brecht Devos (Brechtpd) implementation - MIT license
* https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol
*/
if (data.length == 0) return "";
Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/Bytes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ library Bytes {

/**
* @dev Reverses the byte order of a bytes32 value, converting between little-endian and big-endian.
* Inspired in https://graphics.stanford.edu/~seander/bithacks.html#ReverseParallel[Reverse Parallel]
* Inspired by https://graphics.stanford.edu/~seander/bithacks.html#ReverseParallel[Reverse Parallel]
*/
function reverseBytes32(bytes32 value) internal pure returns (bytes32) {
value = // swap bytes
Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/SlotDerivation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<namespace>"; // eg. OpenZeppelin.Slot
Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/Strings.sol
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,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++] = "\\";
Expand Down
1 change: 1 addition & 0 deletions contracts/utils/cryptography/ECDSA.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,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]
*/
Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/cryptography/README.adoc
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/cryptography/draft-ERC7739Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,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.
Comment on lines 59 to 61
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix preposition: “through ERC-1271”, not “though”.

Minor doc grammar issue within the bullet describing APP_DOMAIN_SEPARATOR.

Apply this diff:

- *   requesting the signature verification (though ERC-1271).
+ *   requesting the signature verification (through ERC-1271).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* - `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.
* - `APP_DOMAIN_SEPARATOR` is the EIP-712 {EIP712-_domainSeparatorV4} of the application smart contract that is
* requesting the signature verification (through ERC-1271).
* - `contentsHash` is the hash of the underlying data structure or message.
🤖 Prompt for AI Agents
In contracts/utils/cryptography/draft-ERC7739Utils.sol around lines 59 to 61,
the documentation has a typo using "though ERC-1271" instead of the correct
preposition "through ERC-1271"; update the comment to read "through ERC-1271" to
fix the grammar.

* - `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.
Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/draft-InteroperableAddress.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ library InteroperableAddress {
/**
* @dev Format an ERC-7930 interoperable address (version 1) from its components `chainType`, `chainReference`
* and `addr`. This is a generic function that supports any chain type, chain reference and address supported by
* ERC-7390, including interoperable addresses with empty chain reference or empty address.
* ERC-7930, including interoperable addresses with empty chain reference or empty address.
*/
function formatV1(
bytes2 chainType,
Expand Down
4 changes: 2 additions & 2 deletions contracts/utils/math/Math.sol
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ library Math {
}

/**
* @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.
* @dev Branchless ternary evaluation for `condition ? a : b`. Gas costs are constant.
*
* IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.
* However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute
* However, the compiler may optimize Solidity ternary operations (i.e. `condition ? a : b`) to only compute
* one branch when needed, making this function more expensive.
*/
function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {
Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/structs/CircularBuffer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {Panic} from "../Panic.sol";
* - inclusion ({includes}): O(N) (worst case)
* - reset ({clear}): O(1)
*
* * The struct is called `Bytes32CircularBuffer`. Other types can be cast to and from `bytes32`. This data structure
* The struct is called `Bytes32CircularBuffer`. Other types can be cast to and from `bytes32`. This data structure
* can only be used in storage, and not in memory.
*
* Example usage:
Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/types/Time.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ library Time {
// ==================================================== Delay =====================================================
/**
* @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the
* future. The "effect" timepoint describes when the transitions happens from the "old" value to the "new" value.
* future. The "effect" timepoint describes when the transition happens from the "old" value to the "new" value.
* This allows updating the delay applied to some operation while keeping some guarantees.
*
* In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for
Expand Down
Loading
Loading