tx · E1x1qRdbqayi6HGBkecMcSADfUvHttcbbiSofg4AcFwE 3MxorpV6jKdNhrzHSujnjVXu7fr8PCHhMwi: -0.01400000 Waves 2020.03.11 04:49 [903849] smart account 3MxorpV6jKdNhrzHSujnjVXu7fr8PCHhMwi > SELF 0.00000000 Waves
{ "type": 13, "id": "E1x1qRdbqayi6HGBkecMcSADfUvHttcbbiSofg4AcFwE", "fee": 1400000, "feeAssetId": null, "timestamp": 1583891511610, "version": 1, "sender": "3MxorpV6jKdNhrzHSujnjVXu7fr8PCHhMwi", "senderPublicKey": "BZT5fzv8ZeHVn8xAGZVXZHUvoAkdRNCbtEuBn3pCuXEH", "proofs": [ "2m4erRqejPeyPEdx5CTeNUVsdbR6m5VKdZgnghRqbrUxgayLvVN2q7ybgoQzTtNPH9FoSxafZGrFUBfWXt43GVC3" ], "script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQgAAAAIAAAAAA5vd25lclB1YmxpY0tleQEAAAAgnOTxzRGlQL/gVO1uf4r6ecWijHA9iBu9xK1V+iHbiGoAAAAADFJhbmRvbWl6ZUtleQkAAlkAAAABAgAAACxCWlQ1Znp2OFplSFZuOHhBR1pWWFpIVXZvQWtkUk5DYnRFdUJuM3BDdVhFSAAAAAAKZGVwbG95SW5mbwIAAAAkYWRkZWQgZGF0YSBmdW5jdGlvbmFsaXR5ICh0ZXN0cGhhc2UpAAAAAAVhc3NldAEAAAAgVXxs3EW2jBqsaGzTqhCj5Mw9QqAAJNYM2NtCErS5DvoBAAAAC2VuY3J5cHREYXRhAAAAAgAAAAdtZXNzYWdlAAAABHBLZXkEAAAABm91dHB1dAIAAAAkcnNhVmVyaWZ5KFNoYTI1NiAsbWVzc2FnZSxwS2V5LHBLZXkpBQAAAAZvdXRwdXQBAAAACXNlc3Npb25JZAAAAAAEAAAAA2dpZAkABLEAAAABCQAB9wAAAAEJAAGaAAAAAQgFAAAACWxhc3RCbG9jawAAAAZoZWlnaHQFAAAAA2dpZAEAAAAHZ2V0R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AAByRtYXRjaDACAAAAD0RhdGFUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAADm93bmVyUHVibGljS2V5B0Mm5+o=", "chainId": 84, "height": 903849, "spentComplexity": 0 } View: original | compacted Prev: HfsuBxwEwcqAbd26XgsgHLCqhuxCy1547RLSCuUTtG8n Next: E9NCyoFAUqQxX9z3VX6Y57f5jVV2CJuyS825qCwRVXZi Diff:
Old | New | Differences | |
---|---|---|---|
7 | 7 | ||
8 | 8 | let c = "added data functionality (testphase)" | |
9 | 9 | ||
10 | - | func d (e,f) = { | |
11 | - | let g = "rsaVerify(Sha256 ,message,pKey,pKey)" | |
12 | - | g | |
10 | + | let d = base58'6khhQRn6E7dsLqxnkGHnEKoZZJv9U7bhadzprWvjAi6m' | |
11 | + | ||
12 | + | func e (f,g) = { | |
13 | + | let h = "rsaVerify(Sha256 ,message,pKey,pKey)" | |
14 | + | h | |
13 | 15 | } | |
14 | 16 | ||
15 | 17 | ||
16 | - | func | |
17 | - | let | |
18 | - | | |
18 | + | func i () = { | |
19 | + | let j = toInt(sha256(toBytes(lastBlock.height))) | |
20 | + | j | |
19 | 21 | } | |
20 | 22 | ||
21 | 23 | ||
22 | - | func j (k,l) = { | |
23 | - | let m = l | |
24 | - | let n = sigVerify(toBytes(m), toBytes(k), b) | |
25 | - | if (n) | |
26 | - | then { | |
27 | - | let o = (toInt(sha256(toBytes(k))) % 6) | |
28 | - | if ((0 > o)) | |
29 | - | then ((-1 * o) + 1) | |
30 | - | else (o + 1) | |
31 | - | } | |
32 | - | else throw("Invalid RSA signature") | |
24 | + | func k (l) = { | |
25 | + | let m = getStringValue(this, l) | |
26 | + | m | |
33 | 27 | } | |
34 | 28 | ||
35 | 29 | ||
36 | - | func p (q,r) = { | |
37 | - | let s = "x" | |
38 | - | s | |
30 | + | func n (o,p,q,r) = { | |
31 | + | let s = size(o) | |
32 | + | if ((s >= q)) | |
33 | + | then if ((q == 0)) | |
34 | + | then { | |
35 | + | let t = r | |
36 | + | let u = extract(split(o, ";")[1]) | |
37 | + | let v = extract(split(o, ";")[2]) | |
38 | + | let w = extract(split(o, ";")[3]) | |
39 | + | let x = extract(split(o, ";")[4]) | |
40 | + | let y = extract(split(o, ";")[5]) | |
41 | + | let z = extract(split(o, ";")[6]) | |
42 | + | let A = extract(split(o, ";")[7]) | |
43 | + | let B = ((((((((((((((t + p) + u) + p) + v) + p) + w) + p) + x) + p) + y) + p) + z) + p) + A) | |
44 | + | B | |
45 | + | } | |
46 | + | else throw("error creating datastring") | |
47 | + | else throw(("field index out of range. Number of fields for string is: " + toString(s))) | |
39 | 48 | } | |
40 | 49 | ||
41 | 50 | ||
42 | - | func t (u,v,w) = { | |
43 | - | let x = "placeholder" | |
44 | - | x | |
51 | + | @Callable(C) | |
52 | + | func initiate () = { | |
53 | + | let D = toBase58String(C.transactionId) | |
54 | + | let E = extract(C.payment) | |
55 | + | let f = "default message for now" | |
56 | + | let F = toBase58String(extract(C.callerPublicKey)) | |
57 | + | let G = toBase58String(extract(C.caller.bytes)) | |
58 | + | let H = C.transactionId | |
59 | + | let I = if ((E.amount == 100000000)) | |
60 | + | then "S" | |
61 | + | else if ((E.amount == 200000000)) | |
62 | + | then "M" | |
63 | + | else if ((E.amount == 400000000)) | |
64 | + | then "L" | |
65 | + | else "error" | |
66 | + | let J = (((((((("SUBMITTED" + ";") + toBase58String(extract(C.caller.bytes))) + ";") + toString(E.amount)) + ";") + toString(height)) + ";") + I) | |
67 | + | if ((I == "error")) | |
68 | + | then throw("Prices are 1, 2, and 4 waves. Other amounts will be rejected by the smart contract") | |
69 | + | else WriteSet([DataEntry(D, J)]) | |
45 | 70 | } | |
46 | 71 | ||
47 | 72 | ||
48 | - | func y (z) = { | |
49 | - | let A = getStringValue(this, z) | |
50 | - | A | |
51 | - | } | |
73 | + | ||
74 | + | @Callable(C) | |
75 | + | func finalize (K) = if ((C.callerPublicKey != a)) | |
76 | + | then throw("Only owner can call finalize function") | |
77 | + | else { | |
78 | + | let L = k(K) | |
79 | + | let M = parseIntValue(extract(split(L, ";")[8])) | |
80 | + | let N = parseIntValue(extract(split(L, ";")[0])) | |
81 | + | let J = n(L, ";", 0, "COMPLETED") | |
82 | + | ScriptResult(WriteSet([DataEntry(K, J)]), TransferSet([ScriptTransfer(C.caller, M, d)])) | |
83 | + | } | |
52 | 84 | ||
53 | 85 | ||
54 | - | @Callable(B) | |
55 | - | func initiate () = { | |
56 | - | let m = toBase58String(B.transactionId) | |
57 | - | let C = extract(B.payment) | |
58 | - | let e = "default message for now" | |
59 | - | let D = toBase58String(extract(B.callerPublicKey)) | |
60 | - | let E = toBase58String(extract(B.caller.bytes)) | |
61 | - | let F = B.transactionId | |
62 | - | let G = base58'6khhQRn6E7dsLqxnkGHnEKoZZJv9U7bhadzprWvjAi6m' | |
63 | - | let H = if ((C.amount == 100000000)) | |
64 | - | then "S" | |
65 | - | else if ((C.amount == 200000000)) | |
66 | - | then "M" | |
67 | - | else if ((C.amount == 400000000)) | |
68 | - | then "L" | |
69 | - | else "error" | |
70 | - | let I = (((((((("SUBMITTED" + ";") + toBase58String(extract(B.caller.bytes))) + ";") + toString(C.amount)) + ";") + toString(height)) + ";") + H) | |
71 | - | if ((H == "error")) | |
72 | - | then throw("Prices are 1, 2, and 4 waves. Other amounts will be rejected by the smart contract") | |
73 | - | else { | |
74 | - | let J = (C.amount * 3) | |
75 | - | WriteSet([DataEntry(m, I)]) | |
86 | + | @Verifier(O) | |
87 | + | func P () = { | |
88 | + | let Q = O | |
89 | + | if (if ($isInstanceOf(Q, "TransferTransaction")) | |
90 | + | then true | |
91 | + | else if ($isInstanceOf(Q, "ReissueTransaction")) | |
92 | + | then true | |
93 | + | else if ($isInstanceOf(Q, "IssueTransaction")) | |
94 | + | then true | |
95 | + | else $isInstanceOf(Q, "SetScriptTransaction")) | |
96 | + | then { | |
97 | + | let R = Q | |
98 | + | sigVerify(O.bodyBytes, O.proofs[0], a) | |
76 | 99 | } | |
77 | - | } | |
78 | - | ||
79 | - | ||
80 | - | @Verifier(K) | |
81 | - | func L () = { | |
82 | - | let M = K | |
83 | - | if (if ($isInstanceOf(M, "ReissueTransaction")) | |
84 | - | then true | |
85 | - | else if ($isInstanceOf(M, "IssueTransaction")) | |
86 | - | then true | |
87 | - | else $isInstanceOf(M, "SetScriptTransaction")) | |
88 | - | then { | |
89 | - | let N = M | |
90 | - | sigVerify(K.bodyBytes, K.proofs[0], a) | |
91 | - | } | |
92 | - | else if ($isInstanceOf(M, "DataTransaction")) | |
100 | + | else if ($isInstanceOf(Q, "DataTransaction")) | |
93 | 101 | then { | |
94 | - | let | |
95 | - | sigVerify( | |
102 | + | let R = Q | |
103 | + | sigVerify(O.bodyBytes, O.proofs[0], a) | |
96 | 104 | } | |
97 | - | else if ($isInstanceOf(M, "TransferTransaction")) | |
98 | - | then { | |
99 | - | let N = M | |
100 | - | true | |
101 | - | } | |
102 | - | else false | |
105 | + | else false | |
103 | 106 | } | |
104 | 107 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'BZT5fzv8ZeHVn8xAGZVXZHUvoAkdRNCbtEuBn3pCuXEH' | |
5 | 5 | ||
6 | 6 | let b = fromBase58String("BZT5fzv8ZeHVn8xAGZVXZHUvoAkdRNCbtEuBn3pCuXEH") | |
7 | 7 | ||
8 | 8 | let c = "added data functionality (testphase)" | |
9 | 9 | ||
10 | - | func d (e,f) = { | |
11 | - | let g = "rsaVerify(Sha256 ,message,pKey,pKey)" | |
12 | - | g | |
10 | + | let d = base58'6khhQRn6E7dsLqxnkGHnEKoZZJv9U7bhadzprWvjAi6m' | |
11 | + | ||
12 | + | func e (f,g) = { | |
13 | + | let h = "rsaVerify(Sha256 ,message,pKey,pKey)" | |
14 | + | h | |
13 | 15 | } | |
14 | 16 | ||
15 | 17 | ||
16 | - | func | |
17 | - | let | |
18 | - | | |
18 | + | func i () = { | |
19 | + | let j = toInt(sha256(toBytes(lastBlock.height))) | |
20 | + | j | |
19 | 21 | } | |
20 | 22 | ||
21 | 23 | ||
22 | - | func j (k,l) = { | |
23 | - | let m = l | |
24 | - | let n = sigVerify(toBytes(m), toBytes(k), b) | |
25 | - | if (n) | |
26 | - | then { | |
27 | - | let o = (toInt(sha256(toBytes(k))) % 6) | |
28 | - | if ((0 > o)) | |
29 | - | then ((-1 * o) + 1) | |
30 | - | else (o + 1) | |
31 | - | } | |
32 | - | else throw("Invalid RSA signature") | |
24 | + | func k (l) = { | |
25 | + | let m = getStringValue(this, l) | |
26 | + | m | |
33 | 27 | } | |
34 | 28 | ||
35 | 29 | ||
36 | - | func p (q,r) = { | |
37 | - | let s = "x" | |
38 | - | s | |
30 | + | func n (o,p,q,r) = { | |
31 | + | let s = size(o) | |
32 | + | if ((s >= q)) | |
33 | + | then if ((q == 0)) | |
34 | + | then { | |
35 | + | let t = r | |
36 | + | let u = extract(split(o, ";")[1]) | |
37 | + | let v = extract(split(o, ";")[2]) | |
38 | + | let w = extract(split(o, ";")[3]) | |
39 | + | let x = extract(split(o, ";")[4]) | |
40 | + | let y = extract(split(o, ";")[5]) | |
41 | + | let z = extract(split(o, ";")[6]) | |
42 | + | let A = extract(split(o, ";")[7]) | |
43 | + | let B = ((((((((((((((t + p) + u) + p) + v) + p) + w) + p) + x) + p) + y) + p) + z) + p) + A) | |
44 | + | B | |
45 | + | } | |
46 | + | else throw("error creating datastring") | |
47 | + | else throw(("field index out of range. Number of fields for string is: " + toString(s))) | |
39 | 48 | } | |
40 | 49 | ||
41 | 50 | ||
42 | - | func t (u,v,w) = { | |
43 | - | let x = "placeholder" | |
44 | - | x | |
51 | + | @Callable(C) | |
52 | + | func initiate () = { | |
53 | + | let D = toBase58String(C.transactionId) | |
54 | + | let E = extract(C.payment) | |
55 | + | let f = "default message for now" | |
56 | + | let F = toBase58String(extract(C.callerPublicKey)) | |
57 | + | let G = toBase58String(extract(C.caller.bytes)) | |
58 | + | let H = C.transactionId | |
59 | + | let I = if ((E.amount == 100000000)) | |
60 | + | then "S" | |
61 | + | else if ((E.amount == 200000000)) | |
62 | + | then "M" | |
63 | + | else if ((E.amount == 400000000)) | |
64 | + | then "L" | |
65 | + | else "error" | |
66 | + | let J = (((((((("SUBMITTED" + ";") + toBase58String(extract(C.caller.bytes))) + ";") + toString(E.amount)) + ";") + toString(height)) + ";") + I) | |
67 | + | if ((I == "error")) | |
68 | + | then throw("Prices are 1, 2, and 4 waves. Other amounts will be rejected by the smart contract") | |
69 | + | else WriteSet([DataEntry(D, J)]) | |
45 | 70 | } | |
46 | 71 | ||
47 | 72 | ||
48 | - | func y (z) = { | |
49 | - | let A = getStringValue(this, z) | |
50 | - | A | |
51 | - | } | |
73 | + | ||
74 | + | @Callable(C) | |
75 | + | func finalize (K) = if ((C.callerPublicKey != a)) | |
76 | + | then throw("Only owner can call finalize function") | |
77 | + | else { | |
78 | + | let L = k(K) | |
79 | + | let M = parseIntValue(extract(split(L, ";")[8])) | |
80 | + | let N = parseIntValue(extract(split(L, ";")[0])) | |
81 | + | let J = n(L, ";", 0, "COMPLETED") | |
82 | + | ScriptResult(WriteSet([DataEntry(K, J)]), TransferSet([ScriptTransfer(C.caller, M, d)])) | |
83 | + | } | |
52 | 84 | ||
53 | 85 | ||
54 | - | @Callable(B) | |
55 | - | func initiate () = { | |
56 | - | let m = toBase58String(B.transactionId) | |
57 | - | let C = extract(B.payment) | |
58 | - | let e = "default message for now" | |
59 | - | let D = toBase58String(extract(B.callerPublicKey)) | |
60 | - | let E = toBase58String(extract(B.caller.bytes)) | |
61 | - | let F = B.transactionId | |
62 | - | let G = base58'6khhQRn6E7dsLqxnkGHnEKoZZJv9U7bhadzprWvjAi6m' | |
63 | - | let H = if ((C.amount == 100000000)) | |
64 | - | then "S" | |
65 | - | else if ((C.amount == 200000000)) | |
66 | - | then "M" | |
67 | - | else if ((C.amount == 400000000)) | |
68 | - | then "L" | |
69 | - | else "error" | |
70 | - | let I = (((((((("SUBMITTED" + ";") + toBase58String(extract(B.caller.bytes))) + ";") + toString(C.amount)) + ";") + toString(height)) + ";") + H) | |
71 | - | if ((H == "error")) | |
72 | - | then throw("Prices are 1, 2, and 4 waves. Other amounts will be rejected by the smart contract") | |
73 | - | else { | |
74 | - | let J = (C.amount * 3) | |
75 | - | WriteSet([DataEntry(m, I)]) | |
86 | + | @Verifier(O) | |
87 | + | func P () = { | |
88 | + | let Q = O | |
89 | + | if (if ($isInstanceOf(Q, "TransferTransaction")) | |
90 | + | then true | |
91 | + | else if ($isInstanceOf(Q, "ReissueTransaction")) | |
92 | + | then true | |
93 | + | else if ($isInstanceOf(Q, "IssueTransaction")) | |
94 | + | then true | |
95 | + | else $isInstanceOf(Q, "SetScriptTransaction")) | |
96 | + | then { | |
97 | + | let R = Q | |
98 | + | sigVerify(O.bodyBytes, O.proofs[0], a) | |
76 | 99 | } | |
77 | - | } | |
78 | - | ||
79 | - | ||
80 | - | @Verifier(K) | |
81 | - | func L () = { | |
82 | - | let M = K | |
83 | - | if (if ($isInstanceOf(M, "ReissueTransaction")) | |
84 | - | then true | |
85 | - | else if ($isInstanceOf(M, "IssueTransaction")) | |
86 | - | then true | |
87 | - | else $isInstanceOf(M, "SetScriptTransaction")) | |
88 | - | then { | |
89 | - | let N = M | |
90 | - | sigVerify(K.bodyBytes, K.proofs[0], a) | |
91 | - | } | |
92 | - | else if ($isInstanceOf(M, "DataTransaction")) | |
100 | + | else if ($isInstanceOf(Q, "DataTransaction")) | |
93 | 101 | then { | |
94 | - | let | |
95 | - | sigVerify( | |
102 | + | let R = Q | |
103 | + | sigVerify(O.bodyBytes, O.proofs[0], a) | |
96 | 104 | } | |
97 | - | else if ($isInstanceOf(M, "TransferTransaction")) | |
98 | - | then { | |
99 | - | let N = M | |
100 | - | true | |
101 | - | } | |
102 | - | else false | |
105 | + | else false | |
103 | 106 | } | |
104 | 107 |
github/deemru/w8io/169f3d6 34.84 ms ◑