Skip to content

Commit a3766ef

Browse files
Format Rust code using rustfmt
1 parent aa7ffcf commit a3766ef

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

src/wallet.rs

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2479,10 +2479,10 @@ impl UserOperationBuilder {
24792479
signer,
24802480
provider,
24812481
)?;
2482-
2482+
24832483
// Set the combined paymaster and data
24842484
self.paymaster_and_data = paymaster_data;
2485-
2485+
24862486
Ok(self)
24872487
}
24882488
}
@@ -2696,19 +2696,19 @@ pub fn encode_usdc_paymaster_data_with_signer<S: Signer>(
26962696
// - address: USDC token address
26972697
// - uint256: permit amount
26982698
// - bytes: permit signature
2699-
2699+
27002700
// Mode byte (0 for permit mode)
27012701
data.push(0u8);
2702-
2702+
27032703
// Token address (USDC)
27042704
data.extend_from_slice(token_address.as_slice());
2705-
2705+
27062706
// Permit amount - use max_cost which should cover gas
27072707
data.extend_from_slice(&max_cost.to_be_bytes::<32>());
2708-
2708+
27092709
// Get current nonce for the TBA from USDC contract
27102710
let nonce = get_usdc_permit_nonce(&token_address.to_string(), tba_address, provider)?;
2711-
2711+
27122712
// Generate permit data
27132713
let deadline = U256::from(u64::MAX); // Max deadline
27142714
let permit_data = PermitData {
@@ -2718,19 +2718,15 @@ pub fn encode_usdc_paymaster_data_with_signer<S: Signer>(
27182718
nonce,
27192719
deadline,
27202720
};
2721-
2721+
27222722
// Generate the actual permit signature
27232723
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+
27312727
// Add the real permit signature
27322728
data.extend_from_slice(&permit_signature);
2733-
2729+
27342730
Ok(data)
27352731
}
27362732

@@ -2751,22 +2747,22 @@ pub fn encode_usdc_paymaster_data(
27512747
// - address: USDC token address
27522748
// - uint256: permit amount
27532749
// - bytes: permit signature (dummy for now)
2754-
2750+
27552751
// Mode byte (0 for permit mode)
27562752
data.push(0u8);
2757-
2753+
27582754
// Token address (USDC)
27592755
data.extend_from_slice(token_address.as_slice());
2760-
2756+
27612757
// Permit amount - use a reasonable amount for gas payment
27622758
// 10 USDC should be more than enough for any transaction
27632759
let permit_amount = U256::from(10_000_000u64); // 10 USDC in 6 decimal units
27642760
data.extend_from_slice(&permit_amount.to_be_bytes::<32>());
2765-
2761+
27662762
// Permit signature - DUMMY SIGNATURE
27672763
// In production, this needs to be a real EIP-2612 permit signature
27682764
let dummy_signature = vec![0u8; 65]; // r (32) + s (32) + v (1)
27692765
data.extend_from_slice(&dummy_signature);
2770-
2766+
27712767
data
27722768
}

0 commit comments

Comments
 (0)