Browse Source

Merge branch 'master' into typo-fixes

Arr00 5 months ago
parent
commit
a7fb048a50
100 changed files with 272 additions and 476 deletions
  1. 0 5
      .changeset/blue-nails-give.md
  2. 0 5
      .changeset/brave-islands-sparkle.md
  3. 0 5
      .changeset/brown-seals-sing.md
  4. 0 5
      .changeset/brown-turkeys-marry.md
  5. 0 5
      .changeset/cyan-taxis-travel.md
  6. 0 5
      .changeset/dirty-bananas-shake.md
  7. 0 5
      .changeset/fair-pumpkins-compete.md
  8. 0 5
      .changeset/famous-timers-compare.md
  9. 0 5
      .changeset/fast-coats-try.md
  10. 0 5
      .changeset/fuzzy-crews-poke.md
  11. 0 5
      .changeset/good-cameras-rush.md
  12. 0 5
      .changeset/good-cameras-serve.md
  13. 0 5
      .changeset/good-zebras-ring.md
  14. 0 5
      .changeset/gorgeous-apes-jam.md
  15. 0 5
      .changeset/green-drinks-report.md
  16. 0 5
      .changeset/long-walls-draw.md
  17. 5 0
      .changeset/lucky-donuts-scream.md
  18. 0 5
      .changeset/mighty-melons-cheer.md
  19. 0 5
      .changeset/nice-cherries-reply.md
  20. 0 5
      .changeset/ninety-rings-suffer.md
  21. 0 5
      .changeset/pretty-lobsters-tan.md
  22. 0 5
      .changeset/proud-cooks-do.md
  23. 5 0
      .changeset/proud-tables-sip.md
  24. 0 5
      .changeset/quiet-shrimps-kiss.md
  25. 0 5
      .changeset/seven-insects-taste.md
  26. 0 5
      .changeset/sixty-tips-wink.md
  27. 0 5
      .changeset/ten-fishes-fold.md
  28. 0 5
      .changeset/ten-hats-begin.md
  29. 0 5
      .changeset/ten-peas-mix.md
  30. 0 5
      .changeset/thin-eels-cross.md
  31. 5 0
      .changeset/wet-dodos-reply.md
  32. 2 1
      .github/actions/setup/action.yml
  33. 3 1
      .github/workflows/checks.yml
  34. 2 0
      .github/workflows/release-cycle.yml
  35. 50 1
      CHANGELOG.md
  36. 3 5
      contracts/access/AccessControl.sol
  37. 1 1
      contracts/access/IAccessControl.sol
  38. 14 39
      contracts/access/extensions/AccessControlDefaultAdminRules.sol
  39. 2 3
      contracts/access/extensions/AccessControlEnumerable.sol
  40. 0 1
      contracts/access/manager/AccessManaged.sol
  41. 5 1
      contracts/access/manager/AuthorityUtils.sol
  42. 0 2
      contracts/access/manager/IAccessManager.sol
  43. 1 1
      contracts/account/utils/draft-ERC4337Utils.sol
  44. 2 2
      contracts/account/utils/draft-ERC7579Utils.sol
  45. 1 1
      contracts/finance/VestingWallet.sol
  46. 28 80
      contracts/governance/Governor.sol
  47. 1 1
      contracts/governance/IGovernor.sol
  48. 3 4
      contracts/governance/TimelockController.sol
  49. 5 11
      contracts/governance/extensions/GovernorCountingFractional.sol
  50. 4 7
      contracts/governance/extensions/GovernorCountingOverridable.sol
  51. 4 10
      contracts/governance/extensions/GovernorCountingSimple.sol
  52. 1 0
      contracts/governance/extensions/GovernorProposalGuardian.sol
  53. 3 4
      contracts/governance/extensions/GovernorSequentialProposalId.sol
  54. 4 10
      contracts/governance/extensions/GovernorSettings.sol
  55. 1 1
      contracts/governance/extensions/GovernorStorage.sol
  56. 1 2
      contracts/governance/extensions/GovernorSuperQuorum.sol
  57. 8 11
      contracts/governance/extensions/GovernorTimelockAccess.sol
  58. 2 4
      contracts/governance/extensions/GovernorTimelockCompound.sol
  59. 2 5
      contracts/governance/extensions/GovernorTimelockControl.sol
  60. 0 1
      contracts/governance/extensions/GovernorVotes.sol
  61. 1 1
      contracts/governance/extensions/GovernorVotesQuorumFraction.sol
  62. 2 0
      contracts/governance/extensions/GovernorVotesSuperQuorumFraction.sol
  63. 1 1
      contracts/interfaces/IERC1271.sol
  64. 1 1
      contracts/interfaces/IERC4626.sol
  65. 1 1
      contracts/interfaces/draft-IERC4337.sol
  66. 3 1
      contracts/interfaces/draft-IERC6909.sol
  67. 1 1
      contracts/interfaces/draft-IERC7579.sol
  68. 1 1
      contracts/metatx/ERC2771Forwarder.sol
  69. 0 1
      contracts/mocks/AccessManagerMock.sol
  70. 5 5
      contracts/mocks/AuthorityMock.sol
  71. 1 0
      contracts/mocks/Stateless.sol
  72. 0 17
      contracts/mocks/docs/access-control/AccessControlNonRevokableAdmin.sol
  73. 1 2
      contracts/mocks/docs/governance/MyGovernor.sol
  74. 1 1
      contracts/mocks/governance/GovernorCountingOverridableMock.sol
  75. 1 1
      contracts/mocks/governance/GovernorStorageMock.sol
  76. 1 1
      contracts/mocks/governance/GovernorTimelockAccessMock.sol
  77. 1 1
      contracts/mocks/governance/GovernorTimelockCompoundMock.sol
  78. 1 1
      contracts/mocks/governance/GovernorTimelockControlMock.sol
  79. 1 2
      contracts/mocks/token/ERC1363ForceApproveMock.sol
  80. 0 1
      contracts/mocks/token/ERC1363NoReturnMock.sol
  81. 28 0
      contracts/mocks/utils/cryptography/ERC7739Mock.sol
  82. 1 1
      contracts/package.json
  83. 1 1
      contracts/proxy/Clones.sol
  84. 1 1
      contracts/proxy/utils/Initializable.sol
  85. 1 1
      contracts/proxy/utils/UUPSUpgradeable.sol
  86. 6 18
      contracts/token/ERC1155/ERC1155.sol
  87. 1 1
      contracts/token/ERC1155/IERC1155.sol
  88. 1 3
      contracts/token/ERC1155/extensions/ERC1155Supply.sol
  89. 1 3
      contracts/token/ERC1155/utils/ERC1155Holder.sol
  90. 3 3
      contracts/token/ERC1155/utils/ERC1155Utils.sol
  91. 4 10
      contracts/token/ERC20/ERC20.sol
  92. 1 3
      contracts/token/ERC20/extensions/ERC1363.sol
  93. 1 3
      contracts/token/ERC20/extensions/ERC20Capped.sol
  94. 3 9
      contracts/token/ERC20/extensions/ERC20Permit.sol
  95. 1 3
      contracts/token/ERC20/extensions/ERC20Wrapper.sol
  96. 17 17
      contracts/token/ERC20/extensions/ERC4626.sol
  97. 1 1
      contracts/token/ERC20/extensions/draft-ERC20TemporaryApproval.sol
  98. 2 2
      contracts/token/ERC20/utils/ERC1363Utils.sol
  99. 1 1
      contracts/token/ERC20/utils/SafeERC20.sol
  100. 5 5
      contracts/token/ERC6909/draft-ERC6909.sol

+ 0 - 5
.changeset/blue-nails-give.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`Math`: Add `add512`, `mul512` and `mulShr`.

+ 0 - 5
.changeset/brave-islands-sparkle.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`GovernorSequentialProposalId`: Adds a `Governor` extension that sequentially numbers proposal ids instead of using the hash.

+ 0 - 5
.changeset/brown-seals-sing.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`SafeERC20`: Add `trySafeTransfer` and `trySafeTransferFrom` that do not revert and return false if the transfer is not successful.

+ 0 - 5
.changeset/brown-turkeys-marry.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`ERC6909TokenSupply`: Add an extension of ERC6909 which tracks total supply for each token id.

+ 0 - 5
.changeset/cyan-taxis-travel.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`Address`: bubble up revert data on `sendValue` failed call

+ 0 - 5
.changeset/dirty-bananas-shake.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`ERC6909ContentURI`: Add an extension of ERC6909 which adds content URI functionality.

+ 0 - 5
.changeset/fair-pumpkins-compete.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`Math`: Add saturating arithmetic operations `saturatingAdd`, `saturatingSub` and `saturatingMul`.

+ 0 - 5
.changeset/famous-timers-compare.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`ERC2771Forwarder`: Expose the `_isTrustedByTarget` internal function to check whether a target trusts the forwarder.

+ 0 - 5
.changeset/fast-coats-try.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`Initializable`: Add `_initializableStorageSlot` function that returns a pointer to the storage struct. The function allows customizing with a custom storage slot with an `override`.

+ 0 - 5
.changeset/fuzzy-crews-poke.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`GovernorSuperQuorum`: Add a governance extension to support a super quorum. Proposals that meet the super quorum (and have a majority of for votes) advance to the `Succeeded` state before the proposal deadline.

+ 0 - 5
.changeset/good-cameras-rush.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`EnumerableMap`: Add `clear` function to EnumerableMaps which deletes all entries in the map.

+ 0 - 5
.changeset/good-cameras-serve.md

@@ -1,5 +0,0 @@
----
-"openzeppelin-solidity": minor
----
-
-`Calldata`: Library with `emptyBytes` and `emptyString` functions to generate empty `bytes` and `string` calldata types.

