You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
600 B
15 lines
600 B
3 years ago
|
// this file assists with instantiating the contract (code and data cells)
|
||
|
|
||
|
import * as fs from "fs";
|
||
|
import { Cell, beginCell, Address } from "ton";
|
||
|
|
||
|
// returns contract code cell by relying on the build output in the build directory
|
||
|
export function createCode() {
|
||
|
return Cell.fromBoc(fs.readFileSync(__dirname + "/../build/main.cell"))[0];
|
||
|
}
|
||
|
|
||
|
// returns contract storage cell according to save_data() contract method
|
||
|
export function createData(params: { ownerAddress: Address; counter: number }) {
|
||
|
return beginCell().storeAddress(params.ownerAddress).storeUint(params.counter, 64).endCell();
|
||
|
}
|