Skip to content

Commit

Permalink
Merge pull request #25 from sablier-labs/feat/checksum-csv-addresses
Browse files Browse the repository at this point in the history
Feat: add checksum preprocessing
  • Loading branch information
gavriliumircea committed Dec 15, 2023
2 parents 37f8701 + ee009ec commit 7c0dc5e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/csv_campaign_parser.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use csv::Reader;
use ethers_rs::{Address, Eip55};
use regex::Regex;
use serde::{Deserialize, Serialize};
use std::{collections::HashSet, error::Error};
Expand Down Expand Up @@ -101,7 +102,10 @@ impl CampaignCsvParsed {
total_amount += padded_amount;
number_of_recipients += 1;
unique_addresses.insert(address.clone());
records.push(CampaignCsvRecord { address, amount: padded_amount });
records.push(CampaignCsvRecord {
address: Address::to_checksum_string(&Address::from_str(&address, false).unwrap()),
amount: padded_amount,
});
}
}

Expand Down

0 comments on commit 7c0dc5e

Please sign in to comment.