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

Planted Bonus 30% Implementation #396

Closed n13 closed 2 years ago

n13 commented 2 years ago

What

People voted for a planted bonus

Implementation

This is an off chain implementation because it's a one-off thing, and would be difficult to test on-chain, also difficult to implement. Off chain it's pretty easy to do thanks to actions history.

1 - get list of acounts and amounts

Take a snapshot at the begining - all planted values. Store. Then a snapshot at the end Then check all accounts at the end, and make sure nobody called the action unplant during that period --> audit done That's 3 calls 2 on chain calls to store the tables, takes seconds And one mongoDB call to parse the action history, that also takes seconds

2 - send bonus Seeds