From f2317374ca33f6845f62fac568fa11ee62afa18d Mon Sep 17 00:00:00 2001 From: billy rennekamp Date: Sat, 1 May 2021 10:44:12 +0200 Subject: [PATCH] convert bignumber t bigfloat --- contracts/Doneth.sol | 10 +- package.json | 2 +- src/components/AllocationBar.vue | 12 +- src/components/Contract.vue | 4 +- src/components/ExpenseAllocateForm.vue | 8 +- src/components/ExpenseCard.vue | 8 +- src/components/ExpenseWithdrawForm.vue | 15 +- src/components/PatronCard.vue | 30 +- src/components/PatronWithdrawForm.vue | 20 +- src/components/TransactionsList.vue | 5 +- src/scss/_variables.scss | 2 +- src/store/actions.js | 34 +- src/store/getters.js | 4 +- src/store/mutations.js | 10 +- yarn.lock | 10081 +++++++++++++++++++++++ 15 files changed, 10184 insertions(+), 61 deletions(-) create mode 100644 yarn.lock diff --git a/contracts/Doneth.sol b/contracts/Doneth.sol index 65913f03..b6bd721f 100644 --- a/contracts/Doneth.sol +++ b/contracts/Doneth.sol @@ -40,6 +40,8 @@ contract Ownable { contract Doneth is Ownable { using SafeMath for uint256; + bool initiated; + // Name of the contract string public name; @@ -79,12 +81,16 @@ contract Doneth is Ownable { uint256 totalWithdrawn; } - function Doneth(string _contractName, string _founderName) { + function Doneth() {} + + function init(string _contractName, string _founderName) { + require(!initiated, "ALREADY_INITATED"); + initiated = true; if (bytes(_contractName).length > 21) revert(); if (bytes(_founderName).length > 21) revert(); name = _contractName; genesisBlockNumber = block.number; - addMember(msg.sender, 1, true, _founderName); + addMember(msg.origin, 1, true, _founderName); } event Deposit(address from, uint value); diff --git a/package.json b/package.json index 30993dcd..6506088f 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "dependencies": { "@babel/plugin-transform-spread": "^7.13.0", "axios": "^0.21.1", - "bignumber.js": "9.0.1", + "bigfloat.js": "^3.0.1", "moment": "^2.29.1", "solc": "^0.8.4", "vue": "^2.5.2", diff --git a/src/components/AllocationBar.vue b/src/components/AllocationBar.vue index d7014364..e4244bdb 100644 --- a/src/components/AllocationBar.vue +++ b/src/components/AllocationBar.vue @@ -10,6 +10,8 @@