Sfoglia il codice sorgente

Fix typographical errors & comments (#4595)

Co-authored-by: Francisco <fg@frang.io>
Hadrien Croubois 2 anni fa
parent
commit
63851f8de5

+ 1 - 1
contracts/governance/Governor.sol

@@ -16,7 +16,7 @@ import {Nonces} from "../utils/Nonces.sol";
 import {IGovernor, IERC6372} from "./IGovernor.sol";
 
 /**
- * @dev Core of the governance system, designed to be extended though various modules.
+ * @dev Core of the governance system, designed to be extended through various modules.
  *
  * This contract is abstract and requires several functions to be implemented in various modules:
  *

+ 1 - 1
contracts/governance/TimelockController.sol

@@ -164,7 +164,7 @@ contract TimelockController is AccessControl, ERC721Holder, ERC1155Holder {
     }
 
     /**
-     * @dev Returns whether an id correspond to a registered operation. This
+     * @dev Returns whether an id corresponds to a registered operation. This
      * includes both Pending, Ready and Done operations.
      */
     function isOperation(bytes32 id) public view returns (bool) {

+ 1 - 1
contracts/governance/extensions/GovernorTimelockAccess.sol

@@ -35,7 +35,7 @@ abstract contract GovernorTimelockAccess is Governor {
         // storing the length redundantly.
         // We pack 8 operations' data in each bucket. Each uint32 value is set to 1 upon proposal creation if it has
         // to be scheduled and executed through the manager. Upon queuing, the value is set to nonce + 1, where the
-        // nonce is that which we get back from the manager when scheduling the operation.
+        // nonce is received from the manager when scheduling the operation.
         mapping(uint256 operationBucket => uint32[8]) managerData;
     }
 

+ 4 - 4
contracts/governance/extensions/GovernorTimelockControl.sol

@@ -17,10 +17,10 @@ import {SafeCast} from "../../utils/math/SafeCast.sol";
  * the assets and permissions must be attached to the {TimelockController}. Any asset sent to the {Governor} will be
  * inaccessible.
  *
- * WARNING: Setting up the TimelockController to have additional proposers besides the governor is very risky, as it
- * grants them powers that they must be trusted or known not to use: 1) {onlyGovernance} functions like {relay} are
- * available to them through the timelock, and 2) approved governance proposals can be blocked by them, effectively
- * executing a Denial of Service attack. This risk will be mitigated in a future release.
+ * WARNING: Setting up the TimelockController to have additional proposers or cancellers besides the governor is very
+ * risky, as it grants them the ability to: 1) execute operations as the timelock, and thus possibly performing
+ * operations or accessing funds that are expected to only be accessible through a vote, and 2) block governance
+ * proposals that have been approved by the voters, effectively executing a Denial of Service attack.
  */
 abstract contract GovernorTimelockControl is Governor {
     TimelockController private _timelock;

+ 1 - 1
contracts/utils/Nonces.sol

@@ -13,7 +13,7 @@ abstract contract Nonces {
     mapping(address account => uint256) private _nonces;
 
     /**
-     * @dev Returns an the next unused nonce for an address.
+     * @dev Returns the next unused nonce for an address.
      */
     function nonces(address owner) public view virtual returns (uint256) {
         return _nonces[owner];

+ 9 - 9
contracts/utils/cryptography/MerkleProof.sol

@@ -13,8 +13,8 @@ pragma solidity ^0.8.20;
  * WARNING: You should avoid using leaf values that are 64 bytes long prior to
  * hashing, or use a hash function other than keccak256 for hashing leaves.
  * This is because the concatenation of a sorted pair of internal nodes in
- * the merkle tree could be reinterpreted as a leaf value.
- * OpenZeppelin's JavaScript library generates merkle trees that are safe
+ * the Merkle tree could be reinterpreted as a leaf value.
+ * OpenZeppelin's JavaScript library generates Merkle trees that are safe
  * against this attack out of the box.
  */
 library MerkleProof {
@@ -66,10 +66,10 @@ library MerkleProof {
     }
 
     /**
-     * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by
+     * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
      * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
      *
-     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
+     * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
      */
     function multiProofVerify(
         bytes32[] memory proof,
@@ -83,7 +83,7 @@ library MerkleProof {
     /**
      * @dev Calldata version of {multiProofVerify}
      *
-     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
+     * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
      */
     function multiProofVerifyCalldata(
         bytes32[] calldata proof,
@@ -100,7 +100,7 @@ library MerkleProof {
      * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
      * respectively.
      *
-     * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
+     * CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
      * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
      * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
      */
@@ -112,7 +112,7 @@ library MerkleProof {
         // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
         // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
         // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
-        // the merkle tree.
+        // the Merkle tree.
         uint256 leavesLen = leaves.length;
         uint256 proofLen = proof.length;
         uint256 totalHashes = proofFlags.length;
@@ -158,7 +158,7 @@ library MerkleProof {
     /**
      * @dev Calldata version of {processMultiProof}.
      *
-     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
+     * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
      */
     function processMultiProofCalldata(
         bytes32[] calldata proof,
@@ -168,7 +168,7 @@ library MerkleProof {
         // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
         // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
         // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
-        // the merkle tree.
+        // the Merkle tree.
         uint256 leavesLen = leaves.length;
         uint256 proofLen = proof.length;
         uint256 totalHashes = proofFlags.length;