tx · 2BV7j3oqWwSdRDLzRbgfbmiZqRCPBe6N5wZdugm9SoAN 3MrdV3AP4zfU77ifesNStoDZmL1Cfx13eDc: -0.05000000 Waves 2019.12.29 17:01 [830442] smart account 3MrdV3AP4zfU77ifesNStoDZmL1Cfx13eDc > SELF 0.00000000 Waves
{ "type": 13, "id": "2BV7j3oqWwSdRDLzRbgfbmiZqRCPBe6N5wZdugm9SoAN", "fee": 5000000, "feeAssetId": null, "timestamp": 1577627959542, "version": 1, "sender": "3MrdV3AP4zfU77ifesNStoDZmL1Cfx13eDc", "senderPublicKey": "5M79Anear5ntQk2bbDdFA2goiPXkv7Xy2UpV4n5RKRv", "proofs": [ "3rnsvooMgSuSzJwW9ZuMw4gT2NFS7oUcpjZkTsNwWF6SMp7UX3NUcB72ULWPYQtubFWEmTRBf684BbHZw2b7z5dA" ], "script": "base64:AAIDAAAAAAAAABoIARIAEgMKAQgSAwoBCBIDCgEIEgASAwoBAQAAABQAAAAADUxPQ0tFRFdCRVRLRVkCAAAAEyRXQkVUX0xPQ0tFRF9BTU9VTlQAAAAADkxPQ0tFRFJPWUFMS0VZAgAAABQkUk9ZQUxfTE9DS0VSX0FNT1VOVAAAAAAQV0FMTEVUQ09VTlRFUktFWQIAAAALJFdBTExFVF9OVU0AAAAAD0NPTU1VTklUWUZFRUtFWQIAAAAUJENPTU1VTklUWUZFRV9BTU9VTlQAAAAABFdCRVQBAAAAIIa0Nqh40w7M2PAXrUsuLAQfB5+6yrkWqUrXbyWtm9B2AAAAAAVST1lBTAEAAAAgQ+mKgsIl2XSclXwgUknGo5qQsraVX2JiXso4iYkMaRwAAAAAD0NPTU1VTklUWVdBTExFVAkBAAAAB0FkZHJlc3MAAAABAQAAABoBVC8R8HhOr9aTn6luIitmtR+yU9d4zzto+wAAAAAKV0JFVExPQ0tFRAAAAAAAAAAAAAAAAAALUk9ZQUxMT0NLRUQAAAAAAAAAAAEAAAAADFdCRVRXSVRIRFJBVwAAAAAAAAAAAgAAAAANUk9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AAECAAAANFlvdSBkbyBub3QgaGF2ZSBwZXJtaXNzaW9uIHRvIHBlcmZvcm0gdGhpcyBmdW5jdGlvbi4AAAAALvCsbA==", "chainId": 84, "height": 830442, "spentComplexity": 0 } View: original | compacted Prev: ATvFWxCGiu9qBmeVFK6Ejc4eZ5hgbGcBDzq8Yi2Kf8ZY Next: AHu7het4xbRrs4AVgTj5x1VMqnTJyRvYBvwR63vqcYLa Diff:
Old | New | Differences | |
---|---|---|---|
6 | 6 | let LOCKEDROYALKEY = "$ROYAL_LOCKER_AMOUNT" | |
7 | 7 | ||
8 | 8 | let WALLETCOUNTERKEY = "$WALLET_NUM" | |
9 | + | ||
10 | + | let COMMUNITYFEEKEY = "$COMMUNITYFEE_AMOUNT" | |
9 | 11 | ||
10 | 12 | let WBET = base58'A4q1mYKo11yuH9gmvDodeJoksagcyQzeFE9JtphMWddw' | |
11 | 13 | ||
43 | 45 | ||
44 | 46 | ||
45 | 47 | func ExtractROYALReservedAmt () = match getInteger(this, LOCKEDROYALKEY) { | |
48 | + | case a: Int => | |
49 | + | a | |
50 | + | case _ => | |
51 | + | 0 | |
52 | + | } | |
53 | + | ||
54 | + | ||
55 | + | func ExtractFEEReservedAmt () = match getInteger(this, COMMUNITYFEEKEY) { | |
46 | 56 | case a: Int => | |
47 | 57 | a | |
48 | 58 | case _ => | |
187 | 197 | else throw("You do not have permission to perform this function.") | |
188 | 198 | ||
189 | 199 | ||
200 | + | ||
201 | + | @Callable(i) | |
202 | + | func addCommunityFee () = { | |
203 | + | let payment = extract(i.payment) | |
204 | + | if ((payment.assetId != assetInfo(base58'WAVES'))) | |
205 | + | then throw("Payment should be in WAVES.") | |
206 | + | else { | |
207 | + | let newFEEReservedAmount = (ExtractFEEReservedAmt() + payment.amount) | |
208 | + | ScriptResult(WriteSet([DataEntry(COMMUNITYFEEKEY, newFEEReservedAmount)]), TransferSet(nil)) | |
209 | + | } | |
210 | + | } | |
211 | + | ||
212 | + | ||
213 | + | ||
214 | + | @Callable(i) | |
215 | + | func getCommunityFee (amount) = if ((i.caller == COMMUNITYWALLET)) | |
216 | + | then { | |
217 | + | let payment = extract(i.payment) | |
218 | + | let FEEReservedAmount = ExtractFEEReservedAmt() | |
219 | + | if ((amount > FEEReservedAmount)) | |
220 | + | then throw("You dont have enough balance to transfer the amount requested.") | |
221 | + | else { | |
222 | + | let newFEEReservedAmount = (FEEReservedAmount - amount) | |
223 | + | ScriptResult(WriteSet([DataEntry(COMMUNITYFEEKEY, newFEEReservedAmount)]), TransferSet([ScriptTransfer(COMMUNITYWALLET, amount, unit)])) | |
224 | + | } | |
225 | + | } | |
226 | + | else throw("You do not have permission to perform this function.") | |
227 | + | ||
228 | + |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let LOCKEDWBETKEY = "$WBET_LOCKED_AMOUNT" | |
5 | 5 | ||
6 | 6 | let LOCKEDROYALKEY = "$ROYAL_LOCKER_AMOUNT" | |
7 | 7 | ||
8 | 8 | let WALLETCOUNTERKEY = "$WALLET_NUM" | |
9 | + | ||
10 | + | let COMMUNITYFEEKEY = "$COMMUNITYFEE_AMOUNT" | |
9 | 11 | ||
10 | 12 | let WBET = base58'A4q1mYKo11yuH9gmvDodeJoksagcyQzeFE9JtphMWddw' | |
11 | 13 | ||
12 | 14 | let ROYAL = base58'5a6rvDEiVwvhTvTH6ce2qFwqdCt3VKaHKXEpwLXXVvyy' | |
13 | 15 | ||
14 | 16 | let COMMUNITYWALLET = Address(base58'3MtCy2PCFPyu8A9SRNL4qUo1V17SGLHftD8') | |
15 | 17 | ||
16 | 18 | let WBETLOCKED = 0 | |
17 | 19 | ||
18 | 20 | let ROYALLOCKED = 1 | |
19 | 21 | ||
20 | 22 | let WBETWITHDRAW = 2 | |
21 | 23 | ||
22 | 24 | let ROYALWITHDRAW = 3 | |
23 | 25 | ||
24 | 26 | let WAVESWITHDRAW = 4 | |
25 | 27 | ||
26 | 28 | func IncrementWalletNum () = { | |
27 | 29 | let walletNum = match getInteger(this, WALLETCOUNTERKEY) { | |
28 | 30 | case num: Int => | |
29 | 31 | num | |
30 | 32 | case _ => | |
31 | 33 | 0 | |
32 | 34 | } | |
33 | 35 | (walletNum + 1) | |
34 | 36 | } | |
35 | 37 | ||
36 | 38 | ||
37 | 39 | func ExtractWBETReservedAmt () = match getInteger(this, LOCKEDWBETKEY) { | |
38 | 40 | case a: Int => | |
39 | 41 | a | |
40 | 42 | case _ => | |
41 | 43 | 0 | |
42 | 44 | } | |
43 | 45 | ||
44 | 46 | ||
45 | 47 | func ExtractROYALReservedAmt () = match getInteger(this, LOCKEDROYALKEY) { | |
48 | + | case a: Int => | |
49 | + | a | |
50 | + | case _ => | |
51 | + | 0 | |
52 | + | } | |
53 | + | ||
54 | + | ||
55 | + | func ExtractFEEReservedAmt () = match getInteger(this, COMMUNITYFEEKEY) { | |
46 | 56 | case a: Int => | |
47 | 57 | a | |
48 | 58 | case _ => | |
49 | 59 | 0 | |
50 | 60 | } | |
51 | 61 | ||
52 | 62 | ||
53 | 63 | func ExtractPlayerAmt (wallet) = match getString(this, wallet) { | |
54 | 64 | case str: String => | |
55 | 65 | str | |
56 | 66 | case _ => | |
57 | 67 | "0_0_0_0_0" | |
58 | 68 | } | |
59 | 69 | ||
60 | 70 | ||
61 | 71 | func WalletExist (wallet) = match getString(this, wallet) { | |
62 | 72 | case str: String => | |
63 | 73 | true | |
64 | 74 | case _ => | |
65 | 75 | false | |
66 | 76 | } | |
67 | 77 | ||
68 | 78 | ||
69 | 79 | func FormatPlayerBalance (wbet,royal,wbetWithdraw,royalWithdraw,wavesWithdraw) = ((((((((toString(wbet) + "_") + toString(royal)) + "_") + toString(wbetWithdraw)) + "_") + toString(royalWithdraw)) + "_") + toString(wavesWithdraw)) | |
70 | 80 | ||
71 | 81 | ||
72 | 82 | func ParsePlayerBalance (wallet) = { | |
73 | 83 | let amounts = split(ExtractPlayerAmt(wallet), "_") | |
74 | 84 | let wbetAmount = parseIntValue(amounts[WBETLOCKED]) | |
75 | 85 | let royalAmount = parseIntValue(amounts[ROYALLOCKED]) | |
76 | 86 | let wbetWithdraw = parseIntValue(amounts[WBETWITHDRAW]) | |
77 | 87 | let royalWithdraw = parseIntValue(amounts[ROYALWITHDRAW]) | |
78 | 88 | let wavesWithdraw = parseIntValue(amounts[WAVESWITHDRAW]) | |
79 | 89 | [wbetAmount, royalAmount, wbetWithdraw, royalWithdraw, wavesWithdraw] | |
80 | 90 | } | |
81 | 91 | ||
82 | 92 | ||
83 | 93 | @Callable(i) | |
84 | 94 | func lock () = { | |
85 | 95 | let payment = extract(i.payment) | |
86 | 96 | if (if ((payment.assetId != WBET)) | |
87 | 97 | then (payment.assetId != ROYAL) | |
88 | 98 | else false) | |
89 | 99 | then throw("The token should be in WBET or ROYAL.") | |
90 | 100 | else { | |
91 | 101 | let wallet = toString(i.caller) | |
92 | 102 | let balance = ParsePlayerBalance(wallet) | |
93 | 103 | if ((payment.assetId == WBET)) | |
94 | 104 | then { | |
95 | 105 | let newWBETReservedAmount = (ExtractWBETReservedAmt() + payment.amount) | |
96 | 106 | let newPlayerWBETAmount = (balance[WBETLOCKED] + payment.amount) | |
97 | 107 | if (WalletExist(wallet)) | |
98 | 108 | then ScriptResult(WriteSet([DataEntry(LOCKEDWBETKEY, newWBETReservedAmount), DataEntry(wallet, FormatPlayerBalance(newPlayerWBETAmount, balance[ROYALLOCKED], balance[WBETWITHDRAW], balance[ROYALWITHDRAW], balance[WAVESWITHDRAW]))]), TransferSet(nil)) | |
99 | 109 | else { | |
100 | 110 | let newWalletNum = IncrementWalletNum() | |
101 | 111 | ScriptResult(WriteSet([DataEntry(WALLETCOUNTERKEY, newWalletNum), DataEntry(LOCKEDWBETKEY, newWBETReservedAmount), DataEntry(wallet, FormatPlayerBalance(newPlayerWBETAmount, balance[ROYALLOCKED], balance[WBETWITHDRAW], balance[ROYALWITHDRAW], balance[WAVESWITHDRAW]))]), TransferSet(nil)) | |
102 | 112 | } | |
103 | 113 | } | |
104 | 114 | else if ((payment.assetId == ROYAL)) | |
105 | 115 | then { | |
106 | 116 | let newROYALReservedAmount = (ExtractROYALReservedAmt() + payment.amount) | |
107 | 117 | let newPlayerRoyalAmount = (balance[ROYALLOCKED] + payment.amount) | |
108 | 118 | if (WalletExist(wallet)) | |
109 | 119 | then ScriptResult(WriteSet([DataEntry(LOCKEDROYALKEY, newROYALReservedAmount), DataEntry(wallet, FormatPlayerBalance(balance[WBETLOCKED], newPlayerRoyalAmount, balance[WBETWITHDRAW], balance[ROYALWITHDRAW], balance[WAVESWITHDRAW]))]), TransferSet(nil)) | |
110 | 120 | else { | |
111 | 121 | let newWalletNum = IncrementWalletNum() | |
112 | 122 | ScriptResult(WriteSet([DataEntry(WALLETCOUNTERKEY, newWalletNum), DataEntry(LOCKEDROYALKEY, newROYALReservedAmount), DataEntry(wallet, FormatPlayerBalance(balance[WBETLOCKED], newPlayerRoyalAmount, balance[WBETWITHDRAW], balance[ROYALWITHDRAW], balance[WAVESWITHDRAW]))]), TransferSet(nil)) | |
113 | 123 | } | |
114 | 124 | } | |
115 | 125 | else throw("error") | |
116 | 126 | } | |
117 | 127 | } | |
118 | 128 | ||
119 | 129 | ||
120 | 130 | ||
121 | 131 | @Callable(i) | |
122 | 132 | func unlock (asset) = { | |
123 | 133 | let wallet = toString(i.caller) | |
124 | 134 | let balance = ParsePlayerBalance(wallet) | |
125 | 135 | if ((asset == "WBET")) | |
126 | 136 | then if ((0 >= balance[WBETLOCKED])) | |
127 | 137 | then throw("You dont have enough balance to withdraw the amount requested.") | |
128 | 138 | else { | |
129 | 139 | let newWBETReservedAmount = (ExtractWBETReservedAmt() - balance[WBETLOCKED]) | |
130 | 140 | ScriptResult(WriteSet([DataEntry(LOCKEDWBETKEY, newWBETReservedAmount), DataEntry(wallet, FormatPlayerBalance(0, balance[ROYALLOCKED], balance[WBETWITHDRAW], balance[ROYALWITHDRAW], balance[WAVESWITHDRAW]))]), TransferSet([ScriptTransfer(i.caller, balance[WBETLOCKED], WBET)])) | |
131 | 141 | } | |
132 | 142 | else if ((asset == "ROYAL")) | |
133 | 143 | then if ((0 >= balance[ROYALLOCKED])) | |
134 | 144 | then throw("You dont have enough balance to withdraw the amount requested.") | |
135 | 145 | else { | |
136 | 146 | let newROYALReservedAmount = (ExtractROYALReservedAmt() - balance[ROYALLOCKED]) | |
137 | 147 | ScriptResult(WriteSet([DataEntry(LOCKEDROYALKEY, newROYALReservedAmount), DataEntry(wallet, FormatPlayerBalance(balance[WBETLOCKED], 0, balance[WBETWITHDRAW], balance[ROYALWITHDRAW], balance[WAVESWITHDRAW]))]), TransferSet([ScriptTransfer(i.caller, balance[ROYALLOCKED], ROYAL)])) | |
138 | 148 | } | |
139 | 149 | else throw("Invalid asset") | |
140 | 150 | } | |
141 | 151 | ||
142 | 152 | ||
143 | 153 | ||
144 | 154 | @Callable(i) | |
145 | 155 | func withdraw (asset) = { | |
146 | 156 | let wallet = toString(i.caller) | |
147 | 157 | let balance = ParsePlayerBalance(wallet) | |
148 | 158 | if ((asset == "WBET")) | |
149 | 159 | then if ((0 >= balance[WBETWITHDRAW])) | |
150 | 160 | then throw("You dont have enough balance to withdraw the amount requested.") | |
151 | 161 | else ScriptResult(WriteSet([DataEntry(wallet, FormatPlayerBalance(balance[WBETLOCKED], balance[ROYALLOCKED], 0, balance[ROYALWITHDRAW], balance[WAVESWITHDRAW]))]), TransferSet([ScriptTransfer(i.caller, balance[WBETWITHDRAW], WBET)])) | |
152 | 162 | else if ((asset == "ROYAL")) | |
153 | 163 | then if ((0 >= balance[ROYALWITHDRAW])) | |
154 | 164 | then throw("You dont have enough balance to withdraw the amount requested.") | |
155 | 165 | else ScriptResult(WriteSet([DataEntry(wallet, FormatPlayerBalance(balance[WBETLOCKED], balance[ROYALLOCKED], balance[WBETWITHDRAW], 0, balance[WAVESWITHDRAW]))]), TransferSet([ScriptTransfer(i.caller, balance[ROYALWITHDRAW], ROYAL)])) | |
156 | 166 | else if ((asset == "WAVES")) | |
157 | 167 | then if ((0 >= balance[WAVESWITHDRAW])) | |
158 | 168 | then throw("You dont have enough balance to withdraw the amount requested.") | |
159 | 169 | else ScriptResult(WriteSet([DataEntry(wallet, FormatPlayerBalance(balance[WBETLOCKED], balance[ROYALLOCKED], balance[WBETWITHDRAW], balance[WBETWITHDRAW], 0))]), TransferSet([ScriptTransfer(i.caller, balance[WAVESWITHDRAW], unit)])) | |
160 | 170 | else throw("Invalid asset") | |
161 | 171 | } | |
162 | 172 | ||
163 | 173 | ||
164 | 174 | ||
165 | 175 | @Callable(i) | |
166 | 176 | func addWithdraw (wallet) = if ((i.caller == COMMUNITYWALLET)) | |
167 | 177 | then { | |
168 | 178 | let payment = extract(i.payment) | |
169 | 179 | let balance = ParsePlayerBalance(wallet) | |
170 | 180 | if ((payment.assetId == WBET)) | |
171 | 181 | then { | |
172 | 182 | let newWbetAmount = (balance[WBETWITHDRAW] + payment.amount) | |
173 | 183 | ScriptResult(WriteSet([DataEntry(wallet, FormatPlayerBalance(balance[WBETLOCKED], balance[ROYALLOCKED], newWbetAmount, balance[ROYALWITHDRAW], balance[WAVESWITHDRAW]))]), TransferSet(nil)) | |
174 | 184 | } | |
175 | 185 | else if ((payment.assetId == ROYAL)) | |
176 | 186 | then { | |
177 | 187 | let newRoyalAmount = (balance[ROYALWITHDRAW] + payment.amount) | |
178 | 188 | ScriptResult(WriteSet([DataEntry(wallet, FormatPlayerBalance(balance[WBETLOCKED], balance[ROYALLOCKED], balance[WBETWITHDRAW], newRoyalAmount, balance[WAVESWITHDRAW]))]), TransferSet(nil)) | |
179 | 189 | } | |
180 | 190 | else if ((payment.assetId == unit)) | |
181 | 191 | then { | |
182 | 192 | let newWavesAmount = (balance[WAVESWITHDRAW] + payment.amount) | |
183 | 193 | ScriptResult(WriteSet([DataEntry(wallet, FormatPlayerBalance(balance[WBETLOCKED], balance[ROYALLOCKED], balance[WBETWITHDRAW], balance[ROYALWITHDRAW], newWavesAmount))]), TransferSet(nil)) | |
184 | 194 | } | |
185 | 195 | else throw("Invalid asset") | |
186 | 196 | } | |
187 | 197 | else throw("You do not have permission to perform this function.") | |
188 | 198 | ||
189 | 199 | ||
200 | + | ||
201 | + | @Callable(i) | |
202 | + | func addCommunityFee () = { | |
203 | + | let payment = extract(i.payment) | |
204 | + | if ((payment.assetId != assetInfo(base58'WAVES'))) | |
205 | + | then throw("Payment should be in WAVES.") | |
206 | + | else { | |
207 | + | let newFEEReservedAmount = (ExtractFEEReservedAmt() + payment.amount) | |
208 | + | ScriptResult(WriteSet([DataEntry(COMMUNITYFEEKEY, newFEEReservedAmount)]), TransferSet(nil)) | |
209 | + | } | |
210 | + | } | |
211 | + | ||
212 | + | ||
213 | + | ||
214 | + | @Callable(i) | |
215 | + | func getCommunityFee (amount) = if ((i.caller == COMMUNITYWALLET)) | |
216 | + | then { | |
217 | + | let payment = extract(i.payment) | |
218 | + | let FEEReservedAmount = ExtractFEEReservedAmt() | |
219 | + | if ((amount > FEEReservedAmount)) | |
220 | + | then throw("You dont have enough balance to transfer the amount requested.") | |
221 | + | else { | |
222 | + | let newFEEReservedAmount = (FEEReservedAmount - amount) | |
223 | + | ScriptResult(WriteSet([DataEntry(COMMUNITYFEEKEY, newFEEReservedAmount)]), TransferSet([ScriptTransfer(COMMUNITYWALLET, amount, unit)])) | |
224 | + | } | |
225 | + | } | |
226 | + | else throw("You do not have permission to perform this function.") | |
227 | + | ||
228 | + |
github/deemru/w8io/026f985 33.33 ms ◑