DA0-DA0 / dao-dao-ui

InterChain DAO tooling UI.
https://daodao.zone
29 stars 22 forks source link

Bug: Create SubDAO proposal doesn't set the admin #1785

Closed kopeboy closed 5 months ago

kopeboy commented 5 months ago

If from a "SubDAO" tab of an existing DAO you click "+ New SubDAO" and complete the steps, you will see in the instantiate message that the admin will be the address of the existing DAO (on the URL you are)... image

... but when you actually click "+ Create SubDAO" you get this message prompted in your wallet:

{
  "account_number": "59681",
  "chain_id": "uni-6",
  "fee": {
    "gas": "2722912",
    "amount": [
      {
        "amount": "68073",
        "denom": "ujunox"
      }
    ]
  },
  "memo": "",
  "msgs": [
    {
      "type": "wasm/MsgExecuteContract",
      "value": {
        "contract": "juno1dacj3j6pwr7jx0jeu99qdc4a2ylc2rxp4v3zap54sfrl3ntrhe8qkjfpku",
        "funds": [],
        "msg": {
          "instantiate_contract_with_self_admin": {
            "code_id": 4067,
            "instantiate_msg": "eyJhZG1pbiI6Imp1bm8xdXdycjZ0cnpmMnQyNXk2M20yYWY1a3E5OG1sdjVzZnczODlkaGw3bmc5ZTN2YTZjM3FocXo2YXp3ZSIsImF1dG9tYXRpY2FsbHlfYWRkX2N3MjBzIjp0cnVlLCJhdXRvbWF0aWNhbGx5X2FkZF9jdzcyMXMiOnRydWUsImRlc2NyaXB0aW9uIjoidGVzdCIsImltYWdlX3VybCI6bnVsbCwibmFtZSI6IkFub3RoZXIgU3ViREFPIiwicHJvcG9zYWxfbW9kdWxlc19pbnN0YW50aWF0ZV9pbmZvIjpbeyJhZG1pbiI6eyJjb3JlX21vZHVsZSI6e319LCJjb2RlX2lkIjo0MDc0LCJsYWJlbCI6IkRBT19Bbm90aGVyIFN1YkRBT19EYW9Qcm9wb3NhbFNpbmdsZSIsIm1zZyI6ImV5SmhiR3h2ZDE5eVpYWnZkR2x1WnlJNlptRnNjMlVzSW1Oc2IzTmxYM0J5YjNCdmMyRnNYMjl1WDJWNFpXTjFkR2x2Ymw5bVlXbHNkWEpsSWpwMGNuVmxMQ0p0WVh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pYY2lPbnNpWTNjMFgyZHliM1Z3WDJOdlpHVmZhV1FpT2pFM09Dd2lhVzVwZEdsaGJGOXRaVzFpWlhKeklqcGJleUpoWkdSeUlqb2lhblZ1YnpGNU0zSTVlV0Y2WjJaNVlXNXdaV1p4WldveVkzcDFiSEZqZEdOdWNEYzJiR3hvZVhsbVpDSXNJbmRsYVdkb2RDSTZNWDFkZlgxOSIsImZ1bmRzIjpbXX19",
            "label": "Another SubDAO"
          }
        },
        "sender": "juno1y3r9yazgfyanpefqej2czulqctcnp76llhyyfd"
      }
    }
  ],
  "sequence": "9"
}

which already is dubious since it contains instantiate_contract_with_self_admin. Go ahead by approving the transaction and querying the chain at https://juno-testnet-api.polkachu.com/cosmwasm/wasm/v1/contract/juno1p6m3uv72l56mdz6yzez6s5lsde2d9m2r2sxxcjhqpt43ndk8ltlql9f2ey, which will return:

{
  "address": "juno1p6m3uv72l56mdz6yzez6s5lsde2d9m2r2sxxcjhqpt43ndk8ltlql9f2ey",
  "contract_info": {
    "code_id": "4067",
    "creator": "juno1dacj3j6pwr7jx0jeu99qdc4a2ylc2rxp4v3zap54sfrl3ntrhe8qkjfpku",
    "admin": "juno1p6m3uv72l56mdz6yzez6s5lsde2d9m2r2sxxcjhqpt43ndk8ltlql9f2ey",
    "label": "Another SubDAO",
    "created": {
      "block_height": "11548366",
      "tx_index": "0"
    },
    "ibc_port_id": "",
    "extension": null
  }
}

.. to confirm that contrary to what was shown in the preview of the instantiate message, the admin is not the original DAO 🚨 but the new DAO itself, ie. a normal DAO like any other you can create from your wallet at daodao.zone/actions (without a proposal). This new DAO still results "Sub" on daodao.zone UI, ie. in the left-menu of your followings and in the SubDAOs tab of the original DAO page, but not on-chain.

NoahSaso commented 5 months ago

oh no! great catch 🙏 will fix this ASAP and write a guide on how to fix it for SubDAOs that are improperly configured 🫡

NoahSaso commented 5 months ago

fixed by 44b2d0bc4c7ad1ecb8f477e9bc1c567677f260ae

NoahSaso commented 5 months ago

blog post explaining the issue and how to fix it:

https://medium.com/@dao-dao/how-to-fix-your-subdaos-contract-level-admin-1264d1842e67