A new subject just came up as our team has recently decided not to consider the Pause function anymore. Before we implement this decision I would like to understand the following concern:
If I instead use the following imports in the New Contract Proposal:
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Capped.sol";
contract FilmVaultToken is ERC20, ERC20Capped {
constructor () ERC20("FilmVault", "FilmVault") ERC20Capped(1000000 * (10 ** uint256(9))) public {
_setupDecimals(9);
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override(ERC20PresetMinterPauser, ERC20Capped) {
super._beforeTokenTransfer(from, to, amount);
}
}
Does the account that deploys this contract would still have the exclusive DEFAULT_ADMIN_ROLE and the exclusive MINTER_ROLE or does it have to be assigned within the constructor.?
If you want a mintable ERC20 token but don’t need it to be pausable, then you can take the ideas from the Preset contract and extend ERC20 yourself.
Currently your token extends from ERC20 and ERC20Capped but doesn’t have a mint function. So if you want a non-fixed supply then you would need to add mint functionality appropriately protected by Access Control. Previously you were extending from ERC20PresetMinterPauser which has mint functionality.
As an aside you can Format code in the forum. This makes it much easier to read with syntax highlighting.
Questions can be answered by anyone in the community so I recommend not tagging people unless you need a specific response, or you want to alert me that no one has answered.