near-daos / sputnik-dao-contract

Smart contracts for https://app.astrodao.com
https://astrodao.com/
MIT License
108 stars 81 forks source link

How to upload new code for upgraded smart contract/DAO #143

Closed siddharthborderwala closed 2 years ago

siddharthborderwala commented 2 years ago

I am trying to understand how to upgrade my dao. I think we can call upgrade_self, but I don't understand how and where to upload the new version of the code? Please help me out, thanks!

In this picture below (taken from sputnik-dao code itself), the function takes in a hash, I take it the hash is the hash generated by the system storage for the uploaded code. But I don't understand how to upload that code into the smart contract's system storage.

image

Please help me out, thanks in advance!

TrevorJTClarke commented 2 years ago

Hi @siddharthborderwala while the upgrade pieces are not live yet, if you have deployed your own factory / DAO, you can refer to this: https://github.com/near-daos/sputnik-dao-contract/blob/main/scripts/upgrade_dao_proposal_dev.sh

siddharthborderwala commented 2 years ago

Hello! Thanks for the pointer, it helped. The confusion is clear now!