From 9199a70e4b177c666046226386a2a8449a9106bd Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 19 Aug 2021 19:24:42 +0200 Subject: [PATCH] Governance: Token Distribution command gov.pay implemented and tested. --- Client/client.js | 2 +- Client/httpInterface.js | 5 +- Client/package-lock.json | 30 +++ Client/package.json | 2 + Client/web3Server.js | 84 +++++++- Projects/Foundations/Icons/web3-api.png | Bin 0 -> 15217 bytes .../Schemas/App-Schema/Api/apis.json | 13 ++ .../Schemas/App-Schema/web3-api.json | 35 ++++ .../Governance/Plugins/Pools/Superalgos.json | 2 +- .../User-Profiles/Luis-Fernando-Molina.json | 192 +++++++++++++----- Projects/Governance/UI/Globals/SaToken.js | 4 +- .../Spaces/Reports-Space/CommandInterface.js | 85 ++++++-- .../UI/Spaces/Reports-Space/Delegation.js | 1 + .../Spaces/User-Profile-Space/UserProfile.js | 2 +- .../UI/Utilities/DescendentTables.js | 1 + 15 files changed, 387 insertions(+), 71 deletions(-) create mode 100644 Projects/Foundations/Icons/web3-api.png create mode 100644 Projects/Foundations/Schemas/App-Schema/web3-api.json diff --git a/Client/client.js b/Client/client.js index 9f4a241e0..3e0999b15 100644 --- a/Client/client.js +++ b/Client/client.js @@ -18,7 +18,7 @@ process.on('uncaughtException', function (err) { process.on('unhandledRejection', (reason, p) => { // Signal user that a necissary node module is missing if (reason.code == 'MODULE_NOT_FOUND') { - console.log("[ERROR] Node Modules not found. Running the node setup command and then restart") + console.log("[ERROR] Dependency library not found. Please try running the 'node setup' command and then restart the Client.") console.log('[ERROR] Client -> client-> reason = ' + JSON.stringify(reason)) process.exit(1) } diff --git a/Client/httpInterface.js b/Client/httpInterface.js index cd8cf6785..d34c0aff0 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -1102,7 +1102,10 @@ exports.newHttpInterface = function newHttpInterface( case 'payContributors': { let serverResponse = await WEB3_SERVER.payContributors( - params.signature + params.contractAddress, + params.contractAbi, + params.paymentsArray, + params.mnemonic ) respondWithContent(JSON.stringify(serverResponse), httpResponse) diff --git a/Client/package-lock.json b/Client/package-lock.json index 085910bef..119b3c164 100644 --- a/Client/package-lock.json +++ b/Client/package-lock.json @@ -1397,6 +1397,36 @@ "setimmediate": "^1.0.5" } }, + "ethereumjs-common": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.2.tgz", + "integrity": "sha512-hTfZjwGX52GS2jcVO6E2sx4YuFnf0Fhp5ylo4pEPhEffNln7vS59Hr5sLnp3/QCazFLluuBZ+FZ6J5HTp0EqCA==" + }, + "ethereumjs-tx": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", + "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", + "requires": { + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.0.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + } + } + }, "ethereumjs-util": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.0.tgz", diff --git a/Client/package.json b/Client/package.json index cb0a4b543..d09113f0b 100644 --- a/Client/package.json +++ b/Client/package.json @@ -10,6 +10,8 @@ "@octokit/rest": "^18.9.0", "ccxt": "^1.51.98", "child_process": "^1.0.2", + "ethereumjs-common": "^1.5.2", + "ethereumjs-tx": "^2.1.2", "ethers": "^5.4.4", "lookpath": "^1.2.2", "node-fetch": "2.6.1", diff --git a/Client/web3Server.js b/Client/web3Server.js index a67e1afe7..48745b979 100644 --- a/Client/web3Server.js +++ b/Client/web3Server.js @@ -8,7 +8,8 @@ exports.newWeb3Server = function newWeb3Server() { getWalletBalances: getWalletBalances, signData: signData, recoverAddress: recoverAddress, - mnemonicToPrivateKey: mnemonicToPrivateKey, + mnemonicToPrivateKey: mnemonicToPrivateKey, + payContributors: payContributors, initialize: initialize, finalize: finalize, run: run @@ -245,13 +246,13 @@ exports.newWeb3Server = function newWeb3Server() { if (wallet.privateKey !== undefined) { return { - address: wallet.address, + address: wallet.address, privateKey: wallet.privateKey, result: 'Ok' } } else { return { - address: undefined, + address: undefined, privateKey: undefined, result: 'Fail' } @@ -260,6 +261,83 @@ exports.newWeb3Server = function newWeb3Server() { } catch (err) { return { error: 'Could not convert to Private Key. ' + err.stack } } + } + async function payContributors(contractAddress, contractAbi, paymentsArray, mnemonic) { + try { + let response = await mnemonicToPrivateKey(mnemonic) + let privateKey = response.privateKey + + for (let i = 0; i < paymentsArray.length; i++) { + await CL.projects.foundations.utilities.asyncFunctions.sleep(10000) + let payment = paymentsArray[i] + sendTokens( + i + 1, + payment.userProfile, + payment.from, + payment.to, + payment.amount + ) + } + + async function sendTokens(number, userProfile, fromAddress, toAddress, tokenAmount) { + try { + console.log('') + console.log('---------------------------------------------------------------------------------------------------------------------------------------------------') + console.log(' Payment # ' + number + ' - User Profile: ' + userProfile + ' - SA Tokens Amount: ' + tokenAmount / 1000000000000000000 + ' - Address: ' + toAddress) + console.log('---------------------------------------------------------------------------------------------------------------------------------------------------') + console.log('') + + const Tx = require('ethereumjs-tx').Transaction; + const web3 = new Web3(new Web3.providers.HttpProvider('https://bsc-dataseed.binance.org/')) + const amount = web3.utils.toHex(tokenAmount) + privateKey = privateKey.replace('0x', '') + const privateKeyBuffer = Buffer.from(privateKey, 'hex') + const contractAbiObject = JSON.parse(contractAbi) + const contract = new web3.eth.Contract(contractAbiObject, contractAddress, { from: fromAddress }) + const Common = require('ethereumjs-common').default + const BSC_FORK = Common.forCustomChain( + 'mainnet', + { + name: 'Binance Smart Chain Mainnet', + networkId: 56, + chainId: 56, + url: 'https://bsc-dataseed.binance.org/' + }, + 'istanbul', + ); + + const nonce = await web3.eth.getTransactionCount(fromAddress); + + const rawTransaction = { + "from": fromAddress, + "gasPrice": web3.utils.toHex(5000000000), + "gasLimit": web3.utils.toHex(210000), + "to": contractAddress, "value": "0x0", + "data": contract.methods.transfer(toAddress, amount).encodeABI(), + "nonce": web3.utils.toHex(nonce) + }; + + const transaction = new Tx(rawTransaction, { 'common': BSC_FORK }) + transaction.sign(privateKeyBuffer) + + console.log('Transaction:', rawTransaction) + const result = await web3.eth.sendSignedTransaction('0x' + transaction.serialize().toString('hex')) + console.log('Result:', result) + return result + } catch (err) { + console.log('[ERROR] web3Server -> sendTokens -> err.stack = ' + err.stack) + } + } + + return { + address: wallet.address, + privateKey: wallet.privateKey, + result: 'Ok' + } + + } catch (err) { + return { error: 'Could not convert to Private Key. ' + err.stack } + } } } \ No newline at end of file diff --git a/Projects/Foundations/Icons/web3-api.png b/Projects/Foundations/Icons/web3-api.png new file mode 100644 index 0000000000000000000000000000000000000000..a4ee2a209ae5922e1d49d3686dfabf910a979d02 GIT binary patch literal 15217 zcmYj&c|4Tg7yo@`h8g?5WSc=Dglq|!5tT|vKB5%Ln!PNkm}jV@5=9}&Xj4%{*$N{q z%388lrq#Y=UuNd{UEkm9^?UvLr|~@ZIrrRi?>)==oRjS2utP*pK@b2SveVAi82}vo zi322l_}}cwFU#=1HIdugBKL*)MaFm^_XXBIVMlx^J43wveVu*1ePSa%_*w#BA+^)i z+T~>5Sni?A9)Ge22SQ^?1WJdSi&P1g`_6du1U(B3utpU>HXQhQEYQjLVurwTeKj>B z3Dcm!y{>{Sb~%f$FQrHxl!~xEI)6lZo6X7<34G{4R?*dbo1f41Q5PRci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pcB(C$1k3ORTM=6_*;;MNxS6G`? s;XgsX@9Cd?db;7APIs->" + }, + "propertyNameAtParent": "web3API", + "isPersonalData": true +} \ No newline at end of file diff --git a/Projects/Governance/Plugins/Pools/Superalgos.json b/Projects/Governance/Plugins/Pools/Superalgos.json index eb2ea2d52..a30d80f5e 100644 --- a/Projects/Governance/Plugins/Pools/Superalgos.json +++ b/Projects/Governance/Plugins/Pools/Superalgos.json @@ -1,7 +1,7 @@ { "type": "Pools", "name": "Superalgos", - "config": "{\n \"tokens\": \"60000000\",\n \"codeName\": \"Superalgos\"\n}", + "config": "{\"tokens\":\"60000000\",\"codeName\":\"Superalgos\"}", "project": "Governance", "poolClasses": [ { diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index 82ae85bd5..1c6e76fff 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -12031,27 +12031,39 @@ "referenceParentCombinedNodePath": [ [ "Superalgos-Exchanges", - "Assets" + "Assets", + "Governance", + "2cefeb95-9fde-418b-a35b-6178a97cac9d" ], [ "SA Token Listings Rewards", - "Asset Class" + "Asset Class", + "Governance", + "492669d5-223f-426d-845a-f26dd1ae251e" ], [ "DEXs", - "Asset Class" + "Asset Class", + "Governance", + "90e0c410-b1e7-4f0a-9dec-99c597a7956d" ], [ "First Listing", - "Asset Class" + "Asset Class", + "Governance", + "54f70f64-029a-4f2f-8847-5208c2fa94a1" ], [ " Pancakeswap SA/WBTC", - "Asset Class" + "Asset Class", + "Governance", + "cc6e34d9-d58a-4aa7-9049-250ea90a8430" ], [ "SA Liquidity", - "Asset" + "Asset", + "Governance", + "2e59edc7-7e37-40e3-808f-9ab3c7c5f0b3" ] ] } @@ -12091,27 +12103,39 @@ "referenceParentCombinedNodePath": [ [ "Superalgos-Exchanges", - "Assets" + "Assets", + "Governance", + "2cefeb95-9fde-418b-a35b-6178a97cac9d" ], [ "SA Token Listings Rewards", - "Asset Class" + "Asset Class", + "Governance", + "492669d5-223f-426d-845a-f26dd1ae251e" ], [ "DEXs", - "Asset Class" + "Asset Class", + "Governance", + "90e0c410-b1e7-4f0a-9dec-99c597a7956d" ], [ "First Listing", - "Asset Class" + "Asset Class", + "Governance", + "54f70f64-029a-4f2f-8847-5208c2fa94a1" ], [ " Pancakeswap SA/WBTC", - "Asset Class" + "Asset Class", + "Governance", + "cc6e34d9-d58a-4aa7-9049-250ea90a8430" ], [ "WBTC Liquidity", - "Asset" + "Asset", + "Governance", + "117afaed-83bd-4b0c-be12-40b8c8dd3a34" ] ] } @@ -12148,23 +12172,33 @@ "referenceParentCombinedNodePath": [ [ "Superalgos-Exchanges", - "Assets" + "Assets", + "Governance", + "2cefeb95-9fde-418b-a35b-6178a97cac9d" ], [ "SA Token Listings Rewards", - "Asset Class" + "Asset Class", + "Governance", + "492669d5-223f-426d-845a-f26dd1ae251e" ], [ "DEXs", - "Asset Class" + "Asset Class", + "Governance", + "90e0c410-b1e7-4f0a-9dec-99c597a7956d" ], [ "First Listing", - "Asset Class" + "Asset Class", + "Governance", + "54f70f64-029a-4f2f-8847-5208c2fa94a1" ], [ " Pancakeswap SA/WBTC", - "Asset Class" + "Asset Class", + "Governance", + "cc6e34d9-d58a-4aa7-9049-250ea90a8430" ] ] } @@ -12203,19 +12237,27 @@ "referenceParentCombinedNodePath": [ [ "Superalgos-Exchanges", - "Assets" + "Assets", + "Governance", + "2cefeb95-9fde-418b-a35b-6178a97cac9d" ], [ "SA Token Listings Rewards", - "Asset Class" + "Asset Class", + "Governance", + "492669d5-223f-426d-845a-f26dd1ae251e" ], [ "DEXs", - "Asset Class" + "Asset Class", + "Governance", + "90e0c410-b1e7-4f0a-9dec-99c597a7956d" ], [ "First Listing", - "Asset Class" + "Asset Class", + "Governance", + "54f70f64-029a-4f2f-8847-5208c2fa94a1" ] ] } @@ -12254,15 +12296,21 @@ "referenceParentCombinedNodePath": [ [ "Superalgos-Exchanges", - "Assets" + "Assets", + "Governance", + "2cefeb95-9fde-418b-a35b-6178a97cac9d" ], [ "SA Token Listings Rewards", - "Asset Class" + "Asset Class", + "Governance", + "492669d5-223f-426d-845a-f26dd1ae251e" ], [ "DEXs", - "Asset Class" + "Asset Class", + "Governance", + "90e0c410-b1e7-4f0a-9dec-99c597a7956d" ] ] } @@ -12315,23 +12363,33 @@ "referenceParentCombinedNodePath": [ [ "Superalgos-Exchanges", - "Assets" + "Assets", + "Governance", + "2cefeb95-9fde-418b-a35b-6178a97cac9d" ], [ "SA Token Listings Rewards", - "Asset Class" + "Asset Class", + "Governance", + "492669d5-223f-426d-845a-f26dd1ae251e" ], [ "CEXs", - "Asset Class" + "Asset Class", + "Governance", + "ec0ab4b8-e3cc-47e6-94e7-6d181e1008f4" ], [ "Open Negotiations", - "Asset Class" + "Asset Class", + "Governance", + "144ad412-94fc-4b80-8dd9-2520f64edfcc" ], [ "Bittrex", - "Asset" + "Asset", + "Governance", + "548dd163-9991-4de3-9e68-9e8a9a051a2f" ] ] } @@ -12370,23 +12428,33 @@ "referenceParentCombinedNodePath": [ [ "Superalgos-Exchanges", - "Assets" + "Assets", + "Governance", + "2cefeb95-9fde-418b-a35b-6178a97cac9d" ], [ "SA Token Listings Rewards", - "Asset Class" + "Asset Class", + "Governance", + "492669d5-223f-426d-845a-f26dd1ae251e" ], [ "CEXs", - "Asset Class" + "Asset Class", + "Governance", + "ec0ab4b8-e3cc-47e6-94e7-6d181e1008f4" ], [ "Open Negotiations", - "Asset Class" + "Asset Class", + "Governance", + "144ad412-94fc-4b80-8dd9-2520f64edfcc" ], [ "LBank", - "Asset" + "Asset", + "Governance", + "e4e7addb-a840-4ce9-9e01-74c7e57c24ad" ] ] } @@ -12425,23 +12493,33 @@ "referenceParentCombinedNodePath": [ [ "Superalgos-Exchanges", - "Assets" + "Assets", + "Governance", + "2cefeb95-9fde-418b-a35b-6178a97cac9d" ], [ "SA Token Listings Rewards", - "Asset Class" + "Asset Class", + "Governance", + "492669d5-223f-426d-845a-f26dd1ae251e" ], [ "CEXs", - "Asset Class" + "Asset Class", + "Governance", + "ec0ab4b8-e3cc-47e6-94e7-6d181e1008f4" ], [ "Open Negotiations", - "Asset Class" + "Asset Class", + "Governance", + "144ad412-94fc-4b80-8dd9-2520f64edfcc" ], [ "Probit", - "Asset" + "Asset", + "Governance", + "6b27f708-c243-42e9-874b-ceceea7db21f" ] ] } @@ -12478,19 +12556,27 @@ "referenceParentCombinedNodePath": [ [ "Superalgos-Exchanges", - "Assets" + "Assets", + "Governance", + "2cefeb95-9fde-418b-a35b-6178a97cac9d" ], [ "SA Token Listings Rewards", - "Asset Class" + "Asset Class", + "Governance", + "492669d5-223f-426d-845a-f26dd1ae251e" ], [ "CEXs", - "Asset Class" + "Asset Class", + "Governance", + "ec0ab4b8-e3cc-47e6-94e7-6d181e1008f4" ], [ "Open Negotiations", - "Asset Class" + "Asset Class", + "Governance", + "144ad412-94fc-4b80-8dd9-2520f64edfcc" ] ] } @@ -12529,15 +12615,21 @@ "referenceParentCombinedNodePath": [ [ "Superalgos-Exchanges", - "Assets" + "Assets", + "Governance", + "2cefeb95-9fde-418b-a35b-6178a97cac9d" ], [ "SA Token Listings Rewards", - "Asset Class" + "Asset Class", + "Governance", + "492669d5-223f-426d-845a-f26dd1ae251e" ], [ "CEXs", - "Asset Class" + "Asset Class", + "Governance", + "ec0ab4b8-e3cc-47e6-94e7-6d181e1008f4" ] ] } @@ -12576,11 +12668,15 @@ "referenceParentCombinedNodePath": [ [ "Superalgos-Exchanges", - "Assets" + "Assets", + "Governance", + "2cefeb95-9fde-418b-a35b-6178a97cac9d" ], [ "SA Token Listings Rewards", - "Asset Class" + "Asset Class", + "Governance", + "492669d5-223f-426d-845a-f26dd1ae251e" ] ] } diff --git a/Projects/Governance/UI/Globals/SaToken.js b/Projects/Governance/UI/Globals/SaToken.js index fec31461a..12c4ef3ee 100644 --- a/Projects/Governance/UI/Globals/SaToken.js +++ b/Projects/Governance/UI/Globals/SaToken.js @@ -1,7 +1,9 @@ function newGovernanceGlobalsSaToken() { let thisObject = { SA_TOKEN_BSC_CONTRACT_ADDRESS: '0xfb981ed9a92377ca4d75d924b9ca06df163924fd', - SA_TOKEN_BSC_TREASURY_ACCOUNT_ADDRESS: '0x8d4d2557ce99f83f658adf61eef3e61e04c2ac2c' + SA_TOKEN_BSC_CONTRACT_ABI: '[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"},{"name":"amount","type":"uint256"}],"name":"mint","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_value","type":"uint256"}],"name":"burn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_subtractedValue","type":"uint256"}],"name":"decreaseApproval","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"listAddress","type":"address"},{"name":"isBlackListed","type":"bool"}],"name":"blackListAddress","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_addedValue","type":"uint256"}],"name":"increaseApproval","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_name","type":"string"},{"name":"_symbol","type":"string"},{"name":"_decimals","type":"uint256"},{"name":"_supply","type":"uint256"},{"name":"tokenOwner","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"burner","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"blackListed","type":"address"},{"indexed":false,"name":"value","type":"bool"}],"name":"Blacklist","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}]', + SA_TOKEN_BSC_TREASURY_ACCOUNT_ADDRESS: '0x8d4d2557ce99f83f658adf61eef3e61e04c2ac2c', + SA_TOKEN_BSC_DECIMAL_FACTOR: 1000000000000000000 } return thisObject } \ No newline at end of file diff --git a/Projects/Governance/UI/Spaces/Reports-Space/CommandInterface.js b/Projects/Governance/UI/Spaces/Reports-Space/CommandInterface.js index d9d5ad775..f7eb10614 100644 --- a/Projects/Governance/UI/Spaces/Reports-Space/CommandInterface.js +++ b/Projects/Governance/UI/Spaces/Reports-Space/CommandInterface.js @@ -33,7 +33,7 @@ function newGovernanceReportsCommmandInterface() { UI.projects.education.spaces.docsSpace.navigateTo('Governance', 'Topic', 'Gov PRs Command') return } - if (command.indexOf('gov.prs') !== 0 ) { return 'Not PRs Commands' } + if (command.indexOf('gov.prs') !== 0) { return 'Not PRs Commands' } /* Set up the commit message */ let message = command.trim().substring(command.indexOf(' ') + 1, command.length) @@ -127,28 +127,83 @@ function newGovernanceReportsCommmandInterface() { } if (command.indexOf('gov.pay') !== 0) { return 'Not Pay Commands' } - httpRequest(undefined, 'Gov/Pay/' + UI.projects.education.spaces.docsSpace.currentBranch, onResponse) UI.projects.education.spaces.docsSpace.navigateTo('Governance', 'Topic', 'Gov Message - Paying to Contributors') - return + /* + Let's create a list of payments to be made. + */ + let paymentsArray = [] + /* + Here we get from the workspace all User Profiles. + */ + let userProfiles = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('User Profile') + /* + Transform the result array into table records. + */ + for (let j = 0; j < userProfiles.length; j++) { + let userProfile = userProfiles[j] + + if (userProfile.payload === undefined) { continue } + if (userProfile.tokensMined === undefined) { continue } + if (userProfile.tokensMined.payload === undefined) { continue } + if (userProfile.tokensMined.payload.tokensMined === undefined) { continue } + + let payment = { + "userProfile": userProfile.name, + "from": UI.projects.governance.globals.saToken.SA_TOKEN_BSC_TREASURY_ACCOUNT_ADDRESS, + "to": userProfile.payload.blockchainAccount, + "amount": 1 * UI.projects.governance.globals.saToken.SA_TOKEN_BSC_DECIMAL_FACTOR //(userProfile.tokensMined.payload.tokensMined.total | 0) * UI.projects.governance.globals.saToken.SA_TOKEN_BSC_DECIMAL_FACTOR + } + + paymentsArray.push(payment) + } + /* Let's get the Mnemonic */ + let web3API = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('APIs')[0].web3API + let mnemonic = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(web3API.payload, 'mnemonic') + + /* Lets execute this command against the Client */ + + let params = { + method: 'payContributors', + contractAddress: UI.projects.governance.globals.saToken.SA_TOKEN_BSC_CONTRACT_ADDRESS, + contractAbi: UI.projects.governance.globals.saToken.SA_TOKEN_BSC_CONTRACT_ABI, + paymentsArray: paymentsArray, + mnemonic: mnemonic + } + + let url = 'GOV' // We will access the default Client GOV endpoint. + + httpRequest(JSON.stringify(params), url, onResponse) function onResponse(err, data) { + /* Lets check the result of the call through the http interface */ - data = JSON.parse(data) - if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result && data.result === GLOBAL.CUSTOM_OK_RESPONSE.result) { - if (data.message.summary.changes + data.message.summary.deletions + data.message.summary.insertions > 0) { - UI.projects.education.spaces.docsSpace.navigateTo('Governance', 'Topic', 'Gov Message - Pay Done') - } else { - UI.projects.education.spaces.docsSpace.navigateTo('Governance', 'Topic', 'Gov Message - Pay Failed') - } + if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) { + console.log('[ERROR] Call via HTTP Interface failed.' + err.stack) + console.log('[ERROR] Params = ' + JSON.stringify(params)) + return + } + + let response = JSON.parse(data) + + /* Lets check the result of the method call */ + if (response.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) { + console.log('[ERROR] Call to Client Github Server failed.' + err.stack) + console.log('[ERROR] Params = ' + JSON.stringify(params)) + } + + /* Successful Call */ + + if (response.result === GLOBAL.DEFAULT_OK_RESPONSE.result) { + UI.projects.education.spaces.docsSpace.navigateTo('Governance', 'Topic', 'Gov Message - Contribution Payments Processed') } else { UI.projects.education.spaces.docsSpace.navigateTo( - data.docs.project, - data.docs.category, - data.docs.type, - data.docs.anchor, + response.docs.project, + response.docs.category, + response.docs.type, + response.docs.anchor, undefined, - data.docs.placeholder + response.docs.placeholder ) } } diff --git a/Projects/Governance/UI/Spaces/Reports-Space/Delegation.js b/Projects/Governance/UI/Spaces/Reports-Space/Delegation.js index 435ff4f5e..6c161a722 100644 --- a/Projects/Governance/UI/Spaces/Reports-Space/Delegation.js +++ b/Projects/Governance/UI/Spaces/Reports-Space/Delegation.js @@ -77,6 +77,7 @@ function newGovernanceReportsDelegation() { if (program === undefined) { continue } if (program.payload === undefined) { continue } if (program.payload[programPropertyName] === undefined) { continue } + if (program.payload[programPropertyName].bonus === undefined) { continue } let tableRecord = { "name": userProfile.name, diff --git a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js index 63d2c0d1c..54cb070fd 100644 --- a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js +++ b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js @@ -88,7 +88,7 @@ function newGovernanceUserProfileSpace() { if (transfer.contractAddress !== UI.projects.governance.globals.saToken.SA_TOKEN_BSC_CONTRACT_ADDRESS) { continue } if (transfer.from !== UI.projects.governance.globals.saToken.SA_TOKEN_BSC_TREASURY_ACCOUNT_ADDRESS) { continue } - let currentReputation = Number(transfer.value) / 1000000000000000000 + let currentReputation = Number(transfer.value) / UI.projects.governance.globals.saToken.SA_TOKEN_BSC_DECIMAL_FACTOR let previousReputation = reputationByAddress.get(transfer.to) let newReputation = previousReputation | 0 + currentReputation reputationByAddress.set(transfer.to, newReputation) diff --git a/Projects/Governance/UI/Utilities/DescendentTables.js b/Projects/Governance/UI/Utilities/DescendentTables.js index 89a57fddf..7bebf214a 100644 --- a/Projects/Governance/UI/Utilities/DescendentTables.js +++ b/Projects/Governance/UI/Utilities/DescendentTables.js @@ -91,6 +91,7 @@ function newGovernanceUtilitiesDecendentTables() { if (program === undefined) { continue } if (program.payload === undefined) { continue } if (program.payload[programPropertyName] === undefined) { continue } + if (program.payload[programPropertyName].bonus === undefined) { continue } let tableRecord = { "name": userProfile.name,