-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdiary-2019-04.htm
314 lines (311 loc) · 38.6 KB
/
diary-2019-04.htm
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>diary-2019-04</title>
<link href=".src/preferred.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<p class='header'>
<a href="-home.htm">Home</a> | <a href="-diary.htm">Diary</a> | <a href="-todo.htm">Todo</a> | <a href="-index.htm">Index</a> | <a href="-about.htm">About</a> |</p>
<p class='main'><hr/><span class="date">2019-04-30:</span><br/>
<span class="quot2">"'Beginning with the grant of Mary<a href="land.htm">land</a> in 1632, and including those of Maine, the Carolinas, and Pennsylvania, the proprietary charters expressly <a href="trans.htm">trans</a>ferred the right of the cr<a href="own.htm">own</a> to re<a href="serv.htm">serv</a>e a <a href="rent.htm">rent</a>.<br/>
<br/>
Also, by waiving the statute Q<a href="ui.htm">ui</a>a Emp<a href="tor.htm">tor</a>es, they <a href="perm.htm">perm</a>itted subin<a href="feud.htm">feud</a>ation.<br/>
<br/>
Q<a href="ui.htm">ui</a>t- <a href="rent.htm">rent</a>s<a href="we.htm"> we</a>re mentioned in the grants to the Duke of York, and still later, in the charter of Ge<a href="org.htm">org</a>ia, by the re<a href="serv.htm">serv</a>ation of a <a href="rent.htm">rent</a> of 4 shillings per 1OO acres.<br/>
<br/>
The theory that the cr<a href="own.htm">own</a> held a <a href="feud.htm">feud</a>al <a href="own.htm">own</a>ership in the soil of <a href="new.htm">new</a> possessions was not confined to the thirteen American colonies.<br/>
<br/>
In the grant of <a href="new.htm">New</a>found<a href="land.htm">land</a> in 1637 to the Marq<a href="ui.htm">ui</a>s of Hamilton and his associates a proprietary <a href="control.htm">control</a>, involving a q<a href="ui.htm">ui</a>t-<a href="rent.htm">rent</a>, was <a href="creat.htm">creat</a>ed.<br/>
<br/>
A further extension of the <a href="feud.htm">feud</a>al theory of <a href="land.htm">land</a>-tenure was made when the proclamation of 1763, which framed the <a href="gov.htm">gov</a>ern- ments of Quebec, East and<a href="we.htm"> We</a>st Florida, and Grenada, provided for a q<a href="ui.htm">ui</a>t-<a href="rent.htm">rent</a> <a href="sys.htm">sys</a>tem as a <a href="sign.htm">sign</a> of the royal supremacy.<br/>
<br/>
A similar policy was ob<a href="serv.htm">serv</a>ed in the British<a href="we.htm"> We</a>st Indies, where the <a href="land.htm">land</a> was granted to proprie<a href="tor.htm">tor</a>s who collected q<a href="ui.htm">ui</a>t-<a href="rent.htm">rent</a>s, or else bore a q<a href="ui.htm">ui</a>t- <a href="rent.htm">rent</a> charge <a href="pay.htm">pay</a>able directly to the cr<a href="own.htm">own</a>.'"</span> -- <small>[<small>[The Q<a href="ui.htm">ui</a>t-<a href="rent.htm">Rent</a> <a href="sys.htm">Sys</a>tem in the American Colonies <a class="ext" href="https://Jstor.org/stable/pdf/1834386.pdf">Jstor.org/stable/pdf/1834386.pdf</a>]</small>]</small><br/>
<br/>
<hr/><span class="date">2019-04-30:</span> <a class="ext" href="https://OneCommunityGlobal.org/aquapini-and-walipini-planting-and-harvesting">OneCommunityGlobal.org/aquapini-and-walipini-planting-and-harvesting</a><br/>
<br/>
<hr/><span class="date">2019-04-30:</span> Climate Reality Leadership <a href="corp.htm">Corp</a>s<br/>
<br/>
<hr/><span class="date">2019-04-29:</span> <a class="ext" href="https://OneCommunityGlobal.org/revenue">OneCommunityGlobal.org/revenue</a> <span class="quot2">>><a href="creat.htm">Creat</a>ing sustainable and duplicable financial successT<a href="our.htm">our</a>ism revenue has <a href="bee.htm">bee</a>n identified as the revenue stream most capable of accomplishing <a href="our.htm">our</a> global <a href="trans.htm">trans</a>formation <a href="goal.htm">goal</a>s by further supporting and <a href="shar.htm">shar</a>ing One <a href="comm.htm">Comm</a>unity as a teacher/demonstration <a href="comm.htm">comm</a>unity, <a href="vill.htm">vill</a>age, and <a href="city.htm">city</a>.<a href="we.htm"> We </a>will <a href="use.htm">use</a> a combination of the visitability of <a href="our.htm">our</a> location, educational classes, and non-stop <a href="creat.htm">creat</a>ion of <a href="open.htm">open</a> <a href="sourc.htm">sourc</a>e blueprints to market and <a href="shar.htm">shar</a>e this option with the world. Sustainable infra<a href="struc.htm">struc</a>ture combined with an all volunteer <a href="labor.htm">labor</a> force will keep operational expenses low while<a href="we.htm"> we </a><a href="shar.htm">shar</a>e the fulfilled living and enriching environment as a marketable eco-t<a href="our.htm">our</a>ism option. This will allow us to offer <a href="sign.htm">sign</a>ificantly more <a href="valu.htm">valu</a>e, for a lo<a href="we.htm">we</a>r <a href="pric.htm">pric</a>e, with an endless and <a href="free.htm">free</a> <a href="open.htm">open</a> <a href="sourc.htm">sourc</a>e <a href="shar.htm">shar</a>ing marketing engine that benefits us and the world. In short, the more <small>(and higher quality)</small> <a href="our.htm">our</a> <a href="open.htm">open</a> <a href="sourc.htm">sourc</a>e <a href="shar.htm">shar</a>ing, and the more <a href="fun.htm">fun</a> <a href="our.htm">our</a> environment is, the more successful<a href="we.htm"> we </a>will be; all of which will help to fuel <a href="our.htm">our</a> s<a href="econ.htm">econ</a>dary revenue streams as<a href="we.htm"> we</a>ll.</span><br/>
<br/>
<hr/><span class="date">2019-04-27:</span> <a class="ext" href="https://Github.com/ethereum/serpent">Github.com/ethereum/serpent</a> <span class="quot2">>>Serpent is an assembly <a href="lang.htm">lang</a>uage that compiles to EVM <a href="code.htm">code</a> that is extended with various high-level features. It can be <a href="use.htm">use</a>ful for writing <a href="code.htm">code</a> that req<a href="ui.htm">ui</a>res low-level op<a href="code.htm">code</a> manipulation as<a href="we.htm"> we</a>ll as access to high-level primitives like the ABI.</span><br/>
<br/>
<hr/><span class="date">2019-04-27:</span> <a class="ext" href="https://Vyper.ReadTheDocs.io">Vyper.ReadTheDocs.io</a> <span class="quot2">>> Vyper <a href="code.htm">code</a> should be maximally human-readable. Furthermore, it should be maximally difficult to write misleading <a href="code.htm">code</a>. Simpli<a href="city.htm">city</a> for the reader is more important than simpli<a href="city.htm">city</a> for the writer, and simpli<a href="city.htm">city</a> for readers with low prior experience with Vyper <small>(and low prior experience with programming in general)</small> is particularly important.</span><br/>
<br/>
<hr/><span class="date">2019-04-27:</span><br/>
<a class="ext" href="https://Ethereum.org/token">Ethereum.org/token</a><br/>
<br/>
<span class="quot2">>> <a href="contract.htm">Contract</a>s aren't able to subscribe to Events only to <a href="fun.htm">fun</a>ction calls. So for <a href="contract.htm">contract</a>s, you should first approve an amount of <a href="token.htm">token</a>s they can move from y<a href="our.htm">our</a> account and then ping them to let them know they should do their <a href="thing.htm">thing</a> - or do the two <a href="act.htm">act</a>ions in one, with approveAndCall.</span><br/>
<br/>
<span class="quot2">>> Note <a href="buy.htm">Buy</a> and <a href="sell.htm">sell</a> "<a href="pric.htm">pric</a>es" are not set in Ether, but in<a href="we.htm"> we</a>i the minimum currency of the <a href="sys.htm">sys</a>tem <small>(eq<a href="ui.htm">ui</a>valent to the cent in the Euro and Dollar, or the Satoshi in Bit<a href="coin.htm">coin</a>)</small>. One Ether is 1000000000000000000<a href="we.htm"> we</a>i. So when setting <a href="pric.htm">pric</a>es for y<a href="our.htm">our</a> <a href="token.htm">token</a> in Ether, add 18 zeros at the end.</span><br/>
<br/>
<small>{<br/>
<span class="cmnt">// Advanced <a href="token.htm">Token</a></span><br/>
<br/>
pragma <a href="solidity.htm">solidity</a> >=0.4.22 <0.6.0;<br/>
<br/>
<a href="contract.htm">contract</a> <a href="own.htm">own</a>ed <small>{<br/>
ad<a href="dress.htm">dress</a> public <a href="own.htm">own</a>er;<br/>
<br/>
con<a href="struc.htm">struc</a><a href="tor.htm">tor</a><small>()</small> public <small>{<br/>
<a href="own.htm">own</a>er = <a class="ext" href="https://msg.sender">msg.sender</a>;<br/>
}</small><br/>
<br/>
<a href="mod.htm">mod</a>ifier only<a href="own.htm">Own</a>er <small>{<br/>
req<a href="ui.htm">ui</a>re<small>(<a class="ext" href="https://msg.sender">msg.sender</a> == <a href="own.htm">own</a>er)</small>;<br/>
_;<br/>
}</small><br/>
<br/>
<a href="fun.htm">fun</a>ction <a href="trans.htm">trans</a>fer<a href="own.htm">Own</a>ership<small>(ad<a href="dress.htm">dress</a> <a href="new.htm">new</a><a href="own.htm">Own</a>er)</small> only<a href="own.htm">Own</a>er public <small>{<br/>
<a href="own.htm">own</a>er = <a href="new.htm">new</a><a href="own.htm">Own</a>er;<br/>
}</small><br/>
}</small><br/>
<br/>
interface <a href="token.htm">token</a><a href="recip.htm">Recip</a>ient <small>{ <a href="fun.htm">fun</a>ction receiveApproval<small>(ad<a href="dress.htm">dress</a> _from,<a href="ui.htm"> ui</a>nt256 _<a href="valu.htm">valu</a>e, ad<a href="dress.htm">dress</a> _<a href="token.htm">token</a>, bytes calldata _ex<a href="trad.htm">traD</a>ata)</small> external; }</small><br/>
<br/>
<a href="contract.htm">contract</a> <a href="token.htm">Token</a>ERC20 <small>{<br/>
// Public variables of the <a href="token.htm">token</a><br/>
string public name;<br/>
string public symbol;<br/>
<a href="ui.htm"> ui</a>nt8 public decimals = 18;<br/>
// 18 decimals is the strongly suggested default, <a href="avo.htm">avo</a>id <a href="chang.htm">chang</a>ing it<br/>
<a href="ui.htm"> ui</a>nt256 public totalSupply;<br/>
<br/>
// This <a href="creat.htm">creat</a>es an array with all balances<br/>
mapping <small>(ad<a href="dress.htm">dress</a> =><a href="ui.htm"> ui</a>nt256)</small> public balanceOf;<br/>
mapping <small>(ad<a href="dress.htm">dress</a> => mapping <small>(ad<a href="dress.htm">dress</a> =><a href="ui.htm"> ui</a>nt256)</small>)</small> public allowance;<br/>
<br/>
// This generates a public event on the <a href="bloc.htm">bloc</a>kchain that will notify clients<br/>
event <a href="trans.htm">Trans</a>fer<small>(ad<a href="dress.htm">dress</a> indexed from, ad<a href="dress.htm">dress</a> indexed to,<a href="ui.htm"> ui</a>nt256 <a href="valu.htm">valu</a>e)</small>;<br/>
<br/>
// This generates a public event on the <a href="bloc.htm">bloc</a>kchain that will notify clients<br/>
event Approval<small>(ad<a href="dress.htm">dress</a> indexed _<a href="own.htm">own</a>er, ad<a href="dress.htm">dress</a> indexed _spender,<a href="ui.htm"> ui</a>nt256 _<a href="valu.htm">valu</a>e)</small>;<br/>
<br/>
// This notifies clients about the amount burnt<br/>
event Burn<small>(ad<a href="dress.htm">dress</a> indexed from,<a href="ui.htm"> ui</a>nt256 <a href="valu.htm">valu</a>e)</small>;<br/>
<br/>
/**<br/>
* Constrc<a href="tor.htm">tor</a> <a href="fun.htm">fun</a>ction<br/>
*<br/>
* Initializes <a href="contract.htm">contract</a> with initial supply <a href="token.htm">token</a>s to the <a href="creat.htm">creat</a>or of the <a href="contract.htm">contract</a><br/>
*/<br/>
con<a href="struc.htm">struc</a><a href="tor.htm">tor</a><small>(<br/>
<a href="ui.htm"> ui</a>nt256 initialSupply,<br/>
string memory <a href="token.htm">token</a>Name,<br/>
string memory <a href="token.htm">token</a>Symbol<br/>
)</small> public <small>{<br/>
totalSupply = initialSupply * 10 **<a href="ui.htm"> ui</a>nt256<small>(decimals)</small>; // Update total supply with the decimal amount<br/>
balanceOf<small>[<a class="ext" href="https://msg.sender">msg.sender</a>]</small> = totalSupply; // Give the <a href="creat.htm">creat</a>or all initial <a href="token.htm">token</a>s<br/>
name = <a href="token.htm">token</a>Name; // Set the name for dis<a href="play.htm">play</a> purposes<br/>
symbol = <a href="token.htm">token</a>Symbol; // Set the symbol for dis<a href="play.htm">play</a> purposes<br/>
}</small><br/>
<br/>
/**<br/>
* Internal <a href="trans.htm">trans</a>fer, only can be called by this <a href="contract.htm">contract</a><br/>
*/<br/>
<a href="fun.htm">fun</a>ction _<a href="trans.htm">trans</a>fer<small>(ad<a href="dress.htm">dress</a> _from, ad<a href="dress.htm">dress</a> _to,<a href="ui.htm"> ui</a>nt _<a href="valu.htm">valu</a>e)</small> internal <small>{<br/>
// Prevent <a href="trans.htm">trans</a>fer to 0x0 ad<a href="dress.htm">dress</a>. <a href="use.htm">Use</a> burn<small>()</small> instead<br/>
req<a href="ui.htm">ui</a>re<small>(_to != ad<a href="dress.htm">dress</a><small>(0x0)</small>)</small>;<br/>
// Check if the sender has enough<br/>
req<a href="ui.htm">ui</a>re<small>(balanceOf<small>[_from]</small> >= _<a href="valu.htm">valu</a>e)</small>;<br/>
// Check for over<a href="flow.htm">flow</a>s<br/>
req<a href="ui.htm">ui</a>re<small>(balanceOf<small>[_to]</small> + _<a href="valu.htm">valu</a>e > balanceOf<small>[_to]</small>)</small>;<br/>
// Save this for an assertion in the <a href="future.htm">future</a><br/>
<a href="ui.htm"> ui</a>nt previousBalances = balanceOf<small>[_from]</small> + balanceOf<small>[_to]</small>;<br/>
// Subtr<a href="act.htm">act</a> from the sender<br/>
balanceOf<small>[_from]</small> -= _<a href="valu.htm">valu</a>e;<br/>
// Add the same to the <a href="recip.htm">recip</a>ient<br/>
balanceOf<small>[_to]</small> += _<a href="valu.htm">valu</a>e;<br/>
emit <a href="trans.htm">Trans</a>fer<small>(_from, _to, _<a href="valu.htm">valu</a>e)</small>;<br/>
// Asserts are <a href="use.htm">use</a>d to <a href="use.htm">use</a> static analysis to find bugs in y<a href="our.htm">our</a> <a href="code.htm">code</a>. They should never fail<br/>
assert<small>(balanceOf<small>[_from]</small> + balanceOf<small>[_to]</small> == previousBalances)</small>;<br/>
}</small><br/>
<br/>
/**<br/>
* <a href="trans.htm">Trans</a>fer <a href="token.htm">token</a>s<br/>
*<br/>
* Send `_<a href="valu.htm">valu</a>e` <a href="token.htm">token</a>s to `_to` from y<a href="our.htm">our</a> account<br/>
*<br/>
* @param _to The ad<a href="dress.htm">dress</a> of the <a href="recip.htm">recip</a>ient<br/>
* @param _<a href="valu.htm">valu</a>e the amount to send<br/>
*/<br/>
<a href="fun.htm">fun</a>ction <a href="trans.htm">trans</a>fer<small>(ad<a href="dress.htm">dress</a> _to,<a href="ui.htm"> ui</a>nt256 _<a href="valu.htm">valu</a>e)</small> public returns <small>(bool success)</small> <small>{<br/>
_<a href="trans.htm">trans</a>fer<small>(<a class="ext" href="https://msg.sender">msg.sender</a>, _to, _<a href="valu.htm">valu</a>e)</small>;<br/>
return true;<br/>
}</small><br/>
<br/>
/**<br/>
* <a href="trans.htm">Trans</a>fer <a href="token.htm">token</a>s from other ad<a href="dress.htm">dress</a><br/>
*<br/>
* Send `_<a href="valu.htm">valu</a>e` <a href="token.htm">token</a>s to `_to` in behalf of `_from`<br/>
*<br/>
* @param _from The ad<a href="dress.htm">dress</a> of the sender<br/>
* @param _to The ad<a href="dress.htm">dress</a> of the <a href="recip.htm">recip</a>ient<br/>
* @param _<a href="valu.htm">valu</a>e the amount to send<br/>
*/<br/>
<a href="fun.htm">fun</a>ction <a href="trans.htm">trans</a>ferFrom<small>(ad<a href="dress.htm">dress</a> _from, ad<a href="dress.htm">dress</a> _to,<a href="ui.htm"> ui</a>nt256 _<a href="valu.htm">valu</a>e)</small> public returns <small>(bool success)</small> <small>{<br/>
req<a href="ui.htm">ui</a>re<small>(_<a href="valu.htm">valu</a>e <= allowance<small>[_from]</small><small>[<a class="ext" href="https://msg.sender">msg.sender</a>]</small>)</small>; // Check allowance<br/>
allowance<small>[_from]</small><small>[<a class="ext" href="https://msg.sender">msg.sender</a>]</small> -= _<a href="valu.htm">valu</a>e;<br/>
_<a href="trans.htm">trans</a>fer<small>(_from, _to, _<a href="valu.htm">valu</a>e)</small>;<br/>
return true;<br/>
}</small><br/>
<br/>
/**<br/>
* Set allowance for other ad<a href="dress.htm">dress</a><br/>
*<br/>
* Allows `_spender` to spend no more than `_<a href="valu.htm">valu</a>e` <a href="token.htm">token</a>s in y<a href="our.htm">our</a> behalf<br/>
*<br/>
* @param _spender The ad<a href="dress.htm">dress</a> authorized to spend<br/>
* @param _<a href="valu.htm">valu</a>e the max amount they can spend<br/>
*/<br/>
<a href="fun.htm">fun</a>ction approve<small>(ad<a href="dress.htm">dress</a> _spender,<a href="ui.htm"> ui</a>nt256 _<a href="valu.htm">valu</a>e)</small> public<br/>
returns <small>(bool success)</small> <small>{<br/>
allowance<small>[<a class="ext" href="https://msg.sender">msg.sender</a>]</small><small>[_spender]</small> = _<a href="valu.htm">valu</a>e;<br/>
emit Approval<small>(<a class="ext" href="https://msg.sender">msg.sender</a>, _spender, _<a href="valu.htm">valu</a>e)</small>;<br/>
return true;<br/>
}</small><br/>
<br/>
/**<br/>
* Set allowance for other ad<a href="dress.htm">dress</a> and notify<br/>
*<br/>
* Allows `_spender` to spend no more than `_<a href="valu.htm">valu</a>e` <a href="token.htm">token</a>s in y<a href="our.htm">our</a> behalf, and then ping the <a href="contract.htm">contract</a> about it<br/>
*<br/>
* @param _spender The ad<a href="dress.htm">dress</a> authorized to spend<br/>
* @param _<a href="valu.htm">valu</a>e the max amount they can spend<br/>
* @param _ex<a href="trad.htm">traD</a>ata some extra information to send to the approved <a href="contract.htm">contract</a><br/>
*/<br/>
<a href="fun.htm">fun</a>ction approveAndCall<small>(ad<a href="dress.htm">dress</a> _spender,<a href="ui.htm"> ui</a>nt256 _<a href="valu.htm">valu</a>e, bytes memory _ex<a href="trad.htm">traD</a>ata)</small><br/>
public<br/>
returns <small>(bool success)</small> <small>{<br/>
<a href="token.htm">token</a><a href="recip.htm">Recip</a>ient spender = <a href="token.htm">token</a><a href="recip.htm">Recip</a>ient<small>(_spender)</small>;<br/>
if <small>(approve<small>(_spender, _<a href="valu.htm">valu</a>e)</small>)</small> <small>{<br/>
<a class="ext" href="https://spender.receiveApproval(msg.sender">spender.receiveApproval(msg.sender</a>, _<a href="valu.htm">valu</a>e, ad<a href="dress.htm">dress</a><small>(this)</small>, _ex<a href="trad.htm">traD</a>ata)</small>;<br/>
return true;<br/>
}</small><br/>
}</small><br/>
<br/>
/**<br/>
* Destroy <a href="token.htm">token</a>s<br/>
*<br/>
* Remove `_<a href="valu.htm">valu</a>e` <a href="token.htm">token</a>s from the <a href="sys.htm">sys</a>tem irreversibly<br/>
*<br/>
* @param _<a href="valu.htm">valu</a>e the amount of <a href="mone.htm">mone</a>y to burn<br/>
*/<br/>
<a href="fun.htm">fun</a>ction burn<small>(<a href="ui.htm">ui</a>nt256 _<a href="valu.htm">valu</a>e)</small> public returns <small>(bool success)</small> <small>{<br/>
req<a href="ui.htm">ui</a>re<small>(balanceOf<small>[<a class="ext" href="https://msg.sender">msg.sender</a>]</small> >= _<a href="valu.htm">valu</a>e)</small>; // Check if the sender has enough<br/>
balanceOf<small>[<a class="ext" href="https://msg.sender">msg.sender</a>]</small> -= _<a href="valu.htm">valu</a>e; // Subtr<a href="act.htm">act</a> from the sender<br/>
totalSupply -= _<a href="valu.htm">valu</a>e; // Updates totalSupply<br/>
emit Burn<small>(<a class="ext" href="https://msg.sender">msg.sender</a>, _<a href="valu.htm">valu</a>e)</small>;<br/>
return true;<br/>
}</small><br/>
<br/>
/**<br/>
* Destroy <a href="token.htm">token</a>s from other account<br/>
*<br/>
* Remove `_<a href="valu.htm">valu</a>e` <a href="token.htm">token</a>s from the <a href="sys.htm">sys</a>tem irreversibly on behalf of `_from`.<br/>
*<br/>
* @param _from the ad<a href="dress.htm">dress</a> of the sender<br/>
* @param _<a href="valu.htm">valu</a>e the amount of <a href="mone.htm">mone</a>y to burn<br/>
*/<br/>
<a href="fun.htm">fun</a>ction burnFrom<small>(ad<a href="dress.htm">dress</a> _from,<a href="ui.htm"> ui</a>nt256 _<a href="valu.htm">valu</a>e)</small> public returns <small>(bool success)</small> <small>{<br/>
req<a href="ui.htm">ui</a>re<small>(balanceOf<small>[_from]</small> >= _<a href="valu.htm">valu</a>e)</small>; // Check if the targeted balance is enough<br/>
req<a href="ui.htm">ui</a>re<small>(_<a href="valu.htm">valu</a>e <= allowance<small>[_from]</small><small>[<a class="ext" href="https://msg.sender">msg.sender</a>]</small>)</small>; // Check allowance<br/>
balanceOf<small>[_from]</small> -= _<a href="valu.htm">valu</a>e; // Subtr<a href="act.htm">act</a> from the targeted balance<br/>
allowance<small>[_from]</small><small>[<a class="ext" href="https://msg.sender">msg.sender</a>]</small> -= _<a href="valu.htm">valu</a>e; // Subtr<a href="act.htm">act</a> from the sender's allowance<br/>
totalSupply -= _<a href="valu.htm">valu</a>e; // Update totalSupply<br/>
emit Burn<small>(_from, _<a href="valu.htm">valu</a>e)</small>;<br/>
return true;<br/>
}</small><br/>
}</small><br/>
<br/>
/******************************************/<br/>
/* ADVANCED <a href="token.htm">TOKEN</a> STARTS HERE */<br/>
/******************************************/<br/>
<br/>
<a href="contract.htm">contract</a> MyAdvanced<a href="token.htm">Token</a> is <a href="own.htm">own</a>ed, <a href="token.htm">Token</a>ERC20 <small>{<br/>
<br/>
<a href="ui.htm"> ui</a>nt256 public <a href="sell.htm">sell</a><a href="pric.htm">Pric</a>e;<br/>
<a href="ui.htm"> ui</a>nt256 public <a href="buy.htm">buy</a><a href="pric.htm">Pric</a>e;<br/>
<br/>
mapping <small>(ad<a href="dress.htm">dress</a> => bool)</small> public frozenAccount;<br/>
<br/>
/* This generates a public event on the <a href="bloc.htm">bloc</a>kchain that will notify clients */<br/>
event Frozen<a href="fund.htm">Fund</a>s<small>(ad<a href="dress.htm">dress</a> target, bool frozen)</small>;<br/>
<br/>
/* Initializes <a href="contract.htm">contract</a> with initial supply <a href="token.htm">token</a>s to the <a href="creat.htm">creat</a>or of the <a href="contract.htm">contract</a> */<br/>
con<a href="struc.htm">struc</a><a href="tor.htm">tor</a><small>(<br/>
<a href="ui.htm"> ui</a>nt256 initialSupply,<br/>
string memory <a href="token.htm">token</a>Name,<br/>
string memory <a href="token.htm">token</a>Symbol<br/>
)</small> <a href="token.htm">Token</a>ERC20<small>(initialSupply, <a href="token.htm">token</a>Name, <a href="token.htm">token</a>Symbol)</small> public <small>{}</small><br/>
<br/>
/* Internal <a href="trans.htm">trans</a>fer, only can be called by this <a href="contract.htm">contract</a> */<br/>
<a href="fun.htm">fun</a>ction _<a href="trans.htm">trans</a>fer<small>(ad<a href="dress.htm">dress</a> _from, ad<a href="dress.htm">dress</a> _to,<a href="ui.htm"> ui</a>nt _<a href="valu.htm">valu</a>e)</small> internal <small>{<br/>
req<a href="ui.htm">ui</a>re <small>(_to != ad<a href="dress.htm">dress</a><small>(0x0)</small>)</small>; // Prevent <a href="trans.htm">trans</a>fer to 0x0 ad<a href="dress.htm">dress</a>. <a href="use.htm">Use</a> burn<small>()</small> instead<br/>
req<a href="ui.htm">ui</a>re <small>(balanceOf<small>[_from]</small> >= _<a href="valu.htm">valu</a>e)</small>; // Check if the sender has enough<br/>
req<a href="ui.htm">ui</a>re <small>(balanceOf<small>[_to]</small> + _<a href="valu.htm">valu</a>e >= balanceOf<small>[_to]</small>)</small>; // Check for over<a href="flow.htm">flow</a>s<br/>
req<a href="ui.htm">ui</a>re<small>(!frozenAccount<small>[_from]</small>)</small>; // Check if sender is frozen<br/>
req<a href="ui.htm">ui</a>re<small>(!frozenAccount<small>[_to]</small>)</small>; // Check if <a href="recip.htm">recip</a>ient is frozen<br/>
balanceOf<small>[_from]</small> -= _<a href="valu.htm">valu</a>e; // Subtr<a href="act.htm">act</a> from the sender<br/>
balanceOf<small>[_to]</small> += _<a href="valu.htm">valu</a>e; // Add the same to the <a href="recip.htm">recip</a>ient<br/>
emit <a href="trans.htm">Trans</a>fer<small>(_from, _to, _<a href="valu.htm">valu</a>e)</small>;<br/>
}</small><br/>
<br/>
/// @not<a href="ice.htm">ice</a> <a href="creat.htm">Creat</a>e `<a href="mint.htm">mint</a>edAmount` <a href="token.htm">token</a>s and send it to `target`<br/>
/// @param target Ad<a href="dress.htm">dress</a> to receive the <a href="token.htm">token</a>s<br/>
/// @param <a href="mint.htm">mint</a>edAmount the amount of <a href="token.htm">token</a>s it will receive<br/>
<a href="fun.htm">fun</a>ction <a href="mint.htm">mint</a><a href="token.htm">Token</a><small>(ad<a href="dress.htm">dress</a> target,<a href="ui.htm"> ui</a>nt256 <a href="mint.htm">mint</a>edAmount)</small> only<a href="own.htm">Own</a>er public <small>{<br/>
balanceOf<small>[target]</small> += <a href="mint.htm">mint</a>edAmount;<br/>
totalSupply += <a href="mint.htm">mint</a>edAmount;<br/>
emit <a href="trans.htm">Trans</a>fer<small>(ad<a href="dress.htm">dress</a><small>(0)</small>, ad<a href="dress.htm">dress</a><small>(this)</small>, <a href="mint.htm">mint</a>edAmount)</small>;<br/>
emit <a href="trans.htm">Trans</a>fer<small>(ad<a href="dress.htm">dress</a><small>(this)</small>, target, <a href="mint.htm">mint</a>edAmount)</small>;<br/>
}</small><br/>
<br/>
/// @not<a href="ice.htm">ice</a> `<a href="free.htm">free</a>ze? Prevent | Allow` `target` from sending & receiving <a href="token.htm">token</a>s<br/>
/// @param target Ad<a href="dress.htm">dress</a> to be frozen<br/>
/// @param <a href="free.htm">free</a>ze either to <a href="free.htm">free</a>ze it or not<br/>
<a href="fun.htm">fun</a>ction <a href="free.htm">free</a>zeAccount<small>(ad<a href="dress.htm">dress</a> target, bool <a href="free.htm">free</a>ze)</small> only<a href="own.htm">Own</a>er public <small>{<br/>
frozenAccount<small>[target]</small> = <a href="free.htm">free</a>ze;<br/>
emit Frozen<a href="fund.htm">Fund</a>s<small>(target, <a href="free.htm">free</a>ze)</small>;<br/>
}</small><br/>
<br/>
/// @not<a href="ice.htm">ice</a> Allow <a href="use.htm">use</a>rs to <a href="buy.htm">buy</a> <a href="token.htm">token</a>s for `<a href="new.htm">new</a><a href="buy.htm">Buy</a><a href="pric.htm">Pric</a>e` eth and <a href="sell.htm">sell</a> <a href="token.htm">token</a>s for `<a href="new.htm">new</a><a href="sell.htm">Sell</a><a href="pric.htm">Pric</a>e` eth<br/>
/// @param <a href="new.htm">new</a><a href="sell.htm">Sell</a><a href="pric.htm">Pric</a>e <a href="pric.htm">Pric</a>e the <a href="use.htm">use</a>rs can <a href="sell.htm">sell</a> to the <a href="contract.htm">contract</a><br/>
/// @param <a href="new.htm">new</a><a href="buy.htm">Buy</a><a href="pric.htm">Pric</a>e <a href="pric.htm">Pric</a>e <a href="use.htm">use</a>rs can <a href="buy.htm">buy</a> from the <a href="contract.htm">contract</a><br/>
<a href="fun.htm">fun</a>ction set<a href="pric.htm">Pric</a>es<small>(<a href="ui.htm">ui</a>nt256 <a href="new.htm">new</a><a href="sell.htm">Sell</a><a href="pric.htm">Pric</a>e,<a href="ui.htm"> ui</a>nt256 <a href="new.htm">new</a><a href="buy.htm">Buy</a><a href="pric.htm">Pric</a>e)</small> only<a href="own.htm">Own</a>er public <small>{<br/>
<a href="sell.htm">sell</a><a href="pric.htm">Pric</a>e = <a href="new.htm">new</a><a href="sell.htm">Sell</a><a href="pric.htm">Pric</a>e;<br/>
<a href="buy.htm">buy</a><a href="pric.htm">Pric</a>e = <a href="new.htm">new</a><a href="buy.htm">Buy</a><a href="pric.htm">Pric</a>e;<br/>
}</small><br/>
<br/>
/// @not<a href="ice.htm">ice</a> <a href="buy.htm">Buy</a> <a href="token.htm">token</a>s from <a href="contract.htm">contract</a> by sending ether<br/>
<a href="fun.htm">fun</a>ction <a href="buy.htm">buy</a><small>()</small> <a href="pay.htm">pay</a>able public <small>{<br/>
<a href="ui.htm"> ui</a>nt amount = <a class="ext" href="https://msg.value">msg.value</a> / <a href="buy.htm">buy</a><a href="pric.htm">Pric</a>e; // calculates the amount<br/>
_<a href="trans.htm">trans</a>fer<small>(ad<a href="dress.htm">dress</a><small>(this)</small>, <a class="ext" href="https://msg.sender">msg.sender</a>, amount)</small>; // <a href="mak.htm">mak</a>es the <a href="trans.htm">trans</a>fers<br/>
}</small><br/>
<br/>
/// @not<a href="ice.htm">ice</a> <a href="sell.htm">Sell</a> `amount` <a href="token.htm">token</a>s to <a href="contract.htm">contract</a><br/>
/// @param amount amount of <a href="token.htm">token</a>s to be sold<br/>
<a href="fun.htm">fun</a>ction <a href="sell.htm">sell</a><small>(<a href="ui.htm">ui</a>nt256 amount)</small> public <small>{<br/>
ad<a href="dress.htm">dress</a> myAd<a href="dress.htm">dress</a> = ad<a href="dress.htm">dress</a><small>(this)</small>;<br/>
req<a href="ui.htm">ui</a>re<small>(<a class="ext" href="https://myAddress.balance">myAddress.balance</a> >= amount * <a href="sell.htm">sell</a><a href="pric.htm">Pric</a>e)</small>; // checks if the <a href="contract.htm">contract</a> has enough ether to <a href="buy.htm">buy</a><br/>
_<a href="trans.htm">trans</a>fer<small>(<a class="ext" href="https://msg.sender">msg.sender</a>, ad<a href="dress.htm">dress</a><small>(this)</small>, amount)</small>; // <a href="mak.htm">mak</a>es the <a href="trans.htm">trans</a>fers<br/>
<a class="ext" href="https://msg.sender.transfer(amount">msg.sender.transfer(amount</a> * <a href="sell.htm">sell</a><a href="pric.htm">Pric</a>e)</small>; // sends ether to the <a href="sell.htm">sell</a>er. It's important to do this last to <a href="avo.htm">avo</a>id recursion attacks<br/>
}</small><br/>
}</small><br/>
}</small><br/>
<br/>
<br/>
<hr/><span class="date">2019-04-26:</span> <a class="ext" href="https://Medium.com/minimum-viable-canvas">Medium.com/minimum-viable-canvas</a><br/>
<br/>
<hr/><span class="date">2019-04-22:</span> <a class="ext" href="https://LeanStack.com">LeanStack.com</a><br/>
<br/>
<hr/><span class="date">2019-04-13:</span> <a class="ext" href="https://TheNextSystem.org/learn/stories/resident-owned-community">TheNextSystem.org/learn/stories/resident-owned-community</a><br/>
<br/>
<hr/><span class="date">2019-04-12:</span> <a href="play.htm">Play</a>ing with <a class="ext" href="https://Pact.Kadena.io">Pact.Kadena.io</a> <a href="contract.htm">contract</a>s.<br/>
</p>
<p class='footer'>
Page generated from <a href=".txt/diary-2019-04">diary-2019-04</a> by <a href=".src/lens.el">lens.el</a>.</p>
</body>
</html>