Browse Source

Withdrawals working

master
Lev 2 years ago
parent
commit
ed43c06a01
  1. 2
      sources/constants.tact
  2. 18
      sources/jetton_trait.tact
  3. 3
      sources/messages.tact
  4. 2
      sources/output/jetton_Linker.abi
  5. 2
      sources/output/jetton_Linker.code.fc
  6. 2
      sources/output/jetton_Linker.code.fif
  7. 4
      sources/output/jetton_Linker.md
  8. 2
      sources/output/jetton_Linker.pkg
  9. 19
      sources/output/jetton_Linker.ts
  10. 2
      sources/output/jetton_TONB.abi
  11. BIN
      sources/output/jetton_TONB.code.boc
  12. 41
      sources/output/jetton_TONB.code.fc
  13. 120
      sources/output/jetton_TONB.code.fif
  14. 240
      sources/output/jetton_TONB.code.rev.fif
  15. 6
      sources/output/jetton_TONB.md
  16. 2
      sources/output/jetton_TONB.pkg
  17. 23
      sources/output/jetton_TONB.ts
  18. 2
      sources/output/jetton_TONBWallet.abi
  19. BIN
      sources/output/jetton_TONBWallet.code.boc
  20. 79
      sources/output/jetton_TONBWallet.code.fc
  21. 196
      sources/output/jetton_TONBWallet.code.fif
  22. 388
      sources/output/jetton_TONBWallet.code.rev.fif
  23. BIN
      sources/output/jetton_TONBWallet.init.boc
  24. 11
      sources/output/jetton_TONBWallet.init.fc
  25. 27
      sources/output/jetton_TONBWallet.init.fif
  26. 29
      sources/output/jetton_TONBWallet.init.rev.fif
  27. 6
      sources/output/jetton_TONBWallet.md
  28. 2
      sources/output/jetton_TONBWallet.pkg
  29. 25
      sources/output/jetton_TONBWallet.ts
  30. 18
      sources/tests/__snapshots__/jetton.spec.ts.snap
  31. 8
      sources/tests/jetton.spec.ts
  32. 15
      sources/wallet.tact

2
sources/constants.tact

@ -3,4 +3,4 @@ const gas_consumption: Int = ton("0.01");
const withdraw_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 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 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 const wallet_credit: Int = ton("0.05"); // TON to send to the wallet for the fees

18
sources/jetton_trait.tact

@ -41,20 +41,15 @@ trait TONBTrait with Ownable {
// Update supply // Update supply
self.totalSupply = self.totalSupply - msg.amount; self.totalSupply = self.totalSupply - msg.amount;
/* todo: if not enough tokens, withdraw what we have, send some tokens to the owner, add a withdrawal request */
// Cashback // Withdraw
if (msg.responseAddress != null) {
send(SendParameters{ send(SendParameters{
to: msg.responseAddress!!, to: msg.owner,
value: 0, value: msg.amount,
bounce: false, bounce: false
mode: SendRemainingValue + SendIgnoreErrors,
body: TokenExcesses{
queryId: msg.queryId
}.toCell()
}); });
} }
}
// //
@ -111,7 +106,8 @@ trait TONBTrait with Ownable {
responseAddress: responseAddress, responseAddress: responseAddress,
forwardTonAmount: 0, forwardTonAmount: 0,
forwardPayload: emptySlice(), forwardPayload: emptySlice(),
setLinker: linker_address setLinker: self.n_linkers - 1,
setLinkerAddress: linker_address
}.toCell(); }.toCell();
send(SendParameters{ send(SendParameters{
to: walletAddress, to: walletAddress,

3
sources/messages.tact

@ -15,7 +15,8 @@ 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?; setLinker: Int?;
setLinkerAddress: Address?;
} }
message(0x7362d09c) TokenNotification { message(0x7362d09c) TokenNotification {

2
sources/output/jetton_Linker.abi

File diff suppressed because one or more lines are too long

2
sources/output/jetton_Linker.code.fc

@ -151,5 +151,5 @@ _ supported_interfaces() method_id {
} }
_ get_abi_ipfs() { _ get_abi_ipfs() {
return "ipfs://QmXsiG6UvpNzjujBxShses6JYADwX9LFvLtVUBva7kHxgm"; return "ipfs://QmP8qFn4KBRoGwXGpZzK8E7torCEscLLo8Ror4EcyYkigW";
} }

2
sources/output/jetton_Linker.code.fif

@ -200,6 +200,6 @@ PROGRAM{
209801025412363888721030803524359905849 PUSHINT 209801025412363888721030803524359905849 PUSHINT
}> }>
get_abi_ipfs PROC:<{ get_abi_ipfs PROC:<{
x{697066733a2f2f516d58736947365576704e7a6a756a42785368736573364a5941447758394c46764c745655427661376b4878676d} PUSHSLICE x{697066733a2f2f516d503871466e344b42526f47775847705a7a4b384537746f72434573634c4c6f38526f7234456379596b696757} PUSHSLICE
}> }>
}END>c }END>c

4
sources/output/jetton_Linker.md

@ -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> setLinker:Maybe address = TokenTransferInternal` TLB: `token_transfer_internal#178d4519 queryId:uint64 amount:coins from:address responseAddress:Maybe address forwardTonAmount:coins forwardPayload:remainder<slice> setLinker:Maybe int257 setLinkerAddress:Maybe address = TokenTransferInternal`
Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder<slice>,setLinker:Maybe address}` Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder<slice>,setLinker:Maybe int257,setLinkerAddress: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`

2
sources/output/jetton_Linker.pkg

File diff suppressed because one or more lines are too long

19
sources/output/jetton_Linker.ts

@ -247,7 +247,8 @@ export type TokenTransferInternal = {
responseAddress: Address | null; responseAddress: Address | null;
forwardTonAmount: bigint; forwardTonAmount: bigint;
forwardPayload: Cell; forwardPayload: Cell;
setLinker: Address | null; setLinker: bigint | null;
setLinkerAddress: Address | null;
} }
export function storeTokenTransferInternal(src: TokenTransferInternal) { export function storeTokenTransferInternal(src: TokenTransferInternal) {
@ -261,7 +262,8 @@ export function storeTokenTransferInternal(src: TokenTransferInternal) {
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(); let b_1 = new Builder();
b_1.storeAddress(src.setLinker); if (src.setLinker !== null && src.setLinker !== undefined) { b_1.storeBit(true).storeInt(src.setLinker, 257); } else { b_1.storeBit(false); }
b_1.storeAddress(src.setLinkerAddress);
b_0.storeRef(b_1.endCell()); b_0.storeRef(b_1.endCell());
}; };
} }
@ -276,8 +278,9 @@ export function loadTokenTransferInternal(slice: Slice) {
let _forwardTonAmount = sc_0.loadCoins(); let _forwardTonAmount = sc_0.loadCoins();
let _forwardPayload = sc_0.asCell(); let _forwardPayload = sc_0.asCell();
let sc_1 = sc_0.loadRef().beginParse(); let sc_1 = sc_0.loadRef().beginParse();
let _setLinker = sc_1.loadMaybeAddress(); let _setLinker = sc_1.loadBit() ? sc_1.loadIntBig(257) : null;
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload, setLinker: _setLinker }; let _setLinkerAddress = sc_1.loadMaybeAddress();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload, setLinker: _setLinker, setLinkerAddress: _setLinkerAddress };
} }
function loadTupleTokenTransferInternal(source: TupleReader) { function loadTupleTokenTransferInternal(source: TupleReader) {
@ -287,8 +290,9 @@ 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();
let _setLinker = source.readAddressOpt(); let _setLinker = source.readBigNumberOpt();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload, setLinker: _setLinker }; let _setLinkerAddress = source.readAddressOpt();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload, setLinker: _setLinker, setLinkerAddress: _setLinkerAddress };
} }
function storeTupleTokenTransferInternal(source: TokenTransferInternal) { function storeTupleTokenTransferInternal(source: TokenTransferInternal) {
@ -299,7 +303,8 @@ 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); builder.writeNumber(source.setLinker);
builder.writeAddress(source.setLinkerAddress);
return builder.build(); return builder.build();
} }

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.

