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:AAIFAAAAAAAAAA4IAhIECgIICBIECgIICAAAAAUAAAAACXNlcGFyYXRvcgIAAAACX18BAAAAC2tleUxpc3RIZWFkAAAAAQAAAAhsaXN0TmFtZQkABLkAAAACCQAETAAAAAICAAAABCVzJXMJAARMAAAAAgUAAAAIbGlzdE5hbWUJAARMAAAAAgIAAAAEaGVhZAUAAAADbmlsBQAAAAlzZXBhcmF0b3IBAAAAC2tleUxpc3RTaXplAAAAAQAAAAhsaXN0TmFtZQkABLkAAAACCQAETAAAAAICAAAABCVzJXMJAARMAAAAAgUAAAAIbGlzdE5hbWUJAARMAAAAAgIAAAAEc2l6ZQUAAAADbmlsBQAAAAlzZXBhcmF0b3IBAAAAB2tleVByZXYAAAACAAAACGxpc3ROYW1lAAAAAmlkCQAEuQAAAAIJAARMAAAAAgIAAAAGJXMlcyVzCQAETAAAAAIFAAAACGxpc3ROYW1lCQAETAAAAAIFAAAAAmlkCQAETAAAAAICAAAABHByZXYFAAAAA25pbAUAAAAJc2VwYXJhdG9yAQAAAAdrZXlOZXh0AAAAAgAAAAhsaXN0TmFtZQAAAAJpZAkABLkAAAACCQAET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AAAAACBQAAAAJpZAUAAAAEaGVhZAkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAALa2V5TGlzdEhlYWQAAAABBQAAAAhsaXN0TmFtZQUAAAADbmlsCQAAAgAAAAECAAAADEludmFsaWQgbm9kZQkABRQAAAACBQAAAAxzdGF0ZUNoYW5nZXMFAAAABHVuaXQAAAAAKEmf/A==", "height": 1939197, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: VhTm4Ru152oV8xouxFwFWckBUFCNvzd6em3NvtUq97v Next: none Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let keyHead = "head"
4+let separator = "__"
55
6-let keyListSize = "listSize"
7-
8-func keyPrev (id) = (id + "__prev")
6+func keyListHead (listName) = makeString(["%s%s", listName, "head"], separator)
97
108
11-func keyNext (id) = (id + "__next")
9+func keyListSize (listName) = makeString(["%s%s", listName, "size"], separator)
1210
1311
14-let head = getString(this, keyHead)
12+func keyPrev (listName,id) = makeString(["%s%s%s", listName, id, "prev"], separator)
1513
16-let listSize = valueOrElse(getInteger(this, keyListSize), 0)
14+
15+func keyNext (listName,id) = makeString(["%s%s%s", listName, id, "next"], separator)
16+
1717
1818 @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))
2224 let checkNode = if (if (if ((id != head))
2325 then (prev == unit)
2426 else false)
2830 else throw("Node exists")
2931 if ((checkNode == checkNode))
3032 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)])
3436 $Tuple2(stateChanges, unit)
3537 }
3638 else throw("Strict value is not equal to itself.")
3941
4042
4143 @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))
4650 then isDefined(next)
4751 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))]
4953 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)))]
5155 else if (isDefined(prev))
52- then [DeleteEntry(keyPrev(id)), DeleteEntry(keyNext(value(prev)))]
56+ then [DeleteEntry(keyPrev(listName, id)), DeleteEntry(keyNext(listName, value(prev)))]
5357 else if ((id == head))
54- then [DeleteEntry(keyHead)]
58+ then [DeleteEntry(keyListHead(listName))]
5559 else throw("Invalid node")))
5660 $Tuple2(stateChanges, unit)
5761 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let keyHead = "head"
4+let separator = "__"
55
6-let keyListSize = "listSize"
7-
8-func keyPrev (id) = (id + "__prev")
6+func keyListHead (listName) = makeString(["%s%s", listName, "head"], separator)
97
108
11-func keyNext (id) = (id + "__next")
9+func keyListSize (listName) = makeString(["%s%s", listName, "size"], separator)
1210
1311
14-let head = getString(this, keyHead)
12+func keyPrev (listName,id) = makeString(["%s%s%s", listName, id, "prev"], separator)
1513
16-let listSize = valueOrElse(getInteger(this, keyListSize), 0)
14+
15+func keyNext (listName,id) = makeString(["%s%s%s", listName, id, "next"], separator)
16+
1717
1818 @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))
2224 let checkNode = if (if (if ((id != head))
2325 then (prev == unit)
2426 else false)
2527 then (next == unit)
2628 else false)
2729 then true
2830 else throw("Node exists")
2931 if ((checkNode == checkNode))
3032 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)])
3436 $Tuple2(stateChanges, unit)
3537 }
3638 else throw("Strict value is not equal to itself.")
3739 }
3840
3941
4042
4143 @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))
4650 then isDefined(next)
4751 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))]
4953 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)))]
5155 else if (isDefined(prev))
52- then [DeleteEntry(keyPrev(id)), DeleteEntry(keyNext(value(prev)))]
56+ then [DeleteEntry(keyPrev(listName, id)), DeleteEntry(keyNext(listName, value(prev)))]
5357 else if ((id == head))
54- then [DeleteEntry(keyHead)]
58+ then [DeleteEntry(keyListHead(listName))]
5559 else throw("Invalid node")))
5660 $Tuple2(stateChanges, unit)
5761 }
5862
5963

github/deemru/w8io/169f3d6 
38.38 ms