From c9a52a85c4d6ff95cfba3158bf1c1815234071ff Mon Sep 17 00:00:00 2001 From: aeolian <94939382+aeolianeth@users.noreply.github.com> Date: Sun, 15 Dec 2024 18:49:47 +1000 Subject: [PATCH 1/4] chore: upgrade v4 for December contract deploy --- package.json | 4 +- .../CustomTokenSettings.tsx | 20 +++---- .../components/DefaultSettings.tsx | 12 ++-- .../ProjectToken/hooks/useProjectTokenForm.ts | 28 ++++----- .../ProjectTokenReview/ProjectTokenReview.tsx | 16 ++--- .../hooks/useProjectTokenReview.ts | 8 +-- .../hooks/useLoadInitialStateFromQuery.ts | 6 +- .../projectTokenSettingsToReduxFormat.ts | 6 +- .../V4PayRedeemCard/RedeemConfiguration.tsx | 4 +- .../V4PayRedeemCard/V4PayRedeemCard.tsx | 6 +- .../v4/hooks/useETHReceivedFromTokens.ts | 10 ++-- src/packages/v4/hooks/useJBUpcomingRuleset.ts | 58 ++++++++++++------- src/packages/v4/hooks/useUsedPayoutLimitOf.ts | 37 ++++++------ src/packages/v4/models/nfts.ts | 2 +- src/packages/v4/utils/editRuleset.ts | 8 +-- .../v4/utils/launchProjectTransformers.ts | 18 +++--- .../V4CyclesPayoutsPanel/V4TreasuryStats.tsx | 10 ++-- ...seV4FormatConfigurationExtensionSection.ts | 6 +- .../useV4FormatConfigurationTokenSection.ts | 34 +++++------ .../hooks/useV4TreasuryStats.tsx | 8 +-- .../RedeemNftsSection/RedeemNftsSection.tsx | 2 +- .../V4TokensPanel/V4BurnOrRedeemModal.tsx | 8 +-- .../V4TokenRedemptionCallout.tsx | 4 +- .../hooks/useV4BalanceMenuItemsUserFlags.ts | 6 +- .../EditCyclePage/EditCycleFormFields.ts | 4 +- .../hooks/useTokensSectionValues.ts | 8 +-- .../IssuanceRateReductionField.tsx | 6 +- .../TokensSection/RedemptionRateField.tsx | 16 ++--- .../hooks/useLoadEditCycleData.tsx | 16 ++--- yarn.lock | 16 ++--- 30 files changed, 202 insertions(+), 185 deletions(-) diff --git a/package.json b/package.json index ffb3fdea64..314e76293f 100644 --- a/package.json +++ b/package.json @@ -106,8 +106,8 @@ "graphql": "^16.8.1", "he": "^1.2.0", "jsonwebtoken": "^9.0.0", - "juice-sdk-core": "^11.6.0-alpha", - "juice-sdk-react": "^11.7.1-alpha", + "juice-sdk-core": "^12.0.1-alpha", + "juice-sdk-react": "^12.0.1-alpha", "juicebox-metadata-helper": "0.1.7", "less": "4.1.2", "lodash": "^4.17.21", diff --git a/src/packages/v4/components/Create/components/pages/ProjectToken/components/CustomTokenSettings/CustomTokenSettings.tsx b/src/packages/v4/components/Create/components/pages/ProjectToken/components/CustomTokenSettings/CustomTokenSettings.tsx index 92a9fcf18c..5d544752c5 100644 --- a/src/packages/v4/components/Create/components/pages/ProjectToken/components/CustomTokenSettings/CustomTokenSettings.tsx +++ b/src/packages/v4/components/Create/components/pages/ProjectToken/components/CustomTokenSettings/CustomTokenSettings.tsx @@ -5,11 +5,11 @@ import FormattedNumberInput from 'components/inputs/FormattedNumberInput' import { JuiceSwitch } from 'components/inputs/JuiceSwitch' import NumberSlider from 'components/inputs/NumberSlider' import { - MINT_RATE_EXPLANATION, - OWNER_MINTING_EXPLANATION, - OWNER_MINTING_RISK, - PAUSE_TRANSFERS_EXPLANATION, - REDEMPTION_RATE_EXPLANATION, + MINT_RATE_EXPLANATION, + OWNER_MINTING_EXPLANATION, + OWNER_MINTING_RISK, + PAUSE_TRANSFERS_EXPLANATION, + REDEMPTION_RATE_EXPLANATION, } from 'components/strings' import { TokenRedemptionRateGraph } from 'components/TokenRedemptionRateGraph/TokenRedemptionRateGraph' import useMobile from 'hooks/useMobile' @@ -53,7 +53,7 @@ export const CustomTokenSettings = () => { const discountRateDisabled = !parseInt(duration) - const redemptionRateDisabled = distributionLimit?.amount.eq(MAX_PAYOUT_LIMIT) + const cashOutTaxRateDisabled = distributionLimit?.amount.eq(MAX_PAYOUT_LIMIT) const initalMintRateAccessory = ( @@ -204,7 +204,7 @@ export const CustomTokenSettings = () => { {REDEMPTION_RATE_EXPLANATION} @@ -213,10 +213,10 @@ export const CustomTokenSettings = () => { defaultValue={0} suffix="%" step={0.5} - disabled={redemptionRateDisabled} + disabled={cashOutTaxRateDisabled} /> - {redemptionRateDisabled ? ( + {cashOutTaxRateDisabled ? ( Redemptions are disabled when all of the project's ETH is being @@ -225,7 +225,7 @@ export const CustomTokenSettings = () => { ) : ( !isMobile && ( - + ) diff --git a/src/packages/v4/components/Create/components/pages/ProjectToken/components/DefaultSettings.tsx b/src/packages/v4/components/Create/components/pages/ProjectToken/components/DefaultSettings.tsx index 9aafd3154e..1f1b1872c9 100644 --- a/src/packages/v4/components/Create/components/pages/ProjectToken/components/DefaultSettings.tsx +++ b/src/packages/v4/components/Create/components/pages/ProjectToken/components/DefaultSettings.tsx @@ -2,11 +2,11 @@ import { t } from '@lingui/macro' import { Divider } from 'antd' import TooltipLabel from 'components/TooltipLabel' import { - DISCOUNT_RATE_EXPLANATION, - MINT_RATE_EXPLANATION, - OWNER_MINTING_EXPLANATION, - REDEMPTION_RATE_EXPLANATION, - RESERVED_RATE_EXPLANATION, + DISCOUNT_RATE_EXPLANATION, + MINT_RATE_EXPLANATION, + OWNER_MINTING_EXPLANATION, + REDEMPTION_RATE_EXPLANATION, + RESERVED_RATE_EXPLANATION, } from 'components/strings' import { ReactNode, useMemo } from 'react' import { formatAmount } from 'utils/format/formatAmount' @@ -33,7 +33,7 @@ export const DefaultSettings: React.FC< tooltip: DISCOUNT_RATE_EXPLANATION, }, [t`Redemption rate`]: { - data: `${ProjectTokenForm.DefaultSettings.redemptionRate}%`, + data: `${ProjectTokenForm.DefaultSettings.cashOutTaxRate}%`, tooltip: REDEMPTION_RATE_EXPLANATION, }, [t`Owner token minting`]: { diff --git a/src/packages/v4/components/Create/components/pages/ProjectToken/hooks/useProjectTokenForm.ts b/src/packages/v4/components/Create/components/pages/ProjectToken/hooks/useProjectTokenForm.ts index e2bdde2235..89531ab3a5 100644 --- a/src/packages/v4/components/Create/components/pages/ProjectToken/hooks/useProjectTokenForm.ts +++ b/src/packages/v4/components/Create/components/pages/ProjectToken/hooks/useProjectTokenForm.ts @@ -34,7 +34,7 @@ export type ProjectTokensFormProps = Partial<{ reservedTokensPercentage: number | undefined reservedTokenAllocation: AllocationSplit[] | undefined discountRate: number | undefined - redemptionRate: number | undefined + cashOutTaxRate: number | undefined tokenMinting: boolean | undefined pauseTransfers: boolean | undefined }> @@ -46,7 +46,7 @@ export const DefaultSettings: Required< reservedTokensPercentage: 0, reservedTokenAllocation: [], discountRate: 0, - redemptionRate: 100, + cashOutTaxRate: 100, tokenMinting: false, pauseTransfers: false, } @@ -62,7 +62,7 @@ export const useProjectTokensForm = () => { useDebugValue(form.getFieldsValue()) const [distributionLimit] = useCreatingDistributionLimit() - const redemptionRateDisabled = + const cashOutTaxRateDisabled = !distributionLimit || distributionLimit.amount.eq(MAX_PAYOUT_LIMIT) const discountRateDisabled = !parseInt(fundingCycleData.duration) @@ -80,10 +80,10 @@ export const useProjectTokensForm = () => { !discountRateDisabled && fundingCycleData.discountRate ? parseFloat(formatDiscountRate(fundingCycleData.discountRate)) : DefaultSettings.discountRate - const redemptionRate = - !redemptionRateDisabled && fundingCycleMetadata.redemptionRate - ? parseFloat(formatRedemptionRate(fundingCycleMetadata.redemptionRate)) - : DefaultSettings.redemptionRate + const cashOutTaxRate = + !cashOutTaxRateDisabled && fundingCycleMetadata.cashOutTaxRate + ? parseFloat(formatRedemptionRate(fundingCycleMetadata.cashOutTaxRate)) + : DefaultSettings.cashOutTaxRate const tokenMinting = fundingCycleMetadata.allowMinting !== undefined ? fundingCycleMetadata.allowMinting @@ -99,7 +99,7 @@ export const useProjectTokensForm = () => { reservedTokensPercentage, reservedTokenAllocation, discountRate, - redemptionRate, + cashOutTaxRate, tokenMinting, pauseTransfers, } @@ -108,11 +108,11 @@ export const useProjectTokensForm = () => { fundingCycleData.discountRate, fundingCycleData.weight, fundingCycleMetadata.allowMinting, - fundingCycleMetadata.redemptionRate, + fundingCycleMetadata.cashOutTaxRate, fundingCycleMetadata.reservedRate, fundingCycleMetadata.global.pauseTransfers, projectTokensSelection, - redemptionRateDisabled, + cashOutTaxRateDisabled, tokenSplits, ]) @@ -186,21 +186,21 @@ export const useProjectTokensForm = () => { useFormDispatchWatch({ form, - fieldName: 'redemptionRate', + fieldName: 'cashOutTaxRate', dispatchFunction: creatingV2ProjectActions.setRedemptionRate, formatter: v => { if (v === undefined || typeof v !== 'number') - return redemptionRateFrom(DefaultSettings.redemptionRate).toHexString() + return redemptionRateFrom(DefaultSettings.cashOutTaxRate).toHexString() return redemptionRateFrom(v).toHexString() }, }) useFormDispatchWatch({ form, - fieldName: 'redemptionRate', + fieldName: 'cashOutTaxRate', dispatchFunction: creatingV2ProjectActions.setBallotRedemptionRate, formatter: v => { if (v === undefined || typeof v !== 'number') - return redemptionRateFrom(DefaultSettings.redemptionRate).toHexString() + return redemptionRateFrom(DefaultSettings.cashOutTaxRate).toHexString() return redemptionRateFrom(v).toHexString() }, }) diff --git a/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/ProjectTokenReview/ProjectTokenReview.tsx b/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/ProjectTokenReview/ProjectTokenReview.tsx index 09ec75dcf9..621205bf44 100644 --- a/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/ProjectTokenReview/ProjectTokenReview.tsx +++ b/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/ProjectTokenReview/ProjectTokenReview.tsx @@ -1,10 +1,10 @@ import { t } from '@lingui/macro' import { ReservedTokensList } from 'packages/v2v3/components/shared/ReservedTokensList' import { - formatDiscountRate, - formatIssuanceRate, - formatRedemptionRate, - formatReservedRate, + formatDiscountRate, + formatIssuanceRate, + formatRedemptionRate, + formatReservedRate, } from 'packages/v2v3/utils/math' import { formatAmount } from 'utils/format/formatAmount' import * as ProjectTokenForm from '../../../ProjectToken/hooks/useProjectTokenForm' @@ -17,7 +17,7 @@ export const ProjectTokenReview = () => { allowTokenMinting, pauseTransfers, discountRate, - redemptionRate, + cashOutTaxRate, reservedRate, setAllocationSplits, weight, @@ -76,9 +76,9 @@ export const ProjectTokenReview = () => { desc={
{formatRedemptionRate( - redemptionRate - ? redemptionRate - : ProjectTokenForm.DefaultSettings.redemptionRate.toString(), + cashOutTaxRate + ? cashOutTaxRate + : ProjectTokenForm.DefaultSettings.cashOutTaxRate.toString(), ) + '%'}
} diff --git a/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/ProjectTokenReview/hooks/useProjectTokenReview.ts b/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/ProjectTokenReview/hooks/useProjectTokenReview.ts index 5c6a1cf39d..4de178cc3c 100644 --- a/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/ProjectTokenReview/hooks/useProjectTokenReview.ts +++ b/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/ProjectTokenReview/hooks/useProjectTokenReview.ts @@ -1,7 +1,7 @@ import { AllocationSplit } from 'packages/v2v3/components/shared/Allocation/Allocation' import { - allocationToSplit, - splitToAllocation, + allocationToSplit, + splitToAllocation, } from 'packages/v2v3/utils/splitToAllocation' import { useCallback, useMemo } from 'react' import { useAppSelector } from 'redux/hooks/useAppSelector' @@ -14,7 +14,7 @@ export const useProjectTokenReview = () => { fundingCycleMetadata: { allowMinting, reservedRate, - redemptionRate, + cashOutTaxRate, global, }, } = useAppSelector(state => state.creatingV2Project) @@ -46,7 +46,7 @@ export const useProjectTokenReview = () => { allowTokenMinting, pauseTransfers, reservedRate, - redemptionRate, + cashOutTaxRate, allocationSplits, setAllocationSplits, } diff --git a/src/packages/v4/components/Create/hooks/useLoadInitialStateFromQuery.ts b/src/packages/v4/components/Create/hooks/useLoadInitialStateFromQuery.ts index cd368837da..2e797b49a1 100644 --- a/src/packages/v4/components/Create/hooks/useLoadInitialStateFromQuery.ts +++ b/src/packages/v4/components/Create/hooks/useLoadInitialStateFromQuery.ts @@ -9,8 +9,8 @@ import { MAX_PAYOUT_LIMIT } from 'packages/v4/utils/math' import { useEffect, useState } from 'react' import { useDispatch } from 'react-redux' import { - DEFAULT_REDUX_STATE, - creatingV2ProjectActions, + DEFAULT_REDUX_STATE, + creatingV2ProjectActions, } from 'redux/slices/creatingV2Project' import { INITIAL_REDUX_STATE } from 'redux/slices/shared/v2ProjectInitialReduxState' import { CreateState, ProjectState } from 'redux/slices/shared/v2ProjectTypes' @@ -63,7 +63,7 @@ const parseCreateFlowStateFromInitialState = ( reservedRate: initialState.fundingCycleMetadata.reservedRate, reservedTokensGroupedSplits: initialState.reservedTokensGroupedSplits, discountRate: initialState.fundingCycleData.discountRate, - redemptionRate: initialState.fundingCycleMetadata.redemptionRate, + cashOutTaxRate: initialState.fundingCycleMetadata.cashOutTaxRate, allowMinting: initialState.fundingCycleMetadata.allowMinting, } if (isEqual(initialTokenData, ReduxDefaultTokenSettings)) { diff --git a/src/packages/v4/components/Create/utils/projectTokenSettingsToReduxFormat.ts b/src/packages/v4/components/Create/utils/projectTokenSettingsToReduxFormat.ts index fa7d98954e..9fd1073ad6 100644 --- a/src/packages/v4/components/Create/utils/projectTokenSettingsToReduxFormat.ts +++ b/src/packages/v4/components/Create/utils/projectTokenSettingsToReduxFormat.ts @@ -22,8 +22,8 @@ export const projectTokenSettingsToReduxFormat = ( const discountRate = discountRateFrom( projectTokenSettings.discountRate, ).toHexString() - const redemptionRate = redemptionRateFrom( - projectTokenSettings.redemptionRate, + const cashOutTaxRate = redemptionRateFrom( + projectTokenSettings.cashOutTaxRate, ).toHexString() const allowMinting = projectTokenSettings.tokenMinting const pauseTransfers = projectTokenSettings.pauseTransfers @@ -33,7 +33,7 @@ export const projectTokenSettingsToReduxFormat = ( reservedRate, reservedTokensGroupedSplits, discountRate, - redemptionRate, + cashOutTaxRate, allowMinting, pauseTransfers, } diff --git a/src/packages/v4/components/ProjectDashboard/V4PayRedeemCard/RedeemConfiguration.tsx b/src/packages/v4/components/ProjectDashboard/V4PayRedeemCard/RedeemConfiguration.tsx index 65f9880744..02ba636d08 100644 --- a/src/packages/v4/components/ProjectDashboard/V4PayRedeemCard/RedeemConfiguration.tsx +++ b/src/packages/v4/components/ProjectDashboard/V4PayRedeemCard/RedeemConfiguration.tsx @@ -13,7 +13,7 @@ import { NATIVE_TOKEN } from 'juice-sdk-core' import { useJBContractContext, useJBTokenContext, - useWriteJbMultiTerminalRedeemTokensOf, + useWriteJbMultiTerminalCashOutTokensOf, } from 'juice-sdk-react' import { useETHReceivedFromTokens } from 'packages/v4/hooks/useETHReceivedFromTokens' import { usePayoutLimit } from 'packages/v4/hooks/usePayoutLimit' @@ -64,7 +64,7 @@ export const RedeemConfiguration: React.FC = ({ : '' const { writeContractAsync: writeRedeem } = - useWriteJbMultiTerminalRedeemTokensOf() + useWriteJbMultiTerminalCashOutTokensOf() const { userAddress } = useWallet() const insufficientBalance = useMemo(() => { diff --git a/src/packages/v4/components/ProjectDashboard/V4PayRedeemCard/V4PayRedeemCard.tsx b/src/packages/v4/components/ProjectDashboard/V4PayRedeemCard/V4PayRedeemCard.tsx index 850d808cd0..ddf2baa873 100644 --- a/src/packages/v4/components/ProjectDashboard/V4PayRedeemCard/V4PayRedeemCard.tsx +++ b/src/packages/v4/components/ProjectDashboard/V4PayRedeemCard/V4PayRedeemCard.tsx @@ -41,8 +41,8 @@ export const V4PayRedeemCard: React.FC = ({ const redeems = { loading: ruleset.isLoading, enabled: - rulesetMetadata.data?.redemptionRate && - rulesetMetadata.data.redemptionRate.value > 0n, + rulesetMetadata.data?.cashOutTaxRate && + rulesetMetadata.data.cashOutTaxRate.value > 0n, } const isIssuingTokens = React.useMemo(() => { @@ -66,7 +66,7 @@ export const V4PayRedeemCard: React.FC = ({ }, [isIssuingTokens, nftRewards.loading, nftRewards.nftRewards.rewardTiers]) const redeemDisabled = - !rulesetMetadata.data?.redemptionRate || + !rulesetMetadata.data?.cashOutTaxRate || payoutLimit?.amount === MAX_PAYOUT_LIMIT return ( diff --git a/src/packages/v4/hooks/useETHReceivedFromTokens.ts b/src/packages/v4/hooks/useETHReceivedFromTokens.ts index d68802b0c5..48b13bd58b 100644 --- a/src/packages/v4/hooks/useETHReceivedFromTokens.ts +++ b/src/packages/v4/hooks/useETHReceivedFromTokens.ts @@ -1,4 +1,4 @@ -import { getTokenRedemptionQuoteEth } from 'juice-sdk-core' +import { getTokenCashOutQuoteEth } from 'juice-sdk-core' import { useJBContractContext, useJBRulesetContext, @@ -22,10 +22,10 @@ export function useETHReceivedFromTokens( address: contracts.controller.data ?? undefined, args: [projectId], }) - const redemptionRate = rulesetMetadata.data?.redemptionRate?.value + const cashOutTaxRate = rulesetMetadata.data?.cashOutTaxRate?.value if ( - redemptionRate === undefined || + cashOutTaxRate === undefined || totalSupply === undefined || tokensReserved === undefined || tokenAmountWei === undefined || @@ -35,8 +35,8 @@ export function useETHReceivedFromTokens( } try { - return getTokenRedemptionQuoteEth(tokenAmountWei, { - redemptionRate: Number(redemptionRate), + return getTokenCashOutQuoteEth(tokenAmountWei, { + cashOutTaxRate: Number(cashOutTaxRate), totalSupply, tokensReserved, overflowWei: nativeTokenSurplus, diff --git a/src/packages/v4/hooks/useJBUpcomingRuleset.ts b/src/packages/v4/hooks/useJBUpcomingRuleset.ts index c9030d367f..f2234a9f31 100644 --- a/src/packages/v4/hooks/useJBUpcomingRuleset.ts +++ b/src/packages/v4/hooks/useJBUpcomingRuleset.ts @@ -1,43 +1,59 @@ -import { DecayPercent, JBRulesetData, JBRulesetMetadata, RedemptionRate, ReservedPercent, RulesetWeight } from 'juice-sdk-core'; -import { useJBContractContext, useReadJbControllerUpcomingRulesetOf } from 'juice-sdk-react'; +import { + CashOutTaxRate, + JBRulesetData, + JBRulesetMetadata, + ReservedPercent, + RulesetWeight, + WeightCutPercent, +} from 'juice-sdk-core' +import { + useJBContractContext, + useReadJbControllerUpcomingRulesetOf, +} from 'juice-sdk-react' // @todo: add to SDK -export function useJBUpcomingRuleset(): { - ruleset: JBRulesetData | undefined, - rulesetMetadata: JBRulesetMetadata | undefined, +export function useJBUpcomingRuleset(): { + ruleset: JBRulesetData | undefined + rulesetMetadata: JBRulesetMetadata | undefined isLoading: boolean - } { +} { const { contracts, projectId } = useJBContractContext() const { data, isLoading } = useReadJbControllerUpcomingRulesetOf({ address: contracts.controller?.data ?? undefined, - args: [projectId] + args: [projectId], }) const _latestUpcomingRuleset = data?.[0] const _latestUpcomingRulesetMetadata = data?.[1] const upcomingWeight = new RulesetWeight(_latestUpcomingRuleset?.weight ?? 0n) - const upcomingDecayPercent = new DecayPercent(_latestUpcomingRuleset?.decayPercent ?? 0) + const upcomingWeightCutPercent = new WeightCutPercent( + _latestUpcomingRuleset?.weightCutPercent ?? 0, + ) const latestUpcomingRuleset = _latestUpcomingRuleset ? { ..._latestUpcomingRuleset, weight: upcomingWeight, - decayPercent: upcomingDecayPercent, + weightCutPercent: upcomingWeightCutPercent, } - : undefined; + : undefined - const upcomingReservedPercent = new ReservedPercent(_latestUpcomingRulesetMetadata?.reservedPercent ?? 0) - const upcomingRedemptionRate = new RedemptionRate(_latestUpcomingRulesetMetadata?.redemptionRate ?? 0) - const latestUpcomingRulesetMetadata = _latestUpcomingRulesetMetadata ? - { - ..._latestUpcomingRulesetMetadata, - reservedPercent: upcomingReservedPercent, - redemptionRate: upcomingRedemptionRate, - - } : undefined + const upcomingReservedPercent = new ReservedPercent( + _latestUpcomingRulesetMetadata?.reservedPercent ?? 0, + ) + const upcomingCashOutTaxRate = new CashOutTaxRate( + _latestUpcomingRulesetMetadata?.cashOutTaxRate ?? 0, + ) + const latestUpcomingRulesetMetadata = _latestUpcomingRulesetMetadata + ? { + ..._latestUpcomingRulesetMetadata, + reservedPercent: upcomingReservedPercent, + cashOutTaxRate: upcomingCashOutTaxRate, + } + : undefined return { ruleset: latestUpcomingRuleset, rulesetMetadata: latestUpcomingRulesetMetadata, - isLoading - }; + isLoading, + } } diff --git a/src/packages/v4/hooks/useUsedPayoutLimitOf.ts b/src/packages/v4/hooks/useUsedPayoutLimitOf.ts index 5c8be280af..fc97177dd5 100644 --- a/src/packages/v4/hooks/useUsedPayoutLimitOf.ts +++ b/src/packages/v4/hooks/useUsedPayoutLimitOf.ts @@ -1,27 +1,28 @@ -import { NATIVE_CURRENCY_ID, NATIVE_TOKEN } from 'juice-sdk-core'; +import { NATIVE_CURRENCY_ID, NATIVE_TOKEN } from 'juice-sdk-core' import { useJBContractContext, useJBRulesetContext, useJBTerminalContext, useReadJbTerminalStoreUsedPayoutLimitOf, -} from 'juice-sdk-react'; -import { zeroAddress } from 'viem'; +} from 'juice-sdk-react' +import { zeroAddress } from 'viem' export const useUsedPayoutLimitOf = () => { - const { store } = useJBTerminalContext(); - const { projectId, contracts } = useJBContractContext(); - const { ruleset } = useJBRulesetContext(); + const { store } = useJBTerminalContext() + const { projectId, contracts } = useJBContractContext() + const { ruleset } = useJBRulesetContext() - const { data: usedPayoutLimit, isLoading } = useReadJbTerminalStoreUsedPayoutLimitOf({ - address: store.data ?? undefined, - args: [ - contracts.primaryNativeTerminal.data ?? zeroAddress, - projectId, - NATIVE_TOKEN, - BigInt(ruleset.data?.cycleNumber ?? 0), - NATIVE_CURRENCY_ID, - ], - }); + const { data: usedPayoutLimit, isLoading } = + useReadJbTerminalStoreUsedPayoutLimitOf({ + address: store.data ?? undefined, + args: [ + contracts.primaryNativeTerminal.data ?? zeroAddress, + projectId, + NATIVE_TOKEN, + BigInt(ruleset.data?.cycleNumber ?? 0), + BigInt(NATIVE_CURRENCY_ID), + ], + }) - return { data: usedPayoutLimit, isLoading }; -}; + return { data: usedPayoutLimit, isLoading } +} diff --git a/src/packages/v4/models/nfts.ts b/src/packages/v4/models/nfts.ts index df7026a90f..2a1965d302 100644 --- a/src/packages/v4/models/nfts.ts +++ b/src/packages/v4/models/nfts.ts @@ -67,7 +67,7 @@ export type JBPayDataHookRulesetConfig = JBRulesetData & { terminals: string[] duration: bigint weight: bigint - decayPercent: bigint + weightCutPercent: bigint approvalHook: Address splitGroups: LaunchV4ProjectGroupedSplit[] } diff --git a/src/packages/v4/utils/editRuleset.ts b/src/packages/v4/utils/editRuleset.ts index 5ab3d38fd2..f25d0ac53c 100644 --- a/src/packages/v4/utils/editRuleset.ts +++ b/src/packages/v4/utils/editRuleset.ts @@ -25,7 +25,7 @@ export function transformEditCycleFormFieldsToTxArgs({ unit: formValues.durationUnit.value, }) const weight = BigInt(issuanceRateFrom(formValues.issuanceRate.toString())) - const decayPercent = round(formValues.decayPercent * 10000000) + const weightCutPercent = round(formValues.weightCutPercent * 10000000) const approvalHook = formValues.approvalHook const rulesetConfigurations = [ @@ -33,12 +33,12 @@ export function transformEditCycleFormFieldsToTxArgs({ mustStartAtOrAfter, duration, weight, - decayPercent, + weightCutPercent, approvalHook, metadata: { reservedPercent: formValues.reservedPercent * 100, - redemptionRate: formValues.redemptionRate * 100, + cashOutTaxRate: formValues.cashOutTaxRate * 100, baseCurrency: BASE_CURRENCY_ETH, pausePay: formValues.pausePay, pauseRedeem: false, // Defaulting this value since it's not in formValues @@ -54,7 +54,7 @@ export function transformEditCycleFormFieldsToTxArgs({ holdFees: formValues.holdFees, useTotalSurplusForRedemptions: false, // Defaulting to false as it's not in formValues useDataHookForPay: false, // Defaulting to false as it's not in formValues - useDataHookForRedeem: false, // Defaulting to false as it's not in formValues + useDataHookForCashOut: false, // Defaulting to false as it's not in formValues dataHook: '0x0000000000000000000000000000000000000000' as `0x${string}`, // Defaulting to a null address metadata: 0, // Assuming no additional metadata is provided allowCrosschainSuckerExtension: false, diff --git a/src/packages/v4/utils/launchProjectTransformers.ts b/src/packages/v4/utils/launchProjectTransformers.ts index 3627112d2d..76c08a9940 100644 --- a/src/packages/v4/utils/launchProjectTransformers.ts +++ b/src/packages/v4/utils/launchProjectTransformers.ts @@ -1,12 +1,12 @@ import { - JBSplit, - NATIVE_TOKEN, - NATIVE_TOKEN_DECIMALS, - SplitGroup, + JBSplit, + NATIVE_TOKEN, + NATIVE_TOKEN_DECIMALS, + SplitGroup, } from 'juice-sdk-core' import { - V2V3FundAccessConstraint, - V2V3FundingCycleData, + V2V3FundAccessConstraint, + V2V3FundingCycleData, } from 'packages/v2v3/models/fundingCycle' import round from 'lodash/round' @@ -60,7 +60,7 @@ export function transformV2V3CreateArgsToV4({ mustStartAtOrAfterNum > now ? mustStartAtOrAfterNum : now, duration: _fundingCycleData.duration.toNumber(), weight: _fundingCycleData.weight.toBigInt(), - decayPercent: _fundingCycleData.discountRate.toNumber(), + weightCutPercent: _fundingCycleData.discountRate.toNumber(), approvalHook: _fundingCycleData.ballot as Address, @@ -100,7 +100,7 @@ export function transformFCMetadataToRulesetMetadata({ }) { return { reservedPercent: fundingCycleMetadata.reservedRate.toNumber(), - redemptionRate: fundingCycleMetadata.redemptionRate.toNumber(), + cashOutTaxRate: fundingCycleMetadata.cashOutTaxRate.toNumber(), baseCurrency: BASE_CURRENCY_ETH, pausePay: fundingCycleMetadata.pausePay, pauseRedeem: fundingCycleMetadata.pauseRedeem, @@ -117,7 +117,7 @@ export function transformFCMetadataToRulesetMetadata({ useTotalSurplusForRedemptions: fundingCycleMetadata.useTotalOverflowForRedemptions, useDataHookForPay: fundingCycleMetadata.useDataSourceForPay, - useDataHookForRedeem: fundingCycleMetadata.useDataSourceForRedeem, + useDataHookForCashOut: fundingCycleMetadata.useDataSourceForRedeem, dataHook: fundingCycleMetadata.dataSource as Address, metadata: 0, allowCrosschainSuckerExtension: false, diff --git a/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4CyclesPayoutsPanel/V4TreasuryStats.tsx b/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4CyclesPayoutsPanel/V4TreasuryStats.tsx index fcfc62e61f..52109a30fe 100644 --- a/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4CyclesPayoutsPanel/V4TreasuryStats.tsx +++ b/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4CyclesPayoutsPanel/V4TreasuryStats.tsx @@ -1,26 +1,26 @@ import { Trans, t } from '@lingui/macro' import { - availableToPayOutTooltip, - treasuryBalanceTooltip, + availableToPayOutTooltip, + treasuryBalanceTooltip, } from 'components/Project/ProjectTabs/CyclesPayoutsTab/CyclesPanelTooltips' import { TitleDescriptionDisplayCard } from 'components/Project/ProjectTabs/TitleDescriptionDisplayCard' import { useMemo } from 'react' import { useV4TreasuryStats } from './hooks/useV4TreasuryStats' export const V4TreasuryStats = () => { - const { availableToPayout, surplus, treasuryBalance, redemptionRate } = + const { availableToPayout, surplus, treasuryBalance, cashOutTaxRate } = useV4TreasuryStats() const surplusTooltip = useMemo( () => - redemptionRate && redemptionRate.toFloat() > 0 ? ( + cashOutTaxRate && cashOutTaxRate.toFloat() > 0 ? ( {surplus} is available for token redemptions or future payouts. ) : ( {surplus} is available for future payouts. ), - [surplus, redemptionRate], + [surplus, cashOutTaxRate], ) return ( diff --git a/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4CyclesPayoutsPanel/hooks/useV4FormatConfigurationExtensionSection.ts b/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4CyclesPayoutsPanel/hooks/useV4FormatConfigurationExtensionSection.ts index 80805fc0a9..3968c1d77c 100644 --- a/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4CyclesPayoutsPanel/hooks/useV4FormatConfigurationExtensionSection.ts +++ b/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4CyclesPayoutsPanel/hooks/useV4FormatConfigurationExtensionSection.ts @@ -60,9 +60,9 @@ export const useV4FormatConfigurationExtensionSection = ({ const useForRedemptionsDatum: ConfigurationPanelDatum = useMemo(() => { const currentUseForRedemptions = - rulesetMetadata?.useDataHookForRedeem + rulesetMetadata?.useDataHookForCashOut const upcomingUseForRedemptions = - upcomingRulesetMetadata?.useDataHookForRedeem + upcomingRulesetMetadata?.useDataHookForCashOut if (upcomingRulesetMetadata === null) { return flagPairToDatum( @@ -78,7 +78,7 @@ export const useV4FormatConfigurationExtensionSection = ({ upcomingUseForRedemptions, ) }, [ - rulesetMetadata?.useDataHookForRedeem, + rulesetMetadata?.useDataHookForCashOut, upcomingRulesetMetadata, ]) diff --git a/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4CyclesPayoutsPanel/hooks/useV4FormatConfigurationTokenSection.ts b/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4CyclesPayoutsPanel/hooks/useV4FormatConfigurationTokenSection.ts index ba6a1e5247..78c6d1afe1 100644 --- a/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4CyclesPayoutsPanel/hooks/useV4FormatConfigurationTokenSection.ts +++ b/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4CyclesPayoutsPanel/hooks/useV4FormatConfigurationTokenSection.ts @@ -1,7 +1,7 @@ import { t } from '@lingui/macro' import { - ConfigurationPanelDatum, - ConfigurationPanelTableData, + ConfigurationPanelDatum, + ConfigurationPanelTableData, } from 'components/Project/ProjectTabs/CyclesPayoutsTab/ConfigurationPanel' import { flagPairToDatum } from 'components/Project/ProjectTabs/utils/flagPairToDatum' import { pairToDatum } from 'components/Project/ProjectTabs/utils/pairToDatum' @@ -31,15 +31,15 @@ export const useV4FormatConfigurationTokenSection = ({ plural: true, }) - const decayPercentFloat = ruleset?.decayPercent.toFloat() + const weightCutPercentFloat = ruleset?.weightCutPercent.toFloat() const currentTotalIssuanceRate = ruleset?.weight.toFloat() const currentTotalIssuanceRateFormatted = formattedNum(currentTotalIssuanceRate) const queuedTotalIssuanceRate = upcomingRuleset ? upcomingRuleset?.weight.toFloat() : typeof currentTotalIssuanceRate !== 'undefined' && - typeof decayPercentFloat !== 'undefined' - ? currentTotalIssuanceRate - currentTotalIssuanceRate * decayPercentFloat + typeof weightCutPercentFloat !== 'undefined' + ? currentTotalIssuanceRate - currentTotalIssuanceRate * weightCutPercentFloat : undefined const queuedTotalIssuanceRateFormatted = formattedNum(queuedTotalIssuanceRate) @@ -129,26 +129,26 @@ export const useV4FormatConfigurationTokenSection = ({ return pairToDatum(t`Reserved rate`, current, queued) }, [upcomingRulesetMetadata, rulesetMetadata, upcomingRulesetLoading]) - const decayPercentDatum: ConfigurationPanelDatum = useMemo(() => { + const weightCutPercentDatum: ConfigurationPanelDatum = useMemo(() => { const current = ruleset - ? `${ruleset.decayPercent.formatPercentage()}%` + ? `${ruleset.weightCutPercent.formatPercentage()}%` : undefined if (upcomingRuleset === null || upcomingRulesetLoading) { return pairToDatum(t`Decay rate`, current, null) } const queued = upcomingRuleset - ? `${upcomingRuleset.decayPercent.formatPercentage()}%` + ? `${upcomingRuleset.weightCutPercent.formatPercentage()}%` : ruleset - ? `${ruleset.decayPercent.formatPercentage()}%` + ? `${ruleset.weightCutPercent.formatPercentage()}%` : undefined return pairToDatum(t`Decay rate`, current, queued) }, [ruleset, upcomingRuleset, upcomingRulesetLoading]) - const redemptionRateDatum: ConfigurationPanelDatum = useMemo(() => { + const cashOutTaxRateDatum: ConfigurationPanelDatum = useMemo(() => { const currentRedemptionRate = - rulesetMetadata?.redemptionRate.formatPercentage() + rulesetMetadata?.cashOutTaxRate.formatPercentage() const current = currentRedemptionRate ? `${currentRedemptionRate}%` @@ -159,9 +159,9 @@ export const useV4FormatConfigurationTokenSection = ({ } const queued = upcomingRulesetMetadata - ? `${upcomingRulesetMetadata?.redemptionRate.formatPercentage()}%` + ? `${upcomingRulesetMetadata?.cashOutTaxRate.formatPercentage()}%` : rulesetMetadata - ? `${rulesetMetadata.redemptionRate.formatPercentage()}%` + ? `${rulesetMetadata.cashOutTaxRate.formatPercentage()}%` : undefined return pairToDatum(t`Redemption rate`, current, queued) }, [upcomingRulesetMetadata, rulesetMetadata, upcomingRulesetLoading]) @@ -232,17 +232,17 @@ export const useV4FormatConfigurationTokenSection = ({ totalIssuanceRate: totalIssuanceRateDatum, payerIssuanceRate: payerIssuanceRateDatum, reservedPercent: reservedPercentDatum, - decayPercentDatum: decayPercentDatum, - redemptionRate: redemptionRateDatum, + weightCutPercentDatum: weightCutPercentDatum, + cashOutTaxRate: cashOutTaxRateDatum, ownerTokenMintingRate: ownerTokenMintingDatum, tokenTransfers: tokenTransfersDatum, } }, [ - decayPercentDatum, + weightCutPercentDatum, totalIssuanceRateDatum, ownerTokenMintingDatum, payerIssuanceRateDatum, - redemptionRateDatum, + cashOutTaxRateDatum, reservedPercentDatum, tokenTransfersDatum, ]) diff --git a/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4CyclesPayoutsPanel/hooks/useV4TreasuryStats.tsx b/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4CyclesPayoutsPanel/hooks/useV4TreasuryStats.tsx index be32cd3419..5a3d3c52ae 100644 --- a/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4CyclesPayoutsPanel/hooks/useV4TreasuryStats.tsx +++ b/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4CyclesPayoutsPanel/hooks/useV4TreasuryStats.tsx @@ -1,8 +1,8 @@ import { t } from '@lingui/macro' import { - NativeTokenValue, - useJBRulesetMetadata, - useNativeTokenSurplus, + NativeTokenValue, + useJBRulesetMetadata, + useNativeTokenSurplus, } from 'juice-sdk-react' import { usePayoutLimit } from 'packages/v4/hooks/usePayoutLimit' import { useV4BalanceOfNativeTerminal } from 'packages/v4/hooks/useV4BalanceOfNativeTerminal' @@ -33,6 +33,6 @@ export const useV4TreasuryStats = () => { treasuryBalance, availableToPayout, surplus, - redemptionRate: rulesetMetadata?.redemptionRate, + cashOutTaxRate: rulesetMetadata?.cashOutTaxRate, } } diff --git a/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4NftRewardsPanel/RedeemNftsSection/RedeemNftsSection.tsx b/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4NftRewardsPanel/RedeemNftsSection/RedeemNftsSection.tsx index 7d5cc929ae..c40c669dab 100644 --- a/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4NftRewardsPanel/RedeemNftsSection/RedeemNftsSection.tsx +++ b/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4NftRewardsPanel/RedeemNftsSection/RedeemNftsSection.tsx @@ -16,7 +16,7 @@ export function RedeemNftsSection() { // const { data: credits, loading: loadingCredits } = useNftCredits(userAddress) // const hasOverflow = primaryTerminalCurrentOverflow?.gt(0) - // const hasRedemptionRate = fundingCycleMetadata?.redemptionRate.gt(0) + // const hasRedemptionRate = fundingCycleMetadata?.cashOutTaxRate.gt(0) // const canRedeem = // hasOverflow && // hasRedemptionRate && diff --git a/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4TokensPanel/V4BurnOrRedeemModal.tsx b/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4TokensPanel/V4BurnOrRedeemModal.tsx index a4a6c36814..5bb6e3d5cf 100644 --- a/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4TokensPanel/V4BurnOrRedeemModal.tsx +++ b/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4TokensPanel/V4BurnOrRedeemModal.tsx @@ -18,7 +18,7 @@ import { useJBTokenContext, useNativeTokenSurplus, useWriteJbControllerBurnTokensOf, - useWriteJbMultiTerminalRedeemTokensOf, + useWriteJbMultiTerminalCashOutTokensOf, } from 'juice-sdk-react' import { useV4UserTotalTokensBalance } from 'packages/v4/contexts/V4UserTotalTokensBalanceProvider' import { useETHReceivedFromTokens } from 'packages/v4/hooks/useETHReceivedFromTokens' @@ -54,7 +54,7 @@ export function V4BurnOrRedeemModal({ const userTokenBalance = useV4UserTotalTokensBalance().data ?? 0n const { writeContractAsync: writeRedeem } = - useWriteJbMultiTerminalRedeemTokensOf() + useWriteJbMultiTerminalCashOutTokensOf() const { writeContractAsync: writeBurnTokens } = useWriteJbControllerBurnTokensOf() @@ -157,8 +157,8 @@ export function V4BurnOrRedeemModal({ args: [ userAddress, BigInt(projectId), - NATIVE_TOKEN, redeemAmountBigInt, + NATIVE_TOKEN, 0n, userAddress, '0x0', @@ -278,7 +278,7 @@ export function V4BurnOrRedeemModal({ contentStyle={{ display: 'block', textAlign: 'right' }} > Redemption rate}> - {rulesetMetadata?.redemptionRate.formatPercentage()} + {rulesetMetadata?.cashOutTaxRate.formatPercentage()} { const redemptionEnabled = React.useMemo(() => { if (!rulesetMetadata || payoutLimit.isLoading) return - // TODO: Update redemptionRate to be cashOut + // TODO: Update cashOutTaxRate to be cashOut return ( - rulesetMetadata.redemptionRate.value > 0 && + rulesetMetadata.cashOutTaxRate.value > 0 && payoutLimit.data.amount !== MAX_PAYOUT_LIMIT ) }, [payoutLimit.data.amount, payoutLimit.isLoading, rulesetMetadata]) diff --git a/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4TokensPanel/hooks/useV4BalanceMenuItemsUserFlags.ts b/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4TokensPanel/hooks/useV4BalanceMenuItemsUserFlags.ts index f34cdd73b0..348d6301f8 100644 --- a/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4TokensPanel/hooks/useV4BalanceMenuItemsUserFlags.ts +++ b/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4TokensPanel/hooks/useV4BalanceMenuItemsUserFlags.ts @@ -22,10 +22,10 @@ export const useV4BalanceMenuItemsUserFlags = () => { () => !!(surplusInNativeToken && surplusInNativeToken > 0n), [surplusInNativeToken], ) - const redemptionRateIsZero = !!(rulesetMetadata && rulesetMetadata.redemptionRate.value === 0n) + const cashOutTaxRateIsZero = !!(rulesetMetadata && rulesetMetadata.cashOutTaxRate.value === 0n) const redeemDisabled = useMemo( - () => !hasOverflow || redemptionRateIsZero, - [hasOverflow, redemptionRateIsZero], + () => !hasOverflow || cashOutTaxRateIsZero, + [hasOverflow, cashOutTaxRateIsZero], ) const projectHasIssuedTokens = useMemo( () => !!tokenAddress && !isZeroAddress(tokenAddress), diff --git a/src/packages/v4/views/V4ProjectSettings/EditCyclePage/EditCycleFormFields.ts b/src/packages/v4/views/V4ProjectSettings/EditCyclePage/EditCycleFormFields.ts index 487731c211..e8a8fb2c14 100644 --- a/src/packages/v4/views/V4ProjectSettings/EditCyclePage/EditCycleFormFields.ts +++ b/src/packages/v4/views/V4ProjectSettings/EditCyclePage/EditCycleFormFields.ts @@ -23,8 +23,8 @@ type TokenSectionFields = { issuanceRate: number reservedPercent: number // percentage reservedTokensSplits: JBSplit[] - decayPercent: number // "Discount / Issuance reduction rate" - redemptionRate: number + weightCutPercent: number // "Discount / Issuance reduction rate" + cashOutTaxRate: number allowOwnerMinting: boolean tokenTransfers: boolean } diff --git a/src/packages/v4/views/V4ProjectSettings/EditCyclePage/ReviewConfirmModal/hooks/useTokensSectionValues.ts b/src/packages/v4/views/V4ProjectSettings/EditCyclePage/ReviewConfirmModal/hooks/useTokensSectionValues.ts index 934f2a791e..a6c196c22f 100644 --- a/src/packages/v4/views/V4ProjectSettings/EditCyclePage/ReviewConfirmModal/hooks/useTokensSectionValues.ts +++ b/src/packages/v4/views/V4ProjectSettings/EditCyclePage/ReviewConfirmModal/hooks/useTokensSectionValues.ts @@ -28,16 +28,16 @@ export const useTokensSectionValues = () => { const newReservedRate = formValues.reservedPercent const newReservedSplits = formValues.reservedTokensSplits - const newDiscountRate = formValues.decayPercent - const newRedemptionRate = formValues.redemptionRate + const newDiscountRate = formValues.weightCutPercent + const newRedemptionRate = formValues.cashOutTaxRate const newAllowMinting = formValues.allowOwnerMinting const newTokenTransfers = formValues.tokenTransfers const currentMintRate = initialFormData?.issuanceRate const currentReservedRate = initialFormData?.reservedPercent const currentReservedSplits = initialFormData?.reservedTokensSplits - const currentDiscountRate = initialFormData?.decayPercent - const currentRedemptionRate = initialFormData?.redemptionRate + const currentDiscountRate = initialFormData?.weightCutPercent + const currentRedemptionRate = initialFormData?.cashOutTaxRate const currentAllowMinting = Boolean(initialFormData?.allowOwnerMinting) const currentTokenTransfers = Boolean( initialFormData?.tokenTransfers, diff --git a/src/packages/v4/views/V4ProjectSettings/EditCyclePage/TokensSection/IssuanceRateReductionField.tsx b/src/packages/v4/views/V4ProjectSettings/EditCyclePage/TokensSection/IssuanceRateReductionField.tsx index 5f472d64b2..c3e4e76f5d 100644 --- a/src/packages/v4/views/V4ProjectSettings/EditCyclePage/TokensSection/IssuanceRateReductionField.tsx +++ b/src/packages/v4/views/V4ProjectSettings/EditCyclePage/TokensSection/IssuanceRateReductionField.tsx @@ -13,7 +13,7 @@ export function IssuanceRateReductionField() { // Issurance reduction rate % const issuanceReductionRate = - editCycleForm?.getFieldValue('decayPercent') ?? (0 as number) + editCycleForm?.getFieldValue('weightCutPercent') ?? (0 as number) const [ issuanceReductionRateSwitchEnabled, @@ -41,12 +41,12 @@ export function IssuanceRateReductionField() { setIssuanceReductionRateSwitchEnabled(val) setFormHasUpdated(true) if (!val) { - editCycleForm?.setFieldsValue({ decayPercent: 0 }) + editCycleForm?.setFieldsValue({ weightCutPercent: 0 }) } }} /> {issuanceReductionRateSwitchEnabled ? ( - + ) : null} ) diff --git a/src/packages/v4/views/V4ProjectSettings/EditCyclePage/TokensSection/RedemptionRateField.tsx b/src/packages/v4/views/V4ProjectSettings/EditCyclePage/TokensSection/RedemptionRateField.tsx index d0fbb6f64c..42612e0194 100644 --- a/src/packages/v4/views/V4ProjectSettings/EditCyclePage/TokensSection/RedemptionRateField.tsx +++ b/src/packages/v4/views/V4ProjectSettings/EditCyclePage/TokensSection/RedemptionRateField.tsx @@ -18,11 +18,11 @@ export function RedemptionRateField() { const { editCycleForm, setFormHasUpdated } = useEditCycleFormContext() // Redemption rate % - const redemptionReductionRate = useWatch('redemptionRate', editCycleForm) + const redemptionReductionRate = useWatch('cashOutTaxRate', editCycleForm) - const [redemptionRateSwitchEnabled, setRedemptionRateSwitchEnabled] = + const [cashOutTaxRateSwitchEnabled, setRedemptionRateSwitchEnabled] = useState( - (editCycleForm?.getFieldValue('redemptionRate') ?? 100) > 0, + (editCycleForm?.getFieldValue('cashOutTaxRate') ?? 100) > 0, ) return (
@@ -38,19 +38,19 @@ export function RedemptionRateField() { } - value={redemptionRateSwitchEnabled} - extra={redemptionRateSwitchEnabled ? null : zeroPercentDisabledNoticed} + value={cashOutTaxRateSwitchEnabled} + extra={cashOutTaxRateSwitchEnabled ? null : zeroPercentDisabledNoticed} onChange={val => { setRedemptionRateSwitchEnabled(val) setFormHasUpdated(true) if (!val) { editCycleForm?.setFieldsValue({ - redemptionRate: 0, + cashOutTaxRate: 0, }) } }} /> - {redemptionRateSwitchEnabled ? ( + {cashOutTaxRateSwitchEnabled ? (
{ const reservedPercent = rulesetMetadata.reservedPercent.formatPercentage() // : DefaultTokenSettings.reservedTokensPercentage - const decayPercent = ruleset.decayPercent.formatPercentage() + const weightCutPercent = ruleset.weightCutPercent.formatPercentage() // : DefaultTokenSettings.discountRate - const redemptionRate = rulesetMetadata.redemptionRate.formatPercentage() - // : DefaultTokenSettings.redemptionRate + const cashOutTaxRate = rulesetMetadata.cashOutTaxRate.formatPercentage() + // : DefaultTokenSettings.cashOutTaxRate const allowOwnerMinting = rulesetMetadata.allowOwnerMinting // : DefaultTokenSettings.tokenMinting @@ -71,8 +71,8 @@ export const useLoadEditCycleData = () => { issuanceRate, reservedPercent, reservedTokensSplits, - decayPercent, - redemptionRate, + weightCutPercent, + cashOutTaxRate, allowOwnerMinting, tokenTransfers, // nftRewards: currentProjectData.nftRewards, diff --git a/yarn.lock b/yarn.lock index 865f9d123c..4033cfaf8f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12178,18 +12178,18 @@ jsx-ast-utils@^3.3.5: object.assign "^4.1.4" object.values "^1.1.6" -juice-sdk-core@^11.6.0-alpha: - version "11.6.0-alpha" - resolved "https://registry.yarnpkg.com/juice-sdk-core/-/juice-sdk-core-11.6.0-alpha.tgz#10f8e5a1a76dcebd04efd7ddb41cac14579b8848" - integrity sha512-rQlcDLCklIOWJ7/M9pE2AP1nU8/ca9oOu+MAa1mpCB36zHMg1YHh2dcgJtmda1wDK1I7dnqvcHbVMyYyVf8nqw== +juice-sdk-core@^12.0.1-alpha: + version "12.0.1-alpha" + resolved "https://registry.yarnpkg.com/juice-sdk-core/-/juice-sdk-core-12.0.1-alpha.tgz#72622f2d63e6e7eae4b37cdd4d32142387997111" + integrity sha512-6tydUNfUicI/6awFkX8k7NKQPKkHCPRzv0uRlVGPG7fpSv77OFHpanX66znSFqQdiz3hsRxG8/maoIK4FPu/pA== dependencies: bs58 "^5.0.0" fpnum "^1.0.0" -juice-sdk-react@^11.7.1-alpha: - version "11.7.1-alpha" - resolved "https://registry.yarnpkg.com/juice-sdk-react/-/juice-sdk-react-11.7.1-alpha.tgz#47f34a44adb415738a32d0484718e0a32eab8e3d" - integrity sha512-ILWXbLBgN7KXbFA+0bSavPceYrmo0C/FiOpQKA6h0HLXj8Eu4Qrj4GG5jwcegPSQrGjR49vCQhmMMP0KGCXKbQ== +juice-sdk-react@^12.0.1-alpha: + version "12.0.1-alpha" + resolved "https://registry.yarnpkg.com/juice-sdk-react/-/juice-sdk-react-12.0.1-alpha.tgz#91b7031649f64617f2f43129f10a44249baabcca" + integrity sha512-GKXlDUlzuvpX1P8pLJc6wlmEK1CRG1XKCovUdyQygFdrX/3xw2p7jTy2KtghyS+wHJo4nA/OuLUlKABaUiNiqA== juice@^10.0.0: version "10.0.0" From 6ebe0b62ed7702215692d9c214f1aa43a6e6d27c Mon Sep 17 00:00:00 2001 From: aeolian <94939382+aeolianeth@users.noreply.github.com> Date: Mon, 16 Dec 2024 09:12:50 +1000 Subject: [PATCH 2/4] No hardcoded deploy addresses --- package.json | 4 +-- .../transactor/useLaunchProjectWithNftsTx.ts | 30 +++-------------- src/packages/v4/hooks/useLaunchProjectTx.ts | 32 +++---------------- yarn.lock | 16 +++++----- 4 files changed, 19 insertions(+), 63 deletions(-) diff --git a/package.json b/package.json index 314e76293f..a8739be052 100644 --- a/package.json +++ b/package.json @@ -106,8 +106,8 @@ "graphql": "^16.8.1", "he": "^1.2.0", "jsonwebtoken": "^9.0.0", - "juice-sdk-core": "^12.0.1-alpha", - "juice-sdk-react": "^12.0.1-alpha", + "juice-sdk-core": "^12.1.0-alpha", + "juice-sdk-react": "^12.1.0-alpha", "juicebox-metadata-helper": "0.1.7", "less": "4.1.2", "lodash": "^4.17.21", diff --git a/src/packages/v4/hooks/JB721Delegate/transactor/useLaunchProjectWithNftsTx.ts b/src/packages/v4/hooks/JB721Delegate/transactor/useLaunchProjectWithNftsTx.ts index 9558d5bbc6..adb5102274 100644 --- a/src/packages/v4/hooks/JB721Delegate/transactor/useLaunchProjectWithNftsTx.ts +++ b/src/packages/v4/hooks/JB721Delegate/transactor/useLaunchProjectWithNftsTx.ts @@ -4,6 +4,7 @@ import { TxHistoryContext } from 'contexts/Transaction/TxHistoryContext' import { useWallet } from 'hooks/Wallet' import { DEFAULT_MEMO, + jbProjectDeploymentAddresses, NATIVE_TOKEN, NATIVE_TOKEN_DECIMALS, } from 'juice-sdk-core' @@ -23,22 +24,12 @@ import { useContext } from 'react' import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/shared/v2ProjectDefaultState' import { ipfsUri } from 'utils/ipfs' import { Address, WaitForTransactionReceiptReturnType, zeroAddress } from 'viem' -import { - arbitrumSepolia, - baseSepolia, - optimismSepolia, - sepolia, -} from 'viem/chains' import { useChainId } from 'wagmi' import { LaunchV2V3ProjectArgs, transformV2V3CreateArgsToV4, } from '../../../utils/launchProjectTransformers' -import { - LaunchTxOpts, - SUPPORTED_JB_CONTROLLER_ADDRESS, - SUPPORTED_JB_MULTITERMINAL_ADDRESS, -} from '../../useLaunchProjectTx' +import { LaunchTxOpts } from '../../useLaunchProjectTx' /** * Return the project ID created from a `launchProjectFor` transaction. @@ -54,17 +45,6 @@ export const getProjectIdFromNftLaunchReceipt = ( return projectId } -/** - * The contract addresses to use for deployment - * @todo not ideal to hardcode these addresses - */ -export const SUPPORTED_JB_721_TIER_STORE = { - [sepolia.id]: '0x4DeF0AA5B9CA095d11705284221b2878731ab4EF' as Address, - [optimismSepolia.id]: '0x4DeF0AA5B9CA095d11705284221b2878731ab4EF' as Address, - [arbitrumSepolia.id]: '0x4DeF0AA5B9CA095d11705284221b2878731ab4EF' as Address, - [baseSepolia.id]: '0x4DeF0AA5B9CA095d11705284221b2878731ab4EF' as Address, -} - export function useLaunchProjectWithNftsTx() { const { contracts } = useJBContractContext() const { addTransaction } = useContext(TxHistoryContext) @@ -73,13 +53,13 @@ export function useLaunchProjectWithNftsTx() { const chainId = useChainId() const defaultJBController = chainId - ? SUPPORTED_JB_CONTROLLER_ADDRESS[chainId as JBChainId] + ? jbProjectDeploymentAddresses.JBController[chainId as JBChainId] : undefined const defaultJBETHPaymentTerminal = chainId - ? SUPPORTED_JB_MULTITERMINAL_ADDRESS[chainId as JBChainId] + ? jbProjectDeploymentAddresses.JBMultiTerminal[chainId as JBChainId] : undefined const JBTiered721DelegateStoreAddress = chainId - ? SUPPORTED_JB_721_TIER_STORE[chainId as JBChainId] + ? jbProjectDeploymentAddresses.JB721TiersHookStore[chainId as JBChainId] : undefined const { writeContractAsync: writeLaunchProject } = diff --git a/src/packages/v4/hooks/useLaunchProjectTx.ts b/src/packages/v4/hooks/useLaunchProjectTx.ts index 0b360772fd..8939386a4a 100644 --- a/src/packages/v4/hooks/useLaunchProjectTx.ts +++ b/src/packages/v4/hooks/useLaunchProjectTx.ts @@ -3,7 +3,7 @@ import { JUICEBOX_MONEY_PROJECT_METADATA_DOMAIN } from 'constants/metadataDomain import { DEFAULT_MEMO } from 'constants/transactionDefaults' import { TxHistoryContext } from 'contexts/Transaction/TxHistoryContext' import { useWallet } from 'hooks/Wallet' -import { NATIVE_TOKEN } from 'juice-sdk-core' +import { jbProjectDeploymentAddresses, NATIVE_TOKEN } from 'juice-sdk-core' import { JBChainId, useWriteJbControllerLaunchProjectFor, @@ -11,13 +11,7 @@ import { import { LaunchV2V3ProjectData } from 'packages/v2v3/hooks/transactor/useLaunchProjectTx' import { useCallback, useContext } from 'react' import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/shared/v2ProjectDefaultState' -import { Address, WaitForTransactionReceiptReturnType } from 'viem' -import { - arbitrumSepolia, - baseSepolia, - optimismSepolia, - sepolia, -} from 'viem/chains' +import { WaitForTransactionReceiptReturnType } from 'viem' import { useChainId } from 'wagmi' import { LaunchV2V3ProjectArgs, @@ -50,24 +44,6 @@ export const getProjectIdFromLaunchReceipt = ( return projectId } -/** - * The contract addresses to use for deployment - * @todo not ideal to hardcode these addresses - */ -export const SUPPORTED_JB_MULTITERMINAL_ADDRESS = { - [sepolia.id]: '0x4DeF0AA5B9CA095d11705284221b2878731ab4EF' as Address, - [optimismSepolia.id]: '0x4DeF0AA5B9CA095d11705284221b2878731ab4EF' as Address, - [arbitrumSepolia.id]: '0x4DeF0AA5B9CA095d11705284221b2878731ab4EF' as Address, - [baseSepolia.id]: '0x4DeF0AA5B9CA095d11705284221b2878731ab4EF' as Address, -} - -export const SUPPORTED_JB_CONTROLLER_ADDRESS = { - [sepolia.id]: '0x219A5cE6d1c512D5b050ad2E3d380b8746BE0Cb8' as Address, - [optimismSepolia.id]: '0x219A5cE6d1c512D5b050ad2E3d380b8746BE0Cb8' as Address, - [arbitrumSepolia.id]: '0x219A5cE6d1c512D5b050ad2E3d380b8746BE0Cb8' as Address, - [baseSepolia.id]: '0x219A5cE6d1c512D5b050ad2E3d380b8746BE0Cb8' as Address, -} - /** * Takes data in V2V3 format, converts it to v4 format and passes it to `writeLaunchProject` * @returns A function that deploys a project. @@ -79,11 +55,11 @@ export function useLaunchProjectTx() { const chainId = useChainId() const terminalAddress = chainId - ? SUPPORTED_JB_MULTITERMINAL_ADDRESS[chainId as JBChainId] + ? jbProjectDeploymentAddresses.JBMultiTerminal[chainId as JBChainId] : undefined const controllerAddress = chainId - ? SUPPORTED_JB_CONTROLLER_ADDRESS[chainId as JBChainId] + ? jbProjectDeploymentAddresses.JBController[chainId as JBChainId] : undefined const { addTransaction } = useContext(TxHistoryContext) diff --git a/yarn.lock b/yarn.lock index 4033cfaf8f..c428d2eddd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12178,18 +12178,18 @@ jsx-ast-utils@^3.3.5: object.assign "^4.1.4" object.values "^1.1.6" -juice-sdk-core@^12.0.1-alpha: - version "12.0.1-alpha" - resolved "https://registry.yarnpkg.com/juice-sdk-core/-/juice-sdk-core-12.0.1-alpha.tgz#72622f2d63e6e7eae4b37cdd4d32142387997111" - integrity sha512-6tydUNfUicI/6awFkX8k7NKQPKkHCPRzv0uRlVGPG7fpSv77OFHpanX66znSFqQdiz3hsRxG8/maoIK4FPu/pA== +juice-sdk-core@^12.1.0-alpha: + version "12.1.0-alpha" + resolved "https://registry.yarnpkg.com/juice-sdk-core/-/juice-sdk-core-12.1.0-alpha.tgz#016aefb05ac9c7aa395d91240746c250f366283c" + integrity sha512-uVe+sdZgA8/pudUGh4duGfduwguVqBW6ez01WcstSgq9mEtWOnoP4T9KVAxyp92xlhFO9MLoj3a0GJzRg0K+zg== dependencies: bs58 "^5.0.0" fpnum "^1.0.0" -juice-sdk-react@^12.0.1-alpha: - version "12.0.1-alpha" - resolved "https://registry.yarnpkg.com/juice-sdk-react/-/juice-sdk-react-12.0.1-alpha.tgz#91b7031649f64617f2f43129f10a44249baabcca" - integrity sha512-GKXlDUlzuvpX1P8pLJc6wlmEK1CRG1XKCovUdyQygFdrX/3xw2p7jTy2KtghyS+wHJo4nA/OuLUlKABaUiNiqA== +juice-sdk-react@^12.1.0-alpha: + version "12.1.0-alpha" + resolved "https://registry.yarnpkg.com/juice-sdk-react/-/juice-sdk-react-12.1.0-alpha.tgz#97630084c2deff402598e808a8ffe1acf45fd744" + integrity sha512-961BNlHuwJfeqbh08nUIxkhxDcNYOGaZmaiOwWm1vpFUW4MNTlv81qtuH1H+QUPUDPg8OQw/bfqXRADGFz/WJA== juice@^10.0.0: version "10.0.0" From e2cad5ae6aa3f4748b5786c5daeb2e3a099b922d Mon Sep 17 00:00:00 2001 From: aeolian <94939382+aeolianeth@users.noreply.github.com> Date: Thu, 19 Dec 2024 07:15:42 +1000 Subject: [PATCH 3/4] Compiles --- .../AddNftCollectionForm.tsx | 2 +- .../RewardsList/AddEditRewardModal.tsx | 2 +- .../NftRewards/RewardsList/RewardItem.tsx | 2 +- .../NftRewards/RewardsList/RewardsList.tsx | 2 +- .../formItems/ProjectDiscountRate.tsx | 2 +- src/components/formItems/ProjectReserved.tsx | 2 +- .../ReconfigureFCModal/ReconfigureFCModal.tsx | 2 +- .../v1/components/shared/forms/BudgetForm.tsx | 2 +- .../Create/components/Wizard/hooks/usePage.ts | 2 +- .../components/Wizard/hooks/useSteps.ts | 2 +- .../components/Wizard/hooks/useWizard.ts | 2 +- .../pages/FundingCycles/FundingCyclesPage.tsx | 2 +- .../hooks/useFundingCyclesForm.ts | 2 +- .../pages/NftRewards/NftRewardsPage.tsx | 2 +- .../hooks/useCreateFlowNftRewardsForm.ts | 2 +- .../pages/PayoutsPage/PayoutsPage.tsx | 2 +- .../components/TreasuryOptionsRadio.tsx | 2 +- .../ProjectDetails/ProjectDetailsPage.tsx | 2 +- .../hooks/useProjectDetailsForm.ts | 2 +- .../pages/ProjectToken/ProjectTokenPage.tsx | 2 +- .../ProjectToken/hooks/useProjectTokenForm.ts | 2 +- .../ReconfigurationRulesPage.tsx | 2 +- .../hooks/useReconfigurationRulesForm.ts | 2 +- .../pages/ReviewDeploy/ReviewDeployPage.tsx | 4 +-- .../hooks/useFundingConfigurationReview.ts | 2 +- .../RewardsReview/RewardsReview.tsx | 2 +- .../hooks/NFT/useDeployNftProject.ts | 2 +- .../hooks/DeployProject/useDeployProject.ts | 2 +- .../hooks/useLoadInitialStateFromQuery.ts | 6 ++-- .../projectTokenSettingsToReduxFormat.ts | 2 +- .../hooks/useEditingFundingCycleConfig.ts | 2 +- .../hooks/useInitialEditingData.ts | 4 +-- .../EditCyclePage/EditCycleFormFields.ts | 2 +- .../hooks/usePrepareSaveEditCycleData.tsx | 4 +-- .../hooks/useLaunchNftsForm.ts | 2 +- .../contexts/NftRewards/NftRewardsContext.ts | 4 +-- .../NftRewards/NftRewardsProvider.tsx | 2 +- .../transactor/useLaunchProjectWithNftsTx.ts | 28 ++++++++--------- ...seReconfigureV2V3FundingCycleWithNftsTx.ts | 20 ++++++------ .../hooks/transactor/useLaunchProjectTx.ts | 2 +- .../useReconfigureV2V3FundingCycleTx.ts | 2 +- .../Create/components/Wizard/hooks/usePage.ts | 2 +- .../components/Wizard/hooks/useSteps.ts | 2 +- .../components/Wizard/hooks/useWizard.ts | 2 +- .../pages/FundingCycles/FundingCyclesPage.tsx | 2 +- .../hooks/useFundingCyclesForm.ts | 2 +- .../pages/NftRewards/NftRewardsPage.tsx | 2 +- .../hooks/useCreateFlowNftRewardsForm.ts | 2 +- .../pages/PayoutsPage/PayoutsPage.tsx | 2 +- .../components/TreasuryOptionsRadio.tsx | 2 +- .../ProjectDetails/ProjectDetailsPage.tsx | 2 +- .../hooks/useProjectDetailsForm.ts | 2 +- .../pages/ProjectToken/ProjectTokenPage.tsx | 2 +- .../components/DefaultSettings.tsx | 16 +++++----- .../ProjectToken/hooks/useProjectTokenForm.ts | 22 ++++++------- .../ReconfigurationRulesPage.tsx | 2 +- .../hooks/useReconfigurationRulesForm.ts | 2 +- .../pages/ReviewDeploy/ReviewDeployPage.tsx | 4 +-- .../hooks/useFundingConfigurationReview.ts | 2 +- .../ProjectTokenReview/ProjectTokenReview.tsx | 10 +++--- .../hooks/useProjectTokenReview.ts | 8 ++--- .../RewardsReview/RewardsReview.tsx | 2 +- .../hooks/NFT/useDeployNftProject.ts | 2 +- .../hooks/DeployProject/useDeployProject.ts | 2 +- .../hooks/useLoadInitialStateFromQuery.ts | 12 +++---- .../projectTokenSettingsToReduxFormat.ts | 8 ++--- .../V4PayRedeemCard/RedeemConfiguration.tsx | 2 +- .../V4NftRewards/V4NftRewardsProvider.tsx | 4 +-- .../transactor/useLaunchProjectWithNftsTx.ts | 31 +++++++++++++++---- src/packages/v4/hooks/useLaunchProjectTx.ts | 14 ++++++--- src/packages/v4/utils/editRuleset.ts | 2 +- .../v4/utils/launchProjectTransformers.ts | 16 +++++----- .../hooks/useLaunchNftsForm.ts | 14 ++++----- src/redux/hooks/v2v3/create.ts | 2 +- .../useEditingCreateFurthestPageReached.ts | 2 +- src/redux/localStoragePreload.ts | 6 ++-- src/redux/slices/{ => v1}/editingProject.ts | 0 .../creatingV2Project/creatingV2Project.ts | 0 .../{ => v2v3}/creatingV2Project/index.ts | 1 + .../editingV2Project/editingV2Project.ts | 0 .../{ => v2v3}/editingV2Project/index.ts | 0 .../shared/v2ProjectDefaultState.ts | 0 .../shared/v2ProjectInitialReduxState.ts | 0 .../{ => v2v3}/shared/v2ProjectTypes.ts | 0 .../{ => v2v3}/shared/v2ProjectVersion.ts | 0 src/redux/store.ts | 6 ++-- 86 files changed, 189 insertions(+), 165 deletions(-) rename src/redux/hooks/{ => v2v3}/useEditingCreateFurthestPageReached.ts (95%) rename src/redux/slices/{ => v1}/editingProject.ts (100%) rename src/redux/slices/{ => v2v3}/creatingV2Project/creatingV2Project.ts (100%) rename src/redux/slices/{ => v2v3}/creatingV2Project/index.ts (99%) rename src/redux/slices/{ => v2v3}/editingV2Project/editingV2Project.ts (100%) rename src/redux/slices/{ => v2v3}/editingV2Project/index.ts (100%) rename src/redux/slices/{ => v2v3}/shared/v2ProjectDefaultState.ts (100%) rename src/redux/slices/{ => v2v3}/shared/v2ProjectInitialReduxState.ts (100%) rename src/redux/slices/{ => v2v3}/shared/v2ProjectTypes.ts (100%) rename src/redux/slices/{ => v2v3}/shared/v2ProjectVersion.ts (100%) diff --git a/src/components/NftRewards/AddNftCollectionForm/AddNftCollectionForm.tsx b/src/components/NftRewards/AddNftCollectionForm/AddNftCollectionForm.tsx index f31acc9273..00188d9435 100644 --- a/src/components/NftRewards/AddNftCollectionForm/AddNftCollectionForm.tsx +++ b/src/components/NftRewards/AddNftCollectionForm/AddNftCollectionForm.tsx @@ -9,7 +9,7 @@ import { NftRewardTier } from 'models/nftRewards' import { CreateCollapse } from 'packages/v2v3/components/Create/components/CreateCollapse/CreateCollapse' import { OptionalHeader } from 'packages/v2v3/components/Create/components/OptionalHeader' import { useLockPageRulesWrapper } from 'packages/v2v3/components/Create/hooks/useLockPageRulesWrapper' -import { NftRewardsData } from 'redux/slices/shared/v2ProjectTypes' +import { NftRewardsData } from 'redux/slices/v2v3/shared/v2ProjectTypes' import { inputMustExistRule } from 'utils/antdRules' import { RewardsList } from '../RewardsList/RewardsList' import { NftAdvancedFormItems } from './NftAdvancedFormItems' diff --git a/src/components/NftRewards/RewardsList/AddEditRewardModal.tsx b/src/components/NftRewards/RewardsList/AddEditRewardModal.tsx index c2eb1c4b8f..9c92f087d3 100644 --- a/src/components/NftRewards/RewardsList/AddEditRewardModal.tsx +++ b/src/components/NftRewards/RewardsList/AddEditRewardModal.tsx @@ -19,7 +19,7 @@ import { OptionalHeader } from 'packages/v2v3/components/Create/components/Optio import { DEFAULT_NFT_MAX_SUPPLY } from 'packages/v2v3/constants/nftRewards' import { UploadRequestOption } from 'rc-upload/lib/interface' import { useCallback, useEffect, useLayoutEffect, useState } from 'react' -import { NftRewardsData } from 'redux/slices/shared/v2ProjectTypes' +import { NftRewardsData } from 'redux/slices/v2v3/shared/v2ProjectTypes' import { inputIsIntegerRule, inputIsValidUrlRule, diff --git a/src/components/NftRewards/RewardsList/RewardItem.tsx b/src/components/NftRewards/RewardsList/RewardItem.tsx index 17e32c31b2..83205f33c9 100644 --- a/src/components/NftRewards/RewardsList/RewardItem.tsx +++ b/src/components/NftRewards/RewardsList/RewardItem.tsx @@ -7,7 +7,7 @@ import TooltipLabel from 'components/TooltipLabel' import round from 'lodash/round' import { NftRewardTier } from 'models/nftRewards' import { ReactNode } from 'react' -import { NftRewardsData } from 'redux/slices/shared/v2ProjectTypes' +import { NftRewardsData } from 'redux/slices/v2v3/shared/v2ProjectTypes' import { isZeroAddress } from 'utils/address' import { hasLimitedSupply } from 'utils/nftRewards' import { prettyUrl } from 'utils/url' diff --git a/src/components/NftRewards/RewardsList/RewardsList.tsx b/src/components/NftRewards/RewardsList/RewardsList.tsx index d0aa82efb9..7720dabbff 100644 --- a/src/components/NftRewards/RewardsList/RewardsList.tsx +++ b/src/components/NftRewards/RewardsList/RewardsList.tsx @@ -7,7 +7,7 @@ import { FormItemInput } from 'models/formItemInput' import { NftRewardTier } from 'models/nftRewards' import { MAX_NFT_REWARD_TIERS } from 'packages/v2v3/constants/nftRewards' import { createContext, useCallback, useContext, useState } from 'react' -import { NftRewardsData } from 'redux/slices/shared/v2ProjectTypes' +import { NftRewardsData } from 'redux/slices/v2v3/shared/v2ProjectTypes' import { sortNftsByContributionFloor } from 'utils/nftRewards' import { AddEditRewardModal } from './AddEditRewardModal' import { useRewards } from './hooks/useRewards' diff --git a/src/components/formItems/ProjectDiscountRate.tsx b/src/components/formItems/ProjectDiscountRate.tsx index b04de8bb58..54fcaa5c84 100644 --- a/src/components/formItems/ProjectDiscountRate.tsx +++ b/src/components/formItems/ProjectDiscountRate.tsx @@ -3,7 +3,7 @@ import { Form, Switch } from 'antd' import FormItemLabel from 'components/FormItemLabel' import FormItemWarningText from 'components/FormItemWarningText' import { DISCOUNT_RATE_EXPLANATION } from 'components/strings' -import { DEFAULT_FUNDING_CYCLE_DATA } from 'redux/slices/shared/v2ProjectDefaultState' +import { DEFAULT_FUNDING_CYCLE_DATA } from 'redux/slices/v2v3/shared/v2ProjectDefaultState' import NumberSlider from '../inputs/NumberSlider' import { FormItemExt } from './formItemExt' diff --git a/src/components/formItems/ProjectReserved.tsx b/src/components/formItems/ProjectReserved.tsx index 9193478a24..cef4334d81 100644 --- a/src/components/formItems/ProjectReserved.tsx +++ b/src/components/formItems/ProjectReserved.tsx @@ -15,7 +15,7 @@ import { useState } from 'react' import { DEFAULT_FUNDING_CYCLE_METADATA, DEFAULT_MINT_RATE, -} from 'redux/slices/shared/v2ProjectDefaultState' +} from 'redux/slices/v2v3/shared/v2ProjectDefaultState' import { formattedNum } from 'utils/format/formatNumber' import NumberSlider from '../inputs/NumberSlider' import FundingCycleDetailWarning from '../Project/FundingCycleDetailWarning' diff --git a/src/packages/v1/components/V1Project/modals/ReconfigureFCModal/ReconfigureFCModal.tsx b/src/packages/v1/components/V1Project/modals/ReconfigureFCModal/ReconfigureFCModal.tsx index 1c4e774cc9..6f0c9040c5 100644 --- a/src/packages/v1/components/V1Project/modals/ReconfigureFCModal/ReconfigureFCModal.tsx +++ b/src/packages/v1/components/V1Project/modals/ReconfigureFCModal/ReconfigureFCModal.tsx @@ -42,7 +42,7 @@ import { serializeV1FundingCycle } from 'packages/v1/utils/serializers' import { useCallback, useContext, useLayoutEffect, useState } from 'react' import { useAppDispatch } from 'redux/hooks/useAppDispatch' import { useEditingV1FundingCycleSelector } from 'redux/hooks/v1' -import { editingProjectActions } from 'redux/slices/editingProject' +import { editingProjectActions } from 'redux/slices/v1/editingProject' import { classNames } from 'utils/classNames' import { drawerWidth } from 'utils/drawerWidth' import { diff --git a/src/packages/v1/components/shared/forms/BudgetForm.tsx b/src/packages/v1/components/shared/forms/BudgetForm.tsx index 8a68aa6ad8..ca1f9c30f4 100644 --- a/src/packages/v1/components/shared/forms/BudgetForm.tsx +++ b/src/packages/v1/components/shared/forms/BudgetForm.tsx @@ -17,7 +17,7 @@ import { import { useContext, useLayoutEffect, useMemo, useState } from 'react' import { useAppDispatch } from 'redux/hooks/useAppDispatch' import { useEditingV1FundingCycleSelector } from 'redux/hooks/v1' -import { editingProjectActions } from 'redux/slices/editingProject' +import { editingProjectActions } from 'redux/slices/v1/editingProject' import { fromWad } from 'utils/format/formatNumber' import { helpPagePath } from 'utils/helpPagePath' diff --git a/src/packages/v2v3/components/Create/components/Wizard/hooks/usePage.ts b/src/packages/v2v3/components/Create/components/Wizard/hooks/usePage.ts index 164f6bc00f..b31a87de0e 100644 --- a/src/packages/v2v3/components/Create/components/Wizard/hooks/usePage.ts +++ b/src/packages/v2v3/components/Create/components/Wizard/hooks/usePage.ts @@ -1,7 +1,7 @@ import { CreatePage } from 'models/createPage' import { useCallback, useContext, useMemo } from 'react' import { useAppDispatch } from 'redux/hooks/useAppDispatch' -import { creatingV2ProjectActions } from 'redux/slices/creatingV2Project' +import { creatingV2ProjectActions } from 'redux/slices/v2v3/creatingV2Project' import { WizardContext } from '../contexts/WizardContext' export const usePage = ({ name }: { name: string }) => { diff --git a/src/packages/v2v3/components/Create/components/Wizard/hooks/useSteps.ts b/src/packages/v2v3/components/Create/components/Wizard/hooks/useSteps.ts index cf35d259a1..bd8eb0466a 100644 --- a/src/packages/v2v3/components/Create/components/Wizard/hooks/useSteps.ts +++ b/src/packages/v2v3/components/Create/components/Wizard/hooks/useSteps.ts @@ -2,7 +2,7 @@ import { t } from '@lingui/macro' import { CreatePage } from 'models/createPage' import { useCallback, useContext, useMemo } from 'react' import { useAppSelector } from 'redux/hooks/useAppSelector' -import { useEditingCreateFurthestPageReached } from 'redux/hooks/useEditingCreateFurthestPageReached' +import { useEditingCreateFurthestPageReached } from 'redux/hooks/v2v3/useEditingCreateFurthestPageReached' import { WizardContext } from '../contexts/WizardContext' const stepNames = (): Record => { diff --git a/src/packages/v2v3/components/Create/components/Wizard/hooks/useWizard.ts b/src/packages/v2v3/components/Create/components/Wizard/hooks/useWizard.ts index fb995801e9..7c6caa20d1 100644 --- a/src/packages/v2v3/components/Create/components/Wizard/hooks/useWizard.ts +++ b/src/packages/v2v3/components/Create/components/Wizard/hooks/useWizard.ts @@ -1,7 +1,7 @@ import { CreatePage } from 'models/createPage' import { useCallback, useEffect, useMemo, useState } from 'react' import { useAppSelector } from 'redux/hooks/useAppSelector' -import { useEditingCreateFurthestPageReached } from 'redux/hooks/useEditingCreateFurthestPageReached' +import { useEditingCreateFurthestPageReached } from 'redux/hooks/v2v3/useEditingCreateFurthestPageReached' import { PageProps } from '../Page' const isPage = (element: PageProps | undefined) => { diff --git a/src/packages/v2v3/components/Create/components/pages/FundingCycles/FundingCyclesPage.tsx b/src/packages/v2v3/components/Create/components/pages/FundingCycles/FundingCyclesPage.tsx index 7caef86242..58deda34e8 100644 --- a/src/packages/v2v3/components/Create/components/pages/FundingCycles/FundingCyclesPage.tsx +++ b/src/packages/v2v3/components/Create/components/pages/FundingCycles/FundingCyclesPage.tsx @@ -15,7 +15,7 @@ import moment from 'moment' import Link from 'next/link' import { useLockPageRulesWrapper } from 'packages/v2v3/components/Create/hooks/useLockPageRulesWrapper' import { useContext, useEffect } from 'react' -import { useSetCreateFurthestPageReached } from 'redux/hooks/useEditingCreateFurthestPageReached' +import { useSetCreateFurthestPageReached } from 'redux/hooks/v2v3/useEditingCreateFurthestPageReached' import { durationMustExistRule } from 'utils/antdRules' import { CreateBadge } from '../../CreateBadge' import { CreateCollapse } from '../../CreateCollapse/CreateCollapse' diff --git a/src/packages/v2v3/components/Create/components/pages/FundingCycles/hooks/useFundingCyclesForm.ts b/src/packages/v2v3/components/Create/components/pages/FundingCycles/hooks/useFundingCyclesForm.ts index 0f3760b486..014f2e0e15 100644 --- a/src/packages/v2v3/components/Create/components/pages/FundingCycles/hooks/useFundingCyclesForm.ts +++ b/src/packages/v2v3/components/Create/components/pages/FundingCycles/hooks/useFundingCyclesForm.ts @@ -7,7 +7,7 @@ import { useAppSelector } from 'redux/hooks/useAppSelector' import { DEFAULT_MUST_START_AT_OR_AFTER, creatingV2ProjectActions, -} from 'redux/slices/creatingV2Project' +} from 'redux/slices/v2v3/creatingV2Project' import { deriveDurationUnit, otherUnitToSeconds, diff --git a/src/packages/v2v3/components/Create/components/pages/NftRewards/NftRewardsPage.tsx b/src/packages/v2v3/components/Create/components/pages/NftRewards/NftRewardsPage.tsx index ca917a589b..b5ddc60b42 100644 --- a/src/packages/v2v3/components/Create/components/pages/NftRewards/NftRewardsPage.tsx +++ b/src/packages/v2v3/components/Create/components/pages/NftRewards/NftRewardsPage.tsx @@ -4,7 +4,7 @@ import { trackFathomGoal } from 'lib/fathom' import { V2V3_CURRENCY_USD } from 'packages/v2v3/utils/currency' import { useContext } from 'react' import { useAppSelector } from 'redux/hooks/useAppSelector' -import { useSetCreateFurthestPageReached } from 'redux/hooks/useEditingCreateFurthestPageReached' +import { useSetCreateFurthestPageReached } from 'redux/hooks/v2v3/useEditingCreateFurthestPageReached' import { PageContext } from '../../Wizard/contexts/PageContext' import { Wizard } from '../../Wizard/Wizard' import { useCreateFlowNftRewardsForm } from './hooks/useCreateFlowNftRewardsForm' diff --git a/src/packages/v2v3/components/Create/components/pages/NftRewards/hooks/useCreateFlowNftRewardsForm.ts b/src/packages/v2v3/components/Create/components/pages/NftRewards/hooks/useCreateFlowNftRewardsForm.ts index 4bd4f9a295..a9c059f8e9 100644 --- a/src/packages/v2v3/components/Create/components/pages/NftRewards/hooks/useCreateFlowNftRewardsForm.ts +++ b/src/packages/v2v3/components/Create/components/pages/NftRewards/hooks/useCreateFlowNftRewardsForm.ts @@ -4,7 +4,7 @@ import { NftRewardTier } from 'models/nftRewards' import { useEffect, useMemo } from 'react' import { useAppDispatch } from 'redux/hooks/useAppDispatch' import { useAppSelector } from 'redux/hooks/useAppSelector' -import { creatingV2ProjectActions } from 'redux/slices/creatingV2Project' +import { creatingV2ProjectActions } from 'redux/slices/v2v3/creatingV2Project' import { withHttps, withoutHttp } from 'utils/externalLink' import { defaultNftCollectionDescription, diff --git a/src/packages/v2v3/components/Create/components/pages/PayoutsPage/PayoutsPage.tsx b/src/packages/v2v3/components/Create/components/pages/PayoutsPage/PayoutsPage.tsx index 6134864242..39fdcc8dd2 100644 --- a/src/packages/v2v3/components/Create/components/pages/PayoutsPage/PayoutsPage.tsx +++ b/src/packages/v2v3/components/Create/components/pages/PayoutsPage/PayoutsPage.tsx @@ -1,6 +1,6 @@ import { useContext } from 'react' import { useAppSelector } from 'redux/hooks/useAppSelector' -import { useSetCreateFurthestPageReached } from 'redux/hooks/useEditingCreateFurthestPageReached' +import { useSetCreateFurthestPageReached } from 'redux/hooks/v2v3/useEditingCreateFurthestPageReached' import { Wizard } from '../../Wizard/Wizard' import { PageContext } from '../../Wizard/contexts/PageContext' import { CreateFlowPayoutsTable } from './components/CreateFlowPayoutsTable' diff --git a/src/packages/v2v3/components/Create/components/pages/PayoutsPage/components/TreasuryOptionsRadio.tsx b/src/packages/v2v3/components/Create/components/pages/PayoutsPage/components/TreasuryOptionsRadio.tsx index 6327320d90..bec9c847e8 100644 --- a/src/packages/v2v3/components/Create/components/pages/PayoutsPage/components/TreasuryOptionsRadio.tsx +++ b/src/packages/v2v3/components/Create/components/pages/PayoutsPage/components/TreasuryOptionsRadio.tsx @@ -13,7 +13,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react' import { useAppDispatch } from 'redux/hooks/useAppDispatch' import { useAppSelector } from 'redux/hooks/useAppSelector' import { ReduxDistributionLimit } from 'redux/hooks/v2v3/shared' -import { creatingV2ProjectActions } from 'redux/slices/creatingV2Project' +import { creatingV2ProjectActions } from 'redux/slices/v2v3/creatingV2Project' import { fromWad } from 'utils/format/formatNumber' import { Icons } from '../../../Icons' import { RadioCard } from './RadioCard' diff --git a/src/packages/v2v3/components/Create/components/pages/ProjectDetails/ProjectDetailsPage.tsx b/src/packages/v2v3/components/Create/components/pages/ProjectDetails/ProjectDetailsPage.tsx index ae8d94bb48..dfb17e8914 100644 --- a/src/packages/v2v3/components/Create/components/pages/ProjectDetails/ProjectDetailsPage.tsx +++ b/src/packages/v2v3/components/Create/components/pages/ProjectDetails/ProjectDetailsPage.tsx @@ -21,7 +21,7 @@ import { V2V3_CURRENCY_USD, } from 'packages/v2v3/utils/currency' import { useCallback, useContext, useMemo, useState } from 'react' -import { useSetCreateFurthestPageReached } from 'redux/hooks/useEditingCreateFurthestPageReached' +import { useSetCreateFurthestPageReached } from 'redux/hooks/v2v3/useEditingCreateFurthestPageReached' import { inputMustBeEthAddressRule, inputMustExistRule } from 'utils/antdRules' import { inputIsLengthRule } from 'utils/antdRules/inputIsLengthRule' import { CreateCollapse } from '../../CreateCollapse/CreateCollapse' diff --git a/src/packages/v2v3/components/Create/components/pages/ProjectDetails/hooks/useProjectDetailsForm.ts b/src/packages/v2v3/components/Create/components/pages/ProjectDetails/hooks/useProjectDetailsForm.ts index 115903809a..641cfa1a21 100644 --- a/src/packages/v2v3/components/Create/components/pages/ProjectDetails/hooks/useProjectDetailsForm.ts +++ b/src/packages/v2v3/components/Create/components/pages/ProjectDetails/hooks/useProjectDetailsForm.ts @@ -9,7 +9,7 @@ import { useAppSelector } from 'redux/hooks/useAppSelector' import { DEFAULT_MUST_START_AT_OR_AFTER, creatingV2ProjectActions, -} from 'redux/slices/creatingV2Project' +} from 'redux/slices/v2v3/creatingV2Project' import { useFormDispatchWatch } from '../../hooks/useFormDispatchWatch' import { AmountInputValue } from '../ProjectDetailsPage' diff --git a/src/packages/v2v3/components/Create/components/pages/ProjectToken/ProjectTokenPage.tsx b/src/packages/v2v3/components/Create/components/pages/ProjectToken/ProjectTokenPage.tsx index f28ba94cac..4ef805ee08 100644 --- a/src/packages/v2v3/components/Create/components/pages/ProjectToken/ProjectTokenPage.tsx +++ b/src/packages/v2v3/components/Create/components/pages/ProjectToken/ProjectTokenPage.tsx @@ -6,7 +6,7 @@ import { Callout } from 'components/Callout/Callout' import { CREATE_FLOW } from 'constants/fathomEvents' import { trackFathomGoal } from 'lib/fathom' import { useContext, useEffect } from 'react' -import { useSetCreateFurthestPageReached } from 'redux/hooks/useEditingCreateFurthestPageReached' +import { useSetCreateFurthestPageReached } from 'redux/hooks/v2v3/useEditingCreateFurthestPageReached' import { CreateBadge } from '../../CreateBadge' import { Icons } from '../../Icons' import { Selection } from '../../Selection/Selection' diff --git a/src/packages/v2v3/components/Create/components/pages/ProjectToken/hooks/useProjectTokenForm.ts b/src/packages/v2v3/components/Create/components/pages/ProjectToken/hooks/useProjectTokenForm.ts index 0537cdb63c..b704a44e3b 100644 --- a/src/packages/v2v3/components/Create/components/pages/ProjectToken/hooks/useProjectTokenForm.ts +++ b/src/packages/v2v3/components/Create/components/pages/ProjectToken/hooks/useProjectTokenForm.ts @@ -25,7 +25,7 @@ import { useCreatingDistributionLimit, useCreatingReservedTokensSplits, } from 'redux/hooks/v2v3/create' -import { creatingV2ProjectActions } from 'redux/slices/creatingV2Project' +import { creatingV2ProjectActions } from 'redux/slices/v2v3/creatingV2Project' import { useFormDispatchWatch } from '../../hooks/useFormDispatchWatch' export type ProjectTokensFormProps = Partial<{ diff --git a/src/packages/v2v3/components/Create/components/pages/ReconfigurationRules/ReconfigurationRulesPage.tsx b/src/packages/v2v3/components/Create/components/pages/ReconfigurationRules/ReconfigurationRulesPage.tsx index bf24fbeb3a..4fb60afc44 100644 --- a/src/packages/v2v3/components/Create/components/pages/ReconfigurationRules/ReconfigurationRulesPage.tsx +++ b/src/packages/v2v3/components/Create/components/pages/ReconfigurationRules/ReconfigurationRulesPage.tsx @@ -19,7 +19,7 @@ import { trackFathomGoal } from 'lib/fathom' import { Selection } from 'packages/v2v3/components/Create/components/Selection/Selection' import { useAvailableReconfigurationStrategies } from 'packages/v2v3/components/Create/hooks/useAvailableReconfigurationStrategies' import { useContext } from 'react' -import { useSetCreateFurthestPageReached } from 'redux/hooks/useEditingCreateFurthestPageReached' +import { useSetCreateFurthestPageReached } from 'redux/hooks/v2v3/useEditingCreateFurthestPageReached' import { featureFlagEnabled } from 'utils/featureFlags' import { CreateCollapse } from '../../CreateCollapse/CreateCollapse' import { PageContext } from '../../Wizard/contexts/PageContext' diff --git a/src/packages/v2v3/components/Create/components/pages/ReconfigurationRules/hooks/useReconfigurationRulesForm.ts b/src/packages/v2v3/components/Create/components/pages/ReconfigurationRules/hooks/useReconfigurationRulesForm.ts index 92bd9755d7..d6c37e58d3 100644 --- a/src/packages/v2v3/components/Create/components/pages/ReconfigurationRules/hooks/useReconfigurationRulesForm.ts +++ b/src/packages/v2v3/components/Create/components/pages/ReconfigurationRules/hooks/useReconfigurationRulesForm.ts @@ -6,7 +6,7 @@ import { useAvailableReconfigurationStrategies } from 'packages/v2v3/components/ import { useEffect, useMemo } from 'react' import { useAppDispatch } from 'redux/hooks/useAppDispatch' import { useAppSelector } from 'redux/hooks/useAppSelector' -import { creatingV2ProjectActions } from 'redux/slices/creatingV2Project' +import { creatingV2ProjectActions } from 'redux/slices/v2v3/creatingV2Project' import { isEqualAddress, isZeroAddress } from 'utils/address' import { useFormDispatchWatch } from '../../hooks/useFormDispatchWatch' diff --git a/src/packages/v2v3/components/Create/components/pages/ReviewDeploy/ReviewDeployPage.tsx b/src/packages/v2v3/components/Create/components/pages/ReviewDeploy/ReviewDeployPage.tsx index cd06e55bb2..8c4bd62dcf 100644 --- a/src/packages/v2v3/components/Create/components/pages/ReviewDeploy/ReviewDeployPage.tsx +++ b/src/packages/v2v3/components/Create/components/pages/ReviewDeploy/ReviewDeployPage.tsx @@ -14,8 +14,8 @@ import { useDeployProject } from 'packages/v2v3/components/Create/hooks/DeployPr import { useCallback, useContext, useEffect, useMemo, useState } from 'react' import { useDispatch } from 'react-redux' import { useAppSelector } from 'redux/hooks/useAppSelector' -import { useSetCreateFurthestPageReached } from 'redux/hooks/useEditingCreateFurthestPageReached' -import { creatingV2ProjectActions } from 'redux/slices/creatingV2Project' +import { useSetCreateFurthestPageReached } from 'redux/hooks/v2v3/useEditingCreateFurthestPageReached' +import { creatingV2ProjectActions } from 'redux/slices/v2v3/creatingV2Project' import { helpPagePath } from 'utils/helpPagePath' import { CreateBadge } from '../../CreateBadge' import { CreateCollapse } from '../../CreateCollapse/CreateCollapse' diff --git a/src/packages/v2v3/components/Create/components/pages/ReviewDeploy/components/FundingConfigurationReview/hooks/useFundingConfigurationReview.ts b/src/packages/v2v3/components/Create/components/pages/ReviewDeploy/components/FundingConfigurationReview/hooks/useFundingConfigurationReview.ts index 2ef2f54203..dc9a31591f 100644 --- a/src/packages/v2v3/components/Create/components/pages/ReviewDeploy/components/FundingConfigurationReview/hooks/useFundingConfigurationReview.ts +++ b/src/packages/v2v3/components/Create/components/pages/ReviewDeploy/components/FundingConfigurationReview/hooks/useFundingConfigurationReview.ts @@ -13,7 +13,7 @@ import { useCreatingDistributionLimit, useCreatingPayoutSplits, } from 'redux/hooks/v2v3/create' -import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/creatingV2Project' +import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/v2v3/creatingV2Project' import { formatFundingTarget } from 'utils/format/formatFundingTarget' export const useFundingConfigurationReview = () => { diff --git a/src/packages/v2v3/components/Create/components/pages/ReviewDeploy/components/RewardsReview/RewardsReview.tsx b/src/packages/v2v3/components/Create/components/pages/ReviewDeploy/components/RewardsReview/RewardsReview.tsx index 95f97a3ba4..63a88275f3 100644 --- a/src/packages/v2v3/components/Create/components/pages/ReviewDeploy/components/RewardsReview/RewardsReview.tsx +++ b/src/packages/v2v3/components/Create/components/pages/ReviewDeploy/components/RewardsReview/RewardsReview.tsx @@ -5,7 +5,7 @@ import { V2V3_CURRENCY_USD } from 'packages/v2v3/utils/currency' import { useCallback, useMemo } from 'react' import { useAppDispatch } from 'redux/hooks/useAppDispatch' import { useAppSelector } from 'redux/hooks/useAppSelector' -import { creatingV2ProjectActions } from 'redux/slices/creatingV2Project' +import { creatingV2ProjectActions } from 'redux/slices/v2v3/creatingV2Project' import { formatEnabled } from 'utils/format/formatBoolean' import { v4 } from 'uuid' import { ReviewDescription } from '../ReviewDescription' diff --git a/src/packages/v2v3/components/Create/hooks/DeployProject/hooks/NFT/useDeployNftProject.ts b/src/packages/v2v3/components/Create/hooks/DeployProject/hooks/NFT/useDeployNftProject.ts index 2b0fd1a462..b66d7fc259 100644 --- a/src/packages/v2v3/components/Create/hooks/DeployProject/hooks/NFT/useDeployNftProject.ts +++ b/src/packages/v2v3/components/Create/hooks/DeployProject/hooks/NFT/useDeployNftProject.ts @@ -8,7 +8,7 @@ import { useCreatingV2V3FundingCycleDataSelector, useCreatingV2V3FundingCycleMetadataSelector, } from 'redux/hooks/v2v3/create' -import { DEFAULT_NFT_FLAGS } from 'redux/slices/creatingV2Project' +import { DEFAULT_NFT_FLAGS } from 'redux/slices/v2v3/creatingV2Project' import { NFT_FUNDING_CYCLE_METADATA_OVERRIDES } from 'utils/nftFundingCycleMetadataOverrides' import { buildJB721TierParams } from 'utils/nftRewards' diff --git a/src/packages/v2v3/components/Create/hooks/DeployProject/useDeployProject.ts b/src/packages/v2v3/components/Create/hooks/DeployProject/useDeployProject.ts index 7dfb5ccee4..b7c825d75c 100644 --- a/src/packages/v2v3/components/Create/hooks/DeployProject/useDeployProject.ts +++ b/src/packages/v2v3/components/Create/hooks/DeployProject/useDeployProject.ts @@ -10,7 +10,7 @@ import { useCreatingV2V3FundingCycleDataSelector, useCreatingV2V3FundingCycleMetadataSelector, } from 'redux/hooks/v2v3/create' -import { creatingV2ProjectActions } from 'redux/slices/creatingV2Project' +import { creatingV2ProjectActions } from 'redux/slices/v2v3/creatingV2Project' import { emitErrorNotification } from 'utils/notifications' import { useDeployNftProject } from './hooks/NFT/useDeployNftProject' import { useIsNftProject } from './hooks/NFT/useIsNftProject' diff --git a/src/packages/v2v3/components/Create/hooks/useLoadInitialStateFromQuery.ts b/src/packages/v2v3/components/Create/hooks/useLoadInitialStateFromQuery.ts index ecd122f276..4809f6edb4 100644 --- a/src/packages/v2v3/components/Create/hooks/useLoadInitialStateFromQuery.ts +++ b/src/packages/v2v3/components/Create/hooks/useLoadInitialStateFromQuery.ts @@ -12,9 +12,9 @@ import { useDispatch } from 'react-redux' import { DEFAULT_REDUX_STATE, creatingV2ProjectActions, -} from 'redux/slices/creatingV2Project' -import { INITIAL_REDUX_STATE } from 'redux/slices/shared/v2ProjectInitialReduxState' -import { CreateState, ProjectState } from 'redux/slices/shared/v2ProjectTypes' +} from 'redux/slices/v2v3/creatingV2Project' +import { INITIAL_REDUX_STATE } from 'redux/slices/v2v3/shared/v2ProjectInitialReduxState' +import { CreateState, ProjectState } from 'redux/slices/v2v3/shared/v2ProjectTypes' import { isEqualAddress } from 'utils/address' import { parseWad } from 'utils/format/formatNumber' import { DefaultSettings as DefaultTokenSettings } from '../components/pages/ProjectToken/hooks/useProjectTokenForm' diff --git a/src/packages/v2v3/components/Create/utils/projectTokenSettingsToReduxFormat.ts b/src/packages/v2v3/components/Create/utils/projectTokenSettingsToReduxFormat.ts index fa7d98954e..1edc3d76fe 100644 --- a/src/packages/v2v3/components/Create/utils/projectTokenSettingsToReduxFormat.ts +++ b/src/packages/v2v3/components/Create/utils/projectTokenSettingsToReduxFormat.ts @@ -5,7 +5,7 @@ import { reservedRateFrom, } from 'packages/v2v3/utils/math' import { allocationToSplit } from 'packages/v2v3/utils/splitToAllocation' -import { EMPTY_RESERVED_TOKENS_GROUPED_SPLITS } from 'redux/slices/creatingV2Project' +import { EMPTY_RESERVED_TOKENS_GROUPED_SPLITS } from 'redux/slices/v2v3/creatingV2Project' import { ProjectTokensFormProps } from '../components/pages/ProjectToken/hooks/useProjectTokenForm' export const projectTokenSettingsToReduxFormat = ( diff --git a/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/hooks/useEditingFundingCycleConfig.ts b/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/hooks/useEditingFundingCycleConfig.ts index 5e367d14c4..1d86c66fe2 100644 --- a/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/hooks/useEditingFundingCycleConfig.ts +++ b/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/hooks/useEditingFundingCycleConfig.ts @@ -13,7 +13,7 @@ import { useEditingV2V3FundingCycleDataSelector, useEditingV2V3FundingCycleMetadataSelector, } from 'redux/hooks/v2v3/edit' -import { NftRewardsData } from 'redux/slices/shared/v2ProjectTypes' +import { NftRewardsData } from 'redux/slices/v2v3/shared/v2ProjectTypes' export interface EditingFundingCycleConfig { editingPayoutGroupedSplits: ETHPayoutGroupedSplits diff --git a/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/hooks/useInitialEditingData.ts b/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/hooks/useInitialEditingData.ts index af2e688ea8..2ee96eda9a 100644 --- a/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/hooks/useInitialEditingData.ts +++ b/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/hooks/useInitialEditingData.ts @@ -24,8 +24,8 @@ import { useAppDispatch } from 'redux/hooks/useAppDispatch' import { DEFAULT_MUST_START_AT_OR_AFTER, editingV2ProjectActions, -} from 'redux/slices/editingV2Project' -import { NftRewardsData } from 'redux/slices/shared/v2ProjectTypes' +} from 'redux/slices/v2v3/editingV2Project' +import { NftRewardsData } from 'redux/slices/v2v3/shared/v2ProjectTypes' import useDeepCompareEffect from 'use-deep-compare-effect' import { fromWad } from 'utils/format/formatNumber' diff --git a/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/pages/EditCyclePage/EditCycleFormFields.ts b/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/pages/EditCyclePage/EditCycleFormFields.ts index 92327b64fb..997759f1dd 100644 --- a/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/pages/EditCyclePage/EditCycleFormFields.ts +++ b/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/pages/EditCyclePage/EditCycleFormFields.ts @@ -1,7 +1,7 @@ import { DurationOption } from 'components/inputs/DurationInput' import { CurrencyName } from 'constants/currency' import { Split } from 'packages/v2v3/models/splits' -import { NftRewardsData } from 'redux/slices/shared/v2ProjectTypes' +import { NftRewardsData } from 'redux/slices/v2v3/shared/v2ProjectTypes' type DetailsSectionFields = { duration: number diff --git a/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/pages/EditCyclePage/hooks/usePrepareSaveEditCycleData.tsx b/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/pages/EditCyclePage/hooks/usePrepareSaveEditCycleData.tsx index e2fc94eb6e..e2478baf32 100644 --- a/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/pages/EditCyclePage/hooks/usePrepareSaveEditCycleData.tsx +++ b/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/pages/EditCyclePage/hooks/usePrepareSaveEditCycleData.tsx @@ -19,8 +19,8 @@ import { } from 'packages/v2v3/utils/math' import { BaseV3FundingCycleMetadataGlobal } from 'packages/v3/models/fundingCycle' import { useContext } from 'react' -import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/editingV2Project' -import { NftRewardsData } from 'redux/slices/shared/v2ProjectTypes' +import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/v2v3/editingV2Project' +import { NftRewardsData } from 'redux/slices/v2v3/shared/v2ProjectTypes' import { isZeroAddress } from 'utils/address' import { parseWad } from 'utils/format/formatNumber' import { otherUnitToSeconds } from 'utils/format/formatTime' diff --git a/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/pages/EditNftsPage/LaunchNftCollection/hooks/useLaunchNftsForm.ts b/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/pages/EditNftsPage/LaunchNftCollection/hooks/useLaunchNftsForm.ts index d2b9d00777..7e030445d1 100644 --- a/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/pages/EditNftsPage/LaunchNftCollection/hooks/useLaunchNftsForm.ts +++ b/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/pages/EditNftsPage/LaunchNftCollection/hooks/useLaunchNftsForm.ts @@ -11,7 +11,7 @@ import { useAppSelector } from 'redux/hooks/useAppSelector' import { DEFAULT_NFT_FLAGS, DEFAULT_NFT_PRICING, -} from 'redux/slices/editingV2Project' +} from 'redux/slices/v2v3/editingV2Project' import { defaultNftCollectionDescription, defaultNftCollectionName, diff --git a/src/packages/v2v3/contexts/NftRewards/NftRewardsContext.ts b/src/packages/v2v3/contexts/NftRewards/NftRewardsContext.ts index a7d72df221..4aac768ee8 100644 --- a/src/packages/v2v3/contexts/NftRewards/NftRewardsContext.ts +++ b/src/packages/v2v3/contexts/NftRewards/NftRewardsContext.ts @@ -4,8 +4,8 @@ import { DEFAULT_NFT_FLAGS, DEFAULT_NFT_PRICING, EMPTY_NFT_COLLECTION_METADATA, -} from 'redux/slices/shared/v2ProjectDefaultState' -import { NftRewardsData } from 'redux/slices/shared/v2ProjectTypes' +} from 'redux/slices/v2v3/shared/v2ProjectDefaultState' +import { NftRewardsData } from 'redux/slices/v2v3/shared/v2ProjectTypes' type NftRewardsContextType = { nftRewards: NftRewardsData diff --git a/src/packages/v2v3/contexts/NftRewards/NftRewardsProvider.tsx b/src/packages/v2v3/contexts/NftRewards/NftRewardsProvider.tsx index 9a45761c0d..dc5a6ac11b 100644 --- a/src/packages/v2v3/contexts/NftRewards/NftRewardsProvider.tsx +++ b/src/packages/v2v3/contexts/NftRewards/NftRewardsProvider.tsx @@ -12,7 +12,7 @@ import { DEFAULT_NFT_FLAGS, DEFAULT_NFT_PRICING, EMPTY_NFT_COLLECTION_METADATA, -} from 'redux/slices/shared/v2ProjectDefaultState' +} from 'redux/slices/v2v3/shared/v2ProjectDefaultState' import { CIDsOfNftRewardTiersResponse } from 'utils/nftRewards' import { JB721DelegateContractsContext } from './JB721DelegateContracts/JB721DelegateContractsContext' diff --git a/src/packages/v2v3/hooks/JB721Delegate/transactor/useLaunchProjectWithNftsTx.ts b/src/packages/v2v3/hooks/JB721Delegate/transactor/useLaunchProjectWithNftsTx.ts index 56d59ea47a..63e3a123b3 100644 --- a/src/packages/v2v3/hooks/JB721Delegate/transactor/useLaunchProjectWithNftsTx.ts +++ b/src/packages/v2v3/hooks/JB721Delegate/transactor/useLaunchProjectWithNftsTx.ts @@ -1,4 +1,3 @@ -import { GroupedSplits, SplitGroup } from 'packages/v2v3/models/splits' import { JB721GovernanceType, JB721TierParams, @@ -14,29 +13,30 @@ import { V2V3FundAccessConstraint, V2V3FundingCycleData, } from 'packages/v2v3/models/fundingCycle' +import { GroupedSplits, SplitGroup } from 'packages/v2v3/models/splits' -import { DEFAULT_JB_721_DELEGATE_VERSION } from 'packages/v2v3/hooks/defaultContracts/useDefaultJB721Delegate' -import { DEFAULT_MEMO } from 'constants/transactionDefaults' -import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/shared/v2ProjectDefaultState' +import { t } from '@lingui/macro' import { JUICEBOX_MONEY_PROJECT_METADATA_DOMAIN } from 'constants/metadataDomain' -import { LaunchV2V3ProjectData } from 'packages/v2v3/hooks/transactor/useLaunchProjectTx' +import { DEFAULT_MEMO } from 'constants/transactionDefaults' import { TransactionContext } from 'contexts/Transaction/TransactionContext' +import { getAddress } from 'ethers/lib/utils' import { TransactorInstance } from 'hooks/useTransactor' +import { useWallet } from 'hooks/Wallet' +import omit from 'lodash/omit' import { V2V3ContractsContext } from 'packages/v2v3/contexts/Contracts/V2V3ContractsContext' +import { DEFAULT_JB_721_DELEGATE_VERSION } from 'packages/v2v3/hooks/defaultContracts/useDefaultJB721Delegate' +import { useDefaultJBController } from 'packages/v2v3/hooks/defaultContracts/useDefaultJBController' +import { useDefaultJBETHPaymentTerminal } from 'packages/v2v3/hooks/defaultContracts/useDefaultJBETHPaymentTerminal' +import { useJBPrices } from 'packages/v2v3/hooks/JBPrices' +import { LaunchV2V3ProjectData } from 'packages/v2v3/hooks/transactor/useLaunchProjectTx' +import { useV2ProjectTitle } from 'packages/v2v3/hooks/useProjectTitle' import { V2V3CurrencyOption } from 'packages/v2v3/models/currencyOption' -import { buildDeployTiered721DelegateData } from 'utils/nftRewards' -import { getAddress } from 'ethers/lib/utils' import { isValidMustStartAtOrAfter } from 'packages/v2v3/utils/fundingCycle' -import omit from 'lodash/omit' -import { t } from '@lingui/macro' import { useContext } from 'react' -import { useDefaultJBController } from 'packages/v2v3/hooks/defaultContracts/useDefaultJBController' -import { useDefaultJBETHPaymentTerminal } from 'packages/v2v3/hooks/defaultContracts/useDefaultJBETHPaymentTerminal' +import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/v2v3/shared/v2ProjectDefaultState' +import { buildDeployTiered721DelegateData } from 'utils/nftRewards' import { useJB721DelegateContractAddress } from '../contracts/useJB721DelegateContractAddress' -import { useJBPrices } from 'packages/v2v3/hooks/JBPrices' import { useJBTiered721DelegateProjectDeployer } from '../contracts/useJBTiered721DelegateProjectDeployer' -import { useV2ProjectTitle } from 'packages/v2v3/hooks/useProjectTitle' -import { useWallet } from 'hooks/Wallet' interface DeployTiered721DelegateData { collectionUri: string diff --git a/src/packages/v2v3/hooks/JB721Delegate/transactor/useReconfigureV2V3FundingCycleWithNftsTx.ts b/src/packages/v2v3/hooks/JB721Delegate/transactor/useReconfigureV2V3FundingCycleWithNftsTx.ts index 78a3762644..3accd18dc7 100644 --- a/src/packages/v2v3/hooks/JB721Delegate/transactor/useReconfigureV2V3FundingCycleWithNftsTx.ts +++ b/src/packages/v2v3/hooks/JB721Delegate/transactor/useReconfigureV2V3FundingCycleWithNftsTx.ts @@ -1,17 +1,17 @@ import { - JBDeployTiered721DelegateData, - JB_DEPLOY_TIERED_721_DELEGATE_DATA_V3_1, + JBDeployTiered721DelegateData, + JB_DEPLOY_TIERED_721_DELEGATE_DATA_V3_1, } from 'models/nftRewards' import { - JBPayDataSourceFundingCycleMetadata, - V2V3FundAccessConstraint, - V2V3FundingCycleData, + JBPayDataSourceFundingCycleMetadata, + V2V3FundAccessConstraint, + V2V3FundingCycleData, } from 'packages/v2v3/models/fundingCycle' import { GroupedSplits, SplitGroup } from 'packages/v2v3/models/splits' import { - buildDeployTiered721DelegateData, - buildJB721TierParams, - defaultNftCollectionName, + buildDeployTiered721DelegateData, + buildJB721TierParams, + defaultNftCollectionName, } from 'utils/nftRewards' import { t } from '@lingui/macro' @@ -30,8 +30,8 @@ import { useV2ProjectTitle } from 'packages/v2v3/hooks/useProjectTitle' import { V2V3_CURRENCY_ETH } from 'packages/v2v3/utils/currency' import { isValidMustStartAtOrAfter } from 'packages/v2v3/utils/fundingCycle' import { useContext } from 'react' -import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/shared/v2ProjectDefaultState' -import { NftRewardsData } from 'redux/slices/shared/v2ProjectTypes' +import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/v2v3/shared/v2ProjectDefaultState' +import { NftRewardsData } from 'redux/slices/v2v3/shared/v2ProjectTypes' import { useJB721DelegateContractAddress } from '../contracts/useJB721DelegateContractAddress' import { useJBTiered721DelegateProjectDeployer } from '../contracts/useJBTiered721DelegateProjectDeployer' import { useProjectControllerJB721DelegateVersion } from '../contracts/useProjectJB721DelegateVersion' diff --git a/src/packages/v2v3/hooks/transactor/useLaunchProjectTx.ts b/src/packages/v2v3/hooks/transactor/useLaunchProjectTx.ts index d41bb30766..9b258f9342 100644 --- a/src/packages/v2v3/hooks/transactor/useLaunchProjectTx.ts +++ b/src/packages/v2v3/hooks/transactor/useLaunchProjectTx.ts @@ -15,7 +15,7 @@ import { import { GroupedSplits, SplitGroup } from 'packages/v2v3/models/splits' import { isValidMustStartAtOrAfter } from 'packages/v2v3/utils/fundingCycle' import { useContext } from 'react' -import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/shared/v2ProjectDefaultState' +import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/v2v3/shared/v2ProjectDefaultState' import { useV2ProjectTitle } from '../useProjectTitle' export interface LaunchV2V3ProjectData { diff --git a/src/packages/v2v3/hooks/transactor/useReconfigureV2V3FundingCycleTx.ts b/src/packages/v2v3/hooks/transactor/useReconfigureV2V3FundingCycleTx.ts index 68b0e7d0fb..2b250b13e8 100644 --- a/src/packages/v2v3/hooks/transactor/useReconfigureV2V3FundingCycleTx.ts +++ b/src/packages/v2v3/hooks/transactor/useReconfigureV2V3FundingCycleTx.ts @@ -6,7 +6,7 @@ import { TransactorInstance } from 'hooks/useTransactor' import { V2V3ProjectContractsContext } from 'packages/v2v3/contexts/ProjectContracts/V2V3ProjectContractsContext' import { isValidMustStartAtOrAfter } from 'packages/v2v3/utils/fundingCycle' import { useContext } from 'react' -import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/shared/v2ProjectDefaultState' +import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/v2v3/shared/v2ProjectDefaultState' import { useV2ProjectTitle } from '../useProjectTitle' import { LaunchV2V3ProjectData } from './useLaunchProjectTx' diff --git a/src/packages/v4/components/Create/components/Wizard/hooks/usePage.ts b/src/packages/v4/components/Create/components/Wizard/hooks/usePage.ts index 164f6bc00f..b31a87de0e 100644 --- a/src/packages/v4/components/Create/components/Wizard/hooks/usePage.ts +++ b/src/packages/v4/components/Create/components/Wizard/hooks/usePage.ts @@ -1,7 +1,7 @@ import { CreatePage } from 'models/createPage' import { useCallback, useContext, useMemo } from 'react' import { useAppDispatch } from 'redux/hooks/useAppDispatch' -import { creatingV2ProjectActions } from 'redux/slices/creatingV2Project' +import { creatingV2ProjectActions } from 'redux/slices/v2v3/creatingV2Project' import { WizardContext } from '../contexts/WizardContext' export const usePage = ({ name }: { name: string }) => { diff --git a/src/packages/v4/components/Create/components/Wizard/hooks/useSteps.ts b/src/packages/v4/components/Create/components/Wizard/hooks/useSteps.ts index a777e09d0b..901c58d8d8 100644 --- a/src/packages/v4/components/Create/components/Wizard/hooks/useSteps.ts +++ b/src/packages/v4/components/Create/components/Wizard/hooks/useSteps.ts @@ -3,7 +3,7 @@ import { useCallback, useContext, useMemo } from 'react' import { t } from '@lingui/macro' import { CreatePage } from 'models/createPage' import { useAppSelector } from 'redux/hooks/useAppSelector' -import { useEditingCreateFurthestPageReached } from 'redux/hooks/useEditingCreateFurthestPageReached' +import { useEditingCreateFurthestPageReached } from 'redux/hooks/v2v3/useEditingCreateFurthestPageReached' import { WizardContext } from '../contexts/WizardContext' const stepNames = (): Record => { diff --git a/src/packages/v4/components/Create/components/Wizard/hooks/useWizard.ts b/src/packages/v4/components/Create/components/Wizard/hooks/useWizard.ts index fb995801e9..7c6caa20d1 100644 --- a/src/packages/v4/components/Create/components/Wizard/hooks/useWizard.ts +++ b/src/packages/v4/components/Create/components/Wizard/hooks/useWizard.ts @@ -1,7 +1,7 @@ import { CreatePage } from 'models/createPage' import { useCallback, useEffect, useMemo, useState } from 'react' import { useAppSelector } from 'redux/hooks/useAppSelector' -import { useEditingCreateFurthestPageReached } from 'redux/hooks/useEditingCreateFurthestPageReached' +import { useEditingCreateFurthestPageReached } from 'redux/hooks/v2v3/useEditingCreateFurthestPageReached' import { PageProps } from '../Page' const isPage = (element: PageProps | undefined) => { diff --git a/src/packages/v4/components/Create/components/pages/FundingCycles/FundingCyclesPage.tsx b/src/packages/v4/components/Create/components/pages/FundingCycles/FundingCyclesPage.tsx index d269012810..19d63ab65a 100644 --- a/src/packages/v4/components/Create/components/pages/FundingCycles/FundingCyclesPage.tsx +++ b/src/packages/v4/components/Create/components/pages/FundingCycles/FundingCyclesPage.tsx @@ -20,7 +20,7 @@ import { trackFathomGoal } from 'lib/fathom' import moment from 'moment' import Link from 'next/link' import { useLockPageRulesWrapper } from 'packages/v2v3/components/Create/hooks/useLockPageRulesWrapper' -import { useSetCreateFurthestPageReached } from 'redux/hooks/useEditingCreateFurthestPageReached' +import { useSetCreateFurthestPageReached } from 'redux/hooks/v2v3/useEditingCreateFurthestPageReached' import { durationMustExistRule } from 'utils/antdRules' import { CreateBadge } from '../../CreateBadge' import { CreateCollapse } from '../../CreateCollapse/CreateCollapse' diff --git a/src/packages/v4/components/Create/components/pages/FundingCycles/hooks/useFundingCyclesForm.ts b/src/packages/v4/components/Create/components/pages/FundingCycles/hooks/useFundingCyclesForm.ts index bbebd8ff6d..ba3c1738fa 100644 --- a/src/packages/v4/components/Create/components/pages/FundingCycles/hooks/useFundingCyclesForm.ts +++ b/src/packages/v4/components/Create/components/pages/FundingCycles/hooks/useFundingCyclesForm.ts @@ -7,7 +7,7 @@ import { useAppSelector } from 'redux/hooks/useAppSelector' import { DEFAULT_MUST_START_AT_OR_AFTER, creatingV2ProjectActions, -} from 'redux/slices/creatingV2Project' +} from 'redux/slices/v2v3/creatingV2Project' import { deriveDurationUnit, otherUnitToSeconds, diff --git a/src/packages/v4/components/Create/components/pages/NftRewards/NftRewardsPage.tsx b/src/packages/v4/components/Create/components/pages/NftRewards/NftRewardsPage.tsx index 54bfa3ad64..3b785511cb 100644 --- a/src/packages/v4/components/Create/components/pages/NftRewards/NftRewardsPage.tsx +++ b/src/packages/v4/components/Create/components/pages/NftRewards/NftRewardsPage.tsx @@ -4,7 +4,7 @@ import { JBChainId, NATIVE_TOKEN_SYMBOLS } from 'juice-sdk-core' import { trackFathomGoal } from 'lib/fathom' import { useContext } from 'react' import { useAppSelector } from 'redux/hooks/useAppSelector' -import { useSetCreateFurthestPageReached } from 'redux/hooks/useEditingCreateFurthestPageReached' +import { useSetCreateFurthestPageReached } from 'redux/hooks/v2v3/useEditingCreateFurthestPageReached' import { useChainId } from 'wagmi' import { PageContext } from '../../Wizard/contexts/PageContext' import { Wizard } from '../../Wizard/Wizard' diff --git a/src/packages/v4/components/Create/components/pages/NftRewards/hooks/useCreateFlowNftRewardsForm.ts b/src/packages/v4/components/Create/components/pages/NftRewards/hooks/useCreateFlowNftRewardsForm.ts index 4bd4f9a295..a9c059f8e9 100644 --- a/src/packages/v4/components/Create/components/pages/NftRewards/hooks/useCreateFlowNftRewardsForm.ts +++ b/src/packages/v4/components/Create/components/pages/NftRewards/hooks/useCreateFlowNftRewardsForm.ts @@ -4,7 +4,7 @@ import { NftRewardTier } from 'models/nftRewards' import { useEffect, useMemo } from 'react' import { useAppDispatch } from 'redux/hooks/useAppDispatch' import { useAppSelector } from 'redux/hooks/useAppSelector' -import { creatingV2ProjectActions } from 'redux/slices/creatingV2Project' +import { creatingV2ProjectActions } from 'redux/slices/v2v3/creatingV2Project' import { withHttps, withoutHttp } from 'utils/externalLink' import { defaultNftCollectionDescription, diff --git a/src/packages/v4/components/Create/components/pages/PayoutsPage/PayoutsPage.tsx b/src/packages/v4/components/Create/components/pages/PayoutsPage/PayoutsPage.tsx index c2e2563baf..c8d3ef562a 100644 --- a/src/packages/v4/components/Create/components/pages/PayoutsPage/PayoutsPage.tsx +++ b/src/packages/v4/components/Create/components/pages/PayoutsPage/PayoutsPage.tsx @@ -1,6 +1,6 @@ import { useContext } from 'react' import { useAppSelector } from 'redux/hooks/useAppSelector' -import { useSetCreateFurthestPageReached } from 'redux/hooks/useEditingCreateFurthestPageReached' +import { useSetCreateFurthestPageReached } from 'redux/hooks/v2v3/useEditingCreateFurthestPageReached' import { Wizard } from '../../Wizard/Wizard' import { PageContext } from '../../Wizard/contexts/PageContext' import { CreateFlowPayoutsTable } from './components/CreateFlowPayoutsTable' diff --git a/src/packages/v4/components/Create/components/pages/PayoutsPage/components/TreasuryOptionsRadio.tsx b/src/packages/v4/components/Create/components/pages/PayoutsPage/components/TreasuryOptionsRadio.tsx index d4c2fffb25..7cda92dd4c 100644 --- a/src/packages/v4/components/Create/components/pages/PayoutsPage/components/TreasuryOptionsRadio.tsx +++ b/src/packages/v4/components/Create/components/pages/PayoutsPage/components/TreasuryOptionsRadio.tsx @@ -13,7 +13,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react' import { useAppDispatch } from 'redux/hooks/useAppDispatch' import { useAppSelector } from 'redux/hooks/useAppSelector' import { ReduxDistributionLimit } from 'redux/hooks/v2v3/shared' -import { creatingV2ProjectActions } from 'redux/slices/creatingV2Project' +import { creatingV2ProjectActions } from 'redux/slices/v2v3/creatingV2Project' import { fromWad } from 'utils/format/formatNumber' import { Icons } from '../../../Icons' import { RadioCard } from './RadioCard' diff --git a/src/packages/v4/components/Create/components/pages/ProjectDetails/ProjectDetailsPage.tsx b/src/packages/v4/components/Create/components/pages/ProjectDetails/ProjectDetailsPage.tsx index ae8d94bb48..dfb17e8914 100644 --- a/src/packages/v4/components/Create/components/pages/ProjectDetails/ProjectDetailsPage.tsx +++ b/src/packages/v4/components/Create/components/pages/ProjectDetails/ProjectDetailsPage.tsx @@ -21,7 +21,7 @@ import { V2V3_CURRENCY_USD, } from 'packages/v2v3/utils/currency' import { useCallback, useContext, useMemo, useState } from 'react' -import { useSetCreateFurthestPageReached } from 'redux/hooks/useEditingCreateFurthestPageReached' +import { useSetCreateFurthestPageReached } from 'redux/hooks/v2v3/useEditingCreateFurthestPageReached' import { inputMustBeEthAddressRule, inputMustExistRule } from 'utils/antdRules' import { inputIsLengthRule } from 'utils/antdRules/inputIsLengthRule' import { CreateCollapse } from '../../CreateCollapse/CreateCollapse' diff --git a/src/packages/v4/components/Create/components/pages/ProjectDetails/hooks/useProjectDetailsForm.ts b/src/packages/v4/components/Create/components/pages/ProjectDetails/hooks/useProjectDetailsForm.ts index 115903809a..641cfa1a21 100644 --- a/src/packages/v4/components/Create/components/pages/ProjectDetails/hooks/useProjectDetailsForm.ts +++ b/src/packages/v4/components/Create/components/pages/ProjectDetails/hooks/useProjectDetailsForm.ts @@ -9,7 +9,7 @@ import { useAppSelector } from 'redux/hooks/useAppSelector' import { DEFAULT_MUST_START_AT_OR_AFTER, creatingV2ProjectActions, -} from 'redux/slices/creatingV2Project' +} from 'redux/slices/v2v3/creatingV2Project' import { useFormDispatchWatch } from '../../hooks/useFormDispatchWatch' import { AmountInputValue } from '../ProjectDetailsPage' diff --git a/src/packages/v4/components/Create/components/pages/ProjectToken/ProjectTokenPage.tsx b/src/packages/v4/components/Create/components/pages/ProjectToken/ProjectTokenPage.tsx index 1201c3c2eb..b99ba951e4 100644 --- a/src/packages/v4/components/Create/components/pages/ProjectToken/ProjectTokenPage.tsx +++ b/src/packages/v4/components/Create/components/pages/ProjectToken/ProjectTokenPage.tsx @@ -6,7 +6,7 @@ import { Callout } from 'components/Callout/Callout' import { CREATE_FLOW } from 'constants/fathomEvents' import { trackFathomGoal } from 'lib/fathom' import { useContext, useEffect } from 'react' -import { useSetCreateFurthestPageReached } from 'redux/hooks/useEditingCreateFurthestPageReached' +import { useSetCreateFurthestPageReached } from 'redux/hooks/v2v3/useEditingCreateFurthestPageReached' import { CreateBadge } from '../../CreateBadge' import { Icons } from '../../Icons' import { Selection } from '../../Selection/Selection' diff --git a/src/packages/v4/components/Create/components/pages/ProjectToken/components/DefaultSettings.tsx b/src/packages/v4/components/Create/components/pages/ProjectToken/components/DefaultSettings.tsx index 1f1b1872c9..a37c79d289 100644 --- a/src/packages/v4/components/Create/components/pages/ProjectToken/components/DefaultSettings.tsx +++ b/src/packages/v4/components/Create/components/pages/ProjectToken/components/DefaultSettings.tsx @@ -2,11 +2,11 @@ import { t } from '@lingui/macro' import { Divider } from 'antd' import TooltipLabel from 'components/TooltipLabel' import { - DISCOUNT_RATE_EXPLANATION, - MINT_RATE_EXPLANATION, - OWNER_MINTING_EXPLANATION, - REDEMPTION_RATE_EXPLANATION, - RESERVED_RATE_EXPLANATION, + DISCOUNT_RATE_EXPLANATION, + MINT_RATE_EXPLANATION, + OWNER_MINTING_EXPLANATION, + REDEMPTION_RATE_EXPLANATION, + RESERVED_RATE_EXPLANATION, } from 'components/strings' import { ReactNode, useMemo } from 'react' import { formatAmount } from 'utils/format/formatAmount' @@ -28,12 +28,12 @@ export const DefaultSettings: React.FC< data: `${ProjectTokenForm.DefaultSettings.reservedTokensPercentage}%`, tooltip: RESERVED_RATE_EXPLANATION, }, - [t`Decay percent`]: { + [t`Weight cut percent`]: { data: `${ProjectTokenForm.DefaultSettings.discountRate}%`, tooltip: DISCOUNT_RATE_EXPLANATION, }, - [t`Redemption rate`]: { - data: `${ProjectTokenForm.DefaultSettings.cashOutTaxRate}%`, + [t`Cash out tax rate`]: { + data: `${ProjectTokenForm.DefaultSettings.redemptionRate}%`, tooltip: REDEMPTION_RATE_EXPLANATION, }, [t`Owner token minting`]: { diff --git a/src/packages/v4/components/Create/components/pages/ProjectToken/hooks/useProjectTokenForm.ts b/src/packages/v4/components/Create/components/pages/ProjectToken/hooks/useProjectTokenForm.ts index 89531ab3a5..5784c005be 100644 --- a/src/packages/v4/components/Create/components/pages/ProjectToken/hooks/useProjectTokenForm.ts +++ b/src/packages/v4/components/Create/components/pages/ProjectToken/hooks/useProjectTokenForm.ts @@ -25,7 +25,7 @@ import { useCreatingDistributionLimit, useCreatingReservedTokensSplits, } from 'redux/hooks/v2v3/create' -import { creatingV2ProjectActions } from 'redux/slices/creatingV2Project' +import { creatingV2ProjectActions } from 'redux/slices/v2v3/creatingV2Project' import { useFormDispatchWatch } from '../../hooks/useFormDispatchWatch' export type ProjectTokensFormProps = Partial<{ @@ -34,7 +34,7 @@ export type ProjectTokensFormProps = Partial<{ reservedTokensPercentage: number | undefined reservedTokenAllocation: AllocationSplit[] | undefined discountRate: number | undefined - cashOutTaxRate: number | undefined + redemptionRate: number | undefined tokenMinting: boolean | undefined pauseTransfers: boolean | undefined }> @@ -46,7 +46,7 @@ export const DefaultSettings: Required< reservedTokensPercentage: 0, reservedTokenAllocation: [], discountRate: 0, - cashOutTaxRate: 100, + redemptionRate: 100, tokenMinting: false, pauseTransfers: false, } @@ -81,9 +81,9 @@ export const useProjectTokensForm = () => { ? parseFloat(formatDiscountRate(fundingCycleData.discountRate)) : DefaultSettings.discountRate const cashOutTaxRate = - !cashOutTaxRateDisabled && fundingCycleMetadata.cashOutTaxRate - ? parseFloat(formatRedemptionRate(fundingCycleMetadata.cashOutTaxRate)) - : DefaultSettings.cashOutTaxRate + !cashOutTaxRateDisabled && fundingCycleMetadata.redemptionRate + ? parseFloat(formatRedemptionRate(fundingCycleMetadata.redemptionRate)) + : DefaultSettings.redemptionRate const tokenMinting = fundingCycleMetadata.allowMinting !== undefined ? fundingCycleMetadata.allowMinting @@ -108,7 +108,7 @@ export const useProjectTokensForm = () => { fundingCycleData.discountRate, fundingCycleData.weight, fundingCycleMetadata.allowMinting, - fundingCycleMetadata.cashOutTaxRate, + fundingCycleMetadata.redemptionRate, fundingCycleMetadata.reservedRate, fundingCycleMetadata.global.pauseTransfers, projectTokensSelection, @@ -186,21 +186,21 @@ export const useProjectTokensForm = () => { useFormDispatchWatch({ form, - fieldName: 'cashOutTaxRate', + fieldName: 'redemptionRate', dispatchFunction: creatingV2ProjectActions.setRedemptionRate, formatter: v => { if (v === undefined || typeof v !== 'number') - return redemptionRateFrom(DefaultSettings.cashOutTaxRate).toHexString() + return redemptionRateFrom(DefaultSettings.redemptionRate).toHexString() return redemptionRateFrom(v).toHexString() }, }) useFormDispatchWatch({ form, - fieldName: 'cashOutTaxRate', + fieldName: 'redemptionRate', dispatchFunction: creatingV2ProjectActions.setBallotRedemptionRate, formatter: v => { if (v === undefined || typeof v !== 'number') - return redemptionRateFrom(DefaultSettings.cashOutTaxRate).toHexString() + return redemptionRateFrom(DefaultSettings.redemptionRate).toHexString() return redemptionRateFrom(v).toHexString() }, }) diff --git a/src/packages/v4/components/Create/components/pages/ReconfigurationRules/ReconfigurationRulesPage.tsx b/src/packages/v4/components/Create/components/pages/ReconfigurationRules/ReconfigurationRulesPage.tsx index c4502f8df3..ebb388480c 100644 --- a/src/packages/v4/components/Create/components/pages/ReconfigurationRules/ReconfigurationRulesPage.tsx +++ b/src/packages/v4/components/Create/components/pages/ReconfigurationRules/ReconfigurationRulesPage.tsx @@ -18,7 +18,7 @@ import { readNetwork } from 'constants/networks' import { trackFathomGoal } from 'lib/fathom' import { Selection } from 'packages/v2v3/components/Create/components/Selection/Selection' import { useContext } from 'react' -import { useSetCreateFurthestPageReached } from 'redux/hooks/useEditingCreateFurthestPageReached' +import { useSetCreateFurthestPageReached } from 'redux/hooks/v2v3/useEditingCreateFurthestPageReached' import { featureFlagEnabled } from 'utils/featureFlags' import { useAvailableReconfigurationStrategies } from '../../../hooks/useAvailableReconfigurationStrategies' import { CreateCollapse } from '../../CreateCollapse/CreateCollapse' diff --git a/src/packages/v4/components/Create/components/pages/ReconfigurationRules/hooks/useReconfigurationRulesForm.ts b/src/packages/v4/components/Create/components/pages/ReconfigurationRules/hooks/useReconfigurationRulesForm.ts index 92bd9755d7..d6c37e58d3 100644 --- a/src/packages/v4/components/Create/components/pages/ReconfigurationRules/hooks/useReconfigurationRulesForm.ts +++ b/src/packages/v4/components/Create/components/pages/ReconfigurationRules/hooks/useReconfigurationRulesForm.ts @@ -6,7 +6,7 @@ import { useAvailableReconfigurationStrategies } from 'packages/v2v3/components/ import { useEffect, useMemo } from 'react' import { useAppDispatch } from 'redux/hooks/useAppDispatch' import { useAppSelector } from 'redux/hooks/useAppSelector' -import { creatingV2ProjectActions } from 'redux/slices/creatingV2Project' +import { creatingV2ProjectActions } from 'redux/slices/v2v3/creatingV2Project' import { isEqualAddress, isZeroAddress } from 'utils/address' import { useFormDispatchWatch } from '../../hooks/useFormDispatchWatch' diff --git a/src/packages/v4/components/Create/components/pages/ReviewDeploy/ReviewDeployPage.tsx b/src/packages/v4/components/Create/components/pages/ReviewDeploy/ReviewDeployPage.tsx index 0c5a772a61..3a5fa0e842 100644 --- a/src/packages/v4/components/Create/components/pages/ReviewDeploy/ReviewDeployPage.tsx +++ b/src/packages/v4/components/Create/components/pages/ReviewDeploy/ReviewDeployPage.tsx @@ -14,8 +14,8 @@ import { useModal } from 'hooks/useModal' import { useRouter } from 'next/router' import { useDispatch } from 'react-redux' import { useAppSelector } from 'redux/hooks/useAppSelector' -import { useSetCreateFurthestPageReached } from 'redux/hooks/useEditingCreateFurthestPageReached' -import { creatingV2ProjectActions } from 'redux/slices/creatingV2Project' +import { useSetCreateFurthestPageReached } from 'redux/hooks/v2v3/useEditingCreateFurthestPageReached' +import { creatingV2ProjectActions } from 'redux/slices/v2v3/creatingV2Project' import { helpPagePath } from 'utils/helpPagePath' import { useDeployProject } from '../../../hooks/DeployProject/useDeployProject' import { CreateBadge } from '../../CreateBadge' diff --git a/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/FundingConfigurationReview/hooks/useFundingConfigurationReview.ts b/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/FundingConfigurationReview/hooks/useFundingConfigurationReview.ts index 2ef2f54203..dc9a31591f 100644 --- a/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/FundingConfigurationReview/hooks/useFundingConfigurationReview.ts +++ b/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/FundingConfigurationReview/hooks/useFundingConfigurationReview.ts @@ -13,7 +13,7 @@ import { useCreatingDistributionLimit, useCreatingPayoutSplits, } from 'redux/hooks/v2v3/create' -import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/creatingV2Project' +import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/v2v3/creatingV2Project' import { formatFundingTarget } from 'utils/format/formatFundingTarget' export const useFundingConfigurationReview = () => { diff --git a/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/ProjectTokenReview/ProjectTokenReview.tsx b/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/ProjectTokenReview/ProjectTokenReview.tsx index 621205bf44..2539883303 100644 --- a/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/ProjectTokenReview/ProjectTokenReview.tsx +++ b/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/ProjectTokenReview/ProjectTokenReview.tsx @@ -1,10 +1,10 @@ import { t } from '@lingui/macro' import { ReservedTokensList } from 'packages/v2v3/components/shared/ReservedTokensList' import { - formatDiscountRate, - formatIssuanceRate, - formatRedemptionRate, - formatReservedRate, + formatDiscountRate, + formatIssuanceRate, + formatRedemptionRate, + formatReservedRate, } from 'packages/v2v3/utils/math' import { formatAmount } from 'utils/format/formatAmount' import * as ProjectTokenForm from '../../../ProjectToken/hooks/useProjectTokenForm' @@ -78,7 +78,7 @@ export const ProjectTokenReview = () => { {formatRedemptionRate( cashOutTaxRate ? cashOutTaxRate - : ProjectTokenForm.DefaultSettings.cashOutTaxRate.toString(), + : ProjectTokenForm.DefaultSettings.redemptionRate.toString(), ) + '%'}
} diff --git a/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/ProjectTokenReview/hooks/useProjectTokenReview.ts b/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/ProjectTokenReview/hooks/useProjectTokenReview.ts index 4de178cc3c..2e14b99339 100644 --- a/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/ProjectTokenReview/hooks/useProjectTokenReview.ts +++ b/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/ProjectTokenReview/hooks/useProjectTokenReview.ts @@ -1,7 +1,7 @@ import { AllocationSplit } from 'packages/v2v3/components/shared/Allocation/Allocation' import { - allocationToSplit, - splitToAllocation, + allocationToSplit, + splitToAllocation, } from 'packages/v2v3/utils/splitToAllocation' import { useCallback, useMemo } from 'react' import { useAppSelector } from 'redux/hooks/useAppSelector' @@ -14,7 +14,7 @@ export const useProjectTokenReview = () => { fundingCycleMetadata: { allowMinting, reservedRate, - cashOutTaxRate, + redemptionRate, global, }, } = useAppSelector(state => state.creatingV2Project) @@ -46,7 +46,7 @@ export const useProjectTokenReview = () => { allowTokenMinting, pauseTransfers, reservedRate, - cashOutTaxRate, + cashOutTaxRate: redemptionRate, allocationSplits, setAllocationSplits, } diff --git a/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/RewardsReview/RewardsReview.tsx b/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/RewardsReview/RewardsReview.tsx index 3d9b8604ac..975f4486a7 100644 --- a/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/RewardsReview/RewardsReview.tsx +++ b/src/packages/v4/components/Create/components/pages/ReviewDeploy/components/RewardsReview/RewardsReview.tsx @@ -5,7 +5,7 @@ import { NftRewardTier } from 'models/nftRewards' import { useCallback, useMemo } from 'react' import { useAppDispatch } from 'redux/hooks/useAppDispatch' import { useAppSelector } from 'redux/hooks/useAppSelector' -import { creatingV2ProjectActions } from 'redux/slices/creatingV2Project' +import { creatingV2ProjectActions } from 'redux/slices/v2v3/creatingV2Project' import { formatEnabled } from 'utils/format/formatBoolean' import { v4 } from 'uuid' import { useChainId } from 'wagmi' diff --git a/src/packages/v4/components/Create/hooks/DeployProject/hooks/NFT/useDeployNftProject.ts b/src/packages/v4/components/Create/hooks/DeployProject/hooks/NFT/useDeployNftProject.ts index fc145b2a2a..94e20590cd 100644 --- a/src/packages/v4/components/Create/hooks/DeployProject/hooks/NFT/useDeployNftProject.ts +++ b/src/packages/v4/components/Create/hooks/DeployProject/hooks/NFT/useDeployNftProject.ts @@ -11,7 +11,7 @@ import { useCreatingV2V3FundingCycleDataSelector, useCreatingV2V3FundingCycleMetadataSelector, } from 'redux/hooks/v2v3/create' -import { DEFAULT_NFT_FLAGS } from 'redux/slices/shared/v2ProjectDefaultState' +import { DEFAULT_NFT_FLAGS } from 'redux/slices/v2v3/shared/v2ProjectDefaultState' import { encodeIpfsUri } from 'utils/ipfs' import { NFT_FUNDING_CYCLE_METADATA_OVERRIDES } from 'utils/nftFundingCycleMetadataOverrides' import { sortNftsByContributionFloor } from 'utils/nftRewards' diff --git a/src/packages/v4/components/Create/hooks/DeployProject/useDeployProject.ts b/src/packages/v4/components/Create/hooks/DeployProject/useDeployProject.ts index 0232d7bc7b..e72f5bb6d1 100644 --- a/src/packages/v4/components/Create/hooks/DeployProject/useDeployProject.ts +++ b/src/packages/v4/components/Create/hooks/DeployProject/useDeployProject.ts @@ -9,7 +9,7 @@ import { useCreatingV2V3FundingCycleDataSelector, useCreatingV2V3FundingCycleMetadataSelector, } from 'redux/hooks/v2v3/create' -import { creatingV2ProjectActions } from 'redux/slices/creatingV2Project' +import { creatingV2ProjectActions } from 'redux/slices/v2v3/creatingV2Project' import { emitErrorNotification } from 'utils/notifications' import { useDeployNftProject } from './hooks/NFT/useDeployNftProject' import { useIsNftProject } from './hooks/NFT/useIsNftProject' diff --git a/src/packages/v4/components/Create/hooks/useLoadInitialStateFromQuery.ts b/src/packages/v4/components/Create/hooks/useLoadInitialStateFromQuery.ts index 2e797b49a1..265923a1d5 100644 --- a/src/packages/v4/components/Create/hooks/useLoadInitialStateFromQuery.ts +++ b/src/packages/v4/components/Create/hooks/useLoadInitialStateFromQuery.ts @@ -9,11 +9,11 @@ import { MAX_PAYOUT_LIMIT } from 'packages/v4/utils/math' import { useEffect, useState } from 'react' import { useDispatch } from 'react-redux' import { - DEFAULT_REDUX_STATE, - creatingV2ProjectActions, -} from 'redux/slices/creatingV2Project' -import { INITIAL_REDUX_STATE } from 'redux/slices/shared/v2ProjectInitialReduxState' -import { CreateState, ProjectState } from 'redux/slices/shared/v2ProjectTypes' + DEFAULT_REDUX_STATE, + creatingV2ProjectActions, +} from 'redux/slices/v2v3/creatingV2Project' +import { INITIAL_REDUX_STATE } from 'redux/slices/v2v3/shared/v2ProjectInitialReduxState' +import { CreateState, ProjectState } from 'redux/slices/v2v3/shared/v2ProjectTypes' import { isEqualAddress } from 'utils/address' import { parseWad } from 'utils/format/formatNumber' import { zeroAddress } from 'viem' @@ -63,7 +63,7 @@ const parseCreateFlowStateFromInitialState = ( reservedRate: initialState.fundingCycleMetadata.reservedRate, reservedTokensGroupedSplits: initialState.reservedTokensGroupedSplits, discountRate: initialState.fundingCycleData.discountRate, - cashOutTaxRate: initialState.fundingCycleMetadata.cashOutTaxRate, + cashOutTaxRate: initialState.fundingCycleMetadata.redemptionRate, allowMinting: initialState.fundingCycleMetadata.allowMinting, } if (isEqual(initialTokenData, ReduxDefaultTokenSettings)) { diff --git a/src/packages/v4/components/Create/utils/projectTokenSettingsToReduxFormat.ts b/src/packages/v4/components/Create/utils/projectTokenSettingsToReduxFormat.ts index 9fd1073ad6..1edc3d76fe 100644 --- a/src/packages/v4/components/Create/utils/projectTokenSettingsToReduxFormat.ts +++ b/src/packages/v4/components/Create/utils/projectTokenSettingsToReduxFormat.ts @@ -5,7 +5,7 @@ import { reservedRateFrom, } from 'packages/v2v3/utils/math' import { allocationToSplit } from 'packages/v2v3/utils/splitToAllocation' -import { EMPTY_RESERVED_TOKENS_GROUPED_SPLITS } from 'redux/slices/creatingV2Project' +import { EMPTY_RESERVED_TOKENS_GROUPED_SPLITS } from 'redux/slices/v2v3/creatingV2Project' import { ProjectTokensFormProps } from '../components/pages/ProjectToken/hooks/useProjectTokenForm' export const projectTokenSettingsToReduxFormat = ( @@ -22,8 +22,8 @@ export const projectTokenSettingsToReduxFormat = ( const discountRate = discountRateFrom( projectTokenSettings.discountRate, ).toHexString() - const cashOutTaxRate = redemptionRateFrom( - projectTokenSettings.cashOutTaxRate, + const redemptionRate = redemptionRateFrom( + projectTokenSettings.redemptionRate, ).toHexString() const allowMinting = projectTokenSettings.tokenMinting const pauseTransfers = projectTokenSettings.pauseTransfers @@ -33,7 +33,7 @@ export const projectTokenSettingsToReduxFormat = ( reservedRate, reservedTokensGroupedSplits, discountRate, - cashOutTaxRate, + redemptionRate, allowMinting, pauseTransfers, } diff --git a/src/packages/v4/components/ProjectDashboard/V4PayRedeemCard/RedeemConfiguration.tsx b/src/packages/v4/components/ProjectDashboard/V4PayRedeemCard/RedeemConfiguration.tsx index 02ba636d08..9bc6a79225 100644 --- a/src/packages/v4/components/ProjectDashboard/V4PayRedeemCard/RedeemConfiguration.tsx +++ b/src/packages/v4/components/ProjectDashboard/V4PayRedeemCard/RedeemConfiguration.tsx @@ -103,8 +103,8 @@ export const RedeemConfiguration: React.FC = ({ const args = [ userAddress, BigInt(projectId), - NATIVE_TOKEN, redeemAmountWei, + NATIVE_TOKEN, 0n, userAddress, '0x0', diff --git a/src/packages/v4/contexts/V4NftRewards/V4NftRewardsProvider.tsx b/src/packages/v4/contexts/V4NftRewards/V4NftRewardsProvider.tsx index 44a6d1778c..e7bd6b9a59 100644 --- a/src/packages/v4/contexts/V4NftRewards/V4NftRewardsProvider.tsx +++ b/src/packages/v4/contexts/V4NftRewards/V4NftRewardsProvider.tsx @@ -9,8 +9,8 @@ import { import { JB721GovernanceType } from 'models/nftRewards' import { V2V3CurrencyOption } from 'packages/v2v3/models/currencyOption' import React, { createContext } from 'react' -import { DEFAULT_NFT_PRICING } from 'redux/slices/editingV2Project' -import { NftRewardsData } from 'redux/slices/shared/v2ProjectTypes' +import { DEFAULT_NFT_PRICING } from 'redux/slices/v2v3/editingV2Project' +import { NftRewardsData } from 'redux/slices/v2v3/shared/v2ProjectTypes' import { CIDsOfNftRewardTiersResponse } from 'utils/nftRewards' import { ContractFunctionReturnType } from 'viem' import { useNftRewards } from './useNftRewards' diff --git a/src/packages/v4/hooks/JB721Delegate/transactor/useLaunchProjectWithNftsTx.ts b/src/packages/v4/hooks/JB721Delegate/transactor/useLaunchProjectWithNftsTx.ts index adb5102274..a1659580b4 100644 --- a/src/packages/v4/hooks/JB721Delegate/transactor/useLaunchProjectWithNftsTx.ts +++ b/src/packages/v4/hooks/JB721Delegate/transactor/useLaunchProjectWithNftsTx.ts @@ -21,9 +21,15 @@ import { } from 'packages/v4/models/nfts' import { wagmiConfig } from 'packages/v4/wagmiConfig' import { useContext } from 'react' -import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/shared/v2ProjectDefaultState' +import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/v2v3/shared/v2ProjectDefaultState' import { ipfsUri } from 'utils/ipfs' -import { Address, WaitForTransactionReceiptReturnType, zeroAddress } from 'viem' +import { + Address, + toBytes, + toHex, + WaitForTransactionReceiptReturnType, + zeroAddress, +} from 'viem' import { useChainId } from 'wagmi' import { LaunchV2V3ProjectArgs, @@ -53,13 +59,19 @@ export function useLaunchProjectWithNftsTx() { const chainId = useChainId() const defaultJBController = chainId - ? jbProjectDeploymentAddresses.JBController[chainId as JBChainId] + ? (jbProjectDeploymentAddresses.JBController[ + chainId as JBChainId + ] as Address) : undefined const defaultJBETHPaymentTerminal = chainId - ? jbProjectDeploymentAddresses.JBMultiTerminal[chainId as JBChainId] + ? (jbProjectDeploymentAddresses.JBMultiTerminal[ + chainId as JBChainId + ] as Address) : undefined const JBTiered721DelegateStoreAddress = chainId - ? jbProjectDeploymentAddresses.JB721TiersHookStore[chainId as JBChainId] + ? (jbProjectDeploymentAddresses.JB721TiersHookStore[ + chainId as JBChainId + ] as Address) : undefined const { writeContractAsync: writeLaunchProject } = @@ -169,7 +181,7 @@ export function useLaunchProjectWithNftsTx() { memo: launchProjectData[4], }, // _launchProjectData, defaultJBController, - // createSalt(), + createSalt(), ] as const try { @@ -202,3 +214,10 @@ export function useLaunchProjectWithNftsTx() { } } } + +function createSalt() { + const base: string = '0x' + Math.random().toString(16).slice(2) // idk lol + const salt = toHex(toBytes(base, { size: 32 })) + + return salt +} diff --git a/src/packages/v4/hooks/useLaunchProjectTx.ts b/src/packages/v4/hooks/useLaunchProjectTx.ts index 8939386a4a..75f44aaefd 100644 --- a/src/packages/v4/hooks/useLaunchProjectTx.ts +++ b/src/packages/v4/hooks/useLaunchProjectTx.ts @@ -6,12 +6,12 @@ import { useWallet } from 'hooks/Wallet' import { jbProjectDeploymentAddresses, NATIVE_TOKEN } from 'juice-sdk-core' import { JBChainId, - useWriteJbControllerLaunchProjectFor, + useWriteJbControllerLaunchProjectFor } from 'juice-sdk-react' import { LaunchV2V3ProjectData } from 'packages/v2v3/hooks/transactor/useLaunchProjectTx' import { useCallback, useContext } from 'react' -import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/shared/v2ProjectDefaultState' -import { WaitForTransactionReceiptReturnType } from 'viem' +import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/v2v3/shared/v2ProjectDefaultState' +import { Address, WaitForTransactionReceiptReturnType } from 'viem' import { useChainId } from 'wagmi' import { LaunchV2V3ProjectArgs, @@ -55,11 +55,15 @@ export function useLaunchProjectTx() { const chainId = useChainId() const terminalAddress = chainId - ? jbProjectDeploymentAddresses.JBMultiTerminal[chainId as JBChainId] + ? (jbProjectDeploymentAddresses.JBMultiTerminal[ + chainId as JBChainId + ] as Address) : undefined const controllerAddress = chainId - ? jbProjectDeploymentAddresses.JBController[chainId as JBChainId] + ? (jbProjectDeploymentAddresses.JBController[ + chainId as JBChainId + ] as Address) : undefined const { addTransaction } = useContext(TxHistoryContext) diff --git a/src/packages/v4/utils/editRuleset.ts b/src/packages/v4/utils/editRuleset.ts index f25d0ac53c..cf28895aa0 100644 --- a/src/packages/v4/utils/editRuleset.ts +++ b/src/packages/v4/utils/editRuleset.ts @@ -52,7 +52,7 @@ export function transformEditCycleFormFieldsToTxArgs({ allowAddPriceFeed: false, // Defaulting to false as it's not in formValues ownerMustSendPayouts: false, // Defaulting to false as it's not in formValues holdFees: formValues.holdFees, - useTotalSurplusForRedemptions: false, // Defaulting to false as it's not in formValues + useTotalSurplusForCashOuts: false, // Defaulting to false as it's not in formValues useDataHookForPay: false, // Defaulting to false as it's not in formValues useDataHookForCashOut: false, // Defaulting to false as it's not in formValues dataHook: '0x0000000000000000000000000000000000000000' as `0x${string}`, // Defaulting to a null address diff --git a/src/packages/v4/utils/launchProjectTransformers.ts b/src/packages/v4/utils/launchProjectTransformers.ts index 76c08a9940..9645063891 100644 --- a/src/packages/v4/utils/launchProjectTransformers.ts +++ b/src/packages/v4/utils/launchProjectTransformers.ts @@ -1,12 +1,12 @@ import { - JBSplit, - NATIVE_TOKEN, - NATIVE_TOKEN_DECIMALS, - SplitGroup, + JBSplit, + NATIVE_TOKEN, + NATIVE_TOKEN_DECIMALS, + SplitGroup, } from 'juice-sdk-core' import { - V2V3FundAccessConstraint, - V2V3FundingCycleData, + V2V3FundAccessConstraint, + V2V3FundingCycleData, } from 'packages/v2v3/models/fundingCycle' import round from 'lodash/round' @@ -100,7 +100,7 @@ export function transformFCMetadataToRulesetMetadata({ }) { return { reservedPercent: fundingCycleMetadata.reservedRate.toNumber(), - cashOutTaxRate: fundingCycleMetadata.cashOutTaxRate.toNumber(), + cashOutTaxRate: fundingCycleMetadata.redemptionRate.toNumber(), baseCurrency: BASE_CURRENCY_ETH, pausePay: fundingCycleMetadata.pausePay, pauseRedeem: fundingCycleMetadata.pauseRedeem, @@ -114,7 +114,7 @@ export function transformFCMetadataToRulesetMetadata({ allowAddPriceFeed: false, // Not present in v2v3, passing false by default ownerMustSendPayouts: false, // Not present in v2v3, passing false by default holdFees: fundingCycleMetadata.holdFees, - useTotalSurplusForRedemptions: + useTotalSurplusForCashOuts: fundingCycleMetadata.useTotalOverflowForRedemptions, useDataHookForPay: fundingCycleMetadata.useDataSourceForPay, useDataHookForCashOut: fundingCycleMetadata.useDataSourceForRedeem, diff --git a/src/packages/v4/views/V4ProjectSettings/EditNftsPage/LaunchNftCollection/hooks/useLaunchNftsForm.ts b/src/packages/v4/views/V4ProjectSettings/EditNftsPage/LaunchNftCollection/hooks/useLaunchNftsForm.ts index 294aa175cf..4674bd116e 100644 --- a/src/packages/v4/views/V4ProjectSettings/EditNftsPage/LaunchNftCollection/hooks/useLaunchNftsForm.ts +++ b/src/packages/v4/views/V4ProjectSettings/EditNftsPage/LaunchNftCollection/hooks/useLaunchNftsForm.ts @@ -1,11 +1,11 @@ -import { - DEFAULT_NFT_FLAGS, - DEFAULT_NFT_PRICING, -} from 'redux/slices/editingV2Project' import { EditingFundingCycleConfig, useEditingFundingCycleConfig, } from 'packages/v2v3/components/V2V3Project/V2V3ProjectSettings/hooks/useEditingFundingCycleConfig' +import { + DEFAULT_NFT_FLAGS, + DEFAULT_NFT_PRICING, +} from 'redux/slices/v2v3/editingV2Project' import { defaultNftCollectionDescription, defaultNftCollectionName, @@ -13,12 +13,12 @@ import { pinNftRewards, } from 'utils/nftRewards' -import { JB721GovernanceType } from 'models/nftRewards' -import { NftRewardsFormProps } from 'components/NftRewards/AddNftCollectionForm/AddNftCollectionForm' -import { useAppSelector } from 'redux/hooks/useAppSelector' import { useForm } from 'antd/lib/form/Form' +import { NftRewardsFormProps } from 'components/NftRewards/AddNftCollectionForm/AddNftCollectionForm' +import { JB721GovernanceType } from 'models/nftRewards' import { useReconfigureFundingCycle } from 'packages/v2v3/components/V2V3Project/V2V3ProjectSettings/hooks/useReconfigureFundingCycle' import { useState } from 'react' +import { useAppSelector } from 'redux/hooks/useAppSelector' // v4TODO: this whole component needs to be v4-ified export const useLaunchNftsForm = () => { diff --git a/src/redux/hooks/v2v3/create.ts b/src/redux/hooks/v2v3/create.ts index f4dcd7f5de..1d0053948d 100644 --- a/src/redux/hooks/v2v3/create.ts +++ b/src/redux/hooks/v2v3/create.ts @@ -14,7 +14,7 @@ import { import { useCallback, useMemo } from 'react' import { shallowEqual } from 'react-redux' import { useAppDispatch } from 'redux/hooks/useAppDispatch' -import { creatingV2ProjectActions } from 'redux/slices/creatingV2Project' +import { creatingV2ProjectActions } from 'redux/slices/v2v3/creatingV2Project' import { fromWad, parseWad } from 'utils/format/formatNumber' import { useAppSelector } from '../useAppSelector' import { ReduxDistributionLimit } from './shared' diff --git a/src/redux/hooks/useEditingCreateFurthestPageReached.ts b/src/redux/hooks/v2v3/useEditingCreateFurthestPageReached.ts similarity index 95% rename from src/redux/hooks/useEditingCreateFurthestPageReached.ts rename to src/redux/hooks/v2v3/useEditingCreateFurthestPageReached.ts index 82f118e487..3722097027 100644 --- a/src/redux/hooks/useEditingCreateFurthestPageReached.ts +++ b/src/redux/hooks/v2v3/useEditingCreateFurthestPageReached.ts @@ -2,7 +2,7 @@ import { CreatePage } from 'models/createPage' import { useCallback, useEffect } from 'react' import { useDispatch } from 'react-redux' import { useAppSelector } from 'redux/hooks/useAppSelector' -import { creatingV2ProjectActions } from 'redux/slices/creatingV2Project' +import { creatingV2ProjectActions } from 'redux/slices/v2v3/creatingV2Project' const pageOrder: CreatePage[] = [ 'projectDetails', diff --git a/src/redux/localStoragePreload.ts b/src/redux/localStoragePreload.ts index d3e02e815e..1abf30ab12 100644 --- a/src/redux/localStoragePreload.ts +++ b/src/redux/localStoragePreload.ts @@ -1,9 +1,9 @@ import { defaultProjectState as defaultV1ProjectState, REDUX_STORE_V1_PROJECT_VERSION, -} from './slices/editingProject' -import { INITIAL_REDUX_STATE as defaultV2ProjectState } from './slices/shared/v2ProjectInitialReduxState' -import { REDUX_STORE_V2_PROJECT_VERSION } from './slices/shared/v2ProjectVersion' +} from './slices/v1/editingProject' +import { INITIAL_REDUX_STATE as defaultV2ProjectState } from './slices/v2v3/shared/v2ProjectInitialReduxState' +import { REDUX_STORE_V2_PROJECT_VERSION } from './slices/v2v3/shared/v2ProjectVersion' import { RootState } from './store' interface PreloadedState { diff --git a/src/redux/slices/editingProject.ts b/src/redux/slices/v1/editingProject.ts similarity index 100% rename from src/redux/slices/editingProject.ts rename to src/redux/slices/v1/editingProject.ts diff --git a/src/redux/slices/creatingV2Project/creatingV2Project.ts b/src/redux/slices/v2v3/creatingV2Project/creatingV2Project.ts similarity index 100% rename from src/redux/slices/creatingV2Project/creatingV2Project.ts rename to src/redux/slices/v2v3/creatingV2Project/creatingV2Project.ts diff --git a/src/redux/slices/creatingV2Project/index.ts b/src/redux/slices/v2v3/creatingV2Project/index.ts similarity index 99% rename from src/redux/slices/creatingV2Project/index.ts rename to src/redux/slices/v2v3/creatingV2Project/index.ts index 6cd530683b..41b2fbabb5 100644 --- a/src/redux/slices/creatingV2Project/index.ts +++ b/src/redux/slices/v2v3/creatingV2Project/index.ts @@ -1,3 +1,4 @@ export * from '../shared/v2ProjectDefaultState' export * from './creatingV2Project' export { default } from './creatingV2Project' + diff --git a/src/redux/slices/editingV2Project/editingV2Project.ts b/src/redux/slices/v2v3/editingV2Project/editingV2Project.ts similarity index 100% rename from src/redux/slices/editingV2Project/editingV2Project.ts rename to src/redux/slices/v2v3/editingV2Project/editingV2Project.ts diff --git a/src/redux/slices/editingV2Project/index.ts b/src/redux/slices/v2v3/editingV2Project/index.ts similarity index 100% rename from src/redux/slices/editingV2Project/index.ts rename to src/redux/slices/v2v3/editingV2Project/index.ts diff --git a/src/redux/slices/shared/v2ProjectDefaultState.ts b/src/redux/slices/v2v3/shared/v2ProjectDefaultState.ts similarity index 100% rename from src/redux/slices/shared/v2ProjectDefaultState.ts rename to src/redux/slices/v2v3/shared/v2ProjectDefaultState.ts diff --git a/src/redux/slices/shared/v2ProjectInitialReduxState.ts b/src/redux/slices/v2v3/shared/v2ProjectInitialReduxState.ts similarity index 100% rename from src/redux/slices/shared/v2ProjectInitialReduxState.ts rename to src/redux/slices/v2v3/shared/v2ProjectInitialReduxState.ts diff --git a/src/redux/slices/shared/v2ProjectTypes.ts b/src/redux/slices/v2v3/shared/v2ProjectTypes.ts similarity index 100% rename from src/redux/slices/shared/v2ProjectTypes.ts rename to src/redux/slices/v2v3/shared/v2ProjectTypes.ts diff --git a/src/redux/slices/shared/v2ProjectVersion.ts b/src/redux/slices/v2v3/shared/v2ProjectVersion.ts similarity index 100% rename from src/redux/slices/shared/v2ProjectVersion.ts rename to src/redux/slices/v2v3/shared/v2ProjectVersion.ts diff --git a/src/redux/store.ts b/src/redux/store.ts index 1bb691a222..a8aa16af09 100644 --- a/src/redux/store.ts +++ b/src/redux/store.ts @@ -4,9 +4,9 @@ import { EnhancedStore, } from '@reduxjs/toolkit' import { getLocalStoragePreloadedState } from './localStoragePreload' -import creatingV2ProjectReducer from './slices/creatingV2Project' -import editingProjectReducer from './slices/editingProject' -import editingV2ProjectReducer from './slices/editingV2Project' +import editingProjectReducer from './slices/v1/editingProject' +import creatingV2ProjectReducer from './slices/v2v3/creatingV2Project' +import editingV2ProjectReducer from './slices/v2v3/editingV2Project' const REDUX_STATE_LOCALSTORAGE_KEY = 'jb_redux_preloadedState' From 316a1348d2c4897b93a84093c14d47a77456a79a Mon Sep 17 00:00:00 2001 From: aeolian <94939382+aeolianeth@users.noreply.github.com> Date: Thu, 19 Dec 2024 07:16:15 +1000 Subject: [PATCH 4/4] pot --- src/locales/messages.pot | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/locales/messages.pot b/src/locales/messages.pot index 4609341b24..05f37ffa68 100644 --- a/src/locales/messages.pot +++ b/src/locales/messages.pot @@ -227,6 +227,9 @@ msgstr "" msgid "Extended functionality for project owners" msgstr "" +msgid "Weight cut percent" +msgstr "" + msgid "Error downloading participants, try again." msgstr "" @@ -4571,6 +4574,9 @@ msgstr "" msgid "Save profile details" msgstr "" +msgid "Cash out tax rate" +msgstr "" + msgid "Current owner" msgstr ""