@leofcoin/chain 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chain.browser.js +10048 -15004
- package/dist/chain.browser.min.js +1 -1
- package/dist/chain.js +31 -219
- package/dist/node.browser.js +3770 -3738
- package/dist/node.browser.min.js +1 -1
- package/dist/node.js +1 -1
- package/docs/@leofcoin/chain/1.0.13/chain.js.html +738 -0
- package/docs/@leofcoin/chain/1.0.13/contracts_factory.js.html +182 -0
- package/docs/@leofcoin/chain/1.0.13/contracts_nameService.js.html +231 -0
- package/docs/@leofcoin/chain/1.0.13/contracts_proxies_factoryProxy.js.html +135 -0
- package/docs/@leofcoin/chain/1.0.13/contracts_proxies_nameServiceProxy.js.html +135 -0
- package/docs/@leofcoin/chain/1.0.13/contracts_proxies_nativeTokenProxy.js.html +135 -0
- package/docs/@leofcoin/chain/1.0.13/contracts_proxies_validatorsProxy.js.html +135 -0
- package/docs/@leofcoin/chain/1.0.13/contracts_proxies_votingProxy.js.html +135 -0
- package/docs/@leofcoin/chain/1.0.13/contracts_validators.js.html +242 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Bold-webfont.svg +1830 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Italic-webfont.svg +1830 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Light-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Light-webfont.svg +1831 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Light-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Regular-webfont.svg +1831 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Semibold-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Semibold-webfont.svg +1830 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Semibold-webfont.ttf +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Semibold-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-SemiboldItalic-webfont.svg +1830 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.13/global.html +1153 -0
- package/docs/@leofcoin/chain/1.0.13/icons/home.svg +4 -0
- package/docs/@leofcoin/chain/1.0.13/icons/search.svg +4 -0
- package/docs/@leofcoin/chain/1.0.13/index.html +125 -0
- package/docs/@leofcoin/chain/1.0.13/machine.js.html +251 -0
- package/docs/@leofcoin/chain/1.0.13/scripts/linenumber.js +23 -0
- package/docs/@leofcoin/chain/1.0.13/scripts/pagelocation.js +89 -0
- package/docs/@leofcoin/chain/1.0.13/standards_roles.js.html +188 -0
- package/docs/@leofcoin/chain/1.0.13/standards_token.js.html +260 -0
- package/docs/@leofcoin/chain/1.0.13/styles/collapse.css +27 -0
- package/docs/@leofcoin/chain/1.0.13/styles/jsdoc-default.css +953 -0
- package/docs/@leofcoin/chain/1.0.13/styles/prettify-jsdoc.css +111 -0
- package/docs/@leofcoin/chain/1.0.13/styles/prettify-tomorrow.css +138 -0
- package/package.json +3 -1
- package/src/chain.js +2 -2
- package/src/machine.js +2 -3
- package/src/node.js +1 -1
- package/src/typer.js +1 -1
- package/src/addresses.json +0 -6
- package/src/bytecodes.json +0 -6
- package/src/lib.js +0 -67
- package/src/messages/block.js +0 -14
- package/src/messages/bw-request.js +0 -14
- package/src/messages/bw.js +0 -14
- package/src/messages/contract.js +0 -13
- package/src/messages/last-block-request.js +0 -14
- package/src/messages/last-block.js +0 -14
- package/src/messages/transaction.js +0 -14
- package/src/protos/block.proto.js +0 -26
- package/src/protos/bw-request.proto.js +0 -5
- package/src/protos/bw.proto.js +0 -7
- package/src/protos/contract.proto.js +0 -7
- package/src/protos/last-block-request.proto.js +0 -5
- package/src/protos/last-block.proto.js +0 -7
- package/src/protos/transaction.proto.js +0 -11
- package/src/utils/utils.js +0 -7
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<!DOCTYPE html>
|
|
4
|
+
<html lang="en">
|
|
5
|
+
<head>
|
|
6
|
+
|
|
7
|
+
<meta charset="utf-8">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
9
|
+
|
|
10
|
+
<title>
|
|
11
|
+
contracts/proxies/nativeTokenProxy.js - Documentation
|
|
12
|
+
</title>
|
|
13
|
+
|
|
14
|
+
<link href="https://www.braintreepayments.com/images/favicon-ccda0b14.png" rel="icon" type="image/png">
|
|
15
|
+
|
|
16
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/highlight.min.js"></script>
|
|
17
|
+
<script>hljs.initHighlightingOnLoad();</script>
|
|
18
|
+
|
|
19
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
|
|
20
|
+
|
|
21
|
+
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
22
|
+
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
23
|
+
|
|
24
|
+
<link type="text/css" rel="stylesheet" href="styles/collapse.css">
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
<!-- start Mixpanel -->
|
|
30
|
+
<script type="text/javascript">(function(e,a){if(!a.__SV){var b=window;try{var c,l,i,j=b.location,g=j.hash;c=function(a,b){return(l=a.match(RegExp(b+"=([^&]*)")))?l[1]:null};g&&c(g,"state")&&(i=JSON.parse(decodeURIComponent(c(g,"state"))),"mpeditor"===i.action&&(b.sessionStorage.setItem("_mpcehash",g),history.replaceState(i.desiredHash||"",e.title,j.pathname+j.search)))}catch(m){}var k,h;window.mixpanel=a;a._i=[];a.init=function(b,c,f){function e(b,a){var c=a.split(".");2==c.length&&(b=b[c[0]],a=c[1]);b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,
|
|
31
|
+
0)))}}var d=a;"undefined"!==typeof f?d=a[f]=[]:f="mixpanel";d.people=d.people||[];d.toString=function(b){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);b||(a+=" (stub)");return a};d.people.toString=function(){return d.toString(1)+".people (stub)"};k="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
|
|
32
|
+
for(h=0;h<k.length;h++)e(d,k[h]);a._i.push([b,c,f])};a.__SV=1.2;b=e.createElement("script");b.type="text/javascript";b.async=!0;b.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";c=e.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c)}})(document,window.mixpanel||[]);
|
|
33
|
+
mixpanel.init("1919205b2da72e4da3b9b6639b444d59");</script>
|
|
34
|
+
<!-- end Mixpanel -->
|
|
35
|
+
</head>
|
|
36
|
+
|
|
37
|
+
<body>
|
|
38
|
+
<svg style="display: none;">
|
|
39
|
+
<defs>
|
|
40
|
+
<symbol id="linkIcon" fill="#706d77" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
|
41
|
+
<path d="M0 0h24v24H0z" fill="none"/>
|
|
42
|
+
<path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/>
|
|
43
|
+
</symbol>
|
|
44
|
+
</defs>
|
|
45
|
+
</svg>
|
|
46
|
+
|
|
47
|
+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
48
|
+
<label for="nav-trigger" class="navicon-button x">
|
|
49
|
+
<div class="navicon"></div>
|
|
50
|
+
</label>
|
|
51
|
+
|
|
52
|
+
<label for="nav-trigger" class="overlay"></label>
|
|
53
|
+
|
|
54
|
+
<div class="top-nav-wrapper">
|
|
55
|
+
<ul>
|
|
56
|
+
<li >
|
|
57
|
+
<a href="index.html">
|
|
58
|
+
|
|
59
|
+
<svg fill="#6D6D6D" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
|
60
|
+
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>
|
|
61
|
+
<path d="M0 0h24v24H0z" fill="none"/>
|
|
62
|
+
</svg>
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
</a>
|
|
66
|
+
</li>
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
</ul>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<nav>
|
|
74
|
+
<h3 class="reference-title">
|
|
75
|
+
@leofcoin/chain
|
|
76
|
+
</h3>
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
<h3>
|
|
80
|
+
Resources
|
|
81
|
+
</h3>
|
|
82
|
+
|
|
83
|
+
<a href="https://github.com/arteontoken/monorepo/chain">github</a>
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
<h3 id="global-nav">Global</h3><ul><li><a href="global.html#addContract">addContract</a></li><li><a href="global.html#createTransaction">createTransaction</a></li><li><a href="global.html#createTransactionFrom">createTransactionFrom</a></li><li><a href="global.html#deployContract">deployContract</a></li><li><a href="global.html#lookup">lookup</a></li><li><a href="global.html#state">state</a></li></ul>
|
|
88
|
+
</nav>
|
|
89
|
+
|
|
90
|
+
<div id="main">
|
|
91
|
+
|
|
92
|
+
<h1 class="page-title">
|
|
93
|
+
contracts/proxies/nativeTokenProxy.js
|
|
94
|
+
</h1>
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
<section>
|
|
101
|
+
<article>
|
|
102
|
+
<pre class="prettyprint source linenums"><code>import Proxy from './../../standards/Proxy.js'
|
|
103
|
+
|
|
104
|
+
export default class NativeTokenProxy extends Proxy {
|
|
105
|
+
/**
|
|
106
|
+
* string
|
|
107
|
+
*/
|
|
108
|
+
#name = 'ArtOnlineNativeTokenProxy'
|
|
109
|
+
|
|
110
|
+
constructor(proxyManager, state) {
|
|
111
|
+
super(proxyManager, state)
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
</code></pre>
|
|
115
|
+
</article>
|
|
116
|
+
</section>
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<br class="clear">
|
|
124
|
+
|
|
125
|
+
<footer>
|
|
126
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a>
|
|
127
|
+
</footer>
|
|
128
|
+
|
|
129
|
+
<script src="scripts/linenumber.js"></script>
|
|
130
|
+
<script src="scripts/pagelocation.js"></script>
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
</body>
|
|
135
|
+
</html>
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<!DOCTYPE html>
|
|
4
|
+
<html lang="en">
|
|
5
|
+
<head>
|
|
6
|
+
|
|
7
|
+
<meta charset="utf-8">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
9
|
+
|
|
10
|
+
<title>
|
|
11
|
+
contracts/proxies/validatorsProxy.js - Documentation
|
|
12
|
+
</title>
|
|
13
|
+
|
|
14
|
+
<link href="https://www.braintreepayments.com/images/favicon-ccda0b14.png" rel="icon" type="image/png">
|
|
15
|
+
|
|
16
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/highlight.min.js"></script>
|
|
17
|
+
<script>hljs.initHighlightingOnLoad();</script>
|
|
18
|
+
|
|
19
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
|
|
20
|
+
|
|
21
|
+
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
22
|
+
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
23
|
+
|
|
24
|
+
<link type="text/css" rel="stylesheet" href="styles/collapse.css">
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
<!-- start Mixpanel -->
|
|
30
|
+
<script type="text/javascript">(function(e,a){if(!a.__SV){var b=window;try{var c,l,i,j=b.location,g=j.hash;c=function(a,b){return(l=a.match(RegExp(b+"=([^&]*)")))?l[1]:null};g&&c(g,"state")&&(i=JSON.parse(decodeURIComponent(c(g,"state"))),"mpeditor"===i.action&&(b.sessionStorage.setItem("_mpcehash",g),history.replaceState(i.desiredHash||"",e.title,j.pathname+j.search)))}catch(m){}var k,h;window.mixpanel=a;a._i=[];a.init=function(b,c,f){function e(b,a){var c=a.split(".");2==c.length&&(b=b[c[0]],a=c[1]);b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,
|
|
31
|
+
0)))}}var d=a;"undefined"!==typeof f?d=a[f]=[]:f="mixpanel";d.people=d.people||[];d.toString=function(b){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);b||(a+=" (stub)");return a};d.people.toString=function(){return d.toString(1)+".people (stub)"};k="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
|
|
32
|
+
for(h=0;h<k.length;h++)e(d,k[h]);a._i.push([b,c,f])};a.__SV=1.2;b=e.createElement("script");b.type="text/javascript";b.async=!0;b.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";c=e.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c)}})(document,window.mixpanel||[]);
|
|
33
|
+
mixpanel.init("1919205b2da72e4da3b9b6639b444d59");</script>
|
|
34
|
+
<!-- end Mixpanel -->
|
|
35
|
+
</head>
|
|
36
|
+
|
|
37
|
+
<body>
|
|
38
|
+
<svg style="display: none;">
|
|
39
|
+
<defs>
|
|
40
|
+
<symbol id="linkIcon" fill="#706d77" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
|
41
|
+
<path d="M0 0h24v24H0z" fill="none"/>
|
|
42
|
+
<path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/>
|
|
43
|
+
</symbol>
|
|
44
|
+
</defs>
|
|
45
|
+
</svg>
|
|
46
|
+
|
|
47
|
+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
48
|
+
<label for="nav-trigger" class="navicon-button x">
|
|
49
|
+
<div class="navicon"></div>
|
|
50
|
+
</label>
|
|
51
|
+
|
|
52
|
+
<label for="nav-trigger" class="overlay"></label>
|
|
53
|
+
|
|
54
|
+
<div class="top-nav-wrapper">
|
|
55
|
+
<ul>
|
|
56
|
+
<li >
|
|
57
|
+
<a href="index.html">
|
|
58
|
+
|
|
59
|
+
<svg fill="#6D6D6D" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
|
60
|
+
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>
|
|
61
|
+
<path d="M0 0h24v24H0z" fill="none"/>
|
|
62
|
+
</svg>
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
</a>
|
|
66
|
+
</li>
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
</ul>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<nav>
|
|
74
|
+
<h3 class="reference-title">
|
|
75
|
+
@leofcoin/chain
|
|
76
|
+
</h3>
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
<h3>
|
|
80
|
+
Resources
|
|
81
|
+
</h3>
|
|
82
|
+
|
|
83
|
+
<a href="https://github.com/arteontoken/monorepo/chain">github</a>
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
<h3 id="global-nav">Global</h3><ul><li><a href="global.html#addContract">addContract</a></li><li><a href="global.html#createTransaction">createTransaction</a></li><li><a href="global.html#createTransactionFrom">createTransactionFrom</a></li><li><a href="global.html#deployContract">deployContract</a></li><li><a href="global.html#lookup">lookup</a></li><li><a href="global.html#state">state</a></li></ul>
|
|
88
|
+
</nav>
|
|
89
|
+
|
|
90
|
+
<div id="main">
|
|
91
|
+
|
|
92
|
+
<h1 class="page-title">
|
|
93
|
+
contracts/proxies/validatorsProxy.js
|
|
94
|
+
</h1>
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
<section>
|
|
101
|
+
<article>
|
|
102
|
+
<pre class="prettyprint source linenums"><code>import Proxy from './../../standards/Proxy.js'
|
|
103
|
+
|
|
104
|
+
export default class ValidatorsProxy extends Proxy {
|
|
105
|
+
/**
|
|
106
|
+
* string
|
|
107
|
+
*/
|
|
108
|
+
#name = 'ArtOnlineValidatorsProxy'
|
|
109
|
+
|
|
110
|
+
constructor(proxyManager, state) {
|
|
111
|
+
super(proxyManager, state)
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
</code></pre>
|
|
115
|
+
</article>
|
|
116
|
+
</section>
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<br class="clear">
|
|
124
|
+
|
|
125
|
+
<footer>
|
|
126
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a>
|
|
127
|
+
</footer>
|
|
128
|
+
|
|
129
|
+
<script src="scripts/linenumber.js"></script>
|
|
130
|
+
<script src="scripts/pagelocation.js"></script>
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
</body>
|
|
135
|
+
</html>
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<!DOCTYPE html>
|
|
4
|
+
<html lang="en">
|
|
5
|
+
<head>
|
|
6
|
+
|
|
7
|
+
<meta charset="utf-8">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
9
|
+
|
|
10
|
+
<title>
|
|
11
|
+
contracts/proxies/votingProxy.js - Documentation
|
|
12
|
+
</title>
|
|
13
|
+
|
|
14
|
+
<link href="https://www.braintreepayments.com/images/favicon-ccda0b14.png" rel="icon" type="image/png">
|
|
15
|
+
|
|
16
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/highlight.min.js"></script>
|
|
17
|
+
<script>hljs.initHighlightingOnLoad();</script>
|
|
18
|
+
|
|
19
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
|
|
20
|
+
|
|
21
|
+
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
22
|
+
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
23
|
+
|
|
24
|
+
<link type="text/css" rel="stylesheet" href="styles/collapse.css">
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
<!-- start Mixpanel -->
|
|
30
|
+
<script type="text/javascript">(function(e,a){if(!a.__SV){var b=window;try{var c,l,i,j=b.location,g=j.hash;c=function(a,b){return(l=a.match(RegExp(b+"=([^&]*)")))?l[1]:null};g&&c(g,"state")&&(i=JSON.parse(decodeURIComponent(c(g,"state"))),"mpeditor"===i.action&&(b.sessionStorage.setItem("_mpcehash",g),history.replaceState(i.desiredHash||"",e.title,j.pathname+j.search)))}catch(m){}var k,h;window.mixpanel=a;a._i=[];a.init=function(b,c,f){function e(b,a){var c=a.split(".");2==c.length&&(b=b[c[0]],a=c[1]);b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,
|
|
31
|
+
0)))}}var d=a;"undefined"!==typeof f?d=a[f]=[]:f="mixpanel";d.people=d.people||[];d.toString=function(b){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);b||(a+=" (stub)");return a};d.people.toString=function(){return d.toString(1)+".people (stub)"};k="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
|
|
32
|
+
for(h=0;h<k.length;h++)e(d,k[h]);a._i.push([b,c,f])};a.__SV=1.2;b=e.createElement("script");b.type="text/javascript";b.async=!0;b.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";c=e.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c)}})(document,window.mixpanel||[]);
|
|
33
|
+
mixpanel.init("1919205b2da72e4da3b9b6639b444d59");</script>
|
|
34
|
+
<!-- end Mixpanel -->
|
|
35
|
+
</head>
|
|
36
|
+
|
|
37
|
+
<body>
|
|
38
|
+
<svg style="display: none;">
|
|
39
|
+
<defs>
|
|
40
|
+
<symbol id="linkIcon" fill="#706d77" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
|
41
|
+
<path d="M0 0h24v24H0z" fill="none"/>
|
|
42
|
+
<path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/>
|
|
43
|
+
</symbol>
|
|
44
|
+
</defs>
|
|
45
|
+
</svg>
|
|
46
|
+
|
|
47
|
+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
48
|
+
<label for="nav-trigger" class="navicon-button x">
|
|
49
|
+
<div class="navicon"></div>
|
|
50
|
+
</label>
|
|
51
|
+
|
|
52
|
+
<label for="nav-trigger" class="overlay"></label>
|
|
53
|
+
|
|
54
|
+
<div class="top-nav-wrapper">
|
|
55
|
+
<ul>
|
|
56
|
+
<li >
|
|
57
|
+
<a href="index.html">
|
|
58
|
+
|
|
59
|
+
<svg fill="#6D6D6D" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
|
60
|
+
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>
|
|
61
|
+
<path d="M0 0h24v24H0z" fill="none"/>
|
|
62
|
+
</svg>
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
</a>
|
|
66
|
+
</li>
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
</ul>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<nav>
|
|
74
|
+
<h3 class="reference-title">
|
|
75
|
+
@leofcoin/chain
|
|
76
|
+
</h3>
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
<h3>
|
|
80
|
+
Resources
|
|
81
|
+
</h3>
|
|
82
|
+
|
|
83
|
+
<a href="https://github.com/arteontoken/monorepo/chain">github</a>
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
<h3 id="global-nav">Global</h3><ul><li><a href="global.html#addContract">addContract</a></li><li><a href="global.html#createTransaction">createTransaction</a></li><li><a href="global.html#createTransactionFrom">createTransactionFrom</a></li><li><a href="global.html#deployContract">deployContract</a></li><li><a href="global.html#lookup">lookup</a></li><li><a href="global.html#state">state</a></li></ul>
|
|
88
|
+
</nav>
|
|
89
|
+
|
|
90
|
+
<div id="main">
|
|
91
|
+
|
|
92
|
+
<h1 class="page-title">
|
|
93
|
+
contracts/proxies/votingProxy.js
|
|
94
|
+
</h1>
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
<section>
|
|
101
|
+
<article>
|
|
102
|
+
<pre class="prettyprint source linenums"><code>import Proxy from './../../standards/Proxy.js'
|
|
103
|
+
|
|
104
|
+
export default class VotingProxy extends Proxy {
|
|
105
|
+
/**
|
|
106
|
+
* string
|
|
107
|
+
*/
|
|
108
|
+
#name = 'ArtOnlineVotingProxy'
|
|
109
|
+
|
|
110
|
+
constructor(proxyManager, state) {
|
|
111
|
+
super(proxyManager, state)
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
</code></pre>
|
|
115
|
+
</article>
|
|
116
|
+
</section>
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<br class="clear">
|
|
124
|
+
|
|
125
|
+
<footer>
|
|
126
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a>
|
|
127
|
+
</footer>
|
|
128
|
+
|
|
129
|
+
<script src="scripts/linenumber.js"></script>
|
|
130
|
+
<script src="scripts/pagelocation.js"></script>
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
</body>
|
|
135
|
+
</html>
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<!DOCTYPE html>
|
|
4
|
+
<html lang="en">
|
|
5
|
+
<head>
|
|
6
|
+
|
|
7
|
+
<meta charset="utf-8">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
9
|
+
|
|
10
|
+
<title>
|
|
11
|
+
contracts/validators.js - Documentation
|
|
12
|
+
</title>
|
|
13
|
+
|
|
14
|
+
<link href="https://www.braintreepayments.com/images/favicon-ccda0b14.png" rel="icon" type="image/png">
|
|
15
|
+
|
|
16
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/highlight.min.js"></script>
|
|
17
|
+
<script>hljs.initHighlightingOnLoad();</script>
|
|
18
|
+
|
|
19
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
|
|
20
|
+
|
|
21
|
+
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
22
|
+
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
23
|
+
|
|
24
|
+
<link type="text/css" rel="stylesheet" href="styles/collapse.css">
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
<!-- start Mixpanel -->
|
|
30
|
+
<script type="text/javascript">(function(e,a){if(!a.__SV){var b=window;try{var c,l,i,j=b.location,g=j.hash;c=function(a,b){return(l=a.match(RegExp(b+"=([^&]*)")))?l[1]:null};g&&c(g,"state")&&(i=JSON.parse(decodeURIComponent(c(g,"state"))),"mpeditor"===i.action&&(b.sessionStorage.setItem("_mpcehash",g),history.replaceState(i.desiredHash||"",e.title,j.pathname+j.search)))}catch(m){}var k,h;window.mixpanel=a;a._i=[];a.init=function(b,c,f){function e(b,a){var c=a.split(".");2==c.length&&(b=b[c[0]],a=c[1]);b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,
|
|
31
|
+
0)))}}var d=a;"undefined"!==typeof f?d=a[f]=[]:f="mixpanel";d.people=d.people||[];d.toString=function(b){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);b||(a+=" (stub)");return a};d.people.toString=function(){return d.toString(1)+".people (stub)"};k="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
|
|
32
|
+
for(h=0;h<k.length;h++)e(d,k[h]);a._i.push([b,c,f])};a.__SV=1.2;b=e.createElement("script");b.type="text/javascript";b.async=!0;b.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";c=e.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c)}})(document,window.mixpanel||[]);
|
|
33
|
+
mixpanel.init("1919205b2da72e4da3b9b6639b444d59");</script>
|
|
34
|
+
<!-- end Mixpanel -->
|
|
35
|
+
</head>
|
|
36
|
+
|
|
37
|
+
<body>
|
|
38
|
+
<svg style="display: none;">
|
|
39
|
+
<defs>
|
|
40
|
+
<symbol id="linkIcon" fill="#706d77" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
|
41
|
+
<path d="M0 0h24v24H0z" fill="none"/>
|
|
42
|
+
<path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/>
|
|
43
|
+
</symbol>
|
|
44
|
+
</defs>
|
|
45
|
+
</svg>
|
|
46
|
+
|
|
47
|
+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
48
|
+
<label for="nav-trigger" class="navicon-button x">
|
|
49
|
+
<div class="navicon"></div>
|
|
50
|
+
</label>
|
|
51
|
+
|
|
52
|
+
<label for="nav-trigger" class="overlay"></label>
|
|
53
|
+
|
|
54
|
+
<div class="top-nav-wrapper">
|
|
55
|
+
<ul>
|
|
56
|
+
<li >
|
|
57
|
+
<a href="index.html">
|
|
58
|
+
|
|
59
|
+
<svg fill="#6D6D6D" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
|
60
|
+
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>
|
|
61
|
+
<path d="M0 0h24v24H0z" fill="none"/>
|
|
62
|
+
</svg>
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
</a>
|
|
66
|
+
</li>
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
</ul>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<nav>
|
|
74
|
+
<h3 class="reference-title">
|
|
75
|
+
@leofcoin/chain
|
|
76
|
+
</h3>
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
<h3>
|
|
80
|
+
Resources
|
|
81
|
+
</h3>
|
|
82
|
+
|
|
83
|
+
<a href="https://github.com/arteontoken/monorepo/chain">github</a>
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
<h3 id="global-nav">Global</h3><ul><li><a href="global.html#addContract">addContract</a></li><li><a href="global.html#createTransaction">createTransaction</a></li><li><a href="global.html#createTransactionFrom">createTransactionFrom</a></li><li><a href="global.html#deployContract">deployContract</a></li><li><a href="global.html#lookup">lookup</a></li><li><a href="global.html#state">state</a></li></ul>
|
|
88
|
+
</nav>
|
|
89
|
+
|
|
90
|
+
<div id="main">
|
|
91
|
+
|
|
92
|
+
<h1 class="page-title">
|
|
93
|
+
contracts/validators.js
|
|
94
|
+
</h1>
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
<section>
|
|
101
|
+
<article>
|
|
102
|
+
<pre class="prettyprint source linenums"><code>export default class Validators {
|
|
103
|
+
/**
|
|
104
|
+
* string
|
|
105
|
+
*/
|
|
106
|
+
#name = 'ArtOnlineValidators'
|
|
107
|
+
/**
|
|
108
|
+
* uint
|
|
109
|
+
*/
|
|
110
|
+
#totalValidators = 0
|
|
111
|
+
/**
|
|
112
|
+
* Object => string(address) => Object
|
|
113
|
+
*/
|
|
114
|
+
#validators = {}
|
|
115
|
+
|
|
116
|
+
#owner
|
|
117
|
+
|
|
118
|
+
#currency
|
|
119
|
+
|
|
120
|
+
#minimumBalance
|
|
121
|
+
|
|
122
|
+
get state() {
|
|
123
|
+
return {
|
|
124
|
+
owner: this.#owner,
|
|
125
|
+
minimumBalance: this.#minimumBalance,
|
|
126
|
+
currency: this.#currency,
|
|
127
|
+
totalValidators: this.#totalValidators,
|
|
128
|
+
validators: this.#validators
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
constructor(tokenAddress, state) {
|
|
133
|
+
if (state) {
|
|
134
|
+
this.#owner = state.owner
|
|
135
|
+
this.#minimumBalance = state.minimumBalance
|
|
136
|
+
this.#currency = state.currency
|
|
137
|
+
|
|
138
|
+
this.#totalValidators = state.totalValidators
|
|
139
|
+
this.#validators = state.validators
|
|
140
|
+
} else {
|
|
141
|
+
this.#owner = msg.sender
|
|
142
|
+
this.#minimumBalance = 50000
|
|
143
|
+
this.#currency = tokenAddress
|
|
144
|
+
|
|
145
|
+
this.#totalValidators += 1
|
|
146
|
+
this.#validators[msg.sender] = {
|
|
147
|
+
firstSeen: new Date().getTime(),
|
|
148
|
+
active: true
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
get name() {
|
|
155
|
+
return this.#name
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
get owner() {
|
|
159
|
+
return this.#owner
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
get currency() {
|
|
163
|
+
return this.#currency
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
get validators() {
|
|
167
|
+
return {...this.#validators}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
get totalValidators() {
|
|
171
|
+
return this.#totalValidators
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
get minimumBalance() {
|
|
175
|
+
return this.#minimumBalance
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
changeOwner(owner) {
|
|
179
|
+
if (msg.sender !== this.#owner) throw new Error('not an owner')
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
changeCurrency(currency) {
|
|
183
|
+
if (msg.sender !== this.#owner) throw new Error('not an owner')
|
|
184
|
+
this.#currency = currency
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
has(validator) {
|
|
188
|
+
return Boolean(this.#validators[validator] !== undefined)
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
async addValidator(validator) {
|
|
192
|
+
if (this.has(validator)) throw new Error('already a validator')
|
|
193
|
+
const balance = await msg.staticCall(this.currency, 'balanceOf', [msg.sender])
|
|
194
|
+
|
|
195
|
+
if (balance < this.minimumBalance) throw new Error(`balance to low! got: ${balance} need: ${this.#minimumBalance}`)
|
|
196
|
+
|
|
197
|
+
this.#totalValidators += 1
|
|
198
|
+
this.#validators[validator] = {
|
|
199
|
+
firstSeen: new Date().getTime(),
|
|
200
|
+
active: true
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
removeValidator(validator) {
|
|
205
|
+
if (!this.has(validator)) throw new Error('validator not found')
|
|
206
|
+
|
|
207
|
+
this.#totalValidators -= 1
|
|
208
|
+
delete this.#validators[validator]
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
async updateValidator(validator, active) {
|
|
212
|
+
if (!this.has(validator)) throw new Error('validator not found')
|
|
213
|
+
const balance = await msg.staticCall(this.currency, 'balanceOf', [msg.sender])
|
|
214
|
+
if (balance < this.minimumBalance && this.#validators[validator].active) this.#validators[validator].active = false
|
|
215
|
+
|
|
216
|
+
if (balance < this.minimumBalance) throw new Error(`balance to low! got: ${balance} need: ${this.#minimumBalance}`)
|
|
217
|
+
|
|
218
|
+
this.#validators[validator].active = active
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
</code></pre>
|
|
222
|
+
</article>
|
|
223
|
+
</section>
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
</div>
|
|
229
|
+
|
|
230
|
+
<br class="clear">
|
|
231
|
+
|
|
232
|
+
<footer>
|
|
233
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a>
|
|
234
|
+
</footer>
|
|
235
|
+
|
|
236
|
+
<script src="scripts/linenumber.js"></script>
|
|
237
|
+
<script src="scripts/pagelocation.js"></script>
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
</body>
|
|
242
|
+
</html>
|
|
Binary file
|