Skip to content
This repository was archived by the owner on Dec 24, 2025. It is now read-only.

Commit 11e3b13

Browse files
committed
corrected token
1 parent 82497dd commit 11e3b13

2 files changed

Lines changed: 11 additions & 25 deletions

File tree

src/components/admin/TokenAdmin.tsx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -782,8 +782,6 @@ export function TokenAdmin() {
782782
tokenProposals,
783783
addToWhitelist,
784784
setTransactionLimit,
785-
setTGETime,
786-
createProposal,
787785
approveProposal,
788786
executeProposal,
789787
refetchWhitelistedAddresses,
@@ -877,25 +875,6 @@ export function TokenAdmin() {
877875
}
878876
}
879877

880-
const handleSetTGE = async () => {
881-
try {
882-
setError(null)
883-
setIsSettingTGE(true)
884-
// Convert date string to Unix timestamp
885-
const tgeDate = new Date(formData.tgeTime)
886-
await setTGETime(Math.floor(tgeDate.getTime() / 1000))
887-
// Clear form
888-
setFormData(prev => ({
889-
...prev,
890-
tgeTime: '',
891-
}))
892-
} catch (error: any) {
893-
setError(error.message)
894-
} finally {
895-
setIsSettingTGE(false)
896-
}
897-
}
898-
899878
const handleApproveProposal = async (id: string) => {
900879
try {
901880
setError(null)
@@ -1008,7 +987,6 @@ export function TokenAdmin() {
1008987
const handlers = {
1009988
handleAddToWhitelist,
1010989
handleSetTransactionLimit,
1011-
handleSetTGE,
1012990
handleApproveProposal,
1013991
handleExecuteProposal,
1014992
handleSetQuorum,

src/hooks/useAdminContract.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ export function useAdminContract() {
268268
const events = await publicClient.getLogs({
269269
address: contractAddress,
270270
event: parseAbiItem('event WalletWhitelistedOp(address indexed target, address indexed operator, uint64 whitelistLockTime, uint8 operation)'),
271-
fromBlock: 0n,
271+
fromBlock: BigInt(0),
272272
toBlock: 'latest'
273273
});
274274

@@ -280,11 +280,12 @@ export function useAdminContract() {
280280
for (const event of events) {
281281
const { target, operation } = event.args;
282282
const address = target.toLowerCase();
283+
const opBigInt = operation ? BigInt(operation) : undefined;
283284

284-
if (operation === 1n) {
285+
if (opBigInt === BigInt(1)) {
285286
// Wallet added
286287
whitelistedWallets.set(address, true);
287-
} else if (operation === 2n) {
288+
} else if (opBigInt === BigInt(2)) {
288289
// Wallet removed
289290
whitelistedWallets.delete(address);
290291
}
@@ -708,6 +709,7 @@ export function useAdminContract() {
708709
const setRoleTransactionLimit = async (role: string, limit: bigint) => {
709710
if (!contractAddress) throw new Error('Contract address not found');
710711
if (!userAddress) throw new Error('Please connect your wallet');
712+
if (!publicClient) throw new Error('Public client not found');
711713

712714
try {
713715
const { request } = await publicClient.simulateContract({
@@ -733,6 +735,7 @@ export function useAdminContract() {
733735
const setRoleQuorum = async (role: string, quorum: number) => {
734736
if (!contractAddress) throw new Error('Contract address not found');
735737
if (!userAddress) throw new Error('Please connect your wallet');
738+
if (!publicClient) throw new Error('Public client not found');
736739
if (quorum <= 1) throw new Error('Quorum must be greater than 1');
737740

738741
try {
@@ -793,6 +796,7 @@ export function useAdminContract() {
793796
if (isNaN(quorumValue) || quorumValue < 1 || quorumValue > 65535) {
794797
throw new Error('Quorum must be a number between 1 and 65535');
795798
}
799+
console.log(`setting role quorum for ${role}: ${quorumValue}`)
796800
return setRoleQuorum(role, quorumValue);
797801
} catch (error: any) {
798802
if (error.message) {
@@ -1265,5 +1269,9 @@ export function useAdminContract() {
12651269
bridgeOpEvents,
12661270
transferFromContract,
12671271
isTransferring,
1272+
handleSetRoleTransactionLimit,
1273+
handleSetRoleQuorum,
1274+
checkRoleConfig,
1275+
roleConfigs,
12681276
}
12691277
}

0 commit comments

Comments
 (0)