I'm confused about some discrepancies I'm seeing around the upgradeable contracts.
There are three places I'm specifically considering:
- The contract wizard which uses the set of specifically upgradeable contracts:
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PermitUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20FlashMintUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
-
The official documentation: https://docs.openzeppelin.com/contracts/5.x/upgradeable#usage
-
A post in the forum which suggests another way: Is IERC20Upgradeable removed from contracts-upgradeable?
- import from "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
- import from "@openzeppelin/contracts-upgradeable/interfaces/IERC20Upgradeable.sol";
+ import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
+ import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20".sol";
- using SafeERC20Upgradeable for IERC20Upgradeable
+ using SafeERC20 for IERC20;
1 and 2 are in agreement but 3 seems to say otherwise. And 3 is a response from an OpenZeppelin staff member.
Which is the preferred way? Is it just that the docs and wizard haven't been updated yet?