tx · BRmubh4Q92AmW1tpUFNqioS1MbM8pPkpKjCyJme88h88

3MxquWQhzpqXgbqunnFqHFJXTjasEznd1tN:  -0.00300000 Waves

2022.10.09 09:14 [2264408] smart account 3MxquWQhzpqXgbqunnFqHFJXTjasEznd1tN > SELF 0.00000000 Waves

{ "type": 13, "id": "BRmubh4Q92AmW1tpUFNqioS1MbM8pPkpKjCyJme88h88", "fee": 300000, "feeAssetId": null, "timestamp": 1665296082836, "version": 2, "chainId": 84, "sender": "3MxquWQhzpqXgbqunnFqHFJXTjasEznd1tN", "senderPublicKey": "GDjexdefwEhShjRTvHgazn3gTrDo74eHpJCAz14cAEeh", "proofs": [ "55k8YA8Ls7eifbYbdegUtZ9fkNjp9csePbx9vWC3ygNajUcqV2z8BG3KEW3s26mhsN4xainPCc3MtRgHGLRBYQt3" ], "script": "base64:AAIFAAAAAAAAAB8IAhIECgIICBIDCgEIEgQKAggIEgMKAQgSBQoDCAgIAAAAEAEAAAAQZ2V0U3RyaW5nT3JUaHJvdwAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAdhZGRyZXNzBQAAAANrZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAADENhbid0IHJlYWQgJwUAAAADa2V5AgAAAA0nIGF0IGFkZHJlc3MgCQAEJQAAAAEFAAAAB2FkZHJlc3MBAAAAEWdldEludGVnZXJPclRocm93AAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEGgAAAAIFAAAAB2FkZHJlc3MFAAAAA2tleQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAMQ2FuJ3QgcmVhZCAnBQAAAANrZXkCAAAADScgYXQgYWRkcmVzcyAJAAQlAAAAAQUAAAAHYWRkcmVzcwEAAAATcGFyc2VBZGRyZXNzT3JUaHJvdwAAAAEAAAAMbWF5YmVBZGRy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AAAAJX2dldE93bmVyAAAAAQUAAAAEbm9kZQAAAANpbnYBAAAAC3NldFJlc29sdmVyAAAAAgAAAARub2RlAAAACHJlc29sdmVyCQEAAAALdmFsdWVPckVsc2UAAAACCQEAAAAJbW9kaWZpZXJzAAAAAQkABEwAAAACCQEAAAAJb25seU93bmVyAAAAAgUAAAADaW52BQAAAARub2RlBQAAAANuaWwJAQAAAAxfc2V0UmVzb2x2ZXIAAAACBQAAAARub2RlBQAAAAhyZXNvbHZlcgAAAANpbnYBAAAACHJlc29sdmVyAAAAAQAAAARub2RlCQAFFAAAAAIFAAAAA25pbAkBAAAADF9nZXRSZXNvbHZlcgAAAAEFAAAABG5vZGUAAAADaW52AQAAAAlzZXRSZWNvcmQAAAADAAAABG5vZGUAAAAFb3duZXIAAAAIcmVzb2x2ZXIJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAQAAAAltb2RpZmllcnMAAAABCQAETAAAAAIJAQAAAAlvbmx5QWRtaW4AAAABBQAAAANpbnYFAAAAA25pbAkABE4AAAACCQEAAAAJX3NldE93bmVyAAAAAgUAAAAEbm9kZQUAAAAFb3duZXIJAQAAAAxfc2V0UmVzb2x2ZXIAAAACBQAAAARub2RlBQAAAAhyZXNvbHZlcgAAAAA4X+YD", "height": 2264408, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DqfoVpmRY8jiWmQd4x9YTAHCdspbkS51CjLQz6QLLuRh Next: 2DKr2Yn8WA1WGyyLRdQiHUfaEbSP3uBy5s6tXkPrBKMZ Diff:
OldNewDifferences
2222 func key_Records_ttl (node) = key_entity("Records", node, "ttl")
2323
2424
25-func _getOwner (node) = getStringOrThrow(this, key_Records_owner(node))
25+func _getOwner (node) = getString(this, key_Records_owner(node))
2626
2727
2828 func _setOwner (node,owner) = [StringEntry(key_Records_owner(node), owner)]
2929
3030
31+func _getResolver (node) = getString(this, key_Records_resolver(node))
32+
33+
3134 func _setResolver (node,resolver) = [StringEntry(key_Records_resolver(node), resolver)]
3235
3336
34-func _setTTL (node,ttl) = [IntegerEntry(key_Records_ttl(node), ttl)]
37+func isAdmin (inv) = (inv.caller == this)
38+
39+
40+func isOwner (inv,node) = (toString(inv.caller) == valueOrErrorMessage(_getOwner(node), (("Owner for the `" + node) + "` was not found")))
3541
3642
3743 func modifiers (validations) = unit
3844
3945
40-func isSelfCall (inv) = if ((inv.caller == this))
46+func onlyAdmin (inv) = if (isAdmin(inv))
4147 then unit
4248 else throw("Permission denied")
4349
4450
45-func isSelfOrOwnerCall (inv,node) = if (isDefined(indexOf([this, parseAddressOrThrow(_getOwner(node))], inv.caller)))
51+func onlyOwner (inv,node) = if (if (isAdmin(inv))
52+ then true
53+ else isOwner(inv, node))
4654 then unit
4755 else throw("Permission denied")
4856
4957
5058 @Callable(inv)
51-func setOwner (node,owner) = valueOrElse(modifiers([isSelfOrOwnerCall(inv, node)]), _setOwner(node, owner))
59+func setOwner (node,owner) = valueOrElse(modifiers([onlyOwner(inv, node)]), _setOwner(node, owner))
5260
5361
5462
5866
5967
6068 @Callable(inv)
61-func setResolver (node,resolver) = valueOrElse(modifiers([isSelfOrOwnerCall(inv, node)]), _setResolver(node, resolver))
69+func setResolver (node,resolver) = valueOrElse(modifiers([onlyOwner(inv, node)]), _setResolver(node, resolver))
6270
6371
6472
6573 @Callable(inv)
66-func resolver (node) = $Tuple2(nil, getStringOrThrow(this, key_Records_resolver(node)))
74+func resolver (node) = $Tuple2(nil, _getResolver(node))
6775
6876
6977
7078 @Callable(inv)
71-func setTTL (node,ttl) = valueOrElse(modifiers([isSelfOrOwnerCall(inv, node)]), _setTTL(node, ttl))
72-
73-
74-
75-@Callable(inv)
76-func ttl (node) = $Tuple2(nil, getIntegerOrThrow(this, key_Records_ttl(node)))
77-
78-
79-
80-@Callable(inv)
81-func setRecord (node,owner,resolver,ttl) = valueOrElse(modifiers([isSelfCall(inv)]), ((_setOwner(node, owner) ++ _setResolver(node, resolver)) ++ _setTTL(node, ttl)))
79+func setRecord (node,owner,resolver) = valueOrElse(modifiers([onlyAdmin(inv)]), (_setOwner(node, owner) ++ _setResolver(node, resolver)))
8280
8381
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_Records_owner (node) = key_entity("Records", node, "owner")
1717
1818
1919 func key_Records_resolver (node) = key_entity("Records", node, "resolver")
2020
2121
2222 func key_Records_ttl (node) = key_entity("Records", node, "ttl")
2323
2424
25-func _getOwner (node) = getStringOrThrow(this, key_Records_owner(node))
25+func _getOwner (node) = getString(this, key_Records_owner(node))
2626
2727
2828 func _setOwner (node,owner) = [StringEntry(key_Records_owner(node), owner)]
2929
3030
31+func _getResolver (node) = getString(this, key_Records_resolver(node))
32+
33+
3134 func _setResolver (node,resolver) = [StringEntry(key_Records_resolver(node), resolver)]
3235
3336
34-func _setTTL (node,ttl) = [IntegerEntry(key_Records_ttl(node), ttl)]
37+func isAdmin (inv) = (inv.caller == this)
38+
39+
40+func isOwner (inv,node) = (toString(inv.caller) == valueOrErrorMessage(_getOwner(node), (("Owner for the `" + node) + "` was not found")))
3541
3642
3743 func modifiers (validations) = unit
3844
3945
40-func isSelfCall (inv) = if ((inv.caller == this))
46+func onlyAdmin (inv) = if (isAdmin(inv))
4147 then unit
4248 else throw("Permission denied")
4349
4450
45-func isSelfOrOwnerCall (inv,node) = if (isDefined(indexOf([this, parseAddressOrThrow(_getOwner(node))], inv.caller)))
51+func onlyOwner (inv,node) = if (if (isAdmin(inv))
52+ then true
53+ else isOwner(inv, node))
4654 then unit
4755 else throw("Permission denied")
4856
4957
5058 @Callable(inv)
51-func setOwner (node,owner) = valueOrElse(modifiers([isSelfOrOwnerCall(inv, node)]), _setOwner(node, owner))
59+func setOwner (node,owner) = valueOrElse(modifiers([onlyOwner(inv, node)]), _setOwner(node, owner))
5260
5361
5462
5563 @Callable(inv)
5664 func owner (node) = $Tuple2(nil, _getOwner(node))
5765
5866
5967
6068 @Callable(inv)
61-func setResolver (node,resolver) = valueOrElse(modifiers([isSelfOrOwnerCall(inv, node)]), _setResolver(node, resolver))
69+func setResolver (node,resolver) = valueOrElse(modifiers([onlyOwner(inv, node)]), _setResolver(node, resolver))
6270
6371
6472
6573 @Callable(inv)
66-func resolver (node) = $Tuple2(nil, getStringOrThrow(this, key_Records_resolver(node)))
74+func resolver (node) = $Tuple2(nil, _getResolver(node))
6775
6876
6977
7078 @Callable(inv)
71-func setTTL (node,ttl) = valueOrElse(modifiers([isSelfOrOwnerCall(inv, node)]), _setTTL(node, ttl))
72-
73-
74-
75-@Callable(inv)
76-func ttl (node) = $Tuple2(nil, getIntegerOrThrow(this, key_Records_ttl(node)))
77-
78-
79-
80-@Callable(inv)
81-func setRecord (node,owner,resolver,ttl) = valueOrElse(modifiers([isSelfCall(inv)]), ((_setOwner(node, owner) ++ _setResolver(node, resolver)) ++ _setTTL(node, ttl)))
79+func setRecord (node,owner,resolver) = valueOrElse(modifiers([onlyAdmin(inv)]), (_setOwner(node, owner) ++ _setResolver(node, resolver)))
8280
8381

github/deemru/w8io/026f985 
30.61 ms