Upgrade module with Dao

Starcoin support upgrade module by DAO.

  1. compile the module which you want to upgrade.
  2. unlock your account.
starcoin% account unlock <account address>
  1. submit upgrade module proposal with your account.
starcoin% dev module_proposal -s <account address> -m <module path> -v <version>
  1. query proposal state.
starcoin% dev call --module-address <module address> --module-name Dao --func-name proposal_state -t 0x1::STC::STC -t 0x1::UpgradeModuleDaoProposal::UpgradeModule --arg <proposal address> --arg <proposal number>
  1. anyone can vote proposal when the proposal state is ACTIVE.
starcoin% dev execute -s <account address> -b --script cast_vote -t 0x1::STC::STC -t 0x1::UpgradeModuleDaoProposal::UpgradeModule --arg <proposal address> --arg <proposal number> --arg <agree> --arg <votes>u128
  1. anyone can queue proposal when the proposal state is AGREED.
starcoin% dev module_queue -s <account address> -a <proposal address> -m <proposal number>
  1. anyone can submit plan when the proposal state is QUEUED.
starcoin% dev module_plan -s <account address> -a <proposal address> -m <proposal number>
  1. anyone can upgrade the module when the proposal state is EXECUTABLE.
starcoin% dev module_exe -s <account address> -m <module path>