Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dashboard] Feature: UI for crosschain modules #5399

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fe50d84
UI for crosschain modules
GWSzeto Nov 8, 2024
d14ec4b
Merge remote-tracking branch 'origin/main' into crosschain-ui
GWSzeto Nov 25, 2024
d442dfe
Merge remote-tracking branch 'origin/main' into crosschain-ui
GWSzeto Nov 26, 2024
c4acff6
Merge remote-tracking branch 'origin/main' into crosschain-ui
GWSzeto Nov 27, 2024
9fedac3
WIP: hardcoded modified version of TWCloneFactory to be used
GWSzeto Nov 27, 2024
4595d58
WIP: TODO's created to fetch for ContractInitialized event and update…
GWSzeto Nov 30, 2024
d08b33c
WIP: Testing out deploying bare core contract with modules installed …
GWSzeto Dec 4, 2024
9f5289b
Merge remote-tracking branch 'origin/main' into crosschain-ui
GWSzeto Dec 4, 2024
1f74bf6
WIP: staging to get help
GWSzeto Dec 5, 2024
3248212
successfully deploys using the initialize data from the event
GWSzeto Dec 6, 2024
6b9dd33
able to install modules successfully when crosschain deploying
GWSzeto Dec 6, 2024
64ca579
updated to be promise.allSettled when installing modules to not block…
GWSzeto Dec 6, 2024
9143857
removing console logs
GWSzeto Dec 6, 2024
051028b
fixing liniting issues
GWSzeto Dec 6, 2024
97e6b99
fixed linting issues
GWSzeto Dec 6, 2024
55158b4
created isSuperchain and isCrosschain flag in favour of case switch s…
GWSzeto Dec 9, 2024
67db04d
god bless greg it works
GWSzeto Dec 10, 2024
f6ee6a2
Merge remote-tracking branch 'origin/main' into crosschain-ui
GWSzeto Dec 10, 2024
828c198
addressed comments in PR
GWSzeto Dec 11, 2024
429d10c
updated wording
GWSzeto Dec 11, 2024
71b8a97
updated superchain bridge address
GWSzeto Dec 11, 2024
3cc27b6
Merge remote-tracking branch 'origin/main' into crosschain-ui
GWSzeto Dec 13, 2024
1a7f7cb
updated to show links
GWSzeto Dec 14, 2024
ec1a0a1
implemented cross chain transfers
GWSzeto Dec 17, 2024
52c3f44
tweaked input + button on crosschain transfer for OP Interop
GWSzeto Dec 17, 2024
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
Prev Previous commit
Next Next commit
WIP: hardcoded modified version of TWCloneFactory to be used
  • Loading branch information
GWSzeto committed Nov 27, 2024
commit 9fedac3624dc7003c0e41348acd765959c6e7583
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { ZERO_ADDRESS, defineChain } from "thirdweb";
import type { FetchDeployMetadataResult } from "thirdweb/contract";
import { deployContractfromDeployMetadata } from "thirdweb/deploys";
import { useActiveAccount, useSwitchActiveWalletChain } from "thirdweb/react";
import { concatHex, padHex } from "thirdweb/utils";

export type CrossChain = {
id: number;
Expand Down Expand Up @@ -170,7 +171,7 @@ export function DataTable({

const chain = defineChain(chainId);
const client = getThirdwebClient();
const salt = "thirdweb";
const salt = concatHex(["0x0101", padHex("0x", { size: 30 })]).toString();

await switchChain(chain);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ export default async function Page(props: {
},
);

const _topOPStackChainIds = [
8453, // Base
10, // OP Mainnet
34443, // Mode Network
7560, // Cyber
7777777, // Zora
];

const topOPStackTestnetChainIds = [
84532, // Base
11155420, // OP testnet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {
} from "thirdweb/deploys";
import { useActiveAccount, useActiveWalletChain } from "thirdweb/react";
import { upload } from "thirdweb/storage";
import { concatHex, padHex } from "thirdweb/utils";
import { FormHelperText, FormLabel, Heading, Text } from "tw-components";
import { useCustomFactoryAbi, useFunctionParamsFromABI } from "../hooks";
import { addContractToMultiChainRegistry } from "../utils";
Expand Down Expand Up @@ -436,7 +437,7 @@ export const CustomContractForm: React.FC<CustomContractFormProps> = ({

// TODO: discuss how to handle the salt properly for crosschain contracts
const salt = isSuperchainInterop
? "thirdweb"
? concatHex(["0x0101", padHex("0x", { size: 30 })]).toString()
: params.deployDeterministic
? params.signerAsSalt
? activeAccount.address.concat(params.saltForCreate2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { getRpcClient } from "../../rpc/rpc.js";
import { encode } from "../../transaction/actions/encode.js";
import { sendAndConfirmTransaction } from "../../transaction/actions/send-and-confirm-transaction.js";
import type { PreparedTransaction } from "../../transaction/prepare-transaction.js";
import { keccakId } from "../../utils/any-evm/keccak-id.js";
import { isZkSyncChain } from "../../utils/any-evm/zksync/isZkSyncChain.js";
import { toHex } from "../../utils/encoding/hex.js";
import { resolvePromisedValue } from "../../utils/promise/resolve-promised-value.js";
Expand Down Expand Up @@ -35,7 +34,8 @@ export function prepareAutoFactoryDeployTransaction(
});
const blockNumber = await eth_blockNumber(rpcRequest);
const salt = args.salt
? keccakId(args.salt)
? //? keccakId(args.salt)
(args.salt as `0x${string}`)
: toHex(blockNumber, {
size: 32,
});
Expand Down
14 changes: 11 additions & 3 deletions packages/thirdweb/src/extensions/prebuilts/deploy-published.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export async function deployContractfromDeployMetadata(
import("../../contract/deployment/deploy-via-autofactory.js"),
import("../../contract/deployment/utils/bootstrap.js"),
]);
const { cloneFactoryContract, implementationContract } =
const { cloneFactoryContract: _, implementationContract } =
await getOrDeployInfraForPublishedContract({
chain,
client,
Expand All @@ -181,18 +181,26 @@ export async function deployContractfromDeployMetadata(
const initializeTransaction = await getInitializeTransaction({
client,
chain,
deployMetadata: deployMetadata,
deployMetadata,
implementationContract,
initializeParams,
account,
modules,
});

// TODO: remove this once the modified version of TWCloneFactory
// has been published under the thirdweb wallet
const modifiedCloneFactoryContract = getContract({
client,
address: "0x7756D8a084e55d9872BD5bBDf6867543D15866A4", // only deployed on OP and zora testnets
chain,
});

return deployViaAutoFactory({
client,
chain,
account,
cloneFactoryContract,
cloneFactoryContract: modifiedCloneFactoryContract,
GWSzeto marked this conversation as resolved.
Show resolved Hide resolved
initializeTransaction,
salt,
});
Expand Down
Loading