Browse Source

Deposit works (with tests)

master
Lev 2 years ago
parent
commit
e928702613
  1. 5
      package.json
  2. 2
      sources/jetton.deploy.ts
  3. 14
      sources/jetton.tact
  4. 151
      sources/jetton_trait.tact
  5. 1
      sources/output/jetton_Linker.abi
  6. BIN
      sources/output/jetton_Linker.code.boc
  7. 133
      sources/output/jetton_Linker.code.fc
  8. 185
      sources/output/jetton_Linker.code.fif
  9. 179
      sources/output/jetton_Linker.code.rev.fif
  10. BIN
      sources/output/jetton_Linker.init.boc
  11. 55
      sources/output/jetton_Linker.init.fc
  12. 69
      sources/output/jetton_Linker.init.fif
  13. 58
      sources/output/jetton_Linker.init.rev.fif
  14. 81
      sources/output/jetton_Linker.md
  15. 1
      sources/output/jetton_Linker.pkg
  16. 1024
      sources/output/jetton_Linker.ts
  17. 1
      sources/output/jetton_TONB.abi
  18. BIN
      sources/output/jetton_TONB.code.boc
  19. 489
      sources/output/jetton_TONB.code.fc
  20. 819
      sources/output/jetton_TONB.code.fif
  21. 1653
      sources/output/jetton_TONB.code.rev.fif
  22. BIN
      sources/output/jetton_TONB.init.boc
  23. 54
      sources/output/jetton_TONB.init.fc
  24. 88
      sources/output/jetton_TONB.init.fif
  25. 96
      sources/output/jetton_TONB.init.rev.fif
  26. 88
      sources/output/jetton_TONB.md
  27. 1
      sources/output/jetton_TONB.pkg
  28. 1058
      sources/output/jetton_TONB.ts
  29. 1
      sources/output/jetton_TONBWallet.abi
  30. BIN
      sources/output/jetton_TONBWallet.code.boc
  31. 437
      sources/output/jetton_TONBWallet.code.fc
  32. 774
      sources/output/jetton_TONBWallet.code.fif
  33. 860
      sources/output/jetton_TONBWallet.code.rev.fif
  34. BIN
      sources/output/jetton_TONBWallet.init.boc
  35. 37
      sources/output/jetton_TONBWallet.init.fc
  36. 40
      sources/output/jetton_TONBWallet.init.fif
  37. 26
      sources/output/jetton_TONBWallet.init.rev.fif
  38. 83
      sources/output/jetton_TONBWallet.md
  39. 1
      sources/output/jetton_TONBWallet.pkg
  40. 1037
      sources/output/jetton_TONBWallet.ts
  41. 31
      sources/staking.tact
  42. 66
      sources/tests/__snapshots__/jetton.spec.ts.snap
  43. 25
      sources/tests/jetton.spec.ts
  44. 9
      sources/tests/scenario.ts
  45. 49
      sources/utils/interactions.ts
  46. 2
      sources/utils/rmlogs.sh
  47. 26
      yarn.lock

5
package.json

