JoinSEEDS / seeds-smart-contracts

Smart contracts for SEEDS - A Regenerative Civilization Building Game.
https://docs.google.com/document/d/1C4w9Ol8VGabCIcQDVPDrwcTRoJXBqhrb7VjslwQbUGU/edit#heading=h.6f4sxygso816
MIT License
20 stars 6 forks source link

Feature/streaming funding #393

Closed IanMendozaJaimes closed 2 years ago

IanMendozaJaimes commented 2 years ago

Includes DAO https://github.com/JoinSEEDS/seeds-smart-contracts/pull/390

Added streaming funding.

Added three new tables:

Added tests for dao, harvest and scheduler.

Brief description

Dhos can be created and deleted with createdho and removedho respectively. When a dho is removed, all its votes are removed as well and the dho is removed immediately from the sharing table.

To vote, users must call the action votedhos with all the dhos they want to vote for. I think this way is easier to implement and validate. Users can call this action at any time and the votes will be recalculated for that user except if the user's voice is delegated. The delegation is implemented as well, to delegate it the dao actions delegate/undelegate are used.

To calculate how much percentage of the harvest each dho receives, the function dhocalcdists has to be triggered. I set this function to be executed every hour in scheduler.

To clean the old votes, the function dhocleanvts has to be called. I set this function to be executed every day.

Some considerations:

Deployment

Contracts to be deployed:

Other considerations:

n13 commented 2 years ago

Maybe tonight we can go over this code after the meeting (I mean your morning) so I can make sure I understand it all

I will go through a full proposal cycle reading the code first as well, so I am prepared.

On Sep 4, 2021, at 11:23 AM, Ian Mendoza Jaimes @.***> wrote:

Hello @n13 https://github.com/n13 , this is the draft of the streaming funding.

I got confused in the call, I added the dho_voice scope so the voice delegation can use the same methods for delegate/undelegate

Small question:

for the cs points multiplier I am currently using the rank, i.e. from 1-99, I decided that because with the noraml 0-2 multiplier votes percentages can become 0 very easily. Is that ok? or I better use the 0-2 multiplier? You can view, comment on, or merge this pull request online at:

https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393 https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393 Commit Summary

Refactoring referendums Added refendum classes Added evaluate function. Added methods for voting on referendums Added tests, added validations for referendums Moved voice methods from proposals to referendums Removed voice contract from contracts.hpp fixed merge conflicts Removed comments. Fixed referendums tests. Changed permissions for referendums Added dao contract. Referendums contract restored using the old version Fixed merge conflicts Added all the voice methods to dao seeds. Added tests. Fixed merge conflicts Added proposals methods in proposal class Added min stake to proposals Campaign proposals refactoring Merge branch 'feature/dao-proposals' of https://github.com/JoinSEEDS/seeds-smart-contracts into feature/dao-proposals Added prop alliances tests test dao Small improvements Merge branch 'feature/dao-proposals' of https://github.com/JoinSEEDS/seeds-smart-contracts into feature/dao-proposals Implemented proposal campaign invite and testing Merge branch 'feature/dao-proposals' of https://github.com/JoinSEEDS/seeds-smart-contracts into feature/dao-proposals Finished alliances Implemented proposal invite campaigns Merge branch 'feature/dao-proposals' of https://github.com/JoinSEEDS/seeds-smart-contracts into feature/dao-proposals Added small validation to stake refund Merge branch 'feature/dao-proposals' of https://github.com/JoinSEEDS/seeds-smart-contracts into feature/dao-proposals Fixed changes in campaing_invite proposal Merge branch 'feature/dao-proposals' of https://github.com/JoinSEEDS/seeds-smart-contracts into feature/dao-proposals Added campaign invites Added proposals Finished proposals. Added alliances, campaign funding/invite, milestones and referendums. Upgraded eos image in the docker file Added distribute dhos in harvest contract File Changes

