Skip to content

Commit ae6a99f

Browse files
committed
add steps for migrating a dao from v2 to v3
1 parent a1572a4 commit ae6a99f

File tree

1 file changed

+61
-2
lines changed

1 file changed

+61
-2
lines changed

release_process.md

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ near call sputnikv2.testnet store $(eval "$BYTES") --base64 --accountId sputnikv
226226

227227
**4. Use the code hash returned from the previous step to store the metadata associated with the code:**
228228
```bash
229-
near call sputnikv2.testnet store_contract_metadata '{"code_hash": "TBD", "metadata": {"version": "v3", "commit_id": "596f27a649c5df3310e945a37a41a957492c0322"}, "set_default": true}' --accountId sputnikv2.testnet
229+
near call sputnikv2.testnet store_contract_metadata '{"code_hash": "GUMFKZP6kdLgy3NjKy1EAkn77AfZFLKkj96VAgjmHXeS", "metadata": {"version": "v3", "commit_id": "596f27a649c5df3310e945a37a41a957492c0322"}, "set_default": true}' --accountId sputnikv2.testnet
230230
```
231231

232232
**5. See all the contract versions stored inside the factory:**
@@ -235,7 +235,7 @@ near view sputnikv2.testnet get_contracts_metadata
235235
```
236236
2 versions should be displayed:
237237
- v2 with commit id `c2cf1553b070d04eed8f659571440b27d398c588` and hash `ZGdM2TFdQpcXrxPxvq25514EViyi9xBSboetDiB3Uiq`
238-
- v3 with commit id `596f27a649c5df3310e945a37a41a957492c0322` and hash `TBD`
238+
- v3 with commit id `596f27a649c5df3310e945a37a41a957492c0322` and hash `GUMFKZP6kdLgy3NjKy1EAkn77AfZFLKkj96VAgjmHXeS`
239239

240240
**6. Try to create a DAO v3 - using Astro DAO:**
241241

@@ -245,3 +245,62 @@ The DAO that gets created should be a brand new v3 DAO.
245245
#### 2.2 Mainnet - using official factory account
246246

247247
The process is very similar with 2.1.
248+
249+
### 4. Existing DAOs will need to migrate from v2 to v3.
250+
251+
Assumptions:
252+
- we are the trying to upgrade `amber.sputnik-dao.near` from v2 to v3
253+
- we have the account id `ctindogaru.near`
254+
255+
1. Open a bash terminal and login to your near account:
256+
257+
```bash
258+
export NEAR_ENV=mainnet
259+
```
260+
261+
```bash
262+
near login
263+
```
264+
265+
2. Clone the sputnik repo and go to the v3 snapshot of the code.
266+
267+
```bash
268+
git clone https://github.com/near-daos/sputnik-dao-contract && cd sputnik-dao-contract
269+
```
270+
271+
```bash
272+
git checkout 596f27a649c5df3310e945a37a41a957492c0322
273+
```
274+
275+
3. Store the DAO code in your DAO.
276+
277+
```bash
278+
BYTES='cat sputnikdao2/res/sputnikdao2.wasm | base64'
279+
```
280+
281+
```bash
282+
near call amber.sputnik-dao.near store_blob $(eval "$BYTES") --base64 --accountId ctindogaru.near --gas 100000000000000 --amount 10
283+
```
284+
285+
After running the command from above, you should get the following code hash in return: `GUMFKZP6kdLgy3NjKy1EAkn77AfZFLKkj96VAgjmHXeS`. If your result differs from `GUMFKZP6kdLgy3NjKy1EAkn77AfZFLKkj96VAgjmHXeS`, do not proceed further as you could harm your DAO. Ask for help on the telegram group: `SputnikDAO v2.0`.
286+
287+
4. Create an upgrade proposal for your DAO.
288+
289+
Run the following command:
290+
```bash
291+
near call amber.sputnik-dao.near add_proposal '{"proposal": {"description": "Upgrade DAO to v3 version", "kind": {"UpgradeSelf": {"hash": "GUMFKZP6kdLgy3NjKy1EAkn77AfZFLKkj96VAgjmHXeS"}}}}' --accountId ctindogaru.near --amount 1
292+
```
293+
294+
5. Approve the proposal.
295+
296+
Everyone from the DAO should go to `https://app.astrodao.com/dao/amber.sputnik-dao.near/proposals` and approve the proposal.
297+
298+
6. Once the proposal get approved, the upgrade will take place.
299+
300+
7. Now that the upgrade is complete, remove the code from your DAO.
301+
302+
```bash
303+
near call amber.sputnik-dao.near remove_blob '{"hash": "GUMFKZP6kdLgy3NjKy1EAkn77AfZFLKkj96VAgjmHXeS"}' --accountId ctindogaru.near --gas 100000000000000 --amount 10
304+
```
305+
306+
7. Congrats! You're now using the DAO v3.

0 commit comments

Comments
 (0)