|
| 1 | +# #!/bin/sh |
| 2 | + |
| 3 | +# Execute a hash-only multisig proposal for object_code_deployment::upgrade. Rebuild must match propose_object_upgrade.sh |
| 4 | +# (same oft_fa, named-addresses, package, and jq transform) or the hash will not match. |
| 5 | +# |
| 6 | +# Requires: jq (brew install jq) |
| 7 | +# |
| 8 | +set -e |
| 9 | +set -u |
| 10 | +set -o pipefail |
| 11 | + |
| 12 | +if ! command -v jq >/dev/null 2>&1; then |
| 13 | + echo "jq is required (e.g. brew install jq)" >&2 |
| 14 | + exit 1 |
| 15 | +fi |
| 16 | + |
| 17 | +multisig_address="0x98ebb7985c84a89972022edf391bdaa7d95f061d9742efb3703de368413431e1" |
| 18 | +oft_fa="0x3dfe1ac4574c7dbbe6f1c5ba862de88fc3e7d3cf8eba95ef1abf32b582889e6d" |
| 19 | + |
| 20 | +source ./set_move_env.sh |
| 21 | +set_move_env movement mainnet oft-aptos-move |
| 22 | + |
| 23 | +base_payload="$(mktemp /tmp/oft_object_upgrade_base.XXXXXX.json)" |
| 24 | +payload_file="$(mktemp /tmp/oft_object_upgrade_payload.XXXXXX.json)" |
| 25 | + |
| 26 | +cleanup() { |
| 27 | + rm -f "$base_payload" "$payload_file" |
| 28 | +} |
| 29 | +trap cleanup EXIT |
| 30 | + |
| 31 | +movement move build-publish-payload \ |
| 32 | + --package-dir oft-aptos-move \ |
| 33 | + --named-addresses oft="$oft_fa",oft_admin="$multisig_address" \ |
| 34 | + --json-output-file "$base_payload" \ |
| 35 | + --assume-yes |
| 36 | + |
| 37 | +jq --arg obj "$oft_fa" \ |
| 38 | + '.function_id = "0x1::object_code_deployment::upgrade" | .args += [{"type": "address", "value": $obj}]' \ |
| 39 | + "$base_payload" >"$payload_file" |
| 40 | + |
| 41 | +# Simulate first: append --local. Remove --assume-yes to review gas prompts interactively. |
| 42 | +movement multisig execute-with-payload \ |
| 43 | + --multisig-address "$multisig_address" \ |
| 44 | + --json-file "$payload_file" \ |
| 45 | + --assume-yes \ |
| 46 | + --profile eoa |
| 47 | + |
| 48 | +# movement multisig verify-proposal \ |
| 49 | +# --multisig-address "$multisig_address" \ |
| 50 | +# --sequence-number <N> \ |
| 51 | +# --json-file "$payload_file" \ |
| 52 | +# --profile ops |
0 commit comments