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:
Old | New | | Differences |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func flashLiquidate (direction,market,addressToLiquidate,leverage) = { |
---|
| 8 | + | let assetId = base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ' |
---|
8 | 9 | | let contract = Address(fromBase58String(market)) |
---|
9 | 10 | | let enterPosition = invoke(contract, "increasePosition", [direction, leverage, 1, ""], [i.payments[0]]) |
---|
10 | 11 | | if ((enterPosition == enterPosition)) |
---|
|
14 | 15 | | then { |
---|
15 | 16 | | let closePosition = invoke(contract, "closePosition", nil, nil) |
---|
16 | 17 | | 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 | + | } |
---|
18 | 24 | | else throw("Strict value is not equal to itself.") |
---|
19 | 25 | | } |
---|
20 | 26 | | else throw("Strict value is not equal to itself.") |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func flashLiquidate (direction,market,addressToLiquidate,leverage) = { |
---|
| 8 | + | let assetId = base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ' |
---|
8 | 9 | | let contract = Address(fromBase58String(market)) |
---|
9 | 10 | | let enterPosition = invoke(contract, "increasePosition", [direction, leverage, 1, ""], [i.payments[0]]) |
---|
10 | 11 | | if ((enterPosition == enterPosition)) |
---|
11 | 12 | | then { |
---|
12 | 13 | | let liquidation = invoke(contract, "liquidate", [addressToLiquidate], nil) |
---|
13 | 14 | | if ((liquidation == liquidation)) |
---|
14 | 15 | | then { |
---|
15 | 16 | | let closePosition = invoke(contract, "closePosition", nil, nil) |
---|
16 | 17 | | 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 | + | } |
---|
18 | 24 | | else throw("Strict value is not equal to itself.") |
---|
19 | 25 | | } |
---|
20 | 26 | | else throw("Strict value is not equal to itself.") |
---|
21 | 27 | | } |
---|
22 | 28 | | else throw("Strict value is not equal to itself.") |
---|
23 | 29 | | } |
---|
24 | 30 | | |
---|
25 | 31 | | |
---|
26 | 32 | | @Verifier(tx) |
---|
27 | 33 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
28 | 34 | | |
---|