Skip to content

Commit 828c198

Browse files
committed
addressed comments in PR
1 parent f6ee6a2 commit 828c198

File tree

6 files changed

+41
-24
lines changed

6 files changed

+41
-24
lines changed

apps/dashboard/src/components/contract-components/contract-deploy-form/custom-contract.tsx

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,10 @@ export const CustomContractForm: React.FC<CustomContractFormProps> = ({
458458

459459
const moduleDeployData = modules?.map((m) => ({
460460
deployMetadata: m,
461-
initializeParams: params.moduleData[m.name],
461+
initializeParams:
462+
m.name === "SuperChainInterop"
463+
? { superchainBridge: "0x4200000000000000000000000000000000000010" }
464+
: params.moduleData[m.name],
462465
}));
463466

464467
const coreContractAddress = await deployContractfromDeployMetadata({
@@ -480,15 +483,15 @@ export const CustomContractForm: React.FC<CustomContractFormProps> = ({
480483
chain: walletChain,
481484
});
482485

483-
const rpcRequest = getRpcClient({
484-
client: thirdwebClient,
485-
chain: walletChain,
486-
});
487-
const currentNonce = await eth_getTransactionCount(rpcRequest, {
488-
address: activeAccount.address,
489-
});
490-
491486
if (isSuperchainInterop && moduleDeployData) {
487+
const rpcRequest = getRpcClient({
488+
client: thirdwebClient,
489+
chain: walletChain,
490+
});
491+
const currentNonce = await eth_getTransactionCount(rpcRequest, {
492+
address: activeAccount.address,
493+
});
494+
492495
for (const [i, m] of moduleDeployData.entries()) {
493496
let moduleData: `0x${string}` | undefined;
494497

@@ -849,7 +852,10 @@ export const CustomContractForm: React.FC<CustomContractFormProps> = ({
849852
{isModular && modules && modules.length > 0 && (
850853
<ModularContractDefaultModulesFieldset
851854
form={form}
852-
modules={modules}
855+
modules={modules.filter(
856+
// superchain interop will have a default value for it's install param
857+
(mod) => mod.name !== "SuperChainInterop",
858+
)}
853859
isTWPublisher={isTWPublisher}
854860
/>
855861
)}

packages/thirdweb/src/contract/deployment/deploy-via-autofactory.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { parseEventLogs } from "../../event/actions/parse-logs.js";
2-
import { proxyDeployedEvent } from "../../extensions/thirdweb/__generated__/IContractFactory/events/ProxyDeployed.js";
2+
import {
3+
modifiedProxyDeployedEvent,
4+
proxyDeployedEvent,
5+
} from "../../extensions/thirdweb/__generated__/IContractFactory/events/ProxyDeployed.js";
36
import { deployProxyByImplementation } from "../../extensions/thirdweb/__generated__/IContractFactory/write/deployProxyByImplementation.js";
47
import { eth_blockNumber } from "../../rpc/actions/eth_blockNumber.js";
58
import { getRpcClient } from "../../rpc/rpc.js";
@@ -97,8 +100,13 @@ export async function deployViaAutoFactory(
97100
transaction: tx,
98101
account,
99102
});
103+
104+
// TODO: remove this once the modified version of TWCloneFactory has been published
105+
const proxyEvent = salt?.startsWith("0x0101")
106+
? modifiedProxyDeployedEvent()
107+
: proxyDeployedEvent();
100108
const decodedEvent = parseEventLogs({
101-
events: [proxyDeployedEvent()],
109+
events: [proxyEvent],
102110
logs: receipt.logs,
103111
});
104112
if (decodedEvent.length === 0 || !decodedEvent[0]) {
@@ -143,19 +151,18 @@ export async function deployViaAutoFactoryWithImplementationParams(
143151
size: 32,
144152
});
145153

146-
const asd = {
154+
const tx = deployProxyByImplementation({
147155
contract: cloneFactoryContract,
148156
data: initializeData || "0x",
149157
implementation: implementationAddress,
150158
salt: parsedSalt,
151-
};
152-
const tx = deployProxyByImplementation(asd);
159+
});
153160
const receipt = await sendAndConfirmTransaction({
154161
transaction: tx,
155162
account,
156163
});
157164
const decodedEvent = parseEventLogs({
158-
events: [proxyDeployedEvent()],
165+
events: [modifiedProxyDeployedEvent()],
159166
logs: receipt.logs,
160167
});
161168
if (decodedEvent.length === 0 || !decodedEvent[0]) {

packages/thirdweb/src/extensions/prebuilts/deploy-published.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,6 @@ export async function deployContractfromDeployMetadata(
185185
publisher: deployMetadata.publisher,
186186
});
187187

188-
console.error("is superchain interop", isSuperchainInterop);
189-
console.error("is crosschain: ", isCrosschain);
190-
console.error("initialize data: ", initializeData);
191-
192188
// TODO: remove this once the modified version of TWCloneFactory
193189
// has been published under the thirdweb wallet
194190
const modifiedCloneFactoryContract = getContract({

packages/thirdweb/src/extensions/thirdweb/__generated__/IContractFactory/events/ProxyDeployed.ts

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/thirdweb/src/transaction/actions/send-and-confirm-transaction.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,5 @@ export async function sendAndConfirmTransaction(
5353
options: SendTransactionOptions,
5454
): Promise<TransactionReceipt> {
5555
const submittedTx = await sendTransaction(options);
56-
const receipt = await waitForReceipt(submittedTx);
57-
58-
return receipt;
56+
return waitForReceipt(submittedTx);
5957
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export type ExtendedMetadata = {
207207
factoryAddresses?: Record<string, string>;
208208
}
209209
| undefined;
210-
deployType?: "standard" | "autoFactory" | "customFactory" | "crosschain";
210+
deployType?: "standard" | "autoFactory" | "customFactory";
211211
routerType?: "none" | "plugin" | "dynamic" | "modular";
212212
networksForDeployment?: {
213213
allNetworks?: boolean;

0 commit comments

Comments
 (0)