Skip to content

Commit 6e22430

Browse files
authored
Fix typographical errors (#5194)
1 parent cae60c5 commit 6e22430

File tree

9 files changed

+29
-29
lines changed

9 files changed

+29
-29
lines changed

contracts/interfaces/IERC1363Receiver.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface IERC1363Receiver {
1818
* (i.e. 0x88a7ca5c, or its own function selector).
1919
*
2020
* @param operator The address which called `transferAndCall` or `transferFromAndCall` function.
21-
* @param from The address which are tokens transferred from.
21+
* @param from The address which the tokens are transferred from.
2222
* @param value The amount of tokens transferred.
2323
* @param data Additional data with no specified format.
2424
* @return `bytes4(keccak256("onTransferReceived(address,address,uint256,bytes)"))` if transfer is allowed unless throwing.

contracts/token/ERC1155/utils/ERC1155Utils.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ library ERC1155Utils {
1515
* @dev Performs an acceptance check for the provided `operator` by calling {IERC1155-onERC1155Received}
1616
* on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).
1717
*
18-
* The acceptance call is not executed and treated as a no-op if the target address is doesn't contain code (i.e. an EOA).
18+
* The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).
1919
* Otherwise, the recipient must implement {IERC1155Receiver-onERC1155Received} and return the acceptance magic value to accept
2020
* the transfer.
2121
*/
@@ -50,7 +50,7 @@ library ERC1155Utils {
5050
* @dev Performs a batch acceptance check for the provided `operator` by calling {IERC1155-onERC1155BatchReceived}
5151
* on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).
5252
*
53-
* The acceptance call is not executed and treated as a no-op if the target address is doesn't contain code (i.e. an EOA).
53+
* The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).
5454
* Otherwise, the recipient must implement {IERC1155Receiver-onERC1155Received} and return the acceptance magic value to accept
5555
* the transfer.
5656
*/

