From cb0c1443f9b0aded3b08dfb3088f5ed5c9c72bea Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 31 Jan 2023 00:03:02 +0000 Subject: [PATCH] Transpile e541d4ae --- .changeset/new-ways-own.md | 5 +++++ .../token/ERC1155/extensions/ERC1155PausableUpgradeable.sol | 6 ++++++ .../token/ERC20/extensions/ERC20PausableUpgradeable.sol | 6 ++++++ .../token/ERC721/extensions/ERC721PausableUpgradeable.sol | 6 ++++++ docs/modules/ROOT/pages/extending-contracts.adoc | 2 -- 5 files changed, 23 insertions(+), 2 deletions(-) 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 000000000..f940bfeb7 --- /dev/null +++ b/.changeset/new-ways-own.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': patch +--- + +`ERC20Pausable`, `ERC721Pausable`, `ERC1155Pausable`: Add note regarding missing public pausing functionality diff --git a/contracts/token/ERC1155/extensions/ERC1155PausableUpgradeable.sol b/contracts/token/ERC1155/extensions/ERC1155PausableUpgradeable.sol index 93e9edeb1..e07278ab4 100644 --- a/contracts/token/ERC1155/extensions/ERC1155PausableUpgradeable.sol +++ b/contracts/token/ERC1155/extensions/ERC1155PausableUpgradeable.sol @@ -14,6 +14,12 @@ import "../../../proxy/utils/Initializable.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 ERC1155PausableUpgradeable is Initializable, ERC1155Upgradeable, PausableUpgradeable { diff --git a/contracts/token/ERC20/extensions/ERC20PausableUpgradeable.sol b/contracts/token/ERC20/extensions/ERC20PausableUpgradeable.sol index d53070b7a..1b29f81a1 100644 --- a/contracts/token/ERC20/extensions/ERC20PausableUpgradeable.sol +++ b/contracts/token/ERC20/extensions/ERC20PausableUpgradeable.sol @@ -13,6 +13,12 @@ import "../../../proxy/utils/Initializable.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 ERC20PausableUpgradeable is Initializable, ERC20Upgradeable, PausableUpgradeable { function __ERC20Pausable_init() internal onlyInitializing { diff --git a/contracts/token/ERC721/extensions/ERC721PausableUpgradeable.sol b/contracts/token/ERC721/extensions/ERC721PausableUpgradeable.sol index 6109e1c1d..c5b01bce7 100644 --- a/contracts/token/ERC721/extensions/ERC721PausableUpgradeable.sol +++ b/contracts/token/ERC721/extensions/ERC721PausableUpgradeable.sol @@ -13,6 +13,12 @@ import "../../../proxy/utils/Initializable.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 ERC721PausableUpgradeable is Initializable, ERC721Upgradeable, PausableUpgradeable { function __ERC721Pausable_init() internal onlyInitializing { diff --git a/docs/modules/ROOT/pages/extending-contracts.adoc b/docs/modules/ROOT/pages/extending-contracts.adoc index 7330fc997..a440f4067 100644 --- a/docs/modules/ROOT/pages/extending-contracts.adoc +++ b/docs/modules/ROOT/pages/extending-contracts.adoc @@ -66,8 +66,6 @@ contract ModifiedAccessControl is AccessControl { The `super.revokeRole` statement at the end will invoke ``AccessControl``'s original version of `revokeRole`, the same code that would've run if there were no overrides in place. -NOTE: As of v3.0.0, `view` functions are not `virtual` in OpenZeppelin, and therefore cannot be overridden. We're considering https://github.com/OpenZeppelin/openzeppelin-contracts/issues/2154[lifting this restriction] in an upcoming release. Let us know if this is something you care about! - [[using-hooks]] == Using Hooks