From 2bf7fc34baf8aa960fae96e67f380517c5259242 Mon Sep 17 00:00:00 2001 From: Adam Gall Date: Fri, 5 Apr 2024 19:32:23 -0400 Subject: [PATCH 1/5] Release 2024-04-08 From c2217584640933715a87c8187a5e5f0e37e5c42c Mon Sep 17 00:00:00 2001 From: Adam Gall Date: Mon, 8 Apr 2024 13:27:35 -0400 Subject: [PATCH 2/5] All new query params should now be appended with `&`, because the `dao` param is first with `?` already --- src/components/ui/modals/ForkProposalTemplateModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ui/modals/ForkProposalTemplateModal.tsx b/src/components/ui/modals/ForkProposalTemplateModal.tsx index f63cf23d7d..00b9ad7bfd 100644 --- a/src/components/ui/modals/ForkProposalTemplateModal.tsx +++ b/src/components/ui/modals/ForkProposalTemplateModal.tsx @@ -78,7 +78,7 @@ export default function ForkProposalTemplateModal({ `${DAO_ROUTES.proposalTemplateNew.relative( addressPrefix, targetDAOAddress, - )}?templatesHash=${proposalTemplatesHash}&templateIndex=${templateIndex}`, + )}&templatesHash=${proposalTemplatesHash}&templateIndex=${templateIndex}`, ); onClose(); }; From 6b0aade9272e369fd44c407ec8366b005c7b5b74 Mon Sep 17 00:00:00 2001 From: Kirill Klimenko Date: Mon, 8 Apr 2024 20:31:41 +0200 Subject: [PATCH 3/5] Fix problem with missing bigNumberValue during prepareProposal --- src/hooks/DAO/proposal/usePrepareProposal.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hooks/DAO/proposal/usePrepareProposal.ts b/src/hooks/DAO/proposal/usePrepareProposal.ts index c9914cd0b3..54928a6360 100644 --- a/src/hooks/DAO/proposal/usePrepareProposal.ts +++ b/src/hooks/DAO/proposal/usePrepareProposal.ts @@ -25,7 +25,9 @@ export function usePrepareProposal() { ); return { targets, - values: transactionsWithEncoding.map(transaction => transaction.ethValue.bigNumberValue!), + values: transactionsWithEncoding.map( + transaction => transaction.ethValue.bigNumberValue || 0, + ), calldatas: transactionsWithEncoding.map( transaction => transaction.encodedFunctionData || '', ), From ac192ff959efc52820a75c0c22d8a4ed25bd5cfb Mon Sep 17 00:00:00 2001 From: Kirill Klimenko Date: Mon, 8 Apr 2024 20:56:38 +0200 Subject: [PATCH 4/5] Explicitly set bigNumberValue to null while creating proposal template and within BigNumberInput --- src/components/CreateProposalTemplate/constants.ts | 2 +- .../DaoCreator/formComponents/AzoriusTokenAllocation.tsx | 2 +- src/components/ui/forms/BigNumberInput.tsx | 6 +++--- src/hooks/utils/useApproval.tsx | 2 +- src/types/common.ts | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/CreateProposalTemplate/constants.ts b/src/components/CreateProposalTemplate/constants.ts index 4c7930e184..d7673dd6fd 100644 --- a/src/components/CreateProposalTemplate/constants.ts +++ b/src/components/CreateProposalTemplate/constants.ts @@ -2,7 +2,7 @@ import { CreateProposalTemplateTransaction } from '../../types/createProposalTem export const DEFAULT_PROPOSAL_TEMPLATE_TRANSACTION: CreateProposalTemplateTransaction = { targetAddress: '', - ethValue: { value: '', bigNumberValue: undefined }, + ethValue: { value: '', bigNumberValue: null }, functionName: '', parameters: [ { diff --git a/src/components/DaoCreator/formComponents/AzoriusTokenAllocation.tsx b/src/components/DaoCreator/formComponents/AzoriusTokenAllocation.tsx index c066bdda74..4c85f26ce0 100644 --- a/src/components/DaoCreator/formComponents/AzoriusTokenAllocation.tsx +++ b/src/components/DaoCreator/formComponents/AzoriusTokenAllocation.tsx @@ -11,7 +11,7 @@ interface ITokenAllocations { setFieldValue: (field: string, value: any) => void; addressErrorMessage: string | null; amountErrorMessage: string | null; - amountInputValue: BigNumber | undefined; + amountInputValue: BigNumber | undefined | null; allocationLength: number; } diff --git a/src/components/ui/forms/BigNumberInput.tsx b/src/components/ui/forms/BigNumberInput.tsx index 02214580b5..51cf769f89 100644 --- a/src/components/ui/forms/BigNumberInput.tsx +++ b/src/components/ui/forms/BigNumberInput.tsx @@ -13,12 +13,12 @@ import { BigNumberValuePair } from '../../../types'; export interface BigNumberInputProps extends Omit, FormControlOptions { - value: BigNumber | undefined; + value: BigNumber | undefined | null; onChange: (value: BigNumberValuePair) => void; decimalPlaces?: number; min?: string; max?: string; - maxValue?: BigNumber; + maxValue?: BigNumber | null; } /** * This component will add a chakra Input component that accepts and sets a BigNumber @@ -82,7 +82,7 @@ export function BigNumberInput({ if (stringValue === '') { onChange({ value: stringValue, - bigNumberValue: undefined, + bigNumberValue: null, }); setInputValue(''); return; diff --git a/src/hooks/utils/useApproval.tsx b/src/hooks/utils/useApproval.tsx index 681a41a0c6..8e8881198b 100644 --- a/src/hooks/utils/useApproval.tsx +++ b/src/hooks/utils/useApproval.tsx @@ -8,7 +8,7 @@ import { useTransaction } from './useTransaction'; const useApproval = ( tokenContract?: VotesERC20 | VotesERC20Wrapper, spenderAddress?: string, - userBalance?: BigNumber, + userBalance?: BigNumber | null, ) => { const { address: account } = useAccount(); const [allowance, setAllowance] = useState(BigNumber.from(0)); diff --git a/src/types/common.ts b/src/types/common.ts index de450d9095..e611af1d7b 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -2,7 +2,7 @@ import { BigNumber } from 'ethers'; export interface BigNumberValuePair { value: string; - bigNumberValue?: BigNumber; + bigNumberValue?: BigNumber | null; } export type WithError = { error?: string }; From e3ff66bbc0d7130ab71271eb67257371a21a03be Mon Sep 17 00:00:00 2001 From: Kirill Klimenko Date: Tue, 9 Apr 2024 12:44:34 +0200 Subject: [PATCH 5/5] Do not type amountInputValue and value on BigNumberInput with explicit undefined --- .../DaoCreator/formComponents/AzoriusTokenAllocation.tsx | 2 +- src/components/ui/forms/BigNumberInput.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/DaoCreator/formComponents/AzoriusTokenAllocation.tsx b/src/components/DaoCreator/formComponents/AzoriusTokenAllocation.tsx index 4c85f26ce0..4f6f574d50 100644 --- a/src/components/DaoCreator/formComponents/AzoriusTokenAllocation.tsx +++ b/src/components/DaoCreator/formComponents/AzoriusTokenAllocation.tsx @@ -11,7 +11,7 @@ interface ITokenAllocations { setFieldValue: (field: string, value: any) => void; addressErrorMessage: string | null; amountErrorMessage: string | null; - amountInputValue: BigNumber | undefined | null; + amountInputValue?: BigNumber | null; allocationLength: number; } diff --git a/src/components/ui/forms/BigNumberInput.tsx b/src/components/ui/forms/BigNumberInput.tsx index 51cf769f89..c7a8229ed2 100644 --- a/src/components/ui/forms/BigNumberInput.tsx +++ b/src/components/ui/forms/BigNumberInput.tsx @@ -13,7 +13,7 @@ import { BigNumberValuePair } from '../../../types'; export interface BigNumberInputProps extends Omit, FormControlOptions { - value: BigNumber | undefined | null; + value?: BigNumber | null; onChange: (value: BigNumberValuePair) => void; decimalPlaces?: number; min?: string;