diff --git a/scripts/deploy/5-dao.ts b/scripts/deploy/5-dao.ts index a9494caf..e3cdb9c4 100644 --- a/scripts/deploy/5-dao.ts +++ b/scripts/deploy/5-dao.ts @@ -10,8 +10,7 @@ import { import { type Address, type Hex, type Log, decodeEventLog, toHex } from "viem"; import { deploymentPublicClient as publicClient, deploymentWalletClient as walletClient } from "../lib/util/client"; import { deploymentAccount as account } from "../lib/util/account"; -import { uploadToIPFS } from "@/utils/ipfs"; -import { deploymentIpfsClient as ipfsClient } from "../lib/util/ipfs"; +import { uploadToPinata } from "@/utils/ipfs"; import { ABI as DaoFactoryABI } from "../lib/artifacts/dao-factory"; import { ABI as DaoRegistryABI } from "../lib/artifacts/dao-registry"; import { ABI as PluginSetupProcessorABI } from "../lib/artifacts/plugin-setup-processor"; @@ -73,11 +72,7 @@ function pinDaoMetadata(): Promise { // }, // ], }; - const blob = new Blob([JSON.stringify(daoMetadata)], { - type: "application/json", - }); - - return uploadToIPFS(ipfsClient, blob) + return uploadToPinata(JSON.stringify(daoMetadata)) .then((res) => toHex(res)) .catch((err) => { console.warn("Warning: Could not pin the DAO metadata on IPFS"); diff --git a/scripts/lib/util/ipfs.ts b/scripts/lib/util/ipfs.ts deleted file mode 100644 index 04e3def4..00000000 --- a/scripts/lib/util/ipfs.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { create } from "ipfs-http-client"; -import { getEnv } from "./env"; - -const IPFS_ENDPOINT = getEnv("DEPLOYMENT_IPFS_ENDPOINT", true) ?? ""; -const IPFS_API_KEY = getEnv("DEPLOYMENT_IPFS_API_KEY", true) || ""; - -export const deploymentIpfsClient = create({ - url: IPFS_ENDPOINT, - headers: { "X-API-KEY": IPFS_API_KEY, Accept: "application/json" }, -});