tx · 6d77RbPSXSqwXUdHk2bKgv6MwHqT8jXEzUYvq5NsFTY9 3N4uWa2T9W2p4WgDwLPo3kWRp8eXRatp4vv: -0.01400000 Waves 2021.12.28 13:28 [1853971] smart account 3N4uWa2T9W2p4WgDwLPo3kWRp8eXRatp4vv > SELF 0.00000000 Waves
{ "type": 13, "id": "6d77RbPSXSqwXUdHk2bKgv6MwHqT8jXEzUYvq5NsFTY9", "fee": 1400000, "feeAssetId": null, "timestamp": 1640687374875, "version": 2, "chainId": 84, "sender": "3N4uWa2T9W2p4WgDwLPo3kWRp8eXRatp4vv", "senderPublicKey": "6pUz5KTgi8pySNF2EuYHUMBkXbTyxL7R7YWGgb2PkhgU", "proofs": [ "4BXmeWzvup4XoMssBbGejb2BnhZBQVtes4CdKCLZLekunxrJpyx7ZyTjaFTpKb76FomTqten2JTod8ap7aipRsz5" ], "script": "base64:AAIFAAAAAAAAA88IAhIAEgMKAQgaCAoBQRIDZ2VuGhIKAUISDWdldFJhbmRvbU5hbWUaDQoBQxIIcmFuZG9tTm8aCQoBRBIEdHlwZRoPCgFFEgpnZW5lcmF0aW9uGhoKAUYSFWNvdW50RWdnc05lZWRlZEFtb3VudBoVCgFHEhB0b3RhbER1Y2tzQW1vdW50GgYKAUgSAW4aBgoBSRIBZxoGCgFKEgF0GgoKAUsSBXByaWNlGgYKAUwSAWkaDwoBTRIKZWdnc05lZWRlZBoRCgFOEgxmaXJzdFBheW1lbnQaDAoBTxIHcmVzdWx0cxoMCgFQEgd0eElkU3RyGhYKAVESEWhhdGNoaW5nU3RhdHVzS2V5GhQKAVISD2ZpbmlzaEhlaWdodEtleRoOCgFTEglkdWNrSWRLZXkaEQoBVBIMZHVja0Zyb21CYWJ5GhUKAVUSEGhhdGNoaW5nVHhTdGF0dXMaCwoBVhIGZHVja0lkGg0KAVcSCG5hbWVEYXRhGgwKAVgSB2R1Y2tHZW4aDAoBWRIHZmFybUdlbhoQCgFaEgtkZXNjcmlwdGlvbhoQCgFhEgtlZ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QACWAAAAAEFAAAAAmFiBQAAAAFTCQAETAAAAAIJAQAAAAxCb29sZWFuRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAFZHVja18JAAJYAAAAAQUAAAACYWICAAAABl9ncm93bgUAAAABVAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkBAAAAAW0AAAABBQAAAAFYBQAAAAJhYwkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQABLAAAAAICAAAABnN0YXRzXwUAAAABWQIAAAAJX3F1YW50aXR5CQAAZAAAAAIJAQAAAAFvAAAAAQkAASwAAAACCQABLAAAAAICAAAABnN0YXRzXwUAAAABWQIAAAAJX3F1YW50aXR5AAAAAAAAAAABCQAETAAAAAIFAAAAAmFhCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFMAAAABmNhbGxlcgAAAAAAAAAAAQUAAAACYWIFAAAAA25pbAAAAAEAAAACYWQBAAAAAmFlAAAAAAkAAfQAAAADCAUAAAACYWQAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJhZAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJhZAAAAA9zZW5kZXJQdWJsaWNLZXk2gaq7", "height": 1853971, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3NHwcZZ1t57S5W2ZdovYAvqq8z4AeiPKZVjJ6L1PWw7S Next: GyaaqetgF6XnsNAow43fASKab58SKajemYtbDYvBiYcC Diff:
Old | New | Differences | |
---|---|---|---|
52 | 52 | ||
53 | 53 | ||
54 | 54 | func B (j,v) = { | |
55 | - | let C = t(500, j, v, 0) | |
56 | - | if (if ((C == 111)) | |
57 | - | then (z("DUCK-WWWWWWWM-JU") == 0) | |
58 | - | else false) | |
59 | - | then $Tuple2("DUCK-WWWWWWWM-JU", "8W-J") | |
60 | - | else { | |
61 | - | let D = t(4, j, v, 0) | |
62 | - | let E = t(4, j, v, 1) | |
63 | - | let F = if ((E == 0)) | |
64 | - | then "Y" | |
65 | - | else if ((E == 1)) | |
66 | - | then "G" | |
67 | - | else if ((E == 2)) | |
68 | - | then "B" | |
69 | - | else "R" | |
70 | - | if ((D == 0)) | |
71 | - | then $Tuple2(("DUCK-FFFFFFFF-G" + F), "8F-G") | |
72 | - | else if ((D == 1)) | |
73 | - | then $Tuple2(("DUCK-HHHHHHHH-G" + F), "8H-G") | |
74 | - | else if ((D == 2)) | |
75 | - | then $Tuple2(("DUCK-GGGGGGGG-G" + F), "8G-G") | |
76 | - | else $Tuple2(("DUCK-IIIIIIII-G" + F), "8I-G") | |
77 | - | } | |
55 | + | let C = t(4000, j, v, 0) | |
56 | + | let D = if ((C > 2000)) | |
57 | + | then "DOG" | |
58 | + | else "DRAGON" | |
59 | + | let E = (C % 2000) | |
60 | + | if ((E > 1800)) | |
61 | + | then $Tuple2(((D + "-WW-") + toString(C)), (D + "-WW")) | |
62 | + | else if ((E > 1600)) | |
63 | + | then $Tuple2(((D + "-TG-") + toString(C)), (D + "-TG")) | |
64 | + | else if ((E > 1400)) | |
65 | + | then $Tuple2(((D + "-T-") + toString(C)), (D + "-T")) | |
66 | + | else if ((E > 1200)) | |
67 | + | then $Tuple2(((D + "-ST-") + toString(C)), (D + "-ST")) | |
68 | + | else if ((E > 1000)) | |
69 | + | then $Tuple2(((D + "-SD-") + toString(C)), (D + "-SD")) | |
70 | + | else if ((E > 800)) | |
71 | + | then $Tuple2(((D + "-SG-") + toString(C)), (D + "-SG")) | |
72 | + | else if ((E > 600)) | |
73 | + | then $Tuple2(((D + "-PE-") + toString(C)), (D + "-PE")) | |
74 | + | else if ((E > 400)) | |
75 | + | then $Tuple2(((D + "-M-") + toString(C)), (D + "-M")) | |
76 | + | else if ((E > 200)) | |
77 | + | then $Tuple2(((D + "-LOG-") + toString(C)), (D + "-LOG")) | |
78 | + | else if ((E > 0)) | |
79 | + | then $Tuple2(((D + "-D-") + toString(C)), (D + "-D")) | |
80 | + | else $Tuple2((D + "-D-1"), (D + "-D")) | |
78 | 81 | } | |
79 | 82 | ||
80 | 83 | ||
81 | - | func | |
82 | - | let | |
83 | - | let | |
84 | - | let | |
85 | - | let | |
86 | - | ( | |
84 | + | func F (G) = { | |
85 | + | let H = G | |
86 | + | let I = c | |
87 | + | let J = d | |
88 | + | let K = pow((100 + ((H * I) / (10 * J))), 2, 5, 1, 2, DOWN) | |
89 | + | (K * 1000000) | |
87 | 90 | } | |
88 | 91 | ||
89 | 92 | ||
90 | - | @Callable( | |
93 | + | @Callable(L) | |
91 | 94 | func startDuckHatching () = { | |
92 | - | let | |
93 | - | let | |
94 | - | let | |
95 | - | let | |
96 | - | if (( | |
95 | + | let G = o("ducks_amount") | |
96 | + | let M = F(G) | |
97 | + | let N = value(L.payments[0]) | |
98 | + | let O = [StringEntry(h(toString(L.originCaller), L.transactionId), f), IntegerEntry(k(toString(L.originCaller), L.transactionId), (height + b)), IntegerEntry("ducks_amount", (G + 1)), IntegerEntry("ducks_last_price", (M / 1000000))] | |
99 | + | if ((N.assetId != a)) | |
97 | 100 | then throw(("You can attach only EGG tokens with the following asset id: " + toBase58String(a))) | |
98 | - | else if (( | |
99 | - | then throw(("To hatch a duck you currently need the following amount of EGGlets: " + toString( | |
100 | - | else ( | |
101 | + | else if ((M > N.amount)) | |
102 | + | then throw(("To hatch a duck you currently need the following amount of EGGlets: " + toString(M))) | |
103 | + | else (O ++ [ScriptTransfer(L.caller, (N.amount - M), a)]) | |
101 | 104 | } | |
102 | 105 | ||
103 | 106 | ||
104 | 107 | ||
105 | - | @Callable( | |
106 | - | func finishDuckHatching ( | |
107 | - | let j = fromBase58String( | |
108 | - | let | |
109 | - | let | |
110 | - | let | |
111 | - | let | |
112 | - | let r = getBoolean((("hatching_" + | |
108 | + | @Callable(L) | |
109 | + | func finishDuckHatching (P) = { | |
110 | + | let j = fromBase58String(P) | |
111 | + | let Q = h(toString(L.caller), j) | |
112 | + | let R = k(toString(L.caller), j) | |
113 | + | let S = l(toString(L.caller), j) | |
114 | + | let T = { | |
115 | + | let r = getBoolean((("hatching_" + P) + "_babyDuck")) | |
113 | 116 | if ($isInstanceOf(r, "Boolean")) | |
114 | 117 | then { | |
115 | - | let | |
116 | - | | |
118 | + | let J = r | |
119 | + | J | |
117 | 120 | } | |
118 | 121 | else false | |
119 | 122 | } | |
120 | - | let | |
121 | - | let v = getIntegerValue(this, | |
122 | - | if (( | |
123 | + | let U = getStringValue(this, Q) | |
124 | + | let v = getIntegerValue(this, R) | |
125 | + | if ((U == g)) | |
123 | 126 | then { | |
124 | - | let | |
125 | - | throw(("The duck was hatched and claimed already, here is the folowing: " + | |
127 | + | let V = getStringValue(this, l(toString(L.caller), j)) | |
128 | + | throw(("The duck was hatched and claimed already, here is the folowing: " + V)) | |
126 | 129 | } | |
127 | 130 | else if ((v > height)) | |
128 | 131 | then throw((((("Hatching is not finished yet " + toString((v - height))) + " blocks remaining, it will take around ") + toString((v - height))) + " minutes")) | |
129 | 132 | else { | |
130 | - | let | |
131 | - | let | |
132 | - | let | |
133 | - | let | |
134 | - | let | |
135 | - | let | |
136 | - | let | |
137 | - | [StringEntry( | |
133 | + | let W = B(j, v) | |
134 | + | let X = W._1 | |
135 | + | let Y = W._2 | |
136 | + | let Z = (("{\"genotype\": \"" + X) + "\", \"crossbreeding\": true}") | |
137 | + | let aa = Issue(X, Z, 1, 0, false, unit, v) | |
138 | + | let ab = calculateAssetId(aa) | |
139 | + | let ac = (o(m(X)) + 1) | |
140 | + | [StringEntry(Q, g), StringEntry(S, toBase58String(ab)), StringEntry(toBase58String(ab), S), BooleanEntry((("duck_" + toBase58String(ab)) + "_grown"), T), IntegerEntry(m(X), ac), IntegerEntry((("stats_" + Y) + "_quantity"), (o((("stats_" + Y) + "_quantity")) + 1)), aa, ScriptTransfer(L.caller, 1, ab)] | |
138 | 141 | } | |
139 | 142 | } | |
140 | 143 | ||
141 | 144 | ||
142 | - | @Verifier( | |
143 | - | func | |
145 | + | @Verifier(ad) | |
146 | + | func ae () = sigVerify(ad.bodyBytes, ad.proofs[0], ad.senderPublicKey) | |
144 | 147 |
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 | - | let C = t(500, j, v, 0) | |
56 | - | if (if ((C == 111)) | |
57 | - | then (z("DUCK-WWWWWWWM-JU") == 0) | |
58 | - | else false) | |
59 | - | then $Tuple2("DUCK-WWWWWWWM-JU", "8W-J") | |
60 | - | else { | |
61 | - | let D = t(4, j, v, 0) | |
62 | - | let E = t(4, j, v, 1) | |
63 | - | let F = if ((E == 0)) | |
64 | - | then "Y" | |
65 | - | else if ((E == 1)) | |
66 | - | then "G" | |
67 | - | else if ((E == 2)) | |
68 | - | then "B" | |
69 | - | else "R" | |
70 | - | if ((D == 0)) | |
71 | - | then $Tuple2(("DUCK-FFFFFFFF-G" + F), "8F-G") | |
72 | - | else if ((D == 1)) | |
73 | - | then $Tuple2(("DUCK-HHHHHHHH-G" + F), "8H-G") | |
74 | - | else if ((D == 2)) | |
75 | - | then $Tuple2(("DUCK-GGGGGGGG-G" + F), "8G-G") | |
76 | - | else $Tuple2(("DUCK-IIIIIIII-G" + F), "8I-G") | |
77 | - | } | |
55 | + | let C = t(4000, j, v, 0) | |
56 | + | let D = if ((C > 2000)) | |
57 | + | then "DOG" | |
58 | + | else "DRAGON" | |
59 | + | let E = (C % 2000) | |
60 | + | if ((E > 1800)) | |
61 | + | then $Tuple2(((D + "-WW-") + toString(C)), (D + "-WW")) | |
62 | + | else if ((E > 1600)) | |
63 | + | then $Tuple2(((D + "-TG-") + toString(C)), (D + "-TG")) | |
64 | + | else if ((E > 1400)) | |
65 | + | then $Tuple2(((D + "-T-") + toString(C)), (D + "-T")) | |
66 | + | else if ((E > 1200)) | |
67 | + | then $Tuple2(((D + "-ST-") + toString(C)), (D + "-ST")) | |
68 | + | else if ((E > 1000)) | |
69 | + | then $Tuple2(((D + "-SD-") + toString(C)), (D + "-SD")) | |
70 | + | else if ((E > 800)) | |
71 | + | then $Tuple2(((D + "-SG-") + toString(C)), (D + "-SG")) | |
72 | + | else if ((E > 600)) | |
73 | + | then $Tuple2(((D + "-PE-") + toString(C)), (D + "-PE")) | |
74 | + | else if ((E > 400)) | |
75 | + | then $Tuple2(((D + "-M-") + toString(C)), (D + "-M")) | |
76 | + | else if ((E > 200)) | |
77 | + | then $Tuple2(((D + "-LOG-") + toString(C)), (D + "-LOG")) | |
78 | + | else if ((E > 0)) | |
79 | + | then $Tuple2(((D + "-D-") + toString(C)), (D + "-D")) | |
80 | + | else $Tuple2((D + "-D-1"), (D + "-D")) | |
78 | 81 | } | |
79 | 82 | ||
80 | 83 | ||
81 | - | func | |
82 | - | let | |
83 | - | let | |
84 | - | let | |
85 | - | let | |
86 | - | ( | |
84 | + | func F (G) = { | |
85 | + | let H = G | |
86 | + | let I = c | |
87 | + | let J = d | |
88 | + | let K = pow((100 + ((H * I) / (10 * J))), 2, 5, 1, 2, DOWN) | |
89 | + | (K * 1000000) | |
87 | 90 | } | |
88 | 91 | ||
89 | 92 | ||
90 | - | @Callable( | |
93 | + | @Callable(L) | |
91 | 94 | func startDuckHatching () = { | |
92 | - | let | |
93 | - | let | |
94 | - | let | |
95 | - | let | |
96 | - | if (( | |
95 | + | let G = o("ducks_amount") | |
96 | + | let M = F(G) | |
97 | + | let N = value(L.payments[0]) | |
98 | + | let O = [StringEntry(h(toString(L.originCaller), L.transactionId), f), IntegerEntry(k(toString(L.originCaller), L.transactionId), (height + b)), IntegerEntry("ducks_amount", (G + 1)), IntegerEntry("ducks_last_price", (M / 1000000))] | |
99 | + | if ((N.assetId != a)) | |
97 | 100 | then throw(("You can attach only EGG tokens with the following asset id: " + toBase58String(a))) | |
98 | - | else if (( | |
99 | - | then throw(("To hatch a duck you currently need the following amount of EGGlets: " + toString( | |
100 | - | else ( | |
101 | + | else if ((M > N.amount)) | |
102 | + | then throw(("To hatch a duck you currently need the following amount of EGGlets: " + toString(M))) | |
103 | + | else (O ++ [ScriptTransfer(L.caller, (N.amount - M), a)]) | |
101 | 104 | } | |
102 | 105 | ||
103 | 106 | ||
104 | 107 | ||
105 | - | @Callable( | |
106 | - | func finishDuckHatching ( | |
107 | - | let j = fromBase58String( | |
108 | - | let | |
109 | - | let | |
110 | - | let | |
111 | - | let | |
112 | - | let r = getBoolean((("hatching_" + | |
108 | + | @Callable(L) | |
109 | + | func finishDuckHatching (P) = { | |
110 | + | let j = fromBase58String(P) | |
111 | + | let Q = h(toString(L.caller), j) | |
112 | + | let R = k(toString(L.caller), j) | |
113 | + | let S = l(toString(L.caller), j) | |
114 | + | let T = { | |
115 | + | let r = getBoolean((("hatching_" + P) + "_babyDuck")) | |
113 | 116 | if ($isInstanceOf(r, "Boolean")) | |
114 | 117 | then { | |
115 | - | let | |
116 | - | | |
118 | + | let J = r | |
119 | + | J | |
117 | 120 | } | |
118 | 121 | else false | |
119 | 122 | } | |
120 | - | let | |
121 | - | let v = getIntegerValue(this, | |
122 | - | if (( | |
123 | + | let U = getStringValue(this, Q) | |
124 | + | let v = getIntegerValue(this, R) | |
125 | + | if ((U == g)) | |
123 | 126 | then { | |
124 | - | let | |
125 | - | throw(("The duck was hatched and claimed already, here is the folowing: " + | |
127 | + | let V = getStringValue(this, l(toString(L.caller), j)) | |
128 | + | throw(("The duck was hatched and claimed already, here is the folowing: " + V)) | |
126 | 129 | } | |
127 | 130 | else if ((v > height)) | |
128 | 131 | then throw((((("Hatching is not finished yet " + toString((v - height))) + " blocks remaining, it will take around ") + toString((v - height))) + " minutes")) | |
129 | 132 | else { | |
130 | - | let | |
131 | - | let | |
132 | - | let | |
133 | - | let | |
134 | - | let | |
135 | - | let | |
136 | - | let | |
137 | - | [StringEntry( | |
133 | + | let W = B(j, v) | |
134 | + | let X = W._1 | |
135 | + | let Y = W._2 | |
136 | + | let Z = (("{\"genotype\": \"" + X) + "\", \"crossbreeding\": true}") | |
137 | + | let aa = Issue(X, Z, 1, 0, false, unit, v) | |
138 | + | let ab = calculateAssetId(aa) | |
139 | + | let ac = (o(m(X)) + 1) | |
140 | + | [StringEntry(Q, g), StringEntry(S, toBase58String(ab)), StringEntry(toBase58String(ab), S), BooleanEntry((("duck_" + toBase58String(ab)) + "_grown"), T), IntegerEntry(m(X), ac), IntegerEntry((("stats_" + Y) + "_quantity"), (o((("stats_" + Y) + "_quantity")) + 1)), aa, ScriptTransfer(L.caller, 1, ab)] | |
138 | 141 | } | |
139 | 142 | } | |
140 | 143 | ||
141 | 144 | ||
142 | - | @Verifier( | |
143 | - | func | |
145 | + | @Verifier(ad) | |
146 | + | func ae () = sigVerify(ad.bodyBytes, ad.proofs[0], ad.senderPublicKey) | |
144 | 147 |
github/deemru/w8io/03bedc9 61.26 ms ◑![]()