Skip to content

Commit 3665092

Browse files
WIP sophon
1 parent 734707e commit 3665092

File tree

2 files changed

+38
-6
lines changed

2 files changed

+38
-6
lines changed

packages/thirdweb/src/wallets/smart/smart-wallet-dev.test.ts

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { beforeAll, describe, expect, it } from "vitest";
22
import { TEST_CLIENT } from "../../../test/src/test-clients.js";
3-
import { zkSyncSepolia } from "../../chains/chain-definitions/zksync-sepolia.js";
3+
import { defineChain } from "../../chains/utils.js";
44
import { type ThirdwebContract, getContract } from "../../contract/contract.js";
55
import { balanceOf } from "../../extensions/erc1155/__generated__/IERC1155/read/balanceOf.js";
66
import { claimTo } from "../../extensions/erc1155/drops/write/claimTo.js";
7+
import { deployPublishedContract } from "../../extensions/prebuilts/deploy-published.js";
78
import { sendAndConfirmTransaction } from "../../transaction/actions/send-and-confirm-transaction.js";
89
import { sendTransaction } from "../../transaction/actions/send-transaction.js";
910
import { prepareTransaction } from "../../transaction/prepare-transaction.js";
@@ -20,14 +21,14 @@ let smartWalletAddress: Address;
2021
let personalAccount: Account;
2122
let accountContract: ThirdwebContract;
2223

23-
const chain = zkSyncSepolia;
24+
const chain = defineChain(531050104);
2425
const client = TEST_CLIENT;
2526
const contract = getContract({
2627
client,
2728
chain,
2829
address: "0x6A7a26c9a595E6893C255C9dF0b593e77518e0c3",
2930
});
30-
describe.runIf(process.env.TW_SECRET_KEY).skip.sequential(
31+
describe.runIf(process.env.TW_SECRET_KEY).sequential(
3132
"SmartWallet policy tests",
3233
{
3334
retry: 0,
@@ -69,7 +70,7 @@ describe.runIf(process.env.TW_SECRET_KEY).skip.sequential(
6970
expect(isDeployed).toEqual(true);
7071
});
7172

72-
it("should send a transaction", async () => {
73+
it.skip("should send a transaction", async () => {
7374
const tx = prepareTransaction({
7475
client,
7576
chain,
@@ -106,5 +107,29 @@ describe.runIf(process.env.TW_SECRET_KEY).skip.sequential(
106107
});
107108
expect(balance).toEqual(1n);
108109
});
110+
111+
it("should deploy a published autofactory contract", async () => {
112+
const address = await deployPublishedContract({
113+
client: TEST_CLIENT,
114+
chain,
115+
account: smartAccount,
116+
contractId: "DropERC721",
117+
contractParams: {
118+
defaultAdmin: smartAccount.address, // defaultAdmin
119+
name: "test", // name
120+
symbol: "test", // symbol
121+
contractURI: "", // contractURI
122+
trustedForwarders: [], // trustedForwarders
123+
saleRecipient: smartAccount.address, // saleRecipient
124+
royaltyRecipient: smartAccount.address, // royaltyRecipient
125+
royaltyBps: 0n, // royaltyBps
126+
platformFeeBps: 0n, // platformFeeBps
127+
platformFeeRecipient: smartAccount.address, // platformFeeRecipient
128+
},
129+
});
130+
console.log("deployed address", address);
131+
expect(address).toBeDefined();
132+
expect(address.length).toBe(42);
133+
});
109134
},
110135
);

packages/thirdweb/test/src/test-clients.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@ const secretKey = process.env.TW_SECRET_KEY;
44

55
export const TEST_CLIENT = createThirdwebClient(
66
secretKey
7-
? { secretKey }
7+
? {
8+
secretKey,
9+
config: {
10+
storage: { gatewayUrl: "https://gateway.pinata.cloud/ipfs/" },
11+
},
12+
}
813
: {
914
clientId: "TEST",
1015
// if we don't have a secret key, we can use a public gateway for testing?
11-
config: { storage: { gatewayUrl: "https://cf-ipfs.com" } },
16+
config: {
17+
storage: { gatewayUrl: "https://gateway.pinata.cloud/ipfs/" },
18+
},
1219
},
1320
);

0 commit comments

Comments
 (0)