Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🥢 Fix typos #1382

Merged
merged 2 commits into from
Mar 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 2 deletions docs/utils/datetimelib.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ function diffYears(uint256 fromTimestamp, uint256 toTimestamp)
Returns the difference in Gregorian calendar years
between `fromTimestamp` and `toTimestamp`.
Note: Even if the true time difference is less than a year,
the difference can be non-zero is the timestamps are
the difference can be non-zero if the timestamps are
from different Gregorian calendar years

### diffMonths(uint256,uint256)
Expand All @@ -419,7 +419,7 @@ function diffMonths(uint256 fromTimestamp, uint256 toTimestamp)
Returns the difference in Gregorian calendar months
between `fromTimestamp` and `toTimestamp`.
Note: Even if the true time difference is less than a month,
the difference can be non-zero is the timestamps are
the difference can be non-zero if the timestamps are
from different Gregorian calendar months.

### diffDays(uint256,uint256)
Expand Down
4 changes: 2 additions & 2 deletions docs/utils/dynamicarraylib.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The constant returned when the element is not found in the array.

Low level minimalist uint256 array operations.
If you don't need syntax sugar, it's recommended to use these.
Some of these functions returns the same array for function chaining.
Some of these functions return the same array for function chaining.
e.g. `array.set(0, 1).set(1, 2)`.

### malloc(uint256)
Expand Down Expand Up @@ -360,7 +360,7 @@ Directly returns `a` without copying.

## Dynamic Array Operations

Some of these functions returns the same array for function chaining.
Some of these functions return the same array for function chaining.
e.g. `a.p("1").p("2")`.

### length(DynamicArray)
Expand Down
2 changes: 1 addition & 1 deletion docs/utils/dynamicbufferlib.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ take care of the memory allocation.

## Operations

Some of these functions returns the same buffer for function chaining.
Some of these functions return the same buffer for function chaining.
e.g. `buffer.p("1").p("2")`.

### length(DynamicBuffer)
Expand Down
2 changes: 1 addition & 1 deletion docs/utils/ecdsa.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Note: Supports lengths of `s` up to 999999 bytes.

## Canonical Hash Functions

The following functions returns the hash of the signature in it's canonicalized format,
The following functions return the hash of the signature in its canonicalized format,
which is the 65-byte `abi.encodePacked(r, s, uint8(v))`, where `v` is either 27 or 28.
If `s` is greater than `N / 2` then it will be converted to `N - s`
and the `v` value will be flipped.
Expand Down
18 changes: 9 additions & 9 deletions docs/utils/enumerablemaplib.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct Bytes32ToBytes32Map {
}
```

A enumerable map of `bytes32` to `bytes32`.
An enumerable map of `bytes32` to `bytes32`.

### Bytes32ToUint256Map

Expand All @@ -41,7 +41,7 @@ struct Bytes32ToUint256Map {
}
```

A enumerable map of `bytes32` to `uint256`.
An enumerable map of `bytes32` to `uint256`.

### Bytes32ToAddressMap

Expand All @@ -52,7 +52,7 @@ struct Bytes32ToAddressMap {
}
```

A enumerable map of `bytes32` to `address`.
An enumerable map of `bytes32` to `address`.

### Uint256ToBytes32Map

Expand All @@ -63,7 +63,7 @@ struct Uint256ToBytes32Map {
}
```

A enumerable map of `uint256` to `bytes32`.
An enumerable map of `uint256` to `bytes32`.

### Uint256ToUint256Map

Expand All @@ -74,7 +74,7 @@ struct Uint256ToUint256Map {
}
```

A enumerable map of `uint256` to `uint256`.
An enumerable map of `uint256` to `uint256`.

### Uint256ToAddressMap

Expand All @@ -85,7 +85,7 @@ struct Uint256ToAddressMap {
}
```

A enumerable map of `uint256` to `address`.
An enumerable map of `uint256` to `address`.

### AddressToBytes32Map

Expand All @@ -96,7 +96,7 @@ struct AddressToBytes32Map {
}
```

A enumerable map of `address` to `bytes32`.
An enumerable map of `address` to `bytes32`.

### AddressToUint256Map

Expand All @@ -107,7 +107,7 @@ struct AddressToUint256Map {
}
```

A enumerable map of `address` to `uint256`.
An enumerable map of `address` to `uint256`.

### AddressToAddressMap

Expand All @@ -118,7 +118,7 @@ struct AddressToAddressMap {
}
```

A enumerable map of `address` to `address`.
An enumerable map of `address` to `address`.

## Getters / Setters

Expand Down
8 changes: 4 additions & 4 deletions docs/utils/libsort.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,31 +97,31 @@ array is not sorted -- it will simply remove consecutive duplicate elements.
function uniquifySorted(uint256[] memory a) internal pure
```

