Skip to content

Instantly share code, notes, and snippets.

@Datswishty
Created December 6, 2022 12:47
Show Gist options
  • Save Datswishty/501d0cfd37b7db4dc70613572b640bf7 to your computer and use it in GitHub Desktop.
Save Datswishty/501d0cfd37b7db4dc70613572b640bf7 to your computer and use it in GitHub Desktop.
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