Skip to content

Commit

Permalink
fix: Don't spread newSafeProps
Browse files Browse the repository at this point in the history
  • Loading branch information
usame-algan committed Sep 23, 2024
1 parent 4e9c787 commit 90c9b77
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/components/new-safe/create/steps/ReviewStep/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,17 @@ const ReviewStep = ({ data, onSubmit, onBack, setStep }: StepRenderProps<NewSafe
[chain, data.owners, data.safeVersion, data.threshold],
)

const safePropsForGasEstimation = useMemo(() => {
return newSafeProps
? {
...newSafeProps,
saltNonce: Date.now().toString(),
}
: undefined
}, [newSafeProps])

// We estimate with a random nonce as we'll just slightly overestimates like this
const { gasLimit } = useEstimateSafeCreationGas(
newSafeProps ? { ...newSafeProps, saltNonce: Date.now().toString() } : undefined,
data.safeVersion,
)
const { gasLimit } = useEstimateSafeCreationGas(safePropsForGasEstimation, data.safeVersion)

const maxFeePerGas = gasPrice?.maxFeePerGas
const maxPriorityFeePerGas = gasPrice?.maxPriorityFeePerGas
Expand Down

0 comments on commit 90c9b77

Please sign in to comment.