Skip to content

Commit 9826787

Browse files
committed
rename decodedBytes to paramsToEncode
1 parent c6178bd commit 9826787

File tree

8 files changed

+34
-34
lines changed

8 files changed

+34
-34
lines changed

apps/dashboard/src/components/contract-components/contract-publish-form/decoded-bytes-input/decoded-input-array-fieldset.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const DecodedInputArrayFieldset: React.FC<
2222
const form = useFormContext();
2323

2424
const { fields, append, remove } = useFieldArray({
25-
name: `constructorParams.${param.name ? param.name : "*"}.dynamicValue.decodedBytes`,
25+
name: `constructorParams.${param.name ? param.name : "*"}.dynamicValue.paramsToEncode`,
2626
control: form.control,
2727
});
2828

apps/dashboard/src/components/contract-components/contract-publish-form/decoded-bytes-input/decoded-input-set.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const DecodedInputSet: React.FC<DecodedInputSetProps> = ({
2323
const form = useFormContext();
2424

2525
const { fields, append, remove } = useFieldArray({
26-
name: `constructorParams.${param.name ? param.name : "*"}.dynamicValue.decodedBytes.${setIndex}`,
26+
name: `constructorParams.${param.name ? param.name : "*"}.dynamicValue.paramsToEncode.${setIndex}`,
2727
control: form.control,
2828
});
2929

apps/dashboard/src/components/contract-components/contract-publish-form/decoded-bytes-input/decoded-input.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ export const DecodedInput: React.FC<DecodedInputProps> = ({
2929
const form = useFormContext();
3030
const [isCustomAddress, setIsCustomAddress] = useState(false);
3131
const selectedType = form.watch(
32-
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.decodedBytes.${setIndex}.${paramIndex}.type`,
32+
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.paramsToEncode.${setIndex}.${paramIndex}.type`,
3333
);
3434

3535
// Toggle function to handle custom input visibility and reset fields
3636
const handleToggleCustomInput = (newVal: boolean) => {
3737
setIsCustomAddress(newVal);
3838
const path =
39-
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.decodedBytes.${setIndex}.${paramIndex}` as const;
39+
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.paramsToEncode.${setIndex}.${paramIndex}` as const;
4040

4141
if (newVal) {
4242
form.setValue(`${path}.dynamicValue.type`, selectedType);
@@ -58,18 +58,18 @@ export const DecodedInput: React.FC<DecodedInputProps> = ({
5858
label="Parameter Type"
5959
errorMessage={
6060
form.getFieldState(
61-
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.decodedBytes.${setIndex}.${paramIndex}.type`,
61+
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.paramsToEncode.${setIndex}.${paramIndex}.type`,
6262
form.formState,
6363
).error?.message
6464
}
6565
>
6666
<Select
6767
{...form.register(
68-
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.decodedBytes.${setIndex}.${paramIndex}.type`,
68+
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.paramsToEncode.${setIndex}.${paramIndex}.type`,
6969
)}
7070
onValueChange={(v) => {
7171
form.setValue(
72-
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.decodedBytes.${setIndex}.${paramIndex}.type`,
72+
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.paramsToEncode.${setIndex}.${paramIndex}.type`,
7373
v,
7474
);
7575
}}
@@ -115,7 +115,7 @@ export const DecodedInput: React.FC<DecodedInputProps> = ({
115115
<Input
116116
placeholder="Enter value"
117117
{...form.register(
118-
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.decodedBytes.${setIndex}.${paramIndex}.defaultValue`,
118+
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.paramsToEncode.${setIndex}.${paramIndex}.defaultValue`,
119119
)}
120120
disabled={selectedType === "address" && isCustomAddress}
121121
/>

apps/dashboard/src/components/contract-components/contract-publish-form/decoded-bytes-input/ref-bytes-input-fieldset.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const RefBytesInputFieldset: React.FC<RefBytesInputFieldsetProps> = ({
1818
const form = useFormContext();
1919

2020
const { fields, append, remove } = useFieldArray({
21-
name: `constructorParams.${param.name ? param.name : "*"}.dynamicValue.decodedBytes.${setIndex}.${paramIndex}.dynamicValue.refContracts`,
21+
name: `constructorParams.${param.name ? param.name : "*"}.dynamicValue.paramsToEncode.${setIndex}.${paramIndex}.dynamicValue.refContracts`,
2222
control: form.control,
2323
});
2424

apps/dashboard/src/components/contract-components/contract-publish-form/decoded-bytes-input/ref-bytes-input.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ export const RefBytesContractInput: React.FC<RefBytesContractInputProps> = ({
3636

3737
const publishedContractsQuery = usePublishedContractsQuery(
3838
form.watch(
39-
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.decodedBytes.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.publisherAddress`,
39+
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.paramsToEncode.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.publisherAddress`,
4040
),
4141
);
4242

4343
const allVersions = useAllVersions(
4444
form.watch(
45-
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.decodedBytes.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.publisherAddress`,
45+
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.paramsToEncode.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.publisherAddress`,
4646
),
4747
form.watch(
48-
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.decodedBytes.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.contractId`,
48+
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.paramsToEncode.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.contractId`,
4949
),
5050
);
5151

@@ -57,7 +57,7 @@ export const RefBytesContractInput: React.FC<RefBytesContractInputProps> = ({
5757
isRequired={true}
5858
errorMessage={
5959
form.getFieldState(
60-
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.decodedBytes.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.publisherAddress`,
60+
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.paramsToEncode.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.publisherAddress`,
6161
form.formState,
6262
).error?.message
6363
}
@@ -66,7 +66,7 @@ export const RefBytesContractInput: React.FC<RefBytesContractInputProps> = ({
6666
placeholder="Address or ENS"
6767
className="truncate"
6868
{...form.register(
69-
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.decodedBytes.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.publisherAddress`,
69+
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.paramsToEncode.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.publisherAddress`,
7070
)}
7171
/>
7272
</FormFieldSetup>
@@ -90,11 +90,11 @@ export const RefBytesContractInput: React.FC<RefBytesContractInputProps> = ({
9090
<Select
9191
disabled={(publishedContractsQuery?.data || []).length === 0}
9292
{...form.register(
93-
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.decodedBytes.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.contractId`,
93+
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.paramsToEncode.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.contractId`,
9494
)}
9595
onValueChange={(v) => {
9696
form.setValue(
97-
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.decodedBytes.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.contractId`,
97+
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.paramsToEncode.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.contractId`,
9898
v,
9999
);
100100
}}
@@ -141,11 +141,11 @@ export const RefBytesContractInput: React.FC<RefBytesContractInputProps> = ({
141141
<Select
142142
disabled={!allVersions.data}
143143
{...form.register(
144-
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.decodedBytes.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.version`,
144+
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.paramsToEncode.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.version`,
145145
)}
146146
onValueChange={(v) => {
147147
form.setValue(
148-
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.decodedBytes.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.version`,
148+
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.paramsToEncode.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.version`,
149149
v === "latest" ? "" : v,
150150
);
151151
}}
@@ -176,7 +176,7 @@ export const RefBytesContractInput: React.FC<RefBytesContractInputProps> = ({
176176
label="Salt"
177177
errorMessage={
178178
form.getFieldState(
179-
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.decodedBytes.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.salt`,
179+
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.paramsToEncode.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.salt`,
180180
form.formState,
181181
).error?.message
182182
}
@@ -185,7 +185,7 @@ export const RefBytesContractInput: React.FC<RefBytesContractInputProps> = ({
185185
className="truncate"
186186
placeholder="Salt (optional)"
187187
{...form.register(
188-
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.decodedBytes.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.salt`,
188+
`constructorParams.${param.name ? param.name : "*"}.dynamicValue.paramsToEncode.${setIndex}.${paramIndex}.dynamicValue.refContracts.${index}.salt`,
189189
)}
190190
/>
191191
</FormFieldSetup>

packages/thirdweb/src/extensions/prebuilts/process-ref-deployments.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe.runIf(process.env.TW_SECRET_KEY)(
2626
chain: ANVIL_CHAIN,
2727
account: TEST_ACCOUNT_A,
2828
contractId: "MultiSig",
29-
version: "0.0.3",
29+
version: "0.0.4",
3030
salt: "tw",
3131
publisher: "0x6453a486d52e0EB6E79Ec4491038E2522a926936",
3232
});
@@ -44,7 +44,7 @@ describe.runIf(process.env.TW_SECRET_KEY)(
4444
chain: ANVIL_CHAIN,
4545
account: TEST_ACCOUNT_A,
4646
contractId: "MintFeeManagerCore",
47-
version: "0.0.23",
47+
version: "0.0.25",
4848
salt: "tw",
4949
publisher: "0x6453a486d52e0EB6E79Ec4491038E2522a926936",
5050
});
@@ -53,7 +53,7 @@ describe.runIf(process.env.TW_SECRET_KEY)(
5353
chain: ANVIL_CHAIN,
5454
account: TEST_ACCOUNT_A,
5555
contractId: "ClaimableERC721",
56-
version: "0.0.12",
56+
version: "0.0.13",
5757
salt: "tw",
5858
publisher: "0x6453a486d52e0EB6E79Ec4491038E2522a926936",
5959
});
@@ -94,7 +94,7 @@ describe.runIf(process.env.TW_SECRET_KEY)(
9494
expect(owner.toLowerCase()).to.eq(multisigAddress);
9595
expect(modules.length).to.eq(1);
9696
expect(modules[0]?.implementation.toLowerCase()).to.eq(mintfeeManagerModuleAddress);
97-
expect(feeRecipient.toLowerCase()).to.eq("0x000000000000000000000000000000000000dead");
97+
expect(feeRecipient.toLowerCase()).to.eq(multisigAddress);
9898
expect(fee).to.eq(5n);
9999
});
100100
},

packages/thirdweb/src/extensions/prebuilts/process-ref-deployments.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export type DynamicParams = {
1212
contractId: string;
1313
salt?: string;
1414
}[];
15-
decodedBytes: Array<
15+
paramsToEncode: Array<
1616
Array<{
1717
type: string;
1818
defaultValue?: string;
@@ -94,12 +94,12 @@ export type DynamicParams = {
9494
}
9595

9696
if (dynamicValue.type === "bytes") {
97-
const decodedBytes = dynamicValue.decodedBytes[0];
97+
const paramsToEncode = dynamicValue.paramsToEncode[0];
9898

99-
if (decodedBytes) {
99+
if (paramsToEncode) {
100100
const types = [];
101101
const values = [];
102-
for (const v of decodedBytes) {
102+
for (const v of paramsToEncode) {
103103
types.push(v.type);
104104

105105
if (v.defaultValue) {
@@ -127,15 +127,15 @@ export type DynamicParams = {
127127

128128
if (dynamicValue.type === "bytes[]") {
129129
const bytesArray = [];
130-
const decodedBytesArray = dynamicValue.decodedBytes;
130+
const paramArray = dynamicValue.paramsToEncode;
131131

132-
for (const a of decodedBytesArray) {
133-
const decodedBytes = a;
132+
for (const a of paramArray) {
133+
const paramsToEncode = a;
134134

135-
if (decodedBytes) {
135+
if (paramsToEncode) {
136136
const types = [];
137137
const values = [];
138-
for (const v of decodedBytes) {
138+
for (const v of paramsToEncode) {
139139
types.push(v.type);
140140

141141
if (v.defaultValue) {

packages/thirdweb/src/utils/any-evm/deploy-metadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ type DynamicParams = {
171171
}>;
172172

173173
// use for bytes
174-
decodedBytes?: Array<
174+
paramsToEncode?: Array<
175175
Array<{
176176
type: string;
177177
defaultValue?: string;

0 commit comments

Comments
 (0)