41
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, slice) v) inline_ref { builder __gen_write_TokenTransferInternal(builder build_0, (int, int, slice, slice, int, slice, int, slice) v) inline_ref {
var (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload, v'setLinker) = v; var (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload, v'setLinker, v'setLinkerAddress) = 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);
@ -89,12 +89,13 @@ builder __gen_write_TokenTransferInternal(builder build_0, (int, int, slice, sli
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(); var build_1 = begin_cell();
build_1 = __tact_store_address_opt(build_1, v'setLinker); build_1 = ~ null?(v'setLinker) ? build_1.store_int(true, 1).store_int(v'setLinker, 257) : build_1.store_int(false, 1);
build_1 = __tact_store_address_opt(build_1, v'setLinkerAddress);
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_writecell_TokenTransferInternal((int, int, slice, slice, int, slice, slice) v) inline_ref { cell __gen_writecell_TokenTransferInternal((int, int, slice, slice, int, slice, int, slice) v) inline_ref {
return __gen_write_TokenTransferInternal(begin_cell(), v).end_cell(); return __gen_write_TokenTransferInternal(begin_cell(), v).end_cell();
} }
@ -121,17 +122,6 @@ cell __gen_writecell_TokenBurn((int, int, slice, slice) v) inline_ref {
return (sc_0, (v'queryId, v'amount, v'owner, v'responseAddress)); return (sc_0, (v'queryId, v'amount, v'owner, v'responseAddress));
} }
builder __gen_write_TokenExcesses(builder build_0, (int) v) inline_ref {
var (v'queryId) = v;
build_0 = store_uint(build_0, 3576854235, 32);
build_0 = build_0.store_uint(v'queryId, 64);
return build_0;
}
cell __gen_writecell_TokenExcesses((int) v) inline_ref {
return __gen_write_TokenExcesses(begin_cell(), v).end_cell();
}
(slice, ((cell))) __gen_read_TokenUpdateContent(slice sc_0) inline_ref { (slice, ((cell))) __gen_read_TokenUpdateContent(slice sc_0) inline_ref {
throw_unless(129, sc_0~load_uint(32) == 201882270); throw_unless(129, sc_0~load_uint(32) == 201882270);
var v'content = sc_0~load_int(1) ? sc_0~load_ref() : null(); var v'content = sc_0~load_int(1) ? sc_0~load_ref() : null();
@ -161,13 +151,14 @@ cell __gen_writecell_SetLinkerNeighbor((slice) v) inline_ref {
return (sc_0, (v'amount)); return (sc_0, (v'amount));
} }
builder __gen_write_TONBWallet(builder build_0, (int, slice, slice, slice) v) inline_ref { builder __gen_write_TONBWallet(builder build_0, (int, slice, slice, int, slice) v) inline_ref {
var (v'balance, v'owner, v'master, v'linker) = v; var (v'balance, v'owner, v'master, v'linker, v'linker_address) = 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(); var build_1 = begin_cell();
build_1 = __tact_store_address_opt(build_1, v'linker); build_1 = ~ null?(v'linker) ? build_1.store_int(true, 1).store_int(v'linker, 257) : build_1.store_int(false, 1);
build_1 = __tact_store_address_opt(build_1, v'linker_address);
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;
} }
@ -301,13 +292,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, $self'linker)) = (null(), null(), null(), null()); var (($self'balance, $self'owner, $self'master, $self'linker, $self'linker_address)) = (null(), 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, $self'linker)); b' = __gen_write_TONBWallet(b', ($self'balance, $self'owner, $self'master, $self'linker, $self'linker_address));
return b'.end_cell(); return b'.end_cell();
} }
@ -386,8 +377,8 @@ _ $__gen_get_get_jetton_data() method_id(106029) {
$send((false, $linker_address, 20000000, 0, __gen_writecell_SetLinkerNeighbor(($self'last_linker)), $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'last_linker = $linker_address;
$self'n_linkers = ($self'n_linkers + 1); $self'n_linkers = ($self'n_linkers + 1);
cell $wallet_msg_body = __gen_writecell_TokenTransferInternal((0, $amount, my_address(), $responseAddress, 0, $emptySlice(), $linker_address)); cell $wallet_msg_body = __gen_writecell_TokenTransferInternal((0, $amount, my_address(), $responseAddress, 0, $emptySlice(), ($self'n_linkers - 1), $linker_address));
$send((false, $walletAddress, 40000000, 0, $wallet_msg_body, $winit'code, $winit'data)); $send((false, $walletAddress, 50000000, 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), ());
} }
@ -460,9 +451,7 @@ _ $__gen_get_owner() method_id(83229) {
var ($msg'queryId, $msg'amount, $msg'owner, $msg'responseAddress) = $msg; var ($msg'queryId, $msg'amount, $msg'owner, $msg'responseAddress) = $msg;
($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)~$__gen_TONB_requireWallet($msg'owner); ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)~$__gen_TONB_requireWallet($msg'owner);
$self'totalSupply = ($self'totalSupply - $msg'amount); $self'totalSupply = ($self'totalSupply - $msg'amount);
if ((~ null?($msg'responseAddress))) { $send((false, $msg'owner, $msg'amount, 0, null(), null(), null()));
$send((false, __tact_not_null($msg'responseAddress), 0, (64 + 2), __gen_writecell_TokenExcesses(($msg'queryId)), null(), null()));
}
return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ()); return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ());
} }
@ -542,5 +531,5 @@ _ supported_interfaces() method_id {
} }
_ get_abi_ipfs() { _ get_abi_ipfs() {
return "ipfs://QmPvEiZGrqt4f1VDKeQxyzgba7g5qVaCcnFiXAyVCz4R9o"; return "ipfs://QmRq7Ws4rcHn99Mv8T1S9fKrCFxp46UnQyae1gPiBrqj5M";
} }

120
sources/output/jetton_TONB.code.fif

@ -17,8 +17,6 @@ PROGRAM{
DECLPROC __gen_write_TokenBurn DECLPROC __gen_write_TokenBurn
DECLPROC __gen_writecell_TokenBurn DECLPROC __gen_writecell_TokenBurn
DECLPROC __gen_read_TokenBurnNotification DECLPROC __gen_read_TokenBurnNotification
DECLPROC __gen_write_TokenExcesses
DECLPROC __gen_writecell_TokenExcesses
DECLPROC __gen_read_TokenUpdateContent DECLPROC __gen_read_TokenUpdateContent
DECLPROC __gen_write_SetLinkerNeighbor DECLPROC __gen_write_SetLinkerNeighbor
DECLPROC __gen_writecell_SetLinkerNeighbor DECLPROC __gen_writecell_SetLinkerNeighbor
@ -162,13 +160,13 @@ PROGRAM{
}> }>
__gen_write_TokenTransferInternal PROCREF:<{ __gen_write_TokenTransferInternal PROCREF:<{
395134233 PUSHINT 395134233 PUSHINT
s0 s8 XCHG2 s0 s9 XCHG2
32 STU 32 STU
s1 s6 XCHG s1 s7 XCHG
64 STU 64 STU
s0 s4 XCHG2 s0 s5 XCHG2
STGRAMS STGRAMS
ROT s0 s3 XCHG2
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
SWAP SWAP
__tact_store_address_opt INLINECALLDICT __tact_store_address_opt INLINECALLDICT
@ -177,6 +175,22 @@ PROGRAM{
SWAP SWAP
STSLICER STSLICER
NEWC NEWC
s2 PUSH
ISNULL
NOT
IF:<{
TRUE
SWAP
1 STI
s1 s2 XCHG
257 PUSHINT
STIX
}>ELSE<{
s2 POP
FALSE
ROT
1 STI
}>
ROT ROT
__tact_store_address_opt INLINECALLDICT __tact_store_address_opt INLINECALLDICT
ENDC ENDC
@ -185,7 +199,7 @@ PROGRAM{
}> }>
__gen_writecell_TokenTransferInternal PROCREF:<{ __gen_writecell_TokenTransferInternal PROCREF:<{
NEWC NEWC
7 -ROLL 8 -ROLL
__gen_write_TokenTransferInternal INLINECALLDICT __gen_write_TokenTransferInternal INLINECALLDICT
ENDC ENDC
}> }>
@ -222,18 +236,6 @@ PROGRAM{
s1 s4 XCHG s1 s4 XCHG
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
}> }>
__gen_write_TokenExcesses PROCREF:<{
3576854235 PUSHINT
ROT
32 STU
64 STU
}>
__gen_writecell_TokenExcesses PROCREF:<{
NEWC
SWAP
__gen_write_TokenExcesses INLINECALLDICT
ENDC
}>
__gen_read_TokenUpdateContent PROCREF:<{ __gen_read_TokenUpdateContent PROCREF:<{
32 LDU 32 LDU
SWAP SWAP
@ -283,14 +285,30 @@ PROGRAM{
SWAP SWAP
}> }>
__gen_write_TONBWallet PROCREF:<{ __gen_write_TONBWallet PROCREF:<{
s3 s4 XCHG2 s4 s5 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
SWAP ROT
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
SWAP SWAP
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
NEWC NEWC
s2 PUSH
ISNULL
NOT
IF:<{
TRUE
SWAP
1 STI
s1 s2 XCHG
257 PUSHINT
STIX
}>ELSE<{
s2 POP
FALSE
ROT
1 STI
}>
ROT ROT
__tact_store_address_opt INLINECALLDICT __tact_store_address_opt INLINECALLDICT
ENDC ENDC
@ -522,13 +540,14 @@ PROGRAM{
SENDRAWMSG SENDRAWMSG
}> }>
$__gen_TONBWallet_init PROC:<{ $__gen_TONBWallet_init PROC:<{
PUSHNULL
PUSHNULL PUSHNULL
0 PUSHINT 0 PUSHINT
s0 s4 XCHG s0 s5 XCHG
NEWC NEWC
STREF STREF
s0 s4 XCHG s0 s5 XCHG
s3 s3 XCHG2 s4 s4 s4 XCHG3
__gen_write_TONBWallet INLINECALLDICT __gen_write_TONBWallet INLINECALLDICT
ENDC ENDC
}> }>
@ -639,16 +658,19 @@ PROGRAM{
MYADDR MYADDR
OVER OVER
$emptySlice CALLDICT $emptySlice CALLDICT
s3 s6 XCHG s4 PUSH
s5 16 s() XCHG DEC
s2 s4 XCHG s4 s7 XCHG
s3 17 s() XCHG s6 17 s() XCHG
s1 s0 s10 XCHG3 s3 s5 XCHG
s4 18 s() XCHG
3 ROLL
s0 s11 XCHG
__gen_writecell_TokenTransferInternal INLINECALLDICT __gen_writecell_TokenTransferInternal INLINECALLDICT
FALSE FALSE
s0 s4 XCHG s0 s4 XCHG
s3 s11 XCHG s3 s11 XCHG
40000000 PUSHINT 50000000 PUSHINT
s0 s3 XCHG s0 s3 XCHG
0 PUSHINT 0 PUSHINT
s3 s1 s3 XCHG3 s3 s1 s3 XCHG3
@ -754,41 +776,21 @@ PROGRAM{
4 ROLL 4 ROLL
}> }>
$__gen_TONB_receive_TokenBurnNotification PROC:<{ $__gen_TONB_receive_TokenBurnNotification PROC:<{
s8 s11 XCHG DROP
s7 s10 XCHG s2 POP
s6 s9 XCHG 8 2 BLKSWAP
s5 s11 XCHG s9 PUSH
s4 s10 XCHG
s3 s9 XCHG
s11 s10 s10 XCHG3
$__gen_TONB_requireWallet CALLDICT $__gen_TONB_requireWallet CALLDICT
s7 s10 XCHG2 s7 s8 XCPU
SUB SUB
s8 PUSH
ISNULL
NOT
IF:<{
FALSE FALSE
s0 s9 XCHG s0 s10 s9 XCHG3
__tact_not_null CALLDICT
0 PUSHINT 0 PUSHINT
66 PUSHINT PUSHNULL
s0 s10 XCHG
__gen_writecell_TokenExcesses INLINECALLDICT
s4 s11 XCHG
s1 s3 s0 XCHG3
s1 s10 XCHG
PUSHNULL PUSHNULL
PUSHNULL PUSHNULL
$send CALLDICT $send CALLDICT
}>ELSE<{ 2 5 BLKSWAP
s7 POP
s7 POP
}>
s5 s7 XCHG
s3 s6 XCHG
s5 s1 s3 XCHG3
s4 s2 XCHG2
}> }>
recv_internal PROC:<{ recv_internal PROC:<{
0 PUSHINT 0 PUSHINT
@ -916,6 +918,6 @@ PROGRAM{
86142586315491086060343270784266291122 PUSHINT 86142586315491086060343270784266291122 PUSHINT
}> }>
get_abi_ipfs PROC:<{ get_abi_ipfs PROC:<{
x{697066733a2f2f516d507645695a4772717434663156444b655178797a67626137673571566143636e466958417956437a3452396f} PUSHSLICE x{697066733a2f2f516d5271375773347263486e39394d763854315339664b72434678703436556e51796165316750694272716a354d} PUSHSLICE
}> }>
}END>c }END>c

240
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
52 CALLDICT 50 CALLDICT
<{ <{
NEWC NEWC
2 GETGLOBVAR 2 GETGLOBVAR
@ -298,7 +298,7 @@ SETCP0
}> CALLREF }> CALLREF
1 8 BLKDROP2 1 8 BLKDROP2
}> CALLREF }> CALLREF
53 CALLDICT 51 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
54 CALLDICT 52 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
55 CALLDICT 53 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
56 CALLDICT 54 CALLDICT
<{ <{
NEWC NEWC
2 GETGLOBVAR 2 GETGLOBVAR
@ -951,20 +951,20 @@ SETCP0
ISNULL ISNULL
128 THROWIF 128 THROWIF
32: 30:
35: 33:
NEWC NEWC
ENDC ENDC
36: 34:
CTOS CTOS
37: 35:
35 CALLDICT 33 CALLDICT
36 CALLDICT 34 CALLDICT
38: 36:
0 PUSHINT 0 PUSHINT
ROTREV ROTREV
NEWC NEWC
@ -995,7 +995,7 @@ SETCP0
ENDC ENDC
CTOS CTOS
39: 37:
NEWC NEWC
1 PUSHINT 1 PUSHINT
s0 s1 XCHG s0 s1 XCHG
@ -1112,23 +1112,42 @@ SETCP0
s0 s1 XCHG s0 s1 XCHG
1 STI 1 STI
40: 38:
PUSHNULL
PUSHNULL PUSHNULL
0 PUSHINT 0 PUSHINT
s0 s4 XCHG s0 s5 XCHG
NEWC NEWC
STREF STREF
s0 s4 XCHG s0 s5 XCHG
s3 s3 XCHG2 s4 s4 s4 XCHG3
<{ <{
s3 s4 XCHG2 s4 s5 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
s0 s1 XCHG ROT
STSLICER STSLICER
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
NEWC NEWC
s2 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s1 s2 XCHG
257 PUSHINT
STIX
}> PUSHCONT
<{
s2 POP
0 PUSHINT
ROT
1 STI
}> PUSHCONT
IFELSE
ROT ROT
s0 PUSH s0 PUSH
ISNULL ISNULL
@ -1148,7 +1167,7 @@ SETCP0
}> CALLREF }> CALLREF
ENDC ENDC
41: 39:
s0 s2 XCHG s0 s2 XCHG
CTOS CTOS
LDDICT LDDICT
@ -1171,9 +1190,9 @@ SETCP0
STDICT STDICT
ENDC ENDC
s0 s0 s3 XCHG3 s0 s0 s3 XCHG3
40 CALLDICT 38 CALLDICT
42: 40:
PUSHNULL PUSHNULL
s0 s4 XCHG s0 s4 XCHG
NEWC NEWC
@ -1207,7 +1226,7 @@ SETCP0
}> CALLREF }> CALLREF
ENDC ENDC
43: 41:
s0 s3 XCHG s0 s3 XCHG
CTOS CTOS
LDDICT LDDICT
@ -1231,39 +1250,39 @@ SETCP0
ENDC ENDC
3 1 BLKSWAP 3 1 BLKSWAP
s0 s4 XCHG s0 s4 XCHG
42 CALLDICT 40 CALLDICT
44: 42:
2 GETGLOBVAR 2 GETGLOBVAR
MYADDR MYADDR
ROT ROT
41 CALLDICT 39 CALLDICT
45: 43:
44 CALLDICT 42 CALLDICT
8 2 BLKDROP2 8 2 BLKDROP2
38 CALLDICT 36 CALLDICT
46: 44:
MYADDR MYADDR
44 CALLDICT 42 CALLDICT
4 2 BLKDROP2 4 2 BLKDROP2
s0 POP s0 POP
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
47: 45:
s10 s1 XCPU s10 s1 XCPU
ADD ADD
8 2 BLKSWAP 8 2 BLKSWAP
44 CALLDICT 42 CALLDICT
2DUP 2DUP
38 CALLDICT 36 CALLDICT
2 GETGLOBVAR 2 GETGLOBVAR
MYADDR MYADDR
6 2 -2 PU2XC 6 2 -2 PU2XC
43 CALLDICT 41 CALLDICT
2DUP 2DUP
38 CALLDICT 36 CALLDICT
0 PUSHINT 0 PUSHINT
20000000 PUSHINT 20000000 PUSHINT
0 PUSHINT 0 PUSHINT
@ -1296,35 +1315,38 @@ SETCP0
s4 s1 s5 XCHG3 s4 s1 s5 XCHG3
s3 s12 XCHG s3 s12 XCHG
s1 s12 s0 XCHG3 s1 s12 s0 XCHG3
39 CALLDICT 37 CALLDICT
s5 PUSH s5 PUSH
s0 s5 XCHG s0 s5 XCHG
INC INC
0 PUSHINT 0 PUSHINT
MYADDR MYADDR
s1 PUSH s1 PUSH
37 CALLDICT 35 CALLDICT
s3 s6 XCHG s4 PUSH
s0 s5 XCHG DEC
s0 s16 XCHG s4 s7 XCHG
s0 s5 XCHG s0 s6 XCHG
s2 s4 XCHG
s0 s3 XCHG
s0 s17 XCHG s0 s17 XCHG
s0 s3 XCHG s0 s6 XCHG
s1 s0 s10 XCHG3 s3 s5 XCHG
s0 s4 XCHG
s0 s18 XCHG
s0 s4 XCHG
1 3 BLKSWAP
s0 s11 XCHG
<{ <{
NEWC NEWC
7 1 BLKSWAP 8 1 BLKSWAP
<{ <{
395134233 PUSHINT 395134233 PUSHINT
s0 s8 XCHG2 s0 s9 XCHG2
32 STU 32 STU
s1 s6 XCHG s1 s7 XCHG
64 STU 64 STU
s0 s4 XCHG2 s0 s5 XCHG2
STGRAMS STGRAMS
ROT s0 s3 XCHG2
STSLICER STSLICER
s0 s1 XCHG s0 s1 XCHG
s0 PUSH s0 PUSH
@ -1344,6 +1366,24 @@ SETCP0
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
NEWC NEWC
s2 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s1 s2 XCHG
257 PUSHINT
STIX
}> PUSHCONT
<{
s2 POP
0 PUSHINT
ROT
1 STI
}> PUSHCONT
IFELSE
ROT ROT
s0 PUSH s0 PUSH
ISNULL ISNULL
@ -1366,19 +1406,19 @@ SETCP0
0 PUSHINT 0 PUSHINT
s0 s4 XCHG s0 s4 XCHG
s3 s11 XCHG s3 s11 XCHG
40000000 PUSHINT 50000000 PUSHINT
s0 s3 XCHG s0 s3 XCHG
0 PUSHINT 0 PUSHINT
s3 s1 s3 XCHG3 s3 s1 s3 XCHG3
s0 s14 XCHG s0 s14 XCHG
39 CALLDICT 37 CALLDICT
s5 s7 XCHG s5 s7 XCHG
s4 s6 XCHG s4 s6 XCHG
s3 s5 XCHG s3 s5 XCHG
s4 s0 s3 XCHG3 s4 s0 s3 XCHG3
s0 s2 XCHG s0 s2 XCHG
48: 46:
s7 s10 XCHG s7 s10 XCHG
s6 s9 XCHG s6 s9 XCHG
s5 s8 XCHG s5 s8 XCHG
@ -1386,9 +1426,9 @@ SETCP0
s3 s9 XCHG s3 s9 XCHG
s8 s10 s9 XCHG3 s8 s10 s9 XCHG3
s8 PUSH s8 PUSH
44 CALLDICT 42 CALLDICT
2DUP 2DUP
38 CALLDICT 36 CALLDICT
0 PUSHINT 0 PUSHINT
0 PUSHINT 0 PUSHINT
64 PUSHINT 64 PUSHINT
@ -1432,28 +1472,28 @@ SETCP0
s4 s14 XCHG s4 s14 XCHG
s3 s12 XCHG s3 s12 XCHG
s12 s2 XCHG2 s12 s2 XCHG2
39 CALLDICT 37 CALLDICT
s4 s7 XCHG s4 s7 XCHG
3 4 BLKSWAP 3 4 BLKSWAP
49: 47:
1 GETGLOBVAR 1 GETGLOBVAR
4 UNTUPLE 4 UNTUPLE
s2 s3 XCHG s2 s3 XCHG
3 BLKDROP 3 BLKDROP
9 1 BLKSWAP 9 1 BLKSWAP
44 CALLDICT 42 CALLDICT
s0 s1 XCHG s0 s1 XCHG
4429 PUSHINT 4429 PUSHINT
s0 s2 XCHG s0 s2 XCHG
38 CALLDICT 36 CALLDICT
s0 s10 XCHG2 s0 s10 XCHG2
SDEQ SDEQ
s1 s9 XCHG s1 s9 XCHG
THROWANYIFNOT THROWANYIFNOT
1 7 BLKSWAP 1 7 BLKSWAP
50: 48:
1 GETGLOBVAR 1 GETGLOBVAR
4 UNTUPLE 4 UNTUPLE
s2 s3 XCHG s2 s3 XCHG
@ -1462,11 +1502,11 @@ SETCP0
SDEQ SDEQ
132 THROWIFNOT 132 THROWIFNOT
51: 49:
s6 s7 XCHG s6 s7 XCHG
7 BLKDROP 7 BLKDROP
52: 50:
1 GETGLOBVAR 1 GETGLOBVAR
4 UNTUPLE 4 UNTUPLE
s0 POP s0 POP
@ -1477,11 +1517,11 @@ SETCP0
s1 s2 XCHG s1 s2 XCHG
THROWANYIFNOT THROWANYIFNOT
TUCK TUCK
47 CALLDICT 45 CALLDICT
53: 51:
54: 52:
1 GETGLOBVAR 1 GETGLOBVAR
4 UNTUPLE 4 UNTUPLE
s0 POP s0 POP
@ -1492,64 +1532,32 @@ SETCP0
s1 s2 XCHG s1 s2 XCHG
THROWANYIFNOT THROWANYIFNOT
TUCK TUCK
48 CALLDICT 46 CALLDICT
55: 53:
8 1 BLKSWAP 8 1 BLKSWAP
50 CALLDICT 48 CALLDICT
s5 POP s5 POP
s6 s7 XCHG s6 s7 XCHG
s5 s6 XCHG s5 s6 XCHG
1 4 BLKSWAP 1 4 BLKSWAP
56: 54:
s8 s11 XCHG s0 POP
s7 s10 XCHG s2 POP
s6 s9 XCHG 8 2 BLKSWAP
s5 s11 XCHG s9 PUSH
s4 s10 XCHG 47 CALLDICT
s3 s9 XCHG s7 s8 XCPU
s11 s10 s10 XCHG3
49 CALLDICT
s7 s10 XCHG2
SUB SUB
s8 PUSH
ISNULL
NOT
<{
0 PUSHINT 0 PUSHINT
s0 s9 XCHG s0 s10 s9 XCHG3
1 CALLDICT
0 PUSHINT 0 PUSHINT
66 PUSHINT
s0 s10 XCHG
<{
NEWC
s0 s1 XCHG
<{
3576854235 PUSHINT
ROT
32 STU
64 STU
}> CALLREF
ENDC
}> CALLREF
s4 s11 XCHG
s1 s3 s0 XCHG3
s1 s10 XCHG
PUSHNULL PUSHNULL
PUSHNULL PUSHNULL
39 CALLDICT PUSHNULL
}> PUSHCONT 37 CALLDICT
<{ 2 5 BLKSWAP
s7 POP
s7 POP
}> PUSHCONT
IFELSE
s5 s7 XCHG
s3 s6 XCHG
s5 s1 s3 XCHG3
s4 s2 XCHG2
owner: owner:
<{ <{
@ -1627,7 +1635,7 @@ SETCP0
}> CALLREF }> CALLREF
1 8 BLKDROP2 1 8 BLKDROP2
}> CALLREF }> CALLREF
51 CALLDICT 49 CALLDICT
get_wallet_address: get_wallet_address:
<{ <{
@ -1706,7 +1714,7 @@ SETCP0
1 8 BLKDROP2 1 8 BLKDROP2
}> CALLREF }> CALLREF
1 8 BLKSWAP 1 8 BLKSWAP
45 CALLDICT 43 CALLDICT
get_jetton_data: get_jetton_data:
<{ <{
@ -1784,8 +1792,8 @@ SETCP0
}> CALLREF }> CALLREF
1 8 BLKDROP2 1 8 BLKDROP2
}> CALLREF }> CALLREF
46 CALLDICT 44 CALLDICT
32 CALLDICT 30 CALLDICT
113617: 113617:
123515602279859691144772641439386770278 PUSHINT 123515602279859691144772641439386770278 PUSHINT

6
sources/output/jetton_TONB.md

@ -1,6 +1,6 @@
# TACT Compilation Report # TACT Compilation Report
Contract: TONB Contract: TONB
BOC Size: 1684 bytes BOC Size: 1708 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> setLinker:Maybe address = TokenTransferInternal` TLB: `token_transfer_internal#178d4519 queryId:uint64 amount:coins from:address responseAddress:Maybe address forwardTonAmount:coins forwardPayload:remainder<slice> setLinker:Maybe int257 setLinkerAddress:Maybe address = TokenTransferInternal`
Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder<slice>,setLinker:Maybe address}` Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder<slice>,setLinker:Maybe int257,setLinkerAddress: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`

2
sources/output/jetton_TONB.pkg

File diff suppressed because one or more lines are too long

23
sources/output/jetton_TONB.ts

@ -247,7 +247,8 @@ export type TokenTransferInternal = {
responseAddress: Address | null; responseAddress: Address | null;
forwardTonAmount: bigint; forwardTonAmount: bigint;
forwardPayload: Cell; forwardPayload: Cell;
setLinker: Address | null; setLinker: bigint | null;
setLinkerAddress: Address | null;
} }
export function storeTokenTransferInternal(src: TokenTransferInternal) { export function storeTokenTransferInternal(src: TokenTransferInternal) {
@ -261,7 +262,8 @@ export function storeTokenTransferInternal(src: TokenTransferInternal) {
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(); let b_1 = new Builder();
b_1.storeAddress(src.setLinker); if (src.setLinker !== null && src.setLinker !== undefined) { b_1.storeBit(true).storeInt(src.setLinker, 257); } else { b_1.storeBit(false); }
b_1.storeAddress(src.setLinkerAddress);
b_0.storeRef(b_1.endCell()); b_0.storeRef(b_1.endCell());
}; };
} }
@ -276,8 +278,9 @@ export function loadTokenTransferInternal(slice: Slice) {
let _forwardTonAmount = sc_0.loadCoins(); let _forwardTonAmount = sc_0.loadCoins();
let _forwardPayload = sc_0.asCell(); let _forwardPayload = sc_0.asCell();
let sc_1 = sc_0.loadRef().beginParse(); let sc_1 = sc_0.loadRef().beginParse();
let _setLinker = sc_1.loadMaybeAddress(); let _setLinker = sc_1.loadBit() ? sc_1.loadIntBig(257) : null;
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload, setLinker: _setLinker }; let _setLinkerAddress = sc_1.loadMaybeAddress();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload, setLinker: _setLinker, setLinkerAddress: _setLinkerAddress };
} }
function loadTupleTokenTransferInternal(source: TupleReader) { function loadTupleTokenTransferInternal(source: TupleReader) {
@ -287,8 +290,9 @@ 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();
let _setLinker = source.readAddressOpt(); let _setLinker = source.readBigNumberOpt();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload, setLinker: _setLinker }; let _setLinkerAddress = source.readAddressOpt();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload, setLinker: _setLinker, setLinkerAddress: _setLinkerAddress };
} }
function storeTupleTokenTransferInternal(source: TokenTransferInternal) { function storeTupleTokenTransferInternal(source: TokenTransferInternal) {
@ -299,7 +303,8 @@ 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); builder.writeNumber(source.setLinker);
builder.writeAddress(source.setLinkerAddress);
return builder.build(); return builder.build();
} }
@ -960,8 +965,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=='; const __init = 'te6ccgEBBwEAhgABFP8A9KQT9LzyyAsBAgFiAgMCAs0EBQAJoUrd4AsAAdQBJWW1tcG0hfwjIzAhEdBYVE9s8yYGAJpQh/oCUAXPFiNus5Z/AcoAE8yWM3BQA8oA4soAASBulTBwAcsBks8W4gEgbpUwcAHLAZLPFuICyIEBAc8AASBulTBwAcsBks8W4skBzA==';
const __code = 'te6ccgECUQEABogAART/APSkE/S88sgLAQIBYgIDAgLKBAUCASASEwIB0gYHAgEgGhsEqRwIddJwh+VMCDXCx/eAtDTAwFxsMABkX+RcOIB+kAiUGZvBPhhApFb4CCCECHutge6j5cw2zwI2zwxEHgQZxBWEEUQNEEw8DTbPOAgwAAi10nBIbCAYCBAJAAsIG7y0ICAAINMfAYIQIe62B7ry4IH6AAEEOI8HW9s88DXbPOAgghBgWRUQuuMCIIIQDAh6nroYEAoLAy4w2zwI2zwxEHgQZxBWEEUQNEEw8DbbPBgMEARCj5cw2zwI2zwxEHgQZxBWEEUQNEEw8DfbPOCCEHvdl966GA0QDgAm0x8BghBgWRUQuvLggYEBAdcAAQAu0x8BghAMCHqeuvLggdIAAZHUkm0B4gEDQo+a2zwI2zw0EKsQmhCJEHgQZxBWEEVVAvA42zzgMPLAghgPEABM0x8BghB73ZfeuvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIUQzAB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mn8BygAE8AJQBMyWNANwAcoA4iRus5p/AcoABPACUATMljQDcAHKAOJwAcoAAn8BygACyVjMlzMzAXABygDiIW6z4w/JAfsAghYQACjFwAcoAABJ/AcoAAfACAcwAS1cFnIcAHLAXMBywFwAcsAEszMyfkAyHIBywFwAcsAEsoHy//J0IAgEgiYgAA6dAAgFii4oAC0IG7y0ICASJRwIddJwh+VMCDXCx/eAtDTAwFxsMABkX+RcOIB+kAiUGZvBPhhAo8JMNs8VQTwKts84CCCEA+KfqW64wIgghAXjUUZuolJKQjAQ+j5Uw2zwF2zw4ELwQqxCaEIlVBvAo2zzgghBZXwe8upSPko0DNo+U2zwF2zw0EHgQZxBWEEVVAvAp2zzgMPLAgpSOkgBM0x8BghBZXwe8uvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIUQzAApNMfAYIQF41FGbry4IHTP/oA+kABAfpAIdcLAcMAkQGSMW3iAfoAINQB0NIAAZWBAQHXAJJtAeL6QCHXCwHDAJEBkjFt4jEQKBAnECYQJRAkECMDKjDbPAXbPDcQqxCaEIkQeFUF8CfbPJSRkgBs0x8BghAPin6luvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIB0gABkdSSbQHi+gBRZhYVFEMwARjI+EIBzFVA2zzJ7VSTAGZQRYEBAc8AWM8WAc8WyCJus5p/AcoAEoEBAc8AlTJwWMoA4lggbpUwcAHLAZLPFuLJAcwBFu1E0NQB+GLbPGwVlQBkgQEB1wD6QAEB+kABAdQB0NIAAZWBAQHXAJJtAeL6QCHXCwHDAJEBkjFt4jEQJRAkECO+YMLl';
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.

