From f2d5c85dc086acee96ec1c4cdbaca1042df5c524 Mon Sep 17 00:00:00 2001 From: Manolis Liolios Date: Wed, 27 Sep 2023 17:18:20 +0300 Subject: [PATCH 1/2] Add tx & gh action + move airdrop data to separate folder to make action data smaller --- .github/workflows/suins-build-tx.yaml | 41 ++----------------- scripts/{tx => data}/mainnet_airdrop.txt | 0 scripts/package.json | 3 +- .../transactions/withdraw_funds_20290927.ts | 31 ++++++++++++++ 4 files changed, 36 insertions(+), 39 deletions(-) rename scripts/{tx => data}/mainnet_airdrop.txt (100%) create mode 100644 scripts/transactions/withdraw_funds_20290927.ts diff --git a/.github/workflows/suins-build-tx.yaml b/.github/workflows/suins-build-tx.yaml index 86f67239..4a3088fb 100644 --- a/.github/workflows/suins-build-tx.yaml +++ b/.github/workflows/suins-build-tx.yaml @@ -8,12 +8,9 @@ on: description: 'select transaction type to create' type: choice options: - - Update Display to Google Storage + - Withdraw Auction Profits - Transfer Reserved Names - Main package upgrade - - Disable BOGO App - - Publish Registration Package - - Migrate to Direct Registrations sui_tools_image: description: 'image reference of sui_tools' default: 'mysten/sui-tools:mainnet' @@ -96,36 +93,6 @@ jobs: run: | cd scripts && pnpm transactions::main_package::upgrade - - name: Publish Registration Package - if: ${{ inputs.transaction_type == 'Publish Registration Package' }} - env: - NODE_ENV: production - GAS_OBJECT: ${{ inputs.gas_object_id }} - NETWORK: mainnet - ORIGIN: gh_action - run: | - cd scripts && pnpm transactions::registration::publish - - - name: Disable DayOne BOGO Deal - if: ${{ inputs.transaction_type == 'Disable BOGO App' }} - env: - NODE_ENV: production - GAS_OBJECT: ${{ inputs.gas_object_id }} - NETWORK: mainnet - ORIGIN: gh_action - run: | - cd scripts && pnpm migrations::day_one::deauthorize - - - name: Migrate to direct registrations - if: ${{ inputs.transaction_type == 'Migrate to Direct Registrations' }} - env: - NODE_ENV: production - GAS_OBJECT: ${{ inputs.gas_object_id }} - NETWORK: mainnet - ORIGIN: gh_action - run: | - cd scripts && pnpm migrations::registration::transition - - name: Transfer Reserved Names if: ${{ inputs.transaction_type == 'Transfer Reserved Names' }} env: @@ -136,15 +103,15 @@ jobs: run: | cd scripts && pnpm transfer::names - - name: Update Display to Google Storage - if: ${{ inputs.transaction_type == 'Update Display to Google Storage' }} + - name: Withdraw Auction Profits + if: ${{ inputs.transaction_type == 'Withdraw Auction Profits' }} env: NODE_ENV: production GAS_OBJECT: ${{ inputs.gas_object_id }} NETWORK: mainnet ORIGIN: gh_action run: | - cd scripts && pnpm migrations::images::google-storage + cd scripts && pnpm withdraw:auction:profits - name: Show Transaction Data (To sign) run: | diff --git a/scripts/tx/mainnet_airdrop.txt b/scripts/data/mainnet_airdrop.txt similarity index 100% rename from scripts/tx/mainnet_airdrop.txt rename to scripts/data/mainnet_airdrop.txt diff --git a/scripts/package.json b/scripts/package.json index 6e7deb44..a6427534 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -8,9 +8,8 @@ "transactions::main_package::upgrade": "ts-node transactions/main_package_upgrade.ts", "migrations::day_one::deauthorize": "ts-node transactions/deauthorize_bogo_app.ts", "transactions::registration::publish": "ts-node transactions/publish_registration.ts", - "migrations::registration::transition": "ts-node transactions/deauthorize_auction_authorize_registration.ts", "transfer::names": "ts-node reserved-names/transfer-names.ts", - "migrations::images::google-storage": "ts-node transactions/display_ipfs_to_google_storage.ts" + "withdraw:auction:profits":"ts-node transactions/withdraw_funds_20290927.ts" }, "keywords": [], "author": "", diff --git a/scripts/transactions/withdraw_funds_20290927.ts b/scripts/transactions/withdraw_funds_20290927.ts new file mode 100644 index 00000000..899df47b --- /dev/null +++ b/scripts/transactions/withdraw_funds_20290927.ts @@ -0,0 +1,31 @@ +// Copyright (c) 2023, Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { TransactionBlock } from '@mysten/sui.js'; +import { mainPackage } from '../config/constants'; +import { prepareMultisigTx } from '../airdrop/helper'; + +/// MystenLabs treasury address. +const ADDRESS_TO_TRANSFER_FUNDS = + '0x638791b625c4482bc1b917847cdf8aa76fe226c0f3e0a9b1aa595625989e98a1'; + +const craftTx = async () => { + const txb = new TransactionBlock(); + const config = mainPackage.mainnet; + + const adminCapObj = txb.object(config.adminCap); + + // Auction house profits. + const auctionProfits = txb.moveCall({ + target: `${config.packageId}::auction::admin_withdraw_funds`, + arguments: [adminCapObj, txb.object('0x2588e11685b460c725e1dc6739a57c483fcd23977369af53d432605225e387f9')], + }); + + txb.transferObjects( + [auctionProfits], + txb.pure(ADDRESS_TO_TRANSFER_FUNDS, 'address'), + ); + await prepareMultisigTx(txb, 'mainnet'); +}; + +craftTx(); From 62d32584528954451282efe39427990aa525e1a5 Mon Sep 17 00:00:00 2001 From: Manolis Liolios Date: Wed, 27 Sep 2023 17:20:23 +0300 Subject: [PATCH 2/2] Maintain tx folder --- scripts/tx/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 scripts/tx/.gitkeep diff --git a/scripts/tx/.gitkeep b/scripts/tx/.gitkeep new file mode 100644 index 00000000..e69de29b