Browse Source

Deploying linker on transfer

master
Lev 2 years ago
parent
commit
8d05577555
  1. 39
      sources/jetton_trait.tact
  2. 4
      sources/messages.tact
  3. 2
      sources/output/jetton_Linker.abi
  4. 2
      sources/output/jetton_Linker.code.fc
  5. 2
      sources/output/jetton_Linker.code.fif
  6. 6
      sources/output/jetton_Linker.md
  7. 2
      sources/output/jetton_Linker.pkg
  8. 42
      sources/output/jetton_Linker.ts
  9. 2
      sources/output/jetton_PseudoStaking.abi
  10. 2
      sources/output/jetton_PseudoStaking.code.fc
  11. 2
      sources/output/jetton_PseudoStaking.code.fif
  12. 6
      sources/output/jetton_PseudoStaking.md
  13. 2
      sources/output/jetton_PseudoStaking.pkg
  14. 42
      sources/output/jetton_PseudoStaking.ts
  15. 2
      sources/output/jetton_TONB.abi
  16. BIN
      sources/output/jetton_TONB.code.boc
  17. 34
      sources/output/jetton_TONB.code.fc
  18. 99
      sources/output/jetton_TONB.code.fif
  19. 707
      sources/output/jetton_TONB.code.rev.fif
  20. 8
      sources/output/jetton_TONB.md
  21. 2
      sources/output/jetton_TONB.pkg
  22. 51
      sources/output/jetton_TONB.ts
  23. 2
      sources/output/jetton_TONBWallet.abi
  24. BIN
      sources/output/jetton_TONBWallet.code.boc
  25. 17
      sources/output/jetton_TONBWallet.code.fc
  26. 34
      sources/output/jetton_TONBWallet.code.fif
  27. 181
      sources/output/jetton_TONBWallet.code.rev.fif
  28. 8
      sources/output/jetton_TONBWallet.md
  29. 2
      sources/output/jetton_TONBWallet.pkg
  30. 46
      sources/output/jetton_TONBWallet.ts
  31. 38
      sources/tests/__snapshots__/jetton.spec.ts.snap
  32. 14
      sources/wallet.tact

39
sources/jetton_trait.tact

@ -167,6 +167,45 @@ trait TONBTrait with Ownable, StakingTrait {
});
}
receive(msg: RequestLinker) {
let ctx: Context = context();
let winit: StateInit = self.getJettonWalletInit(msg.client);
let walletAddress: Address = contractAddress(winit);
require(walletAddress == ctx.sender, "invalid sender");
let linker_init: StateInit = initOf Linker(self.n_linkers, walletAddress, myAddress());
let linker_address: Address = contractAddress(linker_init);
send(SendParameters{
to: linker_address,
value: linker_credit,
bounce: false,
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: 0,
queryId: 0,
from: myAddress(),
responseAddress: myAddress(),
forwardTonAmount: 0,
forwardPayload: emptySlice(),
setLinker: self.n_linkers - 1,
setLinkerAddress: linker_address
}.toCell();
send(SendParameters{
to: walletAddress,
value: wallet_credit,
bounce: false,
body: wallet_msg_body,
code: winit.code,
data: winit.data
});
}
fun burn(from: Address, amount: Int, responseAddress: Address?) {
// Create message

4
sources/messages.tact

@ -129,4 +129,8 @@ message InitiateDistributionVote {
message SetStakingPool {
staking_pool: Address?;
}
message RequestLinker {
client: Address;
}

2
sources/output/jetton_Linker.abi

File diff suppressed because one or more lines are too long

2
sources/output/jetton_Linker.code.fc

@ -229,5 +229,5 @@ _ supported_interfaces() method_id {
}
_ get_abi_ipfs() {
return "ipfs://QmWkjXBm4uV3FSCQFo4XgZ4C4ZZdKD7TWpVno86LVkSrRS";
return "ipfs://QmUSvHrma2CS7pvfxCP2ZnYPCvVGM3Z1FstSNW6u8M2T4h";
}

2
sources/output/jetton_Linker.code.fif

@ -354,6 +354,6 @@ PROGRAM{
209801025412363888721030803524359905849 PUSHINT
}>
get_abi_ipfs PROC:<{
x{697066733a2f2f516d576b6a58426d3475563346534351466f3458675a3443345a5a644b4437545770566e6f38364c566b53725253} PUSHSLICE
x{697066733a2f2f516d55537648726d6132435337707666784350325a6e5950437656474d335a31467374534e573675384d32543468} PUSHSLICE
}>
}END>c

6
sources/output/jetton_Linker.md

@ -3,7 +3,7 @@ Contract: Linker
BOC Size: 645 bytes
# Types
Total Types: 29
Total Types: 30
## StateInit
TLB: `_ code:^cell data:^cell = StateInit`
@ -105,6 +105,10 @@ Signature: `InitiateDistributionVote{adminIndex:int257,quorum_percent:int257,vot
TLB: `set_staking_pool#0764d148 staking_pool:Maybe address = SetStakingPool`
Signature: `SetStakingPool{staking_pool:Maybe address}`
## RequestLinker
TLB: `request_linker#5a29431e client:address = RequestLinker`
Signature: `RequestLinker{client:address}`
## WithdrawalRequests
TLB: `_ addresses:dict<int, address> amounts:dict<int, int> n_requests:int257 = WithdrawalRequests`
Signature: `WithdrawalRequests{addresses:dict<int, address>,amounts:dict<int, int>,n_requests:int257}`

2
sources/output/jetton_Linker.pkg

File diff suppressed because one or more lines are too long

42
sources/output/jetton_Linker.ts

@ -1304,6 +1304,47 @@ function dictValueParserSetStakingPool(): DictionaryValue<SetStakingPool> {
}
}
}
export type RequestLinker = {
$$type: 'RequestLinker';
client: Address;
}
export function storeRequestLinker(src: RequestLinker) {
return (builder: Builder) => {
let b_0 = builder;
b_0.storeUint(1512653598, 32);
b_0.storeAddress(src.client);
};
}
export function loadRequestLinker(slice: Slice) {
let sc_0 = slice;
if (sc_0.loadUint(32) !== 1512653598) { throw Error('Invalid prefix'); }
let _client = sc_0.loadAddress();
return { $$type: 'RequestLinker' as const, client: _client };
}
function loadTupleRequestLinker(source: TupleReader) {
let _client = source.readAddress();
return { $$type: 'RequestLinker' as const, client: _client };
}
function storeTupleRequestLinker(source: RequestLinker) {
let builder = new TupleBuilder();
builder.writeAddress(source.client);
return builder.build();
}
function dictValueParserRequestLinker(): DictionaryValue<RequestLinker> {
return {
serialize: (src, buidler) => {
buidler.storeRef(beginCell().store(storeRequestLinker(src)).endCell());
},
parse: (src) => {
return loadRequestLinker(src.loadRef().beginParse());
}
}
}
export type WithdrawalRequests = {
$$type: 'WithdrawalRequests';
addresses: Dictionary<bigint, Address>;
@ -1534,6 +1575,7 @@ const Linker_errors: { [key: number]: { message: string } } = {
13650: { message: `Invalid bounced message` },
16059: { message: `Invalid value` },
32366: { message: `not enough money for deposit` },
41207: { message: `invalid sender` },
44816: { message: `Wallet is blacklisted` },
62972: { message: `Invalid balance` },
}

2
sources/output/jetton_PseudoStaking.abi

File diff suppressed because one or more lines are too long

2
sources/output/jetton_PseudoStaking.code.fc

@ -209,5 +209,5 @@ _ supported_interfaces() method_id {
}
_ get_abi_ipfs() {
return "ipfs://QmYKdgrRXE254hAvD7qktcXju6QEyfjCpU1nZegvJD7C9K";
return "ipfs://QmPwuNr3oQ5NQcD4Xd7t7WX9wnsfuhfVhNMNuVNSKXHm5R";
}

2
sources/output/jetton_PseudoStaking.code.fif

@ -339,6 +339,6 @@ PROGRAM{
209801025412363888721030803524359905849 PUSHINT
}>
get_abi_ipfs PROC:<{
x{697066733a2f2f516d594b6467725258453235346841764437716b7463586a7536514579666a437055316e5a6567764a443743394b} PUSHSLICE
x{697066733a2f2f516d5077754e72336f51354e516344345864377437575839776e736675686656684e4d4e75564e534b58486d3552} PUSHSLICE
}>
}END>c

