-
Notifications
You must be signed in to change notification settings - Fork 0
/
contract.deploy.ts
47 lines (43 loc) · 1.54 KB
/
contract.deploy.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import * as fs from "fs";
import * as path from "path";
import { Address, contractAddress } from "@ton/core";
import { Bet } from "./output/youbet_Bet";
import { prepareTactDeployment } from "@tact-lang/deployer";
(async () => {
// Parameters
let testnet = true;
let packageName = "youbet_Bet.pkg";
let owner = Address.parse("0QAvZUsQz6Yyz0pgOAos-fHNuZTjyk3hGyo5P_B3OXBt7jlZ");
let init = await Bet.init(owner);
// Load required data
let address = contractAddress(0, init);
let data = init.data.toBoc();
let pkg = fs.readFileSync(path.resolve(__dirname, "output", packageName));
// Prepareing
console.log("Uploading package...");
let prepare = await prepareTactDeployment({ pkg, data, testnet });
// Deploying
console.log(
"============================================================================================"
);
console.log("Contract Address");
console.log(
"============================================================================================"
);
console.log();
console.log(address.toString({ testOnly: testnet }));
console.log();
console.log(
"============================================================================================"
);
console.log("Please, follow deployment link");
console.log(
"============================================================================================"
);
console.log();
console.log(prepare);
console.log();
console.log(
"============================================================================================"
);
})();