Browse Source

Linker

master
Lev 2 years ago
parent
commit
79ca27256c
  1. 1
      package.json
  2. 6
      sources/constants.tact
  3. 7
      sources/jetton.tact
  4. 41
      sources/jetton_trait.tact
  5. 17
      sources/linker.tact
  6. 12
      sources/messages.tact
  7. 2
      sources/output/jetton_Linker.abi
  8. BIN
      sources/output/jetton_Linker.code.boc
  9. 28
      sources/output/jetton_Linker.code.fc
  10. 26
      sources/output/jetton_Linker.code.fif
  11. 109
      sources/output/jetton_Linker.code.rev.fif
  12. BIN
      sources/output/jetton_Linker.init.boc
  13. 17
      sources/output/jetton_Linker.init.fc
  14. 14
      sources/output/jetton_Linker.init.fif
  15. 21
      sources/output/jetton_Linker.init.rev.fif
  16. 20
      sources/output/jetton_Linker.md
  17. 2
      sources/output/jetton_Linker.pkg
  18. 133
      sources/output/jetton_Linker.ts
  19. 2
      sources/output/jetton_TONB.abi
  20. BIN
      sources/output/jetton_TONB.code.boc
  21. 79
      sources/output/jetton_TONB.code.fc
  22. 146
      sources/output/jetton_TONB.code.fif
  23. 294
      sources/output/jetton_TONB.code.rev.fif
  24. 14
      sources/output/jetton_TONB.md
  25. 2
      sources/output/jetton_TONB.pkg
  26. 106
      sources/output/jetton_TONB.ts
  27. 2
      sources/output/jetton_TONBWallet.abi
  28. BIN
      sources/output/jetton_TONBWallet.code.boc
  29. 77
      sources/output/jetton_TONBWallet.code.fc
  30. 145
      sources/output/jetton_TONBWallet.code.fif
  31. 357
      sources/output/jetton_TONBWallet.code.rev.fif
  32. BIN
      sources/output/jetton_TONBWallet.init.boc
  33. 20
      sources/output/jetton_TONBWallet.init.fc
  34. 27
      sources/output/jetton_TONBWallet.init.fif
  35. 29
      sources/output/jetton_TONBWallet.init.rev.fif
  36. 14
      sources/output/jetton_TONBWallet.md
  37. 2
      sources/output/jetton_TONBWallet.pkg
  38. 108
      sources/output/jetton_TONBWallet.ts
  39. 51
      sources/tests/__snapshots__/jetton.spec.ts.snap
  40. 22
      sources/tests/jetton.spec.ts
  41. 14
      sources/wallet.tact

1
package.json

