Browse Source

Initial commit

master
AlexG 2 years ago
commit
b84954d051
  1. BIN
      .DS_Store
  2. 2
      .gitattributes
  3. 1
      .gitignore
  4. 0
      .idea/.gitignore
  5. 6
      .idea/misc.xml
  6. 8
      .idea/modules.xml
  7. 9
      .idea/tact-jetton.iml
  8. 9
      .idea/tact-template.iml
  9. 6
      .idea/vcs.xml
  10. 71
      .idea/workspace.xml
  11. 13
      README.md
  12. 7
      jest.config.js
  13. 8474
      package-lock.json
  14. 34
      package.json
  15. 20
      sources/jetton.deploy.ts
  16. 6
      sources/jetton.json
  17. 26
      sources/jetton.spec.ts
  18. 30
      sources/jetton.tact
  19. 1297
      sources/output/jetton_JettonDefaultWallet.abi
  20. 1
      sources/output/jetton_JettonDefaultWallet.abi.ipfs
  21. BIN
      sources/output/jetton_JettonDefaultWallet.boc
  22. 437
      sources/output/jetton_JettonDefaultWallet.fc
  23. 775
      sources/output/jetton_JettonDefaultWallet.fif
  24. 806
      sources/output/jetton_JettonDefaultWallet.rev.fif
  25. 850
      sources/output/jetton_JettonDefaultWallet.ts
  26. 1328
      sources/output/jetton_SampleJetton.abi
  27. 1
      sources/output/jetton_SampleJetton.abi.ipfs
  28. BIN
      sources/output/jetton_SampleJetton.boc
  29. 456
      sources/output/jetton_SampleJetton.fc
  30. 697
      sources/output/jetton_SampleJetton.fif
  31. 831
      sources/output/jetton_SampleJetton.rev.fif
  32. 890
      sources/output/jetton_SampleJetton.ts
  33. 48
      sources/utils/print.ts
  34. 11
      sources/utils/randomAddress.ts
  35. 7
      tact.config.json
  36. 69
      tsconfig.json
  37. 3133
      yarn.lock

BIN
.DS_Store vendored

Binary file not shown.

2
.gitattributes vendored

@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto

1
.gitignore vendored

@ -0,0 +1 @@
node_modules

0
.idea/.gitignore vendored

6
.idea/misc.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

8
.idea/modules.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/tact-jetton.iml" filepath="$PROJECT_DIR$/.idea/tact-jetton.iml" />
</modules>
</component>
</project>

9
.idea/tact-jetton.iml

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

9
.idea/tact-template.iml

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/tact-template" vcs="Git" />
</component>
</project>

71
.idea/workspace.xml

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="80ea322e-0387-4b61-9c4a-17d8dd5f7086" name="Changes" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/tact-template" />
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectId" id="2JoaNDAd4L1iMZoU4AVhl1PXU0U" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"WebServerToolWindowFactoryState": "false",
"last_opened_file_path": "/Users/alexg/Dev/tact-jetton",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "yarn",
"ts.external.directory.path": "/Users/alexg/Dev/tact-jetton/node_modules/typescript/lib"
}
}]]></component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/sources" />
<recent name="$PROJECT_DIR$" />
</key>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="80ea322e-0387-4b61-9c4a-17d8dd5f7086" name="Changes" comment="" />
<created>1672746847077</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1672746847077</updated>
<workItem from="1672746848277" duration="3955000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
</project>

13
README.md

@ -0,0 +1,13 @@
# TACT template project
This project has ready to use TACT compiler, typescript + jest with ton-contract-executor, example how to do tests.
```bash
yarn test # To test contract
yarn build # To build contract
yarn deploy # To deploy contract
```
## Licence
MIT

7
jest.config.js

@ -0,0 +1,7 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testPathIgnorePatterns: ["/node_modules/","/dist/"],
maxWorkers: 1
};

8474
package-lock.json generated

File diff suppressed because it is too large Load Diff

34
package.json

@ -0,0 +1,34 @@
{
"name": "tact-template",
"version": "1.0.0",
"main": "index.js",
"repository": "https://github.com/ton-community/tact-template.git",
"author": "Steve Korshakov <steve@korshakov.com>",
"license": "MIT",
"scripts": {
"build": "tact --config tact.config.json",
"test": "jest",
"deploy": "ts-node sources/jetton.deploy.ts"
},
"dependencies": {
"@types/jest": "^29.2.4",
"@types/node": "^18.11.14",
"@types/qs": "^6.9.7",
"jest": "^29.3.1",
"prando": "^6.0.1",
"qs": "^6.11.0",
"ton": "^13.2.0",
"ton-contract-executor": "^0.6.0",
"ton-core": "^0.36.1",
"ton-crypto": "^3.2.0",
"ton-emulator": "^1.2.0",
"ton-nodejs": "^1.4.3",
"ton-tact": "^0.5.0",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"typescript": "^4.9.4"
},
"resolutions": {
"ton": "12.3.2"
}
}

20
sources/jetton.deploy.ts

@ -0,0 +1,20 @@
import { contractAddress, toNano } from "ton";
import { packAdd, SampleTactContract_init } from "./output/sample_SampleTactContract";
import { printAddress, printDeploy, printHeader } from "./utils/print";
import { randomAddress } from "./utils/randomAddress";
(async () => { //need to changes for jetton
// Parameters
// let owner = randomAddress(0, 'some-owner'); // Replace owner with your address
// let packed = packAdd({ $$type: 'Add', amount: 10n }); // Replace if you want another message used
// let init = await SampleTactContract_init(owner);
// let address = contractAddress({ workchain: 0, initialCode: init.code, initialData: init.data });
// let deployAmount = toNano(10);
// let testnet = true;
//
// // Print basics
// printHeader('SampleTactContract');
// printAddress(address);
// printDeploy(init, deployAmount, packed, testnet);
})();

6
sources/jetton.json

@ -0,0 +1,6 @@
{
"name": "TACT",
"description": "TACT Test Jetton",
"symbol": "TACT",
"decimals": 9
}

26
sources/jetton.spec.ts

@ -0,0 +1,26 @@
import { toNano } from "ton-core";
import { ContractSystem } from "ton-emulator";
import {SampleJetton, SampleJetton_init} from './output/jetton_SampleJetton';
describe('jetton', () => {
it('should deploy', async () => {
// Create jetton
let system = await ContractSystem.create();
let owner = system.treasure('owner');
let contract = system.open(await SampleJetton.fromInit(owner.address, null));
let tracker = system.track(contract.address);
// Mint
await contract.send(owner, { value: toNano(1) }, { $$type: 'Mint', amount: toNano(1000000) });
await system.run();
expect(tracker.events()).toMatchSnapshot();
// Check owner
expect((await contract.getOwner()).toString()).toEqual(owner.address.toString());
// Data
let data = await contract.getGetJettonData();
// console.warn(data);
});
});

30
sources/jetton.tact

@ -0,0 +1,30 @@
import "@stdlib/jetton";
message Mint {
amount: Int;
}
contract SampleJetton with Jetton {
totalSupply: Int as coins;
owner: Address;
content: Cell?;
mintable: Bool;
init(owner: Address, content: Cell?) {
self.totalSupply = 0;
self.owner = owner;
self.mintable = true;
self.content = content;
}
receive(msg: Mint) {
let ctx: Context = context();
self.mint(ctx.sender, msg.amount, ctx.sender);
}
receive("Mint!") {
let ctx: Context = context();
self.mint(ctx.sender, 1000000000, ctx.sender);
}
}

1297
sources/output/jetton_JettonDefaultWallet.abi

File diff suppressed because it is too large Load Diff

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.

437
sources/output/jetton_JettonDefaultWallet.fc

