tx · FNJfL1FDX6tudsHs33ZiXXSUqXkzAppFJd1WzcRAAehT 3N1hUxU5uVePa5VEmty9UWoTdzjfMUNekSp: -0.01400000 Waves 2020.04.06 17:17 [942494] smart account 3N1hUxU5uVePa5VEmty9UWoTdzjfMUNekSp > SELF 0.00000000 Waves
{ "type": 13, "id": "FNJfL1FDX6tudsHs33ZiXXSUqXkzAppFJd1WzcRAAehT", "fee": 1400000, "feeAssetId": null, "timestamp": 1586182575538, "version": 1, "sender": "3N1hUxU5uVePa5VEmty9UWoTdzjfMUNekSp", "senderPublicKey": "C9N8puBe7PNPmySZRMUWyTK96uEaNp6AB2w758sEo4PQ", "proofs": [ "2pAD4dFdsb45E9JyFsFJKyxXaKBxX8RUmpZPdWF94xaWr95FvmpXRPtLTLZVMPG34zEQziCmc2A1HwJe6NgdFYhK" ], "script": "base64:AAIDAAAAAAAAABwIARIGCgQICAEIEgcKBQgIAQgIEgcKBQgIAQgIAAAAAAAAAAMAAAABaQEAAAANYXRvbWljRGVwb3NpdAAAAAQAAAAPYXRvbWljUmVjaXBpZW50AAAAEGF0b21pY1dpdGhEcmF3SWQAAAAUYXRvbWljV2l0aGRyYXdBbW91bnQAAAAPYXRvbWljRGVwb3NpdElkBAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50BAAAAAlwYXltZW50SWQIBQAAAANwbXQAAAAHYXNzZXRJZAQAAAANY3VycmVudEFtb3VudAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzCQABLAAAAAIJAAEsAAAAAgUAAAAKY3VycmVudEtleQUAAAAPYXRvbWljRGVwb3NpdElkBQAAAA9hdG9taWNSZWNpcGllbnQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAQAAAAJbmV3QW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EdW5pdAUAAAADbmlsCQAAAgAAAAECAAAADkZhaWxlZCB0byBzd2FwAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAAA3R0eAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAADdHR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAADdHR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAA3R0eAAAAA9zZW5kZXJQdWJsaWNLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAANzdHgFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAA3N0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAA3N0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAANzdHgAAAAPc2VuZGVyUHVibGljS2V5BoNiNmw=", "chainId": 84, "height": 942494, "spentComplexity": 0 } View: original | compacted Prev: 9chL8PzxEbHtRLArGQhne38Gcxmh2PJgMfCTiDUBariE Next: none Diff:
Old | New | Differences | |
---|---|---|---|
24 | 24 | ||
25 | 25 | ||
26 | 26 | @Callable(a) | |
27 | - | func | |
27 | + | func cancelWithdraw (b,c,d,e,m) = { | |
28 | 28 | let f = toBase58String(a.caller.bytes) | |
29 | 29 | let n = fromBase58String(m) | |
30 | 30 | let o = { | |
37 | 37 | else 0 | |
38 | 38 | } | |
39 | 39 | let p = { | |
40 | + | let j = getBoolean(this, ((("d_" + b) + c) + f)) | |
41 | + | if ($isInstanceOf(j, "Boolean")) | |
42 | + | then { | |
43 | + | let k = j | |
44 | + | k | |
45 | + | } | |
46 | + | else false | |
47 | + | } | |
48 | + | if (if ((p == false)) | |
49 | + | then (m == "WAVES") | |
50 | + | else false) | |
51 | + | then ScriptResult(WriteSet([DataEntry(((f + e) + b), 0), DataEntry(((f + c) + b), 0), DataEntry(((("d_" + f) + e) + b), false)]), TransferSet([ScriptTransfer(a.caller, o, unit)])) | |
52 | + | else if (if ((p == false)) | |
53 | + | then (m != "WAVES") | |
54 | + | else false) | |
55 | + | then ScriptResult(WriteSet([DataEntry(((f + e) + b), 0), DataEntry(((f + c) + b), 0), DataEntry(((("d_" + f) + e) + b), false)]), TransferSet([ScriptTransfer(a.caller, o, n)])) | |
56 | + | else throw("Failed to withdraw") | |
57 | + | } | |
58 | + | ||
59 | + | ||
60 | + | ||
61 | + | @Callable(a) | |
62 | + | func atomicWithdraw (b,c,d,e,q) = { | |
63 | + | let f = toBase58String(a.caller.bytes) | |
64 | + | let n = fromBase58String(q) | |
65 | + | let o = { | |
66 | + | let j = getInteger(this, ((f + e) + b)) | |
67 | + | if ($isInstanceOf(j, "Int")) | |
68 | + | then { | |
69 | + | let k = j | |
70 | + | k | |
71 | + | } | |
72 | + | else 0 | |
73 | + | } | |
74 | + | let r = { | |
40 | 75 | let j = getInteger(this, ((f + c) + b)) | |
41 | 76 | if ($isInstanceOf(j, "Int")) | |
42 | 77 | then { | |
45 | 80 | } | |
46 | 81 | else 0 | |
47 | 82 | } | |
48 | - | let | |
83 | + | let s = { | |
49 | 84 | let j = getInteger(this, ((b + c) + f)) | |
50 | 85 | if ($isInstanceOf(j, "Int")) | |
51 | 86 | then { | |
54 | 89 | } | |
55 | 90 | else 0 | |
56 | 91 | } | |
57 | - | let | |
92 | + | let t = { | |
58 | 93 | let j = getInteger(this, ((b + e) + f)) | |
59 | 94 | if ($isInstanceOf(j, "Int")) | |
60 | 95 | then { | |
63 | 98 | } | |
64 | 99 | else 0 | |
65 | 100 | } | |
66 | - | let | |
101 | + | let u = { | |
67 | 102 | let j = getBoolean(this, ((("d_" + f) + e) + b)) | |
68 | 103 | if ($isInstanceOf(j, "Boolean")) | |
69 | 104 | then { | |
72 | 107 | } | |
73 | 108 | else false | |
74 | 109 | } | |
75 | - | let | |
110 | + | let p = { | |
76 | 111 | let j = getBoolean(this, ((("d_" + b) + c) + f)) | |
77 | 112 | if ($isInstanceOf(j, "Boolean")) | |
78 | 113 | then { | |
81 | 116 | } | |
82 | 117 | else false | |
83 | 118 | } | |
84 | - | if (if (if (if ((o == | |
85 | - | then ( | |
119 | + | if (if (if (if ((o == t)) | |
120 | + | then (s == r) | |
86 | 121 | else false) | |
87 | - | then ( | |
122 | + | then (p == true) | |
88 | 123 | else false) | |
89 | 124 | then (c == "WAVES") | |
90 | 125 | else false) | |
91 | 126 | then ScriptResult(WriteSet([DataEntry(((b + c) + f), 0), DataEntry(((f + c) + b), 0), DataEntry(((("d_" + b) + c) + f), false)]), TransferSet([ScriptTransfer(a.caller, d, unit)])) | |
92 | - | else if (if (if (if ((o == | |
93 | - | then ( | |
127 | + | else if (if (if (if ((o == t)) | |
128 | + | then (s == r) | |
94 | 129 | else false) | |
95 | - | then ( | |
130 | + | then (p == true) | |
96 | 131 | else false) | |
97 | 132 | then (c != "WAVES") | |
98 | 133 | else false) | |
99 | 134 | then ScriptResult(WriteSet([DataEntry(((b + c) + f), 0), DataEntry(((f + c) + b), 0), DataEntry(((("d_" + b) + c) + f), false)]), TransferSet([ScriptTransfer(a.caller, d, unit)])) | |
100 | - | else throw(" | |
135 | + | else throw("Failed to swap") | |
101 | 136 | } | |
102 | 137 | ||
103 | 138 | ||
104 | - | @Verifier( | |
105 | - | func | |
106 | - | let j = | |
139 | + | @Verifier(v) | |
140 | + | func w () = { | |
141 | + | let j = v | |
107 | 142 | if ($isInstanceOf(j, "TransferTransaction")) | |
108 | 143 | then { | |
109 | - | let | |
110 | - | sigVerify( | |
144 | + | let x = j | |
145 | + | sigVerify(x.bodyBytes, x.proofs[0], x.senderPublicKey) | |
111 | 146 | } | |
112 | 147 | else if ($isInstanceOf(j, "SetScriptTransaction")) | |
113 | 148 | then { | |
114 | - | let | |
115 | - | sigVerify( | |
149 | + | let y = j | |
150 | + | sigVerify(y.bodyBytes, y.proofs[0], y.senderPublicKey) | |
116 | 151 | } | |
117 | 152 | else true | |
118 | 153 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(a) | |
7 | 7 | func atomicDeposit (b,c,d,e) = { | |
8 | 8 | let f = toBase58String(a.caller.bytes) | |
9 | 9 | let g = extract(a.payment) | |
10 | 10 | let h = g.assetId | |
11 | 11 | let i = { | |
12 | 12 | let j = getInteger(this, ((f + e) + b)) | |
13 | 13 | if ($isInstanceOf(j, "Int")) | |
14 | 14 | then { | |
15 | 15 | let k = j | |
16 | 16 | k | |
17 | 17 | } | |
18 | 18 | else 0 | |
19 | 19 | } | |
20 | 20 | let l = (i + g.amount) | |
21 | 21 | WriteSet([DataEntry(((f + e) + b), l), DataEntry(((f + c) + b), d), DataEntry(((("d_" + f) + e) + b), true)]) | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | ||
26 | 26 | @Callable(a) | |
27 | - | func | |
27 | + | func cancelWithdraw (b,c,d,e,m) = { | |
28 | 28 | let f = toBase58String(a.caller.bytes) | |
29 | 29 | let n = fromBase58String(m) | |
30 | 30 | let o = { | |
31 | 31 | let j = getInteger(this, ((f + e) + b)) | |
32 | 32 | if ($isInstanceOf(j, "Int")) | |
33 | 33 | then { | |
34 | 34 | let k = j | |
35 | 35 | k | |
36 | 36 | } | |
37 | 37 | else 0 | |
38 | 38 | } | |
39 | 39 | let p = { | |
40 | + | let j = getBoolean(this, ((("d_" + b) + c) + f)) | |
41 | + | if ($isInstanceOf(j, "Boolean")) | |
42 | + | then { | |
43 | + | let k = j | |
44 | + | k | |
45 | + | } | |
46 | + | else false | |
47 | + | } | |
48 | + | if (if ((p == false)) | |
49 | + | then (m == "WAVES") | |
50 | + | else false) | |
51 | + | then ScriptResult(WriteSet([DataEntry(((f + e) + b), 0), DataEntry(((f + c) + b), 0), DataEntry(((("d_" + f) + e) + b), false)]), TransferSet([ScriptTransfer(a.caller, o, unit)])) | |
52 | + | else if (if ((p == false)) | |
53 | + | then (m != "WAVES") | |
54 | + | else false) | |
55 | + | then ScriptResult(WriteSet([DataEntry(((f + e) + b), 0), DataEntry(((f + c) + b), 0), DataEntry(((("d_" + f) + e) + b), false)]), TransferSet([ScriptTransfer(a.caller, o, n)])) | |
56 | + | else throw("Failed to withdraw") | |
57 | + | } | |
58 | + | ||
59 | + | ||
60 | + | ||
61 | + | @Callable(a) | |
62 | + | func atomicWithdraw (b,c,d,e,q) = { | |
63 | + | let f = toBase58String(a.caller.bytes) | |
64 | + | let n = fromBase58String(q) | |
65 | + | let o = { | |
66 | + | let j = getInteger(this, ((f + e) + b)) | |
67 | + | if ($isInstanceOf(j, "Int")) | |
68 | + | then { | |
69 | + | let k = j | |
70 | + | k | |
71 | + | } | |
72 | + | else 0 | |
73 | + | } | |
74 | + | let r = { | |
40 | 75 | let j = getInteger(this, ((f + c) + b)) | |
41 | 76 | if ($isInstanceOf(j, "Int")) | |
42 | 77 | then { | |
43 | 78 | let k = j | |
44 | 79 | k | |
45 | 80 | } | |
46 | 81 | else 0 | |
47 | 82 | } | |
48 | - | let | |
83 | + | let s = { | |
49 | 84 | let j = getInteger(this, ((b + c) + f)) | |
50 | 85 | if ($isInstanceOf(j, "Int")) | |
51 | 86 | then { | |
52 | 87 | let k = j | |
53 | 88 | k | |
54 | 89 | } | |
55 | 90 | else 0 | |
56 | 91 | } | |
57 | - | let | |
92 | + | let t = { | |
58 | 93 | let j = getInteger(this, ((b + e) + f)) | |
59 | 94 | if ($isInstanceOf(j, "Int")) | |
60 | 95 | then { | |
61 | 96 | let k = j | |
62 | 97 | k | |
63 | 98 | } | |
64 | 99 | else 0 | |
65 | 100 | } | |
66 | - | let | |
101 | + | let u = { | |
67 | 102 | let j = getBoolean(this, ((("d_" + f) + e) + b)) | |
68 | 103 | if ($isInstanceOf(j, "Boolean")) | |
69 | 104 | then { | |
70 | 105 | let k = j | |
71 | 106 | k | |
72 | 107 | } | |
73 | 108 | else false | |
74 | 109 | } | |
75 | - | let | |
110 | + | let p = { | |
76 | 111 | let j = getBoolean(this, ((("d_" + b) + c) + f)) | |
77 | 112 | if ($isInstanceOf(j, "Boolean")) | |
78 | 113 | then { | |
79 | 114 | let k = j | |
80 | 115 | k | |
81 | 116 | } | |
82 | 117 | else false | |
83 | 118 | } | |
84 | - | if (if (if (if ((o == | |
85 | - | then ( | |
119 | + | if (if (if (if ((o == t)) | |
120 | + | then (s == r) | |
86 | 121 | else false) | |
87 | - | then ( | |
122 | + | then (p == true) | |
88 | 123 | else false) | |
89 | 124 | then (c == "WAVES") | |
90 | 125 | else false) | |
91 | 126 | then ScriptResult(WriteSet([DataEntry(((b + c) + f), 0), DataEntry(((f + c) + b), 0), DataEntry(((("d_" + b) + c) + f), false)]), TransferSet([ScriptTransfer(a.caller, d, unit)])) | |
92 | - | else if (if (if (if ((o == | |
93 | - | then ( | |
127 | + | else if (if (if (if ((o == t)) | |
128 | + | then (s == r) | |
94 | 129 | else false) | |
95 | - | then ( | |
130 | + | then (p == true) | |
96 | 131 | else false) | |
97 | 132 | then (c != "WAVES") | |
98 | 133 | else false) | |
99 | 134 | then ScriptResult(WriteSet([DataEntry(((b + c) + f), 0), DataEntry(((f + c) + b), 0), DataEntry(((("d_" + b) + c) + f), false)]), TransferSet([ScriptTransfer(a.caller, d, unit)])) | |
100 | - | else throw(" | |
135 | + | else throw("Failed to swap") | |
101 | 136 | } | |
102 | 137 | ||
103 | 138 | ||
104 | - | @Verifier( | |
105 | - | func | |
106 | - | let j = | |
139 | + | @Verifier(v) | |
140 | + | func w () = { | |
141 | + | let j = v | |
107 | 142 | if ($isInstanceOf(j, "TransferTransaction")) | |
108 | 143 | then { | |
109 | - | let | |
110 | - | sigVerify( | |
144 | + | let x = j | |
145 | + | sigVerify(x.bodyBytes, x.proofs[0], x.senderPublicKey) | |
111 | 146 | } | |
112 | 147 | else if ($isInstanceOf(j, "SetScriptTransaction")) | |
113 | 148 | then { | |
114 | - | let | |
115 | - | sigVerify( | |
149 | + | let y = j | |
150 | + | sigVerify(y.bodyBytes, y.proofs[0], y.senderPublicKey) | |
116 | 151 | } | |
117 | 152 | else true | |
118 | 153 | } | |
119 | 154 |
github/deemru/w8io/026f985 55.93 ms ◑