Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Snapshot with 0.1 governance spec #3

Open
4 of 5 tasks
shahankhatch opened this issue Sep 16, 2021 · 7 comments
Open
4 of 5 tasks

Integrate Snapshot with 0.1 governance spec #3

shahankhatch opened this issue Sep 16, 2021 · 7 comments
Assignees
Labels
Milestone

Comments

@shahankhatch
Copy link
Contributor

shahankhatch commented Sep 16, 2021

  • E2E testing that integrates proposal mechanism developed in this repo
  • Documentation for which parts are automated by on-chain actions and off-chain actions
  • Evaluate whether this testing framework should be in a separate repo

Future work:

  • Evaluate whether this testing framework can be offered as a template, i.e., if it can be generalized to any smart contract framework, e.g., other DAO codebases that use a different governance framework but integrate Snapshot
  • Evaluate how to integrate other off-chain governance frameworks into this testing framework, e.g., Zodiac
@shahankhatch shahankhatch added this to the 0.1 milestone Sep 16, 2021
@CjHare
Copy link
Contributor

CjHare commented Sep 17, 2021

Unfortunately this is not looking anywhere as easy I'd hoped.

Snapshot has a local test harness (no Docker container) that connects to a live network (e.g. main net) to run against contract's there.

End to end testing is going to be ...interesting 🤔

@CjHare
Copy link
Contributor

CjHare commented Sep 21, 2021

@shahankhatch do you want the testing framework code in this BitDAO repo or under the WindRanger repo?

Current thoughts being create the e2e code in the WindRanger then port over the test code to verify the deployed BitDAO contract.

@shahankhatch
Copy link
Contributor Author

Your suggestion for having e2e in Windranger and porting BitDAO-specific tests sounds like a good suggestion @CjHare 👍

@CjHare
Copy link
Contributor

CjHare commented Oct 18, 2021

The test repo up and running against the latest Governance contracts with a open vote and role vote strategies available.

https://github.com/windranger-io/windranger-governance-snapshot-strategies-it

The npm test run an mocha test of the two strategies against an in-memory HardHat network. The tests have equivalent logic to the snapshot-strategies but use dynamic input data (a static example.json is used in the Snapshot tests)

@CjHare
Copy link
Contributor

CjHare commented Oct 18, 2021

Evaluate whether this testing framework can be offered as a template
The setup of the in-memory HardHat node and contract is generic, and would be the same for any test framework (providing the data to test against) ...but, the actual tests themselves (logic) is Snapshot specific and there are additional hooks (node_modules patch) to tweak Snapshot to use the dynamic data from the tests.

To apply to a different Governance framework, interfaces can be added to abstract the details of which contract to deploy and how to initialise them, which would create a further separation between the init and test logic.

The one hiccup is needing to know the multicall contract (common for all snapshot testing) before it is deployed. Not difficult as HardHat uses generated addresses based on order of contract creation, so is consistent across runs, but when updating dependencies is going to be a gotcha)

@bitparadigm
Copy link
Contributor

@shahankhatch This one I think can be closed too as we have sufficient integration test for current contracts and snapshot in strategies-it repo and full flow tests for on-chain Governance in the current repo.

@CjHare
Copy link
Contributor

CjHare commented Dec 13, 2021

Evaluate how to integrate other off-chain governance frameworks into this testing framework, e.g., Zodiac

@shahankhatch this last point is likely to need a PoC (experimenting on Rinkeby with Gnosis Safe+Zodiac), as it's not entirely clear to me from the Zodiac docs how the various plugins work together 🤔

Using Zodiac with on-chain governance is mentioned, but only in passing, without example ...many open questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants