diff --git a/.changeset/grumpy-carpets-sniff.md b/.changeset/grumpy-carpets-sniff.md new file mode 100644 index 00000000000..465bfda2ba6 --- /dev/null +++ b/.changeset/grumpy-carpets-sniff.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Handle fixed size arrays in solidity inputs diff --git a/apps/dashboard/src/contract-ui/components/solidity-inputs/helpers.ts b/apps/dashboard/src/contract-ui/components/solidity-inputs/helpers.ts index 9ae8f9c2df9..880616117bc 100644 --- a/apps/dashboard/src/contract-ui/components/solidity-inputs/helpers.ts +++ b/apps/dashboard/src/contract-ui/components/solidity-inputs/helpers.ts @@ -159,7 +159,10 @@ export const validateAddress = (value: string) => { // all export const validateSolidityInput = (value: string, solidityType: string) => { - if (solidityType.startsWith("int") || solidityType.startsWith("uint")) { + if ( + (solidityType.startsWith("int") || solidityType.startsWith("uint")) && + !solidityType.endsWith("]") + ) { return validateInt(value, solidityType); } // TODO: bytes array not working right now diff --git a/apps/dashboard/src/contract-ui/components/solidity-inputs/index.tsx b/apps/dashboard/src/contract-ui/components/solidity-inputs/index.tsx index 101b8d30800..ee04d2a1d59 100644 --- a/apps/dashboard/src/contract-ui/components/solidity-inputs/index.tsx +++ b/apps/dashboard/src/contract-ui/components/solidity-inputs/index.tsx @@ -60,7 +60,7 @@ export const SolidityInput = forwardRef< ); } - if (solidityType?.endsWith("[]")) { + if (solidityType?.endsWith("]")) { return ( { const value = constructorParamValues[index]; - if (type === "tuple" || type.endsWith("[]")) { + if (type === "tuple" || type.endsWith("]")) { if (typeof value === "string") { return JSON.parse(value); }