Skip to content

Commit

Permalink
single ptb
Browse files Browse the repository at this point in the history
  • Loading branch information
leecchh committed Oct 3, 2024
1 parent 3ca1c37 commit 168b0a5
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions scripts/transactions/create-bulk-coupons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function generateRandomString(length: number) {
return result;
}

const mso89 = async () => {
const create = async () => {
const pkg = mainPackage.mainnet;

const tx = new TransactionBlock();
Expand Down Expand Up @@ -83,32 +83,25 @@ const mso89 = async () => {
),
);

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

const mso99 = async () => {
const pkg = mainPackage.mainnet;

const tx = new TransactionBlock();
const lengthRange = optionalRangeConstructor(tx, pkg, [3, 3]);
const yearsRange = optionalRangeConstructor(tx, pkg, [1, 1]);
const lengthRange2 = optionalRangeConstructor(tx, pkg, [3, 3]);
const yearsRange2 = optionalRangeConstructor(tx, pkg, [1, 1]);

const rules = newCouponRules(
const rules2 = newCouponRules(
tx,
pkg,
{
expiration: "1729656000000",
},
lengthRange,
yearsRange,
lengthRange2,
yearsRange2,
);

const unlimitedCoupon = [];

// create 30% coupons for 3 length names
const coupon = generateRandomString(16);
unlimitedCoupon.push(coupon);
new PercentageOffCoupon(30).setName(coupon).toTransaction(tx, pkg, rules);
new PercentageOffCoupon(30).setName(coupon).toTransaction(tx, pkg, rules2);

writeFileSync(
'./tx/coupon.json',
Expand All @@ -124,5 +117,4 @@ const mso99 = async () => {
await prepareMultisigTx(tx, 'mainnet', pkg.adminAddress);
};

mso89();
mso99();
create();

0 comments on commit 168b0a5

Please sign in to comment.