tx · 2YgyqVaqXcwpT21e5y4gP3gJyGUqm2MA8Xg6B8eN2niw

3NA73oUXjqp7SpudXWV1yMFuKm9awPbqsVz:  -0.01200000 Waves

2022.10.27 16:56 [2290920] smart account 3NA73oUXjqp7SpudXWV1yMFuKm9awPbqsVz > SELF 0.00000000 Waves

{ "type": 13, "id": "2YgyqVaqXcwpT21e5y4gP3gJyGUqm2MA8Xg6B8eN2niw", "fee": 1200000, "feeAssetId": null, "timestamp": 1666878992656, "version": 2, "chainId": 84, "sender": "3NA73oUXjqp7SpudXWV1yMFuKm9awPbqsVz", "senderPublicKey": "2mHW72YTfnxJ1M8WsdUQjgpp3a2SUbt9mbAiePGiuJok", "proofs": [ "3bnuPgSRQKJm8Csp9u82zP2NX1Nv5MLBS1u2p2ceb4CiMPghQTsaVbcFhZGhiZG8R5LgFBrns9bxCdARSuRRfegM" ], "script": "base64:AAIFAAAAAAAAAEAIAhIDCgEBEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgUKAwgIARIDCgEIAAAAKAEAAAAQZ2V0U3RyaW5nT3JUaHJvdwAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAdhZGRyZXNzBQAAAANrZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAADENhbid0IHJlYWQgJwUAAAADa2V5AgAAAA0nIGF0IGFkZHJlc3MgCQAEJQAAAAEFAAAAB2FkZHJlc3MBAAAAEWdldEludGVnZXJPclRocm93AAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEGgAAAAIFAAAAB2FkZHJlc3MFAAAAA2tleQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAMQ2FuJ3QgcmVhZCAnBQAAAANrZXkCAAAADScgYXQgYWRkcmVzcyAJAAQlAAAAAQUAA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G9rZW4AAAACBQAAAARuYW1lBQAAAAtuZXdUb2tlblN0cgQAAAAXdHJhbnNmZXJOZXdUb2tlblRvT3duZXIJAQAAABVfdHJhbnNmZXJUb2tlblRvT3duZXIAAAACBQAAAAtuZXdUb2tlblN0cgUAAAAPbmV3T3duZXJBZGRyZXNzCQAETgAAAAIJAAROAAAAAgUAAAANaXNzdWVOZXdUb2tlbgUAAAAXcmVzdG9yZU5hbWVXaXRoTmV3VG9rZW4FAAAAF3RyYW5zZmVyTmV3VG9rZW5Ub093bmVyAwMFAAAADGlzVG9rZW5Pd25lcgUAAAAIaGFzVG9rZW4HCQAAAgAAAAECAAAAHFlvdSBhbHJlYWR5IG93biBhIG5hbWUgdG9rZW4DCQEAAAABIQAAAAEFAAAACGhhc1Rva2VuCQAAAgAAAAECAAAAG1lvdSBkb24ndCBoYXZlIGEgbmFtZSB0b2tlbgkBAAAACV9zZXRPd25lcgAAAAIFAAAABG5hbWUFAAAAD25ld093bmVyQWRkcmVzcwAAAAChR4yM", "height": 2290920, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JP6PHWTN4K5eXXfDBHT31Dx8GxBdqAY1BoeBoLUd9CW Next: 45RpUf1vCSNTpZvjdJzy3o3mS8KCJtDFbTF9xzx6PNjk Diff:
OldNewDifferences
3939
4040
4141 func _getOwner (name) = getString(this, key_Name_owner(name))
42-
43-
44-func _setResolver (name,resolver) = [StringEntry(key_Name_resolver(name), resolver)]
4542
4643
4744 func _getResolver (name) = getString(this, key_Name_resolver(name))
194191
195192
196193 @Callable(inv)
197-func supportsInterface (interfaceId) = $Tuple2(nil, containsElement(["owner", "resolver", "nameCreated", "nameExpires"], interfaceId))
194+func supportsInterface (interfaceId) = $Tuple2(nil, containsElement(["getOwner", "getResolver", "getNameCreated", "getNameExpires"], interfaceId))
198195
199196
200197
218215
219216
220217 @Callable(inv)
221-func validate (name) = $Tuple2(nil, isValidName(name))
218+func isValid (name) = $Tuple2(nil, isValidName(name))
222219
223220
224221
225222 @Callable(inv)
226-func available (name) = $Tuple2(nil, isAvailableName(name))
223+func isAvailable (name) = $Tuple2(nil, isAvailableName(name))
227224
228225
229226
230227 @Callable(inv)
231-func owner (name) = $Tuple2(nil, _getOwner(_splitLastLabel(name)._1))
228+func getOwner (name) = $Tuple2(nil, _getOwner(_splitLastLabel(name)._1))
232229
233230
234231
235232 @Callable(inv)
236-func resolver (name) = $Tuple2(nil, _getResolver(_splitLastLabel(name)._1))
233+func getResolver (name) = $Tuple2(nil, _getResolver(_splitLastLabel(name)._1))
237234
238235
239236
240237 @Callable(inv)
241-func setResolver (name,resolver) = valueOrElse(modifiers([if (isActiveName(name))
242- then unit
243- else throw("Name expired or not registered"), onlyOwner(inv, name), if (isValidAddress(resolver))
244- then unit
245- else throw("Resolver must be a valid contract address")]), $Tuple2(nil, _setResolver(name, resolver)))
238+func getNameCreated (name) = $Tuple2(nil, _getCreatedAt(_splitLastLabel(name)._1))
246239
247240
248241
249242 @Callable(inv)
250-func nameCreated (name) = $Tuple2(nil, _getCreatedAt(_splitLastLabel(name)._1))
251-
252-
253-
254-@Callable(inv)
255-func nameExpires (name) = $Tuple2(nil, _getExpiresAt(_splitLastLabel(name)._1))
243+func getNameExpires (name) = $Tuple2(nil, _getExpiresAt(_splitLastLabel(name)._1))
256244
257245
258246
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getStringOrThrow (address,key) = valueOrErrorMessage(getString(address, key), ((("Can't read '" + key) + "' at address ") + toString(address)))
55
66
77 func getIntegerOrThrow (address,key) = valueOrErrorMessage(getInteger(address, key), ((("Can't read '" + key) + "' at address ") + toString(address)))
88
99
1010 func parseAddressOrThrow (maybeAddress) = valueOrErrorMessage(addressFromString(maybeAddress), (("Can't parse address from '" + maybeAddress) + "'"))
1111
1212
1313 func key_entity (name,pk,property) = ((((name + "_") + pk) + "_") + property)
1414
1515
1616 func key_Token_name (tokenId) = key_entity("Token", tokenId, "name")
1717
1818
1919 func key_Name_token (name) = key_entity("Name", name, "token")
2020
2121
2222 func key_Name_owner (name) = key_entity("Name", name, "owner")
2323
2424
2525 func key_Name_resolver (name) = key_entity("Name", name, "resolver")
2626
2727
2828 func key_Name_expiresAt (name) = key_entity("Name", name, "expiresAt")
2929
3030
3131 func key_Name_createdAt (name) = key_entity("Name", name, "createdAt")
3232
3333
3434 let key_nameTTL = "nameTTL"
3535
3636 let key_controllers = "controllers"
3737
3838 func _setOwner (name,owner) = [StringEntry(key_Name_owner(name), owner)]
3939
4040
4141 func _getOwner (name) = getString(this, key_Name_owner(name))
42-
43-
44-func _setResolver (name,resolver) = [StringEntry(key_Name_resolver(name), resolver)]
4542
4643
4744 func _getResolver (name) = getString(this, key_Name_resolver(name))
4845
4946
5047 func _getToken (name) = getString(this, key_Name_token(name))
5148
5249
5350 func _getCreatedAt (name) = getInteger(this, key_Name_createdAt(name))
5451
5552
5653 func _getExpiresAt (name) = getInteger(this, key_Name_expiresAt(name))
5754
5855
5956 func _getControllers () = getString(this, key_controllers)
6057
6158
6259 let controllers = match _getControllers() {
6360 case repr: String =>
6461 split(repr, ",")
6562 case _ =>
6663 nil
6764 }
6865
6966 let nameTTL = getIntegerOrThrow(this, key_nameTTL)
7067
7168 func isRegisteredName (name) = isDefined(getString(this, key_Name_token(name)))
7269
7370
7471 func isCreatedName (name) = isDefined(_getCreatedAt(name))
7572
7673
7774 func isExpiredName (name) = match _getExpiresAt(name) {
7875 case expiresAt: Int =>
7976 (lastBlock.timestamp > expiresAt)
8077 case _ =>
8178 false
8279 }
8380
8481
8582 func isActiveName (name) = if (if (isRegisteredName(name))
8683 then isCreatedName(name)
8784 else false)
8885 then !(isExpiredName(name))
8986 else false
9087
9188
9289 func isValidName (name) = {
9390 let symbols = "abcdefghijklmnopqrstuvwxyz1234567890-"
9491 func validateChars (isValid,char) = if (isValid)
9592 then contains(symbols, char)
9693 else false
9794
9895 if (if (if (if (if ((size(name) > 0))
9996 then (63 >= size(name))
10097 else false)
10198 then (indexOf(name, "--") != 2)
10299 else false)
103100 then (indexOf(name, "-") != 0)
104101 else false)
105102 then (lastIndexOf(name, "-") != (size(name) - 1))
106103 else false)
107104 then {
108105 let $l = split(name, "")
109106 let $s = size($l)
110107 let $acc0 = true
111108 func $f0_1 ($a,$i) = if (($i >= $s))
112109 then $a
113110 else validateChars($a, $l[$i])
114111
115112 func $f0_2 ($a,$i) = if (($i >= $s))
116113 then $a
117114 else throw("List size exceeds 63")
118115
119116 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63)
120117 }
121118 else false
122119 }
123120
124121
125122 func isAvailableName (name) = if (isValidName(name))
126123 then if (!(isRegisteredName(name)))
127124 then true
128125 else isExpiredName(name)
129126 else false
130127
131128
132129 func isValidAddress (maybeAddress) = isDefined(addressFromString(maybeAddress))
133130
134131
135132 func isAdmin (inv) = (inv.caller == this)
136133
137134
138135 func isOwner (inv,name) = (toString(inv.originCaller) == valueOrElse(_getOwner(name), ""))
139136
140137
141138 func isController (address) = containsElement(controllers, address)
142139
143140
144141 func _splitLastLabel (name) = {
145142 let labels = split(name, ".")
146143 let lastIndex = (size(labels) - 1)
147144 let lastLabel = labels[lastIndex]
148145 let restLabels = makeString(removeByIndex(labels, lastIndex), ".")
149146 $Tuple2(lastLabel, restLabels)
150147 }
151148
152149
153150 func _issueNameToken (name) = [Issue(if ((size(name) > 16))
154151 then (take(name, 15) + "~")
155152 else take(name, 16), (name + ".waves"), 1, 0, false)]
156153
157154
158155 func _registerNameWithToken (name,tokenId,createdAt) = [StringEntry(key_Name_token(name), tokenId), StringEntry(key_Token_name(tokenId), name), IntegerEntry(key_Name_createdAt(name), createdAt), IntegerEntry(key_Name_expiresAt(name), (createdAt + nameTTL))]
159156
160157
161158 func _restoreNameWithToken (name,tokenId) = [StringEntry(key_Name_token(name), tokenId), StringEntry(key_Token_name(tokenId), name)]
162159
163160
164161 func _transferTokenToOwner (tokenId,owner) = [ScriptTransfer(parseAddressOrThrow(owner), 1, fromBase58String(tokenId))]
165162
166163
167164 func modifiers (validations) = unit
168165
169166
170167 func onlyAdmin (inv) = if (isAdmin(inv))
171168 then unit
172169 else throw("Permission denied")
173170
174171
175172 func onlyController (inv) = if (if (isAdmin(inv))
176173 then true
177174 else isController(toString(inv.caller)))
178175 then unit
179176 else throw("Permission denied")
180177
181178
182179 func onlyOwner (inv,name) = if (if (isAdmin(inv))
183180 then true
184181 else isOwner(inv, name))
185182 then unit
186183 else throw("Permission denied")
187184
188185
189186 @Callable(inv)
190187 func init (nameTTL) = valueOrElse(modifiers([onlyAdmin(inv), if ((nameTTL > 0))
191188 then unit
192189 else throw("TTL cannot be negative")]), [IntegerEntry(key_nameTTL, nameTTL)])
193190
194191
195192
196193 @Callable(inv)
197-func supportsInterface (interfaceId) = $Tuple2(nil, containsElement(["owner", "resolver", "nameCreated", "nameExpires"], interfaceId))
194+func supportsInterface (interfaceId) = $Tuple2(nil, containsElement(["getOwner", "getResolver", "getNameCreated", "getNameExpires"], interfaceId))
198195
199196
200197
201198 @Callable(inv)
202199 func addController (address) = valueOrElse(modifiers([onlyAdmin(inv), if (isValidAddress(address))
203200 then unit
204201 else throw("Controller must be a valid address"), if (!(isController(address)))
205202 then unit
206203 else throw((("Controller `" + address) + "` is already registered"))]), [StringEntry(key_controllers, makeString((controllers :+ address), ","))])
207204
208205
209206
210207 @Callable(inv)
211208 func removeController (address) = valueOrElse(modifiers([onlyAdmin(inv), if (isController(address))
212209 then unit
213210 else throw((("Controller `" + address) + "` is not registered"))]), {
214211 let controllerIndex = value(indexOf(controllers, address))
215212 [StringEntry(key_controllers, makeString(removeByIndex(controllers, controllerIndex), ","))]
216213 })
217214
218215
219216
220217 @Callable(inv)
221-func validate (name) = $Tuple2(nil, isValidName(name))
218+func isValid (name) = $Tuple2(nil, isValidName(name))
222219
223220
224221
225222 @Callable(inv)
226-func available (name) = $Tuple2(nil, isAvailableName(name))
223+func isAvailable (name) = $Tuple2(nil, isAvailableName(name))
227224
228225
229226
230227 @Callable(inv)
231-func owner (name) = $Tuple2(nil, _getOwner(_splitLastLabel(name)._1))
228+func getOwner (name) = $Tuple2(nil, _getOwner(_splitLastLabel(name)._1))
232229
233230
234231
235232 @Callable(inv)
236-func resolver (name) = $Tuple2(nil, _getResolver(_splitLastLabel(name)._1))
233+func getResolver (name) = $Tuple2(nil, _getResolver(_splitLastLabel(name)._1))
237234
238235
239236
240237 @Callable(inv)
241-func setResolver (name,resolver) = valueOrElse(modifiers([if (isActiveName(name))
242- then unit
243- else throw("Name expired or not registered"), onlyOwner(inv, name), if (isValidAddress(resolver))
244- then unit
245- else throw("Resolver must be a valid contract address")]), $Tuple2(nil, _setResolver(name, resolver)))
238+func getNameCreated (name) = $Tuple2(nil, _getCreatedAt(_splitLastLabel(name)._1))
246239
247240
248241
249242 @Callable(inv)
250-func nameCreated (name) = $Tuple2(nil, _getCreatedAt(_splitLastLabel(name)._1))
251-
252-
253-
254-@Callable(inv)
255-func nameExpires (name) = $Tuple2(nil, _getExpiresAt(_splitLastLabel(name)._1))
243+func getNameExpires (name) = $Tuple2(nil, _getExpiresAt(_splitLastLabel(name)._1))
256244
257245
258246
259247 @Callable(inv)
260248 func register (name,owner,createdAt) = valueOrElse(modifiers([onlyController(inv), if (isAvailableName(name))
261249 then unit
262250 else throw((("`" + name) + "` cannot be registered")), if (isValidAddress(owner))
263251 then unit
264252 else throw("Owner must be a valid address"), if ((createdAt > 0))
265253 then unit
266254 else throw("CreatedAt cannot be negative"), if ((lastBlock.timestamp >= createdAt))
267255 then unit
268256 else throw("CreatedAt cannot be in the future")]), {
269257 let issueNameToken = _issueNameToken(name)
270258 let tokenId = calculateAssetId(issueNameToken[0])
271259 let tokenStr = toBase58String(tokenId)
272260 let registerNameWithToken = _registerNameWithToken(name, tokenStr, createdAt)
273261 let transferTokenToOwner = _transferTokenToOwner(tokenStr, owner)
274262 let setOwnership = _setOwner(name, owner)
275263 (((issueNameToken ++ registerNameWithToken) ++ transferTokenToOwner) ++ setOwnership)
276264 })
277265
278266
279267
280268 @Callable(inv)
281269 func reclaim (name) = valueOrElse(modifiers([if (isActiveName(name))
282270 then unit
283271 else throw((("`" + name) + "` is not active"))]), {
284272 let newOwner = inv.originCaller
285273 let newOwnerAddress = toString(newOwner)
286274 let tokenStr = valueOrErrorMessage(_getToken(name), (("No token is issued for `" + name) + "`"))
287275 let tokenId = fromBase58String(tokenStr)
288276 let hasToken = (assetBalance(newOwner, tokenId) == 1)
289277 let isTokenOwner = isOwner(inv, name)
290278 let isTokenExists = match assetInfo(tokenId) {
291279 case token: Asset =>
292280 (token.quantity == 1)
293281 case _ =>
294282 false
295283 }
296284 if (if (isTokenOwner)
297285 then !(isTokenExists)
298286 else false)
299287 then {
300288 let issueNewToken = _issueNameToken(name)
301289 let newTokenId = calculateAssetId(issueNewToken[0])
302290 let newTokenStr = toBase58String(newTokenId)
303291 let restoreNameWithNewToken = _restoreNameWithToken(name, newTokenStr)
304292 let transferNewTokenToOwner = _transferTokenToOwner(newTokenStr, newOwnerAddress)
305293 ((issueNewToken ++ restoreNameWithNewToken) ++ transferNewTokenToOwner)
306294 }
307295 else if (if (isTokenOwner)
308296 then hasToken
309297 else false)
310298 then throw("You already own a name token")
311299 else if (!(hasToken))
312300 then throw("You don't have a name token")
313301 else _setOwner(name, newOwnerAddress)
314302 })
315303
316304

github/deemru/w8io/026f985 
54.02 ms