tx · 4NhUFScTcSx5xSxNWpRzN1jTzchBzMSeJBTERxai415b 3Mzms5gHUDYufDRjSVN7g9DcCMG77pzFN4h: -0.01400000 Waves 2021.10.07 15:13 [1735799] smart account 3Mzms5gHUDYufDRjSVN7g9DcCMG77pzFN4h > SELF 0.00000000 Waves
{ "type": 13, "id": "4NhUFScTcSx5xSxNWpRzN1jTzchBzMSeJBTERxai415b", "fee": 1400000, "feeAssetId": null, "timestamp": 1633608864218, "version": 2, "chainId": 84, "sender": "3Mzms5gHUDYufDRjSVN7g9DcCMG77pzFN4h", "senderPublicKey": "CU8dJ2mJQjVBWaDHwXjPztuVdy9XAyAnTuqSCKuNPARn", "proofs": [ "3ESyTvfKPYs3Ljco2ibMNe86CYPVBpCUeiQTFYENndYd71cUYTa6F4MJMjb9cV216q7jeu9hQKsigKg76Cwo6G8j" ], "script": "base64:AAIFAAAAAAAAAB0IAhIDCgEBEgASBwoFCAgICAgSBAoCCAgSAwoBCAAAAA0AAAAAD3N0b3JhZ2VWZXJpZmllcgkBAAAABXZhbHVlAAAAAQkABCYAAAABAgAAACMzTjJzNVJ0YUhQQmVuQ3N4MkVDY29GUmJZSHgzbm9aaFhXMQAAAAAJc2lnbkFkbWluAgAAACMzTjF3UGdIRnRlem1SVkJhcW9valA4WEp3VGthcms0aGJpZgAAAAAIZmVlQWRtaW4CAAAAIzNNdnVqVVpUdG9BTlJ6cktZS3p4OTlWdGI5VFVoNlZQQ0RtAAAAAARiYW5rAgAAACMzTjFFNnRYZGRSb1ZhUmZROWRRM3ZnNUxhVzJmc2Q4SEt1YgAAAAANYWNjZXB0ZWRUb2tlbgEAAAAgYfHkwqhFFD81I1SLw0GO/ozjwqWx6THXqSKcOOhu9fcAAAAAD2FjY2VwdGVkRGVjaW1hbAAAAAAABfXhAAAAAAAIc3dvcERhcHAJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQIAAAAjM04yMlN2dEJ3ZkdjMUJ3RXJYNVlReDNXemFjRGljZk1wTHIAAA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F0aW9uSWQCAAAAAV8FAAAADWNhbGxlckFkZHJlc3MFAAAAB25ld0pzb24JAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgIAAAAIY3JlZGl0c18JAAJYAAAAAQUAAAANYWNjZXB0ZWRUb2tlbgkAAGUAAAACBQAAAA9kYXBwU0lHTkNyZWRpdHMAAAAAAAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAEYmFuawUAAAAGYW1vdW50CAUAAAAHcGF5bWVudAAAAAdhc3NldElkBQAAAANuaWwAAAABaQEAAAALZGVsZXRlRW50cnkAAAABAAAABWVudHJ5BAAAAAZjYWxsZXIJAAQlAAAAAQkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQgFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5AwkAAAAAAAACBQAAAAZjYWxsZXIFAAAACXNpZ25BZG1pbgkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAAVlbnRyeQUAAAADbmlsCQAAAgAAAAECAAAAAm5vAAAAALg6xb8=", "height": 1735799, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EJAMxvYSEPQu1rXcxmDiX1vjzZGPEKHYmLjB4TsCSMb1 Next: EqFyfdU5BAvkegBNvh6CDaW7fEbadczjZoWT86PSbvbe Diff:
Old | New | Differences | |
---|---|---|---|
77 | 77 | let F = (C + E) | |
78 | 78 | if ((0 >= C)) | |
79 | 79 | then throw("Not enough for at least 1 credit") | |
80 | - | else [IntegerEntry(("credits_" + toBase58String(e)), F), ScriptTransfer(addressFromStringValue(j), (w - (D * f)), v.assetId), ScriptTransfer(addressFromStringValue(u), D, v.assetId)] | |
80 | + | else [IntegerEntry(("credits_" + toBase58String(e)), F), ScriptTransfer(addressFromStringValue(j), (w - (D * f)), v.assetId), ScriptTransfer(addressFromStringValue(u), (D * f), v.assetId)] | |
81 | 81 | } | |
82 | 82 | } | |
83 | 83 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = value(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1")) | |
5 | 5 | ||
6 | 6 | let b = "3N1wPgHFtezmRVBaqoojP8XJwTkark4hbif" | |
7 | 7 | ||
8 | 8 | let c = "3MvujUZTtoANRzrKYKzx99Vtb9TUh6VPCDm" | |
9 | 9 | ||
10 | 10 | let d = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub" | |
11 | 11 | ||
12 | 12 | let e = base58'7bLUm2XNLWvVwgC9aPp9fNNAMVtbGwhwkqdgomJAgVbC' | |
13 | 13 | ||
14 | 14 | let f = 100000000 | |
15 | 15 | ||
16 | 16 | let g = value(addressFromString("3N22SvtBwfGc1BwErX5YQx3WzacDicfMpLr")) | |
17 | 17 | ||
18 | 18 | let h = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a' | |
19 | 19 | ||
20 | 20 | let i = "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC" | |
21 | 21 | ||
22 | 22 | let j = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub" | |
23 | 23 | ||
24 | 24 | func k (l) = valueOrElse(getInteger(this, l), 0) | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func m (n,o) = { | |
28 | 28 | let p = getString(this, (n + o)) | |
29 | 29 | if ($isInstanceOf(p, "String")) | |
30 | 30 | then { | |
31 | 31 | let q = p | |
32 | 32 | q | |
33 | 33 | } | |
34 | 34 | else "NONE" | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func r (o) = { | |
39 | 39 | let p = getString(this, o) | |
40 | 40 | if ($isInstanceOf(p, "String")) | |
41 | 41 | then { | |
42 | 42 | let q = p | |
43 | 43 | q | |
44 | 44 | } | |
45 | 45 | else "NONE" | |
46 | 46 | } | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | @Callable(s) | |
50 | 50 | func setFee (t) = { | |
51 | 51 | let u = toBase58String(s.caller.bytes) | |
52 | 52 | if ((u == c)) | |
53 | 53 | then [IntegerEntry(("certification_fee_" + toBase58String(e)), t)] | |
54 | 54 | else throw("You are not allowed to change fee") | |
55 | 55 | } | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | ||
59 | 59 | @Callable(s) | |
60 | 60 | func refillCredits () = { | |
61 | 61 | let u = toBase58String(s.caller.bytes) | |
62 | 62 | let v = value(s.payments[0]) | |
63 | 63 | let w = value(v.amount) | |
64 | 64 | let x = if (isDefined(v.assetId)) | |
65 | 65 | then value(v.assetId) | |
66 | 66 | else throw("Accept SIGN token only") | |
67 | 67 | if ((h != x)) | |
68 | 68 | then throw("Accept SIGN token only") | |
69 | 69 | else { | |
70 | 70 | let y = getIntegerValue(g, "A_asset_balance") | |
71 | 71 | let z = getIntegerValue(g, "B_asset_balance") | |
72 | 72 | let A = (y / (z * 100)) | |
73 | 73 | let B = (A / 2) | |
74 | 74 | let C = ((w / f) / B) | |
75 | 75 | let D = ((w / f) - (C * B)) | |
76 | 76 | let E = k(("credits_" + toBase58String(e))) | |
77 | 77 | let F = (C + E) | |
78 | 78 | if ((0 >= C)) | |
79 | 79 | then throw("Not enough for at least 1 credit") | |
80 | - | else [IntegerEntry(("credits_" + toBase58String(e)), F), ScriptTransfer(addressFromStringValue(j), (w - (D * f)), v.assetId), ScriptTransfer(addressFromStringValue(u), D, v.assetId)] | |
80 | + | else [IntegerEntry(("credits_" + toBase58String(e)), F), ScriptTransfer(addressFromStringValue(j), (w - (D * f)), v.assetId), ScriptTransfer(addressFromStringValue(u), (D * f), v.assetId)] | |
81 | 81 | } | |
82 | 82 | } | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | ||
86 | 86 | @Callable(G) | |
87 | 87 | func fileCertification (H,I,o,J,K) = { | |
88 | 88 | let L = value(G.transactionId) | |
89 | 89 | let M = m(H, o) | |
90 | 90 | let N = r(o) | |
91 | 91 | let u = toBase58String(G.caller.bytes) | |
92 | 92 | if ((M != "NONE")) | |
93 | 93 | then throw("This entry already exist") | |
94 | 94 | else if ((N != "NONE")) | |
95 | 95 | then throw("This uuid already exist") | |
96 | 96 | else if ((size(o) != 36)) | |
97 | 97 | then throw("Uuid should be 36 characters.") | |
98 | 98 | else if ((size(H) != 64)) | |
99 | 99 | then throw("Hash should be 64 characters.") | |
100 | 100 | else if ((size(I) > 100)) | |
101 | 101 | then throw("Title is too long, 100 characters max.") | |
102 | 102 | else if (if (if (contains(H, "\"")) | |
103 | 103 | then true | |
104 | 104 | else contains(I, "\"")) | |
105 | 105 | then true | |
106 | 106 | else contains(J, "\"")) | |
107 | 107 | then throw("No \" allowed") | |
108 | 108 | else { | |
109 | 109 | let O = (((((((("{\"hash\":\"" + H) + "\",\"timestamp\":") + toString(lastBlock.timestamp)) + ",\"title\":\"") + I) + "\",\"ipfs\":\"") + J) + "\"}") | |
110 | 110 | let v = value(G.payments[0]) | |
111 | 111 | let w = value(v.amount) | |
112 | 112 | let x = if (isDefined(v.assetId)) | |
113 | 113 | then value(v.assetId) | |
114 | 114 | else throw("Waves is not accepted as payment") | |
115 | 115 | let P = getIntegerValue(this, ("certification_fee_" + toBase58String(value(x)))) | |
116 | 116 | let Q = k(("credits_" + toBase58String(e))) | |
117 | 117 | if ((0 >= Q)) | |
118 | 118 | then throw("Not enough credit on the dapp, please refill") | |
119 | 119 | else if ((e != x)) | |
120 | 120 | then throw("This token is not accepted at the moment") | |
121 | 121 | else if ((w != P)) | |
122 | 122 | then throw("The price is wrong") | |
123 | 123 | else [StringEntry(o, toBase58String(L)), StringEntry((H + o), toBase58String(L)), StringEntry((I + o), toBase58String(L)), StringEntry(((("data_fc_" + toBase58String(L)) + "_") + u), O), IntegerEntry(("credits_" + toBase58String(e)), (Q - 1)), ScriptTransfer(addressFromStringValue(d), w, v.assetId)] | |
124 | 124 | } | |
125 | 125 | } | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | ||
129 | 129 | @Callable(G) | |
130 | 130 | func revokeCertification (R,K) = { | |
131 | 131 | let L = value(G.transactionId) | |
132 | 132 | let u = toBase58String(G.caller.bytes) | |
133 | 133 | let M = { | |
134 | 134 | let p = getString(this, ((("data_fc_" + R) + "_") + u)) | |
135 | 135 | if ($isInstanceOf(p, "String")) | |
136 | 136 | then { | |
137 | 137 | let q = p | |
138 | 138 | q | |
139 | 139 | } | |
140 | 140 | else "NONE" | |
141 | 141 | } | |
142 | 142 | let S = { | |
143 | 143 | let p = getString(this, ("STATUS_FC_" + R)) | |
144 | 144 | if ($isInstanceOf(p, "String")) | |
145 | 145 | then { | |
146 | 146 | let q = p | |
147 | 147 | q | |
148 | 148 | } | |
149 | 149 | else "NONE" | |
150 | 150 | } | |
151 | 151 | let T = (((dropRight(M, 1) + ",\"status\":\"REVOKED_") + toBase58String(L)) + "\"}") | |
152 | 152 | if ((S != "NONE")) | |
153 | 153 | then throw("This certification have already been revoked.") | |
154 | 154 | else if ((M == "NONE")) | |
155 | 155 | then throw("You cannot change the status of this certification.") | |
156 | 156 | else { | |
157 | 157 | let v = value(G.payments[0]) | |
158 | 158 | let w = value(v.amount) | |
159 | 159 | let x = if (isDefined(v.assetId)) | |
160 | 160 | then value(v.assetId) | |
161 | 161 | else throw("Waves is not accepted as payment") | |
162 | 162 | let P = getIntegerValue(this, ("certification_fee_" + toBase58String(value(x)))) | |
163 | 163 | let Q = getIntegerValue(this, ("credits_" + toBase58String(e))) | |
164 | 164 | if ((0 >= Q)) | |
165 | 165 | then throw("Not enough credit on the dapp, please refill") | |
166 | 166 | else if ((e != x)) | |
167 | 167 | then throw("This token is not accepted at the moment") | |
168 | 168 | else if ((w != P)) | |
169 | 169 | then throw("The price is wrong") | |
170 | 170 | else [StringEntry(("STATUS_FC_" + R), ("REVOKED_" + toBase58String(L))), StringEntry(((("data_fc_" + R) + "_") + u), T), IntegerEntry(("credits_" + toBase58String(e)), (Q - 1)), ScriptTransfer(addressFromStringValue(d), w, v.assetId)] | |
171 | 171 | } | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | ||
176 | 176 | @Callable(s) | |
177 | 177 | func deleteEntry (U) = { | |
178 | 178 | let V = toString(addressFromPublicKey(s.callerPublicKey)) | |
179 | 179 | if ((V == b)) | |
180 | 180 | then [DeleteEntry(U)] | |
181 | 181 | else throw("no") | |
182 | 182 | } | |
183 | 183 | ||
184 | 184 |
github/deemru/w8io/169f3d6 71.70 ms ◑