Skip to content

Commit

Permalink
modify scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
agileurbanite committed Dec 12, 2022
1 parent 91dbc47 commit f9a79a8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/upgrade_factory_from_dao.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ near call $FACTORY_ACCOUNT_ID set_owner '{"owner_id":"'$GENDAO'"}' --accountId $
# Store the code data
export FACTORYCODE='cat sputnikdao_factory2.wasm | base64'
# - most likely need to use near-cli-rs due to wasm string size limit
echo '{ "proposal": { "description": "Store upgrade", "kind": { "FunctionCall": { "receiver_id": "'$CONTRACT_ID'", "actions": [ { "method_name": "store", "args": "'$(eval $FACTORYCODE)'", "deposit": "'$BYTE_STORAGE_COST'", "gas": "'$GAS_150_TGAS'" } ]}}}}' | base64 | pbcopy
# Store blob in DAO
echo '{ "proposal": { "description": "Store upgrade", "kind": { "FunctionCall": { "receiver_id": "'$GENDAO'", "actions": [ { "method_name": "store_blob", "args": "'$(eval $FACTORYCODE)'", "deposit": "'$BYTE_STORAGE_COST'", "gas": "'$GAS_150_TGAS'" } ]}}}}' | base64 | pbcopy
# near call $GENDAO store $(eval "$FACTORYCODE") --base64 --accountId $FACTORY_ACCOUNT_ID --gas $GAS_100_TGAS --amount 10 > new_factory_hash.txt
# Once proposal created on Genesis DAO that is owner of factory account now, vote on it so that it can act_proposal storing the new factory code and returning a hash
# Vote on proposal
Expand All @@ -99,14 +100,16 @@ near call $GENDAO add_proposal '{
"proposal": {
"description": "Upgrade to new factory hash using local stored code",
"kind": {
"UpgradeFactory": {
"UpgradeRemote": {
"receiver_id": "spudnike.testnet",
"method_name": "upgrade_factory",
"hash": "'$FACTORY_HASH'"
}
}
}
}' --accountId $CONTRACT_ID --amount $BOND_AMOUNT --gas $MAX_GAS
# Vote on proposal
near call $GENDAO act_proposal '{"id": 1, "action" :"VoteApprove"}' --accountId $CONTRACT_ID --gas $MAX_GAS
near call $GENDAO act_proposal '{"id": 2, "action" :"VoteApprove"}' --accountId $CONTRACT_ID --gas $MAX_GAS

# Factory should be pointing to new hash

Expand Down

0 comments on commit f9a79a8

Please sign in to comment.