tx · DND6qwR2TWcVfdF6KxrbcfBDxXcxp5jHScLAbveYHqTa

3N3fgxZPoUjQLkMa8cjGFGwQ6FPpdFCkMip:  -0.00600000 Waves

2022.09.16 18:49 [2231867] smart account 3N3fgxZPoUjQLkMa8cjGFGwQ6FPpdFCkMip > SELF 0.00000000 Waves

{ "type": 13, "id": "DND6qwR2TWcVfdF6KxrbcfBDxXcxp5jHScLAbveYHqTa", "fee": 600000, "feeAssetId": null, "timestamp": 1663343395531, "version": 2, "chainId": 84, "sender": "3N3fgxZPoUjQLkMa8cjGFGwQ6FPpdFCkMip", "senderPublicKey": "5JCXCMFAS5rwKAESK1SqAfhuupWEYWbspuyHFvisUiVX", "proofs": [ "4JwTQNMQGJ9ef2jRBnx8NjLjcFmDLUirfeqGy28ETkcVaBD8TKaZNKTjuZn4vJv2RZkWtcuVXQCnK4RPx5F7b9Bz" ], "script": "base64:AAIFAAAAAAAAAAoIAhIGCgQBCAgBAAAAAAAAAAEAAAABaQEAAAAOZmxhc2hMaXF1aWRhdGUAAAAEAAAACWRpcmVjdGlvbgAAAAZtYXJrZXQAAAASYWRkcmVzc1RvTGlxdWlkYXRlAAAACGxldmVyYWdlBAAAAAdhc3NldElkAQAAACD3dur394PKZdtuE+4CO89YKZWpwdGN8kvabNgdYoDI3gQAAAAIY29udHJhY3QJAQAAAAdBZGRyZXNzAAAAAQkAAlkAAAABBQAAAAZtYXJrZXQEAAAADWVudGVyUG9zaXRpb24JAAP8AAAABAUAAAAIY29udHJhY3QCAAAAEGluY3JlYXNlUG9zaXRpb24JAARMAAAAAgUAAAAJZGlyZWN0aW9uCQAETAAAAAIFAAAACGxldmVyYWdlCQAETAAAAAIAAAAAAAAAAAEJAARMAAAAAgIAAAAABQAAAANuaWwJAARMAAAAAgkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAUAAAADbmlsAwkAAAAAAAACBQAAAA1lbnRlclBvc2l0aW9uBQAAAA1lbnRlclBvc2l0aW9uBAAAAAtsaXF1aWRhdGlvbgkAA/wAAAAEBQAAAAhjb250cmFjdAIAAAAJbGlxdWlkYXRlCQAETAAAAAIFAAAAEmFkZHJlc3NUb0xpcXVpZGF0ZQUAAAADbmlsBQAAAANuaWwDCQAAAAAAAAIFAAAAC2xpcXVpZGF0aW9uBQAAAAtsaXF1aWRhdGlvbgQAAAANY2xvc2VQb3NpdGlvbgkAA/wAAAAEBQAAAAhjb250cmFjdAIAAAANY2xvc2VQb3NpdGlvbgUAAAADbmlsBQAAAANuaWwDCQAAAAAAAAIFAAAADWNsb3NlUG9zaXRpb24FAAAADWNsb3NlUG9zaXRpb24EAAAABmFtb3VudAkAA/AAAAACBQAAAAR0aGlzBQAAAAdhc3NldElkAwkAAAAAAAACBQAAAAZhbW91bnQFAAAABmFtb3VudAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAABmFtb3VudAUAAAAHYXNzZXRJZAUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5avEvzQ==", "height": 2231867, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8BWM1Ebhfwd9cMK51agCCruBsA5eAY1Tw34BZt8ANVTM Next: none Diff:
OldNewDifferences
55
66 @Callable(i)
77 func flashLiquidate (direction,market,addressToLiquidate,leverage) = {
8+ let assetId = base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ'
89 let contract = Address(fromBase58String(market))
910 let enterPosition = invoke(contract, "increasePosition", [direction, leverage, 1, ""], [i.payments[0]])
1011 if ((enterPosition == enterPosition))
1415 then {
1516 let closePosition = invoke(contract, "closePosition", nil, nil)
1617 if ((closePosition == closePosition))
17- then nil
18+ then {
19+ let amount = assetBalance(this, assetId)
20+ if ((amount == amount))
21+ then [ScriptTransfer(i.caller, amount, assetId)]
22+ else throw("Strict value is not equal to itself.")
23+ }
1824 else throw("Strict value is not equal to itself.")
1925 }
2026 else throw("Strict value is not equal to itself.")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func flashLiquidate (direction,market,addressToLiquidate,leverage) = {
8+ let assetId = base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ'
89 let contract = Address(fromBase58String(market))
910 let enterPosition = invoke(contract, "increasePosition", [direction, leverage, 1, ""], [i.payments[0]])
1011 if ((enterPosition == enterPosition))
1112 then {
1213 let liquidation = invoke(contract, "liquidate", [addressToLiquidate], nil)
1314 if ((liquidation == liquidation))
1415 then {
1516 let closePosition = invoke(contract, "closePosition", nil, nil)
1617 if ((closePosition == closePosition))
17- then nil
18+ then {
19+ let amount = assetBalance(this, assetId)
20+ if ((amount == amount))
21+ then [ScriptTransfer(i.caller, amount, assetId)]
22+ else throw("Strict value is not equal to itself.")
23+ }
1824 else throw("Strict value is not equal to itself.")
1925 }
2026 else throw("Strict value is not equal to itself.")
2127 }
2228 else throw("Strict value is not equal to itself.")
2329 }
2430
2531
2632 @Verifier(tx)
2733 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
2834

github/deemru/w8io/026f985 
39.57 ms