8 | | - | let c = "iterationsCount" |
---|
9 | | - | |
---|
10 | | - | let d = "incrementCounter" |
---|
11 | | - | |
---|
12 | | - | let e = "currentBalance" |
---|
13 | | - | |
---|
14 | | - | let f = "isActive" |
---|
15 | | - | |
---|
16 | | - | let g = 96 |
---|
17 | | - | |
---|
18 | | - | let h = valueOrErrorMessage(getInteger(this, b), "Last iteration store read error") |
---|
19 | | - | |
---|
20 | | - | let i = valueOrErrorMessage(getInteger(this, c), "Iteration store read error") |
---|
21 | | - | |
---|
22 | | - | let j = valueOrErrorMessage(getInteger(this, d), "Increment store read error") |
---|
23 | | - | |
---|
24 | | - | let k = valueOrErrorMessage(getInteger(this, e), "Balance store read error") |
---|
25 | | - | |
---|
26 | | - | let l = valueOrErrorMessage(getInteger(this, "usersCounter"), "Range store read error") |
---|
27 | | - | |
---|
28 | | - | let m = valueOrElse(getBoolean(this, f), false) |
---|
29 | | - | |
---|
30 | | - | @Callable(n) |
---|
31 | | - | func enableMassIncrement (o) = if (m) |
---|
32 | | - | then throw("Function blocked") |
---|
33 | | - | else { |
---|
34 | | - | let p = fraction(1, l, g) |
---|
35 | | - | let q = (l % g) |
---|
36 | | - | let r = getStringValue(this, ((o + a) + toString((l - 1)))) |
---|
37 | | - | let s = split(r, a) |
---|
38 | | - | let t = (parseIntValue(s[1]) + 1) |
---|
39 | | - | [IntegerEntry(b, q), IntegerEntry(c, p), IntegerEntry(d, 0), IntegerEntry(e, t)] |
---|
40 | | - | } |
---|
| 6 | + | @Callable(a) |
---|
| 7 | + | func tokenIssuance () = { |
---|
| 8 | + | let b = "BebraToken" |
---|
| 9 | + | let c = "Bebra by Kringe" |
---|
| 10 | + | let d = 10000000 |
---|
| 11 | + | let e = 0 |
---|
| 12 | + | let f = true |
---|
| 13 | + | let g = Issue(b, c, d, e, f, unit, 0) |
---|
| 14 | + | let h = calculateAssetId(g) |
---|
| 15 | + | let i = "Token" |
---|
| 16 | + | let j = valueOrErrorMessage(getString(this, i), "BebraToken is not defined") |
---|
| 17 | + | let k = a.caller |
---|
| 18 | + | [g, StringEntry(i, j), ScriptTransfer(k, 2000, h)] |
---|
| 19 | + | } |
---|
44 | | - | @Callable(n) |
---|
45 | | - | func massIncrement (o) = if ((i != 0)) |
---|
46 | | - | then { |
---|
47 | | - | let u = reentrantInvoke(this, "incrementStore", [g, o], nil) |
---|
48 | | - | if ((u == u)) |
---|
49 | | - | then [IntegerEntry(d, (j + g)), IntegerEntry(c, (i - 1)), BooleanEntry(f, true)] |
---|
50 | | - | else throw("Strict value is not equal to itself.") |
---|
51 | | - | } |
---|
52 | | - | else if (if ((i == 0)) |
---|
53 | | - | then (h != 0) |
---|
54 | | - | else false) |
---|
55 | | - | then { |
---|
56 | | - | let v = reentrantInvoke(this, "incrementStore", [h, o], nil) |
---|
57 | | - | if ((v == v)) |
---|
58 | | - | then [IntegerEntry(d, (j + h)), IntegerEntry(b, 0), BooleanEntry(f, false)] |
---|
59 | | - | else throw("Strict value is not equal to itself.") |
---|
60 | | - | } |
---|
61 | | - | else throw("Storage is incremented") |
---|
| 23 | + | @Callable(a) |
---|
| 24 | + | func tokenTransfer (l) = { |
---|
| 25 | + | let k = toBase58String(a.caller.bytes) |
---|
| 26 | + | nil |
---|
| 27 | + | } |
---|
64 | | - | |
---|
65 | | - | @Callable(n) |
---|
66 | | - | func incrementStore (l,o) = if ((l >= 0)) |
---|
67 | | - | then { |
---|
68 | | - | let w = ((toString(n.originCaller) + a) + toString(k)) |
---|
69 | | - | let x = invoke(this, "incrementStore", [(l - 1), o], nil) |
---|
70 | | - | if ((x == x)) |
---|
71 | | - | then [StringEntry(((o + a) + toString((l + j))), w)] |
---|
72 | | - | else throw("Strict value is not equal to itself.") |
---|
73 | | - | } |
---|
74 | | - | else nil |
---|
75 | | - | |
---|
| 30 | + | @Verifier(m) |
---|
| 31 | + | func n () = sigVerify(m.bodyBytes, m.proofs[0], m.senderPublicKey) |
---|