From 71197e7a6e452fe1cad2baabc59c96f0afb41e64 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Thu, 26 Jan 2023 18:41:13 -0600 Subject: [PATCH 1/9] Add ERC20Pausable `_pause()` and `_unpause()` interfaces warning --- contracts/token/ERC20/extensions/ERC20Pausable.sol | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contracts/token/ERC20/extensions/ERC20Pausable.sol b/contracts/token/ERC20/extensions/ERC20Pausable.sol index d0b224f4b9a..3fe69c2f2d2 100644 --- a/contracts/token/ERC20/extensions/ERC20Pausable.sol +++ b/contracts/token/ERC20/extensions/ERC20Pausable.sol @@ -12,6 +12,11 @@ import "../../../security/Pausable.sol"; * Useful for scenarios such as preventing trades until the end of an evaluation * period, or having an emergency switch for freezing all token transfers in the * event of a large bug. + * + * WARNING: Using it requires securely exposing both {Pausable-_pause} and + * {Pausable-_unpause} internal functions since {Pausable} is intended to be used + * through inheritance. This is done in order to allow both {AccessControl} and + * {Ownable} restricted pause mechanisms. Not doing so will make the contract unpausable. */ abstract contract ERC20Pausable is ERC20, Pausable { /** From 17cfabbfd508c3d0ab338086575435a1c08bf760 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Thu, 26 Jan 2023 18:50:40 -0600 Subject: [PATCH 2/9] Improve wording --- contracts/token/ERC20/extensions/ERC20Pausable.sol | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/contracts/token/ERC20/extensions/ERC20Pausable.sol b/contracts/token/ERC20/extensions/ERC20Pausable.sol index 3fe69c2f2d2..92ca77434f3 100644 --- a/contracts/token/ERC20/extensions/ERC20Pausable.sol +++ b/contracts/token/ERC20/extensions/ERC20Pausable.sol @@ -13,10 +13,11 @@ import "../../../security/Pausable.sol"; * period, or having an emergency switch for freezing all token transfers in the * event of a large bug. * - * WARNING: Using it requires securely exposing both {Pausable-_pause} and - * {Pausable-_unpause} internal functions since {Pausable} is intended to be used - * through inheritance. This is done in order to allow both {AccessControl} and - * {Ownable} restricted pause mechanisms. Not doing so will make the contract unpausable. + * WARNING: Using it requires securely exposing and adding access control to both + * {Pausable-_pause} and {Pausable-_unpause} internal functions since {Pausable} is + * intended to be used through inheritance. This is done in order to allow both + * {AccessControl} and {Ownable} pause restriction mechanisms. Not doing so will + * make the contract unpausable. */ abstract contract ERC20Pausable is ERC20, Pausable { /** From c87fea516e86cf31d2f492a57141257d9206133c Mon Sep 17 00:00:00 2001 From: ernestognw Date: Thu, 26 Jan 2023 19:05:20 -0600 Subject: [PATCH 3/9] Add changesets --- .changeset/new-ways-own.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/new-ways-own.md diff --git a/.changeset/new-ways-own.md b/.changeset/new-ways-own.md new file mode 100644 index 00000000000..9546d5a2cfd --- /dev/null +++ b/.changeset/new-ways-own.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': patch +--- + +`Pausable`: Add a warning regarding the missing public pausing functionality From 5637ec8c6705e58d93b2a10fa517518ffb26f9b4 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Thu, 26 Jan 2023 19:07:14 -0600 Subject: [PATCH 4/9] Fix changeset --- .changeset/new-ways-own.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/new-ways-own.md b/.changeset/new-ways-own.md index 9546d5a2cfd..4038f6dda16 100644 --- a/.changeset/new-ways-own.md +++ b/.changeset/new-ways-own.md @@ -2,4 +2,4 @@ 'openzeppelin-solidity': patch --- -`Pausable`: Add a warning regarding the missing public pausing functionality +`ERC20Pausable`: Add a warning regarding the missing public pausing functionality From f1626deb5060447193aeef64362a5dd022eab6bb Mon Sep 17 00:00:00 2001 From: ernestognw Date: Thu, 26 Jan 2023 19:09:56 -0600 Subject: [PATCH 5/9] Run linter --- contracts/token/ERC20/extensions/ERC20Pausable.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/token/ERC20/extensions/ERC20Pausable.sol b/contracts/token/ERC20/extensions/ERC20Pausable.sol index 92ca77434f3..058021946df 100644 --- a/contracts/token/ERC20/extensions/ERC20Pausable.sol +++ b/contracts/token/ERC20/extensions/ERC20Pausable.sol @@ -14,9 +14,9 @@ import "../../../security/Pausable.sol"; * event of a large bug. * * WARNING: Using it requires securely exposing and adding access control to both - * {Pausable-_pause} and {Pausable-_unpause} internal functions since {Pausable} is - * intended to be used through inheritance. This is done in order to allow both - * {AccessControl} and {Ownable} pause restriction mechanisms. Not doing so will + * {Pausable-_pause} and {Pausable-_unpause} internal functions since {Pausable} is + * intended to be used through inheritance. This is done in order to allow both + * {AccessControl} and {Ownable} pause restriction mechanisms. Not doing so will * make the contract unpausable. */ abstract contract ERC20Pausable is ERC20, Pausable { From dd9108ad0c7486efbd40f2f8714b366c1d0a4bd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernesto=20Garc=C3=ADa?= Date: Fri, 27 Jan 2023 18:22:49 -0600 Subject: [PATCH 6/9] Update contracts/token/ERC20/extensions/ERC20Pausable.sol Co-authored-by: Francisco --- contracts/token/ERC20/extensions/ERC20Pausable.sol | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contracts/token/ERC20/extensions/ERC20Pausable.sol b/contracts/token/ERC20/extensions/ERC20Pausable.sol index 058021946df..e011f08c045 100644 --- a/contracts/token/ERC20/extensions/ERC20Pausable.sol +++ b/contracts/token/ERC20/extensions/ERC20Pausable.sol @@ -13,10 +13,10 @@ import "../../../security/Pausable.sol"; * period, or having an emergency switch for freezing all token transfers in the * event of a large bug. * - * WARNING: Using it requires securely exposing and adding access control to both - * {Pausable-_pause} and {Pausable-_unpause} internal functions since {Pausable} is - * intended to be used through inheritance. This is done in order to allow both - * {AccessControl} and {Ownable} pause restriction mechanisms. Not doing so will + * IMPORTANT: This contract does not include public pause and unpause functions. In + * addition to inheriting this contract, you must define both functions, invoking the + * {Pausable-_pause} and {Pausable-_unpause} internal functions, with appropriate + * access control, e.g. using {AccessControl} or {Ownable}. Not doing so will * make the contract unpausable. */ abstract contract ERC20Pausable is ERC20, Pausable { From 3391767eff597c0b7b21824fc8602c59510ea013 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 27 Jan 2023 18:24:58 -0600 Subject: [PATCH 7/9] Added comments to other ERCs --- .changeset/new-ways-own.md | 2 +- contracts/token/ERC1155/extensions/ERC1155Pausable.sol | 6 ++++++ contracts/token/ERC721/extensions/ERC721Pausable.sol | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.changeset/new-ways-own.md b/.changeset/new-ways-own.md index 4038f6dda16..0c350708d83 100644 --- a/.changeset/new-ways-own.md +++ b/.changeset/new-ways-own.md @@ -2,4 +2,4 @@ 'openzeppelin-solidity': patch --- -`ERC20Pausable`: Add a warning regarding the missing public pausing functionality +`ERC*Pausable`: Add note regarding missing public pausing functionality diff --git a/contracts/token/ERC1155/extensions/ERC1155Pausable.sol b/contracts/token/ERC1155/extensions/ERC1155Pausable.sol index 64790e2aa8d..dd06e6949a8 100644 --- a/contracts/token/ERC1155/extensions/ERC1155Pausable.sol +++ b/contracts/token/ERC1155/extensions/ERC1155Pausable.sol @@ -13,6 +13,12 @@ import "../../../security/Pausable.sol"; * period, or having an emergency switch for freezing all token transfers in the * event of a large bug. * + * IMPORTANT: This contract does not include public pause and unpause functions. In + * addition to inheriting this contract, you must define both functions, invoking the + * {Pausable-_pause} and {Pausable-_unpause} internal functions, with appropriate + * access control, e.g. using {AccessControl} or {Ownable}. Not doing so will + * make the contract unpausable. + * * _Available since v3.1._ */ abstract contract ERC1155Pausable is ERC1155, Pausable { diff --git a/contracts/token/ERC721/extensions/ERC721Pausable.sol b/contracts/token/ERC721/extensions/ERC721Pausable.sol index 4726540f47e..cdd729b2694 100644 --- a/contracts/token/ERC721/extensions/ERC721Pausable.sol +++ b/contracts/token/ERC721/extensions/ERC721Pausable.sol @@ -12,6 +12,12 @@ import "../../../security/Pausable.sol"; * Useful for scenarios such as preventing trades until the end of an evaluation * period, or having an emergency switch for freezing all token transfers in the * event of a large bug. + * + * IMPORTANT: This contract does not include public pause and unpause functions. In + * addition to inheriting this contract, you must define both functions, invoking the + * {Pausable-_pause} and {Pausable-_unpause} internal functions, with appropriate + * access control, e.g. using {AccessControl} or {Ownable}. Not doing so will + * make the contract unpausable. */ abstract contract ERC721Pausable is ERC721, Pausable { /** From 907ad5b6cf26e42495ad4390df849c535f4efc4a Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 27 Jan 2023 21:04:13 -0600 Subject: [PATCH 8/9] Lint --- contracts/token/ERC1155/extensions/ERC1155Pausable.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/token/ERC1155/extensions/ERC1155Pausable.sol b/contracts/token/ERC1155/extensions/ERC1155Pausable.sol index dd06e6949a8..66ad55e7df2 100644 --- a/contracts/token/ERC1155/extensions/ERC1155Pausable.sol +++ b/contracts/token/ERC1155/extensions/ERC1155Pausable.sol @@ -18,7 +18,7 @@ import "../../../security/Pausable.sol"; * {Pausable-_pause} and {Pausable-_unpause} internal functions, with appropriate * access control, e.g. using {AccessControl} or {Ownable}. Not doing so will * make the contract unpausable. - * + * * _Available since v3.1._ */ abstract contract ERC1155Pausable is ERC1155, Pausable { From 2a86021d69ead1b8daa0557de80a7227657076df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernesto=20Garc=C3=ADa?= Date: Sat, 28 Jan 2023 17:04:55 -0600 Subject: [PATCH 9/9] Update .changeset/new-ways-own.md Co-authored-by: Francisco --- .changeset/new-ways-own.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/new-ways-own.md b/.changeset/new-ways-own.md index 0c350708d83..f940bfeb730 100644 --- a/.changeset/new-ways-own.md +++ b/.changeset/new-ways-own.md @@ -2,4 +2,4 @@ 'openzeppelin-solidity': patch --- -`ERC*Pausable`: Add note regarding missing public pausing functionality +`ERC20Pausable`, `ERC721Pausable`, `ERC1155Pausable`: Add note regarding missing public pausing functionality