Skip to content

Commit

Permalink
Adds suilink discount (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
manolisliolios authored Aug 1, 2024
1 parent 2fae448 commit 6f4f82e
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/suins-build-tx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- Disable Free Claims
- Profits to Treasury
- Transfer Reserved Names
- Update Display
- SuiLink Discount
sui_tools_image:
description: 'image reference of sui_tools'
default: 'mysten/sui-tools:mainnet'
Expand Down Expand Up @@ -112,15 +112,15 @@ jobs:
run: |
cd scripts && pnpm create-deepbook-pools
- name: Update Display
if: ${{ inputs.transaction_type == 'Update Display' }}
- name: SuiLink Discount
if: ${{ inputs.transaction_type == 'SuiLink Discount' }}
env:
NODE_ENV: production
GAS_OBJECT: ${{ inputs.gas_object_id }}
NETWORK: mainnet
ORIGIN: gh_action
run: |
cd scripts && pnpm ts-node transactions/update-mainnet-display.ts
cd scripts && pnpm ts-node transactions/authorize-suilink-discount.ts
- name: Show Transaction Data (To sign)
run: |
Expand Down
40 changes: 40 additions & 0 deletions scripts/transactions/authorize-suilink-discount.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
import { TransactionBlock } from '@mysten/sui.js/transactions';
import { MIST_PER_SUI } from '@mysten/sui.js/utils';

import { mainPackage } from '../config/constants';
import { setupDiscountForType } from '../config/discounts';
import { prepareMultisigTx } from '../utils/utils';

export const run = async () => {
const txb = new TransactionBlock();

const suiLinkType = (innerType: string) => {
return `0xf857fa9df5811e6df2a0240a1029d365db24b5026896776ddd1c3c70803bccd3::suilink::SuiLink<${innerType}>`;
};

const suilinkSolanaType = suiLinkType(
'0xf857fa9df5811e6df2a0240a1029d365db24b5026896776ddd1c3c70803bccd3::solana::Solana',
);

const ethType = suiLinkType(
'0xf857fa9df5811e6df2a0240a1029d365db24b5026896776ddd1c3c70803bccd3::ethereum::Ethereum',
);

setupDiscountForType(txb, mainPackage.mainnet, suilinkSolanaType, {
threeCharacterPrice: 400n * MIST_PER_SUI,
fourCharacterPrice: 60n * MIST_PER_SUI,
fivePlusCharacterPrice: 10n * MIST_PER_SUI,
});

setupDiscountForType(txb, mainPackage.mainnet, ethType, {
threeCharacterPrice: 400n * MIST_PER_SUI,
fourCharacterPrice: 60n * MIST_PER_SUI,
fivePlusCharacterPrice: 10n * MIST_PER_SUI,
});

await prepareMultisigTx(txb, 'mainnet', mainPackage.mainnet.adminAddress);
};

run();

0 comments on commit 6f4f82e

Please sign in to comment.