Skip to content

Commit

Permalink
Create free coupons (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
manolisliolios authored Oct 16, 2024
1 parent 7679fbf commit ad8b393
Show file tree
Hide file tree
Showing 3 changed files with 137 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:
- Multi Purpose Operation
- Profits to Treasury
- Transfer Reserved Names
- Bulk Coupons
- Free Coupons
sui_tools_image:
description: 'image reference of sui_tools'
default: 'mysten/sui-tools:mainnet'
Expand Down Expand Up @@ -114,16 +114,16 @@ jobs:
run: |
cd scripts && pnpm ts-node transactions/discount-and-auction-profits.ts
- name: Bulk Coupons
if: ${{ inputs.transaction_type == 'Bulk Coupons' }}
- name: Free Coupons
if: ${{ inputs.transaction_type == 'Free Coupons' }}
env:
NODE_ENV: production
GAS_OBJECT: ${{ inputs.gas_object_id }}
NETWORK: mainnet
ORIGIN: gh_action
RPC_URL: ${{ inputs.rpc }}
run: |
cd scripts && pnpm ts-node transactions/create-bulk-coupons.ts
cd scripts && pnpm ts-node transactions/free-three-digit.ts
- name: Show Transaction Data (To sign)
run: |
Expand Down
99 changes: 99 additions & 0 deletions scripts/transactions/addresses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
[
"0x23f49c47d008a9ec53a82e2f2f69043ede010938d8bd729b07c47a1e094ecdcf",
"0x7f608bbe692ecaa5795a2d85cf9894846dfdb24aab22c98478b18255109e92b4",
"0x335cdbb7ac3692dada6acdff609706c932a57e2352b57700565f71a0e7ec2523",
"0xf1c5704cac70e7d0d92c834d365d77b08bfe1da0645a30957c0c949e6344f0df",
"0x9c21fc706b1453c1bc4255bea8c1b87f041afaaee7c622c98bb4178843f04ee2",
"0xb302c9bf51543ee07bc48fcce8703ed3e5c72040b8ffc46569c31963c99acc6e",
"0xd0f36ac29773c41e44ebdbaafe533483d12aa530bea537bfe65b32161901e74d",
"0xb65c3398e226dbff41aff3e47522301406ddfeda8dbfa2c1e8b7c3ace3cd4f23",
"0xb0e5b03f5c58e02aee550267e006ff10c3d03714c0ae03e369b2cfa117d337ed",
"0x6102d64fa2c935d1064cf61fc6f9bf89b26e7547ee852321d024e15d20bda3e0",
"0x41d436f4f42a2841ebfe1dd8fffc83fe1264b30fb17925edd9e0c821d6dae6ad",
"0xb9b6db62b97cdfd42ce2cf3b02033e232e130428a1f6e1df21b7b37ac56964c2",
"0xf5a6f95e21917272a1e2858211ed6c9d349892db3652c6d3e847a9dc93ed312a",
"0xeea52ef8a78bfc0ea203c84daf1bd7599eb32e8bb2a2eb8f52a47596e1ba93d7",
"0xc5bb2f12e262e76ddbf816b8a261543d604f0afd8c5120a4466d216ca5bff7ff",
"0x825aefef4d7e170a0f91a0324670b2f4a9d6fd9f2e8ef8af857c2274996131a3",
"0xe51afa1dea0e3b73c91235e1670d40e5310cf6ef9882d607de2d7df52bea3c77",
"0xed7ba9119e330d5032637eb573a4078e6c80c2ae17e3c77382a90fc2fe640f92",
"0xbb9faa02f544bdde9a0e4e80aecd12bf7ceb56bcdf4270a55f4ffda13b39ab3b",
"0xed713e5aa1da2a997b474fddaa9e60f7373a6a0d7a00bffd08ffeeea90008707",
"0xc6d327f2aab956d6c4fd66d4996c0ebd578491ebc9529890e80aee7109ed6704",
"0x6e3b59ee4387d92c4f62e91e6e0fc6b29a2054563d1f1b47c8ba621196359af2",
"0xabfc801ba61dcac70d99ebf5d46ba88782becb51da4395e72ab1dd7e0d6aed43",
"0xa60ffa23a5a01f5c505c2154c05b5aba2a6ec7d79974145e802ce0b36818d00b",
"0xab4c5f39c180e142ba675b5f2da896666d6c2f763f7f408f62bf0253ad11449d",
"0x5885bb080c51b72601aefa797a63695d43fb36f8f5a98a580f27c2a822428d1a",
"0xe720432c640fc703546f076cf9c05725b71d12d33ec7d7c8f92bcb2188d76954",
"0xb27c7c6e1974bfbaa522087cd3e4a01da42aff68ec50bb24ca5b42a29ca73661",
"0x3086a4b1e2470735ccb1eb9ddbd28378b66e7b6af1d8a5ec62e973f7834ff839",
"0x4a9f729645a8e943a2607fff0632a2c225f69e6cdae9229a36ab557feefd7be5",
"0x49caa708dc02f10046b58dd8cc91231cefc3479091a6e446f1a655ffaaabb3f3",
"0x10eefc7a3070baa5d72f602a0c89d7b1cb2fcc0b101cf55e6a70e3edb6229f8b",
"0xe22afebc7f8f700cdd6ebdd59b202ec7d1a4f23b30b0655b90c7153e98520ef8",
"0xc23ea8e493616b1510d9405ce05593f8bd1fb30f44f92303ab2c54f6c8680ecb",
"0xb41fcc82fe95e951209b955cf7cfdeb5bbd41346e551636af54f21501b9bfa9e",
"0x7e6b5156d7488111f96507e7e51f1dd13ec7e283d2da38ad1a0a758d5d49b191",
"0xc11485194c99b7b666f1039e453da39c6d74e91a44a03adf644423224a57db5b",
"0xfb92d406dc0cb68a78b1e08b78ebd7ef1c27ca45ed2158cea05167edd61f2a23",
"0xe10e67fa4eb65bc61bfc1848eb53d819a20e0abc35f26b0b75820010df195c2f",
"0x40a698e1fab411a3aedcf88b4d9c88568f76ea6695b3e54738a5728ffdd53939",
"0x2cab99269cf1c7a29b30686d79457f9f5f05ee51f3da5f3ec82da376aaf2f371",
"0x1b6621b208ac613532f8306c6de477a3ff853a00e59795dba6db8035e15858f9",
"0xcaa4e9656f285b64e69929467302c12105364c1ee9cc7091c0cf61a7423dd20f",
"0x5a1f4d90aac55ff178383254478c897dab3ef95df83c6cf7103c42138fa7dc51",
"0xbf034d84d670de64609ef03fff502066a026edfe485bdba578d13dfd29605721",
"0x93476a24428437f243f42fd9a4f3264537f54b570910aa1ed164642f6201dde3",
"0x7c00493930a11ff4757b2276696808eda1fb4d16cee8a614ab140046440f3b00",
"0x8ff357324af78684bcad0b687fce687a4e0db59236ca0ba5af0436d242e7ef90",
"0x8692b886a48553598bcfea72a0a8d5b5a7fe3ee5098e17af448eaddb19cd9225",
"0xbd9d2f9a6b82330c94d513c9b3f64a7e0d0880d4593a0662de93badd461a0b5f",
"0x75bb2ff162e36729bce5f6b40aad0fc6bb0a608a88af75365db16ae7fc397f2a",
"0x2a3ab23fcb05ea048e12791de255ab3a7035ed6e841f542fcbaab55821f8adf3",
"0xc9a48d48a29103c30425b00b6c32d296d77b8ff1b35b811f92dbe664cd8e7419",
"0x5719302ebaeff1c6350d7dc384d0dbd6969c7e2638965f562086cbdb10094fbd",
"0xdb82d4f408b4233da2cf743b43ed5a38d73c7248dca759e81fc27d2fbcd84281",
"0x2531aa6cdab50812493fb8197f11a9f0d8ac6503ffbe033e68316320a06cc31b",
"0xae1121489ae51730f0e8eed13f95b476d42e104c1f9ebc76458b08780fd2d1de",
"0xdfe4b3a229ca79cabe2796836789a3dda5dd6ff2f641170844d7ae278ef893c1",
"0x6395bba59d8f24c490998bb070c31d599ac009a4219fac739fd16a7af4f0c008",
"0x03d054f153ff7d54f1c240fc3006258ae19e0fe572fa80496a068703c7d7cb7f",
"0xc2d8a35fe0315a5feeea6f6c485c9d1c540a3e492c28341f93ef0e99f2696c54",
"0x4011de87d584c2366de8d19ada8c45f58577c8332ac4b3e4b94d3bd7b313438b",
"0x7955467e94a10f726a76e318a14a6d23585df8a7295488c9e31dc0af79bff67c",
"0xde936dc5403e34854374c7ef77ec954e1efea35d1f4e4655896f6084fb291bfa",
"0xa289d080a9877650faeabb2201bfc59ffd4e65f33fc6766495314c50f9b73ef7",
"0x8ec0945def230349b2cbd72abd0a91ceb1ca8a4604474d03ef16379414f05a10",
"0x0760564b88d4d86026aec8c4b0ca695187174ac8138cb9e9a37c7837546039cb",
"0x5df57aa04d8a5f65cbabb0928d116997cd6b2f50fdd1537b2fe4485c8b3a5ad1",
"0x5cca45655492f773d13c218a12399dd255c933bb80e1af60c63dd38ef6159a77",
"0x2a25e5d858849bf2af0bf30aaa106bff8cdce25b9ae8ec3acfe1f2c346f30c36",
"0x8948554e99cea7de0909c99131b3a654ac3eeb98b7c949a9153bd81565039eb2",
"0x45d000fb0116b8f1b50699f6e9c3cc0eed1e9da618aec6daa525d668065d2d27",
"0xb196bd9ddf8c38dfcfa94327613a12b5e24851dabc38f40228a1aa0ca654ef6b",
"0xfea3e95fefaae7a4396d65909c4611220de51ee6819098702ccfcf1a87e4f998",
"0x8f7472504821715512572f29b521d10af0b11ecd27f887f6c7a55ad020c184e7",
"0x1bf820c518a88651a213361b760f5c9643b48332d3bea2143ff9b21cfc294410",
"0x6dda3f0b1a3665da60dcebbe0083730fa02edd54d22be5eba8511ef05e392dfa",
"0x3c38f1ebdcd9ff0458b04ab1f7e4ccf30c11d51f571447ab6414d0ed3ca0517f",
"0x7ac44eb36f6665c35a0a8575efdffed35c601a2ad04a6a1268588eb77bea6c62",
"0x172bc3ebe054f146244f72a2db9ae4f2dcbd6d305d8550c6c12c9cd563988f8e",
"0xb695c4adad040c5f1b52ad52bd7e95fca1c9e4e0059a0877d0af4448773e1159",
"0x966f29f8ef597e6d332c26c5f12dd5f4e5de73c668c05412712033b1bd30c813",
"0x20ba23f9fd095df2cb9e35143c8509e9cf4b62d740dc41e29eccdc6df57931bb",
"0xa18831da2e381dcb2ce1f90bc2b1051aec4a534169a01fa000ea72b17ba8923e",
"0x3150c303a49bb035e032b5574d438324528bf3dfecbe85d111d5bf140777568b",
"0xa074a71385cfb9c9f70af6e16d186b10527a51b33e86e340fb8d6899472fb11d",
"0x44030ba67061231fa4e5df77a496f4a8cd17e6ca945fa2d612545101ef20329c",
"0x4bb141100ff650de8fd26a2fba382055d7638be79d44d3323d9a38d0eea6fc27",
"0x0756e106e570d40cec22875d40f2e08986421be6ca7e898e761e97e00720d29b",
"0x465cc42ce767a2726dee3f209ec8f69a64d1d87fa7a1e3f1b825ff0e821fab0b",
"0xfd729a3d165103c396ad0795b139eb0243d2cd5c93aff540db6a8ed5cc1f634f",
"0x914fcdbc2fde90e54c186f09d4de54e32c4af31822e197d5bed9ff4f0452018c",
"0x6a2af7abe002c2b124c10b87f8f3a952415547dd77ca9a778da61503cf682042",
"0x2838dd20d4efb13551a20bcfa5ee7b4251a4d61b5fbe190dc791639585a1557a",
"0x60abbff7388df70e7640afcddc77a0f64b6de4d7eefbc43cb88d9a2839853af7",
"0x6a437f97052538751462e655af09d45a6beb5de1c8da8d548067daf7ae39aad0",
"0x26fd03b7a4509662b4b9918f62a8e57a3b3975a9a672dc3663b51d732e54e036"
]
34 changes: 34 additions & 0 deletions scripts/transactions/free-three-digit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
import { TransactionBlock } from '@mysten/sui.js/transactions';

import { mainPackage } from '../config/constants';
import { PercentageOffCoupon } from '../coupons/coupon';
import { prepareMultisigTx } from '../utils/utils';
import addresses from './addresses.json';

/// Issue free claim coupon for anyone who purchased 3-digit names
/// with full price.
const prepareCoupons = async () => {
const pkg = mainPackage.mainnet;
const tx = new TransactionBlock();

const expiration = `1760691600000`; // 2025 Oct 17 09:00:00 UTC

// Create a free claim coupon for each wallet
for (const wallet of addresses) {
let coupon = new PercentageOffCoupon(100);

coupon.setName(`free-claim-${wallet}`);

coupon.setExpiration(expiration);
coupon.setUser(wallet);
coupon.setAvailableClaims(1);
coupon.setYears([1, 1]);
coupon.toTransaction(tx, pkg);
}

await prepareMultisigTx(tx, 'mainnet', pkg.adminAddress);
};

prepareCoupons();

0 comments on commit ad8b393

Please sign in to comment.