tx · 2iPAeMrpEokwKj41kPuJB1sW11mMwp1M24EgdcXcUe5u 3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb: -0.01000000 Waves 2022.05.09 13:31 [2044021] smart account 3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb > SELF 0.00000000 Waves
{ "type": 13, "id": "2iPAeMrpEokwKj41kPuJB1sW11mMwp1M24EgdcXcUe5u", "fee": 1000000, "feeAssetId": null, "timestamp": 1652092320684, "version": 2, "chainId": 84, "sender": "3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb", "senderPublicKey": "FWSsBbeCwLVkekWhvNKtX6JkrZiruRybKKVuiS3F4bqN", "proofs": [ "5ccRnbj1CHcN7W1e9j6FSeguoBQUEPZL5Ai2M2aFet6cn6qZWpvceDJ5qEjLGL6sUSt4doPHD5ndekzNkejSCaKD" ], "script": "base64:AAIFAAAAAAAAABsIAhIDCgEIEgQKAggIEgUKAwgICBIFCgMICAgAAAASAAAAAApzaGlueXdnZ2lkAQAAACCJac8C/7a6udRxltd5uJl2JrB00Hd59HNuhvD0c58GJgAAAAAPdHJlYXN1cnlBZGRyZXNzAQAAABoBVGX48BYLBMBZQnAankiMl/9+3Bxi8t27/QAAAAAObmF0aW9uc0FkZHJlc3MBAAAAGgFUTYXo3vT4RGtZEDtwX8O3uWUOUfVERm2gAAAAAAxhZG1pbkFkZHJlc3MJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNNcE50aVBTUlNxNk5uYVFZazM4QmZXU3paY2dBWVR5clE5AAAAAAxCdWlsZFN0YXJ0ZWQCAAAADUJVSUxEX1NUQVJURUQAAAAADUJ1aWxkRmluaXNoZWQCAAAADkJVSUxEX0ZJTklTSEVEAAAAAAZBc3NldHMJAARMAAAAAgIAAAAEQ2l0eQkABEwAAAACAgAAAAdCYXJyYWNrCQAETAAAAAICAAAABEJhcm4JAARMAAAAAgIAAAAHV2FycmlvcgUAAAADbmlsAAAAAAphc3NldHNDb3N0CQAET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hpcyBvcGVyYXRpb24EAAAACG9sZE93bmVyCQEAAAAMdHJ5R2V0U3RyaW5nAAAAAQkAASwAAAACBQAAAAdhc3NldElkAgAAAAZfT3duZXIEAAAACmFzc2V0Q29pbnMJAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQUAAAAHYXNzZXRJZAQAAAAHcmVmQ2FsbAkAA/wAAAAECQEAAAAHQWRkcmVzcwAAAAEFAAAAD3RyZWFzdXJ5QWRkcmVzcwIAAAANdHJhbnNmZXJDb2lucwkABEwAAAACBQAAAAhvbGRPd25lcgkABEwAAAACBQAAAAl0b0FkZHJlc3MJAARMAAAAAgUAAAAKYXNzZXRDb2lucwUAAAADbmlsBQAAAANuaWwEAAAADGN1cnJlbnRQb3dlcgkBAAAAFG5hdGlvbnNUcnlHZXRJbnRlZ2VyAAAAAQUAAAAIb2xkT3duZXIEAAAACmFzc2V0UG93ZXIJAAGRAAAAAgUAAAALYXNzZXRzUG93ZXIJAQAAAAV2YWx1ZQAAAAEJAARPAAAAAgUAAAAGQXNzZXRzBQAAAAxzdHJBc3NldFR5cGUEAAAAAnB3CQAD/AAAAAQJAQAAAAdBZGRyZXNzAAAAAQUAAAAObmF0aW9uc0FkZHJlc3MCAAAADHNldFVzZXJQb3dlcgkABEwAAAACCQAEJQAAAAEIBQAAAAFpAAAABmNhbGxlcgkABEwAAAACCQAAZQAAAAIFAAAADGN1cnJlbnRQb3dlcgUAAAAKYXNzZXRQb3dlcgUAAAADbmlsBQAAAANuaWwJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAAHYXNzZXRJZAUAAAADbmlsAAAAAPHoavY=", "height": 2044021, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7D9Q1rgrgbDJFKgQa4vR1bMEN9Nfe7x5iozSENqKTu2s Next: 9DdCnLRnMEBZhEHzfmMP1BBnu2ZUHQhj3kB8U3EUVb4i Diff:
Old | New | Differences | |
---|---|---|---|
90 | 90 | else if ((y.payments[0].assetId != a)) | |
91 | 91 | then throw("Only $HEG payments allowed") | |
92 | 92 | else { | |
93 | - | let E = invoke(Address(b), "Deposit", nil, | |
93 | + | let E = invoke(Address(b), "Deposit", nil, y.payments) | |
94 | 94 | let F = [StringEntry(x(toString(y.originCaller), y.transactionId, z), e), StringEntry(u(y.transactionId, z), toString(y.originCaller)), IntegerEntry(v(toString(y.originCaller), y.transactionId, z), (height + B))] | |
95 | 95 | F | |
96 | 96 | } | |
120 | 120 | let P = j[O] | |
121 | 121 | let Q = h[O] | |
122 | 122 | let E = invoke(Address(b), "Pay", [toString(y.caller), Q], nil) | |
123 | - | let R = o(toString(y.caller)) | |
124 | - | let S = invoke(Address(c), "setUserPower", [toString(y.caller), (R + P)], nil) | |
125 | - | let F = [IntegerEntry(K, Q), DeleteEntry(I), DeleteEntry(J)] | |
126 | - | F | |
123 | + | if ((E == E)) | |
124 | + | then { | |
125 | + | let R = o(toString(y.caller)) | |
126 | + | let S = invoke(Address(c), "setUserPower", [toString(y.caller), (R + P)], nil) | |
127 | + | if ((S == S)) | |
128 | + | then { | |
129 | + | let F = [IntegerEntry(K, Q), DeleteEntry(I), DeleteEntry(J)] | |
130 | + | F | |
131 | + | } | |
132 | + | else throw("Strict value is not equal to itself.") | |
133 | + | } | |
134 | + | else throw("Strict value is not equal to itself.") | |
127 | 135 | } | |
128 | 136 | } | |
129 | 137 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'AFQS5E4ELtxex3iANtWtUU2V2oWJZSo8VVnK8z3VFmqf' | |
5 | 5 | ||
6 | 6 | let b = base58'3MyDGEoKp1gF4LSRknk9vSuDEyrwuYXcQEQ' | |
7 | 7 | ||
8 | 8 | let c = base58'3MvyzDtzWWV5MZ1GP8JfQhhQqiGU4Nbifdy' | |
9 | 9 | ||
10 | 10 | let d = addressFromStringValue("3MpNtiPSRSq6NnaQYk38BfWSzZcgAYTyrQ9") | |
11 | 11 | ||
12 | 12 | let e = "BUILD_STARTED" | |
13 | 13 | ||
14 | 14 | let f = "BUILD_FINISHED" | |
15 | 15 | ||
16 | 16 | let g = ["City", "Barrack", "Barn", "Warrior"] | |
17 | 17 | ||
18 | 18 | let h = [1000000000, 1000000000, 1000000000, 500000000] | |
19 | 19 | ||
20 | 20 | let i = [4, 4, 4, 2] | |
21 | 21 | ||
22 | 22 | let j = [1000, 500, 500, 0] | |
23 | 23 | ||
24 | 24 | func k (l) = { | |
25 | 25 | let m = getInteger(Address(b), l) | |
26 | 26 | if ($isInstanceOf(m, "Int")) | |
27 | 27 | then { | |
28 | 28 | let n = m | |
29 | 29 | n | |
30 | 30 | } | |
31 | 31 | else 0 | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func o (l) = { | |
36 | 36 | let m = getInteger(Address(b), l) | |
37 | 37 | if ($isInstanceOf(m, "Int")) | |
38 | 38 | then { | |
39 | 39 | let n = m | |
40 | 40 | n | |
41 | 41 | } | |
42 | 42 | else 0 | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func p (l) = { | |
47 | 47 | let m = getString(this, l) | |
48 | 48 | if ($isInstanceOf(m, "String")) | |
49 | 49 | then { | |
50 | 50 | let n = m | |
51 | 51 | n | |
52 | 52 | } | |
53 | 53 | else "" | |
54 | 54 | } | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func q (l) = { | |
58 | 58 | let m = getInteger(this, l) | |
59 | 59 | if ($isInstanceOf(m, "Int")) | |
60 | 60 | then { | |
61 | 61 | let n = m | |
62 | 62 | n | |
63 | 63 | } | |
64 | 64 | else 0 | |
65 | 65 | } | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func r (s,t) = ((t + "_") + toBase58String(s)) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func u (s,t) = (r(s, t) + "_Owner") | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func v (w,s,t) = (((w + "_") + r(s, t)) + "_fh") | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func x (w,s,t) = (((w + "_") + r(s, t)) + "_status") | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | @Callable(y) | |
81 | 81 | func StartBuild (z) = if (!(containsElement(g, z))) | |
82 | 82 | then throw("This asset is not amanged by the system") | |
83 | 83 | else { | |
84 | 84 | let A = value(indexOf(g, z)) | |
85 | 85 | let B = i[A] | |
86 | 86 | let C = h[A] | |
87 | 87 | let D = value(y.payments[0].amount) | |
88 | 88 | if ((C > D)) | |
89 | 89 | then throw(("You provided less $heg than the needed cost for building this " + z)) | |
90 | 90 | else if ((y.payments[0].assetId != a)) | |
91 | 91 | then throw("Only $HEG payments allowed") | |
92 | 92 | else { | |
93 | - | let E = invoke(Address(b), "Deposit", nil, | |
93 | + | let E = invoke(Address(b), "Deposit", nil, y.payments) | |
94 | 94 | let F = [StringEntry(x(toString(y.originCaller), y.transactionId, z), e), StringEntry(u(y.transactionId, z), toString(y.originCaller)), IntegerEntry(v(toString(y.originCaller), y.transactionId, z), (height + B))] | |
95 | 95 | F | |
96 | 96 | } | |
97 | 97 | } | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | ||
101 | 101 | @Callable(y) | |
102 | 102 | func FinishBuild (G,H) = { | |
103 | 103 | let s = fromBase58String(G) | |
104 | 104 | let I = x(toString(y.caller), s, H) | |
105 | 105 | let J = v(toString(y.caller), s, H) | |
106 | 106 | let K = r(s, H) | |
107 | 107 | let L = p(u(s, H)) | |
108 | 108 | if ((L != toString(y.caller))) | |
109 | 109 | then throw(("You cannot claim other's players " + H)) | |
110 | 110 | else { | |
111 | 111 | let M = p(I) | |
112 | 112 | if ((M == "")) | |
113 | 113 | then throw("No pending operations for this asset") | |
114 | 114 | else { | |
115 | 115 | let N = getIntegerValue(this, J) | |
116 | 116 | if ((N > height)) | |
117 | 117 | then throw((((("Building is not finished yet " + toString((N - height))) + " blocks remaining, it will take around ") + toString((N - height))) + " minutes")) | |
118 | 118 | else { | |
119 | 119 | let O = value(indexOf(g, H)) | |
120 | 120 | let P = j[O] | |
121 | 121 | let Q = h[O] | |
122 | 122 | let E = invoke(Address(b), "Pay", [toString(y.caller), Q], nil) | |
123 | - | let R = o(toString(y.caller)) | |
124 | - | let S = invoke(Address(c), "setUserPower", [toString(y.caller), (R + P)], nil) | |
125 | - | let F = [IntegerEntry(K, Q), DeleteEntry(I), DeleteEntry(J)] | |
126 | - | F | |
123 | + | if ((E == E)) | |
124 | + | then { | |
125 | + | let R = o(toString(y.caller)) | |
126 | + | let S = invoke(Address(c), "setUserPower", [toString(y.caller), (R + P)], nil) | |
127 | + | if ((S == S)) | |
128 | + | then { | |
129 | + | let F = [IntegerEntry(K, Q), DeleteEntry(I), DeleteEntry(J)] | |
130 | + | F | |
131 | + | } | |
132 | + | else throw("Strict value is not equal to itself.") | |
133 | + | } | |
134 | + | else throw("Strict value is not equal to itself.") | |
127 | 135 | } | |
128 | 136 | } | |
129 | 137 | } | |
130 | 138 | } | |
131 | 139 | ||
132 | 140 | ||
133 | 141 | ||
134 | 142 | @Callable(y) | |
135 | 143 | func transferOwnership (T,U,z) = if (if ((y.caller != d)) | |
136 | 144 | then (y.caller != this) | |
137 | 145 | else false) | |
138 | 146 | then throw("Only the admin can perform this operation") | |
139 | 147 | else { | |
140 | 148 | let V = p((T + "_Owner")) | |
141 | 149 | let R = o(V) | |
142 | 150 | let P = j[value(indexOf(g, z))] | |
143 | 151 | let S = invoke(Address(c), "setUserPower", [V, (R - P)], nil) | |
144 | 152 | let W = o(U) | |
145 | 153 | let X = invoke(Address(c), "setUserPower", [U, (R + P)], nil) | |
146 | 154 | [StringEntry((T + "_Owner"), U)] | |
147 | 155 | } | |
148 | 156 | ||
149 | 157 | ||
150 | 158 | ||
151 | 159 | @Callable(y) | |
152 | 160 | func destroyAssetAndTransfer (T,Y,z) = if (if ((y.caller != d)) | |
153 | 161 | then (y.caller != this) | |
154 | 162 | else false) | |
155 | 163 | then throw("Only the admin can perform this operation") | |
156 | 164 | else { | |
157 | 165 | let V = p((T + "_Owner")) | |
158 | 166 | let Q = q(T) | |
159 | 167 | let E = invoke(Address(b), "transferCoins", [V, Y, Q], nil) | |
160 | 168 | let R = o(V) | |
161 | 169 | let P = j[value(indexOf(g, z))] | |
162 | 170 | let S = invoke(Address(c), "setUserPower", [toString(y.caller), (R - P)], nil) | |
163 | 171 | [DeleteEntry(T)] | |
164 | 172 | } | |
165 | 173 | ||
166 | 174 |
github/deemru/w8io/169f3d6 45.67 ms ◑