Skip to content

Commit

Permalink
fix: get contractName
Browse files Browse the repository at this point in the history
  • Loading branch information
yonadaa committed Mar 6, 2024
1 parent ad187a2 commit 9b42d37
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/deploy/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { debug } from "./debug";
import { resourceLabel } from "./resourceLabel";
import { uniqueBy } from "@latticexyz/common/utils";
import { ensureContractsDeployed } from "./ensureContractsDeployed";
import { coreModuleBytecode, worldFactoryBytecode, worldFactoryContracts } from "./ensureWorldFactory";
import { worldFactoryContracts } from "./ensureWorldFactory";

type DeployOptions<configInput extends ConfigInput> = {
client: Client<Transport, Chain | undefined, Account>;
Expand Down
6 changes: 1 addition & 5 deletions packages/cli/src/deploy/getPublicLibraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import path from "path";

export async function getPublicLibraries(forgeOutDir: string) {
const libraryDeps: {
contractFullPath: string;
libraryFullPath: string;
libraryFilename: string;
libraryName: string;
contractFullyQualifiedName: string;
Expand All @@ -22,7 +20,7 @@ export async function getPublicLibraries(forgeOutDir: string) {
const json = JSON.parse((await readFile(contractOutPath, "utf8")).trim());
const linkReferences = json.bytecode.linkReferences as LinkReferences;

const contractFullPath = json.ast.absolutePath;
const contractFullPath = Object.keys(json.metadata.settings.compilationTarget)[0];
// skip files that do not reference any contract/library
if (!json.metadata) continue;
const contractName = json.metadata.settings.compilationTarget[contractFullPath];
Expand All @@ -31,8 +29,6 @@ export async function getPublicLibraries(forgeOutDir: string) {
const names = Object.keys(namePositions);
for (const libraryName of names) {
libraryDeps.push({
contractFullPath: json.ast.absolutePath,
libraryFullPath,
libraryFilename: path.basename(libraryFullPath),
libraryName,
contractFullyQualifiedName: `${contractFullPath}:${contractName}`,
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/deploy/resolveConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
getCreate2Address,
getAddress,
hexToBytes,
Abi,
bytesToHex,
getFunctionSignature,
} from "viem";
Expand Down

0 comments on commit 9b42d37

Please sign in to comment.