Skip to content

Commit 02bc9f0

Browse files
committed
cli templates for creating rust modules
1 parent 4bb0d43 commit 02bc9f0

File tree

1 file changed

+49
-0
lines changed
  • packages/thirdweb/src/cli/commands/stylus

1 file changed

+49
-0
lines changed

packages/thirdweb/src/cli/commands/stylus/create.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ export async function createStylusProject() {
6060
{ title: "Airdrop ERC1155", value: "airdrop1155" },
6161
{ title: "ZK ERC721", value: "zk-erc721" },
6262
{ title: "ZK ERC20", value: "zk-erc20" },
63+
{ title: "Mint module - ERC20", value: "mintable20" },
64+
{ title: "Transfer module - ERC20", value: "transferable20" },
65+
{ title: "Mint module - ERC721", value: "mintable721" },
66+
{ title: "Transfer module - ERC721", value: "transferable721" },
67+
{ title: "Mint module - ERC1155", value: "mintable1155" },
68+
{ title: "Transfer module - ERC1155", value: "transferable1155" },
6369
],
6470
message: "Select a template:",
6571
name: "projectType",
@@ -133,6 +139,49 @@ export async function createStylusProject() {
133139
newProject = spawnSync("git", ["clone", repoUrl, projectName], {
134140
stdio: "inherit",
135141
});
142+
} else if (projectType === "mintable20") {
143+
const repoUrl = "[email protected]:thirdweb-example/stylus-mintable-erc20.git";
144+
spinner.start(`Creating new ERC20 Mintable module: ${projectName}...`);
145+
newProject = spawnSync("git", ["clone", repoUrl, projectName], {
146+
stdio: "inherit",
147+
});
148+
} else if (projectType === "transferable20") {
149+
const repoUrl =
150+
"[email protected]:thirdweb-example/stylus-transferable-erc20.git";
151+
spinner.start(`Creating new ERC20 Transferable module: ${projectName}...`);
152+
newProject = spawnSync("git", ["clone", repoUrl, projectName], {
153+
stdio: "inherit",
154+
});
155+
} else if (projectType === "mintable721") {
156+
const repoUrl =
157+
"[email protected]:thirdweb-example/stylus-mintable-erc721.git";
158+
spinner.start(`Creating new ERC721 Mintable module: ${projectName}...`);
159+
newProject = spawnSync("git", ["clone", repoUrl, projectName], {
160+
stdio: "inherit",
161+
});
162+
} else if (projectType === "transferable721") {
163+
const repoUrl =
164+
"[email protected]:thirdweb-example/stylus-transferable-erc721.git";
165+
spinner.start(`Creating new ERC721 Transferable module: ${projectName}...`);
166+
newProject = spawnSync("git", ["clone", repoUrl, projectName], {
167+
stdio: "inherit",
168+
});
169+
} else if (projectType === "mintable1155") {
170+
const repoUrl =
171+
"[email protected]:thirdweb-example/stylus-mintable-erc1155.git";
172+
spinner.start(`Creating new ERC1155 Mintable module: ${projectName}...`);
173+
newProject = spawnSync("git", ["clone", repoUrl, projectName], {
174+
stdio: "inherit",
175+
});
176+
} else if (projectType === "transferable1155") {
177+
const repoUrl =
178+
"[email protected]:thirdweb-example/stylus-transferable-erc1155.git";
179+
spinner.start(
180+
`Creating new ERC1155 Transferable module: ${projectName}...`,
181+
);
182+
newProject = spawnSync("git", ["clone", repoUrl, projectName], {
183+
stdio: "inherit",
184+
});
136185
}
137186

138187
if (!newProject || newProject.status !== 0) {

0 commit comments

Comments
 (0)