From 017914cb189e9a6cd22c93f344329a4dc4ff56e9 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 21 Jun 2021 07:55:36 +0200 Subject: [PATCH 01/17] Governance: Abstracting the mandatory Programs. --- .../Function-Libraries/MentorshipProgram.js | 282 +--------------- Projects/Governance/UI/Utilities/Program.js | 317 ++++++++++++++++++ Projects/ProjectsSchema.json | 5 + 3 files changed, 326 insertions(+), 278 deletions(-) create mode 100644 Projects/Governance/UI/Utilities/Program.js diff --git a/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js b/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js index 40101bfd5..a5aba8b19 100644 --- a/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js +++ b/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js @@ -9,283 +9,9 @@ function newGovernanceFunctionLibraryMentorshipProgram() { pools, userProfiles ) { - /* - Here we will store the total amount of tokens that is going to be distributed among all participants - of the Mentorship Program. This will come from a Pool that is configured wiht a codeName config property - with the value "Mentorship-Program" - */ - let mentorshipProgramPoolTokenReward - /* - In order to be able to calculate the share of the Mentorships Program Pool for each User Profile, - we need to accumulate all the Icomming Mentorship Power that each User Profile at their Mentorship Program - node has, because with that Incoming Power is that each Mentorship Program node gets a share of - the pool. - */ - let accumulatedIncomingMentorshipPower = 0 - - /* Scan Pools Until finding the Mentoship-Program Pool */ - for (let i = 0; i < pools.length; i++) { - let poolsNode = pools[i] - mentorshipProgramPoolTokenReward = UI.projects.governance.utilities.pools.findPool(poolsNode, "Mentorship-Program") - } - if (mentorshipProgramPoolTokenReward === undefined || mentorshipProgramPoolTokenReward === 0) { return } - /* - We will first reset all the mentorship outgoingPower, and then distribute it. - */ - for (let i = 0; i < userProfiles.length; i++) { - let userProfile = userProfiles[i] - - if (userProfile.tokenSwitch === undefined) { continue } - if (userProfile.tokenSwitch.mentorshipProgram === undefined) { continue } - if (userProfile.tokenSwitch.mentorshipProgram.payload === undefined) { continue } - - reserMentorshipProgram(userProfile.tokenSwitch.mentorshipProgram) - } - for (let i = 0; i < userProfiles.length; i++) { - let userProfile = userProfiles[i] - - if (userProfile.tokenSwitch === undefined) { continue } - if (userProfile.tokenSwitch.mentorshipProgram === undefined) { continue } - if (userProfile.tokenSwitch.mentorshipProgram.payload === undefined) { continue } - - distributeMentorshipProgram(userProfile.tokenSwitch.mentorshipProgram) - } - for (let i = 0; i < userProfiles.length; i++) { - let userProfile = userProfiles[i] - - if (userProfile.tokenSwitch === undefined) { continue } - if (userProfile.tokenSwitch.mentorshipProgram === undefined) { continue } - if (userProfile.tokenSwitch.mentorshipProgram.payload === undefined) { continue } - - calculateMentorshipProgram(userProfile.tokenSwitch.mentorshipProgram) - } - - function reserMentorshipProgram(node) { - if (node === undefined) { return } - if (node.payload === undefined) { return } - node.payload.mentorshipProgram = { - count: 0, - outgoingPower: 0, - ownPower: 0, - incomingPower: 0, - awarded: { - tokens: 0, - percentage: 0 - } - } - if ( - node.type === 'User Profile' && - node.tokenSwitch !== undefined - ) { - reserMentorshipProgram(node.tokenSwitch) - return - } - if ( - node.type === 'Token Switch' && - node.mentorshipProgram !== undefined - ) { - reserMentorshipProgram(node.mentorshipProgram) - return - } - if ( - node.type === 'Mentorship Program' && - node.userMentors !== undefined - ) { - for (let i = 0; i < node.userMentors.length; i++) { - reserMentorshipProgram(node.userMentors[i]) - } - return - } - if ( - node.type === 'User Mentor' && - node.payload.referenceParent !== undefined - ) { - reserMentorshipProgram(node.payload.referenceParent) - return - } - } - - function distributeMentorshipProgram(mentorshipProgram) { - if (mentorshipProgram === undefined || mentorshipProgram.payload === undefined) { return } - /* - Here we will convert Token Power into Mentorship Power. - As per system rules mentoshipPower = tokensPower - */ - let mentoshipPower = mentorshipProgram.payload.tokenPower - /* - We will also reseet the count of mentorships here. - */ - let count = 0 - /* - The Own Power is the power generated by the same User Profile tokens, not inherited from others. - */ - mentorshipProgram.payload.mentorshipProgram.ownPower = mentoshipPower - - distributeMentorshipPower(mentorshipProgram, mentoshipPower, count) - } - - function distributeMentorshipPower( - node, - mentoshipPower, - count - ) { - if (node === undefined) { return } - if (node.payload === undefined) { return } - if (node.payload.mentorshipProgram === undefined) { return } - - switch (node.type) { - case 'Mentorship Program': { - /* - This is the point where we increase to our local count of mentorships whatever it comes - at the count parameters. If we are processing the User Profile of this Mentorship Program - then we will add zero, otherwise, 1. - */ - node.payload.mentorshipProgram.count = node.payload.mentorshipProgram.count + count - /* - The outgoingPower of this node will be accumulating all the mentoshipPower flowing - through it, no matter from where it comes. - */ - node.payload.mentorshipProgram.outgoingPower = node.payload.mentorshipProgram.outgoingPower + mentoshipPower - /* - We need to adjust the balance that holds the accumulationt of all incomingPower of all Mentorship Program - nodes. To do this we will substratct the current incomingPower, bacause it is going to be recalculated - inmediatelly after this, and then we will add it again after the recalcualtion. - */ - accumulatedIncomingMentorshipPower = accumulatedIncomingMentorshipPower - node.payload.mentorshipProgram.incomingPower - /* - At any point in time, the incomingPower will be equal to the total of the outgoingPower minus - the ownPower. This is like this because the outgoingPower is the accumulation of all the - power flow that is leaving this node, which includes the ownPower. That means that if we - substract the ownPower, we will have the accumulation of all the incomingPower, which - means all the power coming from other User Profiles referencing this one. - */ - node.payload.mentorshipProgram.incomingPower = node.payload.mentorshipProgram.outgoingPower - node.payload.mentorshipProgram.ownPower - /* - Now that we have the incomingPower calculated again, we can add it again to the balance of all the incomingPower - of all Mentorship Program nodes. - */ - accumulatedIncomingMentorshipPower = accumulatedIncomingMentorshipPower + node.payload.mentorshipProgram.incomingPower - - if (node.userMentors !== undefined) { - for (let i = 0; i < node.userMentors.length; i++) { - distributeMentorshipPower(node.userMentors[i], mentoshipPower / node.userMentors.length, 0) - } - } - break - } - case 'User Mentor': { - node.payload.mentorshipProgram.outgoingPower = node.payload.parentNode.payload.mentorshipProgram.outgoingPower / node.payload.parentNode.userMentors.length - - drawUserMentor(node) - if (node.payload.referenceParent !== undefined) { - distributeMentorshipPower(node.payload.referenceParent, mentoshipPower / 10, 0) - } - break - } - case 'User Profile': { - if (node.tokenSwitch !== undefined) { - distributeMentorshipPower(node.tokenSwitch, mentoshipPower, 0) - } - break - } - case 'Token Switch': { - if (node.mentorshipProgram !== undefined) { - distributeMentorshipPower(node.mentorshipProgram, mentoshipPower, 1) - } - break - } - } - } - - function calculateMentorshipProgram(mentorshipProgram) { - /* - Here we will calculate which share of the Mentorship Program Pool this user will get in tokens. - To do that, we use the incomingPower, to see which proportion of the accumulatedIncomingMentorshipPower - represents. - */ - if (mentorshipProgram.payload === undefined) { return } - /* - If the accumulatedIncomingMentorshipPower is not grater the amount of tokens at the Mentorship Program Pool, then - this user will get the exact amount of tokens from the pool as incomingPower he has. - - If the accumulatedIncomingMentorshipPower is grater the amount of tokens at the Mentorship Program Pool, then - the amount ot tokens to be received is a proportional to the share of incomingPower in accumulatedIncomingMentorshipPower. - */ - let totalPowerRewardRatio = accumulatedIncomingMentorshipPower / mentorshipProgramPoolTokenReward - if (totalPowerRewardRatio < 1) { totalPowerRewardRatio = 1 } - - if (mentorshipProgram.tokensAwarded === undefined || mentorshipProgram.tokensAwarded.payload === undefined) { - mentorshipProgram.payload.uiObject.setErrorMessage("Tokens Awarded Node is needed in order for this Program to get Tokens from the Mentorship Program Pool.") - return - } - mentorshipProgram.payload.mentorshipProgram.awarded.tokens = mentorshipProgram.payload.mentorshipProgram.incomingPower * totalPowerRewardRatio - /* - As per the system rules, the Mentorship Program will not give tokens to users that do not ha their own Referrer set up, - unless it has a big amount of tokens (this last condition is for the edge case where a user it at the top of the - mentorship pyramid.) - */ - if ( - mentorshipProgram.payload.mentorshipProgram.awarded.tokens > 0 && - mentorshipProgram.payload.mentorshipProgram.ownPower < 1000000 && - (mentorshipProgram.userMentors === undefined || hasUsersDefined(mentorshipProgram.userMentors) === false) - ) { - - mentorshipProgram.payload.uiObject.setErrorMessage("In order to be awarded " + mentorshipProgram.payload.mentorshipProgram.awarded.tokens + " SA Tokens from your mentorships, you need first to define yourself who your metors are.") - mentorshipProgram.payload.mentorshipProgram.awarded.tokens = 0 - } - - drawMentorshipProgram(mentorshipProgram) - } - - function hasUsersDefined(usersArray) { - if (usersArray === undefined) { return false } - for (let i = 0; i < usersArray.length; i++) { - let user = usersArray[i] - if (user.payload.referenceParent !== undefined) { return true } - } - return false - } - - function drawUserMentor(node) { - if (node.payload !== undefined) { - - const outgoingPowerText = new Intl.NumberFormat().format(node.payload.mentorshipProgram.outgoingPower) - - node.payload.uiObject.valueAngleOffset = 180 - node.payload.uiObject.valueAtAngle = true - - node.payload.uiObject.setValue(outgoingPowerText + ' ' + 'Mentorship Power') - - node.payload.uiObject.statusAngleOffset = 0 - node.payload.uiObject.statusAtAngle = false - - node.payload.uiObject.setStatus(outgoingPowerText + ' ' + ' Outgoing Power') - } - } - - function drawMentorshipProgram(node) { - if (node.payload !== undefined) { - - const ownPowerText = new Intl.NumberFormat().format(node.payload.mentorshipProgram.ownPower) - const incomingPowerText = new Intl.NumberFormat().format(node.payload.mentorshipProgram.incomingPower) - - node.payload.uiObject.statusAngleOffset = 0 - node.payload.uiObject.statusAtAngle = false - - node.payload.uiObject.setStatus(ownPowerText + ' Own Power - ' + incomingPowerText + ' Incoming Power') - } - if (node.tokensAwarded !== undefined && node.tokensAwarded.payload !== undefined) { - - const tokensAwardedText = new Intl.NumberFormat().format(node.payload.mentorshipProgram.awarded.tokens) - - node.tokensAwarded.payload.uiObject.statusAngleOffset = 0 - node.tokensAwarded.payload.uiObject.statusAtAngle = false - node.tokensAwarded.payload.uiObject.valueAngleOffset = 0 - node.tokensAwarded.payload.uiObject.valueAtAngle = false - - node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens') - node.tokensAwarded.payload.uiObject.setStatus('From ' + node.payload.mentorshipProgram.count + ' Mentees.') - } - } + UI.projects.governance.utilities.program.run( + pools, + userProfiles + ) } } \ No newline at end of file diff --git a/Projects/Governance/UI/Utilities/Program.js b/Projects/Governance/UI/Utilities/Program.js new file mode 100644 index 000000000..51b21f10d --- /dev/null +++ b/Projects/Governance/UI/Utilities/Program.js @@ -0,0 +1,317 @@ +function newFoundationsUtilitiesProgram() { + let thisObject = { + run: run + } + + return thisObject + + function run( + pools, + userProfiles + ) { + /* + Here we will store the total amount of tokens that is going to be distributed among all participants + of the Mentorship Program. This will come from a Pool that is configured wiht a codeName config property + with the value "Mentorship-Program" + */ + let mentorshipProgramPoolTokenReward + /* + In order to be able to calculate the share of the Mentorships Program Pool for each User Profile, + we need to accumulate all the Icomming Mentorship Power that each User Profile at their Mentorship Program + node has, because with that Incoming Power is that each Mentorship Program node gets a share of + the pool. + */ + let accumulatedIncomingMentorshipPower = 0 + + /* Scan Pools Until finding the Mentoship-Program Pool */ + for (let i = 0; i < pools.length; i++) { + let poolsNode = pools[i] + mentorshipProgramPoolTokenReward = UI.projects.governance.utilities.pools.findPool(poolsNode, "Mentorship-Program") + } + if (mentorshipProgramPoolTokenReward === undefined || mentorshipProgramPoolTokenReward === 0) { return } + /* + We will first reset all the mentorship outgoingPower, and then distribute it. + */ + for (let i = 0; i < userProfiles.length; i++) { + let userProfile = userProfiles[i] + + if (userProfile.tokenSwitch === undefined) { continue } + if (userProfile.tokenSwitch.mentorshipProgram === undefined) { continue } + if (userProfile.tokenSwitch.mentorshipProgram.payload === undefined) { continue } + + reserMentorshipProgram(userProfile.tokenSwitch.mentorshipProgram) + } + for (let i = 0; i < userProfiles.length; i++) { + let userProfile = userProfiles[i] + + if (userProfile.tokenSwitch === undefined) { continue } + if (userProfile.tokenSwitch.mentorshipProgram === undefined) { continue } + if (userProfile.tokenSwitch.mentorshipProgram.payload === undefined) { continue } + + validateMentorshipProgram(userProfile.tokenSwitch.mentorshipProgram) + } + for (let i = 0; i < userProfiles.length; i++) { + let userProfile = userProfiles[i] + + if (userProfile.tokenSwitch === undefined) { continue } + if (userProfile.tokenSwitch.mentorshipProgram === undefined) { continue } + if (userProfile.tokenSwitch.mentorshipProgram.payload === undefined) { continue } + if (userProfile.tokenSwitch.mentorshipProgram.payload.mentorshipProgram.isActive === false) { continue } + + distributeMentorshipProgram(userProfile.tokenSwitch.mentorshipProgram) + } + for (let i = 0; i < userProfiles.length; i++) { + let userProfile = userProfiles[i] + + if (userProfile.tokenSwitch === undefined) { continue } + if (userProfile.tokenSwitch.mentorshipProgram === undefined) { continue } + if (userProfile.tokenSwitch.mentorshipProgram.payload === undefined) { continue } + if (userProfile.tokenSwitch.mentorshipProgram.payload.mentorshipProgram.isActive === false) { continue } + + calculateMentorshipProgram(userProfile.tokenSwitch.mentorshipProgram) + } + + function reserMentorshipProgram(node) { + if (node === undefined) { return } + if (node.payload === undefined) { return } + node.payload.mentorshipProgram = { + count: 0, + outgoingPower: 0, + ownPower: 0, + incomingPower: 0, + awarded: { + tokens: 0, + percentage: 0 + } + } + if ( + node.type === 'User Profile' && + node.tokenSwitch !== undefined + ) { + reserMentorshipProgram(node.tokenSwitch) + return + } + if ( + node.type === 'Token Switch' && + node.mentorshipProgram !== undefined + ) { + reserMentorshipProgram(node.mentorshipProgram) + return + } + if ( + node.type === 'Mentorship Program' && + node.userMentors !== undefined + ) { + for (let i = 0; i < node.userMentors.length; i++) { + reserMentorshipProgram(node.userMentors[i]) + } + return + } + if ( + node.type === 'User Mentor' && + node.payload.referenceParent !== undefined + ) { + reserMentorshipProgram(node.payload.referenceParent) + return + } + } + + function validateMentorshipProgram(node) { + /* + This program is not going to run unless the Profile has Tokens, and for + that users needs to execute the setup procedure of signing their Github + username with their private key. + */ + if ( + node.payload.parentNode.payload.parentNode.payload.blockchainTokens === undefined + ) { + node.payload.mentorshipProgram.isActive = false + node.payload.parentNode.payload.parentNode.payload.uiObject.setErrorMessage("You need to setup this profile with the Profile Constructor, to access the Token Power of your account at the Blockchain.") + return + } + /* + As per the system rules, the Mentorship Program will not give tokens + to users that do not have their own user nodes set up, unless it has a big + amount of tokens (this last condition is for the edge case where a user it + at the top of the mentorship pyramid.) + */ + if ( + node.payload.parentNode.payload.parentNode.payload.blockchainTokens < 1000000 && + (node.userMentors === undefined || hasUsersDefined(node.userMentors) === false) + ) { + node.payload.mentorshipProgram.isActive = false + node.payload.uiObject.setErrorMessage("In order to enable this program you need to add User Mentor nodes and reference a User Profile from each one.") + } else { + node.payload.mentorshipProgram.isActive = true + } + function hasUsersDefined(usersArray) { + if (usersArray === undefined) { return false } + for (let i = 0; i < usersArray.length; i++) { + let user = usersArray[i] + if (user.payload.referenceParent !== undefined) { return true } + } + return false + } + } + + function distributeMentorshipProgram(mentorshipProgram) { + if (mentorshipProgram === undefined || mentorshipProgram.payload === undefined) { return } + /* + Here we will convert Token Power into Mentorship Power. + As per system rules mentoshipPower = tokensPower + */ + let mentoshipPower = mentorshipProgram.payload.tokenPower + /* + We will also reseet the count of mentorships here. + */ + let count = 0 + /* + The Own Power is the power generated by the same User Profile tokens, not inherited from others. + */ + mentorshipProgram.payload.mentorshipProgram.ownPower = mentoshipPower + + distributeMentorshipPower(mentorshipProgram, mentoshipPower, count) + } + + function distributeMentorshipPower( + node, + mentoshipPower, + count + ) { + if (node === undefined) { return } + if (node.payload === undefined) { return } + if (node.payload.mentorshipProgram === undefined) { return } + + switch (node.type) { + case 'Mentorship Program': { + /* + This is the point where we increase to our local count of mentorships whatever it comes + at the count parameters. If we are processing the User Profile of this Mentorship Program + then we will add zero, otherwise, 1. + */ + node.payload.mentorshipProgram.count = node.payload.mentorshipProgram.count + count + /* + The outgoingPower of this node will be accumulating all the mentoshipPower flowing + through it, no matter from where it comes. + */ + node.payload.mentorshipProgram.outgoingPower = node.payload.mentorshipProgram.outgoingPower + mentoshipPower + /* + We need to adjust the balance that holds the accumulationt of all incomingPower of all Mentorship Program + nodes. To do this we will substratct the current incomingPower, bacause it is going to be recalculated + inmediatelly after this, and then we will add it again after the recalcualtion. + */ + accumulatedIncomingMentorshipPower = accumulatedIncomingMentorshipPower - node.payload.mentorshipProgram.incomingPower + /* + At any point in time, the incomingPower will be equal to the total of the outgoingPower minus + the ownPower. This is like this because the outgoingPower is the accumulation of all the + power flow that is leaving this node, which includes the ownPower. That means that if we + substract the ownPower, we will have the accumulation of all the incomingPower, which + means all the power coming from other User Profiles referencing this one. + */ + node.payload.mentorshipProgram.incomingPower = node.payload.mentorshipProgram.outgoingPower - node.payload.mentorshipProgram.ownPower + /* + Now that we have the incomingPower calculated again, we can add it again to the balance of all the incomingPower + of all Mentorship Program nodes. + */ + accumulatedIncomingMentorshipPower = accumulatedIncomingMentorshipPower + node.payload.mentorshipProgram.incomingPower + + if (node.userMentors !== undefined) { + for (let i = 0; i < node.userMentors.length; i++) { + distributeMentorshipPower(node.userMentors[i], mentoshipPower / node.userMentors.length, 0) + } + } + break + } + case 'User Mentor': { + node.payload.mentorshipProgram.outgoingPower = node.payload.parentNode.payload.mentorshipProgram.outgoingPower / node.payload.parentNode.userMentors.length + + drawUserMentor(node) + if (node.payload.referenceParent !== undefined) { + distributeMentorshipPower(node.payload.referenceParent, mentoshipPower / 10, 0) + } + break + } + case 'User Profile': { + if (node.tokenSwitch !== undefined) { + distributeMentorshipPower(node.tokenSwitch, mentoshipPower, 0) + } + break + } + case 'Token Switch': { + if (node.mentorshipProgram !== undefined) { + distributeMentorshipPower(node.mentorshipProgram, mentoshipPower, 1) + } + break + } + } + } + + function calculateMentorshipProgram(mentorshipProgram) { + /* + Here we will calculate which share of the Mentorship Program Pool this user will get in tokens. + To do that, we use the incomingPower, to see which proportion of the accumulatedIncomingMentorshipPower + represents. + */ + if (mentorshipProgram.payload === undefined) { return } + /* + If the accumulatedIncomingMentorshipPower is not grater the amount of tokens at the Mentorship Program Pool, then + this user will get the exact amount of tokens from the pool as incomingPower he has. + + If the accumulatedIncomingMentorshipPower is grater the amount of tokens at the Mentorship Program Pool, then + the amount ot tokens to be received is a proportional to the share of incomingPower in accumulatedIncomingMentorshipPower. + */ + let totalPowerRewardRatio = accumulatedIncomingMentorshipPower / mentorshipProgramPoolTokenReward + if (totalPowerRewardRatio < 1) { totalPowerRewardRatio = 1 } + + if (mentorshipProgram.tokensAwarded === undefined || mentorshipProgram.tokensAwarded.payload === undefined) { + mentorshipProgram.payload.uiObject.setErrorMessage("Tokens Awarded Node is needed in order for this Program to get Tokens from the Mentorship Program Pool.") + return + } + mentorshipProgram.payload.mentorshipProgram.awarded.tokens = mentorshipProgram.payload.mentorshipProgram.incomingPower * totalPowerRewardRatio + + drawMentorshipProgram(mentorshipProgram) + } + + function drawUserMentor(node) { + if (node.payload !== undefined) { + + const outgoingPowerText = new Intl.NumberFormat().format(node.payload.mentorshipProgram.outgoingPower) + + node.payload.uiObject.valueAngleOffset = 180 + node.payload.uiObject.valueAtAngle = true + + node.payload.uiObject.setValue(outgoingPowerText + ' ' + 'Mentorship Power') + + node.payload.uiObject.statusAngleOffset = 0 + node.payload.uiObject.statusAtAngle = false + + node.payload.uiObject.setStatus(outgoingPowerText + ' ' + ' Outgoing Power') + } + } + + function drawMentorshipProgram(node) { + if (node.payload !== undefined) { + + const ownPowerText = new Intl.NumberFormat().format(node.payload.mentorshipProgram.ownPower) + const incomingPowerText = new Intl.NumberFormat().format(node.payload.mentorshipProgram.incomingPower) + + node.payload.uiObject.statusAngleOffset = 0 + node.payload.uiObject.statusAtAngle = false + + node.payload.uiObject.setStatus(ownPowerText + ' Own Power - ' + incomingPowerText + ' Incoming Power') + } + if (node.tokensAwarded !== undefined && node.tokensAwarded.payload !== undefined) { + + const tokensAwardedText = new Intl.NumberFormat().format(node.payload.mentorshipProgram.awarded.tokens) + + node.tokensAwarded.payload.uiObject.statusAngleOffset = 0 + node.tokensAwarded.payload.uiObject.statusAtAngle = false + node.tokensAwarded.payload.uiObject.valueAngleOffset = 0 + node.tokensAwarded.payload.uiObject.valueAtAngle = false + + node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens') + node.tokensAwarded.payload.uiObject.setStatus('From ' + node.payload.mentorshipProgram.count + ' Mentees.') + } + } + } +} \ No newline at end of file diff --git a/Projects/ProjectsSchema.json b/Projects/ProjectsSchema.json index 8ce023757..1e2532922 100644 --- a/Projects/ProjectsSchema.json +++ b/Projects/ProjectsSchema.json @@ -1019,6 +1019,11 @@ "name": "Pools", "propertyName": "pools", "functionName": "newFoundationsUtilitiesPools" + }, + { + "name": "Program", + "propertyName": "program", + "functionName": "newFoundationsUtilitiesProgram" } ], "spaces": [ From fa4633a1ef53107c1dbd6fc2adccab4c8615775e Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 21 Jun 2021 07:57:32 +0200 Subject: [PATCH 02/17] adding Mandatory --- .../Governance/UI/Function-Libraries/MentorshipProgram.js | 2 +- .../UI/Utilities/{Program.js => MandatoryProgram.js} | 2 +- Projects/ProjectsSchema.json | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) rename Projects/Governance/UI/Utilities/{Program.js => MandatoryProgram.js} (99%) diff --git a/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js b/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js index a5aba8b19..1e4e94398 100644 --- a/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js +++ b/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js @@ -9,7 +9,7 @@ function newGovernanceFunctionLibraryMentorshipProgram() { pools, userProfiles ) { - UI.projects.governance.utilities.program.run( + UI.projects.governance.utilities.mandatoryProgram.run( pools, userProfiles ) diff --git a/Projects/Governance/UI/Utilities/Program.js b/Projects/Governance/UI/Utilities/MandatoryProgram.js similarity index 99% rename from Projects/Governance/UI/Utilities/Program.js rename to Projects/Governance/UI/Utilities/MandatoryProgram.js index 51b21f10d..d68c7f028 100644 --- a/Projects/Governance/UI/Utilities/Program.js +++ b/Projects/Governance/UI/Utilities/MandatoryProgram.js @@ -1,4 +1,4 @@ -function newFoundationsUtilitiesProgram() { +function newFoundationsUtilitiesMandatoryProgram() { let thisObject = { run: run } diff --git a/Projects/ProjectsSchema.json b/Projects/ProjectsSchema.json index 1e2532922..4c2e387aa 100644 --- a/Projects/ProjectsSchema.json +++ b/Projects/ProjectsSchema.json @@ -1021,9 +1021,9 @@ "functionName": "newFoundationsUtilitiesPools" }, { - "name": "Program", - "propertyName": "program", - "functionName": "newFoundationsUtilitiesProgram" + "name": "Mandatory Program", + "propertyName": "mandatoryProgram", + "functionName": "newFoundationsUtilitiesMandatoryProgram" } ], "spaces": [ From a4e00bab119e5e8d7609a4ff53d3e6fd2ac3e033 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 21 Jun 2021 08:02:01 +0200 Subject: [PATCH 03/17] Program Property Name --- .../Function-Libraries/MentorshipProgram.js | 3 +- .../UI/Utilities/MandatoryProgram.js | 75 ++++++++++--------- 2 files changed, 40 insertions(+), 38 deletions(-) diff --git a/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js b/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js index 1e4e94398..61c4b42ea 100644 --- a/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js +++ b/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js @@ -11,7 +11,8 @@ function newGovernanceFunctionLibraryMentorshipProgram() { ) { UI.projects.governance.utilities.mandatoryProgram.run( pools, - userProfiles + userProfiles, + "mentorshipProgram" ) } } \ No newline at end of file diff --git a/Projects/Governance/UI/Utilities/MandatoryProgram.js b/Projects/Governance/UI/Utilities/MandatoryProgram.js index d68c7f028..34f3df40f 100644 --- a/Projects/Governance/UI/Utilities/MandatoryProgram.js +++ b/Projects/Governance/UI/Utilities/MandatoryProgram.js @@ -7,7 +7,8 @@ function newFoundationsUtilitiesMandatoryProgram() { function run( pools, - userProfiles + userProfiles, + programPropertyName ) { /* Here we will store the total amount of tokens that is going to be distributed among all participants @@ -36,45 +37,45 @@ function newFoundationsUtilitiesMandatoryProgram() { let userProfile = userProfiles[i] if (userProfile.tokenSwitch === undefined) { continue } - if (userProfile.tokenSwitch.mentorshipProgram === undefined) { continue } - if (userProfile.tokenSwitch.mentorshipProgram.payload === undefined) { continue } + if (userProfile.tokenSwitch[programPropertyName] === undefined) { continue } + if (userProfile.tokenSwitch[programPropertyName].payload === undefined) { continue } - reserMentorshipProgram(userProfile.tokenSwitch.mentorshipProgram) + reserMentorshipProgram(userProfile.tokenSwitch[programPropertyName]) } for (let i = 0; i < userProfiles.length; i++) { let userProfile = userProfiles[i] if (userProfile.tokenSwitch === undefined) { continue } - if (userProfile.tokenSwitch.mentorshipProgram === undefined) { continue } - if (userProfile.tokenSwitch.mentorshipProgram.payload === undefined) { continue } + if (userProfile.tokenSwitch[programPropertyName] === undefined) { continue } + if (userProfile.tokenSwitch[programPropertyName].payload === undefined) { continue } - validateMentorshipProgram(userProfile.tokenSwitch.mentorshipProgram) + validateMentorshipProgram(userProfile.tokenSwitch[programPropertyName]) } for (let i = 0; i < userProfiles.length; i++) { let userProfile = userProfiles[i] if (userProfile.tokenSwitch === undefined) { continue } - if (userProfile.tokenSwitch.mentorshipProgram === undefined) { continue } - if (userProfile.tokenSwitch.mentorshipProgram.payload === undefined) { continue } - if (userProfile.tokenSwitch.mentorshipProgram.payload.mentorshipProgram.isActive === false) { continue } + if (userProfile.tokenSwitch[programPropertyName] === undefined) { continue } + if (userProfile.tokenSwitch[programPropertyName].payload === undefined) { continue } + if (userProfile.tokenSwitch[programPropertyName].payload[programPropertyName].isActive === false) { continue } - distributeMentorshipProgram(userProfile.tokenSwitch.mentorshipProgram) + distributeMentorshipProgram(userProfile.tokenSwitch[programPropertyName]) } for (let i = 0; i < userProfiles.length; i++) { let userProfile = userProfiles[i] if (userProfile.tokenSwitch === undefined) { continue } - if (userProfile.tokenSwitch.mentorshipProgram === undefined) { continue } - if (userProfile.tokenSwitch.mentorshipProgram.payload === undefined) { continue } - if (userProfile.tokenSwitch.mentorshipProgram.payload.mentorshipProgram.isActive === false) { continue } + if (userProfile.tokenSwitch[programPropertyName] === undefined) { continue } + if (userProfile.tokenSwitch[programPropertyName].payload === undefined) { continue } + if (userProfile.tokenSwitch[programPropertyName].payload[programPropertyName].isActive === false) { continue } - calculateMentorshipProgram(userProfile.tokenSwitch.mentorshipProgram) + calculateMentorshipProgram(userProfile.tokenSwitch[programPropertyName]) } function reserMentorshipProgram(node) { if (node === undefined) { return } if (node.payload === undefined) { return } - node.payload.mentorshipProgram = { + node.payload[programPropertyName] = { count: 0, outgoingPower: 0, ownPower: 0, @@ -93,9 +94,9 @@ function newFoundationsUtilitiesMandatoryProgram() { } if ( node.type === 'Token Switch' && - node.mentorshipProgram !== undefined + node[programPropertyName] !== undefined ) { - reserMentorshipProgram(node.mentorshipProgram) + reserMentorshipProgram(node[programPropertyName]) return } if ( @@ -125,7 +126,7 @@ function newFoundationsUtilitiesMandatoryProgram() { if ( node.payload.parentNode.payload.parentNode.payload.blockchainTokens === undefined ) { - node.payload.mentorshipProgram.isActive = false + node.payload[programPropertyName].isActive = false node.payload.parentNode.payload.parentNode.payload.uiObject.setErrorMessage("You need to setup this profile with the Profile Constructor, to access the Token Power of your account at the Blockchain.") return } @@ -139,10 +140,10 @@ function newFoundationsUtilitiesMandatoryProgram() { node.payload.parentNode.payload.parentNode.payload.blockchainTokens < 1000000 && (node.userMentors === undefined || hasUsersDefined(node.userMentors) === false) ) { - node.payload.mentorshipProgram.isActive = false + node.payload[programPropertyName].isActive = false node.payload.uiObject.setErrorMessage("In order to enable this program you need to add User Mentor nodes and reference a User Profile from each one.") } else { - node.payload.mentorshipProgram.isActive = true + node.payload[programPropertyName].isActive = true } function hasUsersDefined(usersArray) { if (usersArray === undefined) { return false } @@ -168,7 +169,7 @@ function newFoundationsUtilitiesMandatoryProgram() { /* The Own Power is the power generated by the same User Profile tokens, not inherited from others. */ - mentorshipProgram.payload.mentorshipProgram.ownPower = mentoshipPower + mentorshipProgram.payload[programPropertyName].ownPower = mentoshipPower distributeMentorshipPower(mentorshipProgram, mentoshipPower, count) } @@ -180,7 +181,7 @@ function newFoundationsUtilitiesMandatoryProgram() { ) { if (node === undefined) { return } if (node.payload === undefined) { return } - if (node.payload.mentorshipProgram === undefined) { return } + if (node.payload[programPropertyName] === undefined) { return } switch (node.type) { case 'Mentorship Program': { @@ -189,18 +190,18 @@ function newFoundationsUtilitiesMandatoryProgram() { at the count parameters. If we are processing the User Profile of this Mentorship Program then we will add zero, otherwise, 1. */ - node.payload.mentorshipProgram.count = node.payload.mentorshipProgram.count + count + node.payload[programPropertyName].count = node.payload[programPropertyName].count + count /* The outgoingPower of this node will be accumulating all the mentoshipPower flowing through it, no matter from where it comes. */ - node.payload.mentorshipProgram.outgoingPower = node.payload.mentorshipProgram.outgoingPower + mentoshipPower + node.payload[programPropertyName].outgoingPower = node.payload[programPropertyName].outgoingPower + mentoshipPower /* We need to adjust the balance that holds the accumulationt of all incomingPower of all Mentorship Program nodes. To do this we will substratct the current incomingPower, bacause it is going to be recalculated inmediatelly after this, and then we will add it again after the recalcualtion. */ - accumulatedIncomingMentorshipPower = accumulatedIncomingMentorshipPower - node.payload.mentorshipProgram.incomingPower + accumulatedIncomingMentorshipPower = accumulatedIncomingMentorshipPower - node.payload[programPropertyName].incomingPower /* At any point in time, the incomingPower will be equal to the total of the outgoingPower minus the ownPower. This is like this because the outgoingPower is the accumulation of all the @@ -208,12 +209,12 @@ function newFoundationsUtilitiesMandatoryProgram() { substract the ownPower, we will have the accumulation of all the incomingPower, which means all the power coming from other User Profiles referencing this one. */ - node.payload.mentorshipProgram.incomingPower = node.payload.mentorshipProgram.outgoingPower - node.payload.mentorshipProgram.ownPower + node.payload[programPropertyName].incomingPower = node.payload[programPropertyName].outgoingPower - node.payload[programPropertyName].ownPower /* Now that we have the incomingPower calculated again, we can add it again to the balance of all the incomingPower of all Mentorship Program nodes. */ - accumulatedIncomingMentorshipPower = accumulatedIncomingMentorshipPower + node.payload.mentorshipProgram.incomingPower + accumulatedIncomingMentorshipPower = accumulatedIncomingMentorshipPower + node.payload[programPropertyName].incomingPower if (node.userMentors !== undefined) { for (let i = 0; i < node.userMentors.length; i++) { @@ -223,7 +224,7 @@ function newFoundationsUtilitiesMandatoryProgram() { break } case 'User Mentor': { - node.payload.mentorshipProgram.outgoingPower = node.payload.parentNode.payload.mentorshipProgram.outgoingPower / node.payload.parentNode.userMentors.length + node.payload[programPropertyName].outgoingPower = node.payload.parentNode.payload[programPropertyName].outgoingPower / node.payload.parentNode.userMentors.length drawUserMentor(node) if (node.payload.referenceParent !== undefined) { @@ -238,8 +239,8 @@ function newFoundationsUtilitiesMandatoryProgram() { break } case 'Token Switch': { - if (node.mentorshipProgram !== undefined) { - distributeMentorshipPower(node.mentorshipProgram, mentoshipPower, 1) + if (node[programPropertyName] !== undefined) { + distributeMentorshipPower(node[programPropertyName], mentoshipPower, 1) } break } @@ -267,7 +268,7 @@ function newFoundationsUtilitiesMandatoryProgram() { mentorshipProgram.payload.uiObject.setErrorMessage("Tokens Awarded Node is needed in order for this Program to get Tokens from the Mentorship Program Pool.") return } - mentorshipProgram.payload.mentorshipProgram.awarded.tokens = mentorshipProgram.payload.mentorshipProgram.incomingPower * totalPowerRewardRatio + mentorshipProgram.payload[programPropertyName].awarded.tokens = mentorshipProgram.payload[programPropertyName].incomingPower * totalPowerRewardRatio drawMentorshipProgram(mentorshipProgram) } @@ -275,7 +276,7 @@ function newFoundationsUtilitiesMandatoryProgram() { function drawUserMentor(node) { if (node.payload !== undefined) { - const outgoingPowerText = new Intl.NumberFormat().format(node.payload.mentorshipProgram.outgoingPower) + const outgoingPowerText = new Intl.NumberFormat().format(node.payload[programPropertyName].outgoingPower) node.payload.uiObject.valueAngleOffset = 180 node.payload.uiObject.valueAtAngle = true @@ -292,8 +293,8 @@ function newFoundationsUtilitiesMandatoryProgram() { function drawMentorshipProgram(node) { if (node.payload !== undefined) { - const ownPowerText = new Intl.NumberFormat().format(node.payload.mentorshipProgram.ownPower) - const incomingPowerText = new Intl.NumberFormat().format(node.payload.mentorshipProgram.incomingPower) + const ownPowerText = new Intl.NumberFormat().format(node.payload[programPropertyName].ownPower) + const incomingPowerText = new Intl.NumberFormat().format(node.payload[programPropertyName].incomingPower) node.payload.uiObject.statusAngleOffset = 0 node.payload.uiObject.statusAtAngle = false @@ -302,7 +303,7 @@ function newFoundationsUtilitiesMandatoryProgram() { } if (node.tokensAwarded !== undefined && node.tokensAwarded.payload !== undefined) { - const tokensAwardedText = new Intl.NumberFormat().format(node.payload.mentorshipProgram.awarded.tokens) + const tokensAwardedText = new Intl.NumberFormat().format(node.payload[programPropertyName].awarded.tokens) node.tokensAwarded.payload.uiObject.statusAngleOffset = 0 node.tokensAwarded.payload.uiObject.statusAtAngle = false @@ -310,7 +311,7 @@ function newFoundationsUtilitiesMandatoryProgram() { node.tokensAwarded.payload.uiObject.valueAtAngle = false node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens') - node.tokensAwarded.payload.uiObject.setStatus('From ' + node.payload.mentorshipProgram.count + ' Mentees.') + node.tokensAwarded.payload.uiObject.setStatus('From ' + node.payload[programPropertyName].count + ' Mentees.') } } } From ba1adec98f65f3b0b4d9272aa808e8128fb5b1f4 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 21 Jun 2021 08:05:44 +0200 Subject: [PATCH 04/17] Refactoring ProgramPower --- .../Function-Libraries/MentorshipProgram.js | 3 +- .../UI/Utilities/MandatoryProgram.js | 35 ++++++++++--------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js b/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js index 61c4b42ea..e01f373ba 100644 --- a/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js +++ b/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js @@ -12,7 +12,8 @@ function newGovernanceFunctionLibraryMentorshipProgram() { UI.projects.governance.utilities.mandatoryProgram.run( pools, userProfiles, - "mentorshipProgram" + "mentorshipProgram", + "Mentorship-Program" ) } } \ No newline at end of file diff --git a/Projects/Governance/UI/Utilities/MandatoryProgram.js b/Projects/Governance/UI/Utilities/MandatoryProgram.js index 34f3df40f..88dd28250 100644 --- a/Projects/Governance/UI/Utilities/MandatoryProgram.js +++ b/Projects/Governance/UI/Utilities/MandatoryProgram.js @@ -8,12 +8,13 @@ function newFoundationsUtilitiesMandatoryProgram() { function run( pools, userProfiles, - programPropertyName + programPropertyName, + programName ) { /* Here we will store the total amount of tokens that is going to be distributed among all participants of the Mentorship Program. This will come from a Pool that is configured wiht a codeName config property - with the value "Mentorship-Program" + with the value programName */ let mentorshipProgramPoolTokenReward /* @@ -22,12 +23,12 @@ function newFoundationsUtilitiesMandatoryProgram() { node has, because with that Incoming Power is that each Mentorship Program node gets a share of the pool. */ - let accumulatedIncomingMentorshipPower = 0 + let accumulatedIncomingProgramPower = 0 /* Scan Pools Until finding the Mentoship-Program Pool */ for (let i = 0; i < pools.length; i++) { let poolsNode = pools[i] - mentorshipProgramPoolTokenReward = UI.projects.governance.utilities.pools.findPool(poolsNode, "Mentorship-Program") + mentorshipProgramPoolTokenReward = UI.projects.governance.utilities.pools.findPool(poolsNode, programName) } if (mentorshipProgramPoolTokenReward === undefined || mentorshipProgramPoolTokenReward === 0) { return } /* @@ -171,10 +172,10 @@ function newFoundationsUtilitiesMandatoryProgram() { */ mentorshipProgram.payload[programPropertyName].ownPower = mentoshipPower - distributeMentorshipPower(mentorshipProgram, mentoshipPower, count) + distributeProgramPower(mentorshipProgram, mentoshipPower, count) } - function distributeMentorshipPower( + function distributeProgramPower( node, mentoshipPower, count @@ -201,7 +202,7 @@ function newFoundationsUtilitiesMandatoryProgram() { nodes. To do this we will substratct the current incomingPower, bacause it is going to be recalculated inmediatelly after this, and then we will add it again after the recalcualtion. */ - accumulatedIncomingMentorshipPower = accumulatedIncomingMentorshipPower - node.payload[programPropertyName].incomingPower + accumulatedIncomingProgramPower = accumulatedIncomingProgramPower - node.payload[programPropertyName].incomingPower /* At any point in time, the incomingPower will be equal to the total of the outgoingPower minus the ownPower. This is like this because the outgoingPower is the accumulation of all the @@ -214,11 +215,11 @@ function newFoundationsUtilitiesMandatoryProgram() { Now that we have the incomingPower calculated again, we can add it again to the balance of all the incomingPower of all Mentorship Program nodes. */ - accumulatedIncomingMentorshipPower = accumulatedIncomingMentorshipPower + node.payload[programPropertyName].incomingPower + accumulatedIncomingProgramPower = accumulatedIncomingProgramPower + node.payload[programPropertyName].incomingPower if (node.userMentors !== undefined) { for (let i = 0; i < node.userMentors.length; i++) { - distributeMentorshipPower(node.userMentors[i], mentoshipPower / node.userMentors.length, 0) + distributeProgramPower(node.userMentors[i], mentoshipPower / node.userMentors.length, 0) } } break @@ -228,19 +229,19 @@ function newFoundationsUtilitiesMandatoryProgram() { drawUserMentor(node) if (node.payload.referenceParent !== undefined) { - distributeMentorshipPower(node.payload.referenceParent, mentoshipPower / 10, 0) + distributeProgramPower(node.payload.referenceParent, mentoshipPower / 10, 0) } break } case 'User Profile': { if (node.tokenSwitch !== undefined) { - distributeMentorshipPower(node.tokenSwitch, mentoshipPower, 0) + distributeProgramPower(node.tokenSwitch, mentoshipPower, 0) } break } case 'Token Switch': { if (node[programPropertyName] !== undefined) { - distributeMentorshipPower(node[programPropertyName], mentoshipPower, 1) + distributeProgramPower(node[programPropertyName], mentoshipPower, 1) } break } @@ -250,18 +251,18 @@ function newFoundationsUtilitiesMandatoryProgram() { function calculateMentorshipProgram(mentorshipProgram) { /* Here we will calculate which share of the Mentorship Program Pool this user will get in tokens. - To do that, we use the incomingPower, to see which proportion of the accumulatedIncomingMentorshipPower + To do that, we use the incomingPower, to see which proportion of the accumulatedIncomingProgramPower represents. */ if (mentorshipProgram.payload === undefined) { return } /* - If the accumulatedIncomingMentorshipPower is not grater the amount of tokens at the Mentorship Program Pool, then + If the accumulatedIncomingProgramPower is not grater the amount of tokens at the Mentorship Program Pool, then this user will get the exact amount of tokens from the pool as incomingPower he has. - If the accumulatedIncomingMentorshipPower is grater the amount of tokens at the Mentorship Program Pool, then - the amount ot tokens to be received is a proportional to the share of incomingPower in accumulatedIncomingMentorshipPower. + If the accumulatedIncomingProgramPower is grater the amount of tokens at the Mentorship Program Pool, then + the amount ot tokens to be received is a proportional to the share of incomingPower in accumulatedIncomingProgramPower. */ - let totalPowerRewardRatio = accumulatedIncomingMentorshipPower / mentorshipProgramPoolTokenReward + let totalPowerRewardRatio = accumulatedIncomingProgramPower / mentorshipProgramPoolTokenReward if (totalPowerRewardRatio < 1) { totalPowerRewardRatio = 1 } if (mentorshipProgram.tokensAwarded === undefined || mentorshipProgram.tokensAwarded.payload === undefined) { From ce0125a302bf5f16e857afd222ee8a0d7cb2c0dc Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 21 Jun 2021 08:09:32 +0200 Subject: [PATCH 05/17] programNodeType --- .../UI/Function-Libraries/MentorshipProgram.js | 3 ++- Projects/Governance/UI/Utilities/MandatoryProgram.js | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js b/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js index e01f373ba..07c577899 100644 --- a/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js +++ b/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js @@ -13,7 +13,8 @@ function newGovernanceFunctionLibraryMentorshipProgram() { pools, userProfiles, "mentorshipProgram", - "Mentorship-Program" + "Mentorship-Program", + "Mentorship Program" ) } } \ No newline at end of file diff --git a/Projects/Governance/UI/Utilities/MandatoryProgram.js b/Projects/Governance/UI/Utilities/MandatoryProgram.js index 88dd28250..8e803e846 100644 --- a/Projects/Governance/UI/Utilities/MandatoryProgram.js +++ b/Projects/Governance/UI/Utilities/MandatoryProgram.js @@ -9,7 +9,8 @@ function newFoundationsUtilitiesMandatoryProgram() { pools, userProfiles, programPropertyName, - programName + programName, + programNodeType ) { /* Here we will store the total amount of tokens that is going to be distributed among all participants @@ -18,7 +19,7 @@ function newFoundationsUtilitiesMandatoryProgram() { */ let mentorshipProgramPoolTokenReward /* - In order to be able to calculate the share of the Mentorships Program Pool for each User Profile, + In order to be able to calculate the share of the Program Pool for each User Profile, we need to accumulate all the Icomming Mentorship Power that each User Profile at their Mentorship Program node has, because with that Incoming Power is that each Mentorship Program node gets a share of the pool. @@ -101,7 +102,7 @@ function newFoundationsUtilitiesMandatoryProgram() { return } if ( - node.type === 'Mentorship Program' && + node.type === programNodeType && node.userMentors !== undefined ) { for (let i = 0; i < node.userMentors.length; i++) { @@ -185,7 +186,7 @@ function newFoundationsUtilitiesMandatoryProgram() { if (node.payload[programPropertyName] === undefined) { return } switch (node.type) { - case 'Mentorship Program': { + case programNodeType: { /* This is the point where we increase to our local count of mentorships whatever it comes at the count parameters. If we are processing the User Profile of this Mentorship Program From 7683c15f8d1da0134adddfec84fda3567c243531 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 21 Jun 2021 08:14:18 +0200 Subject: [PATCH 06/17] programPowerName --- .../Function-Libraries/MentorshipProgram.js | 3 +- .../UI/Utilities/MandatoryProgram.js | 29 ++++++++++--------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js b/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js index 07c577899..a9522534d 100644 --- a/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js +++ b/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js @@ -14,7 +14,8 @@ function newGovernanceFunctionLibraryMentorshipProgram() { userProfiles, "mentorshipProgram", "Mentorship-Program", - "Mentorship Program" + "Mentorship Program", + "Mentorship Power" ) } } \ No newline at end of file diff --git a/Projects/Governance/UI/Utilities/MandatoryProgram.js b/Projects/Governance/UI/Utilities/MandatoryProgram.js index 8e803e846..eb1d27d93 100644 --- a/Projects/Governance/UI/Utilities/MandatoryProgram.js +++ b/Projects/Governance/UI/Utilities/MandatoryProgram.js @@ -10,18 +10,19 @@ function newFoundationsUtilitiesMandatoryProgram() { userProfiles, programPropertyName, programName, - programNodeType + programNodeType, + programPowerName ) { /* Here we will store the total amount of tokens that is going to be distributed among all participants - of the Mentorship Program. This will come from a Pool that is configured wiht a codeName config property + of the Program. This will come from a Pool that is configured wiht a codeName config property with the value programName */ let mentorshipProgramPoolTokenReward /* In order to be able to calculate the share of the Program Pool for each User Profile, - we need to accumulate all the Icomming Mentorship Power that each User Profile at their Mentorship Program - node has, because with that Incoming Power is that each Mentorship Program node gets a share of + we need to accumulate all the Icomming programPowerName that each User Profile at their Program + node has, because with that Incoming Power is that each Program node gets a share of the pool. */ let accumulatedIncomingProgramPower = 0 @@ -133,7 +134,7 @@ function newFoundationsUtilitiesMandatoryProgram() { return } /* - As per the system rules, the Mentorship Program will not give tokens + As per the system rules, the Program will not give tokens to users that do not have their own user nodes set up, unless it has a big amount of tokens (this last condition is for the edge case where a user it at the top of the mentorship pyramid.) @@ -160,7 +161,7 @@ function newFoundationsUtilitiesMandatoryProgram() { function distributeMentorshipProgram(mentorshipProgram) { if (mentorshipProgram === undefined || mentorshipProgram.payload === undefined) { return } /* - Here we will convert Token Power into Mentorship Power. + Here we will convert Token Power into programPowerName. As per system rules mentoshipPower = tokensPower */ let mentoshipPower = mentorshipProgram.payload.tokenPower @@ -189,7 +190,7 @@ function newFoundationsUtilitiesMandatoryProgram() { case programNodeType: { /* This is the point where we increase to our local count of mentorships whatever it comes - at the count parameters. If we are processing the User Profile of this Mentorship Program + at the count parameters. If we are processing the User Profile of this Program then we will add zero, otherwise, 1. */ node.payload[programPropertyName].count = node.payload[programPropertyName].count + count @@ -199,7 +200,7 @@ function newFoundationsUtilitiesMandatoryProgram() { */ node.payload[programPropertyName].outgoingPower = node.payload[programPropertyName].outgoingPower + mentoshipPower /* - We need to adjust the balance that holds the accumulationt of all incomingPower of all Mentorship Program + We need to adjust the balance that holds the accumulationt of all incomingPower of all Program nodes. To do this we will substratct the current incomingPower, bacause it is going to be recalculated inmediatelly after this, and then we will add it again after the recalcualtion. */ @@ -214,7 +215,7 @@ function newFoundationsUtilitiesMandatoryProgram() { node.payload[programPropertyName].incomingPower = node.payload[programPropertyName].outgoingPower - node.payload[programPropertyName].ownPower /* Now that we have the incomingPower calculated again, we can add it again to the balance of all the incomingPower - of all Mentorship Program nodes. + of all Program nodes. */ accumulatedIncomingProgramPower = accumulatedIncomingProgramPower + node.payload[programPropertyName].incomingPower @@ -251,23 +252,23 @@ function newFoundationsUtilitiesMandatoryProgram() { function calculateMentorshipProgram(mentorshipProgram) { /* - Here we will calculate which share of the Mentorship Program Pool this user will get in tokens. + Here we will calculate which share of the Program Pool this user will get in tokens. To do that, we use the incomingPower, to see which proportion of the accumulatedIncomingProgramPower represents. */ if (mentorshipProgram.payload === undefined) { return } /* - If the accumulatedIncomingProgramPower is not grater the amount of tokens at the Mentorship Program Pool, then + If the accumulatedIncomingProgramPower is not grater the amount of tokens at the Program Pool, then this user will get the exact amount of tokens from the pool as incomingPower he has. - If the accumulatedIncomingProgramPower is grater the amount of tokens at the Mentorship Program Pool, then + If the accumulatedIncomingProgramPower is grater the amount of tokens at the Program Pool, then the amount ot tokens to be received is a proportional to the share of incomingPower in accumulatedIncomingProgramPower. */ let totalPowerRewardRatio = accumulatedIncomingProgramPower / mentorshipProgramPoolTokenReward if (totalPowerRewardRatio < 1) { totalPowerRewardRatio = 1 } if (mentorshipProgram.tokensAwarded === undefined || mentorshipProgram.tokensAwarded.payload === undefined) { - mentorshipProgram.payload.uiObject.setErrorMessage("Tokens Awarded Node is needed in order for this Program to get Tokens from the Mentorship Program Pool.") + mentorshipProgram.payload.uiObject.setErrorMessage("Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.") return } mentorshipProgram.payload[programPropertyName].awarded.tokens = mentorshipProgram.payload[programPropertyName].incomingPower * totalPowerRewardRatio @@ -283,7 +284,7 @@ function newFoundationsUtilitiesMandatoryProgram() { node.payload.uiObject.valueAngleOffset = 180 node.payload.uiObject.valueAtAngle = true - node.payload.uiObject.setValue(outgoingPowerText + ' ' + 'Mentorship Power') + node.payload.uiObject.setValue(outgoingPowerText + ' ' + programPowerName) node.payload.uiObject.statusAngleOffset = 0 node.payload.uiObject.statusAtAngle = false From 17fc4188d7ff7e95174e3231a74d134ff1910867 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 21 Jun 2021 08:19:37 +0200 Subject: [PATCH 07/17] refactoring programNode --- .../UI/Utilities/MandatoryProgram.js | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Projects/Governance/UI/Utilities/MandatoryProgram.js b/Projects/Governance/UI/Utilities/MandatoryProgram.js index eb1d27d93..4b4c2fce1 100644 --- a/Projects/Governance/UI/Utilities/MandatoryProgram.js +++ b/Projects/Governance/UI/Utilities/MandatoryProgram.js @@ -43,7 +43,7 @@ function newFoundationsUtilitiesMandatoryProgram() { if (userProfile.tokenSwitch[programPropertyName] === undefined) { continue } if (userProfile.tokenSwitch[programPropertyName].payload === undefined) { continue } - reserMentorshipProgram(userProfile.tokenSwitch[programPropertyName]) + reserProgram(userProfile.tokenSwitch[programPropertyName]) } for (let i = 0; i < userProfiles.length; i++) { let userProfile = userProfiles[i] @@ -52,7 +52,7 @@ function newFoundationsUtilitiesMandatoryProgram() { if (userProfile.tokenSwitch[programPropertyName] === undefined) { continue } if (userProfile.tokenSwitch[programPropertyName].payload === undefined) { continue } - validateMentorshipProgram(userProfile.tokenSwitch[programPropertyName]) + validateProgram(userProfile.tokenSwitch[programPropertyName]) } for (let i = 0; i < userProfiles.length; i++) { let userProfile = userProfiles[i] @@ -62,7 +62,7 @@ function newFoundationsUtilitiesMandatoryProgram() { if (userProfile.tokenSwitch[programPropertyName].payload === undefined) { continue } if (userProfile.tokenSwitch[programPropertyName].payload[programPropertyName].isActive === false) { continue } - distributeMentorshipProgram(userProfile.tokenSwitch[programPropertyName]) + distributeProgram(userProfile.tokenSwitch[programPropertyName]) } for (let i = 0; i < userProfiles.length; i++) { let userProfile = userProfiles[i] @@ -72,10 +72,10 @@ function newFoundationsUtilitiesMandatoryProgram() { if (userProfile.tokenSwitch[programPropertyName].payload === undefined) { continue } if (userProfile.tokenSwitch[programPropertyName].payload[programPropertyName].isActive === false) { continue } - calculateMentorshipProgram(userProfile.tokenSwitch[programPropertyName]) + calculateProgram(userProfile.tokenSwitch[programPropertyName]) } - function reserMentorshipProgram(node) { + function reserProgram(node) { if (node === undefined) { return } if (node.payload === undefined) { return } node.payload[programPropertyName] = { @@ -92,14 +92,14 @@ function newFoundationsUtilitiesMandatoryProgram() { node.type === 'User Profile' && node.tokenSwitch !== undefined ) { - reserMentorshipProgram(node.tokenSwitch) + reserProgram(node.tokenSwitch) return } if ( node.type === 'Token Switch' && node[programPropertyName] !== undefined ) { - reserMentorshipProgram(node[programPropertyName]) + reserProgram(node[programPropertyName]) return } if ( @@ -107,7 +107,7 @@ function newFoundationsUtilitiesMandatoryProgram() { node.userMentors !== undefined ) { for (let i = 0; i < node.userMentors.length; i++) { - reserMentorshipProgram(node.userMentors[i]) + reserProgram(node.userMentors[i]) } return } @@ -115,12 +115,12 @@ function newFoundationsUtilitiesMandatoryProgram() { node.type === 'User Mentor' && node.payload.referenceParent !== undefined ) { - reserMentorshipProgram(node.payload.referenceParent) + reserProgram(node.payload.referenceParent) return } } - function validateMentorshipProgram(node) { + function validateProgram(node) { /* This program is not going to run unless the Profile has Tokens, and for that users needs to execute the setup procedure of signing their Github @@ -158,13 +158,13 @@ function newFoundationsUtilitiesMandatoryProgram() { } } - function distributeMentorshipProgram(mentorshipProgram) { - if (mentorshipProgram === undefined || mentorshipProgram.payload === undefined) { return } + function distributeProgram(programNode) { + if (programNode === undefined || programNode.payload === undefined) { return } /* Here we will convert Token Power into programPowerName. As per system rules mentoshipPower = tokensPower */ - let mentoshipPower = mentorshipProgram.payload.tokenPower + let mentoshipPower = programNode.payload.tokenPower /* We will also reseet the count of mentorships here. */ @@ -172,9 +172,9 @@ function newFoundationsUtilitiesMandatoryProgram() { /* The Own Power is the power generated by the same User Profile tokens, not inherited from others. */ - mentorshipProgram.payload[programPropertyName].ownPower = mentoshipPower + programNode.payload[programPropertyName].ownPower = mentoshipPower - distributeProgramPower(mentorshipProgram, mentoshipPower, count) + distributeProgramPower(programNode, mentoshipPower, count) } function distributeProgramPower( @@ -250,13 +250,13 @@ function newFoundationsUtilitiesMandatoryProgram() { } } - function calculateMentorshipProgram(mentorshipProgram) { + function calculateProgram(programNode) { /* Here we will calculate which share of the Program Pool this user will get in tokens. To do that, we use the incomingPower, to see which proportion of the accumulatedIncomingProgramPower represents. */ - if (mentorshipProgram.payload === undefined) { return } + if (programNode.payload === undefined) { return } /* If the accumulatedIncomingProgramPower is not grater the amount of tokens at the Program Pool, then this user will get the exact amount of tokens from the pool as incomingPower he has. @@ -267,13 +267,13 @@ function newFoundationsUtilitiesMandatoryProgram() { let totalPowerRewardRatio = accumulatedIncomingProgramPower / mentorshipProgramPoolTokenReward if (totalPowerRewardRatio < 1) { totalPowerRewardRatio = 1 } - if (mentorshipProgram.tokensAwarded === undefined || mentorshipProgram.tokensAwarded.payload === undefined) { - mentorshipProgram.payload.uiObject.setErrorMessage("Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.") + if (programNode.tokensAwarded === undefined || programNode.tokensAwarded.payload === undefined) { + programNode.payload.uiObject.setErrorMessage("Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.") return } - mentorshipProgram.payload[programPropertyName].awarded.tokens = mentorshipProgram.payload[programPropertyName].incomingPower * totalPowerRewardRatio + programNode.payload[programPropertyName].awarded.tokens = programNode.payload[programPropertyName].incomingPower * totalPowerRewardRatio - drawMentorshipProgram(mentorshipProgram) + drawProgram(programNode) } function drawUserMentor(node) { @@ -293,7 +293,7 @@ function newFoundationsUtilitiesMandatoryProgram() { } } - function drawMentorshipProgram(node) { + function drawProgram(node) { if (node.payload !== undefined) { const ownPowerText = new Intl.NumberFormat().format(node.payload[programPropertyName].ownPower) From d6037100de892d4094b6fba27e71f249e6d6f5ec Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 21 Jun 2021 08:25:47 +0200 Subject: [PATCH 08/17] More Refactoring --- .../Governance/UI/Utilities/MandatoryProgram.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Projects/Governance/UI/Utilities/MandatoryProgram.js b/Projects/Governance/UI/Utilities/MandatoryProgram.js index 4b4c2fce1..39644a785 100644 --- a/Projects/Governance/UI/Utilities/MandatoryProgram.js +++ b/Projects/Governance/UI/Utilities/MandatoryProgram.js @@ -18,7 +18,7 @@ function newFoundationsUtilitiesMandatoryProgram() { of the Program. This will come from a Pool that is configured wiht a codeName config property with the value programName */ - let mentorshipProgramPoolTokenReward + let programPoolTokenReward /* In order to be able to calculate the share of the Program Pool for each User Profile, we need to accumulate all the Icomming programPowerName that each User Profile at their Program @@ -30,11 +30,11 @@ function newFoundationsUtilitiesMandatoryProgram() { /* Scan Pools Until finding the Mentoship-Program Pool */ for (let i = 0; i < pools.length; i++) { let poolsNode = pools[i] - mentorshipProgramPoolTokenReward = UI.projects.governance.utilities.pools.findPool(poolsNode, programName) + programPoolTokenReward = UI.projects.governance.utilities.pools.findPool(poolsNode, programName) } - if (mentorshipProgramPoolTokenReward === undefined || mentorshipProgramPoolTokenReward === 0) { return } + if (programPoolTokenReward === undefined || programPoolTokenReward === 0) { return } /* - We will first reset all the mentorship outgoingPower, and then distribute it. + We will first reset all the program outgoingPower, and then distribute it. */ for (let i = 0; i < userProfiles.length; i++) { let userProfile = userProfiles[i] @@ -137,7 +137,7 @@ function newFoundationsUtilitiesMandatoryProgram() { As per the system rules, the Program will not give tokens to users that do not have their own user nodes set up, unless it has a big amount of tokens (this last condition is for the edge case where a user it - at the top of the mentorship pyramid.) + at the top of the program pyramid.) */ if ( node.payload.parentNode.payload.parentNode.payload.blockchainTokens < 1000000 && @@ -166,7 +166,7 @@ function newFoundationsUtilitiesMandatoryProgram() { */ let mentoshipPower = programNode.payload.tokenPower /* - We will also reseet the count of mentorships here. + We will also reseet the count of descendents from here. */ let count = 0 /* @@ -189,7 +189,7 @@ function newFoundationsUtilitiesMandatoryProgram() { switch (node.type) { case programNodeType: { /* - This is the point where we increase to our local count of mentorships whatever it comes + This is the point where we increase to our local count of descendents whatever it comes at the count parameters. If we are processing the User Profile of this Program then we will add zero, otherwise, 1. */ @@ -264,7 +264,7 @@ function newFoundationsUtilitiesMandatoryProgram() { If the accumulatedIncomingProgramPower is grater the amount of tokens at the Program Pool, then the amount ot tokens to be received is a proportional to the share of incomingPower in accumulatedIncomingProgramPower. */ - let totalPowerRewardRatio = accumulatedIncomingProgramPower / mentorshipProgramPoolTokenReward + let totalPowerRewardRatio = accumulatedIncomingProgramPower / programPoolTokenReward if (totalPowerRewardRatio < 1) { totalPowerRewardRatio = 1 } if (programNode.tokensAwarded === undefined || programNode.tokensAwarded.payload === undefined) { From 8b9a34d5b6c988d77f8652e4ad5d18dac74271ac Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 21 Jun 2021 08:31:44 +0200 Subject: [PATCH 09/17] userMentors refactoring --- .../Function-Libraries/MentorshipProgram.js | 3 ++- .../UI/Utilities/MandatoryProgram.js | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js b/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js index a9522534d..9e91db2d7 100644 --- a/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js +++ b/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js @@ -15,7 +15,8 @@ function newGovernanceFunctionLibraryMentorshipProgram() { "mentorshipProgram", "Mentorship-Program", "Mentorship Program", - "Mentorship Power" + "Mentorship Power", + "userMentors" ) } } \ No newline at end of file diff --git a/Projects/Governance/UI/Utilities/MandatoryProgram.js b/Projects/Governance/UI/Utilities/MandatoryProgram.js index 39644a785..efbeb448c 100644 --- a/Projects/Governance/UI/Utilities/MandatoryProgram.js +++ b/Projects/Governance/UI/Utilities/MandatoryProgram.js @@ -11,7 +11,8 @@ function newFoundationsUtilitiesMandatoryProgram() { programPropertyName, programName, programNodeType, - programPowerName + programPowerName, + usersArrayPropertyName ) { /* Here we will store the total amount of tokens that is going to be distributed among all participants @@ -104,10 +105,10 @@ function newFoundationsUtilitiesMandatoryProgram() { } if ( node.type === programNodeType && - node.userMentors !== undefined + node[usersArrayPropertyName] !== undefined ) { - for (let i = 0; i < node.userMentors.length; i++) { - reserProgram(node.userMentors[i]) + for (let i = 0; i < node[usersArrayPropertyName].length; i++) { + reserProgram(node[usersArrayPropertyName][i]) } return } @@ -141,7 +142,7 @@ function newFoundationsUtilitiesMandatoryProgram() { */ if ( node.payload.parentNode.payload.parentNode.payload.blockchainTokens < 1000000 && - (node.userMentors === undefined || hasUsersDefined(node.userMentors) === false) + (node[usersArrayPropertyName] === undefined || hasUsersDefined(node[usersArrayPropertyName]) === false) ) { node.payload[programPropertyName].isActive = false node.payload.uiObject.setErrorMessage("In order to enable this program you need to add User Mentor nodes and reference a User Profile from each one.") @@ -219,15 +220,15 @@ function newFoundationsUtilitiesMandatoryProgram() { */ accumulatedIncomingProgramPower = accumulatedIncomingProgramPower + node.payload[programPropertyName].incomingPower - if (node.userMentors !== undefined) { - for (let i = 0; i < node.userMentors.length; i++) { - distributeProgramPower(node.userMentors[i], mentoshipPower / node.userMentors.length, 0) + if (node[usersArrayPropertyName] !== undefined) { + for (let i = 0; i < node[usersArrayPropertyName].length; i++) { + distributeProgramPower(node[usersArrayPropertyName][i], mentoshipPower / node[usersArrayPropertyName].length, 0) } } break } case 'User Mentor': { - node.payload[programPropertyName].outgoingPower = node.payload.parentNode.payload[programPropertyName].outgoingPower / node.payload.parentNode.userMentors.length + node.payload[programPropertyName].outgoingPower = node.payload.parentNode.payload[programPropertyName].outgoingPower / node.payload.parentNode[usersArrayPropertyName].length drawUserMentor(node) if (node.payload.referenceParent !== undefined) { From b6ca4ae39d8a6f34b519fc9dc0e6fffca72bc792 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 21 Jun 2021 08:33:55 +0200 Subject: [PATCH 10/17] userNodeType refactoring --- .../Governance/UI/Function-Libraries/MentorshipProgram.js | 3 ++- Projects/Governance/UI/Utilities/MandatoryProgram.js | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js b/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js index 9e91db2d7..85cc6f4b6 100644 --- a/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js +++ b/Projects/Governance/UI/Function-Libraries/MentorshipProgram.js @@ -16,7 +16,8 @@ function newGovernanceFunctionLibraryMentorshipProgram() { "Mentorship-Program", "Mentorship Program", "Mentorship Power", - "userMentors" + "userMentors", + "User Mentor" ) } } \ No newline at end of file diff --git a/Projects/Governance/UI/Utilities/MandatoryProgram.js b/Projects/Governance/UI/Utilities/MandatoryProgram.js index efbeb448c..0ca935486 100644 --- a/Projects/Governance/UI/Utilities/MandatoryProgram.js +++ b/Projects/Governance/UI/Utilities/MandatoryProgram.js @@ -12,7 +12,8 @@ function newFoundationsUtilitiesMandatoryProgram() { programName, programNodeType, programPowerName, - usersArrayPropertyName + usersArrayPropertyName, + userNodeType ) { /* Here we will store the total amount of tokens that is going to be distributed among all participants @@ -113,7 +114,7 @@ function newFoundationsUtilitiesMandatoryProgram() { return } if ( - node.type === 'User Mentor' && + node.type === userNodeType && node.payload.referenceParent !== undefined ) { reserProgram(node.payload.referenceParent) @@ -227,7 +228,7 @@ function newFoundationsUtilitiesMandatoryProgram() { } break } - case 'User Mentor': { + case userNodeType: { node.payload[programPropertyName].outgoingPower = node.payload.parentNode.payload[programPropertyName].outgoingPower / node.payload.parentNode[usersArrayPropertyName].length drawUserMentor(node) From dae98d3fd446594d7348c6909acbb70dfb9eca00 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 21 Jun 2021 08:36:35 +0200 Subject: [PATCH 11/17] Program Utility abstraction finished --- Projects/Governance/UI/Utilities/MandatoryProgram.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Projects/Governance/UI/Utilities/MandatoryProgram.js b/Projects/Governance/UI/Utilities/MandatoryProgram.js index 0ca935486..5eb18b9f9 100644 --- a/Projects/Governance/UI/Utilities/MandatoryProgram.js +++ b/Projects/Governance/UI/Utilities/MandatoryProgram.js @@ -146,7 +146,7 @@ function newFoundationsUtilitiesMandatoryProgram() { (node[usersArrayPropertyName] === undefined || hasUsersDefined(node[usersArrayPropertyName]) === false) ) { node.payload[programPropertyName].isActive = false - node.payload.uiObject.setErrorMessage("In order to enable this program you need to add User Mentor nodes and reference a User Profile from each one.") + node.payload.uiObject.setErrorMessage("In order to enable this program you need to add " + userNodeType + " nodes and reference a User Profile from each one.") } else { node.payload[programPropertyName].isActive = true } @@ -231,7 +231,7 @@ function newFoundationsUtilitiesMandatoryProgram() { case userNodeType: { node.payload[programPropertyName].outgoingPower = node.payload.parentNode.payload[programPropertyName].outgoingPower / node.payload.parentNode[usersArrayPropertyName].length - drawUserMentor(node) + drawUserNode(node) if (node.payload.referenceParent !== undefined) { distributeProgramPower(node.payload.referenceParent, mentoshipPower / 10, 0) } @@ -278,7 +278,7 @@ function newFoundationsUtilitiesMandatoryProgram() { drawProgram(programNode) } - function drawUserMentor(node) { + function drawUserNode(node) { if (node.payload !== undefined) { const outgoingPowerText = new Intl.NumberFormat().format(node.payload[programPropertyName].outgoingPower) From e606fd5101eb6271200d1bd22a0b2194970e1cc1 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 21 Jun 2021 11:58:36 +0200 Subject: [PATCH 12/17] Token Power Switch Refactoring --- ...oken-switch.png => token-power-switch.png} | Bin .../Plugins/User-Profiles/Julian-Molina.json | 6 +-- .../User-Profiles/Luis-Fernando-Molina.json | 6 +-- .../Schemas/App-Schema/claims-program.json | 2 +- .../App-Schema/mentorship-program.json | 2 +- .../Schemas/App-Schema/referral-program.json | 2 +- .../Schemas/App-Schema/staking-program.json | 2 +- .../Schemas/App-Schema/support-program.json | 2 +- ...ensSwitch.json => token-power-switch.json} | 4 +- ...TokensAwarded.json => tokens-awarded.json} | 0 .../Schemas/App-Schema/user-profile.json | 10 ++-- .../Schemas/App-Schema/voting-program.json | 2 +- .../UI/Function-Libraries/ReferralProgram.js | 36 ++++++------- .../UI/Function-Libraries/TokenPower.js | 16 +++--- .../Governance/UI/Function-Libraries/Votes.js | 18 +++---- .../UI/Utilities/MandatoryProgram.js | 48 +++++++++--------- 16 files changed, 78 insertions(+), 78 deletions(-) rename Projects/Governance/Icons/{token-switch.png => token-power-switch.png} (100%) rename Projects/Governance/Schemas/App-Schema/{tokensSwitch.json => token-power-switch.json} (97%) rename Projects/Governance/Schemas/App-Schema/{TokensAwarded.json => tokens-awarded.json} (100%) diff --git a/Projects/Governance/Icons/token-switch.png b/Projects/Governance/Icons/token-power-switch.png similarity index 100% rename from Projects/Governance/Icons/token-switch.png rename to Projects/Governance/Icons/token-power-switch.png diff --git a/Projects/Governance/Plugins/User-Profiles/Julian-Molina.json b/Projects/Governance/Plugins/User-Profiles/Julian-Molina.json index ef80bb5b5..6c5b2049a 100644 --- a/Projects/Governance/Plugins/User-Profiles/Julian-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Julian-Molina.json @@ -3,9 +3,9 @@ "name": "Julian-Molina", "config": "{\n \"signature\": {\n \"message\": \"julian-molina\",\n \"messageHash\": \"0x34eae63163cc918a1a1fab82836b0f15e33051925812cf7d5f8ffe5ff0854f2c\",\n \"v\": \"0x1b\",\n \"r\": \"0x8560ff34239215408cb869d3c90c30ed11ab6634c4269b255d2b4159b7690fe5\",\n \"s\": \"0x017b2c5e080b0f340dcd09f8ba5c67119a3b62c375252d96f541c57db109a0b7\",\n \"signature\": \"0x8560ff34239215408cb869d3c90c30ed11ab6634c4269b255d2b4159b7690fe5017b2c5e080b0f340dcd09f8ba5c67119a3b62c375252d96f541c57db109a0b71b\"\n }\n}", "project": "Governance", - "tokenSwitch": { - "type": "Token Switch", - "name": "New Token Switch", + "tokenPowerSwitch": { + "type": "Token Power Switch", + "name": "New Token Power Switch", "config": "{}", "project": "Governance", "referralProgram": { diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index 8e6d3cea9..50a09d629 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -3,9 +3,9 @@ "name": "Luis-Fernando-Molina", "config": "{\n \"tokens\": 10000000,\n \"signature\": {\n \"message\": \"Luis-Fernando-Molina\",\n \"messageHash\": \"0x443abf3389e332a62d21b84dd12e271cb428d334195d3aeb986ca85ee53cccb9\",\n \"v\": \"0x1b\",\n \"r\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb0\",\n \"s\": \"0x42abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e3\",\n \"signature\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb042abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e31b\"\n }\n}", "project": "Governance", - "tokenSwitch": { - "type": "Token Switch", - "name": "New Token Switch", + "tokenPowerSwitch": { + "type": "Token Power Switch", + "name": "New Token Power Switch", "config": "{}", "project": "Governance", "referralProgram": { diff --git a/Projects/Governance/Schemas/App-Schema/claims-program.json b/Projects/Governance/Schemas/App-Schema/claims-program.json index 86ec39c65..c91831a44 100644 --- a/Projects/Governance/Schemas/App-Schema/claims-program.json +++ b/Projects/Governance/Schemas/App-Schema/claims-program.json @@ -56,7 +56,7 @@ "config": "{}" }, "attachingRules": { - "compatibleTypes": "->Token Switch->" + "compatibleTypes": "->Token Power Switch->" }, "addLeftIcons": true, "level": 1, diff --git a/Projects/Governance/Schemas/App-Schema/mentorship-program.json b/Projects/Governance/Schemas/App-Schema/mentorship-program.json index 9bdf5ed90..24d587b52 100644 --- a/Projects/Governance/Schemas/App-Schema/mentorship-program.json +++ b/Projects/Governance/Schemas/App-Schema/mentorship-program.json @@ -42,7 +42,7 @@ "config": "{}" }, "attachingRules": { - "compatibleTypes": "->Token Switch->" + "compatibleTypes": "->Token Power Switch->" }, "addLeftIcons": true, "level": 1, diff --git a/Projects/Governance/Schemas/App-Schema/referral-program.json b/Projects/Governance/Schemas/App-Schema/referral-program.json index b16edcda3..9c7c831f5 100644 --- a/Projects/Governance/Schemas/App-Schema/referral-program.json +++ b/Projects/Governance/Schemas/App-Schema/referral-program.json @@ -44,7 +44,7 @@ "config": "{}" }, "attachingRules": { - "compatibleTypes": "->Token Switch->" + "compatibleTypes": "->Token Power Switch->" }, "addLeftIcons": true, "level": 1, diff --git a/Projects/Governance/Schemas/App-Schema/staking-program.json b/Projects/Governance/Schemas/App-Schema/staking-program.json index d8e103712..86dab37b1 100644 --- a/Projects/Governance/Schemas/App-Schema/staking-program.json +++ b/Projects/Governance/Schemas/App-Schema/staking-program.json @@ -35,7 +35,7 @@ "config": "{}" }, "attachingRules": { - "compatibleTypes": "->Token Switch->" + "compatibleTypes": "->Token Power Switch->" }, "addLeftIcons": true, "level": 1, diff --git a/Projects/Governance/Schemas/App-Schema/support-program.json b/Projects/Governance/Schemas/App-Schema/support-program.json index a0bfb71e3..9e36f802d 100644 --- a/Projects/Governance/Schemas/App-Schema/support-program.json +++ b/Projects/Governance/Schemas/App-Schema/support-program.json @@ -42,7 +42,7 @@ "config": "{}" }, "attachingRules": { - "compatibleTypes": "->Token Switch->" + "compatibleTypes": "->Token Power Switch->" }, "addLeftIcons": true, "level": 1, diff --git a/Projects/Governance/Schemas/App-Schema/tokensSwitch.json b/Projects/Governance/Schemas/App-Schema/token-power-switch.json similarity index 97% rename from Projects/Governance/Schemas/App-Schema/tokensSwitch.json rename to Projects/Governance/Schemas/App-Schema/token-power-switch.json index caad9fc1d..76ccc55a6 100644 --- a/Projects/Governance/Schemas/App-Schema/tokensSwitch.json +++ b/Projects/Governance/Schemas/App-Schema/token-power-switch.json @@ -1,5 +1,5 @@ { - "type": "Token Switch", + "type": "Token Power Switch", "menuItems": [ { "action": "Configure", @@ -84,7 +84,7 @@ "attachingRules": { "compatibleTypes": "->User Profile->" }, - "propertyNameAtParent": "tokenSwitch", + "propertyNameAtParent": "tokenPowerSwitch", "childrenNodesProperties": [ { "name": "referralProgram", diff --git a/Projects/Governance/Schemas/App-Schema/TokensAwarded.json b/Projects/Governance/Schemas/App-Schema/tokens-awarded.json similarity index 100% rename from Projects/Governance/Schemas/App-Schema/TokensAwarded.json rename to Projects/Governance/Schemas/App-Schema/tokens-awarded.json diff --git a/Projects/Governance/Schemas/App-Schema/user-profile.json b/Projects/Governance/Schemas/App-Schema/user-profile.json index 938527f3b..e77884227 100644 --- a/Projects/Governance/Schemas/App-Schema/user-profile.json +++ b/Projects/Governance/Schemas/App-Schema/user-profile.json @@ -12,10 +12,10 @@ "action": "Add UI Object", "actionProject": "Foundations", "disableIfPropertyIsDefined": true, - "propertyToCheckFor": "tokenSwitch", + "propertyToCheckFor": "tokenPowerSwitch", "actionFunction": "payload.executeAction", - "label": "Add Token Switch", - "relatedUiObject": "Token Switch" + "label": "Add Token Power Switch", + "relatedUiObject": "Token Power Switch" }, { "action": "Delete UI Object", @@ -40,9 +40,9 @@ "level": 0, "childrenNodesProperties": [ { - "name": "tokenSwitch", + "name": "tokenPowerSwitch", "type": "node", - "childType": "Token Switch", + "childType": "Token Power Switch", "autoAdd": true } ] diff --git a/Projects/Governance/Schemas/App-Schema/voting-program.json b/Projects/Governance/Schemas/App-Schema/voting-program.json index 04185a618..83a9aec37 100644 --- a/Projects/Governance/Schemas/App-Schema/voting-program.json +++ b/Projects/Governance/Schemas/App-Schema/voting-program.json @@ -42,7 +42,7 @@ "config": "{}" }, "attachingRules": { - "compatibleTypes": "->Token Switch->" + "compatibleTypes": "->Token Power Switch->" }, "addLeftIcons": true, "level": 1, diff --git a/Projects/Governance/UI/Function-Libraries/ReferralProgram.js b/Projects/Governance/UI/Function-Libraries/ReferralProgram.js index d6d4950a4..4864d4028 100644 --- a/Projects/Governance/UI/Function-Libraries/ReferralProgram.js +++ b/Projects/Governance/UI/Function-Libraries/ReferralProgram.js @@ -35,29 +35,29 @@ function newGovernanceFunctionLibraryReferralProgram() { for (let i = 0; i < userProfiles.length; i++) { let userProfile = userProfiles[i] - if (userProfile.tokenSwitch === undefined) { continue } - if (userProfile.tokenSwitch.referralProgram === undefined) { continue } - if (userProfile.tokenSwitch.referralProgram.payload === undefined) { continue } + if (userProfile.tokenPowerSwitch === undefined) { continue } + if (userProfile.tokenPowerSwitch.referralProgram === undefined) { continue } + if (userProfile.tokenPowerSwitch.referralProgram.payload === undefined) { continue } - reserReferralProgram(userProfile.tokenSwitch.referralProgram) + reserReferralProgram(userProfile.tokenPowerSwitch.referralProgram) } for (let i = 0; i < userProfiles.length; i++) { let userProfile = userProfiles[i] - if (userProfile.tokenSwitch === undefined) { continue } - if (userProfile.tokenSwitch.referralProgram === undefined) { continue } - if (userProfile.tokenSwitch.referralProgram.payload === undefined) { continue } + if (userProfile.tokenPowerSwitch === undefined) { continue } + if (userProfile.tokenPowerSwitch.referralProgram === undefined) { continue } + if (userProfile.tokenPowerSwitch.referralProgram.payload === undefined) { continue } - distributeReferralProgram(userProfile.tokenSwitch.referralProgram) + distributeReferralProgram(userProfile.tokenPowerSwitch.referralProgram) } for (let i = 0; i < userProfiles.length; i++) { let userProfile = userProfiles[i] - if (userProfile.tokenSwitch === undefined) { continue } - if (userProfile.tokenSwitch.referralProgram === undefined) { continue } - if (userProfile.tokenSwitch.referralProgram.payload === undefined) { continue } + if (userProfile.tokenPowerSwitch === undefined) { continue } + if (userProfile.tokenPowerSwitch.referralProgram === undefined) { continue } + if (userProfile.tokenPowerSwitch.referralProgram.payload === undefined) { continue } - calculateReferralProgram(userProfile.tokenSwitch.referralProgram) + calculateReferralProgram(userProfile.tokenPowerSwitch.referralProgram) } function reserReferralProgram(node) { @@ -75,13 +75,13 @@ function newGovernanceFunctionLibraryReferralProgram() { } if ( node.type === 'User Profile' && - node.tokenSwitch !== undefined + node.tokenPowerSwitch !== undefined ) { - reserReferralProgram(node.tokenSwitch) + reserReferralProgram(node.tokenPowerSwitch) return } if ( - node.type === 'Token Switch' && + node.type === 'Token Power Switch' && node.referralProgram !== undefined ) { reserReferralProgram(node.referralProgram) @@ -177,12 +177,12 @@ function newGovernanceFunctionLibraryReferralProgram() { break } case 'User Profile': { - if (node.tokenSwitch !== undefined) { - distributeReferralPower(node.tokenSwitch, referringPower, 0) + if (node.tokenPowerSwitch !== undefined) { + distributeReferralPower(node.tokenPowerSwitch, referringPower, 0) } break } - case 'Token Switch': { + case 'Token Power Switch': { if (node.referralProgram !== undefined) { distributeReferralPower(node.referralProgram, referringPower, 1) } diff --git a/Projects/Governance/UI/Function-Libraries/TokenPower.js b/Projects/Governance/UI/Function-Libraries/TokenPower.js index fc8e533eb..708d2259b 100644 --- a/Projects/Governance/UI/Function-Libraries/TokenPower.js +++ b/Projects/Governance/UI/Function-Libraries/TokenPower.js @@ -78,20 +78,20 @@ function newGovernanceFunctionLibraryTokenPower() { /* Before we start we will do some validations: */ - if (userProfile.tokenSwitch === undefined) { - userProfile.payload.uiObject.setErrorMessage("You need to have a Token Switch child node.") + if (userProfile.tokenPowerSwitch === undefined) { + userProfile.payload.uiObject.setErrorMessage("You need to have a Token Power Switch child node.") return } - if (userProfile.tokenSwitch.referralProgram === undefined) { - userProfile.tokenSwitch.payload.uiObject.setErrorMessage("You need to have a Referral Program child node.") + if (userProfile.tokenPowerSwitch.referralProgram === undefined) { + userProfile.tokenPowerSwitch.payload.uiObject.setErrorMessage("You need to have a Referral Program child node.") return } - if (userProfile.tokenSwitch.mentorshipProgram === undefined) { - userProfile.tokenSwitch.payload.uiObject.setErrorMessage("You need to have a Mentorship Program child node.") + if (userProfile.tokenPowerSwitch.mentorshipProgram === undefined) { + userProfile.tokenPowerSwitch.payload.uiObject.setErrorMessage("You need to have a Mentorship Program child node.") return } - if (userProfile.tokenSwitch.supportProgram === undefined) { - userProfile.tokenSwitch.payload.uiObject.setErrorMessage("You need to have a Spupport Program child node.") + if (userProfile.tokenPowerSwitch.supportProgram === undefined) { + userProfile.tokenPowerSwitch.payload.uiObject.setErrorMessage("You need to have a Spupport Program child node.") return } diff --git a/Projects/Governance/UI/Function-Libraries/Votes.js b/Projects/Governance/UI/Function-Libraries/Votes.js index 7c4f6392d..be6166f71 100644 --- a/Projects/Governance/UI/Function-Libraries/Votes.js +++ b/Projects/Governance/UI/Function-Libraries/Votes.js @@ -42,22 +42,22 @@ function newGovernanceFunctionLibraryVotes() { for (let i = 0; i < userProfiles.length; i++) { let userProfile = userProfiles[i] - if (userProfile.tokenSwitch === undefined) { continue } - if (userProfile.tokenSwitch.votingProgram === undefined) { continue } - if (userProfile.tokenSwitch.votingProgram.payload === undefined) { continue } + if (userProfile.tokenPowerSwitch === undefined) { continue } + if (userProfile.tokenPowerSwitch.votingProgram === undefined) { continue } + if (userProfile.tokenPowerSwitch.votingProgram.payload === undefined) { continue } - resetVotes(userProfile.tokenSwitch.votingProgram) + resetVotes(userProfile.tokenPowerSwitch.votingProgram) } for (let i = 0; i < userProfiles.length; i++) { let userProfile = userProfiles[i] - if (userProfile.tokenSwitch === undefined) { continue } - if (userProfile.tokenSwitch.votingProgram === undefined) { continue } - if (userProfile.tokenSwitch.votingProgram.payload === undefined) { continue } + if (userProfile.tokenPowerSwitch === undefined) { continue } + if (userProfile.tokenPowerSwitch.votingProgram === undefined) { continue } + if (userProfile.tokenPowerSwitch.votingProgram.payload === undefined) { continue } - userProfile.tokenSwitch.votingProgram.payload.votes = userProfile.tokenSwitch.votingProgram.payload.tokenPower + userProfile.tokenPowerSwitch.votingProgram.payload.votes = userProfile.tokenPowerSwitch.votingProgram.payload.tokenPower - distributeVotingProgram(userProfile.tokenSwitch.votingProgram) + distributeVotingProgram(userProfile.tokenPowerSwitch.votingProgram) } function resetVotes(node) { diff --git a/Projects/Governance/UI/Utilities/MandatoryProgram.js b/Projects/Governance/UI/Utilities/MandatoryProgram.js index 5eb18b9f9..6c4fbbafe 100644 --- a/Projects/Governance/UI/Utilities/MandatoryProgram.js +++ b/Projects/Governance/UI/Utilities/MandatoryProgram.js @@ -41,40 +41,40 @@ function newFoundationsUtilitiesMandatoryProgram() { for (let i = 0; i < userProfiles.length; i++) { let userProfile = userProfiles[i] - if (userProfile.tokenSwitch === undefined) { continue } - if (userProfile.tokenSwitch[programPropertyName] === undefined) { continue } - if (userProfile.tokenSwitch[programPropertyName].payload === undefined) { continue } + if (userProfile.tokenPowerSwitch === undefined) { continue } + if (userProfile.tokenPowerSwitch[programPropertyName] === undefined) { continue } + if (userProfile.tokenPowerSwitch[programPropertyName].payload === undefined) { continue } - reserProgram(userProfile.tokenSwitch[programPropertyName]) + reserProgram(userProfile.tokenPowerSwitch[programPropertyName]) } for (let i = 0; i < userProfiles.length; i++) { let userProfile = userProfiles[i] - if (userProfile.tokenSwitch === undefined) { continue } - if (userProfile.tokenSwitch[programPropertyName] === undefined) { continue } - if (userProfile.tokenSwitch[programPropertyName].payload === undefined) { continue } + if (userProfile.tokenPowerSwitch === undefined) { continue } + if (userProfile.tokenPowerSwitch[programPropertyName] === undefined) { continue } + if (userProfile.tokenPowerSwitch[programPropertyName].payload === undefined) { continue } - validateProgram(userProfile.tokenSwitch[programPropertyName]) + validateProgram(userProfile.tokenPowerSwitch[programPropertyName]) } for (let i = 0; i < userProfiles.length; i++) { let userProfile = userProfiles[i] - if (userProfile.tokenSwitch === undefined) { continue } - if (userProfile.tokenSwitch[programPropertyName] === undefined) { continue } - if (userProfile.tokenSwitch[programPropertyName].payload === undefined) { continue } - if (userProfile.tokenSwitch[programPropertyName].payload[programPropertyName].isActive === false) { continue } + if (userProfile.tokenPowerSwitch === undefined) { continue } + if (userProfile.tokenPowerSwitch[programPropertyName] === undefined) { continue } + if (userProfile.tokenPowerSwitch[programPropertyName].payload === undefined) { continue } + if (userProfile.tokenPowerSwitch[programPropertyName].payload[programPropertyName].isActive === false) { continue } - distributeProgram(userProfile.tokenSwitch[programPropertyName]) + distributeProgram(userProfile.tokenPowerSwitch[programPropertyName]) } for (let i = 0; i < userProfiles.length; i++) { let userProfile = userProfiles[i] - if (userProfile.tokenSwitch === undefined) { continue } - if (userProfile.tokenSwitch[programPropertyName] === undefined) { continue } - if (userProfile.tokenSwitch[programPropertyName].payload === undefined) { continue } - if (userProfile.tokenSwitch[programPropertyName].payload[programPropertyName].isActive === false) { continue } + if (userProfile.tokenPowerSwitch === undefined) { continue } + if (userProfile.tokenPowerSwitch[programPropertyName] === undefined) { continue } + if (userProfile.tokenPowerSwitch[programPropertyName].payload === undefined) { continue } + if (userProfile.tokenPowerSwitch[programPropertyName].payload[programPropertyName].isActive === false) { continue } - calculateProgram(userProfile.tokenSwitch[programPropertyName]) + calculateProgram(userProfile.tokenPowerSwitch[programPropertyName]) } function reserProgram(node) { @@ -92,13 +92,13 @@ function newFoundationsUtilitiesMandatoryProgram() { } if ( node.type === 'User Profile' && - node.tokenSwitch !== undefined + node.tokenPowerSwitch !== undefined ) { - reserProgram(node.tokenSwitch) + reserProgram(node.tokenPowerSwitch) return } if ( - node.type === 'Token Switch' && + node.type === 'Token Power Switch' && node[programPropertyName] !== undefined ) { reserProgram(node[programPropertyName]) @@ -238,12 +238,12 @@ function newFoundationsUtilitiesMandatoryProgram() { break } case 'User Profile': { - if (node.tokenSwitch !== undefined) { - distributeProgramPower(node.tokenSwitch, mentoshipPower, 0) + if (node.tokenPowerSwitch !== undefined) { + distributeProgramPower(node.tokenPowerSwitch, mentoshipPower, 0) } break } - case 'Token Switch': { + case 'Token Power Switch': { if (node[programPropertyName] !== undefined) { distributeProgramPower(node[programPropertyName], mentoshipPower, 1) } From 7bf9b0d245a6e02adb2004c5e4035e3c678d3c59 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 21 Jun 2021 12:05:55 +0200 Subject: [PATCH 13/17] typo fixed --- Projects/Governance/UI/Utilities/MandatoryProgram.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Projects/Governance/UI/Utilities/MandatoryProgram.js b/Projects/Governance/UI/Utilities/MandatoryProgram.js index 6c4fbbafe..1052099e0 100644 --- a/Projects/Governance/UI/Utilities/MandatoryProgram.js +++ b/Projects/Governance/UI/Utilities/MandatoryProgram.js @@ -82,6 +82,7 @@ function newFoundationsUtilitiesMandatoryProgram() { if (node.payload === undefined) { return } node.payload[programPropertyName] = { count: 0, + percentage: 0, outgoingPower: 0, ownPower: 0, incomingPower: 0, From c315f1feef5e9bfd47bdb2b25e2edc25b3ab323c Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 21 Jun 2021 12:27:20 +0200 Subject: [PATCH 14/17] percentage at childs of mandatory programs implemented --- .../User-Profiles/Luis-Fernando-Molina.json | 2 +- .../UI/Utilities/MandatoryProgram.js | 61 +++++++++++++++---- 2 files changed, 51 insertions(+), 12 deletions(-) diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index 50a09d629..ec7da26e1 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -101,7 +101,7 @@ { "type": "User Mentor", "name": "Julian-Molina", - "config": "{}", + "config": "{\n \"percentage\": 90\n}", "project": "Governance", "id": "97483d0f-35ec-4471-a981-0d22565e0d63", "savedPayload": { diff --git a/Projects/Governance/UI/Utilities/MandatoryProgram.js b/Projects/Governance/UI/Utilities/MandatoryProgram.js index 1052099e0..4d21081f1 100644 --- a/Projects/Governance/UI/Utilities/MandatoryProgram.js +++ b/Projects/Governance/UI/Utilities/MandatoryProgram.js @@ -45,7 +45,7 @@ function newFoundationsUtilitiesMandatoryProgram() { if (userProfile.tokenPowerSwitch[programPropertyName] === undefined) { continue } if (userProfile.tokenPowerSwitch[programPropertyName].payload === undefined) { continue } - reserProgram(userProfile.tokenPowerSwitch[programPropertyName]) + resetProgram(userProfile.tokenPowerSwitch[programPropertyName]) } for (let i = 0; i < userProfiles.length; i++) { let userProfile = userProfiles[i] @@ -77,7 +77,7 @@ function newFoundationsUtilitiesMandatoryProgram() { calculateProgram(userProfile.tokenPowerSwitch[programPropertyName]) } - function reserProgram(node) { + function resetProgram(node) { if (node === undefined) { return } if (node.payload === undefined) { return } node.payload[programPropertyName] = { @@ -95,14 +95,14 @@ function newFoundationsUtilitiesMandatoryProgram() { node.type === 'User Profile' && node.tokenPowerSwitch !== undefined ) { - reserProgram(node.tokenPowerSwitch) + resetProgram(node.tokenPowerSwitch) return } if ( node.type === 'Token Power Switch' && node[programPropertyName] !== undefined ) { - reserProgram(node[programPropertyName]) + resetProgram(node[programPropertyName]) return } if ( @@ -110,7 +110,7 @@ function newFoundationsUtilitiesMandatoryProgram() { node[usersArrayPropertyName] !== undefined ) { for (let i = 0; i < node[usersArrayPropertyName].length; i++) { - reserProgram(node[usersArrayPropertyName][i]) + resetProgram(node[usersArrayPropertyName][i]) } return } @@ -118,7 +118,7 @@ function newFoundationsUtilitiesMandatoryProgram() { node.type === userNodeType && node.payload.referenceParent !== undefined ) { - reserProgram(node.payload.referenceParent) + resetProgram(node.payload.referenceParent) return } } @@ -183,7 +183,8 @@ function newFoundationsUtilitiesMandatoryProgram() { function distributeProgramPower( node, mentoshipPower, - count + count, + percentage ) { if (node === undefined) { return } if (node.payload === undefined) { return } @@ -223,16 +224,49 @@ function newFoundationsUtilitiesMandatoryProgram() { accumulatedIncomingProgramPower = accumulatedIncomingProgramPower + node.payload[programPropertyName].incomingPower if (node[usersArrayPropertyName] !== undefined) { + /* + Before distributing the program power, we will calculate how the power + is going to be switched between all nodes. The first pass is about + scanning all sibling nodes to see which ones have a percentage defined + at their config, and check that all percentages don't add more than 100. + */ + let totalPercentage = 0 + let totalNodesWithoutPercentage = 0 for (let i = 0; i < node[usersArrayPropertyName].length; i++) { - distributeProgramPower(node[usersArrayPropertyName][i], mentoshipPower / node[usersArrayPropertyName].length, 0) + let childNode = node[usersArrayPropertyName][i] + let percentage = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(childNode.payload, 'percentage') + if (percentage !== undefined && isNaN(percentage) !== true) { + totalPercentage = totalPercentage + percentage + } else { + totalNodesWithoutPercentage++ + } + } + if (totalPercentage > 100) { + node.payload.uiObject.setErrorMessage('Program Power Switching Error. Total Percentage of children nodes is grater that 100.') + return + } + let defaultPercentage = 0 + if (totalNodesWithoutPercentage > 0) { + defaultPercentage = (100 - totalPercentage) / totalNodesWithoutPercentage + } + /* + Here we do the actual distribution. + */ + for (let i = 0; i < node[usersArrayPropertyName].length; i++) { + let childNode = node[usersArrayPropertyName][i] + let percentage = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(childNode.payload, 'percentage') + if (percentage === undefined || isNaN(percentage) === true) { + percentage = defaultPercentage + } + distributeProgramPower(childNode, mentoshipPower * percentage / 100, 0, percentage) } } break } case userNodeType: { - node.payload[programPropertyName].outgoingPower = node.payload.parentNode.payload[programPropertyName].outgoingPower / node.payload.parentNode[usersArrayPropertyName].length + node.payload[programPropertyName].outgoingPower = node.payload.parentNode.payload[programPropertyName].outgoingPower * percentage / 100 - drawUserNode(node) + drawUserNode(node, percentage) if (node.payload.referenceParent !== undefined) { distributeProgramPower(node.payload.referenceParent, mentoshipPower / 10, 0) } @@ -279,7 +313,7 @@ function newFoundationsUtilitiesMandatoryProgram() { drawProgram(programNode) } - function drawUserNode(node) { + function drawUserNode(node, percentage) { if (node.payload !== undefined) { const outgoingPowerText = new Intl.NumberFormat().format(node.payload[programPropertyName].outgoingPower) @@ -289,6 +323,11 @@ function newFoundationsUtilitiesMandatoryProgram() { node.payload.uiObject.setValue(outgoingPowerText + ' ' + programPowerName) + node.payload.uiObject.percentageAngleOffset = 180 + node.payload.uiObject.percentageAtAngle = true + + node.payload.uiObject.setPercentage(percentage) + node.payload.uiObject.statusAngleOffset = 0 node.payload.uiObject.statusAtAngle = false From 54efa67c9c15be2cdff8ef768a27479607e7a7db Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 21 Jun 2021 12:35:40 +0200 Subject: [PATCH 15/17] Referral Program Re-Implemented --- .../Plugins/User-Profiles/Julian-Molina.json | 84 +++--- .../User-Profiles/Luis-Fernando-Molina.json | 62 ++-- .../Schemas/App-Schema/referral-program.json | 6 +- .../UI/Function-Libraries/ReferralProgram.js | 270 +----------------- .../UI/Utilities/MandatoryProgram.js | 2 +- 5 files changed, 88 insertions(+), 336 deletions(-) diff --git a/Projects/Governance/Plugins/User-Profiles/Julian-Molina.json b/Projects/Governance/Plugins/User-Profiles/Julian-Molina.json index 6c5b2049a..21e5006f4 100644 --- a/Projects/Governance/Plugins/User-Profiles/Julian-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Julian-Molina.json @@ -13,37 +13,39 @@ "name": "New Referral Program", "config": "{}", "project": "Governance", - "userReferrer": { - "type": "User Referrer", - "name": "Jeremy", - "config": "{}", - "project": "Governance", - "id": "0d0b04ff-034b-4b02-8351-67d621d514c0", - "savedPayload": { - "position": { - "x": 25532.618466191747, - "y": 23465.846712854385 - }, - "targetPosition": { - "x": 25233.45732703739, - "y": 23488.265740930314 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "User Profile", - "name": "Jeremy", - "id": "759e9012-c995-47ed-92f1-7d204bf2b58e" + "userReferrers": [ + { + "type": "User Referrer", + "name": "Jeremy", + "config": "{}", + "project": "Governance", + "id": "0aa9db01-7605-4a51-abd9-e233de6721d6", + "savedPayload": { + "position": { + "x": 25532.618466191747, + "y": 23465.846712854385 + }, + "targetPosition": { + "x": 25233.45732703739, + "y": 23488.265740930314 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "User Profile", + "name": "Jeremy", + "id": "759e9012-c995-47ed-92f1-7d204bf2b58e" + } } } - }, + ], "tokensAwarded": { "type": "Tokens Awarded", "name": "New Tokens Awarded", @@ -106,12 +108,12 @@ "id": "0e176a01-3ed2-4b02-b070-601236ea2393", "savedPayload": { "position": { - "x": 25662.630264392985, - "y": 23874.32824727054 + "x": 25429.475731817543, + "y": 23702.252371245373 }, "targetPosition": { - "x": 25243.737077503094, - "y": 23709.924786305663 + "x": 25150.213607224283, + "y": 23592.650063935456 }, "floatingObject": { "isPinned": false, @@ -137,12 +139,12 @@ "id": "27f046ba-de7c-45a3-9086-d6f4e0ac0fd7", "savedPayload": { "position": { - "x": 25310.806097282373, - "y": 24154.89865810697 + "x": 25194.926287077134, + "y": 23889.299311802995 }, "targetPosition": { - "x": 25243.737077503094, - "y": 23709.924786305663 + "x": 25150.213607224283, + "y": 23592.650063935456 }, "floatingObject": { "isPinned": false, @@ -158,8 +160,8 @@ "id": "362a1ecb-dce9-4ebb-9b00-a20d3631f2f3", "savedPayload": { "position": { - "x": 25243.737077503094, - "y": 23709.924786305663 + "x": 25150.213607224283, + "y": 23592.650063935456 }, "targetPosition": { "x": 24963.166666666664, @@ -168,9 +170,9 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": false, + "isCollapsed": true, "angleToParent": 2, - "distanceToParent": 4, + "distanceToParent": 3, "arrangementStyle": 0 }, "uiObject": { diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index ec7da26e1..2daef2967 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -13,37 +13,39 @@ "name": "New Referral Program", "config": "{}", "project": "Governance", - "userReferrer": { - "type": "User Referrer", - "name": "Julian-Molina", - "config": "{}", - "project": "Governance", - "id": "c96ae419-54ad-4d70-94fe-38833288d471", - "savedPayload": { - "position": { - "x": 30660.151752050326, - "y": 22933.690934849117 - }, - "targetPosition": { - "x": 30550.54944474041, - "y": 23212.953059442378 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "User Profile", - "name": "Julian-Molina", - "id": "1fd95e41-4b22-48d5-be3a-904c37afcb11" + "userReferrers": [ + { + "type": "User Referrer", + "name": "Julian-Molina", + "config": "{}", + "project": "Governance", + "id": "fb0a076c-b0a8-4f16-9a47-10a3f3489a0a", + "savedPayload": { + "position": { + "x": 30660.151752050326, + "y": 22933.690934849117 + }, + "targetPosition": { + "x": 30550.54944474041, + "y": 23212.953059442378 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "User Profile", + "name": "Julian-Molina", + "id": "1fd95e41-4b22-48d5-be3a-904c37afcb11" + } } } - }, + ], "tokensAwarded": { "type": "Tokens Awarded", "name": "New Tokens Awarded", @@ -82,7 +84,7 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": true, + "isCollapsed": false, "angleToParent": 1, "distanceToParent": 3, "arrangementStyle": 0 diff --git a/Projects/Governance/Schemas/App-Schema/referral-program.json b/Projects/Governance/Schemas/App-Schema/referral-program.json index 9c7c831f5..4ee361de2 100644 --- a/Projects/Governance/Schemas/App-Schema/referral-program.json +++ b/Projects/Governance/Schemas/App-Schema/referral-program.json @@ -11,8 +11,6 @@ { "action": "Add UI Object", "actionProject": "Foundations", - "disableIfPropertyIsDefined": true, - "propertyToCheckFor": "userReferrer", "actionFunction": "payload.executeAction", "label": "Add User Referrer", "relatedUiObject": "User Referrer" @@ -51,8 +49,8 @@ "propertyNameAtParent": "referralProgram", "childrenNodesProperties": [ { - "name": "userReferrer", - "type": "node", + "name": "userReferrers", + "type": "array", "childType": "User Referrer", "autoAdd": true }, diff --git a/Projects/Governance/UI/Function-Libraries/ReferralProgram.js b/Projects/Governance/UI/Function-Libraries/ReferralProgram.js index 4864d4028..b922392d5 100644 --- a/Projects/Governance/UI/Function-Libraries/ReferralProgram.js +++ b/Projects/Governance/UI/Function-Libraries/ReferralProgram.js @@ -9,265 +9,15 @@ function newGovernanceFunctionLibraryReferralProgram() { pools, userProfiles ) { - /* - Here we will store the total amount of tokens that is going to be distributed among all participants - of the Referral Program. This will come from a Pool that is configured wiht a codeName config property - with the value "Referral-Program" - */ - let referralProgramPoolTokenReward - /* - In order to be able to calculate the share of the Referrals Program Pool for each User Profile, - we need to accumulate all the Icomming Referral Power that each User Profile at their Referral Program - node has, because with that Incoming Power is that each Referral Program node gets a share of - the pool. - */ - let accumulatedIncomingReferralPower = 0 - - /* Scan Pools Until finding the Referrla-Program Pool */ - for (let i = 0; i < pools.length; i++) { - let poolsNode = pools[i] - referralProgramPoolTokenReward = UI.projects.governance.utilities.pools.findPool(poolsNode, "Referral-Program") - } - if (referralProgramPoolTokenReward === undefined || referralProgramPoolTokenReward === 0) { return } - /* - We will first reset all the referral outgoingPower, and then distribute it. - */ - for (let i = 0; i < userProfiles.length; i++) { - let userProfile = userProfiles[i] - - if (userProfile.tokenPowerSwitch === undefined) { continue } - if (userProfile.tokenPowerSwitch.referralProgram === undefined) { continue } - if (userProfile.tokenPowerSwitch.referralProgram.payload === undefined) { continue } - - reserReferralProgram(userProfile.tokenPowerSwitch.referralProgram) - } - for (let i = 0; i < userProfiles.length; i++) { - let userProfile = userProfiles[i] - - if (userProfile.tokenPowerSwitch === undefined) { continue } - if (userProfile.tokenPowerSwitch.referralProgram === undefined) { continue } - if (userProfile.tokenPowerSwitch.referralProgram.payload === undefined) { continue } - - distributeReferralProgram(userProfile.tokenPowerSwitch.referralProgram) - } - for (let i = 0; i < userProfiles.length; i++) { - let userProfile = userProfiles[i] - - if (userProfile.tokenPowerSwitch === undefined) { continue } - if (userProfile.tokenPowerSwitch.referralProgram === undefined) { continue } - if (userProfile.tokenPowerSwitch.referralProgram.payload === undefined) { continue } - - calculateReferralProgram(userProfile.tokenPowerSwitch.referralProgram) - } - - function reserReferralProgram(node) { - if (node === undefined) { return } - if (node.payload === undefined) { return } - node.payload.referralProgram = { - count: 0, - outgoingPower: 0, - ownPower: 0, - incomingPower: 0, - awarded: { - tokens: 0, - percentage: 0 - } - } - if ( - node.type === 'User Profile' && - node.tokenPowerSwitch !== undefined - ) { - reserReferralProgram(node.tokenPowerSwitch) - return - } - if ( - node.type === 'Token Power Switch' && - node.referralProgram !== undefined - ) { - reserReferralProgram(node.referralProgram) - return - } - if ( - node.type === 'Referral Program' && - node.userReferrer !== undefined - ) { - reserReferralProgram(node.userReferrer) - return - } - if ( - node.type === 'User Referrer' && - node.payload.referenceParent !== undefined - ) { - reserReferralProgram(node.payload.referenceParent) - return - } - } - - function distributeReferralProgram(referralProgram) { - if (referralProgram === undefined || referralProgram.payload === undefined) { return } - /* - Here we will convert Token Power into Referral Power. - As per system rules referringPower = tokensPower - */ - let referringPower = referralProgram.payload.tokenPower - /* - We will also reseet the count of referrals here. - */ - let count = 0 - /* - The Own Power is the power generated by the same User Profile tokens, not inherited from others. - */ - referralProgram.payload.referralProgram.ownPower = referringPower - - distributeReferralPower(referralProgram, referringPower, count) - } - - function distributeReferralPower( - node, - referringPower, - count - ) { - - if (node === undefined) { return } - if (node.payload === undefined) { return } - - switch (node.type) { - case 'Referral Program': { - /* - This is the point where we increase to our local count of referrals whatever it comes - at the count parameters. If we are processing the User Profile of this Referral Program - then we will add zero, otherwise, 1. - */ - node.payload.referralProgram.count = node.payload.referralProgram.count + count - /* - The outgoingPower of this node will be accumulating all the referringPower flowing - through it, no matter from where it comes. - */ - node.payload.referralProgram.outgoingPower = node.payload.referralProgram.outgoingPower + referringPower - /* - We need to adjust the balance that holds the accumulationt of all incomingPower of all Referral Program - nodes. To do this we will substratct the current incomingPower, bacause it is going to be recalculated - inmediatelly after this, and then we will add it again after the recalcualtion. - */ - accumulatedIncomingReferralPower = accumulatedIncomingReferralPower - node.payload.referralProgram.incomingPower - /* - At any point in time, the incomingPower will be equal to the total of the outgoingPower minus - the ownPower. This is like this because the outgoingPower is the accumulation of all the - power flow that is leaving this node, which includes the ownPower. That means that if we - substract the ownPower, we will have the accumulation of all the incomingPower, which - means all the power coming from other User Profiles referencing this one. - */ - node.payload.referralProgram.incomingPower = node.payload.referralProgram.outgoingPower - node.payload.referralProgram.ownPower - /* - Now that we have the incomingPower calculated again, we can add it again to the balance of all the incomingPower - of all Referral Program nodes. - */ - accumulatedIncomingReferralPower = accumulatedIncomingReferralPower + node.payload.referralProgram.incomingPower - - if (node.userReferrer !== undefined) { - distributeReferralPower(node.userReferrer, referringPower, 0) - } - break - } - case 'User Referrer': { - drawUserReferrer(node) - if (node.payload.referenceParent !== undefined) { - distributeReferralPower(node.payload.referenceParent, referringPower / 10, 0) - } - break - } - case 'User Profile': { - if (node.tokenPowerSwitch !== undefined) { - distributeReferralPower(node.tokenPowerSwitch, referringPower, 0) - } - break - } - case 'Token Power Switch': { - if (node.referralProgram !== undefined) { - distributeReferralPower(node.referralProgram, referringPower, 1) - } - break - } - } - } - - function calculateReferralProgram(referralProgram) { - /* - Here we will calculate which share of the Referral Program Pool this user will get in tokens. - To do that, we use the incomingPower, to see which proportion of the accumulatedIncomingReferralPower - represents. - */ - if (referralProgram.payload === undefined) { return } - /* - If the accumulatedIncomingReferralPower is not grater the amount of tokens at the Referral Program Pool, then - this user will get the exact amount of tokens from the pool as incomingPower he has. - - If the accumulatedIncomingReferralPower is grater the amount of tokens at the Referral Program Pool, then - the amount ot tokens to be received is a proportional to the share of incomingPower in accumulatedIncomingReferralPower. - */ - let totalPowerRewardRatio = accumulatedIncomingReferralPower / referralProgramPoolTokenReward - if (totalPowerRewardRatio < 1) { totalPowerRewardRatio = 1 } - - if (referralProgram.tokensAwarded === undefined || referralProgram.tokensAwarded.payload === undefined) { - referralProgram.payload.uiObject.setErrorMessage("Tokens Awarded Node is needed in order for this Program to get Tokens from the Referral Program Pool.") - return - } - referralProgram.payload.referralProgram.awarded.tokens = referralProgram.payload.referralProgram.incomingPower * totalPowerRewardRatio - /* - As per the system rules, the Referral Program will not give tokens to users that do not ha their own Referrer set up, - unless it has a big amount of tokens (this last condition is for the edge case where a user it at the top of the - referral pyramid.) - */ - if ( - referralProgram.payload.referralProgram.ownPower < 1000000 && - (referralProgram.userReferrer === undefined || referralProgram.userReferrer.payload.referenceParent === undefined) - ) { - - referralProgram.payload.uiObject.setErrorMessage("In order to be awarded " + referralProgram.payload.referralProgram.awarded.tokens + " SA Tokens from your referrals, you need first to define yourself who your referrer is.") - referralProgram.payload.referralProgram.awarded.tokens = 0 - } - - drawReferralProgram(referralProgram) - } - - function drawUserReferrer(node) { - if (node.payload !== undefined) { - const ownPowerText = new Intl.NumberFormat().format(node.payload.parentNode.payload.referralProgram.ownPower) - const incomingPowerText = new Intl.NumberFormat().format(node.payload.parentNode.payload.referralProgram.incomingPower) - const outgoingPowerText = new Intl.NumberFormat().format(node.payload.parentNode.payload.referralProgram.outgoingPower) - - node.payload.uiObject.valueAngleOffset = 180 - node.payload.uiObject.valueAtAngle = true - - node.payload.uiObject.setValue(outgoingPowerText + ' ' + 'Referring Power') - - node.payload.uiObject.statusAngleOffset = 0 - node.payload.uiObject.statusAtAngle = false - - node.payload.uiObject.setStatus(ownPowerText + ' Own RP + ' + incomingPowerText + ' Incoming RP = ' + outgoingPowerText + ' ' + ' Outgoing RP') - } - } - - function drawReferralProgram(node) { - if (node.payload !== undefined) { - - node.payload.uiObject.statusAngleOffset = 0 - node.payload.uiObject.statusAtAngle = false - - node.payload.uiObject.setStatus("Referring Power = Token Power") - } - if (node.tokensAwarded !== undefined && node.tokensAwarded.payload !== undefined) { - - const tokensAwardedText = new Intl.NumberFormat().format(node.payload.referralProgram.awarded.tokens) - - node.tokensAwarded.payload.uiObject.statusAngleOffset = 0 - node.tokensAwarded.payload.uiObject.statusAtAngle = false - node.tokensAwarded.payload.uiObject.valueAngleOffset = 0 - node.tokensAwarded.payload.uiObject.valueAtAngle = false - - node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens') - node.tokensAwarded.payload.uiObject.setStatus('From '+ node.payload.referralProgram.count + ' Referrals.') - } - } + UI.projects.governance.utilities.mandatoryProgram.run( + pools, + userProfiles, + "referralProgram", + "Referral-Program", + "Referral Program", + "Referral Power", + "userReferrers", + "User Referrer" + ) } } \ No newline at end of file diff --git a/Projects/Governance/UI/Utilities/MandatoryProgram.js b/Projects/Governance/UI/Utilities/MandatoryProgram.js index 4d21081f1..976b567a9 100644 --- a/Projects/Governance/UI/Utilities/MandatoryProgram.js +++ b/Projects/Governance/UI/Utilities/MandatoryProgram.js @@ -356,7 +356,7 @@ function newFoundationsUtilitiesMandatoryProgram() { node.tokensAwarded.payload.uiObject.valueAtAngle = false node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens') - node.tokensAwarded.payload.uiObject.setStatus('From ' + node.payload[programPropertyName].count + ' Mentees.') + node.tokensAwarded.payload.uiObject.setStatus('From ' + node.payload[programPropertyName].count + ' Descendants.') } } } From 5d871861270cef3a23155847f573052ecbca2cfb Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 21 Jun 2021 12:45:27 +0200 Subject: [PATCH 16/17] reordering child nodes --- .../App-Schema/token-power-switch.json | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/Projects/Governance/Schemas/App-Schema/token-power-switch.json b/Projects/Governance/Schemas/App-Schema/token-power-switch.json index 76ccc55a6..6e150876b 100644 --- a/Projects/Governance/Schemas/App-Schema/token-power-switch.json +++ b/Projects/Governance/Schemas/App-Schema/token-power-switch.json @@ -17,6 +17,15 @@ "label": "Add Referral Program", "relatedUiObject": "Referral Program" }, + { + "action": "Add UI Object", + "actionProject": "Foundations", + "actionFunction": "payload.executeAction", + "disableIfPropertyIsDefined": true, + "propertyToCheckFor": "supportProgram", + "label": "Add Support Program", + "relatedUiObject": "Support Program" + }, { "action": "Add UI Object", "actionProject": "Foundations", @@ -31,9 +40,9 @@ "actionProject": "Foundations", "actionFunction": "payload.executeAction", "disableIfPropertyIsDefined": true, - "propertyToCheckFor": "supportProgram", - "label": "Add Support Program", - "relatedUiObject": "Support Program" + "propertyToCheckFor": "claimsProgram", + "label": "Add Claims Program", + "relatedUiObject": "Claims Program" }, { "action": "Add UI Object", @@ -44,15 +53,6 @@ "label": "Add Voting Program", "relatedUiObject": "Voting Program" }, - { - "action": "Add UI Object", - "actionProject": "Foundations", - "actionFunction": "payload.executeAction", - "disableIfPropertyIsDefined": true, - "propertyToCheckFor": "claimsProgram", - "label": "Add Claims Program", - "relatedUiObject": "Claims Program" - }, { "action": "Add UI Object", "actionProject": "Foundations", @@ -92,12 +92,6 @@ "childType": "Referral Program", "autoAdd": true }, - { - "name": "mentorshipProgram", - "type": "node", - "childType": "Mentorship Program", - "autoAdd": true - }, { "name": "supportProgram", "type": "node", @@ -105,9 +99,9 @@ "autoAdd": true }, { - "name": "votingProgram", + "name": "mentorshipProgram", "type": "node", - "childType": "Voting Program", + "childType": "Mentorship Program", "autoAdd": true }, { @@ -116,6 +110,12 @@ "childType": "Claims Program", "autoAdd": true }, + { + "name": "votingProgram", + "type": "node", + "childType": "Voting Program", + "autoAdd": true + }, { "name": "stakingProgram", "type": "node", From f7f328737902324bcbc6cb183435ab0e2ee75f5f Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 21 Jun 2021 13:04:30 +0200 Subject: [PATCH 17/17] Governance Mandatory Programs working. --- .../{user-support.png => user-supporter.png} | Bin .../Governance/Plugins/Pools/Superalgos.json | 36 +- .../User-Profiles/Luis-Fernando-Molina.json | 3040 +++++++++-------- .../Token-Distribution-Superalgos.json | 155 +- .../Schemas/App-Schema/support-program.json | 8 +- .../{userSupport.json => user-supporter.json} | 6 +- .../Function-Libraries/DistributionProcess.js | 5 + .../UI/Function-Libraries/SupportProgram.js | 23 + Projects/ProjectsSchema.json | 5 + 9 files changed, 1700 insertions(+), 1578 deletions(-) rename Projects/Governance/Icons/User/{user-support.png => user-supporter.png} (100%) rename Projects/Governance/Schemas/App-Schema/{userSupport.json => user-supporter.json} (88%) create mode 100644 Projects/Governance/UI/Function-Libraries/SupportProgram.js diff --git a/Projects/Governance/Icons/User/user-support.png b/Projects/Governance/Icons/User/user-supporter.png similarity index 100% rename from Projects/Governance/Icons/User/user-support.png rename to Projects/Governance/Icons/User/user-supporter.png diff --git a/Projects/Governance/Plugins/Pools/Superalgos.json b/Projects/Governance/Plugins/Pools/Superalgos.json index 3f00e2e31..c8d3c89c6 100644 --- a/Projects/Governance/Plugins/Pools/Superalgos.json +++ b/Projects/Governance/Plugins/Pools/Superalgos.json @@ -401,8 +401,8 @@ "id": "60712b3c-ee76-40ba-8de2-e03aa61f6dde", "savedPayload": { "position": { - "x": 25130.086277076116, - "y": 31080.643930047634 + "x": 25177.761863855485, + "y": 31018.51189569167 }, "targetPosition": { "x": 24917.954242720152, @@ -431,7 +431,7 @@ "id": "639a6504-a0d0-4d7e-ad99-80ba5115ac72", "savedPayload": { "position": { - "x": 24840.308529189395, + "x": 24995.59995625091, "y": 31158.28964357839 }, "targetPosition": { @@ -450,6 +450,36 @@ "isRunning": false } } + }, + { + "type": "Pool", + "name": "Support-Program", + "config": "{\n\"codeName\": \"Support-Program\"\n}", + "project": "Governance", + "poolClasses": [], + "pools": [], + "id": "18fa6e35-77df-4446-87a9-9d3e6b83eb05", + "savedPayload": { + "position": { + "x": 24767.954242720152, + "y": 31128.319516827003 + }, + "targetPosition": { + "x": 24917.954242720152, + "y": 30868.51189569167 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + } + } } ], "id": "9b6c24b9-e21d-458b-b509-1828d40b4239", diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index 2daef2967..4520f925d 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -94,6 +94,92 @@ } } }, + "supportProgram": { + "type": "Support Program", + "name": "New Support Program", + "config": "{}", + "project": "Governance", + "userSupporters": [ + { + "type": "User Supporter", + "name": "Julian-Molina", + "config": "{}", + "project": "Governance", + "id": "2a038796-fccd-4a5a-b943-116ccca91b1d", + "savedPayload": { + "position": { + "x": 30895.15021539039, + "y": 23378.32972786362 + }, + "targetPosition": { + "x": 30608.478373654547, + "y": 23466.75628018689 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "User Profile", + "name": "Julian-Molina", + "id": "1fd95e41-4b22-48d5-be3a-904c37afcb11" + } + } + } + ], + "tokensAwarded": { + "type": "Tokens Awarded", + "name": "New Tokens Awarded", + "project": "Governance", + "id": "c6367a1d-4bc7-4348-8309-a3e6f3fcdd50", + "savedPayload": { + "position": { + "x": 30828.393935203494, + "y": 23670.808101518167 + }, + "targetPosition": { + "x": 30608.478373654547, + "y": 23466.75628018689 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {} + } + }, + "id": "91d82012-4362-4fe0-b02b-0eb3b394ace5", + "savedPayload": { + "position": { + "x": 30608.478373654547, + "y": 23466.75628018689 + }, + "targetPosition": { + "x": 30316, + "y": 23399.999999999996 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 1, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + } + } + }, "mentorshipProgram": { "type": "Mentorship Program", "name": "New Mentorship Program", @@ -108,12 +194,12 @@ "id": "97483d0f-35ec-4471-a981-0d22565e0d63", "savedPayload": { "position": { - "x": 30862.495633423034, - "y": 23307.14665723229 + "x": 30729.330120827777, + "y": 23769.374378957273 }, "targetPosition": { - "x": 30608.478373654547, - "y": 23466.75628018689 + "x": 30446.165121735266, + "y": 23670.290660370723 }, "floatingObject": { "isPinned": false, @@ -139,12 +225,12 @@ "id": "8adecfda-c803-400c-acde-c34bda09e39b", "savedPayload": { "position": { - "x": 30900.956747309094, - "y": 23533.512560373787 + "x": 30576.330243470533, + "y": 23940.58132074145 }, "targetPosition": { - "x": 30608.478373654547, - "y": 23466.75628018689 + "x": 30446.165121735266, + "y": 23670.290660370723 }, "floatingObject": { "isPinned": false, @@ -170,12 +256,12 @@ "id": "09648f99-1bf8-4d53-9d20-f15cc8c71508", "savedPayload": { "position": { - "x": 30768.08799660915, - "y": 23720.77353995538 + "x": 30347.081403148717, + "y": 23953.455659463234 }, "targetPosition": { - "x": 30608.478373654547, - "y": 23466.75628018689 + "x": 30446.165121735266, + "y": 23670.290660370723 }, "floatingObject": { "isPinned": false, @@ -189,35 +275,6 @@ } }, "id": "8af4af68-62bf-4ad2-bf84-f1124cba0abf", - "savedPayload": { - "position": { - "x": 30608.478373654547, - "y": 23466.75628018689 - }, - "targetPosition": { - "x": 30316, - "y": 23399.999999999996 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 1, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - } - } - }, - "supportProgram": { - "type": "Support Program", - "name": "New Support Program", - "config": "{}", - "project": "Governance", - "userSupports": [], - "id": "91d82012-4362-4fe0-b02b-0eb3b394ace5", "savedPayload": { "position": { "x": 30446.165121735266, @@ -240,1440 +297,6 @@ } } }, - "votingProgram": { - "type": "Voting Program", - "name": "New Voting Program", - "config": "{}", - "project": "Governance", - "votesSwitch": [ - { - "type": "Votes Switch", - "name": "New Votes Switch", - "config": "{}", - "project": "Governance", - "votesSwitch": [], - "claimVotesSwitch": [], - "weightVotesSwitch": [ - { - "type": "Weight Votes Switch", - "name": "New Weight Votes Switch", - "config": "{}", - "project": "Governance", - "weightVotesSwitch": [ - { - "type": "Weight Votes Switch", - "name": "Superalgos Pools", - "config": "{}", - "project": "Governance", - "weightVotesSwitch": [ - { - "type": "Weight Votes Switch", - "name": "Marketing Pool Class", - "config": "{}", - "project": "Governance", - "weightVotesSwitch": [ - { - "type": "Weight Votes Switch", - "name": "Collective Rewards Pool Class", - "config": "{}", - "project": "Governance", - "weightVotesSwitch": [], - "poolWeightVotes": [ - { - "type": "Pool Weight Vote", - "name": "First Exchange Listing The Token Pool", - "config": "{}", - "project": "Governance", - "id": "fa27ae9a-2aaa-4b77-a865-f42c4b1e3cde", - "savedPayload": { - "position": { - "x": 30558.297826077353, - "y": 24780.60171368038 - }, - "targetPosition": { - "x": 30261.648578209813, - "y": 24825.31439353323 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "First Exchange Listing The Token", - "id": "6a456247-13b7-41f2-80b3-957c1af55009" - } - } - }, - { - "type": "Pool Weight Vote", - "name": "10K Stars on Github Pool", - "config": "{}", - "project": "Governance", - "id": "6d9d9712-7a90-4dac-bdcb-1c62c2656155", - "savedPayload": { - "position": { - "x": 30448.695518767432, - "y": 25059.86383827364 - }, - "targetPosition": { - "x": 30261.648578209813, - "y": 24825.31439353323 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "10K Stars on Github", - "id": "5bbe5a09-fe32-4802-8e14-d06615a24510" - } - } - } - ], - "assetWeightVotes": [], - "featureWeightVotes": [], - "positionWeightVotes": [], - "id": "128afaa5-16bb-4d08-9f49-abfc954f2b58", - "savedPayload": { - "position": { - "x": 30261.648578209813, - "y": 24825.31439353323 - }, - "targetPosition": { - "x": 29982.386453616553, - "y": 24715.712086223313 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - }, - "referenceParent": { - "type": "Pool Class", - "name": "Collective Rewards", - "id": "95431b88-cbff-459c-a707-fd3518e79c73" - } - } - }, - { - "type": "Weight Votes Switch", - "name": "Assets Pool Class", - "config": "{}", - "project": "Governance", - "weightVotesSwitch": [], - "poolWeightVotes": [ - { - "type": "Pool Weight Vote", - "name": "Marketing Assets Pool", - "config": "{}", - "project": "Governance", - "id": "1fa92d72-8c7c-4595-90f0-83b72cff9dd8", - "savedPayload": { - "position": { - "x": 30071.811813322256, - "y": 25309.01058195839 - }, - "targetPosition": { - "x": 30027.099133469404, - "y": 25012.361334090852 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "Marketing Assets", - "id": "6b4bee15-622d-4df6-9662-4d7b8d44f198" - } - } - } - ], - "assetWeightVotes": [], - "featureWeightVotes": [], - "positionWeightVotes": [], - "id": "8a915b0f-36c1-4019-b006-02c4a5d47079", - "savedPayload": { - "position": { - "x": 30027.099133469404, - "y": 25012.361334090852 - }, - "targetPosition": { - "x": 29982.386453616553, - "y": 24715.712086223313 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - }, - "referenceParent": { - "type": "Pool Class", - "name": "Assets", - "id": "ab43c779-d6d6-451d-a444-cfb8b68df07e" - } - } - } - ], - "poolWeightVotes": [], - "assetWeightVotes": [], - "featureWeightVotes": [], - "positionWeightVotes": [], - "id": "b313f748-da26-4c50-8ba1-36fff49f3a0f", - "savedPayload": { - "position": { - "x": 29982.386453616553, - "y": 24715.712086223313 - }, - "targetPosition": { - "x": 29795.339513058934, - "y": 24481.162641482904 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - }, - "referenceParent": { - "type": "Pool Class", - "name": "Marketing", - "id": "85dbdcb9-5b59-432e-86a0-fab37e20a55d" - } - } - }, - { - "type": "Weight Votes Switch", - "name": "Community Pool Class", - "config": "{}", - "project": "Governance", - "weightVotesSwitch": [ - { - "type": "Weight Votes Switch", - "name": "Users Pool Class", - "config": "{}", - "project": "Governance", - "weightVotesSwitch": [], - "poolWeightVotes": [ - { - "type": "Pool Weight Vote", - "name": "Mentorship Program Pool", - "config": "{}", - "project": "Governance", - "id": "a32cb176-83c0-4800-b630-01f1df6d2301", - "savedPayload": { - "position": { - "x": 30415.903264450837, - "y": 24944.46799637495 - }, - "targetPosition": { - "x": 30116.113053014316, - "y": 24933.250638092053 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "Mentorship Program", - "id": "60712b3c-ee76-40ba-8de2-e03aa61f6dde" - } - } - }, - { - "type": "Pool Weight Vote", - "name": "Referral Program Pool", - "config": "{}", - "project": "Governance", - "id": "33a03a57-6811-4cad-94af-14a0597e9fb3", - "savedPayload": { - "position": { - "x": 30256.293641496235, - "y": 25198.485256143435 - }, - "targetPosition": { - "x": 30116.113053014316, - "y": 24933.250638092053 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "Referral Program", - "id": "639a6504-a0d0-4d7e-ad99-80ba5115ac72" - } - } - } - ], - "assetWeightVotes": [], - "featureWeightVotes": [], - "positionWeightVotes": [], - "id": "c8894826-483a-4c6d-92e7-8190ea952717", - "savedPayload": { - "position": { - "x": 30116.113053014316, - "y": 24933.250638092053 - }, - "targetPosition": { - "x": 29862.09579324583, - "y": 24773.64101513745 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - }, - "referenceParent": { - "type": "Pool Class", - "name": "Users", - "id": "9b6c24b9-e21d-458b-b509-1828d40b4239" - } - } - }, - { - "type": "Weight Votes Switch", - "name": "Contributors Pool Class", - "config": "{}", - "project": "Governance", - "weightVotesSwitch": [], - "poolWeightVotes": [ - { - "type": "Pool Weight Vote", - "name": "Badges Pool", - "config": "{}", - "project": "Governance", - "id": "cb05c8ff-235b-4b97-9c41-d3cbee5d797d", - "savedPayload": { - "position": { - "x": 29995.60835361962, - "y": 25358.597762446545 - }, - "targetPosition": { - "x": 29928.852073432725, - "y": 25066.119388791998 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "Badges", - "id": "6b11cf29-2957-417d-a268-3569178eca9e" - } - } - } - ], - "assetWeightVotes": [], - "featureWeightVotes": [], - "positionWeightVotes": [], - "id": "307ed30b-fbb2-49c8-ad8a-7e45d9fd8815", - "savedPayload": { - "position": { - "x": 29928.852073432725, - "y": 25066.119388791998 - }, - "targetPosition": { - "x": 29862.09579324583, - "y": 24773.64101513745 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - }, - "referenceParent": { - "type": "Pool Class", - "name": "Contributors", - "id": "e2113b73-9a38-4c59-8fbe-95a7539379c5" - } - } - }, - { - "type": "Weight Votes Switch", - "name": "Token Holders Pool Class", - "config": "{}", - "project": "Governance", - "weightVotesSwitch": [], - "poolWeightVotes": [ - { - "type": "Pool Weight Vote", - "name": "Stacking Pool", - "config": "{}", - "project": "Governance", - "id": "40d246e2-1cd8-4e8e-a9d9-33a3256f1f75", - "savedPayload": { - "position": { - "x": 29542.876547336626, - "y": 25281.675534674425 - }, - "targetPosition": { - "x": 29702.486170291228, - "y": 25027.658274905938 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "Stacking", - "id": "ea79efd3-c3d9-4c80-a1d0-1cab106e0242" - } - } - } - ], - "assetWeightVotes": [], - "featureWeightVotes": [], - "positionWeightVotes": [], - "id": "021a8f3b-eccc-4cce-9884-f3b51d7470d8", - "savedPayload": { - "position": { - "x": 29702.486170291228, - "y": 25027.658274905938 - }, - "targetPosition": { - "x": 29862.09579324583, - "y": 24773.64101513745 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - }, - "referenceParent": { - "type": "Pool Class", - "name": "Token Holders", - "id": "c7cd91a3-96b0-4115-aaaa-fddae1c1b246" - } - } - } - ], - "poolWeightVotes": [], - "assetWeightVotes": [], - "featureWeightVotes": [], - "positionWeightVotes": [], - "id": "8a321cf8-2b35-4c65-80fc-6474597c9a4e", - "savedPayload": { - "position": { - "x": 29862.09579324583, - "y": 24773.64101513745 - }, - "targetPosition": { - "x": 29795.339513058934, - "y": 24481.162641482904 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - }, - "referenceParent": { - "type": "Pool Class", - "name": "Community", - "id": "ae18dd6f-80f7-4fa0-a386-7ffd75e45063" - } - } - }, - { - "type": "Weight Votes Switch", - "name": "Education Pool Class", - "config": "{}", - "project": "Governance", - "weightVotesSwitch": [ - { - "type": "Weight Votes Switch", - "name": "Production Pool Class", - "config": "{}", - "project": "Governance", - "weightVotesSwitch": [ - { - "type": "Weight Votes Switch", - "name": "Creating Pool Class", - "config": "{}", - "project": "Governance", - "weightVotesSwitch": [], - "poolWeightVotes": [ - { - "type": "Pool Weight Vote", - "name": "Blog-Tutorials Pool", - "config": "{}", - "project": "Governance", - "id": "0d922c8d-d7fe-4ee1-a842-bc09b07f5a39", - "savedPayload": { - "position": { - "x": 30331.26986176251, - "y": 25206.387902865903 - }, - "targetPosition": { - "x": 30036.925346744258, - "y": 25264.36467820457 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "Blog-Tutorials", - "id": "0548fbd2-7904-481a-a33d-16ef93707276" - } - } - }, - { - "type": "Pool Weight Vote", - "name": "In-App-Docs Pool", - "config": "{}", - "project": "Governance", - "id": "096f39eb-d93d-48a0-a66a-818fdfc36236", - "savedPayload": { - "position": { - "x": 30309.132955114615, - "y": 25390.471846697437 - }, - "targetPosition": { - "x": 30036.925346744258, - "y": 25264.36467820457 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "In-App-Docs", - "id": "14175310-1a9c-4f4b-89e2-aabe4507932a" - } - } - }, - { - "type": "Pool Weight Vote", - "name": "In-App-Tutorials Pool", - "config": "{}", - "project": "Governance", - "id": "1cf165ee-f898-43bc-9601-9158cd23b651", - "savedPayload": { - "position": { - "x": 30183.021994065566, - "y": 25526.38713838971 - }, - "targetPosition": { - "x": 30036.925346744258, - "y": 25264.36467820457 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "In-App-Tutorials", - "id": "64b19ffc-0240-46cd-804b-b57d25195f64" - } - } - }, - { - "type": "Pool Weight Vote", - "name": "Video-Tutorials Pool", - "config": "{}", - "project": "Governance", - "id": "594d2230-1402-4ed3-8d36-7ef134db9e68", - "savedPayload": { - "position": { - "x": 30001.107079382185, - "y": 25562.21875610712 - }, - "targetPosition": { - "x": 30036.925346744258, - "y": 25264.36467820457 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "Video-Tutorials", - "id": "4d9474e1-e58f-4563-a1c2-e89533bc451e" - } - } - } - ], - "assetWeightVotes": [], - "featureWeightVotes": [], - "positionWeightVotes": [], - "id": "6e843832-f035-4bf5-a533-e7c24241d5da", - "savedPayload": { - "position": { - "x": 30036.925346744258, - "y": 25264.36467820457 - }, - "targetPosition": { - "x": 29817.00978519531, - "y": 25060.312856873294 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - }, - "referenceParent": { - "type": "Pool Class", - "name": "Creating", - "id": "e8c86964-e87d-4490-96ad-4bf4be249d51" - } - } - }, - { - "type": "Weight Votes Switch", - "name": "Translating Pool Class", - "config": "{}", - "project": "Governance", - "weightVotesSwitch": [], - "poolWeightVotes": [ - { - "type": "Pool Weight Vote", - "name": "In-App-Docs Pool", - "config": "{}", - "project": "Governance", - "id": "c9c48c3d-05e2-4620-841e-9326df488b8f", - "savedPayload": { - "position": { - "x": 29909.863127963017, - "y": 25606.808490296327 - }, - "targetPosition": { - "x": 29750.253505008415, - "y": 25352.79123052784 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "In-App-Docs", - "id": "5737235d-c74f-4247-b870-b52428b5576f" - } - } - }, - { - "type": "Pool Weight Vote", - "name": "In-App-Tutorials Pool", - "config": "{}", - "project": "Governance", - "id": "6da35c2d-089c-4406-ba0d-f899e680ed29", - "savedPayload": { - "position": { - "x": 29683.49722482152, - "y": 25645.269604182387 - }, - "targetPosition": { - "x": 29750.253505008415, - "y": 25352.79123052784 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "In-App-Tutorials", - "id": "abe07b52-de21-44da-a989-f52067f508df" - } - } - }, - { - "type": "Pool Weight Vote", - "name": "Video-Tutorials Pool", - "config": "{}", - "project": "Governance", - "id": "3a6da240-0f49-466d-88f9-6ea746d34c55", - "savedPayload": { - "position": { - "x": 29496.23624523993, - "y": 25512.400853482442 - }, - "targetPosition": { - "x": 29750.253505008415, - "y": 25352.79123052784 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "Video-Tutorials", - "id": "fb52e785-fa45-4522-8478-b0d039525b4a" - } - } - } - ], - "assetWeightVotes": [], - "featureWeightVotes": [], - "positionWeightVotes": [], - "id": "b20ba922-208b-4aa8-8a57-270a54a39806", - "savedPayload": { - "position": { - "x": 29750.253505008415, - "y": 25352.79123052784 - }, - "targetPosition": { - "x": 29817.00978519531, - "y": 25060.312856873294 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - }, - "referenceParent": { - "type": "Pool Class", - "name": "Translating", - "id": "1dc0d3a0-4a11-43c2-8c53-6b9e86cb0d01" - } - } - } - ], - "poolWeightVotes": [], - "assetWeightVotes": [], - "featureWeightVotes": [], - "positionWeightVotes": [], - "id": "4827d415-f407-47f3-b389-d6429c676250", - "savedPayload": { - "position": { - "x": 29817.00978519531, - "y": 25060.312856873294 - }, - "targetPosition": { - "x": 29728.58323287204, - "y": 24773.64101513745 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - }, - "referenceParent": { - "type": "Pool Class", - "name": "Production", - "id": "58feb67b-074a-4373-8cc1-9219851b251a" - } - } - }, - { - "type": "Weight Votes Switch", - "name": "Consumption Pool Class", - "config": "{}", - "project": "Governance", - "weightVotesSwitch": [], - "poolWeightVotes": [ - { - "type": "Pool Weight Vote", - "name": "Completing Tutorials Pool", - "config": "{}", - "project": "Governance", - "id": "f28026a2-7299-45c3-9f42-e0a64311e114", - "savedPayload": { - "position": { - "x": 29457.77513135387, - "y": 25286.034950340945 - }, - "targetPosition": { - "x": 29524.531411540764, - "y": 24993.5565766864 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "Completing Tutorials", - "id": "0bfaeebd-a900-4e6e-b62c-3387e4e7baec" - } - } - }, - { - "type": "Pool Weight Vote", - "name": "Reading the Docs Pool", - "config": "{}", - "project": "Governance", - "id": "57196823-651b-4285-bf18-a4bbd9fa3066", - "savedPayload": { - "position": { - "x": 29237.85956980492, - "y": 25081.98312900967 - }, - "targetPosition": { - "x": 29524.531411540764, - "y": 24993.5565766864 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "Reading the Docs", - "id": "c3bee026-075f-48db-92df-fc599cce744d" - } - } - } - ], - "assetWeightVotes": [], - "featureWeightVotes": [], - "positionWeightVotes": [], - "id": "2fb14c74-e3b6-43db-86e3-3f67fb3aa657", - "savedPayload": { - "position": { - "x": 29524.531411540764, - "y": 24993.5565766864 - }, - "targetPosition": { - "x": 29728.58323287204, - "y": 24773.64101513745 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - }, - "referenceParent": { - "type": "Pool Class", - "name": "Consumption", - "id": "8a133a29-c678-4da0-8408-1e7f87d9dfa7" - } - } - } - ], - "poolWeightVotes": [], - "assetWeightVotes": [], - "featureWeightVotes": [], - "positionWeightVotes": [], - "id": "30929e97-3faa-4a62-b45d-c22716b3df8e", - "savedPayload": { - "position": { - "x": 29728.58323287204, - "y": 24773.64101513745 - }, - "targetPosition": { - "x": 29795.339513058934, - "y": 24481.162641482904 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - }, - "referenceParent": { - "type": "Pool Class", - "name": "Education", - "id": "86787666-908c-4b27-8265-cd460732030f" - } - } - }, - { - "type": "Weight Votes Switch", - "name": "Management Pool Class", - "config": "{}", - "project": "Governance", - "weightVotesSwitch": [], - "poolWeightVotes": [ - { - "type": "Pool Weight Vote", - "name": "Management Pool", - "config": "{}", - "project": "Governance", - "id": "a3cd897e-df9e-49ab-88a7-02869b81523b", - "savedPayload": { - "position": { - "x": 29421.245631943697, - "y": 24950.261530963722 - }, - "targetPosition": { - "x": 29608.292572501316, - "y": 24715.712086223313 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "Management", - "id": "5d878af1-e32c-4458-8fb7-98df55f1e54a" - } - } - } - ], - "assetWeightVotes": [], - "featureWeightVotes": [], - "positionWeightVotes": [], - "id": "40c0e3d0-1165-4ff9-8242-211d9f0a7a85", - "savedPayload": { - "position": { - "x": 29608.292572501316, - "y": 24715.712086223313 - }, - "targetPosition": { - "x": 29795.339513058934, - "y": 24481.162641482904 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - }, - "referenceParent": { - "type": "Pool Class", - "name": "Management", - "id": "a2acb2b1-c88f-47f2-b31b-b0cde52801ac" - } - } - }, - { - "type": "Weight Votes Switch", - "name": "Features Pool Class", - "config": "{\n\"percentage\": 50\n}", - "project": "Governance", - "weightVotesSwitch": [], - "poolWeightVotes": [ - { - "type": "Pool Weight Vote", - "name": "Features Pool", - "config": "{}", - "project": "Governance", - "id": "247ec21c-2331-460f-b803-a108db234804", - "savedPayload": { - "position": { - "x": 29254.75819231748, - "y": 24741.492884953437 - }, - "targetPosition": { - "x": 29525.048852688207, - "y": 24611.32776321817 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "Features", - "id": "2d34ec1b-e281-4163-a44b-6ac33a54e002" - } - } - } - ], - "assetWeightVotes": [], - "featureWeightVotes": [], - "positionWeightVotes": [], - "id": "e7eea9e5-4df6-4a6b-8a2a-5e46373a77fa", - "savedPayload": { - "position": { - "x": 29525.048852688207, - "y": 24611.32776321817 - }, - "targetPosition": { - "x": 29795.339513058934, - "y": 24481.162641482904 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - }, - "referenceParent": { - "type": "Pool Class", - "name": "Features", - "id": "8c3175a1-17aa-4e27-bcbe-063468ecc87e" - } - } - }, - { - "type": "Weight Votes Switch", - "name": "Software Projects Pool Class", - "config": "{}", - "project": "Governance", - "weightVotesSwitch": [], - "poolWeightVotes": [ - { - "type": "Pool Weight Vote", - "name": "Foundations Project Pool", - "config": "{}", - "project": "Governance", - "id": "e55378fa-5093-4225-864d-8ff41d99dd6a", - "savedPayload": { - "position": { - "x": 29345.339513058934, - "y": 24740.970262618237 - }, - "targetPosition": { - "x": 29495.339513058934, - "y": 24481.162641482904 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "Foundations Project", - "id": "2207c69c-ee9d-4453-8bf4-582d79b4b635" - } - } - }, - { - "type": "Pool Weight Vote", - "name": "TensorFlow Project Pool", - "config": "{}", - "project": "Governance", - "id": "61584484-e4c2-4166-8e41-f8473f8c669f", - "savedPayload": { - "position": { - "x": 29235.5318919236, - "y": 24631.162641482904 - }, - "targetPosition": { - "x": 29495.339513058934, - "y": 24481.162641482904 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "TensorFlow Project", - "id": "ea854cf8-47cd-43f0-b58a-13e61ae3106d" - } - } - }, - { - "type": "Pool Weight Vote", - "name": "Governance Project Pool", - "config": "{}", - "project": "Governance", - "id": "a6bb434c-67fd-4429-a4b4-f51a0c9a07ed", - "savedPayload": { - "position": { - "x": 29195.339513058934, - "y": 24481.162641482904 - }, - "targetPosition": { - "x": 29495.339513058934, - "y": 24481.162641482904 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "Governance Project", - "id": "3c80032c-51a8-4fd8-ab65-cf219c03ce95" - } - } - }, - { - "type": "Pool Weight Vote", - "name": "Education Project Pool", - "config": "{}", - "project": "Governance", - "id": "e718201a-9ce4-4eb5-aade-1e844f59af64", - "savedPayload": { - "position": { - "x": 29235.5318919236, - "y": 24331.162641482904 - }, - "targetPosition": { - "x": 29495.339513058934, - "y": 24481.162641482904 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "Education Project", - "id": "0a79ec65-6f67-4c18-823f-48a6d0494a81" - } - } - }, - { - "type": "Pool Weight Vote", - "name": "Ethereum Project Pool", - "config": "{}", - "project": "Governance", - "id": "7ac78464-92ee-470e-ba77-661071937ab5", - "savedPayload": { - "position": { - "x": 29345.339513058934, - "y": 24221.35502034757 - }, - "targetPosition": { - "x": 29495.339513058934, - "y": 24481.162641482904 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {}, - "referenceParent": { - "type": "Pool", - "name": "Ethereum Project", - "id": "f51d23aa-742c-40d4-b000-2b90c3ae197c" - } - } - } - ], - "assetWeightVotes": [], - "featureWeightVotes": [], - "positionWeightVotes": [], - "id": "f98086f7-1e41-4365-aa6c-4e4cccaf4ae6", - "savedPayload": { - "position": { - "x": 29495.339513058934, - "y": 24481.162641482904 - }, - "targetPosition": { - "x": 29795.339513058934, - "y": 24481.162641482904 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - }, - "referenceParent": { - "type": "Pool Class", - "name": "Software Projects", - "id": "a987f1d3-fc8d-4b7c-99dd-77f15a32f37d" - } - } - } - ], - "poolWeightVotes": [], - "assetWeightVotes": [], - "featureWeightVotes": [], - "positionWeightVotes": [], - "id": "e059f5c4-9132-4d76-9f3e-1060658fa704", - "savedPayload": { - "position": { - "x": 29795.339513058934, - "y": 24481.162641482904 - }, - "targetPosition": { - "x": 29925.5046347942, - "y": 24210.871981112177 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - }, - "referenceParent": { - "type": "Pools", - "name": "Superalgos", - "id": "6f0aed87-db13-4818-bfe6-68abc463ebec" - } - } - } - ], - "poolWeightVotes": [], - "assetWeightVotes": [], - "featureWeightVotes": [], - "positionWeightVotes": [], - "id": "1d398124-3f36-40a1-8b3b-6c77ad489b92", - "savedPayload": { - "position": { - "x": 29925.5046347942, - "y": 24210.871981112177 - }, - "targetPosition": { - "x": 30055.669756529467, - "y": 23940.58132074145 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - } - } - } - ], - "userProfileVotesSwitch": [], - "id": "2b8d3ce7-515c-44ad-8d80-3c2be6d7736f", - "savedPayload": { - "position": { - "x": 30055.669756529467, - "y": 23940.58132074145 - }, - "targetPosition": { - "x": 30185.834878264734, - "y": 23670.290660370723 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - } - } - } - ], - "id": "d5ed432e-78bf-432e-be3b-8649932f7a65", - "savedPayload": { - "position": { - "x": 30185.834878264734, - "y": 23670.290660370723 - }, - "targetPosition": { - "x": 30316, - "y": 23399.999999999996 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 1, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - } - } - }, "claimsProgram": { "type": "Claims Program", "name": "New Claims Program", @@ -1892,6 +515,1471 @@ ], "positionClaimsFolders": [], "id": "796dd30f-c90d-4b8d-a63d-89867347407b", + "savedPayload": { + "position": { + "x": 30185.834878264734, + "y": 23670.290660370723 + }, + "targetPosition": { + "x": 30316, + "y": 23399.999999999996 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": true, + "angleToParent": 1, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + } + } + }, + "votingProgram": { + "type": "Voting Program", + "name": "New Voting Program", + "config": "{}", + "project": "Governance", + "votesSwitch": [ + { + "type": "Votes Switch", + "name": "New Votes Switch", + "config": "{}", + "project": "Governance", + "votesSwitch": [], + "claimVotesSwitch": [], + "weightVotesSwitch": [ + { + "type": "Weight Votes Switch", + "name": "New Weight Votes Switch", + "config": "{}", + "project": "Governance", + "weightVotesSwitch": [ + { + "type": "Weight Votes Switch", + "name": "Superalgos Pools", + "config": "{}", + "project": "Governance", + "weightVotesSwitch": [ + { + "type": "Weight Votes Switch", + "name": "Marketing Pool Class", + "config": "{}", + "project": "Governance", + "weightVotesSwitch": [ + { + "type": "Weight Votes Switch", + "name": "Collective Rewards Pool Class", + "config": "{}", + "project": "Governance", + "weightVotesSwitch": [], + "poolWeightVotes": [ + { + "type": "Pool Weight Vote", + "name": "First Exchange Listing The Token Pool", + "config": "{}", + "project": "Governance", + "id": "fa27ae9a-2aaa-4b77-a865-f42c4b1e3cde", + "savedPayload": { + "position": { + "x": 29387.672339067136, + "y": 24450.227157469242 + }, + "targetPosition": { + "x": 29167.75677751819, + "y": 24246.175336137967 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "First Exchange Listing The Token", + "id": "6a456247-13b7-41f2-80b3-957c1af55009" + } + } + }, + { + "type": "Pool Weight Vote", + "name": "10K Stars on Github Pool", + "config": "{}", + "project": "Governance", + "id": "6d9d9712-7a90-4dac-bdcb-1c62c2656155", + "savedPayload": { + "position": { + "x": 29101.000497331293, + "y": 24538.653709792514 + }, + "targetPosition": { + "x": 29167.75677751819, + "y": 24246.175336137967 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "10K Stars on Github", + "id": "5bbe5a09-fe32-4802-8e14-d06615a24510" + } + } + } + ], + "assetWeightVotes": [], + "featureWeightVotes": [], + "positionWeightVotes": [], + "id": "128afaa5-16bb-4d08-9f49-abfc954f2b58", + "savedPayload": { + "position": { + "x": 29167.75677751819, + "y": 24246.175336137967 + }, + "targetPosition": { + "x": 29079.330225194917, + "y": 23959.503494402124 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "Pool Class", + "name": "Collective Rewards", + "id": "95431b88-cbff-459c-a707-fd3518e79c73" + } + } + }, + { + "type": "Weight Votes Switch", + "name": "Assets Pool Class", + "config": "{}", + "project": "Governance", + "weightVotesSwitch": [], + "poolWeightVotes": [ + { + "type": "Pool Weight Vote", + "name": "Marketing Assets Pool", + "config": "{}", + "project": "Governance", + "id": "1fa92d72-8c7c-4595-90f0-83b72cff9dd8", + "savedPayload": { + "position": { + "x": 28671.226582532367, + "y": 24399.33461750002 + }, + "targetPosition": { + "x": 28875.278403863642, + "y": 24179.41905595107 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "Marketing Assets", + "id": "6b4bee15-622d-4df6-9662-4d7b8d44f198" + } + } + } + ], + "assetWeightVotes": [], + "featureWeightVotes": [], + "positionWeightVotes": [], + "id": "8a915b0f-36c1-4019-b006-02c4a5d47079", + "savedPayload": { + "position": { + "x": 28875.278403863642, + "y": 24179.41905595107 + }, + "targetPosition": { + "x": 29079.330225194917, + "y": 23959.503494402124 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "Pool Class", + "name": "Assets", + "id": "ab43c779-d6d6-451d-a444-cfb8b68df07e" + } + } + } + ], + "poolWeightVotes": [], + "assetWeightVotes": [], + "featureWeightVotes": [], + "positionWeightVotes": [], + "id": "b313f748-da26-4c50-8ba1-36fff49f3a0f", + "savedPayload": { + "position": { + "x": 29079.330225194917, + "y": 23959.503494402124 + }, + "targetPosition": { + "x": 29146.086505381812, + "y": 23667.025120747578 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "Pool Class", + "name": "Marketing", + "id": "85dbdcb9-5b59-432e-86a0-fab37e20a55d" + } + } + }, + { + "type": "Weight Votes Switch", + "name": "Community Pool Class", + "config": "{}", + "project": "Governance", + "weightVotesSwitch": [ + { + "type": "Weight Votes Switch", + "name": "Users Pool Class", + "config": "{}", + "project": "Governance", + "weightVotesSwitch": [], + "poolWeightVotes": [ + { + "type": "Pool Weight Vote", + "name": "Mentorship Program Pool", + "config": "{}", + "project": "Governance", + "id": "a32cb176-83c0-4800-b630-01f1df6d2301", + "savedPayload": { + "position": { + "x": 29227.178352395596, + "y": 24386.735169013577 + }, + "targetPosition": { + "x": 28992.628907655188, + "y": 24199.688228455958 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "Mentorship Program", + "id": "60712b3c-ee76-40ba-8de2-e03aa61f6dde" + } + } + }, + { + "type": "Pool Weight Vote", + "name": "Referral Program Pool", + "config": "{}", + "project": "Governance", + "id": "33a03a57-6811-4cad-94af-14a0597e9fb3", + "savedPayload": { + "position": { + "x": 29026.21825048618, + "y": 24497.80189142393 + }, + "targetPosition": { + "x": 28992.628907655188, + "y": 24199.688228455958 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "Referral Program", + "id": "639a6504-a0d0-4d7e-ad99-80ba5115ac72" + } + } + }, + { + "type": "Pool Weight Vote", + "name": "Support-Program Pool", + "config": "{}", + "project": "Governance", + "id": "b820443f-890c-4401-bead-82e4617943b0", + "savedPayload": { + "position": { + "x": 28805.58196709757, + "y": 24434.237673196367 + }, + "targetPosition": { + "x": 28992.628907655188, + "y": 24199.688228455958 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "Support-Program", + "id": "18fa6e35-77df-4446-87a9-9d3e6b83eb05" + } + } + } + ], + "assetWeightVotes": [], + "featureWeightVotes": [], + "positionWeightVotes": [], + "id": "c8894826-483a-4c6d-92e7-8190ea952717", + "savedPayload": { + "position": { + "x": 28992.628907655188, + "y": 24199.688228455958 + }, + "targetPosition": { + "x": 28959.039564824194, + "y": 23901.574565487987 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "Pool Class", + "name": "Users", + "id": "9b6c24b9-e21d-458b-b509-1828d40b4239" + } + } + }, + { + "type": "Weight Votes Switch", + "name": "Contributors Pool Class", + "config": "{}", + "project": "Governance", + "weightVotesSwitch": [], + "poolWeightVotes": [ + { + "type": "Pool Weight Vote", + "name": "Badges Pool", + "config": "{}", + "project": "Governance", + "id": "cb05c8ff-235b-4b97-9c41-d3cbee5d797d", + "savedPayload": { + "position": { + "x": 28584.945683708956, + "y": 24370.673454968804 + }, + "targetPosition": { + "x": 28771.992624266575, + "y": 24136.124010228395 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "Badges", + "id": "6b11cf29-2957-417d-a268-3569178eca9e" + } + } + } + ], + "assetWeightVotes": [], + "featureWeightVotes": [], + "positionWeightVotes": [], + "id": "307ed30b-fbb2-49c8-ad8a-7e45d9fd8815", + "savedPayload": { + "position": { + "x": 28771.992624266575, + "y": 24136.124010228395 + }, + "targetPosition": { + "x": 28959.039564824194, + "y": 23901.574565487987 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "Pool Class", + "name": "Contributors", + "id": "e2113b73-9a38-4c59-8fbe-95a7539379c5" + } + } + }, + { + "type": "Weight Votes Switch", + "name": "Token Holders Pool Class", + "config": "{}", + "project": "Governance", + "weightVotesSwitch": [], + "poolWeightVotes": [ + { + "type": "Pool Weight Vote", + "name": "Stacking Pool", + "config": "{}", + "project": "Governance", + "id": "40d246e2-1cd8-4e8e-a9d9-33a3256f1f75", + "savedPayload": { + "position": { + "x": 28362.81223888825, + "y": 23968.753251149974 + }, + "targetPosition": { + "x": 28660.925901856222, + "y": 23935.16390831898 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "Stacking", + "id": "ea79efd3-c3d9-4c80-a1d0-1cab106e0242" + } + } + } + ], + "assetWeightVotes": [], + "featureWeightVotes": [], + "positionWeightVotes": [], + "id": "021a8f3b-eccc-4cce-9884-f3b51d7470d8", + "savedPayload": { + "position": { + "x": 28660.925901856222, + "y": 23935.16390831898 + }, + "targetPosition": { + "x": 28959.039564824194, + "y": 23901.574565487987 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "Pool Class", + "name": "Token Holders", + "id": "c7cd91a3-96b0-4115-aaaa-fddae1c1b246" + } + } + } + ], + "poolWeightVotes": [], + "assetWeightVotes": [], + "featureWeightVotes": [], + "positionWeightVotes": [], + "id": "8a321cf8-2b35-4c65-80fc-6474597c9a4e", + "savedPayload": { + "position": { + "x": 28959.039564824194, + "y": 23901.574565487987 + }, + "targetPosition": { + "x": 29146.086505381812, + "y": 23667.025120747578 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "Pool Class", + "name": "Community", + "id": "ae18dd6f-80f7-4fa0-a386-7ffd75e45063" + } + } + }, + { + "type": "Weight Votes Switch", + "name": "Education Pool Class", + "config": "{}", + "project": "Governance", + "weightVotesSwitch": [ + { + "type": "Weight Votes Switch", + "name": "Production Pool Class", + "config": "{}", + "project": "Governance", + "weightVotesSwitch": [ + { + "type": "Weight Votes Switch", + "name": "Creating Pool Class", + "config": "{}", + "project": "Governance", + "weightVotesSwitch": [], + "poolWeightVotes": [ + { + "type": "Pool Weight Vote", + "name": "Blog-Tutorials Pool", + "config": "{}", + "project": "Governance", + "id": "0d922c8d-d7fe-4ee1-a842-bc09b07f5a39", + "savedPayload": { + "position": { + "x": 28913.22967107475, + "y": 24538.202894296737 + }, + "targetPosition": { + "x": 28684.38079951607, + "y": 24344.223013931998 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "Blog-Tutorials", + "id": "0548fbd2-7904-481a-a33d-16ef93707276" + } + } + }, + { + "type": "Pool Weight Vote", + "name": "In-App-Docs Pool", + "config": "{}", + "project": "Governance", + "id": "096f39eb-d93d-48a0-a66a-818fdfc36236", + "savedPayload": { + "position": { + "x": 28755.504912830722, + "y": 24635.67002541986 + }, + "targetPosition": { + "x": 28684.38079951607, + "y": 24344.223013931998 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "In-App-Docs", + "id": "14175310-1a9c-4f4b-89e2-aabe4507932a" + } + } + }, + { + "type": "Pool Weight Vote", + "name": "In-App-Tutorials Pool", + "config": "{}", + "project": "Governance", + "id": "1cf165ee-f898-43bc-9601-9158cd23b651", + "savedPayload": { + "position": { + "x": 28570.613160720193, + "y": 24621.814304074196 + }, + "targetPosition": { + "x": 28684.38079951607, + "y": 24344.223013931998 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "In-App-Tutorials", + "id": "64b19ffc-0240-46cd-804b-b57d25195f64" + } + } + }, + { + "type": "Pool Weight Vote", + "name": "Video-Tutorials Pool", + "config": "{}", + "project": "Governance", + "id": "594d2230-1402-4ed3-8d36-7ef134db9e68", + "savedPayload": { + "position": { + "x": 28429.17677980987, + "y": 24501.92814487515 + }, + "targetPosition": { + "x": 28684.38079951607, + "y": 24344.223013931998 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "Video-Tutorials", + "id": "4d9474e1-e58f-4563-a1c2-e89533bc451e" + } + } + } + ], + "assetWeightVotes": [], + "featureWeightVotes": [], + "positionWeightVotes": [], + "id": "6e843832-f035-4bf5-a533-e7c24241d5da", + "savedPayload": { + "position": { + "x": 28684.38079951607, + "y": 24344.223013931998 + }, + "targetPosition": { + "x": 28706.799827592, + "y": 24045.061874777643 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "Pool Class", + "name": "Creating", + "id": "e8c86964-e87d-4490-96ad-4bf4be249d51" + } + } + }, + { + "type": "Weight Votes Switch", + "name": "Translating Pool Class", + "config": "{}", + "project": "Governance", + "weightVotesSwitch": [], + "poolWeightVotes": [ + { + "type": "Pool Weight Vote", + "name": "In-App-Docs Pool", + "config": "{}", + "project": "Governance", + "id": "c9c48c3d-05e2-4620-841e-9326df488b8f", + "savedPayload": { + "position": { + "x": 28337.425448634724, + "y": 24458.39199560542 + }, + "targetPosition": { + "x": 28436.509167221273, + "y": 24175.22699651291 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "In-App-Docs", + "id": "5737235d-c74f-4247-b870-b52428b5576f" + } + } + }, + { + "type": "Pool Weight Vote", + "name": "In-App-Tutorials Pool", + "config": "{}", + "project": "Governance", + "id": "6da35c2d-089c-4406-ba0d-f899e680ed29", + "savedPayload": { + "position": { + "x": 28166.218506850546, + "y": 24305.392118248175 + }, + "targetPosition": { + "x": 28436.509167221273, + "y": 24175.22699651291 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "In-App-Tutorials", + "id": "abe07b52-de21-44da-a989-f52067f508df" + } + } + }, + { + "type": "Pool Weight Vote", + "name": "Video-Tutorials Pool", + "config": "{}", + "project": "Governance", + "id": "3a6da240-0f49-466d-88f9-6ea746d34c55", + "savedPayload": { + "position": { + "x": 28153.344168128762, + "y": 24076.14327792636 + }, + "targetPosition": { + "x": 28436.509167221273, + "y": 24175.22699651291 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "Video-Tutorials", + "id": "fb52e785-fa45-4522-8478-b0d039525b4a" + } + } + } + ], + "assetWeightVotes": [], + "featureWeightVotes": [], + "positionWeightVotes": [], + "id": "b20ba922-208b-4aa8-8a57-270a54a39806", + "savedPayload": { + "position": { + "x": 28436.509167221273, + "y": 24175.22699651291 + }, + "targetPosition": { + "x": 28706.799827592, + "y": 24045.061874777643 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "Pool Class", + "name": "Translating", + "id": "1dc0d3a0-4a11-43c2-8c53-6b9e86cb0d01" + } + } + } + ], + "poolWeightVotes": [], + "assetWeightVotes": [], + "featureWeightVotes": [], + "positionWeightVotes": [], + "id": "4827d415-f407-47f3-b389-d6429c676250", + "savedPayload": { + "position": { + "x": 28706.799827592, + "y": 24045.061874777643 + }, + "targetPosition": { + "x": 28875.795845011085, + "y": 23797.190242482844 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "Pool Class", + "name": "Production", + "id": "58feb67b-074a-4373-8cc1-9219851b251a" + } + } + }, + { + "type": "Weight Votes Switch", + "name": "Consumption Pool Class", + "config": "{}", + "project": "Governance", + "weightVotesSwitch": [], + "poolWeightVotes": [ + { + "type": "Pool Weight Vote", + "name": "Completing Tutorials Pool", + "config": "{}", + "project": "Governance", + "id": "f28026a2-7299-45c3-9f42-e0a64311e114", + "savedPayload": { + "position": { + "x": 28306.344045486003, + "y": 23904.936336142182 + }, + "targetPosition": { + "x": 28576.63470585673, + "y": 23774.771214406916 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "Completing Tutorials", + "id": "0bfaeebd-a900-4e6e-b62c-3387e4e7baec" + } + } + }, + { + "type": "Pool Weight Vote", + "name": "Reading the Docs Pool", + "config": "{}", + "project": "Governance", + "id": "57196823-651b-4285-bf18-a4bbd9fa3066", + "savedPayload": { + "position": { + "x": 28328.76307356193, + "y": 23605.77519698783 + }, + "targetPosition": { + "x": 28576.63470585673, + "y": 23774.771214406916 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "Reading the Docs", + "id": "c3bee026-075f-48db-92df-fc599cce744d" + } + } + } + ], + "assetWeightVotes": [], + "featureWeightVotes": [], + "positionWeightVotes": [], + "id": "2fb14c74-e3b6-43db-86e3-3f67fb3aa657", + "savedPayload": { + "position": { + "x": 28576.63470585673, + "y": 23774.771214406916 + }, + "targetPosition": { + "x": 28875.795845011085, + "y": 23797.190242482844 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "Pool Class", + "name": "Consumption", + "id": "8a133a29-c678-4da0-8408-1e7f87d9dfa7" + } + } + } + ], + "poolWeightVotes": [], + "assetWeightVotes": [], + "featureWeightVotes": [], + "positionWeightVotes": [], + "id": "30929e97-3faa-4a62-b45d-c22716b3df8e", + "savedPayload": { + "position": { + "x": 28875.795845011085, + "y": 23797.190242482844 + }, + "targetPosition": { + "x": 29146.086505381812, + "y": 23667.025120747578 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "Pool Class", + "name": "Education", + "id": "86787666-908c-4b27-8265-cd460732030f" + } + } + }, + { + "type": "Weight Votes Switch", + "name": "Management Pool Class", + "config": "{}", + "project": "Governance", + "weightVotesSwitch": [], + "poolWeightVotes": [ + { + "type": "Pool Weight Vote", + "name": "Management Pool", + "config": "{}", + "project": "Governance", + "id": "a3cd897e-df9e-49ab-88a7-02869b81523b", + "savedPayload": { + "position": { + "x": 28546.086505381812, + "y": 23667.025120747578 + }, + "targetPosition": { + "x": 28846.086505381812, + "y": 23667.025120747578 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "Management", + "id": "5d878af1-e32c-4458-8fb7-98df55f1e54a" + } + } + } + ], + "assetWeightVotes": [], + "featureWeightVotes": [], + "positionWeightVotes": [], + "id": "40c0e3d0-1165-4ff9-8242-211d9f0a7a85", + "savedPayload": { + "position": { + "x": 28846.086505381812, + "y": 23667.025120747578 + }, + "targetPosition": { + "x": 29146.086505381812, + "y": 23667.025120747578 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "Pool Class", + "name": "Management", + "id": "a2acb2b1-c88f-47f2-b31b-b0cde52801ac" + } + } + }, + { + "type": "Weight Votes Switch", + "name": "Features Pool Class", + "config": "{\n\"percentage\": 50\n}", + "project": "Governance", + "weightVotesSwitch": [], + "poolWeightVotes": [ + { + "type": "Pool Weight Vote", + "name": "Features Pool", + "config": "{}", + "project": "Governance", + "id": "247ec21c-2331-460f-b803-a108db234804", + "savedPayload": { + "position": { + "x": 28605.50518464036, + "y": 23406.694877277045 + }, + "targetPosition": { + "x": 28875.795845011085, + "y": 23536.85999901231 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "Features", + "id": "2d34ec1b-e281-4163-a44b-6ac33a54e002" + } + } + } + ], + "assetWeightVotes": [], + "featureWeightVotes": [], + "positionWeightVotes": [], + "id": "e7eea9e5-4df6-4a6b-8a2a-5e46373a77fa", + "savedPayload": { + "position": { + "x": 28875.795845011085, + "y": 23536.85999901231 + }, + "targetPosition": { + "x": 29146.086505381812, + "y": 23667.025120747578 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "Pool Class", + "name": "Features", + "id": "8c3175a1-17aa-4e27-bcbe-063468ecc87e" + } + } + }, + { + "type": "Weight Votes Switch", + "name": "Software Projects Pool Class", + "config": "{}", + "project": "Governance", + "weightVotesSwitch": [], + "poolWeightVotes": [ + { + "type": "Pool Weight Vote", + "name": "Foundations Project Pool", + "config": "{}", + "project": "Governance", + "id": "e55378fa-5093-4225-864d-8ff41d99dd6a", + "savedPayload": { + "position": { + "x": 28662.39031695665, + "y": 23477.18835586002 + }, + "targetPosition": { + "x": 28959.03956482419, + "y": 23432.47567600717 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "Foundations Project", + "id": "2207c69c-ee9d-4453-8bf4-582d79b4b635" + } + } + }, + { + "type": "Pool Weight Vote", + "name": "TensorFlow Project Pool", + "config": "{}", + "project": "Governance", + "id": "61584484-e4c2-4166-8e41-f8473f8c669f", + "savedPayload": { + "position": { + "x": 28679.77744023093, + "y": 23322.873368697252 + }, + "targetPosition": { + "x": 28959.03956482419, + "y": 23432.47567600717 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "TensorFlow Project", + "id": "ea854cf8-47cd-43f0-b58a-13e61ae3106d" + } + } + }, + { + "type": "Pool Weight Vote", + "name": "Governance Project Pool", + "config": "{}", + "project": "Governance", + "id": "a6bb434c-67fd-4429-a4b4-f51a0c9a07ed", + "savedPayload": { + "position": { + "x": 28771.992624266568, + "y": 23197.92623126676 + }, + "targetPosition": { + "x": 28959.03956482419, + "y": 23432.47567600717 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "Governance Project", + "id": "3c80032c-51a8-4fd8-ab65-cf219c03ce95" + } + } + }, + { + "type": "Pool Weight Vote", + "name": "Education Project Pool", + "config": "{}", + "project": "Governance", + "id": "e718201a-9ce4-4eb5-aade-1e844f59af64", + "savedPayload": { + "position": { + "x": 28914.32688497134, + "y": 23135.82642813963 + }, + "targetPosition": { + "x": 28959.03956482419, + "y": 23432.47567600717 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "Education Project", + "id": "0a79ec65-6f67-4c18-823f-48a6d0494a81" + } + } + }, + { + "type": "Pool Weight Vote", + "name": "Ethereum Project Pool", + "config": "{}", + "project": "Governance", + "id": "7ac78464-92ee-470e-ba77-661071937ab5", + "savedPayload": { + "position": { + "x": 29068.641872134107, + "y": 23153.213551413908 + }, + "targetPosition": { + "x": 28959.03956482419, + "y": 23432.47567600717 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": {}, + "referenceParent": { + "type": "Pool", + "name": "Ethereum Project", + "id": "f51d23aa-742c-40d4-b000-2b90c3ae197c" + } + } + } + ], + "assetWeightVotes": [], + "featureWeightVotes": [], + "positionWeightVotes": [], + "id": "f98086f7-1e41-4365-aa6c-4e4cccaf4ae6", + "savedPayload": { + "position": { + "x": 28959.03956482419, + "y": 23432.47567600717 + }, + "targetPosition": { + "x": 29146.086505381812, + "y": 23667.025120747578 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "Pool Class", + "name": "Software Projects", + "id": "a987f1d3-fc8d-4b7c-99dd-77f15a32f37d" + } + } + } + ], + "poolWeightVotes": [], + "assetWeightVotes": [], + "featureWeightVotes": [], + "positionWeightVotes": [], + "id": "e059f5c4-9132-4d76-9f3e-1060658fa704", + "savedPayload": { + "position": { + "x": 29146.086505381812, + "y": 23667.025120747578 + }, + "targetPosition": { + "x": 29438.56487903636, + "y": 23600.268840560682 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "Pools", + "name": "Superalgos", + "id": "6f0aed87-db13-4818-bfe6-68abc463ebec" + } + } + } + ], + "poolWeightVotes": [], + "assetWeightVotes": [], + "featureWeightVotes": [], + "positionWeightVotes": [], + "id": "1d398124-3f36-40a1-8b3b-6c77ad489b92", + "savedPayload": { + "position": { + "x": 29438.56487903636, + "y": 23600.268840560682 + }, + "targetPosition": { + "x": 29731.043252690906, + "y": 23533.512560373787 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + } + } + } + ], + "userProfileVotesSwitch": [], + "id": "2b8d3ce7-515c-44ad-8d80-3c2be6d7736f", + "savedPayload": { + "position": { + "x": 29731.043252690906, + "y": 23533.512560373787 + }, + "targetPosition": { + "x": 30023.521626345453, + "y": 23466.75628018689 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + } + } + } + ], + "id": "d5ed432e-78bf-432e-be3b-8649932f7a65", "savedPayload": { "position": { "x": 30023.521626345453, @@ -1904,7 +1992,7 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": true, + "isCollapsed": false, "angleToParent": 1, "distanceToParent": 3, "arrangementStyle": 0 diff --git a/Projects/Governance/Plugins/Workspaces/Token-Distribution-Superalgos.json b/Projects/Governance/Plugins/Workspaces/Token-Distribution-Superalgos.json index b858c811d..c32b43490 100644 --- a/Projects/Governance/Plugins/Workspaces/Token-Distribution-Superalgos.json +++ b/Projects/Governance/Plugins/Workspaces/Token-Distribution-Superalgos.json @@ -144,32 +144,6 @@ "type": "Governance Project", "name": "New Governance Project", "project": "Governance", - "projectDefinition": { - "type": "Project Definition", - "name": "Governance", - "config": "{ \n \"codeName\": \"Governance\"\n}", - "project": "Foundations", - "id": "ba1aa656-d184-493a-b332-e4db109065f0", - "savedPayload": { - "position": { - "x": 13832, - "y": 10738.5 - }, - "targetPosition": { - "x": 13532, - "y": 10738.5 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 1, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": {} - } - }, "id": "db380c52-cf90-475b-87df-c005dd51cdf6", "savedPayload": { "position": { @@ -193,66 +167,6 @@ } } }, - { - "type": "Positions", - "name": "Superalgos", - "project": "Governance", - "positionClasss": [], - "positions": [ - { - "type": "Position", - "name": "Project Leader", - "config": "{\n \"description\": \"\", \"relativeWeight\": 0 \n}", - "project": "Governance", - "positions": [], - "positionClasss": [], - "id": "5f694173-4568-46b2-a52c-4244320919f7", - "savedPayload": { - "position": { - "x": 30231, - "y": 38070 - }, - "targetPosition": { - "x": 30231, - "y": 37770 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - } - } - } - ], - "id": "50c68665-5da2-48a8-b229-7a1563ae82d2", - "savedPayload": { - "position": { - "x": 30231, - "y": 37770 - }, - "targetPosition": { - "x": 30231, - "y": 37770 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": true, - "angleToParent": 1, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - } - } - }, { "type": "Docs Space", "name": "New Docs Space", @@ -892,9 +806,9 @@ { "type": "Plugin File", "name": "Julian-Molina", - "config": "{\"project\":\"Governance\",\"fileName\":\"Julian-Molina\"}", + "config": "{\n \"project\": \"Governance\",\n \"fileName\": \"Julian-Molina\"\n}", "project": "Foundations", - "id": "d13c2f5a-b48c-4c67-ae0a-c5c49c27868b", + "id": "39cd9f98-5266-4eee-ace2-cad6db5b29e4", "savedPayload": { "position": { "x": 35306.95802911758, @@ -931,7 +845,7 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": true, + "isCollapsed": false, "angleToParent": 2, "distanceToParent": 3, "arrangementStyle": 0 @@ -1246,7 +1160,7 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": false, + "isCollapsed": true, "angleToParent": 2, "distanceToParent": 3, "arrangementStyle": 0 @@ -1284,7 +1198,36 @@ "type": "Plugin Positions", "name": "New Plugin Positions", "project": "Governance", - "pluginFiles": [], + "pluginFiles": [ + { + "type": "Plugin File", + "name": "Superalgos", + "config": "{\n \"project\": \"Governance\",\n \"fileName\": \"Superalgos\"\n}", + "project": "Foundations", + "id": "ccaa3acb-687b-4e61-8a15-251f5524ed13", + "savedPayload": { + "position": { + "x": 35942.095312981444, + "y": 9960.039006389541 + }, + "targetPosition": { + "x": 35910.73677400115, + "y": 10258.395575000022 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": true, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + } + } + } + ], "id": "4adb08aa-1703-4a6d-a8f5-eec6f5d8d1cc", "savedPayload": { "position": { @@ -1298,7 +1241,7 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": false, + "isCollapsed": true, "angleToParent": 2, "distanceToParent": 3, "arrangementStyle": 0 @@ -1382,6 +1325,34 @@ "isRunning": false } } + }, + { + "type": "User Profile", + "name": "Jeremy", + "config": "{\n \"codeName\": \"\",\n \"tokens\": 1000\n}", + "project": "Governance", + "id": "759e9012-c995-47ed-92f1-7d204bf2b58e", + "savedPayload": { + "position": { + "x": 19667.166666666664, + "y": 23061.600619195047 + }, + "targetPosition": { + "x": 19667.166666666664, + "y": 23061.600619195047 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + } + } } ] } \ No newline at end of file diff --git a/Projects/Governance/Schemas/App-Schema/support-program.json b/Projects/Governance/Schemas/App-Schema/support-program.json index 9e36f802d..2441a4e96 100644 --- a/Projects/Governance/Schemas/App-Schema/support-program.json +++ b/Projects/Governance/Schemas/App-Schema/support-program.json @@ -12,8 +12,8 @@ "action": "Add UI Object", "actionProject": "Foundations", "actionFunction": "payload.executeAction", - "label": "Add User Support", - "relatedUiObject": "User Support" + "label": "Add User Supporter", + "relatedUiObject": "User Supporter" }, { "action": "Add UI Object", @@ -49,9 +49,9 @@ "propertyNameAtParent": "supportProgram", "childrenNodesProperties": [ { - "name": "userSupports", + "name": "userSupporters", "type": "array", - "childType": "User Support", + "childType": "User Supporter", "autoAdd": false }, { diff --git a/Projects/Governance/Schemas/App-Schema/userSupport.json b/Projects/Governance/Schemas/App-Schema/user-supporter.json similarity index 88% rename from Projects/Governance/Schemas/App-Schema/userSupport.json rename to Projects/Governance/Schemas/App-Schema/user-supporter.json index caa0d2478..361e39ca7 100644 --- a/Projects/Governance/Schemas/App-Schema/userSupport.json +++ b/Projects/Governance/Schemas/App-Schema/user-supporter.json @@ -1,5 +1,5 @@ { - "type": "User Support", + "type": "User Supporter", "menuItems": [ { "action": "Configure", @@ -31,10 +31,10 @@ "addLeftIcons": true, "level": 2, "attachingRules": { - "compatibleTypes": "->support Program->" + "compatibleTypes": "->Support Program->" }, "referencingRules": { "compatibleTypes": "->User Profile->" }, - "propertyNameAtParent": "userSupports" + "propertyNameAtParent": "userSupporters" } \ No newline at end of file diff --git a/Projects/Governance/UI/Function-Libraries/DistributionProcess.js b/Projects/Governance/UI/Function-Libraries/DistributionProcess.js index 65b559f6f..bd22a80a8 100644 --- a/Projects/Governance/UI/Function-Libraries/DistributionProcess.js +++ b/Projects/Governance/UI/Function-Libraries/DistributionProcess.js @@ -41,6 +41,11 @@ function newGovernanceFunctionLibraryDistributionProcess() { userProfiles ) + UI.projects.governance.functionLibraries.supportProgram.calculate( + pools, + userProfiles + ) + UI.projects.governance.functionLibraries.mentorshipProgram.calculate( pools, userProfiles diff --git a/Projects/Governance/UI/Function-Libraries/SupportProgram.js b/Projects/Governance/UI/Function-Libraries/SupportProgram.js new file mode 100644 index 000000000..386336398 --- /dev/null +++ b/Projects/Governance/UI/Function-Libraries/SupportProgram.js @@ -0,0 +1,23 @@ +function newGovernanceFunctionLibrarySupportProgram() { + let thisObject = { + calculate: calculate + } + + return thisObject + + function calculate( + pools, + userProfiles + ) { + UI.projects.governance.utilities.mandatoryProgram.run( + pools, + userProfiles, + "supportProgram", + "Support-Program", + "Support Program", + "Support Power", + "userSupporters", + "User Supporter" + ) + } +} \ No newline at end of file diff --git a/Projects/ProjectsSchema.json b/Projects/ProjectsSchema.json index 4c2e387aa..9318f6869 100644 --- a/Projects/ProjectsSchema.json +++ b/Projects/ProjectsSchema.json @@ -1003,6 +1003,11 @@ "propertyName": "referralProgram", "functionName": "newGovernanceFunctionLibraryReferralProgram" }, + { + "name": "Support Program", + "propertyName": "supportProgram", + "functionName": "newGovernanceFunctionLibrarySupportProgram" + }, { "name": "Mentorship Program", "propertyName": "mentorshipProgram",