diff --git a/packages/page-contracts/src/Codes/Upload.tsx b/packages/page-contracts/src/Codes/Upload.tsx index d3c9ed2bb2..f1c8f4671d 100644 --- a/packages/page-contracts/src/Codes/Upload.tsx +++ b/packages/page-contracts/src/Codes/Upload.tsx @@ -11,7 +11,7 @@ import { Button, Dropdown, InputAddress, InputBalance, InputFile, MarkError, Mod import { useAccountId, useApi, useNonEmptyString, useNonZeroBn, useStepper } from '@polkadot/react-hooks'; import { Available } from '@polkadot/react-query'; import { keyring } from '@polkadot/ui-keyring'; -import { isNull, isWasm } from '@polkadot/util'; +import { isFunction, isNull, isWasm } from '@polkadot/util'; import { ENDOWMENT } from '../constants'; import { ABI, InputMegaGas, InputName, MessageSignature, Params } from '../shared'; @@ -130,6 +130,7 @@ function Upload ({ onClose }: Props): React.ReactElement { const isSubmittable = !!accountId && (!isNull(name) && isNameValid) && isWasmValid && isAbiSupplied && isAbiValid && !!uploadTx && step === 2; const invalidAbi = isAbiError || !isAbiSupplied; + const hasBatchDeploy = isFunction(api.tx.contracts.instantiateWithCode) || isFunction(api.tx.utility?.batch); return ( @@ -161,6 +162,9 @@ function Upload ({ onClose }: Props): React.ReactElement { onRemove={onRemoveAbi} withWasm /> + {!hasBatchDeploy && ( + ('Your environment does not support the latest instantiateWithCode contracts call, nor does it have utility.batch functionality available. This operation is not available.')} /> + )} {!invalidAbi && contractAbi && ( <> {!contractAbi.project.source.wasm.length && ( @@ -218,7 +222,7 @@ function Upload ({ onClose }: Props): React.ReactElement { ? (