79
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, slice) v) inline_ref { builder __gen_write_TokenTransferInternal(builder build_0, (int, int, slice, slice, int, slice, int, slice) v) inline_ref {
var (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload, v'setLinker) = v; var (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload, v'setLinker, v'setLinkerAddress) = 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);
@ -109,16 +109,17 @@ builder __gen_write_TokenTransferInternal(builder build_0, (int, int, slice, sli
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(); var build_1 = begin_cell();
build_1 = __tact_store_address_opt(build_1, v'setLinker); build_1 = ~ null?(v'setLinker) ? build_1.store_int(true, 1).store_int(v'setLinker, 257) : build_1.store_int(false, 1);
build_1 = __tact_store_address_opt(build_1, v'setLinkerAddress);
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_writecell_TokenTransferInternal((int, int, slice, slice, int, slice, slice) v) inline_ref { cell __gen_writecell_TokenTransferInternal((int, int, slice, slice, int, slice, int, slice) v) inline_ref {
return __gen_write_TokenTransferInternal(begin_cell(), v).end_cell(); return __gen_write_TokenTransferInternal(begin_cell(), v).end_cell();
} }
(slice, ((int, int, slice, slice, int, slice, slice))) __gen_read_TokenTransferInternal(slice sc_0) inline_ref { (slice, ((int, int, slice, slice, int, slice, int, slice))) __gen_read_TokenTransferInternal(slice sc_0) inline_ref {
throw_unless(129, sc_0~load_uint(32) == 395134233); throw_unless(129, sc_0~load_uint(32) == 395134233);
var v'queryId = sc_0~load_uint(64); var v'queryId = sc_0~load_uint(64);
var v'amount = sc_0~load_coins(); var v'amount = sc_0~load_coins();
@ -127,8 +128,9 @@ cell __gen_writecell_TokenTransferInternal((int, int, slice, slice, int, slice,
var v'forwardTonAmount = sc_0~load_coins(); var v'forwardTonAmount = sc_0~load_coins();
var v'forwardPayload = sc_0; var v'forwardPayload = sc_0;
slice sc_1 = sc_0~load_ref().begin_parse(); slice sc_1 = sc_0~load_ref().begin_parse();
var v'setLinker = sc_1~__tact_load_address_opt(); var v'setLinker = sc_1~load_int(1) ? sc_1~load_int(257) : null();
return (sc_0, (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload, v'setLinker)); var v'setLinkerAddress = sc_1~__tact_load_address_opt();
return (sc_0, (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload, v'setLinker, v'setLinkerAddress));
} }
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 {
@ -179,24 +181,26 @@ 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, slice) v) inline_ref { builder __gen_write_TONBWallet(builder build_0, (int, slice, slice, int, slice) v) inline_ref {
var (v'balance, v'owner, v'master, v'linker) = v; var (v'balance, v'owner, v'master, v'linker, v'linker_address) = 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(); var build_1 = begin_cell();
build_1 = __tact_store_address_opt(build_1, v'linker); build_1 = ~ null?(v'linker) ? build_1.store_int(true, 1).store_int(v'linker, 257) : build_1.store_int(false, 1);
build_1 = __tact_store_address_opt(build_1, v'linker_address);
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;
} }
(slice, ((int, slice, slice, slice))) __gen_read_TONBWallet(slice sc_0) inline_ref { (slice, ((int, slice, slice, int, 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();
slice sc_1 = sc_0~load_ref().begin_parse(); slice sc_1 = sc_0~load_ref().begin_parse();
var v'linker = sc_1~__tact_load_address_opt(); var v'linker = sc_1~load_int(1) ? sc_1~load_int(257) : null();
return (sc_0, (v'balance, v'owner, v'master, v'linker)); var v'linker_address = sc_1~__tact_load_address_opt();
return (sc_0, (v'balance, v'owner, v'master, v'linker, v'linker_address));
} }
_ __gen_StateInit_get_code((cell, cell) v) inline { _ __gen_StateInit_get_code((cell, cell) v) inline {
@ -209,13 +213,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, slice) __gen_load_TONBWallet() inline_ref { (int, slice, slice, int, 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, slice) v) impure inline_ref { () __gen_store_TONBWallet((int, slice, slice, int, 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);
@ -281,13 +285,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, $self'linker)) = (null(), null(), null(), null()); var (($self'balance, $self'owner, $self'master, $self'linker, $self'linker_address)) = (null(), 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, $self'linker)); b' = __gen_write_TONBWallet(b', ($self'balance, $self'owner, $self'master, $self'linker, $self'linker_address));
return b'.end_cell(); return b'.end_cell();
} }
@ -303,8 +307,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, slice) $self) impure { (int, slice, slice, cell) $__gen_TONBWallet_get_wallet_data((int, slice, slice, int, slice) $self) impure {
var (($self'balance, $self'owner, $self'master, $self'linker)) = $self; var (($self'balance, $self'owner, $self'master, $self'linker, $self'linker_address)) = $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)));
} }
@ -314,8 +318,8 @@ _ $__gen_get_get_wallet_data() method_id(97026) {
return __gen_JettonWalletData_to_external(res); return __gen_JettonWalletData_to_external(res);
} }
(((int, slice, slice, slice)), ()) $__gen_TONBWallet_receive_TokenTransfer((int, slice, slice, slice) $self, (int, int, slice, slice, cell, int, slice) $msg) impure { (((int, slice, slice, int, slice)), ()) $__gen_TONBWallet_receive_TokenTransfer((int, slice, slice, int, slice) $self, (int, int, slice, slice, cell, int, slice) $msg) impure {
var ($self'balance, $self'owner, $self'master, $self'linker) = $self; var ($self'balance, $self'owner, $self'master, $self'linker, $self'linker_address) = $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));
@ -329,18 +333,19 @@ _ $__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, null())), $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(), null())), $init'code, $init'data));
return (($self'balance, $self'owner, $self'master, $self'linker), ()); return (($self'balance, $self'owner, $self'master, $self'linker, $self'linker_address), ());
} }
(((int, slice, slice, slice)), ()) $__gen_TONBWallet_receive_TokenTransferInternal((int, slice, slice, slice) $self, (int, int, slice, slice, int, slice, slice) $msg) impure { (((int, slice, slice, int, slice)), ()) $__gen_TONBWallet_receive_TokenTransferInternal((int, slice, slice, int, slice) $self, (int, int, slice, slice, int, slice, int, slice) $msg) impure {
var ($self'balance, $self'owner, $self'master, $self'linker) = $self; var ($self'balance, $self'owner, $self'master, $self'linker, $self'linker_address) = $self;
var ($msg'queryId, $msg'amount, $msg'from, $msg'responseAddress, $msg'forwardTonAmount, $msg'forwardPayload, $msg'setLinker) = $msg; var ($msg'queryId, $msg'amount, $msg'from, $msg'responseAddress, $msg'forwardTonAmount, $msg'forwardPayload, $msg'setLinker, $msg'setLinkerAddress) = $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 (null?($self'linker)) { if (null?($self'linker)) {
$self'linker = $msg'setLinker; $self'linker = $msg'setLinker;
$self'linker_address = $msg'setLinkerAddress;
} }
if ((__tact_address_neq($ctx'sender, $self'master) & __tact_address_neq($ctx'sender, $self'linker))) { if ((__tact_address_neq($ctx'sender, $self'master) & __tact_address_neq($ctx'sender, $self'linker_address))) {
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));
} }
@ -358,31 +363,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, $self'linker), ()); return (($self'balance, $self'owner, $self'master, $self'linker, $self'linker_address), ());
} }
(((int, slice, slice, slice)), ()) $__gen_TONBWallet_receive_TokenBurn((int, slice, slice, slice) $self, (int, int, slice, slice) $msg) impure { (((int, slice, slice, int, slice)), ()) $__gen_TONBWallet_receive_TokenBurn((int, slice, slice, int, slice) $self, (int, int, slice, slice) $msg) impure {
var ($self'balance, $self'owner, $self'master, $self'linker) = $self; var ($self'balance, $self'owner, $self'master, $self'linker, $self'linker_address) = $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)) | __tact_address_eq($ctx'sender, $self'linker))); throw_unless(4429, ((__tact_address_eq($ctx'sender, $self'owner) | __tact_address_eq($ctx'sender, $self'master)) | __tact_address_eq($ctx'sender, $self'linker_address)));
$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 > ((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, $self'linker), ()); return (($self'balance, $self'owner, $self'master, $self'linker, $self'linker_address), ());
} }
((int, slice, slice, slice), ()) $__gen_TONBWallet_receive_bounced((int, slice, slice, slice) $self, slice $msg) impure { ((int, slice, slice, int, slice), ()) $__gen_TONBWallet_receive_bounced((int, slice, slice, int, slice) $self, slice $msg) impure {
var ($self'balance, $self'owner, $self'master, $self'linker) = $self; var ($self'balance, $self'owner, $self'master, $self'linker, $self'linker_address) = $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, $self'linker), ()); return (($self'balance, $self'owner, $self'master, $self'linker, $self'linker_address), ());
} }
@ -446,5 +451,5 @@ _ supported_interfaces() method_id {
} }
_ get_abi_ipfs() { _ get_abi_ipfs() {
return "ipfs://QmWqpvx8PLAjtTJAa4RuwzEXeejSonT37BiA5HxjDFbLvM"; return "ipfs://QmNcnMjCZjwpaP9xLwcPNt8ziw2bt7pGUNu1PCVFvkfGtv";
} }

196
sources/output/jetton_TONBWallet.code.fif

@ -181,13 +181,13 @@ PROGRAM{
}> }>
__gen_write_TokenTransferInternal PROCREF:<{ __gen_write_TokenTransferInternal PROCREF:<{
395134233 PUSHINT 395134233 PUSHINT
s0 s8 XCHG2 s0 s9 XCHG2
32 STU 32 STU
s1 s6 XCHG s1 s7 XCHG
64 STU 64 STU
s0 s4 XCHG2 s0 s5 XCHG2
STGRAMS STGRAMS
ROT s0 s3 XCHG2
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
SWAP SWAP
__tact_store_address_opt INLINECALLDICT __tact_store_address_opt INLINECALLDICT
@ -196,6 +196,22 @@ PROGRAM{
SWAP SWAP
STSLICER STSLICER
NEWC NEWC
s2 PUSH
ISNULL
NOT
IF:<{
TRUE
SWAP
1 STI
s1 s2 XCHG
257 PUSHINT
STIX
}>ELSE<{
s2 POP
FALSE
ROT
1 STI
}>
ROT ROT
__tact_store_address_opt INLINECALLDICT __tact_store_address_opt INLINECALLDICT
ENDC ENDC
@ -204,7 +220,7 @@ PROGRAM{
}> }>
__gen_writecell_TokenTransferInternal PROCREF:<{ __gen_writecell_TokenTransferInternal PROCREF:<{
NEWC NEWC
7 -ROLL 8 -ROLL
__gen_write_TokenTransferInternal INLINECALLDICT __gen_write_TokenTransferInternal INLINECALLDICT
ENDC ENDC
}> }>
@ -225,13 +241,23 @@ PROGRAM{
LDREF LDREF
SWAP SWAP
CTOS CTOS
1 LDI
SWAP
IF:<{
257 PUSHINT
LDIX
}>ELSE<{
PUSHNULL
SWAP
}>
__tact_load_address_opt INLINECALLDICT __tact_load_address_opt INLINECALLDICT
NIP NIP
s1 s7 XCHG s2 s8 XCHG
s1 s6 XCHG s2 s7 XCHG
s1 s5 XCHG s2 s6 XCHG
s1 s4 XCHG s2 s5 XCHG
s3 s3 s0 XCHG3 s2 s4 XCHG
s2 s3 XCHG
}> }>
__gen_write_TokenNotification PROCREF:<{ __gen_write_TokenNotification PROCREF:<{
1935855772 PUSHINT 1935855772 PUSHINT
@ -298,14 +324,30 @@ PROGRAM{
ENDC ENDC
}> }>
__gen_write_TONBWallet PROCREF:<{ __gen_write_TONBWallet PROCREF:<{
s3 s4 XCHG2 s4 s5 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
SWAP ROT
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
SWAP SWAP
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
NEWC NEWC
s2 PUSH
ISNULL
NOT
IF:<{
TRUE
SWAP
1 STI
s1 s2 XCHG
257 PUSHINT
STIX
}>ELSE<{
s2 POP
FALSE
ROT
1 STI
}>
ROT ROT
__tact_store_address_opt INLINECALLDICT __tact_store_address_opt INLINECALLDICT
ENDC ENDC
@ -322,10 +364,20 @@ PROGRAM{
LDREF LDREF
SWAP SWAP
CTOS CTOS
1 LDI
SWAP
IF:<{
257 PUSHINT
LDIX
}>ELSE<{
PUSHNULL
SWAP
}>
__tact_load_address_opt INLINECALLDICT __tact_load_address_opt INLINECALLDICT
NIP NIP
s1 s4 XCHG s2 s5 XCHG
s3 s3 s0 XCHG3 s2 s4 XCHG
s2 s3 XCHG
}> }>
__gen_StateInit_get_code PROCINLINE:<{ __gen_StateInit_get_code PROCINLINE:<{
DROP DROP
@ -339,14 +391,14 @@ PROGRAM{
SWAP SWAP
__tact_context_sys SETGLOB __tact_context_sys SETGLOB
__gen_read_TONBWallet INLINECALLDICT __gen_read_TONBWallet INLINECALLDICT
1 4 BLKDROP2 1 5 BLKDROP2
}> }>
__gen_store_TONBWallet PROCREF:<{ __gen_store_TONBWallet PROCREF:<{
NEWC NEWC
__tact_context_sys GETGLOB __tact_context_sys GETGLOB
SWAP SWAP
STREF STREF
4 -ROLL 5 -ROLL
__gen_write_TONBWallet INLINECALLDICT __gen_write_TONBWallet INLINECALLDICT
ENDC ENDC
c4 POP c4 POP
@ -469,13 +521,14 @@ PROGRAM{
1 RSHIFT# 1 RSHIFT#
}> }>
$__gen_TONBWallet_init PROC:<{ $__gen_TONBWallet_init PROC:<{
PUSHNULL
PUSHNULL PUSHNULL
0 PUSHINT 0 PUSHINT
s0 s4 XCHG s0 s5 XCHG
NEWC NEWC
STREF STREF
s0 s4 XCHG s0 s5 XCHG
s3 s3 XCHG2 s4 s4 s4 XCHG3
__gen_write_TONBWallet INLINECALLDICT __gen_write_TONBWallet INLINECALLDICT
ENDC ENDC
}> }>
@ -499,7 +552,7 @@ PROGRAM{
$__gen_TONBWallet_init CALLDICT $__gen_TONBWallet_init CALLDICT
}> }>
$__gen_TONBWallet_get_wallet_data PROC:<{ $__gen_TONBWallet_get_wallet_data PROC:<{
DROP 2DROP
__tact_context_sys GETGLOB __tact_context_sys GETGLOB
s1 s2 PUSH2 s1 s2 PUSH2
$__gen_TONBWallet_init_child CALLDICT $__gen_TONBWallet_init_child CALLDICT
@ -514,17 +567,17 @@ PROGRAM{
2 2 BLKDROP2 2 2 BLKDROP2
__tact_context_get INLINECALLDICT __tact_context_get INLINECALLDICT
4429 PUSHINT 4429 PUSHINT
s3 s12 PUSH2 s3 s13 PUSH2
__tact_address_eq INLINECALLDICT __tact_address_eq INLINECALLDICT
THROWANYIFNOT THROWANYIFNOT
s12 s7 XCPU s13 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 s12 PUXC s3 s13 PUXC
$__gen_Context_readForwardFee CALLDICT $__gen_Context_readForwardFee CALLDICT
1 PUSHINT 1 PUSHINT
s4 PUSH s4 PUSH
@ -544,7 +597,7 @@ PROGRAM{
GREATER GREATER
THROWANYIFNOT THROWANYIFNOT
__tact_context_sys GETGLOB __tact_context_sys GETGLOB
s0 s7 s3 XCPUXC s0 s8 s3 XCPUXC
$__gen_TONBWallet_init_child CALLDICT $__gen_TONBWallet_init_child CALLDICT
2DUP 2DUP
$contractAddress CALLDICT $contractAddress CALLDICT
@ -553,49 +606,56 @@ PROGRAM{
0 PUSHINT 0 PUSHINT
64 PUSHINT 64 PUSHINT
PUSHNULL PUSHNULL
s13 PUSH PUSHNULL
s3 s14 XCPU s15 PUSH
s0 s3 XCHG s0 s4 XCHG
s9 s10 s9 XCHG3 16 s() PUSH
s0 s4 XCHG
s3 s10 XCHG
s11 s10 s11 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
s11 PUSH s13 PUSH
ISNULL ISNULL
IF:<{ IF:<{
s11 POP s12 POP
s3 s10 XCHG s12 POP
s3 s11 XCHG
s2 s10 XCHG
}>ELSE<{ }>ELSE<{
s4 POP s4 POP
s4 POP
}> }>
s1 s11 PUSH2 s0 s12 PUSH2
__tact_address_neq INLINECALLDICT __tact_address_neq INLINECALLDICT
s2 s11 PUSH2 s1 s11 PUSH2
__tact_address_neq INLINECALLDICT __tact_address_neq INLINECALLDICT
AND AND
IF:<{ IF:<{
__tact_context_sys GETGLOB __tact_context_sys GETGLOB
s12 s8 PUSH2 s13 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
s3 PUSH s2 PUSH
__tact_address_eq INLINECALLDICT __tact_address_eq INLINECALLDICT
THROWANYIFNOT THROWANYIFNOT
}> }>
s13 s8 XCPU s14 s8 XCPU
ADD ADD
62972 PUSHINT 62972 PUSHINT
OVER OVER
-1 GTINT -1 GTINT
THROWANYIFNOT THROWANYIFNOT
s13 PUSH s3 PUSH
__tact_my_balance INLINECALLDICT __tact_my_balance INLINECALLDICT
OVER OVER
SUB SUB
@ -609,10 +669,12 @@ PROGRAM{
s6 PUSH s6 PUSH
0 GTINT 0 GTINT
IF:<{ IF:<{
s14 s4 XCHG2 s3 s1 s15 XCHG3
s4 s2 XCHG2
$__gen_Context_readForwardFee CALLDICT $__gen_Context_readForwardFee CALLDICT
s3 s(-1) PUXC s3 s(-1) PUXC
ADD ADD
s1 s12 XCHG
SUB SUB
FALSE FALSE
0 PUSHINT 0 PUSHINT
@ -620,20 +682,20 @@ PROGRAM{
s8 s1 s3 XCHG3 s8 s1 s3 XCHG3
s7 s4 XCHG2 s7 s4 XCHG2
__gen_writecell_TokenNotification INLINECALLDICT __gen_writecell_TokenNotification INLINECALLDICT
s9 PUSH s10 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 s6 XCHG2 s0 s7 XCHG2
}>ELSE<{ }>ELSE<{
s7 s14 XCHG s7 s15 XCHG
s8 s9 XCHG2 s8 s9 XCHG2
8 BLKDROP 8 BLKDROP
}> }>
s6 PUSH s7 PUSH
ISNULL ISNULL
NOT NOT
s2 PUSH s2 PUSH
@ -641,19 +703,19 @@ PROGRAM{
AND AND
IF:<{ IF:<{
FALSE FALSE
s0 s7 XCHG s0 s8 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 s8 XCHG s4 s9 XCHG
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
s1 s8 XCHG s1 s9 XCHG
PUSHNULL PUSHNULL
PUSHNULL PUSHNULL
$send CALLDICT $send CALLDICT
}>ELSE<{ }>ELSE<{
s6 POP s7 POP
2DROP 2DROP
}> }>
}> }>
@ -661,40 +723,37 @@ PROGRAM{
2DROP 2DROP
__tact_context_get INLINECALLDICT __tact_context_get INLINECALLDICT
4429 PUSHINT 4429 PUSHINT
s3 s9 PUSH2 s3 s10 PUSH2
__tact_address_eq INLINECALLDICT __tact_address_eq INLINECALLDICT
s4 s9 PUSH2 s4 s10 PUSH2
__tact_address_eq INLINECALLDICT __tact_address_eq INLINECALLDICT
OR OR
s4 s8 PUSH2 s4 s8 PUSH2
__tact_address_eq INLINECALLDICT __tact_address_eq INLINECALLDICT
OR OR
THROWANYIFNOT THROWANYIFNOT
s9 s4 XCPU s10 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 s9 PUXC s3 s10 PUXC
$__gen_Context_readForwardFee CALLDICT $__gen_Context_readForwardFee CALLDICT
DROP
16059 PUSHINT 16059 PUSHINT
SWAP SWAP
20000000 PUSHINT 30000000 PUSHINT
ADD
10000000 PUSHINT
ADD
s1 s2 XCHG
GREATER GREATER
THROWANYIFNOT THROWANYIFNOT
TRUE TRUE
0 PUSHINT 0 PUSHINT
s0 s3 XCHG s0 s3 XCHG
64 PUSHINT 64 PUSHINT
s3 s7 s7 XCPU2 s3 s8 s8 XCPU2
__gen_writecell_TokenBurnNotification INLINECALLDICT __gen_writecell_TokenBurnNotification INLINECALLDICT
s3 s0 s5 XC2PU s3 s0 s6 XC2PU
s3 s3 XCHG2 s3 s3 XCHG2
PUSHNULL PUSHNULL
PUSHNULL PUSHNULL
@ -719,9 +778,9 @@ PROGRAM{
OR OR
s1 s2 XCHG s1 s2 XCHG
THROWANYIFNOT THROWANYIFNOT
s1 s4 XCHG s1 s5 XCHG
ADD ADD
s0 s3 XCHG s0 s4 XCHG
}> }>
recv_internal PROC:<{ recv_internal PROC:<{
0 PUSHINT 0 PUSHINT
@ -755,7 +814,7 @@ PROGRAM{
IFJMP:<{ IFJMP:<{
DROP DROP
__gen_load_TONBWallet INLINECALLDICT __gen_load_TONBWallet INLINECALLDICT
4 ROLL 5 ROLL
$__gen_TONBWallet_receive_bounced CALLDICT $__gen_TONBWallet_receive_bounced CALLDICT
__gen_store_TONBWallet INLINECALLDICT __gen_store_TONBWallet INLINECALLDICT
}> }>
@ -765,9 +824,10 @@ PROGRAM{
IFJMP:<{ IFJMP:<{
DROP DROP
__gen_load_TONBWallet INLINECALLDICT __gen_load_TONBWallet INLINECALLDICT
s0 s4 XCHG s0 s5 XCHG
__gen_read_TokenTransfer INLINECALLDICT __gen_read_TokenTransfer INLINECALLDICT
s7 POP s7 POP
s10 s11 XCHG
s9 s10 XCHG s9 s10 XCHG
s8 s9 XCHG s8 s9 XCHG
s7 s8 XCHG s7 s8 XCHG
@ -781,13 +841,14 @@ PROGRAM{
IFJMP:<{ IFJMP:<{
DROP DROP
__gen_load_TONBWallet INLINECALLDICT __gen_load_TONBWallet INLINECALLDICT
s0 s4 XCHG s0 s5 XCHG
__gen_read_TokenTransferInternal INLINECALLDICT __gen_read_TokenTransferInternal INLINECALLDICT
s7 POP s8 POP
s11 s12 XCHG
s10 s11 XCHG
s9 s10 XCHG s9 s10 XCHG
s8 s9 XCHG s8 s9 XCHG
s7 s8 XCHG 7 ROLL
6 ROLL
$__gen_TONBWallet_receive_TokenTransferInternal CALLDICT $__gen_TONBWallet_receive_TokenTransferInternal CALLDICT
__gen_store_TONBWallet INLINECALLDICT __gen_store_TONBWallet INLINECALLDICT
}> }>
@ -795,9 +856,10 @@ PROGRAM{
EQUAL EQUAL
IFJMP:<{ IFJMP:<{
__gen_load_TONBWallet INLINECALLDICT __gen_load_TONBWallet INLINECALLDICT
s0 s4 XCHG s0 s5 XCHG
__gen_read_TokenBurn INLINECALLDICT __gen_read_TokenBurn INLINECALLDICT
s4 POP s4 POP
s7 s8 XCHG
s6 s7 XCHG s6 s7 XCHG
s5 s6 XCHG s5 s6 XCHG
s4 s5 XCHG s4 s5 XCHG
@ -814,6 +876,6 @@ PROGRAM{
209778528950190195973528115415557644819 PUSHINT 209778528950190195973528115415557644819 PUSHINT
}> }>
get_abi_ipfs PROC:<{ get_abi_ipfs PROC:<{
x{697066733a2f2f516d577170767838504c416a74544a4161345275777a455865656a536f6e5433374269413548786a4446624c764d} PUSHSLICE x{697066733a2f2f516d4e636e4d6a435a6a7770615039784c7763504e74387a6977326274377047554e753150435646766b66477476} PUSHSLICE
}> }>
}END>c }END>c

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

@ -52,6 +52,17 @@ SETCP0
LDREF LDREF
s0 s1 XCHG s0 s1 XCHG
CTOS CTOS
1 LDI
s0 s1 XCHG
<{
257 PUSHINT
LDI
}> PUSHCONT
<{
PUSHNULL
s0 s1 XCHG
}> PUSHCONT
IFELSE
LDMSGADDR LDMSGADDR
s1 PUSH s1 PUSH
2 PLDU 2 PLDU
@ -65,28 +76,47 @@ SETCP0
}> PUSHCONT }> PUSHCONT
IFELSE IFELSE
s1 POP s1 POP
s1 s4 XCHG s2 s5 XCHG
s3 s3 s0 XCHG3 s2 s4 XCHG
s2 s3 XCHG
}> CALLREF }> CALLREF
1 4 BLKDROP2 1 5 BLKDROP2
}> CALLREF }> CALLREF
1 4 BLKSWAP 1 5 BLKSWAP
42 CALLDICT 42 CALLDICT
<{ <{
NEWC NEWC
2 GETGLOBVAR 2 GETGLOBVAR
s0 s1 XCHG s0 s1 XCHG
STREF STREF
4 1 BLKSWAP 5 1 BLKSWAP
<{ <{
s3 s4 XCHG2 s4 s5 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
s0 s1 XCHG ROT
STSLICER STSLICER
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
NEWC NEWC
s2 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s1 s2 XCHG
257 PUSHINT
STIX
}> PUSHCONT
<{
s2 POP
0 PUSHINT
ROT
1 STI
}> PUSHCONT
IFELSE
ROT ROT
s0 PUSH s0 PUSH
ISNULL ISNULL
@ -132,6 +162,17 @@ SETCP0
LDREF LDREF
s0 s1 XCHG s0 s1 XCHG
CTOS CTOS
1 LDI
s0 s1 XCHG
<{
257 PUSHINT
LDI
}> PUSHCONT
<{
PUSHNULL
s0 s1 XCHG
}> PUSHCONT
IFELSE
LDMSGADDR LDMSGADDR
s1 PUSH s1 PUSH
2 PLDU 2 PLDU
@ -145,12 +186,13 @@ SETCP0
}> PUSHCONT }> PUSHCONT
IFELSE IFELSE
s1 POP s1 POP
s1 s4 XCHG s2 s5 XCHG
s3 s3 s0 XCHG3 s2 s4 XCHG
s2 s3 XCHG
}> CALLREF }> CALLREF
1 4 BLKDROP2 1 5 BLKDROP2
}> CALLREF }> CALLREF
s0 s4 XCHG s0 s5 XCHG
<{ <{
32 LDU 32 LDU
s0 s1 XCHG s0 s1 XCHG
@ -193,6 +235,7 @@ SETCP0
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
}> CALLREF }> CALLREF
s7 POP s7 POP
s10 s11 XCHG
s9 s10 XCHG s9 s10 XCHG
s8 s9 XCHG s8 s9 XCHG
s7 s8 XCHG s7 s8 XCHG
@ -203,16 +246,34 @@ SETCP0
2 GETGLOBVAR 2 GETGLOBVAR
s0 s1 XCHG s0 s1 XCHG
STREF STREF
4 1 BLKSWAP 5 1 BLKSWAP
<{ <{
s3 s4 XCHG2 s4 s5 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
s0 s1 XCHG ROT
STSLICER STSLICER
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
NEWC NEWC
s2 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s1 s2 XCHG
257 PUSHINT
STIX
}> PUSHCONT
<{
s2 POP
0 PUSHINT
ROT
1 STI
}> PUSHCONT
IFELSE
ROT ROT
s0 PUSH s0 PUSH
ISNULL ISNULL
@ -257,6 +318,17 @@ SETCP0
LDREF LDREF
s0 s1 XCHG s0 s1 XCHG
CTOS CTOS
1 LDI
s0 s1 XCHG
<{
257 PUSHINT
LDI
}> PUSHCONT
<{
PUSHNULL
s0 s1 XCHG
}> PUSHCONT
IFELSE
LDMSGADDR LDMSGADDR
s1 PUSH s1 PUSH
2 PLDU 2 PLDU
@ -270,12 +342,13 @@ SETCP0
}> PUSHCONT }> PUSHCONT
IFELSE IFELSE
s1 POP s1 POP
s1 s4 XCHG s2 s5 XCHG
s3 s3 s0 XCHG3 s2 s4 XCHG
s2 s3 XCHG
}> CALLREF }> CALLREF
1 4 BLKDROP2 1 5 BLKDROP2
}> CALLREF }> CALLREF
s0 s4 XCHG s0 s5 XCHG
<{ <{
32 LDU 32 LDU
s0 s1 XCHG s0 s1 XCHG
@ -305,6 +378,17 @@ SETCP0
LDREF LDREF
s0 s1 XCHG s0 s1 XCHG
CTOS CTOS
1 LDI
s0 s1 XCHG
<{
257 PUSHINT
LDI
}> PUSHCONT
<{
PUSHNULL
s0 s1 XCHG
}> PUSHCONT
IFELSE
LDMSGADDR LDMSGADDR
s1 PUSH s1 PUSH
2 PLDU 2 PLDU
@ -318,33 +402,53 @@ SETCP0
}> PUSHCONT }> PUSHCONT
IFELSE IFELSE
s1 POP s1 POP
s1 s7 XCHG s2 s8 XCHG
s1 s6 XCHG s2 s7 XCHG
s1 s5 XCHG s2 s6 XCHG
s1 s4 XCHG s2 s5 XCHG
s3 s3 s0 XCHG3 s2 s4 XCHG
s2 s3 XCHG
}> CALLREF }> CALLREF
s7 POP s8 POP
s11 s12 XCHG
s10 s11 XCHG
s9 s10 XCHG s9 s10 XCHG
s8 s9 XCHG s8 s9 XCHG
s7 s8 XCHG 1 7 BLKSWAP
1 6 BLKSWAP
40 CALLDICT 40 CALLDICT
<{ <{
NEWC NEWC
2 GETGLOBVAR 2 GETGLOBVAR
s0 s1 XCHG s0 s1 XCHG
STREF STREF
4 1 BLKSWAP 5 1 BLKSWAP
<{ <{
s3 s4 XCHG2 s4 s5 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
s0 s1 XCHG ROT
STSLICER STSLICER
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
NEWC NEWC
s2 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s1 s2 XCHG
257 PUSHINT
STIX
}> PUSHCONT
<{
s2 POP
0 PUSHINT
ROT
1 STI
}> PUSHCONT
IFELSE
ROT ROT
s0 PUSH s0 PUSH
ISNULL ISNULL
@ -388,6 +492,17 @@ SETCP0
LDREF LDREF
s0 s1 XCHG s0 s1 XCHG
CTOS CTOS
1 LDI
s0 s1 XCHG
<{
257 PUSHINT
LDI
}> PUSHCONT
<{
PUSHNULL
s0 s1 XCHG
}> PUSHCONT
IFELSE
LDMSGADDR LDMSGADDR
s1 PUSH s1 PUSH
2 PLDU 2 PLDU
@ -401,12 +516,13 @@ SETCP0
}> PUSHCONT }> PUSHCONT
IFELSE IFELSE
s1 POP s1 POP
s1 s4 XCHG s2 s5 XCHG
s3 s3 s0 XCHG3 s2 s4 XCHG
s2 s3 XCHG
}> CALLREF }> CALLREF
1 4 BLKDROP2 1 5 BLKDROP2
}> CALLREF }> CALLREF
s0 s4 XCHG s0 s5 XCHG
<{ <{
32 LDU 32 LDU
s0 s1 XCHG s0 s1 XCHG
@ -434,6 +550,7 @@ SETCP0
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
}> CALLREF }> CALLREF
s4 POP s4 POP
s7 s8 XCHG
s6 s7 XCHG s6 s7 XCHG
s5 s6 XCHG s5 s6 XCHG
s4 s5 XCHG s4 s5 XCHG
@ -444,16 +561,34 @@ SETCP0
2 GETGLOBVAR 2 GETGLOBVAR
s0 s1 XCHG s0 s1 XCHG
STREF STREF
4 1 BLKSWAP 5 1 BLKSWAP
<{ <{
s3 s4 XCHG2 s4 s5 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
s0 s1 XCHG ROT
STSLICER STSLICER
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
NEWC NEWC
s2 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s1 s2 XCHG
257 PUSHINT
STIX
}> PUSHCONT
<{
s2 POP
0 PUSHINT
ROT
1 STI
}> PUSHCONT
IFELSE
ROT ROT
s0 PUSH s0 PUSH
ISNULL ISNULL
@ -648,22 +783,41 @@ SETCP0
1 RSHIFT 1 RSHIFT
36: 36:
PUSHNULL
PUSHNULL PUSHNULL
0 PUSHINT 0 PUSHINT
s0 s4 XCHG s0 s5 XCHG
NEWC NEWC
STREF STREF
s0 s4 XCHG s0 s5 XCHG
s3 s3 XCHG2 s4 s4 s4 XCHG3
<{ <{
s3 s4 XCHG2 s4 s5 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
s0 s1 XCHG ROT
STSLICER STSLICER
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
NEWC NEWC
s2 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s1 s2 XCHG
257 PUSHINT
STIX
}> PUSHCONT
<{
s2 POP
0 PUSHINT
ROT
1 STI
}> PUSHCONT
IFELSE
ROT ROT
s0 PUSH s0 PUSH
ISNULL ISNULL
@ -709,7 +863,7 @@ SETCP0
36 CALLDICT 36 CALLDICT
38: 38:
s0 POP 2DROP
2 GETGLOBVAR 2 GETGLOBVAR
s1 s2 PUSH2 s1 s2 PUSH2
37 CALLDICT 37 CALLDICT
@ -720,17 +874,17 @@ SETCP0
1 GETGLOBVAR 1 GETGLOBVAR
4 UNTUPLE 4 UNTUPLE
4429 PUSHINT 4429 PUSHINT
s3 s12 PUSH2 s3 s13 PUSH2
SDEQ SDEQ
THROWANYIFNOT THROWANYIFNOT
s12 s7 XCPU s13 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 s12 PUXC s3 s13 PUXC
35 CALLDICT 35 CALLDICT
1 PUSHINT 1 PUSHINT
s4 PUSH s4 PUSH
@ -751,7 +905,7 @@ SETCP0
GREATER GREATER
THROWANYIFNOT THROWANYIFNOT
2 GETGLOBVAR 2 GETGLOBVAR
0 7 3 XCPUXC 0 8 3 XCPUXC
37 CALLDICT 37 CALLDICT
2DUP 2DUP
33 CALLDICT 33 CALLDICT
@ -760,22 +914,25 @@ SETCP0
0 PUSHINT 0 PUSHINT
64 PUSHINT 64 PUSHINT
PUSHNULL PUSHNULL
s13 PUSH PUSHNULL
s3 s14 XCPU s15 PUSH
s0 s3 XCHG s0 s4 XCHG
s9 s10 s9 XCHG3 s16 PUSH
s0 s4 XCHG
s3 s10 XCHG
s11 s10 s11 XCHG3
<{ <{
NEWC NEWC
7 1 BLKSWAP 8 1 BLKSWAP
<{ <{
395134233 PUSHINT 395134233 PUSHINT
s0 s8 XCHG2 s0 s9 XCHG2
32 STU 32 STU
s1 s6 XCHG s1 s7 XCHG
64 STU 64 STU
s0 s4 XCHG2 s0 s5 XCHG2
STGRAMS STGRAMS
ROT s0 s3 XCHG2
STSLICER STSLICER
s0 s1 XCHG s0 s1 XCHG
s0 PUSH s0 PUSH
@ -795,6 +952,24 @@ SETCP0
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
NEWC NEWC
s2 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s1 s2 XCHG
257 PUSHINT
STIX
}> PUSHCONT
<{
s2 POP
0 PUSHINT
ROT
1 STI
}> PUSHCONT
IFELSE
ROT ROT
s0 PUSH s0 PUSH
ISNULL ISNULL
@ -815,49 +990,53 @@ SETCP0
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
s11 PUSH s13 PUSH
ISNULL ISNULL
<{ <{
s11 POP s12 POP
s3 s10 XCHG s12 POP
s3 s11 XCHG
s2 s10 XCHG
}> PUSHCONT }> PUSHCONT
<{ <{
s4 POP s4 POP
s4 POP
}> PUSHCONT }> PUSHCONT
IFELSE IFELSE
s1 s11 PUSH2 s0 s12 PUSH2
SDEQ SDEQ
NOT NOT
s2 s11 PUSH2 s1 s11 PUSH2
SDEQ SDEQ
NOT NOT
AND AND
<{ <{
2 GETGLOBVAR 2 GETGLOBVAR
s12 s8 PUSH2 s13 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
s3 PUSH s2 PUSH
SDEQ SDEQ
THROWANYIFNOT THROWANYIFNOT
}> PUSHCONT }> PUSHCONT
IF IF
s13 s8 XCPU s14 s8 XCPU
ADD ADD
62972 PUSHINT 62972 PUSHINT
s1 PUSH s1 PUSH
-1 GTINT -1 GTINT
THROWANYIFNOT THROWANYIFNOT
s13 PUSH s3 PUSH
BALANCE BALANCE
0 INDEX 0 INDEX
s1 PUSH s1 PUSH
@ -872,10 +1051,17 @@ SETCP0
s6 PUSH s6 PUSH
0 GTINT 0 GTINT
<{ <{
s14 s4 XCHG2 s7 s15 XCHG
s8 s9 XCHG2
8 BLKDROP
}> PUSHCONT
<{
s3 s1 s15 XCHG3
s4 s2 XCHG2
35 CALLDICT 35 CALLDICT
s3 s-1 PUXC s3 s-1 PUXC
ADD ADD
s1 s12 XCHG
SUB SUB
0 PUSHINT 0 PUSHINT
0 PUSHINT 0 PUSHINT
@ -900,30 +1086,28 @@ SETCP0
}> CALLREF }> CALLREF
ENDC ENDC
}> CALLREF }> CALLREF
s9 PUSH s10 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 s6 XCHG2 s0 s7 XCHG2
}> PUSHCONT }> IFREFELSE
<{ s7 PUSH
s7 s14 XCHG
s8 s9 XCHG2
8 BLKDROP
}> PUSHCONT
IFELSE
s6 PUSH
ISNULL ISNULL
NOT NOT
s2 PUSH s2 PUSH
0 GTINT 0 GTINT
AND AND
<{
s7 POP
2DROP
}> PUSHCONT
<{ <{
0 PUSHINT 0 PUSHINT
s0 s7 XCHG s0 s8 XCHG
2 CALLDICT 2 CALLDICT
0 PUSHINT 0 PUSHINT
s0 s4 XCHG s0 s4 XCHG
@ -938,56 +1122,48 @@ SETCP0
}> CALLREF }> CALLREF
ENDC ENDC
}> CALLREF }> CALLREF
s4 s8 XCHG s4 s9 XCHG
s3 s3 s0 XCHG3 s3 s3 s0 XCHG3
s1 s8 XCHG s1 s9 XCHG
PUSHNULL PUSHNULL
PUSHNULL PUSHNULL
34 CALLDICT 34 CALLDICT
}> PUSHCONT }> IFREFELSE
<{
s6 POP
2DROP
}> PUSHCONT
IFELSE
41: 41:
2DROP 2DROP
1 GETGLOBVAR 1 GETGLOBVAR
4 UNTUPLE 4 UNTUPLE
4429 PUSHINT 4429 PUSHINT
s3 s9 PUSH2 s3 s10 PUSH2
SDEQ SDEQ
s4 s9 PUSH2 s4 s10 PUSH2
SDEQ SDEQ
OR OR
s4 s8 PUSH2 s4 s8 PUSH2
SDEQ SDEQ
OR OR
THROWANYIFNOT THROWANYIFNOT
s9 s4 XCPU s10 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 s9 PUXC s3 s10 PUXC
35 CALLDICT 35 CALLDICT
s0 POP
16059 PUSHINT 16059 PUSHINT
s0 s1 XCHG s0 s1 XCHG
20000000 PUSHINT 30000000 PUSHINT
ADD
10000000 PUSHINT
ADD
s1 s2 XCHG
GREATER GREATER
THROWANYIFNOT THROWANYIFNOT
-1 PUSHINT -1 PUSHINT
0 PUSHINT 0 PUSHINT
s0 s3 XCHG s0 s3 XCHG
64 PUSHINT 64 PUSHINT
3 7 7 XCPU2 3 8 8 XCPU2
<{ <{
NEWC NEWC
4 1 BLKSWAP 4 1 BLKSWAP
@ -1017,7 +1193,7 @@ SETCP0
}> CALLREF }> CALLREF
ENDC ENDC
}> CALLREF }> CALLREF
3 0 5 XC2PU 3 0 6 XC2PU
s3 s3 XCHG2 s3 s3 XCHG2
PUSHNULL PUSHNULL
PUSHNULL PUSHNULL
@ -1042,9 +1218,9 @@ SETCP0
OR OR
s1 s2 XCHG s1 s2 XCHG
THROWANYIFNOT THROWANYIFNOT
s1 s4 XCHG s1 s5 XCHG
ADD ADD
s0 s3 XCHG s0 s4 XCHG
get_wallet_data: get_wallet_data:
<{ <{
@ -1065,6 +1241,17 @@ SETCP0
LDREF LDREF
s0 s1 XCHG s0 s1 XCHG
CTOS CTOS
1 LDI
s0 s1 XCHG
<{
257 PUSHINT
LDI
}> PUSHCONT
<{
PUSHNULL
s0 s1 XCHG
}> PUSHCONT
IFELSE
LDMSGADDR LDMSGADDR
s1 PUSH s1 PUSH
2 PLDU 2 PLDU
@ -1078,10 +1265,11 @@ SETCP0
}> PUSHCONT }> PUSHCONT
IFELSE IFELSE
s1 POP s1 POP
s1 s4 XCHG s2 s5 XCHG
s3 s3 s0 XCHG3 s2 s4 XCHG
s2 s3 XCHG
}> CALLREF }> CALLREF
1 4 BLKDROP2 1 5 BLKDROP2
}> CALLREF }> CALLREF
38 CALLDICT 38 CALLDICT
30 CALLDICT 30 CALLDICT