@ -0,0 +1,437 @@
int __tact_my_balance() inline {
return pair_first(get_balance());
}
forall X -> X __tact_not_null(X x) { throw_if(128, null?(x)); return x; }
global (int, slice, int, slice) __tact_context;
global cell __tact_context_sys;
(int, slice, int, slice) __tact_context_get() inline { return __tact_context; }
() __tact_verify_address(slice address) inline {
throw_unless(134, address.slice_bits() != 267);
}
(slice, slice) __tact_load_address(slice cs) inline {
slice raw = cs~load_msg_addr();
__tact_verify_address(raw);
return (cs, raw);
}
(slice, slice) __tact_load_address_opt(slice cs) inline {
slice raw = cs~load_msg_addr();
if (raw.preload_uint(2) != 0) {
__tact_verify_address(raw);
return (cs, raw);
} else {
return (cs, null());
}
}
builder __tact_store_address(builder b, slice address) inline {
__tact_verify_address(address);
b = b.store_slice(address);
return b;
}
builder __tact_store_address_opt(builder b, slice address) inline {
if (null?(address)) {
b = b.store_uint(0, 2);
return b;
} else {
return __tact_store_address(b, address);
}
}
slice __tact_compute_contract_address(int chain, cell code, cell data) {
var b = begin_cell();
b = b.store_uint(0, 2);
b = b.store_uint(3, 2);
b = b.store_uint(0, 1);
b = b.store_ref(code);
b = b.store_ref(data);
var hash = cell_hash(b.end_cell());
var b2 = begin_cell();
b2 = b2.store_uint(2, 2);
b2 = b2.store_uint(0, 1);
b2 = b2.store_int(chain, 8);
b2 = b2.store_uint(hash, 256);
return b2.end_cell().begin_parse();
}
int __tact_address_eq(slice a, slice b) inline {
return equal_slice_bits(a, b);
}
int __tact_address_neq(slice a, slice b) inline {
return ~ equal_slice_bits(a, b);
}
cell __tact_dict_set_code(cell dict, int id, cell code) inline {
return udict_set_ref(dict, 16, id, code);
}
cell __tact_dict_get_code(cell dict, int id) inline {
var (data, ok) = udict_get_ref?(dict, 16, id);
throw_unless(100, ok);
return data;
}
(slice, ((int, int, slice, slice, cell, int, slice))) __gen_read_TokenTransfer(slice sc_0) inline {
throw_unless(129, sc_0~load_uint(32) == 260734629);
var v'queryId = sc_0~load_uint(64);
var v'amount = sc_0~load_coins();
var v'destination = sc_0~__tact_load_address();
var v'responseDestination = sc_0~__tact_load_address_opt();
var v'customPayload = null();
if (sc_0~load_int(1)) {
v'customPayload = sc_0~load_ref();
}
var v'forwardTonAmount = sc_0~load_coins();
var v'forwardPayload = sc_0;
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 {
var (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload) = v;
build_0 = store_uint(build_0, 395134233, 32);
build_0 = store_uint(build_0, v'queryId, 64);
build_0 = store_coins(build_0, v'amount);
build_0 = __tact_store_address(build_0, v'from);
build_0 = __tact_store_address_opt(build_0, v'responseAddress);
build_0 = store_coins(build_0, v'forwardTonAmount);
build_0 = store_slice(build_0, v'forwardPayload);
return build_0;
}
cell __gen_writecell_TokenTransferInternal((int, int, slice, slice, int, slice) v) inline {
return __gen_write_TokenTransferInternal(begin_cell(), v).end_cell();
}
(slice, ((int, int, slice, slice, int, slice))) __gen_read_TokenTransferInternal(slice sc_0) inline {
throw_unless(129, sc_0~load_uint(32) == 395134233);
var v'queryId = sc_0~load_uint(64);
var v'amount = sc_0~load_coins();
var v'from = sc_0~__tact_load_address();
var v'responseAddress = sc_0~__tact_load_address_opt();
var v'forwardTonAmount = sc_0~load_coins();
var v'forwardPayload = sc_0;
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 {
var (v'queryId, v'amount, v'from, v'forwardPayload) = v;
build_0 = store_uint(build_0, 1935855772, 32);
build_0 = store_uint(build_0, v'queryId, 64);
build_0 = store_coins(build_0, v'amount);
build_0 = __tact_store_address(build_0, v'from);
build_0 = store_slice(build_0, v'forwardPayload);
return build_0;
}
cell __gen_writecell_TokenNotification((int, int, slice, slice) v) inline {
return __gen_write_TokenNotification(begin_cell(), v).end_cell();
}
(slice, ((int, int, slice, slice))) __gen_read_TokenBurn(slice sc_0) inline {
throw_unless(129, sc_0~load_uint(32) == 1499400124);
var v'queryId = sc_0~load_uint(64);
var v'amount = sc_0~load_coins();
var v'owner = sc_0~__tact_load_address();
var v'responseAddress = sc_0~__tact_load_address_opt();
return (sc_0, (v'queryId, v'amount, v'owner, v'responseAddress));
}
builder __gen_write_TokenBurnNotification(builder build_0, (int, int, slice, slice) v) inline {
var (v'queryId, v'amount, v'owner, v'responseAddress) = v;
build_0 = store_uint(build_0, 2078119902, 32);
build_0 = store_uint(build_0, v'queryId, 64);
build_0 = store_coins(build_0, v'amount);
build_0 = __tact_store_address(build_0, v'owner);
build_0 = __tact_store_address_opt(build_0, v'responseAddress);
return build_0;
}
cell __gen_writecell_TokenBurnNotification((int, int, slice, slice) v) inline {
return __gen_write_TokenBurnNotification(begin_cell(), v).end_cell();
}
builder __gen_write_TokenExcesses(builder build_0, (int) v) inline {
var (v'queryId) = v;
build_0 = store_uint(build_0, 3576854235, 32);
build_0 = store_uint(build_0, v'queryId, 64);
return build_0;
}
cell __gen_writecell_TokenExcesses((int) v) inline {
return __gen_write_TokenExcesses(begin_cell(), v).end_cell();
}
builder __gen_write_JettonDefaultWallet(builder build_0, (int, slice, slice) v) inline {
var (v'balance, v'owner, v'master) = v;
build_0 = store_int(build_0, v'balance, 257);
build_0 = __tact_store_address(build_0, v'owner);
build_0 = __tact_store_address(build_0, v'master);
return build_0;
}
(slice, ((int, slice, slice))) __gen_read_JettonDefaultWallet(slice sc_0) inline {
var v'balance = sc_0~load_int(257);
var v'owner = sc_0~__tact_load_address();
var v'master = sc_0~__tact_load_address();
return (sc_0, (v'balance, v'owner, v'master));
}
_ __gen_StateInit_get_code((cell, cell) v) inline {
var (v'code, v'data) = v;
return v'code;
}
(int, slice, slice) __gen_load_JettonDefaultWallet() inline {
slice sc = get_data().begin_parse();
__tact_context_sys = sc~load_ref();
return sc~__gen_read_JettonDefaultWallet();
}
() __gen_store_JettonDefaultWallet((int, slice, slice) v) impure inline {
builder b = begin_cell();
b = b.store_ref(__tact_context_sys);
b = __gen_write_JettonDefaultWallet(b, v);
set_data(b.end_cell());
}
builder storeBool(builder $s, int $value) impure {
if ($value) {
return store_int($s, (- 1), 1);
} else {
return store_int($s, 0, 1);
}
}
slice contractAddress((cell, cell) $s) impure {
var (($s'code, $s'data)) = $s;
return __tact_compute_contract_address(0, $s'code, $s'data);
}
() send((int, slice, int, int, cell, cell, cell) $params) impure {
var (($params'bounce, $params'to, $params'value, $params'mode, $params'body, $params'code, $params'data)) = $params;
builder $b = begin_cell();
$b = store_int($b, 1, 2);
$b = storeBool($b, $params'bounce);
$b = store_int($b, 0, 3);
$b = __tact_store_address($b, $params'to);
$b = store_coins($b, $params'value);
$b = store_int($b, 0, ((((1 + 4) + 4) + 64) + 32));
if (((~ null?($params'code)) | (~ null?($params'data)))) {
$b = storeBool($b, true);
builder $bc = begin_cell();
$bc = storeBool($bc, false);
$bc = storeBool($bc, false);
if ((~ null?($params'code))) {
$bc = storeBool($bc, true);
$bc = store_ref($bc, __tact_not_null($params'code));
} else {
$bc = storeBool($bc, false);
}
if ((~ null?($params'data))) {
$bc = storeBool($bc, true);
$bc = store_ref($bc, __tact_not_null($params'data));
} else {
$bc = storeBool($bc, false);
}
$bc = storeBool($bc, false);
$b = storeBool($b, true);
$b = store_ref($b, end_cell($bc));
} else {
$b = storeBool($b, false);
}
cell $body = $params'body;
if ((~ null?($body))) {
$b = storeBool($b, true);
$b = store_ref($b, __tact_not_null($body));
} else {
$b = storeBool($b, false);
}
cell $c = end_cell($b);
send_raw_message($c, $params'mode);
}
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;
slice $sc = $self'raw;
$sc~load_coins();
$sc~skip_bits(1);
$sc~load_coins();
return (($sc~load_coins() * 3) / 2);
}
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, cell) __gen_JettonDefaultWallet_init_child(cell sys', slice $master, slice $owner) {
slice sc' = sys'.begin_parse();
cell source = sc'~load_dict();
cell mine = __tact_dict_get_code(source, 55471);
cell contracts = new_dict();
cell code_55471 = __tact_dict_get_code(source, 55471);
contracts = __tact_dict_set_code(contracts, 55471, code_55471);
cell sys = begin_cell().store_dict(contracts).end_cell();
return (mine, __gen_JettonDefaultWallet_init(sys, $master, $owner));
}
(int, slice, slice, cell) __gen_JettonDefaultWallet_get_wallet_data((int, slice, slice) $self) impure {
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)));
}
_ __gen_get_get_wallet_data() method_id(97026) {
var self = __gen_load_JettonDefaultWallet();
var res = __gen_JettonDefaultWallet_get_wallet_data(self);
return res;
}
(((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 ($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();
throw_unless(4429, __tact_address_eq($ctx'sender, $self'owner));
$self'balance = ($self'balance - $msg'amount);
throw_unless(62972, ($self'balance >= 0));
int $fwdFee = __gen_Context_readForwardFee(($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw));
int $fwdCount = 1;
if (($msg'forwardTonAmount > 0)) {
$fwdCount = 2;
}
throw_unless(16059, ($ctx'value > ((($fwdCount * $fwdFee) + (2 * 10000000)) + 10000000)));
var ($init'code, $init'data) = __gen_JettonDefaultWallet_init_child(__tact_context_sys, $self'master, $msg'destination);
slice $walletAddress = contractAddress(($init'code, $init'data));
send((true, $walletAddress, 0, 64, __gen_writecell_TokenTransferInternal(($msg'queryId, $msg'amount, $self'owner, $self'owner, $msg'forwardTonAmount, $msg'forwardPayload)), $init'code, $init'data));
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 {
var ($self'balance, $self'owner, $self'master) = $self;
var ($msg'queryId, $msg'amount, $msg'from, $msg'responseAddress, $msg'forwardTonAmount, $msg'forwardPayload) = $msg;
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get();
if (__tact_address_neq($ctx'sender, $self'master)) {
var ($sinit'code, $sinit'data) = __gen_JettonDefaultWallet_init_child(__tact_context_sys, $self'master, $msg'from);
throw_unless(4429, __tact_address_eq(contractAddress(($sinit'code, $sinit'data)), $ctx'sender));
}
$self'balance = ($self'balance + $msg'amount);
throw_unless(62972, ($self'balance >= 0));
int $msgValue = $ctx'value;
int $tonBalanceBeforeMsg = (__tact_my_balance() - $msgValue);
int $storageFee = (10000000 - min($tonBalanceBeforeMsg, 10000000));
$msgValue = ($msgValue - ($storageFee + 10000000));
if (($msg'forwardTonAmount > 0)) {
int $fwdFee = __gen_Context_readForwardFee(($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw));
$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()));
}
if (((~ null?($msg'responseAddress)) & ($msgValue > 0))) {
send((false, __tact_not_null($msg'responseAddress), $msgValue, 0, __gen_writecell_TokenExcesses(($msg'queryId)), null(), null()));
}
return (($self'balance, $self'owner, $self'master), ());
}
(((int, slice, slice)), ()) __gen_JettonDefaultWallet_receive_TokenBurn((int, slice, slice) $self, (int, int, slice, slice) $msg) impure {
var ($self'balance, $self'owner, $self'master) = $self;
var ($msg'queryId, $msg'amount, $msg'owner, $msg'responseAddress) = $msg;
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get();
throw_unless(4429, __tact_address_eq($ctx'sender, $self'owner));
$self'balance = ($self'balance - $msg'amount);
throw_unless(62972, ($self'balance >= 0));
int $fwdFee = __gen_Context_readForwardFee(($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw));
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()));
return (($self'balance, $self'owner, $self'master), ());
}
((int, slice, slice), ()) __gen_JettonDefaultWallet_receive_bounced((int, slice, slice) $self, slice $msg) impure {
var ($self'balance, $self'owner, $self'master) = $self;
$msg~skip_bits(32);
int $op = $msg~load_uint(32);
int $queryId = $msg~load_uint(64);
int $jettonAmount = $msg~load_coins();
throw_unless(13650, (($op == 395134233) | ($op == 2078119902)));
$self'balance = ($self'balance + $jettonAmount);
return (($self'balance, $self'owner, $self'master), ());
}
() recv_internal(int msg_value, cell in_msg_cell, slice in_msg) impure {
;; Parse incoming message
int op = 0;
if (slice_bits(in_msg) >= 32) {
op = in_msg.preload_uint(32);
}
var cs = in_msg_cell.begin_parse();
var msg_flags = cs~load_uint(4);
var msg_bounced = ((msg_flags & 1) == 1 ? true : false);
slice msg_sender_addr = cs~load_msg_addr();
__tact_context = (msg_bounced, msg_sender_addr, msg_value, cs);
;; Handle bounced messages
if (msg_bounced) {
var self = __gen_load_JettonDefaultWallet();
self~__gen_JettonDefaultWallet_receive_bounced(in_msg);
__gen_store_JettonDefaultWallet(self);
return ();
}
;; Receive TokenTransfer message
if (op == 260734629) {
var self = __gen_load_JettonDefaultWallet();
var msg = in_msg~__gen_read_TokenTransfer();
self~__gen_JettonDefaultWallet_receive_TokenTransfer(msg);
__gen_store_JettonDefaultWallet(self);
return ();
}
;; Receive TokenTransferInternal message
if (op == 395134233) {
var self = __gen_load_JettonDefaultWallet();
var msg = in_msg~__gen_read_TokenTransferInternal();
self~__gen_JettonDefaultWallet_receive_TokenTransferInternal(msg);
__gen_store_JettonDefaultWallet(self);
return ();
}
;; Receive TokenBurn message
if (op == 1499400124) {
var self = __gen_load_JettonDefaultWallet();
var msg = in_msg~__gen_read_TokenBurn();
self~__gen_JettonDefaultWallet_receive_TokenBurn(msg);
__gen_store_JettonDefaultWallet(self);
return ();
}
throw(130);
}
cell init_JettonDefaultWallet(cell sys', slice master, slice owner) method_id {
return __gen_JettonDefaultWallet_init(sys', master, owner);
}
_ supported_interfaces() method_id {
return (
"org.ton.introspection.v0"H >> 128,
"org.ton.abi.ipfs.v0"H >> 128,
"org.ton.jetton.wallet"H >> 128
);
}
_ get_abi_ipfs() {
return "ipfs://QmdPUYM67SQxPhiSig4LVW3rjqcKgEce6SGvRp3oZRXEM1";
}

775
sources/output/jetton_JettonDefaultWallet.fif

@ -0,0 +1,775 @@
PROGRAM{
DECLPROC __tact_my_balance
DECLPROC __tact_not_null
DECLPROC __tact_context_get
DECLPROC __tact_verify_address
DECLPROC __tact_load_address
DECLPROC __tact_load_address_opt
DECLPROC __tact_store_address
DECLPROC __tact_store_address_opt
DECLPROC __tact_compute_contract_address
DECLPROC __tact_address_eq
DECLPROC __tact_address_neq
DECLPROC __tact_dict_set_code
DECLPROC __tact_dict_get_code
DECLPROC __gen_read_TokenTransfer
DECLPROC __gen_write_TokenTransferInternal
DECLPROC __gen_writecell_TokenTransferInternal
DECLPROC __gen_read_TokenTransferInternal
DECLPROC __gen_write_TokenNotification
DECLPROC __gen_writecell_TokenNotification
DECLPROC __gen_read_TokenBurn
DECLPROC __gen_write_TokenBurnNotification
DECLPROC __gen_writecell_TokenBurnNotification
DECLPROC __gen_write_TokenExcesses
DECLPROC __gen_writecell_TokenExcesses
DECLPROC __gen_write_JettonDefaultWallet
DECLPROC __gen_read_JettonDefaultWallet
DECLPROC __gen_StateInit_get_code
DECLPROC __gen_load_JettonDefaultWallet
DECLPROC __gen_store_JettonDefaultWallet
DECLPROC storeBool
DECLPROC contractAddress
DECLPROC send
DECLPROC __gen_Context_readForwardFee
DECLPROC __gen_JettonDefaultWallet_init
DECLPROC __gen_JettonDefaultWallet_init_child
DECLPROC __gen_JettonDefaultWallet_get_wallet_data
97026 DECLMETHOD __gen_get_get_wallet_data
DECLPROC __gen_JettonDefaultWallet_receive_TokenTransfer
DECLPROC __gen_JettonDefaultWallet_receive_TokenTransferInternal
DECLPROC __gen_JettonDefaultWallet_receive_TokenBurn
DECLPROC __gen_JettonDefaultWallet_receive_bounced
DECLPROC recv_internal
111075 DECLMETHOD init_JettonDefaultWallet
113617 DECLMETHOD supported_interfaces
DECLPROC get_abi_ipfs
DECLGLOBVAR __tact_context
DECLGLOBVAR __tact_context_sys
__tact_my_balance PROCINLINE:<{
BALANCE
FIRST
}>
__tact_not_null PROC:<{
DUP
ISNULL
128 THROWIF
}>
__tact_context_get PROCINLINE:<{
__tact_context GETGLOB
4 UNTUPLE
}>
__tact_verify_address PROCINLINE:<{
SBITS
267 PUSHINT
NEQ
134 THROWIFNOT
}>
__tact_load_address PROCINLINE:<{
LDMSGADDR
SWAP
}>
__tact_load_address_opt PROCINLINE:<{
LDMSGADDR
OVER
2 PLDU
0 NEQINT
IF:<{
SWAP
}>ELSE<{
NIP
PUSHNULL
}>
}>
__tact_store_address PROCINLINE:<{
STSLICER
}>
__tact_store_address_opt PROCINLINE:<{
DUP
ISNULL
IF:<{
DROP
0 PUSHINT
SWAP
2 STU
}>ELSE<{
__tact_store_address INLINECALLDICT
}>
}>
__tact_compute_contract_address PROC:<{
NEWC
0 PUSHINT
SWAP
2 STU
3 PUSHINT
SWAP
2 STU
0 PUSHINT
SWAP
1 STU
s1 s2 XCHG
STREF
STREF
ENDC
HASHCU
NEWC
2 PUSHINT
SWAP
2 STU
0 PUSHINT
SWAP
1 STU
s1 s2 XCHG
8 STI
256 STU
ENDC
CTOS
}>
__tact_address_eq PROCINLINE:<{
SDEQ
}>
__tact_address_neq PROCINLINE:<{
SDEQ
NOT
}>
__tact_dict_set_code PROCINLINE:<{
s0 s2 XCHG
16 PUSHINT
DICTUSETREF
}>
__tact_dict_get_code PROCINLINE:<{
SWAP
16 PUSHINT
DICTUGETREF
NULLSWAPIFNOT
100 THROWIFNOT
}>
__gen_read_TokenTransfer PROCINLINE:<{
32 LDU
SWAP
260734629 PUSHINT
EQUAL
129 THROWIFNOT
64 LDU
LDGRAMS
__tact_load_address INLINECALLDICT
SWAP
__tact_load_address_opt INLINECALLDICT
PUSHNULL
s0 s2 XCHG
1 LDI
SWAP
IF:<{
1 2 BLKDROP2
LDREF
s1 s2 XCHG
}>
LDGRAMS
s6 s6 XCPU
s1 s6 XCHG
s1 s5 XCHG
s4 s4 s0 XCHG3
}>
__gen_write_TokenTransferInternal PROCINLINE:<{
395134233 PUSHINT
s0 s7 XCHG2
32 STU
s1 s5 XCHG
64 STU
s0 s3 XCHG2
STGRAMS
SWAP
__tact_store_address INLINECALLDICT
SWAP
__tact_store_address_opt INLINECALLDICT
SWAP
STGRAMS
SWAP
STSLICER
}>
__gen_writecell_TokenTransferInternal PROCINLINE:<{
NEWC
6 -ROLL
__gen_write_TokenTransferInternal INLINECALLDICT
ENDC
}>
__gen_read_TokenTransferInternal PROCINLINE:<{
32 LDU
SWAP
395134233 PUSHINT
EQUAL
129 THROWIFNOT
64 LDU
LDGRAMS
__tact_load_address INLINECALLDICT
SWAP
__tact_load_address_opt INLINECALLDICT
SWAP
LDGRAMS
s5 s5 XCPU
s1 s5 XCHG
s1 s4 XCHG
s3 s3 s0 XCHG3
}>
__gen_write_TokenNotification PROCINLINE:<{
1935855772 PUSHINT
s0 s5 XCHG2
32 STU
s1 s3 XCHG
64 STU
SWAP
STGRAMS
SWAP
__tact_store_address INLINECALLDICT
SWAP
STSLICER
}>
__gen_writecell_TokenNotification PROCINLINE:<{
NEWC
4 -ROLL
__gen_write_TokenNotification INLINECALLDICT
ENDC
}>
__gen_read_TokenBurn PROCINLINE:<{
32 LDU
SWAP
1499400124 PUSHINT
EQUAL
129 THROWIFNOT
64 LDU
LDGRAMS
__tact_load_address INLINECALLDICT
SWAP
__tact_load_address_opt INLINECALLDICT
s1 s4 XCHG
s3 s3 s0 XCHG3
}>
__gen_write_TokenBurnNotification PROCINLINE:<{
2078119902 PUSHINT
s0 s5 XCHG2
32 STU
s1 s3 XCHG
64 STU
SWAP
STGRAMS
SWAP
__tact_store_address INLINECALLDICT
SWAP
__tact_store_address_opt INLINECALLDICT
}>
__gen_writecell_TokenBurnNotification PROCINLINE:<{
NEWC
4 -ROLL
__gen_write_TokenBurnNotification INLINECALLDICT
ENDC
}>
__gen_write_TokenExcesses PROCINLINE:<{
3576854235 PUSHINT
ROT
32 STU
64 STU
}>
__gen_writecell_TokenExcesses PROCINLINE:<{
NEWC
SWAP
__gen_write_TokenExcesses INLINECALLDICT
ENDC
}>
__gen_write_JettonDefaultWallet PROCINLINE:<{
s2 s3 XCHG2
257 PUSHINT
STIX
SWAP
__tact_store_address INLINECALLDICT
SWAP
__tact_store_address INLINECALLDICT
}>
__gen_read_JettonDefaultWallet PROCINLINE:<{
257 PUSHINT
LDIX
__tact_load_address INLINECALLDICT
SWAP
__tact_load_address INLINECALLDICT
s3 s3 s0 XCHG3
}>
__gen_StateInit_get_code PROCINLINE:<{
DROP
}>
__gen_load_JettonDefaultWallet PROCINLINE:<{
c4 PUSH
CTOS
LDREF
SWAP
__tact_context_sys SETGLOB
__gen_read_JettonDefaultWallet INLINECALLDICT
1 3 BLKDROP2
}>
__gen_store_JettonDefaultWallet PROCINLINE:<{
NEWC
__tact_context_sys GETGLOB
SWAP
STREF
3 -ROLL
__gen_write_JettonDefaultWallet INLINECALLDICT
ENDC
c4 POP
}>
storeBool PROC:<{
IFJMP:<{
-1 PUSHINT
SWAP
1 STI
}>
0 PUSHINT
SWAP
1 STI
}>
contractAddress PROC:<{
0 PUSHINT
-ROT
__tact_compute_contract_address CALLDICT
}>
send PROC:<{
NEWC
1 PUSHINT
SWAP
2 STI
s0 s7 XCHG2
storeBool CALLDICT
0 PUSHINT
SWAP
3 STI
s0 s5 XCHG2
__tact_store_address INLINECALLDICT
s0 s3 XCHG2
STGRAMS
0 PUSHINT
SWAP
105 STI
s3 PUSH
ISNULL
NOT
s5 PUSH
ISNULL
NOT
OR
IF:<{
TRUE
storeBool CALLDICT
NEWC
FALSE
storeBool CALLDICT
FALSE
storeBool CALLDICT
s4 PUSH
ISNULL
NOT
IF:<{
TRUE
storeBool CALLDICT
s0 s4 XCHG
__tact_not_null CALLDICT
s0 s4 XCHG2
STREF
}>ELSE<{
s4 POP
s0 s3 XCHG
FALSE
storeBool CALLDICT
}>
s4 PUSH
ISNULL
NOT
IF:<{
TRUE
storeBool CALLDICT
s0 s4 XCHG
__tact_not_null CALLDICT
s0 s4 XCHG2
STREF
}>ELSE<{
s4 POP
s0 s3 XCHG
FALSE
storeBool CALLDICT
}>
FALSE
storeBool CALLDICT
s0 s2 XCHG
TRUE
storeBool CALLDICT
s0 s2 XCHG
ENDC
ROT
STREF
}>ELSE<{
s3 POP
s3 POP
SWAP
FALSE
storeBool CALLDICT
}>
OVER
ISNULL
NOT
IF:<{
TRUE
storeBool CALLDICT
SWAP
__tact_not_null CALLDICT
SWAP
STREF
}>ELSE<{
NIP
FALSE
storeBool CALLDICT
}>
ENDC
SWAP
SENDRAWMSG
}>
__gen_Context_readForwardFee PROC:<{
3 1 BLKDROP2
LDGRAMS
NIP
1 PUSHINT
SDSKIPFIRST
LDGRAMS
NIP
LDGRAMS
DROP
3 MULCONST
1 RSHIFT#
}>
__gen_JettonDefaultWallet_init PROC:<{
0 PUSHINT
s0 s3 XCHG
NEWC
STREF
s3 s1 s3 XCHG3
__gen_write_JettonDefaultWallet INLINECALLDICT
ENDC
}>
__gen_JettonDefaultWallet_init_child PROC:<{
s0 s2 XCHG
CTOS
LDDICT
DROP
DUP
55471 PUSHINT
__tact_dict_get_code INLINECALLDICT
NEWDICT
s0 s2 XCHG
55471 PUSHINT
__tact_dict_get_code INLINECALLDICT
s1 s2 XCHG
55471 PUSHINT
SWAP
__tact_dict_set_code INLINECALLDICT
NEWC
STDICT
ENDC
s0 s0 s3 XCHG3
__gen_JettonDefaultWallet_init CALLDICT
}>
__gen_JettonDefaultWallet_get_wallet_data PROC:<{
__tact_context_sys GETGLOB
s1 s2 PUSH2
__gen_JettonDefaultWallet_init_child CALLDICT
__gen_StateInit_get_code INLINECALLDICT
}>
__gen_get_get_wallet_data PROC:<{
__gen_load_JettonDefaultWallet INLINECALLDICT
__gen_JettonDefaultWallet_get_wallet_data CALLDICT
}>
__gen_JettonDefaultWallet_receive_TokenTransfer PROC:<{
2 2 BLKDROP2
__tact_context_get INLINECALLDICT
4429 PUSHINT
s3 s11 PUSH2
__tact_address_eq INLINECALLDICT
THROWANYIFNOT
s11 s7 XCPU
SUB
62972 PUSHINT
OVER
-1 GTINT
THROWANYIFNOT
s3 s3 s0 XCHG3
s3 s11 PUXC
__gen_Context_readForwardFee CALLDICT
1 PUSHINT
s4 PUSH
0 GTINT
IF:<{
DROP
2 PUSHINT
}>
16059 PUSHINT
s0 s2 XCHG
MUL
20000000 PUSHINT
ADD
10000000 PUSHINT
ADD
s1 s2 XCHG
GREATER
THROWANYIFNOT
__tact_context_sys GETGLOB
s0 s6 s3 XCPUXC
__gen_JettonDefaultWallet_init_child CALLDICT
2DUP
contractAddress CALLDICT
TRUE
s7 s6 XCHG2
0 PUSHINT
64 PUSHINT
s11 PUSH
s12 s2 s8 PUXC2
s1 s8 XCHG
__gen_writecell_TokenTransferInternal INLINECALLDICT
s5 s6 XCHG
s3 s4 XCHG
-ROT
send CALLDICT
}>
__gen_JettonDefaultWallet_receive_TokenTransferInternal PROC:<{
__tact_context_get INLINECALLDICT
s2 s10 PUSH2
__tact_address_neq INLINECALLDICT
IF:<{
__tact_context_sys GETGLOB
s11 s8 PUSH2
__gen_JettonDefaultWallet_init_child CALLDICT
SWAP
4429 PUSHINT
s0 s2 XCHG
contractAddress CALLDICT
s4 PUSH
__tact_address_eq INLINECALLDICT
THROWANYIFNOT
}>
s12 s8 XCPU
ADD
62972 PUSHINT
OVER
-1 GTINT
THROWANYIFNOT
OVER
__tact_my_balance INLINECALLDICT
OVER
SUB
10000000 PUSHINT
TUCK
MIN
SUB
10000000 PUSHINT
ADD
SUB
s6 PUSH
0 GTINT
IF:<{
s4 s13 XCHG2
s3 s3 s0 XCHG3
__gen_Context_readForwardFee CALLDICT
s3 s(-1) PUXC
ADD
s1 s10 XCHG
SUB
FALSE
0 PUSHINT
s8 PUSH
s8 s1 s3 XCHG3
s7 s4 XCHG2
__gen_writecell_TokenNotification INLINECALLDICT
s8 PUSH
s4 s6 XCHG
s3 s1 s3 XCHG3
s5 s5 XCHG2
PUSHNULL
PUSHNULL
send CALLDICT
s0 s5 XCHG2
}>ELSE<{
s7 s13 XCHG
s8 s9 XCHG2
8 BLKDROP
}>
s5 PUSH
ISNULL
NOT
s2 PUSH
0 GTINT
AND
IF:<{
FALSE
s0 s6 XCHG
__tact_not_null CALLDICT
0 PUSHINT
s0 s4 XCHG
__gen_writecell_TokenExcesses INLINECALLDICT
s4 s7 XCHG
s3 s3 s0 XCHG3
s1 s7 XCHG
PUSHNULL
PUSHNULL
send CALLDICT
}>ELSE<{
s5 POP
2DROP
}>
}>
__gen_JettonDefaultWallet_receive_TokenBurn PROC:<{
2DROP
__tact_context_get INLINECALLDICT
4429 PUSHINT
s3 s8 PUSH2
__tact_address_eq INLINECALLDICT
THROWANYIFNOT
s8 s4 XCPU
SUB
62972 PUSHINT
OVER
-1 GTINT
THROWANYIFNOT
s3 s3 s0 XCHG3
s3 s8 PUXC
__gen_Context_readForwardFee CALLDICT
16059 PUSHINT
SWAP
20000000 PUSHINT
ADD
10000000 PUSHINT
ADD
s1 s2 XCHG
GREATER
THROWANYIFNOT
TRUE
0 PUSHINT
s0 s3 XCHG
64 PUSHINT
s3 s6 s6 XCPU2
__gen_writecell_TokenBurnNotification INLINECALLDICT
s3 s0 s4 XC2PU
s3 s3 XCHG2
PUSHNULL
PUSHNULL
send CALLDICT
}>
__gen_JettonDefaultWallet_receive_bounced PROC:<{
32 PUSHINT
SDSKIPFIRST
32 LDU
64 LDU
NIP
LDGRAMS
DROP
13650 PUSHINT
s2 PUSH
395134233 PUSHINT
EQUAL
s0 s3 XCHG
2078119902 PUSHINT
EQUAL
s1 s3 XCHG
OR
s1 s2 XCHG
THROWANYIFNOT
s1 s3 XCHG
ADD
s0 s2 XCHG
}>
recv_internal PROC:<{
0 PUSHINT
OVER
SBITS
31 GTINT
IF:<{
DROP
DUP
32 PLDU
}>
s0 s2 XCHG
CTOS
4 LDU
SWAP
1 PUSHINT
AND
1 EQINT
IF:<{
TRUE
}>ELSE<{
FALSE
}>
SWAP
LDMSGADDR
s2 PUSH
s6 s6 XCHG2
4 TUPLE
__tact_context SETGLOB
s0 s2 XCHG
IFJMP:<{
DROP
__gen_load_JettonDefaultWallet INLINECALLDICT
3 ROLL
__gen_JettonDefaultWallet_receive_bounced CALLDICT
__gen_store_JettonDefaultWallet INLINECALLDICT
}>
DUP
260734629 PUSHINT
EQUAL
IFJMP:<{
DROP
__gen_load_JettonDefaultWallet INLINECALLDICT
s0 s3 XCHG
__gen_read_TokenTransfer INLINECALLDICT
s7 POP
s8 s9 XCHG
s7 s8 XCHG
6 ROLL
__gen_JettonDefaultWallet_receive_TokenTransfer CALLDICT
__gen_store_JettonDefaultWallet INLINECALLDICT
}>
DUP
395134233 PUSHINT
EQUAL
IFJMP:<{
DROP
__gen_load_JettonDefaultWallet INLINECALLDICT
s0 s3 XCHG
__gen_read_TokenTransferInternal INLINECALLDICT
s6 POP
s7 s8 XCHG
s6 s7 XCHG
5 ROLL
__gen_JettonDefaultWallet_receive_TokenTransferInternal CALLDICT
__gen_store_JettonDefaultWallet INLINECALLDICT
}>
1499400124 PUSHINT
EQUAL
IFJMP:<{
__gen_load_JettonDefaultWallet INLINECALLDICT
s0 s3 XCHG
__gen_read_TokenBurn INLINECALLDICT
s4 POP
s5 s6 XCHG
s4 s5 XCHG
3 ROLL
__gen_JettonDefaultWallet_receive_TokenBurn CALLDICT
__gen_store_JettonDefaultWallet INLINECALLDICT
}>
DROP
130 THROW
}>
init_JettonDefaultWallet PROC:<{
__gen_JettonDefaultWallet_init CALLDICT
}>
supported_interfaces PROC:<{
123515602279859691144772641439386770278 PUSHINT
209801025412363888721030803524359905849 PUSHINT
209778528950190195973528115415557644819 PUSHINT
}>
get_abi_ipfs PROC:<{
x{697066733a2f2f516d645055594d3637535178506869536967344c565733726a71634b67456365365347765270336f5a5258454d31} PUSHSLICE
}>
}END>c

806
sources/output/jetton_JettonDefaultWallet.rev.fif

@ -0,0 +1,806 @@
SETCP0
(:methods
recv_internal:
0 PUSHINT
s1 PUSH
SBITS
31 GTINT
<{
s0 POP
s0 PUSH
32 PLDU
}> PUSHCONT
IF
s0 s2 XCHG
CTOS
4 LDU
s0 s1 XCHG
1 PUSHINT
AND
1 EQINT
<{
-1 PUSHINT
}> PUSHCONT
<{
0 PUSHINT
}> PUSHCONT
IFELSE
s0 s1 XCHG
LDMSGADDR
s2 PUSH
s6 s6 XCHG2
4 TUPLE
1 SETGLOBVAR
s0 s2 XCHG
<{
s0 POP
c4 PUSH
CTOS
LDREF
s0 s1 XCHG
2 SETGLOBVAR
257 PUSHINT
LDI
LDMSGADDR
s0 s1 XCHG
s0 s1 XCHG
LDMSGADDR
s0 s1 XCHG
s3 s3 s0 XCHG3
1 3 BLKDROP2
1 3 BLKSWAP
40 CALLDICT
NEWC
2 GETGLOBVAR
s0 s1 XCHG
STREF
3 1 BLKSWAP
s2 s3 XCHG2
257 PUSHINT
STIX
s0 s1 XCHG
STSLICER
s0 s1 XCHG
STSLICER
ENDC
c4 POP
}> PUSHCONT
IFJMP
s0 PUSH
260734629 PUSHINT
EQUAL
<{
s0 POP
c4 PUSH
CTOS
LDREF
s0 s1 XCHG
2 SETGLOBVAR
257 PUSHINT
LDI
LDMSGADDR
s0 s1 XCHG
s0 s1 XCHG
LDMSGADDR
s0 s1 XCHG
s3 s3 s0 XCHG3
1 3 BLKDROP2
s0 s3 XCHG
32 LDU
s0 s1 XCHG
260734629 PUSHINT
EQUAL
129 THROWIFNOT
64 LDU
LDGRAMS
LDMSGADDR
s0 s1 XCHG
s0 s1 XCHG
LDMSGADDR
s1 PUSH
2 PLDU
0 NEQINT
<{
s0 s1 XCHG
}> PUSHCONT
<{
s1 POP
PUSHNULL
}> PUSHCONT
IFELSE
PUSHNULL
s0 s2 XCHG
1 LDI
s0 s1 XCHG
<{
1 2 BLKDROP2
LDREF
s1 s2 XCHG
}> PUSHCONT
IF
LDGRAMS
s6 s6 XCPU
s1 s6 XCHG
s1 s5 XCHG
s4 s4 s0 XCHG3
s7 POP
s8 s9 XCHG
s7 s8 XCHG
1 6 BLKSWAP
37 CALLDICT
NEWC
2 GETGLOBVAR
s0 s1 XCHG
STREF
3 1 BLKSWAP
s2 s3 XCHG2
257 PUSHINT
STIX
s0 s1 XCHG
STSLICER
s0 s1 XCHG
STSLICER
ENDC
c4 POP
}> IFJMPREF
s0 PUSH
395134233 PUSHINT
EQUAL
<{
s0 POP
c4 PUSH
CTOS
LDREF
s0 s1 XCHG
2 SETGLOBVAR
257 PUSHINT
LDI
LDMSGADDR
s0 s1 XCHG
s0 s1 XCHG
LDMSGADDR
s0 s1 XCHG
s3 s3 s0 XCHG3
1 3 BLKDROP2
s0 s3 XCHG
32 LDU
s0 s1 XCHG
395134233 PUSHINT
EQUAL
129 THROWIFNOT
64 LDU
LDGRAMS
LDMSGADDR
s0 s1 XCHG
s0 s1 XCHG
LDMSGADDR
s1 PUSH
2 PLDU
0 NEQINT
<{
s0 s1 XCHG
}> PUSHCONT
<{
s1 POP
PUSHNULL
}> PUSHCONT
IFELSE
s0 s1 XCHG
LDGRAMS
s5 s5 XCPU
s1 s5 XCHG
s1 s4 XCHG
s3 s3 s0 XCHG3
s6 POP
s7 s8 XCHG
s6 s7 XCHG
1 5 BLKSWAP
38 CALLDICT
NEWC
2 GETGLOBVAR
s0 s1 XCHG
STREF
3 1 BLKSWAP
s2 s3 XCHG2
257 PUSHINT
STIX
s0 s1 XCHG
STSLICER
s0 s1 XCHG
STSLICER
ENDC
c4 POP
}> IFJMPREF
1499400124 PUSHINT
EQUAL
<{
c4 PUSH
CTOS
LDREF
s0 s1 XCHG
2 SETGLOBVAR
257 PUSHINT
LDI
LDMSGADDR
s0 s1 XCHG
s0 s1 XCHG
LDMSGADDR
s0 s1 XCHG
s3 s3 s0 XCHG3
1 3 BLKDROP2
s0 s3 XCHG
32 LDU
s0 s1 XCHG
1499400124 PUSHINT
EQUAL
129 THROWIFNOT
64 LDU
LDGRAMS
LDMSGADDR
s0 s1 XCHG
s0 s1 XCHG
LDMSGADDR
s1 PUSH
2 PLDU
0 NEQINT
<{
s0 s1 XCHG
}> PUSHCONT
<{
s1 POP
PUSHNULL
}> PUSHCONT
IFELSE
s1 s4 XCHG
s3 s3 s0 XCHG3
s4 POP
s5 s6 XCHG
s4 s5 XCHG
1 3 BLKSWAP
39 CALLDICT
NEWC
2 GETGLOBVAR
s0 s1 XCHG
STREF
3 1 BLKSWAP
s2 s3 XCHG2
257 PUSHINT
STIX
s0 s1 XCHG
STSLICER
s0 s1 XCHG
STSLICER
ENDC
c4 POP
}> IFJMPREF
s0 POP
130 THROW
2:
s0 PUSH
ISNULL
128 THROWIF
9:
NEWC
0 PUSHINT
s0 s1 XCHG
2 STU
3 PUSHINT
s0 s1 XCHG
2 STU
0 PUSHINT
s0 s1 XCHG
1 STU
s1 s2 XCHG
STREF
STREF
ENDC
HASHCU
NEWC
2 PUSHINT
s0 s1 XCHG
2 STU
0 PUSHINT
s0 s1 XCHG
1 STU
s1 s2 XCHG
8 STI
256 STU
ENDC
CTOS
30:
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
}> PUSHCONT
IFJMP
0 PUSHINT
s0 s1 XCHG
1 STI
31:
0 PUSHINT
ROTREV
9 CALLDICT
32:
NEWC
1 PUSHINT
s0 s1 XCHG
2 STI
s0 s7 XCHG2
30 CALLDICT
0 PUSHINT
s0 s1 XCHG
3 STI
s0 s5 XCHG2
STSLICER
s0 s3 XCHG2
STGRAMS
0 PUSHINT
s0 s1 XCHG
105 STI
s3 PUSH
ISNULL
NOT
s5 PUSH
ISNULL
NOT
OR
<{
-1 PUSHINT
30 CALLDICT
NEWC
0 PUSHINT
30 CALLDICT
0 PUSHINT
30 CALLDICT
s4 PUSH
ISNULL
NOT
<{
-1 PUSHINT
30 CALLDICT
s0 s4 XCHG
2 CALLDICT
s0 s4 XCHG2
STREF
}> PUSHCONT
<{
s4 POP
s0 s3 XCHG
0 PUSHINT
30 CALLDICT
}> PUSHCONT
IFELSE
s4 PUSH
ISNULL
NOT
<{
-1 PUSHINT
30 CALLDICT
s0 s4 XCHG
2 CALLDICT
s0 s4 XCHG2
STREF
}> PUSHCONT
<{
s4 POP
s0 s3 XCHG
0 PUSHINT
30 CALLDICT
}> PUSHCONT
IFELSE
0 PUSHINT
30 CALLDICT
s0 s2 XCHG
-1 PUSHINT
30 CALLDICT
s0 s2 XCHG
ENDC
ROT
STREF
}> PUSHCONT
<{
s3 POP
s3 POP
s0 s1 XCHG
0 PUSHINT
30 CALLDICT
}> PUSHCONT
IFELSE
s1 PUSH
ISNULL
NOT
<{
-1 PUSHINT
30 CALLDICT
s0 s1 XCHG
2 CALLDICT
s0 s1 XCHG
STREF
}> PUSHCONT
<{
s1 POP
0 PUSHINT
30 CALLDICT
}> PUSHCONT
IFELSE
ENDC
s0 s1 XCHG
SENDRAWMSG
33:
3 1 BLKDROP2
LDGRAMS
s1 POP
1 PUSHINT
SDSKIPFIRST
LDGRAMS
s1 POP
LDGRAMS
s0 POP
3 MULCONST
1 RSHIFT
34:
0 PUSHINT
s0 s3 XCHG
NEWC
STREF
s3 s1 s3 XCHG3
s2 s3 XCHG2
257 PUSHINT
STIX
s0 s1 XCHG
STSLICER
s0 s1 XCHG
STSLICER
ENDC
35:
s0 s2 XCHG
CTOS
LDDICT
s0 POP
s0 PUSH
55471 PUSHINT
s0 s1 XCHG
16 PUSHINT
DICTUGETREF
NULLSWAPIFNOT
100 THROWIFNOT
PUSHNULL
s0 s2 XCHG
55471 PUSHINT
s0 s1 XCHG
16 PUSHINT
DICTUGETREF
NULLSWAPIFNOT
100 THROWIFNOT
s1 s2 XCHG
55471 PUSHINT
s0 s1 XCHG
s0 s2 XCHG
16 PUSHINT
DICTUSETREF
NEWC
STDICT
ENDC
s0 s0 s3 XCHG3
34 CALLDICT
36:
2 GETGLOBVAR
s1 s2 PUSH2
35 CALLDICT
s0 POP
37:
2 2 BLKDROP2
1 GETGLOBVAR
4 UNTUPLE
4429 PUSHINT
s3 s11 PUSH2
SDEQ
THROWANYIFNOT
s11 s7 XCPU
SUB
62972 PUSHINT
s1 PUSH
-1 GTINT
THROWANYIFNOT
s3 s3 s0 XCHG3
s3 s11 PUXC
33 CALLDICT
1 PUSHINT
s4 PUSH
0 GTINT
<{
s0 POP
2 PUSHINT
}> PUSHCONT
IF
16059 PUSHINT
s0 s2 XCHG
MUL
20000000 PUSHINT
ADD
10000000 PUSHINT
ADD
s1 s2 XCHG
GREATER
THROWANYIFNOT
2 GETGLOBVAR
0 6 3 XCPUXC
35 CALLDICT
2DUP
31 CALLDICT
-1 PUSHINT
s7 s6 XCHG2
0 PUSHINT
64 PUSHINT
s11 PUSH
12 2 8 PUXC2
s1 s8 XCHG
NEWC
6 1 BLKSWAP
395134233 PUSHINT
s0 s7 XCHG2
32 STU
s1 s5 XCHG
64 STU
s0 s3 XCHG2
STGRAMS
s0 s1 XCHG
STSLICER
s0 s1 XCHG
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
s0 s1 XCHG
STGRAMS
s0 s1 XCHG
STSLICER
ENDC
s5 s6 XCHG
s3 s4 XCHG
ROTREV
32 CALLDICT
38:
1 GETGLOBVAR
4 UNTUPLE
s2 s10 PUSH2
SDEQ
NOT
<{
2 GETGLOBVAR
s11 s8 PUSH2
35 CALLDICT
s0 s1 XCHG
4429 PUSHINT
s0 s2 XCHG
31 CALLDICT
s4 PUSH
SDEQ
THROWANYIFNOT
}> PUSHCONT
IF
s12 s8 XCPU
ADD
62972 PUSHINT
s1 PUSH
-1 GTINT
THROWANYIFNOT
s1 PUSH
BALANCE
0 INDEX
s1 PUSH
SUB
10000000 PUSHINT
TUCK
MIN
SUB
10000000 PUSHINT
ADD
SUB
s6 PUSH
0 GTINT
<{
s7 s13 XCHG
s8 s9 XCHG2
8 BLKDROP
}> PUSHCONT
<{
s4 s13 XCHG2
s3 s3 s0 XCHG3
33 CALLDICT
s3 s-1 PUXC
ADD
s1 s10 XCHG
SUB
0 PUSHINT
0 PUSHINT
s8 PUSH
s8 s1 s3 XCHG3
s7 s4 XCHG2
NEWC
4 1 BLKSWAP
1935855772 PUSHINT
s0 s5 XCHG2
32 STU
s1 s3 XCHG
64 STU
s0 s1 XCHG
STGRAMS
s0 s1 XCHG
STSLICER
s0 s1 XCHG
STSLICER
ENDC
s8 PUSH
s4 s6 XCHG
s3 s1 s3 XCHG3
s5 s5 XCHG2
PUSHNULL
PUSHNULL
32 CALLDICT
s0 s5 XCHG2
}> IFREFELSE
s5 PUSH
ISNULL
NOT
s2 PUSH
0 GTINT
AND
<{
0 PUSHINT
s0 s6 XCHG
2 CALLDICT
0 PUSHINT
s0 s4 XCHG
NEWC
s0 s1 XCHG
3576854235 PUSHINT
ROT
32 STU
64 STU
ENDC
s4 s7 XCHG
s3 s3 s0 XCHG3
s1 s7 XCHG
PUSHNULL
PUSHNULL
32 CALLDICT
}> PUSHCONT
<{
s5 POP
2DROP
}> PUSHCONT
IFELSE
39:
2DROP
1 GETGLOBVAR
4 UNTUPLE
4429 PUSHINT
s3 s8 PUSH2
SDEQ
THROWANYIFNOT
s8 s4 XCPU
SUB
62972 PUSHINT
s1 PUSH
-1 GTINT
THROWANYIFNOT
s3 s3 s0 XCHG3
s3 s8 PUXC
33 CALLDICT
16059 PUSHINT
s0 s1 XCHG
20000000 PUSHINT
ADD
10000000 PUSHINT
ADD
s1 s2 XCHG
GREATER
THROWANYIFNOT
-1 PUSHINT
0 PUSHINT
s0 s3 XCHG
64 PUSHINT
3 6 6 XCPU2
NEWC
4 1 BLKSWAP
2078119902 PUSHINT
s0 s5 XCHG2
32 STU
s1 s3 XCHG
64 STU
s0 s1 XCHG
STGRAMS
s0 s1 XCHG
STSLICER
s0 s1 XCHG
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
ENDC
3 0 4 XC2PU
s3 s3 XCHG2
PUSHNULL
PUSHNULL
32 CALLDICT
40:
32 PUSHINT
SDSKIPFIRST
32 LDU
64 LDU
s1 POP
LDGRAMS
s0 POP
13650 PUSHINT
s2 PUSH
395134233 PUSHINT
EQUAL
s0 s3 XCHG
2078119902 PUSHINT
EQUAL
s1 s3 XCHG
OR
s1 s2 XCHG
THROWANYIFNOT
s1 s3 XCHG
ADD
s0 s2 XCHG
get_wallet_data:
c4 PUSH
CTOS
LDREF
s0 s1 XCHG
2 SETGLOBVAR
257 PUSHINT
LDI
LDMSGADDR
s0 s1 XCHG
s0 s1 XCHG
LDMSGADDR
s0 s1 XCHG
s3 s3 s0 XCHG3
1 3 BLKDROP2
36 CALLDICT
111075:
34 CALLDICT
113617:
123515602279859691144772641439386770278 PUSHINT
209801025412363888721030803524359905849 PUSHINT
209778528950190195973528115415557644819 PUSHINT
) 19 DICTPUSHCONST
DICTIGETJMPZ
11 THROWARG

850
sources/output/jetton_JettonDefaultWallet.ts

@ -0,0 +1,850 @@
import { Cell, Slice, StackItem, Address, Builder, InternalMessage, CommonMessageInfo, CellMessage, beginCell, serializeDict, TupleSlice4, readString, stringToCell } from 'ton';
import { ContractExecutor, createExecutorFromCode, ExecuteError } from 'ton-nodejs';
import BN from 'bn.js';
export type StateInit = {
$$type: 'StateInit';
code: Cell;
data: Cell;
}
export function packStateInit(src: StateInit): Cell {
let b_0 = new Builder();
b_0 = b_0.storeRef(src.code);
b_0 = b_0.storeRef(src.data);
return b_0.endCell();
}
export function packStackStateInit(src: StateInit, __stack: StackItem[]) {
__stack.push({ type: 'cell', cell: src.code });
__stack.push({ type: 'cell', cell: src.data });
}
export function packTupleStateInit(src: StateInit): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'cell', cell: src.code });
__stack.push({ type: 'cell', cell: src.data });
return __stack;
}
export function unpackStackStateInit(slice: TupleSlice4): StateInit {
const code = slice.readCell();
const data = slice.readCell();
return { $$type: 'StateInit', code: code, data: data };
}
export function unpackTupleStateInit(slice: TupleSlice4): StateInit {
const code = slice.readCell();
const data = slice.readCell();
return { $$type: 'StateInit', code: code, data: data };
}
export type Context = {
$$type: 'Context';
bounced: boolean;
sender: Address;
value: BN;
raw: Cell;
}
export function packContext(src: Context): Cell {
let b_0 = new Builder();
b_0 = b_0.storeBit(src.bounced);
b_0 = b_0.storeAddress(src.sender);
b_0 = b_0.storeInt(src.value, 257);
b_0 = b_0.storeRef(src.raw);
return b_0.endCell();
}
export function packStackContext(src: Context, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.bounced ? new BN(-1) : new BN(0) });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.sender).endCell() });
__stack.push({ type: 'int', value: src.value });
__stack.push({ type: 'slice', cell: src.raw });
}
export function packTupleContext(src: Context): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.bounced ? new BN(-1) : new BN(0) });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.sender).endCell() });
__stack.push({ type: 'int', value: src.value });
__stack.push({ type: 'slice', cell: src.raw });
return __stack;
}
export function unpackStackContext(slice: TupleSlice4): Context {
const bounced = slice.readBoolean();
const sender = slice.readAddress();
const value = slice.readBigNumber();
const raw = slice.readCell();
return { $$type: 'Context', bounced: bounced, sender: sender, value: value, raw: raw };
}
export function unpackTupleContext(slice: TupleSlice4): Context {
const bounced = slice.readBoolean();
const sender = slice.readAddress();
const value = slice.readBigNumber();
const raw = slice.readCell();
return { $$type: 'Context', bounced: bounced, sender: sender, value: value, raw: raw };
}
export type SendParameters = {
$$type: 'SendParameters';
bounce: boolean;
to: Address;
value: BN;
mode: BN;
body: Cell | null;
code: Cell | null;
data: Cell | null;
}
export function packSendParameters(src: SendParameters): Cell {
let b_0 = new Builder();
b_0 = b_0.storeBit(src.bounce);
b_0 = b_0.storeAddress(src.to);
b_0 = b_0.storeInt(src.value, 257);
b_0 = b_0.storeInt(src.mode, 257);
if (src.body !== null) {
b_0 = b_0.storeBit(true);
b_0 = b_0.storeRef(src.body);
} else {
b_0 = b_0.storeBit(false);
}
if (src.code !== null) {
b_0 = b_0.storeBit(true);
b_0 = b_0.storeRef(src.code);
} else {
b_0 = b_0.storeBit(false);
}
if (src.data !== null) {
b_0 = b_0.storeBit(true);
b_0 = b_0.storeRef(src.data);
} else {
b_0 = b_0.storeBit(false);
}
return b_0.endCell();
}
export function packStackSendParameters(src: SendParameters, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.bounce ? new BN(-1) : new BN(0) });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.to).endCell() });
__stack.push({ type: 'int', value: src.value });
__stack.push({ type: 'int', value: src.mode });
if (src.body !== null) {
__stack.push({ type: 'cell', cell: src.body });
} else {
__stack.push({ type: 'null' });
}
if (src.code !== null) {
__stack.push({ type: 'cell', cell: src.code });
} else {
__stack.push({ type: 'null' });
}
if (src.data !== null) {
__stack.push({ type: 'cell', cell: src.data });
} else {
__stack.push({ type: 'null' });
}
}
export function packTupleSendParameters(src: SendParameters): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.bounce ? new BN(-1) : new BN(0) });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.to).endCell() });
__stack.push({ type: 'int', value: src.value });
__stack.push({ type: 'int', value: src.mode });
if (src.body !== null) {
__stack.push({ type: 'cell', cell: src.body });
} else {
__stack.push({ type: 'null' });
}
if (src.code !== null) {
__stack.push({ type: 'cell', cell: src.code });
} else {
__stack.push({ type: 'null' });
}
if (src.data !== null) {
__stack.push({ type: 'cell', cell: src.data });
} else {
__stack.push({ type: 'null' });
}
return __stack;
}
export function unpackStackSendParameters(slice: TupleSlice4): SendParameters {
const bounce = slice.readBoolean();
const to = slice.readAddress();
const value = slice.readBigNumber();
const mode = slice.readBigNumber();
const body = slice.readCellOpt();
const code = slice.readCellOpt();
const data = slice.readCellOpt();
return { $$type: 'SendParameters', bounce: bounce, to: to, value: value, mode: mode, body: body, code: code, data: data };
}
export function unpackTupleSendParameters(slice: TupleSlice4): SendParameters {
const bounce = slice.readBoolean();
const to = slice.readAddress();
const value = slice.readBigNumber();
const mode = slice.readBigNumber();
const body = slice.readCellOpt();
const code = slice.readCellOpt();
const data = slice.readCellOpt();
return { $$type: 'SendParameters', bounce: bounce, to: to, value: value, mode: mode, body: body, code: code, data: data };
}
export type ChangeOwner = {
$$type: 'ChangeOwner';
newOwner: Address;
}
export function packChangeOwner(src: ChangeOwner): Cell {
let b_0 = new Builder();
b_0 = b_0.storeUint(3067051791, 32);
b_0 = b_0.storeAddress(src.newOwner);
return b_0.endCell();
}
export function packStackChangeOwner(src: ChangeOwner, __stack: StackItem[]) {
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.newOwner).endCell() });
}
export function packTupleChangeOwner(src: ChangeOwner): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.newOwner).endCell() });
return __stack;
}
export function unpackStackChangeOwner(slice: TupleSlice4): ChangeOwner {
const newOwner = slice.readAddress();
return { $$type: 'ChangeOwner', newOwner: newOwner };
}
export function unpackTupleChangeOwner(slice: TupleSlice4): ChangeOwner {
const newOwner = slice.readAddress();
return { $$type: 'ChangeOwner', newOwner: newOwner };
}
export type TokenTransfer = {
$$type: 'TokenTransfer';
queryId: BN;
amount: BN;
destination: Address;
responseDestination: Address | null;
customPayload: Cell | null;
forwardTonAmount: BN;
forwardPayload: Cell;
}
export function packTokenTransfer(src: TokenTransfer): Cell {
let b_0 = new Builder();
b_0 = b_0.storeUint(260734629, 32);
b_0 = b_0.storeUint(src.queryId, 64);
b_0 = b_0.storeCoins(src.amount);
b_0 = b_0.storeAddress(src.destination);
b_0 = b_0.storeAddress(src.responseDestination);
if (src.customPayload !== null) {
b_0 = b_0.storeBit(true);
b_0 = b_0.storeRef(src.customPayload);
} else {
b_0 = b_0.storeBit(false);
}
b_0 = b_0.storeCoins(src.forwardTonAmount);
b_0 = b_0.storeCellCopy(src.forwardPayload);
return b_0.endCell();
}
export function packStackTokenTransfer(src: TokenTransfer, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.queryId });
__stack.push({ type: 'int', value: src.amount });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.destination).endCell() });
if (src.responseDestination !== null) {
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseDestination).endCell() });
} else {
__stack.push({ type: 'null' });
}
if (src.customPayload !== null) {
__stack.push({ type: 'cell', cell: src.customPayload });
} else {
__stack.push({ type: 'null' });
}
__stack.push({ type: 'int', value: src.forwardTonAmount });
__stack.push({ type: 'slice', cell: src.forwardPayload });
}
export function packTupleTokenTransfer(src: TokenTransfer): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.queryId });
__stack.push({ type: 'int', value: src.amount });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.destination).endCell() });
if (src.responseDestination !== null) {
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseDestination).endCell() });
} else {
__stack.push({ type: 'null' });
}
if (src.customPayload !== null) {
__stack.push({ type: 'cell', cell: src.customPayload });
} else {
__stack.push({ type: 'null' });
}
__stack.push({ type: 'int', value: src.forwardTonAmount });
__stack.push({ type: 'slice', cell: src.forwardPayload });
return __stack;
}
export function unpackStackTokenTransfer(slice: TupleSlice4): TokenTransfer {
const queryId = slice.readBigNumber();
const amount = slice.readBigNumber();
const destination = slice.readAddress();
const responseDestination = slice.readAddressOpt();
const customPayload = slice.readCellOpt();
const forwardTonAmount = slice.readBigNumber();
const forwardPayload = slice.readCell();
return { $$type: 'TokenTransfer', queryId: queryId, amount: amount, destination: destination, responseDestination: responseDestination, customPayload: customPayload, forwardTonAmount: forwardTonAmount, forwardPayload: forwardPayload };
}
export function unpackTupleTokenTransfer(slice: TupleSlice4): TokenTransfer {
const queryId = slice.readBigNumber();
const amount = slice.readBigNumber();
const destination = slice.readAddress();
const responseDestination = slice.readAddressOpt();
const customPayload = slice.readCellOpt();
const forwardTonAmount = slice.readBigNumber();
const forwardPayload = slice.readCell();
return { $$type: 'TokenTransfer', queryId: queryId, amount: amount, destination: destination, responseDestination: responseDestination, customPayload: customPayload, forwardTonAmount: forwardTonAmount, forwardPayload: forwardPayload };
}
export type TokenTransferInternal = {
$$type: 'TokenTransferInternal';
queryId: BN;
amount: BN;
from: Address;
responseAddress: Address | null;
forwardTonAmount: BN;
forwardPayload: Cell;
}
export function packTokenTransferInternal(src: TokenTransferInternal): Cell {
let b_0 = new Builder();
b_0 = b_0.storeUint(395134233, 32);
b_0 = b_0.storeUint(src.queryId, 64);
b_0 = b_0.storeCoins(src.amount);
b_0 = b_0.storeAddress(src.from);
b_0 = b_0.storeAddress(src.responseAddress);
b_0 = b_0.storeCoins(src.forwardTonAmount);
b_0 = b_0.storeCellCopy(src.forwardPayload);
return b_0.endCell();
}
export function packStackTokenTransferInternal(src: TokenTransferInternal, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.queryId });
__stack.push({ type: 'int', value: src.amount });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.from).endCell() });
if (src.responseAddress !== null) {
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() });
} else {
__stack.push({ type: 'null' });
}
__stack.push({ type: 'int', value: src.forwardTonAmount });
__stack.push({ type: 'slice', cell: src.forwardPayload });
}
export function packTupleTokenTransferInternal(src: TokenTransferInternal): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.queryId });
__stack.push({ type: 'int', value: src.amount });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.from).endCell() });
if (src.responseAddress !== null) {
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() });
} else {
__stack.push({ type: 'null' });
}
__stack.push({ type: 'int', value: src.forwardTonAmount });
__stack.push({ type: 'slice', cell: src.forwardPayload });
return __stack;
}
export function unpackStackTokenTransferInternal(slice: TupleSlice4): TokenTransferInternal {
const queryId = slice.readBigNumber();
const amount = slice.readBigNumber();
const from = slice.readAddress();
const responseAddress = slice.readAddressOpt();
const forwardTonAmount = slice.readBigNumber();
const forwardPayload = slice.readCell();
return { $$type: 'TokenTransferInternal', queryId: queryId, amount: amount, from: from, responseAddress: responseAddress, forwardTonAmount: forwardTonAmount, forwardPayload: forwardPayload };
}
export function unpackTupleTokenTransferInternal(slice: TupleSlice4): TokenTransferInternal {
const queryId = slice.readBigNumber();
const amount = slice.readBigNumber();
const from = slice.readAddress();
const responseAddress = slice.readAddressOpt();
const forwardTonAmount = slice.readBigNumber();
const forwardPayload = slice.readCell();
return { $$type: 'TokenTransferInternal', queryId: queryId, amount: amount, from: from, responseAddress: responseAddress, forwardTonAmount: forwardTonAmount, forwardPayload: forwardPayload };
}
export type TokenNotification = {
$$type: 'TokenNotification';
queryId: BN;
amount: BN;
from: Address;
forwardPayload: Cell;
}
export function packTokenNotification(src: TokenNotification): Cell {
let b_0 = new Builder();
b_0 = b_0.storeUint(1935855772, 32);
b_0 = b_0.storeUint(src.queryId, 64);
b_0 = b_0.storeCoins(src.amount);
b_0 = b_0.storeAddress(src.from);
b_0 = b_0.storeCellCopy(src.forwardPayload);
return b_0.endCell();
}
export function packStackTokenNotification(src: TokenNotification, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.queryId });
__stack.push({ type: 'int', value: src.amount });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.from).endCell() });
__stack.push({ type: 'slice', cell: src.forwardPayload });
}
export function packTupleTokenNotification(src: TokenNotification): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.queryId });
__stack.push({ type: 'int', value: src.amount });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.from).endCell() });
__stack.push({ type: 'slice', cell: src.forwardPayload });
return __stack;
}
export function unpackStackTokenNotification(slice: TupleSlice4): TokenNotification {
const queryId = slice.readBigNumber();
const amount = slice.readBigNumber();
const from = slice.readAddress();
const forwardPayload = slice.readCell();
return { $$type: 'TokenNotification', queryId: queryId, amount: amount, from: from, forwardPayload: forwardPayload };
}
export function unpackTupleTokenNotification(slice: TupleSlice4): TokenNotification {
const queryId = slice.readBigNumber();
const amount = slice.readBigNumber();
const from = slice.readAddress();
const forwardPayload = slice.readCell();
return { $$type: 'TokenNotification', queryId: queryId, amount: amount, from: from, forwardPayload: forwardPayload };
}
export type TokenBurn = {
$$type: 'TokenBurn';
queryId: BN;
amount: BN;
owner: Address;
responseAddress: Address | null;
}
export function packTokenBurn(src: TokenBurn): Cell {
let b_0 = new Builder();
b_0 = b_0.storeUint(1499400124, 32);
b_0 = b_0.storeUint(src.queryId, 64);
b_0 = b_0.storeCoins(src.amount);
b_0 = b_0.storeAddress(src.owner);
b_0 = b_0.storeAddress(src.responseAddress);
return b_0.endCell();
}
export function packStackTokenBurn(src: TokenBurn, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.queryId });
__stack.push({ type: 'int', value: src.amount });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() });
if (src.responseAddress !== null) {
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() });
} else {
__stack.push({ type: 'null' });
}
}
export function packTupleTokenBurn(src: TokenBurn): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.queryId });
__stack.push({ type: 'int', value: src.amount });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() });
if (src.responseAddress !== null) {
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() });
} else {
__stack.push({ type: 'null' });
}
return __stack;
}
export function unpackStackTokenBurn(slice: TupleSlice4): TokenBurn {
const queryId = slice.readBigNumber();
const amount = slice.readBigNumber();
const owner = slice.readAddress();
const responseAddress = slice.readAddressOpt();
return { $$type: 'TokenBurn', queryId: queryId, amount: amount, owner: owner, responseAddress: responseAddress };
}
export function unpackTupleTokenBurn(slice: TupleSlice4): TokenBurn {
const queryId = slice.readBigNumber();
const amount = slice.readBigNumber();
const owner = slice.readAddress();
const responseAddress = slice.readAddressOpt();
return { $$type: 'TokenBurn', queryId: queryId, amount: amount, owner: owner, responseAddress: responseAddress };
}
export type TokenBurnNotification = {
$$type: 'TokenBurnNotification';
queryId: BN;
amount: BN;
owner: Address;
responseAddress: Address | null;
}
export function packTokenBurnNotification(src: TokenBurnNotification): Cell {
let b_0 = new Builder();
b_0 = b_0.storeUint(2078119902, 32);
b_0 = b_0.storeUint(src.queryId, 64);
b_0 = b_0.storeCoins(src.amount);
b_0 = b_0.storeAddress(src.owner);
b_0 = b_0.storeAddress(src.responseAddress);
return b_0.endCell();
}
export function packStackTokenBurnNotification(src: TokenBurnNotification, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.queryId });
__stack.push({ type: 'int', value: src.amount });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() });
if (src.responseAddress !== null) {
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() });
} else {
__stack.push({ type: 'null' });
}
}
export function packTupleTokenBurnNotification(src: TokenBurnNotification): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.queryId });
__stack.push({ type: 'int', value: src.amount });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() });
if (src.responseAddress !== null) {
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() });
} else {
__stack.push({ type: 'null' });
}
return __stack;
}
export function unpackStackTokenBurnNotification(slice: TupleSlice4): TokenBurnNotification {
const queryId = slice.readBigNumber();
const amount = slice.readBigNumber();
const owner = slice.readAddress();
const responseAddress = slice.readAddressOpt();
return { $$type: 'TokenBurnNotification', queryId: queryId, amount: amount, owner: owner, responseAddress: responseAddress };
}
export function unpackTupleTokenBurnNotification(slice: TupleSlice4): TokenBurnNotification {
const queryId = slice.readBigNumber();
const amount = slice.readBigNumber();
const owner = slice.readAddress();
const responseAddress = slice.readAddressOpt();
return { $$type: 'TokenBurnNotification', queryId: queryId, amount: amount, owner: owner, responseAddress: responseAddress };
}
export type TokenExcesses = {
$$type: 'TokenExcesses';
queryId: BN;
}
export function packTokenExcesses(src: TokenExcesses): Cell {
let b_0 = new Builder();
b_0 = b_0.storeUint(3576854235, 32);
b_0 = b_0.storeUint(src.queryId, 64);
return b_0.endCell();
}
export function packStackTokenExcesses(src: TokenExcesses, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.queryId });
}
export function packTupleTokenExcesses(src: TokenExcesses): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.queryId });
return __stack;
}
export function unpackStackTokenExcesses(slice: TupleSlice4): TokenExcesses {
const queryId = slice.readBigNumber();
return { $$type: 'TokenExcesses', queryId: queryId };
}
export function unpackTupleTokenExcesses(slice: TupleSlice4): TokenExcesses {
const queryId = slice.readBigNumber();
return { $$type: 'TokenExcesses', queryId: queryId };
}
export type TokenUpdateContent = {
$$type: 'TokenUpdateContent';
content: Cell | null;
}
export function packTokenUpdateContent(src: TokenUpdateContent): Cell {
let b_0 = new Builder();
b_0 = b_0.storeUint(1862840892, 32);
if (src.content !== null) {
b_0 = b_0.storeBit(true);
b_0 = b_0.storeRef(src.content);
} else {
b_0 = b_0.storeBit(false);
}
return b_0.endCell();
}
export function packStackTokenUpdateContent(src: TokenUpdateContent, __stack: StackItem[]) {
if (src.content !== null) {
__stack.push({ type: 'cell', cell: src.content });
} else {
__stack.push({ type: 'null' });
}
}
export function packTupleTokenUpdateContent(src: TokenUpdateContent): StackItem[] {
let __stack: StackItem[] = [];
if (src.content !== null) {
__stack.push({ type: 'cell', cell: src.content });
} else {
__stack.push({ type: 'null' });
}
return __stack;
}
export function unpackStackTokenUpdateContent(slice: TupleSlice4): TokenUpdateContent {
const content = slice.readCellOpt();
return { $$type: 'TokenUpdateContent', content: content };
}
export function unpackTupleTokenUpdateContent(slice: TupleSlice4): TokenUpdateContent {
const content = slice.readCellOpt();
return { $$type: 'TokenUpdateContent', content: content };
}
export type JettonData = {
$$type: 'JettonData';
totalSupply: BN;
mintable: boolean;
owner: Address;
content: Cell | null;
walletCode: Cell;
}
export function packJettonData(src: JettonData): Cell {
let b_0 = new Builder();
b_0 = b_0.storeInt(src.totalSupply, 257);
b_0 = b_0.storeBit(src.mintable);
b_0 = b_0.storeAddress(src.owner);
if (src.content !== null) {
b_0 = b_0.storeBit(true);
b_0 = b_0.storeRef(src.content);
} else {
b_0 = b_0.storeBit(false);
}
b_0 = b_0.storeRef(src.walletCode);
return b_0.endCell();
}
export function packStackJettonData(src: JettonData, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.totalSupply });
__stack.push({ type: 'int', value: src.mintable ? new BN(-1) : new BN(0) });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() });
if (src.content !== null) {
__stack.push({ type: 'cell', cell: src.content });
} else {
__stack.push({ type: 'null' });
}
__stack.push({ type: 'cell', cell: src.walletCode });
}
export function packTupleJettonData(src: JettonData): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.totalSupply });
__stack.push({ type: 'int', value: src.mintable ? new BN(-1) : new BN(0) });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() });
if (src.content !== null) {
__stack.push({ type: 'cell', cell: src.content });
} else {
__stack.push({ type: 'null' });
}
__stack.push({ type: 'cell', cell: src.walletCode });
return __stack;
}
export function unpackStackJettonData(slice: TupleSlice4): JettonData {
const totalSupply = slice.readBigNumber();
const mintable = slice.readBoolean();
const owner = slice.readAddress();
const content = slice.readCellOpt();
const walletCode = slice.readCell();
return { $$type: 'JettonData', totalSupply: totalSupply, mintable: mintable, owner: owner, content: content, walletCode: walletCode };
}
export function unpackTupleJettonData(slice: TupleSlice4): JettonData {
const totalSupply = slice.readBigNumber();
const mintable = slice.readBoolean();
const owner = slice.readAddress();
const content = slice.readCellOpt();
const walletCode = slice.readCell();
return { $$type: 'JettonData', totalSupply: totalSupply, mintable: mintable, owner: owner, content: content, walletCode: walletCode };
}
export type JettonWalletData = {
$$type: 'JettonWalletData';
balance: BN;
owner: Address;
master: Address;
walletCode: Cell;
}
export function packJettonWalletData(src: JettonWalletData): Cell {
let b_0 = new Builder();
b_0 = b_0.storeInt(src.balance, 257);
b_0 = b_0.storeAddress(src.owner);
b_0 = b_0.storeAddress(src.master);
b_0 = b_0.storeRef(src.walletCode);
return b_0.endCell();
}
export function packStackJettonWalletData(src: JettonWalletData, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.balance });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.master).endCell() });
__stack.push({ type: 'cell', cell: src.walletCode });
}
export function packTupleJettonWalletData(src: JettonWalletData): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.balance });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.master).endCell() });
__stack.push({ type: 'cell', cell: src.walletCode });
return __stack;
}
export function unpackStackJettonWalletData(slice: TupleSlice4): JettonWalletData {
const balance = slice.readBigNumber();
const owner = slice.readAddress();
const master = slice.readAddress();
const walletCode = slice.readCell();
return { $$type: 'JettonWalletData', balance: balance, owner: owner, master: master, walletCode: walletCode };
}
export function unpackTupleJettonWalletData(slice: TupleSlice4): JettonWalletData {
const balance = slice.readBigNumber();
const owner = slice.readAddress();
const master = slice.readAddress();
const walletCode = slice.readCell();
return { $$type: 'JettonWalletData', balance: balance, owner: owner, master: master, walletCode: walletCode };
}
export type Mint = {
$$type: 'Mint';
amount: BN;
}
export function packMint(src: Mint): Cell {
let b_0 = new Builder();
b_0 = b_0.storeUint(2737462367, 32);
b_0 = b_0.storeInt(src.amount, 257);
return b_0.endCell();
}
export function packStackMint(src: Mint, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.amount });
}
export function packTupleMint(src: Mint): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.amount });
return __stack;
}
export function unpackStackMint(slice: TupleSlice4): Mint {
const amount = slice.readBigNumber();
return { $$type: 'Mint', amount: amount };
}
export function unpackTupleMint(slice: TupleSlice4): Mint {
const amount = slice.readBigNumber();
return { $$type: 'Mint', amount: amount };
}
export async function JettonDefaultWallet_init(master: Address, owner: Address) {
const __code = 'te6ccgECKQEABYcAART/APSkE/S88sgLAQIBYgIDAgLKBAUCASAlJgIBIAYHAgFIEhMCASAICQIB7hARAgFICgsAR7OQ4AOWAuYDlgLgA5YAJZmZk/IBkOQDlgLgA5YAJZQPl/+ToQT1RwIddJwh+VMCDXCx/eAtDTAwFxsMABkX+RcOIB+kAiUGZvBPhhAo4zMO1E0NQB+GKBAQHXAPpAAQH6QAFDMGwTVQLwKMj4QgHMVSBQI4EBAc8AAc8WAc8Wye1U4CCCEA+KfqW64wIgghAXjUUZuuMCghBZXwe8uuMCMIDA0ODwALQgbvLQgIAN4w7UTQ1AH4YoEBAdcA+kABAfpAAUMwbBMD0x8BghAPin6luvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeJtAtIAAZRsEtQS3voAUWYWFURANxCJEHhVBfAlyPhCAcxVIFAjgQEBzwABzxYBzxbJ7VQAyjDtRNDUAfhigQEB1wD6QAEB+kABQzBsEwPTHwGCEBeNRRm68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4gH6AFFVFRRDMDYQeBBnVQTwJsj4QgHMVSBQI4EBAc8AAc8WAc8Wye1UALztRNDUAfhigQEB1wD6QAEB+kABQzBsEwPTHwGCEFlfB7y68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4hRDMDQQVhBFVQLwJ8j4QgHMVSBQI4EBAc8AAc8WAc8Wye1UAAbywIIAFSUfwHKAOBwAcoAgAAkcFnwCYAIBIBQVAE/cAQa5Dpj+mfmP0AGECaqRFBCAvGoozdAcEIPe7L710J2Il5egnQAUAgEgFhcCASAdHgIBIBgZAgEgGxwB9zIcQHKAVAH8B5wAcoCUAXPFlAD+gJwAcpoI26zJW6zsY49f/AeyHDwHnDwHiRus5l/8B4E8AJQBMyVNANw8B7iJG6zmX/wHgTwAlAEzJU0A3DwHuJw8B4Cf/AeAslYzJYzMwFw8B7iIW6zmH/wHgHwAgHMlDFw8B7iyQGAaACUbDH6ADFx1yH6ADH6ADCnA6sAgAAT7AAApHADyMxDE1AjgQEBzwABzxYBzxbJgAG8AtD0BDAgggDYrwGAEPQPb6Hy4GRtAoIA2K8BgBD0D2+h8uBkEoIA2K8BAoAQ9BfI9ADJQAPwIoAIBIB8gAgEgIiMADz4QlMS8CMwgAacbCL4QW8kgRFNUzvHBfL0UbehggD1/CHC//L0QzBSPPAhcSTCAJIwct6BPrsCqIIJMS0AoIIImJaAoBK88vT4QlQgZPAjXPAff1B2cIBAK1RMORiAhAGTIVVCCEBeNRRlQB8sfFcs/UAP6AgHPFgEgbpUwcAHLAZLPFuIB+gIBzxbJEFYQNFnwIAHvPhBbyRTKscFs44S+EJTuPAjAYERTQLwHyTHBfL03lHIoIIA9fwhwv/y9CH4J28QIaGCCJiWgGa2CKGCCJiWgKChJsIAlhB9UIlfCOMNJW6zIsIAsI4dcAbwAnAEyAGCENUydttYyx/LP8kQR0MwF21t8CCSNVvigJADTFv4QW8kgRFNUzjHBfL0UYShggD1/CHC//L0QzBSOfAhgT67AYIJMS0AoIIImJaAoBK88vR/cAOAQFQzZshVMIIQe92X3lAFyx8Tyz8B+gIBzxYBIG6VMHABywGSzxbiyVQTBFAzbW3wIIAByUE1DMPAhUjCgGqFwcChIE1B0yFUwghBzYtCcUAXLHxPLPwH6AgHPFgHPFskoEEZDE1BVbW3wIFAFADe/2BdqJoagD8MUCAgOuAfSAAgP0gAKGYNgn4EkAgJzJygACazx+BFAAHGt6ME4LnYerpZXPY9CdhzrJUKNs0E4TusalpWyPlmRadeW/vixHME4TujwAfLZsB5P5B1ZLNZRCcA=';
const depends = new Map<string, Cell>();
depends.set('55471', Cell.fromBoc(Buffer.from('te6ccgECKQEABYcAART/APSkE/S88sgLAQIBYgIDAgLKBAUCASAlJgIBIAYHAgFIEhMCASAICQIB7hARAgFICgsAR7OQ4AOWAuYDlgLgA5YAJZmZk/IBkOQDlgLgA5YAJZQPl/+ToQT1RwIddJwh+VMCDXCx/eAtDTAwFxsMABkX+RcOIB+kAiUGZvBPhhAo4zMO1E0NQB+GKBAQHXAPpAAQH6QAFDMGwTVQLwKMj4QgHMVSBQI4EBAc8AAc8WAc8Wye1U4CCCEA+KfqW64wIgghAXjUUZuuMCghBZXwe8uuMCMIDA0ODwALQgbvLQgIAN4w7UTQ1AH4YoEBAdcA+kABAfpAAUMwbBMD0x8BghAPin6luvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeJtAtIAAZRsEtQS3voAUWYWFURANxCJEHhVBfAlyPhCAcxVIFAjgQEBzwABzxYBzxbJ7VQAyjDtRNDUAfhigQEB1wD6QAEB+kABQzBsEwPTHwGCEBeNRRm68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4gH6AFFVFRRDMDYQeBBnVQTwJsj4QgHMVSBQI4EBAc8AAc8WAc8Wye1UALztRNDUAfhigQEB1wD6QAEB+kABQzBsEwPTHwGCEFlfB7y68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4hRDMDQQVhBFVQLwJ8j4QgHMVSBQI4EBAc8AAc8WAc8Wye1UAAbywIIAFSUfwHKAOBwAcoAgAAkcFnwCYAIBIBQVAE/cAQa5Dpj+mfmP0AGECaqRFBCAvGoozdAcEIPe7L710J2Il5egnQAUAgEgFhcCASAdHgIBIBgZAgEgGxwB9zIcQHKAVAH8B5wAcoCUAXPFlAD+gJwAcpoI26zJW6zsY49f/AeyHDwHnDwHiRus5l/8B4E8AJQBMyVNANw8B7iJG6zmX/wHgTwAlAEzJU0A3DwHuJw8B4Cf/AeAslYzJYzMwFw8B7iIW6zmH/wHgHwAgHMlDFw8B7iyQGAaACUbDH6ADFx1yH6ADH6ADCnA6sAgAAT7AAApHADyMxDE1AjgQEBzwABzxYBzxbJgAG8AtD0BDAgggDYrwGAEPQPb6Hy4GRtAoIA2K8BgBD0D2+h8uBkEoIA2K8BAoAQ9BfI9ADJQAPwIoAIBIB8gAgEgIiMADz4QlMS8CMwgAacbCL4QW8kgRFNUzvHBfL0UbehggD1/CHC//L0QzBSPPAhcSTCAJIwct6BPrsCqIIJMS0AoIIImJaAoBK88vT4QlQgZPAjXPAff1B2cIBAK1RMORiAhAGTIVVCCEBeNRRlQB8sfFcs/UAP6AgHPFgEgbpUwcAHLAZLPFuIB+gIBzxbJEFYQNFnwIAHvPhBbyRTKscFs44S+EJTuPAjAYERTQLwHyTHBfL03lHIoIIA9fwhwv/y9CH4J28QIaGCCJiWgGa2CKGCCJiWgKChJsIAlhB9UIlfCOMNJW6zIsIAsI4dcAbwAnAEyAGCENUydttYyx/LP8kQR0MwF21t8CCSNVvigJADTFv4QW8kgRFNUzjHBfL0UYShggD1/CHC//L0QzBSOfAhgT67AYIJMS0AoIIImJaAoBK88vR/cAOAQFQzZshVMIIQe92X3lAFyx8Tyz8B+gIBzxYBIG6VMHABywGSzxbiyVQTBFAzbW3wIIAByUE1DMPAhUjCgGqFwcChIE1B0yFUwghBzYtCcUAXLHxPLPwH6AgHPFgHPFskoEEZDE1BVbW3wIFAFADe/2BdqJoagD8MUCAgOuAfSAAgP0gAKGYNgn4EkAgJzJygACazx+BFAAHGt6ME4LnYerpZXPY9CdhzrJUKNs0E4TusalpWyPlmRadeW/vixHME4TujwAfLZsB5P5B1ZLNZRCcA=', 'base64'))[0]);
let systemCell = beginCell().storeDict(serializeDict(depends, 16, (src, v) => v.refs.push(src))).endCell();
let __stack: StackItem[] = [];
__stack.push({ type: 'cell', cell: systemCell });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(master).endCell() });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(owner).endCell() });
let codeCell = Cell.fromBoc(Buffer.from(__code, 'base64'))[0];
let executor = await createExecutorFromCode({ code: codeCell, data: new Cell() });
let res = await executor.get('init_JettonDefaultWallet', __stack, { debug: true });
if (res.debugLogs.length > 0) { console.warn(res.debugLogs); }
let data = res.stack.readCell();
return { code: codeCell, data };
}
export const JettonDefaultWallet_errors: { [key: string]: string } = {
'2': `Stack undeflow`,
'3': `Stack overflow`,
'4': `Integer overflow`,
'5': `Integer out of expected range`,
'6': `Invalid opcode`,
'7': `Type check error`,
'8': `Cell overflow`,
'9': `Cell underflow`,
'10': `Dictionary error`,
'13': `Out of gas error`,
'32': `Method ID not found`,
'34': `Action is invalid or not supported`,
'37': `Not enough TON`,
'38': `Not enough extra-currencies`,
'128': `Null reference exception`,
'129': `Invalid serialization prefix`,
'130': `Invalid incoming message`,
'131': `Constraints error`,
'132': `Access denied`,
'133': `Contract stopped`,
'134': `Invalid argument`,
'4429': `Invalid sender`,
'13650': `Invalid bounced message`,
'16059': `Invalid value`,
'62972': `Invalid balance`,
}
export class JettonDefaultWallet {
readonly executor: ContractExecutor;
constructor(executor: ContractExecutor) { this.executor = executor; }
async send(args: { amount: BN, from?: Address, debug?: boolean }, message: TokenTransfer | TokenTransferInternal | TokenBurn) {
let body: Cell | null = null;
if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'TokenTransfer') {
body = packTokenTransfer(message);
}
if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'TokenTransferInternal') {
body = packTokenTransferInternal(message);
}
if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'TokenBurn') {
body = packTokenBurn(message);
}
if (body === null) { throw new Error('Invalid message type'); }
try {
let r = await this.executor.internal(new InternalMessage({
to: this.executor.address,
from: args.from || this.executor.address,
bounce: false,
value: args.amount,
body: new CommonMessageInfo({
body: new CellMessage(body!)
})
}), { debug: args.debug });
if (r.debugLogs.length > 0) { console.warn(r.debugLogs); }
} catch (e) {
if (e instanceof ExecuteError) {
if (e.debugLogs.length > 0) { console.warn(e.debugLogs); }
if (JettonDefaultWallet_errors[e.exitCode.toString()]) {
throw new Error(JettonDefaultWallet_errors[e.exitCode.toString()]);
}
}
throw e;
}
}
async getGetWalletData() {
try {
let __stack: StackItem[] = [];
let result = await this.executor.get('get_wallet_data', __stack, { debug: true });
if (result.debugLogs.length > 0) { console.warn(result.debugLogs); }
return unpackStackJettonWalletData(result.stack);
} catch (e) {
if (e instanceof ExecuteError) {
if (e.debugLogs.length > 0) { console.warn(e.debugLogs); }
if (JettonDefaultWallet_errors[e.exitCode.toString()]) {
throw new Error(JettonDefaultWallet_errors[e.exitCode.toString()]);
}
}
throw e;
}
}
}

