tx · BkiLHpjdec5nztZ8vBr7DMwfHqynV1tyLS8zMM8NkFeC 3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx: -0.01000000 Waves 2023.02.17 10:14 [2453298] smart account 3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx > SELF 0.00000000 Waves
{ "type": 13, "id": "BkiLHpjdec5nztZ8vBr7DMwfHqynV1tyLS8zMM8NkFeC", "fee": 1000000, "feeAssetId": null, "timestamp": 1676618061555, "version": 2, "chainId": 84, "sender": "3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx", "senderPublicKey": "D35PGQCSSdrp9pvujggj7b2DaCK1BhcU3kho7tikKJYs", "proofs": [ "RiNvbfuKZKhqKqJeUGuMjFLLEwgRt7SgiH62DJSpCrRUgEig57Jv2r5VQp3HiMCTfnDdf1vq3Vn4uGHzJMidDo2" ], "script": "base64:BgIaCAISABIDCgEBEgQKAhgREgQKAggBEgMKAQgBAAR0VVNEASCrJEpqtkJG69L843mwYbrDrmlXTVJ6ykUcp0AdEbApDgUBaQEHZGVwb3NpdAADCQAAAgkAkAMBCAUBaQhwYXltZW50cwAACQACAQIUUGF5bWVudCBub3QgYXR0YWNoZWQEA3BtdAkAkQMCCQEFdmFsdWUBCAUBaQhwYXltZW50cwAAAwkBAiE9AggFA3BtdAdhc3NldElkBQR0VVNECQACAQIXaG9sZGVkIHBheW1lbnQgbm90IHRVU0QDCQBmAgDoBwgFA3BtdAZhbW91bnQJAAIBAhZob2xkZWQgcGF5bWVudCA8IDEwLjAwBApjdXJyZW50S2V5CQDYBAEICAUBaQZjYWxsZXIFYnl0ZXMEDWN1cnJlbnRBbW91bnQEByRtYXRjaDAJAJoIAgUEdGhpcwUKY3VycmVudEtleQMJAAECBQckbWF0Y2gwAgNJbnQEAWEFByRtYXRjaDAFAWEAAAQJbmV3QW1vdW50CQBkAgUNY3VycmVudEFtb3VudAgFA3BtdAZhbW91bnQJAMwIAgkBDEludGVnZXJFbnRyeQ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xpY0tleeN7OqA=", "height": 2453298, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3QC6LXWqgbeGjsau8BkuVdzwmPJ68uZNMKKXXT53qeim Next: 9z4fuKP2rKKt7NUaTNMkRma1h24tyU7QvRyTViZKxgTp Diff:
Old | New | Differences | |
---|---|---|---|
11 | 11 | if ((pmt.assetId != tUSD)) | |
12 | 12 | then throw("holded payment not tUSD") | |
13 | 13 | else if ((1000 > pmt.amount)) | |
14 | - | then throw("holded payment | |
14 | + | then throw("holded payment < 10.00") | |
15 | 15 | else { | |
16 | 16 | let currentKey = toBase58String(i.caller.bytes) | |
17 | 17 | let currentAmount = match getInteger(this, currentKey) { | |
61 | 61 | throw("Match error") | |
62 | 62 | } | |
63 | 63 | func addStringEntry (accum,nextValue) = { | |
64 | - | let $ | |
65 | - | let result = $ | |
66 | - | let j = $ | |
64 | + | let $t027032726 = accum | |
65 | + | let result = $t027032726._1 | |
66 | + | let j = $t027032726._2 | |
67 | 67 | $Tuple2((result :+ IntegerEntry(opts[j], nextValue)), (j + 1)) | |
68 | 68 | } | |
69 | 69 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let tUSD = base58'CX4p6XcuSBUvv44r1avCqYka5PYAVzBK5hSXaT7maU85' | |
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func deposit () = if ((size(i.payments) == 0)) | |
8 | 8 | then throw("Payment not attached") | |
9 | 9 | else { | |
10 | 10 | let pmt = value(i.payments)[0] | |
11 | 11 | if ((pmt.assetId != tUSD)) | |
12 | 12 | then throw("holded payment not tUSD") | |
13 | 13 | else if ((1000 > pmt.amount)) | |
14 | - | then throw("holded payment | |
14 | + | then throw("holded payment < 10.00") | |
15 | 15 | else { | |
16 | 16 | let currentKey = toBase58String(i.caller.bytes) | |
17 | 17 | let currentAmount = match getInteger(this, currentKey) { | |
18 | 18 | case a: Int => | |
19 | 19 | a | |
20 | 20 | case _ => | |
21 | 21 | 0 | |
22 | 22 | } | |
23 | 23 | let newAmount = (currentAmount + pmt.amount) | |
24 | 24 | [IntegerEntry(currentKey, newAmount)] | |
25 | 25 | } | |
26 | 26 | } | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | ||
30 | 30 | @Callable(i) | |
31 | 31 | func withdraw (amount) = { | |
32 | 32 | let currentKey = toBase58String(i.caller.bytes) | |
33 | 33 | let currentAmount = match getInteger(this, currentKey) { | |
34 | 34 | case a: Int => | |
35 | 35 | a | |
36 | 36 | case _ => | |
37 | 37 | 0 | |
38 | 38 | } | |
39 | 39 | let newAmount = (currentAmount - amount) | |
40 | 40 | if ((0 > amount)) | |
41 | 41 | then throw("Can't withdraw negative amount") | |
42 | 42 | else if ((0 > newAmount)) | |
43 | 43 | then throw("Not enough balance") | |
44 | 44 | else $Tuple2([IntegerEntry(currentKey, newAmount), ScriptTransfer(i.caller, amount, unit)], unit) | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | ||
49 | 49 | @Callable(i) | |
50 | 50 | func setOptions (opts,vals) = { | |
51 | 51 | let opt_size = size(opts) | |
52 | 52 | if ((100 >= opt_size)) | |
53 | 53 | then { | |
54 | 54 | let options_addr = Address(base58'3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6') | |
55 | 55 | let adminList = match getString(options_addr, "admin_list") { | |
56 | 56 | case _: Unit => | |
57 | 57 | "unset" | |
58 | 58 | case x: String => | |
59 | 59 | x | |
60 | 60 | case _ => | |
61 | 61 | throw("Match error") | |
62 | 62 | } | |
63 | 63 | func addStringEntry (accum,nextValue) = { | |
64 | - | let $ | |
65 | - | let result = $ | |
66 | - | let j = $ | |
64 | + | let $t027032726 = accum | |
65 | + | let result = $t027032726._1 | |
66 | + | let j = $t027032726._2 | |
67 | 67 | $Tuple2((result :+ IntegerEntry(opts[j], nextValue)), (j + 1)) | |
68 | 68 | } | |
69 | 69 | ||
70 | 70 | let r = { | |
71 | 71 | let $l = vals | |
72 | 72 | let $s = size($l) | |
73 | 73 | let $acc0 = $Tuple2(nil, 0) | |
74 | 74 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
75 | 75 | then $a | |
76 | 76 | else addStringEntry($a, $l[$i]) | |
77 | 77 | ||
78 | 78 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
79 | 79 | then $a | |
80 | 80 | else throw("List size exceeds 100") | |
81 | 81 | ||
82 | 82 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
83 | 83 | } | |
84 | 84 | let callerAddressStr = toString(i.caller) | |
85 | 85 | if ((adminList != "unset")) | |
86 | 86 | then { | |
87 | 87 | let test = getString(addressFromStringValue(adminList), callerAddressStr) | |
88 | 88 | let isAdmin = match test { | |
89 | 89 | case x: String => | |
90 | 90 | x | |
91 | 91 | case _: Unit => | |
92 | 92 | "no admin" | |
93 | 93 | case _ => | |
94 | 94 | throw("Match error") | |
95 | 95 | } | |
96 | 96 | func add_elm (options) = { | |
97 | 97 | let opt = split(options, "|") | |
98 | 98 | StringEntry(opt[0], opt[1]) | |
99 | 99 | } | |
100 | 100 | ||
101 | 101 | if ((isAdmin != "no admin")) | |
102 | 102 | then r | |
103 | 103 | else throw((((((("You not admin: " + adminList) + ", isAdmin: ") + isAdmin) + ", callerAddressStr: ") + callerAddressStr) + ", ")) | |
104 | 104 | } | |
105 | 105 | else throw("Unset admin list") | |
106 | 106 | } | |
107 | 107 | else throw("The number of list elements must not exceed 100") | |
108 | 108 | } | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | ||
112 | 112 | @Callable(i) | |
113 | 113 | func setOption (variable,value) = { | |
114 | 114 | let options_addr = Address(base58'3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6') | |
115 | 115 | let adminList = match getString(options_addr, "admin_list") { | |
116 | 116 | case _: Unit => | |
117 | 117 | "unset" | |
118 | 118 | case x: String => | |
119 | 119 | x | |
120 | 120 | case _ => | |
121 | 121 | throw("Match error") | |
122 | 122 | } | |
123 | 123 | let callerAddressStr = toString(i.caller) | |
124 | 124 | if ((adminList != "unset")) | |
125 | 125 | then { | |
126 | 126 | let test = getString(addressFromStringValue(adminList), callerAddressStr) | |
127 | 127 | let isAdmin = match test { | |
128 | 128 | case x: String => | |
129 | 129 | x | |
130 | 130 | case _: Unit => | |
131 | 131 | "no admin" | |
132 | 132 | case _ => | |
133 | 133 | throw("Match error") | |
134 | 134 | } | |
135 | 135 | if ((isAdmin != "no admin")) | |
136 | 136 | then $Tuple2([IntegerEntry(variable, value)], unit) | |
137 | 137 | else throw((((((("You not admin: " + adminList) + ", isAdmin: ") + isAdmin) + ", callerAddressStr: ") + callerAddressStr) + ", ")) | |
138 | 138 | } | |
139 | 139 | else throw("Unset admin list") | |
140 | 140 | } | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | ||
144 | 144 | @Callable(i) | |
145 | 145 | func delOption (variable) = { | |
146 | 146 | let options_addr = Address(base58'3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6') | |
147 | 147 | let adminList = match getString(options_addr, "admin_list") { | |
148 | 148 | case _: Unit => | |
149 | 149 | "unset" | |
150 | 150 | case x: String => | |
151 | 151 | x | |
152 | 152 | case _ => | |
153 | 153 | throw("Match error") | |
154 | 154 | } | |
155 | 155 | let callerAddressStr = toString(i.caller) | |
156 | 156 | if ((adminList != "unset")) | |
157 | 157 | then { | |
158 | 158 | let test = getString(addressFromStringValue(adminList), callerAddressStr) | |
159 | 159 | let isAdmin = match test { | |
160 | 160 | case x: String => | |
161 | 161 | x | |
162 | 162 | case _: Unit => | |
163 | 163 | "no admin" | |
164 | 164 | case _ => | |
165 | 165 | throw("Match error") | |
166 | 166 | } | |
167 | 167 | if ((isAdmin != "no admin")) | |
168 | 168 | then $Tuple2([DeleteEntry(variable)], unit) | |
169 | 169 | else throw((((((("You not admin: " + adminList) + ", isAdmin: ") + isAdmin) + ", callerAddressStr: ") + callerAddressStr) + ", ")) | |
170 | 170 | } | |
171 | 171 | else throw("Unset admin list") | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | @Verifier(tx) | |
176 | 176 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
177 | 177 |
github/deemru/w8io/169f3d6 33.96 ms ◑