Skip to content

Commit

Permalink
fix: fix contract compile
Browse files Browse the repository at this point in the history
  • Loading branch information
YanYuanFE committed May 26, 2024
1 parent 4f49d47 commit fd12747
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/app/(main)/editor/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export default function EditorPage() {
if (!cairo_program) {
return;
}
console.log(checkIsContract(cairo_program))
if (checkIsContract(cairo_program)) {
const res = await compileContract({starknetContract: cairo_program, replaceIds: isReplaceIds, allowWarnings: true});
console.log(res, 'res');
Expand Down Expand Up @@ -303,7 +304,7 @@ export default function EditorPage() {
return (
<div key={index}>
<div className="text-sm">[{displayTimeByTimeStamp(log.timestamp)}]</div>
<div className="text-sm">{log.message}</div>
<div className="text-sm" dangerouslySetInnerHTML={{__html: log.message}}></div>
</div>
)
})
Expand Down
1 change: 0 additions & 1 deletion src/app/(main)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

'use client';
import {ReactNode} from "react";
import {Header} from "@/components/Header";
import {SideBar} from "@/components/SideBar";
import {StarknetProvider} from "@/components/StarkProvider";
import {QueryClient, QueryClientProvider} from "@tanstack/react-query";
Expand Down
2 changes: 1 addition & 1 deletion src/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const checkIsContract = (codeString: string) => {
const noCommentsCodeStr = noCommentsCode.join('');

// Check if #[contract] is in the code part
return noCommentsCodeStr.includes('#[contract]');
return noCommentsCodeStr.includes('#[starknet::contract]');
}

export const shortenAddress = (address?:string) =>{
Expand Down

0 comments on commit fd12747

Please sign in to comment.