tx · 9QB7w3GT1pv6BkczSXE4kYkP89G5nQtYn9KrxAqL6fa9 3MsNfeY3eRCNZXXyoFwekaSqsaTdrXKLqfF: -0.01990000 Waves 2020.10.20 21:39 [1229255] smart account 3MsNfeY3eRCNZXXyoFwekaSqsaTdrXKLqfF > SELF 0.00000000 Waves
{ "type": 13, "id": "9QB7w3GT1pv6BkczSXE4kYkP89G5nQtYn9KrxAqL6fa9", "fee": 1990000, "feeAssetId": null, "timestamp": 1603219228686, "version": 2, "chainId": 84, "sender": "3MsNfeY3eRCNZXXyoFwekaSqsaTdrXKLqfF", "senderPublicKey": "9HTwTKruTGvJ6qj6TnQU71EtPTv5eQNsXyuFgW1x3JvZ", "proofs": [ "4htgiFR8NE4CwVimkuS3LYuresxSr69vGGT8h7bWnjrFjoMZDkrSfYuFMCnbfruLMzThRyFSKis2vzEhT8d7mYxt" ], "script": "base64:AAIDAAAAAAAAABEIARIAEgASABIAEgMKAQESAAAAAAAAAAAGAAAAAWkBAAAAFFJlYWRNYXhHb3Zlcm5EZXBvc2l0AAAAAAQAAAAOR292ZXJuVG9rZW5LZXkCAAAAFUdvdmVyblRva2VuTWF4RGVwb3NpdAQAAAAaTWF4R292ZXJuVG9rZW5EZXBvc2l0ZXJLZXkCAAAAGk1heEdvdmVyblRva2VuRGVwb3NpdGVyS2V5BAAAAAtTdGFrZWRUb2tlbgEAAAAgRcBshwjyRR7E4jbQIGP2jvCbtpj52Gvg2osXltv2/UMEAAAAC0dvdmVyblRva2VuAQAAACC8BnLNTH75zY/85pKTg3cOi9DRRgrZqRPS5vvLPGg8zQQAAAASVXNlclN0YWtlZFRva2VuS2V5CQABLAAAAAIJAAEsAAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAgAAAAFfCQACWAAAAAEFAAAAC1N0YWtlZFRva2VuBAAAABJVc2VyR292ZXJuVG9rZW5LZXkJAAEsAAAAAgkAASwAAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxs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IGRlcG9zaXQgMTAwIEdvdmVyblRva2VuIHRvIGNsYWltIFJld2FyZCAKIFlvdXIgQmFsYW5jZSBpczogCQABpAAAAAEFAAAAFVVzZXJHb3Zlcm5Ub2tlbkFtb3VudAAAAABEDlvN", "height": 1229255, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9mXwazf9yVNDNg9zefCde6pDhYr8gu2QDqxoZCQgfogz Next: GCnWyFchEpMBbQQPPoA2XqzL4QFNSPp5svpuV4GJtyjD Diff:
Old | New | Differences | |
---|---|---|---|
13 | 13 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
14 | 14 | let Winner = getStringValue(this, MaxGovernTokenDepositerKey) | |
15 | 15 | let MaxGovernTokenDeposit = match getInteger(this, GovernTokenKey) { | |
16 | - | case a: Int => | |
17 | - | a | |
18 | - | case _ => | |
19 | - | 0 | |
20 | - | } | |
21 | - | let ReadUserGovernTokenKey = getStringValue(this, UserGovernTokenKey) | |
22 | - | let UserGovernTokenBalance = match getInteger(this, ReadUserGovernTokenKey) { | |
23 | 16 | case a: Int => | |
24 | 17 | a | |
25 | 18 | case _ => |
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(i) | |
7 | 7 | func ReadMaxGovernDeposit () = { | |
8 | 8 | let GovernTokenKey = "GovernTokenMaxDeposit" | |
9 | 9 | let MaxGovernTokenDepositerKey = "MaxGovernTokenDepositerKey" | |
10 | 10 | let StakedToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' | |
11 | 11 | let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
12 | 12 | let UserStakedTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(StakedToken)) | |
13 | 13 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
14 | 14 | let Winner = getStringValue(this, MaxGovernTokenDepositerKey) | |
15 | 15 | let MaxGovernTokenDeposit = match getInteger(this, GovernTokenKey) { | |
16 | - | case a: Int => | |
17 | - | a | |
18 | - | case _ => | |
19 | - | 0 | |
20 | - | } | |
21 | - | let ReadUserGovernTokenKey = getStringValue(this, UserGovernTokenKey) | |
22 | - | let UserGovernTokenBalance = match getInteger(this, ReadUserGovernTokenKey) { | |
23 | 16 | case a: Int => | |
24 | 17 | a | |
25 | 18 | case _ => | |
26 | 19 | 0 | |
27 | 20 | } | |
28 | 21 | throw(((("Winner is.....: " + Winner) + " | |
29 | 22 | Total GovernToken: ") + toString(MaxGovernTokenDeposit))) | |
30 | 23 | } | |
31 | 24 | ||
32 | 25 | ||
33 | 26 | ||
34 | 27 | @Callable(i) | |
35 | 28 | func payYield () = { | |
36 | 29 | let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
37 | 30 | let currentKey = toBase58String(i.caller.bytes) | |
38 | 31 | let currentAmount = match getInteger(this, currentKey) { | |
39 | 32 | case a: Int => | |
40 | 33 | a | |
41 | 34 | case _ => | |
42 | 35 | 0 | |
43 | 36 | } | |
44 | 37 | if ((currentAmount > 0)) | |
45 | 38 | then { | |
46 | 39 | let GovernTokenAmount = assetBalance(this, GovernToken) | |
47 | 40 | if ((1 > GovernTokenAmount)) | |
48 | 41 | then throw("No enough GovernToken In Contract") | |
49 | 42 | else ScriptResult(WriteSet([DataEntry(currentKey, 10)]), TransferSet([ScriptTransfer(i.caller, 1, GovernToken)])) | |
50 | 43 | } | |
51 | 44 | else throw("You need to deposit Collateral Token to receive Govern Token") | |
52 | 45 | } | |
53 | 46 | ||
54 | 47 | ||
55 | 48 | ||
56 | 49 | @Callable(i) | |
57 | 50 | func Stake () = { | |
58 | 51 | let StakedToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' | |
59 | 52 | let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
60 | 53 | let pmt = extract(i.payment) | |
61 | 54 | if (if (isDefined(pmt.assetId)) | |
62 | 55 | then (extract(pmt.assetId) == StakedToken) | |
63 | 56 | else false) | |
64 | 57 | then { | |
65 | 58 | let UserStakedTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(StakedToken)) | |
66 | 59 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
67 | 60 | let currentAmount = match getInteger(this, UserStakedTokenKey) { | |
68 | 61 | case a: Int => | |
69 | 62 | a | |
70 | 63 | case _ => | |
71 | 64 | 0 | |
72 | 65 | } | |
73 | 66 | let newAmount = (currentAmount + pmt.amount) | |
74 | 67 | let GovernTokenSmartContractBalance = assetBalance(this, GovernToken) | |
75 | 68 | if ((1 > GovernTokenSmartContractBalance)) | |
76 | 69 | then throw("No enough GovernToken In Contract") | |
77 | 70 | else ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, 10), DataEntry(UserStakedTokenKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, 10, GovernToken)])) | |
78 | 71 | } | |
79 | 72 | else throw("Can deposit only StakeToken") | |
80 | 73 | } | |
81 | 74 | ||
82 | 75 | ||
83 | 76 | ||
84 | 77 | @Callable(i) | |
85 | 78 | func DepositGovernToken () = { | |
86 | 79 | let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
87 | 80 | let GovernTokenMaxDeposit = toBase58String(GovernToken) | |
88 | 81 | let pmt = extract(i.payment) | |
89 | 82 | if (if (isDefined(pmt.assetId)) | |
90 | 83 | then (extract(pmt.assetId) == GovernToken) | |
91 | 84 | else false) | |
92 | 85 | then { | |
93 | 86 | let currentKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
94 | 87 | let currentAmount = match getInteger(this, currentKey) { | |
95 | 88 | case a: Int => | |
96 | 89 | a | |
97 | 90 | case _ => | |
98 | 91 | 0 | |
99 | 92 | } | |
100 | 93 | let CurrrentGovernTokenDeposit = (currentAmount + pmt.amount) | |
101 | 94 | let GovernTokenKey = "GovernTokenMaxDeposit" | |
102 | 95 | let MaxGovernTokenDepositerKey = "MaxGovernTokenDepositerKey" | |
103 | 96 | let MaxGovernTokenDeposit = match getInteger(this, GovernTokenKey) { | |
104 | 97 | case a: Int => | |
105 | 98 | a | |
106 | 99 | case _ => | |
107 | 100 | 0 | |
108 | 101 | } | |
109 | 102 | if (if ((CurrrentGovernTokenDeposit > MaxGovernTokenDeposit)) | |
110 | 103 | then true | |
111 | 104 | else (MaxGovernTokenDeposit == 0)) | |
112 | 105 | then WriteSet([DataEntry(currentKey, CurrrentGovernTokenDeposit), DataEntry(GovernTokenKey, CurrrentGovernTokenDeposit), DataEntry(MaxGovernTokenDepositerKey, currentKey)]) | |
113 | 106 | else WriteSet([DataEntry(currentKey, CurrrentGovernTokenDeposit)]) | |
114 | 107 | } | |
115 | 108 | else throw("Can deposit only Govern Token") | |
116 | 109 | } | |
117 | 110 | ||
118 | 111 | ||
119 | 112 | ||
120 | 113 | @Callable(i) | |
121 | 114 | func WithdrawStakedFunds (amount) = { | |
122 | 115 | let CollateralToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' | |
123 | 116 | let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
124 | 117 | let currentKey = toBase58String(i.caller.bytes) | |
125 | 118 | let currentAmount = match getInteger(this, currentKey) { | |
126 | 119 | case a: Int => | |
127 | 120 | a | |
128 | 121 | case _ => | |
129 | 122 | 0 | |
130 | 123 | } | |
131 | 124 | let newAmount = (currentAmount - amount) | |
132 | 125 | if ((0 > amount)) | |
133 | 126 | then throw("Can't withdraw negative amount") | |
134 | 127 | else if ((0 > newAmount)) | |
135 | 128 | then throw("User cannot withdraw more than deposited funds") | |
136 | 129 | else { | |
137 | 130 | let GovernTokenAmount = assetBalance(this, GovernToken) | |
138 | 131 | if ((1 > GovernTokenAmount)) | |
139 | 132 | then throw("No enough GovernToken In Contract") | |
140 | 133 | else ScriptResult(WriteSet([DataEntry(currentKey, 1), DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, 1, GovernToken), ScriptTransfer(i.caller, amount, CollateralToken)])) | |
141 | 134 | } | |
142 | 135 | } | |
143 | 136 | ||
144 | 137 | ||
145 | 138 | ||
146 | 139 | @Callable(i) | |
147 | 140 | func ClaimPrize () = { | |
148 | 141 | let StakedToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' | |
149 | 142 | let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
150 | 143 | let FundBoxAddress58 = base58'3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD' | |
151 | 144 | let UserStakedTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(StakedToken)) | |
152 | 145 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
153 | 146 | let FundBoxStakedToken = ((toBase58String(FundBoxAddress58) + "_") + toBase58String(StakedToken)) | |
154 | 147 | let UserGovernTokenAmount = match getInteger(this, UserGovernTokenKey) { | |
155 | 148 | case a: Int => | |
156 | 149 | a | |
157 | 150 | case _ => | |
158 | 151 | 0 | |
159 | 152 | } | |
160 | 153 | let UserStakedTokenAmount = match getInteger(this, UserStakedTokenKey) { | |
161 | 154 | case a: Int => | |
162 | 155 | a | |
163 | 156 | case _ => | |
164 | 157 | 0 | |
165 | 158 | } | |
166 | 159 | let PrizeAmount = match getInteger(this, FundBoxStakedToken) { | |
167 | 160 | case a: Int => | |
168 | 161 | a | |
169 | 162 | case _ => | |
170 | 163 | 0 | |
171 | 164 | } | |
172 | 165 | let MaxGovernTokenDepositerKey = "MaxGovernTokenDepositerKey" | |
173 | 166 | let PrizeWinner = getStringValue(this, MaxGovernTokenDepositerKey) | |
174 | 167 | if ((PrizeAmount == 0)) | |
175 | 168 | then throw("No prize to Claim") | |
176 | 169 | else if ((UserGovernTokenKey != PrizeWinner)) | |
177 | 170 | then throw("You are not the winner hence cannot claim the reward ") | |
178 | 171 | else if ((1 > UserStakedTokenAmount)) | |
179 | 172 | then throw(("You have to Stake StakedToken to claim reward | |
180 | 173 | Your Balance of Staked Tokens is: " + toString(UserStakedTokenAmount))) | |
181 | 174 | else if ((UserGovernTokenAmount > 100)) | |
182 | 175 | then ScriptResult(WriteSet([DataEntry(PrizeWinner, PrizeAmount), DataEntry(FundBoxStakedToken, 0), DataEntry(UserGovernTokenKey, 0)]), TransferSet([ScriptTransfer(i.caller, PrizeAmount, StakedToken), ScriptTransfer(i.caller, 100, GovernToken)])) | |
183 | 176 | else throw(("You have to deposit 100 GovernToken to claim Reward | |
184 | 177 | Your Balance is: " + toString(UserGovernTokenAmount))) | |
185 | 178 | } | |
186 | 179 | ||
187 | 180 |
github/deemru/w8io/026f985 31.24 ms ◑