1328
sources/output/jetton_SampleJetton.abi

File diff suppressed because it is too large Load Diff

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.

456
sources/output/jetton_SampleJetton.fc

@ -0,0 +1,456 @@
forall X -> X __tact_not_null(X x) { throw_if(128, null?(x)); return x; }
global (int, slice, int, slice) __tact_context;
global cell __tact_context_sys;
(int, slice, int, slice) __tact_context_get() inline { return __tact_context; }
() __tact_verify_address(slice address) inline {
throw_unless(134, address.slice_bits() != 267);
}
(slice, slice) __tact_load_address(slice cs) inline {
slice raw = cs~load_msg_addr();
__tact_verify_address(raw);
return (cs, raw);
}
(slice, slice) __tact_load_address_opt(slice cs) inline {
slice raw = cs~load_msg_addr();
if (raw.preload_uint(2) != 0) {
__tact_verify_address(raw);
return (cs, raw);
} else {
return (cs, null());
}
}
builder __tact_store_address(builder b, slice address) inline {
__tact_verify_address(address);
b = b.store_slice(address);
return b;
}
builder __tact_store_address_opt(builder b, slice address) inline {
if (null?(address)) {
b = b.store_uint(0, 2);
return b;
} else {
return __tact_store_address(b, address);
}
}
slice __tact_compute_contract_address(int chain, cell code, cell data) {
var b = begin_cell();
b = b.store_uint(0, 2);
b = b.store_uint(3, 2);
b = b.store_uint(0, 1);
b = b.store_ref(code);
b = b.store_ref(data);
var hash = cell_hash(b.end_cell());
var b2 = begin_cell();
b2 = b2.store_uint(2, 2);
b2 = b2.store_uint(0, 1);
b2 = b2.store_int(chain, 8);
b2 = b2.store_uint(hash, 256);
return b2.end_cell().begin_parse();
}
int __tact_address_eq(slice a, slice b) inline {
return equal_slice_bits(a, b);
}
cell __tact_dict_set_code(cell dict, int id, cell code) inline {
return udict_set_ref(dict, 16, id, code);
}
cell __tact_dict_get_code(cell dict, int id) inline {
var (data, ok) = udict_get_ref?(dict, 16, id);
throw_unless(100, ok);
return data;
}
builder __gen_write_TokenTransferInternal(builder build_0, (int, int, slice, slice, int, slice) v) inline {
var (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload) = v;
build_0 = store_uint(build_0, 395134233, 32);
build_0 = store_uint(build_0, v'queryId, 64);
build_0 = store_coins(build_0, v'amount);
build_0 = __tact_store_address(build_0, v'from);
build_0 = __tact_store_address_opt(build_0, v'responseAddress);
build_0 = store_coins(build_0, v'forwardTonAmount);
build_0 = store_slice(build_0, v'forwardPayload);
return build_0;
}
cell __gen_writecell_TokenTransferInternal((int, int, slice, slice, int, slice) v) inline {
return __gen_write_TokenTransferInternal(begin_cell(), v).end_cell();
}
(slice, ((int, int, slice, slice))) __gen_read_TokenBurnNotification(slice sc_0) inline {
throw_unless(129, sc_0~load_uint(32) == 2078119902);
var v'queryId = sc_0~load_uint(64);
var v'amount = sc_0~load_coins();
var v'owner = sc_0~__tact_load_address();
var v'responseAddress = sc_0~__tact_load_address_opt();
return (sc_0, (v'queryId, v'amount, v'owner, v'responseAddress));
}
builder __gen_write_TokenExcesses(builder build_0, (int) v) inline {
var (v'queryId) = v;
build_0 = store_uint(build_0, 3576854235, 32);
build_0 = store_uint(build_0, v'queryId, 64);
return build_0;
}
cell __gen_writecell_TokenExcesses((int) v) inline {
return __gen_write_TokenExcesses(begin_cell(), v).end_cell();
}
(slice, ((cell))) __gen_read_TokenUpdateContent(slice sc_0) inline {
throw_unless(129, sc_0~load_uint(32) == 1862840892);
var v'content = null();
if (sc_0~load_int(1)) {
v'content = sc_0~load_ref();
}
return (sc_0, (v'content));
}
(slice, ((int))) __gen_read_Mint(slice sc_0) inline {
throw_unless(129, sc_0~load_uint(32) == 2737462367);
var v'amount = sc_0~load_int(257);
return (sc_0, (v'amount));
}
builder __gen_write_JettonDefaultWallet(builder build_0, (int, slice, slice) v) inline {
var (v'balance, v'owner, v'master) = v;
build_0 = store_int(build_0, v'balance, 257);
build_0 = __tact_store_address(build_0, v'owner);
build_0 = __tact_store_address(build_0, v'master);
return build_0;
}
builder __gen_write_SampleJetton(builder build_0, (int, slice, cell, int) v) inline {
var (v'totalSupply, v'owner, v'content, v'mintable) = v;
build_0 = store_coins(build_0, v'totalSupply);
build_0 = __tact_store_address(build_0, v'owner);
if (null?(v'content)) {
build_0 = store_int(build_0, false, 1);
} else {
build_0 = store_int(build_0, true, 1);
build_0 = store_ref(build_0, v'content);
}
build_0 = store_int(build_0, v'mintable, 1);
return build_0;
}
(slice, ((int, slice, cell, int))) __gen_read_SampleJetton(slice sc_0) inline {
var v'totalSupply = sc_0~load_coins();
var v'owner = sc_0~__tact_load_address();
var v'content = null();
if (sc_0~load_int(1)) {
v'content = sc_0~load_ref();
}
var v'mintable = sc_0~load_int(1);
return (sc_0, (v'totalSupply, v'owner, v'content, v'mintable));
}
_ __gen_StateInit_get_code((cell, cell) v) inline {
var (v'code, v'data) = v;
return v'code;
}
_ __gen_Context_get_sender((int, slice, int, slice) v) inline {
var (v'bounced, v'sender, v'value, v'raw) = v;
return v'sender;
}
(int, slice, cell, int) __gen_load_SampleJetton() inline {
slice sc = get_data().begin_parse();
__tact_context_sys = sc~load_ref();
return sc~__gen_read_SampleJetton();
}
() __gen_store_SampleJetton((int, slice, cell, int) v) impure inline {
builder b = begin_cell();
b = b.store_ref(__tact_context_sys);
b = __gen_write_SampleJetton(b, v);
set_data(b.end_cell());
}
builder storeBool(builder $s, int $value) impure {
if ($value) {
return store_int($s, (- 1), 1);
} else {
return store_int($s, 0, 1);
}
}
cell emptyCell() impure {
return end_cell(begin_cell());
}
slice __gen_Cell_asSlice(cell $self) impure {
var ($self) = $self;
return begin_parse($self);
}
slice emptySlice() impure {
return __gen_Cell_asSlice(emptyCell());
}
slice contractAddress((cell, cell) $s) impure {
var (($s'code, $s'data)) = $s;
return __tact_compute_contract_address(0, $s'code, $s'data);
}
() send((int, slice, int, int, cell, cell, cell) $params) impure {
var (($params'bounce, $params'to, $params'value, $params'mode, $params'body, $params'code, $params'data)) = $params;
builder $b = begin_cell();
$b = store_int($b, 1, 2);
$b = storeBool($b, $params'bounce);
$b = store_int($b, 0, 3);
$b = __tact_store_address($b, $params'to);
$b = store_coins($b, $params'value);
$b = store_int($b, 0, ((((1 + 4) + 4) + 64) + 32));
if (((~ null?($params'code)) | (~ null?($params'data)))) {
$b = storeBool($b, true);
builder $bc = begin_cell();
$bc = storeBool($bc, false);
$bc = storeBool($bc, false);
if ((~ null?($params'code))) {
$bc = storeBool($bc, true);
$bc = store_ref($bc, __tact_not_null($params'code));
} else {
$bc = storeBool($bc, false);
}
if ((~ null?($params'data))) {
$bc = storeBool($bc, true);
$bc = store_ref($bc, __tact_not_null($params'data));
} else {
$bc = storeBool($bc, false);
}
$bc = storeBool($bc, false);
$b = storeBool($b, true);
$b = store_ref($b, end_cell($bc));
} else {
$b = storeBool($b, false);
}
cell $body = $params'body;
if ((~ null?($body))) {
$b = storeBool($b, true);
$b = store_ref($b, __tact_not_null($body));
} else {
$b = storeBool($b, false);
}
cell $c = end_cell($b);
send_raw_message($c, $params'mode);
}
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, cell) __gen_JettonDefaultWallet_init_child(cell sys', slice $master, slice $owner) {
slice sc' = sys'.begin_parse();
cell source = sc'~load_dict();
cell mine = __tact_dict_get_code(source, 55471);
cell contracts = new_dict();
cell code_55471 = __tact_dict_get_code(source, 55471);
contracts = __tact_dict_set_code(contracts, 55471, code_55471);
cell sys = begin_cell().store_dict(contracts).end_cell();
return (mine, __gen_JettonDefaultWallet_init(sys, $master, $owner));
}
cell __gen_SampleJetton_init(cell sys', slice $owner, cell $content) {
var (($self'totalSupply, $self'owner, $self'content, $self'mintable)) = (null(), null(), null(), null());
$self'totalSupply = 0;
$self'owner = $owner;
$self'mintable = true;
$self'content = $content;
var b' = begin_cell();
b' = b'.store_ref(sys');
b' = __gen_write_SampleJetton(b', ($self'totalSupply, $self'owner, $self'content, $self'mintable));
return b'.end_cell();
}
((int, slice, cell, int), (cell, cell)) __gen_SampleJetton_getJettonWalletInit((int, slice, cell, int) $self, slice $address) impure {
var (($self'totalSupply, $self'owner, $self'content, $self'mintable)) = $self;
return (($self'totalSupply, $self'owner, $self'content, $self'mintable), __gen_JettonDefaultWallet_init_child(__tact_context_sys, my_address(), $address));
}
slice __gen_SampleJetton_get_wallet_address((int, slice, cell, int) $self, slice $owner) impure {
var (($self'totalSupply, $self'owner, $self'content, $self'mintable)) = $self;
var ($winit'code, $winit'data) = ($self'totalSupply, $self'owner, $self'content, $self'mintable)~__gen_SampleJetton_getJettonWalletInit($owner);
return contractAddress(($winit'code, $winit'data));
}
_ __gen_get_get_wallet_address(slice $owner) method_id(103289) {
var self = __gen_load_SampleJetton();
var res = __gen_SampleJetton_get_wallet_address(self, $owner);
return res;
}
(int, int, slice, cell, cell) __gen_SampleJetton_get_jetton_data((int, slice, cell, int) $self) impure {
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())));
}
_ __gen_get_get_jetton_data() method_id(106029) {
var self = __gen_load_SampleJetton();
var res = __gen_SampleJetton_get_jetton_data(self);
return res;
}
((int, slice, cell, int), ()) __gen_SampleJetton_mint((int, slice, cell, int) $self, slice $to, int $amount, slice $responseAddress) impure {
var (($self'totalSupply, $self'owner, $self'content, $self'mintable)) = $self;
$self'totalSupply = ($self'totalSupply + $amount);
var ($winit'code, $winit'data) = ($self'totalSupply, $self'owner, $self'content, $self'mintable)~__gen_SampleJetton_getJettonWalletInit($to);
slice $walletAddress = contractAddress(($winit'code, $winit'data));
send((false, $walletAddress, 0, 64, __gen_writecell_TokenTransferInternal((0, $amount, my_address(), $responseAddress, 0, emptySlice())), $winit'code, $winit'data));
return (($self'totalSupply, $self'owner, $self'content, $self'mintable), ());
}
((int, slice, cell, int), ()) __gen_SampleJetton_requireWallet((int, slice, cell, int) $self, slice $owner) impure {
var (($self'totalSupply, $self'owner, $self'content, $self'mintable)) = $self;
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get();
var ($winit'code, $winit'data) = ($self'totalSupply, $self'owner, $self'content, $self'mintable)~__gen_SampleJetton_getJettonWalletInit($owner);
throw_unless(4429, __tact_address_eq(contractAddress(($winit'code, $winit'data)), $ctx'sender));
return (($self'totalSupply, $self'owner, $self'content, $self'mintable), ());
}
((int, slice, cell, int), ()) __gen_SampleJetton_requireOwner((int, slice, cell, int) $self) impure {
var (($self'totalSupply, $self'owner, $self'content, $self'mintable)) = $self;
throw_unless(132, __tact_address_eq(__gen_Context_get_sender(__tact_context_get()), $self'owner));
return (($self'totalSupply, $self'owner, $self'content, $self'mintable), ());
}
slice __gen_SampleJetton_owner((int, slice, cell, int) $self) impure {
var (($self'totalSupply, $self'owner, $self'content, $self'mintable)) = $self;
return $self'owner;
}
_ __gen_get_owner() method_id(83229) {
var self = __gen_load_SampleJetton();
var res = __gen_SampleJetton_owner(self);
return res;
}
(((int, slice, cell, int)), ()) __gen_SampleJetton_receive_Mint((int, slice, cell, int) $self, (int) $msg) impure {
var ($self'totalSupply, $self'owner, $self'content, $self'mintable) = $self;
var ($msg'amount) = $msg;
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get();
($self'totalSupply, $self'owner, $self'content, $self'mintable)~__gen_SampleJetton_mint($ctx'sender, $msg'amount, $ctx'sender);
return (($self'totalSupply, $self'owner, $self'content, $self'mintable), ());
}
((int, slice, cell, int), ()) __gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2((int, slice, cell, int) $self) impure {
var ($self'totalSupply, $self'owner, $self'content, $self'mintable) = $self;
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get();
($self'totalSupply, $self'owner, $self'content, $self'mintable)~__gen_SampleJetton_mint($ctx'sender, 1000000000, $ctx'sender);
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 {
var ($self'totalSupply, $self'owner, $self'content, $self'mintable) = $self;
var ($msg'content) = $msg;
($self'totalSupply, $self'owner, $self'content, $self'mintable)~__gen_SampleJetton_requireOwner();
$self'content = $msg'content;
return (($self'totalSupply, $self'owner, $self'content, $self'mintable), ());
}
(((int, slice, cell, int)), ()) __gen_SampleJetton_receive_TokenBurnNotification((int, slice, cell, int) $self, (int, int, slice, slice) $msg) impure {
var ($self'totalSupply, $self'owner, $self'content, $self'mintable) = $self;
var ($msg'queryId, $msg'amount, $msg'owner, $msg'responseAddress) = $msg;
($self'totalSupply, $self'owner, $self'content, $self'mintable)~__gen_SampleJetton_requireWallet($msg'owner);
$self'totalSupply = ($self'totalSupply - $msg'amount);
if ((~ null?($msg'responseAddress))) {
send((false, $msg'responseAddress, 0, (64 + 2), __gen_writecell_TokenExcesses(($msg'queryId)), null(), null()));
}
return (($self'totalSupply, $self'owner, $self'content, $self'mintable), ());
}
() recv_internal(int msg_value, cell in_msg_cell, slice in_msg) impure {
;; Parse incoming message
int op = 0;
if (slice_bits(in_msg) >= 32) {
op = in_msg.preload_uint(32);
}
var cs = in_msg_cell.begin_parse();
var msg_flags = cs~load_uint(4);
var msg_bounced = ((msg_flags & 1) == 1 ? true : false);
slice msg_sender_addr = cs~load_msg_addr();
__tact_context = (msg_bounced, msg_sender_addr, msg_value, cs);
;; Handle bounced messages
if (msg_bounced) {
return ();
}
;; Receive Mint message
if (op == 2737462367) {
var self = __gen_load_SampleJetton();
var msg = in_msg~__gen_read_Mint();
self~__gen_SampleJetton_receive_Mint(msg);
__gen_store_SampleJetton(self);
return ();
}
;; Receive TokenUpdateContent message
if (op == 1862840892) {
var self = __gen_load_SampleJetton();
var msg = in_msg~__gen_read_TokenUpdateContent();
self~__gen_SampleJetton_receive_TokenUpdateContent(msg);
__gen_store_SampleJetton(self);
return ();
}
;; Receive TokenBurnNotification message
if (op == 2078119902) {
var self = __gen_load_SampleJetton();
var msg = in_msg~__gen_read_TokenBurnNotification();
self~__gen_SampleJetton_receive_TokenBurnNotification(msg);
__gen_store_SampleJetton(self);
return ();
}
;; Text Receivers
if (op == 0) {
var text_op = slice_hash(in_msg);
;; Receive "Mint!" message
if (text_op == 0xcd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2) {
var self = __gen_load_SampleJetton();
self~__gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2();
__gen_store_SampleJetton(self);
return ();
}
}
throw(130);
}
cell init_SampleJetton(cell sys', slice owner, cell content) method_id {
return __gen_SampleJetton_init(sys', owner, content);
}
_ supported_interfaces() method_id {
return (
"org.ton.introspection.v0"H >> 128,
"org.ton.abi.ipfs.v0"H >> 128,
"org.ton.jetton.master"H >> 128,
"org.ton.ownable"H >> 128
);
}
_ get_abi_ipfs() {
return "ipfs://QmfEvDdmm4QFHZHyaeXmxoQzn6vUaLtdbVnjusevQcp7eA";
}

697
sources/output/jetton_SampleJetton.fif

@ -0,0 +1,697 @@
PROGRAM{
DECLPROC __tact_not_null
DECLPROC __tact_context_get
DECLPROC __tact_verify_address
DECLPROC __tact_load_address
DECLPROC __tact_load_address_opt
DECLPROC __tact_store_address
DECLPROC __tact_store_address_opt
DECLPROC __tact_compute_contract_address
DECLPROC __tact_address_eq
DECLPROC __tact_dict_set_code
DECLPROC __tact_dict_get_code
DECLPROC __gen_write_TokenTransferInternal
DECLPROC __gen_writecell_TokenTransferInternal
DECLPROC __gen_read_TokenBurnNotification
DECLPROC __gen_write_TokenExcesses
DECLPROC __gen_writecell_TokenExcesses
DECLPROC __gen_read_TokenUpdateContent
DECLPROC __gen_read_Mint
DECLPROC __gen_write_JettonDefaultWallet
DECLPROC __gen_write_SampleJetton
DECLPROC __gen_read_SampleJetton
DECLPROC __gen_StateInit_get_code
DECLPROC __gen_Context_get_sender
DECLPROC __gen_load_SampleJetton
DECLPROC __gen_store_SampleJetton
DECLPROC storeBool
DECLPROC emptyCell
DECLPROC __gen_Cell_asSlice
DECLPROC emptySlice
DECLPROC contractAddress
DECLPROC send
DECLPROC __gen_JettonDefaultWallet_init
DECLPROC __gen_JettonDefaultWallet_init_child
DECLPROC __gen_SampleJetton_init
DECLPROC __gen_SampleJetton_getJettonWalletInit
DECLPROC __gen_SampleJetton_get_wallet_address
103289 DECLMETHOD __gen_get_get_wallet_address
DECLPROC __gen_SampleJetton_get_jetton_data
106029 DECLMETHOD __gen_get_get_jetton_data
DECLPROC __gen_SampleJetton_mint
DECLPROC __gen_SampleJetton_requireWallet
DECLPROC __gen_SampleJetton_requireOwner
DECLPROC __gen_SampleJetton_owner
83229 DECLMETHOD __gen_get_owner
DECLPROC __gen_SampleJetton_receive_Mint
DECLPROC __gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2
DECLPROC __gen_SampleJetton_receive_TokenUpdateContent
DECLPROC __gen_SampleJetton_receive_TokenBurnNotification
DECLPROC recv_internal
122307 DECLMETHOD init_SampleJetton
113617 DECLMETHOD supported_interfaces
DECLPROC get_abi_ipfs
DECLGLOBVAR __tact_context
DECLGLOBVAR __tact_context_sys
__tact_not_null PROC:<{
DUP
ISNULL
128 THROWIF
}>
__tact_context_get PROCINLINE:<{
__tact_context GETGLOB
4 UNTUPLE
}>
__tact_verify_address PROCINLINE:<{
SBITS
267 PUSHINT
NEQ
134 THROWIFNOT
}>
__tact_load_address PROCINLINE:<{
LDMSGADDR
SWAP
}>
__tact_load_address_opt PROCINLINE:<{
LDMSGADDR
OVER
2 PLDU
0 NEQINT
IF:<{
SWAP
}>ELSE<{
NIP
PUSHNULL
}>
}>
__tact_store_address PROCINLINE:<{
STSLICER
}>
__tact_store_address_opt PROCINLINE:<{
DUP
ISNULL
IF:<{
DROP
0 PUSHINT
SWAP
2 STU
}>ELSE<{
__tact_store_address INLINECALLDICT
}>
}>
__tact_compute_contract_address PROC:<{
NEWC
0 PUSHINT
SWAP
2 STU
3 PUSHINT
SWAP
2 STU
0 PUSHINT
SWAP
1 STU
s1 s2 XCHG
STREF
STREF
ENDC
HASHCU
NEWC
2 PUSHINT
SWAP
2 STU
0 PUSHINT
SWAP
1 STU
s1 s2 XCHG
8 STI
256 STU
ENDC
CTOS
}>
__tact_address_eq PROCINLINE:<{
SDEQ
}>
__tact_dict_set_code PROCINLINE:<{
s0 s2 XCHG
16 PUSHINT
DICTUSETREF
}>
__tact_dict_get_code PROCINLINE:<{
SWAP
16 PUSHINT
DICTUGETREF
NULLSWAPIFNOT
100 THROWIFNOT
}>
__gen_write_TokenTransferInternal PROCINLINE:<{
395134233 PUSHINT
s0 s7 XCHG2
32 STU
s1 s5 XCHG
64 STU
s0 s3 XCHG2
STGRAMS
SWAP
__tact_store_address INLINECALLDICT
SWAP
__tact_store_address_opt INLINECALLDICT
SWAP
STGRAMS
SWAP
STSLICER
}>
__gen_writecell_TokenTransferInternal PROCINLINE:<{
NEWC
6 -ROLL
__gen_write_TokenTransferInternal INLINECALLDICT
ENDC
}>
__gen_read_TokenBurnNotification PROCINLINE:<{
32 LDU
SWAP
2078119902 PUSHINT
EQUAL
129 THROWIFNOT
64 LDU
LDGRAMS
__tact_load_address INLINECALLDICT
SWAP
__tact_load_address_opt INLINECALLDICT
s1 s4 XCHG
s3 s3 s0 XCHG3
}>
__gen_write_TokenExcesses PROCINLINE:<{
3576854235 PUSHINT
ROT
32 STU
64 STU
}>
__gen_writecell_TokenExcesses PROCINLINE:<{
NEWC
SWAP
__gen_write_TokenExcesses INLINECALLDICT
ENDC
}>
__gen_read_TokenUpdateContent PROCINLINE:<{
32 LDU
SWAP
1862840892 PUSHINT
EQUAL
129 THROWIFNOT
PUSHNULL
SWAP
1 LDI
SWAP
IF:<{
NIP
LDREF
}>
SWAP
}>
__gen_read_Mint PROCINLINE:<{
32 LDU
SWAP
2737462367 PUSHINT
EQUAL
129 THROWIFNOT
257 PUSHINT
LDIX
SWAP
}>
__gen_write_JettonDefaultWallet PROCINLINE:<{
s2 s3 XCHG2
257 PUSHINT
STIX
SWAP
__tact_store_address INLINECALLDICT
SWAP
__tact_store_address INLINECALLDICT
}>
__gen_write_SampleJetton PROCINLINE:<{
s4 s3 XCHG2
STGRAMS
SWAP
__tact_store_address INLINECALLDICT
s2 PUSH
ISNULL
IF:<{
s2 POP
FALSE
ROT
1 STI
}>ELSE<{
TRUE
SWAP
1 STI
s1 s2 XCHG
STREF
}>
1 STI
}>
__gen_read_SampleJetton PROCINLINE:<{
LDGRAMS
__tact_load_address INLINECALLDICT
PUSHNULL
s0 s2 XCHG
1 LDI
SWAP
IF:<{
1 2 BLKDROP2
LDREF
s1 s2 XCHG
}>
1 LDI
s0 s4 XCHG
s3 s3 XCHG2
}>
__gen_StateInit_get_code PROCINLINE:<{
DROP
}>
__gen_Context_get_sender PROCINLINE:<{
s2 s3 XCHG
3 BLKDROP
}>
__gen_load_SampleJetton PROCINLINE:<{
c4 PUSH
CTOS
LDREF
SWAP
__tact_context_sys SETGLOB
__gen_read_SampleJetton INLINECALLDICT
1 4 BLKDROP2
}>
__gen_store_SampleJetton PROCINLINE:<{
NEWC
__tact_context_sys GETGLOB
SWAP
STREF
4 -ROLL
__gen_write_SampleJetton INLINECALLDICT
ENDC
c4 POP
}>
storeBool PROC:<{
IFJMP:<{
-1 PUSHINT
SWAP
1 STI
}>
0 PUSHINT
SWAP
1 STI
}>
emptyCell PROC:<{
NEWC
ENDC
}>
__gen_Cell_asSlice PROC:<{
CTOS
}>
emptySlice PROC:<{
emptyCell CALLDICT
__gen_Cell_asSlice CALLDICT
}>
contractAddress PROC:<{
0 PUSHINT
-ROT
__tact_compute_contract_address CALLDICT
}>
send PROC:<{
NEWC
1 PUSHINT
SWAP
2 STI
s0 s7 XCHG2
storeBool CALLDICT
0 PUSHINT
SWAP
3 STI
s0 s5 XCHG2
__tact_store_address INLINECALLDICT
s0 s3 XCHG2
STGRAMS
0 PUSHINT
SWAP
105 STI
s3 PUSH
ISNULL
NOT
s5 PUSH
ISNULL
NOT
OR
IF:<{
TRUE
storeBool CALLDICT
NEWC
FALSE
storeBool CALLDICT
FALSE
storeBool CALLDICT
s4 PUSH
ISNULL
NOT
IF:<{
TRUE
storeBool CALLDICT
s0 s4 XCHG
__tact_not_null CALLDICT
s0 s4 XCHG2
STREF
}>ELSE<{
s4 POP
s0 s3 XCHG
FALSE
storeBool CALLDICT
}>
s4 PUSH
ISNULL
NOT
IF:<{
TRUE
storeBool CALLDICT
s0 s4 XCHG
__tact_not_null CALLDICT
s0 s4 XCHG2
STREF
}>ELSE<{
s4 POP
s0 s3 XCHG
FALSE
storeBool CALLDICT
}>
FALSE
storeBool CALLDICT
s0 s2 XCHG
TRUE
storeBool CALLDICT
s0 s2 XCHG
ENDC
ROT
STREF
}>ELSE<{
s3 POP
s3 POP
SWAP
FALSE
storeBool CALLDICT
}>
OVER
ISNULL
NOT
IF:<{
TRUE
storeBool CALLDICT
SWAP
__tact_not_null CALLDICT
SWAP
STREF
}>ELSE<{
NIP
FALSE
storeBool CALLDICT
}>
ENDC
SWAP
SENDRAWMSG
}>
__gen_JettonDefaultWallet_init PROC:<{
0 PUSHINT
s0 s3 XCHG
NEWC
STREF
s3 s1 s3 XCHG3
__gen_write_JettonDefaultWallet INLINECALLDICT
ENDC
}>
__gen_JettonDefaultWallet_init_child PROC:<{
s0 s2 XCHG
CTOS
LDDICT
DROP
DUP
55471 PUSHINT
__tact_dict_get_code INLINECALLDICT
NEWDICT
s0 s2 XCHG
55471 PUSHINT
__tact_dict_get_code INLINECALLDICT
s1 s2 XCHG
55471 PUSHINT
SWAP
__tact_dict_set_code INLINECALLDICT
NEWC
STDICT
ENDC
s0 s0 s3 XCHG3
__gen_JettonDefaultWallet_init CALLDICT
}>
__gen_SampleJetton_init PROC:<{
0 PUSHINT
TRUE
s0 s4 XCHG
NEWC
STREF
s3 s3 s4 XCHG3
__gen_write_SampleJetton INLINECALLDICT
ENDC
}>
__gen_SampleJetton_getJettonWalletInit PROC:<{
__tact_context_sys GETGLOB
MYADDR
ROT
__gen_JettonDefaultWallet_init_child CALLDICT
}>
__gen_SampleJetton_get_wallet_address PROC:<{
__gen_SampleJetton_getJettonWalletInit CALLDICT
4 2 BLKDROP2
contractAddress CALLDICT
}>
__gen_get_get_wallet_address PROC:<{
__gen_load_SampleJetton INLINECALLDICT
4 ROLL
__gen_SampleJetton_get_wallet_address CALLDICT
}>
__gen_SampleJetton_get_jetton_data PROC:<{
MYADDR
__gen_SampleJetton_getJettonWalletInit CALLDICT
__gen_StateInit_get_code INLINECALLDICT
s3 s3 s0 XCHG3
}>
__gen_get_get_jetton_data PROC:<{
__gen_load_SampleJetton INLINECALLDICT
__gen_SampleJetton_get_jetton_data CALLDICT
}>
__gen_SampleJetton_mint PROC:<{
s6 s1 XCPU
ADD
4 2 BLKSWAP
__gen_SampleJetton_getJettonWalletInit CALLDICT
2DUP
contractAddress CALLDICT
FALSE
0 PUSHINT
64 PUSHINT
OVER
MYADDR
OVER
emptySlice CALLDICT
s3 s5 XCHG
s4 s14 XCHG
s2 s3 XCHG
s2 s15 XCHG
__gen_writecell_TokenTransferInternal INLINECALLDICT
s5 s6 s0 XCHG3
s4 s10 XCHG
s3 s9 XCHG
s0 s10 s9 XCHG3
send CALLDICT
2SWAP
}>
__gen_SampleJetton_requireWallet PROC:<{
__tact_context_get INLINECALLDICT
s2 s3 XCHG
3 BLKDROP
5 -ROLL
__gen_SampleJetton_getJettonWalletInit CALLDICT
SWAP
4429 PUSHINT
s0 s2 XCHG
contractAddress CALLDICT
s0 s6 XCHG2
__tact_address_eq INLINECALLDICT
s1 s5 XCHG
THROWANYIFNOT
3 ROLL
}>
__gen_SampleJetton_requireOwner PROC:<{
__tact_context_get INLINECALLDICT
__gen_Context_get_sender INLINECALLDICT
s3 PUSH
__tact_address_eq INLINECALLDICT
132 THROWIFNOT
}>
__gen_SampleJetton_owner PROC:<{
s2 s3 XCHG
3 BLKDROP
}>
__gen_get_owner PROC:<{
__gen_load_SampleJetton INLINECALLDICT
__gen_SampleJetton_owner CALLDICT
}>
__gen_SampleJetton_receive_Mint PROC:<{
__tact_context_get INLINECALLDICT
s2 s3 XCHG
3 BLKDROP
TUCK
__gen_SampleJetton_mint CALLDICT
}>
__gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2 PROC:<{
__tact_context_get INLINECALLDICT
s2 s3 XCHG
3 BLKDROP
1000000000 PUSHINT
OVER
__gen_SampleJetton_mint CALLDICT
}>
__gen_SampleJetton_receive_TokenUpdateContent PROC:<{
4 -ROLL
__gen_SampleJetton_requireOwner CALLDICT
NIP
s1 s3 s0 XCHG3
}>
__gen_SampleJetton_receive_TokenBurnNotification PROC:<{
s4 s7 XCHG
s3 s6 XCHG
s5 s7 s7 XCHG3
__gen_SampleJetton_requireWallet CALLDICT
s3 s4 XCHG2
SUB
s5 PUSH
ISNULL
NOT
IF:<{
FALSE
0 PUSHINT
66 PUSHINT
s0 s7 XCHG
__gen_writecell_TokenExcesses INLINECALLDICT
s2 s4 XCHG
s3 s8 XCHG
s1 s7 s0 XCHG3
PUSHNULL
PUSHNULL
send CALLDICT
s2 s3 XCHG
}>ELSE<{
s4 POP
s4 POP
}>
s3 s0 s0 XCHG3
}>
recv_internal PROC:<{
SAMEALTSAVE
0 PUSHINT
OVER
SBITS
31 GTINT
IF:<{
DROP
DUP
32 PLDU
}>
s0 s2 XCHG
CTOS
4 LDU
SWAP
1 PUSHINT
AND
1 EQINT
IF:<{
TRUE
}>ELSE<{
FALSE
}>
SWAP
LDMSGADDR
s2 PUSH
s6 s6 XCHG2
4 TUPLE
__tact_context SETGLOB
s0 s2 XCHG
IFJMP:<{
2DROP
}>
DUP
2737462367 PUSHINT
EQUAL
IFJMP:<{
DROP
__gen_load_SampleJetton INLINECALLDICT
s0 s4 XCHG
__gen_read_Mint INLINECALLDICT
NIP
s3 s4 XCHG
s1 s3 s0 XCHG3
__gen_SampleJetton_receive_Mint CALLDICT
__gen_store_SampleJetton INLINECALLDICT
}>
DUP
1862840892 PUSHINT
EQUAL
IFJMP:<{
DROP
__gen_load_SampleJetton INLINECALLDICT
s0 s4 XCHG
__gen_read_TokenUpdateContent INLINECALLDICT
NIP
s3 s4 XCHG
s1 s3 s0 XCHG3
__gen_SampleJetton_receive_TokenUpdateContent CALLDICT
__gen_store_SampleJetton INLINECALLDICT
}>
DUP
2078119902 PUSHINT
EQUAL
IFJMP:<{
DROP
__gen_load_SampleJetton INLINECALLDICT
s0 s4 XCHG
__gen_read_TokenBurnNotification INLINECALLDICT
s4 POP
s6 s7 XCHG
s5 s6 XCHG
s4 s5 XCHG
3 ROLL
__gen_SampleJetton_receive_TokenBurnNotification CALLDICT
__gen_store_SampleJetton INLINECALLDICT
}>
0 EQINT
IF:<{
HASHSU
92748154967237992140665580847895802782213764542359950109876145449566260965554 PUSHINT
EQUAL
IFJMP:<{
__gen_load_SampleJetton INLINECALLDICT
__gen_SampleJetton_receive_comment_cd0d986cb1a2f468ae7089f4fc3162c116e5f53fbd11a6839f52dbf5040830b2 CALLDICT
__gen_store_SampleJetton INLINECALLDICT
RETALT
}>
}>ELSE<{
DROP
}>
130 THROW
}>
init_SampleJetton PROC:<{
__gen_SampleJetton_init CALLDICT
}>
supported_interfaces PROC:<{
123515602279859691144772641439386770278 PUSHINT
209801025412363888721030803524359905849 PUSHINT
258390863389042349688353801369539695109 PUSHINT
86142586315491086060343270784266291122 PUSHINT
}>
get_abi_ipfs PROC:<{
x{697066733a2f2f516d66457644646d6d345146485a48796165586d786f517a6e367655614c746462566e6a75736576516370376541} PUSHSLICE
}>
}END>c

831
sources/output/jetton_SampleJetton.rev.fif

@ -0,0 +1,831 @@
SETCP0
(:methods
recv_internal:
SAMEALTSAVE
0 PUSHINT
s1 PUSH
SBITS
31 GTINT
<{
s0 POP
s0 PUSH
32 PLDU
}> PUSHCONT
IF
s0 s2 XCHG
CTOS
4 LDU
s0 s1 XCHG
1 PUSHINT
AND
1 EQINT
<{
-1 PUSHINT
}> PUSHCONT
<{
0 PUSHINT
}> PUSHCONT
IFELSE
s0 s1 XCHG
LDMSGADDR
s2 PUSH
s6 s6 XCHG2
4 TUPLE
1 SETGLOBVAR
s0 s2 XCHG
<{
2DROP
}> PUSHCONT
IFJMP
s0 PUSH
2737462367 PUSHINT
EQUAL
<{
s0 POP
c4 PUSH
CTOS
LDREF
s0 s1 XCHG
2 SETGLOBVAR
LDGRAMS
LDMSGADDR
s0 s1 XCHG
PUSHNULL
s0 s2 XCHG
1 LDI
s0 s1 XCHG
<{
1 2 BLKDROP2
LDREF
s1 s2 XCHG
}> PUSHCONT
IF
1 LDI
s0 s4 XCHG
s3 s3 XCHG2
1 4 BLKDROP2
s0 s4 XCHG
32 LDU
s0 s1 XCHG
2737462367 PUSHINT
EQUAL
129 THROWIFNOT
257 PUSHINT
LDI
s0 s1 XCHG
s1 POP
s3 s4 XCHG
s1 s3 s0 XCHG3
42 CALLDICT
NEWC
2 GETGLOBVAR
s0 s1 XCHG
STREF
4 1 BLKSWAP
s4 s3 XCHG2
STGRAMS
s0 s1 XCHG
STSLICER
s2 PUSH
ISNULL
<{
s2 POP
0 PUSHINT
ROT
1 STI
}> PUSHCONT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s1 s2 XCHG
STREF
}> PUSHCONT
IFELSE
1 STI
ENDC
c4 POP
}> IFJMPREF
s0 PUSH
1862840892 PUSHINT
EQUAL
<{
s0 POP
c4 PUSH
CTOS
LDREF
s0 s1 XCHG
2 SETGLOBVAR
LDGRAMS
LDMSGADDR
s0 s1 XCHG
PUSHNULL
s0 s2 XCHG
1 LDI
s0 s1 XCHG
<{
1 2 BLKDROP2
LDREF
s1 s2 XCHG
}> PUSHCONT
IF
1 LDI
s0 s4 XCHG
s3 s3 XCHG2
1 4 BLKDROP2
s0 s4 XCHG
32 LDU
s0 s1 XCHG
1862840892 PUSHINT
EQUAL
129 THROWIFNOT
PUSHNULL
s0 s1 XCHG
1 LDI
s0 s1 XCHG
<{
s1 POP
LDREF
}> PUSHCONT
IF
s0 s1 XCHG
s1 POP
s3 s4 XCHG
s1 s3 s0 XCHG3
44 CALLDICT
NEWC
2 GETGLOBVAR
s0 s1 XCHG
STREF
4 1 BLKSWAP
s4 s3 XCHG2
STGRAMS
s0 s1 XCHG
STSLICER
s2 PUSH
ISNULL
<{
s2 POP
0 PUSHINT
ROT
1 STI
}> PUSHCONT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s1 s2 XCHG
STREF
}> PUSHCONT
IFELSE
1 STI
ENDC
c4 POP
}> IFJMPREF
s0 PUSH
2078119902 PUSHINT
EQUAL
<{
s0 POP
c4 PUSH
CTOS
LDREF
s0 s1 XCHG
2 SETGLOBVAR
LDGRAMS
LDMSGADDR
s0 s1 XCHG
PUSHNULL
s0 s2 XCHG
1 LDI
s0 s1 XCHG
<{
1 2 BLKDROP2
LDREF
s1 s2 XCHG
}> PUSHCONT
IF
1 LDI
s0 s4 XCHG
s3 s3 XCHG2
1 4 BLKDROP2
s0 s4 XCHG
32 LDU
s0 s1 XCHG
2078119902 PUSHINT
EQUAL
129 THROWIFNOT
64 LDU
LDGRAMS
LDMSGADDR
s0 s1 XCHG
s0 s1 XCHG
LDMSGADDR
s1 PUSH
2 PLDU
0 NEQINT
<{
s0 s1 XCHG
}> PUSHCONT
<{
s1 POP
PUSHNULL
}> PUSHCONT
IFELSE
s1 s4 XCHG
s3 s3 s0 XCHG3
s4 POP
s6 s7 XCHG
s5 s6 XCHG
s4 s5 XCHG
1 3 BLKSWAP
45 CALLDICT
NEWC
2 GETGLOBVAR
s0 s1 XCHG
STREF
4 1 BLKSWAP
s4 s3 XCHG2
STGRAMS
s0 s1 XCHG
STSLICER
s2 PUSH
ISNULL
<{
s2 POP
0 PUSHINT
ROT
1 STI
}> PUSHCONT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s1 s2 XCHG
STREF
}> PUSHCONT
IFELSE
1 STI
ENDC
c4 POP
}> IFJMPREF
0 EQINT
<{
HASHSU
92748154967237992140665580847895802782213764542359950109876145449566260965554 PUSHINT
EQUAL
<{
c4 PUSH
CTOS
LDREF
s0 s1 XCHG
2 SETGLOBVAR
LDGRAMS
LDMSGADDR
s0 s1 XCHG
PUSHNULL
s0 s2 XCHG
1 LDI
s0 s1 XCHG
<{
1 2 BLKDROP2
LDREF
s1 s2 XCHG
}> PUSHCONT
IF
1 LDI
s0 s4 XCHG
s3 s3 XCHG2
1 4 BLKDROP2
43 CALLDICT
NEWC
2 GETGLOBVAR
s0 s1 XCHG
STREF
4 1 BLKSWAP
s4 s3 XCHG2
STGRAMS
s0 s1 XCHG
STSLICER
s2 PUSH
ISNULL
<{
s2 POP
0 PUSHINT
ROT
1 STI
}> PUSHCONT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s1 s2 XCHG
STREF
}> PUSHCONT
IFELSE
1 STI
ENDC
c4 POP
RETALT
}> PUSHCONT
IFJMP
}> PUSHCONT
<{
s0 POP
}> PUSHCONT
IFELSE
130 THROW
1:
s0 PUSH
ISNULL
128 THROWIF
8:
NEWC
0 PUSHINT
s0 s1 XCHG
2 STU
3 PUSHINT
s0 s1 XCHG
2 STU
0 PUSHINT
s0 s1 XCHG
1 STU
s1 s2 XCHG
STREF
STREF
ENDC
HASHCU
NEWC
2 PUSHINT
s0 s1 XCHG
2 STU
0 PUSHINT
s0 s1 XCHG
1 STU
s1 s2 XCHG
8 STI
256 STU
ENDC
CTOS
26:
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
}> PUSHCONT
IFJMP
0 PUSHINT
s0 s1 XCHG
1 STI
27:
NEWC
ENDC
28:
CTOS
29:
27 CALLDICT
28 CALLDICT
30:
0 PUSHINT
ROTREV
8 CALLDICT
31:
NEWC
1 PUSHINT
s0 s1 XCHG
2 STI
s0 s7 XCHG2
26 CALLDICT
0 PUSHINT
s0 s1 XCHG
3 STI
s0 s5 XCHG2
STSLICER
s0 s3 XCHG2
STGRAMS
0 PUSHINT
s0 s1 XCHG
105 STI
s3 PUSH
ISNULL
NOT
s5 PUSH
ISNULL
NOT
OR
<{
-1 PUSHINT
26 CALLDICT
NEWC
0 PUSHINT
26 CALLDICT
0 PUSHINT
26 CALLDICT
s4 PUSH
ISNULL
NOT
<{
-1 PUSHINT
26 CALLDICT
s0 s4 XCHG
1 CALLDICT
s0 s4 XCHG2
STREF
}> PUSHCONT
<{
s4 POP
s0 s3 XCHG
0 PUSHINT
26 CALLDICT
}> PUSHCONT
IFELSE
s4 PUSH
ISNULL
NOT
<{
-1 PUSHINT
26 CALLDICT
s0 s4 XCHG
1 CALLDICT
s0 s4 XCHG2
STREF
}> PUSHCONT
<{
s4 POP
s0 s3 XCHG
0 PUSHINT
26 CALLDICT
}> PUSHCONT
IFELSE
0 PUSHINT
26 CALLDICT
s0 s2 XCHG
-1 PUSHINT
26 CALLDICT
s0 s2 XCHG
ENDC
ROT
STREF
}> PUSHCONT
<{
s3 POP
s3 POP
s0 s1 XCHG
0 PUSHINT
26 CALLDICT
}> PUSHCONT
IFELSE
s1 PUSH
ISNULL
NOT
<{
-1 PUSHINT
26 CALLDICT
s0 s1 XCHG
1 CALLDICT
s0 s1 XCHG
STREF
}> PUSHCONT
<{
s1 POP
0 PUSHINT
26 CALLDICT
}> PUSHCONT
IFELSE
ENDC
s0 s1 XCHG
SENDRAWMSG
32:
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
ENDC
33:
s0 s2 XCHG
CTOS
LDDICT
s0 POP
s0 PUSH
55471 PUSHINT
s0 s1 XCHG
16 PUSHINT
DICTUGETREF
NULLSWAPIFNOT
100 THROWIFNOT
PUSHNULL
s0 s2 XCHG
55471 PUSHINT
s0 s1 XCHG
16 PUSHINT
DICTUGETREF
NULLSWAPIFNOT
100 THROWIFNOT
s1 s2 XCHG
55471 PUSHINT
s0 s1 XCHG
s0 s2 XCHG
16 PUSHINT
DICTUSETREF
NEWC
STDICT
ENDC
s0 s0 s3 XCHG3
32 CALLDICT
34:
0 PUSHINT
-1 PUSHINT
s0 s4 XCHG
NEWC
STREF
s3 s3 s4 XCHG3
s4 s3 XCHG2
STGRAMS
s0 s1 XCHG
STSLICER
s2 PUSH
ISNULL
<{
s2 POP
0 PUSHINT
ROT
1 STI
}> PUSHCONT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s1 s2 XCHG
STREF
}> PUSHCONT
IFELSE
1 STI
ENDC
35:
2 GETGLOBVAR
MYADDR
ROT
33 CALLDICT
36:
35 CALLDICT
4 2 BLKDROP2
30 CALLDICT
37:
MYADDR
35 CALLDICT
s0 POP
s3 s3 s0 XCHG3
38:
s6 s1 XCPU
ADD
4 2 BLKSWAP
35 CALLDICT
2DUP
30 CALLDICT
0 PUSHINT
0 PUSHINT
64 PUSHINT
s1 PUSH
MYADDR
s1 PUSH
29 CALLDICT
s3 s5 XCHG
s4 s14 XCHG
s2 s3 XCHG
s2 s15 XCHG
NEWC
6 1 BLKSWAP
395134233 PUSHINT
s0 s7 XCHG2
32 STU
s1 s5 XCHG
64 STU
s0 s3 XCHG2
STGRAMS
s0 s1 XCHG
STSLICER
s0 s1 XCHG
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
s0 s1 XCHG
STGRAMS
s0 s1 XCHG
STSLICER
ENDC
s5 s6 s0 XCHG3
s4 s10 XCHG
s3 s9 XCHG
s0 s10 s9 XCHG3
31 CALLDICT
2SWAP
39:
1 GETGLOBVAR
4 UNTUPLE
s2 s3 XCHG
3 BLKDROP
5 1 BLKSWAP
35 CALLDICT
s0 s1 XCHG
4429 PUSHINT
s0 s2 XCHG
30 CALLDICT
s0 s6 XCHG2
SDEQ
s1 s5 XCHG
THROWANYIFNOT
1 3 BLKSWAP
40:
1 GETGLOBVAR
4 UNTUPLE
s2 s3 XCHG
3 BLKDROP
s3 PUSH
SDEQ
132 THROWIFNOT
41:
s2 s3 XCHG
3 BLKDROP
42:
1 GETGLOBVAR
4 UNTUPLE
s2 s3 XCHG
3 BLKDROP
TUCK
38 CALLDICT
43:
1 GETGLOBVAR
4 UNTUPLE
s2 s3 XCHG
3 BLKDROP
1000000000 PUSHINT
s1 PUSH
38 CALLDICT
44:
4 1 BLKSWAP
40 CALLDICT
s1 POP
s1 s3 s0 XCHG3
45:
s4 s7 XCHG
s3 s6 XCHG
s5 s7 s7 XCHG3
39 CALLDICT
s3 s4 XCHG2
SUB
s5 PUSH
ISNULL
NOT
<{
0 PUSHINT
0 PUSHINT
66 PUSHINT
s0 s7 XCHG
NEWC
s0 s1 XCHG
3576854235 PUSHINT
ROT
32 STU
64 STU
ENDC
s2 s4 XCHG
s3 s8 XCHG
s1 s7 s0 XCHG3
PUSHNULL
PUSHNULL
31 CALLDICT
s2 s3 XCHG
}> PUSHCONT
<{
s4 POP
s4 POP
}> PUSHCONT
IFELSE
s3 s0 s0 XCHG3
owner:
c4 PUSH
CTOS
LDREF
s0 s1 XCHG
2 SETGLOBVAR
LDGRAMS
LDMSGADDR
s0 s1 XCHG
PUSHNULL
s0 s2 XCHG
1 LDI
s0 s1 XCHG
<{
1 2 BLKDROP2
LDREF
s1 s2 XCHG
}> PUSHCONT
IF
1 LDI
s0 s4 XCHG
s3 s3 XCHG2
1 4 BLKDROP2
41 CALLDICT
get_wallet_address:
c4 PUSH
CTOS
LDREF
s0 s1 XCHG
2 SETGLOBVAR
LDGRAMS
LDMSGADDR
s0 s1 XCHG
PUSHNULL
s0 s2 XCHG
1 LDI
s0 s1 XCHG
<{
1 2 BLKDROP2
LDREF
s1 s2 XCHG
}> PUSHCONT
IF
1 LDI
s0 s4 XCHG
s3 s3 XCHG2
1 4 BLKDROP2
1 4 BLKSWAP
36 CALLDICT
get_jetton_data:
c4 PUSH
CTOS
LDREF
s0 s1 XCHG
2 SETGLOBVAR
LDGRAMS
LDMSGADDR
s0 s1 XCHG
PUSHNULL
s0 s2 XCHG
1 LDI
s0 s1 XCHG
<{
1 2 BLKDROP2
LDREF
s1 s2 XCHG
}> PUSHCONT
IF
1 LDI
s0 s4 XCHG
s3 s3 XCHG2
1 4 BLKDROP2
37 CALLDICT
113617:
123515602279859691144772641439386770278 PUSHINT
209801025412363888721030803524359905849 PUSHINT
258390863389042349688353801369539695109 PUSHINT
86142586315491086060343270784266291122 PUSHINT
122307:
34 CALLDICT
) 19 DICTPUSHCONST
DICTIGETJMPZ
11 THROWARG

890
sources/output/jetton_SampleJetton.ts

@ -0,0 +1,890 @@
import { Cell, Slice, StackItem, Address, Builder, InternalMessage, CommonMessageInfo, CellMessage, beginCell, serializeDict, TupleSlice4, readString, stringToCell } from 'ton';
import { ContractExecutor, createExecutorFromCode, ExecuteError } from 'ton-nodejs';
import BN from 'bn.js';
export type StateInit = {
$$type: 'StateInit';
code: Cell;
data: Cell;
}
export function packStateInit(src: StateInit): Cell {
let b_0 = new Builder();
b_0 = b_0.storeRef(src.code);
b_0 = b_0.storeRef(src.data);
return b_0.endCell();
}
export function packStackStateInit(src: StateInit, __stack: StackItem[]) {
__stack.push({ type: 'cell', cell: src.code });
__stack.push({ type: 'cell', cell: src.data });
}
export function packTupleStateInit(src: StateInit): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'cell', cell: src.code });
__stack.push({ type: 'cell', cell: src.data });
return __stack;
}
export function unpackStackStateInit(slice: TupleSlice4): StateInit {
const code = slice.readCell();
const data = slice.readCell();
return { $$type: 'StateInit', code: code, data: data };
}
export function unpackTupleStateInit(slice: TupleSlice4): StateInit {
const code = slice.readCell();
const data = slice.readCell();
return { $$type: 'StateInit', code: code, data: data };
}
export type Context = {
$$type: 'Context';
bounced: boolean;
sender: Address;
value: BN;
raw: Cell;
}
export function packContext(src: Context): Cell {
let b_0 = new Builder();
b_0 = b_0.storeBit(src.bounced);
b_0 = b_0.storeAddress(src.sender);
b_0 = b_0.storeInt(src.value, 257);
b_0 = b_0.storeRef(src.raw);
return b_0.endCell();
}
export function packStackContext(src: Context, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.bounced ? new BN(-1) : new BN(0) });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.sender).endCell() });
__stack.push({ type: 'int', value: src.value });
__stack.push({ type: 'slice', cell: src.raw });
}
export function packTupleContext(src: Context): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.bounced ? new BN(-1) : new BN(0) });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.sender).endCell() });
__stack.push({ type: 'int', value: src.value });
__stack.push({ type: 'slice', cell: src.raw });
return __stack;
}
export function unpackStackContext(slice: TupleSlice4): Context {
const bounced = slice.readBoolean();
const sender = slice.readAddress();
const value = slice.readBigNumber();
const raw = slice.readCell();
return { $$type: 'Context', bounced: bounced, sender: sender, value: value, raw: raw };
}
export function unpackTupleContext(slice: TupleSlice4): Context {
const bounced = slice.readBoolean();
const sender = slice.readAddress();
const value = slice.readBigNumber();
const raw = slice.readCell();
return { $$type: 'Context', bounced: bounced, sender: sender, value: value, raw: raw };
}
export type SendParameters = {
$$type: 'SendParameters';
bounce: boolean;
to: Address;
value: BN;
mode: BN;
body: Cell | null;
code: Cell | null;
data: Cell | null;
}
export function packSendParameters(src: SendParameters): Cell {
let b_0 = new Builder();
b_0 = b_0.storeBit(src.bounce);
b_0 = b_0.storeAddress(src.to);
b_0 = b_0.storeInt(src.value, 257);
b_0 = b_0.storeInt(src.mode, 257);
if (src.body !== null) {
b_0 = b_0.storeBit(true);
b_0 = b_0.storeRef(src.body);
} else {
b_0 = b_0.storeBit(false);
}
if (src.code !== null) {
b_0 = b_0.storeBit(true);
b_0 = b_0.storeRef(src.code);
} else {
b_0 = b_0.storeBit(false);
}
if (src.data !== null) {
b_0 = b_0.storeBit(true);
b_0 = b_0.storeRef(src.data);
} else {
b_0 = b_0.storeBit(false);
}
return b_0.endCell();
}
export function packStackSendParameters(src: SendParameters, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.bounce ? new BN(-1) : new BN(0) });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.to).endCell() });
__stack.push({ type: 'int', value: src.value });
__stack.push({ type: 'int', value: src.mode });
if (src.body !== null) {
__stack.push({ type: 'cell', cell: src.body });
} else {
__stack.push({ type: 'null' });
}
if (src.code !== null) {
__stack.push({ type: 'cell', cell: src.code });
} else {
__stack.push({ type: 'null' });
}
if (src.data !== null) {
__stack.push({ type: 'cell', cell: src.data });
} else {
__stack.push({ type: 'null' });
}
}
export function packTupleSendParameters(src: SendParameters): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.bounce ? new BN(-1) : new BN(0) });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.to).endCell() });
__stack.push({ type: 'int', value: src.value });
__stack.push({ type: 'int', value: src.mode });
if (src.body !== null) {
__stack.push({ type: 'cell', cell: src.body });
} else {
__stack.push({ type: 'null' });
}
if (src.code !== null) {
__stack.push({ type: 'cell', cell: src.code });
} else {
__stack.push({ type: 'null' });
}
if (src.data !== null) {
__stack.push({ type: 'cell', cell: src.data });
} else {
__stack.push({ type: 'null' });
}
return __stack;
}
export function unpackStackSendParameters(slice: TupleSlice4): SendParameters {
const bounce = slice.readBoolean();
const to = slice.readAddress();
const value = slice.readBigNumber();
const mode = slice.readBigNumber();
const body = slice.readCellOpt();
const code = slice.readCellOpt();
const data = slice.readCellOpt();
return { $$type: 'SendParameters', bounce: bounce, to: to, value: value, mode: mode, body: body, code: code, data: data };
}
export function unpackTupleSendParameters(slice: TupleSlice4): SendParameters {
const bounce = slice.readBoolean();
const to = slice.readAddress();
const value = slice.readBigNumber();
const mode = slice.readBigNumber();
const body = slice.readCellOpt();
const code = slice.readCellOpt();
const data = slice.readCellOpt();
return { $$type: 'SendParameters', bounce: bounce, to: to, value: value, mode: mode, body: body, code: code, data: data };
}
export type ChangeOwner = {
$$type: 'ChangeOwner';
newOwner: Address;
}
export function packChangeOwner(src: ChangeOwner): Cell {
let b_0 = new Builder();
b_0 = b_0.storeUint(3067051791, 32);
b_0 = b_0.storeAddress(src.newOwner);
return b_0.endCell();
}
export function packStackChangeOwner(src: ChangeOwner, __stack: StackItem[]) {
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.newOwner).endCell() });
}
export function packTupleChangeOwner(src: ChangeOwner): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.newOwner).endCell() });
return __stack;
}
export function unpackStackChangeOwner(slice: TupleSlice4): ChangeOwner {
const newOwner = slice.readAddress();
return { $$type: 'ChangeOwner', newOwner: newOwner };
}
export function unpackTupleChangeOwner(slice: TupleSlice4): ChangeOwner {
const newOwner = slice.readAddress();
return { $$type: 'ChangeOwner', newOwner: newOwner };
}
export type TokenTransfer = {
$$type: 'TokenTransfer';
queryId: BN;
amount: BN;
destination: Address;
responseDestination: Address | null;
customPayload: Cell | null;
forwardTonAmount: BN;
forwardPayload: Cell;
}
export function packTokenTransfer(src: TokenTransfer): Cell {
let b_0 = new Builder();
b_0 = b_0.storeUint(260734629, 32);
b_0 = b_0.storeUint(src.queryId, 64);
b_0 = b_0.storeCoins(src.amount);
b_0 = b_0.storeAddress(src.destination);
b_0 = b_0.storeAddress(src.responseDestination);
if (src.customPayload !== null) {
b_0 = b_0.storeBit(true);
b_0 = b_0.storeRef(src.customPayload);
} else {
b_0 = b_0.storeBit(false);
}
b_0 = b_0.storeCoins(src.forwardTonAmount);
b_0 = b_0.storeCellCopy(src.forwardPayload);
return b_0.endCell();
}
export function packStackTokenTransfer(src: TokenTransfer, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.queryId });
__stack.push({ type: 'int', value: src.amount });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.destination).endCell() });
if (src.responseDestination !== null) {
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseDestination).endCell() });
} else {
__stack.push({ type: 'null' });
}
if (src.customPayload !== null) {
__stack.push({ type: 'cell', cell: src.customPayload });
} else {
__stack.push({ type: 'null' });
}
__stack.push({ type: 'int', value: src.forwardTonAmount });
__stack.push({ type: 'slice', cell: src.forwardPayload });
}
export function packTupleTokenTransfer(src: TokenTransfer): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.queryId });
__stack.push({ type: 'int', value: src.amount });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.destination).endCell() });
if (src.responseDestination !== null) {
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseDestination).endCell() });
} else {
__stack.push({ type: 'null' });
}
if (src.customPayload !== null) {
__stack.push({ type: 'cell', cell: src.customPayload });
} else {
__stack.push({ type: 'null' });
}
__stack.push({ type: 'int', value: src.forwardTonAmount });
__stack.push({ type: 'slice', cell: src.forwardPayload });
return __stack;
}
export function unpackStackTokenTransfer(slice: TupleSlice4): TokenTransfer {
const queryId = slice.readBigNumber();
const amount = slice.readBigNumber();
const destination = slice.readAddress();
const responseDestination = slice.readAddressOpt();
const customPayload = slice.readCellOpt();
const forwardTonAmount = slice.readBigNumber();
const forwardPayload = slice.readCell();
return { $$type: 'TokenTransfer', queryId: queryId, amount: amount, destination: destination, responseDestination: responseDestination, customPayload: customPayload, forwardTonAmount: forwardTonAmount, forwardPayload: forwardPayload };
}
export function unpackTupleTokenTransfer(slice: TupleSlice4): TokenTransfer {
const queryId = slice.readBigNumber();
const amount = slice.readBigNumber();
const destination = slice.readAddress();
const responseDestination = slice.readAddressOpt();
const customPayload = slice.readCellOpt();
const forwardTonAmount = slice.readBigNumber();
const forwardPayload = slice.readCell();
return { $$type: 'TokenTransfer', queryId: queryId, amount: amount, destination: destination, responseDestination: responseDestination, customPayload: customPayload, forwardTonAmount: forwardTonAmount, forwardPayload: forwardPayload };
}
export type TokenTransferInternal = {
$$type: 'TokenTransferInternal';
queryId: BN;
amount: BN;
from: Address;
responseAddress: Address | null;
forwardTonAmount: BN;
forwardPayload: Cell;
}
export function packTokenTransferInternal(src: TokenTransferInternal): Cell {
let b_0 = new Builder();
b_0 = b_0.storeUint(395134233, 32);
b_0 = b_0.storeUint(src.queryId, 64);
b_0 = b_0.storeCoins(src.amount);
b_0 = b_0.storeAddress(src.from);
b_0 = b_0.storeAddress(src.responseAddress);
b_0 = b_0.storeCoins(src.forwardTonAmount);
b_0 = b_0.storeCellCopy(src.forwardPayload);
return b_0.endCell();
}
export function packStackTokenTransferInternal(src: TokenTransferInternal, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.queryId });
__stack.push({ type: 'int', value: src.amount });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.from).endCell() });
if (src.responseAddress !== null) {
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() });
} else {
__stack.push({ type: 'null' });
}
__stack.push({ type: 'int', value: src.forwardTonAmount });
__stack.push({ type: 'slice', cell: src.forwardPayload });
}
export function packTupleTokenTransferInternal(src: TokenTransferInternal): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.queryId });
__stack.push({ type: 'int', value: src.amount });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.from).endCell() });
if (src.responseAddress !== null) {
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() });
} else {
__stack.push({ type: 'null' });
}
__stack.push({ type: 'int', value: src.forwardTonAmount });
__stack.push({ type: 'slice', cell: src.forwardPayload });
return __stack;
}
export function unpackStackTokenTransferInternal(slice: TupleSlice4): TokenTransferInternal {
const queryId = slice.readBigNumber();
const amount = slice.readBigNumber();
const from = slice.readAddress();
const responseAddress = slice.readAddressOpt();
const forwardTonAmount = slice.readBigNumber();
const forwardPayload = slice.readCell();
return { $$type: 'TokenTransferInternal', queryId: queryId, amount: amount, from: from, responseAddress: responseAddress, forwardTonAmount: forwardTonAmount, forwardPayload: forwardPayload };
}
export function unpackTupleTokenTransferInternal(slice: TupleSlice4): TokenTransferInternal {
const queryId = slice.readBigNumber();
const amount = slice.readBigNumber();
const from = slice.readAddress();
const responseAddress = slice.readAddressOpt();
const forwardTonAmount = slice.readBigNumber();
const forwardPayload = slice.readCell();
return { $$type: 'TokenTransferInternal', queryId: queryId, amount: amount, from: from, responseAddress: responseAddress, forwardTonAmount: forwardTonAmount, forwardPayload: forwardPayload };
}
export type TokenNotification = {
$$type: 'TokenNotification';
queryId: BN;
amount: BN;
from: Address;
forwardPayload: Cell;
}
export function packTokenNotification(src: TokenNotification): Cell {
let b_0 = new Builder();
b_0 = b_0.storeUint(1935855772, 32);
b_0 = b_0.storeUint(src.queryId, 64);
b_0 = b_0.storeCoins(src.amount);
b_0 = b_0.storeAddress(src.from);
b_0 = b_0.storeCellCopy(src.forwardPayload);
return b_0.endCell();
}
export function packStackTokenNotification(src: TokenNotification, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.queryId });
__stack.push({ type: 'int', value: src.amount });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.from).endCell() });
__stack.push({ type: 'slice', cell: src.forwardPayload });
}
export function packTupleTokenNotification(src: TokenNotification): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.queryId });
__stack.push({ type: 'int', value: src.amount });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.from).endCell() });
__stack.push({ type: 'slice', cell: src.forwardPayload });
return __stack;
}
export function unpackStackTokenNotification(slice: TupleSlice4): TokenNotification {
const queryId = slice.readBigNumber();
const amount = slice.readBigNumber();
const from = slice.readAddress();
const forwardPayload = slice.readCell();
return { $$type: 'TokenNotification', queryId: queryId, amount: amount, from: from, forwardPayload: forwardPayload };
}
export function unpackTupleTokenNotification(slice: TupleSlice4): TokenNotification {
const queryId = slice.readBigNumber();
const amount = slice.readBigNumber();
const from = slice.readAddress();
const forwardPayload = slice.readCell();
return { $$type: 'TokenNotification', queryId: queryId, amount: amount, from: from, forwardPayload: forwardPayload };
}
export type TokenBurn = {
$$type: 'TokenBurn';
queryId: BN;
amount: BN;
owner: Address;
responseAddress: Address | null;
}
export function packTokenBurn(src: TokenBurn): Cell {
let b_0 = new Builder();
b_0 = b_0.storeUint(1499400124, 32);
b_0 = b_0.storeUint(src.queryId, 64);
b_0 = b_0.storeCoins(src.amount);
b_0 = b_0.storeAddress(src.owner);
b_0 = b_0.storeAddress(src.responseAddress);
return b_0.endCell();
}
export function packStackTokenBurn(src: TokenBurn, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.queryId });
__stack.push({ type: 'int', value: src.amount });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() });
if (src.responseAddress !== null) {
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() });
} else {
__stack.push({ type: 'null' });
}
}
export function packTupleTokenBurn(src: TokenBurn): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.queryId });
__stack.push({ type: 'int', value: src.amount });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() });
if (src.responseAddress !== null) {
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() });
} else {
__stack.push({ type: 'null' });
}
return __stack;
}
export function unpackStackTokenBurn(slice: TupleSlice4): TokenBurn {
const queryId = slice.readBigNumber();
const amount = slice.readBigNumber();
const owner = slice.readAddress();
const responseAddress = slice.readAddressOpt();
return { $$type: 'TokenBurn', queryId: queryId, amount: amount, owner: owner, responseAddress: responseAddress };
}
export function unpackTupleTokenBurn(slice: TupleSlice4): TokenBurn {
const queryId = slice.readBigNumber();
const amount = slice.readBigNumber();
const owner = slice.readAddress();
const responseAddress = slice.readAddressOpt();
return { $$type: 'TokenBurn', queryId: queryId, amount: amount, owner: owner, responseAddress: responseAddress };
}
export type TokenBurnNotification = {
$$type: 'TokenBurnNotification';
queryId: BN;
amount: BN;
owner: Address;
responseAddress: Address | null;
}
export function packTokenBurnNotification(src: TokenBurnNotification): Cell {
let b_0 = new Builder();
b_0 = b_0.storeUint(2078119902, 32);
b_0 = b_0.storeUint(src.queryId, 64);
b_0 = b_0.storeCoins(src.amount);
b_0 = b_0.storeAddress(src.owner);
b_0 = b_0.storeAddress(src.responseAddress);
return b_0.endCell();
}
export function packStackTokenBurnNotification(src: TokenBurnNotification, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.queryId });
__stack.push({ type: 'int', value: src.amount });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() });
if (src.responseAddress !== null) {
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() });
} else {
__stack.push({ type: 'null' });
}
}
export function packTupleTokenBurnNotification(src: TokenBurnNotification): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.queryId });
__stack.push({ type: 'int', value: src.amount });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() });
if (src.responseAddress !== null) {
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.responseAddress).endCell() });
} else {
__stack.push({ type: 'null' });
}
return __stack;
}
export function unpackStackTokenBurnNotification(slice: TupleSlice4): TokenBurnNotification {
const queryId = slice.readBigNumber();
const amount = slice.readBigNumber();
const owner = slice.readAddress();
const responseAddress = slice.readAddressOpt();
return { $$type: 'TokenBurnNotification', queryId: queryId, amount: amount, owner: owner, responseAddress: responseAddress };
}
export function unpackTupleTokenBurnNotification(slice: TupleSlice4): TokenBurnNotification {
const queryId = slice.readBigNumber();
const amount = slice.readBigNumber();
const owner = slice.readAddress();
const responseAddress = slice.readAddressOpt();
return { $$type: 'TokenBurnNotification', queryId: queryId, amount: amount, owner: owner, responseAddress: responseAddress };
}
export type TokenExcesses = {
$$type: 'TokenExcesses';
queryId: BN;
}
export function packTokenExcesses(src: TokenExcesses): Cell {
let b_0 = new Builder();
b_0 = b_0.storeUint(3576854235, 32);
b_0 = b_0.storeUint(src.queryId, 64);
return b_0.endCell();
}
export function packStackTokenExcesses(src: TokenExcesses, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.queryId });
}
export function packTupleTokenExcesses(src: TokenExcesses): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.queryId });
return __stack;
}
export function unpackStackTokenExcesses(slice: TupleSlice4): TokenExcesses {
const queryId = slice.readBigNumber();
return { $$type: 'TokenExcesses', queryId: queryId };
}
export function unpackTupleTokenExcesses(slice: TupleSlice4): TokenExcesses {
const queryId = slice.readBigNumber();
return { $$type: 'TokenExcesses', queryId: queryId };
}
export type TokenUpdateContent = {
$$type: 'TokenUpdateContent';
content: Cell | null;
}
export function packTokenUpdateContent(src: TokenUpdateContent): Cell {
let b_0 = new Builder();
b_0 = b_0.storeUint(1862840892, 32);
if (src.content !== null) {
b_0 = b_0.storeBit(true);
b_0 = b_0.storeRef(src.content);
} else {
b_0 = b_0.storeBit(false);
}
return b_0.endCell();
}
export function packStackTokenUpdateContent(src: TokenUpdateContent, __stack: StackItem[]) {
if (src.content !== null) {
__stack.push({ type: 'cell', cell: src.content });
} else {
__stack.push({ type: 'null' });
}
}
export function packTupleTokenUpdateContent(src: TokenUpdateContent): StackItem[] {
let __stack: StackItem[] = [];
if (src.content !== null) {
__stack.push({ type: 'cell', cell: src.content });
} else {
__stack.push({ type: 'null' });
}
return __stack;
}
export function unpackStackTokenUpdateContent(slice: TupleSlice4): TokenUpdateContent {
const content = slice.readCellOpt();
return { $$type: 'TokenUpdateContent', content: content };
}
export function unpackTupleTokenUpdateContent(slice: TupleSlice4): TokenUpdateContent {
const content = slice.readCellOpt();
return { $$type: 'TokenUpdateContent', content: content };
}
export type JettonData = {
$$type: 'JettonData';
totalSupply: BN;
mintable: boolean;
owner: Address;
content: Cell | null;
walletCode: Cell;
}
export function packJettonData(src: JettonData): Cell {
let b_0 = new Builder();
b_0 = b_0.storeInt(src.totalSupply, 257);
b_0 = b_0.storeBit(src.mintable);
b_0 = b_0.storeAddress(src.owner);
if (src.content !== null) {
b_0 = b_0.storeBit(true);
b_0 = b_0.storeRef(src.content);
} else {
b_0 = b_0.storeBit(false);
}
b_0 = b_0.storeRef(src.walletCode);
return b_0.endCell();
}
export function packStackJettonData(src: JettonData, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.totalSupply });
__stack.push({ type: 'int', value: src.mintable ? new BN(-1) : new BN(0) });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() });
if (src.content !== null) {
__stack.push({ type: 'cell', cell: src.content });
} else {
__stack.push({ type: 'null' });
}
__stack.push({ type: 'cell', cell: src.walletCode });
}
export function packTupleJettonData(src: JettonData): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.totalSupply });
__stack.push({ type: 'int', value: src.mintable ? new BN(-1) : new BN(0) });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() });
if (src.content !== null) {
__stack.push({ type: 'cell', cell: src.content });
} else {
__stack.push({ type: 'null' });
}
__stack.push({ type: 'cell', cell: src.walletCode });
return __stack;
}
export function unpackStackJettonData(slice: TupleSlice4): JettonData {
const totalSupply = slice.readBigNumber();
const mintable = slice.readBoolean();
const owner = slice.readAddress();
const content = slice.readCellOpt();
const walletCode = slice.readCell();
return { $$type: 'JettonData', totalSupply: totalSupply, mintable: mintable, owner: owner, content: content, walletCode: walletCode };
}
export function unpackTupleJettonData(slice: TupleSlice4): JettonData {
const totalSupply = slice.readBigNumber();
const mintable = slice.readBoolean();
const owner = slice.readAddress();
const content = slice.readCellOpt();
const walletCode = slice.readCell();
return { $$type: 'JettonData', totalSupply: totalSupply, mintable: mintable, owner: owner, content: content, walletCode: walletCode };
}
export type JettonWalletData = {
$$type: 'JettonWalletData';
balance: BN;
owner: Address;
master: Address;
walletCode: Cell;
}
export function packJettonWalletData(src: JettonWalletData): Cell {
let b_0 = new Builder();
b_0 = b_0.storeInt(src.balance, 257);
b_0 = b_0.storeAddress(src.owner);
b_0 = b_0.storeAddress(src.master);
b_0 = b_0.storeRef(src.walletCode);
return b_0.endCell();
}
export function packStackJettonWalletData(src: JettonWalletData, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.balance });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.master).endCell() });
__stack.push({ type: 'cell', cell: src.walletCode });
}
export function packTupleJettonWalletData(src: JettonWalletData): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.balance });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.owner).endCell() });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(src.master).endCell() });
__stack.push({ type: 'cell', cell: src.walletCode });
return __stack;
}
export function unpackStackJettonWalletData(slice: TupleSlice4): JettonWalletData {
const balance = slice.readBigNumber();
const owner = slice.readAddress();
const master = slice.readAddress();
const walletCode = slice.readCell();
return { $$type: 'JettonWalletData', balance: balance, owner: owner, master: master, walletCode: walletCode };
}
export function unpackTupleJettonWalletData(slice: TupleSlice4): JettonWalletData {
const balance = slice.readBigNumber();
const owner = slice.readAddress();
const master = slice.readAddress();
const walletCode = slice.readCell();
return { $$type: 'JettonWalletData', balance: balance, owner: owner, master: master, walletCode: walletCode };
}
export type Mint = {
$$type: 'Mint';
amount: BN;
}
export function packMint(src: Mint): Cell {
let b_0 = new Builder();
b_0 = b_0.storeUint(2737462367, 32);
b_0 = b_0.storeInt(src.amount, 257);
return b_0.endCell();
}
export function packStackMint(src: Mint, __stack: StackItem[]) {
__stack.push({ type: 'int', value: src.amount });
}
export function packTupleMint(src: Mint): StackItem[] {
let __stack: StackItem[] = [];
__stack.push({ type: 'int', value: src.amount });
return __stack;
}
export function unpackStackMint(slice: TupleSlice4): Mint {
const amount = slice.readBigNumber();
return { $$type: 'Mint', amount: amount };
}
export function unpackTupleMint(slice: TupleSlice4): Mint {
const amount = slice.readBigNumber();
return { $$type: 'Mint', amount: amount };
}
export async function SampleJetton_init(owner: Address, content: Cell | null) {
const __code = 'te6ccgECPQEABbEAART/APSkE/S88sgLAQIBYgIDAgLKBAUCASA1NgIBIAYHAgFIGxwCASAICQIBWBARAgHUCgsAR95DgA5YC5gOWAuADlgAlmZmT8gGQ5AOWAuADlgAllA+X/5OhASXO37cCHXScIflTAg1wsf3gLQ0wMBcbDAAZF/kXDiAfpAIlBmbwT4YQKRW+AgghCjKlxfuuMCIIIQbwiyPLrjAiCCEHvdl9664wLAAIAwNDg8ACwgbvLQgIAC6MO1E0NQB+GL6APpAAW0C0gABlGwS1BLe0gAEUDNsFATTHwGCEKMqXF+68uCBgQEB1wABMRA0QTDwKsj4QgHMVTBQQ/oCAc8WIm6VMnBYygCWfwHKABLM4soAye1UAMIw7UTQ1AH4YvoA+kABbQLSAAGUbBLUEt7SAARQM2wUBNMfAYIQbwiyPLry4IFtAdIAAZIx1N4BMRA0QTDwLMj4QgHMVTBQQ/oCAc8WIm6VMnBYygCWfwHKABLM4soAye1UAOgw7UTQ1AH4YvoA+kABbQLSAAGUbBLUEt7SAARQM2wUBNMfAYIQe92X3rry4IHTP/oA+kABAfpAIdcLAcMAkQGSMW3iFEMwNBBnEFYQRVUC8C3I+EIBzFUwUEP6AgHPFiJulTJwWMoAln8BygASzOLKAMntVADqjm35AYLwzQ2YbLGi9GiucIn0/DFiwRbl9T+9EaaDn1Lb9QQIMLK6jkXtRNDUAfhi+gD6QAFtAtIAAZRsEtQS3tIABFAzbBTwK8j4QgHMVTBQQ/oCAc8WIm6VMnBYygCWfwHKABLM4soAye1U2zHgkTDi8sCCAgFYEhMCASAUFQAVJR/AcoA4HABygCAABTIyYAIBIBYXAgEgGBkAAzQgAAk8BvwHIAAJHBZ8AiAB9zIcQHKAVAH8BpwAcoCUAXPFlAD+gJwAcpoI26zJW6zsY49f/AayHDwGnDwGiRus5l/8BoE8AFQBMyVNANw8BriJG6zmX/wGgTwAVAEzJU0A3DwGuJw8BoCf/AaAslYzJYzMwFw8BriIW6zmH/wGgHwAQHMlDFw8BriyQGAaAAT7AAIBIB0eAgEgKywCASAfIAIBICUmAgEgISICASAjJAApHADyMxDE1AjgQEBzwABzxYBzxbJgAG8AtD0BDAgggDYrwGAEPQPb6Hy4GRtAoIA2K8BgBD0D2+h8uBkEoIA2K8BAoAQ9BfI9ADJQAPwIIABDHB/BMjMQzRQQ/oCAc8WIm6VMnBYygCWfwHKABLM4soAyYAAPPhC+ChY8CGACASAnKAIBICkqAA08CNsQvAegAA8+CjwIzBDMIAClFFhoFUx8CNc8B5wcIBAIfgoIfAdEDUQThAjEC/IVVCCEBeNRRlQB8sfFcs/UAP6AgHPFgEgbpUwcAHLAZLPFuIB+gIBzxbJRWAQShA5QKnwH1qAAOT4QW8kECNfA1VA8CMBgRFNAvAeUAbHBRXy9FUCgAgEgLS4CAUgzNAIBIC8wAgEgMTIAHT4QW8kECNfAyPHBfLghIAAJBAjXwOAAFz4QW8kECNfA2bwJoAAjPhBbyQQI18DghA7msoAIfAmgAA8VTDwKDFBMIABrBBHEDZFd/AnUDShJW6zjh9wcIBCB8gBghDVMnbbWMsfyz/JECQQOEFwbW3wHxAjkjQ04kMAgAEW+KO9qJoagD8MX0AfSAAtoFpAADKNglqCW9pAAIoGbYKeBTAIBIDc4AgEgOToACbncPwIoAgFYOzwAlbd6ME4LnYerpZXPY9CdhzrJUKNs0E4TusalpWyPlmRadeW/vixHME4YTIikya+3yRcvbDO06rpAsE4IGc6tPOK/OkoWA6wtxMj2UABJrbz2omhqAPwxfQB9IAC2gWkAAMo2CWoJb2kAAigZtgoqgfgSQABFrxb2omhqAPwxfQB9IAC2gWkAAMo2CWoJb2kAAigZtgp4EsA=';
const depends = new Map<string, Cell>();
depends.set('55471', Cell.fromBoc(Buffer.from('te6ccgECKQEABYcAART/APSkE/S88sgLAQIBYgIDAgLKBAUCASAlJgIBIAYHAgFIEhMCASAICQIB7hARAgFICgsAR7OQ4AOWAuYDlgLgA5YAJZmZk/IBkOQDlgLgA5YAJZQPl/+ToQT1RwIddJwh+VMCDXCx/eAtDTAwFxsMABkX+RcOIB+kAiUGZvBPhhAo4zMO1E0NQB+GKBAQHXAPpAAQH6QAFDMGwTVQLwKMj4QgHMVSBQI4EBAc8AAc8WAc8Wye1U4CCCEA+KfqW64wIgghAXjUUZuuMCghBZXwe8uuMCMIDA0ODwALQgbvLQgIAN4w7UTQ1AH4YoEBAdcA+kABAfpAAUMwbBMD0x8BghAPin6luvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeJtAtIAAZRsEtQS3voAUWYWFURANxCJEHhVBfAlyPhCAcxVIFAjgQEBzwABzxYBzxbJ7VQAyjDtRNDUAfhigQEB1wD6QAEB+kABQzBsEwPTHwGCEBeNRRm68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4gH6AFFVFRRDMDYQeBBnVQTwJsj4QgHMVSBQI4EBAc8AAc8WAc8Wye1UALztRNDUAfhigQEB1wD6QAEB+kABQzBsEwPTHwGCEFlfB7y68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4hRDMDQQVhBFVQLwJ8j4QgHMVSBQI4EBAc8AAc8WAc8Wye1UAAbywIIAFSUfwHKAOBwAcoAgAAkcFnwCYAIBIBQVAE/cAQa5Dpj+mfmP0AGECaqRFBCAvGoozdAcEIPe7L710J2Il5egnQAUAgEgFhcCASAdHgIBIBgZAgEgGxwB9zIcQHKAVAH8B5wAcoCUAXPFlAD+gJwAcpoI26zJW6zsY49f/AeyHDwHnDwHiRus5l/8B4E8AJQBMyVNANw8B7iJG6zmX/wHgTwAlAEzJU0A3DwHuJw8B4Cf/AeAslYzJYzMwFw8B7iIW6zmH/wHgHwAgHMlDFw8B7iyQGAaACUbDH6ADFx1yH6ADH6ADCnA6sAgAAT7AAApHADyMxDE1AjgQEBzwABzxYBzxbJgAG8AtD0BDAgggDYrwGAEPQPb6Hy4GRtAoIA2K8BgBD0D2+h8uBkEoIA2K8BAoAQ9BfI9ADJQAPwIoAIBIB8gAgEgIiMADz4QlMS8CMwgAacbCL4QW8kgRFNUzvHBfL0UbehggD1/CHC//L0QzBSPPAhcSTCAJIwct6BPrsCqIIJMS0AoIIImJaAoBK88vT4QlQgZPAjXPAff1B2cIBAK1RMORiAhAGTIVVCCEBeNRRlQB8sfFcs/UAP6AgHPFgEgbpUwcAHLAZLPFuIB+gIBzxbJEFYQNFnwIAHvPhBbyRTKscFs44S+EJTuPAjAYERTQLwHyTHBfL03lHIoIIA9fwhwv/y9CH4J28QIaGCCJiWgGa2CKGCCJiWgKChJsIAlhB9UIlfCOMNJW6zIsIAsI4dcAbwAnAEyAGCENUydttYyx/LP8kQR0MwF21t8CCSNVvigJADTFv4QW8kgRFNUzjHBfL0UYShggD1/CHC//L0QzBSOfAhgT67AYIJMS0AoIIImJaAoBK88vR/cAOAQFQzZshVMIIQe92X3lAFyx8Tyz8B+gIBzxYBIG6VMHABywGSzxbiyVQTBFAzbW3wIIAByUE1DMPAhUjCgGqFwcChIE1B0yFUwghBzYtCcUAXLHxPLPwH6AgHPFgHPFskoEEZDE1BVbW3wIFAFADe/2BdqJoagD8MUCAgOuAfSAAgP0gAKGYNgn4EkAgJzJygACazx+BFAAHGt6ME4LnYerpZXPY9CdhzrJUKNs0E4TusalpWyPlmRadeW/vixHME4TujwAfLZsB5P5B1ZLNZRCcA=', 'base64'))[0]);
let systemCell = beginCell().storeDict(serializeDict(depends, 16, (src, v) => v.refs.push(src))).endCell();
let __stack: StackItem[] = [];
__stack.push({ type: 'cell', cell: systemCell });
__stack.push({ type: 'slice', cell: beginCell().storeAddress(owner).endCell() });
if (content !== null) {
__stack.push({ type: 'cell', cell: content });
} else {
__stack.push({ type: 'null' });
}
let codeCell = Cell.fromBoc(Buffer.from(__code, 'base64'))[0];
let executor = await createExecutorFromCode({ code: codeCell, data: new Cell() });
let res = await executor.get('init_SampleJetton', __stack, { debug: true });
if (res.debugLogs.length > 0) { console.warn(res.debugLogs); }
let data = res.stack.readCell();
return { code: codeCell, data };
}
export const SampleJetton_errors: { [key: string]: string } = {
'2': `Stack undeflow`,
'3': `Stack overflow`,
'4': `Integer overflow`,
'5': `Integer out of expected range`,
'6': `Invalid opcode`,
'7': `Type check error`,
'8': `Cell overflow`,
'9': `Cell underflow`,
'10': `Dictionary error`,
'13': `Out of gas error`,
'32': `Method ID not found`,
'34': `Action is invalid or not supported`,
'37': `Not enough TON`,
'38': `Not enough extra-currencies`,
'128': `Null reference exception`,
'129': `Invalid serialization prefix`,
'130': `Invalid incoming message`,
'131': `Constraints error`,
'132': `Access denied`,
'133': `Contract stopped`,
'134': `Invalid argument`,
'4429': `Invalid sender`,
'13650': `Invalid bounced message`,
'16059': `Invalid value`,
'62972': `Invalid balance`,
}
export class SampleJetton {
readonly executor: ContractExecutor;
constructor(executor: ContractExecutor) { this.executor = executor; }
async send(args: { amount: BN, from?: Address, debug?: boolean }, message: Mint | 'Mint!' | TokenUpdateContent | TokenBurnNotification) {
let body: Cell | null = null;
if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'Mint') {
body = packMint(message);
}
if (message === 'Mint!') {
body = beginCell().storeUint(0, 32).storeBuffer(Buffer.from(message)).endCell();
}
if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'TokenUpdateContent') {
body = packTokenUpdateContent(message);
}
if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'TokenBurnNotification') {
body = packTokenBurnNotification(message);
}
if (body === null) { throw new Error('Invalid message type'); }
try {
let r = await this.executor.internal(new InternalMessage({
to: this.executor.address,
from: args.from || this.executor.address,
bounce: false,
value: args.amount,
body: new CommonMessageInfo({
body: new CellMessage(body!)
})
}), { debug: args.debug });
if (r.debugLogs.length > 0) { console.warn(r.debugLogs); }
} catch (e) {
if (e instanceof ExecuteError) {
if (e.debugLogs.length > 0) { console.warn(e.debugLogs); }
if (SampleJetton_errors[e.exitCode.toString()]) {
throw new Error(SampleJetton_errors[e.exitCode.toString()]);
}
}
throw e;
}
}
async getGetWalletAddress(owner: Address) {
try {
let __stack: StackItem[] = [];
__stack.push({ type: 'slice', cell: beginCell().storeAddress(owner).endCell() });
let result = await this.executor.get('get_wallet_address', __stack, { debug: true });
if (result.debugLogs.length > 0) { console.warn(result.debugLogs); }
return result.stack.readAddress();
} catch (e) {
if (e instanceof ExecuteError) {
if (e.debugLogs.length > 0) { console.warn(e.debugLogs); }
if (SampleJetton_errors[e.exitCode.toString()]) {
throw new Error(SampleJetton_errors[e.exitCode.toString()]);
}
}
throw e;
}
}
async getGetJettonData() {
try {
let __stack: StackItem[] = [];
let result = await this.executor.get('get_jetton_data', __stack, { debug: true });
if (result.debugLogs.length > 0) { console.warn(result.debugLogs); }
return unpackStackJettonData(result.stack);
} catch (e) {
if (e instanceof ExecuteError) {
if (e.debugLogs.length > 0) { console.warn(e.debugLogs); }
if (SampleJetton_errors[e.exitCode.toString()]) {
throw new Error(SampleJetton_errors[e.exitCode.toString()]);
}
}
throw e;
}
}
async getOwner() {
try {
let __stack: StackItem[] = [];
let result = await this.executor.get('owner', __stack, { debug: true });
if (result.debugLogs.length > 0) { console.warn(result.debugLogs); }
return result.stack.readAddress();
} catch (e) {
if (e instanceof ExecuteError) {
if (e.debugLogs.length > 0) { console.warn(e.debugLogs); }
if (SampleJetton_errors[e.exitCode.toString()]) {
throw new Error(SampleJetton_errors[e.exitCode.toString()]);
}
}
throw e;
}
}
}

