Skip to content

Commit

Permalink
fix(merkle-distributor-injestor): fix a small bug and typo (UMAprotoc…
Browse files Browse the repository at this point in the history
…ol#2745)

* Added fixes

Signed-off-by: Christopher Maree <[email protected]>

* Fix key-index

Signed-off-by: Christopher Maree <[email protected]>
  • Loading branch information
chrismaree authored Mar 22, 2021
1 parent 1d5de23 commit 52fba46
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/merkle-distributor/scripts/0_MerklePayoutIngestor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
// the `-i` flag. See the example execution for the KPI options token-distribution below.

// ts-node ./scripts/0_MerklePayoutIngestor.ts --input ../../outputs/governance_recipients.json ../../outputs/uma_holder_recipients.json \
// ../../outputs/uma_user_recipients.json -- key null null null -- d 18 18 18 -- reason "KPI Options drop 1: Governance Recipient" \
// "KPI Options drop1: UMA Token Holder" "KPI Options drop1: UMA User" -- rewardToken 0x47B1EE6d02af0AA5082C90Ea1c2c14c70399186c -- chainId 42 -- windowIndex 0
// ../../outputs/uma_user_recipients.json --key null null null --decimals 18 18 18 --reason "KPI Options drop 1: Governance Recipient" \
// "KPI Options drop1: UMA Token Holder" "KPI Options drop1: UMA User" --rewardToken 0x47B1EE6d02af0AA5082C90Ea1c2c14c70399186c --chainId 42 --windowIndex 0

import assert from "assert";
import path from "path";
Expand Down Expand Up @@ -60,9 +60,9 @@ async function main() {
for (let i = 0; i < o.input.length; i++) {
const inputFile = JSON.parse(fs.readFileSync(o.input[i], { encoding: "utf8" }));

// Fetch the recipients from the input file. The key donates the identifier within the input file. if this is null
// Fetch the recipients from the input file. The key donates the identifier within the input file. If this is null
// then the input file has no nested structures and only contains the recipients.
const recipients = o.key == "null" ? inputFile[o.key] : inputFile;
const recipients = o.key[i] == "null" ? inputFile : inputFile[o.key[i]];
Object.keys(recipients).forEach((recipientAddress: string) => {
const checkSumRecipientAddress = toChecksumAddress(recipientAddress); // Ensure consistent address case

Expand Down

0 comments on commit 52fba46

Please sign in to comment.