ethichub / platform-contracts Goto Github PK
View Code? Open in Web Editor NEWThe contracts for Ethic Hub ethical crowdlending platform
License: GNU General Public License v3.0
The contracts for Ethic Hub ethical crowdlending platform
License: GNU General Public License v3.0
to 5 when registering community / localNode
Instead of manual input, get the final exchange rate from an oracle (coinmarketcap)
Lets test that after upgrading a contract, the old one can't interact with the platform.
sendFundsToBorrower() should be out of contributeWithAddress() and made external.
Add a check for state === AcceptingContributions in sendFundsToBorrower()
This way the transfer to the exchange will happen when local node and representative are ready and in a room together.
Change borrower by representative wherever present.
Also change defaultDays for delayDays
When ready, add the banner to readme and a better description
Right now we have 1 payment back with several transactions to repay.
Our borrowers ask to be able to pay fractions of the total amount before the date, with the interest of the time of payment (like in traditional loans).
This implies that there would be several "reclaimContributionWithInterest".
We are calculating the lending period from fundingEndTime
But what if the money is sent in day fundingStartTime + 2? (when the cap is reached)
reclaimEthicHubTeamFee & reclaimEthicHubTeamFee deppend on borrowerReturnAmount(), which is dependant on "now".
The fee should be fixed when project is repayed
1.- Launch lending contract
2.- Update reputation contract
3.- Try to pay back lending contract using old reputation
Easier for the frontEnd to have this call
BurnReputation or IncrementReputation. TODO the only Lending Contract modifier and unit tests. We have a branch fix_onlylendingcontract with this code without finish.
representative should be the exchange account to receive the funds, community should be a wallet that the community controls.
In EthicHubLending, EthicHubReputation and EthicHubUser
We should have "community" and "representative" in the modifiers, registering and such.
Community should be the subject of reputation calculations (like it is know)
Allow for partial returns, not considering the loan paid, allowing to get the money
On test/EthicHubIntegration.js
En el contrato EthicHubLending. En el flujo de inversión (The investment flow), calculo la reputación al inicio y al final, para la comunidad está bien, y para el nodo local no cambia.
Instead of manual input, use oracles from coinmarketcap to get the peso/ether exchange rate.
Important: Keep the feature of returning surplus ether operational
Explain the system, how to test it and how to contribute.
Restrict project creation to only local nodes.
Since we are going to store investors, localNodes, and other contract data in one contract, we may better refactor to a hub and spoke architecture
This may allow us to upgrade Lending and Reputation in the future.
After Lending payment/default, reputation for the local node and community must be increased or burned.
In this version, reputation for communities is communal. In future version reputations will be set by individual.
Reputation of the local nodes will vary proportionally with the reputation of the communities.
To have a measure of the impact of a project, we are classifying them in 5 tiers (t1 to t5).
Each tier corresponds to the monetary amount lent per person in the project. Each country will have a different monetary amount that makes sense for each tier, and a different fiat currency to grade them, so we will not store that in the blockchain for now.
For our first run in México we have:
Decrement of 1% daily after the set lendingDays, with 100% rep being burned if the money is not returned before maxDefaultDays.
Reputation decrement will be a multiplier of the community result.
R = Reputation
Rp = Previous reputation
Nt = Number of previously succesful projects in that tier
R = Rp + 1/Nt
Tm = Tier multiplier (1 for t1, 2 for t2..)
C = Number of people on the community
R = Rp + 0.05*(Tm*C)
Change interest to variable and annual, also add 4% local node and 3% EthicHub when returning borrowed amount.
After the lending period, the initial cap in eth might be too many pesos when going to exchange. We don't want to charge the farmers with more interests than needed.
The exchanged rate must be set after the actual exchange takes place.
We need to add:
Contract with the API to register investors and local nodes.
Add checks in lending contract for registered investors, valid local nodes creating the contract
Add integration tests for all lending cases, with actual storage, cmc and user contracts , checking that the correct values are set in storage and the balances are right.
Do in a separate testing file that EthicHubLending.js
Set investorsKey[address].amount to 0 before the transfer in the reclaimXX methods
Please add:
getMaxDelayDays()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.