OpenZeppelin / openzeppelin-contracts

OpenZeppelin Contracts is a library for secure smart contract development.
https://openzeppelin.com/contracts
MIT License
25.03k stars 11.82k forks source link

Request for hybrid Detailed-Mintable ERC20 Token #2163

Closed bh2smith closed 4 years ago

bh2smith commented 4 years ago

🧐 Motivation When testing or scripting with smart contracts involving arithmetic between multiple ERC20 tokens (like an Exchange) it can be very useful to have access to a DetailedMintableERC20 which is both a MintableERC20 and DetailedERC20 so that tokens can be minted for deposit, withdraw etc... while having access to relevant values such as number of decimals (for computing exchange rates and such). The above described example is already use in both gnosis/dex-contracts here and gnosis/dex-liquidity-provision here (soon to be more).

📝 Details This simple feature should amount to the introduction of a new contract that is both Mintable and Detailed ERC20

Example implementations could be either of:

pragma solidity ^0.5.0;

import "./ERC20Detailed.sol";
import "./ERC20Mintable.sol";

contract ERC20DetailedMintable is ERC20Mintable, ERC20Detailed {
    constructor(string memory name, string memory symbol, uint8 decimals) public ERC20Detailed(name, symbol, decimals) {}
}
abcoathup commented 4 years ago

Hi @bh2smith! Thanks for the suggestion, it is really appreciated.

The project owner has linked to #2167 which should address this suggestion.

bh2smith commented 4 years ago

The project owner has linked to #2167 which should address this suggestion.

Yes it does thanks. That along with the fact that ERC20Detailedhas been recently merged into ERC20 should be exactly what I was hoping for.