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
89
90
91
92
use eosio::*;
#[derive(Read, Write, NumBytes, Debug, Clone)]
pub struct ProducerInfo {
pub owner: AccountName,
pub total_votes: f64,
pub producer_key: PublicKey,
pub is_active: bool,
pub url: String,
pub unpaid_blocks: u32,
pub last_claim_time: TimePoint,
pub location: u16,
pub producer_authority: BinaryExtension<BlockSigningAuthority>,
}
#[derive(Table, Read, Write, NumBytes, Debug, Clone)]
#[eosio(table_name = "producers2")]
pub struct ProducerInfo2 {
#[eosio(primary_key)]
pub owner: AccountName,
pub votepay_share: f64,
pub last_votepay_share_update: TimePoint,
}
#[derive(Table, Read, Write, NumBytes, Debug, Clone)]
#[eosio(table_name = "voters")]
pub struct VoterInfo {
#[eosio(primary_key)]
pub owner: AccountName,
pub proxy: AccountName,
pub producers: Vec<AccountName>,
pub staked: i64,
pub last_vote_weight: f64,
pub proxied_vote_weight: f64,
pub is_proxy: bool,
pub flags1: u32,
pub reserved2: u32,
pub reserved3: Asset,
}
#[eosio::action]
pub fn regproducer(
producer: AccountName,
producer_key: PublicKey,
url: String,
location: u16,
) {
}
#[eosio::action]
pub fn regproducer2(
producer: AccountName,
producer_authority: BlockSigningAuthority,
url: String,
location: u16,
) {
}
#[eosio::action]
pub fn unregprod(producer: AccountName) {}
#[eosio::action]
pub fn voteproducer(
voter: AccountName,
proxy: AccountName,
producers: Vec<AccountName>,
) {
}
#[eosio::action]
pub fn regproxy(proxy: AccountName, isproxy: bool) {}