diff --git a/publish/src/commands/settle.js b/publish/src/commands/settle.js index d55e144816..603a2e9bce 100644 --- a/publish/src/commands/settle.js +++ b/publish/src/commands/settle.js @@ -139,10 +139,11 @@ const settle = async ({ return []; } console.log(gray('-> Fetching page of results from target', yellow(target.address))); - const pageOfResults = await target.getPastEvents('SynthExchange', { - fromBlock: startingBlock, - toBlock: startingBlock + pageSize - 1, - }); + const pageOfResults = await target.queryFilter( + 'SynthExchange', + startingBlock, + startingBlock + pageSize - 1 + ); startingBlock += pageSize; return [].concat(pageOfResults).concat(await innerFnc()); }; @@ -175,7 +176,7 @@ const settle = async ({ for (const { blockNumber, - returnValues: { account, toCurrencyKey }, + args: [account, , , toCurrencyKey], } of exchanges) { if (cache[account + toCurrencyKey]) continue; cache[account + toCurrencyKey] = true; @@ -273,11 +274,7 @@ const settle = async ({ if (reclaimAmount > 0) { const synth = await Synthetix.synths(toCurrencyKey); - const Synth = new ethers.eth.Contract( - synth, - getSource({ contract: 'Synth' }).abi, - provider - ); + const Synth = new ethers.Contract(synth, getSource({ contract: 'Synth' }).abi, provider); const balance = await Synth.balanceOf(account);