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