tx · 7T3vQ6rekucZZVuT8UBsCj2rZsJqi1bzpE3wMMwsS7oB

3MvVeqqFHW9M6r9ggG3Ma5Que4Rqgb4BjJE:  -0.01000000 Waves

2022.10.17 14:26 [2276309] smart account 3MvVeqqFHW9M6r9ggG3Ma5Que4Rqgb4BjJE > SELF 0.00000000 Waves

{ "type": 13, "id": "7T3vQ6rekucZZVuT8UBsCj2rZsJqi1bzpE3wMMwsS7oB", "fee": 1000000, "feeAssetId": null, "timestamp": 1666005994317, "version": 2, "chainId": 84, "sender": "3MvVeqqFHW9M6r9ggG3Ma5Que4Rqgb4BjJE", "senderPublicKey": "3nPFqmiV1yaNvmSrQdE1QHbTAF8bfJB1GjbegBWbNNCK", "proofs": [ "5UhcvcmnuDmSjssNbcdVXXRw5rPeNG1KgwFyrLKwdrdtzhTnJUUsAqc3vP2FQrG7ydDqQ2DR6rkvRuMxehSfUvs2" ], "script": "base64:AAIFAAAAAAAAABgIAhIECgIICBIDCgEIEgQKAggIEgMKAQgAAAAGAQAAAAlrZXlfb3duZXIAAAABAAAAB3N1Yk5hbWUJAAEsAAAAAgIAAAAGb3duZXJfBQAAAAdzdWJOYW1lAQAAAAlfZ2V0T3duZXIAAAABAAAAB3N1Yk5hbWUJAAQdAAAAAgUAAAAEdGhpcwkBAAAACWtleV9vd25lcgAAAAEFAAAAB3N1Yk5hbWUBAAAACV9zZXRPd25lcgAAAAIAAAAHc3ViTmFtZQAAAAVvd25lcgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQEAAAAJa2V5X293bmVyAAAAAQUAAAAHc3ViTmFtZQUAAAAFb3duZXIFAAAAA25pbAEAAAALa2V5X2FkZHJlc3MAAAABAAAABG5hbWUJAAEsAAAAAgIAAAAIYWRkcmVzc18FAAAABG5hbWUAAAAACXJlZ2lzdHJhcgUAAAAEdGhpcwEAAAAHaXNPd25lcgAAAAIAAAADaW52AAAABG5hbWUDCQAAAAAAAAIIBQAAAANpbnYAAAAGY2FsbGVyBQAAAAR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": 2276309, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ERnjHYdJx2URMpk9S5shHb6fHkvuLQpiGYS7t5hkHqeQ Next: 4j575PixthHe3uJ3ydGM91uLNoEx9dUiAWb9Acw7nXqr Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+func key_owner (subName) = ("owner_" + subName)
5+
6+
7+func _getOwner (subName) = getString(this, key_owner(subName))
8+
9+
10+func _setOwner (subName,owner) = [StringEntry(key_owner(subName), owner)]
11+
12+
413 func key_address (name) = ("address_" + name)
514
615
7-func isOwner (inv) = (inv.caller == this)
16+let registrar = this
17+
18+func isOwner (inv,name) = if ((inv.caller == this))
19+ then true
20+ else match invoke(registrar, "owner", [name], nil) {
21+ case owner: String =>
22+ (owner == toString(inv.caller))
23+ case _ =>
24+ false
25+ }
26+
27+
28+@Callable(inv)
29+func register (subName,owner) = {
30+ let currentOwner = _getOwner(subName)
31+ if (isDefined(currentOwner))
32+ then throw((("`" + subName) + "` already registered"))
33+ else _setOwner(subName, owner)
34+ }
35+
836
937
1038 @Callable(inv)
1341
1442
1543 @Callable(inv)
16-func setAddr (name,address) = if (!(isOwner(inv)))
44+func setAddr (name,address) = if (!(isOwner(inv, name)))
1745 then throw("Permission denied")
1846 else [StringEntry(key_address(name), address)]
1947
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+func key_owner (subName) = ("owner_" + subName)
5+
6+
7+func _getOwner (subName) = getString(this, key_owner(subName))
8+
9+
10+func _setOwner (subName,owner) = [StringEntry(key_owner(subName), owner)]
11+
12+
413 func key_address (name) = ("address_" + name)
514
615
7-func isOwner (inv) = (inv.caller == this)
16+let registrar = this
17+
18+func isOwner (inv,name) = if ((inv.caller == this))
19+ then true
20+ else match invoke(registrar, "owner", [name], nil) {
21+ case owner: String =>
22+ (owner == toString(inv.caller))
23+ case _ =>
24+ false
25+ }
26+
27+
28+@Callable(inv)
29+func register (subName,owner) = {
30+ let currentOwner = _getOwner(subName)
31+ if (isDefined(currentOwner))
32+ then throw((("`" + subName) + "` already registered"))
33+ else _setOwner(subName, owner)
34+ }
35+
836
937
1038 @Callable(inv)
1139 func supportsInterface (interfaceId) = $Tuple2(nil, (interfaceId == "addr"))
1240
1341
1442
1543 @Callable(inv)
16-func setAddr (name,address) = if (!(isOwner(inv)))
44+func setAddr (name,address) = if (!(isOwner(inv, name)))
1745 then throw("Permission denied")
1846 else [StringEntry(key_address(name), address)]
1947
2048
2149
2250 @Callable(inv)
2351 func addr (name) = $Tuple2(nil, getString(this, key_address(name)))
2452
2553

github/deemru/w8io/169f3d6 
28.18 ms