+ 0 - 5
.changeset/good-zebras-ring.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`MerkleTree`: Add an update function that replaces a previously inserted leaf with a new value, updating the tree root along the way.

+ 0 - 5
.changeset/gorgeous-apes-jam.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`TimelockController`: Receive function is now virtual.

+ 0 - 5
.changeset/green-drinks-report.md

@@ -1,5 +0,0 @@
----
-"openzeppelin-solidity": minor
----
-
-`Pausable`: Stop explicitly setting `paused` to `false` during construction.

+ 0 - 5
.changeset/long-walls-draw.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`IERC6909`: Add the interface for ERC-6909.

+ 5 - 0
.changeset/lucky-donuts-scream.md

@@ -0,0 +1,5 @@
+---
+'openzeppelin-solidity': minor
+---
+
+`ERC7739`: An abstract contract to validate signatures following the rehashing scheme from `ERC7739Utils`.

+ 0 - 5
.changeset/mighty-melons-cheer.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': patch
----
-
-`P256`: Adjust precompile detection in `verifyNative` to consider empty `returndata` on invalid verification. Previously, invalid signatures would've reverted with a `MissingPrecompile` error in chains with RIP-7212 support.

+ 0 - 5
.changeset/nice-cherries-reply.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`Strings`: Add `espaceJSON` that escapes special characters in JSON strings.

+ 0 - 5
.changeset/ninety-rings-suffer.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`GovernorVotesSuperQuorumFraction`: Add a variant of the `GovernorSuperQuorum` extensions where the super quorum is expressed as a fraction of the total supply.

+ 0 - 5
.changeset/pretty-lobsters-tan.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`GovernorProposalGuardian`: Add a governance extension that defines a proposal guardian who can cancel proposals at any stage in their lifecycle.

+ 0 - 5
.changeset/proud-cooks-do.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`ERC6909Metadata`: Add an extension of ERC6909 which adds metadata functionality.

+ 5 - 0
.changeset/proud-tables-sip.md

@@ -0,0 +1,5 @@
+---
+'openzeppelin-solidity': minor
+---
+
+`ERC7739Utils`: Add a library that implements a defensive rehashing mechanism to prevent replayability of smart contract signatures based on the ERC-7739.

+ 0 - 5
.changeset/quiet-shrimps-kiss.md

@@ -1,5 +0,0 @@
----
-"openzeppelin-solidity": patch
----
-
-`MessageHashUtils`: Add `toDataWithIntendedValidatorHash(address, bytes32)`.

+ 0 - 5
.changeset/seven-insects-taste.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': patch
----
-
-`ERC7579Utils`: Add ABI decoding checks on calldata bounds within `decodeBatch`

+ 0 - 5
.changeset/sixty-tips-wink.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`EnumerableSet`: Add `clear` function to EnumerableSets which deletes all values in the set.

+ 0 - 5
.changeset/ten-fishes-fold.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`IGovernor`: Add the `getProposalId` function to the governor interface.

+ 0 - 5
.changeset/ten-hats-begin.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`ERC6909`: Add a standard implementation of ERC6909.

+ 0 - 5
.changeset/ten-peas-mix.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': minor
----
-
-`Hashes`: Expose `efficientKeccak256` for hashing non-commutative pairs of bytes32 without allocating extra memory.

+ 0 - 5
.changeset/thin-eels-cross.md

@@ -1,5 +0,0 @@
----
-'openzeppelin-solidity': patch
----
-
-`ERC4626`: Use the `asset` getter in `totalAssets`, `_deposit` and `_withdraw`.

+ 5 - 0
.changeset/wet-dodos-reply.md

@@ -0,0 +1,5 @@
+---
+'openzeppelin-solidity': minor
+---
+
+`Blockhash`: Add a library that provides access to historical block hashes using EIP-2935's history storage, extending the standard 256-block limit to 8191 blocks.

+ 2 - 1
.github/actions/setup/action.yml

@@ -13,7 +13,8 @@ runs:
         path: '**/node_modules'
         key: npm-v3-${{ hashFiles('**/package-lock.json') }}
     - name: Install dependencies
-      run: npm ci
+      ## TODO: Remove when EIP-7702 authorizations are enabled in latest non-beta ethers version
+      run: npm ci --legacy-peer-deps
       shell: bash
       if: steps.cache.outputs.cache-hit != 'true'
     - name: Install Foundry

+ 3 - 1
.github/workflows/checks.yml

@@ -87,7 +87,7 @@ jobs:
       - name: Set up environment
         uses: ./.github/actions/setup
       - name: Run tests
-        run: forge test -vv
+        run: forge test -vvv
 
   coverage:
     runs-on: ubuntu-latest
@@ -118,6 +118,8 @@ jobs:
       - uses: actions/checkout@v4
       - name: Set up environment
         uses: ./.github/actions/setup
+      ## TODO: Remove when EIP-7702 authorizations are enabled in latest non-beta ethers version
+      - run: rm package-lock.json package.json # Dependencies already installed
       - uses: crytic/slither-action@v0.4.1
 
   codespell:

+ 2 - 0
.github/workflows/release-cycle.yml

@@ -131,6 +131,7 @@ jobs:
     environment: npm
     permissions:
       contents: write
+      id-token: write
     if: needs.state.outputs.publish == 'true'
     runs-on: ubuntu-latest
     steps:
@@ -153,6 +154,7 @@ jobs:
           NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
           TARBALL: ${{ steps.pack.outputs.tarball }}
           TAG: ${{ steps.pack.outputs.tag }}
+          NPM_CONFIG_PROVENANCE: true
       - name: Create Github Release
         uses: actions/github-script@v7
         env:

+ 50 - 1
CHANGELOG.md

@@ -1,5 +1,7 @@
 # Changelog
 
+## 5.3.0 (2025-04-09)
+
 ### Breaking Changes
 
 - Replace `GovernorCountingOverridable.VoteReceipt` struct parameter member names `hasOverriden` and `overridenWeight` for `hasOverridden` and `overriddenWeight` respectively.
@@ -7,7 +9,54 @@
 #### Custom error changes
 
 - Replace `GovernorAlreadyOverridenVote` with `GovernorAlreadyOverriddenVote`.
