Skip to content

Commit

Permalink
update: clock version
Browse files Browse the repository at this point in the history
  • Loading branch information
EasonC13 committed Aug 9, 2023
1 parent 3b4b54f commit 63a5f96
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
14 changes: 13 additions & 1 deletion src/lib/config.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,19 @@ RafflePackageIdV2['testnet'] =
RafflePackageIdV2['mainnet'] =
'0xa8ff9a23c6cfb36fb141585a5843be000e40a5424a868ce04aa42d5a25a11a70';

export let RafflePackageIds = [RafflePackageIdV2, RafflePackageId];
// V3
export let RafflePackageIdV3 = Object();
RafflePackageIdV3['testnet'] =
'0x5698f5889daf24a5edd0a197b99fe3abf67dec3a609c0b7d8c9e2a76fc5a9fbd';

RafflePackageIdV3['mainnet'] =
'0xc2355f7f321618e1c791cdd31fb5fae5b44c450424d1634b9b0cc3d94ae5dc3a';

export let RafflePackageIds = [
RafflePackageIdV3,
RafflePackageIdV2,
RafflePackageId,
];
export let CoinMetadatas = Object();

export let DefaultAddresses = `0x04d626ce8938318165fab01491095329aee67fd017a4a17fe2c981b8a9a569cc
Expand Down
8 changes: 8 additions & 0 deletions src/lib/constants.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Inputs } from '@mysten/sui.js';

export const CLOCK_OBJECT = Inputs.SharedObjectRef({
objectId:
'0x0000000000000000000000000000000000000000000000000000000000000006',
mutable: false,
initialSharedVersion: 1,
});
3 changes: 2 additions & 1 deletion src/lib/moveCallCreateCoinRaffle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { TransactionBlock } from '@mysten/sui.js';
import { getNetwork } from './getNetwork';
import { RafflePackageIds } from './config';
let RafflePackageId = RafflePackageIds[0];
import { CLOCK_OBJECT } from './constants';
import getSuiProvider from '../lib/getSuiProvider';
import { CoinMetadatas } from '../lib/config';
import { updateCoinMetadatas } from '@/lib/updateCoinMetadatas';
Expand Down Expand Up @@ -75,7 +76,7 @@ export let moveCallCreateCoinRaffle = async ({
typeArguments: [coin_type],
arguments: [
tx.pure(Array.from(new TextEncoder().encode(raffleName)), 'vector<u8>'),
tx.pure(round, 'u64'),
tx.object(CLOCK_OBJECT),
tx.pure(addresses, 'vector<address>'),
tx.pure(parseInt(winnerCount), 'u64'),
coinInput,
Expand Down
6 changes: 4 additions & 2 deletions src/lib/moveCallCreateNFTRaffle.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { TransactionBlock } from '@mysten/sui.js';
import { getNetwork } from './getNetwork';
import { RafflePackageId } from './config';
import { RafflePackageIds } from './config';
let RafflePackageId = RafflePackageIds[0];
import { CLOCK_OBJECT } from './constants';
import getSuiProvider from './getSuiProvider';
import { CoinMetadatas } from './config';
import { updateCoinMetadatas } from '@/lib/updateCoinMetadatas';
Expand Down Expand Up @@ -40,7 +42,7 @@ export let moveCallCreateNFTRaffle = async ({
typeArguments: [NFTs[0].data.type],
arguments: [
tx.pure(Array.from(new TextEncoder().encode(raffleName)), 'vector<u8>'),
tx.pure(round, 'u64'),
tx.object(CLOCK_OBJECT),
tx.pure(addresses, 'vector<address>'),
tx.makeMoveVec({ objects: NFTs_input }),
// tx.pure(), 'u64'),
Expand Down
4 changes: 3 additions & 1 deletion src/lib/moveCallSettleNFTRaffle.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { TransactionBlock } from '@mysten/sui.js';
import { getNetwork } from './getNetwork';
import { RafflePackageId } from './config';

import { RafflePackageIds } from './config';
let RafflePackageId = RafflePackageIds[0];
import { hexToUint8Array } from './hexToUint8Array';
import { getRaffleFields } from './getRaffleFields';
import { sleep } from './sleep';
Expand Down

0 comments on commit 63a5f96

Please sign in to comment.