48
sources/utils/print.ts

@ -0,0 +1,48 @@
import { Address, Cell, contractAddress, StateInit } from "ton";
import BN from 'bn.js';
import qs from 'qs';
export function printSeparator() {
console.log("========================================================================================");
}
export function printHeader(name: string) {
printSeparator();
console.log('Contract: ' + name);
printSeparator();
}
export function printAddress(address: Address, testnet: boolean = true) {
console.log("Address: " + address.toFriendly({ testOnly: testnet }));
console.log("Explorer: " + "https://" + (testnet ? 'testnet.' : '') + "tonwhales.com/explorer/address/" + address.toFriendly({ testOnly: testnet }));
printSeparator();
}
export function printDeploy(init: { code: Cell, data: Cell }, amount: BN, command: Cell | string, testnet: boolean = true) {
// Resolve target address
let to = contractAddress({ workchain: 0, initialCode: init.code, initialData: init.data });
// Resovle init
let cell = new Cell();
new StateInit(init).writeTo(cell);
let initStr = cell.toBoc({ idx: false }).toString("base64");
let link: string;
if (typeof command === 'string') {
link = `https://${testnet ? 'test.' : ''}tonhub.com/transfer/` + to.toFriendly({ testOnly: testnet }) + "?" + qs.stringify({
text: command,
amount: amount.toString(10),
init: initStr
});
} else {
link = `https://${testnet ? 'test.' : ''}tonhub.com/transfer/` + to.toFriendly({ testOnly: testnet }) + "?" + qs.stringify({
text: "Deploy contract",
amount: amount.toString(10),
init: initStr,
bin: command.toBoc({ idx: false }).toString('base64'),
});
}
console.log("Deploy: " + link);
printSeparator();
}

