Skip to content

Commit

Permalink
fix: incorrect nonce math
Browse files Browse the repository at this point in the history
  • Loading branch information
eccentricexit committed May 14, 2020
1 parent ff1790e commit 5ee11c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const deploymentBlock = Number(process.env.FACTORY_BLOCK_NUM) || 0
console.info(`Detected ${tcrs.length} TCRs`)
console.info('Scanning them for pending requests and withdrawals...')
let tcrCount = 1
let nonce = txCount + 1
let nonce = txCount
for (let tcr of tcrs) {
console.info(`Scanning ${tcrCount} of ${tcrs.length}`)

Expand Down
2 changes: 1 addition & 1 deletion src/utils/withdraw-rewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default async function withdrawRewardsRemoveWatchlist(
// every round by a contributor, we avoid withdrawing
// for the same contributor more than once by using a set.
const done = new Set()
let nonce = (await signer.getTransactionCount()) + 1
let nonce = (await signer.getTransactionCount())
for (let contributionEvent of contributionEvents) {
const { values: { _contributor, itemID, _request } } = contributionEvent
if (done.has(_contributor)) return
Expand Down

0 comments on commit 5ee11c8

Please sign in to comment.