Skip to content

Commit

Permalink
fix some bugs in batch minting script
Browse files Browse the repository at this point in the history
  • Loading branch information
ae2079 committed Jan 15, 2025
1 parent 2df604e commit a103376
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
6 changes: 6 additions & 0 deletions src/scripts/configs.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import path from 'path';

export const streamStartDate = 1730196000; // Oct 29, 2024, 10am GMT
// Des 20th 2024, 10am GMT
export const streamStartDateForQacc = 1734688800; // Dec 20, 2024, 10am GMT
// 182 days is sec
export const SIX_MONTH_IN_SEC_182 = 15724800;
export const streamEndDate = 1793268000; // Oct 29, 2026, 10am GMT
// Des 20th 2025, 10am GMT
export const streamEndDateForQacc = 1766224800; // Dec 20, 2025, 10am GMT
export const streamCliff = 31536000; // 1 year in secs = 365 * 24 * 60 * 60

// The URL of the GitHub repository containing the reports
Expand Down
18 changes: 11 additions & 7 deletions src/scripts/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
/* eslint-disable no-console */
import fs from 'fs-extra';
import { streamCliff, streamEndDate, streamStartDate } from './configs';
import {
SIX_MONTH_IN_SEC_182,
streamCliff,
streamEndDate,
streamEndDateForQacc,
streamStartDate,
streamStartDateForQacc,
} from './configs';
import { AppDataSource } from '../orm';
import { EarlyAccessRound } from '../entities/earlyAccessRound';
import { QfRound } from '../entities/qfRound';

const SIX_MONTH_IN_SEC = 15768000;
const ONE_YEAR_IN_SEC = 31536000;

// Function to ensure directory exists or create it
export function ensureDirectoryExists(dirPath: string) {
if (!fs.existsSync(dirPath)) {
Expand All @@ -25,9 +29,9 @@ export function toScreamingSnakeCase(str: string): string {

export function getStreamDetails(isEarlyAccess: boolean) {
return {
START: streamStartDate,
CLIFF: isEarlyAccess ? streamCliff : SIX_MONTH_IN_SEC,
END: isEarlyAccess ? streamEndDate : streamStartDate + ONE_YEAR_IN_SEC,
START: isEarlyAccess ? streamStartDate : streamStartDateForQacc,
CLIFF: isEarlyAccess ? streamCliff : SIX_MONTH_IN_SEC_182,
END: isEarlyAccess ? streamEndDate : streamEndDateForQacc,
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/scripts/runFundingPotService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ async function fillProjectsData() {
SAFE: project.abc.projectAddress || '',
ORCHESTRATOR: project.abc.orchestratorAddress || '',
NFT: project.abc.nftContractAddress || '',
MATCHING_FUNDS: project.matchingFunds || '',
MATCHING_FUNDS: project.matchingFunds?.toString() || '',
};
} else {
console.warn(
Expand Down

0 comments on commit a103376

Please sign in to comment.