Solidity ERC-20 – How to Use MintableToken, PausableToken, and DetailedERC20 in OpenZeppelin v4.4.2

erc-20openzeppelin-contractssolidity

I am trying to Create Token and Initial Coin Offering Contracts Using Truffle + Zeppelin Solidity. so i installed openZeppelin , truffle , node js , and solidity.

The following veresions of these softwares installed

Truffle: v5.4.30 
Solidity: v0.5.16 (solc-js)
Node: v16.13.2
Web3.js: v1.5.3
openzeppelin:v4.4.2

so now i'am trying to import the following files

"DetailedERC20.sol";
"MintableToken.sol";
"PausableToken.sol";

but i did not see any of these files in my node_modules/openzepplein directory as you can see in the image attached below

Following files are present there.

ERC-20 files in openzeppelin v3.0.0

and when i read the documentation and search for these files i found these files are deprecated after the release of v3 of openZeppelin.

So what should i do know if i want to use the following function of these files
MintableToken,
PausableToken,
DetailedERC20

i am continuously searching for these files but i did not find anything.

is there any possible solution for these files how to use their functions.

Best Answer

  • For PausableToken use the ERC20Pausable.sol one.
  • For MintableToken if you use the wizard they suggest a combination of the ERC20.sol and the Ownable.sol the one.
  • For DetailedERC20 there is no replacement because they merged that with the ERC20.sol so just with using ERC20.sol you're using DetailedERC20.

If you still want to use the originals you can check their repo on the v2.5 version and just use whatever code you need from there.

Related Topic