Browse Source

deployment_fix

master
AlexG 2 years ago
parent
commit
b13bfe447a
  1. 2
      package.json
  2. 174
      sources/jetton.deploy.ts
  3. 1298
      sources/output/jetton_JettonDefaultWallet.abi
  4. 1
      sources/output/jetton_JettonDefaultWallet.abi.ipfs
  5. BIN
      sources/output/jetton_JettonDefaultWallet.boc
  6. BIN
      sources/output/jetton_JettonDefaultWallet.code.boc
  7. 196
      sources/output/jetton_JettonDefaultWallet.code.fc
  8. 216
      sources/output/jetton_JettonDefaultWallet.code.fif
  9. 811
      sources/output/jetton_JettonDefaultWallet.code.rev.fif
  10. BIN
      sources/output/jetton_JettonDefaultWallet.init.boc
  11. 37
      sources/output/jetton_JettonDefaultWallet.init.fc
  12. 40
      sources/output/jetton_JettonDefaultWallet.init.fif
  13. 26
      sources/output/jetton_JettonDefaultWallet.init.rev.fif
  14. 67
      sources/output/jetton_JettonDefaultWallet.md
  15. 1
      sources/output/jetton_JettonDefaultWallet.pkg
  16. 1391
      sources/output/jetton_JettonDefaultWallet.ts
  17. 1329
      sources/output/jetton_SampleJetton.abi
  18. 1
      sources/output/jetton_SampleJetton.abi.ipfs
  19. BIN
      sources/output/jetton_SampleJetton.boc
  20. BIN
      sources/output/jetton_SampleJetton.code.boc
  21. 248
      sources/output/jetton_SampleJetton.code.fc
  22. 301
      sources/output/jetton_SampleJetton.code.fif
  23. 948
      sources/output/jetton_SampleJetton.code.rev.fif
  24. BIN
      sources/output/jetton_SampleJetton.init.boc
  25. 39
      sources/output/jetton_SampleJetton.init.fc
  26. 54
      sources/output/jetton_SampleJetton.init.fif
  27. 42
      sources/output/jetton_SampleJetton.init.rev.fif
  28. 72
      sources/output/jetton_SampleJetton.md
  29. 1
      sources/output/jetton_SampleJetton.pkg
  30. 1441
      sources/output/jetton_SampleJetton.ts
  31. 8
      sources/utils/jetton-helpers.ts

2
package.json

