Flex
Flex exchange system
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
FlexClient Class Referencefinal

FlexClient contract. Implements IFlexClient. More...

Inheritance diagram for FlexClient:
Inheritance graph
[legend]
Collaboration diagram for FlexClient:
Collaboration graph
[legend]

Classes

struct  error_code
 

Public Types

using replay_protection_t = replay_attack_protection::timestamp< TIMESTAMP_DELAY >
 
using replay_protection_t = replay_attack_protection::timestamp< TIMESTAMP_DELAY >
 

Public Member Functions

 __attribute__ ((noinline, noreturn)) static void onCodeUpgrade(cell state)
 
resumable< void > upgrade (uint128 request_evers, address user_data_cfg)
 
void cancelXchgOrder (bool sell, uint128 price_num, uint128 value, cell salted_price_code, opt< uint256 > user_id, opt< uint256 > order_id)
 
void transfer (address dest, uint128 value, bool bounce)
 
void transferTokens (address src, Tip3Creds dst, uint128 tokens, uint128 evers, uint128 keep_evers)
 
address deployPriceXchg (bool sell, bool immediate_client, bool post_order, uint128 price_num, uint128 amount, uint128 lend_amount, uint32 lend_finish_time, uint128 evers, cell unsalted_price_code, cell price_salt, address my_tip3_addr, uint256 user_id, uint256 order_id)
 
address deployEmptyFlexWallet (uint256 pubkey, uint128 evers_to_wallet, Tip3Config tip3cfg, uint256 trader, cell flex_wallet_code)
 
void deployIndex (uint256 user_id, uint256 lend_pubkey, string name, uint128 evers_all, uint128 evers_to_auth_idx, uint128 refill_wallet, uint128 min_refill)
 
void reBindWallets (uint256 user_id, bool set_binding, opt< bind_info > binding, bool set_trader, opt< uint256 > trader, dict_array< address > wallets, uint128 evers_relend_call, uint128 evers_each_wallet_call, uint128 evers_to_remove, uint128 evers_to_auth_idx)
 
void destroyIndex (uint256 user_id, uint128 evers)
 
void burnWallet (uint128 evers_value, uint256 out_pubkey, address_opt out_owner, address my_tip3_addr, opt< cell > notify)
 
void burnThemAll (uint128 burn_ev, dict_array< BurnInfo > burns)
 
void continueBurnThemAll ()
 
void cancelThemAll (uint128 cancel_ev, dict_array< address > prices)
 
void continueCancelThemAll ()
 
void unwrapWallet (uint128 evers_value, uint256 out_pubkey, address_opt out_owner, address my_tip3_addr, uint128 tokens, opt< cell > notify)
 
void bindWallet (uint128 evers, address my_tip3_addr, bool set_binding, opt< bind_info > binding, bool set_trader, opt< uint256 > trader)
 
resumable< void > onTip3Transfer ([[maybe_unused]] uint128 balance, [[maybe_unused]] uint128 new_tokens, uint128 evers_balance, Tip3Config tip3cfg, opt< Tip3Creds > sender, Tip3Creds receiver, [[maybe_unused]] cell payload, [[maybe_unused]] address answer_addr)
 
cell getPayloadForDeployInternalWallet (uint256 owner_pubkey, address_opt owner_addr, uint128 evers, uint128 keep_evers)
 
cell getPayloadForEverReTransferArgs (uint128 wallet_deploy_evers, uint128 wallet_keep_evers)
 
address getPriceXchgAddress (uint128 price_num, cell salted_price_code)
 
address getUserIdIndex (uint256 user_id)
 
FlexClientDetails getDetails ()
 
 __attribute__ ((noinline, noreturn)) static void onCodeUpgrade(cell state)
 
resumable< void > upgrade (uint128 request_evers, address user_data_cfg)
 
void cancelXchgOrder (bool sell, uint128 price_num, uint128 value, cell salted_price_code, opt< uint256 > user_id, opt< uint256 > order_id)
 
void transfer (address dest, uint128 value, bool bounce)
 
void transferTokens (address src, Tip3Creds dst, uint128 tokens, uint128 evers, uint128 keep_evers)
 
address deployPriceXchg (bool sell, bool immediate_client, bool post_order, uint128 price_num, uint128 amount, uint128 lend_amount, uint32 lend_finish_time, uint128 evers, cell unsalted_price_code, cell price_salt, address my_tip3_addr, uint256 user_id, uint256 order_id)
 
address deployEmptyFlexWallet (uint256 pubkey, uint128 evers_to_wallet, Tip3Config tip3cfg, uint256 trader, cell flex_wallet_code)
 
void deployIndex (uint256 user_id, uint256 lend_pubkey, string name, uint128 evers_all, uint128 evers_to_auth_idx, uint128 refill_wallet, uint128 min_refill)
 
void reBindWallets (uint256 user_id, bool set_binding, opt< bind_info > binding, bool set_trader, opt< uint256 > trader, dict_array< address > wallets, uint128 evers_relend_call, uint128 evers_each_wallet_call, uint128 evers_to_remove, uint128 evers_to_auth_idx)
 
void destroyIndex (uint256 user_id, uint128 evers)
 
void burnWallet (uint128 evers_value, uint256 out_pubkey, address_opt out_owner, address my_tip3_addr, opt< cell > notify)
 
