From 26d12ba2390d77da65183a4c7d3b67d6fe1e6a58 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Wed, 10 Apr 2019 13:54:55 +0200 Subject: [PATCH 1/2] Store kredits tokens as wei with 18 decimals This stores the tokens with 18 decimals as most other tokens and as assumed by a potential future token standard EIP 777. --- apps/token/contracts/Token.sol | 6 +++++- scripts/list-contributors.js | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/token/contracts/Token.sol b/apps/token/contracts/Token.sol index 098c7de..7022058 100644 --- a/apps/token/contracts/Token.sol +++ b/apps/token/contracts/Token.sol @@ -14,11 +14,15 @@ contract Token is ERC20Token, AragonApp { function initialize(bytes32[4] _appIds) public onlyInit { appIds = _appIds; + name = 'Kredits'; + symbol = 'K'; + decimals = 18; initialized(); } function mintFor(address contributorAccount, uint256 amount, uint32 contributionId) public isInitialized auth(MINT_TOKEN_ROLE) { - _mint(contributorAccount, amount); + uint256 amountInWei = amount.mul(1 ether); + _mint(contributorAccount, amountInWei); emit LogMint(contributorAccount, amount, contributionId); } diff --git a/scripts/list-contributors.js b/scripts/list-contributors.js index c6944b8..14e602c 100644 --- a/scripts/list-contributors.js +++ b/scripts/list-contributors.js @@ -1,5 +1,6 @@ const promptly = require('promptly'); const Table = require('cli-table'); +const ethers = require('ethers'); const initKredits = require('./helpers/init_kredits.js'); @@ -27,7 +28,7 @@ module.exports = async function(callback) { c.account, c.isCore, `${c.name}`, - c.balance.toString() + ethers.utils.formatEther(c.balance) ]) }) console.log(table.toString()) -- 2.25.1 From 4d2e0ea84b026351b689a2d0e7219ed178f15b39 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Wed, 10 Apr 2019 15:50:33 +0200 Subject: [PATCH 2/2] Update Token symbol --- apps/token/contracts/Token.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/token/contracts/Token.sol b/apps/token/contracts/Token.sol index 7022058..3fe68a4 100644 --- a/apps/token/contracts/Token.sol +++ b/apps/token/contracts/Token.sol @@ -15,7 +15,7 @@ contract Token is ERC20Token, AragonApp { function initialize(bytes32[4] _appIds) public onlyInit { appIds = _appIds; name = 'Kredits'; - symbol = 'K'; + symbol = '₭S'; decimals = 18; initialized(); } -- 2.25.1