File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -233,9 +233,7 @@ export async function deployContract(
233233 const symbol = String ( tokensNeeded ) . split ( ' ' ) [ 1 ]
234234 const currentBalance = ramInfo . tokenBalance . value || 0
235235 const shortfall = tokensNeeded . value - currentBalance
236- const amountToSend = Asset . from (
237- `${ ( shortfall * 1.1 ) . toFixed ( 4 ) } ${ symbol } ` // Add 10% buffer
238- )
236+ const amountToSend = Asset . from ( `${ ( shortfall * 1.01 ) . toFixed ( 4 ) } ${ symbol } ` )
239237
240238 console . log (
241239 `\n❌ Insufficient funds! Need approximately ${ amountToSend } more ${ symbol } `
@@ -251,7 +249,7 @@ export async function deployContract(
251249
252250 displayQRCode ( uri , `💰 Send ${ amountToSend } to ${ accountName } ` )
253251
254- // Poll for balance
252+ // Poll for balance - only wait for the actual amount needed (not the buffered amount)
255253 const targetBalance = Asset . from ( `${ tokensNeeded . value . toFixed ( 4 ) } ${ symbol } ` )
256254 const received = await waitForBalance (
257255 analysisClient ,
@@ -290,10 +288,9 @@ export async function deployContract(
290288 console . log ( ` Estimated cost: ${ ramInfo . costInTokens } ` )
291289
292290 if ( ! options . yes ) {
291+ const ramAmount = formatBytes ( ramInfo . ramToBuy )
293292 const proceed = await promptConfirmation (
294- `\nPurchase ${ formatBytes ( ramInfo . ramToBuy ) } of RAM for ~${
295- ramInfo . costInTokens
296- } ?`
293+ `\nPurchase ${ ramAmount } of RAM for ~${ ramInfo . costInTokens } ?`
297294 )
298295
299296 if ( ! proceed ) {
You can’t perform that action at this time.
0 commit comments