@@ -77,6 +77,7 @@ export default function Payment({
7777
7878 console . log ( '[Payment]' , {
7979 jobsTotalCost,
80+ allowanceRequired : Math . ceil ( jobsTotalCost * 10 ** 6 ) ,
8081 } ) ;
8182
8283 setTotalCost ( jobsTotalCost ) ;
@@ -280,7 +281,7 @@ export default function Payment({
280281 address : config . usdcContractAddress ,
281282 abi : ERC20Abi ,
282283 functionName : 'approve' ,
283- args : [ escrowContractAddress , BigInt ( totalCost * 10 ** 6 ) ] ,
284+ args : [ escrowContractAddress , BigInt ( Math . ceil ( totalCost * 10 ** 6 ) ) ] ,
284285 } ) ;
285286
286287 const receipt = await watchTx ( txHash , publicClient ) ;
@@ -312,7 +313,7 @@ export default function Payment({
312313 return result ;
313314 } ;
314315
315- const hasEnoughAllowance = ( ) : boolean => allowance !== undefined && allowance >= BigInt ( totalCost * 10 ** 6 ) ;
316+ const hasEnoughAllowance = ( ) : boolean => allowance !== undefined && allowance >= BigInt ( Math . ceil ( totalCost * 10 ** 6 ) ) ;
316317
317318 /**
318319 * Approval is required only if the allowance is less than half of the maximum allowance,
@@ -380,7 +381,7 @@ export default function Payment({
380381
381382 < div className = "row gap-1.5" >
382383 < div className = "text-[19px] font-semibold" >
383- < UsdcValue value = { parseFloat ( totalCost . toFixed ( 2 ) ) . toLocaleString ( ) } />
384+ < UsdcValue value = { parseFloat ( totalCost . toFixed ( 2 ) ) . toLocaleString ( ) } isAproximate />
384385 </ div >
385386
386387 { environment !== 'mainnet' && (
0 commit comments