File tree Expand file tree Collapse file tree 4 files changed +11
-3
lines changed
apps/dashboard/src/contract-ui/components/solidity-inputs
packages/thirdweb/src/utils/contract Expand file tree Collapse file tree 4 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " thirdweb " : patch
3+ ---
4+
5+ Handle fixed size arrays in solidity inputs
Original file line number Diff line number Diff line change @@ -159,7 +159,10 @@ export const validateAddress = (value: string) => {
159159
160160// all
161161export const validateSolidityInput = ( value : string , solidityType : string ) => {
162- if ( solidityType . startsWith ( "int" ) || solidityType . startsWith ( "uint" ) ) {
162+ if (
163+ ( solidityType . startsWith ( "int" ) || solidityType . startsWith ( "uint" ) ) &&
164+ ! solidityType . endsWith ( "]" )
165+ ) {
163166 return validateInt ( value , solidityType ) ;
164167 }
165168 // TODO: bytes array not working right now
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ export const SolidityInput = forwardRef<
6060 ) ;
6161 }
6262
63- if ( solidityType ?. endsWith ( "[ ]" ) ) {
63+ if ( solidityType ?. endsWith ( "]" ) ) {
6464 return (
6565 < SolidityRawInput
6666 formContext = { form }
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ export function parseAbiParams(
5151 }
5252 return constructorParamTypes . map ( ( type , index ) => {
5353 const value = constructorParamValues [ index ] ;
54- if ( type === "tuple" || type . endsWith ( "[ ]" ) ) {
54+ if ( type === "tuple" || type . endsWith ( "]" ) ) {
5555 if ( typeof value === "string" ) {
5656 return JSON . parse ( value ) ;
5757 }
You can’t perform that action at this time.
0 commit comments