From 700bf61c4d5812da7bf51e23f34721ce057f7ff2 Mon Sep 17 00:00:00 2001 From: Pandapip1 <45835846+Pandapip1@users.noreply.github.com> Date: Tue, 1 Nov 2022 08:29:31 -0400 Subject: [PATCH 1/4] Remove outdated note about hooks from documentation --- docs/modules/ROOT/pages/extending-contracts.adoc | 7 ------- 1 file changed, 7 deletions(-) diff --git a/docs/modules/ROOT/pages/extending-contracts.adoc b/docs/modules/ROOT/pages/extending-contracts.adoc index 022dfc95751..6ae68a858f9 100644 --- a/docs/modules/ROOT/pages/extending-contracts.adoc +++ b/docs/modules/ROOT/pages/extending-contracts.adoc @@ -103,13 +103,6 @@ contract ERC20WithSafeTransfer is ERC20 { Using hooks this way leads to cleaner and safer code, without having to rely on a deep understanding of the parent's internals. -[NOTE] -==== -Hooks are a new feature of OpenZeppelin Contracts v3.0.0, and we're eager to learn how you plan to use them! - -So far, the only available hook is `_beforeTransferHook`, in all of xref:api:token/ERC20.adoc#ERC20-_beforeTokenTransfer-address-address-uint256-[`ERC20`], xref:api:token/ERC721.adoc#ERC721-_beforeTokenTransfer-address-address-uint256-[`ERC721`], xref:api:token/ERC777.adoc#ERC777-_beforeTokenTransfer-address-address-address-uint256-[`ERC777`] and xref:api:token/ERC1155.adoc#ERC1155-_beforeTokenTransfer-address-address-address-uint256---uint256---bytes-[`ERC1155`]. If you have ideas for new hooks, let us know! -==== - === Rules of Hooks There's a few guidelines you should follow when writing code that uses hooks in order to prevent issues. They are very simple, but do make sure you follow them: From d2249c0a7b321efe806d5a20f51e5f3f3dd39683 Mon Sep 17 00:00:00 2001 From: Pandapip1 <45835846+Pandapip1@users.noreply.github.com> Date: Tue, 1 Nov 2022 08:32:44 -0400 Subject: [PATCH 2/4] Add item to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3093bf90ec..35d358ba0be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased + * Removed outdated note about hooks from the ["Extending Contracts"](https://docs.openzeppelin.com/contracts/4.x/extending-contracts) documentation page. ([#3789](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3789)) * `ReentrancyGuard`: Add a `_reentrancyGuardEntered` function to expose the guard status. ([#3714](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3714)) * `ERC20Votes`: optimize by using unchecked arithmetic. ([#3748](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3748)) From 2d28501f9fef5e18812addf04617c329e8b3de37 Mon Sep 17 00:00:00 2001 From: Francisco Date: Fri, 4 Nov 2022 12:57:13 -0300 Subject: [PATCH 3/4] Update CHANGELOG.md --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35d358ba0be..fb486adaf68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,7 @@ ## Unreleased - * Removed outdated note about hooks from the ["Extending Contracts"](https://docs.openzeppelin.com/contracts/4.x/extending-contracts) documentation page. ([#3789](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3789)) - * `ReentrancyGuard`: Add a `_reentrancyGuardEntered` function to expose the guard status. ([#3714](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3714)) +* `ReentrancyGuard`: Add a `_reentrancyGuardEntered` function to expose the guard status. ([#3714](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3714)) * `ERC20Votes`: optimize by using unchecked arithmetic. ([#3748](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3748)) ## Unreleased From c66bef9be511a469b714e9e2045e7fd7b1a2449b Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Fri, 4 Nov 2022 17:47:18 +0100 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb486adaf68..f3093bf90ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -* `ReentrancyGuard`: Add a `_reentrancyGuardEntered` function to expose the guard status. ([#3714](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3714)) + * `ReentrancyGuard`: Add a `_reentrancyGuardEntered` function to expose the guard status. ([#3714](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3714)) * `ERC20Votes`: optimize by using unchecked arithmetic. ([#3748](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3748)) ## Unreleased