BIN
sources/output/jetton_TONBWallet.init.boc

Binary file not shown.

11
sources/output/jetton_TONBWallet.init.fc

@ -17,25 +17,26 @@ builder __tact_store_address_opt(builder b, slice address) inline {
} }
} }
builder __gen_write_TONBWallet(builder build_0, (int, slice, slice, slice) v) inline_ref { builder __gen_write_TONBWallet(builder build_0, (int, slice, slice, int, slice) v) inline_ref {
var (v'balance, v'owner, v'master, v'linker) = v; var (v'balance, v'owner, v'master, v'linker, v'linker_address) = 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(); var build_1 = begin_cell();
build_1 = __tact_store_address_opt(build_1, v'linker); build_1 = ~ null?(v'linker) ? build_1.store_int(true, 1).store_int(v'linker, 257) : build_1.store_int(false, 1);
build_1 = __tact_store_address_opt(build_1, v'linker_address);
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_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, $self'linker)) = (null(), null(), null(), null()); var (($self'balance, $self'owner, $self'master, $self'linker, $self'linker_address)) = (null(), 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, $self'linker)); b' = __gen_write_TONBWallet(b', ($self'balance, $self'owner, $self'master, $self'linker, $self'linker_address));
return b'.end_cell(); return b'.end_cell();
} }

27
sources/output/jetton_TONBWallet.init.fif

@ -28,14 +28,30 @@ PROGRAM{
}> }>
}> }>
__gen_write_TONBWallet PROCREF:<{ __gen_write_TONBWallet PROCREF:<{
s3 s4 XCHG2 s4 s5 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
SWAP ROT
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
SWAP SWAP
__tact_store_address INLINECALLDICT __tact_store_address INLINECALLDICT
NEWC NEWC
s2 PUSH
ISNULL
NOT
IF:<{
TRUE
SWAP
1 STI
s1 s2 XCHG
257 PUSHINT
STIX
}>ELSE<{
s2 POP
FALSE
ROT
1 STI
}>
ROT ROT
__tact_store_address_opt INLINECALLDICT __tact_store_address_opt INLINECALLDICT
ENDC ENDC
@ -43,13 +59,14 @@ PROGRAM{
STREF STREF
}> }>
$__gen_TONBWallet_init PROC:<{ $__gen_TONBWallet_init PROC:<{
PUSHNULL
PUSHNULL PUSHNULL
0 PUSHINT 0 PUSHINT
s0 s4 XCHG s0 s5 XCHG
NEWC NEWC
STREF STREF
s0 s4 XCHG s0 s5 XCHG
s3 s3 XCHG2 s4 s4 s4 XCHG3
__gen_write_TONBWallet INLINECALLDICT __gen_write_TONBWallet INLINECALLDICT
ENDC ENDC
}> }>

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

@ -3,22 +3,41 @@ SETCP0
recv_internal: recv_internal:
5: 5:
PUSHNULL
PUSHNULL PUSHNULL
0 PUSHINT 0 PUSHINT
s0 s4 XCHG s0 s5 XCHG
NEWC NEWC
STREF STREF
s0 s4 XCHG s0 s5 XCHG
s3 s3 XCHG2 s4 s4 s4 XCHG3
<{ <{
s3 s4 XCHG2 s4 s5 XCHG2
257 PUSHINT 257 PUSHINT
STIX STIX
s0 s1 XCHG ROT
STSLICER STSLICER
s0 s1 XCHG s0 s1 XCHG
STSLICER STSLICER
NEWC NEWC
s2 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s1 s2 XCHG
257 PUSHINT
STIX
}> PUSHCONT
<{
s2 POP
0 PUSHINT
ROT
1 STI
}> PUSHCONT
IFELSE
ROT ROT
s0 PUSH s0 PUSH
ISNULL ISNULL

6
sources/output/jetton_TONBWallet.md

@ -1,6 +1,6 @@
# TACT Compilation Report # TACT Compilation Report
Contract: TONBWallet Contract: TONBWallet
BOC Size: 1422 bytes BOC Size: 1514 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> setLinker:Maybe address = TokenTransferInternal` TLB: `token_transfer_internal#178d4519 queryId:uint64 amount:coins from:address responseAddress:Maybe address forwardTonAmount:coins forwardPayload:remainder<slice> setLinker:Maybe int257 setLinkerAddress:Maybe address = TokenTransferInternal`
Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder<slice>,setLinker:Maybe address}` Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder<slice>,setLinker:Maybe int257,setLinkerAddress: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`

2
sources/output/jetton_TONBWallet.pkg

File diff suppressed because one or more lines are too long

25
sources/output/jetton_TONBWallet.ts

@ -247,7 +247,8 @@ export type TokenTransferInternal = {
responseAddress: Address | null; responseAddress: Address | null;
forwardTonAmount: bigint; forwardTonAmount: bigint;
forwardPayload: Cell; forwardPayload: Cell;
setLinker: Address | null; setLinker: bigint | null;
setLinkerAddress: Address | null;
} }
export function storeTokenTransferInternal(src: TokenTransferInternal) { export function storeTokenTransferInternal(src: TokenTransferInternal) {
@ -261,7 +262,8 @@ export function storeTokenTransferInternal(src: TokenTransferInternal) {
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(); let b_1 = new Builder();
b_1.storeAddress(src.setLinker); if (src.setLinker !== null && src.setLinker !== undefined) { b_1.storeBit(true).storeInt(src.setLinker, 257); } else { b_1.storeBit(false); }
b_1.storeAddress(src.setLinkerAddress);
b_0.storeRef(b_1.endCell()); b_0.storeRef(b_1.endCell());
}; };
} }
@ -276,8 +278,9 @@ export function loadTokenTransferInternal(slice: Slice) {
let _forwardTonAmount = sc_0.loadCoins(); let _forwardTonAmount = sc_0.loadCoins();
let _forwardPayload = sc_0.asCell(); let _forwardPayload = sc_0.asCell();
let sc_1 = sc_0.loadRef().beginParse(); let sc_1 = sc_0.loadRef().beginParse();
let _setLinker = sc_1.loadMaybeAddress(); let _setLinker = sc_1.loadBit() ? sc_1.loadIntBig(257) : null;
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload, setLinker: _setLinker }; let _setLinkerAddress = sc_1.loadMaybeAddress();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload, setLinker: _setLinker, setLinkerAddress: _setLinkerAddress };
} }
function loadTupleTokenTransferInternal(source: TupleReader) { function loadTupleTokenTransferInternal(source: TupleReader) {
@ -287,8 +290,9 @@ 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();
let _setLinker = source.readAddressOpt(); let _setLinker = source.readBigNumberOpt();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload, setLinker: _setLinker }; let _setLinkerAddress = source.readAddressOpt();
return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload, setLinker: _setLinker, setLinkerAddress: _setLinkerAddress };
} }
function storeTupleTokenTransferInternal(source: TokenTransferInternal) { function storeTupleTokenTransferInternal(source: TokenTransferInternal) {
@ -299,7 +303,8 @@ 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); builder.writeNumber(source.setLinker);
builder.writeAddress(source.setLinkerAddress);
return builder.build(); return builder.build();
} }
@ -959,9 +964,9 @@ function dictValueParserWithdraw(): DictionaryValue<Withdraw> {
} }
} }
async function TONBWallet_init(master: Address, owner: Address) { async function TONBWallet_init(master: Address, owner: Address) {
const __init = 'te6ccgEBBwEAUAABFP8A9KQT9LzyyAsBAgFiAgMCAs0EBQAJoUrd4AsAAdQBF2W1wBMjMBFAz2zzJgYAPFA0gQEBzwABzxYBzxbIWCBulTBwAcsBks8W4skBzA=='; const __init = 'te6ccgEBBwEAZgABFP8A9KQT9LzyyAsBAgFiAgMCAs0EBQAJoUrd4AsAAdQBGWW1tcAXIzAVERNs8yYGAGZQRYEBAc8AWM8WAc8WyCJus5p/AcoAEoEBAc8AlTJwWMoA4lggbpUwcAHLAZLPFuLJAcw=';
const __code = 'te6ccgECMwEABYIAART/APSkE/S88sgLAQIBYgIDAgLKBgcCASAEBQERv9gW2eeBN4D0EQBxvd6ME4LnYerpZXPY9CdhzrJUKNs0E4TusalpWyPlmRadeW/vixHME4TujwAfLZsB5P5B1ZLNZRCcAgEgCAkCAUgVFgIBYgoLAAOnQASJRwIddJwh+VMCDXCx/eAtDTAwFxsMABkX+RcOIB+kAiUGZvBPhhAo8JMNs8VQPwKts84CCCEA+KfqW64wIgghAXjUUZuoERMMDQALQgbvLQgIAyYw2zwE2z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JBAjOM6qqA==';
let systemCell = Cell.fromBase64(__system); let systemCell = Cell.fromBase64(__system);
let builder = new TupleBuilder(); let builder = new TupleBuilder();
builder.writeCell(systemCell); builder.writeCell(systemCell);

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

@ -13,14 +13,14 @@ exports[`jetton should deploy and deposit the wallet with the correct sum of mon
}, },
"bounce": true, "bounce": true,
"from": "kQAI-3FJVc_ywSuY4vq0bYrzR7S4Och4y7bTU_i5yLOB3A6P", "from": "kQAI-3FJVc_ywSuY4vq0bYrzR7S4Och4y7bTU_i5yLOB3A6P",
"to": "kQCM9AmnDVgUtUtKjTYQmBC1nKt5dR8EsRWQvtvzNws01ZJu", "to": "kQBvLWbJmRxsnDuBrGvOkN_QmzLpgeyyQf0XbfnIeM7XYTwh",
"type": "internal", "type": "internal",
"value": 1200000000n, "value": 1200000000n,
}, },
"type": "received", "type": "received",
}, },
{ {
"gasUsed": 36303n, "gasUsed": 37054n,
"type": "processed", "type": "processed",
}, },
{ {
@ -31,8 +31,8 @@ exports[`jetton should deploy and deposit the wallet with the correct sum of mon
"type": "cell", "type": "cell",
}, },
"bounce": false, "bounce": false,
"from": "kQCM9AmnDVgUtUtKjTYQmBC1nKt5dR8EsRWQvtvzNws01ZJu", "from": "kQBvLWbJmRxsnDuBrGvOkN_QmzLpgeyyQf0XbfnIeM7XYTwh",
"to": "kQB2vHcaIyjKkO_JMeWRZ8QN_zBjgfX7OHflzG9vrE3cUH-F", "to": "kQDvdSDFqvr41l4MwWjbjCSwTka3iYJTlTEjj5rVuePsXsSa",
"type": "internal", "type": "internal",
"value": 13474000n, "value": 13474000n,
}, },
@ -43,15 +43,15 @@ exports[`jetton should deploy and deposit the wallet with the correct sum of mon
"messages": [ "messages": [
{ {
"body": { "body": {
"cell": "x{178D4519000000000000000043B9ACA0080119E8134E1AB0296A96951A6C2130216B3956F2EA3E09622B217DB7E66E1669AB00023EDC525573FCB04AE638BEAD1B62BCD1ED2E0E721E32EDB4D4FE2E722CE07702_} "cell": "x{178D4519000000000000000043B9ACA00800DE5ACD933238D938770358D79D21BFA13665D303D96483FA2EDBF390F19DAEC300023EDC525573FCB04AE638BEAD1B62BCD1ED2E0E721E32EDB4D4FE2E722CE07702_}
x{800ED78EE3446519521DF9263CB22CF881BFE60C703EBF670EFCB98DEDF589BB8A1_}", x{800000000000000000000000000000000000000000000000000000000000000020077BA9062D57D7C6B2F0660B46DC6125827235BC4C129CA9891C7CD6ADCF1F62F4_}",
"type": "cell", "type": "cell",
}, },
"bounce": false, "bounce": false,
"from": "kQCM9AmnDVgUtUtKjTYQmBC1nKt5dR8EsRWQvtvzNws01ZJu", "from": "kQBvLWbJmRxsnDuBrGvOkN_QmzLpgeyyQf0XbfnIeM7XYTwh",
"to": "kQCs7NEVQDI566FHvxACpYud6bZ40nPH4s_v39XOEbexYPMS", "to": "kQATwu07DUC3EW02Ouf3rQA9zbePcr9Z3bGajEVnEsilpexg",
"type": "internal", "type": "internal",
"value": 21584000n, "value": 30513000n,
}, },
], ],
"type": "sent", "type": "sent",

8
sources/tests/jetton.spec.ts

@ -19,7 +19,6 @@ describe('jetton', () => {
// Mint // Mint
await contract.send(owner, { value: toNano('1.2') }, { $$type: 'Deposit', amount: toNano('1') }); await contract.send(owner, { value: toNano('1.2') }, { $$type: 'Deposit', amount: toNano('1') });
let log = await system.run(); let log = await system.run();
await system.run();
let events = tracker.events(); let events = tracker.events();
expect(events).toMatchSnapshot(); expect(events).toMatchSnapshot();
@ -35,5 +34,12 @@ describe('jetton', () => {
// Check owner // Check owner
expect((await contract.getOwner()).toString()).toEqual(owner.address.toString()); expect((await contract.getOwner()).toString()).toEqual(owner.address.toString());
// Withdraw
await contract.send(owner, { value: toNano('0.15') }, { $$type: 'Withdraw', amount: toNano('0.3') });
log = await system.run();
events = tracker.events();
expect((events[5] as any).messages[0].value).toBeGreaterThan(toNano('0.29'));
}); });
}); });

15
sources/wallet.tact

@ -13,7 +13,8 @@ contract TONBWallet {
balance: Int; balance: Int;
owner: Address; owner: Address;
master: Address; master: Address;
linker: Address?; linker: Int?;
linker_address: Address?;
init(master: Address, owner: Address) { init(master: Address, owner: Address) {
self.balance = 0; self.balance = 0;
@ -54,7 +55,8 @@ contract TONBWallet {
responseAddress: self.owner, responseAddress: self.owner,
forwardTonAmount: msg.forwardTonAmount, forwardTonAmount: msg.forwardTonAmount,
forwardPayload: msg.forwardPayload, forwardPayload: msg.forwardPayload,
setLinker: null setLinker: null,
setLinkerAddress: null
}.toCell(), }.toCell(),
code: init.code, code: init.code,
data: init.data data: init.data
@ -67,8 +69,9 @@ contract TONBWallet {
let ctx: Context = context(); let ctx: Context = context();
if (self.linker == null) { if (self.linker == null) {
self.linker = msg.setLinker; self.linker = msg.setLinker;
self.linker_address = msg.setLinkerAddress;
} }
if (ctx.sender != self.master && ctx.sender != self.linker) { if (ctx.sender != self.master && ctx.sender != self.linker_address) {
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");
} }
@ -117,15 +120,15 @@ contract TONBWallet {
// Check sender // Check sender
let ctx: Context = context(); let ctx: Context = context();
require(ctx.sender == self.owner || ctx.sender == self.master || ctx.sender == self.linker, "Invalid sender"); require(ctx.sender == self.owner || ctx.sender == self.master || ctx.sender == self.linker_address, "Invalid sender");
// Update balance // Update balance
self.balance = self.balance - msg.amount; self.balance = self.balance - msg.amount;
require(self.balance >= 0, "Invalid balance"); require(self.balance >= 0, "Invalid balance");
// Gas checks // // Gas checks
let fwdFee: Int = ctx.readForwardFee(); let fwdFee: Int = ctx.readForwardFee();
require(ctx.value > fwdFee + 2 * self.gasConsumption + self.minTonsForStorage, "Invalid value"); require(ctx.value > 2 * self.gasConsumption + self.minTonsForStorage, "Invalid value");
// Burn tokens // Burn tokens
send(SendParameters{ send(SendParameters{

Loading…
Cancel
Save