Skip to content
Closed
Changes from all commits
Commits
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
18 changes: 4 additions & 14 deletions packages/cli/src/common/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,9 @@ export async function processProject(
const metadataURIs = await Promise.all(
selectedContracts.map(async (c) => {
logger.debug(`Uploading ${c.name}...`);
const hash = await storage.upload(c.metadata, {
return await storage.upload(c.metadata, {
uploadWithoutDirectory: true,
});
return `ipfs://${hash}`;
}),
);

Expand Down Expand Up @@ -194,18 +193,9 @@ export async function processProject(
}

export function getUrl(hashes: string[], command: string) {
let url;
if (hashes.length === 1) {
url = new URL(
THIRDWEB_URL +
`/contracts/${command}/` +
encodeURIComponent(hashes[0].replace("ipfs://", "")),
);
} else {
url = new URL(THIRDWEB_URL + "/contracts/" + command);
for (let hash of hashes) {
url.searchParams.append("ipfs", hash.replace("ipfs://", ""));
}
const url = new URL(THIRDWEB_URL + "/contracts/" + command);
for (let hash of hashes) {
url.searchParams.append("ipfs", hash.replace("ipfs://", ""));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the dashboard handle single contract deploy/releases if i pass just one ipfs query param?

}
return url;
}