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