From e5311eb1978557eb52de4f6d4070965b43934eed Mon Sep 17 00:00:00 2001 From: Kostiantyn Smyrnov Date: Fri, 13 Nov 2020 21:02:23 +0200 Subject: [PATCH] added ERC20Configurable --- contracts/ERC20/ERC20Configurable.sol | 23 +++++++++++++++++++++++ package-lock.json | 2 +- package.json | 6 ++++-- 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 contracts/ERC20/ERC20Configurable.sol diff --git a/contracts/ERC20/ERC20Configurable.sol b/contracts/ERC20/ERC20Configurable.sol new file mode 100644 index 0000000..a2d48d9 --- /dev/null +++ b/contracts/ERC20/ERC20Configurable.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.6.0; + +import "@openzeppelin/contracts/GSN/Context.sol"; +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; + +/** + * @dev Easy configurable token + */ +contract ERC20Configurable is Context, ERC20 { + + /// @dev Token constructor + constructor( + string memory name, + string memory symbol, + uint8 decimals, + uint256 supply + ) public ERC20(name, symbol) { + _setupDecimals(decimals); + _mint(msg.sender, supply); + } +} diff --git a/package-lock.json b/package-lock.json index b9349d8..b293787 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@windingtree/smart-contracts-libraries", - "version": "0.1.2", + "version": "0.1.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7087600..d206033 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/smart-contracts-libraries", - "version": "0.1.4", + "version": "0.2.0", "description": "Libraries and utilities for smart contracts", "publishConfig": { "access": "public" @@ -27,7 +27,9 @@ "url": "https://github.com/windingtree/smart-contracts-libraries/issues" }, "homepage": "https://github.com/windingtree/smart-contracts-libraries#readme", - "dependencies": {}, + "dependencies": { + "@openzeppelin/contracts": "3.2.0" + }, "devDependencies": { "solc": "0.7.4", "solhint": "3.3.2",