Flex
Flex exchange system
Classes | Typedefs | Functions
PriceXchg.hpp File Reference

PriceXchg contract interfaces and data-structs PriceXchg - contract to enqueue and process tip3-tip3 exchange orders at a specific price. More...

#include <tvm/schema/message.hpp>
#include <tvm/replay_attack_protection/timestamp.hpp>
#include <tvm/smart_switcher.hpp>
#include <tvm/small_dict_map.hpp>
#include <tvm/contract_handle.hpp>
#include <tvm/big_queue.hpp>
#include <tvm/string.hpp>
#include <tvm/numeric_limits.hpp>
#include <tvm/suffixes.hpp>
#include "Flex.hpp"
#include "PriceCommon.hpp"
#include "FlexWallet.hpp"
#include "FlexTransferPayloadArgs.hpp"
#include "FlexLendPayloadArgs.hpp"
#include "PriceXchgSalt.hpp"
#include "RationalValue.hpp"
Include dependency graph for PriceXchg.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  OrderInfoXchg
 tip3-tip3 exchange order info More...
 
struct  PriceXchgDetails
 PriceXchg contract details (for getter) More...
 
interface  IPriceXchg
 PriceXchg contract interface. More...
 
struct  DPriceXchg
 PriceXchg persistent data struct. More...
 
interface  EPriceXchg
 PriceXchg events interface. More...
 
struct  preparer< IPriceXchg, DPriceXchg >
 Prepare StateInit struct and std address to deploy PriceXchg contract. More...
 

Typedefs

using ITONTokenWalletPtr = handle< ITONTokenWallet >
 
using OrderInfoXchgWithIdx = std::pair< unsigned, OrderInfoXchg >
 
using IPriceXchgPtr = handle< IPriceXchg >
 

Functions

__always_inline bool is_active_time (uint32 order_finish_time)
 
__always_inline std::optional< uint128 > minor_cost (uint128 amount, price_t price)
 

Detailed Description

PriceXchg contract interfaces and data-structs PriceXchg - contract to enqueue and process tip3-tip3 exchange orders at a specific price.

Author
Andrew Zhogin

Function Documentation

◆ minor_cost()

__always_inline std::optional<uint128> tvm::minor_cost ( uint128  amount,
price_t  price 
)

Calculate cost (amount of minor tip3 tokens to match the "amount" of major tip3 tokens). Zero or 128-bit overflowing value means error.