-
Notifications
You must be signed in to change notification settings - Fork 0
/
Voken2Audit.sol
61 lines (52 loc) · 1.58 KB
/
Voken2Audit.sol
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
// SPDX-License-Identifier: MIT
pragma solidity =0.7.4;
import "LibBaseAuth.sol";
import "LibIVokenAudit.sol";
/**
* @dev Voken2.0 Audit
*/
contract Voken2Audit is BaseAuth, IVokenAudit {
struct Account {
uint72 wei_purchased;
uint72 wei_rewarded;
uint72 wei_audit;
uint16 txs_in;
uint16 txs_out;
}
mapping (address => Account) _accounts;
function setAccounts(
address[] memory accounts,
uint72[] memory wei_purchased,
uint72[] memory wei_rewarded,
uint72[] memory wei_audit,
uint16[] memory txs_in,
uint16[] memory txs_out
)
external
onlyAgent
{
for (uint8 i = 0; i < accounts.length; i++) {
_accounts[accounts[i]] = Account(wei_purchased[i], wei_rewarded[i], wei_audit[i], txs_in[i], txs_out[i]);
}
}
function removeAccounts(address[] memory accounts)
external
onlyAgent
{
for (uint8 i = 0; i < accounts.length; i++) {
delete _accounts[accounts[i]];
}
}
function getAccount(address account)
public
override
view
returns (uint72 wei_purchased, uint72 wei_rewarded, uint72 wei_audit, uint16 txs_in, uint16 txs_out)
{
wei_purchased = _accounts[account].wei_purchased;
wei_rewarded = _accounts[account].wei_rewarded;
wei_audit = _accounts[account].wei_audit;
txs_in = _accounts[account].txs_in;
txs_out = _accounts[account].txs_out;
}
}