tx · BZ8xfukTWXVGi3Ao8QAW3uu31HzYL8dokCzpJ5R6PwWp
3N4NPivoThtskr7JxnNrKL7s8BzmRGx9rT2: -0.14000000 Waves
2019.08.12 17:49 [627984] smart account 3N4NPivoThtskr7JxnNrKL7s8BzmRGx9rT2 > SELF 0.00000000 Waves
{
"type": 13,
"id": "BZ8xfukTWXVGi3Ao8QAW3uu31HzYL8dokCzpJ5R6PwWp",
"fee": 14000000,
"feeAssetId": null,
"timestamp": 1565621329511,
"version": 1,
"sender": "3N4NPivoThtskr7JxnNrKL7s8BzmRGx9rT2",
"senderPublicKey": "F3vhYapU4NBzfM2X4KNkoFcxj3UbYnJjqituG6KE7ZPG",
"proofs": [
"25nnACiMEBPCDHCtwzJCnopE9CuybyKb8RNPhJ82DVzaax4Rvr2jAVgKUgZ5EDWBs4oP2F5YgjvT23jh9MBdj8Vb"
],
"script": "base64:AAIDAAAAAAAAAAAAAAAJAAAAAAdSVU5OSU5HAgAAAAdSVU5OSU5HAAAAAAZDTE9TRUQCAAAABkNMT1NFRAAAAAAJREFQUE9XTkVSAgAAACMzTjROUGl2b1RodHNrcjdKeG5OcktMN3M4QnptUkd4OXJUMgAAAAAFV0FWRVMCAAAABVdBVkVTAAAAAAROT05FAgAAAAROT05FAQAAAAtnZXROdW1CeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFAAAAA251bQEAAAALZ2V0U3RyQnlLZXkAAAABAAAAA2tleQQAAAADc3RyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBQAAAAROT05FBQAAAANzdHIBAAAAEGdldENvbn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AAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24GBn5TcwI=",
"chainId": 84,
"height": 627984,
"spentComplexity": 0
}
View: original | compacted
Prev: BVjBAoqZxMjuXj5i8AZFN1mGFUBPoqeArSYU9J4WHBxS
Next: BsK4vUHjh9SPGruGjDDZPa7tazEYdNFYe4K91nwuxhiW
Diff:
Old | New | | Differences |
---|
45 | 45 | | } |
---|
46 | 46 | | |
---|
47 | 47 | | |
---|
48 | | - | func o (p) = { |
---|
49 | | - | let n = f("contest_currentnumber") |
---|
50 | | - | k(((("bet_" + toString(n)) + "_") + p)) |
---|
| 48 | + | func o () = { |
---|
| 49 | + | let p = extract(addressFromString("3PPTrTo3AzR56N7ArzbU3Bpq9zYMgcf39Mk")) |
---|
| 50 | + | let q = { |
---|
| 51 | + | let i = getInteger(p, "waves_usd_2") |
---|
| 52 | + | if ($isInstanceOf(i, "Int")) |
---|
| 53 | + | then { |
---|
| 54 | + | let j = i |
---|
| 55 | + | j |
---|
| 56 | + | } |
---|
| 57 | + | else 0 |
---|
| 58 | + | } |
---|
| 59 | + | q |
---|
51 | 60 | | } |
---|
52 | 61 | | |
---|
53 | 62 | | |
---|
54 | | - | @Callable(q) |
---|
55 | | - | func setContestStatus (r,s) = { |
---|
56 | | - | let t = toBase58String(q.caller.bytes) |
---|
57 | | - | if ((t != c)) |
---|
| 63 | + | @Callable(r) |
---|
| 64 | + | func setContestStatus (s,t) = { |
---|
| 65 | + | let u = toBase58String(r.caller.bytes) |
---|
| 66 | + | if ((u != c)) |
---|
58 | 67 | | then throw("Only dAPP Owner can set Contest Status.") |
---|
59 | | - | else if (if ((s != a)) |
---|
60 | | - | then (s != b) |
---|
| 68 | + | else if (if ((t != a)) |
---|
| 69 | + | then (t != b) |
---|
61 | 70 | | else false) |
---|
62 | | - | then throw(("Invalid status: " + s)) |
---|
63 | | - | else WriteSet([DataEntry((("contest_" + toString(r)) + "_status"), s)]) |
---|
| 71 | + | then throw(("Invalid status: " + t)) |
---|
| 72 | + | else WriteSet([DataEntry((("contest_" + toString(s)) + "_status"), t)]) |
---|
64 | 73 | | } |
---|
65 | 74 | | |
---|
66 | 75 | | |
---|
67 | 76 | | |
---|
68 | | - | @Callable(q) |
---|
69 | | - | func setContestConfiguration (u,v) = { |
---|
70 | | - | let t = toBase58String(q.caller.bytes) |
---|
71 | | - | let w = f("contest_currentnumber") |
---|
72 | | - | let x = k((("contest_" + toString(w)) + "_status")) |
---|
73 | | - | let n = (w + 1) |
---|
74 | | - | if ((t != c)) |
---|
| 77 | + | @Callable(r) |
---|
| 78 | + | func setContestConfiguration (v,w) = { |
---|
| 79 | + | let u = toBase58String(r.caller.bytes) |
---|
| 80 | + | let x = f("contest_currentnumber") |
---|
| 81 | + | let y = k((("contest_" + toString(x)) + "_status")) |
---|
| 82 | + | let n = (x + 1) |
---|
| 83 | + | if ((u != c)) |
---|
75 | 84 | | then throw("Only dAPP Owner can Configure Contest.") |
---|
76 | | - | else if ((height >= v)) |
---|
| 85 | + | else if ((height >= w)) |
---|
77 | 86 | | then throw(("Start Height must be greater than current Blockchain height: " + toString(height))) |
---|
78 | | - | else if ((x == a)) |
---|
79 | | - | then throw(("You cannot configure a new Contest while old Contest status is: " + x)) |
---|
80 | | - | else if ((u != d)) |
---|
81 | | - | then throw((("dAPP does not support currency: " + u) + " yet.")) |
---|
| 87 | + | else if ((y == a)) |
---|
| 88 | + | then throw(("You cannot configure a new Contest while old Contest status is: " + y)) |
---|
| 89 | + | else if ((v != d)) |
---|
| 90 | + | then throw((("dAPP does not support currency: " + v) + " yet.")) |
---|
82 | 91 | | else { |
---|
83 | | - | let y = (v + (7 * 1440)) |
---|
84 | | - | WriteSet([DataEntry("contest_currentnumber", n), DataEntry((("contest_" + toString(n)) + "_currency"), u), DataEntry((("contest_" + toString(n)) + "_startheight"), v), DataEntry((("contest_" + toString(n)) + "_finishheight"), y), DataEntry((("contest_" + toString(n)) + "_status"), a)]) |
---|
| 92 | + | let z = (w + (7 * 1440)) |
---|
| 93 | + | WriteSet([DataEntry("contest_currentnumber", n), DataEntry((("contest_" + toString(n)) + "_currency"), v), DataEntry((("contest_" + toString(n)) + "_startheight"), w), DataEntry((("contest_" + toString(n)) + "_finishheight"), z), DataEntry((("contest_" + toString(n)) + "_status"), a)]) |
---|
85 | 94 | | } |
---|
86 | 95 | | } |
---|
87 | 96 | | |
---|
88 | 97 | | |
---|
89 | 98 | | |
---|
90 | | - | @Callable(q) |
---|
91 | | - | func bet (p) = { |
---|
92 | | - | let z = base58'FaA6njrtReYVacBjgj36X8gGwydDYQKrthrt3hufhMZh' |
---|
93 | | - | let t = toBase58String(q.caller.bytes) |
---|
94 | | - | let A = extract(q.payment) |
---|
| 99 | + | @Callable(r) |
---|
| 100 | + | func bet (A) = { |
---|
| 101 | + | let B = base58'FaA6njrtReYVacBjgj36X8gGwydDYQKrthrt3hufhMZh' |
---|
| 102 | + | let u = toBase58String(r.caller.bytes) |
---|
| 103 | + | let C = extract(r.payment) |
---|
95 | 104 | | let n = f("contest_currentnumber") |
---|
96 | | - | let v = f((("contest_" + toString(n)) + "_startheight")) |
---|
97 | | - | let y = f((("contest_" + toString(n)) + "_finishheight")) |
---|
98 | | - | let g = ((("bet_" + toString(n)) + "_") + p) |
---|
99 | | - | let s = k((("contest_" + toString(n)) + "_status")) |
---|
100 | | - | let B = k(((("bet_" + toString(n)) + "_") + p)) |
---|
101 | | - | if ((height > (y - (2 * 1440)))) |
---|
| 105 | + | let w = f((("contest_" + toString(n)) + "_startheight")) |
---|
| 106 | + | let z = f((("contest_" + toString(n)) + "_finishheight")) |
---|
| 107 | + | let g = ((("bet_" + toString(n)) + "_") + A) |
---|
| 108 | + | let t = k((("contest_" + toString(n)) + "_status")) |
---|
| 109 | + | let D = k(((("bet_" + toString(n)) + "_") + A)) |
---|
| 110 | + | if ((height > (z - (2 * 1440)))) |
---|
102 | 111 | | then throw("You cannot bet anymore at this height.") |
---|
103 | | - | else if ((s != a)) |
---|
| 112 | + | else if ((t != a)) |
---|
104 | 113 | | then throw("Invalid status: you cannot bet now.") |
---|
105 | | - | else if (if ((A.assetId != z)) |
---|
| 114 | + | else if (if ((C.assetId != B)) |
---|
106 | 115 | | then true |
---|
107 | | - | else (A.amount != 500000)) |
---|
| 116 | + | else (C.amount != 500000)) |
---|
108 | 117 | | then throw("You must pay 5 WLT to bet.") |
---|
109 | | - | else if (if ((B != e)) |
---|
110 | | - | then (B != t) |
---|
| 118 | + | else if (if ((D != e)) |
---|
| 119 | + | then (D != u) |
---|
111 | 120 | | else false) |
---|
112 | | - | then throw(((((((("Key: " + g) + " Account:") + t) + " Existing Bet Account: ") + B) + " Currency Value:") + p)) |
---|
113 | | - | else WriteSet([DataEntry(((("bet_" + toString(n)) + "_") + p), t)]) |
---|
| 121 | + | then throw(((((((("Key: " + g) + " Account:") + u) + " Existing Bet Account: ") + D) + " Currency Value:") + A)) |
---|
| 122 | + | else WriteSet([DataEntry(((("bet_" + toString(n)) + "_") + A), u)]) |
---|
114 | 123 | | } |
---|
115 | 124 | | |
---|
116 | 125 | | |
---|
117 | | - | @Verifier(C) |
---|
118 | | - | func D () = { |
---|
119 | | - | let i = C |
---|
| 126 | + | |
---|
| 127 | + | @Callable(r) |
---|
| 128 | + | func closecontest (E) = { |
---|
| 129 | + | let n = f("contest_currentnumber") |
---|
| 130 | + | let g = ((("bet_" + toString(n)) + "_") + E) |
---|
| 131 | + | let F = k(g) |
---|
| 132 | + | let u = toBase58String(r.caller.bytes) |
---|
| 133 | + | if ((u != c)) |
---|
| 134 | + | then throw("Only dAPP Owner can Close Contest.") |
---|
| 135 | + | else WriteSet([DataEntry((("bet_" + toString(n)) + "_status"), b), DataEntry((("bet_" + toString(n)) + "_winner"), F)]) |
---|
| 136 | + | } |
---|
| 137 | + | |
---|
| 138 | + | |
---|
| 139 | + | @Verifier(G) |
---|
| 140 | + | func H () = { |
---|
| 141 | + | let i = G |
---|
120 | 142 | | if (if ($isInstanceOf(i, "SetScriptTransaction")) |
---|
121 | 143 | | then true |
---|
122 | 144 | | else $isInstanceOf(i, "DataTransaction")) |
---|
123 | | - | then sigVerify(C.bodyBytes, C.proofs[0], C.senderPublicKey) |
---|
| 145 | + | then sigVerify(G.bodyBytes, G.proofs[0], G.senderPublicKey) |
---|
124 | 146 | | else if ($isInstanceOf(i, "InvokeScriptTransaction")) |
---|
125 | 147 | | then true |
---|
126 | 148 | | else true |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = "RUNNING" |
---|
5 | 5 | | |
---|
6 | 6 | | let b = "CLOSED" |
---|
7 | 7 | | |
---|
8 | 8 | | let c = "3N4NPivoThtskr7JxnNrKL7s8BzmRGx9rT2" |
---|
9 | 9 | | |
---|
10 | 10 | | let d = "WAVES" |
---|
11 | 11 | | |
---|
12 | 12 | | let e = "NONE" |
---|
13 | 13 | | |
---|
14 | 14 | | func f (g) = { |
---|
15 | 15 | | let h = { |
---|
16 | 16 | | let i = getInteger(this, g) |
---|
17 | 17 | | if ($isInstanceOf(i, "Int")) |
---|
18 | 18 | | then { |
---|
19 | 19 | | let j = i |
---|
20 | 20 | | j |
---|
21 | 21 | | } |
---|
22 | 22 | | else 0 |
---|
23 | 23 | | } |
---|
24 | 24 | | h |
---|
25 | 25 | | } |
---|
26 | 26 | | |
---|
27 | 27 | | |
---|
28 | 28 | | func k (g) = { |
---|
29 | 29 | | let l = { |
---|
30 | 30 | | let i = getString(this, g) |
---|
31 | 31 | | if ($isInstanceOf(i, "String")) |
---|
32 | 32 | | then { |
---|
33 | 33 | | let j = i |
---|
34 | 34 | | j |
---|
35 | 35 | | } |
---|
36 | 36 | | else e |
---|
37 | 37 | | } |
---|
38 | 38 | | l |
---|
39 | 39 | | } |
---|
40 | 40 | | |
---|
41 | 41 | | |
---|
42 | 42 | | func m () = { |
---|
43 | 43 | | let n = f("contest_currentnumber") |
---|
44 | 44 | | k((("contest_" + toString(n)) + "_status")) |
---|
45 | 45 | | } |
---|
46 | 46 | | |
---|
47 | 47 | | |
---|
48 | | - | func o (p) = { |
---|
49 | | - | let n = f("contest_currentnumber") |
---|
50 | | - | k(((("bet_" + toString(n)) + "_") + p)) |
---|
| 48 | + | func o () = { |
---|
| 49 | + | let p = extract(addressFromString("3PPTrTo3AzR56N7ArzbU3Bpq9zYMgcf39Mk")) |
---|
| 50 | + | let q = { |
---|
| 51 | + | let i = getInteger(p, "waves_usd_2") |
---|
| 52 | + | if ($isInstanceOf(i, "Int")) |
---|
| 53 | + | then { |
---|
| 54 | + | let j = i |
---|
| 55 | + | j |
---|
| 56 | + | } |
---|
| 57 | + | else 0 |
---|
| 58 | + | } |
---|
| 59 | + | q |
---|
51 | 60 | | } |
---|
52 | 61 | | |
---|
53 | 62 | | |
---|
54 | | - | @Callable(q) |
---|
55 | | - | func setContestStatus (r,s) = { |
---|
56 | | - | let t = toBase58String(q.caller.bytes) |
---|
57 | | - | if ((t != c)) |
---|
| 63 | + | @Callable(r) |
---|
| 64 | + | func setContestStatus (s,t) = { |
---|
| 65 | + | let u = toBase58String(r.caller.bytes) |
---|
| 66 | + | if ((u != c)) |
---|
58 | 67 | | then throw("Only dAPP Owner can set Contest Status.") |
---|
59 | | - | else if (if ((s != a)) |
---|
60 | | - | then (s != b) |
---|
| 68 | + | else if (if ((t != a)) |
---|
| 69 | + | then (t != b) |
---|
61 | 70 | | else false) |
---|
62 | | - | then throw(("Invalid status: " + s)) |
---|
63 | | - | else WriteSet([DataEntry((("contest_" + toString(r)) + "_status"), s)]) |
---|
| 71 | + | then throw(("Invalid status: " + t)) |
---|
| 72 | + | else WriteSet([DataEntry((("contest_" + toString(s)) + "_status"), t)]) |
---|
64 | 73 | | } |
---|
65 | 74 | | |
---|
66 | 75 | | |
---|
67 | 76 | | |
---|
68 | | - | @Callable(q) |
---|
69 | | - | func setContestConfiguration (u,v) = { |
---|
70 | | - | let t = toBase58String(q.caller.bytes) |
---|
71 | | - | let w = f("contest_currentnumber") |
---|
72 | | - | let x = k((("contest_" + toString(w)) + "_status")) |
---|
73 | | - | let n = (w + 1) |
---|
74 | | - | if ((t != c)) |
---|
| 77 | + | @Callable(r) |
---|
| 78 | + | func setContestConfiguration (v,w) = { |
---|
| 79 | + | let u = toBase58String(r.caller.bytes) |
---|
| 80 | + | let x = f("contest_currentnumber") |
---|
| 81 | + | let y = k((("contest_" + toString(x)) + "_status")) |
---|
| 82 | + | let n = (x + 1) |
---|
| 83 | + | if ((u != c)) |
---|
75 | 84 | | then throw("Only dAPP Owner can Configure Contest.") |
---|
76 | | - | else if ((height >= v)) |
---|
| 85 | + | else if ((height >= w)) |
---|
77 | 86 | | then throw(("Start Height must be greater than current Blockchain height: " + toString(height))) |
---|
78 | | - | else if ((x == a)) |
---|
79 | | - | then throw(("You cannot configure a new Contest while old Contest status is: " + x)) |
---|
80 | | - | else if ((u != d)) |
---|
81 | | - | then throw((("dAPP does not support currency: " + u) + " yet.")) |
---|
| 87 | + | else if ((y == a)) |
---|
| 88 | + | then throw(("You cannot configure a new Contest while old Contest status is: " + y)) |
---|
| 89 | + | else if ((v != d)) |
---|
| 90 | + | then throw((("dAPP does not support currency: " + v) + " yet.")) |
---|
82 | 91 | | else { |
---|
83 | | - | let y = (v + (7 * 1440)) |
---|
84 | | - | WriteSet([DataEntry("contest_currentnumber", n), DataEntry((("contest_" + toString(n)) + "_currency"), u), DataEntry((("contest_" + toString(n)) + "_startheight"), v), DataEntry((("contest_" + toString(n)) + "_finishheight"), y), DataEntry((("contest_" + toString(n)) + "_status"), a)]) |
---|
| 92 | + | let z = (w + (7 * 1440)) |
---|
| 93 | + | WriteSet([DataEntry("contest_currentnumber", n), DataEntry((("contest_" + toString(n)) + "_currency"), v), DataEntry((("contest_" + toString(n)) + "_startheight"), w), DataEntry((("contest_" + toString(n)) + "_finishheight"), z), DataEntry((("contest_" + toString(n)) + "_status"), a)]) |
---|
85 | 94 | | } |
---|
86 | 95 | | } |
---|
87 | 96 | | |
---|
88 | 97 | | |
---|
89 | 98 | | |
---|
90 | | - | @Callable(q) |
---|
91 | | - | func bet (p) = { |
---|
92 | | - | let z = base58'FaA6njrtReYVacBjgj36X8gGwydDYQKrthrt3hufhMZh' |
---|
93 | | - | let t = toBase58String(q.caller.bytes) |
---|
94 | | - | let A = extract(q.payment) |
---|
| 99 | + | @Callable(r) |
---|
| 100 | + | func bet (A) = { |
---|
| 101 | + | let B = base58'FaA6njrtReYVacBjgj36X8gGwydDYQKrthrt3hufhMZh' |
---|
| 102 | + | let u = toBase58String(r.caller.bytes) |
---|
| 103 | + | let C = extract(r.payment) |
---|
95 | 104 | | let n = f("contest_currentnumber") |
---|
96 | | - | let v = f((("contest_" + toString(n)) + "_startheight")) |
---|
97 | | - | let y = f((("contest_" + toString(n)) + "_finishheight")) |
---|
98 | | - | let g = ((("bet_" + toString(n)) + "_") + p) |
---|
99 | | - | let s = k((("contest_" + toString(n)) + "_status")) |
---|
100 | | - | let B = k(((("bet_" + toString(n)) + "_") + p)) |
---|
101 | | - | if ((height > (y - (2 * 1440)))) |
---|
| 105 | + | let w = f((("contest_" + toString(n)) + "_startheight")) |
---|
| 106 | + | let z = f((("contest_" + toString(n)) + "_finishheight")) |
---|
| 107 | + | let g = ((("bet_" + toString(n)) + "_") + A) |
---|
| 108 | + | let t = k((("contest_" + toString(n)) + "_status")) |
---|
| 109 | + | let D = k(((("bet_" + toString(n)) + "_") + A)) |
---|
| 110 | + | if ((height > (z - (2 * 1440)))) |
---|
102 | 111 | | then throw("You cannot bet anymore at this height.") |
---|
103 | | - | else if ((s != a)) |
---|
| 112 | + | else if ((t != a)) |
---|
104 | 113 | | then throw("Invalid status: you cannot bet now.") |
---|
105 | | - | else if (if ((A.assetId != z)) |
---|
| 114 | + | else if (if ((C.assetId != B)) |
---|
106 | 115 | | then true |
---|
107 | | - | else (A.amount != 500000)) |
---|
| 116 | + | else (C.amount != 500000)) |
---|
108 | 117 | | then throw("You must pay 5 WLT to bet.") |
---|
109 | | - | else if (if ((B != e)) |
---|
110 | | - | then (B != t) |
---|
| 118 | + | else if (if ((D != e)) |
---|
| 119 | + | then (D != u) |
---|
111 | 120 | | else false) |
---|
112 | | - | then throw(((((((("Key: " + g) + " Account:") + t) + " Existing Bet Account: ") + B) + " Currency Value:") + p)) |
---|
113 | | - | else WriteSet([DataEntry(((("bet_" + toString(n)) + "_") + p), t)]) |
---|
| 121 | + | then throw(((((((("Key: " + g) + " Account:") + u) + " Existing Bet Account: ") + D) + " Currency Value:") + A)) |
---|
| 122 | + | else WriteSet([DataEntry(((("bet_" + toString(n)) + "_") + A), u)]) |
---|
114 | 123 | | } |
---|
115 | 124 | | |
---|
116 | 125 | | |
---|
117 | | - | @Verifier(C) |
---|
118 | | - | func D () = { |
---|
119 | | - | let i = C |
---|
| 126 | + | |
---|
| 127 | + | @Callable(r) |
---|
| 128 | + | func closecontest (E) = { |
---|
| 129 | + | let n = f("contest_currentnumber") |
---|
| 130 | + | let g = ((("bet_" + toString(n)) + "_") + E) |
---|
| 131 | + | let F = k(g) |
---|
| 132 | + | let u = toBase58String(r.caller.bytes) |
---|
| 133 | + | if ((u != c)) |
---|
| 134 | + | then throw("Only dAPP Owner can Close Contest.") |
---|
| 135 | + | else WriteSet([DataEntry((("bet_" + toString(n)) + "_status"), b), DataEntry((("bet_" + toString(n)) + "_winner"), F)]) |
---|
| 136 | + | } |
---|
| 137 | + | |
---|
| 138 | + | |
---|
| 139 | + | @Verifier(G) |
---|
| 140 | + | func H () = { |
---|
| 141 | + | let i = G |
---|
120 | 142 | | if (if ($isInstanceOf(i, "SetScriptTransaction")) |
---|
121 | 143 | | then true |
---|
122 | 144 | | else $isInstanceOf(i, "DataTransaction")) |
---|
123 | | - | then sigVerify(C.bodyBytes, C.proofs[0], C.senderPublicKey) |
---|
| 145 | + | then sigVerify(G.bodyBytes, G.proofs[0], G.senderPublicKey) |
---|
124 | 146 | | else if ($isInstanceOf(i, "InvokeScriptTransaction")) |
---|
125 | 147 | | then true |
---|
126 | 148 | | else true |
---|
127 | 149 | | } |
---|
128 | 150 | | |
---|