Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions publish/src/commands/settle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
};
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down