Hi, instead of writing import statements like this:
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { ERC20Burnable } from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import { ERC20Permit } from "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol";
import { ERC20Votes } from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
contract MyToken is ERC20, ERC20Burnable, Ownable, ERC20Permit, ERC20Votes {
I decided to simplify it like this:
import { ERC20, ERC20Burnable } from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import { ERC20Votes, ERC20Permit } from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
contract MyToken is ERC20Burnable, Ownable, ERC20Votes {
My questions are:
- Is it okay to do it like this, or does this cause some unwanted consequences?
- AFAIK the order of placing extensions matters. In my case I put the ERC20Votes in the last place (
is ERC20Burnable, Ownable, ERC20Votes
). Is that correct? Or should it be placed somewhere else, for example in the first place (is ERC20Votes, ERC20Burnable, Ownable
)?
Thanks!