Skip to content

Commit

Permalink
Fix bug in vesting time calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
ae2079 committed Oct 16, 2024
1 parent c581f8c commit 1cd612a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/scripts/syncDataWithJsonReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,17 @@ async function processReportForDonations(

// Fetch the cliff, reward start, and end dates from the InverterAdapter
const vestingInfo = rewardInfo[0]?.vestings.find(
v => v.recipient === donation.fromWalletAddress,
v =>
v.recipient.toLowerCase() ===
donation.fromWalletAddress.toLowerCase(),
);

if (vestingInfo) {
donation.cliff = parseFloat(vestingInfo.cliff);
donation.rewardStreamStart = new Date(parseInt(vestingInfo.start));
donation.rewardStreamEnd = new Date(parseInt(vestingInfo.end));
donation.rewardStreamStart = new Date(
parseInt(vestingInfo.start) * 1000,
);
donation.rewardStreamEnd = new Date(parseInt(vestingInfo.end) * 1000);
if (
String(vestingInfo.amountRaw) !== '0' &&
String(vestingInfo.amountRaw) !==
Expand Down

0 comments on commit 1cd612a

Please sign in to comment.