tx · 632aNsgstRdDpTr99wUrx2D8k5Lon7uwRnKrf5gan3Cm

3MvrXJVzDMDcshazxn88FybxHV2JvWQBxTc:  -0.01100000 Waves

2022.10.14 13:02 [2271870] smart account 3MvrXJVzDMDcshazxn88FybxHV2JvWQBxTc > SELF 0.00000000 Waves

{ "type": 13, "id": "632aNsgstRdDpTr99wUrx2D8k5Lon7uwRnKrf5gan3Cm", "fee": 1100000, "feeAssetId": null, "timestamp": 1665741701904, "version": 2, "chainId": 84, "sender": "3MvrXJVzDMDcshazxn88FybxHV2JvWQBxTc", "senderPublicKey": "Fq8P5ctrS7PNTX37bWWxvnwoB7C2FaNySZWnRmgPUaDH", "proofs": [ "4HLa5K59pFpRV7H5v1RDc6pyPkP69wuDvNVwbX8Ry9VLtqxf1CH6S791cAP5opXnnW3ueaYf8ZndUSAttWZj2gGP" ], "script": "base64:AAIFAAAAAAAAACwIAhIDCgEBEgMKAQgSAwoBCBIDCgEIEgMKAQgSBQoDCAgBEgMKAQgSAwoBCAAAACQBAAAAEGdldFN0cmluZ09yVGhyb3cAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAxDYW4ndCByZWFkICcFAAAAA2tleQIAAAANJyBhdCBhZGRyZXNzIAkABCUAAAABBQAAAAdhZGRyZXNzAQAAABFnZXRJbnRlZ2VyT3JUaHJvdwAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABBoAAAACBQAAAAdhZGRyZXNzBQAAAANrZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAADENhbid0IHJlYWQgJwUAAAADa2V5AgAAAA0nIGF0IGFkZHJlc3MgCQAEJQAAAAEFAAAAB2FkZHJlc3MBAAAAE3BhcnNlQWRkcmVzc09yVGhyb3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CQAAAgAAAAECAAAAHFlvdSBhbHJlYWR5IG93biBhIG5hbWUgdG9rZW4DCQEAAAABIQAAAAEFAAAACGhhc1Rva2VuCQAAAgAAAAECAAAAG1lvdSBkb24ndCBoYXZlIGEgbmFtZSB0b2tlbgkBAAAACV9zZXRPd25lcgAAAAIFAAAABG5hbWUFAAAAD25ld093bmVyQWRkcmVzcwAAAANpbnYBAAAABXdob0lzAAAAAQAAAARuYW1lCQEAAAALdmFsdWVPckVsc2UAAAACCQEAAAAJbW9kaWZpZXJzAAAAAQkABEwAAAACAwkAAGYAAAACCQABMQAAAAEFAAAABG5hbWUAAAAAAAAAAAAFAAAABHVuaXQJAAACAAAAAQIAAAAUTmFtZSBjYW5ub3QgYmUgZW1wdHkFAAAAA25pbAQAAAAJbGFzdExhYmVsCAkBAAAAD19zcGxpdExhc3RMYWJlbAAAAAEFAAAABG5hbWUAAAACXzEEAAAACnJlZ2lzdHJhbnQJAQAAAAlfZ2V0T3duZXIAAAABBQAAAAlsYXN0TGFiZWwEAAAACHJlc29sdmVyBQAAAAR1bml0BAAAAAtuYW1lQ3JlYXRlZAkBAAAADV9nZXRDcmVhdGVkQXQAAAABBQAAAAlsYXN0TGFiZWwEAAAAC25hbWVFeHBpcmVzCQEAAAANX2dldEV4cGlyZXNBdAAAAAEFAAAACWxhc3RMYWJlbAkABRQAAAACBQAAAANuaWwJAAUWAAAABAUAAAAKcmVnaXN0cmFudAUAAAAIcmVzb2x2ZXIFAAAAC25hbWVDcmVhdGVkBQAAAAtuYW1lRXhwaXJlcwAAAAAYLrw1", "height": 2271870, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 67CL4ykCEXAiVgq857v7a6AV5g4W4Ym2V6wrszbeH6hF Next: CPMAhrWJrvtNvhzcfrsLnPMbWgnQ1MwuWo4AunxW2oeY Diff:
OldNewDifferences
2828 func key_Name_createdAt (name) = key_entity("Name", name, "createdAt")
2929
3030
31-let key_rootAddress = "rootAddress"
32-
3331 let key_nameTTL = "nameTTL"
3432
3533 let key_controllers = "controllers"
5149
5250 func _getControllers () = getString(this, key_controllers)
5351
54-
55-let rootAddress = getStringOrThrow(this, key_rootAddress)
56-
57-let root = parseAddressOrThrow(rootAddress)
5852
5953 let controllers = match _getControllers() {
6054 case repr: String =>
9286 then contains(symbols, char)
9387 else false
9488
95- let isValidName = if (if (if (if ((size(name) > 0))
89+ let isValidName = if (if (if (if (if ((size(name) > 0))
9690 then (63 >= size(name))
91+ else false)
92+ then (indexOf(name, "--") != 2)
9793 else false)
9894 then (indexOf(name, "-") != 0)
9995 else false)
126122 func isAdmin (inv) = (inv.caller == this)
127123
128124
129-func isOwner (inv,name) = (toString(inv.caller) == valueOrErrorMessage(_getOwner(name), (("Owner for `" + name) + "` is not found")))
125+func isOwner (inv,name) = (toString(inv.caller) == valueOrElse(_getOwner(name), ""))
130126
131127
132128 func isController (address) = containsElement(controllers, address)
133129
134130
131+func _splitLastLabel (name) = {
132+ let labels = split(name, ".")
133+ let lastIndex = (size(labels) - 1)
134+ let lastLabel = labels[lastIndex]
135+ let restLabels = makeString(removeByIndex(labels, lastIndex), ".")
136+ $Tuple2(lastLabel, restLabels)
137+ }
138+
139+
135140 func _issueNameToken (name) = [Issue(if ((size(name) > 16))
136141 then (take(name, 15) + "~")
137- else take(name, 16), name, 1, 0, false)]
142+ else take(name, 16), (name + ".waves"), 1, 0, false)]
138143
139144
140145 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))]
161166 else throw("Permission denied")
162167
163168
169+func validAddress (address) = if (isDefined(addressFromString(address)))
170+ then unit
171+ else throw("The address must be valid")
172+
173+
164174 @Callable(inv)
165-func init (rootAddress,nameTTL) = valueOrElse(modifiers([onlyAdmin(inv)]), [StringEntry(key_rootAddress, rootAddress), IntegerEntry(key_nameTTL, nameTTL)])
175+func init (nameTTL) = valueOrElse(modifiers([onlyAdmin(inv), if ((nameTTL > 0))
176+ then unit
177+ else throw("TTL cannot be negative")]), [IntegerEntry(key_nameTTL, nameTTL)])
166178
167179
168180
169181 @Callable(inv)
170-func addController (address) = valueOrElse(modifiers([onlyAdmin(inv), if (!(isController(address)))
182+func supportsInterface (interfaceId) = $Tuple2(nil, (interfaceId == "whoIs"))
183+
184+
185+
186+@Callable(inv)
187+func addController (address) = valueOrElse(modifiers([onlyAdmin(inv), validAddress(address), if (!(isController(address)))
171188 then unit
172189 else throw((("Controller `" + address) + "` is already registered"))]), [StringEntry(key_controllers, makeString((controllers :+ address), ","))])
173190
174191
175192
176193 @Callable(inv)
177-func removeController (address) = valueOrElse(modifiers([onlyAdmin(inv), if (isController(address))
194+func removeController (address) = valueOrElse(modifiers([onlyAdmin(inv), validAddress(address), if (isController(address))
178195 then unit
179196 else throw((("Controller `" + address) + "` is not registered"))]), {
180197 let controllerIndex = value(indexOf(controllers, address))
189206
190207
191208 @Callable(inv)
192-func owner (name) = $Tuple2(nil, _getOwner(name))
193-
194-
195-
196-@Callable(inv)
197-func nameCreated (name) = $Tuple2(nil, _getCreatedAt(name))
198-
199-
200-
201-@Callable(inv)
202-func nameExpires (name) = $Tuple2(nil, _getExpiresAt(name))
203-
204-
205-
206-@Callable(inv)
207-func nameStatus (name) = $Tuple2(nil, if (!(isRegisteredName(name)))
208- then "NOT_REGISTERED"
209- else if (isExpiredName(name))
210- then "EXPIRED"
211- else if ((assetBalance(value(addressFromString(value(_getOwner(name)))), fromBase58String(value(_getToken(name)))) == 0))
212- then "SUSPENDED"
213- else "ACTIVE")
214-
215-
216-
217-@Callable(inv)
218209 func register (name,owner,createdAt) = valueOrElse(modifiers([onlyController(inv), if (isAvailableName(name))
219210 then unit
220- else throw((("`" + name) + "` cannot be registered")), if ((lastBlock.timestamp >= createdAt))
211+ else throw((("`" + name) + "` cannot be registered")), validAddress(owner), if ((createdAt > 0))
221212 then unit
222- else throw("createdAt cannot be in the future")]), {
213+ else throw("CreatedAt cannot be negative"), if ((lastBlock.timestamp >= createdAt))
214+ then unit
215+ else throw("CreatedAt cannot be in the future")]), {
223216 let issueNameToken = _issueNameToken(name)
224217 let tokenId = calculateAssetId(issueNameToken[0])
225218 let tokenStr = toBase58String(tokenId)
268261 })
269262
270263
264+
265+@Callable(inv)
266+func whoIs (name) = valueOrElse(modifiers([if ((size(name) > 0))
267+ then unit
268+ else throw("Name cannot be empty")]), {
269+ let lastLabel = _splitLastLabel(name)._1
270+ let registrant = _getOwner(lastLabel)
271+ let resolver = unit
272+ let nameCreated = _getCreatedAt(lastLabel)
273+ let nameExpires = _getExpiresAt(lastLabel)
274+ $Tuple2(nil, $Tuple4(registrant, resolver, nameCreated, nameExpires))
275+ })
276+
277+
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_expiresAt (name) = key_entity("Name", name, "expiresAt")
2626
2727
2828 func key_Name_createdAt (name) = key_entity("Name", name, "createdAt")
2929
3030
31-let key_rootAddress = "rootAddress"
32-
3331 let key_nameTTL = "nameTTL"
3432
3533 let key_controllers = "controllers"
3634
3735 func _setOwner (name,owner) = [StringEntry(key_Name_owner(name), owner)]
3836
3937
4038 func _getOwner (name) = getString(this, key_Name_owner(name))
4139
4240
4341 func _getToken (name) = getString(this, key_Name_token(name))
4442
4543
4644 func _getCreatedAt (name) = getInteger(this, key_Name_createdAt(name))
4745
4846
4947 func _getExpiresAt (name) = getInteger(this, key_Name_expiresAt(name))
5048
5149
5250 func _getControllers () = getString(this, key_controllers)
5351
54-
55-let rootAddress = getStringOrThrow(this, key_rootAddress)
56-
57-let root = parseAddressOrThrow(rootAddress)
5852
5953 let controllers = match _getControllers() {
6054 case repr: String =>
6155 split(repr, ",")
6256 case _ =>
6357 nil
6458 }
6559
6660 let nameTTL = getIntegerOrThrow(this, key_nameTTL)
6761
6862 func isRegisteredName (name) = isDefined(getString(this, key_Name_token(name)))
6963
7064
7165 func isCreatedName (name) = isDefined(_getCreatedAt(name))
7266
7367
7468 func isExpiredName (name) = match _getExpiresAt(name) {
7569 case expiresAt: Int =>
7670 (lastBlock.timestamp > expiresAt)
7771 case _ =>
7872 false
7973 }
8074
8175
8276 func isActiveName (name) = if (if (isRegisteredName(name))
8377 then isCreatedName(name)
8478 else false)
8579 then !(isExpiredName(name))
8680 else false
8781
8882
8983 func isAvailableName (name) = {
9084 let symbols = "abcdefghijklmnopqrstuvwxyz1234567890-"
9185 func validateChars (isValid,char) = if (isValid)
9286 then contains(symbols, char)
9387 else false
9488
95- let isValidName = if (if (if (if ((size(name) > 0))
89+ let isValidName = if (if (if (if (if ((size(name) > 0))
9690 then (63 >= size(name))
91+ else false)
92+ then (indexOf(name, "--") != 2)
9793 else false)
9894 then (indexOf(name, "-") != 0)
9995 else false)
10096 then (lastIndexOf(name, "-") != (size(name) - 1))
10197 else false)
10298 then {
10399 let $l = split(name, "")
104100 let $s = size($l)
105101 let $acc0 = true
106102 func $f0_1 ($a,$i) = if (($i >= $s))
107103 then $a
108104 else validateChars($a, $l[$i])
109105
110106 func $f0_2 ($a,$i) = if (($i >= $s))
111107 then $a
112108 else throw("List size exceeds 63")
113109
114110 $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)
115111 }
116112 else false
117113 let inUse = if (isRegisteredName(name))
118114 then !(isExpiredName(name))
119115 else false
120116 if (!(inUse))
121117 then isValidName
122118 else false
123119 }
124120
125121
126122 func isAdmin (inv) = (inv.caller == this)
127123
128124
129-func isOwner (inv,name) = (toString(inv.caller) == valueOrErrorMessage(_getOwner(name), (("Owner for `" + name) + "` is not found")))
125+func isOwner (inv,name) = (toString(inv.caller) == valueOrElse(_getOwner(name), ""))
130126
131127
132128 func isController (address) = containsElement(controllers, address)
133129
134130
131+func _splitLastLabel (name) = {
132+ let labels = split(name, ".")
133+ let lastIndex = (size(labels) - 1)
134+ let lastLabel = labels[lastIndex]
135+ let restLabels = makeString(removeByIndex(labels, lastIndex), ".")
136+ $Tuple2(lastLabel, restLabels)
137+ }
138+
139+
135140 func _issueNameToken (name) = [Issue(if ((size(name) > 16))
136141 then (take(name, 15) + "~")
137- else take(name, 16), name, 1, 0, false)]
142+ else take(name, 16), (name + ".waves"), 1, 0, false)]
138143
139144
140145 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))]
141146
142147
143148 func _restoreNameWithToken (name,tokenId) = [StringEntry(key_Name_token(name), tokenId), StringEntry(key_Token_name(tokenId), name)]
144149
145150
146151 func _transferTokenToOwner (tokenId,owner) = [ScriptTransfer(parseAddressOrThrow(owner), 1, fromBase58String(tokenId))]
147152
148153
149154 func modifiers (validations) = unit
150155
151156
152157 func onlyAdmin (inv) = if (isAdmin(inv))
153158 then unit
154159 else throw("Permission denied")
155160
156161
157162 func onlyController (inv) = if (if (isAdmin(inv))
158163 then true
159164 else isController(toString(inv.caller)))
160165 then unit
161166 else throw("Permission denied")
162167
163168
169+func validAddress (address) = if (isDefined(addressFromString(address)))
170+ then unit
171+ else throw("The address must be valid")
172+
173+
164174 @Callable(inv)
165-func init (rootAddress,nameTTL) = valueOrElse(modifiers([onlyAdmin(inv)]), [StringEntry(key_rootAddress, rootAddress), IntegerEntry(key_nameTTL, nameTTL)])
175+func init (nameTTL) = valueOrElse(modifiers([onlyAdmin(inv), if ((nameTTL > 0))
176+ then unit
177+ else throw("TTL cannot be negative")]), [IntegerEntry(key_nameTTL, nameTTL)])
166178
167179
168180
169181 @Callable(inv)
170-func addController (address) = valueOrElse(modifiers([onlyAdmin(inv), if (!(isController(address)))
182+func supportsInterface (interfaceId) = $Tuple2(nil, (interfaceId == "whoIs"))
183+
184+
185+
186+@Callable(inv)
187+func addController (address) = valueOrElse(modifiers([onlyAdmin(inv), validAddress(address), if (!(isController(address)))
171188 then unit
172189 else throw((("Controller `" + address) + "` is already registered"))]), [StringEntry(key_controllers, makeString((controllers :+ address), ","))])
173190
174191
175192
176193 @Callable(inv)
177-func removeController (address) = valueOrElse(modifiers([onlyAdmin(inv), if (isController(address))
194+func removeController (address) = valueOrElse(modifiers([onlyAdmin(inv), validAddress(address), if (isController(address))
178195 then unit
179196 else throw((("Controller `" + address) + "` is not registered"))]), {
180197 let controllerIndex = value(indexOf(controllers, address))
181198 [StringEntry(key_controllers, makeString(removeByIndex(controllers, controllerIndex), ","))]
182199 })
183200
184201
185202
186203 @Callable(inv)
187204 func available (name) = $Tuple2(nil, isAvailableName(name))
188205
189206
190207
191208 @Callable(inv)
192-func owner (name) = $Tuple2(nil, _getOwner(name))
193-
194-
195-
196-@Callable(inv)
197-func nameCreated (name) = $Tuple2(nil, _getCreatedAt(name))
198-
199-
200-
201-@Callable(inv)
202-func nameExpires (name) = $Tuple2(nil, _getExpiresAt(name))
203-
204-
205-
206-@Callable(inv)
207-func nameStatus (name) = $Tuple2(nil, if (!(isRegisteredName(name)))
208- then "NOT_REGISTERED"
209- else if (isExpiredName(name))
210- then "EXPIRED"
211- else if ((assetBalance(value(addressFromString(value(_getOwner(name)))), fromBase58String(value(_getToken(name)))) == 0))
212- then "SUSPENDED"
213- else "ACTIVE")
214-
215-
216-
217-@Callable(inv)
218209 func register (name,owner,createdAt) = valueOrElse(modifiers([onlyController(inv), if (isAvailableName(name))
219210 then unit
220- else throw((("`" + name) + "` cannot be registered")), if ((lastBlock.timestamp >= createdAt))
211+ else throw((("`" + name) + "` cannot be registered")), validAddress(owner), if ((createdAt > 0))
221212 then unit
222- else throw("createdAt cannot be in the future")]), {
213+ else throw("CreatedAt cannot be negative"), if ((lastBlock.timestamp >= createdAt))
214+ then unit
215+ else throw("CreatedAt cannot be in the future")]), {
223216 let issueNameToken = _issueNameToken(name)
224217 let tokenId = calculateAssetId(issueNameToken[0])
225218 let tokenStr = toBase58String(tokenId)
226219 let registerNameWithToken = _registerNameWithToken(name, tokenStr, createdAt)
227220 let transferTokenToOwner = _transferTokenToOwner(tokenStr, owner)
228221 let setOwnership = _setOwner(name, owner)
229222 (((issueNameToken ++ registerNameWithToken) ++ transferTokenToOwner) ++ setOwnership)
230223 })
231224
232225
233226
234227 @Callable(inv)
235228 func reclaim (name) = valueOrElse(modifiers([if (isActiveName(name))
236229 then unit
237230 else throw((("`" + name) + "` is not active"))]), {
238231 let newOwner = inv.caller
239232 let newOwnerAddress = toString(newOwner)
240233 let tokenStr = valueOrErrorMessage(_getToken(name), (("No token is issued for `" + name) + "`"))
241234 let tokenId = fromBase58String(tokenStr)
242235 let hasToken = (assetBalance(newOwner, tokenId) == 1)
243236 let isTokenOwner = isOwner(inv, name)
244237 let isTokenExists = match assetInfo(tokenId) {
245238 case token: Asset =>
246239 (token.quantity == 1)
247240 case _ =>
248241 false
249242 }
250243 if (if (isTokenOwner)
251244 then !(isTokenExists)
252245 else false)
253246 then {
254247 let issueNewToken = _issueNameToken(name)
255248 let newTokenId = calculateAssetId(issueNewToken[0])
256249 let newTokenStr = toBase58String(newTokenId)
257250 let restoreNameWithNewToken = _restoreNameWithToken(name, newTokenStr)
258251 let transferNewTokenToOwner = _transferTokenToOwner(newTokenStr, newOwnerAddress)
259252 ((issueNewToken ++ restoreNameWithNewToken) ++ transferNewTokenToOwner)
260253 }
261254 else if (if (isTokenOwner)
262255 then hasToken
263256 else false)
264257 then throw("You already own a name token")
265258 else if (!(hasToken))
266259 then throw("You don't have a name token")
267260 else _setOwner(name, newOwnerAddress)
268261 })
269262
270263
264+
265+@Callable(inv)
266+func whoIs (name) = valueOrElse(modifiers([if ((size(name) > 0))
267+ then unit
268+ else throw("Name cannot be empty")]), {
269+ let lastLabel = _splitLastLabel(name)._1
270+ let registrant = _getOwner(lastLabel)
271+ let resolver = unit
272+ let nameCreated = _getCreatedAt(lastLabel)
273+ let nameExpires = _getExpiresAt(lastLabel)
274+ $Tuple2(nil, $Tuple4(registrant, resolver, nameCreated, nameExpires))
275+ })
276+
277+

github/deemru/w8io/026f985 
56.50 ms