-- Replace `AccessControlNonRevokable` with `AccessControlNonRevocable`.
+- Replace `GovernorOnlyProposer` with `GovernorUnableToCancel`.
+
+### Changes by category
+
+#### Account
+
+- `ERC4337Utils`: Update the `hash` function to call `getUserOpHash` on the specified entrypoint and add an `ENTRYPOINT_V08` constant. ([#5614](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5614))
+- `ERC7579Utils`: Add ABI decoding checks on calldata bounds within `decodeBatch`. ([#5371](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5371))
+- `ERC7579Utils`: Replace `address(0)` with `address(this)` during execution for calldata compression efficiency. ([#5614](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5614))
+
+#### Governance
+
+- `IGovernor`: Add the `getProposalId` function to the governor interface. ([#5290](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5290))
+- `GovernorProposalGuardian`: Add a governance extension that defines a proposal guardian who can cancel proposals at any stage in their lifecycle. ([#5303](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5303))
+- `GovernorSequentialProposalId`: Adds a `Governor` extension that sequentially numbers proposal ids instead of using the hash. ([#5290](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5290))
+- `GovernorSuperQuorum`: Add a governance extension to support a super quorum. Proposals that meet the super quorum (and have a majority of for votes) advance to the `Succeeded` state before the proposal deadline. ([#5526](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5526))
+- `GovernorVotesSuperQuorumFraction`: Add a variant of the `GovernorSuperQuorum` extensions where the super quorum is expressed as a fraction of the total supply. ([#5526](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5526))
+- `TimelockController`: Receive function is now virtual. ([#5509](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5509))
+
+#### Structures
+
+- `EnumerableSet`: Add `clear` function to EnumerableSets which deletes all values in the set. ([#5486](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5486))
+- `EnumerableMap`: Add `clear` function to EnumerableMaps which deletes all entries in the map. ([#5486](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5486))
+- `MerkleTree`: Add an update function that replaces a previously inserted leaf with a new value, updating the tree root along the way. ([#5526](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5526))
+
+#### Tokens
+
+- `ERC4626`: Use the `asset` getter in `totalAssets`, `_deposit` and `_withdraw`. ([#5322](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5322))
+- `IERC6909`: Add the interface for ERC-6909. ([#5343](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5343))
+- `ERC6909`: Add a standard implementation of ERC6909. ([#5394](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5394))
+- `ERC6909TokenSupply`: Add an extension of ERC6909 which tracks total supply for each token id. ([#5394](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5394))
+- `ERC6909Metadata`: Add an extension of ERC6909 which adds metadata functionality. ([#5394](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5394))
+- `ERC6909ContentURI`: Add an extension of ERC6909 which adds content URI functionality. ([#5394](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5394))
+- `SafeERC20`: Add `trySafeTransfer` and `trySafeTransferFrom` that do not revert and return false if the transfer is not successful. ([#5483](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5483))
+
+#### Other
+
+- `Address`: bubble up revert data on `sendValue` failed call. ([#5379](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5379))
+- `Calldata`: Library with `emptyBytes` and `emptyString` functions to generate empty `bytes` and `string` calldata types. ([#5422](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5422))
+- `ERC2771Forwarder`: Expose the `_isTrustedByTarget` internal function to check whether a target trusts the forwarder. ([#5416](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5416))
+- `Hashes`: Expose `efficientKeccak256` for hashing non-commutative pairs of bytes32 without allocating extra memory. ([#5442](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5442))
+- `Initializable`: Add `_initializableStorageSlot` function that returns a pointer to the storage struct. The function allows customizing with a custom storage slot with an `override`. ([#5526](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5526))
+- `Math`: Add `add512`, `mul512` and `mulShr`. ([#5526](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5526))
+- `Math`: Add saturating arithmetic operations `saturatingAdd`, `saturatingSub` and `saturatingMul`. ([#5526](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5526))
+- `MessageHashUtils`: Add `toDataWithIntendedValidatorHash(address, bytes32)`. ([#5526](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5526))
+- `P256`: Adjust precompile detection in `verifyNative` to consider empty `returndata` on invalid verification. Previously, invalid signatures would've reverted with a `MissingPrecompile` error in chains with RIP-7212 support. ([#5620](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5620))
+- `Pausable`: Stop explicitly setting `paused` to `false` during construction. ([#5448](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5448))
+- `Strings`: Add `espaceJSON` that escapes special characters in JSON strings. ([#5526](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5526))
 
 ## 5.2.0 (2025-01-08)
 

+ 3 - 5
contracts/access/AccessControl.sol

@@ -1,11 +1,11 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (access/AccessControl.sol)
 
 pragma solidity ^0.8.20;
 
 import {IAccessControl} from "./IAccessControl.sol";
 import {Context} from "../utils/Context.sol";
-import {ERC165} from "../utils/introspection/ERC165.sol";
+import {IERC165, ERC165} from "../utils/introspection/ERC165.sol";
 
 /**
  * @dev Contract module that allows children to implement role-based access
@@ -65,9 +65,7 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
         _;
     }
 
-    /**
-     * @dev See {IERC165-supportsInterface}.
-     */
+    /// @inheritdoc IERC165
     function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
         return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
     }

+ 1 - 1
contracts/access/IAccessControl.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.1.0) (access/IAccessControl.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (access/IAccessControl.sol)
 
 pragma solidity ^0.8.20;
 

+ 14 - 39
contracts/access/extensions/AccessControlDefaultAdminRules.sol

@@ -8,6 +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";
 
 /**
  * @dev Extension of {AccessControl} that allows specifying special rules to manage
@@ -59,16 +60,12 @@ abstract contract AccessControlDefaultAdminRules is IAccessControlDefaultAdminRu
         _grantRole(DEFAULT_ADMIN_ROLE, initialDefaultAdmin);
     }
 
-    /**
-     * @dev See {IERC165-supportsInterface}.
-     */
+    /// @inheritdoc IERC165
     function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
         return interfaceId == type(IAccessControlDefaultAdminRules).interfaceId || super.supportsInterface(interfaceId);
     }
 
-    /**
-     * @dev See {IERC5313-owner}.
-     */
+    /// @inheritdoc IERC5313
     function owner() public view virtual returns (address) {
         return defaultAdmin();
     }
@@ -140,9 +137,7 @@ abstract contract AccessControlDefaultAdminRules is IAccessControlDefaultAdminRu
         return super._grantRole(role, account);
     }
 
-    /**
-     * @dev See {AccessControl-_revokeRole}.
-     */
+    /// @inheritdoc AccessControl
     function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {
         if (role == DEFAULT_ADMIN_ROLE && account == defaultAdmin()) {
             delete _currentDefaultAdmin;
@@ -164,39 +159,29 @@ abstract contract AccessControlDefaultAdminRules is IAccessControlDefaultAdminRu
     /// AccessControlDefaultAdminRules accessors
     ///
 
-    /**
-     * @inheritdoc IAccessControlDefaultAdminRules
-     */
+    /// @inheritdoc IAccessControlDefaultAdminRules
     function defaultAdmin() public view virtual returns (address) {
         return _currentDefaultAdmin;
     }
 
-    /**
-     * @inheritdoc IAccessControlDefaultAdminRules
-     */
+    /// @inheritdoc IAccessControlDefaultAdminRules
     function pendingDefaultAdmin() public view virtual returns (address newAdmin, uint48 schedule) {
         return (_pendingDefaultAdmin, _pendingDefaultAdminSchedule);
     }
 
-    /**
-     * @inheritdoc IAccessControlDefaultAdminRules
-     */
+    /// @inheritdoc IAccessControlDefaultAdminRules
     function defaultAdminDelay() public view virtual returns (uint48) {
         uint48 schedule = _pendingDelaySchedule;
         return (_isScheduleSet(schedule) && _hasSchedulePassed(schedule)) ? _pendingDelay : _currentDelay;
     }
 
-    /**
-     * @inheritdoc IAccessControlDefaultAdminRules
-     */
+    /// @inheritdoc IAccessControlDefaultAdminRules
     function pendingDefaultAdminDelay() public view virtual returns (uint48 newDelay, uint48 schedule) {
         schedule = _pendingDelaySchedule;
         return (_isScheduleSet(schedule) && !_hasSchedulePassed(schedule)) ? (_pendingDelay, schedule) : (0, 0);
     }
 
-    /**
-     * @inheritdoc IAccessControlDefaultAdminRules
-     */
+    /// @inheritdoc IAccessControlDefaultAdminRules
     function defaultAdminDelayIncreaseWait() public view virtual returns (uint48) {
         return 5 days;
     }
@@ -205,9 +190,7 @@ abstract contract AccessControlDefaultAdminRules is IAccessControlDefaultAdminRu
     /// AccessControlDefaultAdminRules public and internal setters for defaultAdmin/pendingDefaultAdmin
     ///
 
-    /**
-     * @inheritdoc IAccessControlDefaultAdminRules
-     */
+    /// @inheritdoc IAccessControlDefaultAdminRules
     function beginDefaultAdminTransfer(address newAdmin) public virtual onlyRole(DEFAULT_ADMIN_ROLE) {
         _beginDefaultAdminTransfer(newAdmin);
     }
@@ -223,9 +206,7 @@ abstract contract AccessControlDefaultAdminRules is IAccessControlDefaultAdminRu
         emit DefaultAdminTransferScheduled(newAdmin, newSchedule);
     }
 
-    /**
-     * @inheritdoc IAccessControlDefaultAdminRules
-     */
+    /// @inheritdoc IAccessControlDefaultAdminRules
     function cancelDefaultAdminTransfer() public virtual onlyRole(DEFAULT_ADMIN_ROLE) {
         _cancelDefaultAdminTransfer();
     }
@@ -239,9 +220,7 @@ abstract contract AccessControlDefaultAdminRules is IAccessControlDefaultAdminRu
         _setPendingDefaultAdmin(address(0), 0);
     }
 
-    /**
-     * @inheritdoc IAccessControlDefaultAdminRules
-     */
+    /// @inheritdoc IAccessControlDefaultAdminRules
     function acceptDefaultAdminTransfer() public virtual {
         (address newDefaultAdmin, ) = pendingDefaultAdmin();
         if (_msgSender() != newDefaultAdmin) {
@@ -271,9 +250,7 @@ abstract contract AccessControlDefaultAdminRules is IAccessControlDefaultAdminRu
     /// AccessControlDefaultAdminRules public and internal setters for defaultAdminDelay/pendingDefaultAdminDelay
     ///
 
-    /**
-     * @inheritdoc IAccessControlDefaultAdminRules
-     */
+    /// @inheritdoc IAccessControlDefaultAdminRules
     function changeDefaultAdminDelay(uint48 newDelay) public virtual onlyRole(DEFAULT_ADMIN_ROLE) {
         _changeDefaultAdminDelay(newDelay);
     }
@@ -289,9 +266,7 @@ abstract contract AccessControlDefaultAdminRules is IAccessControlDefaultAdminRu
         emit DefaultAdminDelayChangeScheduled(newDelay, newSchedule);
     }
 
-    /**
-     * @inheritdoc IAccessControlDefaultAdminRules
-     */
+    /// @inheritdoc IAccessControlDefaultAdminRules
     function rollbackDefaultAdminDelay() public virtual onlyRole(DEFAULT_ADMIN_ROLE) {
         _rollbackDefaultAdminDelay();
     }

+ 2 - 3
contracts/access/extensions/AccessControlEnumerable.sol

@@ -6,6 +6,7 @@ pragma solidity ^0.8.20;
 import {IAccessControlEnumerable} from "./IAccessControlEnumerable.sol";
 import {AccessControl} from "../AccessControl.sol";
 import {EnumerableSet} from "../../utils/structs/EnumerableSet.sol";
+import {IERC165} from "../../utils/introspection/ERC165.sol";
 
 /**
  * @dev Extension of {AccessControl} that allows enumerating the members of each role.
@@ -15,9 +16,7 @@ abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessCon
 
     mapping(bytes32 role => EnumerableSet.AddressSet) private _roleMembers;
 
-    /**
-     * @dev See {IERC165-supportsInterface}.
-     */
+    /// @inheritdoc IERC165
     function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
         return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);
     }

+ 0 - 1
contracts/access/manager/AccessManaged.sol

@@ -3,7 +3,6 @@
 
 pragma solidity ^0.8.20;
 
-import {IAuthority} from "./IAuthority.sol";
 import {AuthorityUtils} from "./AuthorityUtils.sol";
 import {IAccessManager} from "./IAccessManager.sol";
 import {IAccessManaged} from "./IAccessManaged.sol";

+ 5 - 1
contracts/access/manager/AuthorityUtils.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/AuthorityUtils.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (access/manager/AuthorityUtils.sol)
 
 pragma solidity ^0.8.20;
 
@@ -26,6 +26,10 @@ library AuthorityUtils {
             if staticcall(gas(), authority, add(data, 0x20), mload(data), 0x00, 0x40) {
                 immediate := mload(0x00)
                 delay := mload(0x20)
+
+                // If delay does not fit in a uint32, return 0 (no delay)
+                // equivalent to: if gt(delay, 0xFFFFFFFF) { delay := 0 }
+                delay := mul(delay, iszero(shr(32, delay)))
             }
         }
     }

+ 0 - 2
contracts/access/manager/IAccessManager.sol

@@ -3,8 +3,6 @@
 
 pragma solidity ^0.8.20;
 
-import {Time} from "../../utils/types/Time.sol";
-
 interface IAccessManager {
     /**
      * @dev A delayed operation was scheduled.

+ 1 - 1
contracts/account/utils/draft-ERC4337Utils.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.2.0) (account/utils/draft-ERC4337Utils.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (account/utils/draft-ERC4337Utils.sol)
 
 pragma solidity ^0.8.20;
 

+ 2 - 2
contracts/account/utils/draft-ERC7579Utils.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.2.0) (account/utils/draft-ERC7579Utils.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (account/utils/draft-ERC7579Utils.sol)
 
 pragma solidity ^0.8.20;
 
@@ -204,7 +204,7 @@ library ERC7579Utils {
                 revert ERC7579DecodingError();
 
             assembly ("memory-safe") {
-                executionBatch.offset := add(add(executionCalldata.offset, arrayLengthOffset), 32)
+                executionBatch.offset := add(add(executionCalldata.offset, arrayLengthOffset), 0x20)
                 executionBatch.length := arrayLength
             }
         }

+ 1 - 1
contracts/finance/VestingWallet.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.2.0) (finance/VestingWallet.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (finance/VestingWallet.sol)
 pragma solidity ^0.8.20;
 
 import {IERC20} from "../token/ERC20/IERC20.sol";

+ 28 - 80
contracts/governance/Governor.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.2.0) (governance/Governor.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (governance/Governor.sol)
 
 pragma solidity ^0.8.20;
 
@@ -86,9 +86,7 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72
         }
     }
 
-    /**
-     * @dev See {IERC165-supportsInterface}.
-     */
+    /// @inheritdoc IERC165
     function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {
         return
             interfaceId == type(IGovernor).interfaceId ||
@@ -97,16 +95,12 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72
             super.supportsInterface(interfaceId);
     }
 
-    /**
-     * @dev See {IGovernor-name}.
-     */
+    /// @inheritdoc IGovernor
     function name() public view virtual returns (string memory) {
         return _name;
     }
 
-    /**
-     * @dev See {IGovernor-version}.
-     */
+    /// @inheritdoc IGovernor
     function version() public view virtual returns (string memory) {
         return "1";
     }
@@ -133,9 +127,7 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72
         return uint256(keccak256(abi.encode(targets, values, calldatas, descriptionHash)));
     }
 
-    /**
-     * @dev See {IGovernor-getProposalId}.
-     */
+    /// @inheritdoc IGovernor
     function getProposalId(
         address[] memory targets,
         uint256[] memory values,
@@ -145,9 +137,7 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72
         return hashProposal(targets, values, calldatas, descriptionHash);
     }
 
-    /**
-     * @dev See {IGovernor-state}.
-     */
+    /// @inheritdoc IGovernor
     function state(uint256 proposalId) public view virtual returns (ProposalState) {
         // We read the struct fields into the stack at once so Solidity emits a single SLOAD
         ProposalCore storage proposal = _proposals[proposalId];
@@ -187,44 +177,32 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72
         }
     }
 
-    /**
-     * @dev See {IGovernor-proposalThreshold}.
-     */
+    /// @inheritdoc IGovernor
     function proposalThreshold() public view virtual returns (uint256) {
         return 0;
     }
 
-    /**
-     * @dev See {IGovernor-proposalSnapshot}.
-     */
+    /// @inheritdoc IGovernor
     function proposalSnapshot(uint256 proposalId) public view virtual returns (uint256) {
         return _proposals[proposalId].voteStart;
     }
 
-    /**
-     * @dev See {IGovernor-proposalDeadline}.
-     */
+    /// @inheritdoc IGovernor
     function proposalDeadline(uint256 proposalId) public view virtual returns (uint256) {
         return _proposals[proposalId].voteStart + _proposals[proposalId].voteDuration;
     }
 
-    /**
-     * @dev See {IGovernor-proposalProposer}.
-     */
+    /// @inheritdoc IGovernor
     function proposalProposer(uint256 proposalId) public view virtual returns (address) {
         return _proposals[proposalId].proposer;
     }
 
-    /**
-     * @dev See {IGovernor-proposalEta}.
-     */
+    /// @inheritdoc IGovernor
     function proposalEta(uint256 proposalId) public view virtual returns (uint256) {
         return _proposals[proposalId].etaSeconds;
     }
 
-    /**
-     * @dev See {IGovernor-proposalNeedsQueuing}.
-     */
+    /// @inheritdoc IGovernor
     function proposalNeedsQueuing(uint256) public view virtual returns (bool) {
         return false;
     }
@@ -362,9 +340,7 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72
         // Using a named return variable to avoid stack too deep errors
     }
 
-    /**
-     * @dev See {IGovernor-queue}.
-     */
+    /// @inheritdoc IGovernor
     function queue(
         address[] memory targets,
         uint256[] memory values,
@@ -410,9 +386,7 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72
         return 0;
     }
 
-    /**
-     * @dev See {IGovernor-execute}.
-     */
+    /// @inheritdoc IGovernor
     function execute(
         address[] memory targets,
         uint256[] memory values,
@@ -470,9 +444,7 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72
         }
     }
 
-    /**
-     * @dev See {IGovernor-cancel}.
-     */
+    /// @inheritdoc IGovernor
     function cancel(
         address[] memory targets,
         uint256[] memory values,
@@ -518,16 +490,12 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72
         return proposalId;
     }
 
-    /**
-     * @dev See {IGovernor-getVotes}.
-     */
+    /// @inheritdoc IGovernor
     function getVotes(address account, uint256 timepoint) public view virtual returns (uint256) {
         return _getVotes(account, timepoint, _defaultParams());
     }
 
-    /**
-     * @dev See {IGovernor-getVotesWithParams}.
-     */
+    /// @inheritdoc IGovernor
     function getVotesWithParams(
         address account,
         uint256 timepoint,
@@ -536,17 +504,13 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72
         return _getVotes(account, timepoint, params);
     }
 
-    /**
-     * @dev See {IGovernor-castVote}.
-     */
+    /// @inheritdoc IGovernor
     function castVote(uint256 proposalId, uint8 support) public virtual returns (uint256) {
         address voter = _msgSender();
         return _castVote(proposalId, voter, support, "");
     }
 
-    /**
-     * @dev See {IGovernor-castVoteWithReason}.
-     */
+    /// @inheritdoc IGovernor
     function castVoteWithReason(
         uint256 proposalId,
         uint8 support,
@@ -556,9 +520,7 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72
         return _castVote(proposalId, voter, support, reason);
     }
 
-    /**
-     * @dev See {IGovernor-castVoteWithReasonAndParams}.
-     */
+    /// @inheritdoc IGovernor
     function castVoteWithReasonAndParams(
         uint256 proposalId,
         uint8 support,
@@ -569,9 +531,7 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72
         return _castVote(proposalId, voter, support, reason, params);
     }
 
-    /**
-     * @dev See {IGovernor-castVoteBySig}.
-     */
+    /// @inheritdoc IGovernor
     function castVoteBySig(
         uint256 proposalId,
         uint8 support,
@@ -591,9 +551,7 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72
         return _castVote(proposalId, voter, support, "");
     }
 
-    /**
-     * @dev See {IGovernor-castVoteWithReasonAndParamsBySig}.
-     */
+    /// @inheritdoc IGovernor
     function castVoteWithReasonAndParamsBySig(
         uint256 proposalId,
         uint8 support,
@@ -811,30 +769,20 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72
         return (state(proposalId) == ProposalState.Pending) && caller == proposalProposer(proposalId);
     }
 
-    /**
-     * @inheritdoc IERC6372
-     */
+    /// @inheritdoc IERC6372
     function clock() public view virtual returns (uint48);
 
-    /**
-     * @inheritdoc IERC6372
-     */
+    /// @inheritdoc IERC6372
     // solhint-disable-next-line func-name-mixedcase
     function CLOCK_MODE() public view virtual returns (string memory);
 
-    /**
-     * @inheritdoc IGovernor
-     */
+    /// @inheritdoc IGovernor
     function votingDelay() public view virtual returns (uint256);
 
-    /**
-     * @inheritdoc IGovernor
-     */
+    /// @inheritdoc IGovernor
     function votingPeriod() public view virtual returns (uint256);
 
-    /**
-     * @inheritdoc IGovernor
-     */
+    /// @inheritdoc IGovernor
     function quorum(uint256 timepoint) public view virtual returns (uint256);
 
     /**
@@ -846,7 +794,7 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72
     function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) {
         // This is not memory safe in the general case, but all calls to this private function are within bounds.
         assembly ("memory-safe") {
-            value := mload(add(buffer, add(0x20, offset)))
+            value := mload(add(add(buffer, 0x20), offset))
         }
     }
 }

+ 1 - 1
contracts/governance/IGovernor.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.1.0) (governance/IGovernor.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (governance/IGovernor.sol)
 
 pragma solidity ^0.8.20;
 

+ 3 - 4
contracts/governance/TimelockController.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.0.0) (governance/TimelockController.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (governance/TimelockController.sol)
 
 pragma solidity ^0.8.20;
 
@@ -7,6 +7,7 @@ import {AccessControl} from "../access/AccessControl.sol";
 import {ERC721Holder} from "../token/ERC721/utils/ERC721Holder.sol";
 import {ERC1155Holder} from "../token/ERC1155/utils/ERC1155Holder.sol";
 import {Address} from "../utils/Address.sol";
+import {IERC165} from "../utils/introspection/ERC165.sol";
 
 /**
  * @dev Contract module which acts as a timelocked controller. When set as the
@@ -154,9 +155,7 @@ contract TimelockController is AccessControl, ERC721Holder, ERC1155Holder {
      */
     receive() external payable virtual {}
 
-    /**
-     * @dev See {IERC165-supportsInterface}.
-     */
+    /// @inheritdoc IERC165
     function supportsInterface(
         bytes4 interfaceId
     ) public view virtual override(AccessControl, ERC1155Holder) returns (bool) {

+ 5 - 11
contracts/governance/extensions/GovernorCountingFractional.sol

@@ -1,9 +1,9 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorCountingFractional.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorCountingFractional.sol)
 
 pragma solidity ^0.8.20;
 
-import {Governor} from "../Governor.sol";
+import {IGovernor, Governor} from "../Governor.sol";
 import {GovernorCountingSimple} from "./GovernorCountingSimple.sol";
 import {Math} from "../../utils/math/Math.sol";
 
@@ -53,17 +53,13 @@ abstract contract GovernorCountingFractional is Governor {
      */
     error GovernorExceedRemainingWeight(address voter, uint256 usedVotes, uint256 remainingWeight);
 
-    /**
-     * @dev See {IGovernor-COUNTING_MODE}.
-     */
+    /// @inheritdoc IGovernor
     // solhint-disable-next-line func-name-mixedcase
     function COUNTING_MODE() public pure virtual override returns (string memory) {
         return "support=bravo,fractional&quorum=for,abstain&params=fractional";
     }
 
-    /**
-     * @dev See {IGovernor-hasVoted}.
-     */
+    /// @inheritdoc IGovernor
     function hasVoted(uint256 proposalId, address account) public view virtual override returns (bool) {
         return usedVotes(proposalId, account) > 0;
     }
@@ -86,9 +82,7 @@ abstract contract GovernorCountingFractional is Governor {
         return (proposalVote.againstVotes, proposalVote.forVotes, proposalVote.abstainVotes);
     }
 
-    /**
-     * @dev See {Governor-_quorumReached}.
-     */
+    /// @inheritdoc Governor
     function _quorumReached(uint256 proposalId) internal view virtual override returns (bool) {
         ProposalVote storage proposalVote = _proposalVotes[proposalId];
         return quorum(proposalSnapshot(proposalId)) <= proposalVote.forVotes + proposalVote.abstainVotes;

+ 4 - 7
contracts/governance/extensions/GovernorCountingOverridable.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.2.0) (governance/extensions/GovernorCountingOverridable.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorCountingOverridable.sol)
 
 pragma solidity ^0.8.20;
 
@@ -7,6 +7,7 @@ import {SignatureChecker} from "../../utils/cryptography/SignatureChecker.sol";
 import {SafeCast} from "../../utils/math/SafeCast.sol";
 import {VotesExtended} from "../utils/VotesExtended.sol";
 import {GovernorVotes} from "./GovernorVotes.sol";
+import {IGovernor, Governor} from "../Governor.sol";
 
 /**
  * @dev Extension of {Governor} which enables delegators to override the vote of their delegates. This module requires a
@@ -46,9 +47,7 @@ abstract contract GovernorCountingOverridable is GovernorVotes {
 
     mapping(uint256 proposalId => ProposalVote) private _proposalVotes;
 
-    /**
-     * @dev See {IGovernor-COUNTING_MODE}.
-     */
+    /// @inheritdoc IGovernor
     // solhint-disable-next-line func-name-mixedcase
     function COUNTING_MODE() public pure virtual override returns (string memory) {
         return "support=bravo,override&quorum=for,abstain&overridable=true";
@@ -83,9 +82,7 @@ abstract contract GovernorCountingOverridable is GovernorVotes {
         return (votes[uint8(VoteType.Against)], votes[uint8(VoteType.For)], votes[uint8(VoteType.Abstain)]);
     }
 
-    /**
-     * @dev See {Governor-_quorumReached}.
-     */
+    /// @inheritdoc Governor
     function _quorumReached(uint256 proposalId) internal view virtual override returns (bool) {
         uint256[3] storage votes = _proposalVotes[proposalId].votes;
         return quorum(proposalSnapshot(proposalId)) <= votes[uint8(VoteType.For)] + votes[uint8(VoteType.Abstain)];

+ 4 - 10
contracts/governance/extensions/GovernorCountingSimple.sol

@@ -3,7 +3,7 @@
 
 pragma solidity ^0.8.20;
 
-import {Governor} from "../Governor.sol";
+import {IGovernor, Governor} from "../Governor.sol";
 
 /**
  * @dev Extension of {Governor} for simple, 3 options, vote counting.
@@ -27,17 +27,13 @@ abstract contract GovernorCountingSimple is Governor {
 
     mapping(uint256 proposalId => ProposalVote) private _proposalVotes;
 
-    /**
-     * @dev See {IGovernor-COUNTING_MODE}.
-     */
+    /// @inheritdoc IGovernor
     // solhint-disable-next-line func-name-mixedcase
     function COUNTING_MODE() public pure virtual override returns (string memory) {
         return "support=bravo&quorum=for,abstain";
     }
 
-    /**
-     * @dev See {IGovernor-hasVoted}.
-     */
+    /// @inheritdoc IGovernor
     function hasVoted(uint256 proposalId, address account) public view virtual override returns (bool) {
         return _proposalVotes[proposalId].hasVoted[account];
     }
@@ -52,9 +48,7 @@ abstract contract GovernorCountingSimple is Governor {
         return (proposalVote.againstVotes, proposalVote.forVotes, proposalVote.abstainVotes);
     }
 
-    /**
-     * @dev See {Governor-_quorumReached}.
-     */
+    /// @inheritdoc Governor
     function _quorumReached(uint256 proposalId) internal view virtual override returns (bool) {
         ProposalVote storage proposalVote = _proposalVotes[proposalId];
 

+ 1 - 0
contracts/governance/extensions/GovernorProposalGuardian.sol

@@ -1,4 +1,5 @@
 // SPDX-License-Identifier: MIT
+// OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorProposalGuardian.sol)
 pragma solidity ^0.8.20;
 
 import {Governor} from "../Governor.sol";

+ 3 - 4
contracts/governance/extensions/GovernorSequentialProposalId.sol

@@ -1,8 +1,9 @@
 // SPDX-License-Identifier: MIT
+// OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorSequentialProposalId.sol)
 
 pragma solidity ^0.8.20;
 
-import {Governor} from "../Governor.sol";
+import {IGovernor, Governor} from "../Governor.sol";
 
 /**
  * @dev Extension of {Governor} that changes the numbering of proposal ids from the default hash-based approach to
@@ -18,9 +19,7 @@ abstract contract GovernorSequentialProposalId is Governor {
      */
     error GovernorAlreadyInitializedLatestProposalId();
 
-    /**
-     * @dev See {IGovernor-getProposalId}.
-     */
+    /// @inheritdoc IGovernor
     function getProposalId(
         address[] memory targets,
         uint256[] memory values,

+ 4 - 10
contracts/governance/extensions/GovernorSettings.sol

@@ -3,7 +3,7 @@
 
 pragma solidity ^0.8.20;
 
-import {Governor} from "../Governor.sol";
+import {IGovernor, Governor} from "../Governor.sol";
 
 /**
  * @dev Extension of {Governor} for settings updatable through governance.
@@ -29,23 +29,17 @@ abstract contract GovernorSettings is Governor {
         _setProposalThreshold(initialProposalThreshold);
     }
 
-    /**
-     * @dev See {IGovernor-votingDelay}.
-     */
+    /// @inheritdoc IGovernor
     function votingDelay() public view virtual override returns (uint256) {
         return _votingDelay;
     }
 
-    /**
-     * @dev See {IGovernor-votingPeriod}.
-     */
+    /// @inheritdoc IGovernor
     function votingPeriod() public view virtual override returns (uint256) {
         return _votingPeriod;
     }
 
-    /**
-     * @dev See {Governor-proposalThreshold}.
-     */
+    /// @inheritdoc Governor
     function proposalThreshold() public view virtual override returns (uint256) {
         return _proposalThreshold;
     }

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

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorStorage.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorStorage.sol)
 
 pragma solidity ^0.8.20;
 

+ 1 - 2
contracts/governance/extensions/GovernorSuperQuorum.sol

@@ -1,9 +1,8 @@
 // SPDX-License-Identifier: MIT
+// OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorSuperQuorum.sol)
 pragma solidity ^0.8.20;
 
 import {Governor} from "../Governor.sol";
-import {SafeCast} from "../../utils/math/SafeCast.sol";
-import {Checkpoints} from "../../utils/structs/Checkpoints.sol";
 
 /**
  * @dev Extension of {Governor} with a super quorum. Proposals that meet the super quorum (and have a majority of for

+ 8 - 11
contracts/governance/extensions/GovernorTimelockAccess.sol

@@ -1,9 +1,9 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorTimelockAccess.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorTimelockAccess.sol)
 
 pragma solidity ^0.8.20;
 
-import {Governor} from "../Governor.sol";
+import {IGovernor, Governor} from "../Governor.sol";
 import {AuthorityUtils} from "../../access/manager/AuthorityUtils.sol";
 import {IAccessManager} from "../../access/manager/IAccessManager.sol";
 import {Address} from "../../utils/Address.sol";
@@ -171,16 +171,12 @@ abstract contract GovernorTimelockAccess is Governor {
         return (delay, indirect, withDelay);
     }
 
-    /**
-     * @dev See {IGovernor-proposalNeedsQueuing}.
-     */
+    /// @inheritdoc IGovernor
     function proposalNeedsQueuing(uint256 proposalId) public view virtual override returns (bool) {
         return _executionPlan[proposalId].delay > 0;
     }
 
-    /**
-     * @dev See {IGovernor-propose}
-     */
+    /// @inheritdoc IGovernor
     function propose(
         address[] memory targets,
         uint256[] memory values,
@@ -237,6 +233,9 @@ abstract contract GovernorTimelockAccess is Governor {
         for (uint256 i = 0; i < targets.length; ++i) {
             (, bool withDelay, ) = _getManagerData(plan, i);
             if (withDelay) {
+                // This function can reenter when calling `_manager.schedule` before performing state updates in `_setManagerData`.
+                // However, the `manager` is a trusted contract in the current context's security model (e.g. an `AccessManager`).
+                // slither-disable-next-line reentrancy-no-eth
                 (, uint32 nonce) = _manager.schedule(targets[i], calldatas[i], etaSeconds);
                 _setManagerData(plan, i, true, nonce);
             }
@@ -276,9 +275,7 @@ abstract contract GovernorTimelockAccess is Governor {
         }
     }
 
-    /**
-     * @dev See {Governor-_cancel}
-     */
+    /// @inheritdoc Governor
     function _cancel(
         address[] memory targets,
         uint256[] memory values,

+ 2 - 4
contracts/governance/extensions/GovernorTimelockCompound.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorTimelockCompound.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorTimelockCompound.sol)
 
 pragma solidity ^0.8.20;
 
@@ -53,9 +53,7 @@ abstract contract GovernorTimelockCompound is Governor {
         return address(_timelock);
     }
 
-    /**
-     * @dev See {IGovernor-proposalNeedsQueuing}.
-     */
+    /// @inheritdoc IGovernor
     function proposalNeedsQueuing(uint256) public view virtual override returns (bool) {
         return true;
     }

+ 2 - 5
contracts/governance/extensions/GovernorTimelockControl.sol

@@ -1,11 +1,10 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorTimelockControl.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorTimelockControl.sol)
 
 pragma solidity ^0.8.20;
 
 import {IGovernor, Governor} from "../Governor.sol";
 import {TimelockController} from "../TimelockController.sol";
-import {IERC165} from "../../interfaces/IERC165.sol";
 import {SafeCast} from "../../utils/math/SafeCast.sol";
 
 /**
@@ -67,9 +66,7 @@ abstract contract GovernorTimelockControl is Governor {
         return address(_timelock);
     }
 
-    /**
-     * @dev See {IGovernor-proposalNeedsQueuing}.
-     */
+    /// @inheritdoc IGovernor
     function proposalNeedsQueuing(uint256) public view virtual override returns (bool) {
         return true;
     }

+ 0 - 1
contracts/governance/extensions/GovernorVotes.sol

@@ -6,7 +6,6 @@ pragma solidity ^0.8.20;
 import {Governor} from "../Governor.sol";
 import {IVotes} from "../utils/IVotes.sol";
 import {IERC5805} from "../../interfaces/IERC5805.sol";
-import {SafeCast} from "../../utils/math/SafeCast.sol";
 import {Time} from "../../utils/types/Time.sol";
 
 /**

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

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorVotesQuorumFraction.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorVotesQuorumFraction.sol)
 
 pragma solidity ^0.8.20;
 

+ 2 - 0
contracts/governance/extensions/GovernorVotesSuperQuorumFraction.sol

@@ -1,4 +1,5 @@
 // SPDX-License-Identifier: MIT
+// OpenZeppelin Contracts (last updated v5.3.0) (governance/extensions/GovernorVotesSuperQuorumFraction.sol)
 pragma solidity ^0.8.20;
 
 import {Governor} from "../Governor.sol";
@@ -61,6 +62,7 @@ abstract contract GovernorVotesSuperQuorumFraction is GovernorVotesQuorumFractio
 
     /**
      * @dev Returns the super quorum for a `timepoint`, in terms of number of votes: `supply * numerator / denominator`.
+     * See {GovernorSuperQuorum-superQuorum} for more details.
      */
     function superQuorum(uint256 timepoint) public view virtual override returns (uint256) {
         return Math.mulDiv(token().getPastTotalSupply(timepoint), superQuorumNumerator(timepoint), quorumDenominator());

+ 1 - 1
contracts/interfaces/IERC1271.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1271.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (interfaces/IERC1271.sol)
 
 pragma solidity ^0.8.20;
 

+ 1 - 1
contracts/interfaces/IERC4626.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4626.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (interfaces/IERC4626.sol)
 
 pragma solidity ^0.8.20;
 

+ 1 - 1
contracts/interfaces/draft-IERC4337.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.2.0) (interfaces/draft-IERC4337.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (interfaces/draft-IERC4337.sol)
 
 pragma solidity ^0.8.20;
 

+ 3 - 1
contracts/interfaces/draft-IERC6909.sol

@@ -1,4 +1,5 @@
 // SPDX-License-Identifier: MIT
+// OpenZeppelin Contracts (last updated v5.3.0) (interfaces/draft-IERC6909.sol)
 
 pragma solidity ^0.8.20;
 
@@ -49,7 +50,8 @@ interface IERC6909 is IERC165 {
     function isOperator(address owner, address spender) external view returns (bool);
 
     /**
-     * @dev Sets an approval to `spender` for `amount` tokens of type `id` from the caller's tokens.
+     * @dev Sets an approval to `spender` for `amount` of tokens of type `id` from the caller's tokens. An `amount` of
+     * `type(uint256).max` signifies an unlimited approval.
      *
      * Must return true.
      */

+ 1 - 1
contracts/interfaces/draft-IERC7579.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.2.0) (interfaces/draft-IERC7579.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (interfaces/draft-IERC7579.sol)
 pragma solidity ^0.8.20;
 
 import {PackedUserOperation} from "./draft-IERC4337.sol";

+ 1 - 1
contracts/metatx/ERC2771Forwarder.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.1.0) (metatx/ERC2771Forwarder.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (metatx/ERC2771Forwarder.sol)
 
 pragma solidity ^0.8.20;
 

+ 0 - 1
contracts/mocks/AccessManagerMock.sol

@@ -3,7 +3,6 @@
 pragma solidity ^0.8.20;
 
 import {AccessManager} from "../access/manager/AccessManager.sol";
-import {StorageSlot} from "../utils/StorageSlot.sol";
 
 contract AccessManagerMock is AccessManager {
     event CalledRestricted(address caller);

+ 5 - 5
contracts/mocks/AuthorityMock.sol

@@ -12,7 +12,7 @@ contract NotAuthorityMock is IAuthority {
 }
 
 contract AuthorityNoDelayMock is IAuthority {
-    bool _immediate;
+    bool private _immediate;
 
     function canCall(
         address /* caller */,
@@ -28,14 +28,14 @@ contract AuthorityNoDelayMock is IAuthority {
 }
 
 contract AuthorityDelayMock {
-    bool _immediate;
-    uint32 _delay;
+    bool private _immediate;
+    uint256 private _delay;
 
     function canCall(
         address /* caller */,
         address /* target */,
         bytes4 /* selector */
-    ) external view returns (bool immediate, uint32 delay) {
+    ) external view returns (bool immediate, uint256 delay) {
         return (_immediate, _delay);
     }
 
@@ -43,7 +43,7 @@ contract AuthorityDelayMock {
         _immediate = immediate;
     }
 
-    function _setDelay(uint32 delay) external {
+    function _setDelay(uint256 delay) external {
         _delay = delay;
     }
 }

+ 1 - 0
contracts/mocks/Stateless.sol

@@ -9,6 +9,7 @@ import {Arrays} from "../utils/Arrays.sol";
 import {AuthorityUtils} from "../access/manager/AuthorityUtils.sol";
 import {Base64} from "../utils/Base64.sol";
 import {BitMaps} from "../utils/structs/BitMaps.sol";
+import {Blockhash} from "../utils/Blockhash.sol";
 import {Bytes} from "../utils/Bytes.sol";
 import {CAIP2} from "../utils/CAIP2.sol";
 import {CAIP10} from "../utils/CAIP10.sol";

+ 0 - 17
contracts/mocks/docs/access-control/AccessControlNonRevokableAdmin.sol

@@ -1,17 +0,0 @@
-// contracts/AccessControlNonRevokableAdmin.sol
-// SPDX-License-Identifier: MIT
-pragma solidity ^0.8.20;
-
-import {AccessControl} from "../../../access/AccessControl.sol";
-
-contract AccessControlNonRevokableAdmin is AccessControl {
-    error AccessControlNonRevokable();
-
-    function revokeRole(bytes32 role, address account) public override {
-        if (role == DEFAULT_ADMIN_ROLE) {
-            revert AccessControlNonRevokable();
-        }
-
-        super.revokeRole(role, account);
-    }
-}

+ 1 - 2
contracts/mocks/docs/governance/MyGovernor.sol

@@ -1,14 +1,13 @@
 // SPDX-License-Identifier: MIT
 pragma solidity ^0.8.20;
 
-import {IGovernor, Governor} from "../../../governance/Governor.sol";
+import {Governor} from "../../../governance/Governor.sol";
 import {GovernorCountingSimple} from "../../../governance/extensions/GovernorCountingSimple.sol";
 import {GovernorVotes} from "../../../governance/extensions/GovernorVotes.sol";
 import {GovernorVotesQuorumFraction} from "../../../governance/extensions/GovernorVotesQuorumFraction.sol";
 import {GovernorTimelockControl} from "../../../governance/extensions/GovernorTimelockControl.sol";
 import {TimelockController} from "../../../governance/TimelockController.sol";
 import {IVotes} from "../../../governance/utils/IVotes.sol";
-import {IERC165} from "../../../interfaces/IERC165.sol";
 
 contract MyGovernor is
     Governor,

+ 1 - 1
contracts/mocks/governance/GovernorCountingOverridableMock.sol

@@ -5,7 +5,7 @@ pragma solidity ^0.8.20;
 import {Governor} from "../../governance/Governor.sol";
 import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol";
 import {GovernorVotesQuorumFraction} from "../../governance/extensions/GovernorVotesQuorumFraction.sol";
-import {GovernorCountingOverridable, VotesExtended} from "../../governance/extensions/GovernorCountingOverridable.sol";
+import {GovernorCountingOverridable} from "../../governance/extensions/GovernorCountingOverridable.sol";
 
 abstract contract GovernorCountingOverridableMock is
     GovernorSettings,

+ 1 - 1
contracts/mocks/governance/GovernorStorageMock.sol

@@ -2,7 +2,7 @@
 
 pragma solidity ^0.8.20;
 
-import {IGovernor, Governor} from "../../governance/Governor.sol";
+import {Governor} from "../../governance/Governor.sol";
 import {GovernorTimelockControl} from "../../governance/extensions/GovernorTimelockControl.sol";
 import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol";
 import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol";

+ 1 - 1
contracts/mocks/governance/GovernorTimelockAccessMock.sol

@@ -2,7 +2,7 @@
 
 pragma solidity ^0.8.20;
 
-import {IGovernor, Governor} from "../../governance/Governor.sol";
+import {Governor} from "../../governance/Governor.sol";
 import {GovernorTimelockAccess} from "../../governance/extensions/GovernorTimelockAccess.sol";
 import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol";
 import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol";

+ 1 - 1
contracts/mocks/governance/GovernorTimelockCompoundMock.sol

@@ -2,7 +2,7 @@
 
 pragma solidity ^0.8.20;
 
-import {IGovernor, Governor} from "../../governance/Governor.sol";
+import {Governor} from "../../governance/Governor.sol";
 import {GovernorTimelockCompound} from "../../governance/extensions/GovernorTimelockCompound.sol";
 import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol";
 import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol";

+ 1 - 1
contracts/mocks/governance/GovernorTimelockControlMock.sol

@@ -2,7 +2,7 @@
 
 pragma solidity ^0.8.20;
 
-import {IGovernor, Governor} from "../../governance/Governor.sol";
+import {Governor} from "../../governance/Governor.sol";
 import {GovernorTimelockControl} from "../../governance/extensions/GovernorTimelockControl.sol";
 import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol";
 import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol";

+ 1 - 2
contracts/mocks/token/ERC1363ForceApproveMock.sol

@@ -2,8 +2,7 @@
 
 pragma solidity ^0.8.20;
 
-import {IERC20} from "../../interfaces/IERC20.sol";
-import {ERC20, ERC1363} from "../../token/ERC20/extensions/ERC1363.sol";
+import {ERC1363} from "../../token/ERC20/extensions/ERC1363.sol";
 
 // contract that replicate USDT approval behavior in approveAndCall
 abstract contract ERC1363ForceApproveMock is ERC1363 {

+ 0 - 1
contracts/mocks/token/ERC1363NoReturnMock.sol

@@ -2,7 +2,6 @@
 
 pragma solidity ^0.8.20;
 
-import {IERC20, ERC20} from "../../token/ERC20/ERC20.sol";
 import {ERC1363} from "../../token/ERC20/extensions/ERC1363.sol";
 
 abstract contract ERC1363NoReturnMock is ERC1363 {

+ 28 - 0
contracts/mocks/utils/cryptography/ERC7739Mock.sol

@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: MIT
+
+pragma solidity ^0.8.20;
+
+import {ECDSA} from "../../../utils/cryptography/ECDSA.sol";
+import {EIP712} from "../../../utils/cryptography/EIP712.sol";
+import {ERC7739} from "../../../utils/cryptography/ERC7739.sol";
+import {AbstractSigner} from "../../../utils/cryptography/AbstractSigner.sol";
+
+contract ERC7739ECDSAMock is AbstractSigner, ERC7739 {
+    address private _signer;
+
+    constructor(address signerAddr) EIP712("ERC7739ECDSA", "1") {
+        _signer = signerAddr;
+    }
+
+    function signer() public view virtual returns (address) {
+        return _signer;
+    }
+
+    function _rawSignatureValidation(
+        bytes32 hash,
+        bytes calldata signature
+    ) internal view virtual override returns (bool) {
+        (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);
+        return signer() == recovered && err == ECDSA.RecoverError.NoError;
+    }
+}

+ 1 - 1
contracts/package.json

@@ -1,7 +1,7 @@
 {
   "name": "@openzeppelin/contracts",
   "description": "Secure Smart Contract library for Solidity",
-  "version": "5.2.0",
+  "version": "5.3.0",
   "files": [
     "**/*.sol",
     "/build/contracts/*.json",

+ 1 - 1
contracts/proxy/Clones.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.2.0) (proxy/Clones.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (proxy/Clones.sol)
 
 pragma solidity ^0.8.20;
 

+ 1 - 1
contracts/proxy/utils/Initializable.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/Initializable.sol)
 
 pragma solidity ^0.8.20;
 

+ 1 - 1
contracts/proxy/utils/UUPSUpgradeable.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.2.0) (proxy/utils/UUPSUpgradeable.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/UUPSUpgradeable.sol)
 
 pragma solidity ^0.8.22;
 

+ 6 - 18
contracts/token/ERC1155/ERC1155.sol

@@ -34,9 +34,7 @@ abstract contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI, IER
         _setURI(uri_);
     }
 
-    /**
-     * @dev See {IERC165-supportsInterface}.
-     */
+    /// @inheritdoc IERC165
     function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
         return
             interfaceId == type(IERC1155).interfaceId ||
@@ -58,9 +56,7 @@ abstract contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI, IER
         return _uri;
     }
 
-    /**
-     * @dev See {IERC1155-balanceOf}.
-     */
+    /// @inheritdoc IERC1155
     function balanceOf(address account, uint256 id) public view virtual returns (uint256) {
         return _balances[id][account];
     }
@@ -89,23 +85,17 @@ abstract contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI, IER
         return batchBalances;
     }
 
-    /**
-     * @dev See {IERC1155-setApprovalForAll}.
-     */
+    /// @inheritdoc IERC1155
     function setApprovalForAll(address operator, bool approved) public virtual {
         _setApprovalForAll(_msgSender(), operator, approved);
     }
 
-    /**
-     * @dev See {IERC1155-isApprovedForAll}.
-     */
+    /// @inheritdoc IERC1155
     function isApprovedForAll(address account, address operator) public view virtual returns (bool) {
         return _operatorApprovals[account][operator];
     }
 
-    /**
-     * @dev See {IERC1155-safeTransferFrom}.
-     */
+    /// @inheritdoc IERC1155
     function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes memory data) public virtual {
         address sender = _msgSender();
         if (from != sender && !isApprovedForAll(from, sender)) {
@@ -114,9 +104,7 @@ abstract contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI, IER
         _safeTransferFrom(from, to, id, value, data);
     }
 
-    /**
-     * @dev See {IERC1155-safeBatchTransferFrom}.
-     */
+    /// @inheritdoc IERC1155
     function safeBatchTransferFrom(
         address from,
         address to,

+ 1 - 1
contracts/token/ERC1155/IERC1155.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC1155/IERC1155.sol)
 
 pragma solidity ^0.8.20;
 

+ 1 - 3
contracts/token/ERC1155/extensions/ERC1155Supply.sol

@@ -46,9 +46,7 @@ abstract contract ERC1155Supply is ERC1155 {
         return totalSupply(id) > 0;
     }
 
-    /**
-     * @dev See {ERC1155-_update}.
-     */
+    /// @inheritdoc ERC1155
     function _update(
         address from,
         address to,

+ 1 - 3
contracts/token/ERC1155/utils/ERC1155Holder.sol

@@ -13,9 +13,7 @@ import {IERC1155Receiver} from "../IERC1155Receiver.sol";
  * stuck.
  */
 abstract contract ERC1155Holder is ERC165, IERC1155Receiver {
-    /**
-     * @dev See {IERC165-supportsInterface}.
-     */
+    /// @inheritdoc IERC165
     function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
         return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
     }

+ 3 - 3
contracts/token/ERC1155/utils/ERC1155Utils.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/utils/ERC1155Utils.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC1155/utils/ERC1155Utils.sol)
 
 pragma solidity ^0.8.20;
 
@@ -42,7 +42,7 @@ library ERC1155Utils {
                     revert IERC1155Errors.ERC1155InvalidReceiver(to);
                 } else {
                     assembly ("memory-safe") {
-                        revert(add(32, reason), mload(reason))
+                        revert(add(reason, 0x20), mload(reason))
                     }
                 }
             }
@@ -79,7 +79,7 @@ library ERC1155Utils {
                     revert IERC1155Errors.ERC1155InvalidReceiver(to);
                 } else {
                     assembly ("memory-safe") {
-                        revert(add(32, reason), mload(reason))
+                        revert(add(reason, 0x20), mload(reason))
                     }
                 }
             }

+ 4 - 10
contracts/token/ERC20/ERC20.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/ERC20.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/ERC20.sol)
 
 pragma solidity ^0.8.20;
 
@@ -78,16 +78,12 @@ abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
         return 18;
     }
 
-    /**
-     * @dev See {IERC20-totalSupply}.
-     */
+    /// @inheritdoc IERC20
     function totalSupply() public view virtual returns (uint256) {
         return _totalSupply;
     }
 
-    /**
-     * @dev See {IERC20-balanceOf}.
-     */
+    /// @inheritdoc IERC20
     function balanceOf(address account) public view virtual returns (uint256) {
         return _balances[account];
     }
@@ -106,9 +102,7 @@ abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
         return true;
     }
 
-    /**
-     * @dev See {IERC20-allowance}.
-     */
+    /// @inheritdoc IERC20
     function allowance(address owner, address spender) public view virtual returns (uint256) {
         return _allowances[owner][spender];
     }

+ 1 - 3
contracts/token/ERC20/extensions/ERC1363.sol

@@ -39,9 +39,7 @@ abstract contract ERC1363 is ERC20, ERC165, IERC1363 {
      */
     error ERC1363ApproveFailed(address spender, uint256 value);
 
-    /**
-     * @inheritdoc IERC165
-     */
+    /// @inheritdoc IERC165
     function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
         return interfaceId == type(IERC1363).interfaceId || super.supportsInterface(interfaceId);
     }

+ 1 - 3
contracts/token/ERC20/extensions/ERC20Capped.sol

@@ -39,9 +39,7 @@ abstract contract ERC20Capped is ERC20 {
         return _cap;
     }
 
-    /**
-     * @dev See {ERC20-_update}.
-     */
+    /// @inheritdoc ERC20
     function _update(address from, address to, uint256 value) internal virtual override {
         super._update(from, to, value);
 

+ 3 - 9
contracts/token/ERC20/extensions/ERC20Permit.sol

@@ -38,9 +38,7 @@ abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712, Nonces {
      */
     constructor(string memory name) EIP712(name, "1") {}
 
-    /**
-     * @inheritdoc IERC20Permit
-     */
+    /// @inheritdoc IERC20Permit
     function permit(
         address owner,
         address spender,
@@ -66,16 +64,12 @@ abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712, Nonces {
         _approve(owner, spender, value);
     }
 
-    /**
-     * @inheritdoc IERC20Permit
-     */
+    /// @inheritdoc IERC20Permit
     function nonces(address owner) public view virtual override(IERC20Permit, Nonces) returns (uint256) {
         return super.nonces(owner);
     }
 
-    /**
-     * @inheritdoc IERC20Permit
-     */
+    /// @inheritdoc IERC20Permit
     // solhint-disable-next-line func-name-mixedcase
     function DOMAIN_SEPARATOR() external view virtual returns (bytes32) {
         return _domainSeparatorV4();

+ 1 - 3
contracts/token/ERC20/extensions/ERC20Wrapper.sol

@@ -33,9 +33,7 @@ abstract contract ERC20Wrapper is ERC20 {
         _underlying = underlyingToken;
     }
 
-    /**
-     * @dev See {ERC20-decimals}.
-     */
+    /// @inheritdoc IERC20Metadata
     function decimals() public view virtual override returns (uint8) {
         try IERC20Metadata(address(_underlying)).decimals() returns (uint8 value) {
             return value;

+ 17 - 17
contracts/token/ERC20/extensions/ERC4626.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/ERC4626.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/extensions/ERC4626.sol)
 
 pragma solidity ^0.8.20;
 
@@ -107,67 +107,67 @@ abstract contract ERC4626 is ERC20, IERC4626 {
         return _underlyingDecimals + _decimalsOffset();
     }
 
-    /** @dev See {IERC4626-asset}. */
+    /// @inheritdoc IERC4626
     function asset() public view virtual returns (address) {
         return address(_asset);
     }
 
-    /** @dev See {IERC4626-totalAssets}. */
+    /// @inheritdoc IERC4626
     function totalAssets() public view virtual returns (uint256) {
         return IERC20(asset()).balanceOf(address(this));
     }
 
-    /** @dev See {IERC4626-convertToShares}. */
+    /// @inheritdoc IERC4626
     function convertToShares(uint256 assets) public view virtual returns (uint256) {
         return _convertToShares(assets, Math.Rounding.Floor);
     }
 
-    /** @dev See {IERC4626-convertToAssets}. */
+    /// @inheritdoc IERC4626
     function convertToAssets(uint256 shares) public view virtual returns (uint256) {
         return _convertToAssets(shares, Math.Rounding.Floor);
     }
 
-    /** @dev See {IERC4626-maxDeposit}. */
+    /// @inheritdoc IERC4626
     function maxDeposit(address) public view virtual returns (uint256) {
         return type(uint256).max;
     }
 
-    /** @dev See {IERC4626-maxMint}. */
+    /// @inheritdoc IERC4626
     function maxMint(address) public view virtual returns (uint256) {
         return type(uint256).max;
     }
 
-    /** @dev See {IERC4626-maxWithdraw}. */
+    /// @inheritdoc IERC4626
     function maxWithdraw(address owner) public view virtual returns (uint256) {
         return _convertToAssets(balanceOf(owner), Math.Rounding.Floor);
     }
 
-    /** @dev See {IERC4626-maxRedeem}. */
+    /// @inheritdoc IERC4626
     function maxRedeem(address owner) public view virtual returns (uint256) {
         return balanceOf(owner);
     }
 
-    /** @dev See {IERC4626-previewDeposit}. */
+    /// @inheritdoc IERC4626
     function previewDeposit(uint256 assets) public view virtual returns (uint256) {
         return _convertToShares(assets, Math.Rounding.Floor);
     }
 
-    /** @dev See {IERC4626-previewMint}. */
+    /// @inheritdoc IERC4626
     function previewMint(uint256 shares) public view virtual returns (uint256) {
         return _convertToAssets(shares, Math.Rounding.Ceil);
     }
 
-    /** @dev See {IERC4626-previewWithdraw}. */
+    /// @inheritdoc IERC4626
     function previewWithdraw(uint256 assets) public view virtual returns (uint256) {
         return _convertToShares(assets, Math.Rounding.Ceil);
     }
 
-    /** @dev See {IERC4626-previewRedeem}. */
+    /// @inheritdoc IERC4626
     function previewRedeem(uint256 shares) public view virtual returns (uint256) {
         return _convertToAssets(shares, Math.Rounding.Floor);
     }
 
-    /** @dev See {IERC4626-deposit}. */
+    /// @inheritdoc IERC4626
     function deposit(uint256 assets, address receiver) public virtual returns (uint256) {
         uint256 maxAssets = maxDeposit(receiver);
         if (assets > maxAssets) {
@@ -180,7 +180,7 @@ abstract contract ERC4626 is ERC20, IERC4626 {
         return shares;
     }
 
-    /** @dev See {IERC4626-mint}. */
+    /// @inheritdoc IERC4626
     function mint(uint256 shares, address receiver) public virtual returns (uint256) {
         uint256 maxShares = maxMint(receiver);
         if (shares > maxShares) {
@@ -193,7 +193,7 @@ abstract contract ERC4626 is ERC20, IERC4626 {
         return assets;
     }
 
-    /** @dev See {IERC4626-withdraw}. */
+    /// @inheritdoc IERC4626
     function withdraw(uint256 assets, address receiver, address owner) public virtual returns (uint256) {
         uint256 maxAssets = maxWithdraw(owner);
         if (assets > maxAssets) {
@@ -206,7 +206,7 @@ abstract contract ERC4626 is ERC20, IERC4626 {
         return shares;
     }
 
-    /** @dev See {IERC4626-redeem}. */
+    /// @inheritdoc IERC4626
     function redeem(uint256 shares, address receiver, address owner) public virtual returns (uint256) {
         uint256 maxShares = maxRedeem(owner);
         if (shares > maxShares) {

+ 1 - 1
contracts/token/ERC20/extensions/draft-ERC20TemporaryApproval.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/draft-ERC20TemporaryApproval.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/extensions/draft-ERC20TemporaryApproval.sol)
 
 pragma solidity ^0.8.24;
 

+ 2 - 2
contracts/token/ERC20/utils/ERC1363Utils.sol

@@ -53,7 +53,7 @@ library ERC1363Utils {
                 revert ERC1363InvalidReceiver(to);
             } else {
                 assembly ("memory-safe") {
-                    revert(add(32, reason), mload(reason))
+                    revert(add(reason, 0x20), mload(reason))
                 }
             }
         }
@@ -87,7 +87,7 @@ library ERC1363Utils {
                 revert ERC1363InvalidSpender(spender);
             } else {
                 assembly ("memory-safe") {
-                    revert(add(32, reason), mload(reason))
+                    revert(add(reason, 0x20), mload(reason))
                 }
             }
         }

+ 1 - 1
contracts/token/ERC20/utils/SafeERC20.sol

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: MIT
-// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/utils/SafeERC20.sol)
+// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/utils/SafeERC20.sol)
 
 pragma solidity ^0.8.20;
 

+ 5 - 5
contracts/token/ERC6909/draft-ERC6909.sol

@@ -1,4 +1,5 @@
 // SPDX-License-Identifier: MIT
+// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC6909/draft-ERC6909.sol)
 
 pragma solidity ^0.8.20;
 
@@ -79,7 +80,7 @@ contract ERC6909 is Context, ERC165, IERC6909 {
 
     /**
      * @dev Creates `amount` of token `id` and assigns them to `account`, by transferring it from address(0).
-     * Relies on the `_update` mechanism
+     * Relies on the `_update` mechanism.
      *
      * Emits a {Transfer} event with `from` set to the zero address.
      *
@@ -93,10 +94,9 @@ contract ERC6909 is Context, ERC165, IERC6909 {
     }
 
     /**
-     * @dev Moves `amount` of token `id` from `from` to `to` without checking for approvals.
-     *
-     * This internal function is equivalent to {transfer}, and can be used to
-     * e.g. implement automatic token fees, slashing mechanisms, etc.
+     * @dev Moves `amount` of token `id` from `from` to `to` without checking for approvals. This function verifies
+     * that neither the sender nor the receiver are address(0), which means it cannot mint or burn tokens.
+     * Relies on the `_update` mechanism.
      *
      * Emits a {Transfer} event.
      *

Some files were not shown because too many files changed in this diff