11
sources/utils/randomAddress.ts

@ -0,0 +1,11 @@
import Prando from "prando";
import { Address } from "ton";
export function randomAddress(workchain: number, seed: string) {
const random = new Prando(seed);
const hash = Buffer.alloc(32);
for (let i = 0; i < hash.length; i++) {
hash[i] = random.nextInt(0, 255);
}
return new Address(workchain, hash);
}

7
tact.config.json

@ -0,0 +1,7 @@
{
"projects": [{
"name": "jetton",
"path": "./sources/jetton.tact",
"output": "./sources/output"
}]
}

69
tsconfig.json

@ -0,0 +1,69 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "esnext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */
"declaration": true, /* Generates corresponding '.d.ts' file. */
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "./dist", /* Redirect output structure to the directory. */
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
// "removeComments": true, /* Do not emit comments to output. */
// "noEmit": false, /* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
"downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
/* Strict Type-Checking Options */
"strict": true, /* Enable all strict type-checking options. */
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* Enable strict null checks. */
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
/* Additional Checks */
// "noUnusedLocals": true, /* Report errors on unused locals. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an 'override' modifier. */
// "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */
/* Module Resolution Options */
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
"allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
/* Source Map Options */
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
/* Experimental Options */
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
/* Advanced Options */
"skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */,
"resolveJsonModule": true
},
"include": [
"src/**/*"
]
}

3133
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save