M include/contracts.hpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-8df98c2f55f6b256f4de69158d70c1dbcfcb695b73222d3aedc47a41d86e5fef (1) A include/proposals/proposal_alliance.hpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-6c6bfc3818f546500e3e974a83d5b37123c5b3881ee466510ebd6f2754ed06dd (25) A include/proposals/proposal_campaign_funding.hpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-b8795a51cca1d59148ef0beef61ac25957ef4dc36d6e391ddc05ad488b6e72c7 (27) A include/proposals/proposal_campaign_invite.hpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-45493c3e2cd263ff301d8b6ac65872d9f5baf47ef550f2b32ecbc54e71625307 (23) A include/proposals/proposal_milestone.hpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-2f701ba64fe44cc40d956d459301d14102db0edc78f263c1b3cd161465b9433f (18) M include/proposals/proposals_base.hpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-bb92447d323b3453ea5cd35bf0b7d9be396d2e502a0a79cdf8cb053538d91ce4 (35) M include/proposals/proposals_factory.hpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-eeafa53be51949454e724fa53dde83b3be2c80d652a72f1c4dac0ab326044464 (16) M include/proposals/referendum_settings.hpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-5d9d5010f0ac1aa285d745e75e3a88db2cd9be7e17cbf1a77dbad89cbf3ac12f (11) M include/seeds.dao.hpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-eb53cf4263bcf49c9bff87c5cc99058dfef849f0495175d905c1fcbc09bcc252 (155) M include/seeds.escrow.hpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-b94b4de5fd6427fe6d51983b53affef39d59af64a23caa7a775edb621f4221f9 (1) M include/seeds.harvest.hpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-892e0d6a22f5e850b0892bc8d09a734ff5602ebca749513e77cfcfe1c574e4ff (13) M include/tables/proposals_table.hpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-2cab09bdedc92bcce453b54602b8310973e8ab0fc87e52d74240dfa0df5159d8 (4) M scripts/compile.js https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-0298c9f61477b2f517abde1dee0e15c2593e2b1bb4a9c5a7fc7fa8405f58e782 (2) M scripts/helper.js https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-451c3dd534088e9f21be5df1784043debdd5afa0a7e44723920a1fd2932f8b83 (24) A src/proposals/proposal_alliance.cpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-4421954a251e8ae5be32941f57b0756dddca18b460b1444c10a51f232f173844 (179) A src/proposals/proposal_campaign_funding.cpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-ea6729e1cef86402886ff6ca9f5153afb67eb77541a776fde3b64dd5aeba62fe (217) A src/proposals/proposal_campaign_invite.cpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-e913473d0ee5251abda166c2fcebc072b7070dbdac5558ec37c1a64f3f3c4b82 (186) A src/proposals/proposal_milestone.cpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-7e9f15833e0a31a06a582d8c49df96c122a8fd31feb56bcce95e83ecaa19a2ae (74) A src/proposals/proposals_base.cpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-52ce229a9f16cfb2ed87bde9a10bbb8f5d47119ec727326d43b2659294d55a02 (340) M src/proposals/referendums_settings.cpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-e6395009246c7b2be5ac431bc5dd186f0ad109b7e27ee8c5592fde055afc768a (112) A src/proposals/voice_management.cpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-60d2bb69ed72e8f453c3381538370beb65cf74d2181650fa6d67901fa581a363 (501) M src/seeds.dao.cpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-3ed21f34b1ad100fa70b00eeda69b06584b6f682129090d33ebc84e5726f2a4d (920) M src/seeds.escrow.cpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-f1cf70fe1f89caf104b5ceb8854e976781f12416d241aa4c047defedfc5a7f81 (65) M src/seeds.harvest.cpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-e20691374b94241e319c47b30a96afe30519ff843ac3c8b011604b1d7bc66ecd (20) M src/seeds.onboarding.cpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-e6061d8e95f4e920b2231e2f1ae87ad6faeee66710978b50cad2c54b1ee8d30e (17) M src/seeds.settings.cpp https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-105803d1d7471ec90f7d6a0a368a0791b24d9b02b72546756544ba9e9416e968 (6) M test/dao.test.js https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-36db933a01184a6ed5bb1ee48e1707f2fdaffdd81103976031beffa6d0e5cfb3 (1982) M yarn.lock https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393/files#diff-51e4f558fae534656963876761c95b83b6ef5da5103c4adef6768219ed76c2de (840) Patch Links:

https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393.patch https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393.patch https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393.diff https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393.diff — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/JoinSEEDS/seeds-smart-contracts/pull/393, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAP7BBW2PTVD2OZYBKP7ZDUAGGMNANCNFSM5DM2PD2Q. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.