tx · 89qDxPZ5dGY41vX2PPfezQgysh8wfvbhY4NXD9noH17J

3N4upXkARvecPGQAtpSQ11CFASTFsvEPiP2:  -0.01000000 Waves

2022.02.22 12:31 [1934686] smart account 3N4upXkARvecPGQAtpSQ11CFASTFsvEPiP2 > SELF 0.00000000 Waves

{ "type": 13, "id": "89qDxPZ5dGY41vX2PPfezQgysh8wfvbhY4NXD9noH17J", "fee": 1000000, "feeAssetId": null, "timestamp": 1645522282177, "version": 2, "chainId": 84, "sender": "3N4upXkARvecPGQAtpSQ11CFASTFsvEPiP2", "senderPublicKey": "5dTGvAkGC1ryvEkRCst923pqULtN3qWs6XXueerWos1D", "proofs": [ "jNEgAmPfp5LkByL9HDMoyZyXTy5BSU8pb5ESCqpnPkCtn7PmbfAzAkTGLLTohBVMhGDHokthEbQDPetQXS7ZQkA" ], "script": "base64:AAIFAAAAAAAAAAwIAhIDCgEIEgMKAQgAAAAEAAAAAAdrZXlIZWFkAgAAAARoZWFkAQAAAAdrZXlQcmV2AAAAAQAAAAJpZAkAASwAAAACBQAAAAJpZAIAAAAGX19wcmV2AQAAAAdrZXlOZXh0AAAAAQAAAAJpZAkAASwAAAACBQAAAAJpZAIAAAAGX19uZXh0AAAAAARoZWFkCQAEHQAAAAIFAAAABHRoaXMFAAAAB2tleUhlYWQAAAACAAAAAWkBAAAABmluc2VydAAAAAEAAAACaWQEAAAADHN0YXRlQ2hhbmdlcwkABE4AAAACCQAETgAAAAIFAAAAA25pbAMJAQAAAAlpc0RlZmluZWQAAAABBQAAAARoZWFkCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAQAAAAdrZXlOZXh0AAAAAQUAAAACaWQJAQAAAAV2YWx1ZQAAAAEFAAAABGhlYWQJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkBAAAAB2tleVByZXYAAAABCQEAAAAFdmFsdWUAAAABBQAAAARoZWFkBQAAAAJpZAUAAAADbmlsBQAAAANuaWwJAARMAAAAAgkBAA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DCQEAAAAJaXNEZWZpbmVkAAAAAQUAAAAEcHJldgkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAAHa2V5UHJldgAAAAEFAAAAAmlkCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAQAAAAdrZXlOZXh0AAAAAQkBAAAABXZhbHVlAAAAAQUAAAAEcHJldgUAAAADbmlsAwkAAAAAAAACBQAAAAJpZAUAAAAEaGVhZAkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAAdrZXlIZWFkBQAAAANuaWwJAAACAAAAAQIAAAAMSW52YWxpZCBub2RlCQAFFAAAAAIFAAAADHN0YXRlQ2hhbmdlcwUAAAAEdW5pdAAAAABu8F2h", "height": 1934686, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: TFnwoHWWX5STpJhde4Bo8LQ1Zyj5igTxWNZ2cgzCXm5 Next: CqxKxLgE9WGTo23kyKgAah2N8qP22fm6jyggB4NtWzzp Diff:
OldNewDifferences
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let keyHead = "head"
5+
6+func keyPrev (id) = (id + "__prev")
7+
8+
9+func keyNext (id) = (id + "__next")
10+
511
612 let head = getString(this, keyHead)
713
814 @Callable(i)
915 func insert (id) = {
1016 let stateChanges = ((nil ++ (if (isDefined(head))
11- then [StringEntry((id + "__next"), value(head)), StringEntry((value(head) + "__prev"), id)]
17+ then [StringEntry(keyNext(id), value(head)), StringEntry(keyPrev(value(head)), id)]
1218 else nil)) ++ [StringEntry(keyHead, id)])
1319 $Tuple2(stateChanges, unit)
1420 }
1723
1824 @Callable(i)
1925 func delete (id) = {
20- let stateChanges = ((nil ++ (if (isDefined(head))
21- then [StringEntry((id + "_next"), value(head))]
22- else nil)) ++ [StringEntry(keyHead, id)])
26+ let prev = getString(this, keyPrev(id))
27+ let next = getString(this, keyNext(id))
28+ let stateChanges = if (if (isDefined(prev))
29+ then isDefined(next)
30+ else false)
31+ then [StringEntry(keyNext(value(prev)), value(next)), StringEntry(keyPrev(value(next)), value(prev)), DeleteEntry(keyPrev(id)), DeleteEntry(keyNext(id))]
32+ else if (isDefined(next))
33+ then [StringEntry(keyHead, value(next)), DeleteEntry(keyNext(id)), DeleteEntry(keyPrev(value(next)))]
34+ else if (isDefined(prev))
35+ then [DeleteEntry(keyPrev(id)), DeleteEntry(keyNext(value(prev)))]
36+ else if ((id == head))
37+ then [DeleteEntry(keyHead)]
38+ else throw("Invalid node")
2339 $Tuple2(stateChanges, unit)
2440 }
2541
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let keyHead = "head"
5+
6+func keyPrev (id) = (id + "__prev")
7+
8+
9+func keyNext (id) = (id + "__next")
10+
511
612 let head = getString(this, keyHead)
713
814 @Callable(i)
915 func insert (id) = {
1016 let stateChanges = ((nil ++ (if (isDefined(head))
11- then [StringEntry((id + "__next"), value(head)), StringEntry((value(head) + "__prev"), id)]
17+ then [StringEntry(keyNext(id), value(head)), StringEntry(keyPrev(value(head)), id)]
1218 else nil)) ++ [StringEntry(keyHead, id)])
1319 $Tuple2(stateChanges, unit)
1420 }
1521
1622
1723
1824 @Callable(i)
1925 func delete (id) = {
20- let stateChanges = ((nil ++ (if (isDefined(head))
21- then [StringEntry((id + "_next"), value(head))]
22- else nil)) ++ [StringEntry(keyHead, id)])
26+ let prev = getString(this, keyPrev(id))
27+ let next = getString(this, keyNext(id))
28+ let stateChanges = if (if (isDefined(prev))
29+ then isDefined(next)
30+ else false)
31+ then [StringEntry(keyNext(value(prev)), value(next)), StringEntry(keyPrev(value(next)), value(prev)), DeleteEntry(keyPrev(id)), DeleteEntry(keyNext(id))]
32+ else if (isDefined(next))
33+ then [StringEntry(keyHead, value(next)), DeleteEntry(keyNext(id)), DeleteEntry(keyPrev(value(next)))]
34+ else if (isDefined(prev))
35+ then [DeleteEntry(keyPrev(id)), DeleteEntry(keyNext(value(prev)))]
36+ else if ((id == head))
37+ then [DeleteEntry(keyHead)]
38+ else throw("Invalid node")
2339 $Tuple2(stateChanges, unit)
2440 }
2541
2642

github/deemru/w8io/169f3d6 
51.55 ms