Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/grumpy-carpets-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Handle fixed size arrays in solidity inputs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const SolidityInput = forwardRef<
);
}

if (solidityType?.endsWith("[]")) {
if (solidityType?.endsWith("]")) {
return (
<SolidityRawInput
formContext={form}
Expand Down
2 changes: 1 addition & 1 deletion packages/thirdweb/src/utils/contract/parse-abi-params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function parseAbiParams(
}
return constructorParamTypes.map((type, index) => {
const value = constructorParamValues[index];
if (type === "tuple" || type.endsWith("[]")) {
if (type === "tuple" || type.endsWith("]")) {
if (typeof value === "string") {
return JSON.parse(value);
}
Expand Down
Loading