@ -11,8 +11,8 @@
"deploy": "ts-node sources/jetton.deploy.ts" "deploy": "ts-node sources/jetton.deploy.ts"
}, },
"dependencies": { "dependencies": {
"@types/jest": "^29.2.4",
"@aws-crypto/sha256-js": "^3.0.0", "@aws-crypto/sha256-js": "^3.0.0",
"@types/jest": "^29.2.4",
"@types/node": "^18.11.14", "@types/node": "^18.11.14",
"@types/qs": "^6.9.7", "@types/qs": "^6.9.7",
"jest": "^29.3.1", "jest": "^29.3.1",

174
sources/jetton.deploy.ts

@ -1,25 +1,11 @@
import { beginCell, contractAddress, toNano, TonClient, TonClient4, Address, WalletContractV4, internal, fromNano} from "ton"; import { beginCell, contractAddress, toNano, TonClient, TonClient4, Address, WalletContractV4, internal, fromNano} from "ton";
import {mnemonicToPrivateKey} from "ton-crypto"; 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 (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 //create client for testnet Toncenter API
const client = new TonClient({ const client = new TonClient({
endpoint: 'https://testnet.toncenter.com/api/v2/jsonRPC', endpoint: 'https://testnet.toncenter.com/api/v2/jsonRPC',
@ -48,16 +34,28 @@ import {JettonMetaDataKeys} from 'utils/jetton-helpers';
// Get deployment wallet balance // Get deployment wallet balance
let balance: bigint = await contract.getBalance(); 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'); let owner = Address.parse('kQDND6yHEzKB82ZGRn58aY9Tt_69Ie_uz73e2VuuJ3fVVcxf');
// Create content Cell // 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 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 // send a message on new address contract to deploy it
let seqno: number = await contract.getSeqno(); let seqno: number = await contract.getSeqno();
console.log('🛠Preparing new outgoing massage from deployment wallet. Seqno = ', seqno); 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, ' ======'); 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]
)
);
}

1298
sources/output/jetton_JettonDefaultWallet.abi

File diff suppressed because one or more lines are too long

1
sources/output/jetton_JettonDefaultWallet.abi.ipfs

File diff suppressed because one or more lines are too long

BIN
sources/output/jetton_JettonDefaultWallet.boc

Binary file not shown.

BIN
sources/output/jetton_JettonDefaultWallet.code.boc

Binary file not shown.

196
sources/output/jetton_JettonDefaultWallet.fc → sources/output/jetton_JettonDefaultWallet.code.fc

@ -10,7 +10,12 @@ global cell __tact_context_sys;
(int, slice, int, slice) __tact_context_get() inline { return __tact_context; } (int, slice, int, slice) __tact_context_get() inline { return __tact_context; }
() __tact_verify_address(slice address) inline { () __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 { (slice, slice) __tact_load_address(slice cs) inline {
@ -44,7 +49,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(); var b = begin_cell();
b = b.store_uint(0, 2); b = b.store_uint(0, 2);
b = b.store_uint(3, 2); b = b.store_uint(3, 2);
@ -52,12 +66,7 @@ slice __tact_compute_contract_address(int chain, cell code, cell data) {
b = b.store_ref(code); b = b.store_ref(code);
b = b.store_ref(data); b = b.store_ref(data);
var hash = cell_hash(b.end_cell()); var hash = cell_hash(b.end_cell());
var b2 = begin_cell(); return __tact_create_address(chain, hash);
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();
} }
int __tact_address_eq(slice a, slice b) inline { int __tact_address_eq(slice a, slice b) inline {
@ -74,42 +83,39 @@ cell __tact_dict_set_code(cell dict, int id, cell code) inline {
cell __tact_dict_get_code(cell dict, int id) inline { cell __tact_dict_get_code(cell dict, int id) inline {
var (data, ok) = udict_get_ref?(dict, 16, id); var (data, ok) = udict_get_ref?(dict, 16, id);
throw_unless(100, ok); throw_unless(135, ok);
return data; return data;
} }
(slice, ((int, int, slice, slice, cell, int, slice))) __gen_read_TokenTransfer(slice sc_0) inline { (slice, ((int, int, slice, slice, cell, int, slice))) __gen_read_TokenTransfer(slice sc_0) inline_ref {
throw_unless(129, sc_0~load_uint(32) == 260734629); throw_unless(129, sc_0~load_uint(32) == 260734629);
var v'queryId = sc_0~load_uint(64); var v'queryId = sc_0~load_uint(64);
var v'amount = sc_0~load_coins(); var v'amount = sc_0~load_coins();
var v'destination = sc_0~__tact_load_address(); var v'destination = sc_0~__tact_load_address();
var v'responseDestination = sc_0~__tact_load_address_opt(); var v'responseDestination = sc_0~__tact_load_address_opt();
var v'customPayload = null(); var v'customPayload = sc_0~load_int(1) ? sc_0~load_ref() : null();
if (sc_0~load_int(1)) {
v'customPayload = sc_0~load_ref();
}
var v'forwardTonAmount = sc_0~load_coins(); var v'forwardTonAmount = sc_0~load_coins();
var v'forwardPayload = sc_0; var v'forwardPayload = sc_0;
return (sc_0, (v'queryId, v'amount, v'destination, v'responseDestination, v'customPayload, v'forwardTonAmount, v'forwardPayload)); return (sc_0, (v'queryId, v'amount, v'destination, v'responseDestination, v'customPayload, v'forwardTonAmount, v'forwardPayload));
} }
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; 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, 395134233, 32);
build_0 = store_uint(build_0, v'queryId, 64); build_0 = build_0.store_uint(v'queryId, 64);
build_0 = store_coins(build_0, v'amount); build_0 = build_0.store_coins(v'amount);
build_0 = __tact_store_address(build_0, v'from); build_0 = __tact_store_address(build_0, v'from);
build_0 = __tact_store_address_opt(build_0, v'responseAddress); build_0 = __tact_store_address_opt(build_0, v'responseAddress);
build_0 = store_coins(build_0, v'forwardTonAmount); build_0 = build_0.store_coins(v'forwardTonAmount);
build_0 = store_slice(build_0, v'forwardPayload); build_0 = build_0.store_slice(v'forwardPayload);
return build_0; 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(); return __gen_write_TokenTransferInternal(begin_cell(), v).end_cell();
} }
(slice, ((int, int, slice, slice, int, slice))) __gen_read_TokenTransferInternal(slice sc_0) inline { (slice, ((int, int, slice, slice, int, slice))) __gen_read_TokenTransferInternal(slice sc_0) inline_ref {
throw_unless(129, sc_0~load_uint(32) == 395134233); throw_unless(129, sc_0~load_uint(32) == 395134233);
var v'queryId = sc_0~load_uint(64); var v'queryId = sc_0~load_uint(64);
var v'amount = sc_0~load_coins(); var v'amount = sc_0~load_coins();
@ -120,21 +126,21 @@ cell __gen_writecell_TokenTransferInternal((int, int, slice, slice, int, slice)
return (sc_0, (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload)); return (sc_0, (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload));
} }
builder __gen_write_TokenNotification(builder build_0, (int, int, slice, slice) v) inline { builder __gen_write_TokenNotification(builder build_0, (int, int, slice, slice) v) inline_ref {
var (v'queryId, v'amount, v'from, v'forwardPayload) = v; var (v'queryId, v'amount, v'from, v'forwardPayload) = v;
build_0 = store_uint(build_0, 1935855772, 32); build_0 = store_uint(build_0, 1935855772, 32);
build_0 = store_uint(build_0, v'queryId, 64); build_0 = build_0.store_uint(v'queryId, 64);
build_0 = store_coins(build_0, v'amount); build_0 = build_0.store_coins(v'amount);
build_0 = __tact_store_address(build_0, v'from); build_0 = __tact_store_address(build_0, v'from);
build_0 = store_slice(build_0, v'forwardPayload); build_0 = build_0.store_slice(v'forwardPayload);
return build_0; return build_0;
} }
cell __gen_writecell_TokenNotification((int, int, slice, slice) v) inline { cell __gen_writecell_TokenNotification((int, int, slice, slice) v) inline_ref {
return __gen_write_TokenNotification(begin_cell(), v).end_cell(); return __gen_write_TokenNotification(begin_cell(), v).end_cell();
} }
(slice, ((int, int, slice, slice))) __gen_read_TokenBurn(slice sc_0) inline { (slice, ((int, int, slice, slice))) __gen_read_TokenBurn(slice sc_0) inline_ref {
throw_unless(129, sc_0~load_uint(32) == 1499400124); throw_unless(129, sc_0~load_uint(32) == 1499400124);
var v'queryId = sc_0~load_uint(64); var v'queryId = sc_0~load_uint(64);
var v'amount = sc_0~load_coins(); var v'amount = sc_0~load_coins();
@ -143,40 +149,40 @@ cell __gen_writecell_TokenNotification((int, int, slice, slice) v) inline {
return (sc_0, (v'queryId, v'amount, v'owner, v'responseAddress)); return (sc_0, (v'queryId, v'amount, v'owner, v'responseAddress));
} }
builder __gen_write_TokenBurnNotification(builder build_0, (int, int, slice, slice) v) inline { builder __gen_write_TokenBurnNotification(builder build_0, (int, int, slice, slice) v) inline_ref {
var (v'queryId, v'amount, v'owner, v'responseAddress) = v; var (v'queryId, v'amount, v'owner, v'responseAddress) = v;
build_0 = store_uint(build_0, 2078119902, 32); build_0 = store_uint(build_0, 2078119902, 32);
build_0 = store_uint(build_0, v'queryId, 64); build_0 = build_0.store_uint(v'queryId, 64);
build_0 = store_coins(build_0, v'amount); build_0 = build_0.store_coins(v'amount);
build_0 = __tact_store_address(build_0, v'owner); build_0 = __tact_store_address(build_0, v'owner);
build_0 = __tact_store_address_opt(build_0, v'responseAddress); build_0 = __tact_store_address_opt(build_0, v'responseAddress);
return build_0; return build_0;
} }
cell __gen_writecell_TokenBurnNotification((int, int, slice, slice) v) inline { cell __gen_writecell_TokenBurnNotification((int, int, slice, slice) v) inline_ref {
return __gen_write_TokenBurnNotification(begin_cell(), v).end_cell(); return __gen_write_TokenBurnNotification(begin_cell(), v).end_cell();
} }
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; var (v'queryId) = v;
build_0 = store_uint(build_0, 3576854235, 32); 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; 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(); return __gen_write_TokenExcesses(begin_cell(), v).end_cell();
} }
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; 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'owner);
build_0 = __tact_store_address(build_0, v'master); build_0 = __tact_store_address(build_0, v'master);
return build_0; return build_0;
} }
(slice, ((int, slice, slice))) __gen_read_JettonDefaultWallet(slice sc_0) inline { (slice, ((int, slice, slice))) __gen_read_JettonDefaultWallet(slice sc_0) inline_ref {
var v'balance = sc_0~load_int(257); var v'balance = sc_0~load_int(257);
var v'owner = sc_0~__tact_load_address(); var v'owner = sc_0~__tact_load_address();
var v'master = sc_0~__tact_load_address(); var v'master = sc_0~__tact_load_address();
@ -188,76 +194,73 @@ _ __gen_StateInit_get_code((cell, cell) v) inline {
return v'code; return v'code;
} }
(int, slice, slice) __gen_load_JettonDefaultWallet() inline { (int, slice, slice, cell) __gen_JettonWalletData_to_external(((int, slice, slice, cell)) v) {
var (v'balance, v'owner, v'master, v'walletCode) = v;
return (v'balance, v'owner, v'master, v'walletCode);
}
(int, slice, slice) __gen_load_JettonDefaultWallet() inline_ref {
slice sc = get_data().begin_parse(); slice sc = get_data().begin_parse();
__tact_context_sys = sc~load_ref(); __tact_context_sys = sc~load_ref();
return sc~__gen_read_JettonDefaultWallet(); return sc~__gen_read_JettonDefaultWallet();
} }
() __gen_store_JettonDefaultWallet((int, slice, slice) v) impure inline { () __gen_store_JettonDefaultWallet((int, slice, slice) v) impure inline_ref {
builder b = begin_cell(); builder b = begin_cell();
b = b.store_ref(__tact_context_sys); b = b.store_ref(__tact_context_sys);
b = __gen_write_JettonDefaultWallet(b, v); b = __gen_write_JettonDefaultWallet(b, v);
set_data(b.end_cell()); set_data(b.end_cell());
} }
builder storeBool(builder $s, int $value) impure { slice $contractAddress((cell, cell) $s) impure {
if ($value) {
return store_int($s, (- 1), 1);
} else {
return store_int($s, 0, 1);
}
}
slice contractAddress((cell, cell) $s) impure {
var (($s'code, $s'data)) = $s; var (($s'code, $s'data)) = $s;
return __tact_compute_contract_address(0, $s'code, $s'data); 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; var (($params'bounce, $params'to, $params'value, $params'mode, $params'body, $params'code, $params'data)) = $params;
builder $b = begin_cell(); builder $b = begin_cell();
$b = store_int($b, 1, 2); $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 = store_int($b, 0, 3);
$b = __tact_store_address($b, $params'to); $b = __tact_store_address($b, $params'to);
$b = store_coins($b, $params'value); $b = store_coins($b, $params'value);
$b = store_int($b, 0, ((((1 + 4) + 4) + 64) + 32)); $b = store_int($b, 0, ((((1 + 4) + 4) + 64) + 32));
if (((~ null?($params'code)) | (~ null?($params'data)))) { if (((~ null?($params'code)) | (~ null?($params'data)))) {
$b = storeBool($b, true); $b = __tact_store_bool($b, true);
builder $bc = begin_cell(); builder $bc = begin_cell();
$bc = storeBool($bc, false); $bc = __tact_store_bool($bc, false);
$bc = storeBool($bc, false); $bc = __tact_store_bool($bc, false);
if ((~ null?($params'code))) { if ((~ null?($params'code))) {
$bc = storeBool($bc, true); $bc = __tact_store_bool($bc, true);
$bc = store_ref($bc, __tact_not_null($params'code)); $bc = store_ref($bc, __tact_not_null($params'code));
} else { } else {
$bc = storeBool($bc, false); $bc = __tact_store_bool($bc, false);
} }
if ((~ null?($params'data))) { if ((~ null?($params'data))) {
$bc = storeBool($bc, true); $bc = __tact_store_bool($bc, true);
$bc = store_ref($bc, __tact_not_null($params'data)); $bc = store_ref($bc, __tact_not_null($params'data));
} else { } else {
$bc = storeBool($bc, false); $bc = __tact_store_bool($bc, false);
} }
$bc = storeBool($bc, false); $bc = __tact_store_bool($bc, false);
$b = storeBool($b, true); $b = __tact_store_bool($b, true);
$b = store_ref($b, end_cell($bc)); $b = store_ref($b, end_cell($bc));
} else { } else {
$b = storeBool($b, false); $b = __tact_store_bool($b, false);
} }
cell $body = $params'body; cell $body = $params'body;
if ((~ null?($body))) { if ((~ null?($body))) {
$b = storeBool($b, true); $b = __tact_store_bool($b, true);
$b = store_ref($b, __tact_not_null($body)); $b = store_ref($b, __tact_not_null($body));
} else { } else {
$b = storeBool($b, false); $b = __tact_store_bool($b, false);
} }
cell $c = end_cell($b); cell $c = end_cell($b);
send_raw_message($c, $params'mode); send_raw_message($c, $params'mode);
} }
int __gen_Context_readForwardFee((int, slice, int, slice) $self) impure { int $__gen_Context_readForwardFee((int, slice, int, slice) $self) impure {
var (($self'bounced, $self'sender, $self'value, $self'raw)) = $self; var (($self'bounced, $self'sender, $self'value, $self'raw)) = $self;
var (($self'bounced, $self'sender, $self'value, $self'raw)) = $self; var (($self'bounced, $self'sender, $self'value, $self'raw)) = $self;
slice $sc = $self'raw; slice $sc = $self'raw;
@ -267,7 +270,7 @@ int __gen_Context_readForwardFee((int, slice, int, slice) $self) impure {
return (($sc~load_coins() * 3) / 2); return (($sc~load_coins() * 3) / 2);
} }
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()); var (($self'balance, $self'owner, $self'master)) = (null(), null(), null());
$self'balance = 0; $self'balance = 0;
$self'owner = $owner; $self'owner = $owner;
@ -278,54 +281,55 @@ cell __gen_JettonDefaultWallet_init(cell sys', slice $master, slice $owner) {
return b'.end_cell(); 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(); slice sc' = sys'.begin_parse();
cell source = sc'~load_dict(); cell source = sc'~load_dict();
cell mine = __tact_dict_get_code(source, 55471);
cell contracts = new_dict(); 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(); cell sys = begin_cell().store_dict(contracts).end_cell();
return (mine, __gen_JettonDefaultWallet_init(sys, $master, $owner)); return (mine, $__gen_JettonDefaultWallet_init(sys, $master, $owner));
} }
(int, slice, slice, cell) __gen_JettonDefaultWallet_get_wallet_data((int, slice, slice) $self) impure { (int, slice, slice, cell) $__gen_JettonDefaultWallet_get_wallet_data((int, slice, slice) $self) impure {
var (($self'balance, $self'owner, $self'master)) = $self; var (($self'balance, $self'owner, $self'master)) = $self;
return ($self'balance, $self'owner, $self'master, __gen_StateInit_get_code(__gen_JettonDefaultWallet_init_child(__tact_context_sys, $self'master, $self'owner))); return ($self'balance, $self'owner, $self'master, __gen_StateInit_get_code($__gen_JettonDefaultWallet_init_child(__tact_context_sys, $self'master, $self'owner)));
} }
_ __gen_get_get_wallet_data() method_id(97026) { _ $__gen_get_get_wallet_data() method_id(97026) {
var self = __gen_load_JettonDefaultWallet(); var self = __gen_load_JettonDefaultWallet();
var res = __gen_JettonDefaultWallet_get_wallet_data(self); var res = $__gen_JettonDefaultWallet_get_wallet_data(self);
return res; return __gen_JettonWalletData_to_external(res);
} }
(((int, slice, slice)), ()) __gen_JettonDefaultWallet_receive_TokenTransfer((int, slice, slice) $self, (int, int, slice, slice, cell, int, slice) $msg) impure { (((int, slice, slice)), ()) $__gen_JettonDefaultWallet_receive_TokenTransfer((int, slice, slice) $self, (int, int, slice, slice, cell, int, slice) $msg) impure {
var ($self'balance, $self'owner, $self'master) = $self; var ($self'balance, $self'owner, $self'master) = $self;
var ($msg'queryId, $msg'amount, $msg'destination, $msg'responseDestination, $msg'customPayload, $msg'forwardTonAmount, $msg'forwardPayload) = $msg; var ($msg'queryId, $msg'amount, $msg'destination, $msg'responseDestination, $msg'customPayload, $msg'forwardTonAmount, $msg'forwardPayload) = $msg;
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get();
throw_unless(4429, __tact_address_eq($ctx'sender, $self'owner)); throw_unless(4429, __tact_address_eq($ctx'sender, $self'owner));
$self'balance = ($self'balance - $msg'amount); $self'balance = ($self'balance - $msg'amount);
throw_unless(62972, ($self'balance >= 0)); 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));
int $fwdCount = 1; int $fwdCount = 1;
if (($msg'forwardTonAmount > 0)) { if (($msg'forwardTonAmount > 0)) {
$fwdCount = 2; $fwdCount = 2;
} }
throw_unless(16059, ($ctx'value > ((($fwdCount * $fwdFee) + (2 * 10000000)) + 10000000))); 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); var ($init'code, $init'data) = $__gen_JettonDefaultWallet_init_child(__tact_context_sys, $self'master, $msg'destination);
slice $walletAddress = contractAddress(($init'code, $init'data)); 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)); $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), ()); 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 ($self'balance, $self'owner, $self'master) = $self;
var ($msg'queryId, $msg'amount, $msg'from, $msg'responseAddress, $msg'forwardTonAmount, $msg'forwardPayload) = $msg; 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(); var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get();
if (__tact_address_neq($ctx'sender, $self'master)) { if (__tact_address_neq($ctx'sender, $self'master)) {
var ($sinit'code, $sinit'data) = __gen_JettonDefaultWallet_init_child(__tact_context_sys, $self'master, $msg'from); 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)); throw_unless(4429, __tact_address_eq($contractAddress(($sinit'code, $sinit'data)), $ctx'sender));
} }
$self'balance = ($self'balance + $msg'amount); $self'balance = ($self'balance + $msg'amount);
throw_unless(62972, ($self'balance >= 0)); throw_unless(62972, ($self'balance >= 0));
@ -334,30 +338,30 @@ _ __gen_get_get_wallet_data() method_id(97026) {
int $storageFee = (10000000 - min($tonBalanceBeforeMsg, 10000000)); int $storageFee = (10000000 - min($tonBalanceBeforeMsg, 10000000));
$msgValue = ($msgValue - ($storageFee + 10000000)); $msgValue = ($msgValue - ($storageFee + 10000000));
if (($msg'forwardTonAmount > 0)) { 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)); $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))) { 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), ()); 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 ($self'balance, $self'owner, $self'master) = $self;
var ($msg'queryId, $msg'amount, $msg'owner, $msg'responseAddress) = $msg; var ($msg'queryId, $msg'amount, $msg'owner, $msg'responseAddress) = $msg;
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get();
throw_unless(4429, __tact_address_eq($ctx'sender, $self'owner)); throw_unless(4429, __tact_address_eq($ctx'sender, $self'owner));
$self'balance = ($self'balance - $msg'amount); $self'balance = ($self'balance - $msg'amount);
throw_unless(62972, ($self'balance >= 0)); 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))); 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), ()); 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; var ($self'balance, $self'owner, $self'master) = $self;
$msg~skip_bits(32); $msg~skip_bits(32);
int $op = $msg~load_uint(32); int $op = $msg~load_uint(32);
@ -385,7 +389,7 @@ _ __gen_get_get_wallet_data() method_id(97026) {
;; Handle bounced messages ;; Handle bounced messages
if (msg_bounced) { if (msg_bounced) {
var self = __gen_load_JettonDefaultWallet(); var self = __gen_load_JettonDefaultWallet();
self~__gen_JettonDefaultWallet_receive_bounced(in_msg); self~$__gen_JettonDefaultWallet_receive_bounced(in_msg);
__gen_store_JettonDefaultWallet(self); __gen_store_JettonDefaultWallet(self);
return (); return ();
} }
@ -394,7 +398,7 @@ _ __gen_get_get_wallet_data() method_id(97026) {
if (op == 260734629) { if (op == 260734629) {
var self = __gen_load_JettonDefaultWallet(); var self = __gen_load_JettonDefaultWallet();
var msg = in_msg~__gen_read_TokenTransfer(); var msg = in_msg~__gen_read_TokenTransfer();
self~__gen_JettonDefaultWallet_receive_TokenTransfer(msg); self~$__gen_JettonDefaultWallet_receive_TokenTransfer(msg);
__gen_store_JettonDefaultWallet(self); __gen_store_JettonDefaultWallet(self);
return (); return ();
} }
@ -403,7 +407,7 @@ _ __gen_get_get_wallet_data() method_id(97026) {
if (op == 395134233) { if (op == 395134233) {
var self = __gen_load_JettonDefaultWallet(); var self = __gen_load_JettonDefaultWallet();
var msg = in_msg~__gen_read_TokenTransferInternal(); var msg = in_msg~__gen_read_TokenTransferInternal();
self~__gen_JettonDefaultWallet_receive_TokenTransferInternal(msg); self~$__gen_JettonDefaultWallet_receive_TokenTransferInternal(msg);
__gen_store_JettonDefaultWallet(self); __gen_store_JettonDefaultWallet(self);
return (); return ();
} }
@ -412,7 +416,7 @@ _ __gen_get_get_wallet_data() method_id(97026) {
if (op == 1499400124) { if (op == 1499400124) {
var self = __gen_load_JettonDefaultWallet(); var self = __gen_load_JettonDefaultWallet();
var msg = in_msg~__gen_read_TokenBurn(); var msg = in_msg~__gen_read_TokenBurn();
self~__gen_JettonDefaultWallet_receive_TokenBurn(msg); self~$__gen_JettonDefaultWallet_receive_TokenBurn(msg);
__gen_store_JettonDefaultWallet(self); __gen_store_JettonDefaultWallet(self);
return (); return ();
} }
@ -420,10 +424,6 @@ _ __gen_get_get_wallet_data() method_id(97026) {
throw(130); throw(130);
} }
cell init_JettonDefaultWallet(cell sys', slice master, slice owner) method_id {
return __gen_JettonDefaultWallet_init(sys', master, owner);
}
_ supported_interfaces() method_id { _ supported_interfaces() method_id {
return ( return (
"org.ton.introspection.v0"H >> 128, "org.ton.introspection.v0"H >> 128,
@ -433,5 +433,5 @@ _ supported_interfaces() method_id {
} }
_ get_abi_ipfs() { _ get_abi_ipfs() {
return "ipfs://QmdPUYM67SQxPhiSig4LVW3rjqcKgEce6SGvRp3oZRXEM1"; return "ipfs://QmXBfqbQzeN1uT55MyYpwhU9RV47Sq3quVt3qFLgWH8NhD";
} }

216
sources/output/jetton_JettonDefaultWallet.fif → sources/output/jetton_JettonDefaultWallet.code.fif

@ -3,10 +3,12 @@ PROGRAM{
DECLPROC __tact_not_null DECLPROC __tact_not_null
DECLPROC __tact_context_get DECLPROC __tact_context_get
DECLPROC __tact_verify_address DECLPROC __tact_verify_address
DECLPROC __tact_store_bool
DECLPROC __tact_load_address DECLPROC __tact_load_address
DECLPROC __tact_load_address_opt DECLPROC __tact_load_address_opt
DECLPROC __tact_store_address DECLPROC __tact_store_address
DECLPROC __tact_store_address_opt DECLPROC __tact_store_address_opt
DECLPROC __tact_create_address
DECLPROC __tact_compute_contract_address DECLPROC __tact_compute_contract_address
DECLPROC __tact_address_eq DECLPROC __tact_address_eq
DECLPROC __tact_address_neq DECLPROC __tact_address_neq
@ -26,22 +28,21 @@ PROGRAM{
DECLPROC __gen_write_JettonDefaultWallet DECLPROC __gen_write_JettonDefaultWallet
DECLPROC __gen_read_JettonDefaultWallet DECLPROC __gen_read_JettonDefaultWallet
DECLPROC __gen_StateInit_get_code DECLPROC __gen_StateInit_get_code
DECLPROC __gen_JettonWalletData_to_external
DECLPROC __gen_load_JettonDefaultWallet DECLPROC __gen_load_JettonDefaultWallet
DECLPROC __gen_store_JettonDefaultWallet DECLPROC __gen_store_JettonDefaultWallet
DECLPROC storeBool DECLPROC $contractAddress
DECLPROC contractAddress DECLPROC $send
DECLPROC send DECLPROC $__gen_Context_readForwardFee
DECLPROC __gen_Context_readForwardFee DECLPROC $__gen_JettonDefaultWallet_init
DECLPROC __gen_JettonDefaultWallet_init DECLPROC $__gen_JettonDefaultWallet_init_child
DECLPROC __gen_JettonDefaultWallet_init_child DECLPROC $__gen_JettonDefaultWallet_get_wallet_data
DECLPROC __gen_JettonDefaultWallet_get_wallet_data 97026 DECLMETHOD $__gen_get_get_wallet_data
97026 DECLMETHOD __gen_get_get_wallet_data DECLPROC $__gen_JettonDefaultWallet_receive_TokenTransfer
DECLPROC __gen_JettonDefaultWallet_receive_TokenTransfer DECLPROC $__gen_JettonDefaultWallet_receive_TokenTransferInternal
DECLPROC __gen_JettonDefaultWallet_receive_TokenTransferInternal DECLPROC $__gen_JettonDefaultWallet_receive_TokenBurn
DECLPROC __gen_JettonDefaultWallet_receive_TokenBurn DECLPROC $__gen_JettonDefaultWallet_receive_bounced
DECLPROC __gen_JettonDefaultWallet_receive_bounced
DECLPROC recv_internal DECLPROC recv_internal
111075 DECLMETHOD init_JettonDefaultWallet
113617 DECLMETHOD supported_interfaces 113617 DECLMETHOD supported_interfaces
DECLPROC get_abi_ipfs DECLPROC get_abi_ipfs
DECLGLOBVAR __tact_context DECLGLOBVAR __tact_context
@ -63,7 +64,11 @@ PROGRAM{
SBITS SBITS
267 PUSHINT 267 PUSHINT
NEQ NEQ
134 THROWIFNOT 136 THROWIFNOT
}>
__tact_store_bool PROCINLINE:<{
SWAP
1 STI
}> }>
__tact_load_address PROCINLINE:<{ __tact_load_address PROCINLINE:<{
LDMSGADDR LDMSGADDR
@ -96,34 +101,37 @@ PROGRAM{
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
}> }>
}> }>
__tact_compute_contract_address PROC:<{ __tact_create_address PROCINLINE:<{
NEWC NEWC
0 PUSHINT 2 PUSHINT
SWAP
2 STU
3 PUSHINT
SWAP SWAP
2 STU 2 STU
0 PUSHINT 0 PUSHINT
SWAP SWAP
1 STU 1 STU
s1 s2 XCHG s1 s2 XCHG
STREF 8 STI
STREF 256 STU
ENDC ENDC
HASHCU CTOS
}>
__tact_compute_contract_address PROCINLINE:<{
NEWC NEWC
2 PUSHINT 0 PUSHINT
SWAP
2 STU
3 PUSHINT
SWAP SWAP
2 STU 2 STU
0 PUSHINT 0 PUSHINT
SWAP SWAP
1 STU 1 STU
s1 s2 XCHG s1 s2 XCHG
8 STI STREF
256 STU STREF
ENDC ENDC
CTOS HASHCU
__tact_create_address INLINECALLDICT
}> }>
__tact_address_eq PROCINLINE:<{ __tact_address_eq PROCINLINE:<{
SDEQ SDEQ
@ -142,9 +150,9 @@ PROGRAM{
16 PUSHINT 16 PUSHINT
DICTUGETREF DICTUGETREF
NULLSWAPIFNOT NULLSWAPIFNOT
100 THROWIFNOT 135 THROWIFNOT
}> }>
__gen_read_TokenTransfer PROCINLINE:<{ __gen_read_TokenTransfer PROCREF:<{
32 LDU 32 LDU
SWAP SWAP
260734629 PUSHINT 260734629 PUSHINT
@ -155,22 +163,23 @@ PROGRAM{
__tact_load_address INLINECALLDICT __tact_load_address INLINECALLDICT
SWAP SWAP
__tact_load_address_opt INLINECALLDICT __tact_load_address_opt INLINECALLDICT
PUSHNULL SWAP
s0 s2 XCHG
1 LDI 1 LDI
SWAP SWAP
IF:<{ IF:<{
1 2 BLKDROP2
LDREF LDREF
s1 s2 XCHG }>ELSE<{
PUSHNULL
SWAP
}> }>
LDGRAMS LDGRAMS
s6 s6 XCPU s6 s6 XCPU
s1 s6 XCHG s1 s6 XCHG
s1 s5 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 395134233 PUSHINT
s0 s7 XCHG2 s0 s7 XCHG2
32 STU 32 STU
@ -187,13 +196,13 @@ PROGRAM{
SWAP SWAP
STSLICER STSLICER
}> }>
__gen_writecell_TokenTransferInternal PROCINLINE:<{ __gen_writecell_TokenTransferInternal PROCREF:<{
NEWC NEWC
6 -ROLL 6 -ROLL
__gen_write_TokenTransferInternal INLINECALLDICT __gen_write_TokenTransferInternal INLINECALLDICT
ENDC ENDC
}> }>
__gen_read_TokenTransferInternal PROCINLINE:<{ __gen_read_TokenTransferInternal PROCREF:<{
32 LDU 32 LDU
SWAP SWAP
395134233 PUSHINT 395134233 PUSHINT
@ -211,7 +220,7 @@ PROGRAM{
s1 s4 XCHG s1 s4 XCHG
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
}> }>
__gen_write_TokenNotification PROCINLINE:<{ __gen_write_TokenNotification PROCREF:<{
1935855772 PUSHINT 1935855772 PUSHINT
s0 s5 XCHG2 s0 s5 XCHG2
32 STU 32 STU
@ -224,13 +233,13 @@ PROGRAM{
SWAP SWAP
STSLICER STSLICER
}> }>
__gen_writecell_TokenNotification PROCINLINE:<{ __gen_writecell_TokenNotification PROCREF:<{
NEWC NEWC
4 -ROLL 4 -ROLL
__gen_write_TokenNotification INLINECALLDICT __gen_write_TokenNotification INLINECALLDICT
ENDC ENDC
}> }>
__gen_read_TokenBurn PROCINLINE:<{ __gen_read_TokenBurn PROCREF:<{
32 LDU 32 LDU
SWAP SWAP
1499400124 PUSHINT 1499400124 PUSHINT
@ -244,7 +253,7 @@ PROGRAM{
s1 s4 XCHG s1 s4 XCHG
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
}> }>
__gen_write_TokenBurnNotification PROCINLINE:<{ __gen_write_TokenBurnNotification PROCREF:<{
2078119902 PUSHINT 2078119902 PUSHINT
s0 s5 XCHG2 s0 s5 XCHG2
32 STU 32 STU
@ -257,25 +266,25 @@ PROGRAM{
SWAP SWAP
__tact_store_address_opt INLINECALLDICT __tact_store_address_opt INLINECALLDICT
}> }>
__gen_writecell_TokenBurnNotification PROCINLINE:<{ __gen_writecell_TokenBurnNotification PROCREF:<{
NEWC NEWC
4 -ROLL 4 -ROLL
__gen_write_TokenBurnNotification INLINECALLDICT __gen_write_TokenBurnNotification INLINECALLDICT
ENDC ENDC
}> }>
__gen_write_TokenExcesses PROCINLINE:<{ __gen_write_TokenExcesses PROCREF:<{
3576854235 PUSHINT 3576854235 PUSHINT
ROT ROT
32 STU 32 STU
64 STU 64 STU
}> }>
__gen_writecell_TokenExcesses PROCINLINE:<{ __gen_writecell_TokenExcesses PROCREF:<{
NEWC NEWC
SWAP SWAP
__gen_write_TokenExcesses INLINECALLDICT __gen_write_TokenExcesses INLINECALLDICT
ENDC ENDC
}> }>
__gen_write_JettonDefaultWallet PROCINLINE:<{ __gen_write_JettonDefaultWallet PROCREF:<{
s2 s3 XCHG2 s2 s3 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
@ -284,7 +293,7 @@ PROGRAM{
SWAP SWAP
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
}> }>
__gen_read_JettonDefaultWallet PROCINLINE:<{ __gen_read_JettonDefaultWallet PROCREF:<{
257 PUSHINT 257 PUSHINT
LDIX LDIX
__tact_load_address INLINECALLDICT __tact_load_address INLINECALLDICT
@ -295,7 +304,9 @@ PROGRAM{
__gen_StateInit_get_code PROCINLINE:<{ __gen_StateInit_get_code PROCINLINE:<{
DROP DROP
}> }>
__gen_load_JettonDefaultWallet PROCINLINE:<{ __gen_JettonWalletData_to_external PROC:<{
}>
__gen_load_JettonDefaultWallet PROCREF:<{
c4 PUSH c4 PUSH
CTOS CTOS
LDREF LDREF
@ -304,7 +315,7 @@ PROGRAM{
__gen_read_JettonDefaultWallet INLINECALLDICT __gen_read_JettonDefaultWallet INLINECALLDICT
1 3 BLKDROP2 1 3 BLKDROP2
}> }>
__gen_store_JettonDefaultWallet PROCINLINE:<{ __gen_store_JettonDefaultWallet PROCREF:<{
NEWC NEWC
__tact_context_sys GETGLOB __tact_context_sys GETGLOB
SWAP SWAP
@ -314,28 +325,18 @@ PROGRAM{
ENDC ENDC
c4 POP c4 POP
}> }>
storeBool PROC:<{ $contractAddress PROC:<{
IFJMP:<{
-1 PUSHINT
SWAP
1 STI
}>
0 PUSHINT
SWAP
1 STI
}>
contractAddress PROC:<{
0 PUSHINT 0 PUSHINT
-ROT -ROT
__tact_compute_contract_address CALLDICT __tact_compute_contract_address INLINECALLDICT
}> }>
send PROC:<{ $send PROC:<{
NEWC NEWC
1 PUSHINT 1 PUSHINT
SWAP SWAP
2 STI 2 STI
s0 s7 XCHG2 s0 s7 XCHG2
storeBool CALLDICT __tact_store_bool INLINECALLDICT
0 PUSHINT 0 PUSHINT
SWAP SWAP
3 STI 3 STI
@ -355,18 +356,18 @@ PROGRAM{
OR OR
IF:<{ IF:<{
TRUE TRUE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
NEWC NEWC
FALSE FALSE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
FALSE FALSE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
s4 PUSH s4 PUSH
ISNULL ISNULL
NOT NOT
IF:<{ IF:<{
TRUE TRUE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
s0 s4 XCHG s0 s4 XCHG
__tact_not_null CALLDICT __tact_not_null CALLDICT
s0 s4 XCHG2 s0 s4 XCHG2
@ -375,14 +376,14 @@ PROGRAM{
s4 POP s4 POP
s0 s3 XCHG s0 s3 XCHG
FALSE FALSE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
}> }>
s4 PUSH s4 PUSH
ISNULL ISNULL
NOT NOT
IF:<{ IF:<{
TRUE TRUE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
s0 s4 XCHG s0 s4 XCHG
__tact_not_null CALLDICT __tact_not_null CALLDICT
s0 s4 XCHG2 s0 s4 XCHG2
@ -391,13 +392,13 @@ PROGRAM{
s4 POP s4 POP
s0 s3 XCHG s0 s3 XCHG
FALSE FALSE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
}> }>
FALSE FALSE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
s0 s2 XCHG s0 s2 XCHG
TRUE TRUE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
s0 s2 XCHG s0 s2 XCHG
ENDC ENDC
ROT ROT
@ -407,14 +408,14 @@ PROGRAM{
s3 POP s3 POP
SWAP SWAP
FALSE FALSE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
}> }>
OVER OVER
ISNULL ISNULL
NOT NOT
IF:<{ IF:<{
TRUE TRUE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
SWAP SWAP
__tact_not_null CALLDICT __tact_not_null CALLDICT
SWAP SWAP
@ -422,13 +423,13 @@ PROGRAM{
}>ELSE<{ }>ELSE<{
NIP NIP
FALSE FALSE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
}> }>
ENDC ENDC
SWAP SWAP
SENDRAWMSG SENDRAWMSG
}> }>
__gen_Context_readForwardFee PROC:<{ $__gen_Context_readForwardFee PROC:<{
3 1 BLKDROP2 3 1 BLKDROP2
LDGRAMS LDGRAMS
NIP NIP
@ -441,7 +442,7 @@ PROGRAM{
3 MULCONST 3 MULCONST
1 RSHIFT# 1 RSHIFT#
}> }>
__gen_JettonDefaultWallet_init PROC:<{ $__gen_JettonDefaultWallet_init PROC:<{
0 PUSHINT 0 PUSHINT
s0 s3 XCHG s0 s3 XCHG
NEWC NEWC
@ -450,39 +451,37 @@ PROGRAM{
__gen_write_JettonDefaultWallet INLINECALLDICT __gen_write_JettonDefaultWallet INLINECALLDICT
ENDC ENDC
}> }>
__gen_JettonDefaultWallet_init_child PROC:<{ $__gen_JettonDefaultWallet_init_child PROC:<{
s0 s2 XCHG s0 s2 XCHG
CTOS CTOS
LDDICT LDDICT
DROP DROP
DUP
55471 PUSHINT
__tact_dict_get_code INLINECALLDICT
NEWDICT NEWDICT
s0 s2 XCHG SWAP
55471 PUSHINT 55471 PUSHINT
__tact_dict_get_code INLINECALLDICT __tact_dict_get_code INLINECALLDICT
s1 s2 XCHG
55471 PUSHINT
SWAP SWAP
55471 PUSHINT
s2 PUSH
__tact_dict_set_code INLINECALLDICT __tact_dict_set_code INLINECALLDICT
NEWC NEWC
STDICT STDICT
ENDC ENDC
s0 s0 s3 XCHG3 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 __tact_context_sys GETGLOB
s1 s2 PUSH2 s1 s2 PUSH2
__gen_JettonDefaultWallet_init_child CALLDICT $__gen_JettonDefaultWallet_init_child CALLDICT
__gen_StateInit_get_code INLINECALLDICT __gen_StateInit_get_code INLINECALLDICT
}> }>
__gen_get_get_wallet_data PROC:<{ $__gen_get_get_wallet_data PROC:<{
__gen_load_JettonDefaultWallet INLINECALLDICT __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 2 2 BLKDROP2
__tact_context_get INLINECALLDICT __tact_context_get INLINECALLDICT
4429 PUSHINT 4429 PUSHINT
@ -497,7 +496,7 @@ PROGRAM{
THROWANYIFNOT THROWANYIFNOT
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
s3 s11 PUXC s3 s11 PUXC
__gen_Context_readForwardFee CALLDICT $__gen_Context_readForwardFee CALLDICT
1 PUSHINT 1 PUSHINT
s4 PUSH s4 PUSH
0 GTINT 0 GTINT
@ -517,9 +516,9 @@ PROGRAM{
THROWANYIFNOT THROWANYIFNOT
__tact_context_sys GETGLOB __tact_context_sys GETGLOB
s0 s6 s3 XCPUXC s0 s6 s3 XCPUXC
__gen_JettonDefaultWallet_init_child CALLDICT $__gen_JettonDefaultWallet_init_child CALLDICT
2DUP 2DUP
contractAddress CALLDICT $contractAddress CALLDICT
TRUE TRUE
s7 s6 XCHG2 s7 s6 XCHG2
0 PUSHINT 0 PUSHINT
@ -531,20 +530,20 @@ PROGRAM{
s5 s6 XCHG s5 s6 XCHG
s3 s4 XCHG s3 s4 XCHG
-ROT -ROT
send CALLDICT $send CALLDICT
}> }>
__gen_JettonDefaultWallet_receive_TokenTransferInternal PROC:<{ $__gen_JettonDefaultWallet_receive_TokenTransferInternal PROC:<{
__tact_context_get INLINECALLDICT __tact_context_get INLINECALLDICT
s2 s10 PUSH2 s2 s10 PUSH2
__tact_address_neq INLINECALLDICT __tact_address_neq INLINECALLDICT
IF:<{ IF:<{
__tact_context_sys GETGLOB __tact_context_sys GETGLOB
s11 s8 PUSH2 s11 s8 PUSH2
__gen_JettonDefaultWallet_init_child CALLDICT $__gen_JettonDefaultWallet_init_child CALLDICT
SWAP SWAP
4429 PUSHINT 4429 PUSHINT
s0 s2 XCHG s0 s2 XCHG
contractAddress CALLDICT $contractAddress CALLDICT
s4 PUSH s4 PUSH
__tact_address_eq INLINECALLDICT __tact_address_eq INLINECALLDICT
THROWANYIFNOT THROWANYIFNOT
@ -571,7 +570,7 @@ PROGRAM{
IF:<{ IF:<{
s4 s13 XCHG2 s4 s13 XCHG2
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
__gen_Context_readForwardFee CALLDICT $__gen_Context_readForwardFee CALLDICT
s3 s(-1) PUXC s3 s(-1) PUXC
ADD ADD
s1 s10 XCHG s1 s10 XCHG
@ -588,7 +587,7 @@ PROGRAM{
s5 s5 XCHG2 s5 s5 XCHG2
PUSHNULL PUSHNULL
PUSHNULL PUSHNULL
send CALLDICT $send CALLDICT
s0 s5 XCHG2 s0 s5 XCHG2
}>ELSE<{ }>ELSE<{
s7 s13 XCHG s7 s13 XCHG
@ -613,13 +612,13 @@ PROGRAM{
s1 s7 XCHG s1 s7 XCHG
PUSHNULL PUSHNULL
PUSHNULL PUSHNULL
send CALLDICT $send CALLDICT
}>ELSE<{ }>ELSE<{
s5 POP s5 POP
2DROP 2DROP
}> }>
}> }>
__gen_JettonDefaultWallet_receive_TokenBurn PROC:<{ $__gen_JettonDefaultWallet_receive_TokenBurn PROC:<{
2DROP 2DROP
__tact_context_get INLINECALLDICT __tact_context_get INLINECALLDICT
4429 PUSHINT 4429 PUSHINT
@ -634,7 +633,7 @@ PROGRAM{
THROWANYIFNOT THROWANYIFNOT
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
s3 s8 PUXC s3 s8 PUXC
__gen_Context_readForwardFee CALLDICT $__gen_Context_readForwardFee CALLDICT
16059 PUSHINT 16059 PUSHINT
SWAP SWAP
20000000 PUSHINT 20000000 PUSHINT
@ -654,9 +653,9 @@ PROGRAM{
s3 s3 XCHG2 s3 s3 XCHG2
PUSHNULL PUSHNULL
PUSHNULL PUSHNULL
send CALLDICT $send CALLDICT
}> }>
__gen_JettonDefaultWallet_receive_bounced PROC:<{ $__gen_JettonDefaultWallet_receive_bounced PROC:<{
32 PUSHINT 32 PUSHINT
SDSKIPFIRST SDSKIPFIRST
32 LDU 32 LDU
@ -712,7 +711,7 @@ PROGRAM{
DROP DROP
__gen_load_JettonDefaultWallet INLINECALLDICT __gen_load_JettonDefaultWallet INLINECALLDICT
3 ROLL 3 ROLL
__gen_JettonDefaultWallet_receive_bounced CALLDICT $__gen_JettonDefaultWallet_receive_bounced CALLDICT
__gen_store_JettonDefaultWallet INLINECALLDICT __gen_store_JettonDefaultWallet INLINECALLDICT
}> }>
DUP DUP
@ -727,7 +726,7 @@ PROGRAM{
s8 s9 XCHG s8 s9 XCHG
s7 s8 XCHG s7 s8 XCHG
6 ROLL 6 ROLL
__gen_JettonDefaultWallet_receive_TokenTransfer CALLDICT $__gen_JettonDefaultWallet_receive_TokenTransfer CALLDICT
__gen_store_JettonDefaultWallet INLINECALLDICT __gen_store_JettonDefaultWallet INLINECALLDICT
}> }>
DUP DUP
@ -742,7 +741,7 @@ PROGRAM{
s7 s8 XCHG s7 s8 XCHG
s6 s7 XCHG s6 s7 XCHG
5 ROLL 5 ROLL
__gen_JettonDefaultWallet_receive_TokenTransferInternal CALLDICT $__gen_JettonDefaultWallet_receive_TokenTransferInternal CALLDICT
__gen_store_JettonDefaultWallet INLINECALLDICT __gen_store_JettonDefaultWallet INLINECALLDICT
}> }>
1499400124 PUSHINT 1499400124 PUSHINT
@ -755,21 +754,18 @@ PROGRAM{
s5 s6 XCHG s5 s6 XCHG
s4 s5 XCHG s4 s5 XCHG
3 ROLL 3 ROLL
__gen_JettonDefaultWallet_receive_TokenBurn CALLDICT $__gen_JettonDefaultWallet_receive_TokenBurn CALLDICT
__gen_store_JettonDefaultWallet INLINECALLDICT __gen_store_JettonDefaultWallet INLINECALLDICT
}> }>
DROP DROP
130 THROW 130 THROW
}> }>
init_JettonDefaultWallet PROC:<{
__gen_JettonDefaultWallet_init CALLDICT
}>
supported_interfaces PROC:<{ supported_interfaces PROC:<{
123515602279859691144772641439386770278 PUSHINT 123515602279859691144772641439386770278 PUSHINT
209801025412363888721030803524359905849 PUSHINT 209801025412363888721030803524359905849 PUSHINT
209778528950190195973528115415557644819 PUSHINT 209778528950190195973528115415557644819 PUSHINT
}> }>
get_abi_ipfs PROC:<{ get_abi_ipfs PROC:<{
x{697066733a2f2f516d645055594d3637535178506869536967344c565733726a71634b67456365365347765270336f5a5258454d31} PUSHSLICE x{697066733a2f2f516d5842667162517a654e31755435354d7959707768553952563437537133717556743371464c675748384e6844} PUSHSLICE
}> }>
}END>c }END>c

811
sources/output/jetton_JettonDefaultWallet.rev.fif → sources/output/jetton_JettonDefaultWallet.code.rev.fif

File diff suppressed because it is too large Load Diff

BIN
sources/output/jetton_JettonDefaultWallet.init.boc

Binary file not shown.

37
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() {
}

40
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

26
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

67
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<slice> = TokenTransfer`
Signature: `TokenTransfer{queryId:uint64,amount:coins,destination:address,responseDestination:Maybe address,customPayload:Maybe ^cell,forwardTonAmount:coins,forwardPayload:remainder<slice>}`
## TokenTransferInternal
TLB: `token_transfer_internal#178d4519 queryId:uint64 amount:coins from:address responseAddress:Maybe address forwardTonAmount:coins forwardPayload:remainder<slice> = TokenTransferInternal`
Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder<slice>}`
## TokenNotification
TLB: `token_notification#7362d09c queryId:uint64 amount:coins from:address forwardPayload:remainder<slice> = TokenNotification`
Signature: `TokenNotification{queryId:uint64,amount:coins,from:address,forwardPayload:remainder<slice>}`
## 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

1
sources/output/jetton_JettonDefaultWallet.pkg

File diff suppressed because one or more lines are too long

1391
sources/output/jetton_JettonDefaultWallet.ts

File diff suppressed because it is too large Load Diff

1329
sources/output/jetton_SampleJetton.abi

File diff suppressed because one or more lines are too long

1
sources/output/jetton_SampleJetton.abi.ipfs

File diff suppressed because one or more lines are too long

BIN
sources/output/jetton_SampleJetton.boc

Binary file not shown.

BIN
sources/output/jetton_SampleJetton.code.boc

Binary file not shown.

248
sources/output/jetton_SampleJetton.fc → 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; } (int, slice, int, slice) __tact_context_get() inline { return __tact_context; }
() __tact_verify_address(slice address) inline { () __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 { (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(); var b = begin_cell();
b = b.store_uint(0, 2); b = b.store_uint(0, 2);
b = b.store_uint(3, 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(code);
b = b.store_ref(data); b = b.store_ref(data);
var hash = cell_hash(b.end_cell()); var hash = cell_hash(b.end_cell());
var b2 = begin_cell(); return __tact_create_address(chain, hash);
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();
} }
int __tact_address_eq(slice a, slice b) inline { 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 { cell __tact_dict_get_code(cell dict, int id) inline {
var (data, ok) = udict_get_ref?(dict, 16, id); var (data, ok) = udict_get_ref?(dict, 16, id);
throw_unless(100, ok); throw_unless(135, ok);
return data; 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; 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, 395134233, 32);
build_0 = store_uint(build_0, v'queryId, 64); build_0 = build_0.store_uint(v'queryId, 64);
build_0 = store_coins(build_0, v'amount); build_0 = build_0.store_coins(v'amount);
build_0 = __tact_store_address(build_0, v'from); build_0 = __tact_store_address(build_0, v'from);
build_0 = __tact_store_address_opt(build_0, v'responseAddress); build_0 = __tact_store_address_opt(build_0, v'responseAddress);
build_0 = store_coins(build_0, v'forwardTonAmount); build_0 = build_0.store_coins(v'forwardTonAmount);
build_0 = store_slice(build_0, v'forwardPayload); build_0 = build_0.store_slice(v'forwardPayload);
return build_0; 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(); 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); throw_unless(129, sc_0~load_uint(32) == 2078119902);
var v'queryId = sc_0~load_uint(64); var v'queryId = sc_0~load_uint(64);
var v'amount = sc_0~load_coins(); 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)); 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; var (v'queryId) = v;
build_0 = store_uint(build_0, 3576854235, 32); 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; 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(); return __gen_write_TokenExcesses(begin_cell(), v).end_cell();
} }
(slice, ((cell))) __gen_read_TokenUpdateContent(slice sc_0) inline { (slice, ((cell))) __gen_read_TokenUpdateContent(slice sc_0) inline_ref {
throw_unless(129, sc_0~load_uint(32) == 1862840892); throw_unless(129, sc_0~load_uint(32) == 201882270);
var v'content = null(); var v'content = sc_0~load_int(1) ? sc_0~load_ref() : null();
if (sc_0~load_int(1)) {
v'content = sc_0~load_ref();
}
return (sc_0, (v'content)); return (sc_0, (v'content));
} }
(slice, ((int))) __gen_read_Mint(slice sc_0) inline { (slice, ((int))) __gen_read_Mint(slice sc_0) inline_ref {
throw_unless(129, sc_0~load_uint(32) == 2737462367); throw_unless(129, sc_0~load_uint(32) == 33240155);
var v'amount = sc_0~load_int(257); var v'amount = sc_0~load_int(257);
return (sc_0, (v'amount)); 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; 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'owner);
build_0 = __tact_store_address(build_0, v'master); build_0 = __tact_store_address(build_0, v'master);
return build_0; 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; 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); build_0 = __tact_store_address(build_0, v'owner);
if (null?(v'content)) { build_0 = ~ null?(v'content) ? build_0.store_int(true, 1).store_ref(v'content) : build_0.store_int(false, 1);
build_0 = store_int(build_0, false, 1); build_0 = build_0.store_int(v'mintable, 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);
return build_0; 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'totalSupply = sc_0~load_coins();
var v'owner = sc_0~__tact_load_address(); var v'owner = sc_0~__tact_load_address();
var v'content = null(); var v'content = sc_0~load_int(1) ? sc_0~load_ref() : null();
if (sc_0~load_int(1)) {
v'content = sc_0~load_ref();
}
var v'mintable = sc_0~load_int(1); var v'mintable = sc_0~load_int(1);
return (sc_0, (v'totalSupply, v'owner, v'content, v'mintable)); 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; 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(); slice sc = get_data().begin_parse();
__tact_context_sys = sc~load_ref(); __tact_context_sys = sc~load_ref();
return sc~__gen_read_SampleJetton(); 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(); builder b = begin_cell();
b = b.store_ref(__tact_context_sys); b = b.store_ref(__tact_context_sys);
b = __gen_write_SampleJetton(b, v); b = __gen_write_SampleJetton(b, v);
set_data(b.end_cell()); set_data(b.end_cell());
} }
builder storeBool(builder $s, int $value) impure { cell $emptyCell() impure {
if ($value) {
return store_int($s, (- 1), 1);
} else {
return store_int($s, 0, 1);
}
}
cell emptyCell() impure {
return end_cell(begin_cell()); return end_cell(begin_cell());
} }
slice __gen_Cell_asSlice(cell $self) impure { slice $__gen_Cell_asSlice(cell $self) impure {
var ($self) = $self; var ($self) = $self;
return begin_parse($self); return begin_parse($self);
} }
slice emptySlice() impure { slice $emptySlice() impure {
return __gen_Cell_asSlice(emptyCell()); return $__gen_Cell_asSlice($emptyCell());
} }
slice contractAddress((cell, cell) $s) impure { slice $contractAddress((cell, cell) $s) impure {
var (($s'code, $s'data)) = $s; var (($s'code, $s'data)) = $s;
return __tact_compute_contract_address(0, $s'code, $s'data); 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; var (($params'bounce, $params'to, $params'value, $params'mode, $params'body, $params'code, $params'data)) = $params;
builder $b = begin_cell(); builder $b = begin_cell();
$b = store_int($b, 1, 2); $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 = store_int($b, 0, 3);
$b = __tact_store_address($b, $params'to); $b = __tact_store_address($b, $params'to);
$b = store_coins($b, $params'value); $b = store_coins($b, $params'value);
$b = store_int($b, 0, ((((1 + 4) + 4) + 64) + 32)); $b = store_int($b, 0, ((((1 + 4) + 4) + 64) + 32));
if (((~ null?($params'code)) | (~ null?($params'data)))) { if (((~ null?($params'code)) | (~ null?($params'data)))) {
$b = storeBool($b, true); $b = __tact_store_bool($b, true);
builder $bc = begin_cell(); builder $bc = begin_cell();
$bc = storeBool($bc, false); $bc = __tact_store_bool($bc, false);
$bc = storeBool($bc, false); $bc = __tact_store_bool($bc, false);
if ((~ null?($params'code))) { if ((~ null?($params'code))) {
$bc = storeBool($bc, true); $bc = __tact_store_bool($bc, true);
$bc = store_ref($bc, __tact_not_null($params'code)); $bc = store_ref($bc, __tact_not_null($params'code));
} else { } else {
$bc = storeBool($bc, false); $bc = __tact_store_bool($bc, false);
} }
if ((~ null?($params'data))) { if ((~ null?($params'data))) {
$bc = storeBool($bc, true); $bc = __tact_store_bool($bc, true);
$bc = store_ref($bc, __tact_not_null($params'data)); $bc = store_ref($bc, __tact_not_null($params'data));
} else { } else {
$bc = storeBool($bc, false); $bc = __tact_store_bool($bc, false);
} }
$bc = storeBool($bc, false); $bc = __tact_store_bool($bc, false);
$b = storeBool($b, true); $b = __tact_store_bool($b, true);
$b = store_ref($b, end_cell($bc)); $b = store_ref($b, end_cell($bc));
} else { } else {
$b = storeBool($b, false); $b = __tact_store_bool($b, false);
} }
cell $body = $params'body; cell $body = $params'body;
if ((~ null?($body))) { if ((~ null?($body))) {
$b = storeBool($b, true); $b = __tact_store_bool($b, true);
$b = store_ref($b, __tact_not_null($body)); $b = store_ref($b, __tact_not_null($body));
} else { } else {
$b = storeBool($b, false); $b = __tact_store_bool($b, false);
} }
cell $c = end_cell($b); cell $c = end_cell($b);
send_raw_message($c, $params'mode); 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()); var (($self'balance, $self'owner, $self'master)) = (null(), null(), null());
$self'balance = 0; $self'balance = 0;
$self'owner = $owner; $self'owner = $owner;
@ -257,121 +252,112 @@ cell __gen_JettonDefaultWallet_init(cell sys', slice $master, slice $owner) {
return b'.end_cell(); 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(); slice sc' = sys'.begin_parse();
cell source = sc'~load_dict(); cell source = sc'~load_dict();
cell mine = __tact_dict_get_code(source, 55471);
cell contracts = new_dict(); 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(); cell sys = begin_cell().store_dict(contracts).end_cell();
return (mine, __gen_JettonDefaultWallet_init(sys, $master, $owner)); 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();
} }
((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; 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 (($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); var ($winit'code, $winit'data) = ($self'totalSupply, $self'owner, $self'content, $self'mintable)~$__gen_SampleJetton_getJettonWalletInit($owner);
return contractAddress(($winit'code, $winit'data)); 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 self = __gen_load_SampleJetton();
var res = __gen_SampleJetton_get_wallet_address(self, $owner); var res = $__gen_SampleJetton_get_wallet_address(self, $owner);
return res; 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; 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 self = __gen_load_SampleJetton();
var res = __gen_SampleJetton_get_jetton_data(self); var res = $__gen_SampleJetton_get_jetton_data(self);
return res; 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; var (($self'totalSupply, $self'owner, $self'content, $self'mintable)) = $self;
$self'totalSupply = ($self'totalSupply + $amount); $self'totalSupply = ($self'totalSupply + $amount);
var ($winit'code, $winit'data) = ($self'totalSupply, $self'owner, $self'content, $self'mintable)~__gen_SampleJetton_getJettonWalletInit($to); var ($winit'code, $winit'data) = ($self'totalSupply, $self'owner, $self'content, $self'mintable)~$__gen_SampleJetton_getJettonWalletInit($to);
slice $walletAddress = contractAddress(($winit'code, $winit'data)); 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)); $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), ()); 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 (($self'totalSupply, $self'owner, $self'content, $self'mintable)) = $self;
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); 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); 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)); throw_unless(4429, __tact_address_eq($contractAddress(($winit'code, $winit'data)), $ctx'sender));
return (($self'totalSupply, $self'owner, $self'content, $self'mintable), ()); 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; 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)); throw_unless(132, __tact_address_eq(__gen_Context_get_sender(__tact_context_get()), $self'owner));
return (($self'totalSupply, $self'owner, $self'content, $self'mintable), ()); 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; var (($self'totalSupply, $self'owner, $self'content, $self'mintable)) = $self;
return $self'owner; return $self'owner;
} }
_ __gen_get_owner() method_id(83229) { _ $__gen_get_owner() method_id(83229) {
var self = __gen_load_SampleJetton(); var self = __gen_load_SampleJetton();
var res = __gen_SampleJetton_owner(self); var res = $__gen_SampleJetton_owner(self);
return res; 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 ($self'totalSupply, $self'owner, $self'content, $self'mintable) = $self;
var ($msg'amount) = $msg; var ($msg'amount) = $msg;
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); 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), ()); 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 ($self'totalSupply, $self'owner, $self'content, $self'mintable) = $self;
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); 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), ()); 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 ($self'totalSupply, $self'owner, $self'content, $self'mintable) = $self;
var ($msg'content) = $msg; 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; $self'content = $msg'content;
return (($self'totalSupply, $self'owner, $self'content, $self'mintable), ()); 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 ($self'totalSupply, $self'owner, $self'content, $self'mintable) = $self;
var ($msg'queryId, $msg'amount, $msg'owner, $msg'responseAddress) = $msg; 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); $self'totalSupply = ($self'totalSupply - $msg'amount);
if ((~ null?($msg'responseAddress))) { 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), ()); return (($self'totalSupply, $self'owner, $self'content, $self'mintable), ());
} }
@ -396,19 +382,19 @@ _ __gen_get_owner() method_id(83229) {
} }
;; Receive Mint message ;; Receive Mint message
if (op == 2737462367) { if (op == 33240155) {
var self = __gen_load_SampleJetton(); var self = __gen_load_SampleJetton();
var msg = in_msg~__gen_read_Mint(); var msg = in_msg~__gen_read_Mint();
self~__gen_SampleJetton_receive_Mint(msg); self~$__gen_SampleJetton_receive_Mint(msg);
__gen_store_SampleJetton(self); __gen_store_SampleJetton(self);
return (); return ();
} }
;; Receive TokenUpdateContent message ;; Receive TokenUpdateContent message
if (op == 1862840892) { if (op == 201882270) {
var self = __gen_load_SampleJetton(); var self = __gen_load_SampleJetton();
var msg = in_msg~__gen_read_TokenUpdateContent(); var msg = in_msg~__gen_read_TokenUpdateContent();
self~__gen_SampleJetton_receive_TokenUpdateContent(msg); self~$__gen_SampleJetton_receive_TokenUpdateContent(msg);
__gen_store_SampleJetton(self); __gen_store_SampleJetton(self);
return (); return ();
} }
@ -417,7 +403,7 @@ _ __gen_get_owner() method_id(83229) {
if (op == 2078119902) { if (op == 2078119902) {
var self = __gen_load_SampleJetton(); var self = __gen_load_SampleJetton();
var msg = in_msg~__gen_read_TokenBurnNotification(); var msg = in_msg~__gen_read_TokenBurnNotification();
self~__gen_SampleJetton_receive_TokenBurnNotification(msg); self~$__gen_SampleJetton_receive_TokenBurnNotification(msg);
__gen_store_SampleJetton(self); __gen_store_SampleJetton(self);
return (); return ();
} }
@ -429,7 +415,7 @@ _ __gen_get_owner() method_id(83229) {
;; Receive "Mint!" message ;; Receive "Mint!" message
if (text_op == 0xcd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2) { if (text_op == 0xcd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2) {
var self = __gen_load_SampleJetton(); var self = __gen_load_SampleJetton();
self~__gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2(); self~$__gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2();
__gen_store_SampleJetton(self); __gen_store_SampleJetton(self);
return (); return ();
} }
@ -438,10 +424,6 @@ _ __gen_get_owner() method_id(83229) {
throw(130); throw(130);
} }
cell init_SampleJetton(cell sys', slice owner, cell content) method_id {
return __gen_SampleJetton_init(sys', owner, content);
}
_ supported_interfaces() method_id { _ supported_interfaces() method_id {
return ( return (
"org.ton.introspection.v0"H >> 128, "org.ton.introspection.v0"H >> 128,
@ -452,5 +434,5 @@ _ supported_interfaces() method_id {
} }
_ get_abi_ipfs() { _ get_abi_ipfs() {
return "ipfs://QmfEvDdmm4QFHZHyaeXmxoQzn6vUaLtdbVnjusevQcp7eA"; return "ipfs://QmPfyoAvkPUqzx93gq8EBcVccAYXFEbjnqCMrHYtyPUHfE";
} }

301
sources/output/jetton_SampleJetton.fif → sources/output/jetton_SampleJetton.code.fif

@ -2,10 +2,12 @@ PROGRAM{
DECLPROC __tact_not_null DECLPROC __tact_not_null
DECLPROC __tact_context_get DECLPROC __tact_context_get
DECLPROC __tact_verify_address DECLPROC __tact_verify_address
DECLPROC __tact_store_bool
DECLPROC __tact_load_address DECLPROC __tact_load_address
DECLPROC __tact_load_address_opt DECLPROC __tact_load_address_opt
DECLPROC __tact_store_address DECLPROC __tact_store_address
DECLPROC __tact_store_address_opt DECLPROC __tact_store_address_opt
DECLPROC __tact_create_address
DECLPROC __tact_compute_contract_address DECLPROC __tact_compute_contract_address
DECLPROC __tact_address_eq DECLPROC __tact_address_eq
DECLPROC __tact_dict_set_code DECLPROC __tact_dict_set_code
@ -22,33 +24,31 @@ PROGRAM{
DECLPROC __gen_read_SampleJetton DECLPROC __gen_read_SampleJetton
DECLPROC __gen_StateInit_get_code DECLPROC __gen_StateInit_get_code
DECLPROC __gen_Context_get_sender DECLPROC __gen_Context_get_sender
DECLPROC __gen_JettonData_to_external
DECLPROC __gen_load_SampleJetton DECLPROC __gen_load_SampleJetton
DECLPROC __gen_store_SampleJetton DECLPROC __gen_store_SampleJetton
DECLPROC storeBool DECLPROC $emptyCell
DECLPROC emptyCell DECLPROC $__gen_Cell_asSlice
DECLPROC __gen_Cell_asSlice DECLPROC $emptySlice
DECLPROC emptySlice DECLPROC $contractAddress
DECLPROC contractAddress DECLPROC $send
DECLPROC send DECLPROC $__gen_JettonDefaultWallet_init
DECLPROC __gen_JettonDefaultWallet_init DECLPROC $__gen_JettonDefaultWallet_init_child
DECLPROC __gen_JettonDefaultWallet_init_child DECLPROC $__gen_SampleJetton_getJettonWalletInit
DECLPROC __gen_SampleJetton_init DECLPROC $__gen_SampleJetton_get_wallet_address
DECLPROC __gen_SampleJetton_getJettonWalletInit 103289 DECLMETHOD $__gen_get_get_wallet_address
DECLPROC __gen_SampleJetton_get_wallet_address DECLPROC $__gen_SampleJetton_get_jetton_data
103289 DECLMETHOD __gen_get_get_wallet_address 106029 DECLMETHOD $__gen_get_get_jetton_data
DECLPROC __gen_SampleJetton_get_jetton_data DECLPROC $__gen_SampleJetton_mint
106029 DECLMETHOD __gen_get_get_jetton_data DECLPROC $__gen_SampleJetton_requireWallet
DECLPROC __gen_SampleJetton_mint DECLPROC $__gen_SampleJetton_requireOwner
DECLPROC __gen_SampleJetton_requireWallet DECLPROC $__gen_SampleJetton_owner
DECLPROC __gen_SampleJetton_requireOwner 83229 DECLMETHOD $__gen_get_owner
DECLPROC __gen_SampleJetton_owner DECLPROC $__gen_SampleJetton_receive_Mint
83229 DECLMETHOD __gen_get_owner DECLPROC $__gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2
DECLPROC __gen_SampleJetton_receive_Mint DECLPROC $__gen_SampleJetton_receive_TokenUpdateContent
DECLPROC __gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2 DECLPROC $__gen_SampleJetton_receive_TokenBurnNotification
DECLPROC __gen_SampleJetton_receive_TokenUpdateContent
DECLPROC __gen_SampleJetton_receive_TokenBurnNotification
DECLPROC recv_internal DECLPROC recv_internal
122307 DECLMETHOD init_SampleJetton
113617 DECLMETHOD supported_interfaces 113617 DECLMETHOD supported_interfaces
DECLPROC get_abi_ipfs DECLPROC get_abi_ipfs
DECLGLOBVAR __tact_context DECLGLOBVAR __tact_context
@ -66,7 +66,11 @@ PROGRAM{
SBITS SBITS
267 PUSHINT 267 PUSHINT
NEQ NEQ
134 THROWIFNOT 136 THROWIFNOT
}>
__tact_store_bool PROCINLINE:<{
SWAP
1 STI
}> }>
__tact_load_address PROCINLINE:<{ __tact_load_address PROCINLINE:<{
LDMSGADDR LDMSGADDR
@ -99,34 +103,37 @@ PROGRAM{
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
}> }>
}> }>
__tact_compute_contract_address PROC:<{ __tact_create_address PROCINLINE:<{
NEWC NEWC
0 PUSHINT 2 PUSHINT
SWAP
2 STU
3 PUSHINT
SWAP SWAP
2 STU 2 STU
0 PUSHINT 0 PUSHINT
SWAP SWAP
1 STU 1 STU
s1 s2 XCHG s1 s2 XCHG
STREF 8 STI
STREF 256 STU
ENDC ENDC
HASHCU CTOS
}>
__tact_compute_contract_address PROCINLINE:<{
NEWC NEWC
2 PUSHINT 0 PUSHINT
SWAP
2 STU
3 PUSHINT
SWAP SWAP
2 STU 2 STU
0 PUSHINT 0 PUSHINT
SWAP SWAP
1 STU 1 STU
s1 s2 XCHG s1 s2 XCHG
8 STI STREF
256 STU STREF
ENDC ENDC
CTOS HASHCU
__tact_create_address INLINECALLDICT
}> }>
__tact_address_eq PROCINLINE:<{ __tact_address_eq PROCINLINE:<{
SDEQ SDEQ
@ -141,9 +148,9 @@ PROGRAM{
16 PUSHINT 16 PUSHINT
DICTUGETREF DICTUGETREF
NULLSWAPIFNOT NULLSWAPIFNOT
100 THROWIFNOT 135 THROWIFNOT
}> }>
__gen_write_TokenTransferInternal PROCINLINE:<{ __gen_write_TokenTransferInternal PROCREF:<{
395134233 PUSHINT 395134233 PUSHINT
s0 s7 XCHG2 s0 s7 XCHG2
32 STU 32 STU
@ -160,13 +167,13 @@ PROGRAM{
SWAP SWAP
STSLICER STSLICER
}> }>
__gen_writecell_TokenTransferInternal PROCINLINE:<{ __gen_writecell_TokenTransferInternal PROCREF:<{
NEWC NEWC
6 -ROLL 6 -ROLL
__gen_write_TokenTransferInternal INLINECALLDICT __gen_write_TokenTransferInternal INLINECALLDICT
ENDC ENDC
}> }>
__gen_read_TokenBurnNotification PROCINLINE:<{ __gen_read_TokenBurnNotification PROCREF:<{
32 LDU 32 LDU
SWAP SWAP
2078119902 PUSHINT 2078119902 PUSHINT
@ -180,45 +187,45 @@ PROGRAM{
s1 s4 XCHG s1 s4 XCHG
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
}> }>
__gen_write_TokenExcesses PROCINLINE:<{ __gen_write_TokenExcesses PROCREF:<{
3576854235 PUSHINT 3576854235 PUSHINT
ROT ROT
32 STU 32 STU
64 STU 64 STU
}> }>
__gen_writecell_TokenExcesses PROCINLINE:<{ __gen_writecell_TokenExcesses PROCREF:<{
NEWC NEWC
SWAP SWAP
__gen_write_TokenExcesses INLINECALLDICT __gen_write_TokenExcesses INLINECALLDICT
ENDC ENDC
}> }>
__gen_read_TokenUpdateContent PROCINLINE:<{ __gen_read_TokenUpdateContent PROCREF:<{
32 LDU 32 LDU
SWAP SWAP
1862840892 PUSHINT 201882270 PUSHINT
EQUAL EQUAL
129 THROWIFNOT 129 THROWIFNOT
PUSHNULL
SWAP
1 LDI 1 LDI
SWAP SWAP
IF:<{ IF:<{
NIP
LDREF LDREF
}>ELSE<{
PUSHNULL
SWAP
}> }>
SWAP SWAP
}> }>
__gen_read_Mint PROCINLINE:<{ __gen_read_Mint PROCREF:<{
32 LDU 32 LDU
SWAP SWAP
2737462367 PUSHINT 33240155 PUSHINT
EQUAL EQUAL
129 THROWIFNOT 129 THROWIFNOT
257 PUSHINT 257 PUSHINT
LDIX LDIX
SWAP SWAP
}> }>
__gen_write_JettonDefaultWallet PROCINLINE:<{ __gen_write_JettonDefaultWallet PROCREF:<{
s2 s3 XCHG2 s2 s3 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
@ -227,42 +234,42 @@ PROGRAM{
SWAP SWAP
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
}> }>
__gen_write_SampleJetton PROCINLINE:<{ __gen_write_SampleJetton PROCREF:<{
s4 s3 XCHG2 s4 s3 XCHG2
STGRAMS STGRAMS
SWAP SWAP
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
s2 PUSH s2 PUSH
ISNULL ISNULL
NOT
IF:<{ IF:<{
s2 POP
FALSE
ROT
1 STI
}>ELSE<{
TRUE TRUE
SWAP SWAP
1 STI 1 STI
s1 s2 XCHG s1 s2 XCHG
STREF STREF
}>ELSE<{
s2 POP
FALSE
ROT
1 STI
}> }>
1 STI 1 STI
}> }>
__gen_read_SampleJetton PROCINLINE:<{ __gen_read_SampleJetton PROCREF:<{
LDGRAMS LDGRAMS
__tact_load_address INLINECALLDICT __tact_load_address INLINECALLDICT
PUSHNULL SWAP
s0 s2 XCHG
1 LDI 1 LDI
SWAP SWAP
IF:<{ IF:<{
1 2 BLKDROP2
LDREF LDREF
s1 s2 XCHG }>ELSE<{
PUSHNULL
SWAP
}> }>
1 LDI 1 LDI
s0 s4 XCHG 4 -ROLL
s3 s3 XCHG2
}> }>
__gen_StateInit_get_code PROCINLINE:<{ __gen_StateInit_get_code PROCINLINE:<{
DROP DROP
@ -271,7 +278,9 @@ PROGRAM{
s2 s3 XCHG s2 s3 XCHG
3 BLKDROP 3 BLKDROP
}> }>
__gen_load_SampleJetton PROCINLINE:<{ __gen_JettonData_to_external PROC:<{
}>
__gen_load_SampleJetton PROCREF:<{
c4 PUSH c4 PUSH
CTOS CTOS
LDREF LDREF
@ -280,7 +289,7 @@ PROGRAM{
__gen_read_SampleJetton INLINECALLDICT __gen_read_SampleJetton INLINECALLDICT
1 4 BLKDROP2 1 4 BLKDROP2
}> }>
__gen_store_SampleJetton PROCINLINE:<{ __gen_store_SampleJetton PROCREF:<{
NEWC NEWC
__tact_context_sys GETGLOB __tact_context_sys GETGLOB
SWAP SWAP
@ -290,39 +299,29 @@ PROGRAM{
ENDC ENDC
c4 POP c4 POP
}> }>
storeBool PROC:<{ $emptyCell PROC:<{
IFJMP:<{
-1 PUSHINT
SWAP
1 STI
}>
0 PUSHINT
SWAP
1 STI
}>
emptyCell PROC:<{
NEWC NEWC
ENDC ENDC
}> }>
__gen_Cell_asSlice PROC:<{ $__gen_Cell_asSlice PROC:<{
CTOS CTOS
}> }>
emptySlice PROC:<{ $emptySlice PROC:<{
emptyCell CALLDICT $emptyCell CALLDICT
__gen_Cell_asSlice CALLDICT $__gen_Cell_asSlice CALLDICT
}> }>
contractAddress PROC:<{ $contractAddress PROC:<{
0 PUSHINT 0 PUSHINT
-ROT -ROT
__tact_compute_contract_address CALLDICT __tact_compute_contract_address INLINECALLDICT
}> }>
send PROC:<{ $send PROC:<{
NEWC NEWC
1 PUSHINT 1 PUSHINT
SWAP SWAP
2 STI 2 STI
s0 s7 XCHG2 s0 s7 XCHG2
storeBool CALLDICT __tact_store_bool INLINECALLDICT
0 PUSHINT 0 PUSHINT
SWAP SWAP
3 STI 3 STI
@ -342,18 +341,18 @@ PROGRAM{
OR OR
IF:<{ IF:<{
TRUE TRUE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
NEWC NEWC
FALSE FALSE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
FALSE FALSE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
s4 PUSH s4 PUSH
ISNULL ISNULL
NOT NOT
IF:<{ IF:<{
TRUE TRUE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
s0 s4 XCHG s0 s4 XCHG
__tact_not_null CALLDICT __tact_not_null CALLDICT
s0 s4 XCHG2 s0 s4 XCHG2
@ -362,14 +361,14 @@ PROGRAM{
s4 POP s4 POP
s0 s3 XCHG s0 s3 XCHG
FALSE FALSE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
}> }>
s4 PUSH s4 PUSH
ISNULL ISNULL
NOT NOT
IF:<{ IF:<{
TRUE TRUE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
s0 s4 XCHG s0 s4 XCHG
__tact_not_null CALLDICT __tact_not_null CALLDICT
s0 s4 XCHG2 s0 s4 XCHG2
@ -378,13 +377,13 @@ PROGRAM{
s4 POP s4 POP
s0 s3 XCHG s0 s3 XCHG
FALSE FALSE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
}> }>
FALSE FALSE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
s0 s2 XCHG s0 s2 XCHG
TRUE TRUE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
s0 s2 XCHG s0 s2 XCHG
ENDC ENDC
ROT ROT
@ -394,14 +393,14 @@ PROGRAM{
s3 POP s3 POP
SWAP SWAP
FALSE FALSE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
}> }>
OVER OVER
ISNULL ISNULL
NOT NOT
IF:<{ IF:<{
TRUE TRUE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
SWAP SWAP
__tact_not_null CALLDICT __tact_not_null CALLDICT
SWAP SWAP
@ -409,13 +408,13 @@ PROGRAM{
}>ELSE<{ }>ELSE<{
NIP NIP
FALSE FALSE
storeBool CALLDICT __tact_store_bool INLINECALLDICT
}> }>
ENDC ENDC
SWAP SWAP
SENDRAWMSG SENDRAWMSG
}> }>
__gen_JettonDefaultWallet_init PROC:<{ $__gen_JettonDefaultWallet_init PROC:<{
0 PUSHINT 0 PUSHINT
s0 s3 XCHG s0 s3 XCHG
NEWC NEWC
@ -424,78 +423,66 @@ PROGRAM{
__gen_write_JettonDefaultWallet INLINECALLDICT __gen_write_JettonDefaultWallet INLINECALLDICT
ENDC ENDC
}> }>
__gen_JettonDefaultWallet_init_child PROC:<{ $__gen_JettonDefaultWallet_init_child PROC:<{
s0 s2 XCHG s0 s2 XCHG
CTOS CTOS
LDDICT LDDICT
DROP DROP
DUP
55471 PUSHINT
__tact_dict_get_code INLINECALLDICT
NEWDICT NEWDICT
s0 s2 XCHG SWAP
55471 PUSHINT 55471 PUSHINT
__tact_dict_get_code INLINECALLDICT __tact_dict_get_code INLINECALLDICT
s1 s2 XCHG
55471 PUSHINT
SWAP SWAP
55471 PUSHINT
s2 PUSH
__tact_dict_set_code INLINECALLDICT __tact_dict_set_code INLINECALLDICT
NEWC NEWC
STDICT STDICT
ENDC ENDC
s0 s0 s3 XCHG3 s0 s0 s3 XCHG3
__gen_JettonDefaultWallet_init CALLDICT $__gen_JettonDefaultWallet_init CALLDICT
}> }>
__gen_SampleJetton_init PROC:<{ $__gen_SampleJetton_getJettonWalletInit PROC:<{
0 PUSHINT
TRUE
s0 s4 XCHG
NEWC
STREF
s3 s3 s4 XCHG3
__gen_write_SampleJetton INLINECALLDICT
ENDC
}>
__gen_SampleJetton_getJettonWalletInit PROC:<{
__tact_context_sys GETGLOB __tact_context_sys GETGLOB
MYADDR MYADDR
ROT ROT
__gen_JettonDefaultWallet_init_child CALLDICT $__gen_JettonDefaultWallet_init_child CALLDICT
}> }>
__gen_SampleJetton_get_wallet_address PROC:<{ $__gen_SampleJetton_get_wallet_address PROC:<{
__gen_SampleJetton_getJettonWalletInit CALLDICT $__gen_SampleJetton_getJettonWalletInit CALLDICT
4 2 BLKDROP2 4 2 BLKDROP2
contractAddress CALLDICT $contractAddress CALLDICT
}> }>
__gen_get_get_wallet_address PROC:<{ $__gen_get_get_wallet_address PROC:<{
__gen_load_SampleJetton INLINECALLDICT __gen_load_SampleJetton INLINECALLDICT
4 ROLL 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 MYADDR
__gen_SampleJetton_getJettonWalletInit CALLDICT $__gen_SampleJetton_getJettonWalletInit CALLDICT
__gen_StateInit_get_code INLINECALLDICT __gen_StateInit_get_code INLINECALLDICT
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
}> }>
__gen_get_get_jetton_data PROC:<{ $__gen_get_get_jetton_data PROC:<{
__gen_load_SampleJetton INLINECALLDICT __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 s6 s1 XCPU
ADD ADD
4 2 BLKSWAP 4 2 BLKSWAP
__gen_SampleJetton_getJettonWalletInit CALLDICT $__gen_SampleJetton_getJettonWalletInit CALLDICT
2DUP 2DUP
contractAddress CALLDICT $contractAddress CALLDICT
FALSE FALSE
0 PUSHINT 0 PUSHINT
64 PUSHINT 64 PUSHINT
OVER OVER
MYADDR MYADDR
OVER OVER
emptySlice CALLDICT $emptySlice CALLDICT
s3 s5 XCHG s3 s5 XCHG
s4 s14 XCHG s4 s14 XCHG
s2 s3 XCHG s2 s3 XCHG
@ -505,66 +492,66 @@ PROGRAM{
s4 s10 XCHG s4 s10 XCHG
s3 s9 XCHG s3 s9 XCHG
s0 s10 s9 XCHG3 s0 s10 s9 XCHG3
send CALLDICT $send CALLDICT
2SWAP 2SWAP
}> }>
__gen_SampleJetton_requireWallet PROC:<{ $__gen_SampleJetton_requireWallet PROC:<{
__tact_context_get INLINECALLDICT __tact_context_get INLINECALLDICT
s2 s3 XCHG s2 s3 XCHG
3 BLKDROP 3 BLKDROP
5 -ROLL 5 -ROLL
__gen_SampleJetton_getJettonWalletInit CALLDICT $__gen_SampleJetton_getJettonWalletInit CALLDICT
SWAP SWAP
4429 PUSHINT 4429 PUSHINT
s0 s2 XCHG s0 s2 XCHG
contractAddress CALLDICT $contractAddress CALLDICT
s0 s6 XCHG2 s0 s6 XCHG2
__tact_address_eq INLINECALLDICT __tact_address_eq INLINECALLDICT
s1 s5 XCHG s1 s5 XCHG
THROWANYIFNOT THROWANYIFNOT
3 ROLL 3 ROLL
}> }>
__gen_SampleJetton_requireOwner PROC:<{ $__gen_SampleJetton_requireOwner PROC:<{
__tact_context_get INLINECALLDICT __tact_context_get INLINECALLDICT
__gen_Context_get_sender INLINECALLDICT __gen_Context_get_sender INLINECALLDICT
s3 PUSH s3 PUSH
__tact_address_eq INLINECALLDICT __tact_address_eq INLINECALLDICT
132 THROWIFNOT 132 THROWIFNOT
}> }>
__gen_SampleJetton_owner PROC:<{ $__gen_SampleJetton_owner PROC:<{
s2 s3 XCHG s2 s3 XCHG
3 BLKDROP 3 BLKDROP
}> }>
__gen_get_owner PROC:<{ $__gen_get_owner PROC:<{
__gen_load_SampleJetton INLINECALLDICT __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 __tact_context_get INLINECALLDICT
s2 s3 XCHG s2 s3 XCHG
3 BLKDROP 3 BLKDROP
TUCK 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 __tact_context_get INLINECALLDICT
s2 s3 XCHG s2 s3 XCHG
3 BLKDROP 3 BLKDROP
1000000000 PUSHINT 1000000000 PUSHINT
OVER OVER
__gen_SampleJetton_mint CALLDICT $__gen_SampleJetton_mint CALLDICT
}> }>
__gen_SampleJetton_receive_TokenUpdateContent PROC:<{ $__gen_SampleJetton_receive_TokenUpdateContent PROC:<{
4 -ROLL 4 -ROLL
__gen_SampleJetton_requireOwner CALLDICT $__gen_SampleJetton_requireOwner CALLDICT
NIP NIP
s1 s3 s0 XCHG3 s1 s3 s0 XCHG3
}> }>
__gen_SampleJetton_receive_TokenBurnNotification PROC:<{ $__gen_SampleJetton_receive_TokenBurnNotification PROC:<{
s4 s7 XCHG s4 s7 XCHG
s3 s6 XCHG s3 s6 XCHG
s5 s7 s7 XCHG3 s5 s7 s7 XCHG3
__gen_SampleJetton_requireWallet CALLDICT $__gen_SampleJetton_requireWallet CALLDICT
s3 s4 XCHG2 s3 s4 XCHG2
SUB SUB
s5 PUSH s5 PUSH
@ -581,7 +568,7 @@ PROGRAM{
s1 s7 s0 XCHG3 s1 s7 s0 XCHG3
PUSHNULL PUSHNULL
PUSHNULL PUSHNULL
send CALLDICT $send CALLDICT
s2 s3 XCHG s2 s3 XCHG
}>ELSE<{ }>ELSE<{
s4 POP s4 POP
@ -590,6 +577,7 @@ PROGRAM{
s3 s0 s0 XCHG3 s3 s0 s0 XCHG3
}> }>
recv_internal PROC:<{ recv_internal PROC:<{
c2 SAVE
SAMEALTSAVE SAMEALTSAVE
0 PUSHINT 0 PUSHINT
OVER OVER
@ -623,7 +611,7 @@ PROGRAM{
2DROP 2DROP
}> }>
DUP DUP
2737462367 PUSHINT 33240155 PUSHINT
EQUAL EQUAL
IFJMP:<{ IFJMP:<{
DROP DROP
@ -633,11 +621,11 @@ PROGRAM{
NIP NIP
s3 s4 XCHG s3 s4 XCHG
s1 s3 s0 XCHG3 s1 s3 s0 XCHG3
__gen_SampleJetton_receive_Mint CALLDICT $__gen_SampleJetton_receive_Mint CALLDICT
__gen_store_SampleJetton INLINECALLDICT __gen_store_SampleJetton INLINECALLDICT
}> }>
DUP DUP
1862840892 PUSHINT 201882270 PUSHINT
EQUAL EQUAL
IFJMP:<{ IFJMP:<{
DROP DROP
@ -647,7 +635,7 @@ PROGRAM{
NIP NIP
s3 s4 XCHG s3 s4 XCHG
s1 s3 s0 XCHG3 s1 s3 s0 XCHG3
__gen_SampleJetton_receive_TokenUpdateContent CALLDICT $__gen_SampleJetton_receive_TokenUpdateContent CALLDICT
__gen_store_SampleJetton INLINECALLDICT __gen_store_SampleJetton INLINECALLDICT
}> }>
DUP DUP
@ -663,7 +651,7 @@ PROGRAM{
s5 s6 XCHG s5 s6 XCHG
s4 s5 XCHG s4 s5 XCHG
3 ROLL 3 ROLL
__gen_SampleJetton_receive_TokenBurnNotification CALLDICT $__gen_SampleJetton_receive_TokenBurnNotification CALLDICT
__gen_store_SampleJetton INLINECALLDICT __gen_store_SampleJetton INLINECALLDICT
}> }>
0 EQINT 0 EQINT
@ -673,7 +661,7 @@ PROGRAM{
EQUAL EQUAL
IFJMP:<{ IFJMP:<{
__gen_load_SampleJetton INLINECALLDICT __gen_load_SampleJetton INLINECALLDICT
__gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2 CALLDICT $__gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2 CALLDICT
__gen_store_SampleJetton INLINECALLDICT __gen_store_SampleJetton INLINECALLDICT
RETALT RETALT
}> }>
@ -682,9 +670,6 @@ PROGRAM{
}> }>
130 THROW 130 THROW
}> }>
init_SampleJetton PROC:<{
__gen_SampleJetton_init CALLDICT
}>
supported_interfaces PROC:<{ supported_interfaces PROC:<{
123515602279859691144772641439386770278 PUSHINT 123515602279859691144772641439386770278 PUSHINT
209801025412363888721030803524359905849 PUSHINT 209801025412363888721030803524359905849 PUSHINT
@ -692,6 +677,6 @@ PROGRAM{
86142586315491086060343270784266291122 PUSHINT 86142586315491086060343270784266291122 PUSHINT
}> }>
get_abi_ipfs PROC:<{ get_abi_ipfs PROC:<{
x{697066733a2f2f516d66457644646d6d345146485a48796165586d786f517a6e367655614c746462566e6a75736576516370376541} PUSHSLICE x{697066733a2f2f516d5066796f41766b5055717a7839336771384542635663634159584645626a6e71434d72485974795055486645} PUSHSLICE
}> }>
}END>c }END>c

948
sources/output/jetton_SampleJetton.rev.fif → sources/output/jetton_SampleJetton.code.rev.fif

File diff suppressed because it is too large Load Diff

BIN
sources/output/jetton_SampleJetton.init.boc

Binary file not shown.

39
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() {
}

54
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

42
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

72
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<slice> = TokenTransfer`
Signature: `TokenTransfer{queryId:uint64,amount:coins,destination:address,responseDestination:Maybe address,customPayload:Maybe ^cell,forwardTonAmount:coins,forwardPayload:remainder<slice>}`
## TokenTransferInternal
TLB: `token_transfer_internal#178d4519 queryId:uint64 amount:coins from:address responseAddress:Maybe address forwardTonAmount:coins forwardPayload:remainder<slice> = TokenTransferInternal`
Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder<slice>}`
## TokenNotification
TLB: `token_notification#7362d09c queryId:uint64 amount:coins from:address forwardPayload:remainder<slice> = TokenNotification`
Signature: `TokenNotification{queryId:uint64,amount:coins,from:address,forwardPayload:remainder<slice>}`
## 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

1
sources/output/jetton_SampleJetton.pkg

File diff suppressed because one or more lines are too long

1441
sources/output/jetton_SampleJetton.ts

File diff suppressed because it is too large Load Diff

8
sources/utils/jetton-helpers.ts

@ -2,6 +2,10 @@ import { Sha256 } from "@aws-crypto/sha256-js";
import { beginCell, Cell } from "ton"; import { beginCell, Cell } from "ton";
import { Dictionary } from "ton-core"; 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) { function bufferToChunks(buff: Buffer, chunkSize: number) {
let chunks: Buffer[] = []; let chunks: Buffer[] = [];
while (buff.byteLength > 0) { while (buff.byteLength > 0) {
@ -10,7 +14,6 @@ function bufferToChunks(buff: Buffer, chunkSize: number) {
} }
return chunks; return chunks;
} }
const CELL_MAX_SIZE_BYTES = Math.floor((1023 - 8) / 8);
export function makeSnakeCell(data: Buffer) { export function makeSnakeCell(data: Buffer) {
let chunks = bufferToChunks(data, CELL_MAX_SIZE_BYTES); let chunks = bufferToChunks(data, CELL_MAX_SIZE_BYTES);
@ -29,9 +32,6 @@ export function makeSnakeCell(data: Buffer) {
return b.endCell(); return b.endCell();
} }
const ONCHAIN_CONTENT_PREFIX = 0x00;
const SNAKE_PREFIX = 0x00;
const sha256 = (str: string) => { const sha256 = (str: string) => {
const sha = new Sha256(); const sha = new Sha256();
sha.update(str); sha.update(str);

Loading…
Cancel
Save