Skip to content

Commit f0c0e4b

Browse files
committed
Updated
1 parent 3b25b70 commit f0c0e4b

File tree

2 files changed

+11
-22
lines changed

2 files changed

+11
-22
lines changed

src/chains/Ethereum/contracts/EthereumContract.ts

+9-20
Original file line numberDiff line numberDiff line change
@@ -229,29 +229,18 @@ export class Contract {
229229
// eslint-disable-next-line @typescript-eslint/no-explicit-any
230230
compile(): any {
231231
function findImports(importPath: string) {
232-
if (importPath.startsWith("@openzeppelin")) {
233-
if (importPath.includes("ERC1151")) {
234-
return {
235-
contents: fs
236-
.readFileSync(
237-
path.join(process.cwd(), "node_modules", "@openzeppelin/contracts/token/ERC1151", importPath.split("/").pop() ?? "")
238-
)
239-
.toString(),
240-
};
241-
} else {
242-
return {
243-
contents: fs
244-
.readFileSync(
245-
path.join(process.cwd(), "node_modules", importPath)
246-
)
247-
.toString(),
248-
};
249-
}
250-
} else {
232+
if (importPath.startsWith("@openzeppelin"))
233+
return {
234+
contents: fs
235+
.readFileSync(
236+
path.join(process.cwd(), "node_modules", importPath)
237+
)
238+
.toString(),
239+
};
240+
else {
251241
return { error: "OPEN ZEPPELIN IMPORT FAILED" };
252242
}
253243
}
254-
255244
const compilerInput = {
256245
language: "Solidity",
257246
sources: {

src/chains/Ethereum/functions/draftEthereum.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ nftToolbox.initEthereumContract({
66
name: "DemoContract",
77
symbol: "DEMO",
88
dir: path.join(__dirname, "Contracts"),
9-
standard: "ERC721",
9+
standard: "ERC1151",
1010
connection: JSON.parse(
11-
readFileSync(path.join(__dirname, "connection.json")).toString()
11+
readFileSync(path.join(__dirname, "..","..","..","connection.json")).toString()
1212
),
1313
});
1414

0 commit comments

Comments
 (0)