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