diff --git a/types.hpp b/types.hpp index 357a8e5..b15fd97 100644 --- a/types.hpp +++ b/types.hpp @@ -1,4 +1,5 @@ #include "utils.hpp" +#include #define EOS_SYMBOL S(4, EOS) #define DICE_SYMBOL S(4, BOCAI) @@ -7,8 +8,11 @@ #define DEV N(eosbocaidevv) #define PRIZEPOOL N(eosbocai1111) #define DICESUPPLY 88000000000000 +#define FOMOTIME 24 * 60 * 60 typedef uint32_t eostime; +using eosio::extended_asset; +using eosio::singleton; // @abi table bets i64 struct st_bet @@ -16,11 +20,27 @@ struct st_bet uint64_t id; account_name player; account_name referrer; - asset amount; + extended_asset amount; uint8_t roll_under; uint64_t created_at; uint64_t primary_key() const { return id; } }; +// @abi table tokens i64 +struct st_tokens +{ + account_name contract; // 合约账号 + symbol_type symbol; // 代币名称 + uint64_t minAmout; //最小允许投注的值 + uint64_t primary_key() const { return contract + symbol; } +}; +typedef multi_index tb_tokens; + +// @abi table users1 i64 +struct st_user1 +{ + asset amount = asset(0, EOS_SYMBOL); + uint32_t count = 0; +}; // @abi table users i64 struct st_user @@ -30,6 +50,7 @@ struct st_user uint32_t count; uint64_t primary_key() const { return owner; } }; +typedef singleton tb_uesrs1; struct st_result { @@ -60,7 +81,9 @@ struct st_global asset fomopool; }; -typedef multi_index tb_uesrs; +// typedef multi_index tb_uesrs; typedef multi_index tb_bets; +typedef multi_index tb_uesrs; + typedef singleton tb_fund_pool; typedef singleton tb_global;