-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocumentation.html
71 lines (65 loc) · 4.88 KB
/
documentation.html
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
<!DOCTYPE html>
<html>
<head>
<title>API Functions</title>
<link rel='stylesheet' href='./assets/css/style.css' />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="./assets/javascript/application.js"></script>
</head>
<h2>Global Variables</h2>
<div style="text-align: left">
<code>mapping(address => uint256) balances</code> Map of addresses and how much robinhood coin they contain. <br /><br />
<code>string public name</code> Robinhood Coin <br /><br />
<code>string public symbol</code> Shorthand for Robinhood Coin <br /><br />
<code>uint256 public decimals</code> Number of decimal places for Robinhood Coin <br /><br />
<code>uint256 public totalSupply</code> Total supply of Robinhood Coins available. <br /><br />
<code>uint256 public taxPercent</code> Percent taxed on all transfers. DEFAULT = 1 <br /><br />
<code>uint256 public wealthyMin</code> Minimum amount to be considered wealthy <br /><br />
<code>uint256 public eliteMin</code> Minimum amount to be considered elite <br /><br />
<h3>Roles</h3>
<code>address[] public richDudes</code> List of addresses considered <code>wealthy</code> <br /><br />
<code>address[] public elites</code> List of addresses considered <code>Elite</code> <br /><br />
<code>mapping(address => uint) public elitesTime</code> Map of addresses considered <code>Elite</code> with the value being the time they became elite<br /><br />
<code>address public king</code> Address that has more than 50% of <code>totalSupply</code>. Receives taxes. Can change <code>taxPercent</code> <br /><br />
<code>address public government</code> Address that receives taxes when there is no king <br /><br />
<h3>Mining variables</h3>
<code>uint256 public baseWage</code> Amount received when trying to <code>GetPaid</code> <br /><br />
<code>bytes32 public currentChallenge</code> Challenge for performing <code>TakeFromTheRich</code> or <code>GetPaid</code> <br /><br />
<code>uint public timeOfLastRobbery</code> Time of last successful <code>TakeFromTheRich</code> <br /><br />
<code>uint public timeOfLastPayday</code> Time of last successful <code>GetPaid</code> <br /><br />
<code>uint256 public robberyDifficulty</code> Difficulty used when trying to <code>TakeFromTheRich</code> <br /><br />
<code>uint256 public paydayDifficulty</code> Difficulty used when trying to <code>GetPaid</code> <br /><br />
</div>
<h2>Public Functions</h2>
<div style="text-align: left">
<code>balanceOf(address _owner) public view returns (uint256 balance)</code><br />
Takes an address as a parameter and returns the balance associated with that address<br /><br />
<code>GetPaid(uint _nonce) public returns (uint256 reward)</code> <br />
Perform proof of work to get a set amount of tokens from the government address<br /><br />
<code>TakeFromTheRich(uint _nonce) public payable returns (uint256 reward)</code> <br />
Perform proof of work to get a percentage of tokens from a random address from <code>richDudes</code> Putting Ether in can increase the amount stolen<br /><br />
<code>transfer(address _to, uint256 _value) public returns (bool)</code> <br />
Transfer robinhood coin from your address to another<br /><br />
<code>buyRobinhoodCoin() public payable returns (uint256 amount)</code> <br />
Send Ethereum to the contract in order to receive robinhood coin<br /><br />
<code>setTaxPercent(uint _newTaxPercent) public onlyKing</code> <br />
Set the taxPercent used when calculating tax for transfers.<br /><br />
<code>getRichDudesCount() public view returns (uint)</code> <br />
Return richDudes length.<br /><br />
<code>getElitesCount() public view returns (uint)</code> <br />
Return elites length.<br /><br />
</div>
<h2>Events</h2>
<div style="text-align: left">
<code>Robbery(address indexed _victim, address indexed _thief, uint256 _amountStolen)</code> <br /><br />
<code>Payday(address indexed _government, address indexed _worker, uint256 _amountPaid)</code> <br /><br />
<code>Transfer(address indexed _from, address indexed _to, uint256 _value)</code> <br /><br />
<code>Tax(address indexed _taxPayer, address indexed _taxCollector, uint256 _value)</code> <br /><br />
<code>event Elite(address indexed _winner)</code> <br /><br />
</div>
<footer>
<a href="./contract.html">Contract</a> | <a href="./howto.html">Getting Started</a> | <a href="https://github.com/robinhoodcoin/RobinhoodCoin">Source</a> | <b>Documentation</b> | <a href="./developers.html">Developers</a> | <a href="./scoreboard.html">Scoreboard</a> | <a href="./wallet.html">Wallet</a><br />
</footer>
</html>