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:AAIFAAAAAAAAABgIAhIECgIICBIDCgEIEgQKAggIEgMKAQgAAAAGAQAAAAlrZXlfb3duZXIAAAABAAAAB3N1Yk5hbWUJAAEsAAAAAgIAAAAGb3duZXJfBQAAAAdzdWJOYW1lAQAAAAlfZ2V0T3duZXIAAAABAAAAB3N1Yk5hbWUJAAQdAAAAAgUAAAAEdGhpcwkBAAAACWtleV9vd25lcgAAAAEFAAAAB3N1Yk5hbWUBAAAACV9zZXRPd25lcgAAAAIAAAAHc3ViTmFtZQAAAAVvd25lcgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQEAAAAJa2V5X293bmVyAAAAAQUAAAAHc3ViTmFtZQUAAAAFb3duZXIFAAAAA25pbAEAAAALa2V5X2FkZHJlc3MAAAABAAAABG5hbWUJAAEsAAAAAgIAAAAIYWRkcmVzc18FAAAABG5hbWUAAAAACXJlZ2lzdHJhcgUAAAAEdGhpcwEAAAAHaXNPd25lcgAAAAIAAAADaW52AAAABG5hbWUDCQAAAAAAAAIIBQAAAANpbnYAAAAGY2FsbG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KoAuw=",
"height": 2276309,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: ERnjHYdJx2URMpk9S5shHb6fHkvuLQpiGYS7t5hkHqeQ
Next: 4j575PixthHe3uJ3ydGM91uLNoEx9dUiAWb9Acw7nXqr
Diff:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# 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 | + | |
---|
4 | 13 | | func key_address (name) = ("address_" + name) |
---|
5 | 14 | | |
---|
6 | 15 | | |
---|
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 | + | |
---|
8 | 36 | | |
---|
9 | 37 | | |
---|
10 | 38 | | @Callable(inv) |
---|
|
13 | 41 | | |
---|
14 | 42 | | |
---|
15 | 43 | | @Callable(inv) |
---|
16 | | - | func setAddr (name,address) = if (!(isOwner(inv))) |
---|
| 44 | + | func setAddr (name,address) = if (!(isOwner(inv, name))) |
---|
17 | 45 | | then throw("Permission denied") |
---|
18 | 46 | | else [StringEntry(key_address(name), address)] |
---|
19 | 47 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# 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 | + | |
---|
4 | 13 | | func key_address (name) = ("address_" + name) |
---|
5 | 14 | | |
---|
6 | 15 | | |
---|
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 | + | |
---|
8 | 36 | | |
---|
9 | 37 | | |
---|
10 | 38 | | @Callable(inv) |
---|
11 | 39 | | func supportsInterface (interfaceId) = $Tuple2(nil, (interfaceId == "addr")) |
---|
12 | 40 | | |
---|
13 | 41 | | |
---|
14 | 42 | | |
---|
15 | 43 | | @Callable(inv) |
---|
16 | | - | func setAddr (name,address) = if (!(isOwner(inv))) |
---|
| 44 | + | func setAddr (name,address) = if (!(isOwner(inv, name))) |
---|
17 | 45 | | then throw("Permission denied") |
---|
18 | 46 | | else [StringEntry(key_address(name), address)] |
---|
19 | 47 | | |
---|
20 | 48 | | |
---|
21 | 49 | | |
---|
22 | 50 | | @Callable(inv) |
---|
23 | 51 | | func addr (name) = $Tuple2(nil, getString(this, key_address(name))) |
---|
24 | 52 | | |
---|
25 | 53 | | |
---|