tx · Ca1iEJr8YzvRHkuLtYZgUMzDtp2RJH64mx86HfdtEzH7 3N3y7DVmszkgFYMGoDtNnPjrNmLTf1rRUKJ: -0.01990000 Waves 2020.10.20 19:50 [1229145] smart account 3N3y7DVmszkgFYMGoDtNnPjrNmLTf1rRUKJ > SELF 0.00000000 Waves
{ "type": 13, "id": "Ca1iEJr8YzvRHkuLtYZgUMzDtp2RJH64mx86HfdtEzH7", "fee": 1990000, "feeAssetId": null, "timestamp": 1603212514403, "version": 2, "chainId": 84, "sender": "3N3y7DVmszkgFYMGoDtNnPjrNmLTf1rRUKJ", "senderPublicKey": "EPmZCX2H4AC1hUmAFRUfWrhzXrNjf3wPaybY6jHZQphj", "proofs": [ "3PYDPteDQAsVXvmuijs1iAkNiBoicbj96WUcUjUyDApQph3Jc4PMzx1XhmDfJLgi4pbrHJuWGRT7xGoJxtm4kUPX" ], "script": "base64:AAIDAAAAAAAAABEIARIAEgASABIAEgMKAQESAAAAAAAAAAAGAAAAAWkBAAAAFFJlYWRNYXhHb3Zlcm5EZXBvc2l0AAAAAAQAAAAOR292ZXJuVG9rZW5LZXkCAAAAFUdvdmVyblRva2VuTWF4RGVwb3NpdAQAAAAaTWF4R292ZXJuVG9rZW5EZXBvc2l0ZXJLZXkCAAAAGk1heEdvdmVyblRva2VuRGVwb3NpdGVyS2V5BAAAAAZXaW5uZXIJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMFAAAAGk1heEdvdmVyblRva2VuRGVwb3NpdGVyS2V5BAAAABVNYXhHb3Zlcm5Ub2tlbkRlcG9zaXQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAOR292ZXJuVG9rZW5LZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAkAAAIAAAABCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAABJXaW5uZXIgaXMuLi4u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VzZXJHb3Zlcm5Ub2tlbkFtb3VudAAAAAAAAAAAZAkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAC1ByaXplV2lubmVyBQAAAAtQcml6ZUFtb3VudAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAASRnVuZEJveFN0YWtlZFRva2VuAAAAAAAAAAAACQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAABJVc2VyR292ZXJuVG9rZW5LZXkAAAAAAAAAAGQFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAAC1ByaXplQW1vdW50BQAAAAtTdGFrZWRUb2tlbgkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIAAAAAAAAAAGQFAAAAC0dvdmVyblRva2VuBQAAAANuaWwJAAACAAAAAQkAASwAAAACAgAAAEdZb3UgaGF2ZSB0byBkZXBvc2l0IDEwMCBHb3Zlcm5Ub2tlbiB0byBjbGFpbSBSZXdhcmQgCiBZb3VyIEJhbGFuY2UgaXM6IAkAAaQAAAABBQAAABVVc2VyR292ZXJuVG9rZW5BbW91bnQAAAAA02yMyQ==", "height": 1229145, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7UQxc8Qq9mdSyiTfmVcRpsfRUB1TkKDT3etK5Gr8MFip Next: AnsQJFbGC5wDvtzp3MBwnh2GMezS2nGKteGEVbKXWnbY Diff:
Old | New | Differences | |
---|---|---|---|
17 | 17 | } | |
18 | 18 | else 0 | |
19 | 19 | } | |
20 | - | throw(((("Winner is.....: " + d) + " ") + toString(e))) | |
20 | + | throw(((("Winner is.....: " + d) + " | |
21 | + | Total GovernToken: ") + toString(e))) | |
21 | 22 | } | |
22 | 23 | ||
23 | 24 | ||
56 | 57 | then (extract(m.assetId) == l) | |
57 | 58 | else false) | |
58 | 59 | then { | |
59 | - | let i = ((toBase58String(a.caller.bytes) + "_") + toBase58String(l)) | |
60 | + | let n = ((toBase58String(a.caller.bytes) + "_") + toBase58String(l)) | |
61 | + | let o = ((toBase58String(a.caller.bytes) + "_") + toBase58String(h)) | |
60 | 62 | let j = { | |
61 | - | let f = getInteger(this, | |
63 | + | let f = getInteger(this, n) | |
62 | 64 | if ($isInstanceOf(f, "Int")) | |
63 | 65 | then { | |
64 | 66 | let g = f | |
66 | 68 | } | |
67 | 69 | else 0 | |
68 | 70 | } | |
69 | - | let | |
70 | - | let | |
71 | - | if ((1 > | |
71 | + | let p = (j + m.amount) | |
72 | + | let q = assetBalance(this, h) | |
73 | + | if ((1 > q)) | |
72 | 74 | then throw("No enough GovernToken In Contract") | |
73 | - | else ScriptResult(WriteSet([DataEntry( | |
75 | + | else ScriptResult(WriteSet([DataEntry(o, 10), DataEntry(n, p)]), TransferSet([ScriptTransfer(a.caller, 10, h)])) | |
74 | 76 | } | |
75 | 77 | else throw("Can deposit only StakeToken") | |
76 | 78 | } | |
80 | 82 | @Callable(a) | |
81 | 83 | func DepositGovernToken () = { | |
82 | 84 | let h = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
83 | - | let | |
85 | + | let r = toBase58String(h) | |
84 | 86 | let m = extract(a.payment) | |
85 | 87 | if (if (isDefined(m.assetId)) | |
86 | 88 | then (extract(m.assetId) == h) | |
96 | 98 | } | |
97 | 99 | else 0 | |
98 | 100 | } | |
99 | - | let | |
101 | + | let s = (j + m.amount) | |
100 | 102 | let b = "GovernTokenMaxDeposit" | |
101 | 103 | let c = "MaxGovernTokenDepositerKey" | |
102 | 104 | let e = { | |
108 | 110 | } | |
109 | 111 | else 0 | |
110 | 112 | } | |
111 | - | if (if (( | |
113 | + | if (if ((s > e)) | |
112 | 114 | then true | |
113 | 115 | else (e == 0)) | |
114 | - | then WriteSet([DataEntry(i, | |
115 | - | else WriteSet([DataEntry(i, | |
116 | + | then WriteSet([DataEntry(i, s), DataEntry(b, s), DataEntry(c, i)]) | |
117 | + | else WriteSet([DataEntry(i, s)]) | |
116 | 118 | } | |
117 | 119 | else throw("Can deposit only Govern Token") | |
118 | 120 | } | |
120 | 122 | ||
121 | 123 | ||
122 | 124 | @Callable(a) | |
123 | - | func WithdrawStakedFunds ( | |
124 | - | let | |
125 | + | func WithdrawStakedFunds (t) = { | |
126 | + | let u = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' | |
125 | 127 | let h = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
126 | 128 | let i = toBase58String(a.caller.bytes) | |
127 | 129 | let j = { | |
133 | 135 | } | |
134 | 136 | else 0 | |
135 | 137 | } | |
136 | - | let | |
137 | - | if ((0 > | |
138 | + | let p = (j - t) | |
139 | + | if ((0 > t)) | |
138 | 140 | then throw("Can't withdraw negative amount") | |
139 | - | else if ((0 > | |
141 | + | else if ((0 > p)) | |
140 | 142 | then throw("User cannot withdraw more than deposited funds") | |
141 | 143 | else { | |
142 | 144 | let k = assetBalance(this, h) | |
143 | 145 | if ((1 > k)) | |
144 | 146 | then throw("No enough GovernToken In Contract") | |
145 | - | else ScriptResult(WriteSet([DataEntry(i, 1), DataEntry(i, | |
147 | + | else ScriptResult(WriteSet([DataEntry(i, 1), DataEntry(i, p)]), TransferSet([ScriptTransfer(a.caller, 1, h), ScriptTransfer(a.caller, t, u)])) | |
146 | 148 | } | |
147 | 149 | } | |
148 | 150 | ||
150 | 152 | ||
151 | 153 | @Callable(a) | |
152 | 154 | func ClaimPrize () = { | |
153 | - | let | |
155 | + | let l = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' | |
154 | 156 | let h = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
155 | - | let s = base58'3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD' | |
156 | - | let t = (("3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA" + "_") + toBase58String(r)) | |
157 | - | let u = Address(base58'3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA') | |
158 | - | let v = Address(base58'3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD') | |
159 | - | let w = "3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD" | |
160 | - | let x = ((toBase58String(a.caller.bytes) + "_") + toBase58String(h)) | |
161 | - | let y = ((toBase58String(a.caller.bytes) + "_") + toBase58String(r)) | |
162 | - | let z = ((toBase58String(s) + "_") + toBase58String(r)) | |
163 | - | let A = { | |
164 | - | let f = getInteger(this, x) | |
157 | + | let v = base58'3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD' | |
158 | + | let n = ((toBase58String(a.caller.bytes) + "_") + toBase58String(l)) | |
159 | + | let o = ((toBase58String(a.caller.bytes) + "_") + toBase58String(h)) | |
160 | + | let w = ((toBase58String(v) + "_") + toBase58String(l)) | |
161 | + | let x = { | |
162 | + | let f = getInteger(this, o) | |
165 | 163 | if ($isInstanceOf(f, "Int")) | |
166 | 164 | then { | |
167 | 165 | let g = f | |
169 | 167 | } | |
170 | 168 | else 0 | |
171 | 169 | } | |
172 | - | let | |
173 | - | let f = getInteger(this, | |
170 | + | let y = { | |
171 | + | let f = getInteger(this, n) | |
174 | 172 | if ($isInstanceOf(f, "Int")) | |
175 | 173 | then { | |
176 | 174 | let g = f | |
178 | 176 | } | |
179 | 177 | else 0 | |
180 | 178 | } | |
181 | - | let | |
182 | - | let f = getInteger(this, | |
179 | + | let z = { | |
180 | + | let f = getInteger(this, w) | |
183 | 181 | if ($isInstanceOf(f, "Int")) | |
184 | 182 | then { | |
185 | 183 | let g = f | |
187 | 185 | } | |
188 | 186 | else 0 | |
189 | 187 | } | |
190 | - | if ((C == 0)) | |
188 | + | let c = "MaxGovernTokenDepositerKey" | |
189 | + | let A = getStringValue(this, c) | |
190 | + | if ((z == 0)) | |
191 | 191 | then throw("No prize to Claim") | |
192 | - | else if (( | |
192 | + | else if ((toBase58String(a.caller.bytes) != A)) | |
193 | 193 | then throw("You are not the winner hence cannot claim the reward ") | |
194 | - | else if ((1 > | |
194 | + | else if ((1 > y)) | |
195 | 195 | then throw(("You have to Stake StakedToken to claim reward | |
196 | - | Your Balance of Staked Tokens is: " + toString( | |
197 | - | else if (( | |
198 | - | then ScriptResult(WriteSet([DataEntry( | |
196 | + | Your Balance of Staked Tokens is: " + toString(y))) | |
197 | + | else if ((x > 100)) | |
198 | + | then ScriptResult(WriteSet([DataEntry(A, z), DataEntry(w, 0), DataEntry(o, 100)]), TransferSet([ScriptTransfer(a.caller, z, l), ScriptTransfer(a.caller, 100, h)])) | |
199 | 199 | else throw(("You have to deposit 100 GovernToken to claim Reward | |
200 | - | Your Balance is: " + toString( | |
200 | + | Your Balance is: " + toString(x))) | |
201 | 201 | } | |
202 | 202 | ||
203 | 203 |
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 ReadMaxGovernDeposit () = { | |
8 | 8 | let b = "GovernTokenMaxDeposit" | |
9 | 9 | let c = "MaxGovernTokenDepositerKey" | |
10 | 10 | let d = getStringValue(this, c) | |
11 | 11 | let e = { | |
12 | 12 | let f = getInteger(this, b) | |
13 | 13 | if ($isInstanceOf(f, "Int")) | |
14 | 14 | then { | |
15 | 15 | let g = f | |
16 | 16 | g | |
17 | 17 | } | |
18 | 18 | else 0 | |
19 | 19 | } | |
20 | - | throw(((("Winner is.....: " + d) + " ") + toString(e))) | |
20 | + | throw(((("Winner is.....: " + d) + " | |
21 | + | Total GovernToken: ") + toString(e))) | |
21 | 22 | } | |
22 | 23 | ||
23 | 24 | ||
24 | 25 | ||
25 | 26 | @Callable(a) | |
26 | 27 | func payYield () = { | |
27 | 28 | let h = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
28 | 29 | let i = toBase58String(a.caller.bytes) | |
29 | 30 | let j = { | |
30 | 31 | let f = getInteger(this, i) | |
31 | 32 | if ($isInstanceOf(f, "Int")) | |
32 | 33 | then { | |
33 | 34 | let g = f | |
34 | 35 | g | |
35 | 36 | } | |
36 | 37 | else 0 | |
37 | 38 | } | |
38 | 39 | if ((j > 0)) | |
39 | 40 | then { | |
40 | 41 | let k = assetBalance(this, h) | |
41 | 42 | if ((1 > k)) | |
42 | 43 | then throw("No enough GovernToken In Contract") | |
43 | 44 | else ScriptResult(WriteSet([DataEntry(i, 10)]), TransferSet([ScriptTransfer(a.caller, 1, h)])) | |
44 | 45 | } | |
45 | 46 | else throw("You need to deposit Collateral Token to receive Govern Token") | |
46 | 47 | } | |
47 | 48 | ||
48 | 49 | ||
49 | 50 | ||
50 | 51 | @Callable(a) | |
51 | 52 | func Stake () = { | |
52 | 53 | let l = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' | |
53 | 54 | let h = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
54 | 55 | let m = extract(a.payment) | |
55 | 56 | if (if (isDefined(m.assetId)) | |
56 | 57 | then (extract(m.assetId) == l) | |
57 | 58 | else false) | |
58 | 59 | then { | |
59 | - | let i = ((toBase58String(a.caller.bytes) + "_") + toBase58String(l)) | |
60 | + | let n = ((toBase58String(a.caller.bytes) + "_") + toBase58String(l)) | |
61 | + | let o = ((toBase58String(a.caller.bytes) + "_") + toBase58String(h)) | |
60 | 62 | let j = { | |
61 | - | let f = getInteger(this, | |
63 | + | let f = getInteger(this, n) | |
62 | 64 | if ($isInstanceOf(f, "Int")) | |
63 | 65 | then { | |
64 | 66 | let g = f | |
65 | 67 | g | |
66 | 68 | } | |
67 | 69 | else 0 | |
68 | 70 | } | |
69 | - | let | |
70 | - | let | |
71 | - | if ((1 > | |
71 | + | let p = (j + m.amount) | |
72 | + | let q = assetBalance(this, h) | |
73 | + | if ((1 > q)) | |
72 | 74 | then throw("No enough GovernToken In Contract") | |
73 | - | else ScriptResult(WriteSet([DataEntry( | |
75 | + | else ScriptResult(WriteSet([DataEntry(o, 10), DataEntry(n, p)]), TransferSet([ScriptTransfer(a.caller, 10, h)])) | |
74 | 76 | } | |
75 | 77 | else throw("Can deposit only StakeToken") | |
76 | 78 | } | |
77 | 79 | ||
78 | 80 | ||
79 | 81 | ||
80 | 82 | @Callable(a) | |
81 | 83 | func DepositGovernToken () = { | |
82 | 84 | let h = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
83 | - | let | |
85 | + | let r = toBase58String(h) | |
84 | 86 | let m = extract(a.payment) | |
85 | 87 | if (if (isDefined(m.assetId)) | |
86 | 88 | then (extract(m.assetId) == h) | |
87 | 89 | else false) | |
88 | 90 | then { | |
89 | 91 | let i = toBase58String(a.caller.bytes) | |
90 | 92 | let j = { | |
91 | 93 | let f = getInteger(this, i) | |
92 | 94 | if ($isInstanceOf(f, "Int")) | |
93 | 95 | then { | |
94 | 96 | let g = f | |
95 | 97 | g | |
96 | 98 | } | |
97 | 99 | else 0 | |
98 | 100 | } | |
99 | - | let | |
101 | + | let s = (j + m.amount) | |
100 | 102 | let b = "GovernTokenMaxDeposit" | |
101 | 103 | let c = "MaxGovernTokenDepositerKey" | |
102 | 104 | let e = { | |
103 | 105 | let f = getInteger(this, b) | |
104 | 106 | if ($isInstanceOf(f, "Int")) | |
105 | 107 | then { | |
106 | 108 | let g = f | |
107 | 109 | g | |
108 | 110 | } | |
109 | 111 | else 0 | |
110 | 112 | } | |
111 | - | if (if (( | |
113 | + | if (if ((s > e)) | |
112 | 114 | then true | |
113 | 115 | else (e == 0)) | |
114 | - | then WriteSet([DataEntry(i, | |
115 | - | else WriteSet([DataEntry(i, | |
116 | + | then WriteSet([DataEntry(i, s), DataEntry(b, s), DataEntry(c, i)]) | |
117 | + | else WriteSet([DataEntry(i, s)]) | |
116 | 118 | } | |
117 | 119 | else throw("Can deposit only Govern Token") | |
118 | 120 | } | |
119 | 121 | ||
120 | 122 | ||
121 | 123 | ||
122 | 124 | @Callable(a) | |
123 | - | func WithdrawStakedFunds ( | |
124 | - | let | |
125 | + | func WithdrawStakedFunds (t) = { | |
126 | + | let u = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' | |
125 | 127 | let h = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
126 | 128 | let i = toBase58String(a.caller.bytes) | |
127 | 129 | let j = { | |
128 | 130 | let f = getInteger(this, i) | |
129 | 131 | if ($isInstanceOf(f, "Int")) | |
130 | 132 | then { | |
131 | 133 | let g = f | |
132 | 134 | g | |
133 | 135 | } | |
134 | 136 | else 0 | |
135 | 137 | } | |
136 | - | let | |
137 | - | if ((0 > | |
138 | + | let p = (j - t) | |
139 | + | if ((0 > t)) | |
138 | 140 | then throw("Can't withdraw negative amount") | |
139 | - | else if ((0 > | |
141 | + | else if ((0 > p)) | |
140 | 142 | then throw("User cannot withdraw more than deposited funds") | |
141 | 143 | else { | |
142 | 144 | let k = assetBalance(this, h) | |
143 | 145 | if ((1 > k)) | |
144 | 146 | then throw("No enough GovernToken In Contract") | |
145 | - | else ScriptResult(WriteSet([DataEntry(i, 1), DataEntry(i, | |
147 | + | else ScriptResult(WriteSet([DataEntry(i, 1), DataEntry(i, p)]), TransferSet([ScriptTransfer(a.caller, 1, h), ScriptTransfer(a.caller, t, u)])) | |
146 | 148 | } | |
147 | 149 | } | |
148 | 150 | ||
149 | 151 | ||
150 | 152 | ||
151 | 153 | @Callable(a) | |
152 | 154 | func ClaimPrize () = { | |
153 | - | let | |
155 | + | let l = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' | |
154 | 156 | let h = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
155 | - | let s = base58'3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD' | |
156 | - | let t = (("3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA" + "_") + toBase58String(r)) | |
157 | - | let u = Address(base58'3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA') | |
158 | - | let v = Address(base58'3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD') | |
159 | - | let w = "3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD" | |
160 | - | let x = ((toBase58String(a.caller.bytes) + "_") + toBase58String(h)) | |
161 | - | let y = ((toBase58String(a.caller.bytes) + "_") + toBase58String(r)) | |
162 | - | let z = ((toBase58String(s) + "_") + toBase58String(r)) | |
163 | - | let A = { | |
164 | - | let f = getInteger(this, x) | |
157 | + | let v = base58'3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD' | |
158 | + | let n = ((toBase58String(a.caller.bytes) + "_") + toBase58String(l)) | |
159 | + | let o = ((toBase58String(a.caller.bytes) + "_") + toBase58String(h)) | |
160 | + | let w = ((toBase58String(v) + "_") + toBase58String(l)) | |
161 | + | let x = { | |
162 | + | let f = getInteger(this, o) | |
165 | 163 | if ($isInstanceOf(f, "Int")) | |
166 | 164 | then { | |
167 | 165 | let g = f | |
168 | 166 | g | |
169 | 167 | } | |
170 | 168 | else 0 | |
171 | 169 | } | |
172 | - | let | |
173 | - | let f = getInteger(this, | |
170 | + | let y = { | |
171 | + | let f = getInteger(this, n) | |
174 | 172 | if ($isInstanceOf(f, "Int")) | |
175 | 173 | then { | |
176 | 174 | let g = f | |
177 | 175 | g | |
178 | 176 | } | |
179 | 177 | else 0 | |
180 | 178 | } | |
181 | - | let | |
182 | - | let f = getInteger(this, | |
179 | + | let z = { | |
180 | + | let f = getInteger(this, w) | |
183 | 181 | if ($isInstanceOf(f, "Int")) | |
184 | 182 | then { | |
185 | 183 | let g = f | |
186 | 184 | g | |
187 | 185 | } | |
188 | 186 | else 0 | |
189 | 187 | } | |
190 | - | if ((C == 0)) | |
188 | + | let c = "MaxGovernTokenDepositerKey" | |
189 | + | let A = getStringValue(this, c) | |
190 | + | if ((z == 0)) | |
191 | 191 | then throw("No prize to Claim") | |
192 | - | else if (( | |
192 | + | else if ((toBase58String(a.caller.bytes) != A)) | |
193 | 193 | then throw("You are not the winner hence cannot claim the reward ") | |
194 | - | else if ((1 > | |
194 | + | else if ((1 > y)) | |
195 | 195 | then throw(("You have to Stake StakedToken to claim reward | |
196 | - | Your Balance of Staked Tokens is: " + toString( | |
197 | - | else if (( | |
198 | - | then ScriptResult(WriteSet([DataEntry( | |
196 | + | Your Balance of Staked Tokens is: " + toString(y))) | |
197 | + | else if ((x > 100)) | |
198 | + | then ScriptResult(WriteSet([DataEntry(A, z), DataEntry(w, 0), DataEntry(o, 100)]), TransferSet([ScriptTransfer(a.caller, z, l), ScriptTransfer(a.caller, 100, h)])) | |
199 | 199 | else throw(("You have to deposit 100 GovernToken to claim Reward | |
200 | - | Your Balance is: " + toString( | |
200 | + | Your Balance is: " + toString(x))) | |
201 | 201 | } | |
202 | 202 | ||
203 | 203 |
github/deemru/w8io/169f3d6 81.38 ms ◑