|
|
|
@ -212,6 +212,23 @@ cell __gen_writecell_BlacklistWallet((slice) v) inline_ref {
|
|
|
|
|
return (sc_0, (v'client)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
builder __gen_write_Unstake(builder build_0, (int) v) inline { |
|
|
|
|
var (v'amount) = v; |
|
|
|
|
build_0 = store_uint(build_0, 3125946401, 32); |
|
|
|
|
build_0 = build_0.store_int(v'amount, 257); |
|
|
|
|
return build_0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
cell __gen_writecell_Unstake((int) v) inline_ref { |
|
|
|
|
return __gen_write_Unstake(begin_cell(), v).end_cell(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
(slice, ((int))) __gen_read_Unstake(slice sc_0) inline { |
|
|
|
|
throw_unless(129, sc_0~load_uint(32) == 3125946401); |
|
|
|
|
var v'amount = sc_0~load_int(257); |
|
|
|
|
return (sc_0, (v'amount)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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); |
|
|
|
@ -589,7 +606,7 @@ _ $__gen_get_owner() method_id(83229) {
|
|
|
|
|
int $available = ((__tact_my_balance() - 500000000) - 150000000); |
|
|
|
|
if (($available < $msg'amount)) { |
|
|
|
|
int $diff = ($msg'amount - $available); |
|
|
|
|
$send((false, $msg'owner, (__tact_my_balance() - 500000000), 0, null(), null(), null())); |
|
|
|
|
$send((false, $msg'owner, ((__tact_my_balance() - 500000000) - 150000000), 0, null(), null(), null())); |
|
|
|
|
cell $body = __gen_writecell_TokenTransferInternal((0, $diff, my_address(), my_address(), 0, $emptySlice(), null(), null())); |
|
|
|
|
slice $walletAddress = $__gen_TONB_get_wallet_address(($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)), $msg'owner); |
|
|
|
|
$send((false, $walletAddress, 0, 64, $body, null(), null())); |
|
|
|
@ -636,10 +653,30 @@ _ $__gen_get_owner() method_id(83229) {
|
|
|
|
|
$send((false, $addr, 80000000, 0, __gen_writecell_TokenBurn((0, __tact_not_null(__tact_dict_get_int_int($self'withdrawal_requests'amounts, 257, $i, 257)), $addr, my_address())), null(), null())); |
|
|
|
|
$i = ($i + 1); |
|
|
|
|
} |
|
|
|
|
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); |
|
|
|
|
int $val = $ctx'value; |
|
|
|
|
$self'in_the_pool = ($self'in_the_pool - $val); |
|
|
|
|
if (($self'in_the_pool < 0)) { |
|
|
|
|
int $value = (- $self'in_the_pool); |
|
|
|
|
$send((true, $self'owner, $value, 0, __gen_writecell_Unstake(($value)), null(), null())); |
|
|
|
|
$self'in_the_pool = 0; |
|
|
|
|
} |
|
|
|
|
($self'withdrawal_requests'addresses, $self'withdrawal_requests'amounts, $self'withdrawal_requests'n_requests) = (null(), null(), 0); |
|
|
|
|
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_Unstake((int, slice, cell, int, slice, slice, int, slice, int, (cell, cell, int)) $self, (int) $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'amount) = $msg; |
|
|
|
|
if (null?($self'staking_pool)) { |
|
|
|
|
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)), ()); |
|
|
|
|
} |
|
|
|
|
var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); |
|
|
|
|
throw_unless(61265, __tact_address_eq($ctx'sender, $self'owner)); |
|
|
|
|
$send($stakingWithdrawMessage($msg'amount, __tact_not_null($self'staking_pool))); |
|
|
|
|
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)), ()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
() recv_internal(int msg_value, cell in_msg_cell, slice in_msg) impure { |
|
|
|
|
|
|
|
|
@ -730,6 +767,15 @@ _ $__gen_get_owner() method_id(83229) {
|
|
|
|
|
return (); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
;; Receive Unstake message |
|
|
|
|
if (op == 3125946401) { |
|
|
|
|
var self = __gen_load_TONB(); |
|
|
|
|
var msg = in_msg~__gen_read_Unstake(); |
|
|
|
|
self~$__gen_TONB_receive_Unstake(msg); |
|
|
|
|
__gen_store_TONB(self); |
|
|
|
|
return (); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
;; Text Receivers |
|
|
|
|
if (op == 0) { |
|
|
|
|
var text_op = slice_hash(in_msg); |
|
|
|
@ -756,5 +802,5 @@ _ supported_interfaces() method_id {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_ get_abi_ipfs() { |
|
|
|
|
return "ipfs://QmbvAFjnCM5XTJgrgt7t9fPJakhgnHe6UgD1XQ2bUmTLTR"; |
|
|
|
|
return "ipfs://QmZei32YRHJRnTCv7qY3WpT16zADJCXJ6BC996CpHaiRqG"; |
|
|
|
|
} |