Created
December 6, 2022 12:47
-
-
Save Datswishty/501d0cfd37b7db4dc70613572b640bf7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { compileFunc } from "@ton-community/func-js"; | |
import { SmartContract } from "ton-contract-executor"; | |
import { Cell } from "ton"; | |
import {readFileSync} from "fs"; | |
async function main() { | |
const compileResult = await compileFunc({ | |
entryPoints: ["main.fc"], | |
sources: () => readFileSync("../func/main.fc").toString() | |
}) | |
if (compileResult.status === 'error') throw new Error('compilation failed') | |
const contract = await SmartContract.fromCell( | |
Cell.fromBoc(Buffer.from(compileResult.codeBoc, 'base64'))[0], | |
new Cell(), | |
) | |
} | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment