diff --git a/src/components/DaoCreator/formComponents/AzoriusTokenAllocation.tsx b/src/components/DaoCreator/formComponents/AzoriusTokenAllocation.tsx index c066bdda74..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; + amountInputValue?: BigNumber | null; allocationLength: number; } diff --git a/src/components/ProposalBuilder/constants.ts b/src/components/ProposalBuilder/constants.ts index 8eb29adad4..46f9219a24 100644 --- a/src/components/ProposalBuilder/constants.ts +++ b/src/components/ProposalBuilder/constants.ts @@ -2,7 +2,7 @@ import { CreateProposalTransaction } from '../../types/proposalBuilder'; export const DEFAULT_PROPOSAL_TRANSACTION: CreateProposalTransaction = { targetAddress: '', - ethValue: { value: '', bigNumberValue: undefined }, + ethValue: { value: '', bigNumberValue: null }, functionName: '', parameters: [ { diff --git a/src/components/ui/forms/BigNumberInput.tsx b/src/components/ui/forms/BigNumberInput.tsx index 02214580b5..c7a8229ed2 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 | 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/components/ui/modals/ForkProposalTemplateModal.tsx b/src/components/ui/modals/ForkProposalTemplateModal.tsx index ccfe6c5536..db524d57bc 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(); }; diff --git a/src/hooks/DAO/proposal/usePrepareProposal.ts b/src/hooks/DAO/proposal/usePrepareProposal.ts index d8ca234c08..44928a7173 100644 --- a/src/hooks/DAO/proposal/usePrepareProposal.ts +++ b/src/hooks/DAO/proposal/usePrepareProposal.ts @@ -42,7 +42,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.calldata || ''), metaData: { title: proposalMetadata.title, 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 };