contracts/utils/cryptography/MerkleProof.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ library MerkleProof {
5050
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
5151
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
5252
* hash matches the root of the tree. When processing the proof, the pairs
53-
* of leafs & pre-images are assumed to be sorted.
53+
* of leaves & pre-images are assumed to be sorted.
5454
*
5555
* This version handles proofs in memory with the default hashing function.
5656
*/
@@ -83,7 +83,7 @@ library MerkleProof {
8383
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
8484
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
8585
* hash matches the root of the tree. When processing the proof, the pairs
86-
* of leafs & pre-images are assumed to be sorted.
86+
* of leaves & pre-images are assumed to be sorted.
8787
*
8888
* This version handles proofs in memory with a custom hashing function.
8989
*/
@@ -115,7 +115,7 @@ library MerkleProof {
115115
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
116116
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
117117
* hash matches the root of the tree. When processing the proof, the pairs
118-
* of leafs & pre-images are assumed to be sorted.
118+
* of leaves & pre-images are assumed to be sorted.
119119
*
120120
* This version handles proofs in calldata with the default hashing function.
121121
*/
@@ -148,7 +148,7 @@ library MerkleProof {
148148
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
149149
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
150150
* hash matches the root of the tree. When processing the proof, the pairs
151-
* of leafs & pre-images are assumed to be sorted.
151+
* of leaves & pre-images are assumed to be sorted.
152152
*
153153
* This version handles proofs in calldata with a custom hashing function.
154154
*/

contracts/utils/cryptography/RSA.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {Math} from "../math/Math.sol";
88
*
99
* This library supports PKCS#1 v1.5 padding to avoid malleability via chosen plaintext attacks in practical implementations.
1010
* The padding follows the EMSA-PKCS1-v1_5-ENCODE encoding definition as per section 9.2 of the RFC. This padding makes
11-
* RSA semanticaly secure for signing messages.
11+
* RSA semantically secure for signing messages.
1212
*
1313
* Inspired by https://github.com/adria0/SolRsaVerify[Adrià Massanet's work]
1414
*/
@@ -26,7 +26,7 @@ library RSA {
2626
}
2727

2828
/**
29-
* @dev Verifies a PKCSv1.5 signature given a digest according the verification
29+
* @dev Verifies a PKCSv1.5 signature given a digest according to the verification
3030
* method described in https://datatracker.ietf.org/doc/html/rfc8017#section-8.2.2[section 8.2.2 of RFC8017].
3131
*
3232
* IMPORTANT: Although this function allows for it, using n of length 1024 bits is considered unsafe.
@@ -136,7 +136,7 @@ library RSA {
136136

137137
/// @dev Reads a bytes32 from a bytes array without bounds checking.
138138
function _unsafeReadBytes32(bytes memory array, uint256 offset) private pure returns (bytes32 result) {
139-
// Memory safetiness is guaranteed as long as the provided `array` is a Solidity-allocated bytes array
139+
// Memory safeness is guaranteed as long as the provided `array` is a Solidity-allocated bytes array
140140
// and `offset` is within bounds. This is the case for all calls to this private function from {pkcs1}.
141141
assembly ("memory-safe") {
142142
result := mload(add(add(array, 0x20), offset))

contracts/utils/structs/CircularBuffer.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ library CircularBuffer {
9191
}
9292

9393
/**
94-
* @dev Length of the buffer. This is the maximum number of elements kepts in the buffer.
94+
* @dev Length of the buffer. This is the maximum number of elements kept in the buffer.
9595
*/
9696
function length(Bytes32CircularBuffer storage self) internal view returns (uint256) {
9797
return self._data.length;

contracts/utils/structs/Heap.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ library Heap {
4343
using SafeCast for *;
4444

4545
/**
46-
* @dev Binary heap that support values of type uint256.
46+
* @dev Binary heap that supports values of type uint256.
4747
*
4848
* Each element of that structure uses 2 storage slots.
4949
*/
@@ -235,7 +235,7 @@ library Heap {
235235

236236
/**
237237
* @dev Perform heap maintenance on `self`, starting at position `pos` (with the `value`), using `comp` as a
238-
* comparator, and moving toward the leafs of the underlying tree.
238+
* comparator, and moving toward the leaves of the underlying tree.
239239
*
240240
* NOTE: This is a private function that is called in a trusted context with already cached parameters. `length`
241241
* and `value` could be extracted from `self` and `pos`, but that would require redundant storage read. These
@@ -309,7 +309,7 @@ library Heap {
309309
}
310310

311311
/**
312-
* @dev Binary heap that support values of type uint208.
312+
* @dev Binary heap that supports values of type uint208.
313313
*
314314
* Each element of that structure uses 1 storage slots.
315315
*/
@@ -501,7 +501,7 @@ library Heap {
501501

502502
/**
503503
* @dev Perform heap maintenance on `self`, starting at position `pos` (with the `value`), using `comp` as a
504-
* comparator, and moving toward the leafs of the underlying tree.
504+
* comparator, and moving toward the leaves of the underlying tree.
505505
*
506506
* NOTE: This is a private function that is called in a trusted context with already cached parameters. `length`
507507
* and `value` could be extracted from `self` and `pos`, but that would require redundant storage read. These

scripts/generate/templates/Heap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import {Panic} from "../Panic.sol";
4545

4646
const generate = ({ struct, node, valueType, indexType, blockSize }) => `\
4747
/**
48-
* @dev Binary heap that support values of type ${valueType}.
48+
* @dev Binary heap that supports values of type ${valueType}.
4949
*
5050
* Each element of that structure uses ${blockSize} storage slots.
5151
*/
@@ -237,7 +237,7 @@ function _swap(${struct} storage self, ${indexType} i, ${indexType} j) private {
237237
238238
/**
239239
* @dev Perform heap maintenance on \`self\`, starting at position \`pos\` (with the \`value\`), using \`comp\` as a
240-
* comparator, and moving toward the leafs of the underlying tree.
240+
* comparator, and moving toward the leaves of the underlying tree.
241241
*
242242
* NOTE: This is a private function that is called in a trusted context with already cached parameters. \`length\`
243243
* and \`value\` could be extracted from \`self\` and \`pos\`, but that would require redundant storage read. These

scripts/generate/templates/MerkleProof.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function verify${suffix}(${(hash ? formatArgsMultiline : formatArgsSingleLine)(
6666
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
6767
* from \`leaf\` using \`proof\`. A \`proof\` is valid if and only if the rebuilt
6868
* hash matches the root of the tree. When processing the proof, the pairs
69-
* of leafs & pre-images are assumed to be sorted.
69+
* of leaves & pre-images are assumed to be sorted.
7070
*
7171
* This version handles proofs in ${location} with ${hash ? 'a custom' : 'the default'} hashing function.
7272
*/

test/utils/structs/MerkleTree.test.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ const { StandardMerkleTree } = require('@openzeppelin/merkle-tree');
66

77
const { generators } = require('../../helpers/random');
88

9-
const makeTree = (leafs = [ethers.ZeroHash]) =>
9+
const makeTree = (leaves = [ethers.ZeroHash]) =>
1010
StandardMerkleTree.of(
11-
leafs.map(leaf => [leaf]),
11+
leaves.map(leaf => [leaf]),
1212
['bytes32'],
1313
{ sortLeaves: false },
1414
);
@@ -39,15 +39,15 @@ describe('MerkleTree', function () {
3939

4040
describe('push', function () {
4141
it('tree is correctly updated', async function () {
42-
const leafs = Array.from({ length: 2 ** Number(DEPTH) }, () => ethers.ZeroHash);
42+
const leaves = Array.from({ length: 2 ** Number(DEPTH) }, () => ethers.ZeroHash);
4343

4444
// for each leaf slot
45-
for (const i in leafs) {
45+
for (const i in leaves) {
4646
// generate random leaf and hash it
47-
const hashedLeaf = hashLeaf((leafs[i] = generators.bytes32()));
47+
const hashedLeaf = hashLeaf((leaves[i] = generators.bytes32()));
4848

4949
// update leaf list and rebuild tree.
50-
const tree = makeTree(leafs);
50+
const tree = makeTree(leaves);
5151

5252
// push value to tree
5353
await expect(this.mock.push(hashedLeaf)).to.emit(this.mock, 'LeafInserted').withArgs(hashedLeaf, i, tree.root);
@@ -67,13 +67,13 @@ describe('MerkleTree', function () {
6767

6868
it('reset', async function () {
6969
// empty tree
70-
const zeroLeafs = Array.from({ length: 2 ** Number(DEPTH) }, () => ethers.ZeroHash);
71-
const zeroTree = makeTree(zeroLeafs);
70+
const zeroLeaves = Array.from({ length: 2 ** Number(DEPTH) }, () => ethers.ZeroHash);
71+
const zeroTree = makeTree(zeroLeaves);
7272

7373
// tree with one element
74-
const leafs = Array.from({ length: 2 ** Number(DEPTH) }, () => ethers.ZeroHash);
75-
const hashedLeaf = hashLeaf((leafs[0] = generators.bytes32())); // fill first leaf and hash it
76-
const tree = makeTree(leafs);
74+
const leaves = Array.from({ length: 2 ** Number(DEPTH) }, () => ethers.ZeroHash);
75+
const hashedLeaf = hashLeaf((leaves[0] = generators.bytes32())); // fill first leaf and hash it
76+
const tree = makeTree(leaves);
7777

7878
// root should be that of a zero tree
7979
expect(await this.mock.root()).to.equal(zeroTree.root);

0 commit comments

Comments
 (0)