Replies: 2 comments
-
I like the idea to have a unified contract. When a new election is created must have a kind attribute, that set how the votes must be done (on chain, events, signed, etc). |
Beta Was this translation helpful? Give feedback.
0 replies
-
I love this idea! It's amazing because we can even emit events for the on-chain version by calling the helpers at the end. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Huxwell, Swapp, and I were discussing a unified contract that could potentially support all the current implementations of quadratic diplomacy.
A singular contract with event-helpers could be used for the event-driven, on-chain, cermaic/db, metatxs, signature-based(?), etc. The only difference between the versions would be the usage on the front-end calls to the contract protocol. Because both major versions of the quadratic diplomacy contracts effectively play the same role, it may be possible to reduce them to a common form. We could probably achieve this by being specific about event emissions.
For example, the contract could look something like:
And depending on the version implementation:
for on-chain, we'd use the castVote function to write the data to the chain. Something like:
and for event-driven, we'd just call the event-helper when casting a vote
And so on...
What does this do?
This approach could offer a flexible way to construct applications based upon the contract limitations. This would reduce the # of deployments necessary, focus more eye balls on the contract code, and (as far as I'm aware ;)) still offer the same utility the different versions of the contract offer. With a unified rock-solid contract, we could deploy all the separate versions. Then using some form of metrics, decide if/which version(s) we should focus on supporting in the future.
Cons:
Anyway, thought I'd throw this idea out in the wild and get everyone's input on the matter. Please comment and share what you think!
Beta Was this translation helpful? Give feedback.
All reactions