Skip to content

Commit

Permalink
fix: do not modify any of the fields of the user operation after the …
Browse files Browse the repository at this point in the history
…paymaster signs over it
  • Loading branch information
LiorAgnin committed Dec 11, 2024
1 parent c5b52da commit 2d86b13
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.1.5"
version: "0.1.6"
vector_math:
dependency: transitive
description:
Expand Down
5 changes: 4 additions & 1 deletion lib/src/4337/wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ class SmartWallet with _PluginManager, _GasSettings implements SmartWalletBase {
@override
Future<UserOperationResponse> sendUserOperation(UserOperation op) =>
prepareUserOperation(op)
.then(applyCustomGasSettings)
.then(signUserOperation)
.then(sendSignedUserOperation);

Expand All @@ -158,6 +157,10 @@ class SmartWallet with _PluginManager, _GasSettings implements SmartWalletBase {
{bool update = true}) async {
// Update the user operation with the latest nonce and gas prices if needed
if (update) op = await _updateUserOperation(op);

// Apply custom gas settings
op = applyCustomGasSettings(op);

// If the 'paymaster' plugin is enabled, intercept the user operation
if (hasPlugin('paymaster')) {
op = await plugin<Paymaster>('paymaster').intercept(op);
Expand Down

0 comments on commit 2d86b13

Please sign in to comment.