-
Notifications
You must be signed in to change notification settings - Fork 0
/
burn.hpp
88 lines (74 loc) · 2.79 KB
/
burn.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#include <eosio/eosio.hpp>
#include <eosio/asset.hpp>
#include <eosio/print.hpp>
#include <eosio/system.hpp>
using namespace std;
using namespace eosio;
class [[eosio::contract("burncontrak")]] burncontrak:public eosio::contract
{
private:
const symbol hub_symbol;
const symbol dop_symbol;
const symbol dmd_symbol;
struct [[eosio::table]] burnerdata
{
name key;
uint32_t player_limit;
uint64_t primary_key()const { return key.value; }
};
typedef eosio::multi_index< "totaltable"_n, burnerdata > totaltable;
void inline_burnhub(eosio::name owner_account, eosio::asset quantity, std::string memo) const
{
struct burn
{
eosio::name owner_account;
eosio::asset quantity;
std::string memo;
};
eosio::action burn_action = eosio::action(
eosio::permission_level(get_self(), "active"_n),
eosio::name("hub.efi"), // name of the contract
eosio::name("burn"),
burn{owner_account, quantity, memo});
burn_action.send();
}
void inline_burndop(eosio::name owner_account, eosio::asset quantity, std::string memo) const
{
struct burn
{
eosio::name owner_account;
eosio::asset quantity;
std::string memo;
};
eosio::action burn_action = eosio::action(
eosio::permission_level(get_self(), "active"_n),
eosio::name("dop.efi"), // name of the contract
eosio::name("burn"),
burn{owner_account, quantity, memo});
burn_action.send();
}
void inline_burndmd(eosio::name owner_account, eosio::asset quantity, std::string memo) const
{
struct burn
{
eosio::name owner_account;
eosio::asset quantity;
std::string memo;
};
eosio::action burn_action = eosio::action(
eosio::permission_level(get_self(), "active"_n),
eosio::name("dmd.efi"), // name of the contract
eosio::name("burn"),
burn{owner_account, quantity, memo});
burn_action.send();
}
public:
using contract::contract;
void burndop(const name& owner_account, const name& to, const asset& burn_quantity_dop, std::string memo);
void burnhub(const name& owner_account, const name& to, const asset& burn_quantity_hub, std::string memo);
void burndmd(const name& owner_account, const name& to, const asset& burn_quantity_dmd, std::string memo);
[[eosio::action]]
void set(uint32_t player_limit);
burncontrak(name receiver, name code, datastream<const char *> ds):contract(receiver, code, ds),
hub_symbol("HUB", 4), dop_symbol("DOP", 4), dmd_symbol("DMD", 4){}
};