Skip to content

Commit bae1394

Browse files
committed
feat: update template URL logic and enhance project data structure
1 parent 1e6f5ac commit bae1394

File tree

2 files changed

+47
-17
lines changed

2 files changed

+47
-17
lines changed

src/components/project/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,8 @@ const Template = () => {
385385
}
386386
};
387387

388+
const isOpenZeppelinTemplate = (openzeppelinTemplates ?? []).includes(template);
389+
388390
try {
389391
if (await isExists(template)) {
390392
await client.terminal.log({
@@ -396,7 +398,9 @@ const Template = () => {
396398

397399
const res = await axios.request({
398400
method: "GET",
399-
url: `https://api.welldonestudio.io/compiler/s3Proxy?bucket=code-template&fileKey=arbitrum/${template}.zip`,
401+
url: `https://api.welldonestudio.io/compiler/s3Proxy?bucket=code-template&fileKey=arbitrum/${
402+
isOpenZeppelinTemplate ? `v0.2.0/${template}` : template
403+
}.zip`,
400404
responseType: "arraybuffer",
401405
responseEncoding: "null",
402406
});

src/zustand/project.ts

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,37 @@ const initial = {
2525
loading: false,
2626
error: false,
2727
data: [
28-
"erc4626",
29-
"safe-erc20",
30-
"erc721",
31-
"erc1155",
32-
"erc20",
28+
"access-control",
29+
"beacon-proxy",
30+
"eddsa",
31+
"erc1155-holder",
32+
"erc1155-metadata-uri",
3333
"erc1155-supply",
34-
"vesting-wallet",
34+
"erc1155",
35+
"erc1967",
3536
"erc20-flash-mint",
36-
"erc721-wrapper",
37+
"erc20-permit",
3738
"erc20-wrapper",
38-
"access-control",
39-
"ownable-two-step",
40-
"erc721-metadata",
39+
"erc20",
40+
"erc4626",
4141
"erc721-consecutive",
42-
"erc20-permit",
42+
"erc721-holder",
43+
"erc721-metadata",
44+
"erc721-wrapper",
45+
"erc721",
46+
"merkle-proofs",
47+
"ownable-two-step",
4348
"ownable",
44-
"ecdsa",
45-
"poseidon",
46-
"erc1155-metadata-uri",
4749
"pedersen",
48-
"merkle-proofs",
50+
"poseidon",
51+
"precompiles",
52+
"proxy",
53+
"safe-erc20",
54+
"script",
55+
"token",
56+
"upgradeable-beacon",
57+
"uups-proxy",
58+
"vesting-wallet",
4959
],
5060
},
5161
network: {
@@ -66,7 +76,23 @@ const initial = {
6676
compilerVersions: {
6777
loading: false,
6878
error: false,
69-
data: ["0.5.1", "0.5.2", "0.5.3", "0.5.4", "0.5.5", "0.5.6", "0.5.7", "0.5.8", "0.5.10", "0.5.11", "0.5.12"],
79+
data: [
80+
"0.5.1",
81+
"0.5.2",
82+
"0.5.3",
83+
"0.5.4",
84+
"0.5.5",
85+
"0.5.6",
86+
"0.5.7",
87+
"0.5.8",
88+
"0.5.10",
89+
"0.5.11",
90+
"0.5.12",
91+
"0.6.0",
92+
"0.6.1",
93+
"0.6.2",
94+
"0.6.3",
95+
],
7096
},
7197
os: {
7298
loading: false,

0 commit comments

Comments
 (0)