From b13bfe447a9a1f16c4782228ff72c267beb1ada6 Mon Sep 17 00:00:00 2001 From: AlexG <39581753+Reveloper@users.noreply.github.com> Date: Sun, 22 Jan 2023 15:20:32 +0400 Subject: [PATCH] deployment_fix --- package.json | 2 +- sources/jetton.deploy.ts | 174 +- sources/output/jetton_JettonDefaultWallet.abi | 1298 +-------------- .../jetton_JettonDefaultWallet.abi.ipfs | 1 - sources/output/jetton_JettonDefaultWallet.boc | Bin 1427 -> 0 bytes .../jetton_JettonDefaultWallet.code.boc | Bin 0 -> 1321 bytes ....fc => jetton_JettonDefaultWallet.code.fc} | 196 +-- ...if => jetton_JettonDefaultWallet.code.fif} | 216 ++- ...> jetton_JettonDefaultWallet.code.rev.fif} | 811 +++++----- .../jetton_JettonDefaultWallet.init.boc | Bin 0 -> 72 bytes .../output/jetton_JettonDefaultWallet.init.fc | 37 + .../jetton_JettonDefaultWallet.init.fif | 40 + .../jetton_JettonDefaultWallet.init.rev.fif | 26 + sources/output/jetton_JettonDefaultWallet.md | 67 + sources/output/jetton_JettonDefaultWallet.pkg | 1 + sources/output/jetton_JettonDefaultWallet.ts | 1391 ++++++++-------- sources/output/jetton_SampleJetton.abi | 1329 +-------------- sources/output/jetton_SampleJetton.abi.ipfs | 1 - sources/output/jetton_SampleJetton.boc | Bin 1469 -> 0 bytes sources/output/jetton_SampleJetton.code.boc | Bin 0 -> 1199 bytes ...eJetton.fc => jetton_SampleJetton.code.fc} | 248 ++- ...etton.fif => jetton_SampleJetton.code.fif} | 301 ++-- ...v.fif => jetton_SampleJetton.code.rev.fif} | 948 +++++------ sources/output/jetton_SampleJetton.init.boc | Bin 0 -> 86 bytes sources/output/jetton_SampleJetton.init.fc | 39 + sources/output/jetton_SampleJetton.init.fif | 54 + .../output/jetton_SampleJetton.init.rev.fif | 42 + sources/output/jetton_SampleJetton.md | 72 + sources/output/jetton_SampleJetton.pkg | 1 + sources/output/jetton_SampleJetton.ts | 1441 ++++++++--------- sources/utils/jetton-helpers.ts | 8 +- 31 files changed, 3202 insertions(+), 5542 deletions(-) delete mode 100644 sources/output/jetton_JettonDefaultWallet.abi.ipfs delete mode 100644 sources/output/jetton_JettonDefaultWallet.boc create mode 100644 sources/output/jetton_JettonDefaultWallet.code.boc rename sources/output/{jetton_JettonDefaultWallet.fc => jetton_JettonDefaultWallet.code.fc} (68%) rename sources/output/{jetton_JettonDefaultWallet.fif => jetton_JettonDefaultWallet.code.fif} (75%) rename sources/output/{jetton_JettonDefaultWallet.rev.fif => jetton_JettonDefaultWallet.code.rev.fif} (52%) create mode 100644 sources/output/jetton_JettonDefaultWallet.init.boc create mode 100644 sources/output/jetton_JettonDefaultWallet.init.fc create mode 100644 sources/output/jetton_JettonDefaultWallet.init.fif create mode 100644 sources/output/jetton_JettonDefaultWallet.init.rev.fif create mode 100644 sources/output/jetton_JettonDefaultWallet.md create mode 100644 sources/output/jetton_JettonDefaultWallet.pkg delete mode 100644 sources/output/jetton_SampleJetton.abi.ipfs delete mode 100644 sources/output/jetton_SampleJetton.boc create mode 100644 sources/output/jetton_SampleJetton.code.boc rename sources/output/{jetton_SampleJetton.fc => jetton_SampleJetton.code.fc} (61%) rename sources/output/{jetton_SampleJetton.fif => jetton_SampleJetton.code.fif} (66%) rename sources/output/{jetton_SampleJetton.rev.fif => jetton_SampleJetton.code.rev.fif} (51%) create mode 100644 sources/output/jetton_SampleJetton.init.boc create mode 100644 sources/output/jetton_SampleJetton.init.fc create mode 100644 sources/output/jetton_SampleJetton.init.fif create mode 100644 sources/output/jetton_SampleJetton.init.rev.fif create mode 100644 sources/output/jetton_SampleJetton.md create mode 100644 sources/output/jetton_SampleJetton.pkg diff --git a/package.json b/package.json index 8b13c4a..182f097 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "deploy": "ts-node sources/jetton.deploy.ts" }, "dependencies": { - "@types/jest": "^29.2.4", "@aws-crypto/sha256-js": "^3.0.0", + "@types/jest": "^29.2.4", "@types/node": "^18.11.14", "@types/qs": "^6.9.7", "jest": "^29.3.1", diff --git a/sources/jetton.deploy.ts b/sources/jetton.deploy.ts index b0103ec..3ec5b9b 100644 --- a/sources/jetton.deploy.ts +++ b/sources/jetton.deploy.ts @@ -1,25 +1,11 @@ import { beginCell, contractAddress, toNano, TonClient, TonClient4, Address, WalletContractV4, internal, fromNano} from "ton"; import {mnemonicToPrivateKey} from "ton-crypto"; -import {JettonMetaDataKeys} from 'utils/jetton-helpers'; - - - +import {buildOnchainMetadata} from "./utils/jetton-helpers"; +import {SampleJetton} from "./output/jetton_SampleJetton"; (async () => { //need changes for jetton - // This is example data - Modify these params for your own jetton! - // - Data is stored on-chain (except for the image data itself) - // - Owner should usually be the deploying wallet's address. - const jettonParams = { - name: "MyJetton", - symbol: "JET1", - image: "https://www.linkpicture.com/q/download_183.png", // Image url - description: "My jetton", - }; - - - //create client for testnet Toncenter API const client = new TonClient({ endpoint: 'https://testnet.toncenter.com/api/v2/jsonRPC', @@ -48,16 +34,28 @@ import {JettonMetaDataKeys} from 'utils/jetton-helpers'; // Get deployment wallet balance let balance: bigint = await contract.getBalance(); + // This is example data - Modify these params for your own jetton + // - Data is stored on-chain (except for the image data itself) + + const jettonParams = { + name: "TactJet", + description: "My jetton", + image: "https://www.linkpicture.com/q/download_183.png" // Image url + }; - // Generate define owner of Jetton contract + // Owner should usually be the deploying wallet's address. let owner = Address.parse('kQDND6yHEzKB82ZGRn58aY9Tt_69Ie_uz73e2VuuJ3fVVcxf'); + // Create content Cell - let content = beginCell().storeUint() + let content = buildOnchainMetadata(jettonParams); - // Compute init for deployment + // Compute init data for deployment let init = await SampleJetton.init(owner, content); + let destination_address = contractAddress(workchain, init); + let deployAmount = toNano('0.5'); + // send a message on new address contract to deploy it let seqno: number = await contract.getSeqno(); console.log('🛠️Preparing new outgoing massage from deployment wallet. Seqno = ', seqno); @@ -77,141 +75,3 @@ import {JettonMetaDataKeys} from 'utils/jetton-helpers'; }); console.log('======deployment message sent to ', destination_address, ' ======'); })(); - - -export type JettonMetaDataKeys = "name" | "description" | "image" | "symbol"; - -const jettonOnChainMetadataSpec: { - [key in JettonMetaDataKeys]: "utf8" | "ascii" | undefined; -} = { - name: "utf8", - description: "utf8", - image: "ascii", - symbol: "utf8", -}; - -const sha256 = (str: string) => { - const sha = new Sha256(); - sha.update(str); - return Buffer.from(sha.digestSync()); -}; - -export function buildTokenMetadataCell(data: { [s: string]: string | undefined }): Cell { - const KEYLEN = 256; - const dict = beginDict(KEYLEN); - - Object.entries(data).forEach(([k, v]: [string, string | undefined]) => { - if (!jettonOnChainMetadataSpec[k as JettonMetaDataKeys]) - throw new Error(`Unsupported onchain key: ${k}`); - if (v === undefined || v === "") return; - - let bufferToStore = Buffer.from(v, jettonOnChainMetadataSpec[k as JettonMetaDataKeys]); - - const CELL_MAX_SIZE_BYTES = Math.floor((1023 - 8) / 8); - - const rootCell = new Cell(); - rootCell.bits.writeUint8(SNAKE_PREFIX); - let currentCell = rootCell; - - while (bufferToStore.length > 0) { - currentCell.bits.writeBuffer(bufferToStore.slice(0, CELL_MAX_SIZE_BYTES)); - bufferToStore = bufferToStore.slice(CELL_MAX_SIZE_BYTES); - if (bufferToStore.length > 0) { - const newCell = new Cell(); - currentCell.refs.push(newCell); - currentCell = newCell; - } - } - - dict.storeRef(sha256(k), rootCell); - }); - - return beginCell().storeInt(ONCHAIN_CONTENT_PREFIX, 8).storeDict(dict.endDict()).endCell(); -} - -export function parseTokenMetadataCell(contentCell: Cell): { - [s in JettonMetaDataKeys]?: string; -} { - // Note that this relies on what is (perhaps) an internal implementation detail: - // "ton" library dict parser converts: key (provided as buffer) => BN(base10) - // and upon parsing, it reads it back to a BN(base10) - // tl;dr if we want to read the map back to a JSON with string keys, we have to convert BN(10) back to hex - const toKey = (str: string) => new BN(str, "hex").toString(10); - - const KEYLEN = 256; - const contentSlice = contentCell.beginParse(); - if (contentSlice.readUint(8).toNumber() !== ONCHAIN_CONTENT_PREFIX) - throw new Error("Expected onchain content marker"); - - const dict = contentSlice.readDict(KEYLEN, (s) => { - const buffer = Buffer.from(""); - - const sliceToVal = (s: Slice, v: Buffer, isFirst: boolean) => { - s.toCell().beginParse(); - if (isFirst && s.readUint(8).toNumber() !== SNAKE_PREFIX) - throw new Error("Only snake format is supported"); - - v = Buffer.concat([v, s.readRemainingBytes()]); - if (s.remainingRefs === 1) { - v = sliceToVal(s.readRef(), v, false); - } - - return v; - }; - - return sliceToVal(s.readRef(), buffer, true); - }); - - const res: { [s in JettonMetaDataKeys]?: string } = {}; - - Object.keys(jettonOnChainMetadataSpec).forEach((k) => { - const val = dict - .get(toKey(sha256(k).toString("hex"))) - ?.toString(jettonOnChainMetadataSpec[k as JettonMetaDataKeys]); - if (val) res[k as JettonMetaDataKeys] = val; - }); - - return res; -} - -export function jettonMinterInitData( - owner: Address, - metadata: { [s in JettonMetaDataKeys]?: string } -): Cell { - return beginCell() - .storeCoins(0) - .storeAddress(owner) - .storeRef(buildTokenMetadataCell(metadata)) - .storeRef(JETTON_WALLET_CODE) - .endCell(); -} - -// return the init Cell of the contract storage (according to load_data() contract method) -export function initData() { - return jettonMinterInitData(jettonParams.owner, { - name: jettonParams.name, - symbol: jettonParams.symbol, - image: jettonParams.image, - description: jettonParams.description, - }); -} - -// return the op that should be sent to the contract on deployment, can be "null" to send an empty message -export function initMessage() { - return null; // TODO? -} - -// optional end-to-end sanity test for the actual on-chain contract to see it is actually working on-chain -export async function postDeployTest( - walletContract: WalletContract, - secretKey: Buffer, - contractAddress: Address -) { - const call = await walletContract.client.callGetMethod(contractAddress, "get_jetton_data"); - - console.log( - parseTokenMetadataCell( - Cell.fromBoc(Buffer.from(call.stack[3][1].bytes, "base64").toString("hex"))[0] - ) - ); -} diff --git a/sources/output/jetton_JettonDefaultWallet.abi b/sources/output/jetton_JettonDefaultWallet.abi index 834cde7..f15d8ce 100644 --- a/sources/output/jetton_JettonDefaultWallet.abi +++ b/sources/output/jetton_JettonDefaultWallet.abi @@ -1,1297 +1 @@ -{ - "version": "0.0.1", - "name": "JettonDefaultWallet", - "structs": [ - { - "name": "StateInit", - "header": 0, - "fields": [ - { - "name": "code", - "type": { - "kind": "ref", - "name": "Cell", - "optional": false - } - }, - { - "name": "data", - "type": { - "kind": "ref", - "name": "Cell", - "optional": false - } - } - ], - "allocation": { - "prefix": null, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "cell" - }, - { - "index": 1, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "cell" - } - ], - "next": null, - "size": { - "bits": 0, - "refs": 2 - } - } - } - }, - { - "name": "Context", - "header": 0, - "fields": [ - { - "name": "bounced", - "type": { - "kind": "ref", - "name": "Bool", - "optional": false - } - }, - { - "name": "sender", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "value", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "raw", - "type": { - "kind": "ref", - "name": "Slice", - "optional": false - } - } - ], - "allocation": { - "prefix": null, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 1, - "refs": 0 - }, - "kind": "int", - "bits": 1 - }, - { - "index": 1, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - }, - { - "index": 2, - "size": { - "bits": 257, - "refs": 0 - }, - "kind": "int", - "bits": 257 - }, - { - "index": 3, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "slice" - } - ], - "next": null, - "size": { - "bits": 525, - "refs": 1 - } - } - } - }, - { - "name": "SendParameters", - "header": 0, - "fields": [ - { - "name": "bounce", - "type": { - "kind": "ref", - "name": "Bool", - "optional": false - } - }, - { - "name": "to", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "value", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "mode", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "body", - "type": { - "kind": "ref", - "name": "Cell", - "optional": true - } - }, - { - "name": "code", - "type": { - "kind": "ref", - "name": "Cell", - "optional": true - } - }, - { - "name": "data", - "type": { - "kind": "ref", - "name": "Cell", - "optional": true - } - } - ], - "allocation": { - "prefix": null, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 1, - "refs": 0 - }, - "kind": "int", - "bits": 1 - }, - { - "index": 1, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - }, - { - "index": 2, - "size": { - "bits": 257, - "refs": 0 - }, - "kind": "int", - "bits": 257 - }, - { - "index": 3, - "size": { - "bits": 257, - "refs": 0 - }, - "kind": "int", - "bits": 257 - }, - { - "index": 4, - "size": { - "bits": 1, - "refs": 1 - }, - "kind": "optional", - "inner": { - "index": 4, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "cell" - } - }, - { - "index": 5, - "size": { - "bits": 1, - "refs": 1 - }, - "kind": "optional", - "inner": { - "index": 5, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "cell" - } - }, - { - "index": 6, - "size": { - "bits": 1, - "refs": 1 - }, - "kind": "optional", - "inner": { - "index": 6, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "cell" - } - } - ], - "next": null, - "size": { - "bits": 785, - "refs": 3 - } - } - } - }, - { - "name": "ChangeOwner", - "header": 0, - "fields": [ - { - "name": "newOwner", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - } - ], - "allocation": { - "prefix": 3067051791, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - } - ], - "next": null, - "size": { - "bits": 267, - "refs": 0 - } - } - } - }, - { - "name": "TokenTransfer", - "header": 0, - "fields": [ - { - "name": "queryId", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "amount", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "destination", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "responseDestination", - "type": { - "kind": "ref", - "name": "Address", - "optional": true - } - }, - { - "name": "customPayload", - "type": { - "kind": "ref", - "name": "Cell", - "optional": true - } - }, - { - "name": "forwardTonAmount", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "forwardPayload", - "type": { - "kind": "ref", - "name": "Slice", - "optional": false - } - } - ], - "allocation": { - "prefix": 260734629, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 64, - "refs": 0 - }, - "kind": "uint", - "bits": 64 - }, - { - "index": 1, - "size": { - "bits": 124, - "refs": 0 - }, - "kind": "coins" - }, - { - "index": 2, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - }, - { - "index": 3, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "optional", - "inner": { - "index": 3, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - } - }, - { - "index": 4, - "size": { - "bits": 1, - "refs": 1 - }, - "kind": "optional", - "inner": { - "index": 4, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "cell" - } - }, - { - "index": 5, - "size": { - "bits": 124, - "refs": 0 - }, - "kind": "coins" - }, - { - "index": 6, - "size": { - "bits": 0, - "refs": 0 - }, - "kind": "remaining" - } - ], - "next": null, - "size": { - "bits": 847, - "refs": 1 - } - } - } - }, - { - "name": "TokenTransferInternal", - "header": 0, - "fields": [ - { - "name": "queryId", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "amount", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "from", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "responseAddress", - "type": { - "kind": "ref", - "name": "Address", - "optional": true - } - }, - { - "name": "forwardTonAmount", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "forwardPayload", - "type": { - "kind": "ref", - "name": "Slice", - "optional": false - } - } - ], - "allocation": { - "prefix": 395134233, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 64, - "refs": 0 - }, - "kind": "uint", - "bits": 64 - }, - { - "index": 1, - "size": { - "bits": 124, - "refs": 0 - }, - "kind": "coins" - }, - { - "index": 2, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - }, - { - "index": 3, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "optional", - "inner": { - "index": 3, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - } - }, - { - "index": 4, - "size": { - "bits": 124, - "refs": 0 - }, - "kind": "coins" - }, - { - "index": 5, - "size": { - "bits": 0, - "refs": 0 - }, - "kind": "remaining" - } - ], - "next": null, - "size": { - "bits": 846, - "refs": 0 - } - } - } - }, - { - "name": "TokenNotification", - "header": 0, - "fields": [ - { - "name": "queryId", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "amount", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "from", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "forwardPayload", - "type": { - "kind": "ref", - "name": "Slice", - "optional": false - } - } - ], - "allocation": { - "prefix": 1935855772, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 64, - "refs": 0 - }, - "kind": "uint", - "bits": 64 - }, - { - "index": 1, - "size": { - "bits": 124, - "refs": 0 - }, - "kind": "coins" - }, - { - "index": 2, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - }, - { - "index": 3, - "size": { - "bits": 0, - "refs": 0 - }, - "kind": "remaining" - } - ], - "next": null, - "size": { - "bits": 455, - "refs": 0 - } - } - } - }, - { - "name": "TokenBurn", - "header": 0, - "fields": [ - { - "name": "queryId", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "amount", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "owner", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "responseAddress", - "type": { - "kind": "ref", - "name": "Address", - "optional": true - } - } - ], - "allocation": { - "prefix": 1499400124, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 64, - "refs": 0 - }, - "kind": "uint", - "bits": 64 - }, - { - "index": 1, - "size": { - "bits": 124, - "refs": 0 - }, - "kind": "coins" - }, - { - "index": 2, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - }, - { - "index": 3, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "optional", - "inner": { - "index": 3, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - } - } - ], - "next": null, - "size": { - "bits": 722, - "refs": 0 - } - } - } - }, - { - "name": "TokenBurnNotification", - "header": 0, - "fields": [ - { - "name": "queryId", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "amount", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "owner", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "responseAddress", - "type": { - "kind": "ref", - "name": "Address", - "optional": true - } - } - ], - "allocation": { - "prefix": 2078119902, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 64, - "refs": 0 - }, - "kind": "uint", - "bits": 64 - }, - { - "index": 1, - "size": { - "bits": 124, - "refs": 0 - }, - "kind": "coins" - }, - { - "index": 2, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - }, - { - "index": 3, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "optional", - "inner": { - "index": 3, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - } - } - ], - "next": null, - "size": { - "bits": 722, - "refs": 0 - } - } - } - }, - { - "name": "TokenExcesses", - "header": 0, - "fields": [ - { - "name": "queryId", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - } - ], - "allocation": { - "prefix": 3576854235, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 64, - "refs": 0 - }, - "kind": "uint", - "bits": 64 - } - ], - "next": null, - "size": { - "bits": 64, - "refs": 0 - } - } - } - }, - { - "name": "TokenUpdateContent", - "header": 0, - "fields": [ - { - "name": "content", - "type": { - "kind": "ref", - "name": "Cell", - "optional": true - } - } - ], - "allocation": { - "prefix": 1862840892, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 1, - "refs": 1 - }, - "kind": "optional", - "inner": { - "index": 0, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "cell" - } - } - ], - "next": null, - "size": { - "bits": 1, - "refs": 1 - } - } - } - }, - { - "name": "JettonData", - "header": 0, - "fields": [ - { - "name": "totalSupply", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "mintable", - "type": { - "kind": "ref", - "name": "Bool", - "optional": false - } - }, - { - "name": "owner", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "content", - "type": { - "kind": "ref", - "name": "Cell", - "optional": true - } - }, - { - "name": "walletCode", - "type": { - "kind": "ref", - "name": "Cell", - "optional": false - } - } - ], - "allocation": { - "prefix": null, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 257, - "refs": 0 - }, - "kind": "int", - "bits": 257 - }, - { - "index": 1, - "size": { - "bits": 1, - "refs": 0 - }, - "kind": "int", - "bits": 1 - }, - { - "index": 2, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - }, - { - "index": 3, - "size": { - "bits": 1, - "refs": 1 - }, - "kind": "optional", - "inner": { - "index": 3, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "cell" - } - }, - { - "index": 4, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "cell" - } - ], - "next": null, - "size": { - "bits": 526, - "refs": 2 - } - } - } - }, - { - "name": "JettonWalletData", - "header": 0, - "fields": [ - { - "name": "balance", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "owner", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "master", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "walletCode", - "type": { - "kind": "ref", - "name": "Cell", - "optional": false - } - } - ], - "allocation": { - "prefix": null, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 257, - "refs": 0 - }, - "kind": "int", - "bits": 257 - }, - { - "index": 1, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - }, - { - "index": 2, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - }, - { - "index": 3, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "cell" - } - ], - "next": null, - "size": { - "bits": 791, - "refs": 1 - } - } - } - }, - { - "name": "Mint", - "header": 0, - "fields": [ - { - "name": "amount", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - } - ], - "allocation": { - "prefix": 2737462367, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 257, - "refs": 0 - }, - "kind": "int", - "bits": 257 - } - ], - "next": null, - "size": { - "bits": 257, - "refs": 0 - } - } - } - } - ], - "init": { - "name": "init_JettonDefaultWallet", - "args": [ - { - "name": "master", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "owner", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - } - ] - }, - "receivers": [ - { - "kind": "internal-binary", - "type": "TokenTransfer" - }, - { - "kind": "internal-binary", - "type": "TokenTransferInternal" - }, - { - "kind": "internal-binary", - "type": "TokenBurn" - } - ], - "getters": [ - { - "name": "get_wallet_data", - "args": [], - "returns": { - "kind": "ref", - "name": "JettonWalletData", - "optional": false - } - } - ], - "dependsOn": { - "JettonDefaultWallet": { - "uid": 55471 - } - }, - "errors": { - "2": { - "message": "Stack undeflow" - }, - "3": { - "message": "Stack overflow" - }, - "4": { - "message": "Integer overflow" - }, - "5": { - "message": "Integer out of expected range" - }, - "6": { - "message": "Invalid opcode" - }, - "7": { - "message": "Type check error" - }, - "8": { - "message": "Cell overflow" - }, - "9": { - "message": "Cell underflow" - }, - "10": { - "message": "Dictionary error" - }, - "13": { - "message": "Out of gas error" - }, - "32": { - "message": "Method ID not found" - }, - "34": { - "message": "Action is invalid or not supported" - }, - "37": { - "message": "Not enough TON" - }, - "38": { - "message": "Not enough extra-currencies" - }, - "128": { - "message": "Null reference exception" - }, - "129": { - "message": "Invalid serialization prefix" - }, - "130": { - "message": "Invalid incoming message" - }, - "131": { - "message": "Constraints error" - }, - "132": { - "message": "Access denied" - }, - "133": { - "message": "Contract stopped" - }, - "134": { - "message": "Invalid argument" - }, - "4429": { - "message": "Invalid sender" - }, - "13650": { - "message": "Invalid bounced message" - }, - "16059": { - "message": "Invalid value" - }, - "62972": { - "message": "Invalid balance" - } - } -} \ No newline at end of file +{"name":"JettonDefaultWallet","types":[{"name":"StateInit","header":null,"fields":[{"name":"code","type":{"kind":"simple","type":"cell","optional":false}},{"name":"data","type":{"kind":"simple","type":"cell","optional":false}}]},{"name":"Context","header":null,"fields":[{"name":"bounced","type":{"kind":"simple","type":"bool","optional":false}},{"name":"sender","type":{"kind":"simple","type":"address","optional":false}},{"name":"value","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"raw","type":{"kind":"simple","type":"slice","optional":false}}]},{"name":"SendParameters","header":null,"fields":[{"name":"bounce","type":{"kind":"simple","type":"bool","optional":false}},{"name":"to","type":{"kind":"simple","type":"address","optional":false}},{"name":"value","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"mode","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"body","type":{"kind":"simple","type":"cell","optional":true}},{"name":"code","type":{"kind":"simple","type":"cell","optional":true}},{"name":"data","type":{"kind":"simple","type":"cell","optional":true}}]},{"name":"ChangeOwner","header":256331011,"fields":[{"name":"newOwner","type":{"kind":"simple","type":"address","optional":false}}]},{"name":"TokenTransfer","header":260734629,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}},{"name":"amount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"destination","type":{"kind":"simple","type":"address","optional":false}},{"name":"responseDestination","type":{"kind":"simple","type":"address","optional":true}},{"name":"customPayload","type":{"kind":"simple","type":"cell","optional":true}},{"name":"forwardTonAmount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"forwardPayload","type":{"kind":"simple","type":"slice","optional":false,"format":"remainder"}}]},{"name":"TokenTransferInternal","header":395134233,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}},{"name":"amount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"from","type":{"kind":"simple","type":"address","optional":false}},{"name":"responseAddress","type":{"kind":"simple","type":"address","optional":true}},{"name":"forwardTonAmount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"forwardPayload","type":{"kind":"simple","type":"slice","optional":false,"format":"remainder"}}]},{"name":"TokenNotification","header":1935855772,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}},{"name":"amount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"from","type":{"kind":"simple","type":"address","optional":false}},{"name":"forwardPayload","type":{"kind":"simple","type":"slice","optional":false,"format":"remainder"}}]},{"name":"TokenBurn","header":1499400124,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}},{"name":"amount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"owner","type":{"kind":"simple","type":"address","optional":false}},{"name":"responseAddress","type":{"kind":"simple","type":"address","optional":true}}]},{"name":"TokenBurnNotification","header":2078119902,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}},{"name":"amount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"owner","type":{"kind":"simple","type":"address","optional":false}},{"name":"responseAddress","type":{"kind":"simple","type":"address","optional":true}}]},{"name":"TokenExcesses","header":3576854235,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}}]},{"name":"TokenUpdateContent","header":201882270,"fields":[{"name":"content","type":{"kind":"simple","type":"cell","optional":true}}]},{"name":"JettonData","header":null,"fields":[{"name":"totalSupply","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"mintable","type":{"kind":"simple","type":"bool","optional":false}},{"name":"owner","type":{"kind":"simple","type":"address","optional":false}},{"name":"content","type":{"kind":"simple","type":"cell","optional":true}},{"name":"walletCode","type":{"kind":"simple","type":"cell","optional":false}}]},{"name":"JettonWalletData","header":null,"fields":[{"name":"balance","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"owner","type":{"kind":"simple","type":"address","optional":false}},{"name":"master","type":{"kind":"simple","type":"address","optional":false}},{"name":"walletCode","type":{"kind":"simple","type":"cell","optional":false}}]},{"name":"Mint","header":33240155,"fields":[{"name":"amount","type":{"kind":"simple","type":"int","optional":false,"format":257}}]}],"receivers":[{"receiver":"internal","message":{"kind":"typed","type":"TokenTransfer"}},{"receiver":"internal","message":{"kind":"typed","type":"TokenTransferInternal"}},{"receiver":"internal","message":{"kind":"typed","type":"TokenBurn"}}],"getters":[{"name":"get_wallet_data","arguments":[],"returnType":{"kind":"simple","type":"JettonWalletData","optional":false}}],"errors":{"2":{"message":"Stack undeflow"},"3":{"message":"Stack overflow"},"4":{"message":"Integer overflow"},"5":{"message":"Integer out of expected range"},"6":{"message":"Invalid opcode"},"7":{"message":"Type check error"},"8":{"message":"Cell overflow"},"9":{"message":"Cell underflow"},"10":{"message":"Dictionary error"},"13":{"message":"Out of gas error"},"32":{"message":"Method ID not found"},"34":{"message":"Action is invalid or not supported"},"37":{"message":"Not enough TON"},"38":{"message":"Not enough extra-currencies"},"128":{"message":"Null reference exception"},"129":{"message":"Invalid serialization prefix"},"130":{"message":"Invalid incoming message"},"131":{"message":"Constraints error"},"132":{"message":"Access denied"},"133":{"message":"Contract stopped"},"134":{"message":"Invalid argument"},"135":{"message":"Code of a contract was not found"},"136":{"message":"Invalid address"},"4429":{"message":"Invalid sender"},"13650":{"message":"Invalid bounced message"},"16059":{"message":"Invalid value"},"62972":{"message":"Invalid balance"}}} \ No newline at end of file diff --git a/sources/output/jetton_JettonDefaultWallet.abi.ipfs b/sources/output/jetton_JettonDefaultWallet.abi.ipfs deleted file mode 100644 index 1f99401..0000000 --- a/sources/output/jetton_JettonDefaultWallet.abi.ipfs +++ /dev/null @@ -1 +0,0 @@ -{"version":"0.0.1","name":"JettonDefaultWallet","structs":[{"name":"StateInit","header":0,"fields":[{"name":"code","type":{"kind":"ref","name":"Cell","optional":false}},{"name":"data","type":{"kind":"ref","name":"Cell","optional":false}}],"allocation":{"prefix":null,"root":{"fields":[{"index":0,"size":{"bits":0,"refs":1},"kind":"cell"},{"index":1,"size":{"bits":0,"refs":1},"kind":"cell"}],"next":null,"size":{"bits":0,"refs":2}}}},{"name":"Context","header":0,"fields":[{"name":"bounced","type":{"kind":"ref","name":"Bool","optional":false}},{"name":"sender","type":{"kind":"ref","name":"Address","optional":false}},{"name":"value","type":{"kind":"ref","name":"Int","optional":false}},{"name":"raw","type":{"kind":"ref","name":"Slice","optional":false}}],"allocation":{"prefix":null,"root":{"fields":[{"index":0,"size":{"bits":1,"refs":0},"kind":"int","bits":1},{"index":1,"size":{"bits":267,"refs":0},"kind":"address"},{"index":2,"size":{"bits":257,"refs":0},"kind":"int","bits":257},{"index":3,"size":{"bits":0,"refs":1},"kind":"slice"}],"next":null,"size":{"bits":525,"refs":1}}}},{"name":"SendParameters","header":0,"fields":[{"name":"bounce","type":{"kind":"ref","name":"Bool","optional":false}},{"name":"to","type":{"kind":"ref","name":"Address","optional":false}},{"name":"value","type":{"kind":"ref","name":"Int","optional":false}},{"name":"mode","type":{"kind":"ref","name":"Int","optional":false}},{"name":"body","type":{"kind":"ref","name":"Cell","optional":true}},{"name":"code","type":{"kind":"ref","name":"Cell","optional":true}},{"name":"data","type":{"kind":"ref","name":"Cell","optional":true}}],"allocation":{"prefix":null,"root":{"fields":[{"index":0,"size":{"bits":1,"refs":0},"kind":"int","bits":1},{"index":1,"size":{"bits":267,"refs":0},"kind":"address"},{"index":2,"size":{"bits":257,"refs":0},"kind":"int","bits":257},{"index":3,"size":{"bits":257,"refs":0},"kind":"int","bits":257},{"index":4,"size":{"bits":1,"refs":1},"kind":"optional","inner":{"index":4,"size":{"bits":0,"refs":1},"kind":"cell"}},{"index":5,"size":{"bits":1,"refs":1},"kind":"optional","inner":{"index":5,"size":{"bits":0,"refs":1},"kind":"cell"}},{"index":6,"size":{"bits":1,"refs":1},"kind":"optional","inner":{"index":6,"size":{"bits":0,"refs":1},"kind":"cell"}}],"next":null,"size":{"bits":785,"refs":3}}}},{"name":"ChangeOwner","header":0,"fields":[{"name":"newOwner","type":{"kind":"ref","name":"Address","optional":false}}],"allocation":{"prefix":3067051791,"root":{"fields":[{"index":0,"size":{"bits":267,"refs":0},"kind":"address"}],"next":null,"size":{"bits":267,"refs":0}}}},{"name":"TokenTransfer","header":0,"fields":[{"name":"queryId","type":{"kind":"ref","name":"Int","optional":false}},{"name":"amount","type":{"kind":"ref","name":"Int","optional":false}},{"name":"destination","type":{"kind":"ref","name":"Address","optional":false}},{"name":"responseDestination","type":{"kind":"ref","name":"Address","optional":true}},{"name":"customPayload","type":{"kind":"ref","name":"Cell","optional":true}},{"name":"forwardTonAmount","type":{"kind":"ref","name":"Int","optional":false}},{"name":"forwardPayload","type":{"kind":"ref","name":"Slice","optional":false}}],"allocation":{"prefix":260734629,"root":{"fields":[{"index":0,"size":{"bits":64,"refs":0},"kind":"uint","bits":64},{"index":1,"size":{"bits":124,"refs":0},"kind":"coins"},{"index":2,"size":{"bits":267,"refs":0},"kind":"address"},{"index":3,"size":{"bits":267,"refs":0},"kind":"optional","inner":{"index":3,"size":{"bits":267,"refs":0},"kind":"address"}},{"index":4,"size":{"bits":1,"refs":1},"kind":"optional","inner":{"index":4,"size":{"bits":0,"refs":1},"kind":"cell"}},{"index":5,"size":{"bits":124,"refs":0},"kind":"coins"},{"index":6,"size":{"bits":0,"refs":0},"kind":"remaining"}],"next":null,"size":{"bits":847,"refs":1}}}},{"name":"TokenTransferInternal","header":0,"fields":[{"name":"queryId","type":{"kind":"ref","name":"Int","optional":false}},{"name":"amount","type":{"kind":"ref","name":"Int","optional":false}},{"name":"from","type":{"kind":"ref","name":"Address","optional":false}},{"name":"responseAddress","type":{"kind":"ref","name":"Address","optional":true}},{"name":"forwardTonAmount","type":{"kind":"ref","name":"Int","optional":false}},{"name":"forwardPayload","type":{"kind":"ref","name":"Slice","optional":false}}],"allocation":{"prefix":395134233,"root":{"fields":[{"index":0,"size":{"bits":64,"refs":0},"kind":"uint","bits":64},{"index":1,"size":{"bits":124,"refs":0},"kind":"coins"},{"index":2,"size":{"bits":267,"refs":0},"kind":"address"},{"index":3,"size":{"bits":267,"refs":0},"kind":"optional","inner":{"index":3,"size":{"bits":267,"refs":0},"kind":"address"}},{"index":4,"size":{"bits":124,"refs":0},"kind":"coins"},{"index":5,"size":{"bits":0,"refs":0},"kind":"remaining"}],"next":null,"size":{"bits":846,"refs":0}}}},{"name":"TokenNotification","header":0,"fields":[{"name":"queryId","type":{"kind":"ref","name":"Int","optional":false}},{"name":"amount","type":{"kind":"ref","name":"Int","optional":false}},{"name":"from","type":{"kind":"ref","name":"Address","optional":false}},{"name":"forwardPayload","type":{"kind":"ref","name":"Slice","optional":false}}],"allocation":{"prefix":1935855772,"root":{"fields":[{"index":0,"size":{"bits":64,"refs":0},"kind":"uint","bits":64},{"index":1,"size":{"bits":124,"refs":0},"kind":"coins"},{"index":2,"size":{"bits":267,"refs":0},"kind":"address"},{"index":3,"size":{"bits":0,"refs":0},"kind":"remaining"}],"next":null,"size":{"bits":455,"refs":0}}}},{"name":"TokenBurn","header":0,"fields":[{"name":"queryId","type":{"kind":"ref","name":"Int","optional":false}},{"name":"amount","type":{"kind":"ref","name":"Int","optional":false}},{"name":"owner","type":{"kind":"ref","name":"Address","optional":false}},{"name":"responseAddress","type":{"kind":"ref","name":"Address","optional":true}}],"allocation":{"prefix":1499400124,"root":{"fields":[{"index":0,"size":{"bits":64,"refs":0},"kind":"uint","bits":64},{"index":1,"size":{"bits":124,"refs":0},"kind":"coins"},{"index":2,"size":{"bits":267,"refs":0},"kind":"address"},{"index":3,"size":{"bits":267,"refs":0},"kind":"optional","inner":{"index":3,"size":{"bits":267,"refs":0},"kind":"address"}}],"next":null,"size":{"bits":722,"refs":0}}}},{"name":"TokenBurnNotification","header":0,"fields":[{"name":"queryId","type":{"kind":"ref","name":"Int","optional":false}},{"name":"amount","type":{"kind":"ref","name":"Int","optional":false}},{"name":"owner","type":{"kind":"ref","name":"Address","optional":false}},{"name":"responseAddress","type":{"kind":"ref","name":"Address","optional":true}}],"allocation":{"prefix":2078119902,"root":{"fields":[{"index":0,"size":{"bits":64,"refs":0},"kind":"uint","bits":64},{"index":1,"size":{"bits":124,"refs":0},"kind":"coins"},{"index":2,"size":{"bits":267,"refs":0},"kind":"address"},{"index":3,"size":{"bits":267,"refs":0},"kind":"optional","inner":{"index":3,"size":{"bits":267,"refs":0},"kind":"address"}}],"next":null,"size":{"bits":722,"refs":0}}}},{"name":"TokenExcesses","header":0,"fields":[{"name":"queryId","type":{"kind":"ref","name":"Int","optional":false}}],"allocation":{"prefix":3576854235,"root":{"fields":[{"index":0,"size":{"bits":64,"refs":0},"kind":"uint","bits":64}],"next":null,"size":{"bits":64,"refs":0}}}},{"name":"TokenUpdateContent","header":0,"fields":[{"name":"content","type":{"kind":"ref","name":"Cell","optional":true}}],"allocation":{"prefix":1862840892,"root":{"fields":[{"index":0,"size":{"bits":1,"refs":1},"kind":"optional","inner":{"index":0,"size":{"bits":0,"refs":1},"kind":"cell"}}],"next":null,"size":{"bits":1,"refs":1}}}},{"name":"JettonData","header":0,"fields":[{"name":"totalSupply","type":{"kind":"ref","name":"Int","optional":false}},{"name":"mintable","type":{"kind":"ref","name":"Bool","optional":false}},{"name":"owner","type":{"kind":"ref","name":"Address","optional":false}},{"name":"content","type":{"kind":"ref","name":"Cell","optional":true}},{"name":"walletCode","type":{"kind":"ref","name":"Cell","optional":false}}],"allocation":{"prefix":null,"root":{"fields":[{"index":0,"size":{"bits":257,"refs":0},"kind":"int","bits":257},{"index":1,"size":{"bits":1,"refs":0},"kind":"int","bits":1},{"index":2,"size":{"bits":267,"refs":0},"kind":"address"},{"index":3,"size":{"bits":1,"refs":1},"kind":"optional","inner":{"index":3,"size":{"bits":0,"refs":1},"kind":"cell"}},{"index":4,"size":{"bits":0,"refs":1},"kind":"cell"}],"next":null,"size":{"bits":526,"refs":2}}}},{"name":"JettonWalletData","header":0,"fields":[{"name":"balance","type":{"kind":"ref","name":"Int","optional":false}},{"name":"owner","type":{"kind":"ref","name":"Address","optional":false}},{"name":"master","type":{"kind":"ref","name":"Address","optional":false}},{"name":"walletCode","type":{"kind":"ref","name":"Cell","optional":false}}],"allocation":{"prefix":null,"root":{"fields":[{"index":0,"size":{"bits":257,"refs":0},"kind":"int","bits":257},{"index":1,"size":{"bits":267,"refs":0},"kind":"address"},{"index":2,"size":{"bits":267,"refs":0},"kind":"address"},{"index":3,"size":{"bits":0,"refs":1},"kind":"cell"}],"next":null,"size":{"bits":791,"refs":1}}}},{"name":"Mint","header":0,"fields":[{"name":"amount","type":{"kind":"ref","name":"Int","optional":false}}],"allocation":{"prefix":2737462367,"root":{"fields":[{"index":0,"size":{"bits":257,"refs":0},"kind":"int","bits":257}],"next":null,"size":{"bits":257,"refs":0}}}}],"init":{"name":"init_JettonDefaultWallet","args":[{"name":"master","type":{"kind":"ref","name":"Address","optional":false}},{"name":"owner","type":{"kind":"ref","name":"Address","optional":false}}]},"receivers":[{"kind":"internal-binary","type":"TokenTransfer"},{"kind":"internal-binary","type":"TokenTransferInternal"},{"kind":"internal-binary","type":"TokenBurn"}],"getters":[{"name":"get_wallet_data","args":[],"returns":{"kind":"ref","name":"JettonWalletData","optional":false}}],"dependsOn":{"JettonDefaultWallet":{"uid":55471}},"errors":{"2":{"message":"Stack undeflow"},"3":{"message":"Stack overflow"},"4":{"message":"Integer overflow"},"5":{"message":"Integer out of expected range"},"6":{"message":"Invalid opcode"},"7":{"message":"Type check error"},"8":{"message":"Cell overflow"},"9":{"message":"Cell underflow"},"10":{"message":"Dictionary error"},"13":{"message":"Out of gas error"},"32":{"message":"Method ID not found"},"34":{"message":"Action is invalid or not supported"},"37":{"message":"Not enough TON"},"38":{"message":"Not enough extra-currencies"},"128":{"message":"Null reference exception"},"129":{"message":"Invalid serialization prefix"},"130":{"message":"Invalid incoming message"},"131":{"message":"Constraints error"},"132":{"message":"Access denied"},"133":{"message":"Contract stopped"},"134":{"message":"Invalid argument"},"4429":{"message":"Invalid sender"},"13650":{"message":"Invalid bounced message"},"16059":{"message":"Invalid value"},"62972":{"message":"Invalid balance"}}} \ No newline at end of file diff --git a/sources/output/jetton_JettonDefaultWallet.boc b/sources/output/jetton_JettonDefaultWallet.boc deleted file mode 100644 index d53e37c3c54cc2299e859565aa2390031bb24665..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1427 zcmaJ=eN0nV6hHUTkB5}@YFk+8gT4yIXQtZ|RQgAY9pDEUN>QpIkk~QjHUk@LoiQ0< zk4pSlbchzvt<0KWObjxt`(R7eG9iMnK@epIb(d^%g5l`V!y$C=&I{G8XncP7xajF>Dsj6BR|I+j^qr}o#@uuRu_ zF=fP<2?8^2XU5CEy1I^{^$Sz6Lc=g=L5S>ZzDyZ)MTcBi@mbZ0A48+nS5{2^eW@RgK^LJ89a>U; ztDG7HP+5uD(eX34{1^+hg=K%)qy7}Pz(}AYFjg8(W zP!adIcmjz@1YXe)&@$**8e?$?g=k9ZA(7q4+2w|5fyiIbBP~6}Ef3zV-8?1rF(#?U zB;BWNxl6Qa6Sz^jVJ+M+N!$O=MqGtsQ&PdVG2O7gFHl0<_7=C?)e%!A2u_16V)0q* z31HC5ssvfd$K3?US{S$&U_tadz(NK>>9})<9<^AU0dRH+&Mu!FK7?<~NJg{5@>c_P zkvVE)tg>CBwRr!fi)K`dS7a84%#dbGQa_ht1hg z_{(@l^N%I*0pIwI;eGmlsm@Gv9mjTLY(9SKgZzj&-FPyqxH3)45Ds zPisu{uu1ycP@;#$bFM1ot5`j3>9$#2I5J&UX|GP*yTTeZNkyiT{h*$&K)vWtf7~rJ zW9lJqzqBaGqQ{ve5!K~09c8y`&SUo@6CJSUY_RyHJxfSp8Eyy1zQ~NOiXQ2t-?K;Z z(42O0GXlruwh4wBUE%yqKN&CP7PoY_35$~VlpsHNP#V~4mgO~lcP;Hws6Ui5cc4!^ zQd~)=9M~B4roffB=@(6iaH-zn{@H}jD``6^-u|E3bvIxXt7X@H>O8h4>DfEa+{kgM zGt?ib639ylYqTfw$fyRkob77&*+d;GS%i=Uhjnc>AJnhsy$Q!FD!4UD>-KIN@50W~ z0gqMOt5f!__^UCIAI#xZ*-EReygbNS#gK8~*Z6IzyS<8wDw>wJO9z2g48k1EF8i_S z6pC^#;2^qXJUrI|ADtfSFut}UskLE~xi)JDbKj74;Ora5b@vk*>V26-b?*;1Ooz`f X9maKIK@_^)mXv=dv1rk?g6P1XUdRhM diff --git a/sources/output/jetton_JettonDefaultWallet.code.boc b/sources/output/jetton_JettonDefaultWallet.code.boc new file mode 100644 index 0000000000000000000000000000000000000000..6de6d0931631c97f7850081b790801f30f4e0a40 GIT binary patch literal 1321 zcmaJ=4NMzl82-NN0oPK-mFv$~i@laH4hN$Y1fmCYgSn9rDS?ielB{5unt;}#1|zbg zAx@OZk6nze%W5(+G;G4=?*gL;OA4)YaU~l$TnPSbqGKHrWrU&M!APc2lka=){obGF zp7*)?KAU$tAeIF|L;`^FKf&TDYH?t}7Y#93gNZO~JTeM{G#&wEL)Vm3H(GMIMHzTu z@OnGtyiq;(b8W-5#pLRVa}^AqMYYcNfAp+1@yGX+Cti8}_FJ+5igW;N+Hv^9>dwjT zZ)!<5!Xm^N+^bL`d`UDAoi^cZd$5ET-MYKwSd6{@-b`AI!Jtx0LA>g&Y7?zJg(XEE z3YWf4GU0b(&R;U8V`t7!V1y1Vou0FvHRuT)Yz&nh?~zf`7!bWH@^%_Qi1Y@Y74d8i z*+w>6BErc$E89fj*&SW$@och@eALWURaoE zxl*tUmQ4^Yn{-#B;Rxu0-5K?>@LK@8Lf!Rnb{Ui%QYz$y25?}lPjz&6{QvZ!a*I$c z+R@Ru#x9H8Pwuv0;S|Keu;6vd;wY%RRdhK7muh&nj*^3tHQY6R|H%g-!p**=T`*vw zd3NkpMIz9&KzQ{&by#RXnyWS=&6yPB#cx4IOM`ut5$+>E)2A|^jh-+y5IET>Jwk6B zJxxO^CkRxm)?j}aH6{mF0lf}R100+SHe7OnRn83@?-P9Qn6>xUr@Bs}q*2HUTdeN= zNeDm|xL{_|Q80~yxo!U%MJOB)iov=4nMr|ww@Rpe!`izvvS4cV(g_cNB(=1elUBXt zLl&(R@0^zgafjhJfME;e5lN|j$XtX7QGVp00l&VcOE_=Jz zhUba+n@wNpyu#7PdGNf5g*;$1gB39iwwM!ZSEw2sk5 z9rpL2`xS};i*+h7@L8;GTMqe)(JmDmT|HvHW*DCx4X3;Vx zaG{?&X0Ss)><%ht;aUjI`S5m7x)+OaBxKyn{7vf-5tK#GtltJtt}beD>a|}!cuba_ zzVlJQi0oxGZPP`$UCh#91s?H{6Pr@;)VkWPIbRN%vMDUa|yMnNfbiO15R z-X0mo>^RSodkPJz`uecm0PshwAk|4W)LeF(Bm7#*U$Cy0prOPEQC|j7I>|}n%lrYq X7G>|FWdf6veD%9`um8R4LD~NT^-= 0)); - int $fwdFee = __gen_Context_readForwardFee(($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw)); + int $fwdFee = $__gen_Context_readForwardFee(($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw)); int $fwdCount = 1; if (($msg'forwardTonAmount > 0)) { $fwdCount = 2; } throw_unless(16059, ($ctx'value > ((($fwdCount * $fwdFee) + (2 * 10000000)) + 10000000))); - var ($init'code, $init'data) = __gen_JettonDefaultWallet_init_child(__tact_context_sys, $self'master, $msg'destination); - slice $walletAddress = contractAddress(($init'code, $init'data)); - send((true, $walletAddress, 0, 64, __gen_writecell_TokenTransferInternal(($msg'queryId, $msg'amount, $self'owner, $self'owner, $msg'forwardTonAmount, $msg'forwardPayload)), $init'code, $init'data)); + var ($init'code, $init'data) = $__gen_JettonDefaultWallet_init_child(__tact_context_sys, $self'master, $msg'destination); + slice $walletAddress = $contractAddress(($init'code, $init'data)); + $send((true, $walletAddress, 0, 64, __gen_writecell_TokenTransferInternal(($msg'queryId, $msg'amount, $self'owner, $self'owner, $msg'forwardTonAmount, $msg'forwardPayload)), $init'code, $init'data)); return (($self'balance, $self'owner, $self'master), ()); } -(((int, slice, slice)), ()) __gen_JettonDefaultWallet_receive_TokenTransferInternal((int, slice, slice) $self, (int, int, slice, slice, int, slice) $msg) impure { +(((int, slice, slice)), ()) $__gen_JettonDefaultWallet_receive_TokenTransferInternal((int, slice, slice) $self, (int, int, slice, slice, int, slice) $msg) impure { var ($self'balance, $self'owner, $self'master) = $self; var ($msg'queryId, $msg'amount, $msg'from, $msg'responseAddress, $msg'forwardTonAmount, $msg'forwardPayload) = $msg; var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); if (__tact_address_neq($ctx'sender, $self'master)) { - var ($sinit'code, $sinit'data) = __gen_JettonDefaultWallet_init_child(__tact_context_sys, $self'master, $msg'from); - throw_unless(4429, __tact_address_eq(contractAddress(($sinit'code, $sinit'data)), $ctx'sender)); + var ($sinit'code, $sinit'data) = $__gen_JettonDefaultWallet_init_child(__tact_context_sys, $self'master, $msg'from); + throw_unless(4429, __tact_address_eq($contractAddress(($sinit'code, $sinit'data)), $ctx'sender)); } $self'balance = ($self'balance + $msg'amount); throw_unless(62972, ($self'balance >= 0)); @@ -334,30 +338,30 @@ _ __gen_get_get_wallet_data() method_id(97026) { int $storageFee = (10000000 - min($tonBalanceBeforeMsg, 10000000)); $msgValue = ($msgValue - ($storageFee + 10000000)); if (($msg'forwardTonAmount > 0)) { - int $fwdFee = __gen_Context_readForwardFee(($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw)); + int $fwdFee = $__gen_Context_readForwardFee(($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw)); $msgValue = ($msgValue - ($msg'forwardTonAmount + $fwdFee)); - send((false, $self'owner, $msg'forwardTonAmount, 0, __gen_writecell_TokenNotification(($msg'queryId, $msg'amount, $msg'from, $msg'forwardPayload)), null(), null())); + $send((false, $self'owner, $msg'forwardTonAmount, 0, __gen_writecell_TokenNotification(($msg'queryId, $msg'amount, $msg'from, $msg'forwardPayload)), null(), null())); } if (((~ null?($msg'responseAddress)) & ($msgValue > 0))) { - send((false, __tact_not_null($msg'responseAddress), $msgValue, 0, __gen_writecell_TokenExcesses(($msg'queryId)), null(), null())); + $send((false, __tact_not_null($msg'responseAddress), $msgValue, 0, __gen_writecell_TokenExcesses(($msg'queryId)), null(), null())); } return (($self'balance, $self'owner, $self'master), ()); } -(((int, slice, slice)), ()) __gen_JettonDefaultWallet_receive_TokenBurn((int, slice, slice) $self, (int, int, slice, slice) $msg) impure { +(((int, slice, slice)), ()) $__gen_JettonDefaultWallet_receive_TokenBurn((int, slice, slice) $self, (int, int, slice, slice) $msg) impure { var ($self'balance, $self'owner, $self'master) = $self; var ($msg'queryId, $msg'amount, $msg'owner, $msg'responseAddress) = $msg; var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); throw_unless(4429, __tact_address_eq($ctx'sender, $self'owner)); $self'balance = ($self'balance - $msg'amount); throw_unless(62972, ($self'balance >= 0)); - int $fwdFee = __gen_Context_readForwardFee(($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw)); + int $fwdFee = $__gen_Context_readForwardFee(($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw)); throw_unless(16059, ($ctx'value > (($fwdFee + (2 * 10000000)) + 10000000))); - send((true, $self'master, 0, 64, __gen_writecell_TokenBurnNotification(($msg'queryId, $msg'amount, $self'owner, $self'owner)), null(), null())); + $send((true, $self'master, 0, 64, __gen_writecell_TokenBurnNotification(($msg'queryId, $msg'amount, $self'owner, $self'owner)), null(), null())); return (($self'balance, $self'owner, $self'master), ()); } -((int, slice, slice), ()) __gen_JettonDefaultWallet_receive_bounced((int, slice, slice) $self, slice $msg) impure { +((int, slice, slice), ()) $__gen_JettonDefaultWallet_receive_bounced((int, slice, slice) $self, slice $msg) impure { var ($self'balance, $self'owner, $self'master) = $self; $msg~skip_bits(32); int $op = $msg~load_uint(32); @@ -385,7 +389,7 @@ _ __gen_get_get_wallet_data() method_id(97026) { ;; Handle bounced messages if (msg_bounced) { var self = __gen_load_JettonDefaultWallet(); - self~__gen_JettonDefaultWallet_receive_bounced(in_msg); + self~$__gen_JettonDefaultWallet_receive_bounced(in_msg); __gen_store_JettonDefaultWallet(self); return (); } @@ -394,7 +398,7 @@ _ __gen_get_get_wallet_data() method_id(97026) { if (op == 260734629) { var self = __gen_load_JettonDefaultWallet(); var msg = in_msg~__gen_read_TokenTransfer(); - self~__gen_JettonDefaultWallet_receive_TokenTransfer(msg); + self~$__gen_JettonDefaultWallet_receive_TokenTransfer(msg); __gen_store_JettonDefaultWallet(self); return (); } @@ -403,7 +407,7 @@ _ __gen_get_get_wallet_data() method_id(97026) { if (op == 395134233) { var self = __gen_load_JettonDefaultWallet(); var msg = in_msg~__gen_read_TokenTransferInternal(); - self~__gen_JettonDefaultWallet_receive_TokenTransferInternal(msg); + self~$__gen_JettonDefaultWallet_receive_TokenTransferInternal(msg); __gen_store_JettonDefaultWallet(self); return (); } @@ -412,7 +416,7 @@ _ __gen_get_get_wallet_data() method_id(97026) { if (op == 1499400124) { var self = __gen_load_JettonDefaultWallet(); var msg = in_msg~__gen_read_TokenBurn(); - self~__gen_JettonDefaultWallet_receive_TokenBurn(msg); + self~$__gen_JettonDefaultWallet_receive_TokenBurn(msg); __gen_store_JettonDefaultWallet(self); return (); } @@ -420,10 +424,6 @@ _ __gen_get_get_wallet_data() method_id(97026) { throw(130); } -cell init_JettonDefaultWallet(cell sys', slice master, slice owner) method_id { - return __gen_JettonDefaultWallet_init(sys', master, owner); -} - _ supported_interfaces() method_id { return ( "org.ton.introspection.v0"H >> 128, @@ -433,5 +433,5 @@ _ supported_interfaces() method_id { } _ get_abi_ipfs() { - return "ipfs://QmdPUYM67SQxPhiSig4LVW3rjqcKgEce6SGvRp3oZRXEM1"; + return "ipfs://QmXBfqbQzeN1uT55MyYpwhU9RV47Sq3quVt3qFLgWH8NhD"; } \ No newline at end of file diff --git a/sources/output/jetton_JettonDefaultWallet.fif b/sources/output/jetton_JettonDefaultWallet.code.fif similarity index 75% rename from sources/output/jetton_JettonDefaultWallet.fif rename to sources/output/jetton_JettonDefaultWallet.code.fif index fd9b910..0e71cd0 100644 --- a/sources/output/jetton_JettonDefaultWallet.fif +++ b/sources/output/jetton_JettonDefaultWallet.code.fif @@ -3,10 +3,12 @@ PROGRAM{ DECLPROC __tact_not_null DECLPROC __tact_context_get DECLPROC __tact_verify_address + DECLPROC __tact_store_bool DECLPROC __tact_load_address DECLPROC __tact_load_address_opt DECLPROC __tact_store_address DECLPROC __tact_store_address_opt + DECLPROC __tact_create_address DECLPROC __tact_compute_contract_address DECLPROC __tact_address_eq DECLPROC __tact_address_neq @@ -26,22 +28,21 @@ PROGRAM{ DECLPROC __gen_write_JettonDefaultWallet DECLPROC __gen_read_JettonDefaultWallet DECLPROC __gen_StateInit_get_code + DECLPROC __gen_JettonWalletData_to_external DECLPROC __gen_load_JettonDefaultWallet DECLPROC __gen_store_JettonDefaultWallet - DECLPROC storeBool - DECLPROC contractAddress - DECLPROC send - DECLPROC __gen_Context_readForwardFee - DECLPROC __gen_JettonDefaultWallet_init - DECLPROC __gen_JettonDefaultWallet_init_child - DECLPROC __gen_JettonDefaultWallet_get_wallet_data - 97026 DECLMETHOD __gen_get_get_wallet_data - DECLPROC __gen_JettonDefaultWallet_receive_TokenTransfer - DECLPROC __gen_JettonDefaultWallet_receive_TokenTransferInternal - DECLPROC __gen_JettonDefaultWallet_receive_TokenBurn - DECLPROC __gen_JettonDefaultWallet_receive_bounced + DECLPROC $contractAddress + DECLPROC $send + DECLPROC $__gen_Context_readForwardFee + DECLPROC $__gen_JettonDefaultWallet_init + DECLPROC $__gen_JettonDefaultWallet_init_child + DECLPROC $__gen_JettonDefaultWallet_get_wallet_data + 97026 DECLMETHOD $__gen_get_get_wallet_data + DECLPROC $__gen_JettonDefaultWallet_receive_TokenTransfer + DECLPROC $__gen_JettonDefaultWallet_receive_TokenTransferInternal + DECLPROC $__gen_JettonDefaultWallet_receive_TokenBurn + DECLPROC $__gen_JettonDefaultWallet_receive_bounced DECLPROC recv_internal - 111075 DECLMETHOD init_JettonDefaultWallet 113617 DECLMETHOD supported_interfaces DECLPROC get_abi_ipfs DECLGLOBVAR __tact_context @@ -63,7 +64,11 @@ PROGRAM{ SBITS 267 PUSHINT NEQ - 134 THROWIFNOT + 136 THROWIFNOT + }> + __tact_store_bool PROCINLINE:<{ + SWAP + 1 STI }> __tact_load_address PROCINLINE:<{ LDMSGADDR @@ -96,34 +101,37 @@ PROGRAM{ __tact_store_address INLINECALLDICT }> }> - __tact_compute_contract_address PROC:<{ + __tact_create_address PROCINLINE:<{ NEWC - 0 PUSHINT - SWAP - 2 STU - 3 PUSHINT + 2 PUSHINT SWAP 2 STU 0 PUSHINT SWAP 1 STU s1 s2 XCHG - STREF - STREF + 8 STI + 256 STU ENDC - HASHCU + CTOS + }> + __tact_compute_contract_address PROCINLINE:<{ NEWC - 2 PUSHINT + 0 PUSHINT + SWAP + 2 STU + 3 PUSHINT SWAP 2 STU 0 PUSHINT SWAP 1 STU s1 s2 XCHG - 8 STI - 256 STU + STREF + STREF ENDC - CTOS + HASHCU + __tact_create_address INLINECALLDICT }> __tact_address_eq PROCINLINE:<{ SDEQ @@ -142,9 +150,9 @@ PROGRAM{ 16 PUSHINT DICTUGETREF NULLSWAPIFNOT - 100 THROWIFNOT + 135 THROWIFNOT }> - __gen_read_TokenTransfer PROCINLINE:<{ + __gen_read_TokenTransfer PROCREF:<{ 32 LDU SWAP 260734629 PUSHINT @@ -155,22 +163,23 @@ PROGRAM{ __tact_load_address INLINECALLDICT SWAP __tact_load_address_opt INLINECALLDICT - PUSHNULL - s0 s2 XCHG + SWAP 1 LDI SWAP IF:<{ - 1 2 BLKDROP2 LDREF - s1 s2 XCHG + }>ELSE<{ + PUSHNULL + SWAP }> LDGRAMS s6 s6 XCPU s1 s6 XCHG s1 s5 XCHG - s4 s4 s0 XCHG3 + s1 s4 XCHG + s3 s3 s0 XCHG3 }> - __gen_write_TokenTransferInternal PROCINLINE:<{ + __gen_write_TokenTransferInternal PROCREF:<{ 395134233 PUSHINT s0 s7 XCHG2 32 STU @@ -187,13 +196,13 @@ PROGRAM{ SWAP STSLICER }> - __gen_writecell_TokenTransferInternal PROCINLINE:<{ + __gen_writecell_TokenTransferInternal PROCREF:<{ NEWC 6 -ROLL __gen_write_TokenTransferInternal INLINECALLDICT ENDC }> - __gen_read_TokenTransferInternal PROCINLINE:<{ + __gen_read_TokenTransferInternal PROCREF:<{ 32 LDU SWAP 395134233 PUSHINT @@ -211,7 +220,7 @@ PROGRAM{ s1 s4 XCHG s3 s3 s0 XCHG3 }> - __gen_write_TokenNotification PROCINLINE:<{ + __gen_write_TokenNotification PROCREF:<{ 1935855772 PUSHINT s0 s5 XCHG2 32 STU @@ -224,13 +233,13 @@ PROGRAM{ SWAP STSLICER }> - __gen_writecell_TokenNotification PROCINLINE:<{ + __gen_writecell_TokenNotification PROCREF:<{ NEWC 4 -ROLL __gen_write_TokenNotification INLINECALLDICT ENDC }> - __gen_read_TokenBurn PROCINLINE:<{ + __gen_read_TokenBurn PROCREF:<{ 32 LDU SWAP 1499400124 PUSHINT @@ -244,7 +253,7 @@ PROGRAM{ s1 s4 XCHG s3 s3 s0 XCHG3 }> - __gen_write_TokenBurnNotification PROCINLINE:<{ + __gen_write_TokenBurnNotification PROCREF:<{ 2078119902 PUSHINT s0 s5 XCHG2 32 STU @@ -257,25 +266,25 @@ PROGRAM{ SWAP __tact_store_address_opt INLINECALLDICT }> - __gen_writecell_TokenBurnNotification PROCINLINE:<{ + __gen_writecell_TokenBurnNotification PROCREF:<{ NEWC 4 -ROLL __gen_write_TokenBurnNotification INLINECALLDICT ENDC }> - __gen_write_TokenExcesses PROCINLINE:<{ + __gen_write_TokenExcesses PROCREF:<{ 3576854235 PUSHINT ROT 32 STU 64 STU }> - __gen_writecell_TokenExcesses PROCINLINE:<{ + __gen_writecell_TokenExcesses PROCREF:<{ NEWC SWAP __gen_write_TokenExcesses INLINECALLDICT ENDC }> - __gen_write_JettonDefaultWallet PROCINLINE:<{ + __gen_write_JettonDefaultWallet PROCREF:<{ s2 s3 XCHG2 257 PUSHINT STIX @@ -284,7 +293,7 @@ PROGRAM{ SWAP __tact_store_address INLINECALLDICT }> - __gen_read_JettonDefaultWallet PROCINLINE:<{ + __gen_read_JettonDefaultWallet PROCREF:<{ 257 PUSHINT LDIX __tact_load_address INLINECALLDICT @@ -295,7 +304,9 @@ PROGRAM{ __gen_StateInit_get_code PROCINLINE:<{ DROP }> - __gen_load_JettonDefaultWallet PROCINLINE:<{ + __gen_JettonWalletData_to_external PROC:<{ + }> + __gen_load_JettonDefaultWallet PROCREF:<{ c4 PUSH CTOS LDREF @@ -304,7 +315,7 @@ PROGRAM{ __gen_read_JettonDefaultWallet INLINECALLDICT 1 3 BLKDROP2 }> - __gen_store_JettonDefaultWallet PROCINLINE:<{ + __gen_store_JettonDefaultWallet PROCREF:<{ NEWC __tact_context_sys GETGLOB SWAP @@ -314,28 +325,18 @@ PROGRAM{ ENDC c4 POP }> - storeBool PROC:<{ - IFJMP:<{ - -1 PUSHINT - SWAP - 1 STI - }> - 0 PUSHINT - SWAP - 1 STI - }> - contractAddress PROC:<{ + $contractAddress PROC:<{ 0 PUSHINT -ROT - __tact_compute_contract_address CALLDICT + __tact_compute_contract_address INLINECALLDICT }> - send PROC:<{ + $send PROC:<{ NEWC 1 PUSHINT SWAP 2 STI s0 s7 XCHG2 - storeBool CALLDICT + __tact_store_bool INLINECALLDICT 0 PUSHINT SWAP 3 STI @@ -355,18 +356,18 @@ PROGRAM{ OR IF:<{ TRUE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT NEWC FALSE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT FALSE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT s4 PUSH ISNULL NOT IF:<{ TRUE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT s0 s4 XCHG __tact_not_null CALLDICT s0 s4 XCHG2 @@ -375,14 +376,14 @@ PROGRAM{ s4 POP s0 s3 XCHG FALSE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT }> s4 PUSH ISNULL NOT IF:<{ TRUE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT s0 s4 XCHG __tact_not_null CALLDICT s0 s4 XCHG2 @@ -391,13 +392,13 @@ PROGRAM{ s4 POP s0 s3 XCHG FALSE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT }> FALSE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT s0 s2 XCHG TRUE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT s0 s2 XCHG ENDC ROT @@ -407,14 +408,14 @@ PROGRAM{ s3 POP SWAP FALSE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT }> OVER ISNULL NOT IF:<{ TRUE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT SWAP __tact_not_null CALLDICT SWAP @@ -422,13 +423,13 @@ PROGRAM{ }>ELSE<{ NIP FALSE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT }> ENDC SWAP SENDRAWMSG }> - __gen_Context_readForwardFee PROC:<{ + $__gen_Context_readForwardFee PROC:<{ 3 1 BLKDROP2 LDGRAMS NIP @@ -441,7 +442,7 @@ PROGRAM{ 3 MULCONST 1 RSHIFT# }> - __gen_JettonDefaultWallet_init PROC:<{ + $__gen_JettonDefaultWallet_init PROC:<{ 0 PUSHINT s0 s3 XCHG NEWC @@ -450,39 +451,37 @@ PROGRAM{ __gen_write_JettonDefaultWallet INLINECALLDICT ENDC }> - __gen_JettonDefaultWallet_init_child PROC:<{ + $__gen_JettonDefaultWallet_init_child PROC:<{ s0 s2 XCHG CTOS LDDICT DROP - DUP - 55471 PUSHINT - __tact_dict_get_code INLINECALLDICT NEWDICT - s0 s2 XCHG + SWAP 55471 PUSHINT __tact_dict_get_code INLINECALLDICT - s1 s2 XCHG - 55471 PUSHINT SWAP + 55471 PUSHINT + s2 PUSH __tact_dict_set_code INLINECALLDICT NEWC STDICT ENDC s0 s0 s3 XCHG3 - __gen_JettonDefaultWallet_init CALLDICT + $__gen_JettonDefaultWallet_init CALLDICT }> - __gen_JettonDefaultWallet_get_wallet_data PROC:<{ + $__gen_JettonDefaultWallet_get_wallet_data PROC:<{ __tact_context_sys GETGLOB s1 s2 PUSH2 - __gen_JettonDefaultWallet_init_child CALLDICT + $__gen_JettonDefaultWallet_init_child CALLDICT __gen_StateInit_get_code INLINECALLDICT }> - __gen_get_get_wallet_data PROC:<{ + $__gen_get_get_wallet_data PROC:<{ __gen_load_JettonDefaultWallet INLINECALLDICT - __gen_JettonDefaultWallet_get_wallet_data CALLDICT + $__gen_JettonDefaultWallet_get_wallet_data CALLDICT + __gen_JettonWalletData_to_external CALLDICT }> - __gen_JettonDefaultWallet_receive_TokenTransfer PROC:<{ + $__gen_JettonDefaultWallet_receive_TokenTransfer PROC:<{ 2 2 BLKDROP2 __tact_context_get INLINECALLDICT 4429 PUSHINT @@ -497,7 +496,7 @@ PROGRAM{ THROWANYIFNOT s3 s3 s0 XCHG3 s3 s11 PUXC - __gen_Context_readForwardFee CALLDICT + $__gen_Context_readForwardFee CALLDICT 1 PUSHINT s4 PUSH 0 GTINT @@ -517,9 +516,9 @@ PROGRAM{ THROWANYIFNOT __tact_context_sys GETGLOB s0 s6 s3 XCPUXC - __gen_JettonDefaultWallet_init_child CALLDICT + $__gen_JettonDefaultWallet_init_child CALLDICT 2DUP - contractAddress CALLDICT + $contractAddress CALLDICT TRUE s7 s6 XCHG2 0 PUSHINT @@ -531,20 +530,20 @@ PROGRAM{ s5 s6 XCHG s3 s4 XCHG -ROT - send CALLDICT + $send CALLDICT }> - __gen_JettonDefaultWallet_receive_TokenTransferInternal PROC:<{ + $__gen_JettonDefaultWallet_receive_TokenTransferInternal PROC:<{ __tact_context_get INLINECALLDICT s2 s10 PUSH2 __tact_address_neq INLINECALLDICT IF:<{ __tact_context_sys GETGLOB s11 s8 PUSH2 - __gen_JettonDefaultWallet_init_child CALLDICT + $__gen_JettonDefaultWallet_init_child CALLDICT SWAP 4429 PUSHINT s0 s2 XCHG - contractAddress CALLDICT + $contractAddress CALLDICT s4 PUSH __tact_address_eq INLINECALLDICT THROWANYIFNOT @@ -571,7 +570,7 @@ PROGRAM{ IF:<{ s4 s13 XCHG2 s3 s3 s0 XCHG3 - __gen_Context_readForwardFee CALLDICT + $__gen_Context_readForwardFee CALLDICT s3 s(-1) PUXC ADD s1 s10 XCHG @@ -588,7 +587,7 @@ PROGRAM{ s5 s5 XCHG2 PUSHNULL PUSHNULL - send CALLDICT + $send CALLDICT s0 s5 XCHG2 }>ELSE<{ s7 s13 XCHG @@ -613,13 +612,13 @@ PROGRAM{ s1 s7 XCHG PUSHNULL PUSHNULL - send CALLDICT + $send CALLDICT }>ELSE<{ s5 POP 2DROP }> }> - __gen_JettonDefaultWallet_receive_TokenBurn PROC:<{ + $__gen_JettonDefaultWallet_receive_TokenBurn PROC:<{ 2DROP __tact_context_get INLINECALLDICT 4429 PUSHINT @@ -634,7 +633,7 @@ PROGRAM{ THROWANYIFNOT s3 s3 s0 XCHG3 s3 s8 PUXC - __gen_Context_readForwardFee CALLDICT + $__gen_Context_readForwardFee CALLDICT 16059 PUSHINT SWAP 20000000 PUSHINT @@ -654,9 +653,9 @@ PROGRAM{ s3 s3 XCHG2 PUSHNULL PUSHNULL - send CALLDICT + $send CALLDICT }> - __gen_JettonDefaultWallet_receive_bounced PROC:<{ + $__gen_JettonDefaultWallet_receive_bounced PROC:<{ 32 PUSHINT SDSKIPFIRST 32 LDU @@ -712,7 +711,7 @@ PROGRAM{ DROP __gen_load_JettonDefaultWallet INLINECALLDICT 3 ROLL - __gen_JettonDefaultWallet_receive_bounced CALLDICT + $__gen_JettonDefaultWallet_receive_bounced CALLDICT __gen_store_JettonDefaultWallet INLINECALLDICT }> DUP @@ -727,7 +726,7 @@ PROGRAM{ s8 s9 XCHG s7 s8 XCHG 6 ROLL - __gen_JettonDefaultWallet_receive_TokenTransfer CALLDICT + $__gen_JettonDefaultWallet_receive_TokenTransfer CALLDICT __gen_store_JettonDefaultWallet INLINECALLDICT }> DUP @@ -742,7 +741,7 @@ PROGRAM{ s7 s8 XCHG s6 s7 XCHG 5 ROLL - __gen_JettonDefaultWallet_receive_TokenTransferInternal CALLDICT + $__gen_JettonDefaultWallet_receive_TokenTransferInternal CALLDICT __gen_store_JettonDefaultWallet INLINECALLDICT }> 1499400124 PUSHINT @@ -755,21 +754,18 @@ PROGRAM{ s5 s6 XCHG s4 s5 XCHG 3 ROLL - __gen_JettonDefaultWallet_receive_TokenBurn CALLDICT + $__gen_JettonDefaultWallet_receive_TokenBurn CALLDICT __gen_store_JettonDefaultWallet INLINECALLDICT }> DROP 130 THROW }> - init_JettonDefaultWallet PROC:<{ - __gen_JettonDefaultWallet_init CALLDICT - }> supported_interfaces PROC:<{ 123515602279859691144772641439386770278 PUSHINT 209801025412363888721030803524359905849 PUSHINT 209778528950190195973528115415557644819 PUSHINT }> get_abi_ipfs PROC:<{ - x{697066733a2f2f516d645055594d3637535178506869536967344c565733726a71634b67456365365347765270336f5a5258454d31} PUSHSLICE + x{697066733a2f2f516d5842667162517a654e31755435354d7959707768553952563437537133717556743371464c675748384e6844} PUSHSLICE }> }END>c diff --git a/sources/output/jetton_JettonDefaultWallet.rev.fif b/sources/output/jetton_JettonDefaultWallet.code.rev.fif similarity index 52% rename from sources/output/jetton_JettonDefaultWallet.rev.fif rename to sources/output/jetton_JettonDefaultWallet.code.rev.fif index 4f47c52..2a05c5c 100644 --- a/sources/output/jetton_JettonDefaultWallet.rev.fif +++ b/sources/output/jetton_JettonDefaultWallet.code.rev.fif @@ -34,36 +34,44 @@ SETCP0 s0 s2 XCHG <{ s0 POP - c4 PUSH - CTOS - LDREF - s0 s1 XCHG - 2 SETGLOBVAR - 257 PUSHINT - LDI - LDMSGADDR - s0 s1 XCHG - s0 s1 XCHG - LDMSGADDR - s0 s1 XCHG - s3 s3 s0 XCHG3 - 1 3 BLKDROP2 + <{ + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + <{ + 257 PUSHINT + LDI + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDMSGADDR + s0 s1 XCHG + s3 s3 s0 XCHG3 + }> CALLREF + 1 3 BLKDROP2 + }> CALLREF 1 3 BLKSWAP - 40 CALLDICT - NEWC - 2 GETGLOBVAR - s0 s1 XCHG - STREF - 3 1 BLKSWAP - s2 s3 XCHG2 - 257 PUSHINT - STIX - s0 s1 XCHG - STSLICER - s0 s1 XCHG - STSLICER - ENDC - c4 POP + 42 CALLDICT + <{ + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 3 1 BLKSWAP + <{ + s2 s3 XCHG2 + 257 PUSHINT + STIX + s0 s1 XCHG + STSLICER + s0 s1 XCHG + STSLICER + }> CALLREF + ENDC + c4 POP + }> CALLREF }> PUSHCONT IFJMP s0 PUSH @@ -71,208 +79,242 @@ SETCP0 EQUAL <{ s0 POP - c4 PUSH - CTOS - LDREF - s0 s1 XCHG - 2 SETGLOBVAR - 257 PUSHINT - LDI - LDMSGADDR - s0 s1 XCHG - s0 s1 XCHG - LDMSGADDR - s0 s1 XCHG - s3 s3 s0 XCHG3 - 1 3 BLKDROP2 - s0 s3 XCHG - 32 LDU - s0 s1 XCHG - 260734629 PUSHINT - EQUAL - 129 THROWIFNOT - 64 LDU - LDGRAMS - LDMSGADDR - s0 s1 XCHG - s0 s1 XCHG - LDMSGADDR - s1 PUSH - 2 PLDU - 0 NEQINT <{ + c4 PUSH + CTOS + LDREF s0 s1 XCHG - }> PUSHCONT - <{ - s1 POP - PUSHNULL - }> PUSHCONT - IFELSE - PUSHNULL - s0 s2 XCHG - 1 LDI - s0 s1 XCHG + 2 SETGLOBVAR + <{ + 257 PUSHINT + LDI + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDMSGADDR + s0 s1 XCHG + s3 s3 s0 XCHG3 + }> CALLREF + 1 3 BLKDROP2 + }> CALLREF + s0 s3 XCHG <{ - 1 2 BLKDROP2 - LDREF - s1 s2 XCHG - }> PUSHCONT - IF - LDGRAMS - s6 s6 XCPU - s1 s6 XCHG - s1 s5 XCHG - s4 s4 s0 XCHG3 + 32 LDU + s0 s1 XCHG + 260734629 PUSHINT + EQUAL + 129 THROWIFNOT + 64 LDU + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + 1 LDI + s0 s1 XCHG + <{ + LDREF + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + LDGRAMS + s6 s6 XCPU + s1 s6 XCHG + s1 s5 XCHG + s1 s4 XCHG + s3 s3 s0 XCHG3 + }> CALLREF s7 POP s8 s9 XCHG s7 s8 XCHG 1 6 BLKSWAP - 37 CALLDICT - NEWC - 2 GETGLOBVAR - s0 s1 XCHG - STREF - 3 1 BLKSWAP - s2 s3 XCHG2 - 257 PUSHINT - STIX - s0 s1 XCHG - STSLICER - s0 s1 XCHG - STSLICER - ENDC - c4 POP + 39 CALLDICT + <{ + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 3 1 BLKSWAP + <{ + s2 s3 XCHG2 + 257 PUSHINT + STIX + s0 s1 XCHG + STSLICER + s0 s1 XCHG + STSLICER + }> CALLREF + ENDC + c4 POP + }> CALLREF }> IFJMPREF s0 PUSH 395134233 PUSHINT EQUAL <{ s0 POP - c4 PUSH - CTOS - LDREF - s0 s1 XCHG - 2 SETGLOBVAR - 257 PUSHINT - LDI - LDMSGADDR - s0 s1 XCHG - s0 s1 XCHG - LDMSGADDR - s0 s1 XCHG - s3 s3 s0 XCHG3 - 1 3 BLKDROP2 - s0 s3 XCHG - 32 LDU - s0 s1 XCHG - 395134233 PUSHINT - EQUAL - 129 THROWIFNOT - 64 LDU - LDGRAMS - LDMSGADDR - s0 s1 XCHG - s0 s1 XCHG - LDMSGADDR - s1 PUSH - 2 PLDU - 0 NEQINT <{ + c4 PUSH + CTOS + LDREF s0 s1 XCHG - }> PUSHCONT + 2 SETGLOBVAR + <{ + 257 PUSHINT + LDI + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDMSGADDR + s0 s1 XCHG + s3 s3 s0 XCHG3 + }> CALLREF + 1 3 BLKDROP2 + }> CALLREF + s0 s3 XCHG <{ - s1 POP - PUSHNULL - }> PUSHCONT - IFELSE - s0 s1 XCHG - LDGRAMS - s5 s5 XCPU - s1 s5 XCHG - s1 s4 XCHG - s3 s3 s0 XCHG3 + 32 LDU + s0 s1 XCHG + 395134233 PUSHINT + EQUAL + 129 THROWIFNOT + 64 LDU + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + LDGRAMS + s5 s5 XCPU + s1 s5 XCHG + s1 s4 XCHG + s3 s3 s0 XCHG3 + }> CALLREF s6 POP s7 s8 XCHG s6 s7 XCHG 1 5 BLKSWAP - 38 CALLDICT - NEWC - 2 GETGLOBVAR - s0 s1 XCHG - STREF - 3 1 BLKSWAP - s2 s3 XCHG2 - 257 PUSHINT - STIX - s0 s1 XCHG - STSLICER - s0 s1 XCHG - STSLICER - ENDC - c4 POP - }> IFJMPREF + 40 CALLDICT + <{ + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 3 1 BLKSWAP + <{ + s2 s3 XCHG2 + 257 PUSHINT + STIX + s0 s1 XCHG + STSLICER + s0 s1 XCHG + STSLICER + }> CALLREF + ENDC + c4 POP + }> CALLREF + }> PUSHCONT + IFJMP 1499400124 PUSHINT EQUAL <{ - c4 PUSH - CTOS - LDREF - s0 s1 XCHG - 2 SETGLOBVAR - 257 PUSHINT - LDI - LDMSGADDR - s0 s1 XCHG - s0 s1 XCHG - LDMSGADDR - s0 s1 XCHG - s3 s3 s0 XCHG3 - 1 3 BLKDROP2 - s0 s3 XCHG - 32 LDU - s0 s1 XCHG - 1499400124 PUSHINT - EQUAL - 129 THROWIFNOT - 64 LDU - LDGRAMS - LDMSGADDR - s0 s1 XCHG - s0 s1 XCHG - LDMSGADDR - s1 PUSH - 2 PLDU - 0 NEQINT <{ + c4 PUSH + CTOS + LDREF s0 s1 XCHG - }> PUSHCONT + 2 SETGLOBVAR + <{ + 257 PUSHINT + LDI + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDMSGADDR + s0 s1 XCHG + s3 s3 s0 XCHG3 + }> CALLREF + 1 3 BLKDROP2 + }> CALLREF + s0 s3 XCHG <{ - s1 POP - PUSHNULL - }> PUSHCONT - IFELSE - s1 s4 XCHG - s3 s3 s0 XCHG3 + 32 LDU + s0 s1 XCHG + 1499400124 PUSHINT + EQUAL + 129 THROWIFNOT + 64 LDU + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s1 s4 XCHG + s3 s3 s0 XCHG3 + }> CALLREF s4 POP s5 s6 XCHG s4 s5 XCHG 1 3 BLKSWAP - 39 CALLDICT - NEWC - 2 GETGLOBVAR - s0 s1 XCHG - STREF - 3 1 BLKSWAP - s2 s3 XCHG2 - 257 PUSHINT - STIX - s0 s1 XCHG - STSLICER - s0 s1 XCHG - STSLICER - ENDC - c4 POP - }> IFJMPREF + 41 CALLDICT + <{ + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 3 1 BLKSWAP + <{ + s2 s3 XCHG2 + 257 PUSHINT + STIX + s0 s1 XCHG + STSLICER + s0 s1 XCHG + STSLICER + }> CALLREF + ENDC + c4 POP + }> CALLREF + }> PUSHCONT + IFJMP s0 POP 130 THROW @@ -281,7 +323,11 @@ SETCP0 ISNULL 128 THROWIF - 9: + 30: + + 33: + 0 PUSHINT + ROTREV NEWC 0 PUSHINT s0 s1 XCHG @@ -310,29 +356,14 @@ SETCP0 ENDC CTOS - 30: - <{ - -1 PUSHINT - s0 s1 XCHG - 1 STI - }> PUSHCONT - IFJMP - 0 PUSHINT - s0 s1 XCHG - 1 STI - - 31: - 0 PUSHINT - ROTREV - 9 CALLDICT - - 32: + 34: NEWC 1 PUSHINT s0 s1 XCHG 2 STI s0 s7 XCHG2 - 30 CALLDICT + s0 s1 XCHG + 1 STI 0 PUSHINT s0 s1 XCHG 3 STI @@ -352,18 +383,22 @@ SETCP0 OR <{ -1 PUSHINT - 30 CALLDICT + s0 s1 XCHG + 1 STI NEWC 0 PUSHINT - 30 CALLDICT + s0 s1 XCHG + 1 STI 0 PUSHINT - 30 CALLDICT + s0 s1 XCHG + 1 STI s4 PUSH ISNULL NOT <{ -1 PUSHINT - 30 CALLDICT + s0 s1 XCHG + 1 STI s0 s4 XCHG 2 CALLDICT s0 s4 XCHG2 @@ -373,7 +408,8 @@ SETCP0 s4 POP s0 s3 XCHG 0 PUSHINT - 30 CALLDICT + s0 s1 XCHG + 1 STI }> PUSHCONT IFELSE s4 PUSH @@ -381,7 +417,8 @@ SETCP0 NOT <{ -1 PUSHINT - 30 CALLDICT + s0 s1 XCHG + 1 STI s0 s4 XCHG 2 CALLDICT s0 s4 XCHG2 @@ -391,14 +428,17 @@ SETCP0 s4 POP s0 s3 XCHG 0 PUSHINT - 30 CALLDICT + s0 s1 XCHG + 1 STI }> PUSHCONT IFELSE 0 PUSHINT - 30 CALLDICT + s0 s1 XCHG + 1 STI s0 s2 XCHG -1 PUSHINT - 30 CALLDICT + s0 s1 XCHG + 1 STI s0 s2 XCHG ENDC ROT @@ -409,7 +449,8 @@ SETCP0 s3 POP s0 s1 XCHG 0 PUSHINT - 30 CALLDICT + s0 s1 XCHG + 1 STI }> PUSHCONT IFELSE s1 PUSH @@ -417,23 +458,22 @@ SETCP0 NOT <{ -1 PUSHINT - 30 CALLDICT + s0 s1 XCHG + 1 STI s0 s1 XCHG 2 CALLDICT s0 s1 XCHG STREF - }> PUSHCONT - <{ - s1 POP - 0 PUSHINT - 30 CALLDICT - }> PUSHCONT - IFELSE + }> IFREFELSEREF ENDC s0 s1 XCHG SENDRAWMSG + s1 POP + 0 PUSHINT + s0 s1 XCHG + 1 STI - 33: + 35: 3 1 BLKDROP2 LDGRAMS s1 POP @@ -446,44 +486,39 @@ SETCP0 3 MULCONST 1 RSHIFT - 34: + 36: 0 PUSHINT s0 s3 XCHG NEWC STREF s3 s1 s3 XCHG3 - s2 s3 XCHG2 - 257 PUSHINT - STIX - s0 s1 XCHG - STSLICER - s0 s1 XCHG - STSLICER + <{ + s2 s3 XCHG2 + 257 PUSHINT + STIX + s0 s1 XCHG + STSLICER + s0 s1 XCHG + STSLICER + }> CALLREF ENDC - 35: + 37: s0 s2 XCHG CTOS LDDICT s0 POP - s0 PUSH - 55471 PUSHINT - s0 s1 XCHG - 16 PUSHINT - DICTUGETREF - NULLSWAPIFNOT - 100 THROWIFNOT PUSHNULL - s0 s2 XCHG + s0 s1 XCHG 55471 PUSHINT s0 s1 XCHG 16 PUSHINT DICTUGETREF NULLSWAPIFNOT - 100 THROWIFNOT - s1 s2 XCHG - 55471 PUSHINT + 135 THROWIFNOT s0 s1 XCHG + 55471 PUSHINT + s2 PUSH s0 s2 XCHG 16 PUSHINT DICTUSETREF @@ -491,15 +526,15 @@ SETCP0 STDICT ENDC s0 s0 s3 XCHG3 - 34 CALLDICT + 36 CALLDICT - 36: + 38: 2 GETGLOBVAR s1 s2 PUSH2 - 35 CALLDICT + 37 CALLDICT s0 POP - 37: + 39: 2 2 BLKDROP2 1 GETGLOBVAR 4 UNTUPLE @@ -515,7 +550,7 @@ SETCP0 THROWANYIFNOT s3 s3 s0 XCHG3 s3 s11 PUXC - 33 CALLDICT + 35 CALLDICT 1 PUSHINT s4 PUSH 0 GTINT @@ -536,9 +571,9 @@ SETCP0 THROWANYIFNOT 2 GETGLOBVAR 0 6 3 XCPUXC - 35 CALLDICT + 37 CALLDICT 2DUP - 31 CALLDICT + 33 CALLDICT -1 PUSHINT s7 s6 XCHG2 0 PUSHINT @@ -546,41 +581,45 @@ SETCP0 s11 PUSH 12 2 8 PUXC2 s1 s8 XCHG - NEWC - 6 1 BLKSWAP - 395134233 PUSHINT - s0 s7 XCHG2 - 32 STU - s1 s5 XCHG - 64 STU - s0 s3 XCHG2 - STGRAMS - s0 s1 XCHG - STSLICER - s0 s1 XCHG - s0 PUSH - ISNULL - <{ - s0 POP - 0 PUSHINT - s0 s1 XCHG - 2 STU - }> PUSHCONT <{ - STSLICER - }> PUSHCONT - IFELSE - s0 s1 XCHG - STGRAMS - s0 s1 XCHG - STSLICER - ENDC + NEWC + 6 1 BLKSWAP + <{ + 395134233 PUSHINT + s0 s7 XCHG2 + 32 STU + s1 s5 XCHG + 64 STU + s0 s3 XCHG2 + STGRAMS + s0 s1 XCHG + STSLICER + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + s0 s1 XCHG + STGRAMS + s0 s1 XCHG + STSLICER + }> CALLREF + ENDC + }> CALLREF s5 s6 XCHG s3 s4 XCHG ROTREV - 32 CALLDICT + 34 CALLDICT - 38: + 40: 1 GETGLOBVAR 4 UNTUPLE s2 s10 PUSH2 @@ -589,11 +628,11 @@ SETCP0 <{ 2 GETGLOBVAR s11 s8 PUSH2 - 35 CALLDICT + 37 CALLDICT s0 s1 XCHG 4429 PUSHINT s0 s2 XCHG - 31 CALLDICT + 33 CALLDICT s4 PUSH SDEQ THROWANYIFNOT @@ -619,15 +658,10 @@ SETCP0 SUB s6 PUSH 0 GTINT - <{ - s7 s13 XCHG - s8 s9 XCHG2 - 8 BLKDROP - }> PUSHCONT <{ s4 s13 XCHG2 s3 s3 s0 XCHG3 - 33 CALLDICT + 35 CALLDICT s3 s-1 PUXC ADD s1 s10 XCHG @@ -637,29 +671,39 @@ SETCP0 s8 PUSH s8 s1 s3 XCHG3 s7 s4 XCHG2 - NEWC - 4 1 BLKSWAP - 1935855772 PUSHINT - s0 s5 XCHG2 - 32 STU - s1 s3 XCHG - 64 STU - s0 s1 XCHG - STGRAMS - s0 s1 XCHG - STSLICER - s0 s1 XCHG - STSLICER - ENDC + <{ + NEWC + 4 1 BLKSWAP + <{ + 1935855772 PUSHINT + s0 s5 XCHG2 + 32 STU + s1 s3 XCHG + 64 STU + s0 s1 XCHG + STGRAMS + s0 s1 XCHG + STSLICER + s0 s1 XCHG + STSLICER + }> CALLREF + ENDC + }> CALLREF s8 PUSH s4 s6 XCHG s3 s1 s3 XCHG3 s5 s5 XCHG2 PUSHNULL PUSHNULL - 32 CALLDICT + 34 CALLDICT s0 s5 XCHG2 - }> IFREFELSE + }> PUSHCONT + <{ + s7 s13 XCHG + s8 s9 XCHG2 + 8 BLKDROP + }> PUSHCONT + IFELSE s5 PUSH ISNULL NOT @@ -672,27 +716,28 @@ SETCP0 2 CALLDICT 0 PUSHINT s0 s4 XCHG - NEWC - s0 s1 XCHG - 3576854235 PUSHINT - ROT - 32 STU - 64 STU - ENDC + <{ + NEWC + s0 s1 XCHG + <{ + 3576854235 PUSHINT + ROT + 32 STU + 64 STU + }> CALLREF + ENDC + }> CALLREF s4 s7 XCHG s3 s3 s0 XCHG3 s1 s7 XCHG PUSHNULL PUSHNULL - 32 CALLDICT - }> PUSHCONT - <{ - s5 POP - 2DROP - }> PUSHCONT - IFELSE + 34 CALLDICT + }> IFREFELSEREF + s5 POP + 2DROP - 39: + 41: 2DROP 1 GETGLOBVAR 4 UNTUPLE @@ -708,7 +753,7 @@ SETCP0 THROWANYIFNOT s3 s3 s0 XCHG3 s3 s8 PUXC - 33 CALLDICT + 35 CALLDICT 16059 PUSHINT s0 s1 XCHG 20000000 PUSHINT @@ -723,38 +768,42 @@ SETCP0 s0 s3 XCHG 64 PUSHINT 3 6 6 XCPU2 - NEWC - 4 1 BLKSWAP - 2078119902 PUSHINT - s0 s5 XCHG2 - 32 STU - s1 s3 XCHG - 64 STU - s0 s1 XCHG - STGRAMS - s0 s1 XCHG - STSLICER - s0 s1 XCHG - s0 PUSH - ISNULL <{ - s0 POP - 0 PUSHINT - s0 s1 XCHG - 2 STU - }> PUSHCONT - <{ - STSLICER - }> PUSHCONT - IFELSE - ENDC + NEWC + 4 1 BLKSWAP + <{ + 2078119902 PUSHINT + s0 s5 XCHG2 + 32 STU + s1 s3 XCHG + 64 STU + s0 s1 XCHG + STGRAMS + s0 s1 XCHG + STSLICER + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + }> CALLREF + ENDC + }> CALLREF 3 0 4 XC2PU s3 s3 XCHG2 PUSHNULL PUSHNULL - 32 CALLDICT + 34 CALLDICT - 40: + 42: 32 PUSHINT SDSKIPFIRST 32 LDU @@ -778,24 +827,26 @@ SETCP0 s0 s2 XCHG get_wallet_data: - c4 PUSH - CTOS - LDREF - s0 s1 XCHG - 2 SETGLOBVAR - 257 PUSHINT - LDI - LDMSGADDR - s0 s1 XCHG - s0 s1 XCHG - LDMSGADDR - s0 s1 XCHG - s3 s3 s0 XCHG3 - 1 3 BLKDROP2 - 36 CALLDICT - - 111075: - 34 CALLDICT + <{ + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + <{ + 257 PUSHINT + LDI + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDMSGADDR + s0 s1 XCHG + s3 s3 s0 XCHG3 + }> CALLREF + 1 3 BLKDROP2 + }> CALLREF + 38 CALLDICT + 30 CALLDICT 113617: 123515602279859691144772641439386770278 PUSHINT diff --git a/sources/output/jetton_JettonDefaultWallet.init.boc b/sources/output/jetton_JettonDefaultWallet.init.boc new file mode 100644 index 0000000000000000000000000000000000000000..18cd0d9ca423d58fadfdc02374a47b8cdfe17e72 GIT binary patch literal 72 zcmdn`ZcY&+BReC5Ed!&-e}*qhgum?hbb_0ai7| literal 0 HcmV?d00001 diff --git a/sources/output/jetton_JettonDefaultWallet.init.fc b/sources/output/jetton_JettonDefaultWallet.init.fc new file mode 100644 index 0000000..acfa612 --- /dev/null +++ b/sources/output/jetton_JettonDefaultWallet.init.fc @@ -0,0 +1,37 @@ +() __tact_verify_address(slice address) inline { + throw_unless(136, address.slice_bits() != 267); +} + +builder __tact_store_address(builder b, slice address) inline { + __tact_verify_address(address); + b = b.store_slice(address); + return b; +} + +builder __gen_write_JettonDefaultWallet(builder build_0, (int, slice, slice) v) inline_ref { + var (v'balance, v'owner, v'master) = v; + build_0 = build_0.store_int(v'balance, 257); + build_0 = __tact_store_address(build_0, v'owner); + build_0 = __tact_store_address(build_0, v'master); + return build_0; +} + +cell $__gen_JettonDefaultWallet_init(cell sys', slice $master, slice $owner) { + var (($self'balance, $self'owner, $self'master)) = (null(), null(), null()); + $self'balance = 0; + $self'owner = $owner; + $self'master = $master; + var b' = begin_cell(); + b' = b'.store_ref(sys'); + b' = __gen_write_JettonDefaultWallet(b', ($self'balance, $self'owner, $self'master)); + return b'.end_cell(); +} + +cell init(cell sys', slice $$master, slice $$owner) method_id { + slice $master = $$master; + slice $owner = $$owner; + return $__gen_JettonDefaultWallet_init(sys', $master, $owner); +} + +() main() { +} \ No newline at end of file diff --git a/sources/output/jetton_JettonDefaultWallet.init.fif b/sources/output/jetton_JettonDefaultWallet.init.fif new file mode 100644 index 0000000..35f3bdb --- /dev/null +++ b/sources/output/jetton_JettonDefaultWallet.init.fif @@ -0,0 +1,40 @@ +PROGRAM{ + DECLPROC __tact_verify_address + DECLPROC __tact_store_address + DECLPROC __gen_write_JettonDefaultWallet + DECLPROC $__gen_JettonDefaultWallet_init + 107886 DECLMETHOD init + DECLPROC main + __tact_verify_address PROCINLINE:<{ + SBITS + 267 PUSHINT + NEQ + 136 THROWIFNOT + }> + __tact_store_address PROCINLINE:<{ + STSLICER + }> + __gen_write_JettonDefaultWallet PROCREF:<{ + s2 s3 XCHG2 + 257 PUSHINT + STIX + SWAP + __tact_store_address INLINECALLDICT + SWAP + __tact_store_address INLINECALLDICT + }> + $__gen_JettonDefaultWallet_init PROC:<{ + 0 PUSHINT + s0 s3 XCHG + NEWC + STREF + s3 s1 s3 XCHG3 + __gen_write_JettonDefaultWallet INLINECALLDICT + ENDC + }> + init PROC:<{ + $__gen_JettonDefaultWallet_init CALLDICT + }> + main PROC:<{ + }> +}END>c diff --git a/sources/output/jetton_JettonDefaultWallet.init.rev.fif b/sources/output/jetton_JettonDefaultWallet.init.rev.fif new file mode 100644 index 0000000..b3909c3 --- /dev/null +++ b/sources/output/jetton_JettonDefaultWallet.init.rev.fif @@ -0,0 +1,26 @@ +SETCP0 +(:methods + recv_internal: + + 4: + 0 PUSHINT + s0 s3 XCHG + NEWC + STREF + s3 s1 s3 XCHG3 + <{ + s2 s3 XCHG2 + 257 PUSHINT + STIX + s0 s1 XCHG + STSLICER + s0 s1 XCHG + STSLICER + }> CALLREF + ENDC + + 107886: + 4 CALLDICT +) 19 DICTPUSHCONST +DICTIGETJMPZ +11 THROWARG diff --git a/sources/output/jetton_JettonDefaultWallet.md b/sources/output/jetton_JettonDefaultWallet.md new file mode 100644 index 0000000..833298d --- /dev/null +++ b/sources/output/jetton_JettonDefaultWallet.md @@ -0,0 +1,67 @@ +# TACT Compilation Report +Contract: JettonDefaultWallet +BOC Size: 1321 bytes + +# Types +Total Types: 14 + +## StateInit +TLB: `_ code:^cell data:^cell = StateInit` +Signature: `StateInit{code:^cell,data:^cell}` + +## Context +TLB: `_ bounced:bool sender:address value:int257 raw:^slice = Context` +Signature: `Context{bounced:bool,sender:address,value:int257,raw:^slice}` + +## SendParameters +TLB: `_ bounce:bool to:address value:int257 mode:int257 body:Maybe ^cell code:Maybe ^cell data:Maybe ^cell = SendParameters` +Signature: `SendParameters{bounce:bool,to:address,value:int257,mode:int257,body:Maybe ^cell,code:Maybe ^cell,data:Maybe ^cell}` + +## ChangeOwner +TLB: `change_owner#0f474d03 newOwner:address = ChangeOwner` +Signature: `ChangeOwner{newOwner:address}` + +## TokenTransfer +TLB: `token_transfer#0f8a7ea5 queryId:uint64 amount:coins destination:address responseDestination:Maybe address customPayload:Maybe ^cell forwardTonAmount:coins forwardPayload:remainder = TokenTransfer` +Signature: `TokenTransfer{queryId:uint64,amount:coins,destination:address,responseDestination:Maybe address,customPayload:Maybe ^cell,forwardTonAmount:coins,forwardPayload:remainder}` + +## TokenTransferInternal +TLB: `token_transfer_internal#178d4519 queryId:uint64 amount:coins from:address responseAddress:Maybe address forwardTonAmount:coins forwardPayload:remainder = TokenTransferInternal` +Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder}` + +## TokenNotification +TLB: `token_notification#7362d09c queryId:uint64 amount:coins from:address forwardPayload:remainder = TokenNotification` +Signature: `TokenNotification{queryId:uint64,amount:coins,from:address,forwardPayload:remainder}` + +## TokenBurn +TLB: `token_burn#595f07bc queryId:uint64 amount:coins owner:address responseAddress:Maybe address = TokenBurn` +Signature: `TokenBurn{queryId:uint64,amount:coins,owner:address,responseAddress:Maybe address}` + +## TokenBurnNotification +TLB: `token_burn_notification#7bdd97de queryId:uint64 amount:coins owner:address responseAddress:Maybe address = TokenBurnNotification` +Signature: `TokenBurnNotification{queryId:uint64,amount:coins,owner:address,responseAddress:Maybe address}` + +## TokenExcesses +TLB: `token_excesses#d53276db queryId:uint64 = TokenExcesses` +Signature: `TokenExcesses{queryId:uint64}` + +## TokenUpdateContent +TLB: `token_update_content#0c087a9e content:Maybe ^cell = TokenUpdateContent` +Signature: `TokenUpdateContent{content:Maybe ^cell}` + +## JettonData +TLB: `_ totalSupply:int257 mintable:bool owner:address content:Maybe ^cell walletCode:^cell = JettonData` +Signature: `JettonData{totalSupply:int257,mintable:bool,owner:address,content:Maybe ^cell,walletCode:^cell}` + +## JettonWalletData +TLB: `_ balance:int257 owner:address master:address walletCode:^cell = JettonWalletData` +Signature: `JettonWalletData{balance:int257,owner:address,master:address,walletCode:^cell}` + +## Mint +TLB: `mint#01fb345b amount:int257 = Mint` +Signature: `Mint{amount:int257}` + +# Get Methods +Total Get Methods: 1 + +## get_wallet_data diff --git a/sources/output/jetton_JettonDefaultWallet.pkg b/sources/output/jetton_JettonDefaultWallet.pkg new file mode 100644 index 0000000..96c7bd8 --- /dev/null +++ b/sources/output/jetton_JettonDefaultWallet.pkg @@ -0,0 +1 @@ +{"name":"JettonDefaultWallet","code":"te6ccgECNAEABR0AART/APSkE/S88sgLAQIBYgIDAgLKBgcCASAEBQERv9gW2eeBN4D0EQBxvd6ME4LnYerpZXPY9CdhzrJUKNs0E4TusalpWyPlmRadeW/vixHME4TujwAfLZsB5P5B1ZLNZRCcAgEgCAkCAUgVFgIBYgoLAAOnQASJRwIddJwh+VMCDXCx/eAtDTAwFxsMABkX+RcOIB+kAiUGZvBPhhAo8JMNs8VQLwKts84CCCEA+KfqW64wIgghAXjUUZuoERMMDQALQgbvLQgIAyIw2zwD2zw3EIkQeFUF8CfbPBEOEwQ2j5Ew2zwD2zw2EHgQZ1UE8CjbPOCCEFlfB7y6EQ8TEABs0x8BghAPin6luvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIB0gABkdSSbQHi+gBRZhYVFEMwAFjTHwGCEBeNRRm68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4gH6AFFVFRRDMAMuj5DbPAPbPDQQVhBFVQLwKds84DDywIIREhMBFu1E0NQB+GLbPGwTFABM0x8BghBZXwe8uvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIUQzABGMj4QgHMVSDbPMntVCMAHIEBAdcA+kABAfpAAUMwAgEgFxgCAUgoKQIBIBkaAgEgHyAAS1cFnIcAHLAXMBywFwAcsAEszMyfkAyHIBywFwAcsAEsoHy//J0IAgEgGxwC9zIcQHKAVAHAcoAcAHKAlAFzxZQA/oCcAHKaCNusyVus7GORn8BygDIcAHKAHABygAkbrOafwHKAATwAlAEzJY0A3ABygDiJG6zmn8BygAE8AJQBMyWNANwAcoA4nABygACfwHKAALJWMyXMzMBcAHKAOIhbrPjD8kB+wCAdHgAlGwx+gAxcdch+gAx+gAwpwOrAIAASfwHKAAHwAgHMAAoxcAHKAAIBICEiAgEgJCUBExwA8jMQxPbPMmAjAFEAtD0BDBtAYIA2K8BgBD0D2+h8uCHAYIA2K8iAoAQ9BfI9ADJQAPwJIAAaUCOBAQHPAAHPFgHPFgAPPhCUxLwJTCABuRsIvhBbySBEU1TO8cF8vRRt6GCAPX8IcL/8vRDMFI88CNxJMIAkjBy3oE+uwKoggkxLQCgggiYloCgErzy9PhCVCBk8CVc8CF/UHZwgEArVEw5GNs8EFYQNFnwIoCYBDMhVUNs8yScAToIQF41FGVAHyx8Vyz9QA/oCAc8WASBulTBwAcsBks8W4gH6AgHPFgIBICorAE9IAg1yHTH9M/MfoAMIE1UiKCEBeNRRm6A4IQe92X3roTsRLy9BOgAoA/E+EFvJFMqxwWzjhL4QlO48CUBgRFNAvAhJMcF8vTeUcigggD1/CHC//L0IfgnbxAhoYIImJaAZrYIoYIImJaAoKEmwgCOoVBNQzDwI1IwoBqhcHAoSBNQdNs8KBBGQxNQVW1t8CJQBZYQfVCJXwjiJW6zIsIAsOMPgLC0uAY8W/hBbySBEU1TOMcF8vRRhKGCAPX8IcL/8vRDMFI58COBPrsBggkxLQCgggiYloCgErzy9H9wA4BAVDNm2zxUEwRQM21t8CKAyAQzIVTDbPMkvASJwBvACcATbPBBHQzAXbW3wIjAABDVbACyCEHNi0JxQBcsfE8s/AfoCAc8WAc8WAQrIAds8yTEAFoIQ1TJ221jLH8s/AQzIVTDbPMkzAECCEHvdl95QBcsfE8s/AfoCAc8WASBulTBwAcsBks8W4g==","abi":"{\"name\":\"JettonDefaultWallet\",\"types\":[{\"name\":\"StateInit\",\"header\":null,\"fields\":[{\"name\":\"code\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":false}},{\"name\":\"data\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":false}}]},{\"name\":\"Context\",\"header\":null,\"fields\":[{\"name\":\"bounced\",\"type\":{\"kind\":\"simple\",\"type\":\"bool\",\"optional\":false}},{\"name\":\"sender\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"value\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"raw\",\"type\":{\"kind\":\"simple\",\"type\":\"slice\",\"optional\":false}}]},{\"name\":\"SendParameters\",\"header\":null,\"fields\":[{\"name\":\"bounce\",\"type\":{\"kind\":\"simple\",\"type\":\"bool\",\"optional\":false}},{\"name\":\"to\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"value\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"mode\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"body\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":true}},{\"name\":\"code\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":true}},{\"name\":\"data\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":true}}]},{\"name\":\"ChangeOwner\",\"header\":256331011,\"fields\":[{\"name\":\"newOwner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}}]},{\"name\":\"TokenTransfer\",\"header\":260734629,\"fields\":[{\"name\":\"queryId\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":64}},{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"destination\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"responseDestination\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}},{\"name\":\"customPayload\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":true}},{\"name\":\"forwardTonAmount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"forwardPayload\",\"type\":{\"kind\":\"simple\",\"type\":\"slice\",\"optional\":false,\"format\":\"remainder\"}}]},{\"name\":\"TokenTransferInternal\",\"header\":395134233,\"fields\":[{\"name\":\"queryId\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":64}},{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"from\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"responseAddress\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}},{\"name\":\"forwardTonAmount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"forwardPayload\",\"type\":{\"kind\":\"simple\",\"type\":\"slice\",\"optional\":false,\"format\":\"remainder\"}}]},{\"name\":\"TokenNotification\",\"header\":1935855772,\"fields\":[{\"name\":\"queryId\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":64}},{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"from\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"forwardPayload\",\"type\":{\"kind\":\"simple\",\"type\":\"slice\",\"optional\":false,\"format\":\"remainder\"}}]},{\"name\":\"TokenBurn\",\"header\":1499400124,\"fields\":[{\"name\":\"queryId\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":64}},{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"owner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"responseAddress\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}}]},{\"name\":\"TokenBurnNotification\",\"header\":2078119902,\"fields\":[{\"name\":\"queryId\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":64}},{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"owner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"responseAddress\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}}]},{\"name\":\"TokenExcesses\",\"header\":3576854235,\"fields\":[{\"name\":\"queryId\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":64}}]},{\"name\":\"TokenUpdateContent\",\"header\":201882270,\"fields\":[{\"name\":\"content\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":true}}]},{\"name\":\"JettonData\",\"header\":null,\"fields\":[{\"name\":\"totalSupply\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"mintable\",\"type\":{\"kind\":\"simple\",\"type\":\"bool\",\"optional\":false}},{\"name\":\"owner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"content\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":true}},{\"name\":\"walletCode\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":false}}]},{\"name\":\"JettonWalletData\",\"header\":null,\"fields\":[{\"name\":\"balance\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"owner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"master\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"walletCode\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":false}}]},{\"name\":\"Mint\",\"header\":33240155,\"fields\":[{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}}]}],\"receivers\":[{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"TokenTransfer\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"TokenTransferInternal\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"TokenBurn\"}}],\"getters\":[{\"name\":\"get_wallet_data\",\"arguments\":[],\"returnType\":{\"kind\":\"simple\",\"type\":\"JettonWalletData\",\"optional\":false}}],\"errors\":{\"2\":{\"message\":\"Stack undeflow\"},\"3\":{\"message\":\"Stack overflow\"},\"4\":{\"message\":\"Integer overflow\"},\"5\":{\"message\":\"Integer out of expected range\"},\"6\":{\"message\":\"Invalid opcode\"},\"7\":{\"message\":\"Type check error\"},\"8\":{\"message\":\"Cell overflow\"},\"9\":{\"message\":\"Cell underflow\"},\"10\":{\"message\":\"Dictionary error\"},\"13\":{\"message\":\"Out of gas error\"},\"32\":{\"message\":\"Method ID not found\"},\"34\":{\"message\":\"Action is invalid or not supported\"},\"37\":{\"message\":\"Not enough TON\"},\"38\":{\"message\":\"Not enough extra-currencies\"},\"128\":{\"message\":\"Null reference exception\"},\"129\":{\"message\":\"Invalid serialization prefix\"},\"130\":{\"message\":\"Invalid incoming message\"},\"131\":{\"message\":\"Constraints error\"},\"132\":{\"message\":\"Access denied\"},\"133\":{\"message\":\"Contract stopped\"},\"134\":{\"message\":\"Invalid argument\"},\"135\":{\"message\":\"Code of a contract was not found\"},\"136\":{\"message\":\"Invalid address\"},\"4429\":{\"message\":\"Invalid sender\"},\"13650\":{\"message\":\"Invalid bounced message\"},\"16059\":{\"message\":\"Invalid value\"},\"62972\":{\"message\":\"Invalid balance\"}}}","init":{"code":"te6ccgEBBwEAPQABFP8A9KQT9LzyyAsBAgFiAgMCAs0EBQAJoUrd4AkAAdQBE9OAHkZiGJ7Z5kwGABpQI4EBAc8AAc8WAc8W","args":[{"name":"master","type":{"kind":"simple","type":"address","optional":false}},{"name":"owner","type":{"kind":"simple","type":"address","optional":false}}],"deployment":{"kind":"system-cell","system":"te6cckECNgEABScAAQHAAQEFobFfAgEU/wD0pBP0vPLICwMCAWIHBAIBIAYFAHG93owTgudh6ullc9j0J2HOslQo2zQThO6xqWlbI+WZFp15b++LEcwThO6PAB8tmwHk/kHVks1lEJwBEb/YFtnngTeA9DQCAsonCAIBSBYJAgFICwoAT0gCDXIdMf0z8x+gAwgTVSIoIQF41FGboDghB73ZfeuhOxEvL0E6ACgCASAPDAGPFv4QW8kgRFNUzjHBfL0UYShggD1/CHC//L0QzBSOfAjgT67AYIJMS0AoIIImJaAoBK88vR/cAOAQFQzZts8VBMEUDNtbfAigDQEMyFUw2zzJDgBAghB73ZfeUAXLHxPLPwH6AgHPFgEgbpUwcAHLAZLPFuID8T4QW8kUyrHBbOOEvhCU7jwJQGBEU0C8CEkxwXy9N5RyKCCAPX8IcL/8vQh+CdvECGhggiYloBmtgihggiYloCgoSbCAI6hUE1DMPAjUjCgGqFwcChIE1B02zwoEEZDE1BVbW3wIlAFlhB9UIlfCOIlbrMiwgCw4w+AUERAABDVbASJwBvACcATbPBBHQzAXbW3wIhIBCsgB2zzJEwAWghDVMnbbWMsfyz8BDMhVMNs8yRUALIIQc2LQnFAFyx8Tyz8B+gIBzxYBzxYCASAgFwIBIB0YAgEgHBkBuRsIvhBbySBEU1TO8cF8vRRt6GCAPX8IcL/8vRDMFI88CNxJMIAkjBy3oE+uwKoggkxLQCgggiYloCgErzy9PhCVCBk8CVc8CF/UHZwgEArVEw5GNs8EFYQNFnwIoBoBDMhVUNs8yRsAToIQF41FGVAHyx8Vyz9QA/oCAc8WASBulTBwAcsBks8W4gH6AgHPFgAPPhCUxLwJTCACASAfHgBRALQ9AQwbQGCANivAYAQ9A9vofLghwGCANivIgKAEPQXyPQAyUAD8CSABExwA8jMQxPbPMmAzAgEgJiECASAjIgAlGwx+gAxcdch+gAx+gAwpwOrAIAL3MhxAcoBUAcBygBwAcoCUAXPFlAD+gJwAcpoI26zJW6zsY5GfwHKAMhwAcoAcAHKACRus5p/AcoABPACUATMljQDcAHKAOIkbrOafwHKAATwAlAEzJY0A3ABygDicAHKAAJ/AcoAAslYzJczMwFwAcoA4iFus+MPyQH7AICUkAAoxcAHKAAASfwHKAAHwAgHMAEtXBZyHABywFzAcsBcAHLABLMzMn5AMhyAcsBcAHLABLKB8v/ydCAIBICkoAAOnQAIBYisqAAtCBu8tCAgEiUcCHXScIflTAg1wsf3gLQ0wMBcbDAAZF/kXDiAfpAIlBmbwT4YQKPCTDbPFUC8CrbPOAgghAPin6luuMCIIIQF41FGbqDQyMCwENo+RMNs8A9s8NhB4EGdVBPAo2zzgghBZXwe8ujQvMi0DLo+Q2zwD2zw0EFYQRVUC8CnbPOAw8sCCNC4yAEzTHwGCEFlfB7y68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4hRDMABY0x8BghAXjUUZuvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIB+gBRVRUUQzADIjDbPAPbPDcQiRB4VQXwJ9s8NDEyAGzTHwGCEA+KfqW68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4gHSAAGR1JJtAeL6AFFmFhUUQzABGMj4QgHMVSDbPMntVDMAGlAjgQEBzwABzxYBzxYBFu1E0NQB+GLbPGwTNQAcgQEB1wD6QAEB+kABQzCZZpMs"}},"compiler":{"name":"tact","version":"0.8.7"}} \ No newline at end of file diff --git a/sources/output/jetton_JettonDefaultWallet.ts b/sources/output/jetton_JettonDefaultWallet.ts index cef9cbd..2157d9e 100644 --- a/sources/output/jetton_JettonDefaultWallet.ts +++ b/sources/output/jetton_JettonDefaultWallet.ts @@ -1,6 +1,5 @@ -import { Cell, Slice, StackItem, Address, Builder, InternalMessage, CommonMessageInfo, CellMessage, beginCell, serializeDict, TupleSlice4, readString, stringToCell } from 'ton'; -import { ContractExecutor, createExecutorFromCode, ExecuteError } from 'ton-nodejs'; -import BN from 'bn.js'; +import { Cell, Slice, Address, Builder, beginCell, ComputeError, TupleItem, TupleReader, Dictionary, contractAddress, ContractProvider, Sender, Contract, ContractABI, TupleBuilder, DictionaryValue } from 'ton-core'; +import { ContractSystem, ContractExecutor } from 'ton-emulator'; export type StateInit = { $$type: 'StateInit'; @@ -8,843 +7,857 @@ export type StateInit = { data: Cell; } -export function packStateInit(src: StateInit): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeRef(src.code); - b_0 = b_0.storeRef(src.data); - return b_0.endCell(); +export function storeStateInit(src: StateInit) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeRef(src.code); + b_0.storeRef(src.data); + }; } -export function packStackStateInit(src: StateInit, __stack: StackItem[]) { - __stack.push({ type: 'cell', cell: src.code }); - __stack.push({ type: 'cell', cell: src.data }); +export function loadStateInit(slice: Slice) { + let sc_0 = slice; + let _code = sc_0.loadRef(); + let _data = sc_0.loadRef(); + return { $$type: 'StateInit' as const, code: _code, data: _data }; } -export function packTupleStateInit(src: StateInit): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'cell', cell: src.code }); - __stack.push({ type: 'cell', cell: src.data }); - return __stack; +function loadTupleStateInit(source: TupleReader) { + let _code = source.readCell(); + let _data = source.readCell(); + return { $$type: 'StateInit' as const, code: _code, data: _data }; } -export function unpackStackStateInit(slice: TupleSlice4): StateInit { - const code = slice.readCell(); - const data = slice.readCell(); - return { $$type: 'StateInit', code: code, data: data }; +function storeTupleStateInit(source: StateInit) { + let builder = new TupleBuilder(); + builder.writeCell(source.code); + builder.writeCell(source.data); + return builder.build(); } -export function unpackTupleStateInit(slice: TupleSlice4): StateInit { - const code = slice.readCell(); - const data = slice.readCell(); - return { $$type: 'StateInit', code: code, data: data }; + +function dictValueParserStateInit(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeStateInit(src)).endCell()); + }, + parse: (src) => { + return loadStateInit(src.loadRef().beginParse()); + } + } } export type Context = { $$type: 'Context'; bounced: boolean; sender: Address; - value: BN; + value: bigint; raw: Cell; } -export function packContext(src: Context): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeBit(src.bounced); - b_0 = b_0.storeAddress(src.sender); - b_0 = b_0.storeInt(src.value, 257); - b_0 = b_0.storeRef(src.raw); - return b_0.endCell(); -} - -export function packStackContext(src: Context, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.bounced ? new BN(-1) : new BN(0) }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.sender).endCell() }); - __stack.push({ type: 'int', value: src.value }); - __stack.push({ type: 'slice', cell: src.raw }); -} - -export function packTupleContext(src: Context): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.bounced ? new BN(-1) : new BN(0) }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.sender).endCell() }); - __stack.push({ type: 'int', value: src.value }); - __stack.push({ type: 'slice', cell: src.raw }); - return __stack; -} - -export function unpackStackContext(slice: TupleSlice4): Context { - const bounced = slice.readBoolean(); - const sender = slice.readAddress(); - const value = slice.readBigNumber(); - const raw = slice.readCell(); - return { $$type: 'Context', bounced: bounced, sender: sender, value: value, raw: raw }; -} -export function unpackTupleContext(slice: TupleSlice4): Context { - const bounced = slice.readBoolean(); - const sender = slice.readAddress(); - const value = slice.readBigNumber(); - const raw = slice.readCell(); - return { $$type: 'Context', bounced: bounced, sender: sender, value: value, raw: raw }; +export function storeContext(src: Context) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeBit(src.bounced); + b_0.storeAddress(src.sender); + b_0.storeInt(src.value, 257); + b_0.storeRef(src.raw); + }; +} + +export function loadContext(slice: Slice) { + let sc_0 = slice; + let _bounced = sc_0.loadBit(); + let _sender = sc_0.loadAddress(); + let _value = sc_0.loadIntBig(257); + let _raw = sc_0.loadRef(); + return { $$type: 'Context' as const, bounced: _bounced, sender: _sender, value: _value, raw: _raw }; +} + +function loadTupleContext(source: TupleReader) { + let _bounced = source.readBoolean(); + let _sender = source.readAddress(); + let _value = source.readBigNumber(); + let _raw = source.readCell(); + return { $$type: 'Context' as const, bounced: _bounced, sender: _sender, value: _value, raw: _raw }; +} + +function storeTupleContext(source: Context) { + let builder = new TupleBuilder(); + builder.writeBoolean(source.bounced); + builder.writeAddress(source.sender); + builder.writeNumber(source.value); + builder.writeSlice(source.raw); + return builder.build(); +} + +function dictValueParserContext(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeContext(src)).endCell()); + }, + parse: (src) => { + return loadContext(src.loadRef().beginParse()); + } + } } export type SendParameters = { $$type: 'SendParameters'; bounce: boolean; to: Address; - value: BN; - mode: BN; + value: bigint; + mode: bigint; body: Cell | null; code: Cell | null; data: Cell | null; } -export function packSendParameters(src: SendParameters): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeBit(src.bounce); - b_0 = b_0.storeAddress(src.to); - b_0 = b_0.storeInt(src.value, 257); - b_0 = b_0.storeInt(src.mode, 257); - if (src.body !== null) { - b_0 = b_0.storeBit(true); - b_0 = b_0.storeRef(src.body); - } else { - b_0 = b_0.storeBit(false); - } - if (src.code !== null) { - b_0 = b_0.storeBit(true); - b_0 = b_0.storeRef(src.code); - } else { - b_0 = b_0.storeBit(false); - } - if (src.data !== null) { - b_0 = b_0.storeBit(true); - b_0 = b_0.storeRef(src.data); - } else { - b_0 = b_0.storeBit(false); - } - return b_0.endCell(); -} - -export function packStackSendParameters(src: SendParameters, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.bounce ? new BN(-1) : new BN(0) }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.to).endCell() }); - __stack.push({ type: 'int', value: src.value }); - __stack.push({ type: 'int', value: src.mode }); - if (src.body !== null) { - __stack.push({ type: 'cell', cell: src.body }); - } else { - __stack.push({ type: 'null' }); - } - if (src.code !== null) { - __stack.push({ type: 'cell', cell: src.code }); - } else { - __stack.push({ type: 'null' }); - } - if (src.data !== null) { - __stack.push({ type: 'cell', cell: src.data }); - } else { - __stack.push({ type: 'null' }); - } -} - -export function packTupleSendParameters(src: SendParameters): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.bounce ? new BN(-1) : new BN(0) }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.to).endCell() }); - __stack.push({ type: 'int', value: src.value }); - __stack.push({ type: 'int', value: src.mode }); - if (src.body !== null) { - __stack.push({ type: 'cell', cell: src.body }); - } else { - __stack.push({ type: 'null' }); - } - if (src.code !== null) { - __stack.push({ type: 'cell', cell: src.code }); - } else { - __stack.push({ type: 'null' }); - } - if (src.data !== null) { - __stack.push({ type: 'cell', cell: src.data }); - } else { - __stack.push({ type: 'null' }); +export function storeSendParameters(src: SendParameters) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeBit(src.bounce); + b_0.storeAddress(src.to); + b_0.storeInt(src.value, 257); + b_0.storeInt(src.mode, 257); + if (src.body !== null && src.body !== undefined) { b_0.storeBit(true).storeRef(src.body); } else { b_0.storeBit(false); } + if (src.code !== null && src.code !== undefined) { b_0.storeBit(true).storeRef(src.code); } else { b_0.storeBit(false); } + if (src.data !== null && src.data !== undefined) { b_0.storeBit(true).storeRef(src.data); } else { b_0.storeBit(false); } + }; +} + +export function loadSendParameters(slice: Slice) { + let sc_0 = slice; + let _bounce = sc_0.loadBit(); + let _to = sc_0.loadAddress(); + let _value = sc_0.loadIntBig(257); + let _mode = sc_0.loadIntBig(257); + let _body = sc_0.loadBit() ? sc_0.loadRef() : null; + let _code = sc_0.loadBit() ? sc_0.loadRef() : null; + let _data = sc_0.loadBit() ? sc_0.loadRef() : null; + return { $$type: 'SendParameters' as const, bounce: _bounce, to: _to, value: _value, mode: _mode, body: _body, code: _code, data: _data }; +} + +function loadTupleSendParameters(source: TupleReader) { + let _bounce = source.readBoolean(); + let _to = source.readAddress(); + let _value = source.readBigNumber(); + let _mode = source.readBigNumber(); + let _body = source.readCellOpt(); + let _code = source.readCellOpt(); + let _data = source.readCellOpt(); + return { $$type: 'SendParameters' as const, bounce: _bounce, to: _to, value: _value, mode: _mode, body: _body, code: _code, data: _data }; +} + +function storeTupleSendParameters(source: SendParameters) { + let builder = new TupleBuilder(); + builder.writeBoolean(source.bounce); + builder.writeAddress(source.to); + builder.writeNumber(source.value); + builder.writeNumber(source.mode); + builder.writeCell(source.body); + builder.writeCell(source.code); + builder.writeCell(source.data); + return builder.build(); +} + +function dictValueParserSendParameters(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeSendParameters(src)).endCell()); + }, + parse: (src) => { + return loadSendParameters(src.loadRef().beginParse()); + } } - return __stack; -} - -export function unpackStackSendParameters(slice: TupleSlice4): SendParameters { - const bounce = slice.readBoolean(); - const to = slice.readAddress(); - const value = slice.readBigNumber(); - const mode = slice.readBigNumber(); - const body = slice.readCellOpt(); - const code = slice.readCellOpt(); - const data = slice.readCellOpt(); - return { $$type: 'SendParameters', bounce: bounce, to: to, value: value, mode: mode, body: body, code: code, data: data }; -} -export function unpackTupleSendParameters(slice: TupleSlice4): SendParameters { - const bounce = slice.readBoolean(); - const to = slice.readAddress(); - const value = slice.readBigNumber(); - const mode = slice.readBigNumber(); - const body = slice.readCellOpt(); - const code = slice.readCellOpt(); - const data = slice.readCellOpt(); - return { $$type: 'SendParameters', bounce: bounce, to: to, value: value, mode: mode, body: body, code: code, data: data }; } export type ChangeOwner = { $$type: 'ChangeOwner'; newOwner: Address; } -export function packChangeOwner(src: ChangeOwner): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeUint(3067051791, 32); - b_0 = b_0.storeAddress(src.newOwner); - return b_0.endCell(); +export function storeChangeOwner(src: ChangeOwner) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(256331011, 32); + b_0.storeAddress(src.newOwner); + }; } -export function packStackChangeOwner(src: ChangeOwner, __stack: StackItem[]) { - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.newOwner).endCell() }); +export function loadChangeOwner(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 256331011) { throw Error('Invalid prefix'); } + let _newOwner = sc_0.loadAddress(); + return { $$type: 'ChangeOwner' as const, newOwner: _newOwner }; } -export function packTupleChangeOwner(src: ChangeOwner): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.newOwner).endCell() }); - return __stack; +function loadTupleChangeOwner(source: TupleReader) { + let _newOwner = source.readAddress(); + return { $$type: 'ChangeOwner' as const, newOwner: _newOwner }; } -export function unpackStackChangeOwner(slice: TupleSlice4): ChangeOwner { - const newOwner = slice.readAddress(); - return { $$type: 'ChangeOwner', newOwner: newOwner }; +function storeTupleChangeOwner(source: ChangeOwner) { + let builder = new TupleBuilder(); + builder.writeAddress(source.newOwner); + return builder.build(); } -export function unpackTupleChangeOwner(slice: TupleSlice4): ChangeOwner { - const newOwner = slice.readAddress(); - return { $$type: 'ChangeOwner', newOwner: newOwner }; + +function dictValueParserChangeOwner(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeChangeOwner(src)).endCell()); + }, + parse: (src) => { + return loadChangeOwner(src.loadRef().beginParse()); + } + } } export type TokenTransfer = { $$type: 'TokenTransfer'; - queryId: BN; - amount: BN; + queryId: bigint; + amount: bigint; destination: Address; responseDestination: Address | null; customPayload: Cell | null; - forwardTonAmount: BN; + forwardTonAmount: bigint; forwardPayload: Cell; } -export function packTokenTransfer(src: TokenTransfer): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeUint(260734629, 32); - b_0 = b_0.storeUint(src.queryId, 64); - b_0 = b_0.storeCoins(src.amount); - b_0 = b_0.storeAddress(src.destination); - b_0 = b_0.storeAddress(src.responseDestination); - if (src.customPayload !== null) { - b_0 = b_0.storeBit(true); - b_0 = b_0.storeRef(src.customPayload); - } else { - b_0 = b_0.storeBit(false); - } - b_0 = b_0.storeCoins(src.forwardTonAmount); - b_0 = b_0.storeCellCopy(src.forwardPayload); - return b_0.endCell(); -} - -export function packStackTokenTransfer(src: TokenTransfer, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.queryId }); - __stack.push({ type: 'int', value: src.amount }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.destination).endCell() }); - if (src.responseDestination !== null) { - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseDestination).endCell() }); - } else { - __stack.push({ type: 'null' }); - } - if (src.customPayload !== null) { - __stack.push({ type: 'cell', cell: src.customPayload }); - } else { - __stack.push({ type: 'null' }); - } - __stack.push({ type: 'int', value: src.forwardTonAmount }); - __stack.push({ type: 'slice', cell: src.forwardPayload }); -} - -export function packTupleTokenTransfer(src: TokenTransfer): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.queryId }); - __stack.push({ type: 'int', value: src.amount }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.destination).endCell() }); - if (src.responseDestination !== null) { - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseDestination).endCell() }); - } else { - __stack.push({ type: 'null' }); - } - if (src.customPayload !== null) { - __stack.push({ type: 'cell', cell: src.customPayload }); - } else { - __stack.push({ type: 'null' }); +export function storeTokenTransfer(src: TokenTransfer) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(260734629, 32); + b_0.storeUint(src.queryId, 64); + b_0.storeCoins(src.amount); + b_0.storeAddress(src.destination); + if (src.responseDestination !== null && src.responseDestination !== undefined) { b_0.storeBit(true).storeAddress(src.responseDestination); } else { b_0.storeBit(false); } + if (src.customPayload !== null && src.customPayload !== undefined) { b_0.storeBit(true).storeRef(src.customPayload); } else { b_0.storeBit(false); } + b_0.storeCoins(src.forwardTonAmount); + b_0.storeBuilder(src.forwardPayload.asBuilder()); + }; +} + +export function loadTokenTransfer(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 260734629) { throw Error('Invalid prefix'); } + let _queryId = sc_0.loadUintBig(64); + let _amount = sc_0.loadCoins(); + let _destination = sc_0.loadAddress(); + let _responseDestination = sc_0.loadBit() ? sc_0.loadAddress() : null; + let _customPayload = sc_0.loadBit() ? sc_0.loadRef() : null; + let _forwardTonAmount = sc_0.loadCoins(); + let _forwardPayload = sc_0.asCell(); + return { $$type: 'TokenTransfer' as const, queryId: _queryId, amount: _amount, destination: _destination, responseDestination: _responseDestination, customPayload: _customPayload, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; +} + +function loadTupleTokenTransfer(source: TupleReader) { + let _queryId = source.readBigNumber(); + let _amount = source.readBigNumber(); + let _destination = source.readAddress(); + let _responseDestination = source.readAddressOpt(); + let _customPayload = source.readCellOpt(); + let _forwardTonAmount = source.readBigNumber(); + let _forwardPayload = source.readCell(); + return { $$type: 'TokenTransfer' as const, queryId: _queryId, amount: _amount, destination: _destination, responseDestination: _responseDestination, customPayload: _customPayload, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; +} + +function storeTupleTokenTransfer(source: TokenTransfer) { + let builder = new TupleBuilder(); + builder.writeNumber(source.queryId); + builder.writeNumber(source.amount); + builder.writeAddress(source.destination); + builder.writeAddress(source.responseDestination); + builder.writeCell(source.customPayload); + builder.writeNumber(source.forwardTonAmount); + builder.writeSlice(source.forwardPayload); + return builder.build(); +} + +function dictValueParserTokenTransfer(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenTransfer(src)).endCell()); + }, + parse: (src) => { + return loadTokenTransfer(src.loadRef().beginParse()); + } } - __stack.push({ type: 'int', value: src.forwardTonAmount }); - __stack.push({ type: 'slice', cell: src.forwardPayload }); - return __stack; -} - -export function unpackStackTokenTransfer(slice: TupleSlice4): TokenTransfer { - const queryId = slice.readBigNumber(); - const amount = slice.readBigNumber(); - const destination = slice.readAddress(); - const responseDestination = slice.readAddressOpt(); - const customPayload = slice.readCellOpt(); - const forwardTonAmount = slice.readBigNumber(); - const forwardPayload = slice.readCell(); - return { $$type: 'TokenTransfer', queryId: queryId, amount: amount, destination: destination, responseDestination: responseDestination, customPayload: customPayload, forwardTonAmount: forwardTonAmount, forwardPayload: forwardPayload }; -} -export function unpackTupleTokenTransfer(slice: TupleSlice4): TokenTransfer { - const queryId = slice.readBigNumber(); - const amount = slice.readBigNumber(); - const destination = slice.readAddress(); - const responseDestination = slice.readAddressOpt(); - const customPayload = slice.readCellOpt(); - const forwardTonAmount = slice.readBigNumber(); - const forwardPayload = slice.readCell(); - return { $$type: 'TokenTransfer', queryId: queryId, amount: amount, destination: destination, responseDestination: responseDestination, customPayload: customPayload, forwardTonAmount: forwardTonAmount, forwardPayload: forwardPayload }; } export type TokenTransferInternal = { $$type: 'TokenTransferInternal'; - queryId: BN; - amount: BN; + queryId: bigint; + amount: bigint; from: Address; responseAddress: Address | null; - forwardTonAmount: BN; + forwardTonAmount: bigint; forwardPayload: Cell; } -export function packTokenTransferInternal(src: TokenTransferInternal): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeUint(395134233, 32); - b_0 = b_0.storeUint(src.queryId, 64); - b_0 = b_0.storeCoins(src.amount); - b_0 = b_0.storeAddress(src.from); - b_0 = b_0.storeAddress(src.responseAddress); - b_0 = b_0.storeCoins(src.forwardTonAmount); - b_0 = b_0.storeCellCopy(src.forwardPayload); - return b_0.endCell(); -} - -export function packStackTokenTransferInternal(src: TokenTransferInternal, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.queryId }); - __stack.push({ type: 'int', value: src.amount }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.from).endCell() }); - if (src.responseAddress !== null) { - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() }); - } else { - __stack.push({ type: 'null' }); - } - __stack.push({ type: 'int', value: src.forwardTonAmount }); - __stack.push({ type: 'slice', cell: src.forwardPayload }); -} - -export function packTupleTokenTransferInternal(src: TokenTransferInternal): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.queryId }); - __stack.push({ type: 'int', value: src.amount }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.from).endCell() }); - if (src.responseAddress !== null) { - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() }); - } else { - __stack.push({ type: 'null' }); +export function storeTokenTransferInternal(src: TokenTransferInternal) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(395134233, 32); + b_0.storeUint(src.queryId, 64); + b_0.storeCoins(src.amount); + b_0.storeAddress(src.from); + if (src.responseAddress !== null && src.responseAddress !== undefined) { b_0.storeBit(true).storeAddress(src.responseAddress); } else { b_0.storeBit(false); } + b_0.storeCoins(src.forwardTonAmount); + b_0.storeBuilder(src.forwardPayload.asBuilder()); + }; +} + +export function loadTokenTransferInternal(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 395134233) { throw Error('Invalid prefix'); } + let _queryId = sc_0.loadUintBig(64); + let _amount = sc_0.loadCoins(); + let _from = sc_0.loadAddress(); + let _responseAddress = sc_0.loadBit() ? sc_0.loadAddress() : null; + let _forwardTonAmount = sc_0.loadCoins(); + let _forwardPayload = sc_0.asCell(); + return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; +} + +function loadTupleTokenTransferInternal(source: TupleReader) { + let _queryId = source.readBigNumber(); + let _amount = source.readBigNumber(); + let _from = source.readAddress(); + let _responseAddress = source.readAddressOpt(); + let _forwardTonAmount = source.readBigNumber(); + let _forwardPayload = source.readCell(); + return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; +} + +function storeTupleTokenTransferInternal(source: TokenTransferInternal) { + let builder = new TupleBuilder(); + builder.writeNumber(source.queryId); + builder.writeNumber(source.amount); + builder.writeAddress(source.from); + builder.writeAddress(source.responseAddress); + builder.writeNumber(source.forwardTonAmount); + builder.writeSlice(source.forwardPayload); + return builder.build(); +} + +function dictValueParserTokenTransferInternal(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenTransferInternal(src)).endCell()); + }, + parse: (src) => { + return loadTokenTransferInternal(src.loadRef().beginParse()); + } } - __stack.push({ type: 'int', value: src.forwardTonAmount }); - __stack.push({ type: 'slice', cell: src.forwardPayload }); - return __stack; -} - -export function unpackStackTokenTransferInternal(slice: TupleSlice4): TokenTransferInternal { - const queryId = slice.readBigNumber(); - const amount = slice.readBigNumber(); - const from = slice.readAddress(); - const responseAddress = slice.readAddressOpt(); - const forwardTonAmount = slice.readBigNumber(); - const forwardPayload = slice.readCell(); - return { $$type: 'TokenTransferInternal', queryId: queryId, amount: amount, from: from, responseAddress: responseAddress, forwardTonAmount: forwardTonAmount, forwardPayload: forwardPayload }; -} -export function unpackTupleTokenTransferInternal(slice: TupleSlice4): TokenTransferInternal { - const queryId = slice.readBigNumber(); - const amount = slice.readBigNumber(); - const from = slice.readAddress(); - const responseAddress = slice.readAddressOpt(); - const forwardTonAmount = slice.readBigNumber(); - const forwardPayload = slice.readCell(); - return { $$type: 'TokenTransferInternal', queryId: queryId, amount: amount, from: from, responseAddress: responseAddress, forwardTonAmount: forwardTonAmount, forwardPayload: forwardPayload }; } export type TokenNotification = { $$type: 'TokenNotification'; - queryId: BN; - amount: BN; + queryId: bigint; + amount: bigint; from: Address; forwardPayload: Cell; } -export function packTokenNotification(src: TokenNotification): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeUint(1935855772, 32); - b_0 = b_0.storeUint(src.queryId, 64); - b_0 = b_0.storeCoins(src.amount); - b_0 = b_0.storeAddress(src.from); - b_0 = b_0.storeCellCopy(src.forwardPayload); - return b_0.endCell(); -} - -export function packStackTokenNotification(src: TokenNotification, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.queryId }); - __stack.push({ type: 'int', value: src.amount }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.from).endCell() }); - __stack.push({ type: 'slice', cell: src.forwardPayload }); -} - -export function packTupleTokenNotification(src: TokenNotification): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.queryId }); - __stack.push({ type: 'int', value: src.amount }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.from).endCell() }); - __stack.push({ type: 'slice', cell: src.forwardPayload }); - return __stack; -} - -export function unpackStackTokenNotification(slice: TupleSlice4): TokenNotification { - const queryId = slice.readBigNumber(); - const amount = slice.readBigNumber(); - const from = slice.readAddress(); - const forwardPayload = slice.readCell(); - return { $$type: 'TokenNotification', queryId: queryId, amount: amount, from: from, forwardPayload: forwardPayload }; -} -export function unpackTupleTokenNotification(slice: TupleSlice4): TokenNotification { - const queryId = slice.readBigNumber(); - const amount = slice.readBigNumber(); - const from = slice.readAddress(); - const forwardPayload = slice.readCell(); - return { $$type: 'TokenNotification', queryId: queryId, amount: amount, from: from, forwardPayload: forwardPayload }; +export function storeTokenNotification(src: TokenNotification) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(1935855772, 32); + b_0.storeUint(src.queryId, 64); + b_0.storeCoins(src.amount); + b_0.storeAddress(src.from); + b_0.storeBuilder(src.forwardPayload.asBuilder()); + }; +} + +export function loadTokenNotification(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 1935855772) { throw Error('Invalid prefix'); } + let _queryId = sc_0.loadUintBig(64); + let _amount = sc_0.loadCoins(); + let _from = sc_0.loadAddress(); + let _forwardPayload = sc_0.asCell(); + return { $$type: 'TokenNotification' as const, queryId: _queryId, amount: _amount, from: _from, forwardPayload: _forwardPayload }; +} + +function loadTupleTokenNotification(source: TupleReader) { + let _queryId = source.readBigNumber(); + let _amount = source.readBigNumber(); + let _from = source.readAddress(); + let _forwardPayload = source.readCell(); + return { $$type: 'TokenNotification' as const, queryId: _queryId, amount: _amount, from: _from, forwardPayload: _forwardPayload }; +} + +function storeTupleTokenNotification(source: TokenNotification) { + let builder = new TupleBuilder(); + builder.writeNumber(source.queryId); + builder.writeNumber(source.amount); + builder.writeAddress(source.from); + builder.writeSlice(source.forwardPayload); + return builder.build(); +} + +function dictValueParserTokenNotification(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenNotification(src)).endCell()); + }, + parse: (src) => { + return loadTokenNotification(src.loadRef().beginParse()); + } + } } export type TokenBurn = { $$type: 'TokenBurn'; - queryId: BN; - amount: BN; + queryId: bigint; + amount: bigint; owner: Address; responseAddress: Address | null; } -export function packTokenBurn(src: TokenBurn): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeUint(1499400124, 32); - b_0 = b_0.storeUint(src.queryId, 64); - b_0 = b_0.storeCoins(src.amount); - b_0 = b_0.storeAddress(src.owner); - b_0 = b_0.storeAddress(src.responseAddress); - return b_0.endCell(); -} - -export function packStackTokenBurn(src: TokenBurn, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.queryId }); - __stack.push({ type: 'int', value: src.amount }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() }); - if (src.responseAddress !== null) { - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() }); - } else { - __stack.push({ type: 'null' }); - } -} - -export function packTupleTokenBurn(src: TokenBurn): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.queryId }); - __stack.push({ type: 'int', value: src.amount }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() }); - if (src.responseAddress !== null) { - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() }); - } else { - __stack.push({ type: 'null' }); +export function storeTokenBurn(src: TokenBurn) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(1499400124, 32); + b_0.storeUint(src.queryId, 64); + b_0.storeCoins(src.amount); + b_0.storeAddress(src.owner); + if (src.responseAddress !== null && src.responseAddress !== undefined) { b_0.storeBit(true).storeAddress(src.responseAddress); } else { b_0.storeBit(false); } + }; +} + +export function loadTokenBurn(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 1499400124) { throw Error('Invalid prefix'); } + let _queryId = sc_0.loadUintBig(64); + let _amount = sc_0.loadCoins(); + let _owner = sc_0.loadAddress(); + let _responseAddress = sc_0.loadBit() ? sc_0.loadAddress() : null; + return { $$type: 'TokenBurn' as const, queryId: _queryId, amount: _amount, owner: _owner, responseAddress: _responseAddress }; +} + +function loadTupleTokenBurn(source: TupleReader) { + let _queryId = source.readBigNumber(); + let _amount = source.readBigNumber(); + let _owner = source.readAddress(); + let _responseAddress = source.readAddressOpt(); + return { $$type: 'TokenBurn' as const, queryId: _queryId, amount: _amount, owner: _owner, responseAddress: _responseAddress }; +} + +function storeTupleTokenBurn(source: TokenBurn) { + let builder = new TupleBuilder(); + builder.writeNumber(source.queryId); + builder.writeNumber(source.amount); + builder.writeAddress(source.owner); + builder.writeAddress(source.responseAddress); + return builder.build(); +} + +function dictValueParserTokenBurn(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenBurn(src)).endCell()); + }, + parse: (src) => { + return loadTokenBurn(src.loadRef().beginParse()); + } } - return __stack; -} - -export function unpackStackTokenBurn(slice: TupleSlice4): TokenBurn { - const queryId = slice.readBigNumber(); - const amount = slice.readBigNumber(); - const owner = slice.readAddress(); - const responseAddress = slice.readAddressOpt(); - return { $$type: 'TokenBurn', queryId: queryId, amount: amount, owner: owner, responseAddress: responseAddress }; -} -export function unpackTupleTokenBurn(slice: TupleSlice4): TokenBurn { - const queryId = slice.readBigNumber(); - const amount = slice.readBigNumber(); - const owner = slice.readAddress(); - const responseAddress = slice.readAddressOpt(); - return { $$type: 'TokenBurn', queryId: queryId, amount: amount, owner: owner, responseAddress: responseAddress }; } export type TokenBurnNotification = { $$type: 'TokenBurnNotification'; - queryId: BN; - amount: BN; + queryId: bigint; + amount: bigint; owner: Address; responseAddress: Address | null; } -export function packTokenBurnNotification(src: TokenBurnNotification): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeUint(2078119902, 32); - b_0 = b_0.storeUint(src.queryId, 64); - b_0 = b_0.storeCoins(src.amount); - b_0 = b_0.storeAddress(src.owner); - b_0 = b_0.storeAddress(src.responseAddress); - return b_0.endCell(); -} - -export function packStackTokenBurnNotification(src: TokenBurnNotification, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.queryId }); - __stack.push({ type: 'int', value: src.amount }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() }); - if (src.responseAddress !== null) { - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() }); - } else { - __stack.push({ type: 'null' }); - } -} - -export function packTupleTokenBurnNotification(src: TokenBurnNotification): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.queryId }); - __stack.push({ type: 'int', value: src.amount }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() }); - if (src.responseAddress !== null) { - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() }); - } else { - __stack.push({ type: 'null' }); +export function storeTokenBurnNotification(src: TokenBurnNotification) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(2078119902, 32); + b_0.storeUint(src.queryId, 64); + b_0.storeCoins(src.amount); + b_0.storeAddress(src.owner); + if (src.responseAddress !== null && src.responseAddress !== undefined) { b_0.storeBit(true).storeAddress(src.responseAddress); } else { b_0.storeBit(false); } + }; +} + +export function loadTokenBurnNotification(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 2078119902) { throw Error('Invalid prefix'); } + let _queryId = sc_0.loadUintBig(64); + let _amount = sc_0.loadCoins(); + let _owner = sc_0.loadAddress(); + let _responseAddress = sc_0.loadBit() ? sc_0.loadAddress() : null; + return { $$type: 'TokenBurnNotification' as const, queryId: _queryId, amount: _amount, owner: _owner, responseAddress: _responseAddress }; +} + +function loadTupleTokenBurnNotification(source: TupleReader) { + let _queryId = source.readBigNumber(); + let _amount = source.readBigNumber(); + let _owner = source.readAddress(); + let _responseAddress = source.readAddressOpt(); + return { $$type: 'TokenBurnNotification' as const, queryId: _queryId, amount: _amount, owner: _owner, responseAddress: _responseAddress }; +} + +function storeTupleTokenBurnNotification(source: TokenBurnNotification) { + let builder = new TupleBuilder(); + builder.writeNumber(source.queryId); + builder.writeNumber(source.amount); + builder.writeAddress(source.owner); + builder.writeAddress(source.responseAddress); + return builder.build(); +} + +function dictValueParserTokenBurnNotification(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenBurnNotification(src)).endCell()); + }, + parse: (src) => { + return loadTokenBurnNotification(src.loadRef().beginParse()); + } } - return __stack; -} - -export function unpackStackTokenBurnNotification(slice: TupleSlice4): TokenBurnNotification { - const queryId = slice.readBigNumber(); - const amount = slice.readBigNumber(); - const owner = slice.readAddress(); - const responseAddress = slice.readAddressOpt(); - return { $$type: 'TokenBurnNotification', queryId: queryId, amount: amount, owner: owner, responseAddress: responseAddress }; -} -export function unpackTupleTokenBurnNotification(slice: TupleSlice4): TokenBurnNotification { - const queryId = slice.readBigNumber(); - const amount = slice.readBigNumber(); - const owner = slice.readAddress(); - const responseAddress = slice.readAddressOpt(); - return { $$type: 'TokenBurnNotification', queryId: queryId, amount: amount, owner: owner, responseAddress: responseAddress }; } export type TokenExcesses = { $$type: 'TokenExcesses'; - queryId: BN; + queryId: bigint; } -export function packTokenExcesses(src: TokenExcesses): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeUint(3576854235, 32); - b_0 = b_0.storeUint(src.queryId, 64); - return b_0.endCell(); +export function storeTokenExcesses(src: TokenExcesses) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(3576854235, 32); + b_0.storeUint(src.queryId, 64); + }; } -export function packStackTokenExcesses(src: TokenExcesses, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.queryId }); +export function loadTokenExcesses(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 3576854235) { throw Error('Invalid prefix'); } + let _queryId = sc_0.loadUintBig(64); + return { $$type: 'TokenExcesses' as const, queryId: _queryId }; } -export function packTupleTokenExcesses(src: TokenExcesses): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.queryId }); - return __stack; +function loadTupleTokenExcesses(source: TupleReader) { + let _queryId = source.readBigNumber(); + return { $$type: 'TokenExcesses' as const, queryId: _queryId }; } -export function unpackStackTokenExcesses(slice: TupleSlice4): TokenExcesses { - const queryId = slice.readBigNumber(); - return { $$type: 'TokenExcesses', queryId: queryId }; +function storeTupleTokenExcesses(source: TokenExcesses) { + let builder = new TupleBuilder(); + builder.writeNumber(source.queryId); + return builder.build(); } -export function unpackTupleTokenExcesses(slice: TupleSlice4): TokenExcesses { - const queryId = slice.readBigNumber(); - return { $$type: 'TokenExcesses', queryId: queryId }; + +function dictValueParserTokenExcesses(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenExcesses(src)).endCell()); + }, + parse: (src) => { + return loadTokenExcesses(src.loadRef().beginParse()); + } + } } export type TokenUpdateContent = { $$type: 'TokenUpdateContent'; content: Cell | null; } -export function packTokenUpdateContent(src: TokenUpdateContent): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeUint(1862840892, 32); - if (src.content !== null) { - b_0 = b_0.storeBit(true); - b_0 = b_0.storeRef(src.content); - } else { - b_0 = b_0.storeBit(false); - } - return b_0.endCell(); +export function storeTokenUpdateContent(src: TokenUpdateContent) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(201882270, 32); + if (src.content !== null && src.content !== undefined) { b_0.storeBit(true).storeRef(src.content); } else { b_0.storeBit(false); } + }; } -export function packStackTokenUpdateContent(src: TokenUpdateContent, __stack: StackItem[]) { - if (src.content !== null) { - __stack.push({ type: 'cell', cell: src.content }); - } else { - __stack.push({ type: 'null' }); - } +export function loadTokenUpdateContent(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 201882270) { throw Error('Invalid prefix'); } + let _content = sc_0.loadBit() ? sc_0.loadRef() : null; + return { $$type: 'TokenUpdateContent' as const, content: _content }; } -export function packTupleTokenUpdateContent(src: TokenUpdateContent): StackItem[] { - let __stack: StackItem[] = []; - if (src.content !== null) { - __stack.push({ type: 'cell', cell: src.content }); - } else { - __stack.push({ type: 'null' }); - } - return __stack; +function loadTupleTokenUpdateContent(source: TupleReader) { + let _content = source.readCellOpt(); + return { $$type: 'TokenUpdateContent' as const, content: _content }; } -export function unpackStackTokenUpdateContent(slice: TupleSlice4): TokenUpdateContent { - const content = slice.readCellOpt(); - return { $$type: 'TokenUpdateContent', content: content }; +function storeTupleTokenUpdateContent(source: TokenUpdateContent) { + let builder = new TupleBuilder(); + builder.writeCell(source.content); + return builder.build(); } -export function unpackTupleTokenUpdateContent(slice: TupleSlice4): TokenUpdateContent { - const content = slice.readCellOpt(); - return { $$type: 'TokenUpdateContent', content: content }; + +function dictValueParserTokenUpdateContent(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenUpdateContent(src)).endCell()); + }, + parse: (src) => { + return loadTokenUpdateContent(src.loadRef().beginParse()); + } + } } export type JettonData = { $$type: 'JettonData'; - totalSupply: BN; + totalSupply: bigint; mintable: boolean; owner: Address; content: Cell | null; walletCode: Cell; } -export function packJettonData(src: JettonData): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeInt(src.totalSupply, 257); - b_0 = b_0.storeBit(src.mintable); - b_0 = b_0.storeAddress(src.owner); - if (src.content !== null) { - b_0 = b_0.storeBit(true); - b_0 = b_0.storeRef(src.content); - } else { - b_0 = b_0.storeBit(false); - } - b_0 = b_0.storeRef(src.walletCode); - return b_0.endCell(); -} - -export function packStackJettonData(src: JettonData, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.totalSupply }); - __stack.push({ type: 'int', value: src.mintable ? new BN(-1) : new BN(0) }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() }); - if (src.content !== null) { - __stack.push({ type: 'cell', cell: src.content }); - } else { - __stack.push({ type: 'null' }); - } - __stack.push({ type: 'cell', cell: src.walletCode }); -} - -export function packTupleJettonData(src: JettonData): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.totalSupply }); - __stack.push({ type: 'int', value: src.mintable ? new BN(-1) : new BN(0) }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() }); - if (src.content !== null) { - __stack.push({ type: 'cell', cell: src.content }); - } else { - __stack.push({ type: 'null' }); +export function storeJettonData(src: JettonData) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeInt(src.totalSupply, 257); + b_0.storeBit(src.mintable); + b_0.storeAddress(src.owner); + if (src.content !== null && src.content !== undefined) { b_0.storeBit(true).storeRef(src.content); } else { b_0.storeBit(false); } + b_0.storeRef(src.walletCode); + }; +} + +export function loadJettonData(slice: Slice) { + let sc_0 = slice; + let _totalSupply = sc_0.loadIntBig(257); + let _mintable = sc_0.loadBit(); + let _owner = sc_0.loadAddress(); + let _content = sc_0.loadBit() ? sc_0.loadRef() : null; + let _walletCode = sc_0.loadRef(); + return { $$type: 'JettonData' as const, totalSupply: _totalSupply, mintable: _mintable, owner: _owner, content: _content, walletCode: _walletCode }; +} + +function loadTupleJettonData(source: TupleReader) { + let _totalSupply = source.readBigNumber(); + let _mintable = source.readBoolean(); + let _owner = source.readAddress(); + let _content = source.readCellOpt(); + let _walletCode = source.readCell(); + return { $$type: 'JettonData' as const, totalSupply: _totalSupply, mintable: _mintable, owner: _owner, content: _content, walletCode: _walletCode }; +} + +function storeTupleJettonData(source: JettonData) { + let builder = new TupleBuilder(); + builder.writeNumber(source.totalSupply); + builder.writeBoolean(source.mintable); + builder.writeAddress(source.owner); + builder.writeCell(source.content); + builder.writeCell(source.walletCode); + return builder.build(); +} + +function dictValueParserJettonData(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeJettonData(src)).endCell()); + }, + parse: (src) => { + return loadJettonData(src.loadRef().beginParse()); + } } - __stack.push({ type: 'cell', cell: src.walletCode }); - return __stack; -} - -export function unpackStackJettonData(slice: TupleSlice4): JettonData { - const totalSupply = slice.readBigNumber(); - const mintable = slice.readBoolean(); - const owner = slice.readAddress(); - const content = slice.readCellOpt(); - const walletCode = slice.readCell(); - return { $$type: 'JettonData', totalSupply: totalSupply, mintable: mintable, owner: owner, content: content, walletCode: walletCode }; -} -export function unpackTupleJettonData(slice: TupleSlice4): JettonData { - const totalSupply = slice.readBigNumber(); - const mintable = slice.readBoolean(); - const owner = slice.readAddress(); - const content = slice.readCellOpt(); - const walletCode = slice.readCell(); - return { $$type: 'JettonData', totalSupply: totalSupply, mintable: mintable, owner: owner, content: content, walletCode: walletCode }; } export type JettonWalletData = { $$type: 'JettonWalletData'; - balance: BN; + balance: bigint; owner: Address; master: Address; walletCode: Cell; } -export function packJettonWalletData(src: JettonWalletData): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeInt(src.balance, 257); - b_0 = b_0.storeAddress(src.owner); - b_0 = b_0.storeAddress(src.master); - b_0 = b_0.storeRef(src.walletCode); - return b_0.endCell(); -} - -export function packStackJettonWalletData(src: JettonWalletData, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.balance }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.master).endCell() }); - __stack.push({ type: 'cell', cell: src.walletCode }); -} - -export function packTupleJettonWalletData(src: JettonWalletData): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.balance }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.master).endCell() }); - __stack.push({ type: 'cell', cell: src.walletCode }); - return __stack; -} - -export function unpackStackJettonWalletData(slice: TupleSlice4): JettonWalletData { - const balance = slice.readBigNumber(); - const owner = slice.readAddress(); - const master = slice.readAddress(); - const walletCode = slice.readCell(); - return { $$type: 'JettonWalletData', balance: balance, owner: owner, master: master, walletCode: walletCode }; -} -export function unpackTupleJettonWalletData(slice: TupleSlice4): JettonWalletData { - const balance = slice.readBigNumber(); - const owner = slice.readAddress(); - const master = slice.readAddress(); - const walletCode = slice.readCell(); - return { $$type: 'JettonWalletData', balance: balance, owner: owner, master: master, walletCode: walletCode }; +export function storeJettonWalletData(src: JettonWalletData) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeInt(src.balance, 257); + b_0.storeAddress(src.owner); + b_0.storeAddress(src.master); + b_0.storeRef(src.walletCode); + }; +} + +export function loadJettonWalletData(slice: Slice) { + let sc_0 = slice; + let _balance = sc_0.loadIntBig(257); + let _owner = sc_0.loadAddress(); + let _master = sc_0.loadAddress(); + let _walletCode = sc_0.loadRef(); + return { $$type: 'JettonWalletData' as const, balance: _balance, owner: _owner, master: _master, walletCode: _walletCode }; +} + +function loadTupleJettonWalletData(source: TupleReader) { + let _balance = source.readBigNumber(); + let _owner = source.readAddress(); + let _master = source.readAddress(); + let _walletCode = source.readCell(); + return { $$type: 'JettonWalletData' as const, balance: _balance, owner: _owner, master: _master, walletCode: _walletCode }; +} + +function storeTupleJettonWalletData(source: JettonWalletData) { + let builder = new TupleBuilder(); + builder.writeNumber(source.balance); + builder.writeAddress(source.owner); + builder.writeAddress(source.master); + builder.writeCell(source.walletCode); + return builder.build(); +} + +function dictValueParserJettonWalletData(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeJettonWalletData(src)).endCell()); + }, + parse: (src) => { + return loadJettonWalletData(src.loadRef().beginParse()); + } + } } export type Mint = { $$type: 'Mint'; - amount: BN; + amount: bigint; } -export function packMint(src: Mint): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeUint(2737462367, 32); - b_0 = b_0.storeInt(src.amount, 257); - return b_0.endCell(); +export function storeMint(src: Mint) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(33240155, 32); + b_0.storeInt(src.amount, 257); + }; } -export function packStackMint(src: Mint, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.amount }); +export function loadMint(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 33240155) { throw Error('Invalid prefix'); } + let _amount = sc_0.loadIntBig(257); + return { $$type: 'Mint' as const, amount: _amount }; } -export function packTupleMint(src: Mint): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.amount }); - return __stack; +function loadTupleMint(source: TupleReader) { + let _amount = source.readBigNumber(); + return { $$type: 'Mint' as const, amount: _amount }; } -export function unpackStackMint(slice: TupleSlice4): Mint { - const amount = slice.readBigNumber(); - return { $$type: 'Mint', amount: amount }; +function storeTupleMint(source: Mint) { + let builder = new TupleBuilder(); + builder.writeNumber(source.amount); + return builder.build(); } -export function unpackTupleMint(slice: TupleSlice4): Mint { - const amount = slice.readBigNumber(); - return { $$type: 'Mint', amount: amount }; + +function dictValueParserMint(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeMint(src)).endCell()); + }, + parse: (src) => { + return loadMint(src.loadRef().beginParse()); + } + } } -export async function JettonDefaultWallet_init(master: Address, owner: Address) { - const __code = 'te6ccgECKQEABYcAART/APSkE/S88sgLAQIBYgIDAgLKBAUCASAlJgIBIAYHAgFIEhMCASAICQIB7hARAgFICgsAR7OQ4AOWAuYDlgLgA5YAJZmZk/IBkOQDlgLgA5YAJZQPl/+ToQT1RwIddJwh+VMCDXCx/eAtDTAwFxsMABkX+RcOIB+kAiUGZvBPhhAo4zMO1E0NQB+GKBAQHXAPpAAQH6QAFDMGwTVQLwKMj4QgHMVSBQI4EBAc8AAc8WAc8Wye1U4CCCEA+KfqW64wIgghAXjUUZuuMCghBZXwe8uuMCMIDA0ODwALQgbvLQgIAN4w7UTQ1AH4YoEBAdcA+kABAfpAAUMwbBMD0x8BghAPin6luvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeJtAtIAAZRsEtQS3voAUWYWFURANxCJEHhVBfAlyPhCAcxVIFAjgQEBzwABzxYBzxbJ7VQAyjDtRNDUAfhigQEB1wD6QAEB+kABQzBsEwPTHwGCEBeNRRm68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4gH6AFFVFRRDMDYQeBBnVQTwJsj4QgHMVSBQI4EBAc8AAc8WAc8Wye1UALztRNDUAfhigQEB1wD6QAEB+kABQzBsEwPTHwGCEFlfB7y68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4hRDMDQQVhBFVQLwJ8j4QgHMVSBQI4EBAc8AAc8WAc8Wye1UAAbywIIAFSUfwHKAOBwAcoAgAAkcFnwCYAIBIBQVAE/cAQa5Dpj+mfmP0AGECaqRFBCAvGoozdAcEIPe7L710J2Il5egnQAUAgEgFhcCASAdHgIBIBgZAgEgGxwB9zIcQHKAVAH8B5wAcoCUAXPFlAD+gJwAcpoI26zJW6zsY49f/AeyHDwHnDwHiRus5l/8B4E8AJQBMyVNANw8B7iJG6zmX/wHgTwAlAEzJU0A3DwHuJw8B4Cf/AeAslYzJYzMwFw8B7iIW6zmH/wHgHwAgHMlDFw8B7iyQGAaACUbDH6ADFx1yH6ADH6ADCnA6sAgAAT7AAApHADyMxDE1AjgQEBzwABzxYBzxbJgAG8AtD0BDAgggDYrwGAEPQPb6Hy4GRtAoIA2K8BgBD0D2+h8uBkEoIA2K8BAoAQ9BfI9ADJQAPwIoAIBIB8gAgEgIiMADz4QlMS8CMwgAacbCL4QW8kgRFNUzvHBfL0UbehggD1/CHC//L0QzBSPPAhcSTCAJIwct6BPrsCqIIJMS0AoIIImJaAoBK88vT4QlQgZPAjXPAff1B2cIBAK1RMORiAhAGTIVVCCEBeNRRlQB8sfFcs/UAP6AgHPFgEgbpUwcAHLAZLPFuIB+gIBzxbJEFYQNFnwIAHvPhBbyRTKscFs44S+EJTuPAjAYERTQLwHyTHBfL03lHIoIIA9fwhwv/y9CH4J28QIaGCCJiWgGa2CKGCCJiWgKChJsIAlhB9UIlfCOMNJW6zIsIAsI4dcAbwAnAEyAGCENUydttYyx/LP8kQR0MwF21t8CCSNVvigJADTFv4QW8kgRFNUzjHBfL0UYShggD1/CHC//L0QzBSOfAhgT67AYIJMS0AoIIImJaAoBK88vR/cAOAQFQzZshVMIIQe92X3lAFyx8Tyz8B+gIBzxYBIG6VMHABywGSzxbiyVQTBFAzbW3wIIAByUE1DMPAhUjCgGqFwcChIE1B0yFUwghBzYtCcUAXLHxPLPwH6AgHPFgHPFskoEEZDE1BVbW3wIFAFADe/2BdqJoagD8MUCAgOuAfSAAgP0gAKGYNgn4EkAgJzJygACazx+BFAAHGt6ME4LnYerpZXPY9CdhzrJUKNs0E4TusalpWyPlmRadeW/vixHME4TujwAfLZsB5P5B1ZLNZRCcA='; - const depends = new Map(); - depends.set('55471', Cell.fromBoc(Buffer.from('te6ccgECKQEABYcAART/APSkE/S88sgLAQIBYgIDAgLKBAUCASAlJgIBIAYHAgFIEhMCASAICQIB7hARAgFICgsAR7OQ4AOWAuYDlgLgA5YAJZmZk/IBkOQDlgLgA5YAJZQPl/+ToQT1RwIddJwh+VMCDXCx/eAtDTAwFxsMABkX+RcOIB+kAiUGZvBPhhAo4zMO1E0NQB+GKBAQHXAPpAAQH6QAFDMGwTVQLwKMj4QgHMVSBQI4EBAc8AAc8WAc8Wye1U4CCCEA+KfqW64wIgghAXjUUZuuMCghBZXwe8uuMCMIDA0ODwALQgbvLQgIAN4w7UTQ1AH4YoEBAdcA+kABAfpAAUMwbBMD0x8BghAPin6luvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeJtAtIAAZRsEtQS3voAUWYWFURANxCJEHhVBfAlyPhCAcxVIFAjgQEBzwABzxYBzxbJ7VQAyjDtRNDUAfhigQEB1wD6QAEB+kABQzBsEwPTHwGCEBeNRRm68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4gH6AFFVFRRDMDYQeBBnVQTwJsj4QgHMVSBQI4EBAc8AAc8WAc8Wye1UALztRNDUAfhigQEB1wD6QAEB+kABQzBsEwPTHwGCEFlfB7y68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4hRDMDQQVhBFVQLwJ8j4QgHMVSBQI4EBAc8AAc8WAc8Wye1UAAbywIIAFSUfwHKAOBwAcoAgAAkcFnwCYAIBIBQVAE/cAQa5Dpj+mfmP0AGECaqRFBCAvGoozdAcEIPe7L710J2Il5egnQAUAgEgFhcCASAdHgIBIBgZAgEgGxwB9zIcQHKAVAH8B5wAcoCUAXPFlAD+gJwAcpoI26zJW6zsY49f/AeyHDwHnDwHiRus5l/8B4E8AJQBMyVNANw8B7iJG6zmX/wHgTwAlAEzJU0A3DwHuJw8B4Cf/AeAslYzJYzMwFw8B7iIW6zmH/wHgHwAgHMlDFw8B7iyQGAaACUbDH6ADFx1yH6ADH6ADCnA6sAgAAT7AAApHADyMxDE1AjgQEBzwABzxYBzxbJgAG8AtD0BDAgggDYrwGAEPQPb6Hy4GRtAoIA2K8BgBD0D2+h8uBkEoIA2K8BAoAQ9BfI9ADJQAPwIoAIBIB8gAgEgIiMADz4QlMS8CMwgAacbCL4QW8kgRFNUzvHBfL0UbehggD1/CHC//L0QzBSPPAhcSTCAJIwct6BPrsCqIIJMS0AoIIImJaAoBK88vT4QlQgZPAjXPAff1B2cIBAK1RMORiAhAGTIVVCCEBeNRRlQB8sfFcs/UAP6AgHPFgEgbpUwcAHLAZLPFuIB+gIBzxbJEFYQNFnwIAHvPhBbyRTKscFs44S+EJTuPAjAYERTQLwHyTHBfL03lHIoIIA9fwhwv/y9CH4J28QIaGCCJiWgGa2CKGCCJiWgKChJsIAlhB9UIlfCOMNJW6zIsIAsI4dcAbwAnAEyAGCENUydttYyx/LP8kQR0MwF21t8CCSNVvigJADTFv4QW8kgRFNUzjHBfL0UYShggD1/CHC//L0QzBSOfAhgT67AYIJMS0AoIIImJaAoBK88vR/cAOAQFQzZshVMIIQe92X3lAFyx8Tyz8B+gIBzxYBIG6VMHABywGSzxbiyVQTBFAzbW3wIIAByUE1DMPAhUjCgGqFwcChIE1B0yFUwghBzYtCcUAXLHxPLPwH6AgHPFgHPFskoEEZDE1BVbW3wIFAFADe/2BdqJoagD8MUCAgOuAfSAAgP0gAKGYNgn4EkAgJzJygACazx+BFAAHGt6ME4LnYerpZXPY9CdhzrJUKNs0E4TusalpWyPlmRadeW/vixHME4TujwAfLZsB5P5B1ZLNZRCcA=', 'base64'))[0]); - let systemCell = beginCell().storeDict(serializeDict(depends, 16, (src, v) => v.refs.push(src))).endCell(); - let __stack: StackItem[] = []; - __stack.push({ type: 'cell', cell: systemCell }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(master).endCell() }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(owner).endCell() }); +async function JettonDefaultWallet_init(master: Address, owner: Address) { + const __init = 'te6ccgEBBwEAPQABFP8A9KQT9LzyyAsBAgFiAgMCAs0EBQAJoUrd4AkAAdQBE9OAHkZiGJ7Z5kwGABpQI4EBAc8AAc8WAc8W'; + const __code = 'te6ccgECNAEABR0AART/APSkE/S88sgLAQIBYgIDAgLKBgcCASAEBQERv9gW2eeBN4D0EQBxvd6ME4LnYerpZXPY9CdhzrJUKNs0E4TusalpWyPlmRadeW/vixHME4TujwAfLZsB5P5B1ZLNZRCcAgEgCAkCAUgVFgIBYgoLAAOnQASJRwIddJwh+VMCDXCx/eAtDTAwFxsMABkX+RcOIB+kAiUGZvBPhhAo8JMNs8VQLwKts84CCCEA+KfqW64wIgghAXjUUZuoERMMDQALQgbvLQgIAyIw2zwD2zw3EIkQeFUF8CfbPBEOEwQ2j5Ew2zwD2zw2EHgQZ1UE8CjbPOCCEFlfB7y6EQ8TEABs0x8BghAPin6luvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIB0gABkdSSbQHi+gBRZhYVFEMwAFjTHwGCEBeNRRm68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4gH6AFFVFRRDMAMuj5DbPAPbPDQQVhBFVQLwKds84DDywIIREhMBFu1E0NQB+GLbPGwTFABM0x8BghBZXwe8uvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIUQzABGMj4QgHMVSDbPMntVCMAHIEBAdcA+kABAfpAAUMwAgEgFxgCAUgoKQIBIBkaAgEgHyAAS1cFnIcAHLAXMBywFwAcsAEszMyfkAyHIBywFwAcsAEsoHy//J0IAgEgGxwC9zIcQHKAVAHAcoAcAHKAlAFzxZQA/oCcAHKaCNusyVus7GORn8BygDIcAHKAHABygAkbrOafwHKAATwAlAEzJY0A3ABygDiJG6zmn8BygAE8AJQBMyWNANwAcoA4nABygACfwHKAALJWMyXMzMBcAHKAOIhbrPjD8kB+wCAdHgAlGwx+gAxcdch+gAx+gAwpwOrAIAASfwHKAAHwAgHMAAoxcAHKAAIBICEiAgEgJCUBExwA8jMQxPbPMmAjAFEAtD0BDBtAYIA2K8BgBD0D2+h8uCHAYIA2K8iAoAQ9BfI9ADJQAPwJIAAaUCOBAQHPAAHPFgHPFgAPPhCUxLwJTCABuRsIvhBbySBEU1TO8cF8vRRt6GCAPX8IcL/8vRDMFI88CNxJMIAkjBy3oE+uwKoggkxLQCgggiYloCgErzy9PhCVCBk8CVc8CF/UHZwgEArVEw5GNs8EFYQNFnwIoCYBDMhVUNs8yScAToIQF41FGVAHyx8Vyz9QA/oCAc8WASBulTBwAcsBks8W4gH6AgHPFgIBICorAE9IAg1yHTH9M/MfoAMIE1UiKCEBeNRRm6A4IQe92X3roTsRLy9BOgAoA/E+EFvJFMqxwWzjhL4QlO48CUBgRFNAvAhJMcF8vTeUcigggD1/CHC//L0IfgnbxAhoYIImJaAZrYIoYIImJaAoKEmwgCOoVBNQzDwI1IwoBqhcHAoSBNQdNs8KBBGQxNQVW1t8CJQBZYQfVCJXwjiJW6zIsIAsOMPgLC0uAY8W/hBbySBEU1TOMcF8vRRhKGCAPX8IcL/8vRDMFI58COBPrsBggkxLQCgggiYloCgErzy9H9wA4BAVDNm2zxUEwRQM21t8CKAyAQzIVTDbPMkvASJwBvACcATbPBBHQzAXbW3wIjAABDVbACyCEHNi0JxQBcsfE8s/AfoCAc8WAc8WAQrIAds8yTEAFoIQ1TJ221jLH8s/AQzIVTDbPMkzAECCEHvdl95QBcsfE8s/AfoCAc8WASBulTBwAcsBks8W4g=='; + const __system = 'te6cckECNgEABScAAQHAAQEFobFfAgEU/wD0pBP0vPLICwMCAWIHBAIBIAYFAHG93owTgudh6ullc9j0J2HOslQo2zQThO6xqWlbI+WZFp15b++LEcwThO6PAB8tmwHk/kHVks1lEJwBEb/YFtnngTeA9DQCAsonCAIBSBYJAgFICwoAT0gCDXIdMf0z8x+gAwgTVSIoIQF41FGboDghB73ZfeuhOxEvL0E6ACgCASAPDAGPFv4QW8kgRFNUzjHBfL0UYShggD1/CHC//L0QzBSOfAjgT67AYIJMS0AoIIImJaAoBK88vR/cAOAQFQzZts8VBMEUDNtbfAigDQEMyFUw2zzJDgBAghB73ZfeUAXLHxPLPwH6AgHPFgEgbpUwcAHLAZLPFuID8T4QW8kUyrHBbOOEvhCU7jwJQGBEU0C8CEkxwXy9N5RyKCCAPX8IcL/8vQh+CdvECGhggiYloBmtgihggiYloCgoSbCAI6hUE1DMPAjUjCgGqFwcChIE1B02zwoEEZDE1BVbW3wIlAFlhB9UIlfCOIlbrMiwgCw4w+AUERAABDVbASJwBvACcATbPBBHQzAXbW3wIhIBCsgB2zzJEwAWghDVMnbbWMsfyz8BDMhVMNs8yRUALIIQc2LQnFAFyx8Tyz8B+gIBzxYBzxYCASAgFwIBIB0YAgEgHBkBuRsIvhBbySBEU1TO8cF8vRRt6GCAPX8IcL/8vRDMFI88CNxJMIAkjBy3oE+uwKoggkxLQCgggiYloCgErzy9PhCVCBk8CVc8CF/UHZwgEArVEw5GNs8EFYQNFnwIoBoBDMhVUNs8yRsAToIQF41FGVAHyx8Vyz9QA/oCAc8WASBulTBwAcsBks8W4gH6AgHPFgAPPhCUxLwJTCACASAfHgBRALQ9AQwbQGCANivAYAQ9A9vofLghwGCANivIgKAEPQXyPQAyUAD8CSABExwA8jMQxPbPMmAzAgEgJiECASAjIgAlGwx+gAxcdch+gAx+gAwpwOrAIAL3MhxAcoBUAcBygBwAcoCUAXPFlAD+gJwAcpoI26zJW6zsY5GfwHKAMhwAcoAcAHKACRus5p/AcoABPACUATMljQDcAHKAOIkbrOafwHKAATwAlAEzJY0A3ABygDicAHKAAJ/AcoAAslYzJczMwFwAcoA4iFus+MPyQH7AICUkAAoxcAHKAAASfwHKAAHwAgHMAEtXBZyHABywFzAcsBcAHLABLMzMn5AMhyAcsBcAHLABLKB8v/ydCAIBICkoAAOnQAIBYisqAAtCBu8tCAgEiUcCHXScIflTAg1wsf3gLQ0wMBcbDAAZF/kXDiAfpAIlBmbwT4YQKPCTDbPFUC8CrbPOAgghAPin6luuMCIIIQF41FGbqDQyMCwENo+RMNs8A9s8NhB4EGdVBPAo2zzgghBZXwe8ujQvMi0DLo+Q2zwD2zw0EFYQRVUC8CnbPOAw8sCCNC4yAEzTHwGCEFlfB7y68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4hRDMABY0x8BghAXjUUZuvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIB+gBRVRUUQzADIjDbPAPbPDcQiRB4VQXwJ9s8NDEyAGzTHwGCEA+KfqW68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4gHSAAGR1JJtAeL6AFFmFhUUQzABGMj4QgHMVSDbPMntVDMAGlAjgQEBzwABzxYBzxYBFu1E0NQB+GLbPGwTNQAcgQEB1wD6QAEB+kABQzCZZpMs'; + let systemCell = Cell.fromBase64(__system); + let builder = new TupleBuilder(); + builder.writeCell(systemCell); + builder.writeAddress(master); + builder.writeAddress(owner); + let __stack = builder.build(); let codeCell = Cell.fromBoc(Buffer.from(__code, 'base64'))[0]; - let executor = await createExecutorFromCode({ code: codeCell, data: new Cell() }); - let res = await executor.get('init_JettonDefaultWallet', __stack, { debug: true }); - if (res.debugLogs.length > 0) { console.warn(res.debugLogs); } + let initCell = Cell.fromBoc(Buffer.from(__init, 'base64'))[0]; + let system = await ContractSystem.create(); + let executor = await ContractExecutor.create({ code: initCell, data: new Cell() }, system); + let res = await executor.get('init', __stack); + if (!res.success) { throw Error(res.error); } + if (res.exitCode !== 0 && res.exitCode !== 1) { + if (JettonDefaultWallet_errors[res.exitCode]) { + throw new ComputeError(JettonDefaultWallet_errors[res.exitCode].message, res.exitCode, { logs: res.vmLogs }); + } else { + throw new ComputeError('Exit code: ' + res.exitCode, res.exitCode, { logs: res.vmLogs }); + } + } + let data = res.stack.readCell(); return { code: codeCell, data }; } -export const JettonDefaultWallet_errors: { [key: string]: string } = { - '2': `Stack undeflow`, - '3': `Stack overflow`, - '4': `Integer overflow`, - '5': `Integer out of expected range`, - '6': `Invalid opcode`, - '7': `Type check error`, - '8': `Cell overflow`, - '9': `Cell underflow`, - '10': `Dictionary error`, - '13': `Out of gas error`, - '32': `Method ID not found`, - '34': `Action is invalid or not supported`, - '37': `Not enough TON`, - '38': `Not enough extra-currencies`, - '128': `Null reference exception`, - '129': `Invalid serialization prefix`, - '130': `Invalid incoming message`, - '131': `Constraints error`, - '132': `Access denied`, - '133': `Contract stopped`, - '134': `Invalid argument`, - '4429': `Invalid sender`, - '13650': `Invalid bounced message`, - '16059': `Invalid value`, - '62972': `Invalid balance`, -} - -export class JettonDefaultWallet { - readonly executor: ContractExecutor; - constructor(executor: ContractExecutor) { this.executor = executor; } +const JettonDefaultWallet_errors: { [key: number]: { message: string } } = { + 2: { message: `Stack undeflow` }, + 3: { message: `Stack overflow` }, + 4: { message: `Integer overflow` }, + 5: { message: `Integer out of expected range` }, + 6: { message: `Invalid opcode` }, + 7: { message: `Type check error` }, + 8: { message: `Cell overflow` }, + 9: { message: `Cell underflow` }, + 10: { message: `Dictionary error` }, + 13: { message: `Out of gas error` }, + 32: { message: `Method ID not found` }, + 34: { message: `Action is invalid or not supported` }, + 37: { message: `Not enough TON` }, + 38: { message: `Not enough extra-currencies` }, + 128: { message: `Null reference exception` }, + 129: { message: `Invalid serialization prefix` }, + 130: { message: `Invalid incoming message` }, + 131: { message: `Constraints error` }, + 132: { message: `Access denied` }, + 133: { message: `Contract stopped` }, + 134: { message: `Invalid argument` }, + 135: { message: `Code of a contract was not found` }, + 136: { message: `Invalid address` }, + 4429: { message: `Invalid sender` }, + 13650: { message: `Invalid bounced message` }, + 16059: { message: `Invalid value` }, + 62972: { message: `Invalid balance` }, +} + +export class JettonDefaultWallet implements Contract { + + static async init(master: Address, owner: Address) { + return await JettonDefaultWallet_init(master,owner); + } + + static async fromInit(master: Address, owner: Address) { + const init = await JettonDefaultWallet_init(master,owner); + const address = contractAddress(0, init); + return new JettonDefaultWallet(address, init); + } + + static fromAddress(address: Address) { + return new JettonDefaultWallet(address); + } + + readonly address: Address; + readonly init?: { code: Cell, data: Cell }; + readonly abi: ContractABI = { + errors: JettonDefaultWallet_errors + }; - async send(args: { amount: BN, from?: Address, debug?: boolean }, message: TokenTransfer | TokenTransferInternal | TokenBurn) { + private constructor(address: Address, init?: { code: Cell, data: Cell }) { + this.address = address; + this.init = init; + } + + async send(provider: ContractProvider, via: Sender, args: { value: bigint, bounce?: boolean| null | undefined }, message: TokenTransfer | TokenTransferInternal | TokenBurn) { + let body: Cell | null = null; if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'TokenTransfer') { - body = packTokenTransfer(message); + body = beginCell().store(storeTokenTransfer(message)).endCell(); } if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'TokenTransferInternal') { - body = packTokenTransferInternal(message); + body = beginCell().store(storeTokenTransferInternal(message)).endCell(); } if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'TokenBurn') { - body = packTokenBurn(message); + body = beginCell().store(storeTokenBurn(message)).endCell(); } if (body === null) { throw new Error('Invalid message type'); } - try { - let r = await this.executor.internal(new InternalMessage({ - to: this.executor.address, - from: args.from || this.executor.address, - bounce: false, - value: args.amount, - body: new CommonMessageInfo({ - body: new CellMessage(body!) - }) - }), { debug: args.debug }); - if (r.debugLogs.length > 0) { console.warn(r.debugLogs); } - } catch (e) { - if (e instanceof ExecuteError) { - if (e.debugLogs.length > 0) { console.warn(e.debugLogs); } - if (JettonDefaultWallet_errors[e.exitCode.toString()]) { - throw new Error(JettonDefaultWallet_errors[e.exitCode.toString()]); - } - } - throw e; - } + + await provider.internal(via, { ...args, body: body }); + } - async getGetWalletData() { - try { - let __stack: StackItem[] = []; - let result = await this.executor.get('get_wallet_data', __stack, { debug: true }); - if (result.debugLogs.length > 0) { console.warn(result.debugLogs); } - return unpackStackJettonWalletData(result.stack); - } catch (e) { - if (e instanceof ExecuteError) { - if (e.debugLogs.length > 0) { console.warn(e.debugLogs); } - if (JettonDefaultWallet_errors[e.exitCode.toString()]) { - throw new Error(JettonDefaultWallet_errors[e.exitCode.toString()]); - } - } - throw e; - } + + async getGetWalletData(provider: ContractProvider) { + let builder = new TupleBuilder(); + let source = (await provider.get('get_wallet_data', builder.build())).stack; + const result = loadTupleJettonWalletData(source); + return result; } + } \ No newline at end of file diff --git a/sources/output/jetton_SampleJetton.abi b/sources/output/jetton_SampleJetton.abi index 343c294..3098a27 100644 --- a/sources/output/jetton_SampleJetton.abi +++ b/sources/output/jetton_SampleJetton.abi @@ -1,1328 +1 @@ -{ - "version": "0.0.1", - "name": "SampleJetton", - "structs": [ - { - "name": "StateInit", - "header": 0, - "fields": [ - { - "name": "code", - "type": { - "kind": "ref", - "name": "Cell", - "optional": false - } - }, - { - "name": "data", - "type": { - "kind": "ref", - "name": "Cell", - "optional": false - } - } - ], - "allocation": { - "prefix": null, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "cell" - }, - { - "index": 1, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "cell" - } - ], - "next": null, - "size": { - "bits": 0, - "refs": 2 - } - } - } - }, - { - "name": "Context", - "header": 0, - "fields": [ - { - "name": "bounced", - "type": { - "kind": "ref", - "name": "Bool", - "optional": false - } - }, - { - "name": "sender", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "value", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "raw", - "type": { - "kind": "ref", - "name": "Slice", - "optional": false - } - } - ], - "allocation": { - "prefix": null, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 1, - "refs": 0 - }, - "kind": "int", - "bits": 1 - }, - { - "index": 1, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - }, - { - "index": 2, - "size": { - "bits": 257, - "refs": 0 - }, - "kind": "int", - "bits": 257 - }, - { - "index": 3, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "slice" - } - ], - "next": null, - "size": { - "bits": 525, - "refs": 1 - } - } - } - }, - { - "name": "SendParameters", - "header": 0, - "fields": [ - { - "name": "bounce", - "type": { - "kind": "ref", - "name": "Bool", - "optional": false - } - }, - { - "name": "to", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "value", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "mode", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "body", - "type": { - "kind": "ref", - "name": "Cell", - "optional": true - } - }, - { - "name": "code", - "type": { - "kind": "ref", - "name": "Cell", - "optional": true - } - }, - { - "name": "data", - "type": { - "kind": "ref", - "name": "Cell", - "optional": true - } - } - ], - "allocation": { - "prefix": null, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 1, - "refs": 0 - }, - "kind": "int", - "bits": 1 - }, - { - "index": 1, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - }, - { - "index": 2, - "size": { - "bits": 257, - "refs": 0 - }, - "kind": "int", - "bits": 257 - }, - { - "index": 3, - "size": { - "bits": 257, - "refs": 0 - }, - "kind": "int", - "bits": 257 - }, - { - "index": 4, - "size": { - "bits": 1, - "refs": 1 - }, - "kind": "optional", - "inner": { - "index": 4, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "cell" - } - }, - { - "index": 5, - "size": { - "bits": 1, - "refs": 1 - }, - "kind": "optional", - "inner": { - "index": 5, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "cell" - } - }, - { - "index": 6, - "size": { - "bits": 1, - "refs": 1 - }, - "kind": "optional", - "inner": { - "index": 6, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "cell" - } - } - ], - "next": null, - "size": { - "bits": 785, - "refs": 3 - } - } - } - }, - { - "name": "ChangeOwner", - "header": 0, - "fields": [ - { - "name": "newOwner", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - } - ], - "allocation": { - "prefix": 3067051791, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - } - ], - "next": null, - "size": { - "bits": 267, - "refs": 0 - } - } - } - }, - { - "name": "TokenTransfer", - "header": 0, - "fields": [ - { - "name": "queryId", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "amount", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "destination", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "responseDestination", - "type": { - "kind": "ref", - "name": "Address", - "optional": true - } - }, - { - "name": "customPayload", - "type": { - "kind": "ref", - "name": "Cell", - "optional": true - } - }, - { - "name": "forwardTonAmount", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "forwardPayload", - "type": { - "kind": "ref", - "name": "Slice", - "optional": false - } - } - ], - "allocation": { - "prefix": 260734629, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 64, - "refs": 0 - }, - "kind": "uint", - "bits": 64 - }, - { - "index": 1, - "size": { - "bits": 124, - "refs": 0 - }, - "kind": "coins" - }, - { - "index": 2, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - }, - { - "index": 3, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "optional", - "inner": { - "index": 3, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - } - }, - { - "index": 4, - "size": { - "bits": 1, - "refs": 1 - }, - "kind": "optional", - "inner": { - "index": 4, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "cell" - } - }, - { - "index": 5, - "size": { - "bits": 124, - "refs": 0 - }, - "kind": "coins" - }, - { - "index": 6, - "size": { - "bits": 0, - "refs": 0 - }, - "kind": "remaining" - } - ], - "next": null, - "size": { - "bits": 847, - "refs": 1 - } - } - } - }, - { - "name": "TokenTransferInternal", - "header": 0, - "fields": [ - { - "name": "queryId", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "amount", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "from", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "responseAddress", - "type": { - "kind": "ref", - "name": "Address", - "optional": true - } - }, - { - "name": "forwardTonAmount", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "forwardPayload", - "type": { - "kind": "ref", - "name": "Slice", - "optional": false - } - } - ], - "allocation": { - "prefix": 395134233, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 64, - "refs": 0 - }, - "kind": "uint", - "bits": 64 - }, - { - "index": 1, - "size": { - "bits": 124, - "refs": 0 - }, - "kind": "coins" - }, - { - "index": 2, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - }, - { - "index": 3, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "optional", - "inner": { - "index": 3, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - } - }, - { - "index": 4, - "size": { - "bits": 124, - "refs": 0 - }, - "kind": "coins" - }, - { - "index": 5, - "size": { - "bits": 0, - "refs": 0 - }, - "kind": "remaining" - } - ], - "next": null, - "size": { - "bits": 846, - "refs": 0 - } - } - } - }, - { - "name": "TokenNotification", - "header": 0, - "fields": [ - { - "name": "queryId", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "amount", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "from", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "forwardPayload", - "type": { - "kind": "ref", - "name": "Slice", - "optional": false - } - } - ], - "allocation": { - "prefix": 1935855772, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 64, - "refs": 0 - }, - "kind": "uint", - "bits": 64 - }, - { - "index": 1, - "size": { - "bits": 124, - "refs": 0 - }, - "kind": "coins" - }, - { - "index": 2, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - }, - { - "index": 3, - "size": { - "bits": 0, - "refs": 0 - }, - "kind": "remaining" - } - ], - "next": null, - "size": { - "bits": 455, - "refs": 0 - } - } - } - }, - { - "name": "TokenBurn", - "header": 0, - "fields": [ - { - "name": "queryId", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "amount", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "owner", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "responseAddress", - "type": { - "kind": "ref", - "name": "Address", - "optional": true - } - } - ], - "allocation": { - "prefix": 1499400124, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 64, - "refs": 0 - }, - "kind": "uint", - "bits": 64 - }, - { - "index": 1, - "size": { - "bits": 124, - "refs": 0 - }, - "kind": "coins" - }, - { - "index": 2, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - }, - { - "index": 3, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "optional", - "inner": { - "index": 3, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - } - } - ], - "next": null, - "size": { - "bits": 722, - "refs": 0 - } - } - } - }, - { - "name": "TokenBurnNotification", - "header": 0, - "fields": [ - { - "name": "queryId", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "amount", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "owner", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "responseAddress", - "type": { - "kind": "ref", - "name": "Address", - "optional": true - } - } - ], - "allocation": { - "prefix": 2078119902, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 64, - "refs": 0 - }, - "kind": "uint", - "bits": 64 - }, - { - "index": 1, - "size": { - "bits": 124, - "refs": 0 - }, - "kind": "coins" - }, - { - "index": 2, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - }, - { - "index": 3, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "optional", - "inner": { - "index": 3, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - } - } - ], - "next": null, - "size": { - "bits": 722, - "refs": 0 - } - } - } - }, - { - "name": "TokenExcesses", - "header": 0, - "fields": [ - { - "name": "queryId", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - } - ], - "allocation": { - "prefix": 3576854235, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 64, - "refs": 0 - }, - "kind": "uint", - "bits": 64 - } - ], - "next": null, - "size": { - "bits": 64, - "refs": 0 - } - } - } - }, - { - "name": "TokenUpdateContent", - "header": 0, - "fields": [ - { - "name": "content", - "type": { - "kind": "ref", - "name": "Cell", - "optional": true - } - } - ], - "allocation": { - "prefix": 1862840892, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 1, - "refs": 1 - }, - "kind": "optional", - "inner": { - "index": 0, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "cell" - } - } - ], - "next": null, - "size": { - "bits": 1, - "refs": 1 - } - } - } - }, - { - "name": "JettonData", - "header": 0, - "fields": [ - { - "name": "totalSupply", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "mintable", - "type": { - "kind": "ref", - "name": "Bool", - "optional": false - } - }, - { - "name": "owner", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "content", - "type": { - "kind": "ref", - "name": "Cell", - "optional": true - } - }, - { - "name": "walletCode", - "type": { - "kind": "ref", - "name": "Cell", - "optional": false - } - } - ], - "allocation": { - "prefix": null, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 257, - "refs": 0 - }, - "kind": "int", - "bits": 257 - }, - { - "index": 1, - "size": { - "bits": 1, - "refs": 0 - }, - "kind": "int", - "bits": 1 - }, - { - "index": 2, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - }, - { - "index": 3, - "size": { - "bits": 1, - "refs": 1 - }, - "kind": "optional", - "inner": { - "index": 3, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "cell" - } - }, - { - "index": 4, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "cell" - } - ], - "next": null, - "size": { - "bits": 526, - "refs": 2 - } - } - } - }, - { - "name": "JettonWalletData", - "header": 0, - "fields": [ - { - "name": "balance", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - }, - { - "name": "owner", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "master", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "walletCode", - "type": { - "kind": "ref", - "name": "Cell", - "optional": false - } - } - ], - "allocation": { - "prefix": null, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 257, - "refs": 0 - }, - "kind": "int", - "bits": 257 - }, - { - "index": 1, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - }, - { - "index": 2, - "size": { - "bits": 267, - "refs": 0 - }, - "kind": "address" - }, - { - "index": 3, - "size": { - "bits": 0, - "refs": 1 - }, - "kind": "cell" - } - ], - "next": null, - "size": { - "bits": 791, - "refs": 1 - } - } - } - }, - { - "name": "Mint", - "header": 0, - "fields": [ - { - "name": "amount", - "type": { - "kind": "ref", - "name": "Int", - "optional": false - } - } - ], - "allocation": { - "prefix": 2737462367, - "root": { - "fields": [ - { - "index": 0, - "size": { - "bits": 257, - "refs": 0 - }, - "kind": "int", - "bits": 257 - } - ], - "next": null, - "size": { - "bits": 257, - "refs": 0 - } - } - } - } - ], - "init": { - "name": "init_SampleJetton", - "args": [ - { - "name": "owner", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "content", - "type": { - "kind": "ref", - "name": "Cell", - "optional": true - } - } - ] - }, - "receivers": [ - { - "kind": "internal-binary", - "type": "Mint" - }, - { - "kind": "internal-comment", - "comment": "Mint!" - }, - { - "kind": "internal-binary", - "type": "TokenUpdateContent" - }, - { - "kind": "internal-binary", - "type": "TokenBurnNotification" - } - ], - "getters": [ - { - "name": "get_wallet_address", - "args": [ - { - "name": "owner", - "type": { - "kind": "ref", - "name": "Address", - "optional": false - } - } - ], - "returns": { - "kind": "ref", - "name": "Address", - "optional": false - } - }, - { - "name": "get_jetton_data", - "args": [], - "returns": { - "kind": "ref", - "name": "JettonData", - "optional": false - } - }, - { - "name": "owner", - "args": [], - "returns": { - "kind": "ref", - "name": "Address", - "optional": false - } - } - ], - "dependsOn": { - "JettonDefaultWallet": { - "uid": 55471 - } - }, - "errors": { - "2": { - "message": "Stack undeflow" - }, - "3": { - "message": "Stack overflow" - }, - "4": { - "message": "Integer overflow" - }, - "5": { - "message": "Integer out of expected range" - }, - "6": { - "message": "Invalid opcode" - }, - "7": { - "message": "Type check error" - }, - "8": { - "message": "Cell overflow" - }, - "9": { - "message": "Cell underflow" - }, - "10": { - "message": "Dictionary error" - }, - "13": { - "message": "Out of gas error" - }, - "32": { - "message": "Method ID not found" - }, - "34": { - "message": "Action is invalid or not supported" - }, - "37": { - "message": "Not enough TON" - }, - "38": { - "message": "Not enough extra-currencies" - }, - "128": { - "message": "Null reference exception" - }, - "129": { - "message": "Invalid serialization prefix" - }, - "130": { - "message": "Invalid incoming message" - }, - "131": { - "message": "Constraints error" - }, - "132": { - "message": "Access denied" - }, - "133": { - "message": "Contract stopped" - }, - "134": { - "message": "Invalid argument" - }, - "4429": { - "message": "Invalid sender" - }, - "13650": { - "message": "Invalid bounced message" - }, - "16059": { - "message": "Invalid value" - }, - "62972": { - "message": "Invalid balance" - } - } -} \ No newline at end of file +{"name":"SampleJetton","types":[{"name":"StateInit","header":null,"fields":[{"name":"code","type":{"kind":"simple","type":"cell","optional":false}},{"name":"data","type":{"kind":"simple","type":"cell","optional":false}}]},{"name":"Context","header":null,"fields":[{"name":"bounced","type":{"kind":"simple","type":"bool","optional":false}},{"name":"sender","type":{"kind":"simple","type":"address","optional":false}},{"name":"value","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"raw","type":{"kind":"simple","type":"slice","optional":false}}]},{"name":"SendParameters","header":null,"fields":[{"name":"bounce","type":{"kind":"simple","type":"bool","optional":false}},{"name":"to","type":{"kind":"simple","type":"address","optional":false}},{"name":"value","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"mode","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"body","type":{"kind":"simple","type":"cell","optional":true}},{"name":"code","type":{"kind":"simple","type":"cell","optional":true}},{"name":"data","type":{"kind":"simple","type":"cell","optional":true}}]},{"name":"ChangeOwner","header":256331011,"fields":[{"name":"newOwner","type":{"kind":"simple","type":"address","optional":false}}]},{"name":"TokenTransfer","header":260734629,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}},{"name":"amount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"destination","type":{"kind":"simple","type":"address","optional":false}},{"name":"responseDestination","type":{"kind":"simple","type":"address","optional":true}},{"name":"customPayload","type":{"kind":"simple","type":"cell","optional":true}},{"name":"forwardTonAmount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"forwardPayload","type":{"kind":"simple","type":"slice","optional":false,"format":"remainder"}}]},{"name":"TokenTransferInternal","header":395134233,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}},{"name":"amount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"from","type":{"kind":"simple","type":"address","optional":false}},{"name":"responseAddress","type":{"kind":"simple","type":"address","optional":true}},{"name":"forwardTonAmount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"forwardPayload","type":{"kind":"simple","type":"slice","optional":false,"format":"remainder"}}]},{"name":"TokenNotification","header":1935855772,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}},{"name":"amount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"from","type":{"kind":"simple","type":"address","optional":false}},{"name":"forwardPayload","type":{"kind":"simple","type":"slice","optional":false,"format":"remainder"}}]},{"name":"TokenBurn","header":1499400124,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}},{"name":"amount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"owner","type":{"kind":"simple","type":"address","optional":false}},{"name":"responseAddress","type":{"kind":"simple","type":"address","optional":true}}]},{"name":"TokenBurnNotification","header":2078119902,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}},{"name":"amount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"owner","type":{"kind":"simple","type":"address","optional":false}},{"name":"responseAddress","type":{"kind":"simple","type":"address","optional":true}}]},{"name":"TokenExcesses","header":3576854235,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}}]},{"name":"TokenUpdateContent","header":201882270,"fields":[{"name":"content","type":{"kind":"simple","type":"cell","optional":true}}]},{"name":"JettonData","header":null,"fields":[{"name":"totalSupply","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"mintable","type":{"kind":"simple","type":"bool","optional":false}},{"name":"owner","type":{"kind":"simple","type":"address","optional":false}},{"name":"content","type":{"kind":"simple","type":"cell","optional":true}},{"name":"walletCode","type":{"kind":"simple","type":"cell","optional":false}}]},{"name":"JettonWalletData","header":null,"fields":[{"name":"balance","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"owner","type":{"kind":"simple","type":"address","optional":false}},{"name":"master","type":{"kind":"simple","type":"address","optional":false}},{"name":"walletCode","type":{"kind":"simple","type":"cell","optional":false}}]},{"name":"Mint","header":33240155,"fields":[{"name":"amount","type":{"kind":"simple","type":"int","optional":false,"format":257}}]}],"receivers":[{"receiver":"internal","message":{"kind":"typed","type":"Mint"}},{"receiver":"internal","message":{"kind":"text","text":"Mint!"}},{"receiver":"internal","message":{"kind":"typed","type":"TokenUpdateContent"}},{"receiver":"internal","message":{"kind":"typed","type":"TokenBurnNotification"}}],"getters":[{"name":"get_wallet_address","arguments":[{"name":"owner","type":{"kind":"simple","type":"address","optional":false}}],"returnType":{"kind":"simple","type":"address","optional":false}},{"name":"get_jetton_data","arguments":[],"returnType":{"kind":"simple","type":"JettonData","optional":false}},{"name":"owner","arguments":[],"returnType":{"kind":"simple","type":"address","optional":false}}],"errors":{"2":{"message":"Stack undeflow"},"3":{"message":"Stack overflow"},"4":{"message":"Integer overflow"},"5":{"message":"Integer out of expected range"},"6":{"message":"Invalid opcode"},"7":{"message":"Type check error"},"8":{"message":"Cell overflow"},"9":{"message":"Cell underflow"},"10":{"message":"Dictionary error"},"13":{"message":"Out of gas error"},"32":{"message":"Method ID not found"},"34":{"message":"Action is invalid or not supported"},"37":{"message":"Not enough TON"},"38":{"message":"Not enough extra-currencies"},"128":{"message":"Null reference exception"},"129":{"message":"Invalid serialization prefix"},"130":{"message":"Invalid incoming message"},"131":{"message":"Constraints error"},"132":{"message":"Access denied"},"133":{"message":"Contract stopped"},"134":{"message":"Invalid argument"},"135":{"message":"Code of a contract was not found"},"136":{"message":"Invalid address"},"4429":{"message":"Invalid sender"},"13650":{"message":"Invalid bounced message"},"16059":{"message":"Invalid value"},"62972":{"message":"Invalid balance"}}} \ No newline at end of file diff --git a/sources/output/jetton_SampleJetton.abi.ipfs b/sources/output/jetton_SampleJetton.abi.ipfs deleted file mode 100644 index a71d69f..0000000 --- a/sources/output/jetton_SampleJetton.abi.ipfs +++ /dev/null @@ -1 +0,0 @@ -{"version":"0.0.1","name":"SampleJetton","structs":[{"name":"StateInit","header":0,"fields":[{"name":"code","type":{"kind":"ref","name":"Cell","optional":false}},{"name":"data","type":{"kind":"ref","name":"Cell","optional":false}}],"allocation":{"prefix":null,"root":{"fields":[{"index":0,"size":{"bits":0,"refs":1},"kind":"cell"},{"index":1,"size":{"bits":0,"refs":1},"kind":"cell"}],"next":null,"size":{"bits":0,"refs":2}}}},{"name":"Context","header":0,"fields":[{"name":"bounced","type":{"kind":"ref","name":"Bool","optional":false}},{"name":"sender","type":{"kind":"ref","name":"Address","optional":false}},{"name":"value","type":{"kind":"ref","name":"Int","optional":false}},{"name":"raw","type":{"kind":"ref","name":"Slice","optional":false}}],"allocation":{"prefix":null,"root":{"fields":[{"index":0,"size":{"bits":1,"refs":0},"kind":"int","bits":1},{"index":1,"size":{"bits":267,"refs":0},"kind":"address"},{"index":2,"size":{"bits":257,"refs":0},"kind":"int","bits":257},{"index":3,"size":{"bits":0,"refs":1},"kind":"slice"}],"next":null,"size":{"bits":525,"refs":1}}}},{"name":"SendParameters","header":0,"fields":[{"name":"bounce","type":{"kind":"ref","name":"Bool","optional":false}},{"name":"to","type":{"kind":"ref","name":"Address","optional":false}},{"name":"value","type":{"kind":"ref","name":"Int","optional":false}},{"name":"mode","type":{"kind":"ref","name":"Int","optional":false}},{"name":"body","type":{"kind":"ref","name":"Cell","optional":true}},{"name":"code","type":{"kind":"ref","name":"Cell","optional":true}},{"name":"data","type":{"kind":"ref","name":"Cell","optional":true}}],"allocation":{"prefix":null,"root":{"fields":[{"index":0,"size":{"bits":1,"refs":0},"kind":"int","bits":1},{"index":1,"size":{"bits":267,"refs":0},"kind":"address"},{"index":2,"size":{"bits":257,"refs":0},"kind":"int","bits":257},{"index":3,"size":{"bits":257,"refs":0},"kind":"int","bits":257},{"index":4,"size":{"bits":1,"refs":1},"kind":"optional","inner":{"index":4,"size":{"bits":0,"refs":1},"kind":"cell"}},{"index":5,"size":{"bits":1,"refs":1},"kind":"optional","inner":{"index":5,"size":{"bits":0,"refs":1},"kind":"cell"}},{"index":6,"size":{"bits":1,"refs":1},"kind":"optional","inner":{"index":6,"size":{"bits":0,"refs":1},"kind":"cell"}}],"next":null,"size":{"bits":785,"refs":3}}}},{"name":"ChangeOwner","header":0,"fields":[{"name":"newOwner","type":{"kind":"ref","name":"Address","optional":false}}],"allocation":{"prefix":3067051791,"root":{"fields":[{"index":0,"size":{"bits":267,"refs":0},"kind":"address"}],"next":null,"size":{"bits":267,"refs":0}}}},{"name":"TokenTransfer","header":0,"fields":[{"name":"queryId","type":{"kind":"ref","name":"Int","optional":false}},{"name":"amount","type":{"kind":"ref","name":"Int","optional":false}},{"name":"destination","type":{"kind":"ref","name":"Address","optional":false}},{"name":"responseDestination","type":{"kind":"ref","name":"Address","optional":true}},{"name":"customPayload","type":{"kind":"ref","name":"Cell","optional":true}},{"name":"forwardTonAmount","type":{"kind":"ref","name":"Int","optional":false}},{"name":"forwardPayload","type":{"kind":"ref","name":"Slice","optional":false}}],"allocation":{"prefix":260734629,"root":{"fields":[{"index":0,"size":{"bits":64,"refs":0},"kind":"uint","bits":64},{"index":1,"size":{"bits":124,"refs":0},"kind":"coins"},{"index":2,"size":{"bits":267,"refs":0},"kind":"address"},{"index":3,"size":{"bits":267,"refs":0},"kind":"optional","inner":{"index":3,"size":{"bits":267,"refs":0},"kind":"address"}},{"index":4,"size":{"bits":1,"refs":1},"kind":"optional","inner":{"index":4,"size":{"bits":0,"refs":1},"kind":"cell"}},{"index":5,"size":{"bits":124,"refs":0},"kind":"coins"},{"index":6,"size":{"bits":0,"refs":0},"kind":"remaining"}],"next":null,"size":{"bits":847,"refs":1}}}},{"name":"TokenTransferInternal","header":0,"fields":[{"name":"queryId","type":{"kind":"ref","name":"Int","optional":false}},{"name":"amount","type":{"kind":"ref","name":"Int","optional":false}},{"name":"from","type":{"kind":"ref","name":"Address","optional":false}},{"name":"responseAddress","type":{"kind":"ref","name":"Address","optional":true}},{"name":"forwardTonAmount","type":{"kind":"ref","name":"Int","optional":false}},{"name":"forwardPayload","type":{"kind":"ref","name":"Slice","optional":false}}],"allocation":{"prefix":395134233,"root":{"fields":[{"index":0,"size":{"bits":64,"refs":0},"kind":"uint","bits":64},{"index":1,"size":{"bits":124,"refs":0},"kind":"coins"},{"index":2,"size":{"bits":267,"refs":0},"kind":"address"},{"index":3,"size":{"bits":267,"refs":0},"kind":"optional","inner":{"index":3,"size":{"bits":267,"refs":0},"kind":"address"}},{"index":4,"size":{"bits":124,"refs":0},"kind":"coins"},{"index":5,"size":{"bits":0,"refs":0},"kind":"remaining"}],"next":null,"size":{"bits":846,"refs":0}}}},{"name":"TokenNotification","header":0,"fields":[{"name":"queryId","type":{"kind":"ref","name":"Int","optional":false}},{"name":"amount","type":{"kind":"ref","name":"Int","optional":false}},{"name":"from","type":{"kind":"ref","name":"Address","optional":false}},{"name":"forwardPayload","type":{"kind":"ref","name":"Slice","optional":false}}],"allocation":{"prefix":1935855772,"root":{"fields":[{"index":0,"size":{"bits":64,"refs":0},"kind":"uint","bits":64},{"index":1,"size":{"bits":124,"refs":0},"kind":"coins"},{"index":2,"size":{"bits":267,"refs":0},"kind":"address"},{"index":3,"size":{"bits":0,"refs":0},"kind":"remaining"}],"next":null,"size":{"bits":455,"refs":0}}}},{"name":"TokenBurn","header":0,"fields":[{"name":"queryId","type":{"kind":"ref","name":"Int","optional":false}},{"name":"amount","type":{"kind":"ref","name":"Int","optional":false}},{"name":"owner","type":{"kind":"ref","name":"Address","optional":false}},{"name":"responseAddress","type":{"kind":"ref","name":"Address","optional":true}}],"allocation":{"prefix":1499400124,"root":{"fields":[{"index":0,"size":{"bits":64,"refs":0},"kind":"uint","bits":64},{"index":1,"size":{"bits":124,"refs":0},"kind":"coins"},{"index":2,"size":{"bits":267,"refs":0},"kind":"address"},{"index":3,"size":{"bits":267,"refs":0},"kind":"optional","inner":{"index":3,"size":{"bits":267,"refs":0},"kind":"address"}}],"next":null,"size":{"bits":722,"refs":0}}}},{"name":"TokenBurnNotification","header":0,"fields":[{"name":"queryId","type":{"kind":"ref","name":"Int","optional":false}},{"name":"amount","type":{"kind":"ref","name":"Int","optional":false}},{"name":"owner","type":{"kind":"ref","name":"Address","optional":false}},{"name":"responseAddress","type":{"kind":"ref","name":"Address","optional":true}}],"allocation":{"prefix":2078119902,"root":{"fields":[{"index":0,"size":{"bits":64,"refs":0},"kind":"uint","bits":64},{"index":1,"size":{"bits":124,"refs":0},"kind":"coins"},{"index":2,"size":{"bits":267,"refs":0},"kind":"address"},{"index":3,"size":{"bits":267,"refs":0},"kind":"optional","inner":{"index":3,"size":{"bits":267,"refs":0},"kind":"address"}}],"next":null,"size":{"bits":722,"refs":0}}}},{"name":"TokenExcesses","header":0,"fields":[{"name":"queryId","type":{"kind":"ref","name":"Int","optional":false}}],"allocation":{"prefix":3576854235,"root":{"fields":[{"index":0,"size":{"bits":64,"refs":0},"kind":"uint","bits":64}],"next":null,"size":{"bits":64,"refs":0}}}},{"name":"TokenUpdateContent","header":0,"fields":[{"name":"content","type":{"kind":"ref","name":"Cell","optional":true}}],"allocation":{"prefix":1862840892,"root":{"fields":[{"index":0,"size":{"bits":1,"refs":1},"kind":"optional","inner":{"index":0,"size":{"bits":0,"refs":1},"kind":"cell"}}],"next":null,"size":{"bits":1,"refs":1}}}},{"name":"JettonData","header":0,"fields":[{"name":"totalSupply","type":{"kind":"ref","name":"Int","optional":false}},{"name":"mintable","type":{"kind":"ref","name":"Bool","optional":false}},{"name":"owner","type":{"kind":"ref","name":"Address","optional":false}},{"name":"content","type":{"kind":"ref","name":"Cell","optional":true}},{"name":"walletCode","type":{"kind":"ref","name":"Cell","optional":false}}],"allocation":{"prefix":null,"root":{"fields":[{"index":0,"size":{"bits":257,"refs":0},"kind":"int","bits":257},{"index":1,"size":{"bits":1,"refs":0},"kind":"int","bits":1},{"index":2,"size":{"bits":267,"refs":0},"kind":"address"},{"index":3,"size":{"bits":1,"refs":1},"kind":"optional","inner":{"index":3,"size":{"bits":0,"refs":1},"kind":"cell"}},{"index":4,"size":{"bits":0,"refs":1},"kind":"cell"}],"next":null,"size":{"bits":526,"refs":2}}}},{"name":"JettonWalletData","header":0,"fields":[{"name":"balance","type":{"kind":"ref","name":"Int","optional":false}},{"name":"owner","type":{"kind":"ref","name":"Address","optional":false}},{"name":"master","type":{"kind":"ref","name":"Address","optional":false}},{"name":"walletCode","type":{"kind":"ref","name":"Cell","optional":false}}],"allocation":{"prefix":null,"root":{"fields":[{"index":0,"size":{"bits":257,"refs":0},"kind":"int","bits":257},{"index":1,"size":{"bits":267,"refs":0},"kind":"address"},{"index":2,"size":{"bits":267,"refs":0},"kind":"address"},{"index":3,"size":{"bits":0,"refs":1},"kind":"cell"}],"next":null,"size":{"bits":791,"refs":1}}}},{"name":"Mint","header":0,"fields":[{"name":"amount","type":{"kind":"ref","name":"Int","optional":false}}],"allocation":{"prefix":2737462367,"root":{"fields":[{"index":0,"size":{"bits":257,"refs":0},"kind":"int","bits":257}],"next":null,"size":{"bits":257,"refs":0}}}}],"init":{"name":"init_SampleJetton","args":[{"name":"owner","type":{"kind":"ref","name":"Address","optional":false}},{"name":"content","type":{"kind":"ref","name":"Cell","optional":true}}]},"receivers":[{"kind":"internal-binary","type":"Mint"},{"kind":"internal-comment","comment":"Mint!"},{"kind":"internal-binary","type":"TokenUpdateContent"},{"kind":"internal-binary","type":"TokenBurnNotification"}],"getters":[{"name":"get_wallet_address","args":[{"name":"owner","type":{"kind":"ref","name":"Address","optional":false}}],"returns":{"kind":"ref","name":"Address","optional":false}},{"name":"get_jetton_data","args":[],"returns":{"kind":"ref","name":"JettonData","optional":false}},{"name":"owner","args":[],"returns":{"kind":"ref","name":"Address","optional":false}}],"dependsOn":{"JettonDefaultWallet":{"uid":55471}},"errors":{"2":{"message":"Stack undeflow"},"3":{"message":"Stack overflow"},"4":{"message":"Integer overflow"},"5":{"message":"Integer out of expected range"},"6":{"message":"Invalid opcode"},"7":{"message":"Type check error"},"8":{"message":"Cell overflow"},"9":{"message":"Cell underflow"},"10":{"message":"Dictionary error"},"13":{"message":"Out of gas error"},"32":{"message":"Method ID not found"},"34":{"message":"Action is invalid or not supported"},"37":{"message":"Not enough TON"},"38":{"message":"Not enough extra-currencies"},"128":{"message":"Null reference exception"},"129":{"message":"Invalid serialization prefix"},"130":{"message":"Invalid incoming message"},"131":{"message":"Constraints error"},"132":{"message":"Access denied"},"133":{"message":"Contract stopped"},"134":{"message":"Invalid argument"},"4429":{"message":"Invalid sender"},"13650":{"message":"Invalid bounced message"},"16059":{"message":"Invalid value"},"62972":{"message":"Invalid balance"}}} \ No newline at end of file diff --git a/sources/output/jetton_SampleJetton.boc b/sources/output/jetton_SampleJetton.boc deleted file mode 100644 index 02c72e7675586b59b138a8b042e691fd82703da7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1469 zcma)6eN09yTcFG753=PA{un2)HG1}ql zY=k8`!0@pMgl2&LA^V_1hJ>*P1NjIO!s>_t31NdQi<{UmKy1(pkv~k#!XNK<&-uM` z&hOlFZ|?U`8%q$8fWWl_kk8++((1j^>ll$D0_74e1TjXs5{QY3#UK(B=$KN4ElNV5 zOxlY;b~h;;olE9DGNqUBhgYaOefrH2QF7Iet53|?OtX;nN6KcYvs1<8i#jT1V0ex1 zj247!qZ;yZ9%je!WmQy7Ktq3`Ki8VEPBE6yv3kF!-9iOpQ4T~@9^AI}uD!Q*wOhCj zjJwRk6Qq=~x07L@NBtya(vH@1H(-N9g~Sw~8l&7UpPK?wuQmFR_X5#*x+N?-r^hjG zHX}3*D2k4LMZFw0vi>R>KdIIyZxCog5&U7TrZ{s9>OMtdARk{CgV87HFtDrgMU;)* zDqo1O{8v%-xql@hb|djuBp7krY{(e(Rt2Az76 zSdQF{>f?)rf1>ltcV(B19hX<~uNGfeaYp6#D;A$6-SYb8v*x#Eo{^N=)^joS`SV>4 z--X&t)O@vi!6BT-7f0@muaJ)~_=W@uC48I;N_YlbH5vn^6@D1}1HdJk0SPN|it(aS zmhr--*@XhXgj7qW3!MOOP#Af`;fm4>))F*eTd0+4?J?rhIq4B-(N z0vQY;`!NIsW7zj198iHnOAp$qd5$X;pmc~Y9kLmq2s#sxJH_y^;evroaG7~z>JCtH z*8lkAw#!+`1Xo7_X!PKu7)VwH_G`5CT_1Xr$F(XN+H{Qy4Ik2sr$*k0v+)`OcqY<) zZVHy#n%zsG7!HJijHPDiUa=MbbYrP;dYpkapUiw;or#)e#f>V4rpnwXlQ>0|;%%V@ zr4HY8#^Ug`f2-B^XlP=6c07sG~pCbjz2s;$9*T;s-+;jjcm!3{e``vy(FNN582%2p{fN z{yg~Y@W1p*tgvs#o40r@*?7u?IZt05>*lW4G4KKDH7Kio*D0~fLXT&)KPaEYJ2E@K zV2RN+b=}ttJ0=_{64HatR%V&RgVe(>WpPyk1F3zXzZdNP-0FG9Z&Ex3(tJe~xVISU ztaYnZ5NvKRd~4R>E?nd7DuiYH=J7m;$KJMYJr%?evU11k)$G@&{X^$Kn zS=GbwE4{0i^9#Tkbq>xk&}BXYFcvE*kQAK(A~c}OEzG@x^WpWCj)jV9V_etWk58uX{tOVLLy-#62q2?&MdRC zQZa0a3xY5g9jp=1KV+K&%nUMC9BP4XC2W%{o!X$xCj=YD5Ethu6aO-~=XcNd_705l$Y%FYpW9M8z?3q4xP7tMs zS2^tWH8mm50$LSSly)P34b}{ZYlehbC0>O#Y|l72 z7gZ=SmR9jkv@cy#ovy$5!E)Vs%ZcR&88u`4{Js3k;UB(n_8IRzmWTtxt;8!WrFtcA zhObSW^E>Ul8u^8y>6^G(PB^(X#UOQYBz;0y!h znaOTZhXa~txkofVJH_v;tbWc ztewtkHdp5T+4@<6Ga$Nb4mLN)p9@+uJRlC(Y)+*2#{={%=|@jtmq;N)3t@TOsDhV> z4^)yojvFBYRVgHS26>LOvs5!+- z${m>);wm%KS?a)K=hP>QW6i-+@zGQHX4(1#Q8?5oT5t;6J^UQ5t7rjx^b~UQC}ihQ z*egMH9#=WRl3C|1vm}S=q7uUhiNcFx#n#Kw1_x}}FuVR3qrK932Yh{?-q7D3k^5+* zd;^vgurJAKpFPIBDcc`W{+s@nJ;8((ULPD|3S`adP2YUagfrQRg{CBt6hPtz-`5;^ kcfdxhavy|6)3<3f8wFIjkao5YcsqAX`>MBMDt;>eAKD$GJOBUy literal 0 HcmV?d00001 diff --git a/sources/output/jetton_SampleJetton.fc b/sources/output/jetton_SampleJetton.code.fc similarity index 61% rename from sources/output/jetton_SampleJetton.fc rename to sources/output/jetton_SampleJetton.code.fc index ced53ae..aee5239 100644 --- a/sources/output/jetton_SampleJetton.fc +++ b/sources/output/jetton_SampleJetton.code.fc @@ -6,7 +6,12 @@ global cell __tact_context_sys; (int, slice, int, slice) __tact_context_get() inline { return __tact_context; } () __tact_verify_address(slice address) inline { - throw_unless(134, address.slice_bits() != 267); + throw_unless(136, address.slice_bits() != 267); +} + +builder __tact_store_bool(builder b, int v) inline { + b = b.store_int(v, 1); + return b; } (slice, slice) __tact_load_address(slice cs) inline { @@ -40,7 +45,16 @@ builder __tact_store_address_opt(builder b, slice address) inline { } } -slice __tact_compute_contract_address(int chain, cell code, cell data) { +slice __tact_create_address(int chain, int hash) inline { + var b = begin_cell(); + b = b.store_uint(2, 2); + b = b.store_uint(0, 1); + b = b.store_int(chain, 8); + b = b.store_uint(hash, 256); + return b.end_cell().begin_parse(); +} + +slice __tact_compute_contract_address(int chain, cell code, cell data) inline { var b = begin_cell(); b = b.store_uint(0, 2); b = b.store_uint(3, 2); @@ -48,12 +62,7 @@ slice __tact_compute_contract_address(int chain, cell code, cell data) { b = b.store_ref(code); b = b.store_ref(data); var hash = cell_hash(b.end_cell()); - var b2 = begin_cell(); - b2 = b2.store_uint(2, 2); - b2 = b2.store_uint(0, 1); - b2 = b2.store_int(chain, 8); - b2 = b2.store_uint(hash, 256); - return b2.end_cell().begin_parse(); + return __tact_create_address(chain, hash); } int __tact_address_eq(slice a, slice b) inline { @@ -66,27 +75,27 @@ cell __tact_dict_set_code(cell dict, int id, cell code) inline { cell __tact_dict_get_code(cell dict, int id) inline { var (data, ok) = udict_get_ref?(dict, 16, id); - throw_unless(100, ok); + throw_unless(135, ok); return data; } -builder __gen_write_TokenTransferInternal(builder build_0, (int, int, slice, slice, int, slice) v) inline { +builder __gen_write_TokenTransferInternal(builder build_0, (int, int, slice, slice, int, slice) v) inline_ref { var (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload) = v; build_0 = store_uint(build_0, 395134233, 32); - build_0 = store_uint(build_0, v'queryId, 64); - build_0 = store_coins(build_0, v'amount); + build_0 = build_0.store_uint(v'queryId, 64); + build_0 = build_0.store_coins(v'amount); build_0 = __tact_store_address(build_0, v'from); build_0 = __tact_store_address_opt(build_0, v'responseAddress); - build_0 = store_coins(build_0, v'forwardTonAmount); - build_0 = store_slice(build_0, v'forwardPayload); + build_0 = build_0.store_coins(v'forwardTonAmount); + build_0 = build_0.store_slice(v'forwardPayload); return build_0; } -cell __gen_writecell_TokenTransferInternal((int, int, slice, slice, int, slice) v) inline { +cell __gen_writecell_TokenTransferInternal((int, int, slice, slice, int, slice) v) inline_ref { return __gen_write_TokenTransferInternal(begin_cell(), v).end_cell(); } -(slice, ((int, int, slice, slice))) __gen_read_TokenBurnNotification(slice sc_0) inline { +(slice, ((int, int, slice, slice))) __gen_read_TokenBurnNotification(slice sc_0) inline_ref { throw_unless(129, sc_0~load_uint(32) == 2078119902); var v'queryId = sc_0~load_uint(64); var v'amount = sc_0~load_coins(); @@ -95,61 +104,50 @@ cell __gen_writecell_TokenTransferInternal((int, int, slice, slice, int, slice) return (sc_0, (v'queryId, v'amount, v'owner, v'responseAddress)); } -builder __gen_write_TokenExcesses(builder build_0, (int) v) inline { +builder __gen_write_TokenExcesses(builder build_0, (int) v) inline_ref { var (v'queryId) = v; build_0 = store_uint(build_0, 3576854235, 32); - build_0 = store_uint(build_0, v'queryId, 64); + build_0 = build_0.store_uint(v'queryId, 64); return build_0; } -cell __gen_writecell_TokenExcesses((int) v) inline { +cell __gen_writecell_TokenExcesses((int) v) inline_ref { return __gen_write_TokenExcesses(begin_cell(), v).end_cell(); } -(slice, ((cell))) __gen_read_TokenUpdateContent(slice sc_0) inline { - throw_unless(129, sc_0~load_uint(32) == 1862840892); - var v'content = null(); - if (sc_0~load_int(1)) { - v'content = sc_0~load_ref(); - } +(slice, ((cell))) __gen_read_TokenUpdateContent(slice sc_0) inline_ref { + throw_unless(129, sc_0~load_uint(32) == 201882270); + var v'content = sc_0~load_int(1) ? sc_0~load_ref() : null(); return (sc_0, (v'content)); } -(slice, ((int))) __gen_read_Mint(slice sc_0) inline { - throw_unless(129, sc_0~load_uint(32) == 2737462367); +(slice, ((int))) __gen_read_Mint(slice sc_0) inline_ref { + throw_unless(129, sc_0~load_uint(32) == 33240155); var v'amount = sc_0~load_int(257); return (sc_0, (v'amount)); } -builder __gen_write_JettonDefaultWallet(builder build_0, (int, slice, slice) v) inline { +builder __gen_write_JettonDefaultWallet(builder build_0, (int, slice, slice) v) inline_ref { var (v'balance, v'owner, v'master) = v; - build_0 = store_int(build_0, v'balance, 257); + build_0 = build_0.store_int(v'balance, 257); build_0 = __tact_store_address(build_0, v'owner); build_0 = __tact_store_address(build_0, v'master); return build_0; } -builder __gen_write_SampleJetton(builder build_0, (int, slice, cell, int) v) inline { +builder __gen_write_SampleJetton(builder build_0, (int, slice, cell, int) v) inline_ref { var (v'totalSupply, v'owner, v'content, v'mintable) = v; - build_0 = store_coins(build_0, v'totalSupply); + build_0 = build_0.store_coins(v'totalSupply); build_0 = __tact_store_address(build_0, v'owner); - if (null?(v'content)) { - build_0 = store_int(build_0, false, 1); - } else { - build_0 = store_int(build_0, true, 1); - build_0 = store_ref(build_0, v'content); - } - build_0 = store_int(build_0, v'mintable, 1); + build_0 = ~ null?(v'content) ? build_0.store_int(true, 1).store_ref(v'content) : build_0.store_int(false, 1); + build_0 = build_0.store_int(v'mintable, 1); return build_0; } -(slice, ((int, slice, cell, int))) __gen_read_SampleJetton(slice sc_0) inline { +(slice, ((int, slice, cell, int))) __gen_read_SampleJetton(slice sc_0) inline_ref { var v'totalSupply = sc_0~load_coins(); var v'owner = sc_0~__tact_load_address(); - var v'content = null(); - if (sc_0~load_int(1)) { - v'content = sc_0~load_ref(); - } + var v'content = sc_0~load_int(1) ? sc_0~load_ref() : null(); var v'mintable = sc_0~load_int(1); return (sc_0, (v'totalSupply, v'owner, v'content, v'mintable)); } @@ -164,89 +162,86 @@ _ __gen_Context_get_sender((int, slice, int, slice) v) inline { return v'sender; } -(int, slice, cell, int) __gen_load_SampleJetton() inline { +(int, int, slice, cell, cell) __gen_JettonData_to_external(((int, int, slice, cell, cell)) v) { + var (v'totalSupply, v'mintable, v'owner, v'content, v'walletCode) = v; + return (v'totalSupply, v'mintable, v'owner, v'content, v'walletCode); +} + +(int, slice, cell, int) __gen_load_SampleJetton() inline_ref { slice sc = get_data().begin_parse(); __tact_context_sys = sc~load_ref(); return sc~__gen_read_SampleJetton(); } -() __gen_store_SampleJetton((int, slice, cell, int) v) impure inline { +() __gen_store_SampleJetton((int, slice, cell, int) v) impure inline_ref { builder b = begin_cell(); b = b.store_ref(__tact_context_sys); b = __gen_write_SampleJetton(b, v); set_data(b.end_cell()); } -builder storeBool(builder $s, int $value) impure { - if ($value) { - return store_int($s, (- 1), 1); - } else { - return store_int($s, 0, 1); - } -} - -cell emptyCell() impure { +cell $emptyCell() impure { return end_cell(begin_cell()); } -slice __gen_Cell_asSlice(cell $self) impure { +slice $__gen_Cell_asSlice(cell $self) impure { var ($self) = $self; return begin_parse($self); } -slice emptySlice() impure { - return __gen_Cell_asSlice(emptyCell()); +slice $emptySlice() impure { + return $__gen_Cell_asSlice($emptyCell()); } -slice contractAddress((cell, cell) $s) impure { +slice $contractAddress((cell, cell) $s) impure { var (($s'code, $s'data)) = $s; return __tact_compute_contract_address(0, $s'code, $s'data); } -() send((int, slice, int, int, cell, cell, cell) $params) impure { +() $send((int, slice, int, int, cell, cell, cell) $params) impure { var (($params'bounce, $params'to, $params'value, $params'mode, $params'body, $params'code, $params'data)) = $params; builder $b = begin_cell(); $b = store_int($b, 1, 2); - $b = storeBool($b, $params'bounce); + $b = __tact_store_bool($b, $params'bounce); $b = store_int($b, 0, 3); $b = __tact_store_address($b, $params'to); $b = store_coins($b, $params'value); $b = store_int($b, 0, ((((1 + 4) + 4) + 64) + 32)); if (((~ null?($params'code)) | (~ null?($params'data)))) { - $b = storeBool($b, true); + $b = __tact_store_bool($b, true); builder $bc = begin_cell(); - $bc = storeBool($bc, false); - $bc = storeBool($bc, false); + $bc = __tact_store_bool($bc, false); + $bc = __tact_store_bool($bc, false); if ((~ null?($params'code))) { - $bc = storeBool($bc, true); + $bc = __tact_store_bool($bc, true); $bc = store_ref($bc, __tact_not_null($params'code)); } else { - $bc = storeBool($bc, false); + $bc = __tact_store_bool($bc, false); } if ((~ null?($params'data))) { - $bc = storeBool($bc, true); + $bc = __tact_store_bool($bc, true); $bc = store_ref($bc, __tact_not_null($params'data)); } else { - $bc = storeBool($bc, false); + $bc = __tact_store_bool($bc, false); } - $bc = storeBool($bc, false); - $b = storeBool($b, true); + $bc = __tact_store_bool($bc, false); + $b = __tact_store_bool($b, true); $b = store_ref($b, end_cell($bc)); } else { - $b = storeBool($b, false); + $b = __tact_store_bool($b, false); } cell $body = $params'body; if ((~ null?($body))) { - $b = storeBool($b, true); + $b = __tact_store_bool($b, true); $b = store_ref($b, __tact_not_null($body)); } else { - $b = storeBool($b, false); + $b = __tact_store_bool($b, false); } cell $c = end_cell($b); send_raw_message($c, $params'mode); } -cell __gen_JettonDefaultWallet_init(cell sys', slice $master, slice $owner) { +cell $__gen_JettonDefaultWallet_init(cell sys', slice $master, slice $owner) { var (($self'balance, $self'owner, $self'master)) = (null(), null(), null()); $self'balance = 0; $self'owner = $owner; @@ -257,121 +252,112 @@ cell __gen_JettonDefaultWallet_init(cell sys', slice $master, slice $owner) { return b'.end_cell(); } -(cell, cell) __gen_JettonDefaultWallet_init_child(cell sys', slice $master, slice $owner) { +(cell, cell) $__gen_JettonDefaultWallet_init_child(cell sys', slice $master, slice $owner) { slice sc' = sys'.begin_parse(); cell source = sc'~load_dict(); - cell mine = __tact_dict_get_code(source, 55471); cell contracts = new_dict(); - cell code_55471 = __tact_dict_get_code(source, 55471); - contracts = __tact_dict_set_code(contracts, 55471, code_55471); + + ;; Contract Code: JettonDefaultWallet + cell mine = __tact_dict_get_code(source, 55471); + contracts = __tact_dict_set_code(contracts, 55471, mine); cell sys = begin_cell().store_dict(contracts).end_cell(); - return (mine, __gen_JettonDefaultWallet_init(sys, $master, $owner)); -} - -cell __gen_SampleJetton_init(cell sys', slice $owner, cell $content) { - var (($self'totalSupply, $self'owner, $self'content, $self'mintable)) = (null(), null(), null(), null()); - $self'totalSupply = 0; - $self'owner = $owner; - $self'mintable = true; - $self'content = $content; - var b' = begin_cell(); - b' = b'.store_ref(sys'); - b' = __gen_write_SampleJetton(b', ($self'totalSupply, $self'owner, $self'content, $self'mintable)); - return b'.end_cell(); + return (mine, $__gen_JettonDefaultWallet_init(sys, $master, $owner)); } -((int, slice, cell, int), (cell, cell)) __gen_SampleJetton_getJettonWalletInit((int, slice, cell, int) $self, slice $address) impure { +((int, slice, cell, int), (cell, cell)) $__gen_SampleJetton_getJettonWalletInit((int, slice, cell, int) $self, slice $address) impure { var (($self'totalSupply, $self'owner, $self'content, $self'mintable)) = $self; - return (($self'totalSupply, $self'owner, $self'content, $self'mintable), __gen_JettonDefaultWallet_init_child(__tact_context_sys, my_address(), $address)); + return (($self'totalSupply, $self'owner, $self'content, $self'mintable), $__gen_JettonDefaultWallet_init_child(__tact_context_sys, my_address(), $address)); } -slice __gen_SampleJetton_get_wallet_address((int, slice, cell, int) $self, slice $owner) impure { +slice $__gen_SampleJetton_get_wallet_address((int, slice, cell, int) $self, slice $owner) impure { var (($self'totalSupply, $self'owner, $self'content, $self'mintable)) = $self; - var ($winit'code, $winit'data) = ($self'totalSupply, $self'owner, $self'content, $self'mintable)~__gen_SampleJetton_getJettonWalletInit($owner); - return contractAddress(($winit'code, $winit'data)); + var ($winit'code, $winit'data) = ($self'totalSupply, $self'owner, $self'content, $self'mintable)~$__gen_SampleJetton_getJettonWalletInit($owner); + return $contractAddress(($winit'code, $winit'data)); } -_ __gen_get_get_wallet_address(slice $owner) method_id(103289) { +_ $__gen_get_get_wallet_address(slice $$owner) method_id(103289) { + slice $owner = $$owner; var self = __gen_load_SampleJetton(); - var res = __gen_SampleJetton_get_wallet_address(self, $owner); + var res = $__gen_SampleJetton_get_wallet_address(self, $owner); return res; } -(int, int, slice, cell, cell) __gen_SampleJetton_get_jetton_data((int, slice, cell, int) $self) impure { +(int, int, slice, cell, cell) $__gen_SampleJetton_get_jetton_data((int, slice, cell, int) $self) impure { var (($self'totalSupply, $self'owner, $self'content, $self'mintable)) = $self; - return ($self'totalSupply, $self'mintable, $self'owner, $self'content, __gen_StateInit_get_code(($self'totalSupply, $self'owner, $self'content, $self'mintable)~__gen_SampleJetton_getJettonWalletInit(my_address()))); + cell $code = __gen_StateInit_get_code(($self'totalSupply, $self'owner, $self'content, $self'mintable)~$__gen_SampleJetton_getJettonWalletInit(my_address())); + return ($self'totalSupply, $self'mintable, $self'owner, $self'content, $code); } -_ __gen_get_get_jetton_data() method_id(106029) { +_ $__gen_get_get_jetton_data() method_id(106029) { var self = __gen_load_SampleJetton(); - var res = __gen_SampleJetton_get_jetton_data(self); - return res; + var res = $__gen_SampleJetton_get_jetton_data(self); + return __gen_JettonData_to_external(res); } -((int, slice, cell, int), ()) __gen_SampleJetton_mint((int, slice, cell, int) $self, slice $to, int $amount, slice $responseAddress) impure { +((int, slice, cell, int), ()) $__gen_SampleJetton_mint((int, slice, cell, int) $self, slice $to, int $amount, slice $responseAddress) impure { var (($self'totalSupply, $self'owner, $self'content, $self'mintable)) = $self; $self'totalSupply = ($self'totalSupply + $amount); - var ($winit'code, $winit'data) = ($self'totalSupply, $self'owner, $self'content, $self'mintable)~__gen_SampleJetton_getJettonWalletInit($to); - slice $walletAddress = contractAddress(($winit'code, $winit'data)); - send((false, $walletAddress, 0, 64, __gen_writecell_TokenTransferInternal((0, $amount, my_address(), $responseAddress, 0, emptySlice())), $winit'code, $winit'data)); + var ($winit'code, $winit'data) = ($self'totalSupply, $self'owner, $self'content, $self'mintable)~$__gen_SampleJetton_getJettonWalletInit($to); + slice $walletAddress = $contractAddress(($winit'code, $winit'data)); + $send((false, $walletAddress, 0, 64, __gen_writecell_TokenTransferInternal((0, $amount, my_address(), $responseAddress, 0, $emptySlice())), $winit'code, $winit'data)); return (($self'totalSupply, $self'owner, $self'content, $self'mintable), ()); } -((int, slice, cell, int), ()) __gen_SampleJetton_requireWallet((int, slice, cell, int) $self, slice $owner) impure { +((int, slice, cell, int), ()) $__gen_SampleJetton_requireWallet((int, slice, cell, int) $self, slice $owner) impure { var (($self'totalSupply, $self'owner, $self'content, $self'mintable)) = $self; var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); - var ($winit'code, $winit'data) = ($self'totalSupply, $self'owner, $self'content, $self'mintable)~__gen_SampleJetton_getJettonWalletInit($owner); - throw_unless(4429, __tact_address_eq(contractAddress(($winit'code, $winit'data)), $ctx'sender)); + var ($winit'code, $winit'data) = ($self'totalSupply, $self'owner, $self'content, $self'mintable)~$__gen_SampleJetton_getJettonWalletInit($owner); + throw_unless(4429, __tact_address_eq($contractAddress(($winit'code, $winit'data)), $ctx'sender)); return (($self'totalSupply, $self'owner, $self'content, $self'mintable), ()); } -((int, slice, cell, int), ()) __gen_SampleJetton_requireOwner((int, slice, cell, int) $self) impure { +((int, slice, cell, int), ()) $__gen_SampleJetton_requireOwner((int, slice, cell, int) $self) impure { var (($self'totalSupply, $self'owner, $self'content, $self'mintable)) = $self; throw_unless(132, __tact_address_eq(__gen_Context_get_sender(__tact_context_get()), $self'owner)); return (($self'totalSupply, $self'owner, $self'content, $self'mintable), ()); } -slice __gen_SampleJetton_owner((int, slice, cell, int) $self) impure { +slice $__gen_SampleJetton_owner((int, slice, cell, int) $self) impure { var (($self'totalSupply, $self'owner, $self'content, $self'mintable)) = $self; return $self'owner; } -_ __gen_get_owner() method_id(83229) { +_ $__gen_get_owner() method_id(83229) { var self = __gen_load_SampleJetton(); - var res = __gen_SampleJetton_owner(self); + var res = $__gen_SampleJetton_owner(self); return res; } -(((int, slice, cell, int)), ()) __gen_SampleJetton_receive_Mint((int, slice, cell, int) $self, (int) $msg) impure { +(((int, slice, cell, int)), ()) $__gen_SampleJetton_receive_Mint((int, slice, cell, int) $self, (int) $msg) impure { var ($self'totalSupply, $self'owner, $self'content, $self'mintable) = $self; var ($msg'amount) = $msg; var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); - ($self'totalSupply, $self'owner, $self'content, $self'mintable)~__gen_SampleJetton_mint($ctx'sender, $msg'amount, $ctx'sender); + ($self'totalSupply, $self'owner, $self'content, $self'mintable)~$__gen_SampleJetton_mint($ctx'sender, $msg'amount, $ctx'sender); return (($self'totalSupply, $self'owner, $self'content, $self'mintable), ()); } -((int, slice, cell, int), ()) __gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2((int, slice, cell, int) $self) impure { +((int, slice, cell, int), ()) $__gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2((int, slice, cell, int) $self) impure { var ($self'totalSupply, $self'owner, $self'content, $self'mintable) = $self; var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); - ($self'totalSupply, $self'owner, $self'content, $self'mintable)~__gen_SampleJetton_mint($ctx'sender, 1000000000, $ctx'sender); + ($self'totalSupply, $self'owner, $self'content, $self'mintable)~$__gen_SampleJetton_mint($ctx'sender, 1000000000, $ctx'sender); return (($self'totalSupply, $self'owner, $self'content, $self'mintable), ()); } -(((int, slice, cell, int)), ()) __gen_SampleJetton_receive_TokenUpdateContent((int, slice, cell, int) $self, (cell) $msg) impure { +(((int, slice, cell, int)), ()) $__gen_SampleJetton_receive_TokenUpdateContent((int, slice, cell, int) $self, (cell) $msg) impure { var ($self'totalSupply, $self'owner, $self'content, $self'mintable) = $self; var ($msg'content) = $msg; - ($self'totalSupply, $self'owner, $self'content, $self'mintable)~__gen_SampleJetton_requireOwner(); + ($self'totalSupply, $self'owner, $self'content, $self'mintable)~$__gen_SampleJetton_requireOwner(); $self'content = $msg'content; return (($self'totalSupply, $self'owner, $self'content, $self'mintable), ()); } -(((int, slice, cell, int)), ()) __gen_SampleJetton_receive_TokenBurnNotification((int, slice, cell, int) $self, (int, int, slice, slice) $msg) impure { +(((int, slice, cell, int)), ()) $__gen_SampleJetton_receive_TokenBurnNotification((int, slice, cell, int) $self, (int, int, slice, slice) $msg) impure { var ($self'totalSupply, $self'owner, $self'content, $self'mintable) = $self; var ($msg'queryId, $msg'amount, $msg'owner, $msg'responseAddress) = $msg; - ($self'totalSupply, $self'owner, $self'content, $self'mintable)~__gen_SampleJetton_requireWallet($msg'owner); + ($self'totalSupply, $self'owner, $self'content, $self'mintable)~$__gen_SampleJetton_requireWallet($msg'owner); $self'totalSupply = ($self'totalSupply - $msg'amount); if ((~ null?($msg'responseAddress))) { - send((false, $msg'responseAddress, 0, (64 + 2), __gen_writecell_TokenExcesses(($msg'queryId)), null(), null())); + $send((false, $msg'responseAddress, 0, (64 + 2), __gen_writecell_TokenExcesses(($msg'queryId)), null(), null())); } return (($self'totalSupply, $self'owner, $self'content, $self'mintable), ()); } @@ -396,19 +382,19 @@ _ __gen_get_owner() method_id(83229) { } ;; Receive Mint message - if (op == 2737462367) { + if (op == 33240155) { var self = __gen_load_SampleJetton(); var msg = in_msg~__gen_read_Mint(); - self~__gen_SampleJetton_receive_Mint(msg); + self~$__gen_SampleJetton_receive_Mint(msg); __gen_store_SampleJetton(self); return (); } ;; Receive TokenUpdateContent message - if (op == 1862840892) { + if (op == 201882270) { var self = __gen_load_SampleJetton(); var msg = in_msg~__gen_read_TokenUpdateContent(); - self~__gen_SampleJetton_receive_TokenUpdateContent(msg); + self~$__gen_SampleJetton_receive_TokenUpdateContent(msg); __gen_store_SampleJetton(self); return (); } @@ -417,7 +403,7 @@ _ __gen_get_owner() method_id(83229) { if (op == 2078119902) { var self = __gen_load_SampleJetton(); var msg = in_msg~__gen_read_TokenBurnNotification(); - self~__gen_SampleJetton_receive_TokenBurnNotification(msg); + self~$__gen_SampleJetton_receive_TokenBurnNotification(msg); __gen_store_SampleJetton(self); return (); } @@ -429,7 +415,7 @@ _ __gen_get_owner() method_id(83229) { ;; Receive "Mint!" message if (text_op == 0xcd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2) { var self = __gen_load_SampleJetton(); - self~__gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2(); + self~$__gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2(); __gen_store_SampleJetton(self); return (); } @@ -438,10 +424,6 @@ _ __gen_get_owner() method_id(83229) { throw(130); } -cell init_SampleJetton(cell sys', slice owner, cell content) method_id { - return __gen_SampleJetton_init(sys', owner, content); -} - _ supported_interfaces() method_id { return ( "org.ton.introspection.v0"H >> 128, @@ -452,5 +434,5 @@ _ supported_interfaces() method_id { } _ get_abi_ipfs() { - return "ipfs://QmfEvDdmm4QFHZHyaeXmxoQzn6vUaLtdbVnjusevQcp7eA"; + return "ipfs://QmPfyoAvkPUqzx93gq8EBcVccAYXFEbjnqCMrHYtyPUHfE"; } \ No newline at end of file diff --git a/sources/output/jetton_SampleJetton.fif b/sources/output/jetton_SampleJetton.code.fif similarity index 66% rename from sources/output/jetton_SampleJetton.fif rename to sources/output/jetton_SampleJetton.code.fif index fc72b13..d1998c5 100644 --- a/sources/output/jetton_SampleJetton.fif +++ b/sources/output/jetton_SampleJetton.code.fif @@ -2,10 +2,12 @@ PROGRAM{ DECLPROC __tact_not_null DECLPROC __tact_context_get DECLPROC __tact_verify_address + DECLPROC __tact_store_bool DECLPROC __tact_load_address DECLPROC __tact_load_address_opt DECLPROC __tact_store_address DECLPROC __tact_store_address_opt + DECLPROC __tact_create_address DECLPROC __tact_compute_contract_address DECLPROC __tact_address_eq DECLPROC __tact_dict_set_code @@ -22,33 +24,31 @@ PROGRAM{ DECLPROC __gen_read_SampleJetton DECLPROC __gen_StateInit_get_code DECLPROC __gen_Context_get_sender + DECLPROC __gen_JettonData_to_external DECLPROC __gen_load_SampleJetton DECLPROC __gen_store_SampleJetton - DECLPROC storeBool - DECLPROC emptyCell - DECLPROC __gen_Cell_asSlice - DECLPROC emptySlice - DECLPROC contractAddress - DECLPROC send - DECLPROC __gen_JettonDefaultWallet_init - DECLPROC __gen_JettonDefaultWallet_init_child - DECLPROC __gen_SampleJetton_init - DECLPROC __gen_SampleJetton_getJettonWalletInit - DECLPROC __gen_SampleJetton_get_wallet_address - 103289 DECLMETHOD __gen_get_get_wallet_address - DECLPROC __gen_SampleJetton_get_jetton_data - 106029 DECLMETHOD __gen_get_get_jetton_data - DECLPROC __gen_SampleJetton_mint - DECLPROC __gen_SampleJetton_requireWallet - DECLPROC __gen_SampleJetton_requireOwner - DECLPROC __gen_SampleJetton_owner - 83229 DECLMETHOD __gen_get_owner - DECLPROC __gen_SampleJetton_receive_Mint - DECLPROC __gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2 - DECLPROC __gen_SampleJetton_receive_TokenUpdateContent - DECLPROC __gen_SampleJetton_receive_TokenBurnNotification + DECLPROC $emptyCell + DECLPROC $__gen_Cell_asSlice + DECLPROC $emptySlice + DECLPROC $contractAddress + DECLPROC $send + DECLPROC $__gen_JettonDefaultWallet_init + DECLPROC $__gen_JettonDefaultWallet_init_child + DECLPROC $__gen_SampleJetton_getJettonWalletInit + DECLPROC $__gen_SampleJetton_get_wallet_address + 103289 DECLMETHOD $__gen_get_get_wallet_address + DECLPROC $__gen_SampleJetton_get_jetton_data + 106029 DECLMETHOD $__gen_get_get_jetton_data + DECLPROC $__gen_SampleJetton_mint + DECLPROC $__gen_SampleJetton_requireWallet + DECLPROC $__gen_SampleJetton_requireOwner + DECLPROC $__gen_SampleJetton_owner + 83229 DECLMETHOD $__gen_get_owner + DECLPROC $__gen_SampleJetton_receive_Mint + DECLPROC $__gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2 + DECLPROC $__gen_SampleJetton_receive_TokenUpdateContent + DECLPROC $__gen_SampleJetton_receive_TokenBurnNotification DECLPROC recv_internal - 122307 DECLMETHOD init_SampleJetton 113617 DECLMETHOD supported_interfaces DECLPROC get_abi_ipfs DECLGLOBVAR __tact_context @@ -66,7 +66,11 @@ PROGRAM{ SBITS 267 PUSHINT NEQ - 134 THROWIFNOT + 136 THROWIFNOT + }> + __tact_store_bool PROCINLINE:<{ + SWAP + 1 STI }> __tact_load_address PROCINLINE:<{ LDMSGADDR @@ -99,34 +103,37 @@ PROGRAM{ __tact_store_address INLINECALLDICT }> }> - __tact_compute_contract_address PROC:<{ + __tact_create_address PROCINLINE:<{ NEWC - 0 PUSHINT - SWAP - 2 STU - 3 PUSHINT + 2 PUSHINT SWAP 2 STU 0 PUSHINT SWAP 1 STU s1 s2 XCHG - STREF - STREF + 8 STI + 256 STU ENDC - HASHCU + CTOS + }> + __tact_compute_contract_address PROCINLINE:<{ NEWC - 2 PUSHINT + 0 PUSHINT + SWAP + 2 STU + 3 PUSHINT SWAP 2 STU 0 PUSHINT SWAP 1 STU s1 s2 XCHG - 8 STI - 256 STU + STREF + STREF ENDC - CTOS + HASHCU + __tact_create_address INLINECALLDICT }> __tact_address_eq PROCINLINE:<{ SDEQ @@ -141,9 +148,9 @@ PROGRAM{ 16 PUSHINT DICTUGETREF NULLSWAPIFNOT - 100 THROWIFNOT + 135 THROWIFNOT }> - __gen_write_TokenTransferInternal PROCINLINE:<{ + __gen_write_TokenTransferInternal PROCREF:<{ 395134233 PUSHINT s0 s7 XCHG2 32 STU @@ -160,13 +167,13 @@ PROGRAM{ SWAP STSLICER }> - __gen_writecell_TokenTransferInternal PROCINLINE:<{ + __gen_writecell_TokenTransferInternal PROCREF:<{ NEWC 6 -ROLL __gen_write_TokenTransferInternal INLINECALLDICT ENDC }> - __gen_read_TokenBurnNotification PROCINLINE:<{ + __gen_read_TokenBurnNotification PROCREF:<{ 32 LDU SWAP 2078119902 PUSHINT @@ -180,45 +187,45 @@ PROGRAM{ s1 s4 XCHG s3 s3 s0 XCHG3 }> - __gen_write_TokenExcesses PROCINLINE:<{ + __gen_write_TokenExcesses PROCREF:<{ 3576854235 PUSHINT ROT 32 STU 64 STU }> - __gen_writecell_TokenExcesses PROCINLINE:<{ + __gen_writecell_TokenExcesses PROCREF:<{ NEWC SWAP __gen_write_TokenExcesses INLINECALLDICT ENDC }> - __gen_read_TokenUpdateContent PROCINLINE:<{ + __gen_read_TokenUpdateContent PROCREF:<{ 32 LDU SWAP - 1862840892 PUSHINT + 201882270 PUSHINT EQUAL 129 THROWIFNOT - PUSHNULL - SWAP 1 LDI SWAP IF:<{ - NIP LDREF + }>ELSE<{ + PUSHNULL + SWAP }> SWAP }> - __gen_read_Mint PROCINLINE:<{ + __gen_read_Mint PROCREF:<{ 32 LDU SWAP - 2737462367 PUSHINT + 33240155 PUSHINT EQUAL 129 THROWIFNOT 257 PUSHINT LDIX SWAP }> - __gen_write_JettonDefaultWallet PROCINLINE:<{ + __gen_write_JettonDefaultWallet PROCREF:<{ s2 s3 XCHG2 257 PUSHINT STIX @@ -227,42 +234,42 @@ PROGRAM{ SWAP __tact_store_address INLINECALLDICT }> - __gen_write_SampleJetton PROCINLINE:<{ + __gen_write_SampleJetton PROCREF:<{ s4 s3 XCHG2 STGRAMS SWAP __tact_store_address INLINECALLDICT s2 PUSH ISNULL + NOT IF:<{ - s2 POP - FALSE - ROT - 1 STI - }>ELSE<{ TRUE SWAP 1 STI s1 s2 XCHG STREF + }>ELSE<{ + s2 POP + FALSE + ROT + 1 STI }> 1 STI }> - __gen_read_SampleJetton PROCINLINE:<{ + __gen_read_SampleJetton PROCREF:<{ LDGRAMS __tact_load_address INLINECALLDICT - PUSHNULL - s0 s2 XCHG + SWAP 1 LDI SWAP IF:<{ - 1 2 BLKDROP2 LDREF - s1 s2 XCHG + }>ELSE<{ + PUSHNULL + SWAP }> 1 LDI - s0 s4 XCHG - s3 s3 XCHG2 + 4 -ROLL }> __gen_StateInit_get_code PROCINLINE:<{ DROP @@ -271,7 +278,9 @@ PROGRAM{ s2 s3 XCHG 3 BLKDROP }> - __gen_load_SampleJetton PROCINLINE:<{ + __gen_JettonData_to_external PROC:<{ + }> + __gen_load_SampleJetton PROCREF:<{ c4 PUSH CTOS LDREF @@ -280,7 +289,7 @@ PROGRAM{ __gen_read_SampleJetton INLINECALLDICT 1 4 BLKDROP2 }> - __gen_store_SampleJetton PROCINLINE:<{ + __gen_store_SampleJetton PROCREF:<{ NEWC __tact_context_sys GETGLOB SWAP @@ -290,39 +299,29 @@ PROGRAM{ ENDC c4 POP }> - storeBool PROC:<{ - IFJMP:<{ - -1 PUSHINT - SWAP - 1 STI - }> - 0 PUSHINT - SWAP - 1 STI - }> - emptyCell PROC:<{ + $emptyCell PROC:<{ NEWC ENDC }> - __gen_Cell_asSlice PROC:<{ + $__gen_Cell_asSlice PROC:<{ CTOS }> - emptySlice PROC:<{ - emptyCell CALLDICT - __gen_Cell_asSlice CALLDICT + $emptySlice PROC:<{ + $emptyCell CALLDICT + $__gen_Cell_asSlice CALLDICT }> - contractAddress PROC:<{ + $contractAddress PROC:<{ 0 PUSHINT -ROT - __tact_compute_contract_address CALLDICT + __tact_compute_contract_address INLINECALLDICT }> - send PROC:<{ + $send PROC:<{ NEWC 1 PUSHINT SWAP 2 STI s0 s7 XCHG2 - storeBool CALLDICT + __tact_store_bool INLINECALLDICT 0 PUSHINT SWAP 3 STI @@ -342,18 +341,18 @@ PROGRAM{ OR IF:<{ TRUE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT NEWC FALSE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT FALSE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT s4 PUSH ISNULL NOT IF:<{ TRUE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT s0 s4 XCHG __tact_not_null CALLDICT s0 s4 XCHG2 @@ -362,14 +361,14 @@ PROGRAM{ s4 POP s0 s3 XCHG FALSE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT }> s4 PUSH ISNULL NOT IF:<{ TRUE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT s0 s4 XCHG __tact_not_null CALLDICT s0 s4 XCHG2 @@ -378,13 +377,13 @@ PROGRAM{ s4 POP s0 s3 XCHG FALSE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT }> FALSE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT s0 s2 XCHG TRUE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT s0 s2 XCHG ENDC ROT @@ -394,14 +393,14 @@ PROGRAM{ s3 POP SWAP FALSE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT }> OVER ISNULL NOT IF:<{ TRUE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT SWAP __tact_not_null CALLDICT SWAP @@ -409,13 +408,13 @@ PROGRAM{ }>ELSE<{ NIP FALSE - storeBool CALLDICT + __tact_store_bool INLINECALLDICT }> ENDC SWAP SENDRAWMSG }> - __gen_JettonDefaultWallet_init PROC:<{ + $__gen_JettonDefaultWallet_init PROC:<{ 0 PUSHINT s0 s3 XCHG NEWC @@ -424,78 +423,66 @@ PROGRAM{ __gen_write_JettonDefaultWallet INLINECALLDICT ENDC }> - __gen_JettonDefaultWallet_init_child PROC:<{ + $__gen_JettonDefaultWallet_init_child PROC:<{ s0 s2 XCHG CTOS LDDICT DROP - DUP - 55471 PUSHINT - __tact_dict_get_code INLINECALLDICT NEWDICT - s0 s2 XCHG + SWAP 55471 PUSHINT __tact_dict_get_code INLINECALLDICT - s1 s2 XCHG - 55471 PUSHINT SWAP + 55471 PUSHINT + s2 PUSH __tact_dict_set_code INLINECALLDICT NEWC STDICT ENDC s0 s0 s3 XCHG3 - __gen_JettonDefaultWallet_init CALLDICT + $__gen_JettonDefaultWallet_init CALLDICT }> - __gen_SampleJetton_init PROC:<{ - 0 PUSHINT - TRUE - s0 s4 XCHG - NEWC - STREF - s3 s3 s4 XCHG3 - __gen_write_SampleJetton INLINECALLDICT - ENDC - }> - __gen_SampleJetton_getJettonWalletInit PROC:<{ + $__gen_SampleJetton_getJettonWalletInit PROC:<{ __tact_context_sys GETGLOB MYADDR ROT - __gen_JettonDefaultWallet_init_child CALLDICT + $__gen_JettonDefaultWallet_init_child CALLDICT }> - __gen_SampleJetton_get_wallet_address PROC:<{ - __gen_SampleJetton_getJettonWalletInit CALLDICT + $__gen_SampleJetton_get_wallet_address PROC:<{ + $__gen_SampleJetton_getJettonWalletInit CALLDICT 4 2 BLKDROP2 - contractAddress CALLDICT + $contractAddress CALLDICT }> - __gen_get_get_wallet_address PROC:<{ + $__gen_get_get_wallet_address PROC:<{ __gen_load_SampleJetton INLINECALLDICT 4 ROLL - __gen_SampleJetton_get_wallet_address CALLDICT + $__gen_SampleJetton_get_wallet_address CALLDICT }> - __gen_SampleJetton_get_jetton_data PROC:<{ + $__gen_SampleJetton_get_jetton_data PROC:<{ MYADDR - __gen_SampleJetton_getJettonWalletInit CALLDICT + $__gen_SampleJetton_getJettonWalletInit CALLDICT __gen_StateInit_get_code INLINECALLDICT s3 s3 s0 XCHG3 }> - __gen_get_get_jetton_data PROC:<{ + $__gen_get_get_jetton_data PROC:<{ __gen_load_SampleJetton INLINECALLDICT - __gen_SampleJetton_get_jetton_data CALLDICT + $__gen_SampleJetton_get_jetton_data CALLDICT + __gen_JettonData_to_external CALLDICT }> - __gen_SampleJetton_mint PROC:<{ + $__gen_SampleJetton_mint PROC:<{ s6 s1 XCPU ADD 4 2 BLKSWAP - __gen_SampleJetton_getJettonWalletInit CALLDICT + $__gen_SampleJetton_getJettonWalletInit CALLDICT 2DUP - contractAddress CALLDICT + $contractAddress CALLDICT FALSE 0 PUSHINT 64 PUSHINT OVER MYADDR OVER - emptySlice CALLDICT + $emptySlice CALLDICT s3 s5 XCHG s4 s14 XCHG s2 s3 XCHG @@ -505,66 +492,66 @@ PROGRAM{ s4 s10 XCHG s3 s9 XCHG s0 s10 s9 XCHG3 - send CALLDICT + $send CALLDICT 2SWAP }> - __gen_SampleJetton_requireWallet PROC:<{ + $__gen_SampleJetton_requireWallet PROC:<{ __tact_context_get INLINECALLDICT s2 s3 XCHG 3 BLKDROP 5 -ROLL - __gen_SampleJetton_getJettonWalletInit CALLDICT + $__gen_SampleJetton_getJettonWalletInit CALLDICT SWAP 4429 PUSHINT s0 s2 XCHG - contractAddress CALLDICT + $contractAddress CALLDICT s0 s6 XCHG2 __tact_address_eq INLINECALLDICT s1 s5 XCHG THROWANYIFNOT 3 ROLL }> - __gen_SampleJetton_requireOwner PROC:<{ + $__gen_SampleJetton_requireOwner PROC:<{ __tact_context_get INLINECALLDICT __gen_Context_get_sender INLINECALLDICT s3 PUSH __tact_address_eq INLINECALLDICT 132 THROWIFNOT }> - __gen_SampleJetton_owner PROC:<{ + $__gen_SampleJetton_owner PROC:<{ s2 s3 XCHG 3 BLKDROP }> - __gen_get_owner PROC:<{ + $__gen_get_owner PROC:<{ __gen_load_SampleJetton INLINECALLDICT - __gen_SampleJetton_owner CALLDICT + $__gen_SampleJetton_owner CALLDICT }> - __gen_SampleJetton_receive_Mint PROC:<{ + $__gen_SampleJetton_receive_Mint PROC:<{ __tact_context_get INLINECALLDICT s2 s3 XCHG 3 BLKDROP TUCK - __gen_SampleJetton_mint CALLDICT + $__gen_SampleJetton_mint CALLDICT }> - __gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2 PROC:<{ + $__gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2 PROC:<{ __tact_context_get INLINECALLDICT s2 s3 XCHG 3 BLKDROP 1000000000 PUSHINT OVER - __gen_SampleJetton_mint CALLDICT + $__gen_SampleJetton_mint CALLDICT }> - __gen_SampleJetton_receive_TokenUpdateContent PROC:<{ + $__gen_SampleJetton_receive_TokenUpdateContent PROC:<{ 4 -ROLL - __gen_SampleJetton_requireOwner CALLDICT + $__gen_SampleJetton_requireOwner CALLDICT NIP s1 s3 s0 XCHG3 }> - __gen_SampleJetton_receive_TokenBurnNotification PROC:<{ + $__gen_SampleJetton_receive_TokenBurnNotification PROC:<{ s4 s7 XCHG s3 s6 XCHG s5 s7 s7 XCHG3 - __gen_SampleJetton_requireWallet CALLDICT + $__gen_SampleJetton_requireWallet CALLDICT s3 s4 XCHG2 SUB s5 PUSH @@ -581,7 +568,7 @@ PROGRAM{ s1 s7 s0 XCHG3 PUSHNULL PUSHNULL - send CALLDICT + $send CALLDICT s2 s3 XCHG }>ELSE<{ s4 POP @@ -590,6 +577,7 @@ PROGRAM{ s3 s0 s0 XCHG3 }> recv_internal PROC:<{ + c2 SAVE SAMEALTSAVE 0 PUSHINT OVER @@ -623,7 +611,7 @@ PROGRAM{ 2DROP }> DUP - 2737462367 PUSHINT + 33240155 PUSHINT EQUAL IFJMP:<{ DROP @@ -633,11 +621,11 @@ PROGRAM{ NIP s3 s4 XCHG s1 s3 s0 XCHG3 - __gen_SampleJetton_receive_Mint CALLDICT + $__gen_SampleJetton_receive_Mint CALLDICT __gen_store_SampleJetton INLINECALLDICT }> DUP - 1862840892 PUSHINT + 201882270 PUSHINT EQUAL IFJMP:<{ DROP @@ -647,7 +635,7 @@ PROGRAM{ NIP s3 s4 XCHG s1 s3 s0 XCHG3 - __gen_SampleJetton_receive_TokenUpdateContent CALLDICT + $__gen_SampleJetton_receive_TokenUpdateContent CALLDICT __gen_store_SampleJetton INLINECALLDICT }> DUP @@ -663,7 +651,7 @@ PROGRAM{ s5 s6 XCHG s4 s5 XCHG 3 ROLL - __gen_SampleJetton_receive_TokenBurnNotification CALLDICT + $__gen_SampleJetton_receive_TokenBurnNotification CALLDICT __gen_store_SampleJetton INLINECALLDICT }> 0 EQINT @@ -673,7 +661,7 @@ PROGRAM{ EQUAL IFJMP:<{ __gen_load_SampleJetton INLINECALLDICT - __gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2 CALLDICT + $__gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2 CALLDICT __gen_store_SampleJetton INLINECALLDICT RETALT }> @@ -682,9 +670,6 @@ PROGRAM{ }> 130 THROW }> - init_SampleJetton PROC:<{ - __gen_SampleJetton_init CALLDICT - }> supported_interfaces PROC:<{ 123515602279859691144772641439386770278 PUSHINT 209801025412363888721030803524359905849 PUSHINT @@ -692,6 +677,6 @@ PROGRAM{ 86142586315491086060343270784266291122 PUSHINT }> get_abi_ipfs PROC:<{ - x{697066733a2f2f516d66457644646d6d345146485a48796165586d786f517a6e367655614c746462566e6a75736576516370376541} PUSHSLICE + x{697066733a2f2f516d5066796f41766b5055717a7839336771384542635663634159584645626a6e71434d72485974795055486645} PUSHSLICE }> }END>c diff --git a/sources/output/jetton_SampleJetton.rev.fif b/sources/output/jetton_SampleJetton.code.rev.fif similarity index 51% rename from sources/output/jetton_SampleJetton.rev.fif rename to sources/output/jetton_SampleJetton.code.rev.fif index 75db1cb..4839ef9 100644 --- a/sources/output/jetton_SampleJetton.rev.fif +++ b/sources/output/jetton_SampleJetton.code.rev.fif @@ -1,6 +1,7 @@ SETCP0 (:methods recv_internal: + c2 SAVE SAMEALTSAVE 0 PUSHINT s1 PUSH @@ -38,294 +39,340 @@ SETCP0 }> PUSHCONT IFJMP s0 PUSH - 2737462367 PUSHINT + 33240155 PUSHINT EQUAL <{ s0 POP - c4 PUSH - CTOS - LDREF - s0 s1 XCHG - 2 SETGLOBVAR - LDGRAMS - LDMSGADDR - s0 s1 XCHG - PUSHNULL - s0 s2 XCHG - 1 LDI - s0 s1 XCHG <{ - 1 2 BLKDROP2 + c4 PUSH + CTOS LDREF - s1 s2 XCHG - }> PUSHCONT - IF - 1 LDI - s0 s4 XCHG - s3 s3 XCHG2 - 1 4 BLKDROP2 + s0 s1 XCHG + 2 SETGLOBVAR + <{ + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + 1 LDI + s0 s1 XCHG + <{ + LDREF + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + 1 LDI + 4 1 BLKSWAP + }> CALLREF + 1 4 BLKDROP2 + }> CALLREF s0 s4 XCHG - 32 LDU - s0 s1 XCHG - 2737462367 PUSHINT - EQUAL - 129 THROWIFNOT - 257 PUSHINT - LDI - s0 s1 XCHG + <{ + 32 LDU + s0 s1 XCHG + 33240155 PUSHINT + EQUAL + 129 THROWIFNOT + 257 PUSHINT + LDI + s0 s1 XCHG + }> CALLREF s1 POP s3 s4 XCHG s1 s3 s0 XCHG3 - 42 CALLDICT - NEWC - 2 GETGLOBVAR - s0 s1 XCHG - STREF - 4 1 BLKSWAP - s4 s3 XCHG2 - STGRAMS - s0 s1 XCHG - STSLICER - s2 PUSH - ISNULL - <{ - s2 POP - 0 PUSHINT - ROT - 1 STI - }> PUSHCONT + 43 CALLDICT <{ - -1 PUSHINT + NEWC + 2 GETGLOBVAR s0 s1 XCHG - 1 STI - s1 s2 XCHG STREF - }> PUSHCONT - IFELSE - 1 STI - ENDC - c4 POP - }> IFJMPREF + 4 1 BLKSWAP + <{ + s4 s3 XCHG2 + STGRAMS + s0 s1 XCHG + STSLICER + s2 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + s1 s2 XCHG + STREF + }> PUSHCONT + <{ + s2 POP + 0 PUSHINT + ROT + 1 STI + }> PUSHCONT + IFELSE + 1 STI + }> CALLREF + ENDC + c4 POP + }> CALLREF + }> PUSHCONT + IFJMP s0 PUSH - 1862840892 PUSHINT + 201882270 PUSHINT EQUAL <{ s0 POP - c4 PUSH - CTOS - LDREF - s0 s1 XCHG - 2 SETGLOBVAR - LDGRAMS - LDMSGADDR - s0 s1 XCHG - PUSHNULL - s0 s2 XCHG - 1 LDI - s0 s1 XCHG <{ - 1 2 BLKDROP2 + c4 PUSH + CTOS LDREF - s1 s2 XCHG - }> PUSHCONT - IF - 1 LDI - s0 s4 XCHG - s3 s3 XCHG2 - 1 4 BLKDROP2 + s0 s1 XCHG + 2 SETGLOBVAR + <{ + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + 1 LDI + s0 s1 XCHG + <{ + LDREF + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + 1 LDI + 4 1 BLKSWAP + }> CALLREF + 1 4 BLKDROP2 + }> CALLREF s0 s4 XCHG - 32 LDU - s0 s1 XCHG - 1862840892 PUSHINT - EQUAL - 129 THROWIFNOT - PUSHNULL - s0 s1 XCHG - 1 LDI - s0 s1 XCHG <{ - s1 POP - LDREF - }> PUSHCONT - IF - s0 s1 XCHG + 32 LDU + s0 s1 XCHG + 201882270 PUSHINT + EQUAL + 129 THROWIFNOT + 1 LDI + s0 s1 XCHG + <{ + LDREF + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + s0 s1 XCHG + }> CALLREF s1 POP s3 s4 XCHG s1 s3 s0 XCHG3 - 44 CALLDICT - NEWC - 2 GETGLOBVAR - s0 s1 XCHG - STREF - 4 1 BLKSWAP - s4 s3 XCHG2 - STGRAMS - s0 s1 XCHG - STSLICER - s2 PUSH - ISNULL - <{ - s2 POP - 0 PUSHINT - ROT - 1 STI - }> PUSHCONT + 45 CALLDICT <{ - -1 PUSHINT + NEWC + 2 GETGLOBVAR s0 s1 XCHG - 1 STI - s1 s2 XCHG STREF - }> PUSHCONT - IFELSE - 1 STI - ENDC - c4 POP - }> IFJMPREF + 4 1 BLKSWAP + <{ + s4 s3 XCHG2 + STGRAMS + s0 s1 XCHG + STSLICER + s2 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + s1 s2 XCHG + STREF + }> PUSHCONT + <{ + s2 POP + 0 PUSHINT + ROT + 1 STI + }> PUSHCONT + IFELSE + 1 STI + }> CALLREF + ENDC + c4 POP + }> CALLREF + }> PUSHCONT + IFJMP s0 PUSH 2078119902 PUSHINT EQUAL <{ s0 POP - c4 PUSH - CTOS - LDREF - s0 s1 XCHG - 2 SETGLOBVAR - LDGRAMS - LDMSGADDR - s0 s1 XCHG - PUSHNULL - s0 s2 XCHG - 1 LDI - s0 s1 XCHG <{ - 1 2 BLKDROP2 + c4 PUSH + CTOS LDREF - s1 s2 XCHG - }> PUSHCONT - IF - 1 LDI - s0 s4 XCHG - s3 s3 XCHG2 - 1 4 BLKDROP2 + s0 s1 XCHG + 2 SETGLOBVAR + <{ + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + 1 LDI + s0 s1 XCHG + <{ + LDREF + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + 1 LDI + 4 1 BLKSWAP + }> CALLREF + 1 4 BLKDROP2 + }> CALLREF s0 s4 XCHG - 32 LDU - s0 s1 XCHG - 2078119902 PUSHINT - EQUAL - 129 THROWIFNOT - 64 LDU - LDGRAMS - LDMSGADDR - s0 s1 XCHG - s0 s1 XCHG - LDMSGADDR - s1 PUSH - 2 PLDU - 0 NEQINT <{ + 32 LDU s0 s1 XCHG - }> PUSHCONT - <{ - s1 POP - PUSHNULL - }> PUSHCONT - IFELSE - s1 s4 XCHG - s3 s3 s0 XCHG3 + 2078119902 PUSHINT + EQUAL + 129 THROWIFNOT + 64 LDU + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s1 s4 XCHG + s3 s3 s0 XCHG3 + }> CALLREF s4 POP s6 s7 XCHG s5 s6 XCHG s4 s5 XCHG 1 3 BLKSWAP - 45 CALLDICT - NEWC - 2 GETGLOBVAR - s0 s1 XCHG - STREF - 4 1 BLKSWAP - s4 s3 XCHG2 - STGRAMS - s0 s1 XCHG - STSLICER - s2 PUSH - ISNULL - <{ - s2 POP - 0 PUSHINT - ROT - 1 STI - }> PUSHCONT + 46 CALLDICT <{ - -1 PUSHINT + NEWC + 2 GETGLOBVAR s0 s1 XCHG - 1 STI - s1 s2 XCHG STREF - }> PUSHCONT - IFELSE - 1 STI - ENDC - c4 POP - }> IFJMPREF + 4 1 BLKSWAP + <{ + s4 s3 XCHG2 + STGRAMS + s0 s1 XCHG + STSLICER + s2 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + s1 s2 XCHG + STREF + }> PUSHCONT + <{ + s2 POP + 0 PUSHINT + ROT + 1 STI + }> PUSHCONT + IFELSE + 1 STI + }> CALLREF + ENDC + c4 POP + }> CALLREF + }> PUSHCONT + IFJMP 0 EQINT <{ HASHSU 92748154967237992140665580847895802782213764542359950109876145449566260965554 PUSHINT EQUAL <{ - c4 PUSH - CTOS - LDREF - s0 s1 XCHG - 2 SETGLOBVAR - LDGRAMS - LDMSGADDR - s0 s1 XCHG - PUSHNULL - s0 s2 XCHG - 1 LDI - s0 s1 XCHG <{ - 1 2 BLKDROP2 + c4 PUSH + CTOS LDREF - s1 s2 XCHG - }> PUSHCONT - IF - 1 LDI - s0 s4 XCHG - s3 s3 XCHG2 - 1 4 BLKDROP2 - 43 CALLDICT - NEWC - 2 GETGLOBVAR - s0 s1 XCHG - STREF - 4 1 BLKSWAP - s4 s3 XCHG2 - STGRAMS - s0 s1 XCHG - STSLICER - s2 PUSH - ISNULL - <{ - s2 POP - 0 PUSHINT - ROT - 1 STI - }> PUSHCONT + s0 s1 XCHG + 2 SETGLOBVAR + <{ + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + 1 LDI + s0 s1 XCHG + <{ + LDREF + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + 1 LDI + 4 1 BLKSWAP + }> CALLREF + 1 4 BLKDROP2 + }> CALLREF + 44 CALLDICT <{ - -1 PUSHINT + NEWC + 2 GETGLOBVAR s0 s1 XCHG - 1 STI - s1 s2 XCHG STREF - }> PUSHCONT - IFELSE - 1 STI - ENDC - c4 POP + 4 1 BLKSWAP + <{ + s4 s3 XCHG2 + STGRAMS + s0 s1 XCHG + STSLICER + s2 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + s1 s2 XCHG + STREF + }> PUSHCONT + <{ + s2 POP + 0 PUSHINT + ROT + 1 STI + }> PUSHCONT + IFELSE + 1 STI + }> CALLREF + ENDC + c4 POP + }> CALLREF RETALT }> PUSHCONT IFJMP @@ -341,7 +388,22 @@ SETCP0 ISNULL 128 THROWIF - 8: + 26: + + 29: + NEWC + ENDC + + 30: + CTOS + + 31: + 29 CALLDICT + 30 CALLDICT + + 32: + 0 PUSHINT + ROTREV NEWC 0 PUSHINT s0 s1 XCHG @@ -370,40 +432,14 @@ SETCP0 ENDC CTOS - 26: - <{ - -1 PUSHINT - s0 s1 XCHG - 1 STI - }> PUSHCONT - IFJMP - 0 PUSHINT - s0 s1 XCHG - 1 STI - - 27: - NEWC - ENDC - - 28: - CTOS - - 29: - 27 CALLDICT - 28 CALLDICT - - 30: - 0 PUSHINT - ROTREV - 8 CALLDICT - - 31: + 33: NEWC 1 PUSHINT s0 s1 XCHG 2 STI s0 s7 XCHG2 - 26 CALLDICT + s0 s1 XCHG + 1 STI 0 PUSHINT s0 s1 XCHG 3 STI @@ -423,18 +459,22 @@ SETCP0 OR <{ -1 PUSHINT - 26 CALLDICT + s0 s1 XCHG + 1 STI NEWC 0 PUSHINT - 26 CALLDICT + s0 s1 XCHG + 1 STI 0 PUSHINT - 26 CALLDICT + s0 s1 XCHG + 1 STI s4 PUSH ISNULL NOT <{ -1 PUSHINT - 26 CALLDICT + s0 s1 XCHG + 1 STI s0 s4 XCHG 1 CALLDICT s0 s4 XCHG2 @@ -444,7 +484,8 @@ SETCP0 s4 POP s0 s3 XCHG 0 PUSHINT - 26 CALLDICT + s0 s1 XCHG + 1 STI }> PUSHCONT IFELSE s4 PUSH @@ -452,7 +493,8 @@ SETCP0 NOT <{ -1 PUSHINT - 26 CALLDICT + s0 s1 XCHG + 1 STI s0 s4 XCHG 1 CALLDICT s0 s4 XCHG2 @@ -462,14 +504,17 @@ SETCP0 s4 POP s0 s3 XCHG 0 PUSHINT - 26 CALLDICT + s0 s1 XCHG + 1 STI }> PUSHCONT IFELSE 0 PUSHINT - 26 CALLDICT + s0 s1 XCHG + 1 STI s0 s2 XCHG -1 PUSHINT - 26 CALLDICT + s0 s1 XCHG + 1 STI s0 s2 XCHG ENDC ROT @@ -480,7 +525,8 @@ SETCP0 s3 POP s0 s1 XCHG 0 PUSHINT - 26 CALLDICT + s0 s1 XCHG + 1 STI }> PUSHCONT IFELSE s1 PUSH @@ -488,60 +534,54 @@ SETCP0 NOT <{ -1 PUSHINT - 26 CALLDICT + s0 s1 XCHG + 1 STI s0 s1 XCHG 1 CALLDICT s0 s1 XCHG - STREF - }> PUSHCONT - <{ - s1 POP - 0 PUSHINT - 26 CALLDICT - }> PUSHCONT - IFELSE + STREF + }> IFREFELSEREF ENDC s0 s1 XCHG SENDRAWMSG + s1 POP + 0 PUSHINT + s0 s1 XCHG + 1 STI - 32: + 34: 0 PUSHINT s0 s3 XCHG NEWC STREF s3 s1 s3 XCHG3 - s2 s3 XCHG2 - 257 PUSHINT - STIX - s0 s1 XCHG - STSLICER - s0 s1 XCHG - STSLICER + <{ + s2 s3 XCHG2 + 257 PUSHINT + STIX + s0 s1 XCHG + STSLICER + s0 s1 XCHG + STSLICER + }> CALLREF ENDC - 33: + 35: s0 s2 XCHG CTOS LDDICT s0 POP - s0 PUSH - 55471 PUSHINT - s0 s1 XCHG - 16 PUSHINT - DICTUGETREF - NULLSWAPIFNOT - 100 THROWIFNOT PUSHNULL - s0 s2 XCHG + s0 s1 XCHG 55471 PUSHINT s0 s1 XCHG 16 PUSHINT DICTUGETREF NULLSWAPIFNOT - 100 THROWIFNOT - s1 s2 XCHG - 55471 PUSHINT + 135 THROWIFNOT s0 s1 XCHG + 55471 PUSHINT + s2 PUSH s0 s2 XCHG 16 PUSHINT DICTUSETREF @@ -549,127 +589,101 @@ SETCP0 STDICT ENDC s0 s0 s3 XCHG3 - 32 CALLDICT - - 34: - 0 PUSHINT - -1 PUSHINT - s0 s4 XCHG - NEWC - STREF - s3 s3 s4 XCHG3 - s4 s3 XCHG2 - STGRAMS - s0 s1 XCHG - STSLICER - s2 PUSH - ISNULL - <{ - s2 POP - 0 PUSHINT - ROT - 1 STI - }> PUSHCONT - <{ - -1 PUSHINT - s0 s1 XCHG - 1 STI - s1 s2 XCHG - STREF - }> PUSHCONT - IFELSE - 1 STI - ENDC + 34 CALLDICT - 35: + 36: 2 GETGLOBVAR MYADDR ROT - 33 CALLDICT - - 36: 35 CALLDICT - 4 2 BLKDROP2 - 30 CALLDICT 37: + 36 CALLDICT + 4 2 BLKDROP2 + 32 CALLDICT + + 38: MYADDR - 35 CALLDICT + 36 CALLDICT s0 POP s3 s3 s0 XCHG3 - 38: + 39: s6 s1 XCPU ADD 4 2 BLKSWAP - 35 CALLDICT + 36 CALLDICT 2DUP - 30 CALLDICT + 32 CALLDICT 0 PUSHINT 0 PUSHINT 64 PUSHINT s1 PUSH MYADDR s1 PUSH - 29 CALLDICT + 31 CALLDICT s3 s5 XCHG s4 s14 XCHG s2 s3 XCHG s2 s15 XCHG - NEWC - 6 1 BLKSWAP - 395134233 PUSHINT - s0 s7 XCHG2 - 32 STU - s1 s5 XCHG - 64 STU - s0 s3 XCHG2 - STGRAMS - s0 s1 XCHG - STSLICER - s0 s1 XCHG - s0 PUSH - ISNULL - <{ - s0 POP - 0 PUSHINT - s0 s1 XCHG - 2 STU - }> PUSHCONT <{ - STSLICER - }> PUSHCONT - IFELSE - s0 s1 XCHG - STGRAMS - s0 s1 XCHG - STSLICER - ENDC + NEWC + 6 1 BLKSWAP + <{ + 395134233 PUSHINT + s0 s7 XCHG2 + 32 STU + s1 s5 XCHG + 64 STU + s0 s3 XCHG2 + STGRAMS + s0 s1 XCHG + STSLICER + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + s0 s1 XCHG + STGRAMS + s0 s1 XCHG + STSLICER + }> CALLREF + ENDC + }> CALLREF s5 s6 s0 XCHG3 s4 s10 XCHG s3 s9 XCHG s0 s10 s9 XCHG3 - 31 CALLDICT + 33 CALLDICT 2SWAP - 39: + 40: 1 GETGLOBVAR 4 UNTUPLE s2 s3 XCHG 3 BLKDROP 5 1 BLKSWAP - 35 CALLDICT + 36 CALLDICT s0 s1 XCHG 4429 PUSHINT s0 s2 XCHG - 30 CALLDICT + 32 CALLDICT s0 s6 XCHG2 SDEQ s1 s5 XCHG THROWANYIFNOT 1 3 BLKSWAP - 40: + 41: 1 GETGLOBVAR 4 UNTUPLE s2 s3 XCHG @@ -678,38 +692,38 @@ SETCP0 SDEQ 132 THROWIFNOT - 41: + 42: s2 s3 XCHG 3 BLKDROP - 42: + 43: 1 GETGLOBVAR 4 UNTUPLE s2 s3 XCHG 3 BLKDROP TUCK - 38 CALLDICT + 39 CALLDICT - 43: + 44: 1 GETGLOBVAR 4 UNTUPLE s2 s3 XCHG 3 BLKDROP 1000000000 PUSHINT s1 PUSH - 38 CALLDICT + 39 CALLDICT - 44: + 45: 4 1 BLKSWAP - 40 CALLDICT + 41 CALLDICT s1 POP s1 s3 s0 XCHG3 - 45: + 46: s4 s7 XCHG s3 s6 XCHG s5 s7 s7 XCHG3 - 39 CALLDICT + 40 CALLDICT s3 s4 XCHG2 SUB s5 PUSH @@ -720,19 +734,23 @@ SETCP0 0 PUSHINT 66 PUSHINT s0 s7 XCHG - NEWC - s0 s1 XCHG - 3576854235 PUSHINT - ROT - 32 STU - 64 STU - ENDC + <{ + NEWC + s0 s1 XCHG + <{ + 3576854235 PUSHINT + ROT + 32 STU + 64 STU + }> CALLREF + ENDC + }> CALLREF s2 s4 XCHG s3 s8 XCHG s1 s7 s0 XCHG3 PUSHNULL PUSHNULL - 31 CALLDICT + 33 CALLDICT s2 s3 XCHG }> PUSHCONT <{ @@ -743,89 +761,99 @@ SETCP0 s3 s0 s0 XCHG3 owner: - c4 PUSH - CTOS - LDREF - s0 s1 XCHG - 2 SETGLOBVAR - LDGRAMS - LDMSGADDR - s0 s1 XCHG - PUSHNULL - s0 s2 XCHG - 1 LDI - s0 s1 XCHG <{ - 1 2 BLKDROP2 + c4 PUSH + CTOS LDREF - s1 s2 XCHG - }> PUSHCONT - IF - 1 LDI - s0 s4 XCHG - s3 s3 XCHG2 - 1 4 BLKDROP2 - 41 CALLDICT + s0 s1 XCHG + 2 SETGLOBVAR + <{ + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + 1 LDI + s0 s1 XCHG + <{ + LDREF + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + 1 LDI + 4 1 BLKSWAP + }> CALLREF + 1 4 BLKDROP2 + }> CALLREF + 42 CALLDICT get_wallet_address: - c4 PUSH - CTOS - LDREF - s0 s1 XCHG - 2 SETGLOBVAR - LDGRAMS - LDMSGADDR - s0 s1 XCHG - PUSHNULL - s0 s2 XCHG - 1 LDI - s0 s1 XCHG <{ - 1 2 BLKDROP2 + c4 PUSH + CTOS LDREF - s1 s2 XCHG - }> PUSHCONT - IF - 1 LDI - s0 s4 XCHG - s3 s3 XCHG2 - 1 4 BLKDROP2 + s0 s1 XCHG + 2 SETGLOBVAR + <{ + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + 1 LDI + s0 s1 XCHG + <{ + LDREF + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + 1 LDI + 4 1 BLKSWAP + }> CALLREF + 1 4 BLKDROP2 + }> CALLREF 1 4 BLKSWAP - 36 CALLDICT + 37 CALLDICT get_jetton_data: - c4 PUSH - CTOS - LDREF - s0 s1 XCHG - 2 SETGLOBVAR - LDGRAMS - LDMSGADDR - s0 s1 XCHG - PUSHNULL - s0 s2 XCHG - 1 LDI - s0 s1 XCHG <{ - 1 2 BLKDROP2 + c4 PUSH + CTOS LDREF - s1 s2 XCHG - }> PUSHCONT - IF - 1 LDI - s0 s4 XCHG - s3 s3 XCHG2 - 1 4 BLKDROP2 - 37 CALLDICT + s0 s1 XCHG + 2 SETGLOBVAR + <{ + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + 1 LDI + s0 s1 XCHG + <{ + LDREF + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + 1 LDI + 4 1 BLKSWAP + }> CALLREF + 1 4 BLKDROP2 + }> CALLREF + 38 CALLDICT + 26 CALLDICT 113617: 123515602279859691144772641439386770278 PUSHINT 209801025412363888721030803524359905849 PUSHINT 258390863389042349688353801369539695109 PUSHINT 86142586315491086060343270784266291122 PUSHINT - - 122307: - 34 CALLDICT ) 19 DICTPUSHCONST DICTIGETJMPZ 11 THROWARG diff --git a/sources/output/jetton_SampleJetton.init.boc b/sources/output/jetton_SampleJetton.init.boc new file mode 100644 index 0000000000000000000000000000000000000000..5923328bfe794d282e3c1de83ec9bb8a31eb5f30 GIT binary patch literal 86 zcmV-c0IC1A?woP~0S5s9O8@~B{{Zx)6ZE|D$O{1i0b&9J0s_qh1po=5O5NZI00Gni s71M+GCPrczrrG991^_frL;3;%&lVzXvzC7W$^a6~l`?Qx$^hcZ0QbxuzyJUM literal 0 HcmV?d00001 diff --git a/sources/output/jetton_SampleJetton.init.fc b/sources/output/jetton_SampleJetton.init.fc new file mode 100644 index 0000000..a6cecef --- /dev/null +++ b/sources/output/jetton_SampleJetton.init.fc @@ -0,0 +1,39 @@ +() __tact_verify_address(slice address) inline { + throw_unless(136, address.slice_bits() != 267); +} + +builder __tact_store_address(builder b, slice address) inline { + __tact_verify_address(address); + b = b.store_slice(address); + return b; +} + +builder __gen_write_SampleJetton(builder build_0, (int, slice, cell, int) v) inline_ref { + var (v'totalSupply, v'owner, v'content, v'mintable) = v; + build_0 = build_0.store_coins(v'totalSupply); + build_0 = __tact_store_address(build_0, v'owner); + build_0 = ~ null?(v'content) ? build_0.store_int(true, 1).store_ref(v'content) : build_0.store_int(false, 1); + build_0 = build_0.store_int(v'mintable, 1); + return build_0; +} + +cell $__gen_SampleJetton_init(cell sys', slice $owner, cell $content) { + var (($self'totalSupply, $self'owner, $self'content, $self'mintable)) = (null(), null(), null(), null()); + $self'totalSupply = 0; + $self'owner = $owner; + $self'mintable = true; + $self'content = $content; + var b' = begin_cell(); + b' = b'.store_ref(sys'); + b' = __gen_write_SampleJetton(b', ($self'totalSupply, $self'owner, $self'content, $self'mintable)); + return b'.end_cell(); +} + +cell init(cell sys', slice $$owner, cell $$content) method_id { + slice $owner = $$owner; + cell $content = $$content; + return $__gen_SampleJetton_init(sys', $owner, $content); +} + +() main() { +} \ No newline at end of file diff --git a/sources/output/jetton_SampleJetton.init.fif b/sources/output/jetton_SampleJetton.init.fif new file mode 100644 index 0000000..f00fd02 --- /dev/null +++ b/sources/output/jetton_SampleJetton.init.fif @@ -0,0 +1,54 @@ +PROGRAM{ + DECLPROC __tact_verify_address + DECLPROC __tact_store_address + DECLPROC __gen_write_SampleJetton + DECLPROC $__gen_SampleJetton_init + 107886 DECLMETHOD init + DECLPROC main + __tact_verify_address PROCINLINE:<{ + SBITS + 267 PUSHINT + NEQ + 136 THROWIFNOT + }> + __tact_store_address PROCINLINE:<{ + STSLICER + }> + __gen_write_SampleJetton PROCREF:<{ + s4 s3 XCHG2 + STGRAMS + SWAP + __tact_store_address INLINECALLDICT + s2 PUSH + ISNULL + NOT + IF:<{ + TRUE + SWAP + 1 STI + s1 s2 XCHG + STREF + }>ELSE<{ + s2 POP + FALSE + ROT + 1 STI + }> + 1 STI + }> + $__gen_SampleJetton_init PROC:<{ + 0 PUSHINT + TRUE + s0 s4 XCHG + NEWC + STREF + s3 s3 s4 XCHG3 + __gen_write_SampleJetton INLINECALLDICT + ENDC + }> + init PROC:<{ + $__gen_SampleJetton_init CALLDICT + }> + main PROC:<{ + }> +}END>c diff --git a/sources/output/jetton_SampleJetton.init.rev.fif b/sources/output/jetton_SampleJetton.init.rev.fif new file mode 100644 index 0000000..2348142 --- /dev/null +++ b/sources/output/jetton_SampleJetton.init.rev.fif @@ -0,0 +1,42 @@ +SETCP0 +(:methods + recv_internal: + + 4: + 0 PUSHINT + -1 PUSHINT + s0 s4 XCHG + NEWC + STREF + s3 s3 s4 XCHG3 + <{ + s4 s3 XCHG2 + STGRAMS + s0 s1 XCHG + STSLICER + s2 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + s1 s2 XCHG + STREF + }> PUSHCONT + <{ + s2 POP + 0 PUSHINT + ROT + 1 STI + }> PUSHCONT + IFELSE + 1 STI + }> CALLREF + ENDC + + 107886: + 4 CALLDICT +) 19 DICTPUSHCONST +DICTIGETJMPZ +11 THROWARG diff --git a/sources/output/jetton_SampleJetton.md b/sources/output/jetton_SampleJetton.md new file mode 100644 index 0000000..d1626c7 --- /dev/null +++ b/sources/output/jetton_SampleJetton.md @@ -0,0 +1,72 @@ +# TACT Compilation Report +Contract: SampleJetton +BOC Size: 1199 bytes + +# Types +Total Types: 14 + +## StateInit +TLB: `_ code:^cell data:^cell = StateInit` +Signature: `StateInit{code:^cell,data:^cell}` + +## Context +TLB: `_ bounced:bool sender:address value:int257 raw:^slice = Context` +Signature: `Context{bounced:bool,sender:address,value:int257,raw:^slice}` + +## SendParameters +TLB: `_ bounce:bool to:address value:int257 mode:int257 body:Maybe ^cell code:Maybe ^cell data:Maybe ^cell = SendParameters` +Signature: `SendParameters{bounce:bool,to:address,value:int257,mode:int257,body:Maybe ^cell,code:Maybe ^cell,data:Maybe ^cell}` + +## ChangeOwner +TLB: `change_owner#0f474d03 newOwner:address = ChangeOwner` +Signature: `ChangeOwner{newOwner:address}` + +## TokenTransfer +TLB: `token_transfer#0f8a7ea5 queryId:uint64 amount:coins destination:address responseDestination:Maybe address customPayload:Maybe ^cell forwardTonAmount:coins forwardPayload:remainder = TokenTransfer` +Signature: `TokenTransfer{queryId:uint64,amount:coins,destination:address,responseDestination:Maybe address,customPayload:Maybe ^cell,forwardTonAmount:coins,forwardPayload:remainder}` + +## TokenTransferInternal +TLB: `token_transfer_internal#178d4519 queryId:uint64 amount:coins from:address responseAddress:Maybe address forwardTonAmount:coins forwardPayload:remainder = TokenTransferInternal` +Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder}` + +## TokenNotification +TLB: `token_notification#7362d09c queryId:uint64 amount:coins from:address forwardPayload:remainder = TokenNotification` +Signature: `TokenNotification{queryId:uint64,amount:coins,from:address,forwardPayload:remainder}` + +## TokenBurn +TLB: `token_burn#595f07bc queryId:uint64 amount:coins owner:address responseAddress:Maybe address = TokenBurn` +Signature: `TokenBurn{queryId:uint64,amount:coins,owner:address,responseAddress:Maybe address}` + +## TokenBurnNotification +TLB: `token_burn_notification#7bdd97de queryId:uint64 amount:coins owner:address responseAddress:Maybe address = TokenBurnNotification` +Signature: `TokenBurnNotification{queryId:uint64,amount:coins,owner:address,responseAddress:Maybe address}` + +## TokenExcesses +TLB: `token_excesses#d53276db queryId:uint64 = TokenExcesses` +Signature: `TokenExcesses{queryId:uint64}` + +## TokenUpdateContent +TLB: `token_update_content#0c087a9e content:Maybe ^cell = TokenUpdateContent` +Signature: `TokenUpdateContent{content:Maybe ^cell}` + +## JettonData +TLB: `_ totalSupply:int257 mintable:bool owner:address content:Maybe ^cell walletCode:^cell = JettonData` +Signature: `JettonData{totalSupply:int257,mintable:bool,owner:address,content:Maybe ^cell,walletCode:^cell}` + +## JettonWalletData +TLB: `_ balance:int257 owner:address master:address walletCode:^cell = JettonWalletData` +Signature: `JettonWalletData{balance:int257,owner:address,master:address,walletCode:^cell}` + +## Mint +TLB: `mint#01fb345b amount:int257 = Mint` +Signature: `Mint{amount:int257}` + +# Get Methods +Total Get Methods: 3 + +## get_wallet_address +Argument: owner + +## get_jetton_data + +## owner diff --git a/sources/output/jetton_SampleJetton.pkg b/sources/output/jetton_SampleJetton.pkg new file mode 100644 index 0000000..980c5fb --- /dev/null +++ b/sources/output/jetton_SampleJetton.pkg @@ -0,0 +1 @@ +{"name":"SampleJetton","code":"te6ccgECQwEABKMAART/APSkE/S88sgLAQIBYgIDAgLKBAUCASAGBwIBIAwNAgFIICEBDb4o7tnngVQWAgFICAkCAVgKCwCVt3owTgudh6ullc9j0J2HOslQo2zQThO6xqWlbI+WZFp15b++LEcwThhMiKTJr7fJFy9sM7TqukCwTggZzq084r86ShYDrC3EyPZQARGtvO2eKoH4EsAWARGvFu2eeBN4DUAWAgHODg8CAVgaGwSdO2i7ftwIddJwh+VMCDXCx/eAtDTAwFxsMABkX+RcOIB+kAiUGZvBPhhApFb4CCCCfs0W7qPjzDbPATbPDEQNEEw8CvbPOAgghAMCHqeuoBYQFxEACwgbvLQgIAAk0x8Bggn7NFu68uCBgQEB1wABBDSPjzDbPATbPDEQNEEw8C3bPOAgghB73ZfeuhYSFxMALtMfAYIQDAh6nrry4IHSAAGR1JJtAeIBBDCPkzDbPATbPDQQZxBWEEVVAvAu2zzgwAAWFBcVAEzTHwGCEHvdl9668uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4hRDMAJwjzD5AYLwzQ2YbLGi9GiucIn0/DFiwRbl9T+9EaaDn1Lb9QQIMLK6jwjbPPAs2zzbMeCRMOLywIIWFwEW7UTQ1AH4Yts8bBQYARjI+EIBzFUw2zzJ7VQZACb6APpAAQHSAAGR1JJtAeLSAFUwADRQQ/oCAc8WIm6zln8BygASzJUycFjKAOLKAAABagIBIBwdAAVcjJgCASAeHwADNCAACTwHfAegAgEgIiMCASA1NgIBICQlAgEgLS4CASAmJwIBICorAEscFnIcAHLAXMBywFwAcsAEszMyfkAyHIBywFwAcsAEsoHy//J0IAL3MhxAcoBUAcBygBwAcoCUAXPFlAD+gJwAcpoI26zJW6zsY5GfwHKAMhwAcoAcAHKACRus5p/AcoABPABUATMljQDcAHKAOIkbrOafwHKAATwAVAEzJY0A3ABygDicAHKAAJ/AcoAAslYzJczMwFwAcoA4iFus+MPyQH7AICgpABJ/AcoAAfABAcwACjFwAcoAARMcAPIzEMT2zzJgLABRALQ9AQwbQGCANivAYAQ9A9vofLghwGCANivIgKAEPQXyPQAyUAD8CKAAGlAjgQEBzwABzxYBzxYCASAvMAIBIDEyAA8+EL4KFjwI4AANPAkbELwIIAAPPgo8CQwQzCABUxRYaBVMfAkXPAgcHCAQCH4KCHwHxA1EE4QIxAv2zxFYBBKEDlAqfAhWoDMBDMhVUNs8yTQAToIQF41FGVAHyx8Vyz9QA/oCAc8WASBulTBwAcsBks8W4gH6AgHPFgIBIDc4AgEgPT4CASA5OgIBIDs8ADk+EFvJBAjXwNVQPAkAYERTQLwIFAGxwUV8vRVAoAAdPhBbyQQI18DI8cF8uCEgAAkECNfA4AAXPhBbyQQI18DZvAngAgEgP0ABU0EEcQNkV38ChQNKElbrOOk3BwgEIH2zwQJBA4QXBtbfAhECOSNDTiQwCEEAIz4QW8kECNfA4IQO5rKACHwJ4AAPFUw8CkxQTCABCsgB2zzJQgAWghDVMnbbWMsfyz8=","abi":"{\"name\":\"SampleJetton\",\"types\":[{\"name\":\"StateInit\",\"header\":null,\"fields\":[{\"name\":\"code\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":false}},{\"name\":\"data\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":false}}]},{\"name\":\"Context\",\"header\":null,\"fields\":[{\"name\":\"bounced\",\"type\":{\"kind\":\"simple\",\"type\":\"bool\",\"optional\":false}},{\"name\":\"sender\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"value\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"raw\",\"type\":{\"kind\":\"simple\",\"type\":\"slice\",\"optional\":false}}]},{\"name\":\"SendParameters\",\"header\":null,\"fields\":[{\"name\":\"bounce\",\"type\":{\"kind\":\"simple\",\"type\":\"bool\",\"optional\":false}},{\"name\":\"to\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"value\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"mode\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"body\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":true}},{\"name\":\"code\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":true}},{\"name\":\"data\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":true}}]},{\"name\":\"ChangeOwner\",\"header\":256331011,\"fields\":[{\"name\":\"newOwner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}}]},{\"name\":\"TokenTransfer\",\"header\":260734629,\"fields\":[{\"name\":\"queryId\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":64}},{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"destination\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"responseDestination\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}},{\"name\":\"customPayload\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":true}},{\"name\":\"forwardTonAmount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"forwardPayload\",\"type\":{\"kind\":\"simple\",\"type\":\"slice\",\"optional\":false,\"format\":\"remainder\"}}]},{\"name\":\"TokenTransferInternal\",\"header\":395134233,\"fields\":[{\"name\":\"queryId\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":64}},{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"from\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"responseAddress\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}},{\"name\":\"forwardTonAmount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"forwardPayload\",\"type\":{\"kind\":\"simple\",\"type\":\"slice\",\"optional\":false,\"format\":\"remainder\"}}]},{\"name\":\"TokenNotification\",\"header\":1935855772,\"fields\":[{\"name\":\"queryId\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":64}},{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"from\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"forwardPayload\",\"type\":{\"kind\":\"simple\",\"type\":\"slice\",\"optional\":false,\"format\":\"remainder\"}}]},{\"name\":\"TokenBurn\",\"header\":1499400124,\"fields\":[{\"name\":\"queryId\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":64}},{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"owner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"responseAddress\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}}]},{\"name\":\"TokenBurnNotification\",\"header\":2078119902,\"fields\":[{\"name\":\"queryId\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":64}},{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"owner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"responseAddress\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}}]},{\"name\":\"TokenExcesses\",\"header\":3576854235,\"fields\":[{\"name\":\"queryId\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":64}}]},{\"name\":\"TokenUpdateContent\",\"header\":201882270,\"fields\":[{\"name\":\"content\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":true}}]},{\"name\":\"JettonData\",\"header\":null,\"fields\":[{\"name\":\"totalSupply\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"mintable\",\"type\":{\"kind\":\"simple\",\"type\":\"bool\",\"optional\":false}},{\"name\":\"owner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"content\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":true}},{\"name\":\"walletCode\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":false}}]},{\"name\":\"JettonWalletData\",\"header\":null,\"fields\":[{\"name\":\"balance\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"owner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"master\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"walletCode\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":false}}]},{\"name\":\"Mint\",\"header\":33240155,\"fields\":[{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}}]}],\"receivers\":[{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"Mint\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"text\",\"text\":\"Mint!\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"TokenUpdateContent\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"TokenBurnNotification\"}}],\"getters\":[{\"name\":\"get_wallet_address\",\"arguments\":[{\"name\":\"owner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}}],\"returnType\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"get_jetton_data\",\"arguments\":[],\"returnType\":{\"kind\":\"simple\",\"type\":\"JettonData\",\"optional\":false}},{\"name\":\"owner\",\"arguments\":[],\"returnType\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}}],\"errors\":{\"2\":{\"message\":\"Stack undeflow\"},\"3\":{\"message\":\"Stack overflow\"},\"4\":{\"message\":\"Integer overflow\"},\"5\":{\"message\":\"Integer out of expected range\"},\"6\":{\"message\":\"Invalid opcode\"},\"7\":{\"message\":\"Type check error\"},\"8\":{\"message\":\"Cell overflow\"},\"9\":{\"message\":\"Cell underflow\"},\"10\":{\"message\":\"Dictionary error\"},\"13\":{\"message\":\"Out of gas error\"},\"32\":{\"message\":\"Method ID not found\"},\"34\":{\"message\":\"Action is invalid or not supported\"},\"37\":{\"message\":\"Not enough TON\"},\"38\":{\"message\":\"Not enough extra-currencies\"},\"128\":{\"message\":\"Null reference exception\"},\"129\":{\"message\":\"Invalid serialization prefix\"},\"130\":{\"message\":\"Invalid incoming message\"},\"131\":{\"message\":\"Constraints error\"},\"132\":{\"message\":\"Access denied\"},\"133\":{\"message\":\"Contract stopped\"},\"134\":{\"message\":\"Invalid argument\"},\"135\":{\"message\":\"Code of a contract was not found\"},\"136\":{\"message\":\"Invalid address\"},\"4429\":{\"message\":\"Invalid sender\"},\"13650\":{\"message\":\"Invalid bounced message\"},\"16059\":{\"message\":\"Invalid value\"},\"62972\":{\"message\":\"Invalid balance\"}}}","init":{"code":"te6ccgEBBwEASwABFP8A9KQT9LzyyAsBAgFiAgMCAs0EBQAJoUrd4AkAAdQBFdOD+CZGYhmm2eZMBgA0UEP6AgHPFiJus5Z/AcoAEsyVMnBYygDiygA=","args":[{"name":"owner","type":{"kind":"simple","type":"address","optional":false}},{"name":"content","type":{"kind":"simple","type":"cell","optional":true}}],"deployment":{"kind":"system-cell","system":"te6cckECdAEACWsAAQHAAQIBIDACAQW+xXwDART/APSkE/S88sgLBAIBYggFAgEgBwYAcb3ejBOC52Hq6WVz2PQnYc6yVCjbNBOE7rGpaVsj5ZkWnXlv74sRzBOE7o8AHy2bAeT+QdWSzWUQnAERv9gW2eeBN4D0LgICyiIJAgFIFQoCAUgMCwBPSAINch0x/TPzH6ADCBNVIighAXjUUZugOCEHvdl966E7ES8vQToAKAIBIBANAY8W/hBbySBEU1TOMcF8vRRhKGCAPX8IcL/8vRDMFI58COBPrsBggkxLQCgggiYloCgErzy9H9wA4BAVDNm2zxUEwRQM21t8CKAOAQzIVTDbPMkPAECCEHvdl95QBcsfE8s/AfoCAc8WASBulTBwAcsBks8W4gPxPhBbyRTKscFs44S+EJTuPAlAYERTQLwISTHBfL03lHIoIIA9fwhwv/y9CH4J28QIaGCCJiWgGa2CKGCCJiWgKChJsIAjqFQTUMw8CNSMKAaoXBwKEgTUHTbPCgQRkMTUFVtbfAiUAWWEH1QiV8I4iVusyLCALDjD4BMSEQAENVsBInAG8AJwBNs8EEdDMBdtbfAiPwEMyFUw2zzJFAAsghBzYtCcUAXLHxPLPwH6AgHPFgHPFgIBIBwWAgEgGhcCASAZGAG5Gwi+EFvJIERTVM7xwXy9FG3oYIA9fwhwv/y9EMwUjzwI3EkwgCSMHLegT67AqiCCTEtAKCCCJiWgKASvPL0+EJUIGTwJVzwIX9QdnCAQCtUTDkY2zwQVhA0WfAigTwAPPhCUxLwJTCACASBYGwBRALQ9AQwbQGCANivAYAQ9A9vofLghwGCANivIgKAEPQXyPQAyUAD8CSACASAhHQIBIB8eACUbDH6ADFx1yH6ADH6ADCnA6sAgAvcyHEBygFQBwHKAHABygJQBc8WUAP6AnABymgjbrMlbrOxjkZ/AcoAyHABygBwAcoAJG6zmn8BygAE8AJQBMyWNANwAcoA4iRus5p/AcoABPACUATMljQDcAHKAOJwAcoAAn8BygACyVjMlzMzAXABygDiIW6z4w/JAfsAgIFwAEn8BygAB8AIBzABLVwWchwAcsBcwHLAXABywASzMzJ+QDIcgHLAXABywASygfL/8nQgCASAkIwADp0ACAWImJQALQgbvLQgIBIlHAh10nCH5UwINcLH94C0NMDAXGwwAGRf5Fw4gH6QCJQZm8E+GECjwkw2zxVAvAq2zzgIIIQD4p+pbrjAiCCEBeNRRm6guLSsnBDaPkTDbPAPbPDYQeBBnVQTwKNs84IIQWV8HvLouKi0oAy6PkNs8A9s8NBBWEEVVAvAp2zzgMPLAgi4pLQBM0x8BghBZXwe8uvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIUQzAAWNMfAYIQF41FGbry4IHTP/oA+kABAfpAIdcLAcMAkQGSMW3iAfoAUVUVFEMwAyIw2zwD2zw3EIkQeFUF8CfbPC4sLQBs0x8BghAPin6luvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIB0gABkdSSbQHi+gBRZhYVFEMwARjI+EIBzFUg2zzJ7VRZARbtRNDUAfhi2zxsEy8AHIEBAdcA+kABAfpAAUMwAQW9XCwxART/APSkE/S88sgLMgIBYjozAgEgOTQCAUg2NQCVt3owTgudh6ullc9j0J2HOslQo2zQThO6xqWlbI+WZFp15b++LEcwThhMiKTJr7fJFy9sM7TqukCwTggZzq084r86ShYDrC3EyPZQAgFYODcBEa8W7Z54E3gNQHIBEa287Z4qgfgSwHIBDb4o7tnngVRyAgLKXzsCAUhLPAIBIEQ9AgEgQT4BU0EEcQNkV38ChQNKElbrOOk3BwgEIH2zwQJBA4QXBtbfAhECOSNDTiQwCD8BCsgB2zzJQAAWghDVMnbbWMsfyz8CASBDQgAPFUw8CkxQTCAAIz4QW8kECNfA4IQO5rKACHwJ4AIBIEhFAgEgR0YAFz4QW8kECNfA2bwJ4AAJBAjXwOACASBKSQAdPhBbyQQI18DI8cF8uCEgADk+EFvJBAjXwNVQPAkAYERTQLwIFAGxwUV8vRVAoAIBIFVMAgEgUk0CASBRTgFTFFhoFUx8CRc8CBwcIBAIfgoIfAfEDUQThAjEC/bPEVgEEoQOUCp8CFagTwEMyFVQ2zzJUABOghAXjUUZUAfLHxXLP1AD+gIBzxYBIG6VMHABywGSzxbiAfoCAc8WAA8+CjwJDBDMIAIBIFRTAA08CRsQvAggAA8+EL4KFjwI4AIBIFpWAgEgWFcAUQC0PQEMG0BggDYrwGAEPQPb6Hy4IcBggDYryICgBD0F8j0AMlAA/AigARMcAPIzEMT2zzJgWQAaUCOBAQHPAAHPFgHPFgIBIF5bAvcyHEBygFQBwHKAHABygJQBc8WUAP6AnABymgjbrMlbrOxjkZ/AcoAyHABygBwAcoAJG6zmn8BygAE8AFQBMyWNANwAcoA4iRus5p/AcoABPABUATMljQDcAHKAOJwAcoAAn8BygACyVjMlzMzAXABygDiIW6z4w/JAfsAgXVwACjFwAcoAABJ/AcoAAfABAcwASxwWchwAcsBcwHLAXABywASzMzJ+QDIcgHLAXABywASygfL/8nQgAgEgZ2ACAVhmYQIBIGViAgEgZGMACTwHfAegAAM0IAAFXIyYAAFqAgHOaWgACwgbvLQgIASdO2i7ftwIddJwh+VMCDXCx/eAtDTAwFxsMABkX+RcOIB+kAiUGZvBPhhApFb4CCCCfs0W7qPjzDbPATbPDEQNEEw8CvbPOAgghAMCHqeuoHJxb2oENI+PMNs8BNs8MRA0QTDwLds84CCCEHvdl966cm5vawQwj5Mw2zwE2zw0EGcQVhBFVQLwLts84MAAcm1vbAJwjzD5AYLwzQ2YbLGi9GiucIn0/DFiwRbl9T+9EaaDn1Lb9QQIMLK6jwjbPPAs2zzbMeCRMOLywIJybwBM0x8BghB73ZfeuvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIUQzAALtMfAYIQDAh6nrry4IHSAAGR1JJtAeIBARjI+EIBzFUw2zzJ7VRwADRQQ/oCAc8WIm6zln8BygASzJUycFjKAOLKAAAk0x8Bggn7NFu68uCBgQEB1wABARbtRNDUAfhi2zxsFHMAJvoA+kABAdIAAZHUkm0B4tIAVTC+msWv"}},"compiler":{"name":"tact","version":"0.8.7"}} \ No newline at end of file diff --git a/sources/output/jetton_SampleJetton.ts b/sources/output/jetton_SampleJetton.ts index 9b4ed18..ee0c5d9 100644 --- a/sources/output/jetton_SampleJetton.ts +++ b/sources/output/jetton_SampleJetton.ts @@ -1,6 +1,5 @@ -import { Cell, Slice, StackItem, Address, Builder, InternalMessage, CommonMessageInfo, CellMessage, beginCell, serializeDict, TupleSlice4, readString, stringToCell } from 'ton'; -import { ContractExecutor, createExecutorFromCode, ExecuteError } from 'ton-nodejs'; -import BN from 'bn.js'; +import { Cell, Slice, Address, Builder, beginCell, ComputeError, TupleItem, TupleReader, Dictionary, contractAddress, ContractProvider, Sender, Contract, ContractABI, TupleBuilder, DictionaryValue } from 'ton-core'; +import { ContractSystem, ContractExecutor } from 'ton-emulator'; export type StateInit = { $$type: 'StateInit'; @@ -8,883 +7,875 @@ export type StateInit = { data: Cell; } -export function packStateInit(src: StateInit): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeRef(src.code); - b_0 = b_0.storeRef(src.data); - return b_0.endCell(); +export function storeStateInit(src: StateInit) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeRef(src.code); + b_0.storeRef(src.data); + }; } -export function packStackStateInit(src: StateInit, __stack: StackItem[]) { - __stack.push({ type: 'cell', cell: src.code }); - __stack.push({ type: 'cell', cell: src.data }); +export function loadStateInit(slice: Slice) { + let sc_0 = slice; + let _code = sc_0.loadRef(); + let _data = sc_0.loadRef(); + return { $$type: 'StateInit' as const, code: _code, data: _data }; } -export function packTupleStateInit(src: StateInit): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'cell', cell: src.code }); - __stack.push({ type: 'cell', cell: src.data }); - return __stack; +function loadTupleStateInit(source: TupleReader) { + let _code = source.readCell(); + let _data = source.readCell(); + return { $$type: 'StateInit' as const, code: _code, data: _data }; } -export function unpackStackStateInit(slice: TupleSlice4): StateInit { - const code = slice.readCell(); - const data = slice.readCell(); - return { $$type: 'StateInit', code: code, data: data }; +function storeTupleStateInit(source: StateInit) { + let builder = new TupleBuilder(); + builder.writeCell(source.code); + builder.writeCell(source.data); + return builder.build(); } -export function unpackTupleStateInit(slice: TupleSlice4): StateInit { - const code = slice.readCell(); - const data = slice.readCell(); - return { $$type: 'StateInit', code: code, data: data }; + +function dictValueParserStateInit(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeStateInit(src)).endCell()); + }, + parse: (src) => { + return loadStateInit(src.loadRef().beginParse()); + } + } } export type Context = { $$type: 'Context'; bounced: boolean; sender: Address; - value: BN; + value: bigint; raw: Cell; } -export function packContext(src: Context): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeBit(src.bounced); - b_0 = b_0.storeAddress(src.sender); - b_0 = b_0.storeInt(src.value, 257); - b_0 = b_0.storeRef(src.raw); - return b_0.endCell(); -} - -export function packStackContext(src: Context, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.bounced ? new BN(-1) : new BN(0) }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.sender).endCell() }); - __stack.push({ type: 'int', value: src.value }); - __stack.push({ type: 'slice', cell: src.raw }); -} - -export function packTupleContext(src: Context): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.bounced ? new BN(-1) : new BN(0) }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.sender).endCell() }); - __stack.push({ type: 'int', value: src.value }); - __stack.push({ type: 'slice', cell: src.raw }); - return __stack; -} - -export function unpackStackContext(slice: TupleSlice4): Context { - const bounced = slice.readBoolean(); - const sender = slice.readAddress(); - const value = slice.readBigNumber(); - const raw = slice.readCell(); - return { $$type: 'Context', bounced: bounced, sender: sender, value: value, raw: raw }; -} -export function unpackTupleContext(slice: TupleSlice4): Context { - const bounced = slice.readBoolean(); - const sender = slice.readAddress(); - const value = slice.readBigNumber(); - const raw = slice.readCell(); - return { $$type: 'Context', bounced: bounced, sender: sender, value: value, raw: raw }; +export function storeContext(src: Context) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeBit(src.bounced); + b_0.storeAddress(src.sender); + b_0.storeInt(src.value, 257); + b_0.storeRef(src.raw); + }; +} + +export function loadContext(slice: Slice) { + let sc_0 = slice; + let _bounced = sc_0.loadBit(); + let _sender = sc_0.loadAddress(); + let _value = sc_0.loadIntBig(257); + let _raw = sc_0.loadRef(); + return { $$type: 'Context' as const, bounced: _bounced, sender: _sender, value: _value, raw: _raw }; +} + +function loadTupleContext(source: TupleReader) { + let _bounced = source.readBoolean(); + let _sender = source.readAddress(); + let _value = source.readBigNumber(); + let _raw = source.readCell(); + return { $$type: 'Context' as const, bounced: _bounced, sender: _sender, value: _value, raw: _raw }; +} + +function storeTupleContext(source: Context) { + let builder = new TupleBuilder(); + builder.writeBoolean(source.bounced); + builder.writeAddress(source.sender); + builder.writeNumber(source.value); + builder.writeSlice(source.raw); + return builder.build(); +} + +function dictValueParserContext(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeContext(src)).endCell()); + }, + parse: (src) => { + return loadContext(src.loadRef().beginParse()); + } + } } export type SendParameters = { $$type: 'SendParameters'; bounce: boolean; to: Address; - value: BN; - mode: BN; + value: bigint; + mode: bigint; body: Cell | null; code: Cell | null; data: Cell | null; } -export function packSendParameters(src: SendParameters): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeBit(src.bounce); - b_0 = b_0.storeAddress(src.to); - b_0 = b_0.storeInt(src.value, 257); - b_0 = b_0.storeInt(src.mode, 257); - if (src.body !== null) { - b_0 = b_0.storeBit(true); - b_0 = b_0.storeRef(src.body); - } else { - b_0 = b_0.storeBit(false); - } - if (src.code !== null) { - b_0 = b_0.storeBit(true); - b_0 = b_0.storeRef(src.code); - } else { - b_0 = b_0.storeBit(false); - } - if (src.data !== null) { - b_0 = b_0.storeBit(true); - b_0 = b_0.storeRef(src.data); - } else { - b_0 = b_0.storeBit(false); - } - return b_0.endCell(); -} - -export function packStackSendParameters(src: SendParameters, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.bounce ? new BN(-1) : new BN(0) }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.to).endCell() }); - __stack.push({ type: 'int', value: src.value }); - __stack.push({ type: 'int', value: src.mode }); - if (src.body !== null) { - __stack.push({ type: 'cell', cell: src.body }); - } else { - __stack.push({ type: 'null' }); - } - if (src.code !== null) { - __stack.push({ type: 'cell', cell: src.code }); - } else { - __stack.push({ type: 'null' }); - } - if (src.data !== null) { - __stack.push({ type: 'cell', cell: src.data }); - } else { - __stack.push({ type: 'null' }); - } -} - -export function packTupleSendParameters(src: SendParameters): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.bounce ? new BN(-1) : new BN(0) }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.to).endCell() }); - __stack.push({ type: 'int', value: src.value }); - __stack.push({ type: 'int', value: src.mode }); - if (src.body !== null) { - __stack.push({ type: 'cell', cell: src.body }); - } else { - __stack.push({ type: 'null' }); - } - if (src.code !== null) { - __stack.push({ type: 'cell', cell: src.code }); - } else { - __stack.push({ type: 'null' }); - } - if (src.data !== null) { - __stack.push({ type: 'cell', cell: src.data }); - } else { - __stack.push({ type: 'null' }); +export function storeSendParameters(src: SendParameters) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeBit(src.bounce); + b_0.storeAddress(src.to); + b_0.storeInt(src.value, 257); + b_0.storeInt(src.mode, 257); + if (src.body !== null && src.body !== undefined) { b_0.storeBit(true).storeRef(src.body); } else { b_0.storeBit(false); } + if (src.code !== null && src.code !== undefined) { b_0.storeBit(true).storeRef(src.code); } else { b_0.storeBit(false); } + if (src.data !== null && src.data !== undefined) { b_0.storeBit(true).storeRef(src.data); } else { b_0.storeBit(false); } + }; +} + +export function loadSendParameters(slice: Slice) { + let sc_0 = slice; + let _bounce = sc_0.loadBit(); + let _to = sc_0.loadAddress(); + let _value = sc_0.loadIntBig(257); + let _mode = sc_0.loadIntBig(257); + let _body = sc_0.loadBit() ? sc_0.loadRef() : null; + let _code = sc_0.loadBit() ? sc_0.loadRef() : null; + let _data = sc_0.loadBit() ? sc_0.loadRef() : null; + return { $$type: 'SendParameters' as const, bounce: _bounce, to: _to, value: _value, mode: _mode, body: _body, code: _code, data: _data }; +} + +function loadTupleSendParameters(source: TupleReader) { + let _bounce = source.readBoolean(); + let _to = source.readAddress(); + let _value = source.readBigNumber(); + let _mode = source.readBigNumber(); + let _body = source.readCellOpt(); + let _code = source.readCellOpt(); + let _data = source.readCellOpt(); + return { $$type: 'SendParameters' as const, bounce: _bounce, to: _to, value: _value, mode: _mode, body: _body, code: _code, data: _data }; +} + +function storeTupleSendParameters(source: SendParameters) { + let builder = new TupleBuilder(); + builder.writeBoolean(source.bounce); + builder.writeAddress(source.to); + builder.writeNumber(source.value); + builder.writeNumber(source.mode); + builder.writeCell(source.body); + builder.writeCell(source.code); + builder.writeCell(source.data); + return builder.build(); +} + +function dictValueParserSendParameters(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeSendParameters(src)).endCell()); + }, + parse: (src) => { + return loadSendParameters(src.loadRef().beginParse()); + } } - return __stack; -} - -export function unpackStackSendParameters(slice: TupleSlice4): SendParameters { - const bounce = slice.readBoolean(); - const to = slice.readAddress(); - const value = slice.readBigNumber(); - const mode = slice.readBigNumber(); - const body = slice.readCellOpt(); - const code = slice.readCellOpt(); - const data = slice.readCellOpt(); - return { $$type: 'SendParameters', bounce: bounce, to: to, value: value, mode: mode, body: body, code: code, data: data }; -} -export function unpackTupleSendParameters(slice: TupleSlice4): SendParameters { - const bounce = slice.readBoolean(); - const to = slice.readAddress(); - const value = slice.readBigNumber(); - const mode = slice.readBigNumber(); - const body = slice.readCellOpt(); - const code = slice.readCellOpt(); - const data = slice.readCellOpt(); - return { $$type: 'SendParameters', bounce: bounce, to: to, value: value, mode: mode, body: body, code: code, data: data }; } export type ChangeOwner = { $$type: 'ChangeOwner'; newOwner: Address; } -export function packChangeOwner(src: ChangeOwner): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeUint(3067051791, 32); - b_0 = b_0.storeAddress(src.newOwner); - return b_0.endCell(); +export function storeChangeOwner(src: ChangeOwner) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(256331011, 32); + b_0.storeAddress(src.newOwner); + }; } -export function packStackChangeOwner(src: ChangeOwner, __stack: StackItem[]) { - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.newOwner).endCell() }); +export function loadChangeOwner(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 256331011) { throw Error('Invalid prefix'); } + let _newOwner = sc_0.loadAddress(); + return { $$type: 'ChangeOwner' as const, newOwner: _newOwner }; } -export function packTupleChangeOwner(src: ChangeOwner): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.newOwner).endCell() }); - return __stack; +function loadTupleChangeOwner(source: TupleReader) { + let _newOwner = source.readAddress(); + return { $$type: 'ChangeOwner' as const, newOwner: _newOwner }; } -export function unpackStackChangeOwner(slice: TupleSlice4): ChangeOwner { - const newOwner = slice.readAddress(); - return { $$type: 'ChangeOwner', newOwner: newOwner }; +function storeTupleChangeOwner(source: ChangeOwner) { + let builder = new TupleBuilder(); + builder.writeAddress(source.newOwner); + return builder.build(); } -export function unpackTupleChangeOwner(slice: TupleSlice4): ChangeOwner { - const newOwner = slice.readAddress(); - return { $$type: 'ChangeOwner', newOwner: newOwner }; + +function dictValueParserChangeOwner(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeChangeOwner(src)).endCell()); + }, + parse: (src) => { + return loadChangeOwner(src.loadRef().beginParse()); + } + } } export type TokenTransfer = { $$type: 'TokenTransfer'; - queryId: BN; - amount: BN; + queryId: bigint; + amount: bigint; destination: Address; responseDestination: Address | null; customPayload: Cell | null; - forwardTonAmount: BN; + forwardTonAmount: bigint; forwardPayload: Cell; } -export function packTokenTransfer(src: TokenTransfer): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeUint(260734629, 32); - b_0 = b_0.storeUint(src.queryId, 64); - b_0 = b_0.storeCoins(src.amount); - b_0 = b_0.storeAddress(src.destination); - b_0 = b_0.storeAddress(src.responseDestination); - if (src.customPayload !== null) { - b_0 = b_0.storeBit(true); - b_0 = b_0.storeRef(src.customPayload); - } else { - b_0 = b_0.storeBit(false); - } - b_0 = b_0.storeCoins(src.forwardTonAmount); - b_0 = b_0.storeCellCopy(src.forwardPayload); - return b_0.endCell(); -} - -export function packStackTokenTransfer(src: TokenTransfer, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.queryId }); - __stack.push({ type: 'int', value: src.amount }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.destination).endCell() }); - if (src.responseDestination !== null) { - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseDestination).endCell() }); - } else { - __stack.push({ type: 'null' }); - } - if (src.customPayload !== null) { - __stack.push({ type: 'cell', cell: src.customPayload }); - } else { - __stack.push({ type: 'null' }); - } - __stack.push({ type: 'int', value: src.forwardTonAmount }); - __stack.push({ type: 'slice', cell: src.forwardPayload }); -} - -export function packTupleTokenTransfer(src: TokenTransfer): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.queryId }); - __stack.push({ type: 'int', value: src.amount }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.destination).endCell() }); - if (src.responseDestination !== null) { - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseDestination).endCell() }); - } else { - __stack.push({ type: 'null' }); - } - if (src.customPayload !== null) { - __stack.push({ type: 'cell', cell: src.customPayload }); - } else { - __stack.push({ type: 'null' }); +export function storeTokenTransfer(src: TokenTransfer) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(260734629, 32); + b_0.storeUint(src.queryId, 64); + b_0.storeCoins(src.amount); + b_0.storeAddress(src.destination); + if (src.responseDestination !== null && src.responseDestination !== undefined) { b_0.storeBit(true).storeAddress(src.responseDestination); } else { b_0.storeBit(false); } + if (src.customPayload !== null && src.customPayload !== undefined) { b_0.storeBit(true).storeRef(src.customPayload); } else { b_0.storeBit(false); } + b_0.storeCoins(src.forwardTonAmount); + b_0.storeBuilder(src.forwardPayload.asBuilder()); + }; +} + +export function loadTokenTransfer(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 260734629) { throw Error('Invalid prefix'); } + let _queryId = sc_0.loadUintBig(64); + let _amount = sc_0.loadCoins(); + let _destination = sc_0.loadAddress(); + let _responseDestination = sc_0.loadBit() ? sc_0.loadAddress() : null; + let _customPayload = sc_0.loadBit() ? sc_0.loadRef() : null; + let _forwardTonAmount = sc_0.loadCoins(); + let _forwardPayload = sc_0.asCell(); + return { $$type: 'TokenTransfer' as const, queryId: _queryId, amount: _amount, destination: _destination, responseDestination: _responseDestination, customPayload: _customPayload, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; +} + +function loadTupleTokenTransfer(source: TupleReader) { + let _queryId = source.readBigNumber(); + let _amount = source.readBigNumber(); + let _destination = source.readAddress(); + let _responseDestination = source.readAddressOpt(); + let _customPayload = source.readCellOpt(); + let _forwardTonAmount = source.readBigNumber(); + let _forwardPayload = source.readCell(); + return { $$type: 'TokenTransfer' as const, queryId: _queryId, amount: _amount, destination: _destination, responseDestination: _responseDestination, customPayload: _customPayload, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; +} + +function storeTupleTokenTransfer(source: TokenTransfer) { + let builder = new TupleBuilder(); + builder.writeNumber(source.queryId); + builder.writeNumber(source.amount); + builder.writeAddress(source.destination); + builder.writeAddress(source.responseDestination); + builder.writeCell(source.customPayload); + builder.writeNumber(source.forwardTonAmount); + builder.writeSlice(source.forwardPayload); + return builder.build(); +} + +function dictValueParserTokenTransfer(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenTransfer(src)).endCell()); + }, + parse: (src) => { + return loadTokenTransfer(src.loadRef().beginParse()); + } } - __stack.push({ type: 'int', value: src.forwardTonAmount }); - __stack.push({ type: 'slice', cell: src.forwardPayload }); - return __stack; -} - -export function unpackStackTokenTransfer(slice: TupleSlice4): TokenTransfer { - const queryId = slice.readBigNumber(); - const amount = slice.readBigNumber(); - const destination = slice.readAddress(); - const responseDestination = slice.readAddressOpt(); - const customPayload = slice.readCellOpt(); - const forwardTonAmount = slice.readBigNumber(); - const forwardPayload = slice.readCell(); - return { $$type: 'TokenTransfer', queryId: queryId, amount: amount, destination: destination, responseDestination: responseDestination, customPayload: customPayload, forwardTonAmount: forwardTonAmount, forwardPayload: forwardPayload }; -} -export function unpackTupleTokenTransfer(slice: TupleSlice4): TokenTransfer { - const queryId = slice.readBigNumber(); - const amount = slice.readBigNumber(); - const destination = slice.readAddress(); - const responseDestination = slice.readAddressOpt(); - const customPayload = slice.readCellOpt(); - const forwardTonAmount = slice.readBigNumber(); - const forwardPayload = slice.readCell(); - return { $$type: 'TokenTransfer', queryId: queryId, amount: amount, destination: destination, responseDestination: responseDestination, customPayload: customPayload, forwardTonAmount: forwardTonAmount, forwardPayload: forwardPayload }; } export type TokenTransferInternal = { $$type: 'TokenTransferInternal'; - queryId: BN; - amount: BN; + queryId: bigint; + amount: bigint; from: Address; responseAddress: Address | null; - forwardTonAmount: BN; + forwardTonAmount: bigint; forwardPayload: Cell; } -export function packTokenTransferInternal(src: TokenTransferInternal): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeUint(395134233, 32); - b_0 = b_0.storeUint(src.queryId, 64); - b_0 = b_0.storeCoins(src.amount); - b_0 = b_0.storeAddress(src.from); - b_0 = b_0.storeAddress(src.responseAddress); - b_0 = b_0.storeCoins(src.forwardTonAmount); - b_0 = b_0.storeCellCopy(src.forwardPayload); - return b_0.endCell(); -} - -export function packStackTokenTransferInternal(src: TokenTransferInternal, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.queryId }); - __stack.push({ type: 'int', value: src.amount }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.from).endCell() }); - if (src.responseAddress !== null) { - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() }); - } else { - __stack.push({ type: 'null' }); - } - __stack.push({ type: 'int', value: src.forwardTonAmount }); - __stack.push({ type: 'slice', cell: src.forwardPayload }); -} - -export function packTupleTokenTransferInternal(src: TokenTransferInternal): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.queryId }); - __stack.push({ type: 'int', value: src.amount }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.from).endCell() }); - if (src.responseAddress !== null) { - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() }); - } else { - __stack.push({ type: 'null' }); +export function storeTokenTransferInternal(src: TokenTransferInternal) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(395134233, 32); + b_0.storeUint(src.queryId, 64); + b_0.storeCoins(src.amount); + b_0.storeAddress(src.from); + if (src.responseAddress !== null && src.responseAddress !== undefined) { b_0.storeBit(true).storeAddress(src.responseAddress); } else { b_0.storeBit(false); } + b_0.storeCoins(src.forwardTonAmount); + b_0.storeBuilder(src.forwardPayload.asBuilder()); + }; +} + +export function loadTokenTransferInternal(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 395134233) { throw Error('Invalid prefix'); } + let _queryId = sc_0.loadUintBig(64); + let _amount = sc_0.loadCoins(); + let _from = sc_0.loadAddress(); + let _responseAddress = sc_0.loadBit() ? sc_0.loadAddress() : null; + let _forwardTonAmount = sc_0.loadCoins(); + let _forwardPayload = sc_0.asCell(); + return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; +} + +function loadTupleTokenTransferInternal(source: TupleReader) { + let _queryId = source.readBigNumber(); + let _amount = source.readBigNumber(); + let _from = source.readAddress(); + let _responseAddress = source.readAddressOpt(); + let _forwardTonAmount = source.readBigNumber(); + let _forwardPayload = source.readCell(); + return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; +} + +function storeTupleTokenTransferInternal(source: TokenTransferInternal) { + let builder = new TupleBuilder(); + builder.writeNumber(source.queryId); + builder.writeNumber(source.amount); + builder.writeAddress(source.from); + builder.writeAddress(source.responseAddress); + builder.writeNumber(source.forwardTonAmount); + builder.writeSlice(source.forwardPayload); + return builder.build(); +} + +function dictValueParserTokenTransferInternal(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenTransferInternal(src)).endCell()); + }, + parse: (src) => { + return loadTokenTransferInternal(src.loadRef().beginParse()); + } } - __stack.push({ type: 'int', value: src.forwardTonAmount }); - __stack.push({ type: 'slice', cell: src.forwardPayload }); - return __stack; -} - -export function unpackStackTokenTransferInternal(slice: TupleSlice4): TokenTransferInternal { - const queryId = slice.readBigNumber(); - const amount = slice.readBigNumber(); - const from = slice.readAddress(); - const responseAddress = slice.readAddressOpt(); - const forwardTonAmount = slice.readBigNumber(); - const forwardPayload = slice.readCell(); - return { $$type: 'TokenTransferInternal', queryId: queryId, amount: amount, from: from, responseAddress: responseAddress, forwardTonAmount: forwardTonAmount, forwardPayload: forwardPayload }; -} -export function unpackTupleTokenTransferInternal(slice: TupleSlice4): TokenTransferInternal { - const queryId = slice.readBigNumber(); - const amount = slice.readBigNumber(); - const from = slice.readAddress(); - const responseAddress = slice.readAddressOpt(); - const forwardTonAmount = slice.readBigNumber(); - const forwardPayload = slice.readCell(); - return { $$type: 'TokenTransferInternal', queryId: queryId, amount: amount, from: from, responseAddress: responseAddress, forwardTonAmount: forwardTonAmount, forwardPayload: forwardPayload }; } export type TokenNotification = { $$type: 'TokenNotification'; - queryId: BN; - amount: BN; + queryId: bigint; + amount: bigint; from: Address; forwardPayload: Cell; } -export function packTokenNotification(src: TokenNotification): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeUint(1935855772, 32); - b_0 = b_0.storeUint(src.queryId, 64); - b_0 = b_0.storeCoins(src.amount); - b_0 = b_0.storeAddress(src.from); - b_0 = b_0.storeCellCopy(src.forwardPayload); - return b_0.endCell(); -} - -export function packStackTokenNotification(src: TokenNotification, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.queryId }); - __stack.push({ type: 'int', value: src.amount }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.from).endCell() }); - __stack.push({ type: 'slice', cell: src.forwardPayload }); -} - -export function packTupleTokenNotification(src: TokenNotification): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.queryId }); - __stack.push({ type: 'int', value: src.amount }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.from).endCell() }); - __stack.push({ type: 'slice', cell: src.forwardPayload }); - return __stack; -} - -export function unpackStackTokenNotification(slice: TupleSlice4): TokenNotification { - const queryId = slice.readBigNumber(); - const amount = slice.readBigNumber(); - const from = slice.readAddress(); - const forwardPayload = slice.readCell(); - return { $$type: 'TokenNotification', queryId: queryId, amount: amount, from: from, forwardPayload: forwardPayload }; -} -export function unpackTupleTokenNotification(slice: TupleSlice4): TokenNotification { - const queryId = slice.readBigNumber(); - const amount = slice.readBigNumber(); - const from = slice.readAddress(); - const forwardPayload = slice.readCell(); - return { $$type: 'TokenNotification', queryId: queryId, amount: amount, from: from, forwardPayload: forwardPayload }; +export function storeTokenNotification(src: TokenNotification) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(1935855772, 32); + b_0.storeUint(src.queryId, 64); + b_0.storeCoins(src.amount); + b_0.storeAddress(src.from); + b_0.storeBuilder(src.forwardPayload.asBuilder()); + }; +} + +export function loadTokenNotification(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 1935855772) { throw Error('Invalid prefix'); } + let _queryId = sc_0.loadUintBig(64); + let _amount = sc_0.loadCoins(); + let _from = sc_0.loadAddress(); + let _forwardPayload = sc_0.asCell(); + return { $$type: 'TokenNotification' as const, queryId: _queryId, amount: _amount, from: _from, forwardPayload: _forwardPayload }; +} + +function loadTupleTokenNotification(source: TupleReader) { + let _queryId = source.readBigNumber(); + let _amount = source.readBigNumber(); + let _from = source.readAddress(); + let _forwardPayload = source.readCell(); + return { $$type: 'TokenNotification' as const, queryId: _queryId, amount: _amount, from: _from, forwardPayload: _forwardPayload }; +} + +function storeTupleTokenNotification(source: TokenNotification) { + let builder = new TupleBuilder(); + builder.writeNumber(source.queryId); + builder.writeNumber(source.amount); + builder.writeAddress(source.from); + builder.writeSlice(source.forwardPayload); + return builder.build(); +} + +function dictValueParserTokenNotification(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenNotification(src)).endCell()); + }, + parse: (src) => { + return loadTokenNotification(src.loadRef().beginParse()); + } + } } export type TokenBurn = { $$type: 'TokenBurn'; - queryId: BN; - amount: BN; + queryId: bigint; + amount: bigint; owner: Address; responseAddress: Address | null; } -export function packTokenBurn(src: TokenBurn): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeUint(1499400124, 32); - b_0 = b_0.storeUint(src.queryId, 64); - b_0 = b_0.storeCoins(src.amount); - b_0 = b_0.storeAddress(src.owner); - b_0 = b_0.storeAddress(src.responseAddress); - return b_0.endCell(); -} - -export function packStackTokenBurn(src: TokenBurn, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.queryId }); - __stack.push({ type: 'int', value: src.amount }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() }); - if (src.responseAddress !== null) { - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() }); - } else { - __stack.push({ type: 'null' }); - } -} - -export function packTupleTokenBurn(src: TokenBurn): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.queryId }); - __stack.push({ type: 'int', value: src.amount }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() }); - if (src.responseAddress !== null) { - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() }); - } else { - __stack.push({ type: 'null' }); +export function storeTokenBurn(src: TokenBurn) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(1499400124, 32); + b_0.storeUint(src.queryId, 64); + b_0.storeCoins(src.amount); + b_0.storeAddress(src.owner); + if (src.responseAddress !== null && src.responseAddress !== undefined) { b_0.storeBit(true).storeAddress(src.responseAddress); } else { b_0.storeBit(false); } + }; +} + +export function loadTokenBurn(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 1499400124) { throw Error('Invalid prefix'); } + let _queryId = sc_0.loadUintBig(64); + let _amount = sc_0.loadCoins(); + let _owner = sc_0.loadAddress(); + let _responseAddress = sc_0.loadBit() ? sc_0.loadAddress() : null; + return { $$type: 'TokenBurn' as const, queryId: _queryId, amount: _amount, owner: _owner, responseAddress: _responseAddress }; +} + +function loadTupleTokenBurn(source: TupleReader) { + let _queryId = source.readBigNumber(); + let _amount = source.readBigNumber(); + let _owner = source.readAddress(); + let _responseAddress = source.readAddressOpt(); + return { $$type: 'TokenBurn' as const, queryId: _queryId, amount: _amount, owner: _owner, responseAddress: _responseAddress }; +} + +function storeTupleTokenBurn(source: TokenBurn) { + let builder = new TupleBuilder(); + builder.writeNumber(source.queryId); + builder.writeNumber(source.amount); + builder.writeAddress(source.owner); + builder.writeAddress(source.responseAddress); + return builder.build(); +} + +function dictValueParserTokenBurn(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenBurn(src)).endCell()); + }, + parse: (src) => { + return loadTokenBurn(src.loadRef().beginParse()); + } } - return __stack; -} - -export function unpackStackTokenBurn(slice: TupleSlice4): TokenBurn { - const queryId = slice.readBigNumber(); - const amount = slice.readBigNumber(); - const owner = slice.readAddress(); - const responseAddress = slice.readAddressOpt(); - return { $$type: 'TokenBurn', queryId: queryId, amount: amount, owner: owner, responseAddress: responseAddress }; -} -export function unpackTupleTokenBurn(slice: TupleSlice4): TokenBurn { - const queryId = slice.readBigNumber(); - const amount = slice.readBigNumber(); - const owner = slice.readAddress(); - const responseAddress = slice.readAddressOpt(); - return { $$type: 'TokenBurn', queryId: queryId, amount: amount, owner: owner, responseAddress: responseAddress }; } export type TokenBurnNotification = { $$type: 'TokenBurnNotification'; - queryId: BN; - amount: BN; + queryId: bigint; + amount: bigint; owner: Address; responseAddress: Address | null; } -export function packTokenBurnNotification(src: TokenBurnNotification): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeUint(2078119902, 32); - b_0 = b_0.storeUint(src.queryId, 64); - b_0 = b_0.storeCoins(src.amount); - b_0 = b_0.storeAddress(src.owner); - b_0 = b_0.storeAddress(src.responseAddress); - return b_0.endCell(); -} - -export function packStackTokenBurnNotification(src: TokenBurnNotification, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.queryId }); - __stack.push({ type: 'int', value: src.amount }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() }); - if (src.responseAddress !== null) { - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() }); - } else { - __stack.push({ type: 'null' }); - } -} - -export function packTupleTokenBurnNotification(src: TokenBurnNotification): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.queryId }); - __stack.push({ type: 'int', value: src.amount }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() }); - if (src.responseAddress !== null) { - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() }); - } else { - __stack.push({ type: 'null' }); +export function storeTokenBurnNotification(src: TokenBurnNotification) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(2078119902, 32); + b_0.storeUint(src.queryId, 64); + b_0.storeCoins(src.amount); + b_0.storeAddress(src.owner); + if (src.responseAddress !== null && src.responseAddress !== undefined) { b_0.storeBit(true).storeAddress(src.responseAddress); } else { b_0.storeBit(false); } + }; +} + +export function loadTokenBurnNotification(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 2078119902) { throw Error('Invalid prefix'); } + let _queryId = sc_0.loadUintBig(64); + let _amount = sc_0.loadCoins(); + let _owner = sc_0.loadAddress(); + let _responseAddress = sc_0.loadBit() ? sc_0.loadAddress() : null; + return { $$type: 'TokenBurnNotification' as const, queryId: _queryId, amount: _amount, owner: _owner, responseAddress: _responseAddress }; +} + +function loadTupleTokenBurnNotification(source: TupleReader) { + let _queryId = source.readBigNumber(); + let _amount = source.readBigNumber(); + let _owner = source.readAddress(); + let _responseAddress = source.readAddressOpt(); + return { $$type: 'TokenBurnNotification' as const, queryId: _queryId, amount: _amount, owner: _owner, responseAddress: _responseAddress }; +} + +function storeTupleTokenBurnNotification(source: TokenBurnNotification) { + let builder = new TupleBuilder(); + builder.writeNumber(source.queryId); + builder.writeNumber(source.amount); + builder.writeAddress(source.owner); + builder.writeAddress(source.responseAddress); + return builder.build(); +} + +function dictValueParserTokenBurnNotification(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenBurnNotification(src)).endCell()); + }, + parse: (src) => { + return loadTokenBurnNotification(src.loadRef().beginParse()); + } } - return __stack; -} - -export function unpackStackTokenBurnNotification(slice: TupleSlice4): TokenBurnNotification { - const queryId = slice.readBigNumber(); - const amount = slice.readBigNumber(); - const owner = slice.readAddress(); - const responseAddress = slice.readAddressOpt(); - return { $$type: 'TokenBurnNotification', queryId: queryId, amount: amount, owner: owner, responseAddress: responseAddress }; -} -export function unpackTupleTokenBurnNotification(slice: TupleSlice4): TokenBurnNotification { - const queryId = slice.readBigNumber(); - const amount = slice.readBigNumber(); - const owner = slice.readAddress(); - const responseAddress = slice.readAddressOpt(); - return { $$type: 'TokenBurnNotification', queryId: queryId, amount: amount, owner: owner, responseAddress: responseAddress }; } export type TokenExcesses = { $$type: 'TokenExcesses'; - queryId: BN; + queryId: bigint; } -export function packTokenExcesses(src: TokenExcesses): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeUint(3576854235, 32); - b_0 = b_0.storeUint(src.queryId, 64); - return b_0.endCell(); +export function storeTokenExcesses(src: TokenExcesses) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(3576854235, 32); + b_0.storeUint(src.queryId, 64); + }; } -export function packStackTokenExcesses(src: TokenExcesses, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.queryId }); +export function loadTokenExcesses(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 3576854235) { throw Error('Invalid prefix'); } + let _queryId = sc_0.loadUintBig(64); + return { $$type: 'TokenExcesses' as const, queryId: _queryId }; } -export function packTupleTokenExcesses(src: TokenExcesses): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.queryId }); - return __stack; +function loadTupleTokenExcesses(source: TupleReader) { + let _queryId = source.readBigNumber(); + return { $$type: 'TokenExcesses' as const, queryId: _queryId }; } -export function unpackStackTokenExcesses(slice: TupleSlice4): TokenExcesses { - const queryId = slice.readBigNumber(); - return { $$type: 'TokenExcesses', queryId: queryId }; +function storeTupleTokenExcesses(source: TokenExcesses) { + let builder = new TupleBuilder(); + builder.writeNumber(source.queryId); + return builder.build(); } -export function unpackTupleTokenExcesses(slice: TupleSlice4): TokenExcesses { - const queryId = slice.readBigNumber(); - return { $$type: 'TokenExcesses', queryId: queryId }; + +function dictValueParserTokenExcesses(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenExcesses(src)).endCell()); + }, + parse: (src) => { + return loadTokenExcesses(src.loadRef().beginParse()); + } + } } export type TokenUpdateContent = { $$type: 'TokenUpdateContent'; content: Cell | null; } -export function packTokenUpdateContent(src: TokenUpdateContent): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeUint(1862840892, 32); - if (src.content !== null) { - b_0 = b_0.storeBit(true); - b_0 = b_0.storeRef(src.content); - } else { - b_0 = b_0.storeBit(false); - } - return b_0.endCell(); +export function storeTokenUpdateContent(src: TokenUpdateContent) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(201882270, 32); + if (src.content !== null && src.content !== undefined) { b_0.storeBit(true).storeRef(src.content); } else { b_0.storeBit(false); } + }; } -export function packStackTokenUpdateContent(src: TokenUpdateContent, __stack: StackItem[]) { - if (src.content !== null) { - __stack.push({ type: 'cell', cell: src.content }); - } else { - __stack.push({ type: 'null' }); - } +export function loadTokenUpdateContent(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 201882270) { throw Error('Invalid prefix'); } + let _content = sc_0.loadBit() ? sc_0.loadRef() : null; + return { $$type: 'TokenUpdateContent' as const, content: _content }; } -export function packTupleTokenUpdateContent(src: TokenUpdateContent): StackItem[] { - let __stack: StackItem[] = []; - if (src.content !== null) { - __stack.push({ type: 'cell', cell: src.content }); - } else { - __stack.push({ type: 'null' }); - } - return __stack; +function loadTupleTokenUpdateContent(source: TupleReader) { + let _content = source.readCellOpt(); + return { $$type: 'TokenUpdateContent' as const, content: _content }; } -export function unpackStackTokenUpdateContent(slice: TupleSlice4): TokenUpdateContent { - const content = slice.readCellOpt(); - return { $$type: 'TokenUpdateContent', content: content }; +function storeTupleTokenUpdateContent(source: TokenUpdateContent) { + let builder = new TupleBuilder(); + builder.writeCell(source.content); + return builder.build(); } -export function unpackTupleTokenUpdateContent(slice: TupleSlice4): TokenUpdateContent { - const content = slice.readCellOpt(); - return { $$type: 'TokenUpdateContent', content: content }; + +function dictValueParserTokenUpdateContent(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenUpdateContent(src)).endCell()); + }, + parse: (src) => { + return loadTokenUpdateContent(src.loadRef().beginParse()); + } + } } export type JettonData = { $$type: 'JettonData'; - totalSupply: BN; + totalSupply: bigint; mintable: boolean; owner: Address; content: Cell | null; walletCode: Cell; } -export function packJettonData(src: JettonData): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeInt(src.totalSupply, 257); - b_0 = b_0.storeBit(src.mintable); - b_0 = b_0.storeAddress(src.owner); - if (src.content !== null) { - b_0 = b_0.storeBit(true); - b_0 = b_0.storeRef(src.content); - } else { - b_0 = b_0.storeBit(false); - } - b_0 = b_0.storeRef(src.walletCode); - return b_0.endCell(); -} - -export function packStackJettonData(src: JettonData, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.totalSupply }); - __stack.push({ type: 'int', value: src.mintable ? new BN(-1) : new BN(0) }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() }); - if (src.content !== null) { - __stack.push({ type: 'cell', cell: src.content }); - } else { - __stack.push({ type: 'null' }); - } - __stack.push({ type: 'cell', cell: src.walletCode }); -} - -export function packTupleJettonData(src: JettonData): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.totalSupply }); - __stack.push({ type: 'int', value: src.mintable ? new BN(-1) : new BN(0) }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() }); - if (src.content !== null) { - __stack.push({ type: 'cell', cell: src.content }); - } else { - __stack.push({ type: 'null' }); +export function storeJettonData(src: JettonData) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeInt(src.totalSupply, 257); + b_0.storeBit(src.mintable); + b_0.storeAddress(src.owner); + if (src.content !== null && src.content !== undefined) { b_0.storeBit(true).storeRef(src.content); } else { b_0.storeBit(false); } + b_0.storeRef(src.walletCode); + }; +} + +export function loadJettonData(slice: Slice) { + let sc_0 = slice; + let _totalSupply = sc_0.loadIntBig(257); + let _mintable = sc_0.loadBit(); + let _owner = sc_0.loadAddress(); + let _content = sc_0.loadBit() ? sc_0.loadRef() : null; + let _walletCode = sc_0.loadRef(); + return { $$type: 'JettonData' as const, totalSupply: _totalSupply, mintable: _mintable, owner: _owner, content: _content, walletCode: _walletCode }; +} + +function loadTupleJettonData(source: TupleReader) { + let _totalSupply = source.readBigNumber(); + let _mintable = source.readBoolean(); + let _owner = source.readAddress(); + let _content = source.readCellOpt(); + let _walletCode = source.readCell(); + return { $$type: 'JettonData' as const, totalSupply: _totalSupply, mintable: _mintable, owner: _owner, content: _content, walletCode: _walletCode }; +} + +function storeTupleJettonData(source: JettonData) { + let builder = new TupleBuilder(); + builder.writeNumber(source.totalSupply); + builder.writeBoolean(source.mintable); + builder.writeAddress(source.owner); + builder.writeCell(source.content); + builder.writeCell(source.walletCode); + return builder.build(); +} + +function dictValueParserJettonData(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeJettonData(src)).endCell()); + }, + parse: (src) => { + return loadJettonData(src.loadRef().beginParse()); + } } - __stack.push({ type: 'cell', cell: src.walletCode }); - return __stack; -} - -export function unpackStackJettonData(slice: TupleSlice4): JettonData { - const totalSupply = slice.readBigNumber(); - const mintable = slice.readBoolean(); - const owner = slice.readAddress(); - const content = slice.readCellOpt(); - const walletCode = slice.readCell(); - return { $$type: 'JettonData', totalSupply: totalSupply, mintable: mintable, owner: owner, content: content, walletCode: walletCode }; -} -export function unpackTupleJettonData(slice: TupleSlice4): JettonData { - const totalSupply = slice.readBigNumber(); - const mintable = slice.readBoolean(); - const owner = slice.readAddress(); - const content = slice.readCellOpt(); - const walletCode = slice.readCell(); - return { $$type: 'JettonData', totalSupply: totalSupply, mintable: mintable, owner: owner, content: content, walletCode: walletCode }; } export type JettonWalletData = { $$type: 'JettonWalletData'; - balance: BN; + balance: bigint; owner: Address; master: Address; walletCode: Cell; } -export function packJettonWalletData(src: JettonWalletData): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeInt(src.balance, 257); - b_0 = b_0.storeAddress(src.owner); - b_0 = b_0.storeAddress(src.master); - b_0 = b_0.storeRef(src.walletCode); - return b_0.endCell(); -} - -export function packStackJettonWalletData(src: JettonWalletData, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.balance }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.master).endCell() }); - __stack.push({ type: 'cell', cell: src.walletCode }); -} - -export function packTupleJettonWalletData(src: JettonWalletData): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.balance }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(src.master).endCell() }); - __stack.push({ type: 'cell', cell: src.walletCode }); - return __stack; -} - -export function unpackStackJettonWalletData(slice: TupleSlice4): JettonWalletData { - const balance = slice.readBigNumber(); - const owner = slice.readAddress(); - const master = slice.readAddress(); - const walletCode = slice.readCell(); - return { $$type: 'JettonWalletData', balance: balance, owner: owner, master: master, walletCode: walletCode }; -} -export function unpackTupleJettonWalletData(slice: TupleSlice4): JettonWalletData { - const balance = slice.readBigNumber(); - const owner = slice.readAddress(); - const master = slice.readAddress(); - const walletCode = slice.readCell(); - return { $$type: 'JettonWalletData', balance: balance, owner: owner, master: master, walletCode: walletCode }; +export function storeJettonWalletData(src: JettonWalletData) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeInt(src.balance, 257); + b_0.storeAddress(src.owner); + b_0.storeAddress(src.master); + b_0.storeRef(src.walletCode); + }; +} + +export function loadJettonWalletData(slice: Slice) { + let sc_0 = slice; + let _balance = sc_0.loadIntBig(257); + let _owner = sc_0.loadAddress(); + let _master = sc_0.loadAddress(); + let _walletCode = sc_0.loadRef(); + return { $$type: 'JettonWalletData' as const, balance: _balance, owner: _owner, master: _master, walletCode: _walletCode }; +} + +function loadTupleJettonWalletData(source: TupleReader) { + let _balance = source.readBigNumber(); + let _owner = source.readAddress(); + let _master = source.readAddress(); + let _walletCode = source.readCell(); + return { $$type: 'JettonWalletData' as const, balance: _balance, owner: _owner, master: _master, walletCode: _walletCode }; +} + +function storeTupleJettonWalletData(source: JettonWalletData) { + let builder = new TupleBuilder(); + builder.writeNumber(source.balance); + builder.writeAddress(source.owner); + builder.writeAddress(source.master); + builder.writeCell(source.walletCode); + return builder.build(); +} + +function dictValueParserJettonWalletData(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeJettonWalletData(src)).endCell()); + }, + parse: (src) => { + return loadJettonWalletData(src.loadRef().beginParse()); + } + } } export type Mint = { $$type: 'Mint'; - amount: BN; + amount: bigint; } -export function packMint(src: Mint): Cell { - let b_0 = new Builder(); - b_0 = b_0.storeUint(2737462367, 32); - b_0 = b_0.storeInt(src.amount, 257); - return b_0.endCell(); +export function storeMint(src: Mint) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(33240155, 32); + b_0.storeInt(src.amount, 257); + }; } -export function packStackMint(src: Mint, __stack: StackItem[]) { - __stack.push({ type: 'int', value: src.amount }); +export function loadMint(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 33240155) { throw Error('Invalid prefix'); } + let _amount = sc_0.loadIntBig(257); + return { $$type: 'Mint' as const, amount: _amount }; } -export function packTupleMint(src: Mint): StackItem[] { - let __stack: StackItem[] = []; - __stack.push({ type: 'int', value: src.amount }); - return __stack; +function loadTupleMint(source: TupleReader) { + let _amount = source.readBigNumber(); + return { $$type: 'Mint' as const, amount: _amount }; } -export function unpackStackMint(slice: TupleSlice4): Mint { - const amount = slice.readBigNumber(); - return { $$type: 'Mint', amount: amount }; -} -export function unpackTupleMint(slice: TupleSlice4): Mint { - const amount = slice.readBigNumber(); - return { $$type: 'Mint', amount: amount }; +function storeTupleMint(source: Mint) { + let builder = new TupleBuilder(); + builder.writeNumber(source.amount); + return builder.build(); } -export async function SampleJetton_init(owner: Address, content: Cell | null) { - const __code = 'te6ccgECPQEABbEAART/APSkE/S88sgLAQIBYgIDAgLKBAUCASA1NgIBIAYHAgFIGxwCASAICQIBWBARAgHUCgsAR95DgA5YC5gOWAuADlgAlmZmT8gGQ5AOWAuADlgAllA+X/5OhASXO37cCHXScIflTAg1wsf3gLQ0wMBcbDAAZF/kXDiAfpAIlBmbwT4YQKRW+AgghCjKlxfuuMCIIIQbwiyPLrjAiCCEHvdl9664wLAAIAwNDg8ACwgbvLQgIAC6MO1E0NQB+GL6APpAAW0C0gABlGwS1BLe0gAEUDNsFATTHwGCEKMqXF+68uCBgQEB1wABMRA0QTDwKsj4QgHMVTBQQ/oCAc8WIm6VMnBYygCWfwHKABLM4soAye1UAMIw7UTQ1AH4YvoA+kABbQLSAAGUbBLUEt7SAARQM2wUBNMfAYIQbwiyPLry4IFtAdIAAZIx1N4BMRA0QTDwLMj4QgHMVTBQQ/oCAc8WIm6VMnBYygCWfwHKABLM4soAye1UAOgw7UTQ1AH4YvoA+kABbQLSAAGUbBLUEt7SAARQM2wUBNMfAYIQe92X3rry4IHTP/oA+kABAfpAIdcLAcMAkQGSMW3iFEMwNBBnEFYQRVUC8C3I+EIBzFUwUEP6AgHPFiJulTJwWMoAln8BygASzOLKAMntVADqjm35AYLwzQ2YbLGi9GiucIn0/DFiwRbl9T+9EaaDn1Lb9QQIMLK6jkXtRNDUAfhi+gD6QAFtAtIAAZRsEtQS3tIABFAzbBTwK8j4QgHMVTBQQ/oCAc8WIm6VMnBYygCWfwHKABLM4soAye1U2zHgkTDi8sCCAgFYEhMCASAUFQAVJR/AcoA4HABygCAABTIyYAIBIBYXAgEgGBkAAzQgAAk8BvwHIAAJHBZ8AiAB9zIcQHKAVAH8BpwAcoCUAXPFlAD+gJwAcpoI26zJW6zsY49f/AayHDwGnDwGiRus5l/8BoE8AFQBMyVNANw8BriJG6zmX/wGgTwAVAEzJU0A3DwGuJw8BoCf/AaAslYzJYzMwFw8BriIW6zmH/wGgHwAQHMlDFw8BriyQGAaAAT7AAIBIB0eAgEgKywCASAfIAIBICUmAgEgISICASAjJAApHADyMxDE1AjgQEBzwABzxYBzxbJgAG8AtD0BDAgggDYrwGAEPQPb6Hy4GRtAoIA2K8BgBD0D2+h8uBkEoIA2K8BAoAQ9BfI9ADJQAPwIIABDHB/BMjMQzRQQ/oCAc8WIm6VMnBYygCWfwHKABLM4soAyYAAPPhC+ChY8CGACASAnKAIBICkqAA08CNsQvAegAA8+CjwIzBDMIAClFFhoFUx8CNc8B5wcIBAIfgoIfAdEDUQThAjEC/IVVCCEBeNRRlQB8sfFcs/UAP6AgHPFgEgbpUwcAHLAZLPFuIB+gIBzxbJRWAQShA5QKnwH1qAAOT4QW8kECNfA1VA8CMBgRFNAvAeUAbHBRXy9FUCgAgEgLS4CAUgzNAIBIC8wAgEgMTIAHT4QW8kECNfAyPHBfLghIAAJBAjXwOAAFz4QW8kECNfA2bwJoAAjPhBbyQQI18DghA7msoAIfAmgAA8VTDwKDFBMIABrBBHEDZFd/AnUDShJW6zjh9wcIBCB8gBghDVMnbbWMsfyz/JECQQOEFwbW3wHxAjkjQ04kMAgAEW+KO9qJoagD8MX0AfSAAtoFpAADKNglqCW9pAAIoGbYKeBTAIBIDc4AgEgOToACbncPwIoAgFYOzwAlbd6ME4LnYerpZXPY9CdhzrJUKNs0E4TusalpWyPlmRadeW/vixHME4YTIikya+3yRcvbDO06rpAsE4IGc6tPOK/OkoWA6wtxMj2UABJrbz2omhqAPwxfQB9IAC2gWkAAMo2CWoJb2kAAigZtgoqgfgSQABFrxb2omhqAPwxfQB9IAC2gWkAAMo2CWoJb2kAAigZtgp4EsA='; - const depends = new Map(); - depends.set('55471', Cell.fromBoc(Buffer.from('te6ccgECKQEABYcAART/APSkE/S88sgLAQIBYgIDAgLKBAUCASAlJgIBIAYHAgFIEhMCASAICQIB7hARAgFICgsAR7OQ4AOWAuYDlgLgA5YAJZmZk/IBkOQDlgLgA5YAJZQPl/+ToQT1RwIddJwh+VMCDXCx/eAtDTAwFxsMABkX+RcOIB+kAiUGZvBPhhAo4zMO1E0NQB+GKBAQHXAPpAAQH6QAFDMGwTVQLwKMj4QgHMVSBQI4EBAc8AAc8WAc8Wye1U4CCCEA+KfqW64wIgghAXjUUZuuMCghBZXwe8uuMCMIDA0ODwALQgbvLQgIAN4w7UTQ1AH4YoEBAdcA+kABAfpAAUMwbBMD0x8BghAPin6luvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeJtAtIAAZRsEtQS3voAUWYWFURANxCJEHhVBfAlyPhCAcxVIFAjgQEBzwABzxYBzxbJ7VQAyjDtRNDUAfhigQEB1wD6QAEB+kABQzBsEwPTHwGCEBeNRRm68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4gH6AFFVFRRDMDYQeBBnVQTwJsj4QgHMVSBQI4EBAc8AAc8WAc8Wye1UALztRNDUAfhigQEB1wD6QAEB+kABQzBsEwPTHwGCEFlfB7y68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4hRDMDQQVhBFVQLwJ8j4QgHMVSBQI4EBAc8AAc8WAc8Wye1UAAbywIIAFSUfwHKAOBwAcoAgAAkcFnwCYAIBIBQVAE/cAQa5Dpj+mfmP0AGECaqRFBCAvGoozdAcEIPe7L710J2Il5egnQAUAgEgFhcCASAdHgIBIBgZAgEgGxwB9zIcQHKAVAH8B5wAcoCUAXPFlAD+gJwAcpoI26zJW6zsY49f/AeyHDwHnDwHiRus5l/8B4E8AJQBMyVNANw8B7iJG6zmX/wHgTwAlAEzJU0A3DwHuJw8B4Cf/AeAslYzJYzMwFw8B7iIW6zmH/wHgHwAgHMlDFw8B7iyQGAaACUbDH6ADFx1yH6ADH6ADCnA6sAgAAT7AAApHADyMxDE1AjgQEBzwABzxYBzxbJgAG8AtD0BDAgggDYrwGAEPQPb6Hy4GRtAoIA2K8BgBD0D2+h8uBkEoIA2K8BAoAQ9BfI9ADJQAPwIoAIBIB8gAgEgIiMADz4QlMS8CMwgAacbCL4QW8kgRFNUzvHBfL0UbehggD1/CHC//L0QzBSPPAhcSTCAJIwct6BPrsCqIIJMS0AoIIImJaAoBK88vT4QlQgZPAjXPAff1B2cIBAK1RMORiAhAGTIVVCCEBeNRRlQB8sfFcs/UAP6AgHPFgEgbpUwcAHLAZLPFuIB+gIBzxbJEFYQNFnwIAHvPhBbyRTKscFs44S+EJTuPAjAYERTQLwHyTHBfL03lHIoIIA9fwhwv/y9CH4J28QIaGCCJiWgGa2CKGCCJiWgKChJsIAlhB9UIlfCOMNJW6zIsIAsI4dcAbwAnAEyAGCENUydttYyx/LP8kQR0MwF21t8CCSNVvigJADTFv4QW8kgRFNUzjHBfL0UYShggD1/CHC//L0QzBSOfAhgT67AYIJMS0AoIIImJaAoBK88vR/cAOAQFQzZshVMIIQe92X3lAFyx8Tyz8B+gIBzxYBIG6VMHABywGSzxbiyVQTBFAzbW3wIIAByUE1DMPAhUjCgGqFwcChIE1B0yFUwghBzYtCcUAXLHxPLPwH6AgHPFgHPFskoEEZDE1BVbW3wIFAFADe/2BdqJoagD8MUCAgOuAfSAAgP0gAKGYNgn4EkAgJzJygACazx+BFAAHGt6ME4LnYerpZXPY9CdhzrJUKNs0E4TusalpWyPlmRadeW/vixHME4TujwAfLZsB5P5B1ZLNZRCcA=', 'base64'))[0]); - let systemCell = beginCell().storeDict(serializeDict(depends, 16, (src, v) => v.refs.push(src))).endCell(); - let __stack: StackItem[] = []; - __stack.push({ type: 'cell', cell: systemCell }); - __stack.push({ type: 'slice', cell: beginCell().storeAddress(owner).endCell() }); - if (content !== null) { - __stack.push({ type: 'cell', cell: content }); - } else { - __stack.push({ type: 'null' }); + +function dictValueParserMint(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeMint(src)).endCell()); + }, + parse: (src) => { + return loadMint(src.loadRef().beginParse()); + } } +} +async function SampleJetton_init(owner: Address, content: Cell | null) { + const __init = 'te6ccgEBBwEASwABFP8A9KQT9LzyyAsBAgFiAgMCAs0EBQAJoUrd4AkAAdQBFdOD+CZGYhmm2eZMBgA0UEP6AgHPFiJus5Z/AcoAEsyVMnBYygDiygA='; + const __code = 'te6ccgECQwEABKMAART/APSkE/S88sgLAQIBYgIDAgLKBAUCASAGBwIBIAwNAgFIICEBDb4o7tnngVQWAgFICAkCAVgKCwCVt3owTgudh6ullc9j0J2HOslQo2zQThO6xqWlbI+WZFp15b++LEcwThhMiKTJr7fJFy9sM7TqukCwTggZzq084r86ShYDrC3EyPZQARGtvO2eKoH4EsAWARGvFu2eeBN4DUAWAgHODg8CAVgaGwSdO2i7ftwIddJwh+VMCDXCx/eAtDTAwFxsMABkX+RcOIB+kAiUGZvBPhhApFb4CCCCfs0W7qPjzDbPATbPDEQNEEw8CvbPOAgghAMCHqeuoBYQFxEACwgbvLQgIAAk0x8Bggn7NFu68uCBgQEB1wABBDSPjzDbPATbPDEQNEEw8C3bPOAgghB73ZfeuhYSFxMALtMfAYIQDAh6nrry4IHSAAGR1JJtAeIBBDCPkzDbPATbPDQQZxBWEEVVAvAu2zzgwAAWFBcVAEzTHwGCEHvdl9668uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4hRDMAJwjzD5AYLwzQ2YbLGi9GiucIn0/DFiwRbl9T+9EaaDn1Lb9QQIMLK6jwjbPPAs2zzbMeCRMOLywIIWFwEW7UTQ1AH4Yts8bBQYARjI+EIBzFUw2zzJ7VQZACb6APpAAQHSAAGR1JJtAeLSAFUwADRQQ/oCAc8WIm6zln8BygASzJUycFjKAOLKAAABagIBIBwdAAVcjJgCASAeHwADNCAACTwHfAegAgEgIiMCASA1NgIBICQlAgEgLS4CASAmJwIBICorAEscFnIcAHLAXMBywFwAcsAEszMyfkAyHIBywFwAcsAEsoHy//J0IAL3MhxAcoBUAcBygBwAcoCUAXPFlAD+gJwAcpoI26zJW6zsY5GfwHKAMhwAcoAcAHKACRus5p/AcoABPABUATMljQDcAHKAOIkbrOafwHKAATwAVAEzJY0A3ABygDicAHKAAJ/AcoAAslYzJczMwFwAcoA4iFus+MPyQH7AICgpABJ/AcoAAfABAcwACjFwAcoAARMcAPIzEMT2zzJgLABRALQ9AQwbQGCANivAYAQ9A9vofLghwGCANivIgKAEPQXyPQAyUAD8CKAAGlAjgQEBzwABzxYBzxYCASAvMAIBIDEyAA8+EL4KFjwI4AANPAkbELwIIAAPPgo8CQwQzCABUxRYaBVMfAkXPAgcHCAQCH4KCHwHxA1EE4QIxAv2zxFYBBKEDlAqfAhWoDMBDMhVUNs8yTQAToIQF41FGVAHyx8Vyz9QA/oCAc8WASBulTBwAcsBks8W4gH6AgHPFgIBIDc4AgEgPT4CASA5OgIBIDs8ADk+EFvJBAjXwNVQPAkAYERTQLwIFAGxwUV8vRVAoAAdPhBbyQQI18DI8cF8uCEgAAkECNfA4AAXPhBbyQQI18DZvAngAgEgP0ABU0EEcQNkV38ChQNKElbrOOk3BwgEIH2zwQJBA4QXBtbfAhECOSNDTiQwCEEAIz4QW8kECNfA4IQO5rKACHwJ4AAPFUw8CkxQTCABCsgB2zzJQgAWghDVMnbbWMsfyz8='; + const __system = 'te6cckECdAEACWsAAQHAAQIBIDACAQW+xXwDART/APSkE/S88sgLBAIBYggFAgEgBwYAcb3ejBOC52Hq6WVz2PQnYc6yVCjbNBOE7rGpaVsj5ZkWnXlv74sRzBOE7o8AHy2bAeT+QdWSzWUQnAERv9gW2eeBN4D0LgICyiIJAgFIFQoCAUgMCwBPSAINch0x/TPzH6ADCBNVIighAXjUUZugOCEHvdl966E7ES8vQToAKAIBIBANAY8W/hBbySBEU1TOMcF8vRRhKGCAPX8IcL/8vRDMFI58COBPrsBggkxLQCgggiYloCgErzy9H9wA4BAVDNm2zxUEwRQM21t8CKAOAQzIVTDbPMkPAECCEHvdl95QBcsfE8s/AfoCAc8WASBulTBwAcsBks8W4gPxPhBbyRTKscFs44S+EJTuPAlAYERTQLwISTHBfL03lHIoIIA9fwhwv/y9CH4J28QIaGCCJiWgGa2CKGCCJiWgKChJsIAjqFQTUMw8CNSMKAaoXBwKEgTUHTbPCgQRkMTUFVtbfAiUAWWEH1QiV8I4iVusyLCALDjD4BMSEQAENVsBInAG8AJwBNs8EEdDMBdtbfAiPwEMyFUw2zzJFAAsghBzYtCcUAXLHxPLPwH6AgHPFgHPFgIBIBwWAgEgGhcCASAZGAG5Gwi+EFvJIERTVM7xwXy9FG3oYIA9fwhwv/y9EMwUjzwI3EkwgCSMHLegT67AqiCCTEtAKCCCJiWgKASvPL0+EJUIGTwJVzwIX9QdnCAQCtUTDkY2zwQVhA0WfAigTwAPPhCUxLwJTCACASBYGwBRALQ9AQwbQGCANivAYAQ9A9vofLghwGCANivIgKAEPQXyPQAyUAD8CSACASAhHQIBIB8eACUbDH6ADFx1yH6ADH6ADCnA6sAgAvcyHEBygFQBwHKAHABygJQBc8WUAP6AnABymgjbrMlbrOxjkZ/AcoAyHABygBwAcoAJG6zmn8BygAE8AJQBMyWNANwAcoA4iRus5p/AcoABPACUATMljQDcAHKAOJwAcoAAn8BygACyVjMlzMzAXABygDiIW6z4w/JAfsAgIFwAEn8BygAB8AIBzABLVwWchwAcsBcwHLAXABywASzMzJ+QDIcgHLAXABywASygfL/8nQgCASAkIwADp0ACAWImJQALQgbvLQgIBIlHAh10nCH5UwINcLH94C0NMDAXGwwAGRf5Fw4gH6QCJQZm8E+GECjwkw2zxVAvAq2zzgIIIQD4p+pbrjAiCCEBeNRRm6guLSsnBDaPkTDbPAPbPDYQeBBnVQTwKNs84IIQWV8HvLouKi0oAy6PkNs8A9s8NBBWEEVVAvAp2zzgMPLAgi4pLQBM0x8BghBZXwe8uvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIUQzAAWNMfAYIQF41FGbry4IHTP/oA+kABAfpAIdcLAcMAkQGSMW3iAfoAUVUVFEMwAyIw2zwD2zw3EIkQeFUF8CfbPC4sLQBs0x8BghAPin6luvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIB0gABkdSSbQHi+gBRZhYVFEMwARjI+EIBzFUg2zzJ7VRZARbtRNDUAfhi2zxsEy8AHIEBAdcA+kABAfpAAUMwAQW9XCwxART/APSkE/S88sgLMgIBYjozAgEgOTQCAUg2NQCVt3owTgudh6ullc9j0J2HOslQo2zQThO6xqWlbI+WZFp15b++LEcwThhMiKTJr7fJFy9sM7TqukCwTggZzq084r86ShYDrC3EyPZQAgFYODcBEa8W7Z54E3gNQHIBEa287Z4qgfgSwHIBDb4o7tnngVRyAgLKXzsCAUhLPAIBIEQ9AgEgQT4BU0EEcQNkV38ChQNKElbrOOk3BwgEIH2zwQJBA4QXBtbfAhECOSNDTiQwCD8BCsgB2zzJQAAWghDVMnbbWMsfyz8CASBDQgAPFUw8CkxQTCAAIz4QW8kECNfA4IQO5rKACHwJ4AIBIEhFAgEgR0YAFz4QW8kECNfA2bwJ4AAJBAjXwOACASBKSQAdPhBbyQQI18DI8cF8uCEgADk+EFvJBAjXwNVQPAkAYERTQLwIFAGxwUV8vRVAoAIBIFVMAgEgUk0CASBRTgFTFFhoFUx8CRc8CBwcIBAIfgoIfAfEDUQThAjEC/bPEVgEEoQOUCp8CFagTwEMyFVQ2zzJUABOghAXjUUZUAfLHxXLP1AD+gIBzxYBIG6VMHABywGSzxbiAfoCAc8WAA8+CjwJDBDMIAIBIFRTAA08CRsQvAggAA8+EL4KFjwI4AIBIFpWAgEgWFcAUQC0PQEMG0BggDYrwGAEPQPb6Hy4IcBggDYryICgBD0F8j0AMlAA/AigARMcAPIzEMT2zzJgWQAaUCOBAQHPAAHPFgHPFgIBIF5bAvcyHEBygFQBwHKAHABygJQBc8WUAP6AnABymgjbrMlbrOxjkZ/AcoAyHABygBwAcoAJG6zmn8BygAE8AFQBMyWNANwAcoA4iRus5p/AcoABPABUATMljQDcAHKAOJwAcoAAn8BygACyVjMlzMzAXABygDiIW6z4w/JAfsAgXVwACjFwAcoAABJ/AcoAAfABAcwASxwWchwAcsBcwHLAXABywASzMzJ+QDIcgHLAXABywASygfL/8nQgAgEgZ2ACAVhmYQIBIGViAgEgZGMACTwHfAegAAM0IAAFXIyYAAFqAgHOaWgACwgbvLQgIASdO2i7ftwIddJwh+VMCDXCx/eAtDTAwFxsMABkX+RcOIB+kAiUGZvBPhhApFb4CCCCfs0W7qPjzDbPATbPDEQNEEw8CvbPOAgghAMCHqeuoHJxb2oENI+PMNs8BNs8MRA0QTDwLds84CCCEHvdl966cm5vawQwj5Mw2zwE2zw0EGcQVhBFVQLwLts84MAAcm1vbAJwjzD5AYLwzQ2YbLGi9GiucIn0/DFiwRbl9T+9EaaDn1Lb9QQIMLK6jwjbPPAs2zzbMeCRMOLywIJybwBM0x8BghB73ZfeuvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIUQzAALtMfAYIQDAh6nrry4IHSAAGR1JJtAeIBARjI+EIBzFUw2zzJ7VRwADRQQ/oCAc8WIm6zln8BygASzJUycFjKAOLKAAAk0x8Bggn7NFu68uCBgQEB1wABARbtRNDUAfhi2zxsFHMAJvoA+kABAdIAAZHUkm0B4tIAVTC+msWv'; + let systemCell = Cell.fromBase64(__system); + let builder = new TupleBuilder(); + builder.writeCell(systemCell); + builder.writeAddress(owner); + builder.writeCell(content); + let __stack = builder.build(); let codeCell = Cell.fromBoc(Buffer.from(__code, 'base64'))[0]; - let executor = await createExecutorFromCode({ code: codeCell, data: new Cell() }); - let res = await executor.get('init_SampleJetton', __stack, { debug: true }); - if (res.debugLogs.length > 0) { console.warn(res.debugLogs); } + let initCell = Cell.fromBoc(Buffer.from(__init, 'base64'))[0]; + let system = await ContractSystem.create(); + let executor = await ContractExecutor.create({ code: initCell, data: new Cell() }, system); + let res = await executor.get('init', __stack); + if (!res.success) { throw Error(res.error); } + if (res.exitCode !== 0 && res.exitCode !== 1) { + if (SampleJetton_errors[res.exitCode]) { + throw new ComputeError(SampleJetton_errors[res.exitCode].message, res.exitCode, { logs: res.vmLogs }); + } else { + throw new ComputeError('Exit code: ' + res.exitCode, res.exitCode, { logs: res.vmLogs }); + } + } + let data = res.stack.readCell(); return { code: codeCell, data }; } -export const SampleJetton_errors: { [key: string]: string } = { - '2': `Stack undeflow`, - '3': `Stack overflow`, - '4': `Integer overflow`, - '5': `Integer out of expected range`, - '6': `Invalid opcode`, - '7': `Type check error`, - '8': `Cell overflow`, - '9': `Cell underflow`, - '10': `Dictionary error`, - '13': `Out of gas error`, - '32': `Method ID not found`, - '34': `Action is invalid or not supported`, - '37': `Not enough TON`, - '38': `Not enough extra-currencies`, - '128': `Null reference exception`, - '129': `Invalid serialization prefix`, - '130': `Invalid incoming message`, - '131': `Constraints error`, - '132': `Access denied`, - '133': `Contract stopped`, - '134': `Invalid argument`, - '4429': `Invalid sender`, - '13650': `Invalid bounced message`, - '16059': `Invalid value`, - '62972': `Invalid balance`, -} - -export class SampleJetton { - readonly executor: ContractExecutor; - constructor(executor: ContractExecutor) { this.executor = executor; } +const SampleJetton_errors: { [key: number]: { message: string } } = { + 2: { message: `Stack undeflow` }, + 3: { message: `Stack overflow` }, + 4: { message: `Integer overflow` }, + 5: { message: `Integer out of expected range` }, + 6: { message: `Invalid opcode` }, + 7: { message: `Type check error` }, + 8: { message: `Cell overflow` }, + 9: { message: `Cell underflow` }, + 10: { message: `Dictionary error` }, + 13: { message: `Out of gas error` }, + 32: { message: `Method ID not found` }, + 34: { message: `Action is invalid or not supported` }, + 37: { message: `Not enough TON` }, + 38: { message: `Not enough extra-currencies` }, + 128: { message: `Null reference exception` }, + 129: { message: `Invalid serialization prefix` }, + 130: { message: `Invalid incoming message` }, + 131: { message: `Constraints error` }, + 132: { message: `Access denied` }, + 133: { message: `Contract stopped` }, + 134: { message: `Invalid argument` }, + 135: { message: `Code of a contract was not found` }, + 136: { message: `Invalid address` }, + 4429: { message: `Invalid sender` }, + 13650: { message: `Invalid bounced message` }, + 16059: { message: `Invalid value` }, + 62972: { message: `Invalid balance` }, +} + +export class SampleJetton implements Contract { + + static async init(owner: Address, content: Cell | null) { + return await SampleJetton_init(owner,content); + } - async send(args: { amount: BN, from?: Address, debug?: boolean }, message: Mint | 'Mint!' | TokenUpdateContent | TokenBurnNotification) { + static async fromInit(owner: Address, content: Cell | null) { + const init = await SampleJetton_init(owner,content); + const address = contractAddress(0, init); + return new SampleJetton(address, init); + } + + static fromAddress(address: Address) { + return new SampleJetton(address); + } + + readonly address: Address; + readonly init?: { code: Cell, data: Cell }; + readonly abi: ContractABI = { + errors: SampleJetton_errors + }; + + private constructor(address: Address, init?: { code: Cell, data: Cell }) { + this.address = address; + this.init = init; + } + + async send(provider: ContractProvider, via: Sender, args: { value: bigint, bounce?: boolean| null | undefined }, message: Mint | 'Mint!' | TokenUpdateContent | TokenBurnNotification) { + let body: Cell | null = null; if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'Mint') { - body = packMint(message); + body = beginCell().store(storeMint(message)).endCell(); } if (message === 'Mint!') { - body = beginCell().storeUint(0, 32).storeBuffer(Buffer.from(message)).endCell(); + body = beginCell().storeUint(0, 32).storeStringTail(message).endCell(); } if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'TokenUpdateContent') { - body = packTokenUpdateContent(message); + body = beginCell().store(storeTokenUpdateContent(message)).endCell(); } if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'TokenBurnNotification') { - body = packTokenBurnNotification(message); + body = beginCell().store(storeTokenBurnNotification(message)).endCell(); } if (body === null) { throw new Error('Invalid message type'); } - try { - let r = await this.executor.internal(new InternalMessage({ - to: this.executor.address, - from: args.from || this.executor.address, - bounce: false, - value: args.amount, - body: new CommonMessageInfo({ - body: new CellMessage(body!) - }) - }), { debug: args.debug }); - if (r.debugLogs.length > 0) { console.warn(r.debugLogs); } - } catch (e) { - if (e instanceof ExecuteError) { - if (e.debugLogs.length > 0) { console.warn(e.debugLogs); } - if (SampleJetton_errors[e.exitCode.toString()]) { - throw new Error(SampleJetton_errors[e.exitCode.toString()]); - } - } - throw e; - } + + await provider.internal(via, { ...args, body: body }); + } - async getGetWalletAddress(owner: Address) { - try { - let __stack: StackItem[] = []; - __stack.push({ type: 'slice', cell: beginCell().storeAddress(owner).endCell() }); - let result = await this.executor.get('get_wallet_address', __stack, { debug: true }); - if (result.debugLogs.length > 0) { console.warn(result.debugLogs); } - return result.stack.readAddress(); - } catch (e) { - if (e instanceof ExecuteError) { - if (e.debugLogs.length > 0) { console.warn(e.debugLogs); } - if (SampleJetton_errors[e.exitCode.toString()]) { - throw new Error(SampleJetton_errors[e.exitCode.toString()]); - } - } - throw e; - } + + async getGetWalletAddress(provider: ContractProvider, owner: Address) { + let builder = new TupleBuilder(); + builder.writeAddress(owner); + let source = (await provider.get('get_wallet_address', builder.build())).stack; + let result = source.readAddress(); + return result; } - async getGetJettonData() { - try { - let __stack: StackItem[] = []; - let result = await this.executor.get('get_jetton_data', __stack, { debug: true }); - if (result.debugLogs.length > 0) { console.warn(result.debugLogs); } - return unpackStackJettonData(result.stack); - } catch (e) { - if (e instanceof ExecuteError) { - if (e.debugLogs.length > 0) { console.warn(e.debugLogs); } - if (SampleJetton_errors[e.exitCode.toString()]) { - throw new Error(SampleJetton_errors[e.exitCode.toString()]); - } - } - throw e; - } + + async getGetJettonData(provider: ContractProvider) { + let builder = new TupleBuilder(); + let source = (await provider.get('get_jetton_data', builder.build())).stack; + const result = loadTupleJettonData(source); + return result; } - async getOwner() { - try { - let __stack: StackItem[] = []; - let result = await this.executor.get('owner', __stack, { debug: true }); - if (result.debugLogs.length > 0) { console.warn(result.debugLogs); } - return result.stack.readAddress(); - } catch (e) { - if (e instanceof ExecuteError) { - if (e.debugLogs.length > 0) { console.warn(e.debugLogs); } - if (SampleJetton_errors[e.exitCode.toString()]) { - throw new Error(SampleJetton_errors[e.exitCode.toString()]); - } - } - throw e; - } + + async getOwner(provider: ContractProvider) { + let builder = new TupleBuilder(); + let source = (await provider.get('owner', builder.build())).stack; + let result = source.readAddress(); + return result; } + } \ No newline at end of file diff --git a/sources/utils/jetton-helpers.ts b/sources/utils/jetton-helpers.ts index 4ceab82..990d4e8 100644 --- a/sources/utils/jetton-helpers.ts +++ b/sources/utils/jetton-helpers.ts @@ -2,6 +2,10 @@ import { Sha256 } from "@aws-crypto/sha256-js"; import { beginCell, Cell } from "ton"; import { Dictionary } from "ton-core"; +const ONCHAIN_CONTENT_PREFIX = 0x00; +const SNAKE_PREFIX = 0x00; +const CELL_MAX_SIZE_BYTES = Math.floor((1023 - 8) / 8); + function bufferToChunks(buff: Buffer, chunkSize: number) { let chunks: Buffer[] = []; while (buff.byteLength > 0) { @@ -10,7 +14,6 @@ function bufferToChunks(buff: Buffer, chunkSize: number) { } return chunks; } -const CELL_MAX_SIZE_BYTES = Math.floor((1023 - 8) / 8); export function makeSnakeCell(data: Buffer) { let chunks = bufferToChunks(data, CELL_MAX_SIZE_BYTES); @@ -29,9 +32,6 @@ export function makeSnakeCell(data: Buffer) { return b.endCell(); } -const ONCHAIN_CONTENT_PREFIX = 0x00; -const SNAKE_PREFIX = 0x00; - const sha256 = (str: string) => { const sha = new Sha256(); sha.update(str);