@ -8,6 +8,7 @@
"scripts": { "scripts": {
"build": "tact --config tact.config.json && sources/utils/rmlogs.sh", "build": "tact --config tact.config.json && sources/utils/rmlogs.sh",
"test": "jest", "test": "jest",
"btest": "yarn build && yarn test -u",
"deploy": "ts-node sources/jetton.deploy.ts" "deploy": "ts-node sources/jetton.deploy.ts"
}, },
"dependencies": { "dependencies": {

6
sources/constants.tact

@ -0,0 +1,6 @@
const gas_consumption: Int = ton("0.01");
const withdraw_gas_consumption: Int = ton("0.01");
const deposit_gas_consumption: Int = ton("0.01"); // Gas consumption during processing
const linker_credit: Int = ton("0.02"); // TON to send to the linker for the fees
const wallet_credit: Int = ton("0.04"); // TON to send to the wallet for the fees

7
sources/jetton.tact

@ -4,6 +4,7 @@ import "./wallet";
import "./linker"; import "./linker";
import "./jetton_trait"; import "./jetton_trait";
import "./staking"; import "./staking";
import "./constants";
message Deposit { message Deposit {
amount: Int as coins; amount: Int as coins;
@ -14,11 +15,6 @@ message Withdraw {
} }
const gas_consumption: Int = ton("0.01");
const withdraw_gas_consumption: Int = ton("0.05");
const deposit_gas_consumption: Int = ton("0.05");
contract TONB with TONBTrait { contract TONB with TONBTrait {
@ -41,6 +37,7 @@ contract TONB with TONBTrait {
receive(msg: Deposit) { receive(msg: Deposit) {
let ctx: Context = context(); let ctx: Context = context();
require(ctx.value >= deposit_gas_consumption, "not enough money for deposit"); require(ctx.value >= deposit_gas_consumption, "not enough money for deposit");
// require(ctx.value >= deposit_gas_consumption + msg.amount + linker_credit + wallet_credit, "not enough money for deposit");
self.mint(ctx.sender, msg.amount, ctx.sender); self.mint(ctx.sender, msg.amount, ctx.sender);
} }

41
sources/jetton_trait.tact

@ -2,6 +2,7 @@
import "@stdlib/ownable"; import "@stdlib/ownable";
import "./wallet"; import "./wallet";
import "./linker"; import "./linker";
import "./constants";
@interface("org.ton.jetton.master") @interface("org.ton.jetton.master")
@ -88,34 +89,38 @@ trait TONBTrait with Ownable {
// Create message // Create message
let winit: StateInit = self.getJettonWalletInit(to); let winit: StateInit = self.getJettonWalletInit(to);
let walletAddress: Address = contractAddress(winit); let walletAddress: Address = contractAddress(winit);
// let linker_init: StateInit = initOf Linker(self.n_linkers, walletAddress); let linker_init: StateInit = initOf Linker(self.n_linkers, walletAddress, myAddress());
// let linker_address: Address = contractAddress(linker_init); 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{ send(SendParameters{
to: walletAddress, to: linker_address,
value: ton("0.2"), value: linker_credit,
bounce: false, bounce: false,
body: TokenTransferInternal{ body: SetLinkerNeighbor{
neighbor: self.last_linker
}.toCell(),
code: linker_init.code,
data: linker_init.data
});
self.last_linker = linker_address;
self.n_linkers = self.n_linkers + 1;
let wallet_msg_body: Cell = TokenTransferInternal{
amount: amount, amount: amount,
queryId: 0, queryId: 0,
from: myAddress(), from: myAddress(),
responseAddress: responseAddress, responseAddress: responseAddress,
forwardTonAmount: 0, forwardTonAmount: 0,
forwardPayload: emptySlice() forwardPayload: emptySlice(),
}.toCell(), setLinker: linker_address
}.toCell();
send(SendParameters{
to: walletAddress,
value: wallet_credit,
bounce: false,
body: wallet_msg_body,
code: winit.code, code: winit.code,
data: winit.data data: winit.data
}); });
} }
fun burn(from: Address, amount: Int, responseAddress: Address?) { fun burn(from: Address, amount: Int, responseAddress: Address?) {

17
sources/linker.tact

@ -1,19 +1,18 @@
import "@stdlib/ownable"; import "@stdlib/ownable";
import "./messages"; import "./messages";
import "./constants";
contract Linker { contract Linker {
index: Int; index: Int;
master: Address; master: Address;
owner: Address?; owner: Address;
neighbor: Address?; neighbor: Address?;
init(index: Int, owner: Address) { init(index: Int, owner: Address, master: Address) {
self.index = index; self.index = index;
self.owner = owner; self.owner = owner;
self.master = master;
let ctx: Context = context();
self.master = ctx.sender;
} }
receive(msg: SetLinkerNeighbor) { receive(msg: SetLinkerNeighbor) {
@ -21,4 +20,12 @@ contract Linker {
require(ctx.sender == self.master, "Invalid sender"); require(ctx.sender == self.master, "Invalid sender");
self.neighbor = msg.neighbor; self.neighbor = msg.neighbor;
} }
get fun owner(): Address? {
return self.owner;
}
get fun master(): Address {
return self.master;
}
} }

12
sources/messages.tact

@ -15,6 +15,7 @@ message(0x178d4519) TokenTransferInternal {
responseAddress: Address?; responseAddress: Address?;
forwardTonAmount: Int as coins; forwardTonAmount: Int as coins;
forwardPayload: Slice as remaining; forwardPayload: Slice as remaining;
setLinker: Address?;
} }
message(0x7362d09c) TokenNotification { message(0x7362d09c) TokenNotification {
@ -61,10 +62,15 @@ struct JettonWalletData {
walletCode: Cell; walletCode: Cell;
} }
message InitLinker { message SetLinkerNeighbor {
owner: Address; neighbor: Address?;
} }
message SetLinkerNeighbor { message InitLinker {
neighbor: Address?; neighbor: Address?;
walletAmount: Int;
walletCode: Cell;
walletData: Cell;
walletAddress: Address;
responseAddress: Address?;
} }

2
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.

28
sources/output/jetton_Linker.code.fc

@ -52,7 +52,7 @@ builder __gen_write_Linker(builder build_0, (int, slice, slice, slice) v) inline
var (v'index, v'master, v'owner, v'neighbor) = v; var (v'index, v'master, v'owner, v'neighbor) = v;
build_0 = build_0.store_int(v'index, 257); build_0 = build_0.store_int(v'index, 257);
build_0 = __tact_store_address(build_0, v'master); build_0 = __tact_store_address(build_0, v'master);
build_0 = __tact_store_address_opt(build_0, v'owner); build_0 = __tact_store_address(build_0, v'owner);
var build_1 = begin_cell(); var build_1 = begin_cell();
build_1 = __tact_store_address_opt(build_1, v'neighbor); build_1 = __tact_store_address_opt(build_1, v'neighbor);
build_0 = store_ref(build_0, build_1.end_cell()); build_0 = store_ref(build_0, build_1.end_cell());
@ -62,7 +62,7 @@ builder __gen_write_Linker(builder build_0, (int, slice, slice, slice) v) inline
(slice, ((int, slice, slice, slice))) __gen_read_Linker(slice sc_0) inline_ref { (slice, ((int, slice, slice, slice))) __gen_read_Linker(slice sc_0) inline_ref {
var v'index = sc_0~load_int(257); var v'index = sc_0~load_int(257);
var v'master = sc_0~__tact_load_address(); var v'master = sc_0~__tact_load_address();
var v'owner = sc_0~__tact_load_address_opt(); var v'owner = sc_0~__tact_load_address();
slice sc_1 = sc_0~load_ref().begin_parse(); slice sc_1 = sc_0~load_ref().begin_parse();
var v'neighbor = sc_1~__tact_load_address_opt(); var v'neighbor = sc_1~__tact_load_address_opt();
return (sc_0, (v'index, v'master, v'owner, v'neighbor)); return (sc_0, (v'index, v'master, v'owner, v'neighbor));
@ -81,6 +81,28 @@ builder __gen_write_Linker(builder build_0, (int, slice, slice, slice) v) inline
set_data(b.end_cell()); set_data(b.end_cell());
} }
slice $__gen_Linker_owner((int, slice, slice, slice) $self) impure {
var (($self'index, $self'master, $self'owner, $self'neighbor)) = $self;
return $self'owner;
}
_ $__gen_get_owner() method_id(83229) {
var self = __gen_load_Linker();
var res = $__gen_Linker_owner(self);
return res;
}
slice $__gen_Linker_master((int, slice, slice, slice) $self) impure {
var (($self'index, $self'master, $self'owner, $self'neighbor)) = $self;
return $self'master;
}
_ $__gen_get_master() method_id(120253) {
var self = __gen_load_Linker();
var res = $__gen_Linker_master(self);
return res;
}
(((int, slice, slice, slice)), ()) $__gen_Linker_receive_SetLinkerNeighbor((int, slice, slice, slice) $self, (slice) $msg) impure { (((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 ($self'index, $self'master, $self'owner, $self'neighbor) = $self;
var ($msg'neighbor) = $msg; var ($msg'neighbor) = $msg;
@ -129,5 +151,5 @@ _ supported_interfaces() method_id {
} }
_ get_abi_ipfs() { _ get_abi_ipfs() {
return "ipfs://QmT79j24zg2Re4mVCSdgbcXVAfBwfhsZveFUwQHpdgYjCU"; return "ipfs://QmXsiG6UvpNzjujBxShses6JYADwX9LFvLtVUBva7kHxgm";
} }

26
sources/output/jetton_Linker.code.fif

@ -11,6 +11,10 @@ PROGRAM{
DECLPROC __gen_read_Linker DECLPROC __gen_read_Linker
DECLPROC __gen_load_Linker DECLPROC __gen_load_Linker
DECLPROC __gen_store_Linker DECLPROC __gen_store_Linker
DECLPROC $__gen_Linker_owner
83229 DECLMETHOD $__gen_get_owner
DECLPROC $__gen_Linker_master
120253 DECLMETHOD $__gen_get_master
DECLPROC $__gen_Linker_receive_SetLinkerNeighbor DECLPROC $__gen_Linker_receive_SetLinkerNeighbor
DECLPROC recv_internal DECLPROC recv_internal
113617 DECLMETHOD supported_interfaces 113617 DECLMETHOD supported_interfaces
@ -76,7 +80,7 @@ PROGRAM{
SWAP SWAP
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
SWAP SWAP
__tact_store_address_opt INLINECALLDICT __tact_store_address INLINECALLDICT
NEWC NEWC
ROT ROT
__tact_store_address_opt INLINECALLDICT __tact_store_address_opt INLINECALLDICT
@ -89,7 +93,7 @@ PROGRAM{
LDIX LDIX
__tact_load_address INLINECALLDICT __tact_load_address INLINECALLDICT
SWAP SWAP
__tact_load_address_opt INLINECALLDICT __tact_load_address INLINECALLDICT
SWAP SWAP
LDREF LDREF
SWAP SWAP
@ -118,6 +122,22 @@ PROGRAM{
ENDC ENDC
c4 POP c4 POP
}> }>
$__gen_Linker_owner PROC:<{
s1 s3 XCHG
3 BLKDROP
}>
$__gen_get_owner PROC:<{
__gen_load_Linker INLINECALLDICT
$__gen_Linker_owner CALLDICT
}>
$__gen_Linker_master PROC:<{
s2 s3 XCHG
3 BLKDROP
}>
$__gen_get_master PROC:<{
__gen_load_Linker INLINECALLDICT
$__gen_Linker_master CALLDICT
}>
$__gen_Linker_receive_SetLinkerNeighbor PROC:<{ $__gen_Linker_receive_SetLinkerNeighbor PROC:<{
NIP NIP
__tact_context_get INLINECALLDICT __tact_context_get INLINECALLDICT
@ -180,6 +200,6 @@ PROGRAM{
209801025412363888721030803524359905849 PUSHINT 209801025412363888721030803524359905849 PUSHINT
}> }>
get_abi_ipfs PROC:<{ get_abi_ipfs PROC:<{
x{697066733a2f2f516d5437396a32347a67325265346d564353646762635856416642776668735a76654655775148706467596a4355} PUSHSLICE x{697066733a2f2f516d58736947365576704e7a6a756a42785368736573364a5941447758394c46764c745655427661376b4878676d} PUSHSLICE
}> }>
}END>c }END>c

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

@ -52,17 +52,7 @@ SETCP0
s0 s1 XCHG s0 s1 XCHG
s0 s1 XCHG s0 s1 XCHG
LDMSGADDR LDMSGADDR
s1 PUSH
2 PLDU
0 NEQINT
<{
s0 s1 XCHG s0 s1 XCHG
}> PUSHCONT
<{
s1 POP
PUSHNULL
}> PUSHCONT
IFELSE
s0 s1 XCHG s0 s1 XCHG
LDREF LDREF
s0 s1 XCHG s0 s1 XCHG
@ -108,7 +98,7 @@ SETCP0
s1 POP s1 POP
s3 s4 XCHG s3 s4 XCHG
s1 s3 s0 XCHG3 s1 s3 s0 XCHG3
13 CALLDICT 15 CALLDICT
<{ <{
NEWC NEWC
2 GETGLOBVAR 2 GETGLOBVAR
@ -122,18 +112,7 @@ SETCP0
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
s0 s1 XCHG s0 s1 XCHG
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER STSLICER
}> PUSHCONT
IFELSE
NEWC NEWC
ROT ROT
s0 PUSH s0 PUSH
@ -161,6 +140,14 @@ SETCP0
130 THROW 130 THROW
13: 13:
s1 s3 XCHG
3 BLKDROP
14:
s2 s3 XCHG
3 BLKDROP
15:
s1 POP s1 POP
1 GETGLOBVAR 1 GETGLOBVAR
4 UNTUPLE 4 UNTUPLE
@ -171,9 +158,87 @@ SETCP0
SDEQ SDEQ
THROWANYIFNOT THROWANYIFNOT
owner:
<{
c4 PUSH
CTOS
LDREF
s0 s1 XCHG
2 SETGLOBVAR
<{
257 PUSHINT
LDI
LDMSGADDR
s0 s1 XCHG
s0 s1 XCHG
LDMSGADDR
s0 s1 XCHG
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
13 CALLDICT
113617: 113617:
123515602279859691144772641439386770278 PUSHINT 123515602279859691144772641439386770278 PUSHINT
209801025412363888721030803524359905849 PUSHINT 209801025412363888721030803524359905849 PUSHINT
120253:
<{
c4 PUSH
CTOS
LDREF
s0 s1 XCHG
2 SETGLOBVAR
<{
257 PUSHINT
LDI
LDMSGADDR
s0 s1 XCHG
s0 s1 XCHG
LDMSGADDR
s0 s1 XCHG
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
14 CALLDICT
) 19 DICTPUSHCONST ) 19 DICTPUSHCONST
DICTIGETJMPZ DICTIGETJMPZ
11 THROWARG 11 THROWARG

BIN
sources/output/jetton_Linker.init.boc

Binary file not shown.

17
sources/output/jetton_Linker.init.fc

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

14
sources/output/jetton_Linker.init.fif

@ -1,5 +1,4 @@
PROGRAM{ PROGRAM{
DECLPROC __tact_context_get
DECLPROC __tact_verify_address DECLPROC __tact_verify_address
DECLPROC __tact_store_address DECLPROC __tact_store_address
DECLPROC __tact_store_address_opt DECLPROC __tact_store_address_opt
@ -7,12 +6,6 @@ PROGRAM{
DECLPROC $__gen_Linker_init DECLPROC $__gen_Linker_init
107886 DECLMETHOD init 107886 DECLMETHOD init
DECLPROC main DECLPROC main
DECLGLOBVAR __tact_context
DECLGLOBVAR __tact_context_sys
__tact_context_get PROCINLINE:<{
__tact_context GETGLOB
4 UNTUPLE
}>
__tact_verify_address PROCINLINE:<{ __tact_verify_address PROCINLINE:<{
SBITS SBITS
267 PUSHINT 267 PUSHINT
@ -41,7 +34,7 @@ PROGRAM{
SWAP SWAP
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
SWAP SWAP
__tact_store_address_opt INLINECALLDICT __tact_store_address INLINECALLDICT
NEWC NEWC
ROT ROT
__tact_store_address_opt INLINECALLDICT __tact_store_address_opt INLINECALLDICT
@ -51,13 +44,10 @@ PROGRAM{
}> }>
$__gen_Linker_init PROC:<{ $__gen_Linker_init PROC:<{
PUSHNULL PUSHNULL
__tact_context_get INLINECALLDICT
s2 s3 XCHG
3 BLKDROP
s0 s4 XCHG s0 s4 XCHG
NEWC NEWC
STREF STREF
s4 s4 s4 XCHG3 s2 s4 XCHG2
__gen_write_Linker INLINECALLDICT __gen_write_Linker INLINECALLDICT
ENDC ENDC
}> }>

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

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

20
sources/output/jetton_Linker.md

@ -1,6 +1,6 @@
# TACT Compilation Report # TACT Compilation Report
Contract: Linker Contract: Linker
BOC Size: 316 bytes BOC Size: 348 bytes
# Types # Types
Total Types: 18 Total Types: 18
@ -22,8 +22,8 @@ TLB: `token_transfer#0f8a7ea5 queryId:uint64 amount:coins destination:address re
Signature: `TokenTransfer{queryId:uint64,amount:coins,destination:address,responseDestination:Maybe address,customPayload:Maybe ^cell,forwardTonAmount:coins,forwardPayload:remainder<slice>}` Signature: `TokenTransfer{queryId:uint64,amount:coins,destination:address,responseDestination:Maybe address,customPayload:Maybe ^cell,forwardTonAmount:coins,forwardPayload:remainder<slice>}`
## TokenTransferInternal ## TokenTransferInternal
TLB: `token_transfer_internal#178d4519 queryId:uint64 amount:coins from:address responseAddress:Maybe address 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> setLinker:Maybe address = TokenTransferInternal`
Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder<slice>}` Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder<slice>,setLinker:Maybe address}`
## TokenNotification ## TokenNotification
TLB: `token_notification#7362d09c queryId:uint64 amount:coins from:address forwardPayload:remainder<slice> = TokenNotification` TLB: `token_notification#7362d09c queryId:uint64 amount:coins from:address forwardPayload:remainder<slice> = TokenNotification`
@ -53,14 +53,14 @@ Signature: `JettonData{totalSupply:int257,mintable:bool,owner:address,content:Ma
TLB: `_ balance:int257 owner:address master:address walletCode:^cell = JettonWalletData` TLB: `_ balance:int257 owner:address master:address walletCode:^cell = JettonWalletData`
Signature: `JettonWalletData{balance:int257,owner:address,master:address,walletCode:^cell}` Signature: `JettonWalletData{balance:int257,owner:address,master:address,walletCode:^cell}`
## InitLinker
TLB: `init_linker#453d436d owner:address = InitLinker`
Signature: `InitLinker{owner:address}`
## SetLinkerNeighbor ## SetLinkerNeighbor
TLB: `set_linker_neighbor#b3fcf4c1 neighbor:Maybe address = SetLinkerNeighbor` TLB: `set_linker_neighbor#b3fcf4c1 neighbor:Maybe address = SetLinkerNeighbor`
Signature: `SetLinkerNeighbor{neighbor:Maybe address}` Signature: `SetLinkerNeighbor{neighbor:Maybe address}`
## InitLinker
TLB: `init_linker#67c08154 neighbor:Maybe address walletAmount:int257 walletCode:^cell walletData:^cell walletAddress:address responseAddress:Maybe address = InitLinker`
Signature: `InitLinker{neighbor:Maybe address,walletAmount:int257,walletCode:^cell,walletData:^cell,walletAddress:address,responseAddress:Maybe address}`
## WithdrawalRequests ## WithdrawalRequests
TLB: `_ addresses:dict<int, address> amounts:dict<int, int> n_requests:int257 = 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}` Signature: `WithdrawalRequests{addresses:dict<int, address>,amounts:dict<int, int>,n_requests:int257}`
@ -78,4 +78,8 @@ TLB: `withdraw#60591510 amount:int257 = Withdraw`
Signature: `Withdraw{amount:int257}` Signature: `Withdraw{amount:int257}`
# Get Methods # Get Methods
Total Get Methods: 0 Total Get Methods: 2
## owner
## master

2
sources/output/jetton_Linker.pkg

File diff suppressed because one or more lines are too long

133
sources/output/jetton_Linker.ts

@ -247,6 +247,7 @@ export type TokenTransferInternal = {
responseAddress: Address | null; responseAddress: Address | null;
forwardTonAmount: bigint; forwardTonAmount: bigint;
forwardPayload: Cell; forwardPayload: Cell;
setLinker: Address | null;
} }
export function storeTokenTransferInternal(src: TokenTransferInternal) { export function storeTokenTransferInternal(src: TokenTransferInternal) {
@ -259,6 +260,9 @@ export function storeTokenTransferInternal(src: TokenTransferInternal) {
b_0.storeAddress(src.responseAddress); b_0.storeAddress(src.responseAddress);
b_0.storeCoins(src.forwardTonAmount); b_0.storeCoins(src.forwardTonAmount);
b_0.storeBuilder(src.forwardPayload.asBuilder()); b_0.storeBuilder(src.forwardPayload.asBuilder());
let b_1 = new Builder();
b_1.storeAddress(src.setLinker);
b_0.storeRef(b_1.endCell());
}; };
} }
@ -271,7 +275,9 @@ export function loadTokenTransferInternal(slice: Slice) {
let _responseAddress = sc_0.loadMaybeAddress(); let _responseAddress = sc_0.loadMaybeAddress();
let _forwardTonAmount = sc_0.loadCoins(); let _forwardTonAmount = sc_0.loadCoins();
let _forwardPayload = sc_0.asCell(); let _forwardPayload = sc_0.asCell();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; let sc_1 = sc_0.loadRef().beginParse();
let _setLinker = sc_1.loadMaybeAddress();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload, setLinker: _setLinker };
} }
function loadTupleTokenTransferInternal(source: TupleReader) { function loadTupleTokenTransferInternal(source: TupleReader) {
@ -281,7 +287,8 @@ function loadTupleTokenTransferInternal(source: TupleReader) {
let _responseAddress = source.readAddressOpt(); let _responseAddress = source.readAddressOpt();
let _forwardTonAmount = source.readBigNumber(); let _forwardTonAmount = source.readBigNumber();
let _forwardPayload = source.readCell(); let _forwardPayload = source.readCell();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; let _setLinker = source.readAddressOpt();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload, setLinker: _setLinker };
} }
function storeTupleTokenTransferInternal(source: TokenTransferInternal) { function storeTupleTokenTransferInternal(source: TokenTransferInternal) {
@ -292,6 +299,7 @@ function storeTupleTokenTransferInternal(source: TokenTransferInternal) {
builder.writeAddress(source.responseAddress); builder.writeAddress(source.responseAddress);
builder.writeNumber(source.forwardTonAmount); builder.writeNumber(source.forwardTonAmount);
builder.writeSlice(source.forwardPayload); builder.writeSlice(source.forwardPayload);
builder.writeAddress(source.setLinker);
return builder.build(); return builder.build();
} }
@ -668,85 +676,113 @@ function dictValueParserJettonWalletData(): DictionaryValue<JettonWalletData> {
} }
} }
} }
export type InitLinker = { export type SetLinkerNeighbor = {
$$type: 'InitLinker'; $$type: 'SetLinkerNeighbor';
owner: Address; neighbor: Address | null;
} }
export function storeInitLinker(src: InitLinker) { export function storeSetLinkerNeighbor(src: SetLinkerNeighbor) {
return (builder: Builder) => { return (builder: Builder) => {
let b_0 = builder; let b_0 = builder;
b_0.storeUint(1161642861, 32); b_0.storeUint(3019699393, 32);
b_0.storeAddress(src.owner); b_0.storeAddress(src.neighbor);
}; };
} }
export function loadInitLinker(slice: Slice) { export function loadSetLinkerNeighbor(slice: Slice) {
let sc_0 = slice; let sc_0 = slice;
if (sc_0.loadUint(32) !== 1161642861) { throw Error('Invalid prefix'); } if (sc_0.loadUint(32) !== 3019699393) { throw Error('Invalid prefix'); }
let _owner = sc_0.loadAddress(); let _neighbor = sc_0.loadMaybeAddress();
return { $$type: 'InitLinker' as const, owner: _owner }; return { $$type: 'SetLinkerNeighbor' as const, neighbor: _neighbor };
} }
function loadTupleInitLinker(source: TupleReader) { function loadTupleSetLinkerNeighbor(source: TupleReader) {
let _owner = source.readAddress(); let _neighbor = source.readAddressOpt();
return { $$type: 'InitLinker' as const, owner: _owner }; return { $$type: 'SetLinkerNeighbor' as const, neighbor: _neighbor };
} }
function storeTupleInitLinker(source: InitLinker) { function storeTupleSetLinkerNeighbor(source: SetLinkerNeighbor) {
let builder = new TupleBuilder(); let builder = new TupleBuilder();
builder.writeAddress(source.owner); builder.writeAddress(source.neighbor);
return builder.build(); return builder.build();
} }
function dictValueParserInitLinker(): DictionaryValue<InitLinker> { function dictValueParserSetLinkerNeighbor(): DictionaryValue<SetLinkerNeighbor> {
return { return {
serialize: (src, buidler) => { serialize: (src, buidler) => {
buidler.storeRef(beginCell().store(storeInitLinker(src)).endCell()); buidler.storeRef(beginCell().store(storeSetLinkerNeighbor(src)).endCell());
}, },
parse: (src) => { parse: (src) => {
return loadInitLinker(src.loadRef().beginParse()); return loadSetLinkerNeighbor(src.loadRef().beginParse());
} }
} }
} }
export type SetLinkerNeighbor = { export type InitLinker = {
$$type: 'SetLinkerNeighbor'; $$type: 'InitLinker';
neighbor: Address | null; neighbor: Address | null;
walletAmount: bigint;
walletCode: Cell;
walletData: Cell;
walletAddress: Address;
responseAddress: Address | null;
} }
export function storeSetLinkerNeighbor(src: SetLinkerNeighbor) { export function storeInitLinker(src: InitLinker) {
return (builder: Builder) => { return (builder: Builder) => {
let b_0 = builder; let b_0 = builder;
b_0.storeUint(3019699393, 32); b_0.storeUint(1740669268, 32);
b_0.storeAddress(src.neighbor); b_0.storeAddress(src.neighbor);
b_0.storeInt(src.walletAmount, 257);
b_0.storeRef(src.walletCode);
b_0.storeRef(src.walletData);
b_0.storeAddress(src.walletAddress);
let b_1 = new Builder();
b_1.storeAddress(src.responseAddress);
b_0.storeRef(b_1.endCell());
}; };
} }
export function loadSetLinkerNeighbor(slice: Slice) { export function loadInitLinker(slice: Slice) {
let sc_0 = slice; let sc_0 = slice;
if (sc_0.loadUint(32) !== 3019699393) { throw Error('Invalid prefix'); } if (sc_0.loadUint(32) !== 1740669268) { throw Error('Invalid prefix'); }
let _neighbor = sc_0.loadMaybeAddress(); let _neighbor = sc_0.loadMaybeAddress();
return { $$type: 'SetLinkerNeighbor' as const, neighbor: _neighbor }; let _walletAmount = sc_0.loadIntBig(257);
let _walletCode = sc_0.loadRef();
let _walletData = sc_0.loadRef();
let _walletAddress = sc_0.loadAddress();
let sc_1 = sc_0.loadRef().beginParse();
let _responseAddress = sc_1.loadMaybeAddress();
return { $$type: 'InitLinker' as const, neighbor: _neighbor, walletAmount: _walletAmount, walletCode: _walletCode, walletData: _walletData, walletAddress: _walletAddress, responseAddress: _responseAddress };
} }
function loadTupleSetLinkerNeighbor(source: TupleReader) { function loadTupleInitLinker(source: TupleReader) {
let _neighbor = source.readAddressOpt(); let _neighbor = source.readAddressOpt();
return { $$type: 'SetLinkerNeighbor' as const, neighbor: _neighbor }; let _walletAmount = source.readBigNumber();
let _walletCode = source.readCell();
let _walletData = source.readCell();
let _walletAddress = source.readAddress();
let _responseAddress = source.readAddressOpt();
return { $$type: 'InitLinker' as const, neighbor: _neighbor, walletAmount: _walletAmount, walletCode: _walletCode, walletData: _walletData, walletAddress: _walletAddress, responseAddress: _responseAddress };
} }
function storeTupleSetLinkerNeighbor(source: SetLinkerNeighbor) { function storeTupleInitLinker(source: InitLinker) {
let builder = new TupleBuilder(); let builder = new TupleBuilder();
builder.writeAddress(source.neighbor); builder.writeAddress(source.neighbor);
builder.writeNumber(source.walletAmount);
builder.writeCell(source.walletCode);
builder.writeCell(source.walletData);
builder.writeAddress(source.walletAddress);
builder.writeAddress(source.responseAddress);
return builder.build(); return builder.build();
} }
function dictValueParserSetLinkerNeighbor(): DictionaryValue<SetLinkerNeighbor> { function dictValueParserInitLinker(): DictionaryValue<InitLinker> {
return { return {
serialize: (src, buidler) => { serialize: (src, buidler) => {
buidler.storeRef(beginCell().store(storeSetLinkerNeighbor(src)).endCell()); buidler.storeRef(beginCell().store(storeInitLinker(src)).endCell());
}, },
parse: (src) => { parse: (src) => {
return loadSetLinkerNeighbor(src.loadRef().beginParse()); return loadInitLinker(src.loadRef().beginParse());
} }
} }
} }
@ -922,15 +958,16 @@ function dictValueParserWithdraw(): DictionaryValue<Withdraw> {
} }
} }
} }
async function Linker_init(index: bigint, owner: Address) { async function Linker_init(index: bigint, owner: Address, master: Address) {
const __init = 'te6ccgEBBwEAYAABFP8A9KQT9LzyyAsBAgFiAgMCAs0EBQAJoUrd4A0AAdQBI2m34QW8kECNfAwTIzERE2zzJgYAUFA0gQEBzwABzxYBIG6VMHABywGSzxbiyFggbpUwcAHLAZLPFuLJAcw='; const __init = 'te6ccgEBBwEATgABFP8A9KQT9LzyyAsBAgFiAgMCAs0EBQAJoUrd4AsAAdQBE2W0EyMxQJNs8yYGADxQNIEBAc8AAc8WAc8WyFggbpUwcAHLAZLPFuLJAcw=';
const __code = 'te6ccgECCwEAATAAART/APSkE/S88sgLAQIBYgIDAgLMBAUATaF3owTgudh6ullc9j0J2HOslQo2zQThO6xqWlbI+WZFp15b++LEcwOL24EOuk4Q/KmBBrhY/vAWhpgYC42GAAyL/IuHEA/SARKDM3gnwwgUit8EEIWf56YN1Hx22eAm2eGIgaIJh4Bu2ecBh5YEFAYHCAAfumPwgt5ItwIimmRJjgvl6QEW7UTQ1AH4Yts8bBQJADbTHwGCELP89MG68uCB+kAh1wsBwwCRAZIxbeIBGMj4QgHMVTDbPMntVAoAWoEBAdcA+kABAfpAIdcLAcMAkQGSMW3iAdQB0PpAIdcLAcMAkQGSMW3iMRRDMABQUDSBAQHPAAHPFgEgbpUwcAHLAZLPFuLIWCBulTBwAcsBks8W4skBzA=='; const __code = 'te6ccgECEwEAAVAAART/APSkE/S88sgLAQIBYgIDAgLMBAUCASANDgOL24EOuk4Q/KmBBrhY/vAWhpgYC42GAAyL/IuHEA/SARKDM3gnwwgUit8EEIWf56YN1Hx22eAm2eGIgaIJh4B+2ecBh5YEFBEGBwIBWAkKADbTHwGCELP89MG68uCB+kAh1wsBwwCRAZIxbeIBGMj4QgHMVTDbPMntVAgAPFA0gQEBzwABzxYBz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RAZIxbeIBFu1E0NQB+GLbPGwUFABEgQEB1wD6QAEB+kABAdQB0PpAIdcLAcMAkQGSMW3iMRRDMEhMYDc=';
let systemCell = Cell.fromBase64(__system); let systemCell = Cell.fromBase64(__system);
let builder = new TupleBuilder(); let builder = new TupleBuilder();
builder.writeCell(systemCell); builder.writeCell(systemCell);
builder.writeNumber(index); builder.writeNumber(index);
builder.writeAddress(owner); builder.writeAddress(owner);
builder.writeAddress(master);
let __stack = builder.build(); let __stack = builder.build();
let codeCell = Cell.fromBoc(Buffer.from(__code, 'base64'))[0]; let codeCell = Cell.fromBoc(Buffer.from(__code, 'base64'))[0];
let initCell = Cell.fromBoc(Buffer.from(__init, 'base64'))[0]; let initCell = Cell.fromBoc(Buffer.from(__init, 'base64'))[0];
@ -984,12 +1021,12 @@ const Linker_errors: { [key: number]: { message: string } } = {
export class Linker implements Contract { export class Linker implements Contract {
static async init(index: bigint, owner: Address) { static async init(index: bigint, owner: Address, master: Address) {
return await Linker_init(index,owner); return await Linker_init(index,owner,master);
} }
static async fromInit(index: bigint, owner: Address) { static async fromInit(index: bigint, owner: Address, master: Address) {
const init = await Linker_init(index,owner); const init = await Linker_init(index,owner,master);
const address = contractAddress(0, init); const address = contractAddress(0, init);
return new Linker(address, init); return new Linker(address, init);
} }
@ -1021,4 +1058,18 @@ export class Linker implements Contract {
} }
async getOwner(provider: ContractProvider) {
let builder = new TupleBuilder();
let source = (await provider.get('owner', builder.build())).stack;
let result = source.readAddressOpt();
return result;
}
async getMaster(provider: ContractProvider) {
let builder = new TupleBuilder();
let source = (await provider.get('master', builder.build())).stack;
let result = source.readAddress();
return result;
}
} }

2
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.

79
sources/output/jetton_TONB.code.fc

@ -79,8 +79,8 @@ cell __tact_dict_get_code(cell dict, int id) inline {
return data; return data;
} }
builder __gen_write_TokenTransferInternal(builder build_0, (int, int, slice, slice, int, slice) v) inline_ref { builder __gen_write_TokenTransferInternal(builder build_0, (int, int, slice, slice, int, slice, slice) v) inline_ref {
var (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload) = v; var (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload, v'setLinker) = v;
build_0 = store_uint(build_0, 395134233, 32); build_0 = store_uint(build_0, 395134233, 32);
build_0 = build_0.store_uint(v'queryId, 64); build_0 = build_0.store_uint(v'queryId, 64);
build_0 = build_0.store_coins(v'amount); build_0 = build_0.store_coins(v'amount);
@ -88,10 +88,13 @@ builder __gen_write_TokenTransferInternal(builder build_0, (int, int, slice, sli
build_0 = __tact_store_address_opt(build_0, v'responseAddress); build_0 = __tact_store_address_opt(build_0, v'responseAddress);
build_0 = build_0.store_coins(v'forwardTonAmount); build_0 = build_0.store_coins(v'forwardTonAmount);
build_0 = build_0.store_slice(v'forwardPayload); build_0 = build_0.store_slice(v'forwardPayload);
var build_1 = begin_cell();
build_1 = __tact_store_address_opt(build_1, v'setLinker);
build_0 = store_ref(build_0, build_1.end_cell());
return build_0; return build_0;
} }
cell __gen_writecell_TokenTransferInternal((int, int, slice, slice, int, slice) v) inline_ref { cell __gen_writecell_TokenTransferInternal((int, int, slice, slice, int, slice, slice) v) inline_ref {
return __gen_write_TokenTransferInternal(begin_cell(), v).end_cell(); return __gen_write_TokenTransferInternal(begin_cell(), v).end_cell();
} }
@ -135,6 +138,17 @@ cell __gen_writecell_TokenExcesses((int) v) inline_ref {
return (sc_0, (v'content)); return (sc_0, (v'content));
} }
builder __gen_write_SetLinkerNeighbor(builder build_0, (slice) v) inline_ref {
var (v'neighbor) = v;
build_0 = store_uint(build_0, 3019699393, 32);
build_0 = __tact_store_address_opt(build_0, v'neighbor);
return build_0;
}
cell __gen_writecell_SetLinkerNeighbor((slice) v) inline_ref {
return __gen_write_SetLinkerNeighbor(begin_cell(), v).end_cell();
}
(slice, ((int))) __gen_read_Deposit(slice sc_0) inline_ref { (slice, ((int))) __gen_read_Deposit(slice sc_0) inline_ref {
throw_unless(129, sc_0~load_uint(32) == 569292295); throw_unless(129, sc_0~load_uint(32) == 569292295);
var v'amount = sc_0~load_coins(); var v'amount = sc_0~load_coins();
@ -147,11 +161,25 @@ cell __gen_writecell_TokenExcesses((int) v) inline_ref {
return (sc_0, (v'amount)); return (sc_0, (v'amount));
} }
builder __gen_write_TONBWallet(builder build_0, (int, slice, slice) v) inline_ref { builder __gen_write_TONBWallet(builder build_0, (int, slice, slice, slice) v) inline_ref {
var (v'balance, v'owner, v'master) = v; var (v'balance, v'owner, v'master, v'linker) = v;
build_0 = build_0.store_int(v'balance, 257); build_0 = build_0.store_int(v'balance, 257);
build_0 = __tact_store_address(build_0, v'owner); build_0 = __tact_store_address(build_0, v'owner);
build_0 = __tact_store_address(build_0, v'master); build_0 = __tact_store_address(build_0, v'master);
var build_1 = begin_cell();
build_1 = __tact_store_address_opt(build_1, v'linker);
build_0 = store_ref(build_0, build_1.end_cell());
return build_0;
}
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(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; return build_0;
} }
@ -273,13 +301,13 @@ slice $contractAddress((cell, cell) $s) impure {
} }
cell $__gen_TONBWallet_init(cell sys', slice $master, slice $owner) { cell $__gen_TONBWallet_init(cell sys', slice $master, slice $owner) {
var (($self'balance, $self'owner, $self'master)) = (null(), null(), null()); var (($self'balance, $self'owner, $self'master, $self'linker)) = (null(), null(), null(), null());
$self'balance = 0; $self'balance = 0;
$self'owner = $owner; $self'owner = $owner;
$self'master = $master; $self'master = $master;
var b' = begin_cell(); var b' = begin_cell();
b' = b'.store_ref(sys'); b' = b'.store_ref(sys');
b' = __gen_write_TONBWallet(b', ($self'balance, $self'owner, $self'master)); b' = __gen_write_TONBWallet(b', ($self'balance, $self'owner, $self'master, $self'linker));
return b'.end_cell(); return b'.end_cell();
} }
@ -295,6 +323,29 @@ cell $__gen_TONBWallet_init(cell sys', slice $master, slice $owner) {
return (mine, $__gen_TONBWallet_init(sys, $master, $owner)); return (mine, $__gen_TONBWallet_init(sys, $master, $owner));
} }
cell $__gen_Linker_init(cell sys', int $index, slice $owner, slice $master) {
var (($self'index, $self'master, $self'owner, $self'neighbor)) = (null(), null(), null(), null());
$self'index = $index;
$self'owner = $owner;
$self'master = $master;
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, cell) $__gen_Linker_init_child(cell sys', int $index, slice $owner, slice $master) {
slice sc' = sys'.begin_parse();
cell source = sc'~load_dict();
cell contracts = new_dict();
;; Contract Code: Linker
cell mine = __tact_dict_get_code(source, 59979);
contracts = __tact_dict_set_code(contracts, 59979, mine);
cell sys = begin_cell().store_dict(contracts).end_cell();
return (mine, $__gen_Linker_init(sys, $index, $owner, $master));
}
((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 { ((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; 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)); 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));
@ -330,7 +381,13 @@ _ $__gen_get_get_jetton_data() method_id(106029) {
$self'totalSupply = ($self'totalSupply + $amount); $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); 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)); 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)); var ($linker_init'code, $linker_init'data) = $__gen_Linker_init_child(__tact_context_sys, $self'n_linkers, $walletAddress, my_address());
slice $linker_address = $contractAddress(($linker_init'code, $linker_init'data));
$send((false, $linker_address, 20000000, 0, __gen_writecell_SetLinkerNeighbor(($self'last_linker)), $linker_init'code, $linker_init'data));
$self'last_linker = $linker_address;
$self'n_linkers = ($self'n_linkers + 1);
cell $wallet_msg_body = __gen_writecell_TokenTransferInternal((0, $amount, my_address(), $responseAddress, 0, $emptySlice(), $linker_address));
$send((false, $walletAddress, 40000000, 0, $wallet_msg_body, $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), ()); return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ());
} }
@ -371,7 +428,7 @@ _ $__gen_get_owner() method_id(83229) {
var ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool) = $self; 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 ($msg'amount) = $msg;
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get();
throw_unless(32366, ($ctx'value >= 50000000)); throw_unless(32366, ($ctx'value >= 10000000));
($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); ($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), ()); return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ());
} }
@ -385,7 +442,7 @@ _ $__gen_get_owner() method_id(83229) {
var ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool) = $self; 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 ($msg'amount) = $msg;
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get();
throw_unless(6384, ($ctx'value >= 50000000)); throw_unless(6384, ($ctx'value >= 10000000));
($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); ($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), ()); return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ());
} }
@ -485,5 +542,5 @@ _ supported_interfaces() method_id {
} }
_ get_abi_ipfs() { _ get_abi_ipfs() {
return "ipfs://Qma6JYPtEyX4isBJUUKdLJZsPe3r5ig6X7NFfzn7hBBCFC"; return "ipfs://QmPvEiZGrqt4f1VDKeQxyzgba7g5qVaCcnFiXAyVCz4R9o";
} }

146
sources/output/jetton_TONB.code.fif

@ -20,9 +20,12 @@ PROGRAM{
DECLPROC __gen_write_TokenExcesses DECLPROC __gen_write_TokenExcesses
DECLPROC __gen_writecell_TokenExcesses DECLPROC __gen_writecell_TokenExcesses
DECLPROC __gen_read_TokenUpdateContent DECLPROC __gen_read_TokenUpdateContent
DECLPROC __gen_write_SetLinkerNeighbor
DECLPROC __gen_writecell_SetLinkerNeighbor
DECLPROC __gen_read_Deposit DECLPROC __gen_read_Deposit
DECLPROC __gen_read_Withdraw DECLPROC __gen_read_Withdraw
DECLPROC __gen_write_TONBWallet DECLPROC __gen_write_TONBWallet
DECLPROC __gen_write_Linker
DECLPROC __gen_write_TONB DECLPROC __gen_write_TONB
DECLPROC __gen_read_TONB DECLPROC __gen_read_TONB
DECLPROC __gen_StateInit_get_code DECLPROC __gen_StateInit_get_code
@ -37,6 +40,8 @@ PROGRAM{
DECLPROC $send DECLPROC $send
DECLPROC $__gen_TONBWallet_init DECLPROC $__gen_TONBWallet_init
DECLPROC $__gen_TONBWallet_init_child DECLPROC $__gen_TONBWallet_init_child
DECLPROC $__gen_Linker_init
DECLPROC $__gen_Linker_init_child
DECLPROC $__gen_TONB_getJettonWalletInit DECLPROC $__gen_TONB_getJettonWalletInit
DECLPROC $__gen_TONB_get_wallet_address DECLPROC $__gen_TONB_get_wallet_address
103289 DECLMETHOD $__gen_get_get_wallet_address 103289 DECLMETHOD $__gen_get_get_wallet_address
@ -157,13 +162,13 @@ PROGRAM{
}> }>
__gen_write_TokenTransferInternal PROCREF:<{ __gen_write_TokenTransferInternal PROCREF:<{
395134233 PUSHINT 395134233 PUSHINT
s0 s7 XCHG2 s0 s8 XCHG2
32 STU 32 STU
s1 s5 XCHG s1 s6 XCHG
64 STU 64 STU
s0 s3 XCHG2 s0 s4 XCHG2
STGRAMS STGRAMS
SWAP ROT
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
SWAP SWAP
__tact_store_address_opt INLINECALLDICT __tact_store_address_opt INLINECALLDICT
@ -171,10 +176,16 @@ PROGRAM{
STGRAMS STGRAMS
SWAP SWAP
STSLICER STSLICER
NEWC
ROT
__tact_store_address_opt INLINECALLDICT
ENDC
SWAP
STREF
}> }>
__gen_writecell_TokenTransferInternal PROCREF:<{ __gen_writecell_TokenTransferInternal PROCREF:<{
NEWC NEWC
6 -ROLL 7 -ROLL
__gen_write_TokenTransferInternal INLINECALLDICT __gen_write_TokenTransferInternal INLINECALLDICT
ENDC ENDC
}> }>
@ -239,6 +250,19 @@ PROGRAM{
}> }>
SWAP SWAP
}> }>
__gen_write_SetLinkerNeighbor PROCREF:<{
3019699393 PUSHINT
ROT
32 STU
SWAP
__tact_store_address_opt INLINECALLDICT
}>
__gen_writecell_SetLinkerNeighbor PROCREF:<{
NEWC
SWAP
__gen_write_SetLinkerNeighbor INLINECALLDICT
ENDC
}>
__gen_read_Deposit PROCREF:<{ __gen_read_Deposit PROCREF:<{
32 LDU 32 LDU
SWAP SWAP
@ -259,13 +283,34 @@ PROGRAM{
SWAP SWAP
}> }>
__gen_write_TONBWallet PROCREF:<{ __gen_write_TONBWallet PROCREF:<{
s2 s3 XCHG2 s3 s4 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
SWAP SWAP
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
SWAP SWAP
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
NEWC
ROT
__tact_store_address_opt INLINECALLDICT
ENDC
SWAP
STREF
}>
__gen_write_Linker PROCREF:<{
s3 s4 XCHG2
257 PUSHINT
STIX
SWAP
__tact_store_address INLINECALLDICT
SWAP
__tact_store_address INLINECALLDICT
NEWC
ROT
__tact_store_address_opt INLINECALLDICT
ENDC
SWAP
STREF
}> }>
__gen_write_TONB PROCREF:<{ __gen_write_TONB PROCREF:<{
s8 s7 XCHG2 s8 s7 XCHG2
@ -477,11 +522,13 @@ PROGRAM{
SENDRAWMSG SENDRAWMSG
}> }>
$__gen_TONBWallet_init PROC:<{ $__gen_TONBWallet_init PROC:<{
PUSHNULL
0 PUSHINT 0 PUSHINT
s0 s3 XCHG s0 s4 XCHG
NEWC NEWC
STREF STREF
s3 s1 s3 XCHG3 s0 s4 XCHG
s3 s3 XCHG2
__gen_write_TONBWallet INLINECALLDICT __gen_write_TONBWallet INLINECALLDICT
ENDC ENDC
}> }>
@ -504,6 +551,35 @@ PROGRAM{
s0 s0 s3 XCHG3 s0 s0 s3 XCHG3
$__gen_TONBWallet_init CALLDICT $__gen_TONBWallet_init CALLDICT
}> }>
$__gen_Linker_init PROC:<{
PUSHNULL
s0 s4 XCHG
NEWC
STREF
s2 s4 XCHG2
__gen_write_Linker INLINECALLDICT
ENDC
}>
$__gen_Linker_init_child PROC:<{
s0 s3 XCHG
CTOS
LDDICT
DROP
NEWDICT
SWAP
59979 PUSHINT
__tact_dict_get_code INLINECALLDICT
SWAP
59979 PUSHINT
s2 PUSH
__tact_dict_set_code INLINECALLDICT
NEWC
STDICT
ENDC
3 -ROLL
s0 s4 XCHG
$__gen_Linker_init CALLDICT
}>
$__gen_TONB_getJettonWalletInit PROC:<{ $__gen_TONB_getJettonWalletInit PROC:<{
__tact_context_sys GETGLOB __tact_context_sys GETGLOB
MYADDR MYADDR
@ -539,24 +615,50 @@ PROGRAM{
$__gen_TONB_getJettonWalletInit CALLDICT $__gen_TONB_getJettonWalletInit CALLDICT
2DUP 2DUP
$contractAddress CALLDICT $contractAddress CALLDICT
__tact_context_sys GETGLOB
MYADDR
s6 s2 s(-2) PU2XC
$__gen_Linker_init_child CALLDICT
2DUP
$contractAddress CALLDICT
FALSE FALSE
200000000 PUSHINT 20000000 PUSHINT
0 PUSHINT
s0 s11 XCHG
__gen_writecell_SetLinkerNeighbor INLINECALLDICT
s3 PUSH
s3 s6 XCHG
s4 s1 s5 XCHG3
s3 s12 XCHG
s1 s12 s0 XCHG3
$send CALLDICT
s5 PUSH
s0 s5 XCHG
INC
0 PUSHINT 0 PUSHINT
DUP
MYADDR MYADDR
OVER OVER
$emptySlice CALLDICT $emptySlice CALLDICT
s3 s5 XCHG s3 s6 XCHG
s4 18 s() XCHG s5 16 s() XCHG
s2 s3 XCHG s2 s4 XCHG
s2 19 s() XCHG s3 17 s() XCHG
s1 s0 s10 XCHG3
__gen_writecell_TokenTransferInternal INLINECALLDICT __gen_writecell_TokenTransferInternal INLINECALLDICT
s5 s6 s0 XCHG3 FALSE
s4 s14 XCHG s0 s4 XCHG
s3 s13 XCHG s3 s11 XCHG
s0 s14 s13 XCHG3 40000000 PUSHINT
s0 s3 XCHG
0 PUSHINT
s3 s1 s3 XCHG3
s0 s14 XCHG
$send CALLDICT $send CALLDICT
2 6 BLKSWAP s5 s7 XCHG
s4 s6 XCHG
s3 s5 XCHG
s4 s0 s3 XCHG3
s0 s2 XCHG
}> }>
$__gen_TONB_burn PROC:<{ $__gen_TONB_burn PROC:<{
s7 s10 XCHG s7 s10 XCHG
@ -622,7 +724,7 @@ PROGRAM{
DROP DROP
32366 PUSHINT 32366 PUSHINT
s3 POP s3 POP
50000000 PUSHINT 10000000 PUSHINT
GEQ GEQ
s1 s2 XCHG s1 s2 XCHG
THROWANYIFNOT THROWANYIFNOT
@ -636,7 +738,7 @@ PROGRAM{
DROP DROP
6384 PUSHINT 6384 PUSHINT
s3 POP s3 POP
50000000 PUSHINT 10000000 PUSHINT
GEQ GEQ
s1 s2 XCHG s1 s2 XCHG
THROWANYIFNOT THROWANYIFNOT
@ -814,6 +916,6 @@ PROGRAM{
86142586315491086060343270784266291122 PUSHINT 86142586315491086060343270784266291122 PUSHINT
}> }>
get_abi_ipfs PROC:<{ get_abi_ipfs PROC:<{
x{697066733a2f2f516d61364a595074457958346973424a55554b644c4a5a73506533723569673658374e46667a6e37684242434643} PUSHSLICE x{697066733a2f2f516d507645695a4772717434663156444b655178797a67626137673571566143636e466958417956437a3452396f} PUSHSLICE
}> }>
}END>c }END>c

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

@ -133,7 +133,7 @@ SETCP0
s4 s5 XCHG s4 s5 XCHG
s3 s4 XCHG s3 s4 XCHG
s1 s3 s0 XCHG3 s1 s3 s0 XCHG3
47 CALLDICT 52 CALLDICT
<{ <{
NEWC NEWC
2 GETGLOBVAR 2 GETGLOBVAR
@ -298,7 +298,7 @@ SETCP0
}> CALLREF }> CALLREF
1 8 BLKDROP2 1 8 BLKDROP2
}> CALLREF }> CALLREF
48 CALLDICT 53 CALLDICT
<{ <{
NEWC NEWC
2 GETGLOBVAR 2 GETGLOBVAR
@ -478,7 +478,7 @@ SETCP0
s4 s5 XCHG s4 s5 XCHG
s3 s4 XCHG s3 s4 XCHG
s1 s3 s0 XCHG3 s1 s3 s0 XCHG3
49 CALLDICT 54 CALLDICT
<{ <{
NEWC NEWC
2 GETGLOBVAR 2 GETGLOBVAR
@ -665,7 +665,7 @@ SETCP0
s4 s5 XCHG s4 s5 XCHG
s3 s4 XCHG s3 s4 XCHG
s1 s3 s0 XCHG3 s1 s3 s0 XCHG3
50 CALLDICT 55 CALLDICT
<{ <{
NEWC NEWC
2 GETGLOBVAR 2 GETGLOBVAR
@ -861,7 +861,7 @@ SETCP0
s5 s6 XCHG s5 s6 XCHG
s4 s5 XCHG s4 s5 XCHG
1 3 BLKSWAP 1 3 BLKSWAP
51 CALLDICT 56 CALLDICT
<{ <{
NEWC NEWC
2 GETGLOBVAR 2 GETGLOBVAR
@ -951,20 +951,20 @@ SETCP0
ISNULL ISNULL
128 THROWIF 128 THROWIF
29:
32: 32:
35:
NEWC NEWC
ENDC ENDC
33: 36:
CTOS CTOS
34: 37:
32 CALLDICT 35 CALLDICT
33 CALLDICT 36 CALLDICT
35: 38:
0 PUSHINT 0 PUSHINT
ROTREV ROTREV
NEWC NEWC
@ -995,7 +995,7 @@ SETCP0
ENDC ENDC
CTOS CTOS
36: 39:
NEWC NEWC
1 PUSHINT 1 PUSHINT
s0 s1 XCHG s0 s1 XCHG
@ -1112,24 +1112,43 @@ SETCP0
s0 s1 XCHG s0 s1 XCHG
1 STI 1 STI
37: 40:
PUSHNULL
0 PUSHINT 0 PUSHINT
s0 s3 XCHG s0 s4 XCHG
NEWC NEWC
STREF STREF
s3 s1 s3 XCHG3 s0 s4 XCHG
s3 s3 XCHG2
<{ <{
s2 s3 XCHG2 s3 s4 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
NEWC
ROT
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
ENDC
s0 s1 XCHG
STREF
}> CALLREF }> CALLREF
ENDC ENDC
38: 41:
s0 s2 XCHG s0 s2 XCHG
CTOS CTOS
LDDICT LDDICT
@ -1152,60 +1171,160 @@ SETCP0
STDICT STDICT
ENDC ENDC
s0 s0 s3 XCHG3 s0 s0 s3 XCHG3
37 CALLDICT 40 CALLDICT
39: 42:
PUSHNULL
s0 s4 XCHG
NEWC
STREF
s2 s4 XCHG2
<{
s3 s4 XCHG2
257 PUSHINT
STIX
s0 s1 XCHG
STSLICER
s0 s1 XCHG
STSLICER
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
43:
s0 s3 XCHG
CTOS
LDDICT
s0 POP
PUSHNULL
s0 s1 XCHG
59979 PUSHINT
s0 s1 XCHG
16 PUSHINT
DICTUGETREF
NULLSWAPIFNOT
135 THROWIFNOT
s0 s1 XCHG
59979 PUSHINT
s2 PUSH
s0 s2 XCHG
16 PUSHINT
DICTUSETREF
NEWC
STDICT
ENDC
3 1 BLKSWAP
s0 s4 XCHG
42 CALLDICT
44:
2 GETGLOBVAR 2 GETGLOBVAR
MYADDR MYADDR
ROT ROT
38 CALLDICT 41 CALLDICT
40: 45:
39 CALLDICT 44 CALLDICT
8 2 BLKDROP2 8 2 BLKDROP2
35 CALLDICT 38 CALLDICT
41: 46:
MYADDR MYADDR
39 CALLDICT 44 CALLDICT
4 2 BLKDROP2 4 2 BLKDROP2
s0 POP s0 POP
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
42: 47:
s10 s1 XCPU s10 s1 XCPU
ADD ADD
8 2 BLKSWAP 8 2 BLKSWAP
39 CALLDICT 44 CALLDICT
2DUP 2DUP
35 CALLDICT 38 CALLDICT
2 GETGLOBVAR
MYADDR
6 2 -2 PU2XC
43 CALLDICT
2DUP
38 CALLDICT
0 PUSHINT 0 PUSHINT
200000000 PUSHINT 20000000 PUSHINT
0 PUSHINT 0 PUSHINT
s0 s11 XCHG
<{
NEWC
s0 s1 XCHG
<{
3019699393 PUSHINT
ROT
32 STU
s0 s1 XCHG
s0 PUSH s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
}> CALLREF
ENDC
}> CALLREF
s3 PUSH
s3 s6 XCHG
s4 s1 s5 XCHG3
s3 s12 XCHG
s1 s12 s0 XCHG3
39 CALLDICT
s5 PUSH
s0 s5 XCHG
INC
0 PUSHINT
MYADDR MYADDR
s1 PUSH s1 PUSH
34 CALLDICT 37 CALLDICT
s3 s5 XCHG s3 s6 XCHG
s0 s4 XCHG s0 s5 XCHG
s0 s18 XCHG s0 s16 XCHG
s0 s4 XCHG s0 s5 XCHG
s2 s3 XCHG s2 s4 XCHG
s0 s2 XCHG s0 s3 XCHG
s0 s19 XCHG s0 s17 XCHG
s0 s2 XCHG s0 s3 XCHG
s1 s0 s10 XCHG3
<{ <{
NEWC NEWC
6 1 BLKSWAP 7 1 BLKSWAP
<{ <{
395134233 PUSHINT 395134233 PUSHINT
s0 s7 XCHG2 s0 s8 XCHG2
32 STU 32 STU
s1 s5 XCHG s1 s6 XCHG
64 STU 64 STU
s0 s3 XCHG2 s0 s4 XCHG2
STGRAMS STGRAMS
s0 s1 XCHG ROT
STSLICER STSLICER
s0 s1 XCHG s0 s1 XCHG
s0 PUSH s0 PUSH
@ -1224,17 +1343,42 @@ SETCP0
STGRAMS STGRAMS
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
NEWC
ROT
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
ENDC
s0 s1 XCHG
STREF
}> CALLREF }> CALLREF
ENDC ENDC
}> CALLREF }> CALLREF
s5 s6 s0 XCHG3 0 PUSHINT
s4 s14 XCHG s0 s4 XCHG
s3 s13 XCHG s3 s11 XCHG
s0 s14 s13 XCHG3 40000000 PUSHINT
36 CALLDICT s0 s3 XCHG
2 6 BLKSWAP 0 PUSHINT
s3 s1 s3 XCHG3
s0 s14 XCHG
39 CALLDICT
s5 s7 XCHG
s4 s6 XCHG
s3 s5 XCHG
s4 s0 s3 XCHG3
s0 s2 XCHG
43: 48:
s7 s10 XCHG s7 s10 XCHG
s6 s9 XCHG s6 s9 XCHG
s5 s8 XCHG s5 s8 XCHG
@ -1242,9 +1386,9 @@ SETCP0
s3 s9 XCHG s3 s9 XCHG
s8 s10 s9 XCHG3 s8 s10 s9 XCHG3
s8 PUSH s8 PUSH
39 CALLDICT 44 CALLDICT
2DUP 2DUP
35 CALLDICT 38 CALLDICT
0 PUSHINT 0 PUSHINT
0 PUSHINT 0 PUSHINT
64 PUSHINT 64 PUSHINT
@ -1288,28 +1432,28 @@ SETCP0
s4 s14 XCHG s4 s14 XCHG
s3 s12 XCHG s3 s12 XCHG
s12 s2 XCHG2 s12 s2 XCHG2
36 CALLDICT 39 CALLDICT
s4 s7 XCHG s4 s7 XCHG
3 4 BLKSWAP 3 4 BLKSWAP
44: 49:
1 GETGLOBVAR 1 GETGLOBVAR
4 UNTUPLE 4 UNTUPLE
s2 s3 XCHG s2 s3 XCHG
3 BLKDROP 3 BLKDROP
9 1 BLKSWAP 9 1 BLKSWAP
39 CALLDICT 44 CALLDICT
s0 s1 XCHG s0 s1 XCHG
4429 PUSHINT 4429 PUSHINT
s0 s2 XCHG s0 s2 XCHG
35 CALLDICT 38 CALLDICT
s0 s10 XCHG2 s0 s10 XCHG2
SDEQ SDEQ
s1 s9 XCHG s1 s9 XCHG
THROWANYIFNOT THROWANYIFNOT
1 7 BLKSWAP 1 7 BLKSWAP
45: 50:
1 GETGLOBVAR 1 GETGLOBVAR
4 UNTUPLE 4 UNTUPLE
s2 s3 XCHG s2 s3 XCHG
@ -1318,47 +1462,47 @@ SETCP0
SDEQ SDEQ
132 THROWIFNOT 132 THROWIFNOT
46: 51:
s6 s7 XCHG s6 s7 XCHG
7 BLKDROP 7 BLKDROP
47: 52:
1 GETGLOBVAR 1 GETGLOBVAR
4 UNTUPLE 4 UNTUPLE
s0 POP s0 POP
32366 PUSHINT 32366 PUSHINT
s3 POP s3 POP
50000000 PUSHINT 10000000 PUSHINT
GEQ GEQ
s1 s2 XCHG s1 s2 XCHG
THROWANYIFNOT THROWANYIFNOT
TUCK TUCK
42 CALLDICT 47 CALLDICT
48: 53:
49: 54:
1 GETGLOBVAR 1 GETGLOBVAR
4 UNTUPLE 4 UNTUPLE
s0 POP s0 POP
6384 PUSHINT 6384 PUSHINT
s3 POP s3 POP
50000000 PUSHINT 10000000 PUSHINT
GEQ GEQ
s1 s2 XCHG s1 s2 XCHG
THROWANYIFNOT THROWANYIFNOT
TUCK TUCK
43 CALLDICT 48 CALLDICT
50: 55:
8 1 BLKSWAP 8 1 BLKSWAP
45 CALLDICT 50 CALLDICT
s5 POP s5 POP
s6 s7 XCHG s6 s7 XCHG
s5 s6 XCHG s5 s6 XCHG
1 4 BLKSWAP 1 4 BLKSWAP
51: 56:
s8 s11 XCHG s8 s11 XCHG
s7 s10 XCHG s7 s10 XCHG
s6 s9 XCHG s6 s9 XCHG
@ -1366,7 +1510,7 @@ SETCP0
s4 s10 XCHG s4 s10 XCHG
s3 s9 XCHG s3 s9 XCHG
s11 s10 s10 XCHG3 s11 s10 s10 XCHG3
44 CALLDICT 49 CALLDICT
s7 s10 XCHG2 s7 s10 XCHG2
SUB SUB
s8 PUSH s8 PUSH
@ -1395,7 +1539,7 @@ SETCP0
s1 s10 XCHG s1 s10 XCHG
PUSHNULL PUSHNULL
PUSHNULL PUSHNULL
36 CALLDICT 39 CALLDICT
}> PUSHCONT }> PUSHCONT
<{ <{
s7 POP s7 POP
@ -1483,7 +1627,7 @@ SETCP0
}> CALLREF }> CALLREF
1 8 BLKDROP2 1 8 BLKDROP2
}> CALLREF }> CALLREF
46 CALLDICT 51 CALLDICT
get_wallet_address: get_wallet_address:
<{ <{
@ -1562,7 +1706,7 @@ SETCP0
1 8 BLKDROP2 1 8 BLKDROP2
}> CALLREF }> CALLREF
1 8 BLKSWAP 1 8 BLKSWAP
40 CALLDICT 45 CALLDICT
get_jetton_data: get_jetton_data:
<{ <{
@ -1640,8 +1784,8 @@ SETCP0
}> CALLREF }> CALLREF
1 8 BLKDROP2 1 8 BLKDROP2
}> CALLREF }> CALLREF
41 CALLDICT 46 CALLDICT
29 CALLDICT 32 CALLDICT
113617: 113617:
123515602279859691144772641439386770278 PUSHINT 123515602279859691144772641439386770278 PUSHINT

14
sources/output/jetton_TONB.md

@ -1,6 +1,6 @@
# TACT Compilation Report # TACT Compilation Report
Contract: TONB Contract: TONB
BOC Size: 1506 bytes BOC Size: 1684 bytes
# Types # Types
Total Types: 18 Total Types: 18
@ -22,8 +22,8 @@ TLB: `token_transfer#0f8a7ea5 queryId:uint64 amount:coins destination:address re
Signature: `TokenTransfer{queryId:uint64,amount:coins,destination:address,responseDestination:Maybe address,customPayload:Maybe ^cell,forwardTonAmount:coins,forwardPayload:remainder<slice>}` Signature: `TokenTransfer{queryId:uint64,amount:coins,destination:address,responseDestination:Maybe address,customPayload:Maybe ^cell,forwardTonAmount:coins,forwardPayload:remainder<slice>}`
## TokenTransferInternal ## TokenTransferInternal
TLB: `token_transfer_internal#178d4519 queryId:uint64 amount:coins from:address responseAddress:Maybe address 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> setLinker:Maybe address = TokenTransferInternal`
Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder<slice>}` Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder<slice>,setLinker:Maybe address}`
## TokenNotification ## TokenNotification
TLB: `token_notification#7362d09c queryId:uint64 amount:coins from:address forwardPayload:remainder<slice> = TokenNotification` TLB: `token_notification#7362d09c queryId:uint64 amount:coins from:address forwardPayload:remainder<slice> = TokenNotification`
@ -53,14 +53,14 @@ Signature: `JettonData{totalSupply:int257,mintable:bool,owner:address,content:Ma
TLB: `_ balance:int257 owner:address master:address walletCode:^cell = JettonWalletData` TLB: `_ balance:int257 owner:address master:address walletCode:^cell = JettonWalletData`
Signature: `JettonWalletData{balance:int257,owner:address,master:address,walletCode:^cell}` Signature: `JettonWalletData{balance:int257,owner:address,master:address,walletCode:^cell}`
## InitLinker
TLB: `init_linker#453d436d owner:address = InitLinker`
Signature: `InitLinker{owner:address}`
## SetLinkerNeighbor ## SetLinkerNeighbor
TLB: `set_linker_neighbor#b3fcf4c1 neighbor:Maybe address = SetLinkerNeighbor` TLB: `set_linker_neighbor#b3fcf4c1 neighbor:Maybe address = SetLinkerNeighbor`
Signature: `SetLinkerNeighbor{neighbor:Maybe address}` Signature: `SetLinkerNeighbor{neighbor:Maybe address}`
## InitLinker
TLB: `init_linker#67c08154 neighbor:Maybe address walletAmount:int257 walletCode:^cell walletData:^cell walletAddress:address responseAddress:Maybe address = InitLinker`
Signature: `InitLinker{neighbor:Maybe address,walletAmount:int257,walletCode:^cell,walletData:^cell,walletAddress:address,responseAddress:Maybe address}`
## WithdrawalRequests ## WithdrawalRequests
TLB: `_ addresses:dict<int, address> amounts:dict<int, int> n_requests:int257 = 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}` Signature: `WithdrawalRequests{addresses:dict<int, address>,amounts:dict<int, int>,n_requests:int257}`

2
sources/output/jetton_TONB.pkg

File diff suppressed because one or more lines are too long

106
sources/output/jetton_TONB.ts

@ -247,6 +247,7 @@ export type TokenTransferInternal = {
responseAddress: Address | null; responseAddress: Address | null;
forwardTonAmount: bigint; forwardTonAmount: bigint;
forwardPayload: Cell; forwardPayload: Cell;
setLinker: Address | null;
} }
export function storeTokenTransferInternal(src: TokenTransferInternal) { export function storeTokenTransferInternal(src: TokenTransferInternal) {
@ -259,6 +260,9 @@ export function storeTokenTransferInternal(src: TokenTransferInternal) {
b_0.storeAddress(src.responseAddress); b_0.storeAddress(src.responseAddress);
b_0.storeCoins(src.forwardTonAmount); b_0.storeCoins(src.forwardTonAmount);
b_0.storeBuilder(src.forwardPayload.asBuilder()); b_0.storeBuilder(src.forwardPayload.asBuilder());
let b_1 = new Builder();
b_1.storeAddress(src.setLinker);
b_0.storeRef(b_1.endCell());
}; };
} }
@ -271,7 +275,9 @@ export function loadTokenTransferInternal(slice: Slice) {
let _responseAddress = sc_0.loadMaybeAddress(); let _responseAddress = sc_0.loadMaybeAddress();
let _forwardTonAmount = sc_0.loadCoins(); let _forwardTonAmount = sc_0.loadCoins();
let _forwardPayload = sc_0.asCell(); let _forwardPayload = sc_0.asCell();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; let sc_1 = sc_0.loadRef().beginParse();
let _setLinker = sc_1.loadMaybeAddress();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload, setLinker: _setLinker };
} }
function loadTupleTokenTransferInternal(source: TupleReader) { function loadTupleTokenTransferInternal(source: TupleReader) {
@ -281,7 +287,8 @@ function loadTupleTokenTransferInternal(source: TupleReader) {
let _responseAddress = source.readAddressOpt(); let _responseAddress = source.readAddressOpt();
let _forwardTonAmount = source.readBigNumber(); let _forwardTonAmount = source.readBigNumber();
let _forwardPayload = source.readCell(); let _forwardPayload = source.readCell();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; let _setLinker = source.readAddressOpt();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload, setLinker: _setLinker };
} }
function storeTupleTokenTransferInternal(source: TokenTransferInternal) { function storeTupleTokenTransferInternal(source: TokenTransferInternal) {
@ -292,6 +299,7 @@ function storeTupleTokenTransferInternal(source: TokenTransferInternal) {
builder.writeAddress(source.responseAddress); builder.writeAddress(source.responseAddress);
builder.writeNumber(source.forwardTonAmount); builder.writeNumber(source.forwardTonAmount);
builder.writeSlice(source.forwardPayload); builder.writeSlice(source.forwardPayload);
builder.writeAddress(source.setLinker);
return builder.build(); return builder.build();
} }
@ -668,85 +676,113 @@ function dictValueParserJettonWalletData(): DictionaryValue<JettonWalletData> {
} }
} }
} }
export type InitLinker = { export type SetLinkerNeighbor = {
$$type: 'InitLinker'; $$type: 'SetLinkerNeighbor';
owner: Address; neighbor: Address | null;
} }
export function storeInitLinker(src: InitLinker) { export function storeSetLinkerNeighbor(src: SetLinkerNeighbor) {
return (builder: Builder) => { return (builder: Builder) => {
let b_0 = builder; let b_0 = builder;
b_0.storeUint(1161642861, 32); b_0.storeUint(3019699393, 32);
b_0.storeAddress(src.owner); b_0.storeAddress(src.neighbor);
}; };
} }
export function loadInitLinker(slice: Slice) { export function loadSetLinkerNeighbor(slice: Slice) {
let sc_0 = slice; let sc_0 = slice;
if (sc_0.loadUint(32) !== 1161642861) { throw Error('Invalid prefix'); } if (sc_0.loadUint(32) !== 3019699393) { throw Error('Invalid prefix'); }
let _owner = sc_0.loadAddress(); let _neighbor = sc_0.loadMaybeAddress();
return { $$type: 'InitLinker' as const, owner: _owner }; return { $$type: 'SetLinkerNeighbor' as const, neighbor: _neighbor };
} }
function loadTupleInitLinker(source: TupleReader) { function loadTupleSetLinkerNeighbor(source: TupleReader) {
let _owner = source.readAddress(); let _neighbor = source.readAddressOpt();
return { $$type: 'InitLinker' as const, owner: _owner }; return { $$type: 'SetLinkerNeighbor' as const, neighbor: _neighbor };
} }
function storeTupleInitLinker(source: InitLinker) { function storeTupleSetLinkerNeighbor(source: SetLinkerNeighbor) {
let builder = new TupleBuilder(); let builder = new TupleBuilder();
builder.writeAddress(source.owner); builder.writeAddress(source.neighbor);
return builder.build(); return builder.build();
} }
function dictValueParserInitLinker(): DictionaryValue<InitLinker> { function dictValueParserSetLinkerNeighbor(): DictionaryValue<SetLinkerNeighbor> {
return { return {
serialize: (src, buidler) => { serialize: (src, buidler) => {
buidler.storeRef(beginCell().store(storeInitLinker(src)).endCell()); buidler.storeRef(beginCell().store(storeSetLinkerNeighbor(src)).endCell());
}, },
parse: (src) => { parse: (src) => {
return loadInitLinker(src.loadRef().beginParse()); return loadSetLinkerNeighbor(src.loadRef().beginParse());
} }
} }
} }
export type SetLinkerNeighbor = { export type InitLinker = {
$$type: 'SetLinkerNeighbor'; $$type: 'InitLinker';
neighbor: Address | null; neighbor: Address | null;
walletAmount: bigint;
walletCode: Cell;
walletData: Cell;
walletAddress: Address;
responseAddress: Address | null;
} }
export function storeSetLinkerNeighbor(src: SetLinkerNeighbor) { export function storeInitLinker(src: InitLinker) {
return (builder: Builder) => { return (builder: Builder) => {
let b_0 = builder; let b_0 = builder;
b_0.storeUint(3019699393, 32); b_0.storeUint(1740669268, 32);
b_0.storeAddress(src.neighbor); b_0.storeAddress(src.neighbor);
b_0.storeInt(src.walletAmount, 257);
b_0.storeRef(src.walletCode);
b_0.storeRef(src.walletData);
b_0.storeAddress(src.walletAddress);
let b_1 = new Builder();
b_1.storeAddress(src.responseAddress);
b_0.storeRef(b_1.endCell());
}; };
} }
export function loadSetLinkerNeighbor(slice: Slice) { export function loadInitLinker(slice: Slice) {
let sc_0 = slice; let sc_0 = slice;
if (sc_0.loadUint(32) !== 3019699393) { throw Error('Invalid prefix'); } if (sc_0.loadUint(32) !== 1740669268) { throw Error('Invalid prefix'); }
let _neighbor = sc_0.loadMaybeAddress(); let _neighbor = sc_0.loadMaybeAddress();
return { $$type: 'SetLinkerNeighbor' as const, neighbor: _neighbor }; let _walletAmount = sc_0.loadIntBig(257);
let _walletCode = sc_0.loadRef();
let _walletData = sc_0.loadRef();
let _walletAddress = sc_0.loadAddress();
let sc_1 = sc_0.loadRef().beginParse();
let _responseAddress = sc_1.loadMaybeAddress();
return { $$type: 'InitLinker' as const, neighbor: _neighbor, walletAmount: _walletAmount, walletCode: _walletCode, walletData: _walletData, walletAddress: _walletAddress, responseAddress: _responseAddress };
} }
function loadTupleSetLinkerNeighbor(source: TupleReader) { function loadTupleInitLinker(source: TupleReader) {
let _neighbor = source.readAddressOpt(); let _neighbor = source.readAddressOpt();
return { $$type: 'SetLinkerNeighbor' as const, neighbor: _neighbor }; let _walletAmount = source.readBigNumber();
let _walletCode = source.readCell();
let _walletData = source.readCell();
let _walletAddress = source.readAddress();
let _responseAddress = source.readAddressOpt();
return { $$type: 'InitLinker' as const, neighbor: _neighbor, walletAmount: _walletAmount, walletCode: _walletCode, walletData: _walletData, walletAddress: _walletAddress, responseAddress: _responseAddress };
} }
function storeTupleSetLinkerNeighbor(source: SetLinkerNeighbor) { function storeTupleInitLinker(source: InitLinker) {
let builder = new TupleBuilder(); let builder = new TupleBuilder();
builder.writeAddress(source.neighbor); builder.writeAddress(source.neighbor);
builder.writeNumber(source.walletAmount);
builder.writeCell(source.walletCode);
builder.writeCell(source.walletData);
builder.writeAddress(source.walletAddress);
builder.writeAddress(source.responseAddress);
return builder.build(); return builder.build();
} }
function dictValueParserSetLinkerNeighbor(): DictionaryValue<SetLinkerNeighbor> { function dictValueParserInitLinker(): DictionaryValue<InitLinker> {
return { return {
serialize: (src, buidler) => { serialize: (src, buidler) => {
buidler.storeRef(beginCell().store(storeSetLinkerNeighbor(src)).endCell()); buidler.storeRef(beginCell().store(storeInitLinker(src)).endCell());
}, },
parse: (src) => { parse: (src) => {
return loadSetLinkerNeighbor(src.loadRef().beginParse()); return loadInitLinker(src.loadRef().beginParse());
} }
} }
} }
@ -924,8 +960,8 @@ function dictValueParserWithdraw(): DictionaryValue<Withdraw> {
} }
async function TONB_init(owner: Address, content: Cell | null) { async function TONB_init(owner: Address, content: Cell | null) {
const __init = 'te6ccgEBBwEAhgABFP8A9KQT9LzyyAsBAgFiAgMCAs0EBQAJoUrd4AsAAdQBJWW1tcG0hfwjIzAhEdBYVE9s8yYGAJpQh/oCUAXPFiNus5Z/AcoAE8yWM3BQA8oA4soAASBulTBwAcsBks8W4gEgbpUwcAHLAZLPFuICyIEBAc8AASBulTBwAcsBks8W4skBzA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bPOCCEFlfB7y6kIuOiQMyj5LbPATbPDQQZxBWEEVVAvAp2zzgMPLAgpCKjgBM0x8BghBZXwe8uvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIUQzAAftMfAYIQF41FGbry4IHTP/oA+kABAfpAIdcLAcMAkQGSMW3iAfoAINQB0PpAIdcLAcMAkQGSMW3iMRcWFRRDMAMmMNs8BNs8NxCaEIkQeFUF8CfbPJCNjgBs0x8BghAPin6luvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIB0gABkdSSbQHi+gBRZhYVFEMwARjI+EIBzFUw2zzJ7VSPADxQNIEBAc8AAc8WAc8WyFggbpUwcAHLAZLPFuLJAcwBFu1E0NQB+GLbPGwUkQBEgQEB1wD6QAEB+kABAdQB0PpAIdcLAcMAkQGSMW3iMRRDMBQGkS0=';
let systemCell = Cell.fromBase64(__system); let systemCell = Cell.fromBase64(__system);
let builder = new TupleBuilder(); let builder = new TupleBuilder();
builder.writeCell(systemCell); builder.writeCell(systemCell);

2
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.

77
sources/output/jetton_TONBWallet.code.fc

@ -99,8 +99,8 @@ cell __tact_dict_get_code(cell dict, int id) inline {
return (sc_0, (v'queryId, v'amount, v'destination, v'responseDestination, v'customPayload, v'forwardTonAmount, v'forwardPayload)); return (sc_0, (v'queryId, v'amount, v'destination, v'responseDestination, v'customPayload, v'forwardTonAmount, v'forwardPayload));
} }
builder __gen_write_TokenTransferInternal(builder build_0, (int, int, slice, slice, int, slice) v) inline_ref { builder __gen_write_TokenTransferInternal(builder build_0, (int, int, slice, slice, int, slice, slice) v) inline_ref {
var (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload) = v; var (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload, v'setLinker) = v;
build_0 = store_uint(build_0, 395134233, 32); build_0 = store_uint(build_0, 395134233, 32);
build_0 = build_0.store_uint(v'queryId, 64); build_0 = build_0.store_uint(v'queryId, 64);
build_0 = build_0.store_coins(v'amount); build_0 = build_0.store_coins(v'amount);
@ -108,14 +108,17 @@ builder __gen_write_TokenTransferInternal(builder build_0, (int, int, slice, sli
build_0 = __tact_store_address_opt(build_0, v'responseAddress); build_0 = __tact_store_address_opt(build_0, v'responseAddress);
build_0 = build_0.store_coins(v'forwardTonAmount); build_0 = build_0.store_coins(v'forwardTonAmount);
build_0 = build_0.store_slice(v'forwardPayload); build_0 = build_0.store_slice(v'forwardPayload);
var build_1 = begin_cell();
build_1 = __tact_store_address_opt(build_1, v'setLinker);
build_0 = store_ref(build_0, build_1.end_cell());
return build_0; return build_0;
} }
cell __gen_writecell_TokenTransferInternal((int, int, slice, slice, int, slice) v) inline_ref { cell __gen_writecell_TokenTransferInternal((int, int, slice, slice, int, slice, slice) v) inline_ref {
return __gen_write_TokenTransferInternal(begin_cell(), v).end_cell(); return __gen_write_TokenTransferInternal(begin_cell(), v).end_cell();
} }
(slice, ((int, int, slice, slice, int, slice))) __gen_read_TokenTransferInternal(slice sc_0) inline_ref { (slice, ((int, int, slice, slice, int, slice, slice))) __gen_read_TokenTransferInternal(slice sc_0) inline_ref {
throw_unless(129, sc_0~load_uint(32) == 395134233); throw_unless(129, sc_0~load_uint(32) == 395134233);
var v'queryId = sc_0~load_uint(64); var v'queryId = sc_0~load_uint(64);
var v'amount = sc_0~load_coins(); var v'amount = sc_0~load_coins();
@ -123,7 +126,9 @@ cell __gen_writecell_TokenTransferInternal((int, int, slice, slice, int, slice)
var v'responseAddress = sc_0~__tact_load_address_opt(); var v'responseAddress = sc_0~__tact_load_address_opt();
var v'forwardTonAmount = sc_0~load_coins(); var v'forwardTonAmount = sc_0~load_coins();
var v'forwardPayload = sc_0; var v'forwardPayload = sc_0;
return (sc_0, (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload)); slice sc_1 = sc_0~load_ref().begin_parse();
var v'setLinker = sc_1~__tact_load_address_opt();
return (sc_0, (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload, v'setLinker));
} }
builder __gen_write_TokenNotification(builder build_0, (int, int, slice, slice) v) inline_ref { builder __gen_write_TokenNotification(builder build_0, (int, int, slice, slice) v) inline_ref {
@ -174,19 +179,24 @@ cell __gen_writecell_TokenExcesses((int) v) inline_ref {
return __gen_write_TokenExcesses(begin_cell(), v).end_cell(); return __gen_write_TokenExcesses(begin_cell(), v).end_cell();
} }
builder __gen_write_TONBWallet(builder build_0, (int, slice, slice) v) inline_ref { builder __gen_write_TONBWallet(builder build_0, (int, slice, slice, slice) v) inline_ref {
var (v'balance, v'owner, v'master) = v; var (v'balance, v'owner, v'master, v'linker) = v;
build_0 = build_0.store_int(v'balance, 257); build_0 = build_0.store_int(v'balance, 257);
build_0 = __tact_store_address(build_0, v'owner); build_0 = __tact_store_address(build_0, v'owner);
build_0 = __tact_store_address(build_0, v'master); build_0 = __tact_store_address(build_0, v'master);
var build_1 = begin_cell();
build_1 = __tact_store_address_opt(build_1, v'linker);
build_0 = store_ref(build_0, build_1.end_cell());
return build_0; return build_0;
} }
(slice, ((int, slice, slice))) __gen_read_TONBWallet(slice sc_0) inline_ref { (slice, ((int, slice, slice, slice))) __gen_read_TONBWallet(slice sc_0) inline_ref {
var v'balance = sc_0~load_int(257); var v'balance = sc_0~load_int(257);
var v'owner = sc_0~__tact_load_address(); var v'owner = sc_0~__tact_load_address();
var v'master = sc_0~__tact_load_address(); var v'master = sc_0~__tact_load_address();
return (sc_0, (v'balance, v'owner, v'master)); slice sc_1 = sc_0~load_ref().begin_parse();
var v'linker = sc_1~__tact_load_address_opt();
return (sc_0, (v'balance, v'owner, v'master, v'linker));
} }
_ __gen_StateInit_get_code((cell, cell) v) inline { _ __gen_StateInit_get_code((cell, cell) v) inline {
@ -199,13 +209,13 @@ _ __gen_StateInit_get_code((cell, cell) v) inline {
return (v'balance, v'owner, v'master, v'walletCode); return (v'balance, v'owner, v'master, v'walletCode);
} }
(int, slice, slice) __gen_load_TONBWallet() inline_ref { (int, slice, slice, slice) __gen_load_TONBWallet() inline_ref {
slice sc = get_data().begin_parse(); slice sc = get_data().begin_parse();
__tact_context_sys = sc~load_ref(); __tact_context_sys = sc~load_ref();
return sc~__gen_read_TONBWallet(); return sc~__gen_read_TONBWallet();
} }
() __gen_store_TONBWallet((int, slice, slice) v) impure inline_ref { () __gen_store_TONBWallet((int, slice, slice, slice) v) impure inline_ref {
builder b = begin_cell(); builder b = begin_cell();
b = b.store_ref(__tact_context_sys); b = b.store_ref(__tact_context_sys);
b = __gen_write_TONBWallet(b, v); b = __gen_write_TONBWallet(b, v);
@ -271,13 +281,13 @@ int $__gen_Context_readForwardFee((int, slice, int, slice) $self) impure {
} }
cell $__gen_TONBWallet_init(cell sys', slice $master, slice $owner) { cell $__gen_TONBWallet_init(cell sys', slice $master, slice $owner) {
var (($self'balance, $self'owner, $self'master)) = (null(), null(), null()); var (($self'balance, $self'owner, $self'master, $self'linker)) = (null(), null(), null(), null());
$self'balance = 0; $self'balance = 0;
$self'owner = $owner; $self'owner = $owner;
$self'master = $master; $self'master = $master;
var b' = begin_cell(); var b' = begin_cell();
b' = b'.store_ref(sys'); b' = b'.store_ref(sys');
b' = __gen_write_TONBWallet(b', ($self'balance, $self'owner, $self'master)); b' = __gen_write_TONBWallet(b', ($self'balance, $self'owner, $self'master, $self'linker));
return b'.end_cell(); return b'.end_cell();
} }
@ -293,8 +303,8 @@ cell $__gen_TONBWallet_init(cell sys', slice $master, slice $owner) {
return (mine, $__gen_TONBWallet_init(sys, $master, $owner)); return (mine, $__gen_TONBWallet_init(sys, $master, $owner));
} }
(int, slice, slice, cell) $__gen_TONBWallet_get_wallet_data((int, slice, slice) $self) impure { (int, slice, slice, cell) $__gen_TONBWallet_get_wallet_data((int, slice, slice, slice) $self) impure {
var (($self'balance, $self'owner, $self'master)) = $self; var (($self'balance, $self'owner, $self'master, $self'linker)) = $self;
return ($self'balance, $self'owner, $self'master, __gen_StateInit_get_code($__gen_TONBWallet_init_child(__tact_context_sys, $self'master, $self'owner))); return ($self'balance, $self'owner, $self'master, __gen_StateInit_get_code($__gen_TONBWallet_init_child(__tact_context_sys, $self'master, $self'owner)));
} }
@ -304,8 +314,8 @@ _ $__gen_get_get_wallet_data() method_id(97026) {
return __gen_JettonWalletData_to_external(res); 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 { (((int, slice, slice, slice)), ()) $__gen_TONBWallet_receive_TokenTransfer((int, slice, slice, slice) $self, (int, int, slice, slice, cell, int, slice) $msg) impure {
var ($self'balance, $self'owner, $self'master) = $self; var ($self'balance, $self'owner, $self'master, $self'linker) = $self;
var ($msg'queryId, $msg'amount, $msg'destination, $msg'responseDestination, $msg'customPayload, $msg'forwardTonAmount, $msg'forwardPayload) = $msg; var ($msg'queryId, $msg'amount, $msg'destination, $msg'responseDestination, $msg'customPayload, $msg'forwardTonAmount, $msg'forwardPayload) = $msg;
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get();
throw_unless(4429, __tact_address_eq($ctx'sender, $self'owner)); throw_unless(4429, __tact_address_eq($ctx'sender, $self'owner));
@ -319,15 +329,18 @@ _ $__gen_get_get_wallet_data() method_id(97026) {
throw_unless(16059, ($ctx'value > ((($fwdCount * $fwdFee) + (2 * 10000000)) + 10000000))); throw_unless(16059, ($ctx'value > ((($fwdCount * $fwdFee) + (2 * 10000000)) + 10000000)));
var ($init'code, $init'data) = $__gen_TONBWallet_init_child(__tact_context_sys, $self'master, $msg'destination); var ($init'code, $init'data) = $__gen_TONBWallet_init_child(__tact_context_sys, $self'master, $msg'destination);
slice $walletAddress = $contractAddress(($init'code, $init'data)); slice $walletAddress = $contractAddress(($init'code, $init'data));
$send((true, $walletAddress, 0, 64, __gen_writecell_TokenTransferInternal(($msg'queryId, $msg'amount, $self'owner, $self'owner, $msg'forwardTonAmount, $msg'forwardPayload)), $init'code, $init'data)); $send((true, $walletAddress, 0, 64, __gen_writecell_TokenTransferInternal(($msg'queryId, $msg'amount, $self'owner, $self'owner, $msg'forwardTonAmount, $msg'forwardPayload, null())), $init'code, $init'data));
return (($self'balance, $self'owner, $self'master), ()); return (($self'balance, $self'owner, $self'master, $self'linker), ());
} }
(((int, slice, slice)), ()) $__gen_TONBWallet_receive_TokenTransferInternal((int, slice, slice) $self, (int, int, slice, slice, int, slice) $msg) impure { (((int, slice, slice, slice)), ()) $__gen_TONBWallet_receive_TokenTransferInternal((int, slice, slice, slice) $self, (int, int, slice, slice, int, slice, slice) $msg) impure {
var ($self'balance, $self'owner, $self'master) = $self; var ($self'balance, $self'owner, $self'master, $self'linker) = $self;
var ($msg'queryId, $msg'amount, $msg'from, $msg'responseAddress, $msg'forwardTonAmount, $msg'forwardPayload) = $msg; var ($msg'queryId, $msg'amount, $msg'from, $msg'responseAddress, $msg'forwardTonAmount, $msg'forwardPayload, $msg'setLinker) = $msg;
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get();
if (__tact_address_neq($ctx'sender, $self'master)) { if (null?($self'linker)) {
$self'linker = $msg'setLinker;
}
if ((__tact_address_neq($ctx'sender, $self'master) & __tact_address_neq($ctx'sender, $self'linker))) {
var ($sinit'code, $sinit'data) = $__gen_TONBWallet_init_child(__tact_context_sys, $self'master, $msg'from); 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)); throw_unless(4429, __tact_address_eq($contractAddress(($sinit'code, $sinit'data)), $ctx'sender));
} }
@ -345,31 +358,31 @@ _ $__gen_get_get_wallet_data() method_id(97026) {
if (((~ null?($msg'responseAddress)) & ($msgValue > 0))) { if (((~ null?($msg'responseAddress)) & ($msgValue > 0))) {
$send((false, __tact_not_null($msg'responseAddress), $msgValue, 0, __gen_writecell_TokenExcesses(($msg'queryId)), null(), null())); $send((false, __tact_not_null($msg'responseAddress), $msgValue, 0, __gen_writecell_TokenExcesses(($msg'queryId)), null(), null()));
} }
return (($self'balance, $self'owner, $self'master), ()); return (($self'balance, $self'owner, $self'master, $self'linker), ());
} }
(((int, slice, slice)), ()) $__gen_TONBWallet_receive_TokenBurn((int, slice, slice) $self, (int, int, slice, slice) $msg) impure { (((int, slice, slice, slice)), ()) $__gen_TONBWallet_receive_TokenBurn((int, slice, slice, slice) $self, (int, int, slice, slice) $msg) impure {
var ($self'balance, $self'owner, $self'master) = $self; var ($self'balance, $self'owner, $self'master, $self'linker) = $self;
var ($msg'queryId, $msg'amount, $msg'owner, $msg'responseAddress) = $msg; var ($msg'queryId, $msg'amount, $msg'owner, $msg'responseAddress) = $msg;
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get();
throw_unless(4429, (__tact_address_eq($ctx'sender, $self'owner) | __tact_address_eq($ctx'sender, $self'master))); throw_unless(4429, ((__tact_address_eq($ctx'sender, $self'owner) | __tact_address_eq($ctx'sender, $self'master)) | __tact_address_eq($ctx'sender, $self'linker)));
$self'balance = ($self'balance - $msg'amount); $self'balance = ($self'balance - $msg'amount);
throw_unless(62972, ($self'balance >= 0)); throw_unless(62972, ($self'balance >= 0));
int $fwdFee = $__gen_Context_readForwardFee(($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw)); int $fwdFee = $__gen_Context_readForwardFee(($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw));
throw_unless(16059, ($ctx'value > (($fwdFee + (2 * 10000000)) + 10000000))); throw_unless(16059, ($ctx'value > (($fwdFee + (2 * 10000000)) + 10000000)));
$send((true, $self'master, 0, 64, __gen_writecell_TokenBurnNotification(($msg'queryId, $msg'amount, $self'owner, $self'owner)), null(), null())); $send((true, $self'master, 0, 64, __gen_writecell_TokenBurnNotification(($msg'queryId, $msg'amount, $self'owner, $self'owner)), null(), null()));
return (($self'balance, $self'owner, $self'master), ()); return (($self'balance, $self'owner, $self'master, $self'linker), ());
} }
((int, slice, slice), ()) $__gen_TONBWallet_receive_bounced((int, slice, slice) $self, slice $msg) impure { ((int, slice, slice, slice), ()) $__gen_TONBWallet_receive_bounced((int, slice, slice, slice) $self, slice $msg) impure {
var ($self'balance, $self'owner, $self'master) = $self; var ($self'balance, $self'owner, $self'master, $self'linker) = $self;
$msg~skip_bits(32); $msg~skip_bits(32);
int $op = $msg~load_uint(32); int $op = $msg~load_uint(32);
int $queryId = $msg~load_uint(64); int $queryId = $msg~load_uint(64);
int $jettonAmount = $msg~load_coins(); int $jettonAmount = $msg~load_coins();
throw_unless(13650, (($op == 395134233) | ($op == 2078119902))); throw_unless(13650, (($op == 395134233) | ($op == 2078119902)));
$self'balance = ($self'balance + $jettonAmount); $self'balance = ($self'balance + $jettonAmount);
return (($self'balance, $self'owner, $self'master), ()); return (($self'balance, $self'owner, $self'master, $self'linker), ());
} }
@ -433,5 +446,5 @@ _ supported_interfaces() method_id {
} }
_ get_abi_ipfs() { _ get_abi_ipfs() {
return "ipfs://QmdeQibxp6Bp8gtTKCziJsCfzaEpbxC4zCEomnBb1nCyer"; return "ipfs://QmWqpvx8PLAjtTJAa4RuwzEXeejSonT37BiA5HxjDFbLvM";
} }

145
sources/output/jetton_TONBWallet.code.fif

@ -181,13 +181,13 @@ PROGRAM{
}> }>
__gen_write_TokenTransferInternal PROCREF:<{ __gen_write_TokenTransferInternal PROCREF:<{
395134233 PUSHINT 395134233 PUSHINT
s0 s7 XCHG2 s0 s8 XCHG2
32 STU 32 STU
s1 s5 XCHG s1 s6 XCHG
64 STU 64 STU
s0 s3 XCHG2 s0 s4 XCHG2
STGRAMS STGRAMS
SWAP ROT
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
SWAP SWAP
__tact_store_address_opt INLINECALLDICT __tact_store_address_opt INLINECALLDICT
@ -195,10 +195,16 @@ PROGRAM{
STGRAMS STGRAMS
SWAP SWAP
STSLICER STSLICER
NEWC
ROT
__tact_store_address_opt INLINECALLDICT
ENDC
SWAP
STREF
}> }>
__gen_writecell_TokenTransferInternal PROCREF:<{ __gen_writecell_TokenTransferInternal PROCREF:<{
NEWC NEWC
6 -ROLL 7 -ROLL
__gen_write_TokenTransferInternal INLINECALLDICT __gen_write_TokenTransferInternal INLINECALLDICT
ENDC ENDC
}> }>
@ -215,7 +221,14 @@ PROGRAM{
__tact_load_address_opt INLINECALLDICT __tact_load_address_opt INLINECALLDICT
SWAP SWAP
LDGRAMS LDGRAMS
s5 s5 XCPU DUP
LDREF
SWAP
CTOS
__tact_load_address_opt INLINECALLDICT
NIP
s1 s7 XCHG
s1 s6 XCHG
s1 s5 XCHG s1 s5 XCHG
s1 s4 XCHG s1 s4 XCHG
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
@ -285,13 +298,19 @@ PROGRAM{
ENDC ENDC
}> }>
__gen_write_TONBWallet PROCREF:<{ __gen_write_TONBWallet PROCREF:<{
s2 s3 XCHG2 s3 s4 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
SWAP SWAP
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
SWAP SWAP
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
NEWC
ROT
__tact_store_address_opt INLINECALLDICT
ENDC
SWAP
STREF
}> }>
__gen_read_TONBWallet PROCREF:<{ __gen_read_TONBWallet PROCREF:<{
257 PUSHINT 257 PUSHINT
@ -299,6 +318,13 @@ PROGRAM{
__tact_load_address INLINECALLDICT __tact_load_address INLINECALLDICT
SWAP SWAP
__tact_load_address INLINECALLDICT __tact_load_address INLINECALLDICT
SWAP
LDREF
SWAP
CTOS
__tact_load_address_opt INLINECALLDICT
NIP
s1 s4 XCHG
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
}> }>
__gen_StateInit_get_code PROCINLINE:<{ __gen_StateInit_get_code PROCINLINE:<{
@ -313,14 +339,14 @@ PROGRAM{
SWAP SWAP
__tact_context_sys SETGLOB __tact_context_sys SETGLOB
__gen_read_TONBWallet INLINECALLDICT __gen_read_TONBWallet INLINECALLDICT
1 3 BLKDROP2 1 4 BLKDROP2
}> }>
__gen_store_TONBWallet PROCREF:<{ __gen_store_TONBWallet PROCREF:<{
NEWC NEWC
__tact_context_sys GETGLOB __tact_context_sys GETGLOB
SWAP SWAP
STREF STREF
3 -ROLL 4 -ROLL
__gen_write_TONBWallet INLINECALLDICT __gen_write_TONBWallet INLINECALLDICT
ENDC ENDC
c4 POP c4 POP
@ -443,11 +469,13 @@ PROGRAM{
1 RSHIFT# 1 RSHIFT#
}> }>
$__gen_TONBWallet_init PROC:<{ $__gen_TONBWallet_init PROC:<{
PUSHNULL
0 PUSHINT 0 PUSHINT
s0 s3 XCHG s0 s4 XCHG
NEWC NEWC
STREF STREF
s3 s1 s3 XCHG3 s0 s4 XCHG
s3 s3 XCHG2
__gen_write_TONBWallet INLINECALLDICT __gen_write_TONBWallet INLINECALLDICT
ENDC ENDC
}> }>
@ -471,6 +499,7 @@ PROGRAM{
$__gen_TONBWallet_init CALLDICT $__gen_TONBWallet_init CALLDICT
}> }>
$__gen_TONBWallet_get_wallet_data PROC:<{ $__gen_TONBWallet_get_wallet_data PROC:<{
DROP
__tact_context_sys GETGLOB __tact_context_sys GETGLOB
s1 s2 PUSH2 s1 s2 PUSH2
$__gen_TONBWallet_init_child CALLDICT $__gen_TONBWallet_init_child CALLDICT
@ -485,17 +514,17 @@ PROGRAM{
2 2 BLKDROP2 2 2 BLKDROP2
__tact_context_get INLINECALLDICT __tact_context_get INLINECALLDICT
4429 PUSHINT 4429 PUSHINT
s3 s11 PUSH2 s3 s12 PUSH2
__tact_address_eq INLINECALLDICT __tact_address_eq INLINECALLDICT
THROWANYIFNOT THROWANYIFNOT
s11 s7 XCPU s12 s7 XCPU
SUB SUB
62972 PUSHINT 62972 PUSHINT
OVER OVER
-1 GTINT -1 GTINT
THROWANYIFNOT THROWANYIFNOT
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
s3 s11 PUXC s3 s12 PUXC
$__gen_Context_readForwardFee CALLDICT $__gen_Context_readForwardFee CALLDICT
1 PUSHINT 1 PUSHINT
s4 PUSH s4 PUSH
@ -515,7 +544,7 @@ PROGRAM{
GREATER GREATER
THROWANYIFNOT THROWANYIFNOT
__tact_context_sys GETGLOB __tact_context_sys GETGLOB
s0 s6 s3 XCPUXC s0 s7 s3 XCPUXC
$__gen_TONBWallet_init_child CALLDICT $__gen_TONBWallet_init_child CALLDICT
2DUP 2DUP
$contractAddress CALLDICT $contractAddress CALLDICT
@ -523,38 +552,50 @@ PROGRAM{
s7 s6 XCHG2 s7 s6 XCHG2
0 PUSHINT 0 PUSHINT
64 PUSHINT 64 PUSHINT
s11 PUSH PUSHNULL
s12 s2 s8 PUXC2 s13 PUSH
s1 s8 XCHG s3 s14 XCPU
s0 s3 XCHG
s9 s10 s9 XCHG3
__gen_writecell_TokenTransferInternal INLINECALLDICT __gen_writecell_TokenTransferInternal INLINECALLDICT
s5 s6 XCHG s5 s6 XCHG
s3 s4 XCHG
-ROT -ROT
$send CALLDICT $send CALLDICT
}> }>
$__gen_TONBWallet_receive_TokenTransferInternal PROC:<{ $__gen_TONBWallet_receive_TokenTransferInternal PROC:<{
__tact_context_get INLINECALLDICT __tact_context_get INLINECALLDICT
s2 s10 PUSH2 s11 PUSH
ISNULL
IF:<{
s11 POP
s3 s10 XCHG
}>ELSE<{
s4 POP
}>
s1 s11 PUSH2
__tact_address_neq INLINECALLDICT
s2 s11 PUSH2
__tact_address_neq INLINECALLDICT __tact_address_neq INLINECALLDICT
AND
IF:<{ IF:<{
__tact_context_sys GETGLOB __tact_context_sys GETGLOB
s11 s8 PUSH2 s12 s8 PUSH2
$__gen_TONBWallet_init_child CALLDICT $__gen_TONBWallet_init_child CALLDICT
SWAP SWAP
4429 PUSHINT 4429 PUSHINT
s0 s2 XCHG s0 s2 XCHG
$contractAddress CALLDICT $contractAddress CALLDICT
s4 PUSH s3 PUSH
__tact_address_eq INLINECALLDICT __tact_address_eq INLINECALLDICT
THROWANYIFNOT THROWANYIFNOT
}> }>
s12 s8 XCPU s13 s8 XCPU
ADD ADD
62972 PUSHINT 62972 PUSHINT
OVER OVER
-1 GTINT -1 GTINT
THROWANYIFNOT THROWANYIFNOT
OVER s13 PUSH
__tact_my_balance INLINECALLDICT __tact_my_balance INLINECALLDICT
OVER OVER
SUB SUB
@ -568,12 +609,10 @@ PROGRAM{
s6 PUSH s6 PUSH
0 GTINT 0 GTINT
IF:<{ IF:<{
s4 s13 XCHG2 s14 s4 XCHG2
s3 s3 s0 XCHG3
$__gen_Context_readForwardFee CALLDICT $__gen_Context_readForwardFee CALLDICT
s3 s(-1) PUXC s3 s(-1) PUXC
ADD ADD
s1 s10 XCHG
SUB SUB
FALSE FALSE
0 PUSHINT 0 PUSHINT
@ -581,20 +620,20 @@ PROGRAM{
s8 s1 s3 XCHG3 s8 s1 s3 XCHG3
s7 s4 XCHG2 s7 s4 XCHG2
__gen_writecell_TokenNotification INLINECALLDICT __gen_writecell_TokenNotification INLINECALLDICT
s8 PUSH s9 PUSH
s4 s6 XCHG s4 s6 XCHG
s3 s1 s3 XCHG3 s3 s1 s3 XCHG3
s5 s5 XCHG2 s5 s5 XCHG2
PUSHNULL PUSHNULL
PUSHNULL PUSHNULL
$send CALLDICT $send CALLDICT
s0 s5 XCHG2 s0 s6 XCHG2
}>ELSE<{ }>ELSE<{
s7 s13 XCHG s7 s14 XCHG
s8 s9 XCHG2 s8 s9 XCHG2
8 BLKDROP 8 BLKDROP
}> }>
s5 PUSH s6 PUSH
ISNULL ISNULL
NOT NOT
s2 PUSH s2 PUSH
@ -602,19 +641,19 @@ PROGRAM{
AND AND
IF:<{ IF:<{
FALSE FALSE
s0 s6 XCHG s0 s7 XCHG
__tact_not_null CALLDICT __tact_not_null CALLDICT
0 PUSHINT 0 PUSHINT
s0 s4 XCHG s0 s4 XCHG
__gen_writecell_TokenExcesses INLINECALLDICT __gen_writecell_TokenExcesses INLINECALLDICT
s4 s7 XCHG s4 s8 XCHG
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
s1 s7 XCHG s1 s8 XCHG
PUSHNULL PUSHNULL
PUSHNULL PUSHNULL
$send CALLDICT $send CALLDICT
}>ELSE<{ }>ELSE<{
s5 POP s6 POP
2DROP 2DROP
}> }>
}> }>
@ -622,20 +661,23 @@ PROGRAM{
2DROP 2DROP
__tact_context_get INLINECALLDICT __tact_context_get INLINECALLDICT
4429 PUSHINT 4429 PUSHINT
s3 s8 PUSH2 s3 s9 PUSH2
__tact_address_eq INLINECALLDICT
s4 s9 PUSH2
__tact_address_eq INLINECALLDICT __tact_address_eq INLINECALLDICT
OR
s4 s8 PUSH2 s4 s8 PUSH2
__tact_address_eq INLINECALLDICT __tact_address_eq INLINECALLDICT
OR OR
THROWANYIFNOT THROWANYIFNOT
s8 s4 XCPU s9 s4 XCPU
SUB SUB
62972 PUSHINT 62972 PUSHINT
OVER OVER
-1 GTINT -1 GTINT
THROWANYIFNOT THROWANYIFNOT
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
s3 s8 PUXC s3 s9 PUXC
$__gen_Context_readForwardFee CALLDICT $__gen_Context_readForwardFee CALLDICT
16059 PUSHINT 16059 PUSHINT
SWAP SWAP
@ -650,9 +692,9 @@ PROGRAM{
0 PUSHINT 0 PUSHINT
s0 s3 XCHG s0 s3 XCHG
64 PUSHINT 64 PUSHINT
s3 s6 s6 XCPU2 s3 s7 s7 XCPU2
__gen_writecell_TokenBurnNotification INLINECALLDICT __gen_writecell_TokenBurnNotification INLINECALLDICT
s3 s0 s4 XC2PU s3 s0 s5 XC2PU
s3 s3 XCHG2 s3 s3 XCHG2
PUSHNULL PUSHNULL
PUSHNULL PUSHNULL
@ -677,9 +719,9 @@ PROGRAM{
OR OR
s1 s2 XCHG s1 s2 XCHG
THROWANYIFNOT THROWANYIFNOT
s1 s3 XCHG s1 s4 XCHG
ADD ADD
s0 s2 XCHG s0 s3 XCHG
}> }>
recv_internal PROC:<{ recv_internal PROC:<{
0 PUSHINT 0 PUSHINT
@ -713,7 +755,7 @@ PROGRAM{
IFJMP:<{ IFJMP:<{
DROP DROP
__gen_load_TONBWallet INLINECALLDICT __gen_load_TONBWallet INLINECALLDICT
3 ROLL 4 ROLL
$__gen_TONBWallet_receive_bounced CALLDICT $__gen_TONBWallet_receive_bounced CALLDICT
__gen_store_TONBWallet INLINECALLDICT __gen_store_TONBWallet INLINECALLDICT
}> }>
@ -723,9 +765,10 @@ PROGRAM{
IFJMP:<{ IFJMP:<{
DROP DROP
__gen_load_TONBWallet INLINECALLDICT __gen_load_TONBWallet INLINECALLDICT
s0 s3 XCHG s0 s4 XCHG
__gen_read_TokenTransfer INLINECALLDICT __gen_read_TokenTransfer INLINECALLDICT
s7 POP s7 POP
s9 s10 XCHG
s8 s9 XCHG s8 s9 XCHG
s7 s8 XCHG s7 s8 XCHG
6 ROLL 6 ROLL
@ -738,12 +781,13 @@ PROGRAM{
IFJMP:<{ IFJMP:<{
DROP DROP
__gen_load_TONBWallet INLINECALLDICT __gen_load_TONBWallet INLINECALLDICT
s0 s3 XCHG s0 s4 XCHG
__gen_read_TokenTransferInternal INLINECALLDICT __gen_read_TokenTransferInternal INLINECALLDICT
s6 POP s7 POP
s9 s10 XCHG
s8 s9 XCHG
s7 s8 XCHG s7 s8 XCHG
s6 s7 XCHG 6 ROLL
5 ROLL
$__gen_TONBWallet_receive_TokenTransferInternal CALLDICT $__gen_TONBWallet_receive_TokenTransferInternal CALLDICT
__gen_store_TONBWallet INLINECALLDICT __gen_store_TONBWallet INLINECALLDICT
}> }>
@ -751,9 +795,10 @@ PROGRAM{
EQUAL EQUAL
IFJMP:<{ IFJMP:<{
__gen_load_TONBWallet INLINECALLDICT __gen_load_TONBWallet INLINECALLDICT
s0 s3 XCHG s0 s4 XCHG
__gen_read_TokenBurn INLINECALLDICT __gen_read_TokenBurn INLINECALLDICT
s4 POP s4 POP
s6 s7 XCHG
s5 s6 XCHG s5 s6 XCHG
s4 s5 XCHG s4 s5 XCHG
3 ROLL 3 ROLL
@ -769,6 +814,6 @@ PROGRAM{
209778528950190195973528115415557644819 PUSHINT 209778528950190195973528115415557644819 PUSHINT
}> }>
get_abi_ipfs PROC:<{ get_abi_ipfs PROC:<{
x{697066733a2f2f516d64655169627870364270386774544b437a694a7343667a614570627843347a43456f6d6e4262316e43796572} PUSHSLICE x{697066733a2f2f516d577170767838504c416a74544a4161345275777a455865656a536f6e5433374269413548786a4446624c764d} PUSHSLICE
}> }>
}END>c }END>c

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

@ -48,26 +48,61 @@ SETCP0
s0 s1 XCHG s0 s1 XCHG
LDMSGADDR LDMSGADDR
s0 s1 XCHG s0 s1 XCHG
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 s3 s3 s0 XCHG3
}> CALLREF }> CALLREF
1 3 BLKDROP2 1 4 BLKDROP2
}> CALLREF }> CALLREF
1 3 BLKSWAP 1 4 BLKSWAP
42 CALLDICT 42 CALLDICT
<{ <{
NEWC NEWC
2 GETGLOBVAR 2 GETGLOBVAR
s0 s1 XCHG s0 s1 XCHG
STREF STREF
3 1 BLKSWAP 4 1 BLKSWAP
<{ <{
s2 s3 XCHG2 s3 s4 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
NEWC
ROT
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
ENDC
s0 s1 XCHG
STREF
}> CALLREF }> CALLREF
ENDC ENDC
c4 POP c4 POP
@ -93,11 +128,29 @@ SETCP0
s0 s1 XCHG s0 s1 XCHG
LDMSGADDR LDMSGADDR
s0 s1 XCHG s0 s1 XCHG
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 s3 s3 s0 XCHG3
}> CALLREF }> CALLREF
1 3 BLKDROP2 1 4 BLKDROP2
}> CALLREF }> CALLREF
s0 s3 XCHG s0 s4 XCHG
<{ <{
32 LDU 32 LDU
s0 s1 XCHG s0 s1 XCHG
@ -140,6 +193,7 @@ SETCP0
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
}> CALLREF }> CALLREF
s7 POP s7 POP
s9 s10 XCHG
s8 s9 XCHG s8 s9 XCHG
s7 s8 XCHG s7 s8 XCHG
1 6 BLKSWAP 1 6 BLKSWAP
@ -149,15 +203,32 @@ SETCP0
2 GETGLOBVAR 2 GETGLOBVAR
s0 s1 XCHG s0 s1 XCHG
STREF STREF
3 1 BLKSWAP 4 1 BLKSWAP
<{ <{
s2 s3 XCHG2 s3 s4 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
NEWC
ROT
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
ENDC
s0 s1 XCHG
STREF
}> CALLREF }> CALLREF
ENDC ENDC
c4 POP c4 POP
@ -182,11 +253,29 @@ SETCP0
s0 s1 XCHG s0 s1 XCHG
LDMSGADDR LDMSGADDR
s0 s1 XCHG s0 s1 XCHG
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 s3 s3 s0 XCHG3
}> CALLREF }> CALLREF
1 3 BLKDROP2 1 4 BLKDROP2
}> CALLREF }> CALLREF
s0 s3 XCHG s0 s4 XCHG
<{ <{
32 LDU 32 LDU
s0 s1 XCHG s0 s1 XCHG
@ -212,30 +301,66 @@ SETCP0
IFELSE IFELSE
s0 s1 XCHG s0 s1 XCHG
LDGRAMS LDGRAMS
s5 s5 XCPU s0 PUSH
LDREF
s0 s1 XCHG
CTOS
LDMSGADDR
s1 PUSH
2 PLDU
0 NEQINT
<{
s0 s1 XCHG
}> PUSHCONT
<{
s1 POP
PUSHNULL
}> PUSHCONT
IFELSE
s1 POP
s1 s7 XCHG
s1 s6 XCHG
s1 s5 XCHG s1 s5 XCHG
s1 s4 XCHG s1 s4 XCHG
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
}> CALLREF }> CALLREF
s6 POP s7 POP
s9 s10 XCHG
s8 s9 XCHG
s7 s8 XCHG s7 s8 XCHG
s6 s7 XCHG 1 6 BLKSWAP
1 5 BLKSWAP
40 CALLDICT 40 CALLDICT
<{ <{
NEWC NEWC
2 GETGLOBVAR 2 GETGLOBVAR
s0 s1 XCHG s0 s1 XCHG
STREF STREF
3 1 BLKSWAP 4 1 BLKSWAP
<{ <{
s2 s3 XCHG2 s3 s4 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
NEWC
ROT
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
ENDC
s0 s1 XCHG
STREF
}> CALLREF }> CALLREF
ENDC ENDC
c4 POP c4 POP
@ -259,11 +384,29 @@ SETCP0
s0 s1 XCHG s0 s1 XCHG
LDMSGADDR LDMSGADDR
s0 s1 XCHG s0 s1 XCHG
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 s3 s3 s0 XCHG3
}> CALLREF }> CALLREF
1 3 BLKDROP2 1 4 BLKDROP2
}> CALLREF }> CALLREF
s0 s3 XCHG s0 s4 XCHG
<{ <{
32 LDU 32 LDU
s0 s1 XCHG s0 s1 XCHG
@ -291,6 +434,7 @@ SETCP0
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
}> CALLREF }> CALLREF
s4 POP s4 POP
s6 s7 XCHG
s5 s6 XCHG s5 s6 XCHG
s4 s5 XCHG s4 s5 XCHG
1 3 BLKSWAP 1 3 BLKSWAP
@ -300,15 +444,32 @@ SETCP0
2 GETGLOBVAR 2 GETGLOBVAR
s0 s1 XCHG s0 s1 XCHG
STREF STREF
3 1 BLKSWAP 4 1 BLKSWAP
<{ <{
s2 s3 XCHG2 s3 s4 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
NEWC
ROT
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
ENDC
s0 s1 XCHG
STREF
}> CALLREF }> CALLREF
ENDC ENDC
c4 POP c4 POP
@ -487,19 +648,38 @@ SETCP0
1 RSHIFT 1 RSHIFT
36: 36:
PUSHNULL
0 PUSHINT 0 PUSHINT
s0 s3 XCHG s0 s4 XCHG
NEWC NEWC
STREF STREF
s3 s1 s3 XCHG3 s0 s4 XCHG
s3 s3 XCHG2
<{ <{
s2 s3 XCHG2 s3 s4 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
NEWC
ROT
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
ENDC
s0 s1 XCHG
STREF
}> CALLREF }> CALLREF
ENDC ENDC
@ -529,6 +709,7 @@ SETCP0
36 CALLDICT 36 CALLDICT
38: 38:
s0 POP
2 GETGLOBVAR 2 GETGLOBVAR
s1 s2 PUSH2 s1 s2 PUSH2
37 CALLDICT 37 CALLDICT
@ -539,17 +720,17 @@ SETCP0
1 GETGLOBVAR 1 GETGLOBVAR
4 UNTUPLE 4 UNTUPLE
4429 PUSHINT 4429 PUSHINT
s3 s11 PUSH2 s3 s12 PUSH2
SDEQ SDEQ
THROWANYIFNOT THROWANYIFNOT
s11 s7 XCPU s12 s7 XCPU
SUB SUB
62972 PUSHINT 62972 PUSHINT
s1 PUSH s1 PUSH
-1 GTINT -1 GTINT
THROWANYIFNOT THROWANYIFNOT
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
s3 s11 PUXC s3 s12 PUXC
35 CALLDICT 35 CALLDICT
1 PUSHINT 1 PUSHINT
s4 PUSH s4 PUSH
@ -570,7 +751,7 @@ SETCP0
GREATER GREATER
THROWANYIFNOT THROWANYIFNOT
2 GETGLOBVAR 2 GETGLOBVAR
0 6 3 XCPUXC 0 7 3 XCPUXC
37 CALLDICT 37 CALLDICT
2DUP 2DUP
33 CALLDICT 33 CALLDICT
@ -578,21 +759,23 @@ SETCP0
s7 s6 XCHG2 s7 s6 XCHG2
0 PUSHINT 0 PUSHINT
64 PUSHINT 64 PUSHINT
s11 PUSH PUSHNULL
12 2 8 PUXC2 s13 PUSH
s1 s8 XCHG s3 s14 XCPU
s0 s3 XCHG
s9 s10 s9 XCHG3
<{ <{
NEWC NEWC
6 1 BLKSWAP 7 1 BLKSWAP
<{ <{
395134233 PUSHINT 395134233 PUSHINT
s0 s7 XCHG2 s0 s8 XCHG2
32 STU 32 STU
s1 s5 XCHG s1 s6 XCHG
64 STU 64 STU
s0 s3 XCHG2 s0 s4 XCHG2
STGRAMS STGRAMS
s0 s1 XCHG ROT
STSLICER STSLICER
s0 s1 XCHG s0 s1 XCHG
s0 PUSH s0 PUSH
@ -611,40 +794,70 @@ SETCP0
STGRAMS STGRAMS
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
NEWC
ROT
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
ENDC
s0 s1 XCHG
STREF
}> CALLREF }> CALLREF
ENDC ENDC
}> CALLREF }> CALLREF
s5 s6 XCHG s5 s6 XCHG
s3 s4 XCHG
ROTREV ROTREV
34 CALLDICT 34 CALLDICT
40: 40:
1 GETGLOBVAR 1 GETGLOBVAR
4 UNTUPLE 4 UNTUPLE
s2 s10 PUSH2 s11 PUSH
ISNULL
<{
s11 POP
s3 s10 XCHG
}> PUSHCONT
<{
s4 POP
}> PUSHCONT
IFELSE
s1 s11 PUSH2
SDEQ SDEQ
NOT NOT
s2 s11 PUSH2
SDEQ
NOT
AND
<{ <{
2 GETGLOBVAR 2 GETGLOBVAR
s11 s8 PUSH2 s12 s8 PUSH2
37 CALLDICT 37 CALLDICT
s0 s1 XCHG s0 s1 XCHG
4429 PUSHINT 4429 PUSHINT
s0 s2 XCHG s0 s2 XCHG
33 CALLDICT 33 CALLDICT
s4 PUSH s3 PUSH
SDEQ SDEQ
THROWANYIFNOT THROWANYIFNOT
}> PUSHCONT }> PUSHCONT
IF IF
s12 s8 XCPU s13 s8 XCPU
ADD ADD
62972 PUSHINT 62972 PUSHINT
s1 PUSH s1 PUSH
-1 GTINT -1 GTINT
THROWANYIFNOT THROWANYIFNOT
s1 PUSH s13 PUSH
BALANCE BALANCE
0 INDEX 0 INDEX
s1 PUSH s1 PUSH
@ -659,12 +872,10 @@ SETCP0
s6 PUSH s6 PUSH
0 GTINT 0 GTINT
<{ <{
s4 s13 XCHG2 s14 s4 XCHG2
s3 s3 s0 XCHG3
35 CALLDICT 35 CALLDICT
s3 s-1 PUXC s3 s-1 PUXC
ADD ADD
s1 s10 XCHG
SUB SUB
0 PUSHINT 0 PUSHINT
0 PUSHINT 0 PUSHINT
@ -689,22 +900,22 @@ SETCP0
}> CALLREF }> CALLREF
ENDC ENDC
}> CALLREF }> CALLREF
s8 PUSH s9 PUSH
s4 s6 XCHG s4 s6 XCHG
s3 s1 s3 XCHG3 s3 s1 s3 XCHG3
s5 s5 XCHG2 s5 s5 XCHG2
PUSHNULL PUSHNULL
PUSHNULL PUSHNULL
34 CALLDICT 34 CALLDICT
s0 s5 XCHG2 s0 s6 XCHG2
}> PUSHCONT }> PUSHCONT
<{ <{
s7 s13 XCHG s7 s14 XCHG
s8 s9 XCHG2 s8 s9 XCHG2
8 BLKDROP 8 BLKDROP
}> PUSHCONT }> PUSHCONT
IFELSE IFELSE
s5 PUSH s6 PUSH
ISNULL ISNULL
NOT NOT
s2 PUSH s2 PUSH
@ -712,7 +923,7 @@ SETCP0
AND AND
<{ <{
0 PUSHINT 0 PUSHINT
s0 s6 XCHG s0 s7 XCHG
2 CALLDICT 2 CALLDICT
0 PUSHINT 0 PUSHINT
s0 s4 XCHG s0 s4 XCHG
@ -727,35 +938,41 @@ SETCP0
}> CALLREF }> CALLREF
ENDC ENDC
}> CALLREF }> CALLREF
s4 s7 XCHG s4 s8 XCHG
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
s1 s7 XCHG s1 s8 XCHG
PUSHNULL PUSHNULL
PUSHNULL PUSHNULL
34 CALLDICT 34 CALLDICT
}> IFREFELSEREF }> PUSHCONT
s5 POP <{
s6 POP
2DROP 2DROP
}> PUSHCONT
IFELSE
41: 41:
2DROP 2DROP
1 GETGLOBVAR 1 GETGLOBVAR
4 UNTUPLE 4 UNTUPLE
4429 PUSHINT 4429 PUSHINT
s3 s8 PUSH2 s3 s9 PUSH2
SDEQ
s4 s9 PUSH2
SDEQ SDEQ
OR
s4 s8 PUSH2 s4 s8 PUSH2
SDEQ SDEQ
OR OR
THROWANYIFNOT THROWANYIFNOT
s8 s4 XCPU s9 s4 XCPU
SUB SUB
62972 PUSHINT 62972 PUSHINT
s1 PUSH s1 PUSH
-1 GTINT -1 GTINT
THROWANYIFNOT THROWANYIFNOT
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
s3 s8 PUXC s3 s9 PUXC
35 CALLDICT 35 CALLDICT
16059 PUSHINT 16059 PUSHINT
s0 s1 XCHG s0 s1 XCHG
@ -770,7 +987,7 @@ SETCP0
0 PUSHINT 0 PUSHINT
s0 s3 XCHG s0 s3 XCHG
64 PUSHINT 64 PUSHINT
3 6 6 XCPU2 3 7 7 XCPU2
<{ <{
NEWC NEWC
4 1 BLKSWAP 4 1 BLKSWAP
@ -800,7 +1017,7 @@ SETCP0
}> CALLREF }> CALLREF
ENDC ENDC
}> CALLREF }> CALLREF
3 0 4 XC2PU 3 0 5 XC2PU
s3 s3 XCHG2 s3 s3 XCHG2
PUSHNULL PUSHNULL
PUSHNULL PUSHNULL
@ -825,9 +1042,9 @@ SETCP0
OR OR
s1 s2 XCHG s1 s2 XCHG
THROWANYIFNOT THROWANYIFNOT
s1 s3 XCHG s1 s4 XCHG
ADD ADD
s0 s2 XCHG s0 s3 XCHG
get_wallet_data: get_wallet_data:
<{ <{
@ -844,9 +1061,27 @@ SETCP0
s0 s1 XCHG s0 s1 XCHG
LDMSGADDR LDMSGADDR
s0 s1 XCHG s0 s1 XCHG
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 s3 s3 s0 XCHG3
}> CALLREF }> CALLREF
1 3 BLKDROP2 1 4 BLKDROP2
}> CALLREF }> CALLREF
38 CALLDICT 38 CALLDICT
30 CALLDICT 30 CALLDICT

BIN
sources/output/jetton_TONBWallet.init.boc

Binary file not shown.

20
sources/output/jetton_TONBWallet.init.fc

@ -8,22 +8,34 @@ builder __tact_store_address(builder b, slice address) inline {
return b; return b;
} }
builder __gen_write_TONBWallet(builder build_0, (int, slice, slice) v) inline_ref { builder __tact_store_address_opt(builder b, slice address) inline {
var (v'balance, v'owner, v'master) = v; if (null?(address)) {
b = b.store_uint(0, 2);
return b;
} else {
return __tact_store_address(b, address);
}
}
builder __gen_write_TONBWallet(builder build_0, (int, slice, slice, slice) v) inline_ref {
var (v'balance, v'owner, v'master, v'linker) = v;
build_0 = build_0.store_int(v'balance, 257); build_0 = build_0.store_int(v'balance, 257);
build_0 = __tact_store_address(build_0, v'owner); build_0 = __tact_store_address(build_0, v'owner);
build_0 = __tact_store_address(build_0, v'master); build_0 = __tact_store_address(build_0, v'master);
var build_1 = begin_cell();
build_1 = __tact_store_address_opt(build_1, v'linker);
build_0 = store_ref(build_0, build_1.end_cell());
return build_0; return build_0;
} }
cell $__gen_TONBWallet_init(cell sys', slice $master, slice $owner) { cell $__gen_TONBWallet_init(cell sys', slice $master, slice $owner) {
var (($self'balance, $self'owner, $self'master)) = (null(), null(), null()); var (($self'balance, $self'owner, $self'master, $self'linker)) = (null(), null(), null(), null());
$self'balance = 0; $self'balance = 0;
$self'owner = $owner; $self'owner = $owner;
$self'master = $master; $self'master = $master;
var b' = begin_cell(); var b' = begin_cell();
b' = b'.store_ref(sys'); b' = b'.store_ref(sys');
b' = __gen_write_TONBWallet(b', ($self'balance, $self'owner, $self'master)); b' = __gen_write_TONBWallet(b', ($self'balance, $self'owner, $self'master, $self'linker));
return b'.end_cell(); return b'.end_cell();
} }

27
sources/output/jetton_TONBWallet.init.fif

@ -1,6 +1,7 @@
PROGRAM{ PROGRAM{
DECLPROC __tact_verify_address DECLPROC __tact_verify_address
DECLPROC __tact_store_address DECLPROC __tact_store_address
DECLPROC __tact_store_address_opt
DECLPROC __gen_write_TONBWallet DECLPROC __gen_write_TONBWallet
DECLPROC $__gen_TONBWallet_init DECLPROC $__gen_TONBWallet_init
107886 DECLMETHOD init 107886 DECLMETHOD init
@ -14,21 +15,41 @@ PROGRAM{
__tact_store_address PROCINLINE:<{ __tact_store_address PROCINLINE:<{
STSLICER STSLICER
}> }>
__tact_store_address_opt PROCINLINE:<{
DUP
ISNULL
IF:<{
DROP
0 PUSHINT
SWAP
2 STU
}>ELSE<{
__tact_store_address INLINECALLDICT
}>
}>
__gen_write_TONBWallet PROCREF:<{ __gen_write_TONBWallet PROCREF:<{
s2 s3 XCHG2 s3 s4 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
SWAP SWAP
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
SWAP SWAP
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
NEWC
ROT
__tact_store_address_opt INLINECALLDICT
ENDC
SWAP
STREF
}> }>
$__gen_TONBWallet_init PROC:<{ $__gen_TONBWallet_init PROC:<{
PUSHNULL
0 PUSHINT 0 PUSHINT
s0 s3 XCHG s0 s4 XCHG
NEWC NEWC
STREF STREF
s3 s1 s3 XCHG3 s0 s4 XCHG
s3 s3 XCHG2
__gen_write_TONBWallet INLINECALLDICT __gen_write_TONBWallet INLINECALLDICT
ENDC ENDC
}> }>

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

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

14
sources/output/jetton_TONBWallet.md

@ -1,6 +1,6 @@
# TACT Compilation Report # TACT Compilation Report
Contract: TONBWallet Contract: TONBWallet
BOC Size: 1324 bytes BOC Size: 1422 bytes
# Types # Types
Total Types: 18 Total Types: 18
@ -22,8 +22,8 @@ TLB: `token_transfer#0f8a7ea5 queryId:uint64 amount:coins destination:address re
Signature: `TokenTransfer{queryId:uint64,amount:coins,destination:address,responseDestination:Maybe address,customPayload:Maybe ^cell,forwardTonAmount:coins,forwardPayload:remainder<slice>}` Signature: `TokenTransfer{queryId:uint64,amount:coins,destination:address,responseDestination:Maybe address,customPayload:Maybe ^cell,forwardTonAmount:coins,forwardPayload:remainder<slice>}`
## TokenTransferInternal ## TokenTransferInternal
TLB: `token_transfer_internal#178d4519 queryId:uint64 amount:coins from:address responseAddress:Maybe address 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> setLinker:Maybe address = TokenTransferInternal`
Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder<slice>}` Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder<slice>,setLinker:Maybe address}`
## TokenNotification ## TokenNotification
TLB: `token_notification#7362d09c queryId:uint64 amount:coins from:address forwardPayload:remainder<slice> = TokenNotification` TLB: `token_notification#7362d09c queryId:uint64 amount:coins from:address forwardPayload:remainder<slice> = TokenNotification`
@ -53,14 +53,14 @@ Signature: `JettonData{totalSupply:int257,mintable:bool,owner:address,content:Ma
TLB: `_ balance:int257 owner:address master:address walletCode:^cell = JettonWalletData` TLB: `_ balance:int257 owner:address master:address walletCode:^cell = JettonWalletData`
Signature: `JettonWalletData{balance:int257,owner:address,master:address,walletCode:^cell}` Signature: `JettonWalletData{balance:int257,owner:address,master:address,walletCode:^cell}`
## InitLinker
TLB: `init_linker#453d436d owner:address = InitLinker`
Signature: `InitLinker{owner:address}`
## SetLinkerNeighbor ## SetLinkerNeighbor
TLB: `set_linker_neighbor#b3fcf4c1 neighbor:Maybe address = SetLinkerNeighbor` TLB: `set_linker_neighbor#b3fcf4c1 neighbor:Maybe address = SetLinkerNeighbor`
Signature: `SetLinkerNeighbor{neighbor:Maybe address}` Signature: `SetLinkerNeighbor{neighbor:Maybe address}`
## InitLinker
TLB: `init_linker#67c08154 neighbor:Maybe address walletAmount:int257 walletCode:^cell walletData:^cell walletAddress:address responseAddress:Maybe address = InitLinker`
Signature: `InitLinker{neighbor:Maybe address,walletAmount:int257,walletCode:^cell,walletData:^cell,walletAddress:address,responseAddress:Maybe address}`
## WithdrawalRequests ## WithdrawalRequests
TLB: `_ addresses:dict<int, address> amounts:dict<int, int> n_requests:int257 = 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}` Signature: `WithdrawalRequests{addresses:dict<int, address>,amounts:dict<int, int>,n_requests:int257}`

2
sources/output/jetton_TONBWallet.pkg

File diff suppressed because one or more lines are too long

108
sources/output/jetton_TONBWallet.ts

@ -247,6 +247,7 @@ export type TokenTransferInternal = {
responseAddress: Address | null; responseAddress: Address | null;
forwardTonAmount: bigint; forwardTonAmount: bigint;
forwardPayload: Cell; forwardPayload: Cell;
setLinker: Address | null;
} }
export function storeTokenTransferInternal(src: TokenTransferInternal) { export function storeTokenTransferInternal(src: TokenTransferInternal) {
@ -259,6 +260,9 @@ export function storeTokenTransferInternal(src: TokenTransferInternal) {
b_0.storeAddress(src.responseAddress); b_0.storeAddress(src.responseAddress);
b_0.storeCoins(src.forwardTonAmount); b_0.storeCoins(src.forwardTonAmount);
b_0.storeBuilder(src.forwardPayload.asBuilder()); b_0.storeBuilder(src.forwardPayload.asBuilder());
let b_1 = new Builder();
b_1.storeAddress(src.setLinker);
b_0.storeRef(b_1.endCell());
}; };
} }
@ -271,7 +275,9 @@ export function loadTokenTransferInternal(slice: Slice) {
let _responseAddress = sc_0.loadMaybeAddress(); let _responseAddress = sc_0.loadMaybeAddress();
let _forwardTonAmount = sc_0.loadCoins(); let _forwardTonAmount = sc_0.loadCoins();
let _forwardPayload = sc_0.asCell(); let _forwardPayload = sc_0.asCell();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; let sc_1 = sc_0.loadRef().beginParse();
let _setLinker = sc_1.loadMaybeAddress();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload, setLinker: _setLinker };
} }
function loadTupleTokenTransferInternal(source: TupleReader) { function loadTupleTokenTransferInternal(source: TupleReader) {
@ -281,7 +287,8 @@ function loadTupleTokenTransferInternal(source: TupleReader) {
let _responseAddress = source.readAddressOpt(); let _responseAddress = source.readAddressOpt();
let _forwardTonAmount = source.readBigNumber(); let _forwardTonAmount = source.readBigNumber();
let _forwardPayload = source.readCell(); let _forwardPayload = source.readCell();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; let _setLinker = source.readAddressOpt();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload, setLinker: _setLinker };
} }
function storeTupleTokenTransferInternal(source: TokenTransferInternal) { function storeTupleTokenTransferInternal(source: TokenTransferInternal) {
@ -292,6 +299,7 @@ function storeTupleTokenTransferInternal(source: TokenTransferInternal) {
builder.writeAddress(source.responseAddress); builder.writeAddress(source.responseAddress);
builder.writeNumber(source.forwardTonAmount); builder.writeNumber(source.forwardTonAmount);
builder.writeSlice(source.forwardPayload); builder.writeSlice(source.forwardPayload);
builder.writeAddress(source.setLinker);
return builder.build(); return builder.build();
} }
@ -668,85 +676,113 @@ function dictValueParserJettonWalletData(): DictionaryValue<JettonWalletData> {
} }
} }
} }
export type InitLinker = { export type SetLinkerNeighbor = {
$$type: 'InitLinker'; $$type: 'SetLinkerNeighbor';
owner: Address; neighbor: Address | null;
} }
export function storeInitLinker(src: InitLinker) { export function storeSetLinkerNeighbor(src: SetLinkerNeighbor) {
return (builder: Builder) => { return (builder: Builder) => {
let b_0 = builder; let b_0 = builder;
b_0.storeUint(1161642861, 32); b_0.storeUint(3019699393, 32);
b_0.storeAddress(src.owner); b_0.storeAddress(src.neighbor);
}; };
} }
export function loadInitLinker(slice: Slice) { export function loadSetLinkerNeighbor(slice: Slice) {
let sc_0 = slice; let sc_0 = slice;
if (sc_0.loadUint(32) !== 1161642861) { throw Error('Invalid prefix'); } if (sc_0.loadUint(32) !== 3019699393) { throw Error('Invalid prefix'); }
let _owner = sc_0.loadAddress(); let _neighbor = sc_0.loadMaybeAddress();
return { $$type: 'InitLinker' as const, owner: _owner }; return { $$type: 'SetLinkerNeighbor' as const, neighbor: _neighbor };
} }
function loadTupleInitLinker(source: TupleReader) { function loadTupleSetLinkerNeighbor(source: TupleReader) {
let _owner = source.readAddress(); let _neighbor = source.readAddressOpt();
return { $$type: 'InitLinker' as const, owner: _owner }; return { $$type: 'SetLinkerNeighbor' as const, neighbor: _neighbor };
} }
function storeTupleInitLinker(source: InitLinker) { function storeTupleSetLinkerNeighbor(source: SetLinkerNeighbor) {
let builder = new TupleBuilder(); let builder = new TupleBuilder();
builder.writeAddress(source.owner); builder.writeAddress(source.neighbor);
return builder.build(); return builder.build();
} }
function dictValueParserInitLinker(): DictionaryValue<InitLinker> { function dictValueParserSetLinkerNeighbor(): DictionaryValue<SetLinkerNeighbor> {
return { return {
serialize: (src, buidler) => { serialize: (src, buidler) => {
buidler.storeRef(beginCell().store(storeInitLinker(src)).endCell()); buidler.storeRef(beginCell().store(storeSetLinkerNeighbor(src)).endCell());
}, },
parse: (src) => { parse: (src) => {
return loadInitLinker(src.loadRef().beginParse()); return loadSetLinkerNeighbor(src.loadRef().beginParse());
} }
} }
} }
export type SetLinkerNeighbor = { export type InitLinker = {
$$type: 'SetLinkerNeighbor'; $$type: 'InitLinker';
neighbor: Address | null; neighbor: Address | null;
walletAmount: bigint;
walletCode: Cell;
walletData: Cell;
walletAddress: Address;
responseAddress: Address | null;
} }
export function storeSetLinkerNeighbor(src: SetLinkerNeighbor) { export function storeInitLinker(src: InitLinker) {
return (builder: Builder) => { return (builder: Builder) => {
let b_0 = builder; let b_0 = builder;
b_0.storeUint(3019699393, 32); b_0.storeUint(1740669268, 32);
b_0.storeAddress(src.neighbor); b_0.storeAddress(src.neighbor);
b_0.storeInt(src.walletAmount, 257);
b_0.storeRef(src.walletCode);
b_0.storeRef(src.walletData);
b_0.storeAddress(src.walletAddress);
let b_1 = new Builder();
b_1.storeAddress(src.responseAddress);
b_0.storeRef(b_1.endCell());
}; };
} }
export function loadSetLinkerNeighbor(slice: Slice) { export function loadInitLinker(slice: Slice) {
let sc_0 = slice; let sc_0 = slice;
if (sc_0.loadUint(32) !== 3019699393) { throw Error('Invalid prefix'); } if (sc_0.loadUint(32) !== 1740669268) { throw Error('Invalid prefix'); }
let _neighbor = sc_0.loadMaybeAddress(); let _neighbor = sc_0.loadMaybeAddress();
return { $$type: 'SetLinkerNeighbor' as const, neighbor: _neighbor }; let _walletAmount = sc_0.loadIntBig(257);
let _walletCode = sc_0.loadRef();
let _walletData = sc_0.loadRef();
let _walletAddress = sc_0.loadAddress();
let sc_1 = sc_0.loadRef().beginParse();
let _responseAddress = sc_1.loadMaybeAddress();
return { $$type: 'InitLinker' as const, neighbor: _neighbor, walletAmount: _walletAmount, walletCode: _walletCode, walletData: _walletData, walletAddress: _walletAddress, responseAddress: _responseAddress };
} }
function loadTupleSetLinkerNeighbor(source: TupleReader) { function loadTupleInitLinker(source: TupleReader) {
let _neighbor = source.readAddressOpt(); let _neighbor = source.readAddressOpt();
return { $$type: 'SetLinkerNeighbor' as const, neighbor: _neighbor }; let _walletAmount = source.readBigNumber();
let _walletCode = source.readCell();
let _walletData = source.readCell();
let _walletAddress = source.readAddress();
let _responseAddress = source.readAddressOpt();
return { $$type: 'InitLinker' as const, neighbor: _neighbor, walletAmount: _walletAmount, walletCode: _walletCode, walletData: _walletData, walletAddress: _walletAddress, responseAddress: _responseAddress };
} }
function storeTupleSetLinkerNeighbor(source: SetLinkerNeighbor) { function storeTupleInitLinker(source: InitLinker) {
let builder = new TupleBuilder(); let builder = new TupleBuilder();
builder.writeAddress(source.neighbor); builder.writeAddress(source.neighbor);
builder.writeNumber(source.walletAmount);
builder.writeCell(source.walletCode);
builder.writeCell(source.walletData);
builder.writeAddress(source.walletAddress);
builder.writeAddress(source.responseAddress);
return builder.build(); return builder.build();
} }
function dictValueParserSetLinkerNeighbor(): DictionaryValue<SetLinkerNeighbor> { function dictValueParserInitLinker(): DictionaryValue<InitLinker> {
return { return {
serialize: (src, buidler) => { serialize: (src, buidler) => {
buidler.storeRef(beginCell().store(storeSetLinkerNeighbor(src)).endCell()); buidler.storeRef(beginCell().store(storeInitLinker(src)).endCell());
}, },
parse: (src) => { parse: (src) => {
return loadSetLinkerNeighbor(src.loadRef().beginParse()); return loadInitLinker(src.loadRef().beginParse());
} }
} }
} }
@ -923,9 +959,9 @@ function dictValueParserWithdraw(): DictionaryValue<Withdraw> {
} }
} }
async function TONBWallet_init(master: Address, owner: Address) { async function TONBWallet_init(master: Address, owner: Address) {
const __init = 'te6ccgEBBwEAPQABFP8A9KQT9LzyyAsBAgFiAgMCAs0EBQAJoUrd4AkAAdQBE9OAHkZiGJ7Z5kwGABpQI4EBAc8AAc8WAc8W'; const __init = 'te6ccgEBBwEAUAABFP8A9KQT9LzyyAsBAgFiAgMCAs0EBQAJoUrd4AsAAdQBF2W1wBMjMBFAz2zzJgYAPFA0gQEBzwABzxYBzxbIWCBulTBwAcsBks8W4skBzA==';
const __code = 'te6ccgECNAEABSAAART/APSkE/S88sgLAQIBYgIDAgLKBgcCASAEBQERv9gW2eeBN4D0EQBxvd6ME4LnYerpZXPY9CdhzrJUKNs0E4TusalpWyPlmRadeW/vixHME4TujwAfLZsB5P5B1ZLNZRCcAgEgCAkCAUgVFgIBYgoLAAOnQASJRwIddJwh+VMCDXCx/eAtDTAwFxsMABkX+RcOIB+kAiUGZvBPhhAo8JMNs8VQLwKts84CCCEA+KfqW64wIgghAXjUUZuoERMMDQALQgbvLQgIAyIw2zwD2zw3EIkQeFUF8CfbPBEOEwQ2j5Ew2zwD2zw2EHgQZ1UE8CjbPOCCEFlfB7y6EQ8TEABs0x8BghAPin6luvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIB0gABkdSSbQHi+gBRZhYVFEMwAFjTHwGCEBeNRRm68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4gH6AFFVFRRDMAMuj5DbPAPbPDQQVhBFVQLwKds84DDywIIREhMBFu1E0NQB+GLbPGwTFABM0x8BghBZXwe8uvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIUQzABGMj4QgHMVSDbPMntVCMAHIE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Ns8BNs8NxCaEIkQeFUF8CfbPDMwMQBs0x8BghAPin6luvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIB0gABkdSSbQHi+gBRZhYVFEMwARjI+EIBzFUw2zzJ7VQyADxQNIEBAc8AAc8WAc8WyFggbpUwcAHLAZLPFuLJAcwBFu1E0NQB+GLbPGwUNABEgQEB1wD6QAEB+kABAdQB0PpAIdcLAcMAkQGSMW3iMRRDMGRj05c=';
let systemCell = Cell.fromBase64(__system); let systemCell = Cell.fromBase64(__system);
let builder = new TupleBuilder(); let builder = new TupleBuilder();
builder.writeCell(systemCell); builder.writeCell(systemCell);

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

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`jetton should deploy 1`] = ` exports[`jetton should deploy and deposit the wallet with the correct sum of money 1`] = `
[ [
{ {
"type": "deploy", "type": "deploy",
@ -13,70 +13,45 @@ exports[`jetton should deploy 1`] = `
}, },
"bounce": true, "bounce": true,
"from": "kQAI-3FJVc_ywSuY4vq0bYrzR7S4Och4y7bTU_i5yLOB3A6P", "from": "kQAI-3FJVc_ywSuY4vq0bYrzR7S4Och4y7bTU_i5yLOB3A6P",
"to": "kQBbN1ES7aHOD-YQDRZ0b8_HFJFJtu99cbmeu79JtaT7mbCh", "to": "kQCM9AmnDVgUtUtKjTYQmBC1nKt5dR8EsRWQvtvzNws01ZJu",
"type": "internal", "type": "internal",
"value": 1100000000n, "value": 1200000000n,
}, },
"type": "received", "type": "received",
}, },
{ {
"gasUsed": 22607n, "gasUsed": 36303n,
"type": "processed", "type": "processed",
}, },
{ {
"messages": [ "messages": [
{ {
"body": { "body": {
"cell": "x{178D4519000000000000000043B9ACA00800B66EA225DB439C1FCC201A2CE8DF9F8E2922936DDEFAE3733D777E936B49F73300023EDC525573FCB04AE638BEAD1B62BCD1ED2E0E721E32EDB4D4FE2E722CE07702_}", "cell": "x{B3FCF4C12_}",
"type": "cell", "type": "cell",
}, },
"bounce": false, "bounce": false,
"from": "kQBbN1ES7aHOD-YQDRZ0b8_HFJFJtu99cbmeu79JtaT7mbCh", "from": "kQCM9AmnDVgUtUtKjTYQmBC1nKt5dR8EsRWQvtvzNws01ZJu",
"to": "kQBUyXAApVkXHsyW_DjETpmWFHRLXdFHz5XELjf5v7e3oluU", "to": "kQB2vHcaIyjKkO_JMeWRZ8QN_zBjgfX7OHflzG9vrE3cUH-F",
"type": "internal", "type": "internal",
"value": 182761000n, "value": 13474000n,
}, },
], ],
"type": "sent", "type": "sent",
}, },
]
`;
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": [ "messages": [
{ {
"body": { "body": {
"cell": "x{178D4519000000000000000043B9ACA00800B66EA225DB439C1FCC201A2CE8DF9F8E2922936DDEFAE3733D777E936B49F73300023EDC525573FCB04AE638BEAD1B62BCD1ED2E0E721E32EDB4D4FE2E722CE07702_}", "cell": "x{178D4519000000000000000043B9ACA0080119E8134E1AB0296A96951A6C2130216B3956F2EA3E09622B217DB7E66E1669AB00023EDC525573FCB04AE638BEAD1B62BCD1ED2E0E721E32EDB4D4FE2E722CE07702_}
x{800ED78EE3446519521DF9263CB22CF881BFE60C703EBF670EFCB98DEDF589BB8A1_}",
"type": "cell", "type": "cell",
}, },
"bounce": false, "bounce": false,
"from": "kQBbN1ES7aHOD-YQDRZ0b8_HFJFJtu99cbmeu79JtaT7mbCh", "from": "kQCM9AmnDVgUtUtKjTYQmBC1nKt5dR8EsRWQvtvzNws01ZJu",
"to": "kQBUyXAApVkXHsyW_DjETpmWFHRLXdFHz5XELjf5v7e3oluU", "to": "kQCs7NEVQDI566FHvxACpYud6bZ40nPH4s_v39XOEbexYPMS",
"type": "internal", "type": "internal",
"value": 182761000n, "value": 21584000n,
}, },
], ],
"type": "sent", "type": "sent",

22
sources/tests/jetton.spec.ts

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

14
sources/wallet.tact

@ -1,5 +1,8 @@
import "@stdlib/ownable"; import "@stdlib/ownable";
import "./messages"; import "./messages";
import "./linker";
@interface("org.ton.jetton.wallet") @interface("org.ton.jetton.wallet")
contract TONBWallet { contract TONBWallet {
@ -10,6 +13,7 @@ contract TONBWallet {
balance: Int; balance: Int;
owner: Address; owner: Address;
master: Address; master: Address;
linker: Address?;
init(master: Address, owner: Address) { init(master: Address, owner: Address) {
self.balance = 0; self.balance = 0;
@ -49,7 +53,8 @@ contract TONBWallet {
from: self.owner, from: self.owner,
responseAddress: self.owner, responseAddress: self.owner,
forwardTonAmount: msg.forwardTonAmount, forwardTonAmount: msg.forwardTonAmount,
forwardPayload: msg.forwardPayload forwardPayload: msg.forwardPayload,
setLinker: null
}.toCell(), }.toCell(),
code: init.code, code: init.code,
data: init.data data: init.data
@ -60,7 +65,10 @@ contract TONBWallet {
// Check sender // Check sender
let ctx: Context = context(); let ctx: Context = context();
if (ctx.sender != self.master) { if (self.linker == null) {
self.linker = msg.setLinker;
}
if (ctx.sender != self.master && ctx.sender != self.linker) {
let sinit: StateInit = initOf TONBWallet(self.master, msg.from); let sinit: StateInit = initOf TONBWallet(self.master, msg.from);
require(contractAddress(sinit) == ctx.sender, "Invalid sender"); require(contractAddress(sinit) == ctx.sender, "Invalid sender");
} }
@ -109,7 +117,7 @@ contract TONBWallet {
// Check sender // Check sender
let ctx: Context = context(); let ctx: Context = context();
require(ctx.sender == self.owner || ctx.sender == self.master, "Invalid sender"); require(ctx.sender == self.owner || ctx.sender == self.master || ctx.sender == self.linker, "Invalid sender");
// Update balance // Update balance
self.balance = self.balance - msg.amount; self.balance = self.balance - msg.amount;

Loading…
Cancel
Save