tx · DNUK8UyFrero8pZBR8iWxmiB7z6Vt1ZYz83YSYqjezij
3N4upXkARvecPGQAtpSQ11CFASTFsvEPiP2: -0.01000000 Waves
2022.02.25 16:09 [1939197] smart account 3N4upXkARvecPGQAtpSQ11CFASTFsvEPiP2 > SELF 0.00000000 Waves
{
"type": 13,
"id": "DNUK8UyFrero8pZBR8iWxmiB7z6Vt1ZYz83YSYqjezij",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1645794648253,
"version": 2,
"chainId": 84,
"sender": "3N4upXkARvecPGQAtpSQ11CFASTFsvEPiP2",
"senderPublicKey": "5dTGvAkGC1ryvEkRCst923pqULtN3qWs6XXueerWos1D",
"proofs": [
"3KbadchtaPcTGJoY2HWpA6aSVwnmhfEqSDPkgzG9dyqR5Q4iJwaExpGt9mUGqvB7HYWcCD2CUTw7QWiKZkftZSbS"
],
"script": "base64:AAIFAAAAAAAAAA4IAhIECgIICBIECgIICAAAAAUAAAAACXNlcGFyYXRvcgIAAAACX18BAAAAC2tleUxpc3RIZWFkAAAAAQAAAAhsaXN0TmFtZQkABLkAAAACCQAETAAAAAICAAAABCVzJXMJAARMAAAAAgUAAAAIbGlzdE5hbWUJAARMAAAAAgIAAAAEaGVhZAUAAAADbmlsBQAAAAlzZXBhcmF0b3IBAAAAC2tleUxpc3RTaXplAAAAAQAAAAhsaXN0TmFtZQkABLkAAAACCQAETAAAAAICAAAABCVzJXMJAARMAAAAAgUAAAAIbGlzdE5hbWUJAARMAAAAAgIAAAAEc2l6ZQUAAAADbmlsBQAAAAlzZXBhcmF0b3IBAAAAB2tleVByZXYAAAACAAAACGxpc3ROYW1lAAAAAmlkCQAEuQAAAAIJAARMAAAAAgIAAAAGJXMlcyVzCQAETAAAAAIFAAAACGxpc3ROYW1lCQAETAAAAAIFAAAAAmlkCQAETAAAAAICAAAABHByZXYFAAAAA25pbAUAAAAJc2VwYXJhdG9yAQAAAAdrZXlOZXh0AAAAAgAAAAhsaXN0TmFtZQAAAAJpZAkABL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mlsAwkAAAAAAAACBQAAAAJpZAUAAAAEaGVhZAkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAALa2V5TGlzdEhlYWQAAAABBQAAAAhsaXN0TmFtZQUAAAADbmlsCQAAAgAAAAECAAAADEludmFsaWQgbm9kZQkABRQAAAACBQAAAAxzdGF0ZUNoYW5nZXMFAAAABHVuaXQAAAAAKEmf/A==",
"height": 1939197,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: VhTm4Ru152oV8xouxFwFWckBUFCNvzd6em3NvtUq97v
Next: none
Diff:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let keyHead = "head" |
---|
| 4 | + | let separator = "__" |
---|
5 | 5 | | |
---|
6 | | - | let keyListSize = "listSize" |
---|
7 | | - | |
---|
8 | | - | func keyPrev (id) = (id + "__prev") |
---|
| 6 | + | func keyListHead (listName) = makeString(["%s%s", listName, "head"], separator) |
---|
9 | 7 | | |
---|
10 | 8 | | |
---|
11 | | - | func keyNext (id) = (id + "__next") |
---|
| 9 | + | func keyListSize (listName) = makeString(["%s%s", listName, "size"], separator) |
---|
12 | 10 | | |
---|
13 | 11 | | |
---|
14 | | - | let head = getString(this, keyHead) |
---|
| 12 | + | func keyPrev (listName,id) = makeString(["%s%s%s", listName, id, "prev"], separator) |
---|
15 | 13 | | |
---|
16 | | - | let listSize = valueOrElse(getInteger(this, keyListSize), 0) |
---|
| 14 | + | |
---|
| 15 | + | func keyNext (listName,id) = makeString(["%s%s%s", listName, id, "next"], separator) |
---|
| 16 | + | |
---|
17 | 17 | | |
---|
18 | 18 | | @Callable(i) |
---|
19 | | - | func insert (id) = { |
---|
20 | | - | let prev = getString(this, keyPrev(id)) |
---|
21 | | - | let next = getString(this, keyNext(id)) |
---|
| 19 | + | func insert (listName,id) = { |
---|
| 20 | + | let head = getString(this, keyListHead(listName)) |
---|
| 21 | + | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) |
---|
| 22 | + | let prev = getString(this, keyPrev(listName, id)) |
---|
| 23 | + | let next = getString(this, keyNext(listName, id)) |
---|
22 | 24 | | let checkNode = if (if (if ((id != head)) |
---|
23 | 25 | | then (prev == unit) |
---|
24 | 26 | | else false) |
---|
|
28 | 30 | | else throw("Node exists") |
---|
29 | 31 | | if ((checkNode == checkNode)) |
---|
30 | 32 | | then { |
---|
31 | | - | let stateChanges = (([IntegerEntry(keyListSize, (listSize + 1))] ++ (if (isDefined(head)) |
---|
32 | | - | then [StringEntry(keyNext(id), value(head)), StringEntry(keyPrev(value(head)), id)] |
---|
33 | | - | else nil)) ++ [StringEntry(keyHead, id)]) |
---|
| 33 | + | let stateChanges = (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if (isDefined(head)) |
---|
| 34 | + | then [StringEntry(keyNext(listName, id), value(head)), StringEntry(keyPrev(listName, value(head)), id)] |
---|
| 35 | + | else nil)) ++ [StringEntry(keyListHead(listName), id)]) |
---|
34 | 36 | | $Tuple2(stateChanges, unit) |
---|
35 | 37 | | } |
---|
36 | 38 | | else throw("Strict value is not equal to itself.") |
---|
|
39 | 41 | | |
---|
40 | 42 | | |
---|
41 | 43 | | @Callable(i) |
---|
42 | | - | func delete (id) = { |
---|
43 | | - | let prev = getString(this, keyPrev(id)) |
---|
44 | | - | let next = getString(this, keyNext(id)) |
---|
45 | | - | let stateChanges = ([IntegerEntry(keyListSize, (listSize - 1))] ++ (if (if (isDefined(prev)) |
---|
| 44 | + | func delete (listName,id) = { |
---|
| 45 | + | let head = getString(this, keyListHead(listName)) |
---|
| 46 | + | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) |
---|
| 47 | + | let prev = getString(this, keyPrev(listName, id)) |
---|
| 48 | + | let next = getString(this, keyNext(listName, id)) |
---|
| 49 | + | let stateChanges = ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if (isDefined(prev)) |
---|
46 | 50 | | then isDefined(next) |
---|
47 | 51 | | else false) |
---|
48 | | - | then [StringEntry(keyNext(value(prev)), value(next)), StringEntry(keyPrev(value(next)), value(prev)), DeleteEntry(keyPrev(id)), DeleteEntry(keyNext(id))] |
---|
| 52 | + | then [StringEntry(keyNext(listName, value(prev)), value(next)), StringEntry(keyPrev(listName, value(next)), value(prev)), DeleteEntry(keyPrev(listName, id)), DeleteEntry(keyNext(listName, id))] |
---|
49 | 53 | | else if (isDefined(next)) |
---|
50 | | - | then [StringEntry(keyHead, value(next)), DeleteEntry(keyNext(id)), DeleteEntry(keyPrev(value(next)))] |
---|
| 54 | + | then [StringEntry(keyListHead(listName), value(next)), DeleteEntry(keyNext(listName, id)), DeleteEntry(keyPrev(listName, value(next)))] |
---|
51 | 55 | | else if (isDefined(prev)) |
---|
52 | | - | then [DeleteEntry(keyPrev(id)), DeleteEntry(keyNext(value(prev)))] |
---|
| 56 | + | then [DeleteEntry(keyPrev(listName, id)), DeleteEntry(keyNext(listName, value(prev)))] |
---|
53 | 57 | | else if ((id == head)) |
---|
54 | | - | then [DeleteEntry(keyHead)] |
---|
| 58 | + | then [DeleteEntry(keyListHead(listName))] |
---|
55 | 59 | | else throw("Invalid node"))) |
---|
56 | 60 | | $Tuple2(stateChanges, unit) |
---|
57 | 61 | | } |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let keyHead = "head" |
---|
| 4 | + | let separator = "__" |
---|
5 | 5 | | |
---|
6 | | - | let keyListSize = "listSize" |
---|
7 | | - | |
---|
8 | | - | func keyPrev (id) = (id + "__prev") |
---|
| 6 | + | func keyListHead (listName) = makeString(["%s%s", listName, "head"], separator) |
---|
9 | 7 | | |
---|
10 | 8 | | |
---|
11 | | - | func keyNext (id) = (id + "__next") |
---|
| 9 | + | func keyListSize (listName) = makeString(["%s%s", listName, "size"], separator) |
---|
12 | 10 | | |
---|
13 | 11 | | |
---|
14 | | - | let head = getString(this, keyHead) |
---|
| 12 | + | func keyPrev (listName,id) = makeString(["%s%s%s", listName, id, "prev"], separator) |
---|
15 | 13 | | |
---|
16 | | - | let listSize = valueOrElse(getInteger(this, keyListSize), 0) |
---|
| 14 | + | |
---|
| 15 | + | func keyNext (listName,id) = makeString(["%s%s%s", listName, id, "next"], separator) |
---|
| 16 | + | |
---|
17 | 17 | | |
---|
18 | 18 | | @Callable(i) |
---|
19 | | - | func insert (id) = { |
---|
20 | | - | let prev = getString(this, keyPrev(id)) |
---|
21 | | - | let next = getString(this, keyNext(id)) |
---|
| 19 | + | func insert (listName,id) = { |
---|
| 20 | + | let head = getString(this, keyListHead(listName)) |
---|
| 21 | + | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) |
---|
| 22 | + | let prev = getString(this, keyPrev(listName, id)) |
---|
| 23 | + | let next = getString(this, keyNext(listName, id)) |
---|
22 | 24 | | let checkNode = if (if (if ((id != head)) |
---|
23 | 25 | | then (prev == unit) |
---|
24 | 26 | | else false) |
---|
25 | 27 | | then (next == unit) |
---|
26 | 28 | | else false) |
---|
27 | 29 | | then true |
---|
28 | 30 | | else throw("Node exists") |
---|
29 | 31 | | if ((checkNode == checkNode)) |
---|
30 | 32 | | then { |
---|
31 | | - | let stateChanges = (([IntegerEntry(keyListSize, (listSize + 1))] ++ (if (isDefined(head)) |
---|
32 | | - | then [StringEntry(keyNext(id), value(head)), StringEntry(keyPrev(value(head)), id)] |
---|
33 | | - | else nil)) ++ [StringEntry(keyHead, id)]) |
---|
| 33 | + | let stateChanges = (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if (isDefined(head)) |
---|
| 34 | + | then [StringEntry(keyNext(listName, id), value(head)), StringEntry(keyPrev(listName, value(head)), id)] |
---|
| 35 | + | else nil)) ++ [StringEntry(keyListHead(listName), id)]) |
---|
34 | 36 | | $Tuple2(stateChanges, unit) |
---|
35 | 37 | | } |
---|
36 | 38 | | else throw("Strict value is not equal to itself.") |
---|
37 | 39 | | } |
---|
38 | 40 | | |
---|
39 | 41 | | |
---|
40 | 42 | | |
---|
41 | 43 | | @Callable(i) |
---|
42 | | - | func delete (id) = { |
---|
43 | | - | let prev = getString(this, keyPrev(id)) |
---|
44 | | - | let next = getString(this, keyNext(id)) |
---|
45 | | - | let stateChanges = ([IntegerEntry(keyListSize, (listSize - 1))] ++ (if (if (isDefined(prev)) |
---|
| 44 | + | func delete (listName,id) = { |
---|
| 45 | + | let head = getString(this, keyListHead(listName)) |
---|
| 46 | + | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) |
---|
| 47 | + | let prev = getString(this, keyPrev(listName, id)) |
---|
| 48 | + | let next = getString(this, keyNext(listName, id)) |
---|
| 49 | + | let stateChanges = ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if (isDefined(prev)) |
---|
46 | 50 | | then isDefined(next) |
---|
47 | 51 | | else false) |
---|
48 | | - | then [StringEntry(keyNext(value(prev)), value(next)), StringEntry(keyPrev(value(next)), value(prev)), DeleteEntry(keyPrev(id)), DeleteEntry(keyNext(id))] |
---|
| 52 | + | then [StringEntry(keyNext(listName, value(prev)), value(next)), StringEntry(keyPrev(listName, value(next)), value(prev)), DeleteEntry(keyPrev(listName, id)), DeleteEntry(keyNext(listName, id))] |
---|
49 | 53 | | else if (isDefined(next)) |
---|
50 | | - | then [StringEntry(keyHead, value(next)), DeleteEntry(keyNext(id)), DeleteEntry(keyPrev(value(next)))] |
---|
| 54 | + | then [StringEntry(keyListHead(listName), value(next)), DeleteEntry(keyNext(listName, id)), DeleteEntry(keyPrev(listName, value(next)))] |
---|
51 | 55 | | else if (isDefined(prev)) |
---|
52 | | - | then [DeleteEntry(keyPrev(id)), DeleteEntry(keyNext(value(prev)))] |
---|
| 56 | + | then [DeleteEntry(keyPrev(listName, id)), DeleteEntry(keyNext(listName, value(prev)))] |
---|
53 | 57 | | else if ((id == head)) |
---|
54 | | - | then [DeleteEntry(keyHead)] |
---|
| 58 | + | then [DeleteEntry(keyListHead(listName))] |
---|
55 | 59 | | else throw("Invalid node"))) |
---|
56 | 60 | | $Tuple2(stateChanges, unit) |
---|
57 | 61 | | } |
---|
58 | 62 | | |
---|
59 | 63 | | |
---|