tx · EKDsBqJmGQrAMg47NDXwuz8b3gApJgRGGkmpJSBkCkBS 3ND7koq1CpoHCrLv833dEWPcC8ygda22q3n: -0.01400000 Waves 2021.10.28 21:37 [1766523] smart account 3ND7koq1CpoHCrLv833dEWPcC8ygda22q3n > SELF 0.00000000 Waves
{ "type": 13, "id": "EKDsBqJmGQrAMg47NDXwuz8b3gApJgRGGkmpJSBkCkBS", "fee": 1400000, "feeAssetId": null, "timestamp": 1635446260309, "version": 2, "chainId": 84, "sender": "3ND7koq1CpoHCrLv833dEWPcC8ygda22q3n", "senderPublicKey": "5jZ49iFWx2PFcwiMSEcqEgkXUebfs8Cn4P2H8nzenoPt", "proofs": [ "48aLn4gKc6bdECW9A2dui7ePAZvyapyQ73ayBgwhWfimDPZjjBy8grz9HDTUqFR7SWf3863aVw7QSyPyB5MjKDLT" ], "script": "base64:AAIEAAAAAAAAADYIAhIDCgEIEgMKAQESAwoBARIECgIIARIHCgUICAEBCBIECgIIARIECgIIARIDCgEIEgMKAQgAAAATAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAZudW1iZXIEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFAAAABm51bWJlcgAAAAAETk9ORQIAAAAEbm9uZQEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQQAAAAGc3RyaW5nBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBQAAAAROT05FBQAAAAZzdHJpbmcBAAAAD2dldEJvb2xlYW5CeUtleQAAAAEAAAADa2V5BAAAAAdib29sZWFuBAAAAAckbWF0Y2gwCQAEGwAAAAIFAAAABHRoa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Ftb3VudENoYW5nZQUAAAAOcGF5bWVudEFzc2V0SWQJAARMAAAAAgkBAAAABEJ1cm4AAAACBQAAAA5wYXltZW50QXNzZXRJZAUAAAALYXNzZXRBbW91bnQFAAAAA25pbAAAAAFpAQAAABRzZXRSZXNwb25zaWJsZVN0YXR1cwAAAAEAAAALdXNlckFkZHJlc3MEAAAADWlzUmVzcG9uc2libGUJAQAAABNnZXRSZXNwb25zaWJsZVZhbHVlAAAAAQUAAAALdXNlckFkZHJlc3MDBQAAAA1pc1Jlc3BvbnNpYmxlCQAAAgAAAAECAAAAJFVzZXIgYWxyZWFkeSBoYXZlIHJlc3BvbnNpYmxlIHN0YXR1cwkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgkBAAAAEWdldFJlc3BvbnNpYmxlS2V5AAAAAQUAAAALdXNlckFkZHJlc3MGBQAAAANuaWwAAAABaQEAAAAXcmV2b2tlUmVzcG9uc2libGVTdGF0dXMAAAABAAAAC3VzZXJBZGRyZXNzBAAAAA1pc1Jlc3BvbnNpYmxlCQEAAAATZ2V0UmVzcG9uc2libGVWYWx1ZQAAAAEFAAAAC3VzZXJBZGRyZXNzAwkBAAAAASEAAAABBQAAAA1pc1Jlc3BvbnNpYmxlCQAAAgAAAAECAAAAKlVzZXIgYWxyZWFkeSBkb24ndCBoYXZlIHJlc3BvbnNpYmxlIHN0YXR1cwkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgkBAAAAEWdldFJlc3BvbnNpYmxlS2V5AAAAAQUAAAALdXNlckFkZHJlc3MHBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleTMzju8=", "height": 1766523, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: D221jKhmsK5PXwMWdi9S9DzLVxNjwJB7AJo7VWfReqXP Next: eLACRAMPZ62dRnzrSdzF42Pp1AHbezpFzESnyVwiRdF Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getNumberByKey (key) = { | |
5 | 5 | let number = match getInteger(this, key) { | |
6 | 6 | case a: Int => | |
7 | 7 | a | |
8 | 8 | case _ => | |
9 | 9 | 0 | |
10 | 10 | } | |
11 | 11 | number | |
12 | 12 | } | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | let NONE = "none" | |
16 | 16 | ||
17 | 17 | func getStringByKey (key) = { | |
18 | 18 | let string = match getString(this, key) { | |
19 | 19 | case a: String => | |
20 | 20 | a | |
21 | 21 | case _ => | |
22 | 22 | NONE | |
23 | 23 | } | |
24 | 24 | string | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func getBooleanByKey (key) = { | |
29 | 29 | let boolean = match getBoolean(this, key) { | |
30 | 30 | case a: Boolean => | |
31 | 31 | a | |
32 | 32 | case _ => | |
33 | 33 | false | |
34 | 34 | } | |
35 | 35 | boolean | |
36 | 36 | } | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func addressToString (address) = toBase58String(address.bytes) | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func stringToAddress (string) = Address(fromBase58String(string)) | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func byteVectorToString (byteVector) = toBase58String(byteVector) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func stringToByteVector (string) = fromBase58String(string) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func isAdmin (caller) = (this == caller) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func getUserEmailKey (userAddress) = (("user_<" + userAddress) + ">_email") | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func getUserEmailValue (userAddress) = getStringByKey(getUserEmailKey(userAddress)) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func getNyanTokenKey (dAppAddress) = (("dApp_<" + addressToString(dAppAddress)) + ">_tokenId") | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func getNyanTokenValue (dAppAddress) = getStringByKey(getNyanTokenKey(dAppAddress)) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func getAssetPriceKey (assetId) = (("asset_<" + assetId) + ">_price") | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func getAssetPriceValue (assetId) = getNumberByKey(getAssetPriceKey(assetId)) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func getAssetDataKey (assetId) = (("asset_<" + assetId) + ">_data") | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func getAssetDataValue (assetId) = getStringByKey(getAssetPriceKey(assetId)) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func getResponsibleKey (userAddress) = (("dApp_<" + userAddress) + ">_responsible") | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func getResponsibleValue (userAddress) = getBooleanByKey(getResponsibleKey(userAddress)) | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | @Callable(i) | |
85 | 85 | func signUp (email) = { | |
86 | 86 | let userAddress = addressToString(i.caller) | |
87 | 87 | let userEmail = getUserEmailValue(userAddress) | |
88 | 88 | if ((userEmail != NONE)) | |
89 | 89 | then throw((("User " + userEmail) + " is already registered")) | |
90 | 90 | else [StringEntry(getUserEmailKey(userAddress), email)] | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | ||
95 | 95 | @Callable(i) | |
96 | 96 | func issueNyanToken (quantity) = { | |
97 | 97 | let nyanToken = getNyanTokenValue(this) | |
98 | 98 | if (!(isAdmin(i.caller))) | |
99 | 99 | then throw("Function invoke not allowed, requested from non-admin address") | |
100 | 100 | else if ((nyanToken != NONE)) | |
101 | 101 | then throw("NYAN Token is already issued") | |
102 | 102 | else { | |
103 | 103 | let nyanTokenIssue = Issue("NYAN Token", "NYAN Token is a cryptocurrency token that operates on the Waves platform", quantity, 0, true) | |
104 | 104 | let nyanTokenAssetId = calculateAssetId(nyanTokenIssue) | |
105 | 105 | [nyanTokenIssue, StringEntry(getNyanTokenKey(this), byteVectorToString(nyanTokenAssetId))] | |
106 | 106 | } | |
107 | 107 | } | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | ||
111 | 111 | @Callable(i) | |
112 | 112 | func reissueNyanToken (quantity) = { | |
113 | 113 | let nyanToken = getNyanTokenValue(this) | |
114 | 114 | if (!(isAdmin(i.caller))) | |
115 | 115 | then throw("Function invoke not allowed, requested from non-admin address") | |
116 | 116 | else if ((nyanToken == NONE)) | |
117 | 117 | then throw("NYAN Token was not issued") | |
118 | 118 | else [Reissue(stringToByteVector(nyanToken), quantity, true)] | |
119 | 119 | } | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | ||
123 | 123 | @Callable(i) | |
124 | 124 | func transferNyanToken (recipient,amount) = { | |
125 | 125 | let userEmail = getUserEmailValue(recipient) | |
126 | 126 | let nyanTokenAssetId = stringToByteVector(getNyanTokenValue(this)) | |
127 | 127 | let currentDAppBalance = assetBalance(this, nyanTokenAssetId) | |
128 | 128 | let newDAppBalance = (currentDAppBalance - amount) | |
129 | 129 | if (!(isAdmin(i.caller))) | |
130 | 130 | then throw("Function invoke not allowed, requested from non-admin address") | |
131 | 131 | else if ((userEmail == NONE)) | |
132 | 132 | then throw("You cannot transfer NYAN Token to an unregistered user") | |
133 | 133 | else if ((0 > amount)) | |
134 | 134 | then throw("You cannot transfer a negative amount") | |
135 | 135 | else if ((0 > newDAppBalance)) | |
136 | 136 | then throw("Not enough NYAN Token to transfer") | |
137 | 137 | else [ScriptTransfer(stringToAddress(recipient), amount, nyanTokenAssetId)] | |
138 | 138 | } | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | ||
142 | 142 | @Callable(i) | |
143 | 143 | func issueAssetToken (name,description,quantity,price,data) = { | |
144 | 144 | let assetTokenIssue = Issue(name, description, quantity, 0, true) | |
145 | 145 | let assetTokenAssetId = calculateAssetId(assetTokenIssue) | |
146 | 146 | let assetToken = byteVectorToString(assetTokenAssetId) | |
147 | 147 | if (!(isAdmin(i.caller))) | |
148 | 148 | then throw("Function invoke not allowed, requested from non-admin address") | |
149 | 149 | else if ((quantity == 0)) | |
150 | 150 | then [assetTokenIssue, IntegerEntry(getAssetPriceKey(assetToken), price), StringEntry(getAssetDataKey(assetToken), data)] | |
151 | 151 | else { | |
152 | 152 | let nyanTokenAssetId = stringToByteVector(getNyanTokenValue(this)) | |
153 | 153 | let currentDAppBalance = assetBalance(this, nyanTokenAssetId) | |
154 | 154 | let amount = (quantity * price) | |
155 | 155 | let newDAppBalance = (currentDAppBalance - amount) | |
156 | 156 | if ((0 > newDAppBalance)) | |
157 | 157 | then throw("Not enough NYAN Token to issue an asset") | |
158 | 158 | else [assetTokenIssue, Burn(nyanTokenAssetId, amount), IntegerEntry(getAssetPriceKey(assetToken), price), StringEntry(getAssetDataKey(assetToken), data)] | |
159 | 159 | } | |
160 | 160 | } | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | ||
164 | 164 | @Callable(i) | |
165 | 165 | func reissueAssetToken (assetId,quantity) = { | |
166 | 166 | let nyanTokenAssetId = stringToByteVector(getNyanTokenValue(this)) | |
167 | 167 | let currentDAppBalance = assetBalance(this, nyanTokenAssetId) | |
168 | 168 | let price = getAssetPriceValue(assetId) | |
169 | 169 | let amount = (quantity * price) | |
170 | 170 | let newDAppBalance = (currentDAppBalance - amount) | |
171 | 171 | if (!(isAdmin(i.caller))) | |
172 | 172 | then throw("Function invoke not allowed, requested from non-admin address") | |
173 | 173 | else if ((0 > newDAppBalance)) | |
174 | 174 | then throw("Not enough NYAN Token to reissue an asset") | |
175 | 175 | else [Reissue(stringToByteVector(assetId), quantity, true), Burn(nyanTokenAssetId, amount)] | |
176 | 176 | } | |
177 | 177 | ||
178 | 178 | ||
179 | 179 | ||
180 | 180 | @Callable(i) | |
181 | 181 | func exchangeAssetToken (assetId,amount) = { | |
182 | 182 | let payments = i.payments | |
183 | 183 | if ((size(payments) == 0)) | |
184 | 184 | then throw("You need to attach the payment") | |
185 | 185 | else { | |
186 | 186 | let paymentAmount = payments[0].amount | |
187 | 187 | let paymentAssetId = value(payments[0].assetId) | |
188 | 188 | let assetPrice = getAssetPriceValue(assetId) | |
189 | 189 | let assetAmount = (amount * assetPrice) | |
190 | 190 | let userAddress = i.caller | |
191 | 191 | let assetTokenAssetId = stringToByteVector(assetId) | |
192 | 192 | if ((assetAmount > paymentAmount)) | |
193 | 193 | then throw("Not enough NYAN Token to exchange an asset") | |
194 | 194 | else if ((paymentAmount == assetAmount)) | |
195 | 195 | then [ScriptTransfer(userAddress, amount, assetTokenAssetId), Burn(paymentAssetId, paymentAmount)] | |
196 | 196 | else { | |
197 | 197 | let paymentAmountChange = (paymentAmount - assetAmount) | |
198 | 198 | [ScriptTransfer(userAddress, amount, assetTokenAssetId), ScriptTransfer(userAddress, paymentAmountChange, paymentAssetId), Burn(paymentAssetId, assetAmount)] | |
199 | 199 | } | |
200 | 200 | } | |
201 | 201 | } | |
202 | 202 | ||
203 | 203 | ||
204 | 204 | ||
205 | 205 | @Callable(i) | |
206 | 206 | func setResponsibleStatus (userAddress) = { | |
207 | 207 | let isResponsible = getResponsibleValue(userAddress) | |
208 | 208 | if (isResponsible) | |
209 | 209 | then throw("User already have responsible status") | |
210 | 210 | else [BooleanEntry(getResponsibleKey(userAddress), true)] | |
211 | 211 | } | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | ||
215 | 215 | @Callable(i) | |
216 | 216 | func revokeResponsibleStatus (userAddress) = { | |
217 | 217 | let isResponsible = getResponsibleValue(userAddress) | |
218 | 218 | if (!(isResponsible)) | |
219 | 219 | then throw("User already don't have responsible status") | |
220 | 220 | else [BooleanEntry(getResponsibleKey(userAddress), false)] | |
221 | 221 | } | |
222 | 222 | ||
223 | 223 | ||
224 | 224 | @Verifier(tx) | |
225 | 225 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
226 | 226 |
github/deemru/w8io/169f3d6 42.68 ms ◑