Skip to content

Commit 03cc4ef

Browse files
committed
Set allowance amount to actual amount
1 parent 8a132b4 commit 03cc4ef

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/contracts/erc-20.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Address, maxUint256 } from 'viem'
1+
import { Address } from 'viem'
22
import {
33
readContract,
44
waitForTransactionReceipt,
@@ -43,7 +43,7 @@ export const checkAndSetErc20Allowance = async (
4343
approvalAddress: Address,
4444
amount: bigint,
4545
userAddress: Address,
46-
allowanceAmount = maxUint256,
46+
allowanceAmount = amount,
4747
): Promise<void> => {
4848
// Transactions with the native token don't need approval
4949
if (tokenAddress.toLowerCase() === ROFL_PAYMASTER_NATIVE_TOKEN_ADDRESS) {

0 commit comments

Comments
 (0)