void burnThemAll (uint128 burn_ev, dict_array< BurnInfo > burns)
 
void continueBurnThemAll ()
 
void unwrapWallet (uint128 evers_value, uint256 out_pubkey, address_opt out_owner, address my_tip3_addr, uint128 tokens, opt< cell > notify)
 
void bindWallet (uint128 evers, address my_tip3_addr, bool set_binding, opt< bind_info > binding, bool set_trader, opt< uint256 > trader)
 
resumable< void > onTip3Transfer ([[maybe_unused]] uint128 balance, [[maybe_unused]] uint128 new_tokens, uint128 evers_balance, Tip3Config tip3cfg, opt< Tip3Creds > sender, Tip3Creds receiver, [[maybe_unused]] cell payload, [[maybe_unused]] address answer_addr)
 
cell getPayloadForDeployInternalWallet (uint256 owner_pubkey, address_opt owner_addr, uint128 evers, uint128 keep_evers)
 
cell getPayloadForEverReTransferArgs (uint128 wallet_deploy_evers, uint128 wallet_keep_evers)
 
address getPriceXchgAddress (uint128 price_num, cell salted_price_code)
 
address getUserIdIndex (uint256 user_id)
 
FlexClientDetails getDetails ()
 
uint32 getTestValue ()
 

Static Public Member Functions

static __attribute__ ((noinline)) std
 
static __attribute__ ((noinline)) std
 
static int _fallback ([[maybe_unused]] cell msg, [[maybe_unused]] slice msg_body)
 
static int _receive ([[maybe_unused]] cell msg, [[maybe_unused]] slice msg_body)
 
static __attribute__ ((noinline)) std
 
static int _fallback ([[maybe_unused]] cell msg, [[maybe_unused]] slice msg_body)
 
static int _receive ([[maybe_unused]] cell msg, [[maybe_unused]] slice msg_body)
 

Additional Inherited Members

- Public Attributes inherited from DFlexClient1
uint256 owner_
 Owner's public key.
 
FlexVersion triplet_
 Version triplet.
 
FlexVersion ex_triplet_
 Ex-version triplet (initialized during code upgrade)
 
optcell auth_index_code_
 AuthIndex code.
 
optcell user_id_index_code_
 UserIdIndex code.
 
opt< bind_infobinding_
 Binding info for exchange.
 
bool_t packet_burning_
 When burnThemAll was postponed into continueBurnThemAll call.
 
uint128 burn_ev_
 Processing evers for each wallet burn call.
 
dict_array< BurnInfoburns_
 Array of burn parameters for each wallet.
 
bool_t packet_canceling_
 When cancelThemAll was postponed into continueCancelThemAll call.
 
uint128 cancel_ev_
 Processing evers for each wallet cancelOrder call.
 
dict_array< address > prices_
 Array of PriceXchg addresses.
 

Detailed Description

FlexClient contract. Implements IFlexClient.

Member Function Documentation

◆ getPayloadForEverReTransferArgs() [1/2]

cell getPayloadForEverReTransferArgs ( uint128  wallet_deploy_evers,
uint128  wallet_keep_evers 
)
inline
Parameters
wallet_deploy_eversEvers to be sent to the deployable wallet.
wallet_keep_eversEvers to be kept in the deployable wallet.

◆ getPayloadForEverReTransferArgs() [2/2]

cell getPayloadForEverReTransferArgs ( uint128  wallet_deploy_evers,
uint128  wallet_keep_evers 
)
inline
Parameters
wallet_deploy_eversEvers to be sent to the deployable wallet.
wallet_keep_eversEvers to be kept in the deployable wallet.

◆ getPriceXchgAddress() [1/2]

address getPriceXchgAddress ( uint128  price_num,
cell  salted_price_code 
)
inline
Parameters
price_numPrice numerator for rational price value
salted_price_codeCode of PriceXchg contract (salted!).

◆ getPriceXchgAddress() [2/2]

address getPriceXchgAddress ( uint128  price_num,
cell  salted_price_code 
)
inline
Parameters
price_numPrice numerator for rational price value
salted_price_codeCode of PriceXchg contract (salted!).

◆ onTip3Transfer() [1/2]

resumable<void> onTip3Transfer ( [[maybe_unused] ] uint128  balance,
[[maybe_unused] ] uint128  new_tokens,
uint128  evers_balance,
Tip3Config  tip3cfg,
opt< Tip3Creds >  sender,
Tip3Creds  receiver,
[[maybe_unused] ] cell  payload,
[[maybe_unused] ] address  answer_addr 
)
inline

Implementation of ITONTokenWalletNotify::onTip3Transfer. Notification from tip3 wallet to its owner contract about received tokens transfer.

◆ onTip3Transfer() [2/2]

resumable<void> onTip3Transfer ( [[maybe_unused] ] uint128  balance,
[[maybe_unused] ] uint128  new_tokens,
uint128  evers_balance,
Tip3Config  tip3cfg,
opt< Tip3Creds >  sender,
Tip3Creds  receiver,
[[maybe_unused] ] cell  payload,
[[maybe_unused] ] address  answer_addr 
)
inline

Implementation of ITONTokenWalletNotify::onTip3Transfer. Notification from tip3 wallet to its owner contract about received tokens transfer.


The documentation for this class was generated from the following files: