Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions packages/polymath-issuer/public/whitelist-sample.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ETH Address,Sell Restriction Date,Buy Restriction Date,KYC/AML Expiry Date,Can Buy From STO,Exempt From % Ownership,Is Accredited,Non-Accredited Limit
0x592E80AD45c08aba6C5bBd2d5C5A097BDF35Dee1,1/1/22,6/4/24,1/1/21,TRUE,TRUE,TRUE,
0xd9f346Bf88cA2cb7e11B0106018DE80A0169764D,12/21/30,12/21/30,10/10/24,TRUE,,TRUE,
0xA1833Cd1a3e72335DE0b6945b5d83247F234d6e8,,,12/1/25,,TRUE,,1000
0x07889A89C6854bb4Ec445825E680255b17751192,,,12/1/25,TRUE,TRUE,,
0x592E80AD45c08aba6C5bBd2d5C5A097BDF35Dee1,1/1/2022,6/4/2024,1/1/2021,TRUE,TRUE,TRUE,
0xd9f346Bf88cA2cb7e11B0106018DE80A0169764D,12/21/2030,12/21/2030,10/10/2024,TRUE,,TRUE,
0xA1833Cd1a3e72335DE0b6945b5d83247F234d6e8,,,12/1/2025,,TRUE,,1000
0x07889A89C6854bb4Ec445825E680255b17751192,,,12/1/2025,TRUE,TRUE,,
8 changes: 2 additions & 6 deletions packages/polymath-issuer/src/utils/parsers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,8 @@ export function parseWhitelistCsv(file: string) {
return false;
}
if (value.split('/').length === 3) {
let resultDate = moment(value, ['MM/DD/YY', 'MM/DD/YYYY']).toDate();
const year = value.split(/\/|-/)[2];
if (year.length === 2 && resultDate.getFullYear() < 2000) {
resultDate.setFullYear(resultDate.getFullYear() + 100);
}
return resultDate;
const regex = /\d\d?\/\d\d?\/\d{4}/;
return regex.test(value) && moment(value, 'M/D/YYYY').toDate();
}
if (numericalRegex.test(value)) {
return new BigNumber(value);
Expand Down
8 changes: 4 additions & 4 deletions packages/polymath-issuer/testUtils/fixtures/csvFiles.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export const validWhitelistCsv = `\
ETH Address,Sell Restriction Date,Buy Restriction Date,KYC/AML Expiry Date,Can Buy From STO,Exempt From % Ownership,Is Accredited,Non-Accredited Limit
0x592E80AD45c08aba6C5bBd2d5C5A097BDF35Dee1,1/1/22,6/4/24,1/1/21,TRUE,TRUE,FALSE,
0xd9f346Bf88cA2cb7e11B0106018DE80A0169764D,12/21/30,12/21/30,10/10/24,TRUE,,TRUE,
0xA1833Cd1a3e72335DE0b6945b5d83247F234d6e8,,,12/1/25,,TRUE,,1000
0x07889A89C6854bb4Ec445825E680255b17751192,,,12/1/25,TRUE,TRUE,,
0x592E80AD45c08aba6C5bBd2d5C5A097BDF35Dee1,1/1/2022,6/4/2024,1/1/2021,TRUE,TRUE,FALSE,
0xd9f346Bf88cA2cb7e11B0106018DE80A0169764D,12/21/2030,12/21/2030,10/10/2024,TRUE,,TRUE,
0xA1833Cd1a3e72335DE0b6945b5d83247F234d6e8,,,12/1/2025,,TRUE,,1000
0x07889A89C6854bb4Ec445825E680255b17751192,,,12/1/2025,TRUE,TRUE,,
`;

export const invalidWhitelistCsv = `\
Expand Down