From 4d64c499452bff3291ac4ba7efbe9c00da40d51f Mon Sep 17 00:00:00 2001 From: AlexG <39581753+Reveloper@users.noreply.github.com> Date: Sun, 22 Jan 2023 15:41:19 +0400 Subject: [PATCH] lib_dependecies_update --- package.json | 10 +++---- sources/jetton.spec.ts | 2 +- sources/jetton.tact | 2 -- sources/utils/print.ts | 48 ---------------------------------- sources/utils/randomAddress.ts | 11 -------- 5 files changed, 6 insertions(+), 67 deletions(-) delete mode 100644 sources/utils/print.ts delete mode 100644 sources/utils/randomAddress.ts diff --git a/package.json b/package.json index 182f097..a49ecb2 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { - "name": "tact-template", + "name": "tact-jetton", "version": "1.0.0", "main": "index.js", - "repository": "https://github.com/ton-community/tact-template.git", - "author": "Steve Korshakov ", + "repository": "https://github.com/Reveloper/tact-jetton", + "author": "Alex Golev ", "license": "MIT", "scripts": { "build": "tact --config tact.config.json", @@ -18,9 +18,9 @@ "jest": "^29.3.1", "prando": "^6.0.1", "qs": "^6.11.0", - "ton": "^13.2.0", + "ton": "^13.3.0", "ton-contract-executor": "^0.6.0", - "ton-core": "^0.36.1", + "ton-core": "^0.45.0", "ton-crypto": "^3.2.0", "ton-emulator": "^1.2.0", "ton-nodejs": "^1.4.3", diff --git a/sources/jetton.spec.ts b/sources/jetton.spec.ts index 6823c85..14cbde1 100644 --- a/sources/jetton.spec.ts +++ b/sources/jetton.spec.ts @@ -1,6 +1,6 @@ import { toNano, beginCell } from "ton-core"; import { ContractSystem } from "ton-emulator"; -import {SampleJetton, SampleJetton_init} from './output/jetton_SampleJetton'; +import {SampleJetton} from './output/jetton_SampleJetton'; describe('jetton', () => { it('should deploy', async () => { diff --git a/sources/jetton.tact b/sources/jetton.tact index b41e060..f7d289e 100644 --- a/sources/jetton.tact +++ b/sources/jetton.tact @@ -6,8 +6,6 @@ message Mint { contract SampleJetton with Jetton { -// storage#_ balance:Grams owner_address:MsgAddressInt jetton_master_address:MsgAddressInt jetton_wallet_code:^Cell = Storage - totalSupply: Int as coins; owner: Address; content: Cell?; diff --git a/sources/utils/print.ts b/sources/utils/print.ts deleted file mode 100644 index 6b44b01..0000000 --- a/sources/utils/print.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { Address, Cell, contractAddress, StateInit } from "ton"; -import BN from 'bn.js'; -import qs from 'qs'; - -export function printSeparator() { - console.log("========================================================================================"); -} - -export function printHeader(name: string) { - printSeparator(); - console.log('Contract: ' + name); - printSeparator(); -} - -export function printAddress(address: Address, testnet: boolean = true) { - console.log("Address: " + address.toFriendly({ testOnly: testnet })); - console.log("Explorer: " + "https://" + (testnet ? 'testnet.' : '') + "tonwhales.com/explorer/address/" + address.toFriendly({ testOnly: testnet })); - printSeparator(); -} - -export function printDeploy(init: { code: Cell, data: Cell }, amount: BN, command: Cell | string, testnet: boolean = true) { - - // Resolve target address - let to = contractAddress({ workchain: 0, initialCode: init.code, initialData: init.data }); - - // Resovle init - let cell = new Cell(); - new StateInit(init).writeTo(cell); - let initStr = cell.toBoc({ idx: false }).toString("base64"); - - let link: string; - if (typeof command === 'string') { - link = `https://${testnet ? 'test.' : ''}tonhub.com/transfer/` + to.toFriendly({ testOnly: testnet }) + "?" + qs.stringify({ - text: command, - amount: amount.toString(10), - init: initStr - }); - } else { - link = `https://${testnet ? 'test.' : ''}tonhub.com/transfer/` + to.toFriendly({ testOnly: testnet }) + "?" + qs.stringify({ - text: "Deploy contract", - amount: amount.toString(10), - init: initStr, - bin: command.toBoc({ idx: false }).toString('base64'), - }); - } - console.log("Deploy: " + link); - printSeparator(); -} \ No newline at end of file diff --git a/sources/utils/randomAddress.ts b/sources/utils/randomAddress.ts deleted file mode 100644 index f8c491c..0000000 --- a/sources/utils/randomAddress.ts +++ /dev/null @@ -1,11 +0,0 @@ -import Prando from "prando"; -import { Address } from "ton"; - -export function randomAddress(workchain: number, seed: string) { - const random = new Prando(seed); - const hash = Buffer.alloc(32); - for (let i = 0; i < hash.length; i++) { - hash[i] = random.nextInt(0, 255); - } - return new Address(workchain, hash); -}