tx · 4T3gTomtqU3JT5KDW6U14t2FfTaPPViKgFhFg6A5Pe94
3MrkN6oPxUnKSE6dWPcZpCKvxMop2J6RZnU: -0.01300000 Waves
2023.05.10 13:15 [2571655] smart account 3MrkN6oPxUnKSE6dWPcZpCKvxMop2J6RZnU > SELF 0.00000000 Waves
{
"type": 13,
"id": "4T3gTomtqU3JT5KDW6U14t2FfTaPPViKgFhFg6A5Pe94",
"fee": 1300000,
"feeAssetId": null,
"timestamp": 1683713766952,
"version": 2,
"chainId": 84,
"sender": "3MrkN6oPxUnKSE6dWPcZpCKvxMop2J6RZnU",
"senderPublicKey": "6rcTS9tjxpHUnn2Q3Qsx6QVR9pQBBPt3id4bgSfbQ5Uo",
"proofs": [
"5tjBWG8oMuZvZpbQfwv7FyAuRHinM1BzotP6zuk2XLR46z5onALEJKJWkWRCQQhohkXTKgn1kx8r5xz7uG6yfWxu"
],
"script": "base64:AAIFAAAAAAAAALsIAiITa2V5TWFuYWdlclB1YmxpY0tleSIWa2V5TWFuYWdlclZhdWx0QWRkcmVzcyIcZ2V0TWFuYWdlclZhdWx0QWRkcmVzc09yVGhpcyIHJG1hdGNoMCIBcyIWbWFuYWdlclB1YmxpY0tleU9yVW5pdCITbWFuYWdlclZhdWx0QWRkcmVzcyILbXVzdE1hbmFnZXIiAWkiAnBkIgJwayICdHgiBnZlcmlmeSIPdGFyZ2V0UHVibGljS2V5AAAABQEAAAABYQAAAAACAAAAFCVzX19tYW5hZ2VyUHVibGljS2V5AQAAAAFiAAAAAAIAAAAXJXNfX21hbmFnZXJWYXVsdEFkZHJlc3MBAAAAAWMAAAAABAAAAAFkCQAEIgAAAAEJAQAAAAFiAAAAAAMJAAABAAAAAgUAAAABZAIAAAAGU3RyaW5nBAAAAAFlBQAAAAFkCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAFlBQAAAAR0aGlzAQAAAAFmAAAAAAQAAAABZwkBAAAAAWMAAAAABAAAAAFkCQAEHQAAAAIFAAAAAWcJAQAAAAFhAAAAAAMJAAABAAAAAgUAAAABZAIAAAAGU3RyaW5nBAAAAAFlBQAAAAFkCQACWQAAAAEFAAAAAWUDCQAAAQAAAAIFAAAAAWQCAAAABFVuaXQFAAAABHVuaXQJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IBAAAAAWgAAAABAAAAAWkEAAAAAWoJAAACAAAAAQIAAAARUGVybWlzc2lvbiBkZW5pZWQEAAAAAWQJAQAAAAFmAAAAAAMJAAABAAAAAgUAAAABZAIAAAAKQnl0ZVZlY3RvcgQAAAABawUAAAABZAMJAAAAAAAAAggFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5BQAAAAFrBgUAAAABagMJAAABAAAAAgUAAAABZAIAAAAEVW5pdAMJAAAAAAAAAggFAAAAAWkAAAAGY2FsbGVyBQAAAAR0aGlzBgUAAAABagkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgAAAAAAAAABAAAAAWwBAAAAAW0AAAAABAAAAAFuBAAAAAFkCQEAAAABZgAAAAADCQAAAQAAAAIFAAAAAWQCAAAACkJ5dGVWZWN0b3IEAAAAAWsFAAAAAWQFAAAAAWsDCQAAAQAAAAIFAAAAAWQCAAAABFVuaXQIBQAAAAFsAAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgkAAfQAAAADCAUAAAABbAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAWwAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAFuM9K62w==",
"height": 2571655,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: DnoMgAVcekedEUj6xfMJeARr9g2kuUNik525HBmgQvHV
Next: none
Diff:
Old | New | | Differences |
---|
7 | 7 | | func keyManagerVaultAddress () = "%s__managerVaultAddress" |
---|
8 | 8 | | |
---|
9 | 9 | | |
---|
10 | | - | func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress())) |
---|
| 10 | + | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { |
---|
| 11 | + | case s: String => |
---|
| 12 | + | addressFromStringValue(s) |
---|
| 13 | + | case _ => |
---|
| 14 | + | this |
---|
| 15 | + | } |
---|
11 | 16 | | |
---|
12 | 17 | | |
---|
13 | 18 | | func managerPublicKeyOrUnit () = { |
---|
14 | | - | let managerVaultAddress = getManagerAddressOrFail() |
---|
| 19 | + | let managerVaultAddress = getManagerVaultAddressOrThis() |
---|
15 | 20 | | match getString(managerVaultAddress, keyManagerPublicKey()) { |
---|
16 | 21 | | case s: String => |
---|
17 | 22 | | fromBase58String(s) |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | func keyManagerPublicKey () = "%s__managerPublicKey" |
---|
5 | 5 | | |
---|
6 | 6 | | |
---|
7 | 7 | | func keyManagerVaultAddress () = "%s__managerVaultAddress" |
---|
8 | 8 | | |
---|
9 | 9 | | |
---|
10 | | - | func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress())) |
---|
| 10 | + | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { |
---|
| 11 | + | case s: String => |
---|
| 12 | + | addressFromStringValue(s) |
---|
| 13 | + | case _ => |
---|
| 14 | + | this |
---|
| 15 | + | } |
---|
11 | 16 | | |
---|
12 | 17 | | |
---|
13 | 18 | | func managerPublicKeyOrUnit () = { |
---|
14 | | - | let managerVaultAddress = getManagerAddressOrFail() |
---|
| 19 | + | let managerVaultAddress = getManagerVaultAddressOrThis() |
---|
15 | 20 | | match getString(managerVaultAddress, keyManagerPublicKey()) { |
---|
16 | 21 | | case s: String => |
---|
17 | 22 | | fromBase58String(s) |
---|
18 | 23 | | case _: Unit => |
---|
19 | 24 | | unit |
---|
20 | 25 | | case _ => |
---|
21 | 26 | | throw("Match error") |
---|
22 | 27 | | } |
---|
23 | 28 | | } |
---|
24 | 29 | | |
---|
25 | 30 | | |
---|
26 | 31 | | func mustManager (i) = { |
---|
27 | 32 | | let pd = throw("Permission denied") |
---|
28 | 33 | | match managerPublicKeyOrUnit() { |
---|
29 | 34 | | case pk: ByteVector => |
---|
30 | 35 | | if ((i.callerPublicKey == pk)) |
---|
31 | 36 | | then true |
---|
32 | 37 | | else pd |
---|
33 | 38 | | case _: Unit => |
---|
34 | 39 | | if ((i.caller == this)) |
---|
35 | 40 | | then true |
---|
36 | 41 | | else pd |
---|
37 | 42 | | case _ => |
---|
38 | 43 | | throw("Match error") |
---|
39 | 44 | | } |
---|
40 | 45 | | } |
---|
41 | 46 | | |
---|
42 | 47 | | |
---|
43 | 48 | | |
---|
44 | 49 | | @Verifier(tx) |
---|
45 | 50 | | func verify () = { |
---|
46 | 51 | | let targetPublicKey = match managerPublicKeyOrUnit() { |
---|
47 | 52 | | case pk: ByteVector => |
---|
48 | 53 | | pk |
---|
49 | 54 | | case _: Unit => |
---|
50 | 55 | | tx.senderPublicKey |
---|
51 | 56 | | case _ => |
---|
52 | 57 | | throw("Match error") |
---|
53 | 58 | | } |
---|
54 | 59 | | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) |
---|
55 | 60 | | } |
---|
56 | 61 | | |
---|