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

Disable Q3 discounts #40

Merged
merged 2 commits into from
Nov 13, 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
10 changes: 5 additions & 5 deletions .github/workflows/suins-build-tx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ on:
description: 'select transaction type to create'
type: choice
options:
- Disable Discounts
- Disable Free Claims
- Publish Discounts
- Authorize Discounts
- Withdraw Auction Profits
- Transfer Reserved Names
- Main package upgrade
- Create Deepbook Pools
sui_tools_image:
description: 'image reference of sui_tools'
default: 'mysten/sui-tools:mainnet'
Expand Down Expand Up @@ -146,16 +146,16 @@ jobs:
ORIGIN: gh_action
run: |
cd scripts && pnpm disable-free-claims

- name: Create Deepbook Pools
if: ${{ inputs.transaction_type == 'Create Deepbook Pools' }}
- name: Disable Discounts
if: ${{ inputs.transaction_type == 'Disable Discounts' }}
env:
NODE_ENV: production
GAS_OBJECT: ${{ inputs.gas_object_id }}
NETWORK: mainnet
ORIGIN: gh_action
run: |
cd scripts && pnpm create-deepbook-pools
cd scripts && pnpm disable-discounts

- name: Show Transaction Data (To sign)
run: |
Expand Down
1 change: 1 addition & 0 deletions scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"publish-discounts": "ts-node transactions/publish_discounts.ts",
"authorize-discounts": "ts-node transactions/quest_3_setup.ts",
"disable-free-claims": "ts-node transactions/quest3/disable_free_claims.ts",
"disable-discounts": "ts-node transactions/quest3/disable_discounts.ts",
"create-deepbook-pools": "ts-node transactions/deepbook/create_pools.ts"
},
"keywords": [],
Expand Down
30 changes: 30 additions & 0 deletions scripts/transactions/quest3/disable_discounts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright (c) 2023, Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

import dotenv from "dotenv";
dotenv.config();
import { executeTx, prepareMultisigTx, prepareSigner } from "../../airdrop/helper";
import { Network, mainPackage } from "../../config/constants";
import { TransactionBlock } from "@mysten/sui.js";
import { DAY_ONE_TYPE, SUIFREN_BULLSHARK_TYPE, SUIFREN_CAPY_TYPE, removeDiscountForType } from "../../config/discounts";

const execute = async (network: Network) => {
const setup = mainPackage[network];

const txb = new TransactionBlock();

removeDiscountForType(txb, setup, SUIFREN_BULLSHARK_TYPE[network]);
removeDiscountForType(txb, setup, SUIFREN_CAPY_TYPE[network]);
removeDiscountForType(txb, setup, DAY_ONE_TYPE[network]);

// for mainnet, we prepare the multi-sig tx.
if(network === 'mainnet') return prepareMultisigTx(txb, 'mainnet');

// For testnet, we execute the TX directly.
return executeTx(prepareSigner(setup.provider), txb);
}

if(process.env.NETWORK === 'mainnet') execute('mainnet')
else execute('testnet');