6
sources/output/jetton_PseudoStaking.md

@ -3,7 +3,7 @@ Contract: PseudoStaking
BOC Size: 584 bytes
# Types
Total Types: 29
Total Types: 30
## StateInit
TLB: `_ code:^cell data:^cell = StateInit`
@ -105,6 +105,10 @@ Signature: `InitiateDistributionVote{adminIndex:int257,quorum_percent:int257,vot
TLB: `set_staking_pool#0764d148 staking_pool:Maybe address = SetStakingPool`
Signature: `SetStakingPool{staking_pool:Maybe address}`
## RequestLinker
TLB: `request_linker#5a29431e client:address = RequestLinker`
Signature: `RequestLinker{client:address}`
## WithdrawalRequests
TLB: `_ addresses:dict<int, address> amounts:dict<int, int> n_requests:int257 = WithdrawalRequests`
Signature: `WithdrawalRequests{addresses:dict<int, address>,amounts:dict<int, int>,n_requests:int257}`

2
sources/output/jetton_PseudoStaking.pkg

File diff suppressed because one or more lines are too long

42
sources/output/jetton_PseudoStaking.ts

@ -1304,6 +1304,47 @@ function dictValueParserSetStakingPool(): DictionaryValue<SetStakingPool> {
}
}
}
export type RequestLinker = {
$$type: 'RequestLinker';
client: Address;
}
export function storeRequestLinker(src: RequestLinker) {
return (builder: Builder) => {
let b_0 = builder;
b_0.storeUint(1512653598, 32);
b_0.storeAddress(src.client);
};
}
export function loadRequestLinker(slice: Slice) {
let sc_0 = slice;
if (sc_0.loadUint(32) !== 1512653598) { throw Error('Invalid prefix'); }
let _client = sc_0.loadAddress();
return { $$type: 'RequestLinker' as const, client: _client };
}
function loadTupleRequestLinker(source: TupleReader) {
let _client = source.readAddress();
return { $$type: 'RequestLinker' as const, client: _client };
}
function storeTupleRequestLinker(source: RequestLinker) {
let builder = new TupleBuilder();
builder.writeAddress(source.client);
return builder.build();
}
function dictValueParserRequestLinker(): DictionaryValue<RequestLinker> {
return {
serialize: (src, buidler) => {
buidler.storeRef(beginCell().store(storeRequestLinker(src)).endCell());
},
parse: (src) => {
return loadRequestLinker(src.loadRef().beginParse());
}
}
}
export type WithdrawalRequests = {
$$type: 'WithdrawalRequests';
addresses: Dictionary<bigint, Address>;
@ -1531,6 +1572,7 @@ const PseudoStaking_errors: { [key: number]: { message: string } } = {
13650: { message: `Invalid bounced message` },
16059: { message: `Invalid value` },
32366: { message: `not enough money for deposit` },
41207: { message: `invalid sender` },
44816: { message: `Wallet is blacklisted` },
62972: { message: `Invalid balance` },
}

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.

34
sources/output/jetton_TONB.code.fc

@ -206,6 +206,12 @@ cell __gen_writecell_BlacklistWallet((slice) v) inline_ref {
return (sc_0, (v'staking_pool));
}
(slice, ((slice))) __gen_read_RequestLinker(slice sc_0) inline {
throw_unless(129, sc_0~load_uint(32) == 1512653598);
var v'client = sc_0~__tact_load_address();
return (sc_0, (v'client));
}
builder __gen_write_WithdrawalRequests(builder build_0, (cell, cell, int) v) inline {
var (v'addresses, v'amounts, v'n_requests) = v;
build_0 = build_0.store_dict(v'addresses);
@ -599,6 +605,23 @@ _ $__gen_get_owner() method_id(83229) {
return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool, $self'in_the_pool, ($self'withdrawal_requests'addresses, $self'withdrawal_requests'amounts, $self'withdrawal_requests'n_requests)), ());
}
(((int, slice, cell, int, slice, slice, int, slice, int, (cell, cell, int))), ()) $__gen_TONB_receive_RequestLinker((int, slice, cell, int, slice, slice, int, slice, int, (cell, cell, int)) $self, (slice) $msg) impure inline {
var ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool, $self'in_the_pool, ($self'withdrawal_requests'addresses, $self'withdrawal_requests'amounts, $self'withdrawal_requests'n_requests)) = $self;
var ($msg'client) = $msg;
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get();
var ($winit'code, $winit'data) = ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool, $self'in_the_pool, ($self'withdrawal_requests'addresses, $self'withdrawal_requests'amounts, $self'withdrawal_requests'n_requests))~$__gen_TONB_getJettonWalletInit($msg'client);
slice $walletAddress = $contractAddress(($winit'code, $winit'data));
throw_unless(41207, __tact_address_eq($walletAddress, $ctx'sender));
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, 0, my_address(), my_address(), 0, $emptySlice(), ($self'n_linkers - 1), $linker_address));
$send((false, $walletAddress, 65000000, 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, $self'in_the_pool, ($self'withdrawal_requests'addresses, $self'withdrawal_requests'amounts, $self'withdrawal_requests'n_requests)), ());
}
((int, slice, cell, int, slice, slice, int, slice, int, (cell, cell, int)), ()) $__gen_TONB_receive_comment_f7b1ab6077945b37370a1550574675180cf87df4cb047c869746812a83667d4c((int, slice, cell, int, slice, slice, int, slice, int, (cell, cell, int)) $self) impure inline {
var ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool, $self'in_the_pool, ($self'withdrawal_requests'addresses, $self'withdrawal_requests'amounts, $self'withdrawal_requests'n_requests)) = $self;
int $i = 0;
@ -691,6 +714,15 @@ _ $__gen_get_owner() method_id(83229) {
return ();
}
;; Receive RequestLinker message
if (op == 1512653598) {
var self = __gen_load_TONB();
var msg = in_msg~__gen_read_RequestLinker();
self~$__gen_TONB_receive_RequestLinker(msg);
__gen_store_TONB(self);
return ();
}
;; Text Receivers
if (op == 0) {
var text_op = slice_hash(in_msg);
@ -717,5 +749,5 @@ _ supported_interfaces() method_id {
}
_ get_abi_ipfs() {
return "ipfs://QmT3asZBJxdjojRfpy7LPafCD4rqJn3fQzFqeWGuf8rLCC";
return "ipfs://QmbvAFjnCM5XTJgrgt7t9fPJakhgnHe6UgD1XQ2bUmTLTR";
}

99
sources/output/jetton_TONB.code.fif

@ -29,6 +29,7 @@ PROGRAM{
DECLPROC __gen_writecell_BlacklistWallet
DECLPROC __gen_read_BlacklistWallet
DECLPROC __gen_read_SetStakingPool
DECLPROC __gen_read_RequestLinker
DECLPROC __gen_write_WithdrawalRequests
DECLPROC __gen_read_WithdrawalRequests
DECLPROC __gen_read_Deposit
@ -72,6 +73,7 @@ PROGRAM{
DECLPROC $__gen_TONB_receive_TokenUpdateContent
DECLPROC $__gen_TONB_receive_TokenBurnNotification
DECLPROC $__gen_TONB_receive_BlacklistWallet
DECLPROC $__gen_TONB_receive_RequestLinker
DECLPROC $__gen_TONB_receive_comment_f7b1ab6077945b37370a1550574675180cf87df4cb047c869746812a83667d4c
DECLPROC recv_internal
113617 DECLMETHOD supported_interfaces
@ -367,6 +369,14 @@ PROGRAM{
129 THROWIFNOT
__tact_load_address_opt INLINECALLDICT
}>
__gen_read_RequestLinker PROCINLINE:<{
32 LDU
SWAP
1512653598 PUSHINT
EQUAL
129 THROWIFNOT
__tact_load_address INLINECALLDICT
}>
__gen_write_WithdrawalRequests PROCINLINE:<{
s2 s3 XCHG2
STDICT
@ -1069,6 +1079,71 @@ PROGRAM{
$send INLINECALLDICT
11 ROLL
}>
$__gen_TONB_receive_RequestLinker PROCINLINE:<{
__tact_context_get INLINECALLDICT
s2 s3 XCHG
3 BLKDROP
13 -ROLL
$__gen_TONB_getJettonWalletInit INLINECALLDICT
2DUP
$contractAddress INLINECALLDICT
DUP
41207 PUSHINT
s0 17 s() XCHG
__tact_address_eq INLINECALLDICT
s1 16 s() XCHG
THROWANYIFNOT
__tact_context_sys GETGLOB
MYADDR
s9 s(-1) PUXC
17 s() PUSH
SWAP
$__gen_Linker_init_child CALLDICT
2DUP
$contractAddress INLINECALLDICT
FALSE
20000000 PUSHINT
0 PUSHINT
s0 s14 XCHG
__gen_writecell_SetLinkerNeighbor INLINECALLDICT
s3 PUSH
s3 s6 XCHG
s4 s1 s5 XCHG3
s3 s15 XCHG
s1 s15 s0 XCHG3
$send INLINECALLDICT
s8 PUSH
s0 s8 XCHG
INC
0 PUSHINT
DUP
MYADDR
MYADDR
s2 PUSH
$emptySlice INLINECALLDICT
s6 PUSH
DEC
7 ROLL
s0 16 s() XCHG
__gen_writecell_TokenTransferInternal INLINECALLDICT
FALSE
s0 s4 XCHG
s3 16 s() XCHG
65000000 PUSHINT
s0 s3 XCHG
0 PUSHINT
s3 s1 s3 XCHG3
s0 18 s() XCHG
SWAP
$send INLINECALLDICT
s10 s11 XCHG
s9 s10 XCHG
s8 s9 XCHG
s7 s8 XCHG
s6 s7 XCHG
s4 s6 XCHG
4 ROLL
}>
$__gen_TONB_receive_comment_f7b1ab6077945b37370a1550574675180cf87df4cb047c869746812a83667d4c PROCINLINE:<{
0 PUSHINT
WHILE:<{
@ -1278,6 +1353,28 @@ PROGRAM{
$__gen_TONB_receive_BlacklistWallet INLINECALLDICT
__gen_store_TONB INLINECALLDICT
}>
DUP
1512653598 PUSHINT
EQUAL
IFJMP:<{
DROP
__gen_load_TONB INLINECALLDICT
s0 s12 XCHG
__gen_read_RequestLinker INLINECALLDICT
NIP
s11 s12 XCHG
s10 s11 XCHG
s9 s10 XCHG
s8 s9 XCHG
s7 s8 XCHG
s6 s7 XCHG
s5 s6 XCHG
s4 s5 XCHG
s3 s4 XCHG
s1 s3 s0 XCHG3
$__gen_TONB_receive_RequestLinker INLINECALLDICT
__gen_store_TONB INLINECALLDICT
}>
0 EQINT
IF:<{
HASHSU
@ -1301,6 +1398,6 @@ PROGRAM{
86142586315491086060343270784266291122 PUSHINT
}>
get_abi_ipfs PROC:<{
x{697066733a2f2f516d543361735a424a78646a6f6a52667079374c50616643443472714a6e3366517a4671655747756638724c4343} PUSHSLICE
x{697066733a2f2f516d627641466a6e434d3558544a6772677437743966504a616b68676e4865365567443158513262556d544c5452} PUSHSLICE
}>
}END>c

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

@ -170,7 +170,7 @@ SETCP0
2 GETGLOBVAR
MYADDR
ROT
51 CALLDICT
52 CALLDICT
}> CALLREF
2DUP
<{
@ -207,7 +207,7 @@ SETCP0
2 GETGLOBVAR
MYADDR
10 2 -2 PU2XC
53 CALLDICT
54 CALLDICT
2DUP
<{
0 PUSHINT
@ -1199,7 +1199,7 @@ SETCP0
2 GETGLOBVAR
MYADDR
ROT
51 CALLDICT
52 CALLDICT
}> CALLREF
2DUP
<{
@ -2077,7 +2077,7 @@ SETCP0
2 GETGLOBVAR
MYADDR
ROT
51 CALLDICT
52 CALLDICT
}> CALLREF
s0 s1 XCHG
4429 PUSHINT
@ -2500,7 +2500,7 @@ SETCP0
2 GETGLOBVAR
MYADDR
ROT
51 CALLDICT
52 CALLDICT
}> CALLREF
12 2 BLKDROP2
<{
@ -2936,7 +2936,7 @@ SETCP0
2 GETGLOBVAR
MYADDR
ROT
51 CALLDICT
52 CALLDICT
}> CALLREF
<{
0 PUSHINT
@ -3209,6 +3209,685 @@ SETCP0
c4 POP
}> PUSHCONT
IFJMP
s0 PUSH
1512653598 PUSHINT
EQUAL
<{
s0 POP
c4 PUSH
CTOS
LDREF
s0 s1 XCHG
2 SETGLOBVAR
LDGRAMS
LDMSGADDR
s0 s1 XCHG
s0 s1 XCHG
1 LDI
s0 s1 XCHG
<{
LDREF
}> PUSHCONT
<{
PUSHNULL
s0 s1 XCHG
}> PUSHCONT
IFELSE
1 LDI
LDMSGADDR
s1 PUSH
2 PLDU
0 NEQINT
<{
s0 s1 XCHG
}> PUSHCONT
<{
s1 POP
PUSHNULL
}> PUSHCONT
IFELSE
s0 s1 XCHG
LDMSGADDR
s1 PUSH
2 PLDU
0 NEQINT
<{
s0 s1 XCHG
}> PUSHCONT
<{
s1 POP
PUSHNULL
}> PUSHCONT
IFELSE
s0 s1 XCHG
LDREF
s0 s1 XCHG
CTOS
257 PUSHINT
LDI
LDMSGADDR
s1 PUSH
2 PLDU
0 NEQINT
<{
s0 s1 XCHG
}> PUSHCONT
<{
s1 POP
PUSHNULL
}> PUSHCONT
IFELSE
s0 s1 XCHG
257 PUSHINT
LDI
LDREF
s0 POP
CTOS
LDDICT
LDDICT
257 PUSHINT
LDI
3 1 BLKSWAP
s3 POP
s6 s12 XCHG
s6 s11 XCHG
s6 s10 XCHG
s6 s9 XCHG
s6 s8 XCHG
s6 s7 XCHG
ROT
1 12 BLKDROP2
s0 s12 XCHG
32 LDU
s0 s1 XCHG
1512653598 PUSHINT
EQUAL
129 THROWIFNOT
LDMSGADDR
s0 s1 XCHG
s1 POP
s11 s12 XCHG
s10 s11 XCHG
s9 s10 XCHG
s8 s9 XCHG
s7 s8 XCHG
s6 s7 XCHG
s5 s6 XCHG
s4 s5 XCHG
s3 s4 XCHG
s1 s3 s0 XCHG3
<{
1 GETGLOBVAR
4 UNTUPLE
s2 s3 XCHG
3 BLKDROP
13 1 BLKSWAP
<{
2 GETGLOBVAR
MYADDR
ROT
52 CALLDICT
}> CALLREF
2DUP
<{
0 PUSHINT
ROTREV
NEWC
0 PUSHINT
s0 s1 XCHG
2 STU
3 PUSHINT
s0 s1 XCHG
2 STU
0 PUSHINT
s0 s1 XCHG
1 STU
s1 s2 XCHG
STREF
STREF
ENDC
HASHCU
NEWC
2 PUSHINT
s0 s1 XCHG
2 STU
0 PUSHINT
s0 s1 XCHG
1 STU
s1 s2 XCHG
8 STI
256 STU
ENDC
CTOS
}> CALLREF
s0 PUSH
41207 PUSHINT
s0 s17 XCHG
SDEQ
s0 s1 XCHG
s0 s16 XCHG
s0 s1 XCHG
THROWANYIFNOT
2 GETGLOBVAR
MYADDR
s9 s-1 PUXC
s17 PUSH
s0 s1 XCHG
54 CALLDICT
2DUP
<{
0 PUSHINT
ROTREV
NEWC
0 PUSHINT
s0 s1 XCHG
2 STU
3 PUSHINT
s0 s1 XCHG
2 STU
0 PUSHINT
s0 s1 XCHG
1 STU
s1 s2 XCHG
STREF
STREF
ENDC
HASHCU
NEWC
2 PUSHINT
s0 s1 XCHG
2 STU
0 PUSHINT
s0 s1 XCHG
1 STU
s1 s2 XCHG
8 STI
256 STU
ENDC
CTOS
}> CALLREF
0 PUSHINT
20000000 PUSHINT
0 PUSHINT
s0 s14 XCHG
<{
NEWC
s0 s1 XCHG
3019699393 PUSHINT
ROT
32 STU
s0 s1 XCHG
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
ENDC
}> CALLREF
s3 PUSH
s3 s6 XCHG
s4 s1 s5 XCHG3
s3 s15 XCHG
s1 s15 s0 XCHG3
<{
NEWC
1 PUSHINT
s0 s1 XCHG
2 STI
s0 s7 XCHG2
s0 s1 XCHG
1 STI
0 PUSHINT
s0 s1 XCHG
3 STI
s0 s5 XCHG2
STSLICER
s0 s3 XCHG2
STGRAMS
0 PUSHINT
s0 s1 XCHG
105 STI
s3 PUSH
ISNULL
NOT
s5 PUSH
ISNULL
NOT
OR
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
NEWC
0 PUSHINT
s0 s1 XCHG
1 STI
0 PUSHINT
s0 s1 XCHG
1 STI
s4 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s0 s4 XCHG
s0 PUSH
ISNULL
128 THROWIF
s0 s4 XCHG2
STREF
}> PUSHCONT
<{
s4 POP
s0 s3 XCHG
0 PUSHINT
s0 s1 XCHG
1 STI
}> PUSHCONT
IFELSE
s4 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s0 s4 XCHG
s0 PUSH
ISNULL
128 THROWIF
s0 s4 XCHG2
STREF
}> PUSHCONT
<{
s4 POP
s0 s3 XCHG
0 PUSHINT
s0 s1 XCHG
1 STI
}> PUSHCONT
IFELSE
0 PUSHINT
s0 s1 XCHG
1 STI
s0 s2 XCHG
-1 PUSHINT
s0 s1 XCHG
1 STI
s0 s2 XCHG
ENDC
ROT
STREF
}> PUSHCONT
<{
s3 POP
s3 POP
s0 s1 XCHG
0 PUSHINT
s0 s1 XCHG
1 STI
}> PUSHCONT
IFELSE
s1 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s0 s1 XCHG
s0 PUSH
ISNULL
128 THROWIF
s0 s1 XCHG
STREF
}> PUSHCONT
<{
s1 POP
0 PUSHINT
s0 s1 XCHG
1 STI
}> PUSHCONT
IFELSE
ENDC
s0 s1 XCHG
SENDRAWMSG
}> CALLREF
s8 PUSH
s0 s8 XCHG
INC
0 PUSHINT
s0 PUSH
MYADDR
MYADDR
s2 PUSH
<{
<{
NEWC
ENDC
}> CALLREF
<{
CTOS
}> CALLREF
}> CALLREF
s6 PUSH
DEC
1 7 BLKSWAP
s0 s16 XCHG
<{
NEWC
8 1 BLKSWAP
<{
395134233 PUSHINT
s0 s9 XCHG2
32 STU
s1 s7 XCHG
64 STU
s0 s5 XCHG2
STGRAMS
s0 s3 XCHG2
STSLICER
s0 s1 XCHG
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
s0 s1 XCHG
STGRAMS
s0 s1 XCHG
STSLICER
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
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
ENDC
s0 s1 XCHG
STREF
}> CALLREF
ENDC
}> CALLREF
0 PUSHINT
s0 s4 XCHG
s0 s3 XCHG
s0 s16 XCHG
s0 s3 XCHG
65000000 PUSHINT
s0 s3 XCHG
0 PUSHINT
s3 s1 s3 XCHG3
s0 s18 XCHG
s0 s1 XCHG
<{
NEWC
1 PUSHINT
s0 s1 XCHG
2 STI
s0 s7 XCHG2
s0 s1 XCHG
1 STI
0 PUSHINT
s0 s1 XCHG
3 STI
s0 s5 XCHG2
STSLICER
s0 s3 XCHG2
STGRAMS
0 PUSHINT
s0 s1 XCHG
105 STI
s3 PUSH
ISNULL
NOT
s5 PUSH
ISNULL
NOT
OR
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
NEWC
0 PUSHINT
s0 s1 XCHG
1 STI
0 PUSHINT
s0 s1 XCHG
1 STI
s4 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s0 s4 XCHG
s0 PUSH
ISNULL
128 THROWIF
s0 s4 XCHG2
STREF
}> PUSHCONT
<{
s4 POP
s0 s3 XCHG
0 PUSHINT
s0 s1 XCHG
1 STI
}> PUSHCONT
IFELSE
s4 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s0 s4 XCHG
s0 PUSH
ISNULL
128 THROWIF
s0 s4 XCHG2
STREF
}> PUSHCONT
<{
s4 POP
s0 s3 XCHG
0 PUSHINT
s0 s1 XCHG
1 STI
}> PUSHCONT
IFELSE
0 PUSHINT
s0 s1 XCHG
1 STI
s0 s2 XCHG
-1 PUSHINT
s0 s1 XCHG
1 STI
s0 s2 XCHG
ENDC
ROT
STREF
}> PUSHCONT
<{
s3 POP
s3 POP
s0 s1 XCHG
0 PUSHINT
s0 s1 XCHG
1 STI
}> PUSHCONT
IFELSE
s1 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s0 s1 XCHG
s0 PUSH
ISNULL
128 THROWIF
s0 s1 XCHG
STREF
}> PUSHCONT
<{
s1 POP
0 PUSHINT
s0 s1 XCHG
1 STI
}> PUSHCONT
IFELSE
ENDC
s0 s1 XCHG
SENDRAWMSG
}> CALLREF
s10 s11 XCHG
s9 s10 XCHG
s8 s9 XCHG
s7 s8 XCHG
s6 s7 XCHG
s4 s6 XCHG
1 4 BLKSWAP
}> CALLREF
NEWC
2 GETGLOBVAR
s0 s1 XCHG
STREF
12 1 BLKSWAP
s12 s11 XCHG2
STGRAMS
s0 s9 XCHG2
STSLICER
s7 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s1 s7 XCHG
STREF
}> PUSHCONT
<{
s7 POP
0 PUSHINT
s0 s7 XCHG2
1 STI
}> PUSHCONT
IFELSE
s1 s5 XCHG
1 STI
s0 s3 XCHG2
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
s0 s1 XCHG
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
s0 s1 XCHG
NEWC
257 PUSHINT
STIX
ROT
s0 PUSH
ISNULL
<{
s0 POP
0 PUSHINT
s0 s1 XCHG
2 STU
}> PUSHCONT
<{
STSLICER
}> PUSHCONT
IFELSE
s1 s2 XCHG
257 PUSHINT
STIX
NEWC
s3 s1 s3 XCHG3
s5 s4 XCHG2
s2 s3 XCHG2
STDICT
STDICT
257 PUSHINT
STIX
ENDC
ROT
STREF
ENDC
s0 s1 XCHG
STREF
ENDC
c4 POP
}> PUSHCONT
IFJMP
0 EQINT
<{
HASHSU
@ -3574,7 +4253,7 @@ SETCP0
IFELSE
130 THROW
50:
51:
0 PUSHINT
PUSHNULL
PUSHNULL
@ -3630,7 +4309,7 @@ SETCP0
STREF
ENDC
51:
52:
s0 s2 XCHG
CTOS
LDDICT
@ -3653,9 +4332,9 @@ SETCP0
STDICT
ENDC
s0 s0 s3 XCHG3
50 CALLDICT
51 CALLDICT
52:
53:
PUSHNULL
s0 s4 XCHG
NEWC
@ -3687,7 +4366,7 @@ SETCP0
STREF
ENDC
53:
54:
s0 s3 XCHG
CTOS
LDDICT
@ -3711,7 +4390,7 @@ SETCP0
ENDC
3 1 BLKSWAP
s0 s4 XCHG
52 CALLDICT
53 CALLDICT
owner:
c4 PUSH
@ -3892,7 +4571,7 @@ SETCP0
2 GETGLOBVAR
MYADDR
ROT
51 CALLDICT
52 CALLDICT
}> CALLREF
12 2 BLKDROP2
<{
@ -4018,7 +4697,7 @@ SETCP0
2 GETGLOBVAR
MYADDR
ROT
51 CALLDICT
52 CALLDICT
}> CALLREF
8 2 BLKDROP2
s0 POP

8
sources/output/jetton_TONB.md

@ -1,9 +1,9 @@
# TACT Compilation Report
Contract: TONB
BOC Size: 3438 bytes
BOC Size: 3745 bytes
# Types
Total Types: 29
Total Types: 30
## StateInit
TLB: `_ code:^cell data:^cell = StateInit`
@ -105,6 +105,10 @@ Signature: `InitiateDistributionVote{adminIndex:int257,quorum_percent:int257,vot
TLB: `set_staking_pool#0764d148 staking_pool:Maybe address = SetStakingPool`
Signature: `SetStakingPool{staking_pool:Maybe address}`
## RequestLinker
TLB: `request_linker#5a29431e client:address = RequestLinker`
Signature: `RequestLinker{client:address}`
## WithdrawalRequests
TLB: `_ addresses:dict<int, address> amounts:dict<int, int> n_requests:int257 = WithdrawalRequests`
Signature: `WithdrawalRequests{addresses:dict<int, address>,amounts:dict<int, int>,n_requests:int257}`

2
sources/output/jetton_TONB.pkg

File diff suppressed because one or more lines are too long

51
sources/output/jetton_TONB.ts

File diff suppressed because one or more lines are too long

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.

17
sources/output/jetton_TONBWallet.code.fc

@ -191,6 +191,17 @@ cell __gen_writecell_TokenExcesses((int) v) inline_ref {
return (sc_0, (v'wallet));
}
builder __gen_write_RequestLinker(builder build_0, (slice) v) inline {
var (v'client) = v;
build_0 = store_uint(build_0, 1512653598, 32);
build_0 = __tact_store_address(build_0, v'client);
return build_0;
}
cell __gen_writecell_RequestLinker((slice) v) inline_ref {
return __gen_write_RequestLinker(begin_cell(), v).end_cell();
}
builder __gen_write_TONBWallet(builder build_0, (int, slice, slice, int, int, slice) v) inline {
var (v'balance, v'owner, v'master, v'blacklisted, v'linker, v'linker_address) = v;
build_0 = build_0.store_int(v'balance, 257);
@ -381,6 +392,10 @@ _ $__gen_get_get_wallet_data() method_id(97026) {
int $msgValue = $ctx'value;
int $tonBalanceBeforeMsg = (__tact_my_balance() - $msgValue);
int $storageFee = (10000000 - min($tonBalanceBeforeMsg, 10000000));
if (null?($self'linker)) {
$send((true, $self'master, 0, 64, __gen_writecell_RequestLinker(($self'owner)), null(), null()));
return (($self'balance, $self'owner, $self'master, $self'blacklisted, $self'linker, $self'linker_address), ());
}
$msgValue = ($msgValue - ($storageFee + 10000000));
if (($msg'forwardTonAmount > 0)) {
int $fwdFee = $__gen_Context_readForwardFee(($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw));
@ -499,5 +514,5 @@ _ supported_interfaces() method_id {
}
_ get_abi_ipfs() {
return "ipfs://QmWmwq8kiCPdxDUjPz2DSrahAGvYmYK56xg35uBGLkKibZ";
return "ipfs://QmcS4CYiu6xUPu6QvPConc7ut86RgukmohTexGBWmm3HM6";
}

34
sources/output/jetton_TONBWallet.code.fif

@ -26,6 +26,8 @@ PROGRAM{
DECLPROC __gen_write_TokenExcesses
DECLPROC __gen_writecell_TokenExcesses
DECLPROC __gen_read_BlacklistWallet
DECLPROC __gen_write_RequestLinker
DECLPROC __gen_writecell_RequestLinker
DECLPROC __gen_write_TONBWallet
DECLPROC __gen_read_TONBWallet
DECLPROC __gen_StateInit_get_code
@ -333,6 +335,19 @@ PROGRAM{
129 THROWIFNOT
__tact_load_address INLINECALLDICT
}>
__gen_write_RequestLinker PROCINLINE:<{
1512653598 PUSHINT
ROT
32 STU
SWAP
__tact_store_address INLINECALLDICT
}>
__gen_writecell_RequestLinker PROCREF:<{
NEWC
SWAP
__gen_write_RequestLinker INLINECALLDICT
ENDC
}>
__gen_write_TONBWallet PROCINLINE:<{
s5 s6 XCHG2
257 PUSHINT
@ -712,6 +727,23 @@ PROGRAM{
TUCK
MIN
SUB
s13 PUSH
ISNULL
IFJMP:<{
s2 s11 XCHG
11 BLKDROP
s6 POP
TRUE
0 PUSHINT
64 PUSHINT
s7 PUSH
__gen_writecell_RequestLinker INLINECALLDICT
s7 PUSH
3 -ROLL
PUSHNULL
PUSHNULL
$send INLINECALLDICT
}>
10000000 PUSHINT
ADD
SUB
@ -976,6 +1008,6 @@ PROGRAM{
209778528950190195973528115415557644819 PUSHINT
}>
get_abi_ipfs PROC:<{
x{697066733a2f2f516d576d7771386b694350647844556a507a324453726168414776596d594b3536786733357542474c6b4b69625a} PUSHSLICE
x{697066733a2f2f516d63533443596975367855507536517650436f6e6337757438365267756b6d6f685465784742576d6d33484d36} PUSHSLICE
}>
}END>c

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

@ -297,7 +297,7 @@ SETCP0
THROWANYIFNOT
2 GETGLOBVAR
0 9 3 XCPUXC
38 CALLDICT
40 CALLDICT
2DUP
<{
0 PUSHINT
@ -928,7 +928,7 @@ SETCP0
<{
2 GETGLOBVAR
s14 s8 PUSH2
38 CALLDICT
40 CALLDICT
s0 s1 XCHG
4429 PUSHINT
s0 s2 XCHG
@ -985,18 +985,163 @@ SETCP0
TUCK
MIN
SUB
s13 PUSH
ISNULL
<{
s2 s11 XCHG
11 BLKDROP
s6 POP
-1 PUSHINT
0 PUSHINT
64 PUSHINT
s7 PUSH
<{
NEWC
s0 s1 XCHG
1512653598 PUSHINT
ROT
32 STU
s0 s1 XCHG
STSLICER
ENDC
}> CALLREF
s7 PUSH
3 1 BLKSWAP
PUSHNULL
PUSHNULL
<{
NEWC
1 PUSHINT
s0 s1 XCHG
2 STI
s0 s7 XCHG2
s0 s1 XCHG
1 STI
0 PUSHINT
s0 s1 XCHG
3 STI
s0 s5 XCHG2
STSLICER
s0 s3 XCHG2
STGRAMS
0 PUSHINT
s0 s1 XCHG
105 STI
s3 PUSH
ISNULL
NOT
s5 PUSH
ISNULL
NOT
OR
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
NEWC
0 PUSHINT
s0 s1 XCHG
1 STI
0 PUSHINT
s0 s1 XCHG
1 STI
s4 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s0 s4 XCHG
s0 PUSH
ISNULL
128 THROWIF
s0 s4 XCHG2
STREF
}> PUSHCONT
<{
s4 POP
s0 s3 XCHG
0 PUSHINT
s0 s1 XCHG
1 STI
}> PUSHCONT
IFELSE
s4 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s0 s4 XCHG
s0 PUSH
ISNULL
128 THROWIF
s0 s4 XCHG2
STREF
}> PUSHCONT
<{
s4 POP
s0 s3 XCHG
0 PUSHINT
s0 s1 XCHG
1 STI
}> PUSHCONT
IFELSE
0 PUSHINT
s0 s1 XCHG
1 STI
s0 s2 XCHG
-1 PUSHINT
s0 s1 XCHG
1 STI
s0 s2 XCHG
ENDC
ROT
STREF
}> PUSHCONT
<{
s3 POP
s3 POP
s0 s1 XCHG
0 PUSHINT
s0 s1 XCHG
1 STI
}> PUSHCONT
IFELSE
s1 PUSH
ISNULL
NOT
<{
-1 PUSHINT
s0 s1 XCHG
1 STI
s0 s1 XCHG
s0 PUSH
ISNULL
128 THROWIF
s0 s1 XCHG
STREF
}> PUSHCONT
<{
s1 POP
0 PUSHINT
s0 s1 XCHG
1 STI
}> PUSHCONT
IFELSE
ENDC
s0 s1 XCHG
SENDRAWMSG
}> CALLREF
}> PUSHCONT
IFJMP
10000000 PUSHINT
ADD
SUB
s6 PUSH
0 GTINT
<{
s0 s7 XCHG
s0 s16 XCHG
s0 s7 XCHG
s8 s9 XCHG2
8 BLKDROP
}> PUSHCONT
<{
s2 s3 XCHG
s0 s16 XCHG
@ -1172,7 +1317,15 @@ SETCP0
SENDRAWMSG
}> CALLREF
s0 s8 XCHG2
}> IFREFELSE
}> PUSHCONT
<{
s0 s7 XCHG
s0 s16 XCHG
s0 s7 XCHG
s8 s9 XCHG2
8 BLKDROP
}> PUSHCONT
IFELSE
s8 PUSH
ISNULL
NOT
@ -2018,7 +2171,7 @@ SETCP0
s0 POP
130 THROW
37:
39:
0 PUSHINT
PUSHNULL
PUSHNULL
@ -2074,7 +2227,7 @@ SETCP0
STREF
ENDC
38:
40:
s0 s2 XCHG
CTOS
LDDICT
@ -2097,7 +2250,7 @@ SETCP0
STDICT
ENDC
s0 s0 s3 XCHG3
37 CALLDICT
39 CALLDICT
get_wallet_data:
c4 PUSH
@ -2150,7 +2303,7 @@ SETCP0
3 BLKDROP
2 GETGLOBVAR
s1 s2 PUSH2
38 CALLDICT
40 CALLDICT
s0 POP
}> CALLREF

8
sources/output/jetton_TONBWallet.md

@ -1,9 +1,9 @@
# TACT Compilation Report
Contract: TONBWallet
BOC Size: 2067 bytes
BOC Size: 2111 bytes
# Types
Total Types: 29
Total Types: 30
## StateInit
TLB: `_ code:^cell data:^cell = StateInit`
@ -105,6 +105,10 @@ Signature: `InitiateDistributionVote{adminIndex:int257,quorum_percent:int257,vot
TLB: `set_staking_pool#0764d148 staking_pool:Maybe address = SetStakingPool`
Signature: `SetStakingPool{staking_pool:Maybe address}`
## RequestLinker
TLB: `request_linker#5a29431e client:address = RequestLinker`
Signature: `RequestLinker{client:address}`
## WithdrawalRequests
TLB: `_ addresses:dict<int, address> amounts:dict<int, int> n_requests:int257 = WithdrawalRequests`
Signature: `WithdrawalRequests{addresses:dict<int, address>,amounts:dict<int, int>,n_requests:int257}`

2
sources/output/jetton_TONBWallet.pkg

File diff suppressed because one or more lines are too long

46
sources/output/jetton_TONBWallet.ts

@ -1304,6 +1304,47 @@ function dictValueParserSetStakingPool(): DictionaryValue<SetStakingPool> {
}
}
}
export type RequestLinker = {
$$type: 'RequestLinker';
client: Address;
}
export function storeRequestLinker(src: RequestLinker) {
return (builder: Builder) => {
let b_0 = builder;
b_0.storeUint(1512653598, 32);
b_0.storeAddress(src.client);
};
}
export function loadRequestLinker(slice: Slice) {
let sc_0 = slice;
if (sc_0.loadUint(32) !== 1512653598) { throw Error('Invalid prefix'); }
let _client = sc_0.loadAddress();
return { $$type: 'RequestLinker' as const, client: _client };
}
function loadTupleRequestLinker(source: TupleReader) {
let _client = source.readAddress();
return { $$type: 'RequestLinker' as const, client: _client };
}
function storeTupleRequestLinker(source: RequestLinker) {
let builder = new TupleBuilder();
builder.writeAddress(source.client);
return builder.build();
}
function dictValueParserRequestLinker(): DictionaryValue<RequestLinker> {
return {
serialize: (src, buidler) => {
buidler.storeRef(beginCell().store(storeRequestLinker(src)).endCell());
},
parse: (src) => {
return loadRequestLinker(src.loadRef().beginParse());
}
}
}
export type WithdrawalRequests = {
$$type: 'WithdrawalRequests';
addresses: Dictionary<bigint, Address>;
@ -1478,8 +1519,8 @@ function dictValueParserWithdraw(): DictionaryValue<Withdraw> {
}
async function TONBWallet_init(master: Address, owner: Address) {
const __init = 'te6ccgEBBgEAZgABFP8A9K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jEQJhAlECQQI2wWBtMfAYIKnIOWuvLggfpAATEQVhBFEDRBMB0ACDDywIIAJGwx+gAxcdch+gAx+gAwpwOrAACAyPhCAcxVUFBWgQEBzwBQA88WAc8WygDIIm6zmn8BygASgQEBzwCVMnBYygDiWCBulTBwAcsBks8W4skBzMntVALeMDL4QW8kECNfA4ERTVMUxwVRJMcFErHy9H9wf1MRgEBUOpnbPCcDBFCqbW3bPALI+EIBzFVQUFaBAQHPAFADzxYBzxbKAMgibrOafwHKABKBAQHPAJUycFjKAOJYIG6VMHABywGSzxbiyQHMye1UHh8ASMhVMIIQe92X3lAFyx8Tyz8B+gIBzxYBIG6VMHABywGSzxbiyQH2yHEBygFQBwHKAHABygJQBc8WUAP6AnABymgjbrMlbrOxjkx/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMlzMzAXABygDiIW6zIAAwnH8BygABIG7y0IABzJUxcAHKAOLJAfsAAIX7g2trgDZGYDAqqQKCtAgIDngCgB54sA54tlAGQRN1nNP4DlAAlAgIDngEqZOCxlAHEsEDdKmDgA5YDJZ4txZIDmZMAE3YFoegIYNoDAsEIAwAh6B7fQ+XBDgMCwQhEBQAh6C+R6AGSgAfgTwBh7/YF2omhqAPwxQICA64B9IACA/SAAgOkAagDoaQAAysCAgOuASTaA8X0gEOuFgOGASIDJGLbxGIgTCBKIEggRtgttnkJQBxvd6ME4LnYerpZXPY9CdhzrJUKNs0E4TusalpWyPlmRadeW/vixHME4TujwAfLZsB5P5B1ZLNZRCcABJfA/hCUxLwKDA=';
const __system = 'te6cckECKAEACD0AAQHAAQEFoMEJAgEU/wD0pBP0vPLICwMCAWIIBAIBIAYFAHG93owTgudh6ullc9j0J2HOslQo2zQThO6xqWlbI+WZFp15b++LEcwThO6PAB8tmwHk/kHVks1lEJwBh7/YF2omhqAPwxQICA64B9IACA/SAAgOkAagDoaQAAysCAgOuASTaA8X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SzxbiAfoCAc8WyCJus5p/AcoAEoEBAc8AlTJwWMoA4lggbpUwcAHLAZLPFuLJAcwASnBZyHABywFzAcsBcAHLABLMzMn5AMhyAcsBcAHLABLKB8v/ydAAJGwx+gAxcdch+gAx+gAwpwOrAABs0x8BghAPin6luvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIB0gABkdSSbQHi+gBRZhYVFEMwAdIw7UTQ1AH4YoEBAdcA+kABAfpAAQHSANQB0NIAAZWBAQHXAJJtAeL6QCHXCwHDAJEBkjFt4jEQJhAlECQQI2wWVQWAINch0x/TPzH6ADCBNVIighAXjUUZugOCEHvdl966E7ES8vQWoAUnAIDI+EIBzFVQUFaBAQHPAFADzxYBzxbKAMgibrOafwHKABKBAQHPAJUycFjKAOJYIG6VMHABywGSzxbiyQHMye1UqaXHQg==';
let systemCell = Cell.fromBase64(__system);
let builder = new TupleBuilder();
builder.writeCell(systemCell);
@ -1533,6 +1574,7 @@ const TONBWallet_errors: { [key: number]: { message: string } } = {
13650: { message: `Invalid bounced message` },
16059: { message: `Invalid value` },
32366: { message: `not enough money for deposit` },
41207: { message: `invalid sender` },
44816: { message: `Wallet is blacklisted` },
62972: { message: `Invalid balance` },
}

38
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,
"from": "kQAI-3FJVc_ywSuY4vq0bYrzR7S4Och4y7bTU_i5yLOB3A6P",
"to": "kQCgC9v8VlLgcAqjnYBphuag9zsz4uNqZ5Ljp5owpkHL5t9u",
"to": "kQBlV9n2WlhBQZuY-iA0VWSTOykYvzU61JiygM950JnqGI58",
"type": "internal",
"value": 1200000000n,
},
"type": "received",
},
{
"gasUsed": 32790n,
"gasUsed": 32815n,
"type": "processed",
},
{
@ -31,8 +31,8 @@ exports[`jetton should deploy and deposit the wallet with the correct sum of mon
"type": "cell",
},
"bounce": false,
"from": "kQCgC9v8VlLgcAqjnYBphuag9zsz4uNqZ5Ljp5owpkHL5t9u",
"to": "kQCb-hsQ8GpnGdMASvglnuSNAH_3BEqkXicdTRUxOS-Tj0bm",
"from": "kQBlV9n2WlhBQZuY-iA0VWSTOykYvzU61JiygM950JnqGI58",
"to": "kQDCv0UFsmlWdo2QSZ_wHaKo10d0x-JIbuOdTa5x6p8rqv-p",
"type": "internal",
"value": 11365000n,
},
@ -43,15 +43,15 @@ exports[`jetton should deploy and deposit the wallet with the correct sum of mon
"messages": [
{
"body": {
"cell": "x{178D4519000000000000000043B9ACA008014017B7F8ACA5C0E015473B00D30DCD41EE7667C5C6D4CF25C74F34614C8397CD00023EDC525573FCB04AE638BEAD1B62BCD1ED2E0E721E32EDB4D4FE2E722CE07702_}
x{80000000000000000000000000000000000000000000000000000000000000002004DFD0D887835338CE980257C12CF7246803FFB8225522F138EA68A989C97C9C7C_}",
"cell": "x{178D4519000000000000000043B9ACA00800CAAFB3ECB4B082833731F44068AAC9267652317E6A75A93165019EF3A133D43100023EDC525573FCB04AE638BEAD1B62BCD1ED2E0E721E32EDB4D4FE2E722CE07702_}
x{8000000000000000000000000000000000000000000000000000000000000000200615FA282D934AB3B46C824CFF80ED1546BA3BA63F1243771CEA6D738F54F95D54_}",
"type": "cell",
},
"bounce": false,
"from": "kQCgC9v8VlLgcAqjnYBphuag9zsz4uNqZ5Ljp5owpkHL5t9u",
"to": "kQCz-T_vzRzdycSvptielZ5gy5UMUE4VmKnSM5wGE11g0n4O",
"from": "kQBlV9n2WlhBQZuY-iA0VWSTOykYvzU61JiygM950JnqGI58",
"to": "kQD36XkQiZgovUNdKm0YESkF9ukWFb4nZ0bhfjR1rWRGnfuH",
"type": "internal",
"value": 42141000n,
"value": 41723000n,
},
],
"type": "sent",
@ -69,14 +69,14 @@ exports[`jetton should work correctly with the staking 1`] = `
},
"bounce": true,
"from": "kQAI-3FJVc_ywSuY4vq0bYrzR7S4Och4y7bTU_i5yLOB3A6P",
"to": "kQCEp9Xa_tc20MxUf4bEIQaq-lmyW3q_0g6UPYenF9LQKJRX",
"to": "kQDPsaN8zrq_pbfsttObqfZmkwendx9IOF5giFl71SafPE45",
"type": "internal",
"value": 100200000000n,
},
"type": "received",
},
{
"gasUsed": 36073n,
"gasUsed": 36098n,
"type": "processed",
},
{
@ -87,8 +87,8 @@ exports[`jetton should work correctly with the staking 1`] = `
"type": "cell",
},
"bounce": false,
"from": "kQCEp9Xa_tc20MxUf4bEIQaq-lmyW3q_0g6UPYenF9LQKJRX",
"to": "kQDSpq8vAolKxm_t83PJHfSlhQZpwox3pIVtdk63PPZrknwN",
"from": "kQDPsaN8zrq_pbfsttObqfZmkwendx9IOF5giFl71SafPE45",
"to": "kQCm0JH-Bq_lKD51Ytp7Dz6nuP-_wlohUMWHff55zxHui-f-",
"type": "internal",
"value": 11365000n,
},
@ -99,15 +99,15 @@ exports[`jetton should work correctly with the staking 1`] = `
"messages": [
{
"body": {
"cell": "x{178D451900000000000000005174876E800801094FABB5FDAE6DA198A8FF0D88420D55F4B364B6F57FA41D287B0F4E2FA5A05100023EDC525573FCB04AE638BEAD1B62BCD1ED2E0E721E32EDB4D4FE2E722CE07702_}
x{8000000000000000000000000000000000000000000000000000000000000000200695357978144A56337F6F9B9E48EFA52C28334E1463BD242B6BB275B9E7B35C94_}",
"cell": "x{178D451900000000000000005174876E8008019F6346F99D757F4B6FD96DA73753ECCD260F4EEE3E9070BCC110B2F7AA4D3E7900023EDC525573FCB04AE638BEAD1B62BCD1ED2E0E721E32EDB4D4FE2E722CE07702_}
x{8000000000000000000000000000000000000000000000000000000000000000200536848FF0357F2941F3AB16D3D879F53DC7FDFE12D10A862C3BEFF3CE788F745C_}",
"type": "cell",
},
"bounce": false,
"from": "kQCEp9Xa_tc20MxUf4bEIQaq-lmyW3q_0g6UPYenF9LQKJRX",
"to": "kQCrkVOqKyuE6nGTEpCuoMa5bd5z7FlJRMuvxFa4BbXmckiO",
"from": "kQDPsaN8zrq_pbfsttObqfZmkwendx9IOF5giFl71SafPE45",
"to": "kQArzurjMe3EIlNNuEVtY2MNex06iyKlvOa1oiBoepw42npF",
"type": "internal",
"value": 42133000n,
"value": 41715000n,
},
],
"type": "sent",
@ -120,7 +120,7 @@ exports[`jetton should work correctly with the staking 1`] = `
"type": "cell",
},
"bounce": true,
"from": "kQCEp9Xa_tc20MxUf4bEIQaq-lmyW3q_0g6UPYenF9LQKJRX",
"from": "kQDPsaN8zrq_pbfsttObqfZmkwendx9IOF5giFl71SafPE45",
"to": "kQAQUSIm_zYC9VxtmVfOeKhmjxmGLXoU3PR_y7RQR9lxXtJM",
"type": "internal",
"value": 99491421000n,

14
sources/wallet.tact

@ -89,7 +89,6 @@ contract TONBWallet {
self.linker = msg.setLinker;
self.linker_address = msg.setLinkerAddress;
}
// todo: request a linker otherwise
}
if (ctx.sender != self.master/* && ctx.sender != self.linker_address*/) {
let is_from_linker: Bool = false;
@ -112,6 +111,19 @@ contract TONBWallet {
let msgValue: Int = ctx.value;
let tonBalanceBeforeMsg: Int = myBalance() - msgValue;
let storageFee: Int = self.minTonsForStorage - min(tonBalanceBeforeMsg, self.minTonsForStorage);
if (self.linker == null) {
// request a linker
send(SendParameters{
to: self.master,
value: 0,
mode: SendRemainingValue,
body: RequestLinker {
client: self.owner
}.toCell()
});
return;
}
msgValue = msgValue - (storageFee + self.gasConsumption);
// Forward ton

Loading…
Cancel
Save