7 stable releases

2.6.0 Nov 8, 2024
2.5.0 Oct 31, 2024
2.4.2 Jul 22, 2024
2.3.0 Oct 18, 2023
2.2.0 Jul 9, 2023

#928 in Magic Beans

Download history 83/week @ 2024-07-27 8/week @ 2024-09-21 8/week @ 2024-09-28 123/week @ 2024-10-26 124/week @ 2024-11-02 31/week @ 2024-11-09

278 downloads per month

BSD-3-Clause

1MB
30K SLoC

dao-migrator

dao-migrator on crates.io docs.rs

Here is the discussion.

A migrator module for a DAO DAO DAO which handles migration for DAO modules and test it went successfully.

DAO core migration is handled by a proposal, which adds this module and do init callback to do migration on all regsitered modules. If custom module is found, this TX fails and migration is cancelled, custom module requires a custom migration to be done by the DAO.

General idea

  1. Proposal is made to migrate DAO core to V2, which also adds this module to the DAO.
  2. On init of this contract, a callback is fired to do the migration.
  3. Then we check to make sure the DAO doesn't have custom modules.
  4. We query the state before migration
  5. We do the migration
  6. We query the new state and test it to make sure everything is correct.
  7. In any case where 1 migration fails, we fail the whole TX.

Important notes

  • custom modules cannot reliably be migrated by this contract, because of that we fail the process to avoid any unwanted results.

  • If any module migration fails we fail the whole thing, this is to make sure that we either have a fully working V2, or we do nothing and make sure the DAO is operational at any time.

Dependencies

~11MB
~219K SLoC