Which version of OpenZeppelin is stable to create a new Currency?

Hi, I have to create new currency for that I am using Openzeppelin.
Main feature of currency are following:
1- Mintable
2- Capable
3- Burnable
4- Pausable
5- Vesting.

May be we also use upgradeable contract. So according to these features which version of Openzeppelin will stable and suitable 3.x or 2.x ?

2 Likes

Hi @hussammustafa,

I would suggest using the latest version of OpenZeppelin Contracts v3.x (currently v3.2) with Solidity 0.6.
Though the Solidity version will likely change in future releases to Solidity 0.7.

For the functionality you mentioned please see the following documentation:

For minting see the Preset contract for an example of using AccessControl:

For simple vesting you could look at TokenTimelock:

If you want the contract to be upgradeable then you will need to use the upgrade safe fork which is OpenZeppelin Contracts Ethereum Package (The Future of contracts-ethereum-package). You can deploy upgradeable contracts using OpenZeppelin Upgrades Plugins for Truffle and Buidler: https://docs.openzeppelin.com/upgrades-plugins/1.x/

1 Like

Hi @abcoathup I i am using solidity version 0.6 but Proxy Contracts are not working giving errors. Is there any example available for reference. Thanks

1 Like

Can you share what errors you're seeing?

1 Like

I am getting this error while compiling.

ParserError: Expected β€˜(’ but got β€˜,’
let result := delegatecall(gas, _impl, add(data, 0x20), mload(data), 0, 0)

This error is coming after (gas, ).

1 Like

Hi @hussammustafa,

How are you deploying? I suggest using OpenZeppelin Upgrades Plugins with either Truffle or Buidler: https://docs.openzeppelin.com/upgrades-plugins/1.x/

For an example ERC20 contract that is upgrade safe, please see:

I tried open zeppelin truffle plugin but it is using solidity version ^0.7.0. But I am working on solidity version 0.6.0

1 Like

Hi @hussammustafa,

You can use Solidity 0.6 with OpenZeppelin Upgrades Truffle plugin.

The step by step tutorial has example contracts using Solidity 0.7 but you can change all of these to Solidity 0.6 as the contracts are very simple.

Hi @abcoathup

Then how to verify contract on ether scan test network.

Thanks.

1 Like

Hi @hussammustafa,

To verify I recommend the following: Verify smart contract inheriting from OpenZeppelin Contracts

If you have any issues, let me know and I can try to help.

HI, @abcoathup,

You suggested me to make upgradeable contract using ( Upgrades Truffle plugin) . tried this example and now I want to deploy and verify this on etherscan using ropsten or rinkeby, Please suggest some solution for this.

Thanks

1 Like

Hi @hussammustafa,

I would verify the implementation contract using the Buidler Etherscan plugin. (There is a Truffle plugin but this flattens currently, though in future should support multi-file verification).

The proxy and ProxyAdmin contracts should be verified. If they are not I can verify these (using Verify Upgrades Plugins proxy on Etherscan)

Hi @abcoathup,

I just have two files Box.sol and BoxV2.sol no proxy and proxyAdmin contracts.

1 Like

Hi @hussammustafa,

You can verify the Box and BoxV2 implementation contracts using the Etherscan web interface as they are only single file. It should be straight forward as they don’t have any constructor parameters. Let me know if you need help with this.