Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Withdraw Funds to ML Treasury #24

Merged
merged 2 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 4 additions & 37 deletions .github/workflows/suins-build-tx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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:
Expand All @@ -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: |
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down
31 changes: 31 additions & 0 deletions scripts/transactions/withdraw_funds_20290927.ts
Original file line number Diff line number Diff line change
@@ -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';
jnaulty marked this conversation as resolved.
Show resolved Hide resolved

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();
Empty file added scripts/tx/.gitkeep
Empty file.