Skip to content

Commit d963fc6

Browse files
committed
fix(issuer): improve header checking and fix sample
1 parent 408be0c commit d963fc6

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

packages/polymath-issuer/public/whitelist-sample.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Address,Sale Lockup,Purchase Lockup,KYC/AML Expiry,Can Buy From STO,Exempt From % Ownership,Is Accredited,Non-Accredited Limit
1+
ETH Address,Sell Restriction Date,Buy Restriction Date,KYC/AML Expiry Date,Can Buy From STO,Exempt From % Ownership,Is Accredited,Non-Accredited Limit
22
0x592E80AD45c08aba6C5bBd2d5C5A097BDF35Dee1,1/1/22,6/4/24,1/1/21,TRUE,TRUE,TRUE,
33
0xd9f346Bf88cA2cb7e11B0106018DE80A0169764D,12/21/30,12/21/30,10/10/24,TRUE,,TRUE,
44
0xA1833Cd1a3e72335DE0b6945b5d83247F234d6e8,,,12/1/25,,TRUE,,1000

packages/polymath-issuer/src/actions/compliance.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ export const exportWhitelist = () => async (
238238

239239
// eslint-disable-next-line max-len
240240
let csvContent =
241-
'Address,Sale Lockup,Purchase Lockup,KYC/AML Expiry,Can Buy From STO,Exempt From % Ownership';
241+
'ETH Address,Sell Restriction Date,Buy Restriction Date,KYC/AML Expiry Date,Can Buy From STO,Exempt From % Ownership,Is Accredited,Non-Accredited Limit';
242242

243243
if (sto.stage === STAGE_OVERVIEW && sto.details.type === 'USDTieredSTO') {
244244
csvContent += ',Is Accredited,Non-Accredited Limit';

packages/polymath-issuer/src/utils/parsers/index.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,17 @@ const checkCSVHeaders = data => {
8787
// Split the input into lines
8888
let rows = data.split('\n');
8989
const header_row = rows[0].split(',');
90-
const default_headers =
91-
'Address,Sale Lockup,Purchase Lockup,KYC/AML Expiry,Can Buy From STO,Exempt From % Ownership';
90+
const required_keywords =
91+
'ETH Address,Sell Restriction Date,Buy Restriction Date,KYC/AML Expiry Date,Can Buy From STO,Exempt From % Ownership';
9292
let errorMsg = false;
93-
const cells = default_headers.split(',');
94-
for (let i = 1; i < cells.length; i++) {
93+
const cells = required_keywords.split(',');
94+
for (let i = 0; i < cells.length; i++) {
9595
const result = header_row.includes(cells[i]);
9696
if (!result) {
97-
errorMsg = 'The header row is missing fields';
97+
errorMsg =
98+
"The header row is missing or has misspelt the field '" +
99+
cells[i] +
100+
"'";
98101
break;
99102
}
100103
}

0 commit comments

Comments
 (0)