diff --git a/packages/round-manager/src/constants.ts b/packages/round-manager/src/constants.ts index 917a797ea2..cf6cf4f6a7 100644 --- a/packages/round-manager/src/constants.ts +++ b/packages/round-manager/src/constants.ts @@ -1,3 +1,3 @@ export const errorModalDelayMs = 3000; export const modalDelayMs = 1000; -export const maxDateForUint256 = new Date(8640000000000000); +export const maxDateForUint256 = new Date(8640000000000); diff --git a/packages/round-manager/src/context/application/usePayout.ts b/packages/round-manager/src/context/application/usePayout.ts index 5caa90b388..b1d6074d6e 100644 --- a/packages/round-manager/src/context/application/usePayout.ts +++ b/packages/round-manager/src/context/application/usePayout.ts @@ -1,17 +1,12 @@ -import { Dispatch, SetStateAction, useState } from "react"; import { ProgressStatus, ProgressStep } from "../../features/api/types"; -import { - DirectPayoutStrategy__factory, - Erc20__factory, -} from "../../types/generated/typechain"; -import { BigNumber, ethers } from "ethers"; -import { waitForSubgraphSyncTo } from "../../features/api/subgraph"; +import { Erc20__factory } from "../../types/generated/typechain"; +import { ethers } from "ethers"; import { PayoutToken } from "../../features/api/payoutTokens"; -import { round } from "lodash"; import { Allo } from "common"; import { Hex } from "viem"; import { datadogRum } from "@datadog/browser-rum"; import { datadogLogs } from "@datadog/browser-logs"; +import { useState } from "react"; export function usePayout() { const [contractApproveSpendStatus, setContractApproveSpendStatus] = @@ -48,25 +43,6 @@ export function usePayout() { }, ]; - async function waitForSubgraphToUpdate( - setIndexingStatus: Dispatch>, - signerOrProvider: ethers.Signer, - transactionBlockNumber: number - ) { - try { - setIndexingStatus(ProgressStatus.IN_PROGRESS); - - const chainId = await signerOrProvider.getChainId(); - await waitForSubgraphSyncTo(chainId, transactionBlockNumber); - - setIndexingStatus(ProgressStatus.IS_SUCCESS); - } catch (error) { - console.error("waitForSubgraphToUpdate", error); - setIndexingStatus(ProgressStatus.IS_ERROR); - throw error; - } - } - const resetStatuses = () => { setContractApproveSpendStatus(ProgressStatus.NOT_STARTED); setContractUpdatingStatus(ProgressStatus.NOT_STARTED); diff --git a/packages/round-manager/src/context/program/ReadProgramContext.tsx b/packages/round-manager/src/context/program/ReadProgramContext.tsx index 2de0355c64..eada517e20 100644 --- a/packages/round-manager/src/context/program/ReadProgramContext.tsx +++ b/packages/round-manager/src/context/program/ReadProgramContext.tsx @@ -9,7 +9,6 @@ import { getProgramById, listPrograms } from "../../features/api/program"; import { datadogLogs } from "@datadog/browser-logs"; import { Web3Provider } from "@ethersproject/providers"; import { DataLayer, useDataLayer } from "data-layer"; -import { getAlloVersion } from "common/src/config"; import { useAlloVersion } from "common/src/components/AlloVersionSwitcher"; export interface ReadProgramState { diff --git a/packages/round-manager/src/context/round/RoundContext.tsx b/packages/round-manager/src/context/round/RoundContext.tsx index 649a352baf..1e48796f58 100644 --- a/packages/round-manager/src/context/round/RoundContext.tsx +++ b/packages/round-manager/src/context/round/RoundContext.tsx @@ -4,7 +4,6 @@ import { useWallet } from "../../features/common/Auth"; import { getRoundById, listRounds } from "../../features/api/round"; import { datadogLogs } from "@datadog/browser-logs"; import { DataLayer, useDataLayer } from "data-layer"; -import { switchAlloVersionAndReloadPage } from "common/src/config"; import { useAlloVersion } from "common/src/components/AlloVersionSwitcher"; export interface RoundState { diff --git a/packages/round-manager/src/features/api/AlloWrapper.tsx b/packages/round-manager/src/features/api/AlloWrapper.tsx index 15d7177ade..f5aa8fe0dc 100644 --- a/packages/round-manager/src/features/api/AlloWrapper.tsx +++ b/packages/round-manager/src/features/api/AlloWrapper.tsx @@ -3,7 +3,6 @@ import { AlloProvider, AlloV1, AlloV2, - ChainId, createEthersTransactionSender, createPinataIpfsUploader, createWaitForIndexerSyncTo, diff --git a/packages/round-manager/src/features/api/program.ts b/packages/round-manager/src/features/api/program.ts index ecefce806b..96b9f83257 100644 --- a/packages/round-manager/src/features/api/program.ts +++ b/packages/round-manager/src/features/api/program.ts @@ -3,7 +3,7 @@ import { Program, Web3Instance } from "./types"; import { datadogLogs } from "@datadog/browser-logs"; import { ChainId } from "common"; import { DataLayer } from "data-layer"; -import { getAlloVersion, getConfig } from "common/src/config"; +import { getAlloVersion } from "common/src/config"; /** * Fetch a list of programs diff --git a/packages/round-manager/src/features/round/ApplicationsToReview.tsx b/packages/round-manager/src/features/round/ApplicationsToReview.tsx index d3135fbba8..596175ec1a 100644 --- a/packages/round-manager/src/features/round/ApplicationsToReview.tsx +++ b/packages/round-manager/src/features/round/ApplicationsToReview.tsx @@ -36,7 +36,6 @@ import { errorModalDelayMs } from "../../constants"; import ErrorModal from "../common/ErrorModal"; import { getRoundStrategyType, renderToPlainText, useAllo } from "common"; import { useWallet } from "../common/Auth"; -import { roundApplicationsToCSV } from "../api/exports"; import { CheckIcon } from "@heroicons/react/solid"; import { useApplicationsByRoundId } from "../common/useApplicationsByRoundId"; import { exportAndDownloadCSV } from "./ApplicationsToApproveReject"; diff --git a/packages/round-manager/src/features/round/FundContract.tsx b/packages/round-manager/src/features/round/FundContract.tsx index 8968d52541..4d67e4e5bd 100644 --- a/packages/round-manager/src/features/round/FundContract.tsx +++ b/packages/round-manager/src/features/round/FundContract.tsx @@ -1,6 +1,5 @@ import { datadogLogs } from "@datadog/browser-logs"; import { InformationCircleIcon } from "@heroicons/react/solid"; -import { getConfig } from "common/src/config"; import { BigNumber, ethers } from "ethers"; import { Logger } from "ethers/lib.esm/utils"; import { useEffect, useState } from "react"; @@ -219,7 +218,7 @@ export default function FundContract(props: { matchingFundPayoutToken?.decimal ?? 18 ); // todo: replace 0x0000000000000000000000000000000000000000 with native token for respective chain - const alloVersion = getConfig().allo.version; + // const alloVersion = getConfig().allo.version; const tokenDetailUser = matchingFundPayoutToken?.address == ethers.constants.AddressZero diff --git a/packages/round-manager/src/features/round/ViewApplicationPage.tsx b/packages/round-manager/src/features/round/ViewApplicationPage.tsx index 07d60af4ec..7b5924a847 100644 --- a/packages/round-manager/src/features/round/ViewApplicationPage.tsx +++ b/packages/round-manager/src/features/round/ViewApplicationPage.tsx @@ -39,7 +39,6 @@ import { } from "../api/types"; import { VerifiableCredential } from "@gitcoinco/passport-sdk-types"; import { Lit } from "../api/lit"; -import { utils } from "ethers"; import NotFoundPage from "../common/NotFoundPage"; import AccessDenied from "../common/AccessDenied"; import { Spinner } from "../common/Spinner"; @@ -70,8 +69,6 @@ import { getPayoutRoundDescription } from "../common/Utils"; import moment from "moment"; import ApplicationDirectPayout from "./ApplicationDirectPayout"; import { useApplicationsByRoundId } from "../common/useApplicationsByRoundId"; -import { getAddress } from "ethers/lib/utils.js"; -import { getAlloAddress } from "common/dist/allo/backends/allo-v2"; type Status = "done" | "current" | "rejected" | "approved" | undefined; diff --git a/packages/round-manager/src/features/round/ViewRoundSettings.tsx b/packages/round-manager/src/features/round/ViewRoundSettings.tsx index 27a6692c85..bb35a24b1b 100644 --- a/packages/round-manager/src/features/round/ViewRoundSettings.tsx +++ b/packages/round-manager/src/features/round/ViewRoundSettings.tsx @@ -175,8 +175,8 @@ export default function ViewRoundSettings(props: { id?: string }) { /* All DG rounds have rolling applications enabled */ useEffect(() => { if ( - (round?.applicationsEndTime == new Date(UINT64_MAX.toString())) - && isDirectRound(round) + round?.applicationsEndTime == new Date(UINT64_MAX.toString()) && + isDirectRound(round) ) { setRollingApplicationsEnabled(true); } else { @@ -1298,8 +1298,10 @@ function RoundApplicationPeriod(props: { return inputTime.isBefore(moment()); }; - const showApplicationPeriod = (isV2 && isDirectRound(editedRound)) || !isDirectRound(editedRound); - const showRoundPeriod = (!isV2 && isDirectRound(editedRound)) || !isDirectRound(editedRound); + const showApplicationPeriod = + (isV2 && isDirectRound(editedRound)) || !isDirectRound(editedRound); + const showRoundPeriod = + (!isV2 && isDirectRound(editedRound)) || !isDirectRound(editedRound); return (
@@ -1312,7 +1314,9 @@ function RoundApplicationPeriod(props: { <>
Applications
@@ -1432,34 +1436,42 @@ function RoundApplicationPeriod(props: {
)}
- { - setRollingApplicationsEnabled( - !rollingApplicationsEnabled - ); - props.setEditedRound({ - ...props.editedRound, - applicationsEndTime: rollingApplicationsEnabled ? - new Date(UINT64_MAX.toString()) : - props.editedRound.applicationsStartTime - }); - props.setValue( - "applicationsEndTime", - rollingApplicationsEnabled ? new Date(UINT64_MAX.toString()) : props.editedRound.applicationsStartTime - ); - }} + ( + { + const isChecked = e.target.checked; + setRollingApplicationsEnabled(isChecked); + const newEndTime = isChecked + ? new Date(maxDateForUint256) + : moment(new Date()).add(1, "days").toDate(); + props.setEditedRound({ + ...props.editedRound, + applicationsEndTime: newEndTime, + }); + props.setValue("applicationsEndTime", newEndTime); + }} + /> + )} /> +
@@ -1488,14 +1500,18 @@ function RoundApplicationPeriod(props: {
 
{props.editMode.canEdit && !rollingApplicationsEnabled && - !moment(editedRound.applicationsEndTime).isBefore(new Date()) ? ( + !moment(editedRound.applicationsEndTime).isBefore( + new Date() + ) ? (