tx · 7Qgzuj2XekvVrfT835ebFy3NbaXpx1oHGd4sY2jrUsNz
3MvVeqqFHW9M6r9ggG3Ma5Que4Rqgb4BjJE: -0.01000000 Waves
2022.10.20 09:43 [2280369] smart account 3MvVeqqFHW9M6r9ggG3Ma5Que4Rqgb4BjJE > SELF 0.00000000 Waves
{
"type": 13,
"id": "7Qgzuj2XekvVrfT835ebFy3NbaXpx1oHGd4sY2jrUsNz",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1666248307749,
"version": 2,
"chainId": 84,
"sender": "3MvVeqqFHW9M6r9ggG3Ma5Que4Rqgb4BjJE",
"senderPublicKey": "3nPFqmiV1yaNvmSrQdE1QHbTAF8bfJB1GjbegBWbNNCK",
"proofs": [
"3CaaXHmmAv8H5BqMivxrxNULwNMEwLxa7urbBffU4ypVzi3yY22hRM1KHP9pZSusKm1LT1kjfwnzCEQjik1Ef7S9"
],
"script": "base64:AAIFAAAAAAAAACIIAhIDCgEIEgMKAQgSBAoCCAgSAwoBCBIECgIICBIDCgEIAAAACQEAAAAJa2V5X293bmVyAAAAAQAAAAdzdWJOYW1lCQABLAAAAAICAAAABm93bmVyXwUAAAAHc3ViTmFtZQEAAAANa2V5X3JlZ2lzdHJhcgAAAAEAAAAHc3ViTmFtZQkAASwAAAACAgAAAApyZWdpc3RyYXJfBQAAAAdzdWJOYW1lAQAAAAlfZ2V0T3duZXIAAAABAAAAB3N1Yk5hbWUJAAQdAAAAAgUAAAAEdGhpcwkBAAAACWtleV9vd25lcgAAAAEFAAAAB3N1Yk5hbWUBAAAACV9zZXRPd25lcgAAAAIAAAAHc3ViTmFtZQAAAAVvd25lcgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQEAAAAJa2V5X293bmVyAAAAAQUAAAAHc3ViTmFtZQUAAAAFb3duZXIFAAAAA25pbAEAAAANX2dldFJlZ2lzdHJhcgAAAAEAAAAHc3ViTmFtZQkABB0AAAACBQAAAAR0aGlzCQEAAAAJa2V5X293bmVyAAA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3ViTmFtZQIAAAAUYCBhbHJlYWR5IHJlZ2lzdGVyZWQJAQAAAAlfc2V0T3duZXIAAAACBQAAAAdzdWJOYW1lBQAAAAVvd25lcgAAAANpbnYBAAAAEXN1cHBvcnRzSW50ZXJmYWNlAAAAAQAAAAtpbnRlcmZhY2VJZAkABRQAAAACBQAAAANuaWwJAQAAAA9jb250YWluc0VsZW1lbnQAAAACCQAETAAAAAICAAAABGFkZHIJAARMAAAAAgIAAAAFb3duZXIJAARMAAAAAgIAAAAJcmVnaXN0cmFyBQAAAANuaWwFAAAAC2ludGVyZmFjZUlkAAAAA2ludgEAAAAHc2V0QWRkcgAAAAIAAAAEbmFtZQAAAAdhZGRyZXNzAwkBAAAAASEAAAABCQEAAAAHaXNPd25lcgAAAAIFAAAAA2ludgUAAAAEbmFtZQkAAAIAAAABAgAAABFQZXJtaXNzaW9uIGRlbmllZAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQEAAAALa2V5X2FkZHJlc3MAAAABBQAAAARuYW1lBQAAAAdhZGRyZXNzBQAAAANuaWwAAAADaW52AQAAAARhZGRyAAAAAQAAAARuYW1lCQAFFAAAAAIFAAAAA25pbAkABB0AAAACBQAAAAR0aGlzCQEAAAALa2V5X2FkZHJlc3MAAAABBQAAAARuYW1lAAAAAAwxvxk=",
"height": 2280369,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 4j575PixthHe3uJ3ydGM91uLNoEx9dUiAWb9Acw7nXqr
Next: 83XR9igMH8K8pQfcZ9TNQ6GtsLDBAhxzgwgDEiAXKtA4
Diff:
Old | New | | Differences |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | func key_owner (subName) = ("owner_" + subName) |
---|
| 5 | + | |
---|
| 6 | + | |
---|
| 7 | + | func key_registrar (subName) = ("registrar_" + subName) |
---|
5 | 8 | | |
---|
6 | 9 | | |
---|
7 | 10 | | func _getOwner (subName) = getString(this, key_owner(subName)) |
---|
|
10 | 13 | | func _setOwner (subName,owner) = [StringEntry(key_owner(subName), owner)] |
---|
11 | 14 | | |
---|
12 | 15 | | |
---|
| 16 | + | func _getRegistrar (subName) = getString(this, key_owner(subName)) |
---|
| 17 | + | |
---|
| 18 | + | |
---|
| 19 | + | func _setRegistrar (subName,registrar) = [StringEntry(key_registrar(subName), registrar)] |
---|
| 20 | + | |
---|
| 21 | + | |
---|
13 | 22 | | func key_address (name) = ("address_" + name) |
---|
14 | 23 | | |
---|
15 | 24 | | |
---|
16 | | - | let registrar = this |
---|
| 25 | + | let registry = this |
---|
17 | 26 | | |
---|
18 | 27 | | func isOwner (inv,name) = if ((inv.caller == this)) |
---|
19 | 28 | | then true |
---|
20 | | - | else match invoke(registrar, "owner", [name], nil) { |
---|
| 29 | + | else match invoke(registry, "owner", [name], nil) { |
---|
21 | 30 | | case owner: String => |
---|
22 | 31 | | (owner == toString(inv.caller)) |
---|
23 | 32 | | case _ => |
---|
|
27 | 36 | | |
---|
28 | 37 | | @Callable(inv) |
---|
29 | 38 | | func owner (subName) = $Tuple2(nil, _getOwner(subName)) |
---|
| 39 | + | |
---|
| 40 | + | |
---|
| 41 | + | |
---|
| 42 | + | @Callable(inv) |
---|
| 43 | + | func registrar (subName) = $Tuple2(nil, _getRegistrar(subName)) |
---|
30 | 44 | | |
---|
31 | 45 | | |
---|
32 | 46 | | |
---|
|
41 | 55 | | |
---|
42 | 56 | | |
---|
43 | 57 | | @Callable(inv) |
---|
44 | | - | func supportsInterface (interfaceId) = $Tuple2(nil, (interfaceId == "addr")) |
---|
| 58 | + | func supportsInterface (interfaceId) = $Tuple2(nil, containsElement(["addr", "owner", "registrar"], interfaceId)) |
---|
45 | 59 | | |
---|
46 | 60 | | |
---|
47 | 61 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | func key_owner (subName) = ("owner_" + subName) |
---|
| 5 | + | |
---|
| 6 | + | |
---|
| 7 | + | func key_registrar (subName) = ("registrar_" + subName) |
---|
5 | 8 | | |
---|
6 | 9 | | |
---|
7 | 10 | | func _getOwner (subName) = getString(this, key_owner(subName)) |
---|
8 | 11 | | |
---|
9 | 12 | | |
---|
10 | 13 | | func _setOwner (subName,owner) = [StringEntry(key_owner(subName), owner)] |
---|
11 | 14 | | |
---|
12 | 15 | | |
---|
| 16 | + | func _getRegistrar (subName) = getString(this, key_owner(subName)) |
---|
| 17 | + | |
---|
| 18 | + | |
---|
| 19 | + | func _setRegistrar (subName,registrar) = [StringEntry(key_registrar(subName), registrar)] |
---|
| 20 | + | |
---|
| 21 | + | |
---|
13 | 22 | | func key_address (name) = ("address_" + name) |
---|
14 | 23 | | |
---|
15 | 24 | | |
---|
16 | | - | let registrar = this |
---|
| 25 | + | let registry = this |
---|
17 | 26 | | |
---|
18 | 27 | | func isOwner (inv,name) = if ((inv.caller == this)) |
---|
19 | 28 | | then true |
---|
20 | | - | else match invoke(registrar, "owner", [name], nil) { |
---|
| 29 | + | else match invoke(registry, "owner", [name], nil) { |
---|
21 | 30 | | case owner: String => |
---|
22 | 31 | | (owner == toString(inv.caller)) |
---|
23 | 32 | | case _ => |
---|
24 | 33 | | false |
---|
25 | 34 | | } |
---|
26 | 35 | | |
---|
27 | 36 | | |
---|
28 | 37 | | @Callable(inv) |
---|
29 | 38 | | func owner (subName) = $Tuple2(nil, _getOwner(subName)) |
---|
| 39 | + | |
---|
| 40 | + | |
---|
| 41 | + | |
---|
| 42 | + | @Callable(inv) |
---|
| 43 | + | func registrar (subName) = $Tuple2(nil, _getRegistrar(subName)) |
---|
30 | 44 | | |
---|
31 | 45 | | |
---|
32 | 46 | | |
---|
33 | 47 | | @Callable(inv) |
---|
34 | 48 | | func register (subName,owner) = { |
---|
35 | 49 | | let currentOwner = _getOwner(subName) |
---|
36 | 50 | | if (isDefined(currentOwner)) |
---|
37 | 51 | | then throw((("`" + subName) + "` already registered")) |
---|
38 | 52 | | else _setOwner(subName, owner) |
---|
39 | 53 | | } |
---|
40 | 54 | | |
---|
41 | 55 | | |
---|
42 | 56 | | |
---|
43 | 57 | | @Callable(inv) |
---|
44 | | - | func supportsInterface (interfaceId) = $Tuple2(nil, (interfaceId == "addr")) |
---|
| 58 | + | func supportsInterface (interfaceId) = $Tuple2(nil, containsElement(["addr", "owner", "registrar"], interfaceId)) |
---|
45 | 59 | | |
---|
46 | 60 | | |
---|
47 | 61 | | |
---|
48 | 62 | | @Callable(inv) |
---|
49 | 63 | | func setAddr (name,address) = if (!(isOwner(inv, name))) |
---|
50 | 64 | | then throw("Permission denied") |
---|
51 | 65 | | else [StringEntry(key_address(name), address)] |
---|
52 | 66 | | |
---|
53 | 67 | | |
---|
54 | 68 | | |
---|
55 | 69 | | @Callable(inv) |
---|
56 | 70 | | func addr (name) = $Tuple2(nil, getString(this, key_address(name))) |
---|
57 | 71 | | |
---|
58 | 72 | | |
---|