Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
0xKurt committed May 2, 2024
1 parent abdaa41 commit d7cc9d4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 31 deletions.
3 changes: 1 addition & 2 deletions packages/builder/src/utils/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ export const formatTimeUTC = (ts: number) => {
export const formatDateFromString = (ts: string) =>
new Date(ts).toLocaleDateString();

export const isInfinite = (number: Number) =>
export const isInfinite = (number: Number): boolean =>
isInfiniteDate(new Date(number.toString()));
// BigInt(number.toString()) === UINT64_MAX || !number;

export const formatDateAsNumber = (ts: string) => Date.parse(ts) / 1000;
5 changes: 5 additions & 0 deletions packages/common/src/allo/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ export const dateToEthereumTimestamp = (date: Date): bigint =>

export const UINT64_MAX = 18446744073709551615n;

export const isInfiniteDate = (roundTime: Date): boolean => {
const UINT_64_MAX_YEAR = 2243;
return roundTime.getFullYear() >= UINT_64_MAX_YEAR;
};

export { NATIVE } from "@allo-team/allo-v2-sdk";
24 changes: 0 additions & 24 deletions packages/round-manager/src/features/api/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { roundImplementationContract, ERC20Contract } from "./contracts";
import { BigNumber } from "ethers";
import { ethers } from "ethers";
import { Signer } from "@ethersproject/abstract-signer";
import { DirectPayoutStrategy__factory } from "../../types/generated/typechain";
import { PayoutToken } from "./payoutTokens";

export const updateApplicationStatuses = async (
Expand All @@ -30,29 +29,6 @@ export const updateApplicationStatuses = async (
};
};

export const updatePayoutApplicationStatuses = async (
payoutStrategyAddress: string,
signer: Signer,
statuses: AppStatus[]
): Promise<{ transactionBlockNumber: number }> => {
const payout = DirectPayoutStrategy__factory.connect(
payoutStrategyAddress,
signer
);

const tx = await payout.setApplicationsInReview(statuses);

const receipt = await tx.wait();

console.log("✅ Transaction hash: ", tx.hash);

const blockNumber = receipt.blockNumber;

return {
transactionBlockNumber: blockNumber,
};
};

export const fundRoundContract = async (
roundId: string,
signer: Signer,
Expand Down
5 changes: 0 additions & 5 deletions packages/round-manager/src/features/api/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,4 @@ export const formatCurrency = (
).toLocaleString("en-US", {
maximumFractionDigits: fraction || 3,
});
};

export const isInfiniteDate = (roundTime: Date) => {
const UINT_64_MAX_YEAR = 2243;
roundTime.getFullYear() >= UINT_64_MAX_YEAR;
};

0 comments on commit d7cc9d4

Please sign in to comment.