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