@ -6,15 +6,18 @@
"author": "Alex Golev <flexorise@gmail.com>",
"license": "MIT",
"scripts": {
"build": "tact --config tact.config.json",
"build": "tact --config tact.config.json && sources/utils/rmlogs.sh",
"test": "jest",
"deploy": "ts-node sources/jetton.deploy.ts"
},
"dependencies": {
"@aws-crypto/sha256-js": "^3.0.0",
"@types/bn.js": "^5.1.1",
"@types/jest": "^29.2.4",
"@types/node": "^18.11.14",
"@types/qs": "^6.9.7",
"bigint-buffer": "^1.1.5",
"bn.js": "^5.2.0",
"build": "^0.1.4",
"jest": "^29.3.1",
"prando": "^6.0.1",

2
sources/jetton.deploy.ts

@ -20,7 +20,7 @@ import {client, wallet_data, workchain, owner, jettonParams, default_content} fr
let destination_address = contractAddress(workchain, init);
let deployAmount = toNano('0.5');
let deployAmount = toNano('0.2');
let supply = 500;
let amount = BigInt(supply * Math.pow(10, 9));

14
sources/jetton.tact

@ -3,21 +3,16 @@ import "./messages";
import "./wallet";
import "./linker";
import "./jetton_trait";
import "./staking";
message Deposit {
amount: Int;
amount: Int as coins;
}
message Withdraw {
amount: Int;
}
struct WithdrawalRequests {
addresses: map[Int]Address;
amounts: map[Int]Int;
n_requests: Int;
}
const gas_consumption: Int = ton("0.01");
const withdraw_gas_consumption: Int = ton("0.05");
@ -25,7 +20,7 @@ const deposit_gas_consumption: Int = ton("0.05");
contract TONB with Jetton {
contract TONB with TONBTrait {
totalSupply: Int as coins;
owner: Address;
@ -34,6 +29,7 @@ contract TONB with Jetton {
first_linker: Address?;
last_linker: Address?;
n_linkers: Int = 0;
staking_pool: Address?;
init(owner: Address, content: Cell?) {
self.totalSupply = 0;
@ -48,6 +44,8 @@ contract TONB with Jetton {
self.mint(ctx.sender, msg.amount, ctx.sender);
}
receive() {}
receive(msg: Withdraw) {
let ctx: Context = context();
require(ctx.value >= withdraw_gas_consumption, "not enough money for withdraw");

151
sources/jetton_trait.tact

@ -0,0 +1,151 @@
import "@stdlib/ownable";
import "./wallet";
import "./linker";
@interface("org.ton.jetton.master")
trait TONBTrait with Ownable {
//
// Storage
//
totalSupply: Int;
mintable: Bool;
owner: Address;
content: Cell?;
first_linker: Address?;
last_linker: Address?;
n_linkers: Int = 0;
//
// Receivers
//
receive(msg: TokenUpdateContent) {
// Allow changing content only by owner
self.requireOwner();
// Update content
self.content = msg.content;
}
receive(msg: TokenBurnNotification) {
// Check wallet
self.requireWallet(msg.owner);
// Update supply
self.totalSupply = self.totalSupply - msg.amount;
// Cashback
if (msg.responseAddress != null) {
send(SendParameters{
to: msg.responseAddress!!,
value: 0,
bounce: false,
mode: SendRemainingValue + SendIgnoreErrors,
body: TokenExcesses{
queryId: msg.queryId
}.toCell()
});
}
}
//
// Get Methods
//
get fun get_wallet_address(owner: Address): Address {
let winit: StateInit = self.getJettonWalletInit(owner);
return contractAddress(winit);
}
get fun get_jetton_data(): JettonData {
let code: Cell = self.getJettonWalletInit(myAddress()).code;
return JettonData{
totalSupply: self.totalSupply,
mintable: self.mintable,
owner: self.owner,
content: self.content,
walletCode: code
};
}
//
// Private Methods
//
fun mint(to: Address, amount: Int, responseAddress: Address?) {
// Update total supply
self.totalSupply = self.totalSupply + amount;
// Create message
let winit: StateInit = self.getJettonWalletInit(to);
let walletAddress: Address = contractAddress(winit);
// let linker_init: StateInit = initOf Linker(self.n_linkers, walletAddress);
// let linker_address: Address = contractAddress(linker_init);
// send(SendParameters{
// to: linker_address,
// value: 0,
// bounce: false,
// body: SetLinkerNeighbor{
// neighbor: self.last_linker
// }.toCell(),
// code: linker_init.code,
// data: linker_init.data
// });
send(SendParameters{
to: walletAddress,
value: ton("0.2"),
bounce: false,
body: TokenTransferInternal{
amount: amount,
queryId: 0,
from: myAddress(),
responseAddress: responseAddress,
forwardTonAmount: 0,
forwardPayload: emptySlice()
}.toCell(),
code: winit.code,
data: winit.data
});
}
fun burn(from: Address, amount: Int, responseAddress: Address?) {
// Create message
let winit: StateInit = self.getJettonWalletInit(from);
let walletAddress: Address = contractAddress(winit);
send(SendParameters{
to: walletAddress,
value: 0,
bounce: false,
mode: SendRemainingValue,
body: TokenBurn{
amount: amount,
queryId: 0,
responseAddress: responseAddress,
owner: from
}.toCell(),
code: winit.code,
data: winit.data
});
}
fun requireWallet(owner: Address) {
let ctx: Context = context();
let winit: StateInit = self.getJettonWalletInit(owner);
require(contractAddress(winit) == ctx.sender, "Invalid sender");
}
virtual fun getJettonWalletInit(address: Address): StateInit {
return initOf TONBWallet(myAddress(), address);
}
}

1
sources/output/jetton_Linker.abi

File diff suppressed because one or more lines are too long

BIN
sources/output/jetton_Linker.code.boc

Binary file not shown.

133
sources/output/jetton_Linker.code.fc

@ -0,0 +1,133 @@
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(136, 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);
}
}
int __tact_address_eq(slice a, slice b) inline {
return equal_slice_bits(a, b);
}
(slice, ((slice))) __gen_read_SetLinkerNeighbor(slice sc_0) inline_ref {
throw_unless(129, sc_0~load_uint(32) == 3019699393);
var v'neighbor = sc_0~__tact_load_address_opt();
return (sc_0, (v'neighbor));
}
builder __gen_write_Linker(builder build_0, (int, slice, slice, slice) v) inline_ref {
var (v'index, v'master, v'owner, v'neighbor) = v;
build_0 = build_0.store_int(v'index, 257);
build_0 = __tact_store_address(build_0, v'master);
build_0 = __tact_store_address_opt(build_0, v'owner);
var build_1 = begin_cell();
build_1 = __tact_store_address_opt(build_1, v'neighbor);
build_0 = store_ref(build_0, build_1.end_cell());
return build_0;
}
(slice, ((int, slice, slice, slice))) __gen_read_Linker(slice sc_0) inline_ref {
var v'index = sc_0~load_int(257);
var v'master = sc_0~__tact_load_address();
var v'owner = sc_0~__tact_load_address_opt();
slice sc_1 = sc_0~load_ref().begin_parse();
var v'neighbor = sc_1~__tact_load_address_opt();
return (sc_0, (v'index, v'master, v'owner, v'neighbor));
}
(int, slice, slice, slice) __gen_load_Linker() inline_ref {
slice sc = get_data().begin_parse();
__tact_context_sys = sc~load_ref();
return sc~__gen_read_Linker();
}
() __gen_store_Linker((int, slice, slice, slice) v) impure inline_ref {
builder b = begin_cell();
b = b.store_ref(__tact_context_sys);
b = __gen_write_Linker(b, v);
set_data(b.end_cell());
}
(((int, slice, slice, slice)), ()) $__gen_Linker_receive_SetLinkerNeighbor((int, slice, slice, slice) $self, (slice) $msg) impure {
var ($self'index, $self'master, $self'owner, $self'neighbor) = $self;
var ($msg'neighbor) = $msg;
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get();
throw_unless(4429, __tact_address_eq($ctx'sender, $self'master));
$self'neighbor = $msg'neighbor;
return (($self'index, $self'master, $self'owner, $self'neighbor), ());
}
() 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 SetLinkerNeighbor message
if (op == 3019699393) {
var self = __gen_load_Linker();
var msg = in_msg~__gen_read_SetLinkerNeighbor();
self~$__gen_Linker_receive_SetLinkerNeighbor(msg);
__gen_store_Linker(self);
return ();
}
throw(130);
}
_ supported_interfaces() method_id {
return (
"org.ton.introspection.v0"H >> 128,
"org.ton.abi.ipfs.v0"H >> 128
);
}
_ get_abi_ipfs() {
return "ipfs://QmT79j24zg2Re4mVCSdgbcXVAfBwfhsZveFUwQHpdgYjCU";
}

185
sources/output/jetton_Linker.code.fif

@ -0,0 +1,185 @@
PROGRAM{
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_address_eq
DECLPROC __gen_read_SetLinkerNeighbor
DECLPROC __gen_write_Linker
DECLPROC __gen_read_Linker
DECLPROC __gen_load_Linker
DECLPROC __gen_store_Linker
DECLPROC $__gen_Linker_receive_SetLinkerNeighbor
DECLPROC recv_internal
113617 DECLMETHOD supported_interfaces
DECLPROC get_abi_ipfs
DECLGLOBVAR __tact_context
DECLGLOBVAR __tact_context_sys
__tact_context_get PROCINLINE:<{
__tact_context GETGLOB
4 UNTUPLE
}>
__tact_verify_address PROCINLINE:<{
SBITS
267 PUSHINT
NEQ
136 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_address_eq PROCINLINE:<{
SDEQ
}>
__gen_read_SetLinkerNeighbor PROCREF:<{
32 LDU
SWAP
3019699393 PUSHINT
EQUAL
129 THROWIFNOT
__tact_load_address_opt INLINECALLDICT
}>
__gen_write_Linker PROCREF:<{
s3 s4 XCHG2
257 PUSHINT
STIX
SWAP
__tact_store_address INLINECALLDICT
SWAP
__tact_store_address_opt INLINECALLDICT
NEWC
ROT
__tact_store_address_opt INLINECALLDICT
ENDC
SWAP
STREF
}>
__gen_read_Linker PROCREF:<{
257 PUSHINT
LDIX
__tact_load_address INLINECALLDICT
SWAP
__tact_load_address_opt INLINECALLDICT
SWAP
LDREF
SWAP
CTOS
__tact_load_address_opt INLINECALLDICT
NIP
s1 s4 XCHG
s3 s3 s0 XCHG3
}>
__gen_load_Linker PROCREF:<{
c4 PUSH
CTOS
LDREF
SWAP
__tact_context_sys SETGLOB
__gen_read_Linker INLINECALLDICT
1 4 BLKDROP2
}>
__gen_store_Linker PROCREF:<{
NEWC
__tact_context_sys GETGLOB
SWAP
STREF
4 -ROLL
__gen_write_Linker INLINECALLDICT
ENDC
c4 POP
}>
$__gen_Linker_receive_SetLinkerNeighbor PROC:<{
NIP
__tact_context_get INLINECALLDICT
2DROP
4429 PUSHINT
s2 POP
s4 PUSH
__tact_address_eq INLINECALLDICT
THROWANYIFNOT
}>
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:<{
2DROP
}>
3019699393 PUSHINT
EQUAL
IFJMP:<{
__gen_load_Linker INLINECALLDICT
s0 s4 XCHG
__gen_read_SetLinkerNeighbor INLINECALLDICT
NIP
s3 s4 XCHG
s1 s3 s0 XCHG3
$__gen_Linker_receive_SetLinkerNeighbor CALLDICT
__gen_store_Linker INLINECALLDICT
}>
DROP
130 THROW
}>
supported_interfaces PROC:<{
123515602279859691144772641439386770278 PUSHINT
209801025412363888721030803524359905849 PUSHINT
}>
get_abi_ipfs PROC:<{
x{697066733a2f2f516d5437396a32347a67325265346d564353646762635856416642776668735a76654655775148706467596a4355} PUSHSLICE
}>
}END>c

179
sources/output/jetton_Linker.code.rev.fif

@ -0,0 +1,179 @@
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
<{
2DROP
}> PUSHCONT
IFJMP
3019699393 PUSHINT
EQUAL
<{
<{
c4 PUSH
CTOS
LDREF
s0 s1 XCHG
2 SETGLOBVAR
<{
257 PUSHINT
LDI
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
LDREF
s0 s1 XCHG
CTOS
LDMSGADDR
s1 PUSH
2 PLDU
0 NEQINT
<{
s0 s1 XCHG
}> PUSHCONT
<{
s1 POP
PUSHNULL
}> PUSHCONT
IFELSE
s1 POP
s1 s4 XCHG
s3 s3 s0 XCHG3
}> CALLREF
1 4 BLKDROP2
}> CALLREF
s0 s4 XCHG
<{
32 LDU
s0 s1 XCHG
3019699393 PUSHINT
EQUAL
129 THROWIFNOT
LDMSGADDR
s1 PUSH
2 PLDU
0 NEQINT
<{
s0 s1 XCHG
}> PUSHCONT
<{
s1 POP
PUSHNULL
}> PUSHCONT
IFELSE
}> CALLREF
s1 POP
s3 s4 XCHG
s1 s3 s0 XCHG3
13 CALLDICT
<{
NEWC
2 GETGLOBVAR
s0 s1 XCHG
STREF
4 1 BLKSWAP
<{
s3 s4 XCHG2
257 PUSHINT
STIX
s0 s1 XCHG
STSLICER
s0 s1 XCHG
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
NEWC
ROT
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
ENDC
s0 s1 XCHG
STREF
}> CALLREF
ENDC
c4 POP
}> CALLREF
}> PUSHCONT
IFJMP
s0 POP
130 THROW
13:
s1 POP
1 GETGLOBVAR
4 UNTUPLE
2DROP
4429 PUSHINT
s2 POP
s4 PUSH
SDEQ
THROWANYIFNOT
113617:
123515602279859691144772641439386770278 PUSHINT
209801025412363888721030803524359905849 PUSHINT
) 19 DICTPUSHCONST
DICTIGETJMPZ
11 THROWARG

BIN
sources/output/jetton_Linker.init.boc

Binary file not shown.

55
sources/output/jetton_Linker.init.fc

@ -0,0 +1,55 @@
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(136, address.slice_bits() != 267);
}
builder __tact_store_address(builder b, slice address) inline {
__tact_verify_address(address);
b = b.store_slice(address);
return b;
}
builder __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);
}
}
builder __gen_write_Linker(builder build_0, (int, slice, slice, slice) v) inline_ref {
var (v'index, v'master, v'owner, v'neighbor) = v;
build_0 = build_0.store_int(v'index, 257);
build_0 = __tact_store_address(build_0, v'master);
build_0 = __tact_store_address_opt(build_0, v'owner);
var build_1 = begin_cell();
build_1 = __tact_store_address_opt(build_1, v'neighbor);
build_0 = store_ref(build_0, build_1.end_cell());
return build_0;
}
cell $__gen_Linker_init(cell sys', int $index, slice $owner) {
var (($self'index, $self'master, $self'owner, $self'neighbor)) = (null(), null(), null(), null());
$self'index = $index;
$self'owner = $owner;
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get();
$self'master = $ctx'sender;
var b' = begin_cell();
b' = b'.store_ref(sys');
b' = __gen_write_Linker(b', ($self'index, $self'master, $self'owner, $self'neighbor));
return b'.end_cell();
}
cell init(cell sys', int $$index, slice $$owner) method_id {
int $index = $$index;
slice $owner = $$owner;
return $__gen_Linker_init(sys', $index, $owner);
}
() main() {
}

69
sources/output/jetton_Linker.init.fif

@ -0,0 +1,69 @@
PROGRAM{
DECLPROC __tact_context_get
DECLPROC __tact_verify_address
DECLPROC __tact_store_address
DECLPROC __tact_store_address_opt
DECLPROC __gen_write_Linker
DECLPROC $__gen_Linker_init
107886 DECLMETHOD init
DECLPROC main
DECLGLOBVAR __tact_context
DECLGLOBVAR __tact_context_sys
__tact_context_get PROCINLINE:<{
__tact_context GETGLOB
4 UNTUPLE
}>
__tact_verify_address PROCINLINE:<{
SBITS
267 PUSHINT
NEQ
136 THROWIFNOT
}>
__tact_store_address PROCINLINE:<{
STSLICER
}>
__tact_store_address_opt PROCINLINE:<{
DUP
ISNULL
IF:<{
DROP
0 PUSHINT
SWAP
2 STU
}>ELSE<{
__tact_store_address INLINECALLDICT
}>
}>
__gen_write_Linker PROCREF:<{
s3 s4 XCHG2
257 PUSHINT
STIX
SWAP
__tact_store_address INLINECALLDICT
SWAP
__tact_store_address_opt INLINECALLDICT
NEWC
ROT
__tact_store_address_opt INLINECALLDICT
ENDC
SWAP
STREF
}>
$__gen_Linker_init PROC:<{
PUSHNULL
__tact_context_get INLINECALLDICT
s2 s3 XCHG
3 BLKDROP
s0 s4 XCHG
NEWC
STREF
s4 s4 s4 XCHG3
__gen_write_Linker INLINECALLDICT
ENDC
}>
init PROC:<{
$__gen_Linker_init CALLDICT
}>
main PROC:<{
}>
}END>c

58
sources/output/jetton_Linker.init.rev.fif

@ -0,0 +1,58 @@
SETCP0
(:methods
recv_internal:
6:
PUSHNULL
1 GETGLOBVAR
4 UNTUPLE
s2 s3 XCHG
3 BLKDROP
s0 s4 XCHG
NEWC
STREF
s4 s4 s4 XCHG3
<{
s3 s4 XCHG2
257 PUSHINT
STIX
s0 s1 XCHG
STSLICER
s0 s1 XCHG
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
NEWC
ROT
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
ENDC
s0 s1 XCHG
STREF
}> CALLREF
ENDC
107886:
6 CALLDICT
) 19 DICTPUSHCONST
DICTIGETJMPZ
11 THROWARG

81
sources/output/jetton_Linker.md

@ -0,0 +1,81 @@
# TACT Compilation Report
Contract: Linker
BOC Size: 316 bytes
# Types
Total Types: 18
## StateInit
TLB: `_ code:^cell data:^cell = StateInit`
Signature: `StateInit{code:^cell,data:^cell}`
## Context
TLB: `_ bounced:bool sender:address value:int257 raw:^slice = Context`
Signature: `Context{bounced:bool,sender:address,value:int257,raw:^slice}`
## SendParameters
TLB: `_ bounce:bool to:address value:int257 mode:int257 body:Maybe ^cell code:Maybe ^cell data:Maybe ^cell = SendParameters`
Signature: `SendParameters{bounce:bool,to:address,value:int257,mode:int257,body:Maybe ^cell,code:Maybe ^cell,data:Maybe ^cell}`
## TokenTransfer
TLB: `token_transfer#0f8a7ea5 queryId:uint64 amount:coins destination:address responseDestination:Maybe address customPayload:Maybe ^cell forwardTonAmount:coins forwardPayload:remainder<slice> = TokenTransfer`
Signature: `TokenTransfer{queryId:uint64,amount:coins,destination:address,responseDestination:Maybe address,customPayload:Maybe ^cell,forwardTonAmount:coins,forwardPayload:remainder<slice>}`
## TokenTransferInternal
TLB: `token_transfer_internal#178d4519 queryId:uint64 amount:coins from:address responseAddress:Maybe address forwardTonAmount:coins forwardPayload:remainder<slice> = TokenTransferInternal`
Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder<slice>}`
## TokenNotification
TLB: `token_notification#7362d09c queryId:uint64 amount:coins from:address forwardPayload:remainder<slice> = TokenNotification`
Signature: `TokenNotification{queryId:uint64,amount:coins,from:address,forwardPayload:remainder<slice>}`
## TokenBurn
TLB: `token_burn#595f07bc queryId:uint64 amount:coins owner:address responseAddress:Maybe address = TokenBurn`
Signature: `TokenBurn{queryId:uint64,amount:coins,owner:address,responseAddress:Maybe address}`
## TokenBurnNotification
TLB: `token_burn_notification#7bdd97de queryId:uint64 amount:coins owner:address responseAddress:Maybe address = TokenBurnNotification`
Signature: `TokenBurnNotification{queryId:uint64,amount:coins,owner:address,responseAddress:Maybe address}`
## TokenExcesses
TLB: `token_excesses#d53276db queryId:uint64 = TokenExcesses`
Signature: `TokenExcesses{queryId:uint64}`
## TokenUpdateContent
TLB: `token_update_content#0c087a9e content:Maybe ^cell = TokenUpdateContent`
Signature: `TokenUpdateContent{content:Maybe ^cell}`
## JettonData
TLB: `_ totalSupply:int257 mintable:bool owner:address content:Maybe ^cell walletCode:^cell = JettonData`
Signature: `JettonData{totalSupply:int257,mintable:bool,owner:address,content:Maybe ^cell,walletCode:^cell}`
## JettonWalletData
TLB: `_ balance:int257 owner:address master:address walletCode:^cell = JettonWalletData`
Signature: `JettonWalletData{balance:int257,owner:address,master:address,walletCode:^cell}`
## InitLinker
TLB: `init_linker#453d436d owner:address = InitLinker`
Signature: `InitLinker{owner:address}`
## SetLinkerNeighbor
TLB: `set_linker_neighbor#b3fcf4c1 neighbor:Maybe address = SetLinkerNeighbor`
Signature: `SetLinkerNeighbor{neighbor:Maybe address}`
## WithdrawalRequests
TLB: `_ addresses:dict<int, address> amounts:dict<int, int> n_requests:int257 = WithdrawalRequests`
Signature: `WithdrawalRequests{addresses:dict<int, address>,amounts:dict<int, int>,n_requests:int257}`
## ChangeOwner
TLB: `change_owner#0f474d03 newOwner:address = ChangeOwner`
Signature: `ChangeOwner{newOwner:address}`
## Deposit
TLB: `deposit#21eeb607 amount:coins = Deposit`
Signature: `Deposit{amount:coins}`
## Withdraw
TLB: `withdraw#60591510 amount:int257 = Withdraw`
Signature: `Withdraw{amount:int257}`
# Get Methods
Total Get Methods: 0

1
sources/output/jetton_Linker.pkg

File diff suppressed because one or more lines are too long

1024
sources/output/jetton_Linker.ts

File diff suppressed because it is too large Load Diff

1
sources/output/jetton_TONB.abi

File diff suppressed because one or more lines are too long

BIN
sources/output/jetton_TONB.code.boc

Binary file not shown.

489
sources/output/jetton_TONB.code.fc

@ -0,0 +1,489 @@
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(136, address.slice_bits() != 267);
}
builder __tact_store_bool(builder b, int v) inline {
b = b.store_int(v, 1);
return b;
}
(slice, slice) __tact_load_address(slice cs) inline {
slice 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_create_address(int chain, int hash) inline {
var b = begin_cell();
b = b.store_uint(2, 2);
b = b.store_uint(0, 1);
b = b.store_int(chain, 8);
b = b.store_uint(hash, 256);
return b.end_cell().begin_parse();
}
slice __tact_compute_contract_address(int chain, cell code, cell data) inline {
var b = begin_cell();
b = b.store_uint(0, 2);
b = b.store_uint(3, 2);
b = b.store_uint(0, 1);
b = b.store_ref(code);
b = b.store_ref(data);
var hash = cell_hash(b.end_cell());
return __tact_create_address(chain, hash);
}
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(135, ok);
return data;
}
builder __gen_write_TokenTransferInternal(builder build_0, (int, int, slice, slice, int, slice) v) inline_ref {
var (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload) = v;
build_0 = store_uint(build_0, 395134233, 32);
build_0 = build_0.store_uint(v'queryId, 64);
build_0 = build_0.store_coins(v'amount);
build_0 = __tact_store_address(build_0, v'from);
build_0 = __tact_store_address_opt(build_0, v'responseAddress);
build_0 = build_0.store_coins(v'forwardTonAmount);
build_0 = build_0.store_slice(v'forwardPayload);
return build_0;
}
cell __gen_writecell_TokenTransferInternal((int, int, slice, slice, int, slice) v) inline_ref {
return __gen_write_TokenTransferInternal(begin_cell(), v).end_cell();
}
builder __gen_write_TokenBurn(builder build_0, (int, int, slice, slice) v) inline_ref {
var (v'queryId, v'amount, v'owner, v'responseAddress) = v;
build_0 = store_uint(build_0, 1499400124, 32);
build_0 = build_0.store_uint(v'queryId, 64);
build_0 = build_0.store_coins(v'amount);
build_0 = __tact_store_address(build_0, v'owner);
build_0 = __tact_store_address_opt(build_0, v'responseAddress);
return build_0;
}
cell __gen_writecell_TokenBurn((int, int, slice, slice) v) inline_ref {
return __gen_write_TokenBurn(begin_cell(), v).end_cell();
}
(slice, ((int, int, slice, slice))) __gen_read_TokenBurnNotification(slice sc_0) inline_ref {
throw_unless(129, sc_0~load_uint(32) == 2078119902);
var v'queryId = sc_0~load_uint(64);
var v'amount = sc_0~load_coins();
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_ref {
var (v'queryId) = v;
build_0 = store_uint(build_0, 3576854235, 32);
build_0 = build_0.store_uint(v'queryId, 64);
return build_0;
}
cell __gen_writecell_TokenExcesses((int) v) inline_ref {
return __gen_write_TokenExcesses(begin_cell(), v).end_cell();
}
(slice, ((cell))) __gen_read_TokenUpdateContent(slice sc_0) inline_ref {
throw_unless(129, sc_0~load_uint(32) == 201882270);
var v'content = sc_0~load_int(1) ? sc_0~load_ref() : null();
return (sc_0, (v'content));
}
(slice, ((int))) __gen_read_Deposit(slice sc_0) inline_ref {
throw_unless(129, sc_0~load_uint(32) == 569292295);
var v'amount = sc_0~load_coins();
return (sc_0, (v'amount));
}
(slice, ((int))) __gen_read_Withdraw(slice sc_0) inline_ref {
throw_unless(129, sc_0~load_uint(32) == 1616450832);
var v'amount = sc_0~load_int(257);
return (sc_0, (v'amount));
}
builder __gen_write_TONBWallet(builder build_0, (int, slice, slice) v) inline_ref {
var (v'balance, v'owner, v'master) = v;
build_0 = build_0.store_int(v'balance, 257);
build_0 = __tact_store_address(build_0, v'owner);
build_0 = __tact_store_address(build_0, v'master);
return build_0;
}
builder __gen_write_TONB(builder build_0, (int, slice, cell, int, slice, slice, int, slice) v) inline_ref {
var (v'totalSupply, v'owner, v'content, v'mintable, v'first_linker, v'last_linker, v'n_linkers, v'staking_pool) = v;
build_0 = build_0.store_coins(v'totalSupply);
build_0 = __tact_store_address(build_0, v'owner);
build_0 = ~ null?(v'content) ? build_0.store_int(true, 1).store_ref(v'content) : build_0.store_int(false, 1);
build_0 = build_0.store_int(v'mintable, 1);
build_0 = __tact_store_address_opt(build_0, v'first_linker);
build_0 = __tact_store_address_opt(build_0, v'last_linker);
var build_1 = begin_cell();
build_1 = build_1.store_int(v'n_linkers, 257);
build_1 = __tact_store_address_opt(build_1, v'staking_pool);
build_0 = store_ref(build_0, build_1.end_cell());
return build_0;
}
(slice, ((int, slice, cell, int, slice, slice, int, slice))) __gen_read_TONB(slice sc_0) inline_ref {
var v'totalSupply = sc_0~load_coins();
var v'owner = sc_0~__tact_load_address();
var v'content = sc_0~load_int(1) ? sc_0~load_ref() : null();
var v'mintable = sc_0~load_int(1);
var v'first_linker = sc_0~__tact_load_address_opt();
var v'last_linker = sc_0~__tact_load_address_opt();
slice sc_1 = sc_0~load_ref().begin_parse();
var v'n_linkers = sc_1~load_int(257);
var v'staking_pool = sc_1~__tact_load_address_opt();
return (sc_0, (v'totalSupply, v'owner, v'content, v'mintable, v'first_linker, v'last_linker, v'n_linkers, v'staking_pool));
}
_ __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, int, slice, cell, cell) __gen_JettonData_to_external(((int, int, slice, cell, cell)) v) {
var (v'totalSupply, v'mintable, v'owner, v'content, v'walletCode) = v;
return (v'totalSupply, v'mintable, v'owner, v'content, v'walletCode);
}
(int, slice, cell, int, slice, slice, int, slice) __gen_load_TONB() inline_ref {
slice sc = get_data().begin_parse();
__tact_context_sys = sc~load_ref();
return sc~__gen_read_TONB();
}
() __gen_store_TONB((int, slice, cell, int, slice, slice, int, slice) v) impure inline_ref {
builder b = begin_cell();
b = b.store_ref(__tact_context_sys);
b = __gen_write_TONB(b, v);
set_data(b.end_cell());
}
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 = __tact_store_bool($b, $params'bounce);
$b = store_int($b, 0, 3);
$b = __tact_store_address($b, $params'to);
$b = store_coins($b, $params'value);
$b = store_int($b, 0, ((((1 + 4) + 4) + 64) + 32));
if (((~ null?($params'code)) | (~ null?($params'data)))) {
$b = __tact_store_bool($b, true);
builder $bc = begin_cell();
$bc = __tact_store_bool($bc, false);
$bc = __tact_store_bool($bc, false);
if ((~ null?($params'code))) {
$bc = __tact_store_bool($bc, true);
$bc = store_ref($bc, __tact_not_null($params'code));
} else {
$bc = __tact_store_bool($bc, false);
}
if ((~ null?($params'data))) {
$bc = __tact_store_bool($bc, true);
$bc = store_ref($bc, __tact_not_null($params'data));
} else {
$bc = __tact_store_bool($bc, false);
}
$bc = __tact_store_bool($bc, false);
$b = __tact_store_bool($b, true);
$b = store_ref($b, end_cell($bc));
} else {
$b = __tact_store_bool($b, false);
}
cell $body = $params'body;
if ((~ null?($body))) {
$b = __tact_store_bool($b, true);
$b = store_ref($b, __tact_not_null($body));
} else {
$b = __tact_store_bool($b, false);
}
cell $c = end_cell($b);
send_raw_message($c, $params'mode);
}
cell $__gen_TONBWallet_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_TONBWallet(b', ($self'balance, $self'owner, $self'master));
return b'.end_cell();
}
(cell, cell) $__gen_TONBWallet_init_child(cell sys', slice $master, slice $owner) {
slice sc' = sys'.begin_parse();
cell source = sc'~load_dict();
cell contracts = new_dict();
;; Contract Code: TONBWallet
cell mine = __tact_dict_get_code(source, 24708);
contracts = __tact_dict_set_code(contracts, 24708, mine);
cell sys = begin_cell().store_dict(contracts).end_cell();
return (mine, $__gen_TONBWallet_init(sys, $master, $owner));
}
((int, slice, cell, int, slice, slice, int, slice), (cell, cell)) $__gen_TONB_getJettonWalletInit((int, slice, cell, int, slice, slice, int, slice) $self, slice $address) impure {
var (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)) = $self;
return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), $__gen_TONBWallet_init_child(__tact_context_sys, my_address(), $address));
}
slice $__gen_TONB_get_wallet_address((int, slice, cell, int, slice, slice, int, slice) $self, slice $owner) impure {
var (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)) = $self;
var ($winit'code, $winit'data) = ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)~$__gen_TONB_getJettonWalletInit($owner);
return $contractAddress(($winit'code, $winit'data));
}
_ $__gen_get_get_wallet_address(slice $$owner) method_id(103289) {
slice $owner = $$owner;
var self = __gen_load_TONB();
var res = $__gen_TONB_get_wallet_address(self, $owner);
return res;
}
(int, int, slice, cell, cell) $__gen_TONB_get_jetton_data((int, slice, cell, int, slice, slice, int, slice) $self) impure {
var (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)) = $self;
cell $code = __gen_StateInit_get_code(($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)~$__gen_TONB_getJettonWalletInit(my_address()));
return ($self'totalSupply, $self'mintable, $self'owner, $self'content, $code);
}
_ $__gen_get_get_jetton_data() method_id(106029) {
var self = __gen_load_TONB();
var res = $__gen_TONB_get_jetton_data(self);
return __gen_JettonData_to_external(res);
}
((int, slice, cell, int, slice, slice, int, slice), ()) $__gen_TONB_mint((int, slice, cell, int, slice, slice, int, slice) $self, slice $to, int $amount, slice $responseAddress) impure {
var (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)) = $self;
$self'totalSupply = ($self'totalSupply + $amount);
var ($winit'code, $winit'data) = ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)~$__gen_TONB_getJettonWalletInit($to);
slice $walletAddress = $contractAddress(($winit'code, $winit'data));
$send((false, $walletAddress, 200000000, 0, __gen_writecell_TokenTransferInternal((0, $amount, my_address(), $responseAddress, 0, $emptySlice())), $winit'code, $winit'data));
return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ());
}
((int, slice, cell, int, slice, slice, int, slice), ()) $__gen_TONB_burn((int, slice, cell, int, slice, slice, int, slice) $self, slice $from, int $amount, slice $responseAddress) impure {
var (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)) = $self;
var ($winit'code, $winit'data) = ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)~$__gen_TONB_getJettonWalletInit($from);
slice $walletAddress = $contractAddress(($winit'code, $winit'data));
$send((false, $walletAddress, 0, 64, __gen_writecell_TokenBurn((0, $amount, $from, $responseAddress)), $winit'code, $winit'data));
return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ());
}
((int, slice, cell, int, slice, slice, int, slice), ()) $__gen_TONB_requireWallet((int, slice, cell, int, slice, slice, int, slice) $self, slice $owner) impure {
var (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)) = $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, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)~$__gen_TONB_getJettonWalletInit($owner);
throw_unless(4429, __tact_address_eq($contractAddress(($winit'code, $winit'data)), $ctx'sender));
return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ());
}
((int, slice, cell, int, slice, slice, int, slice), ()) $__gen_TONB_requireOwner((int, slice, cell, int, slice, slice, int, slice) $self) impure {
var (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)) = $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, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ());
}
slice $__gen_TONB_owner((int, slice, cell, int, slice, slice, int, slice) $self) impure {
var (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)) = $self;
return $self'owner;
}
_ $__gen_get_owner() method_id(83229) {
var self = __gen_load_TONB();
var res = $__gen_TONB_owner(self);
return res;
}
(((int, slice, cell, int, slice, slice, int, slice)), ()) $__gen_TONB_receive_Deposit((int, slice, cell, int, slice, slice, int, slice) $self, (int) $msg) impure {
var ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool) = $self;
var ($msg'amount) = $msg;
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get();
throw_unless(32366, ($ctx'value >= 50000000));
($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)~$__gen_TONB_mint($ctx'sender, $msg'amount, $ctx'sender);
return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ());
}
(((int, slice, cell, int, slice, slice, int, slice)), ()) $__gen_TONB_receive((int, slice, cell, int, slice, slice, int, slice) $self) impure {
var ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool) = $self;
return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ());
}
(((int, slice, cell, int, slice, slice, int, slice)), ()) $__gen_TONB_receive_Withdraw((int, slice, cell, int, slice, slice, int, slice) $self, (int) $msg) impure {
var ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool) = $self;
var ($msg'amount) = $msg;
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get();
throw_unless(6384, ($ctx'value >= 50000000));
($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)~$__gen_TONB_burn($ctx'sender, $msg'amount, $ctx'sender);
return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ());
}
(((int, slice, cell, int, slice, slice, int, slice)), ()) $__gen_TONB_receive_TokenUpdateContent((int, slice, cell, int, slice, slice, int, slice) $self, (cell) $msg) impure {
var ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool) = $self;
var ($msg'content) = $msg;
($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)~$__gen_TONB_requireOwner();
$self'content = $msg'content;
return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ());
}
(((int, slice, cell, int, slice, slice, int, slice)), ()) $__gen_TONB_receive_TokenBurnNotification((int, slice, cell, int, slice, slice, int, slice) $self, (int, int, slice, slice) $msg) impure {
var ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool) = $self;
var ($msg'queryId, $msg'amount, $msg'owner, $msg'responseAddress) = $msg;
($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)~$__gen_TONB_requireWallet($msg'owner);
$self'totalSupply = ($self'totalSupply - $msg'amount);
if ((~ null?($msg'responseAddress))) {
$send((false, __tact_not_null($msg'responseAddress), 0, (64 + 2), __gen_writecell_TokenExcesses(($msg'queryId)), null(), null()));
}
return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ());
}
() 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 Deposit message
if (op == 569292295) {
var self = __gen_load_TONB();
var msg = in_msg~__gen_read_Deposit();
self~$__gen_TONB_receive_Deposit(msg);
__gen_store_TONB(self);
return ();
}
;; Receive empty message
if ((op == 0) & (slice_bits(in_msg) <= 32)) {
var self = __gen_load_TONB();
self~$__gen_TONB_receive();
__gen_store_TONB(self);
return ();
}
;; Receive Withdraw message
if (op == 1616450832) {
var self = __gen_load_TONB();
var msg = in_msg~__gen_read_Withdraw();
self~$__gen_TONB_receive_Withdraw(msg);
__gen_store_TONB(self);
return ();
}
;; Receive TokenUpdateContent message
if (op == 201882270) {
var self = __gen_load_TONB();
var msg = in_msg~__gen_read_TokenUpdateContent();
self~$__gen_TONB_receive_TokenUpdateContent(msg);
__gen_store_TONB(self);
return ();
}
;; Receive TokenBurnNotification message
if (op == 2078119902) {
var self = __gen_load_TONB();
var msg = in_msg~__gen_read_TokenBurnNotification();
self~$__gen_TONB_receive_TokenBurnNotification(msg);
__gen_store_TONB(self);
return ();
}
throw(130);
}
_ 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://Qma6JYPtEyX4isBJUUKdLJZsPe3r5ig6X7NFfzn7hBBCFC";
}

819
sources/output/jetton_TONB.code.fif

@ -0,0 +1,819 @@
PROGRAM{
DECLPROC __tact_not_null
DECLPROC __tact_context_get
DECLPROC __tact_verify_address
DECLPROC __tact_store_bool
DECLPROC __tact_load_address
DECLPROC __tact_load_address_opt
DECLPROC __tact_store_address
DECLPROC __tact_store_address_opt
DECLPROC __tact_create_address
DECLPROC __tact_compute_contract_address
DECLPROC __tact_address_eq
DECLPROC __tact_dict_set_code
DECLPROC __tact_dict_get_code
DECLPROC __gen_write_TokenTransferInternal
DECLPROC __gen_writecell_TokenTransferInternal
DECLPROC __gen_write_TokenBurn
DECLPROC __gen_writecell_TokenBurn
DECLPROC __gen_read_TokenBurnNotification
DECLPROC __gen_write_TokenExcesses
DECLPROC __gen_writecell_TokenExcesses
DECLPROC __gen_read_TokenUpdateContent
DECLPROC __gen_read_Deposit
DECLPROC __gen_read_Withdraw
DECLPROC __gen_write_TONBWallet
DECLPROC __gen_write_TONB
DECLPROC __gen_read_TONB
DECLPROC __gen_StateInit_get_code
DECLPROC __gen_Context_get_sender
DECLPROC __gen_JettonData_to_external
DECLPROC __gen_load_TONB
DECLPROC __gen_store_TONB
DECLPROC $emptyCell
DECLPROC $__gen_Cell_asSlice
DECLPROC $emptySlice
DECLPROC $contractAddress
DECLPROC $send
DECLPROC $__gen_TONBWallet_init
DECLPROC $__gen_TONBWallet_init_child
DECLPROC $__gen_TONB_getJettonWalletInit
DECLPROC $__gen_TONB_get_wallet_address
103289 DECLMETHOD $__gen_get_get_wallet_address
DECLPROC $__gen_TONB_get_jetton_data
106029 DECLMETHOD $__gen_get_get_jetton_data
DECLPROC $__gen_TONB_mint
DECLPROC $__gen_TONB_burn
DECLPROC $__gen_TONB_requireWallet
DECLPROC $__gen_TONB_requireOwner
DECLPROC $__gen_TONB_owner
83229 DECLMETHOD $__gen_get_owner
DECLPROC $__gen_TONB_receive_Deposit
DECLPROC $__gen_TONB_receive
DECLPROC $__gen_TONB_receive_Withdraw
DECLPROC $__gen_TONB_receive_TokenUpdateContent
DECLPROC $__gen_TONB_receive_TokenBurnNotification
DECLPROC recv_internal
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
136 THROWIFNOT
}>
__tact_store_bool PROCINLINE:<{
SWAP
1 STI
}>
__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_create_address PROCINLINE:<{
NEWC
2 PUSHINT
SWAP
2 STU
0 PUSHINT
SWAP
1 STU
s1 s2 XCHG
8 STI
256 STU
ENDC
CTOS
}>
__tact_compute_contract_address PROCINLINE:<{
NEWC
0 PUSHINT
SWAP
2 STU
3 PUSHINT
SWAP
2 STU
0 PUSHINT
SWAP
1 STU
s1 s2 XCHG
STREF
STREF
ENDC
HASHCU
__tact_create_address INLINECALLDICT
}>
__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
135 THROWIFNOT
}>
__gen_write_TokenTransferInternal PROCREF:<{
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 PROCREF:<{
NEWC
6 -ROLL
__gen_write_TokenTransferInternal INLINECALLDICT
ENDC
}>
__gen_write_TokenBurn PROCREF:<{
1499400124 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_TokenBurn PROCREF:<{
NEWC
4 -ROLL
__gen_write_TokenBurn INLINECALLDICT
ENDC
}>
__gen_read_TokenBurnNotification PROCREF:<{
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 PROCREF:<{
3576854235 PUSHINT
ROT
32 STU
64 STU
}>
__gen_writecell_TokenExcesses PROCREF:<{
NEWC
SWAP
__gen_write_TokenExcesses INLINECALLDICT
ENDC
}>
__gen_read_TokenUpdateContent PROCREF:<{
32 LDU
SWAP
201882270 PUSHINT
EQUAL
129 THROWIFNOT
1 LDI
SWAP
IF:<{
LDREF
}>ELSE<{
PUSHNULL
SWAP
}>
SWAP
}>
__gen_read_Deposit PROCREF:<{
32 LDU
SWAP
569292295 PUSHINT
EQUAL
129 THROWIFNOT
LDGRAMS
SWAP
}>
__gen_read_Withdraw PROCREF:<{
32 LDU
SWAP
1616450832 PUSHINT
EQUAL
129 THROWIFNOT
257 PUSHINT
LDIX
SWAP
}>
__gen_write_TONBWallet PROCREF:<{
s2 s3 XCHG2
257 PUSHINT
STIX
SWAP
__tact_store_address INLINECALLDICT
SWAP
__tact_store_address INLINECALLDICT
}>
__gen_write_TONB PROCREF:<{
s8 s7 XCHG2
STGRAMS
s0 s5 XCHG2
__tact_store_address INLINECALLDICT
s3 PUSH
ISNULL
NOT
IF:<{
TRUE
SWAP
1 STI
s1 s3 XCHG
STREF
}>ELSE<{
s3 POP
FALSE
s0 s3 XCHG2
1 STI
}>
1 STI
SWAP
__tact_store_address_opt INLINECALLDICT
SWAP
__tact_store_address_opt INLINECALLDICT
s0 s2 XCHG
NEWC
257 PUSHINT
STIX
SWAP
__tact_store_address_opt INLINECALLDICT
ENDC
SWAP
STREF
}>
__gen_read_TONB PROCREF:<{
LDGRAMS
__tact_load_address INLINECALLDICT
SWAP
1 LDI
SWAP
IF:<{
LDREF
}>ELSE<{
PUSHNULL
SWAP
}>
1 LDI
__tact_load_address_opt INLINECALLDICT
SWAP
__tact_load_address_opt INLINECALLDICT
SWAP
LDREF
SWAP
CTOS
257 PUSHINT
LDIX
__tact_load_address_opt INLINECALLDICT
NIP
s2 s8 XCHG
s2 s7 XCHG
s2 s6 XCHG
s2 s5 XCHG
s2 s4 XCHG
s2 s3 XCHG
}>
__gen_StateInit_get_code PROCINLINE:<{
DROP
}>
__gen_Context_get_sender PROCINLINE:<{
s2 s3 XCHG
3 BLKDROP
}>
__gen_JettonData_to_external PROC:<{
}>
__gen_load_TONB PROCREF:<{
c4 PUSH
CTOS
LDREF
SWAP
__tact_context_sys SETGLOB
__gen_read_TONB INLINECALLDICT
1 8 BLKDROP2
}>
__gen_store_TONB PROCREF:<{
NEWC
__tact_context_sys GETGLOB
SWAP
STREF
8 -ROLL
__gen_write_TONB INLINECALLDICT
ENDC
c4 POP
}>
$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 INLINECALLDICT
}>
$send PROC:<{
NEWC
1 PUSHINT
SWAP
2 STI
s0 s7 XCHG2
__tact_store_bool INLINECALLDICT
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
__tact_store_bool INLINECALLDICT
NEWC
FALSE
__tact_store_bool INLINECALLDICT
FALSE
__tact_store_bool INLINECALLDICT
s4 PUSH
ISNULL
NOT
IF:<{
TRUE
__tact_store_bool INLINECALLDICT
s0 s4 XCHG
__tact_not_null CALLDICT
s0 s4 XCHG2
STREF
}>ELSE<{
s4 POP
s0 s3 XCHG
FALSE
__tact_store_bool INLINECALLDICT
}>
s4 PUSH
ISNULL
NOT
IF:<{
TRUE
__tact_store_bool INLINECALLDICT
s0 s4 XCHG
__tact_not_null CALLDICT
s0 s4 XCHG2
STREF
}>ELSE<{
s4 POP
s0 s3 XCHG
FALSE
__tact_store_bool INLINECALLDICT
}>
FALSE
__tact_store_bool INLINECALLDICT
s0 s2 XCHG
TRUE
__tact_store_bool INLINECALLDICT
s0 s2 XCHG
ENDC
ROT
STREF
}>ELSE<{
s3 POP
s3 POP
SWAP
FALSE
__tact_store_bool INLINECALLDICT
}>
OVER
ISNULL
NOT
IF:<{
TRUE
__tact_store_bool INLINECALLDICT
SWAP
__tact_not_null CALLDICT
SWAP
STREF
}>ELSE<{
NIP
FALSE
__tact_store_bool INLINECALLDICT
}>
ENDC
SWAP
SENDRAWMSG
}>
$__gen_TONBWallet_init PROC:<{
0 PUSHINT
s0 s3 XCHG
NEWC
STREF
s3 s1 s3 XCHG3
__gen_write_TONBWallet INLINECALLDICT
ENDC
}>
$__gen_TONBWallet_init_child PROC:<{
s0 s2 XCHG
CTOS
LDDICT
DROP
NEWDICT
SWAP
24708 PUSHINT
__tact_dict_get_code INLINECALLDICT
SWAP
24708 PUSHINT
s2 PUSH
__tact_dict_set_code INLINECALLDICT
NEWC
STDICT
ENDC
s0 s0 s3 XCHG3
$__gen_TONBWallet_init CALLDICT
}>
$__gen_TONB_getJettonWalletInit PROC:<{
__tact_context_sys GETGLOB
MYADDR
ROT
$__gen_TONBWallet_init_child CALLDICT
}>
$__gen_TONB_get_wallet_address PROC:<{
$__gen_TONB_getJettonWalletInit CALLDICT
8 2 BLKDROP2
$contractAddress CALLDICT
}>
$__gen_get_get_wallet_address PROC:<{
__gen_load_TONB INLINECALLDICT
8 ROLL
$__gen_TONB_get_wallet_address CALLDICT
}>
$__gen_TONB_get_jetton_data PROC:<{
MYADDR
$__gen_TONB_getJettonWalletInit CALLDICT
4 2 BLKDROP2
__gen_StateInit_get_code INLINECALLDICT
s3 s3 s0 XCHG3
}>
$__gen_get_get_jetton_data PROC:<{
__gen_load_TONB INLINECALLDICT
$__gen_TONB_get_jetton_data CALLDICT
__gen_JettonData_to_external CALLDICT
}>
$__gen_TONB_mint PROC:<{
s10 s1 XCPU
ADD
8 2 BLKSWAP
$__gen_TONB_getJettonWalletInit CALLDICT
2DUP
$contractAddress CALLDICT
FALSE
200000000 PUSHINT
0 PUSHINT
DUP
MYADDR
OVER
$emptySlice CALLDICT
s3 s5 XCHG
s4 18 s() XCHG
s2 s3 XCHG
s2 19 s() XCHG
__gen_writecell_TokenTransferInternal INLINECALLDICT
s5 s6 s0 XCHG3
s4 s14 XCHG
s3 s13 XCHG
s0 s14 s13 XCHG3
$send CALLDICT
2 6 BLKSWAP
}>
$__gen_TONB_burn PROC:<{
s7 s10 XCHG
s6 s9 XCHG
s5 s8 XCHG
s4 s10 XCHG
s3 s9 XCHG
s8 s10 s9 XCHG3
s8 PUSH
$__gen_TONB_getJettonWalletInit CALLDICT
2DUP
$contractAddress CALLDICT
FALSE
0 PUSHINT
64 PUSHINT
s1 s0 s2 PUXC2
s2 17 s() XCHG
s0 16 s() XCHG
s1 s15 XCHG
__gen_writecell_TokenBurn INLINECALLDICT
s6 s13 XCHG
s1 s5 XCHG
s4 s14 XCHG
s3 s12 XCHG
s12 s2 XCHG2
$send CALLDICT
s4 s7 XCHG
3 4 BLKSWAP
}>
$__gen_TONB_requireWallet PROC:<{
__tact_context_get INLINECALLDICT
s2 s3 XCHG
3 BLKDROP
9 -ROLL
$__gen_TONB_getJettonWalletInit CALLDICT
SWAP
4429 PUSHINT
s0 s2 XCHG
$contractAddress CALLDICT
s0 s10 XCHG2
__tact_address_eq INLINECALLDICT
s1 s9 XCHG
THROWANYIFNOT
7 ROLL
}>
$__gen_TONB_requireOwner PROC:<{
__tact_context_get INLINECALLDICT
__gen_Context_get_sender INLINECALLDICT
s7 PUSH
__tact_address_eq INLINECALLDICT
132 THROWIFNOT
}>
$__gen_TONB_owner PROC:<{
s6 s7 XCHG
7 BLKDROP
}>
$__gen_get_owner PROC:<{
__gen_load_TONB INLINECALLDICT
$__gen_TONB_owner CALLDICT
}>
$__gen_TONB_receive_Deposit PROC:<{
__tact_context_get INLINECALLDICT
DROP
32366 PUSHINT
s3 POP
50000000 PUSHINT
GEQ
s1 s2 XCHG
THROWANYIFNOT
TUCK
$__gen_TONB_mint CALLDICT
}>
$__gen_TONB_receive PROC:<{
}>
$__gen_TONB_receive_Withdraw PROC:<{
__tact_context_get INLINECALLDICT
DROP
6384 PUSHINT
s3 POP
50000000 PUSHINT
GEQ
s1 s2 XCHG
THROWANYIFNOT
TUCK
$__gen_TONB_burn CALLDICT
}>
$__gen_TONB_receive_TokenUpdateContent PROC:<{
8 -ROLL
$__gen_TONB_requireOwner CALLDICT
s5 POP
s6 s7 XCHG
s5 s6 XCHG
4 ROLL
}>
$__gen_TONB_receive_TokenBurnNotification PROC:<{
s8 s11 XCHG
s7 s10 XCHG
s6 s9 XCHG
s5 s11 XCHG
s4 s10 XCHG
s3 s9 XCHG
s11 s10 s10 XCHG3
$__gen_TONB_requireWallet CALLDICT
s7 s10 XCHG2
SUB
s8 PUSH
ISNULL
NOT
IF:<{
FALSE
s0 s9 XCHG
__tact_not_null CALLDICT
0 PUSHINT
66 PUSHINT
s0 s10 XCHG
__gen_writecell_TokenExcesses INLINECALLDICT
s4 s11 XCHG
s1 s3 s0 XCHG3
s1 s10 XCHG
PUSHNULL
PUSHNULL
$send CALLDICT
}>ELSE<{
s7 POP
s7 POP
}>
s5 s7 XCHG
s3 s6 XCHG
s5 s1 s3 XCHG3
s4 s2 XCHG2
}>
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:<{
2DROP
}>
DUP
569292295 PUSHINT
EQUAL
IFJMP:<{
DROP
__gen_load_TONB INLINECALLDICT
s0 s8 XCHG
__gen_read_Deposit INLINECALLDICT
NIP
s7 s8 XCHG
s6 s7 XCHG
s5 s6 XCHG
s4 s5 XCHG
s3 s4 XCHG
s1 s3 s0 XCHG3
$__gen_TONB_receive_Deposit CALLDICT
__gen_store_TONB INLINECALLDICT
}>
DUP
0 EQINT
s2 PUSH
SBITS
33 LESSINT
AND
IFJMP:<{
2DROP
__gen_load_TONB INLINECALLDICT
$__gen_TONB_receive CALLDICT
__gen_store_TONB INLINECALLDICT
}>
DUP
1616450832 PUSHINT
EQUAL
IFJMP:<{
DROP
__gen_load_TONB INLINECALLDICT
s0 s8 XCHG
__gen_read_Withdraw INLINECALLDICT
NIP
s7 s8 XCHG
s6 s7 XCHG
s5 s6 XCHG
s4 s5 XCHG
s3 s4 XCHG
s1 s3 s0 XCHG3
$__gen_TONB_receive_Withdraw CALLDICT
__gen_store_TONB INLINECALLDICT
}>
DUP
201882270 PUSHINT
EQUAL
IFJMP:<{
DROP
__gen_load_TONB INLINECALLDICT
s0 s8 XCHG
__gen_read_TokenUpdateContent INLINECALLDICT
NIP
s7 s8 XCHG
s6 s7 XCHG
s5 s6 XCHG
s4 s5 XCHG
s3 s4 XCHG
s1 s3 s0 XCHG3
$__gen_TONB_receive_TokenUpdateContent CALLDICT
__gen_store_TONB INLINECALLDICT
}>
2078119902 PUSHINT
EQUAL
IFJMP:<{
__gen_load_TONB INLINECALLDICT
s0 s8 XCHG
__gen_read_TokenBurnNotification INLINECALLDICT
s4 POP
s10 s11 XCHG
s9 s10 XCHG
s8 s9 XCHG
s7 s8 XCHG
s6 s7 XCHG
s5 s6 XCHG
s4 s5 XCHG
3 ROLL
$__gen_TONB_receive_TokenBurnNotification CALLDICT
__gen_store_TONB INLINECALLDICT
}>
DROP
130 THROW
}>
supported_interfaces PROC:<{
123515602279859691144772641439386770278 PUSHINT
209801025412363888721030803524359905849 PUSHINT
258390863389042349688353801369539695109 PUSHINT
86142586315491086060343270784266291122 PUSHINT
}>
get_abi_ipfs PROC:<{
x{697066733a2f2f516d61364a595074457958346973424a55554b644c4a5a73506533723569673658374e46667a6e37684242434643} PUSHSLICE
}>
}END>c

1653
sources/output/jetton_TONB.code.rev.fif

File diff suppressed because it is too large Load Diff

BIN
sources/output/jetton_TONB.init.boc

Binary file not shown.

54
sources/output/jetton_TONB.init.fc

@ -0,0 +1,54 @@
() __tact_verify_address(slice address) inline {
throw_unless(136, address.slice_bits() != 267);
}
builder __tact_store_address(builder b, slice address) inline {
__tact_verify_address(address);
b = b.store_slice(address);
return b;
}
builder __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);
}
}
builder __gen_write_TONB(builder build_0, (int, slice, cell, int, slice, slice, int, slice) v) inline_ref {
var (v'totalSupply, v'owner, v'content, v'mintable, v'first_linker, v'last_linker, v'n_linkers, v'staking_pool) = v;
build_0 = build_0.store_coins(v'totalSupply);
build_0 = __tact_store_address(build_0, v'owner);
build_0 = ~ null?(v'content) ? build_0.store_int(true, 1).store_ref(v'content) : build_0.store_int(false, 1);
build_0 = build_0.store_int(v'mintable, 1);
build_0 = __tact_store_address_opt(build_0, v'first_linker);
build_0 = __tact_store_address_opt(build_0, v'last_linker);
var build_1 = begin_cell();
build_1 = build_1.store_int(v'n_linkers, 257);
build_1 = __tact_store_address_opt(build_1, v'staking_pool);
build_0 = store_ref(build_0, build_1.end_cell());
return build_0;
}
cell $__gen_TONB_init(cell sys', slice $owner, cell $content) {
var (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)) = (null(), null(), null(), null(), null(), null(), 0, 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_TONB(b', ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool));
return b'.end_cell();
}
cell init(cell sys', slice $$owner, cell $$content) method_id {
slice $owner = $$owner;
cell $content = $$content;
return $__gen_TONB_init(sys', $owner, $content);
}
() main() {
}

88
sources/output/jetton_TONB.init.fif

@ -0,0 +1,88 @@
PROGRAM{
DECLPROC __tact_verify_address
DECLPROC __tact_store_address
DECLPROC __tact_store_address_opt
DECLPROC __gen_write_TONB
DECLPROC $__gen_TONB_init
107886 DECLMETHOD init
DECLPROC main
__tact_verify_address PROCINLINE:<{
SBITS
267 PUSHINT
NEQ
136 THROWIFNOT
}>
__tact_store_address PROCINLINE:<{
STSLICER
}>
__tact_store_address_opt PROCINLINE:<{
DUP
ISNULL
IF:<{
DROP
0 PUSHINT
SWAP
2 STU
}>ELSE<{
__tact_store_address INLINECALLDICT
}>
}>
__gen_write_TONB PROCREF:<{
s8 s7 XCHG2
STGRAMS
s0 s5 XCHG2
__tact_store_address INLINECALLDICT
s3 PUSH
ISNULL
NOT
IF:<{
TRUE
SWAP
1 STI
s1 s3 XCHG
STREF
}>ELSE<{
s3 POP
FALSE
s0 s3 XCHG2
1 STI
}>
1 STI
SWAP
__tact_store_address_opt INLINECALLDICT
SWAP
__tact_store_address_opt INLINECALLDICT
s0 s2 XCHG
NEWC
257 PUSHINT
STIX
SWAP
__tact_store_address_opt INLINECALLDICT
ENDC
SWAP
STREF
}>
$__gen_TONB_init PROC:<{
PUSHNULL
PUSHNULL
0 PUSHINT
PUSHNULL
OVER
TRUE
s0 s8 XCHG
NEWC
STREF
s0 s8 XCHG
s4 s7 s4 XCHG3
s1 s6 XCHG
s1 s5 XCHG
s1 s3 XCHG
__gen_write_TONB INLINECALLDICT
ENDC
}>
init PROC:<{
$__gen_TONB_init CALLDICT
}>
main PROC:<{
}>
}END>c

96
sources/output/jetton_TONB.init.rev.fif

@ -0,0 +1,96 @@
SETCP0
(:methods
recv_internal:
5:
PUSHNULL
PUSHNULL
0 PUSHINT
PUSHNULL
s1 PUSH
-1 PUSHINT
s0 s8 XCHG
NEWC
STREF
s0 s8 XCHG
s4 s7 s4 XCHG3
s1 s6 XCHG
s1 s5 XCHG
s1 s3 XCHG
<{
s8 s7 XCHG2
STGRAMS
s0 s5 XCHG2
STSLICER
s3 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s1 s3 XCHG
STREF
}> PUSHCONT
<{
s3 POP
0 PUSHINT
s0 s3 XCHG2
1 STI
}> PUSHCONT
IFELSE
1 STI
s0 s1 XCHG
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
s0 s1 XCHG
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
s0 s2 XCHG
NEWC
257 PUSHINT
STIX
s0 s1 XCHG
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
ENDC
s0 s1 XCHG
STREF
}> CALLREF
ENDC
107886:
5 CALLDICT
) 19 DICTPUSHCONST
DICTIGETJMPZ
11 THROWARG

88
sources/output/jetton_TONB.md

@ -0,0 +1,88 @@
# TACT Compilation Report
Contract: TONB
BOC Size: 1506 bytes
# Types
Total Types: 18
## StateInit
TLB: `_ code:^cell data:^cell = StateInit`
Signature: `StateInit{code:^cell,data:^cell}`
## Context
TLB: `_ bounced:bool sender:address value:int257 raw:^slice = Context`
Signature: `Context{bounced:bool,sender:address,value:int257,raw:^slice}`
## SendParameters
TLB: `_ bounce:bool to:address value:int257 mode:int257 body:Maybe ^cell code:Maybe ^cell data:Maybe ^cell = SendParameters`
Signature: `SendParameters{bounce:bool,to:address,value:int257,mode:int257,body:Maybe ^cell,code:Maybe ^cell,data:Maybe ^cell}`
## TokenTransfer
TLB: `token_transfer#0f8a7ea5 queryId:uint64 amount:coins destination:address responseDestination:Maybe address customPayload:Maybe ^cell forwardTonAmount:coins forwardPayload:remainder<slice> = TokenTransfer`
Signature: `TokenTransfer{queryId:uint64,amount:coins,destination:address,responseDestination:Maybe address,customPayload:Maybe ^cell,forwardTonAmount:coins,forwardPayload:remainder<slice>}`
## TokenTransferInternal
TLB: `token_transfer_internal#178d4519 queryId:uint64 amount:coins from:address responseAddress:Maybe address forwardTonAmount:coins forwardPayload:remainder<slice> = TokenTransferInternal`
Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder<slice>}`
## TokenNotification
TLB: `token_notification#7362d09c queryId:uint64 amount:coins from:address forwardPayload:remainder<slice> = TokenNotification`
Signature: `TokenNotification{queryId:uint64,amount:coins,from:address,forwardPayload:remainder<slice>}`
## TokenBurn
TLB: `token_burn#595f07bc queryId:uint64 amount:coins owner:address responseAddress:Maybe address = TokenBurn`
Signature: `TokenBurn{queryId:uint64,amount:coins,owner:address,responseAddress:Maybe address}`
## TokenBurnNotification
TLB: `token_burn_notification#7bdd97de queryId:uint64 amount:coins owner:address responseAddress:Maybe address = TokenBurnNotification`
Signature: `TokenBurnNotification{queryId:uint64,amount:coins,owner:address,responseAddress:Maybe address}`
## TokenExcesses
TLB: `token_excesses#d53276db queryId:uint64 = TokenExcesses`
Signature: `TokenExcesses{queryId:uint64}`
## TokenUpdateContent
TLB: `token_update_content#0c087a9e content:Maybe ^cell = TokenUpdateContent`
Signature: `TokenUpdateContent{content:Maybe ^cell}`
## JettonData
TLB: `_ totalSupply:int257 mintable:bool owner:address content:Maybe ^cell walletCode:^cell = JettonData`
Signature: `JettonData{totalSupply:int257,mintable:bool,owner:address,content:Maybe ^cell,walletCode:^cell}`
## JettonWalletData
TLB: `_ balance:int257 owner:address master:address walletCode:^cell = JettonWalletData`
Signature: `JettonWalletData{balance:int257,owner:address,master:address,walletCode:^cell}`
## InitLinker
TLB: `init_linker#453d436d owner:address = InitLinker`
Signature: `InitLinker{owner:address}`
## SetLinkerNeighbor
TLB: `set_linker_neighbor#b3fcf4c1 neighbor:Maybe address = SetLinkerNeighbor`
Signature: `SetLinkerNeighbor{neighbor:Maybe address}`
## WithdrawalRequests
TLB: `_ addresses:dict<int, address> amounts:dict<int, int> n_requests:int257 = WithdrawalRequests`
Signature: `WithdrawalRequests{addresses:dict<int, address>,amounts:dict<int, int>,n_requests:int257}`
## ChangeOwner
TLB: `change_owner#0f474d03 newOwner:address = ChangeOwner`
Signature: `ChangeOwner{newOwner:address}`
## Deposit
TLB: `deposit#21eeb607 amount:coins = Deposit`
Signature: `Deposit{amount:coins}`
## Withdraw
TLB: `withdraw#60591510 amount:int257 = Withdraw`
Signature: `Withdraw{amount:int257}`
# Get Methods
Total Get Methods: 3
## get_wallet_address
Argument: owner
## get_jetton_data
## owner

1
sources/output/jetton_TONB.pkg

File diff suppressed because one or more lines are too long

1058
sources/output/jetton_TONB.ts

File diff suppressed because it is too large Load Diff

1
sources/output/jetton_TONBWallet.abi

File diff suppressed because one or more lines are too long

BIN
sources/output/jetton_TONBWallet.code.boc

Binary file not shown.

437
sources/output/jetton_TONBWallet.code.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(136, address.slice_bits() != 267);
}
builder __tact_store_bool(builder b, int v) inline {
b = b.store_int(v, 1);
return b;
}
(slice, slice) __tact_load_address(slice cs) inline {
slice 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_create_address(int chain, int hash) inline {
var b = begin_cell();
b = b.store_uint(2, 2);
b = b.store_uint(0, 1);
b = b.store_int(chain, 8);
b = b.store_uint(hash, 256);
return b.end_cell().begin_parse();
}
slice __tact_compute_contract_address(int chain, cell code, cell data) inline {
var b = begin_cell();
b = b.store_uint(0, 2);
b = b.store_uint(3, 2);
b = b.store_uint(0, 1);
b = b.store_ref(code);
b = b.store_ref(data);
var hash = cell_hash(b.end_cell());
return __tact_create_address(chain, hash);
}
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(135, ok);
return data;
}
(slice, ((int, int, slice, slice, cell, int, slice))) __gen_read_TokenTransfer(slice sc_0) inline_ref {
throw_unless(129, sc_0~load_uint(32) == 260734629);
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 = sc_0~load_int(1) ? sc_0~load_ref() : null();
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_ref {
var (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload) = v;
build_0 = store_uint(build_0, 395134233, 32);
build_0 = build_0.store_uint(v'queryId, 64);
build_0 = build_0.store_coins(v'amount);
build_0 = __tact_store_address(build_0, v'from);
build_0 = __tact_store_address_opt(build_0, v'responseAddress);
build_0 = build_0.store_coins(v'forwardTonAmount);
build_0 = build_0.store_slice(v'forwardPayload);
return build_0;
}
cell __gen_writecell_TokenTransferInternal((int, int, slice, slice, int, slice) v) inline_ref {
return __gen_write_TokenTransferInternal(begin_cell(), v).end_cell();
}
(slice, ((int, int, slice, slice, int, slice))) __gen_read_TokenTransferInternal(slice sc_0) inline_ref {
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_ref {
var (v'queryId, v'amount, v'from, v'forwardPayload) = v;
build_0 = store_uint(build_0, 1935855772, 32);
build_0 = build_0.store_uint(v'queryId, 64);
build_0 = build_0.store_coins(v'amount);
build_0 = __tact_store_address(build_0, v'from);
build_0 = build_0.store_slice(v'forwardPayload);
return build_0;
}
cell __gen_writecell_TokenNotification((int, int, slice, slice) v) inline_ref {
return __gen_write_TokenNotification(begin_cell(), v).end_cell();
}
(slice, ((int, int, slice, slice))) __gen_read_TokenBurn(slice sc_0) inline_ref {
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_ref {
var (v'queryId, v'amount, v'owner, v'responseAddress) = v;
build_0 = store_uint(build_0, 2078119902, 32);
build_0 = build_0.store_uint(v'queryId, 64);
build_0 = build_0.store_coins(v'amount);
build_0 = __tact_store_address(build_0, v'owner);
build_0 = __tact_store_address_opt(build_0, v'responseAddress);
return build_0;
}
cell __gen_writecell_TokenBurnNotification((int, int, slice, slice) v) inline_ref {
return __gen_write_TokenBurnNotification(begin_cell(), v).end_cell();
}
builder __gen_write_TokenExcesses(builder build_0, (int) v) inline_ref {
var (v'queryId) = v;
build_0 = store_uint(build_0, 3576854235, 32);
build_0 = build_0.store_uint(v'queryId, 64);
return build_0;
}
cell __gen_writecell_TokenExcesses((int) v) inline_ref {
return __gen_write_TokenExcesses(begin_cell(), v).end_cell();
}
builder __gen_write_TONBWallet(builder build_0, (int, slice, slice) v) inline_ref {
var (v'balance, v'owner, v'master) = v;
build_0 = build_0.store_int(v'balance, 257);
build_0 = __tact_store_address(build_0, v'owner);
build_0 = __tact_store_address(build_0, v'master);
return build_0;
}
(slice, ((int, slice, slice))) __gen_read_TONBWallet(slice sc_0) inline_ref {
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, cell) __gen_JettonWalletData_to_external(((int, slice, slice, cell)) v) {
var (v'balance, v'owner, v'master, v'walletCode) = v;
return (v'balance, v'owner, v'master, v'walletCode);
}
(int, slice, slice) __gen_load_TONBWallet() inline_ref {
slice sc = get_data().begin_parse();
__tact_context_sys = sc~load_ref();
return sc~__gen_read_TONBWallet();
}
() __gen_store_TONBWallet((int, slice, slice) v) impure inline_ref {
builder b = begin_cell();
b = b.store_ref(__tact_context_sys);
b = __gen_write_TONBWallet(b, v);
set_data(b.end_cell());
}
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 = __tact_store_bool($b, $params'bounce);
$b = store_int($b, 0, 3);
$b = __tact_store_address($b, $params'to);
$b = store_coins($b, $params'value);
$b = store_int($b, 0, ((((1 + 4) + 4) + 64) + 32));
if (((~ null?($params'code)) | (~ null?($params'data)))) {
$b = __tact_store_bool($b, true);
builder $bc = begin_cell();
$bc = __tact_store_bool($bc, false);
$bc = __tact_store_bool($bc, false);
if ((~ null?($params'code))) {
$bc = __tact_store_bool($bc, true);
$bc = store_ref($bc, __tact_not_null($params'code));
} else {
$bc = __tact_store_bool($bc, false);
}
if ((~ null?($params'data))) {
$bc = __tact_store_bool($bc, true);
$bc = store_ref($bc, __tact_not_null($params'data));
} else {
$bc = __tact_store_bool($bc, false);
}
$bc = __tact_store_bool($bc, false);
$b = __tact_store_bool($b, true);
$b = store_ref($b, end_cell($bc));
} else {
$b = __tact_store_bool($b, false);
}
cell $body = $params'body;
if ((~ null?($body))) {
$b = __tact_store_bool($b, true);
$b = store_ref($b, __tact_not_null($body));
} else {
$b = __tact_store_bool($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_TONBWallet_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_TONBWallet(b', ($self'balance, $self'owner, $self'master));
return b'.end_cell();
}
(cell, cell) $__gen_TONBWallet_init_child(cell sys', slice $master, slice $owner) {
slice sc' = sys'.begin_parse();
cell source = sc'~load_dict();
cell contracts = new_dict();
;; Contract Code: TONBWallet
cell mine = __tact_dict_get_code(source, 24708);
contracts = __tact_dict_set_code(contracts, 24708, mine);
cell sys = begin_cell().store_dict(contracts).end_cell();
return (mine, $__gen_TONBWallet_init(sys, $master, $owner));
}
(int, slice, slice, cell) $__gen_TONBWallet_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_TONBWallet_init_child(__tact_context_sys, $self'master, $self'owner)));
}
_ $__gen_get_get_wallet_data() method_id(97026) {
var self = __gen_load_TONBWallet();
var res = $__gen_TONBWallet_get_wallet_data(self);
return __gen_JettonWalletData_to_external(res);
}
(((int, slice, slice)), ()) $__gen_TONBWallet_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_TONBWallet_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_TONBWallet_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_TONBWallet_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_TONBWallet_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) | __tact_address_eq($ctx'sender, $self'master)));
$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_TONBWallet_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_TONBWallet();
self~$__gen_TONBWallet_receive_bounced(in_msg);
__gen_store_TONBWallet(self);
return ();
}
;; Receive TokenTransfer message
if (op == 260734629) {
var self = __gen_load_TONBWallet();
var msg = in_msg~__gen_read_TokenTransfer();
self~$__gen_TONBWallet_receive_TokenTransfer(msg);
__gen_store_TONBWallet(self);
return ();
}
;; Receive TokenTransferInternal message
if (op == 395134233) {
var self = __gen_load_TONBWallet();
var msg = in_msg~__gen_read_TokenTransferInternal();
self~$__gen_TONBWallet_receive_TokenTransferInternal(msg);
__gen_store_TONBWallet(self);
return ();
}
;; Receive TokenBurn message
if (op == 1499400124) {
var self = __gen_load_TONBWallet();
var msg = in_msg~__gen_read_TokenBurn();
self~$__gen_TONBWallet_receive_TokenBurn(msg);
__gen_store_TONBWallet(self);
return ();
}
throw(130);
}
_ 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://QmdeQibxp6Bp8gtTKCziJsCfzaEpbxC4zCEomnBb1nCyer";
}

774
sources/output/jetton_TONBWallet.code.fif

@ -0,0 +1,774 @@
PROGRAM{
DECLPROC __tact_my_balance
DECLPROC __tact_not_null
DECLPROC __tact_context_get
DECLPROC __tact_verify_address
DECLPROC __tact_store_bool
DECLPROC __tact_load_address
DECLPROC __tact_load_address_opt
DECLPROC __tact_store_address
DECLPROC __tact_store_address_opt
DECLPROC __tact_create_address
DECLPROC __tact_compute_contract_address
DECLPROC __tact_address_eq
DECLPROC __tact_address_neq
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_TONBWallet
DECLPROC __gen_read_TONBWallet
DECLPROC __gen_StateInit_get_code
DECLPROC __gen_JettonWalletData_to_external
DECLPROC __gen_load_TONBWallet
DECLPROC __gen_store_TONBWallet
DECLPROC $contractAddress
DECLPROC $send
DECLPROC $__gen_Context_readForwardFee
DECLPROC $__gen_TONBWallet_init
DECLPROC $__gen_TONBWallet_init_child
DECLPROC $__gen_TONBWallet_get_wallet_data
97026 DECLMETHOD $__gen_get_get_wallet_data
DECLPROC $__gen_TONBWallet_receive_TokenTransfer
DECLPROC $__gen_TONBWallet_receive_TokenTransferInternal
DECLPROC $__gen_TONBWallet_receive_TokenBurn
DECLPROC $__gen_TONBWallet_receive_bounced
DECLPROC recv_internal
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
136 THROWIFNOT
}>
__tact_store_bool PROCINLINE:<{
SWAP
1 STI
}>
__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_create_address PROCINLINE:<{
NEWC
2 PUSHINT
SWAP
2 STU
0 PUSHINT
SWAP
1 STU
s1 s2 XCHG
8 STI
256 STU
ENDC
CTOS
}>
__tact_compute_contract_address PROCINLINE:<{
NEWC
0 PUSHINT
SWAP
2 STU
3 PUSHINT
SWAP
2 STU
0 PUSHINT
SWAP
1 STU
s1 s2 XCHG
STREF
STREF
ENDC
HASHCU
__tact_create_address INLINECALLDICT
}>
__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
135 THROWIFNOT
}>
__gen_read_TokenTransfer PROCREF:<{
32 LDU
SWAP
260734629 PUSHINT
EQUAL
129 THROWIFNOT
64 LDU
LDGRAMS
__tact_load_address INLINECALLDICT
SWAP
__tact_load_address_opt INLINECALLDICT
SWAP
1 LDI
SWAP
IF:<{
LDREF
}>ELSE<{
PUSHNULL
SWAP
}>
LDGRAMS
s6 s6 XCPU
s1 s6 XCHG
s1 s5 XCHG
s1 s4 XCHG
s3 s3 s0 XCHG3
}>
__gen_write_TokenTransferInternal PROCREF:<{
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 PROCREF:<{
NEWC
6 -ROLL
__gen_write_TokenTransferInternal INLINECALLDICT
ENDC
}>
__gen_read_TokenTransferInternal PROCREF:<{
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 PROCREF:<{
1935855772 PUSHINT
s0 s5 XCHG2
32 STU
s1 s3 XCHG
64 STU
SWAP
STGRAMS
SWAP
__tact_store_address INLINECALLDICT
SWAP
STSLICER
}>
__gen_writecell_TokenNotification PROCREF:<{
NEWC
4 -ROLL
__gen_write_TokenNotification INLINECALLDICT
ENDC
}>
__gen_read_TokenBurn PROCREF:<{
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 PROCREF:<{
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 PROCREF:<{
NEWC
4 -ROLL
__gen_write_TokenBurnNotification INLINECALLDICT
ENDC
}>
__gen_write_TokenExcesses PROCREF:<{
3576854235 PUSHINT
ROT
32 STU
64 STU
}>
__gen_writecell_TokenExcesses PROCREF:<{
NEWC
SWAP
__gen_write_TokenExcesses INLINECALLDICT
ENDC
}>
__gen_write_TONBWallet PROCREF:<{
s2 s3 XCHG2
257 PUSHINT
STIX
SWAP
__tact_store_address INLINECALLDICT
SWAP
__tact_store_address INLINECALLDICT
}>
__gen_read_TONBWallet PROCREF:<{
257 PUSHINT
LDIX
__tact_load_address INLINECALLDICT
SWAP
__tact_load_address INLINECALLDICT
s3 s3 s0 XCHG3
}>
__gen_StateInit_get_code PROCINLINE:<{
DROP
}>
__gen_JettonWalletData_to_external PROC:<{
}>
__gen_load_TONBWallet PROCREF:<{
c4 PUSH
CTOS
LDREF
SWAP
__tact_context_sys SETGLOB
__gen_read_TONBWallet INLINECALLDICT
1 3 BLKDROP2
}>
__gen_store_TONBWallet PROCREF:<{
NEWC
__tact_context_sys GETGLOB
SWAP
STREF
3 -ROLL
__gen_write_TONBWallet INLINECALLDICT
ENDC
c4 POP
}>
$contractAddress PROC:<{
0 PUSHINT
-ROT
__tact_compute_contract_address INLINECALLDICT
}>
$send PROC:<{
NEWC
1 PUSHINT
SWAP
2 STI
s0 s7 XCHG2
__tact_store_bool INLINECALLDICT
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
__tact_store_bool INLINECALLDICT
NEWC
FALSE
__tact_store_bool INLINECALLDICT
FALSE
__tact_store_bool INLINECALLDICT
s4 PUSH
ISNULL
NOT
IF:<{
TRUE
__tact_store_bool INLINECALLDICT
s0 s4 XCHG
__tact_not_null CALLDICT
s0 s4 XCHG2
STREF
}>ELSE<{
s4 POP
s0 s3 XCHG
FALSE
__tact_store_bool INLINECALLDICT
}>
s4 PUSH
ISNULL
NOT
IF:<{
TRUE
__tact_store_bool INLINECALLDICT
s0 s4 XCHG
__tact_not_null CALLDICT
s0 s4 XCHG2
STREF
}>ELSE<{
s4 POP
s0 s3 XCHG
FALSE
__tact_store_bool INLINECALLDICT
}>
FALSE
__tact_store_bool INLINECALLDICT
s0 s2 XCHG
TRUE
__tact_store_bool INLINECALLDICT
s0 s2 XCHG
ENDC
ROT
STREF
}>ELSE<{
s3 POP
s3 POP
SWAP
FALSE
__tact_store_bool INLINECALLDICT
}>
OVER
ISNULL
NOT
IF:<{
TRUE
__tact_store_bool INLINECALLDICT
SWAP
__tact_not_null CALLDICT
SWAP
STREF
}>ELSE<{
NIP
FALSE
__tact_store_bool INLINECALLDICT
}>
ENDC
SWAP
SENDRAWMSG
}>
$__gen_Context_readForwardFee PROC:<{
3 1 BLKDROP2
LDGRAMS
NIP
1 PUSHINT
SDSKIPFIRST
LDGRAMS
NIP
LDGRAMS
DROP
3 MULCONST
1 RSHIFT#
}>
$__gen_TONBWallet_init PROC:<{
0 PUSHINT
s0 s3 XCHG
NEWC
STREF
s3 s1 s3 XCHG3
__gen_write_TONBWallet INLINECALLDICT
ENDC
}>
$__gen_TONBWallet_init_child PROC:<{
s0 s2 XCHG
CTOS
LDDICT
DROP
NEWDICT
SWAP
24708 PUSHINT
__tact_dict_get_code INLINECALLDICT
SWAP
24708 PUSHINT
s2 PUSH
__tact_dict_set_code INLINECALLDICT
NEWC
STDICT
ENDC
s0 s0 s3 XCHG3
$__gen_TONBWallet_init CALLDICT
}>
$__gen_TONBWallet_get_wallet_data PROC:<{
__tact_context_sys GETGLOB
s1 s2 PUSH2
$__gen_TONBWallet_init_child CALLDICT
__gen_StateInit_get_code INLINECALLDICT
}>
$__gen_get_get_wallet_data PROC:<{
__gen_load_TONBWallet INLINECALLDICT
$__gen_TONBWallet_get_wallet_data CALLDICT
__gen_JettonWalletData_to_external CALLDICT
}>
$__gen_TONBWallet_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_TONBWallet_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_TONBWallet_receive_TokenTransferInternal PROC:<{
__tact_context_get INLINECALLDICT
s2 s10 PUSH2
__tact_address_neq INLINECALLDICT
IF:<{
__tact_context_sys GETGLOB
s11 s8 PUSH2
$__gen_TONBWallet_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_TONBWallet_receive_TokenBurn PROC:<{
2DROP
__tact_context_get INLINECALLDICT
4429 PUSHINT
s3 s8 PUSH2
__tact_address_eq INLINECALLDICT
s4 s8 PUSH2
__tact_address_eq INLINECALLDICT
OR
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_TONBWallet_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_TONBWallet INLINECALLDICT
3 ROLL
$__gen_TONBWallet_receive_bounced CALLDICT
__gen_store_TONBWallet INLINECALLDICT
}>
DUP
260734629 PUSHINT
EQUAL
IFJMP:<{
DROP
__gen_load_TONBWallet INLINECALLDICT
s0 s3 XCHG
__gen_read_TokenTransfer INLINECALLDICT
s7 POP
s8 s9 XCHG
s7 s8 XCHG
6 ROLL
$__gen_TONBWallet_receive_TokenTransfer CALLDICT
__gen_store_TONBWallet INLINECALLDICT
}>
DUP
395134233 PUSHINT
EQUAL
IFJMP:<{
DROP
__gen_load_TONBWallet INLINECALLDICT
s0 s3 XCHG
__gen_read_TokenTransferInternal INLINECALLDICT
s6 POP
s7 s8 XCHG
s6 s7 XCHG
5 ROLL
$__gen_TONBWallet_receive_TokenTransferInternal CALLDICT
__gen_store_TONBWallet INLINECALLDICT
}>
1499400124 PUSHINT
EQUAL
IFJMP:<{
__gen_load_TONBWallet INLINECALLDICT
s0 s3 XCHG
__gen_read_TokenBurn INLINECALLDICT
s4 POP
s5 s6 XCHG
s4 s5 XCHG
3 ROLL
$__gen_TONBWallet_receive_TokenBurn CALLDICT
__gen_store_TONBWallet INLINECALLDICT
}>
DROP
130 THROW
}>
supported_interfaces PROC:<{
123515602279859691144772641439386770278 PUSHINT
209801025412363888721030803524359905849 PUSHINT
209778528950190195973528115415557644819 PUSHINT
}>
get_abi_ipfs PROC:<{
x{697066733a2f2f516d64655169627870364270386774544b437a694a7343667a614570627843347a43456f6d6e4262316e43796572} PUSHSLICE
}>
}END>c

860
sources/output/jetton_TONBWallet.code.rev.fif

@ -0,0 +1,860 @@
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
}> CALLREF
1 3 BLKDROP2
}> CALLREF
1 3 BLKSWAP
42 CALLDICT
<{
NEWC
2 GETGLOBVAR
s0 s1 XCHG
STREF
3 1 BLKSWAP
<{
s2 s3 XCHG2
257 PUSHINT
STIX
s0 s1 XCHG
STSLICER
s0 s1 XCHG
STSLICER
}> CALLREF
ENDC
c4 POP
}> CALLREF
}> PUSHCONT
IFJMP
s0 PUSH
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
}> CALLREF
1 3 BLKDROP2
}> CALLREF
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
s0 s1 XCHG
1 LDI
s0 s1 XCHG
<{
LDREF
}> PUSHCONT
<{
PUSHNULL
s0 s1 XCHG
}> PUSHCONT
IFELSE
LDGRAMS
s6 s6 XCPU
s1 s6 XCHG
s1 s5 XCHG
s1 s4 XCHG
s3 s3 s0 XCHG3
}> CALLREF
s7 POP
s8 s9 XCHG
s7 s8 XCHG
1 6 BLKSWAP
39 CALLDICT
<{
NEWC
2 GETGLOBVAR
s0 s1 XCHG
STREF
3 1 BLKSWAP
<{
s2 s3 XCHG2
257 PUSHINT
STIX
s0 s1 XCHG
STSLICER
s0 s1 XCHG
STSLICER
}> CALLREF
ENDC
c4 POP
}> CALLREF
}> IFJMPREF
s0 PUSH
395134233 PUSHINT
EQUAL
<{
s0 POP
<{
c4 PUSH
CTOS
LDREF
s0 s1 XCHG
2 SETGLOBVAR
<{
257 PUSHINT
LDI
LDMSGADDR
s0 s1 XCHG
s0 s1 XCHG
LDMSGADDR
s0 s1 XCHG
s3 s3 s0 XCHG3
}> CALLREF
1 3 BLKDROP2
}> CALLREF
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
}> CALLREF
s6 POP
s7 s8 XCHG
s6 s7 XCHG
1 5 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
}> CALLREF
ENDC
c4 POP
}> CALLREF
}> PUSHCONT
IFJMP
1499400124 PUSHINT
EQUAL
<{
<{
c4 PUSH
CTOS
LDREF
s0 s1 XCHG
2 SETGLOBVAR
<{
257 PUSHINT
LDI
LDMSGADDR
s0 s1 XCHG
s0 s1 XCHG
LDMSGADDR
s0 s1 XCHG
s3 s3 s0 XCHG3
}> CALLREF
1 3 BLKDROP2
}> CALLREF
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
}> CALLREF
s4 POP
s5 s6 XCHG
s4 s5 XCHG
1 3 BLKSWAP
41 CALLDICT
<{
NEWC
2 GETGLOBVAR
s0 s1 XCHG
STREF
3 1 BLKSWAP
<{
s2 s3 XCHG2
257 PUSHINT
STIX
s0 s1 XCHG
STSLICER
s0 s1 XCHG
STSLICER
}> CALLREF
ENDC
c4 POP
}> CALLREF
}> PUSHCONT
IFJMP
s0 POP
130 THROW
2:
s0 PUSH
ISNULL
128 THROWIF
30:
33:
0 PUSHINT
ROTREV
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
34:
NEWC
1 PUSHINT
s0 s1 XCHG
2 STI
s0 s7 XCHG2
s0 s1 XCHG
1 STI
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
s0 s1 XCHG
1 STI
NEWC
0 PUSHINT
s0 s1 XCHG
1 STI
0 PUSHINT
s0 s1 XCHG
1 STI
s4 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s0 s4 XCHG
2 CALLDICT
s0 s4 XCHG2
STREF
}> PUSHCONT
<{
s4 POP
s0 s3 XCHG
0 PUSHINT
s0 s1 XCHG
1 STI
}> PUSHCONT
IFELSE
s4 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s0 s4 XCHG
2 CALLDICT
s0 s4 XCHG2
STREF
}> PUSHCONT
<{
s4 POP
s0 s3 XCHG
0 PUSHINT
s0 s1 XCHG
1 STI
}> PUSHCONT
IFELSE
0 PUSHINT
s0 s1 XCHG
1 STI
s0 s2 XCHG
-1 PUSHINT
s0 s1 XCHG
1 STI
s0 s2 XCHG
ENDC
ROT
STREF
}> PUSHCONT
<{
s3 POP
s3 POP
s0 s1 XCHG
0 PUSHINT
s0 s1 XCHG
1 STI
}> PUSHCONT
IFELSE
s1 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s0 s1 XCHG
2 CALLDICT
s0 s1 XCHG
STREF
}> IFREFELSEREF
ENDC
s0 s1 XCHG
SENDRAWMSG
s1 POP
0 PUSHINT
s0 s1 XCHG
1 STI
35:
3 1 BLKDROP2
LDGRAMS
s1 POP
1 PUSHINT
SDSKIPFIRST
LDGRAMS
s1 POP
LDGRAMS
s0 POP
3 MULCONST
1 RSHIFT
36:
0 PUSHINT
s0 s3 XCHG
NEWC
STREF
s3 s1 s3 XCHG3
<{
s2 s3 XCHG2
257 PUSHINT
STIX
s0 s1 XCHG
STSLICER
s0 s1 XCHG
STSLICER
}> CALLREF
ENDC
37:
s0 s2 XCHG
CTOS
LDDICT
s0 POP
PUSHNULL
s0 s1 XCHG
24708 PUSHINT
s0 s1 XCHG
16 PUSHINT
DICTUGETREF
NULLSWAPIFNOT
135 THROWIFNOT
s0 s1 XCHG
24708 PUSHINT
s2 PUSH
s0 s2 XCHG
16 PUSHINT
DICTUSETREF
NEWC
STDICT
ENDC
s0 s0 s3 XCHG3
36 CALLDICT
38:
2 GETGLOBVAR
s1 s2 PUSH2
37 CALLDICT
s0 POP
39:
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
35 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
37 CALLDICT
2DUP
33 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
}> CALLREF
ENDC
}> CALLREF
s5 s6 XCHG
s3 s4 XCHG
ROTREV
34 CALLDICT
40:
1 GETGLOBVAR
4 UNTUPLE
s2 s10 PUSH2
SDEQ
NOT
<{
2 GETGLOBVAR
s11 s8 PUSH2
37 CALLDICT
s0 s1 XCHG
4429 PUSHINT
s0 s2 XCHG
33 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
<{
s4 s13 XCHG2
s3 s3 s0 XCHG3
35 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
}> CALLREF
ENDC
}> CALLREF
s8 PUSH
s4 s6 XCHG
s3 s1 s3 XCHG3
s5 s5 XCHG2
PUSHNULL
PUSHNULL
34 CALLDICT
s0 s5 XCHG2
}> PUSHCONT
<{
s7 s13 XCHG
s8 s9 XCHG2
8 BLKDROP
}> PUSHCONT
IFELSE
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
}> CALLREF
ENDC
}> CALLREF
s4 s7 XCHG
s3 s3 s0 XCHG3
s1 s7 XCHG
PUSHNULL
PUSHNULL
34 CALLDICT
}> IFREFELSEREF
s5 POP
2DROP
41:
2DROP
1 GETGLOBVAR
4 UNTUPLE
4429 PUSHINT
s3 s8 PUSH2
SDEQ
s4 s8 PUSH2
SDEQ
OR
THROWANYIFNOT
s8 s4 XCPU
SUB
62972 PUSHINT
s1 PUSH
-1 GTINT
THROWANYIFNOT
s3 s3 s0 XCHG3
s3 s8 PUXC
35 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
}> CALLREF
ENDC
}> CALLREF
3 0 4 XC2PU
s3 s3 XCHG2
PUSHNULL
PUSHNULL
34 CALLDICT
42:
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
}> CALLREF
1 3 BLKDROP2
}> CALLREF
38 CALLDICT
30 CALLDICT
113617:
123515602279859691144772641439386770278 PUSHINT
209801025412363888721030803524359905849 PUSHINT
209778528950190195973528115415557644819 PUSHINT
) 19 DICTPUSHCONST
DICTIGETJMPZ
11 THROWARG

BIN
sources/output/jetton_TONBWallet.init.boc

Binary file not shown.

37
sources/output/jetton_TONBWallet.init.fc

@ -0,0 +1,37 @@
() __tact_verify_address(slice address) inline {
throw_unless(136, address.slice_bits() != 267);
}
builder __tact_store_address(builder b, slice address) inline {
__tact_verify_address(address);
b = b.store_slice(address);
return b;
}
builder __gen_write_TONBWallet(builder build_0, (int, slice, slice) v) inline_ref {
var (v'balance, v'owner, v'master) = v;
build_0 = build_0.store_int(v'balance, 257);
build_0 = __tact_store_address(build_0, v'owner);
build_0 = __tact_store_address(build_0, v'master);
return build_0;
}
cell $__gen_TONBWallet_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_TONBWallet(b', ($self'balance, $self'owner, $self'master));
return b'.end_cell();
}
cell init(cell sys', slice $$master, slice $$owner) method_id {
slice $master = $$master;
slice $owner = $$owner;
return $__gen_TONBWallet_init(sys', $master, $owner);
}
() main() {
}

40
sources/output/jetton_TONBWallet.init.fif

@ -0,0 +1,40 @@
PROGRAM{
DECLPROC __tact_verify_address
DECLPROC __tact_store_address
DECLPROC __gen_write_TONBWallet
DECLPROC $__gen_TONBWallet_init
107886 DECLMETHOD init
DECLPROC main
__tact_verify_address PROCINLINE:<{
SBITS
267 PUSHINT
NEQ
136 THROWIFNOT
}>
__tact_store_address PROCINLINE:<{
STSLICER
}>
__gen_write_TONBWallet PROCREF:<{
s2 s3 XCHG2
257 PUSHINT
STIX
SWAP
__tact_store_address INLINECALLDICT
SWAP
__tact_store_address INLINECALLDICT
}>
$__gen_TONBWallet_init PROC:<{
0 PUSHINT
s0 s3 XCHG
NEWC
STREF
s3 s1 s3 XCHG3
__gen_write_TONBWallet INLINECALLDICT
ENDC
}>
init PROC:<{
$__gen_TONBWallet_init CALLDICT
}>
main PROC:<{
}>
}END>c

26
sources/output/jetton_TONBWallet.init.rev.fif

@ -0,0 +1,26 @@
SETCP0
(:methods
recv_internal:
4:
0 PUSHINT
s0 s3 XCHG
NEWC
STREF
s3 s1 s3 XCHG3
<{
s2 s3 XCHG2
257 PUSHINT
STIX
s0 s1 XCHG
STSLICER
s0 s1 XCHG
STSLICER
}> CALLREF
ENDC
107886:
4 CALLDICT
) 19 DICTPUSHCONST
DICTIGETJMPZ
11 THROWARG

83
sources/output/jetton_TONBWallet.md

@ -0,0 +1,83 @@
# TACT Compilation Report
Contract: TONBWallet
BOC Size: 1324 bytes
# Types
Total Types: 18
## StateInit
TLB: `_ code:^cell data:^cell = StateInit`
Signature: `StateInit{code:^cell,data:^cell}`
## Context
TLB: `_ bounced:bool sender:address value:int257 raw:^slice = Context`
Signature: `Context{bounced:bool,sender:address,value:int257,raw:^slice}`
## SendParameters
TLB: `_ bounce:bool to:address value:int257 mode:int257 body:Maybe ^cell code:Maybe ^cell data:Maybe ^cell = SendParameters`
Signature: `SendParameters{bounce:bool,to:address,value:int257,mode:int257,body:Maybe ^cell,code:Maybe ^cell,data:Maybe ^cell}`
## TokenTransfer
TLB: `token_transfer#0f8a7ea5 queryId:uint64 amount:coins destination:address responseDestination:Maybe address customPayload:Maybe ^cell forwardTonAmount:coins forwardPayload:remainder<slice> = TokenTransfer`
Signature: `TokenTransfer{queryId:uint64,amount:coins,destination:address,responseDestination:Maybe address,customPayload:Maybe ^cell,forwardTonAmount:coins,forwardPayload:remainder<slice>}`
## TokenTransferInternal
TLB: `token_transfer_internal#178d4519 queryId:uint64 amount:coins from:address responseAddress:Maybe address forwardTonAmount:coins forwardPayload:remainder<slice> = TokenTransferInternal`
Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder<slice>}`
## TokenNotification
TLB: `token_notification#7362d09c queryId:uint64 amount:coins from:address forwardPayload:remainder<slice> = TokenNotification`
Signature: `TokenNotification{queryId:uint64,amount:coins,from:address,forwardPayload:remainder<slice>}`
## TokenBurn
TLB: `token_burn#595f07bc queryId:uint64 amount:coins owner:address responseAddress:Maybe address = TokenBurn`
Signature: `TokenBurn{queryId:uint64,amount:coins,owner:address,responseAddress:Maybe address}`
## TokenBurnNotification
TLB: `token_burn_notification#7bdd97de queryId:uint64 amount:coins owner:address responseAddress:Maybe address = TokenBurnNotification`
Signature: `TokenBurnNotification{queryId:uint64,amount:coins,owner:address,responseAddress:Maybe address}`
## TokenExcesses
TLB: `token_excesses#d53276db queryId:uint64 = TokenExcesses`
Signature: `TokenExcesses{queryId:uint64}`
## TokenUpdateContent
TLB: `token_update_content#0c087a9e content:Maybe ^cell = TokenUpdateContent`
Signature: `TokenUpdateContent{content:Maybe ^cell}`
## JettonData
TLB: `_ totalSupply:int257 mintable:bool owner:address content:Maybe ^cell walletCode:^cell = JettonData`
Signature: `JettonData{totalSupply:int257,mintable:bool,owner:address,content:Maybe ^cell,walletCode:^cell}`
## JettonWalletData
TLB: `_ balance:int257 owner:address master:address walletCode:^cell = JettonWalletData`
Signature: `JettonWalletData{balance:int257,owner:address,master:address,walletCode:^cell}`
## InitLinker
TLB: `init_linker#453d436d owner:address = InitLinker`
Signature: `InitLinker{owner:address}`
## SetLinkerNeighbor
TLB: `set_linker_neighbor#b3fcf4c1 neighbor:Maybe address = SetLinkerNeighbor`
Signature: `SetLinkerNeighbor{neighbor:Maybe address}`
## WithdrawalRequests
TLB: `_ addresses:dict<int, address> amounts:dict<int, int> n_requests:int257 = WithdrawalRequests`
Signature: `WithdrawalRequests{addresses:dict<int, address>,amounts:dict<int, int>,n_requests:int257}`
## ChangeOwner
TLB: `change_owner#0f474d03 newOwner:address = ChangeOwner`
Signature: `ChangeOwner{newOwner:address}`
## Deposit
TLB: `deposit#21eeb607 amount:coins = Deposit`
Signature: `Deposit{amount:coins}`
## Withdraw
TLB: `withdraw#60591510 amount:int257 = Withdraw`
Signature: `Withdraw{amount:int257}`
# Get Methods
Total Get Methods: 1
## get_wallet_data

1
sources/output/jetton_TONBWallet.pkg

File diff suppressed because one or more lines are too long

1037
sources/output/jetton_TONBWallet.ts

File diff suppressed because it is too large Load Diff

31
sources/staking.tact

@ -0,0 +1,31 @@
fun stakingDepositMessage(value: Int, pool: Address): SendParameters {
return SendParameters{
to: pool,
value: value,
body: beginCell().storeSlice("Deposit".asSlice()).endCell()
};
}
fun stakingWithdrawMessage(value: Int, pool: Address): SendParameters {
return SendParameters{
to: pool,
value: ton("0.05"),
body: beginCell().storeUint(3665837821, 32).storeCoins(value).endCell()
};
}
struct WithdrawalRequests {
addresses: map[Int]Address;
amounts: map[Int]Int;
n_requests: Int;
}
fun withdrawalSum(requests: WithdrawalRequests): Int {
let sum: Int = 0;
let i: Int = 0;
while(i < requests.n_requests) {
sum = sum + requests.amounts.get(i)!!;
i = i + 1;
}
return sum;
}

66
sources/tests/__snapshots__/jetton.spec.ts.snap

@ -8,22 +8,78 @@ exports[`jetton should deploy 1`] = `
{
"message": {
"body": {
"cell": "x{8999B1640000000000000000000000000000000000000000000000000001C6BF526340004_}",
"cell": "x{21EEB60743B9ACA00}",
"type": "cell",
},
"bounce": true,
"from": "kQAI-3FJVc_ywSuY4vq0bYrzR7S4Och4y7bTU_i5yLOB3A6P",
"to": "kQCrEWck7tGRuwnumilB-HRzp2v-IxRzWG4Lw0mP_VYl72fg",
"to": "kQBbN1ES7aHOD-YQDRZ0b8_HFJFJtu99cbmeu79JtaT7mbCh",
"type": "internal",
"value": 1000000000n,
"value": 1100000000n,
},
"type": "received",
},
{
"gasUsed": 22165n,
"gasUsed": 22607n,
"type": "processed",
},
{
"messages": [
{
"body": {
"cell": "x{178D4519000000000000000043B9ACA00800B66EA225DB439C1FCC201A2CE8DF9F8E2922936DDEFAE3733D777E936B49F73300023EDC525573FCB04AE638BEAD1B62BCD1ED2E0E721E32EDB4D4FE2E722CE07702_}",
"type": "cell",
},
"bounce": false,
"from": "kQBbN1ES7aHOD-YQDRZ0b8_HFJFJtu99cbmeu79JtaT7mbCh",
"to": "kQBUyXAApVkXHsyW_DjETpmWFHRLXdFHz5XELjf5v7e3oluU",
"type": "internal",
"value": 182761000n,
},
],
"type": "sent",
},
]
`;
exports[`jetton should deploy 2`] = `[]`;
exports[`jetton should deploy and deposit the correct sub of money 1`] = `
[
{
"type": "deploy",
},
{
"message": {
"body": {
"cell": "x{21EEB60743B9ACA00}",
"type": "cell",
},
"bounce": true,
"from": "kQAI-3FJVc_ywSuY4vq0bYrzR7S4Och4y7bTU_i5yLOB3A6P",
"to": "kQBbN1ES7aHOD-YQDRZ0b8_HFJFJtu99cbmeu79JtaT7mbCh",
"type": "internal",
"value": 1100000000n,
},
"type": "received",
},
{
"gasUsed": 22607n,
"type": "processed",
},
{
"messages": [
{
"body": {
"cell": "x{178D4519000000000000000043B9ACA00800B66EA225DB439C1FCC201A2CE8DF9F8E2922936DDEFAE3733D777E936B49F73300023EDC525573FCB04AE638BEAD1B62BCD1ED2E0E721E32EDB4D4FE2E722CE07702_}",
"type": "cell",
},
"bounce": false,
"from": "kQBbN1ES7aHOD-YQDRZ0b8_HFJFJtu99cbmeu79JtaT7mbCh",
"to": "kQBUyXAApVkXHsyW_DjETpmWFHRLXdFHz5XELjf5v7e3oluU",
"type": "internal",
"value": 182761000n,
},
],
"type": "sent",
},
]
`;

25
sources/tests/jetton.spec.ts

@ -1,36 +1,35 @@
import { toNano, beginCell } from "ton";
import { toNano, Address } from "ton";
import { ContractSystem } from "ton-emulator";
import {TONB} from '../output/jetton_TONB';
import { default_content } from '../utils/config';
import { TONBWallet } from '../output/jetton_TONBWallet';
describe('jetton', () => {
it('should deploy', async () => {
it('should deploy and deposit the correct sum of money', async () => {
// Create jetton
let system = await ContractSystem.create();
let owner = system.treasure('owner');
let contract = system.open(await TONB.fromInit(owner.address, default_content));
let tracker = system.track(contract.address);
let wallet_contract = system.open(await TONBWallet.fromInit(contract.address, owner.address));
let wallet_tracker = system.track(wallet_contract.address);
// Mint
let res1 = await contract.send(owner, { value: toNano(1) }, { $$type: 'Deposit', amount: toNano(1000000) });
let res = await system.run();
console.log(res1)
console.log(res)
expect(tracker.events()).toMatchSnapshot();
expect(wallet_tracker.events()).toMatchSnapshot();
console.log(await wallet_contract.getGetWalletData());
await contract.send(owner, { value: toNano('1.1') }, { $$type: 'Deposit', amount: toNano('1') });
await system.run();
let events = tracker.events();
expect(events).toMatchSnapshot();
let addr = Address.parse((events[3] as any).messages[0].to);
let wallet_contract_2 = system.contract(addr);
let wdata = (await wallet_contract_2.get(97026, [])) as any;
expect(wdata.stack.items[0].value).toEqual(1000000000n);
// Check owner
expect((await contract.getOwner()).toString()).toEqual(owner.address.toString());
// Data
let data = await contract.getGetJettonData();
// console.warn(data);
console.log(tracker.events())
});
});

9
sources/tests/scenario.ts

@ -1,10 +1,11 @@
import { deployTONB, deposit, withdraw } from "../utils/interactions";
import { wallet_data } from '../utils/config';
import { deployTONB, deposit, withdraw, getTONB } from "../utils/interactions";
import { wallet_data, client } from '../utils/config';
import { randomAddress, TON } from '../utils/helpers';
import { toNano } from 'ton';
(async () => {
let {my_wallet, secretKey} = await wallet_data();
let tonb_addr = await deployTONB();
await deposit(my_wallet, secretKey, 1 * TON(), tonb_addr);
await withdraw(my_wallet, secretKey, 0.5 * TON(), tonb_addr);
// await deposit(my_wallet, secretKey, toNano('0.6'), tonb_addr);
await withdraw(my_wallet, secretKey, 0.45 * TON(), tonb_addr);
})();

49
sources/utils/interactions.ts

@ -1,14 +1,16 @@
import { Cell, Address, internal, beginCell, contractAddress, toNano, fromNano } from "ton";
import { Cell, Address, internal, beginCell, contractAddress, toNano, fromNano, SendMode } from "ton";
import { storeDeposit, storeWithdraw } from "../output/jetton_TONB";
import { TON } from "./helpers";
import { wallet_data, owner, default_content, workchain } from './config';
import {TONB} from "../output/jetton_TONB";
import { TONB } from "../output/jetton_TONB";
import { TONBWallet } from '../output/jetton_TONBWallet';
export async function sendMessage(wallet: any, secretKey: Buffer, msg: {value: string | bigint, to: Address, bounce?: boolean, init?: {code?: Cell, data?: Cell}, body?: any}) {
export async function sendMessage(wallet: any, secretKey: Buffer, msg: { value: string | bigint, to: Address, bounce?: boolean, init?: { code?: Cell, data?: Cell }, body?: any }) {
let seqno: number = await wallet.getSeqno();
return await wallet.sendTransfer({
seqno,
sendMode: SendMode.PAY_GAS_SEPARATLY + SendMode.IGNORE_ERRORS,
secretKey,
messages: [internal(msg)]
});
@ -20,8 +22,9 @@ export async function deposit(wallet: any, secretKey: Buffer, value_: bigint | n
let msg_body_b = beginCell();
storeDeposit({amount: value as bigint, $$type: 'Deposit'})(msg_body_b);
let msg_body = msg_body_b.endCell();
let msg_value = value as bigint + BigInt(0.1 * TON());
let res = await sendMessage(wallet, secretKey, {value: msg_value, to: tonb, body: msg_body});
// let msg_body = msg_body_b.storeUint(0x8999b164, 32).storeUint(value, 257).endCell();
let msg_value = value as bigint + toNano('0.1');
let res = await sendMessage(wallet, secretKey, { value: msg_value, to: tonb, body: msg_body });
console.log(res);
console.log('======deposit message sent ======');
}
@ -29,25 +32,36 @@ export async function deposit(wallet: any, secretKey: Buffer, value_: bigint | n
export async function withdraw(wallet: any, secretKey: Buffer, value_: bigint | number, tonb: Address) {
let value = BigInt(value_);
let msg_body_b = beginCell();
storeWithdraw({amount: value as bigint, $$type: 'Withdraw'})(msg_body_b);
storeWithdraw({ amount: value as bigint, $$type: 'Withdraw' })(msg_body_b);
let msg_body = msg_body_b.endCell();
let msg_value = BigInt(0.1 * TON());
await sendMessage(wallet, secretKey, {value: msg_value, to: tonb, body: msg_body});
let msg_value = toNano('0.05');
await sendMessage(wallet, secretKey, { value: msg_value, to: tonb, body: msg_body });
}
export async function getTONBState(tonb_content?: any) {
if (!tonb_content) {
tonb_content = default_content;
}
return await TONB.init(owner, tonb_content);
}
export async function deployTONB(tonb_content?: any) {
export async function getTONB(tonb_content?: any) {
if (!tonb_content) {
tonb_content = default_content;
}
let {my_wallet, secretKey, keyPair} = await wallet_data();
return await TONB.fromInit(owner, tonb_content);
}
export async function deployTONB(tonb_content?: any, cancel: boolean = false) {
let { my_wallet, secretKey, keyPair } = await wallet_data();
// Get deployment wallet balance
let balance: bigint = await my_wallet.getBalance();
let init = await getTONBState(tonb_content);
// Compute init data for deployment
let init = await TONB.init(owner, tonb_content);
let destination_address = contractAddress(workchain, init);
let deployAmount = toNano('0.5');
let deployAmount = toNano('0.1');
let supply = 500;
let amount = BigInt(supply * Math.pow(10, 9));
@ -59,6 +73,9 @@ export async function deployTONB(tonb_content?: any) {
console.log('🛠Preparing new outgoing massage from deployment wallet. Seqno = ', seqno, ', wallet = ', my_wallet.address);
console.log('Current deployment wallet balance = ', fromNano(balance).toString(), '💎TON');
// console.log('Totally supply for deployed Token = ', supply, ', amount = ', amount.toString());
if (cancel) {
return destination_address;
}
let res = await my_wallet.sendTransfer({
seqno,
secretKey,
@ -66,17 +83,17 @@ export async function deployTONB(tonb_content?: any) {
value: deployAmount,
to: destination_address,
init: {
code : init.code,
data : init.data
code: init.code,
data: init.data
}
})]
});
console.log('======deployment message sent to ', destination_address, ' ======');
console.log(res);
// console.log(res);
return destination_address;
}
export async function getAddress(master_: string | Address, owner_: string | Address) {
export async function getWalletAddress(master_: string | Address, owner_: string | Address) {
let master = typeof master_ === 'string' ? Address.parse(master_) : master_;
let owner = typeof owner_ === 'string' ? Address.parse(owner_) : owner_;
return contractAddress(workchain, await TONBWallet.init(master, owner));

2
sources/utils/rmlogs.sh

@ -1,3 +1,3 @@
#!/bin/hash
#!/bin/bash
for file in $(find sources/output -type f); do sed -i 's/,\ {\ logs:\ res.vmLogs\ }//g' $file; done
for file in $(find sources/output -type f); do sed -i 's/stringtoreplace//g' $file; done

26
yarn.lock

@ -756,6 +756,13 @@
dependencies:
"@babel/types" "^7.3.0"
"@types/bn.js@^5.1.1":
version "5.1.1"
resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682"
integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g==
dependencies:
"@types/node" "*"
"@types/graceful-fs@^4.1.3":
version "4.1.5"
resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz"
@ -990,6 +997,20 @@ base64-js@^1.3.1:
resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz"
integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==
bigint-buffer@^1.1.5:
version "1.1.5"
resolved "https://registry.yarnpkg.com/bigint-buffer/-/bigint-buffer-1.1.5.tgz#d038f31c8e4534c1f8d0015209bf34b4fa6dd442"
integrity sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==
dependencies:
bindings "^1.3.0"
bindings@^1.3.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df"
integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==
dependencies:
file-uri-to-path "1.0.0"
bl@^5.0.0:
version "5.1.0"
resolved "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz"
@ -1483,6 +1504,11 @@ fecha@^4.2.0:
resolved "https://registry.yarnpkg.com/fecha/-/fecha-4.2.3.tgz#4d9ccdbc61e8629b259fdca67e65891448d569fd"
integrity sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==
file-uri-to-path@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd"
integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==
fill-range@^7.0.1:
version "7.0.1"
resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz"

Loading…
Cancel
Save