@@ -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