File tree 4 files changed +11
-3
lines changed
apps/dashboard/src/contract-ui/components/solidity-inputs
packages/thirdweb/src/utils/contract
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) => {
159
159
160
160
// all
161
161
export 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
+ ) {
163
166
return validateInt ( value , solidityType ) ;
164
167
}
165
168
// 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<
60
60
) ;
61
61
}
62
62
63
- if ( solidityType ?. endsWith ( "[ ]" ) ) {
63
+ if ( solidityType ?. endsWith ( "]" ) ) {
64
64
return (
65
65
< SolidityRawInput
66
66
formContext = { form }
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ export function parseAbiParams(
51
51
}
52
52
return constructorParamTypes . map ( ( type , index ) => {
53
53
const value = constructorParamValues [ index ] ;
54
- if ( type === "tuple" || type . endsWith ( "[ ]" ) ) {
54
+ if ( type === "tuple" || type . endsWith ( "]" ) ) {
55
55
if ( typeof value === "string" ) {
56
56
return JSON . parse ( value ) ;
57
57
}
You can’t perform that action at this time.
0 commit comments