@@ -2479,10 +2479,10 @@ impl UserOperationBuilder {
2479
2479
signer,
2480
2480
provider,
2481
2481
) ?;
2482
-
2482
+
2483
2483
// Set the combined paymaster and data
2484
2484
self . paymaster_and_data = paymaster_data;
2485
-
2485
+
2486
2486
Ok ( self )
2487
2487
}
2488
2488
}
@@ -2696,19 +2696,19 @@ pub fn encode_usdc_paymaster_data_with_signer<S: Signer>(
2696
2696
// - address: USDC token address
2697
2697
// - uint256: permit amount
2698
2698
// - bytes: permit signature
2699
-
2699
+
2700
2700
// Mode byte (0 for permit mode)
2701
2701
data. push ( 0u8 ) ;
2702
-
2702
+
2703
2703
// Token address (USDC)
2704
2704
data. extend_from_slice ( token_address. as_slice ( ) ) ;
2705
-
2705
+
2706
2706
// Permit amount - use max_cost which should cover gas
2707
2707
data. extend_from_slice ( & max_cost. to_be_bytes :: < 32 > ( ) ) ;
2708
-
2708
+
2709
2709
// Get current nonce for the TBA from USDC contract
2710
2710
let nonce = get_usdc_permit_nonce ( & token_address. to_string ( ) , tba_address, provider) ?;
2711
-
2711
+
2712
2712
// Generate permit data
2713
2713
let deadline = U256 :: from ( u64:: MAX ) ; // Max deadline
2714
2714
let permit_data = PermitData {
@@ -2718,19 +2718,15 @@ pub fn encode_usdc_paymaster_data_with_signer<S: Signer>(
2718
2718
nonce,
2719
2719
deadline,
2720
2720
} ;
2721
-
2721
+
2722
2722
// Generate the actual permit signature
2723
2723
let chain_id = provider. chain_id ;
2724
- let permit_signature = generate_eip2612_permit_signature (
2725
- & permit_data,
2726
- token_address,
2727
- chain_id,
2728
- signer,
2729
- ) ?;
2730
-
2724
+ let permit_signature =
2725
+ generate_eip2612_permit_signature ( & permit_data, token_address, chain_id, signer) ?;
2726
+
2731
2727
// Add the real permit signature
2732
2728
data. extend_from_slice ( & permit_signature) ;
2733
-
2729
+
2734
2730
Ok ( data)
2735
2731
}
2736
2732
@@ -2751,22 +2747,22 @@ pub fn encode_usdc_paymaster_data(
2751
2747
// - address: USDC token address
2752
2748
// - uint256: permit amount
2753
2749
// - bytes: permit signature (dummy for now)
2754
-
2750
+
2755
2751
// Mode byte (0 for permit mode)
2756
2752
data. push ( 0u8 ) ;
2757
-
2753
+
2758
2754
// Token address (USDC)
2759
2755
data. extend_from_slice ( token_address. as_slice ( ) ) ;
2760
-
2756
+
2761
2757
// Permit amount - use a reasonable amount for gas payment
2762
2758
// 10 USDC should be more than enough for any transaction
2763
2759
let permit_amount = U256 :: from ( 10_000_000u64 ) ; // 10 USDC in 6 decimal units
2764
2760
data. extend_from_slice ( & permit_amount. to_be_bytes :: < 32 > ( ) ) ;
2765
-
2761
+
2766
2762
// Permit signature - DUMMY SIGNATURE
2767
2763
// In production, this needs to be a real EIP-2612 permit signature
2768
2764
let dummy_signature = vec ! [ 0u8 ; 65 ] ; // r (32) + s (32) + v (1)
2769
2765
data. extend_from_slice ( & dummy_signature) ;
2770
-
2766
+
2771
2767
data
2772
2768
}
0 commit comments