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 typographical errors #5171

Merged
merged 1 commit into from
Aug 29, 2024
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
2 changes: 1 addition & 1 deletion contracts/access/manager/AccessManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ contract AccessManager is Context, Multicall, IAccessManager {

(bool adminRestricted, uint64 roleId, uint32 operationDelay) = _getAdminRestrictions(data);

// isTragetClosed apply to non-admin-restricted function
// isTargetClosed apply to non-admin-restricted function
if (!adminRestricted && isTargetClosed(address(this))) {
return (false, 0);
}
Expand Down
12 changes: 6 additions & 6 deletions contracts/utils/StorageSlot.sol
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ library StorageSlot {
}

/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
* @dev Returns a `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
/// @solidity memory-safe-assembly
Expand All @@ -99,7 +99,7 @@ library StorageSlot {
}

/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
* @dev Returns a `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
/// @solidity memory-safe-assembly
Expand All @@ -109,7 +109,7 @@ library StorageSlot {
}

/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
* @dev Returns a `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
/// @solidity memory-safe-assembly
Expand All @@ -119,7 +119,7 @@ library StorageSlot {
}

/**
* @dev Returns an `Int256Slot` with member `value` located at `slot`.
* @dev Returns a `Int256Slot` with member `value` located at `slot`.
*/
function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {
/// @solidity memory-safe-assembly
Expand All @@ -129,7 +129,7 @@ library StorageSlot {
}

/**
* @dev Returns an `StringSlot` with member `value` located at `slot`.
* @dev Returns a `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
Expand All @@ -149,7 +149,7 @@ library StorageSlot {
}

/**
* @dev Returns an `BytesSlot` with member `value` located at `slot`.
* @dev Returns a `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/math/Math.sol
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ library Math {
/**
* @dev Calculate the modular multiplicative inverse of a number in Z/nZ.
*
* If n is a prime, then Z/nZ is a field. In that case all elements are inversible, expect 0.
* If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.
* If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.
*
* If the input value is not inversible, 0 is returned.
Expand Down
4 changes: 2 additions & 2 deletions contracts/utils/math/SignedMath.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ library SignedMath {
// Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,
// taking advantage of the most significant (or "sign" bit) in two's complement representation.
// This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,
// the mask will either be `bytes(0)` (if n is positive) or `~bytes32(0)` (if n is negative).
// the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).
int256 mask = n >> 255;

// A `bytes(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.
// A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.
return uint256((n + mask) ^ mask);
}
}
Expand Down
4 changes: 3 additions & 1 deletion scripts/generate/templates/StorageSlot.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ struct ${name}Slot {

const get = ({ name }) => `\
/**
* @dev Returns an \`${name}Slot\` with member \`value\` located at \`slot\`.
* @dev Returns ${
name.toLowerCase().startsWith('a') ? 'an' : 'a'
} \`${name}Slot\` with member \`value\` located at \`slot\`.
*/
function get${name}Slot(bytes32 slot) internal pure returns (${name}Slot storage r) {
/// @solidity memory-safe-assembly
Expand Down