tx · 9zSY659oHNi928rcGVZtGpudVui6ENEr61EceouzzUXW 3N4uWa2T9W2p4WgDwLPo3kWRp8eXRatp4vv: -0.01400000 Waves 2022.02.06 16:19 [1911799] smart account 3N4uWa2T9W2p4WgDwLPo3kWRp8eXRatp4vv > SELF 0.00000000 Waves
{ "type": 13, "id": "9zSY659oHNi928rcGVZtGpudVui6ENEr61EceouzzUXW", "fee": 1400000, "feeAssetId": null, "timestamp": 1644153605934, "version": 2, "chainId": 84, "sender": "3N4uWa2T9W2p4WgDwLPo3kWRp8eXRatp4vv", "senderPublicKey": "6pUz5KTgi8pySNF2EuYHUMBkXbTyxL7R7YWGgb2PkhgU", "proofs": [ "2kUfTjbhb2jGvwoupAtUmPHWSq7dA4tVmfntAd1EeedX3yMVJgHCqfdD1v7oDo3uBDSEahkyorB5wwAguHs9G9BH" ], "script": "base64:AAIFAAAAAAAAAAkIAhIAEgMKAQgAAAAQAAAAAAtlZ2dzQXNzZXRJZAEAAAAgF/4YCdBeNnPXi9mYwFve9iIGEZ5QZQVegfUQpkcQUdwAAAAAEGRlbGF5Rm9yQWRvcHRpb24AAAAAAAAAAAIAAAAAE2Rpc2NvdW50Q29lZmZpY2llbnQAAAAAAAAAAAoAAAAAC3R5cGVzQW1vdW50AAAAAAAAAAAJAAAAAA1SZWZlcmVyUmV3YXJkAAAAAAAAAAAFAAAAAA9BZG9wdGlvblN0YXJ0ZWQCAAAAEEFET1BUSU9OX1NUQVJURUQAAAAAEEFkb3B0aW9uRmluaXNoZWQCAAAAEUFET1BUSU9OX0ZJTklTSEVEAQAAABRnZXRBZG9wdGlvblN0YXR1c0tleQAAAAIAAAAHYWRkcmVzcwAAAAR0eElkCQABLAAAAAIJAAEsAAAAAgkAASwAAAACBQAAAAdhZGRyZXNzAgAAAAFfCQACWAAAAAEFAAAABHR4SWQCAAAAB19zdGF0dXMBAAAAGmdldEFkb3B0aW9uRmluaXNoSGVpZ2h0S2V5AAAAAgAAAAdhZGRyZXNzAAAABHR4SW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plexity": 0 } View: original | compacted Prev: CrhBvqsRNous5GskzWkxB4W38Lwg9g3f4j421dheyAfY Next: AeRLF5VgPooFZGhsQVYouBCkrSsCfjPTFyytP7jt7rVj Diff:
Old | New | Differences | |
---|---|---|---|
79 | 79 | ||
80 | 80 | ||
81 | 81 | @Callable(P) | |
82 | - | func | |
82 | + | func startPandaAdoption () = { | |
83 | 83 | let K = o("ducks_amount") | |
84 | 84 | let Q = J(K) | |
85 | 85 | let R = value(P.payments[0]) | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | @Callable(P) | |
97 | - | func | |
97 | + | func finishPandaAdoption (T) = { | |
98 | 98 | let j = fromBase58String(T) | |
99 | 99 | let U = h(toString(P.caller), j) | |
100 | 100 | let V = k(toString(P.caller), j) | |
101 | 101 | let W = l(toString(P.caller), j) | |
102 | 102 | let X = { | |
103 | - | let r = getBoolean(((" | |
103 | + | let r = getBoolean((("Adoption_" + T) + "_babyDuck")) | |
104 | 104 | if ($isInstanceOf(r, "Boolean")) | |
105 | 105 | then { | |
106 | 106 | let N = r | |
116 | 116 | throw(("The duck was hatched and claimed already, here is the folowing: " + Z)) | |
117 | 117 | } | |
118 | 118 | else if ((v > height)) | |
119 | - | then throw(((((" | |
119 | + | then throw((((("Adoption is not finished yet " + toString((v - height))) + " blocks remaining, it will take around ") + toString((v - height))) + " minutes")) | |
120 | 120 | else { | |
121 | 121 | let aa = B(j, v) | |
122 | 122 | let ab = aa._1 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'2cf6jyVG19oHU79R8iHfqFEesjstr3e7nSYEUhb2WagB' | |
5 | 5 | ||
6 | 6 | let b = 2 | |
7 | 7 | ||
8 | 8 | let c = 10 | |
9 | 9 | ||
10 | 10 | let d = 9 | |
11 | 11 | ||
12 | 12 | let e = 5 | |
13 | 13 | ||
14 | 14 | let f = "ADOPTION_STARTED" | |
15 | 15 | ||
16 | 16 | let g = "ADOPTION_FINISHED" | |
17 | 17 | ||
18 | 18 | func h (i,j) = (((i + "_") + toBase58String(j)) + "_status") | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func k (i,j) = (((i + "_") + toBase58String(j)) + "_fh") | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func l (i,j) = (((i + "_") + toBase58String(j)) + "_di") | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func m (n) = (("stats_" + n) + "_amount") | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func o (p) = { | |
31 | 31 | let q = { | |
32 | 32 | let r = getInteger(this, p) | |
33 | 33 | if ($isInstanceOf(r, "Int")) | |
34 | 34 | then { | |
35 | 35 | let s = r | |
36 | 36 | s | |
37 | 37 | } | |
38 | 38 | else 0 | |
39 | 39 | } | |
40 | 40 | q | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func t (u,j,v,w) = { | |
45 | 45 | let x = value(blockInfoByHeight((v - 1))) | |
46 | 46 | let y = sha256((j + value(x.vrf))) | |
47 | 47 | (toInt(y, (w * 8)) % u) | |
48 | 48 | } | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func z (A) = o(m(A)) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func B (j,v) = { | |
55 | 55 | let C = toString(t(6, j, v, 0)) | |
56 | 56 | let D = toString(t(5, j, v, 0)) | |
57 | 57 | let E = toString(t(3, j, v, 0)) | |
58 | 58 | let F = toString(t(43, j, v, 0)) | |
59 | 59 | let G = toString(t(34, j, v, 0)) | |
60 | 60 | let H = t(4, j, v, 1) | |
61 | 61 | let I = if ((H == 0)) | |
62 | 62 | then "R" | |
63 | 63 | else if ((H == 1)) | |
64 | 64 | then "G" | |
65 | 65 | else if ((H == 2)) | |
66 | 66 | then "B" | |
67 | 67 | else "Y" | |
68 | 68 | $Tuple2(((((((("PANDA-" + C) + D) + E) + F) + G) + "-") + I), "PANDA") | |
69 | 69 | } | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func J (K) = { | |
73 | 73 | let L = K | |
74 | 74 | let M = c | |
75 | 75 | let N = d | |
76 | 76 | let O = pow((100 + ((L * M) / (10 * N))), 2, 5, 1, 2, DOWN) | |
77 | 77 | (O * 1000000) | |
78 | 78 | } | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | @Callable(P) | |
82 | - | func | |
82 | + | func startPandaAdoption () = { | |
83 | 83 | let K = o("ducks_amount") | |
84 | 84 | let Q = J(K) | |
85 | 85 | let R = value(P.payments[0]) | |
86 | 86 | let S = [StringEntry(h(toString(P.originCaller), P.transactionId), f), IntegerEntry(k(toString(P.originCaller), P.transactionId), (height + b)), IntegerEntry("ducks_amount", (K + 1)), IntegerEntry("ducks_last_price", (Q / 1000000))] | |
87 | 87 | if ((R.assetId != a)) | |
88 | 88 | then throw(("You can attach only EGG tokens with the following asset id: " + toBase58String(a))) | |
89 | 89 | else if ((Q > R.amount)) | |
90 | 90 | then throw(("To hatch a duck you currently need the following amount of EGGlets: " + toString(Q))) | |
91 | 91 | else (S ++ [ScriptTransfer(P.caller, (R.amount - Q), a)]) | |
92 | 92 | } | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | ||
96 | 96 | @Callable(P) | |
97 | - | func | |
97 | + | func finishPandaAdoption (T) = { | |
98 | 98 | let j = fromBase58String(T) | |
99 | 99 | let U = h(toString(P.caller), j) | |
100 | 100 | let V = k(toString(P.caller), j) | |
101 | 101 | let W = l(toString(P.caller), j) | |
102 | 102 | let X = { | |
103 | - | let r = getBoolean(((" | |
103 | + | let r = getBoolean((("Adoption_" + T) + "_babyDuck")) | |
104 | 104 | if ($isInstanceOf(r, "Boolean")) | |
105 | 105 | then { | |
106 | 106 | let N = r | |
107 | 107 | N | |
108 | 108 | } | |
109 | 109 | else false | |
110 | 110 | } | |
111 | 111 | let Y = getStringValue(this, U) | |
112 | 112 | let v = getIntegerValue(this, V) | |
113 | 113 | if ((Y == g)) | |
114 | 114 | then { | |
115 | 115 | let Z = getStringValue(this, l(toString(P.caller), j)) | |
116 | 116 | throw(("The duck was hatched and claimed already, here is the folowing: " + Z)) | |
117 | 117 | } | |
118 | 118 | else if ((v > height)) | |
119 | - | then throw(((((" | |
119 | + | then throw((((("Adoption is not finished yet " + toString((v - height))) + " blocks remaining, it will take around ") + toString((v - height))) + " minutes")) | |
120 | 120 | else { | |
121 | 121 | let aa = B(j, v) | |
122 | 122 | let ab = aa._1 | |
123 | 123 | let ac = aa._2 | |
124 | 124 | let ad = (("{\"genotype\": \"" + ab) + "\", \"crossbreeding\": true}") | |
125 | 125 | let ae = Issue(ab, ad, 1, 0, false, unit, v) | |
126 | 126 | let af = calculateAssetId(ae) | |
127 | 127 | let ag = (o(m(ab)) + 1) | |
128 | 128 | [StringEntry(U, g), StringEntry(W, toBase58String(af)), StringEntry(toBase58String(af), W), BooleanEntry((("duck_" + toBase58String(af)) + "_grown"), X), IntegerEntry(m(ab), ag), IntegerEntry((("stats_" + ac) + "_quantity"), (o((("stats_" + ac) + "_quantity")) + 1)), ae, ScriptTransfer(P.caller, 1, af)] | |
129 | 129 | } | |
130 | 130 | } | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | @Verifier(ah) | |
134 | 134 | func ai () = sigVerify(ah.bodyBytes, ah.proofs[0], ah.senderPublicKey) | |
135 | 135 |
github/deemru/w8io/169f3d6 39.35 ms ◑