Skip to content

Commit

Permalink
add a note about waiting on transactions using the simple method
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckbergeron committed Jul 5, 2023
1 parent 99db90d commit 78f5903
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/library/src/claimerProfitablePrizeTxs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,16 @@ export async function executeClaimerProfitablePrizeTxs(

console.log(chalk.greenBright.bold('Transaction sent! ✔'));
console.log(chalk.blueBright.bold('Transaction hash:', tx.hash));

// NOTE: This uses a naive method of waiting for the tx since OZ Defender can
// re-submit transactions, effectively giving them different tx hashes
// It is likely good enough for these types of transactions but could cause
// issues if there are a lot of failures or gas price issues
// See querying here:
// https://github.com/OpenZeppelin/defender-client/tree/master/packages/relay#querying-transactions
console.log('Waiting on transaction to be confirmed ...');
await readProvider.waitForTransaction(tx.hash);
console.log('Tx confirmed !');
} else {
console.log(
chalk.yellow(
Expand Down Expand Up @@ -560,8 +570,8 @@ const getClaimInfo = async (
chalk.dim(`($${nextClaimFeesUsd})`),
);
printSpacer();
console.log(chalk.dim(`if ((nextClaimFeesUsd - claimFeesUsd) > totalCostUsd)`));
console.log(chalk.dim(`($${nextClaimFeesUsd} - $${claimFeesUsd}) > $${totalCostUsd}`));
// console.log(chalk.dim(`if ((nextClaimFeesUsd - claimFeesUsd) > totalCostUsd)`));
// console.log(chalk.dim(`($${nextClaimFeesUsd} - $${claimFeesUsd}) > $${totalCostUsd}`));

// To push through a non-profitable tx for debugging:
// claimCount = numClaims;
Expand Down

0 comments on commit 78f5903

Please sign in to comment.