Removes duplicate elements from a ascendingly sorted memory array.
Removes duplicate elements from an ascendingly sorted memory array.

### uniquifySorted(int256[])

```solidity
function uniquifySorted(int256[] memory a) internal pure
```

Removes duplicate elements from a ascendingly sorted memory array.
Removes duplicate elements from an ascendingly sorted memory array.

### uniquifySorted(address[])

```solidity
function uniquifySorted(address[] memory a) internal pure
```

Removes duplicate elements from a ascendingly sorted memory array.
Removes duplicate elements from an ascendingly sorted memory array.

### uniquifySorted(bytes32[])

```solidity
function uniquifySorted(bytes32[] memory a) internal pure
```

Removes duplicate elements from a ascendingly sorted memory array.
Removes duplicate elements from an ascendingly sorted memory array.

### searchSorted(uint256[],uint256)

Expand Down
2 changes: 1 addition & 1 deletion prep/gen-enumerable-map-lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function main() {
const crossForEach = (a, fn) => a.forEach(x => a.forEach(y => fn(x, y)));

const genStructDef = (f, t) => {
return '/// @dev A enumerable map of `' + f + '` to `' + t + '`.\n' +
return '/// @dev An enumerable map of `' + f + '` to `' + t + '`.\n' +
'struct ' + mapType(f, t) + '{\n' +
'EnumerableSetLib.' + capitalize(f) + 'Set _keys;\n' +
'mapping(' + f + ' => ' + t + ') _values;\n}\n\n';
Expand Down
6 changes: 3 additions & 3 deletions src/utils/DynamicArrayLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ library DynamicArrayLib {

// Low level minimalist uint256 array operations.
// If you don't need syntax sugar, it's recommended to use these.
// Some of these functions returns the same array for function chaining.
// Some of these functions return the same array for function chaining.
// e.g. `array.set(0, 1).set(1, 2)`.

/// @dev Returns a uint256 array with `n` elements. The elements are not zeroized.
Expand Down Expand Up @@ -359,7 +359,7 @@ library DynamicArrayLib {
/* DYNAMIC ARRAY OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

// Some of these functions returns the same array for function chaining.
// Some of these functions return the same array for function chaining.
// e.g. `a.p("1").p("2")`.

/// @dev Shorthand for `a.data.length`.
Expand Down Expand Up @@ -1002,7 +1002,7 @@ library DynamicArrayLib {
/* PRIVATE HELPERS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

/// @dev Helper for deallocating a automatically allocated array pointer.
/// @dev Helper for deallocating an automatically allocated array pointer.
function _deallocate(DynamicArray memory result) private pure {
/// @solidity memory-safe-assembly
assembly {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/DynamicBufferLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ library DynamicBufferLib {
/* OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

// Some of these functions returns the same buffer for function chaining.
// Some of these functions return the same buffer for function chaining.
// e.g. `buffer.p("1").p("2")`.

/// @dev Shorthand for `buffer.data.length`.
Expand Down Expand Up @@ -1283,7 +1283,7 @@ library DynamicBufferLib {
/* PRIVATE HELPERS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

/// @dev Helper for deallocating a automatically allocated `buffer` pointer.
/// @dev Helper for deallocating an automatically allocated `buffer` pointer.
function _deallocate(DynamicBuffer memory result) private pure {
/// @solidity memory-safe-assembly
assembly {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/ECDSA.sol
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ library ECDSA {
/* CANONICAL HASH FUNCTIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

// The following functions returns the hash of the signature in it's canonicalized format,
// The following functions return the hash of the signature in its canonicalized format,
// which is the 65-byte `abi.encodePacked(r, s, uint8(v))`, where `v` is either 27 or 28.
// If `s` is greater than `N / 2` then it will be converted to `N - s`
// and the `v` value will be flipped.
Expand Down
18 changes: 9 additions & 9 deletions src/utils/EnumerableMapLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,55 +18,55 @@ library EnumerableMapLib {
/* STRUCTS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

/// @dev A enumerable map of `bytes32` to `bytes32`.
/// @dev An enumerable map of `bytes32` to `bytes32`.
struct Bytes32ToBytes32Map {
EnumerableSetLib.Bytes32Set _keys;
mapping(bytes32 => bytes32) _values;
}

/// @dev A enumerable map of `bytes32` to `uint256`.
/// @dev An enumerable map of `bytes32` to `uint256`.
struct Bytes32ToUint256Map {
EnumerableSetLib.Bytes32Set _keys;
mapping(bytes32 => uint256) _values;
}

/// @dev A enumerable map of `bytes32` to `address`.
/// @dev An enumerable map of `bytes32` to `address`.
struct Bytes32ToAddressMap {
EnumerableSetLib.Bytes32Set _keys;
mapping(bytes32 => address) _values;
}

/// @dev A enumerable map of `uint256` to `bytes32`.
/// @dev An enumerable map of `uint256` to `bytes32`.
struct Uint256ToBytes32Map {
EnumerableSetLib.Uint256Set _keys;
mapping(uint256 => bytes32) _values;
}

/// @dev A enumerable map of `uint256` to `uint256`.
/// @dev An enumerable map of `uint256` to `uint256`.
struct Uint256ToUint256Map {
EnumerableSetLib.Uint256Set _keys;
mapping(uint256 => uint256) _values;
}

/// @dev A enumerable map of `uint256` to `address`.
/// @dev An enumerable map of `uint256` to `address`.
struct Uint256ToAddressMap {
EnumerableSetLib.Uint256Set _keys;
mapping(uint256 => address) _values;
}

/// @dev A enumerable map of `address` to `bytes32`.
/// @dev An enumerable map of `address` to `bytes32`.
struct AddressToBytes32Map {
EnumerableSetLib.AddressSet _keys;
mapping(address => bytes32) _values;
}

/// @dev A enumerable map of `address` to `uint256`.
/// @dev An enumerable map of `address` to `uint256`.
struct AddressToUint256Map {
EnumerableSetLib.AddressSet _keys;
mapping(address => uint256) _values;
}

/// @dev A enumerable map of `address` to `address`.
/// @dev An enumerable map of `address` to `address`.
struct AddressToAddressMap {
EnumerableSetLib.AddressSet _keys;
mapping(address => address) _values;
Expand Down
10 changes: 5 additions & 5 deletions src/utils/Initializable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ abstract contract Initializable {
event Initialized(uint64 version);

/// @dev `keccak256(bytes("Initialized(uint64)"))`.
bytes32 private constant _INTIALIZED_EVENT_SIGNATURE =
bytes32 private constant _INITIALIZED_EVENT_SIGNATURE =
0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2;

/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
Expand Down Expand Up @@ -93,12 +93,12 @@ abstract contract Initializable {
sstore(s, 2)
// Emit the {Initialized} event.
mstore(0x20, 1)
log1(0x20, 0x20, _INTIALIZED_EVENT_SIGNATURE)
log1(0x20, 0x20, _INITIALIZED_EVENT_SIGNATURE)
}
}
}

/// @dev Guards a reinitialzer function so that it can be invoked at most once.
/// @dev Guards a reinitializer function so that it can be invoked at most once.
///
/// You can guard a function with `onlyInitializing` such that it can be called
/// through a function guarded with `reinitializer`.
Expand Down Expand Up @@ -126,7 +126,7 @@ abstract contract Initializable {
sstore(s, version)
// Emit the {Initialized} event.
mstore(0x20, shr(1, version))
log1(0x20, 0x20, _INTIALIZED_EVENT_SIGNATURE)
log1(0x20, 0x20, _INITIALIZED_EVENT_SIGNATURE)
}
}

Expand Down Expand Up @@ -171,7 +171,7 @@ abstract contract Initializable {
sstore(s, shl(1, uint64max))
// Emit the {Initialized} event.
mstore(0x20, uint64max)
log1(0x20, 0x20, _INTIALIZED_EVENT_SIGNATURE)
log1(0x20, 0x20, _INITIALIZED_EVENT_SIGNATURE)
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/utils/g/DynamicArrayLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ library DynamicArrayLib {

// Low level minimalist uint256 array operations.
// If you don't need syntax sugar, it's recommended to use these.
// Some of these functions returns the same array for function chaining.
// Some of these functions return the same array for function chaining.
// e.g. `array.set(0, 1).set(1, 2)`.

/// @dev Returns a uint256 array with `n` elements. The elements are not zeroized.
Expand Down Expand Up @@ -363,7 +363,7 @@ library DynamicArrayLib {
/* DYNAMIC ARRAY OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

// Some of these functions returns the same array for function chaining.
// Some of these functions return the same array for function chaining.
// e.g. `a.p("1").p("2")`.

/// @dev Shorthand for `a.data.length`.
Expand Down Expand Up @@ -1006,7 +1006,7 @@ library DynamicArrayLib {
/* PRIVATE HELPERS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

/// @dev Helper for deallocating a automatically allocated array pointer.
/// @dev Helper for deallocating an automatically allocated array pointer.
function _deallocate(DynamicArray memory result) private pure {
/// @solidity memory-safe-assembly
assembly {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/g/DynamicBufferLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ library DynamicBufferLib {
/* OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

// Some of these functions returns the same buffer for function chaining.
// Some of these functions return the same buffer for function chaining.
// e.g. `buffer.p("1").p("2")`.

/// @dev Shorthand for `buffer.data.length`.
Expand Down
Loading
Loading