tx · 2xnhuzFekctCcLinYjoLg4uEVBpoZjVotgnk2Egytzvu 3MuvmdQpHrmMrszZmrdarf8d95XHbWMcPkM: -0.05000000 Waves 2022.10.31 14:30 [2296530] smart account 3MuvmdQpHrmMrszZmrdarf8d95XHbWMcPkM > SELF 0.00000000 Waves
{ "type": 13, "id": "2xnhuzFekctCcLinYjoLg4uEVBpoZjVotgnk2Egytzvu", "fee": 5000000, "feeAssetId": null, "timestamp": 1667215893315, "version": 2, "chainId": 84, "sender": "3MuvmdQpHrmMrszZmrdarf8d95XHbWMcPkM", "senderPublicKey": "7UnFgjKRHSBUfvTnV31mCr4bNSKGpDZqDJCc98qzC2Ut", "proofs": [ "3JY7YTLq5JWnyezgaVYdDMyzLuJqVY4ifChStQuC3ijpxVmzsD33QXrasAfqtShDpJSyYLKGX5uVmvApVHKAdcy1" ], "script": "base64:AAIFAAAAAAAAAA4IAhIECgIIARIECgIIAQAAAAMAAAAABExPTkcAAAAAAAAAAAEAAAAABVNIT1JUAAAAAAAAAAACAAAAAAdhc3NldElkAQAAACD3dur394PKZdtuE+4CO89YKZWpwdGN8kvabNgdYoDI3gAAAAIAAAABaQEAAAARc3dpdGNoTG9uZ1RvU2hvcnQAAAACAAAABm1hcmtldAAAAAhsZXZlcmFnZQMJAQAAAAIhPQAAAAIIBQAAAAFpAAAABmNhbGxlcgUAAAAEdGhpcwkAAAIAAAABAgAAACh5b3UgYXJlIG5vdCBhbGxvd2VkIHRvIGNoYW5nZSBwb3NpdGlvbnMhBAAAAAhjb250cmFjdAkBAAAAB0FkZHJlc3MAAAABCQACWQAAAAEFAAAABm1hcmtldAQAAAANY2xvc2VQb3NpdGlvbgkAA/wAAAAEBQAAAAhjb250cmFjdAIAAAANY2xvc2VQb3NpdGlvbgUAAAADbmlsBQAAAANuaWwDCQAAAAAAAAIFAAAADWNsb3NlUG9zaXRpb24FAAAADWNsb3NlUG9zaXRpb24EAAAADXNob3J0UG9zaXRpb24JAAP8AAAABAUAAAAIY29udHJh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gUAAAAIbGV2ZXJhZ2UJAARMAAAAAgAAAAAAAAAAAQkABEwAAAACAgAAAAAFAAAAA25pbAkABEwAAAACCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAABQAAAANuaWwDCQAAAAAAAAIFAAAADXNob3J0UG9zaXRpb24FAAAADXNob3J0UG9zaXRpb24EAAAABnJldHVybgkAA/AAAAACBQAAAAR0aGlzBQAAAAdhc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGcmV0dXJuBQAAAAdhc3NldElkBQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5hzMcdg==", "height": 2296530, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6vjE5gbYQQPQucBbnoP8yEWQd8q1TNuK623LY3FDg9C8 Next: 22f13Y8yki3QuFz8sik34a4zoPUwtpaN2Ug3kCjWKroy Diff:
Old | New | Differences | |
---|---|---|---|
8 | 8 | let assetId = base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ' | |
9 | 9 | ||
10 | 10 | @Callable(i) | |
11 | - | func switchLongToShort (market | |
11 | + | func switchLongToShort (market,leverage) = if ((i.caller != this)) | |
12 | 12 | then throw("you are not allowed to change positions!") | |
13 | 13 | else { | |
14 | 14 | let contract = Address(fromBase58String(market)) | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | @Callable(i) | |
32 | - | func switchShortToLong (market | |
32 | + | func switchShortToLong (market,leverage) = if ((i.caller != this)) | |
33 | 33 | then throw("you are not allowed to switch positions") | |
34 | 34 | else { | |
35 | 35 | let contract = Address(fromBase58String(market)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let LONG = 1 | |
5 | 5 | ||
6 | 6 | let SHORT = 2 | |
7 | 7 | ||
8 | 8 | let assetId = base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ' | |
9 | 9 | ||
10 | 10 | @Callable(i) | |
11 | - | func switchLongToShort (market | |
11 | + | func switchLongToShort (market,leverage) = if ((i.caller != this)) | |
12 | 12 | then throw("you are not allowed to change positions!") | |
13 | 13 | else { | |
14 | 14 | let contract = Address(fromBase58String(market)) | |
15 | 15 | let closePosition = invoke(contract, "closePosition", nil, nil) | |
16 | 16 | if ((closePosition == closePosition)) | |
17 | 17 | then { | |
18 | 18 | let shortPosition = invoke(contract, "increasePosition", [SHORT, leverage, 1, ""], [i.payments[0]]) | |
19 | 19 | if ((shortPosition == shortPosition)) | |
20 | 20 | then { | |
21 | 21 | let return = assetBalance(this, assetId) | |
22 | 22 | [ScriptTransfer(i.caller, return, assetId)] | |
23 | 23 | } | |
24 | 24 | else throw("Strict value is not equal to itself.") | |
25 | 25 | } | |
26 | 26 | else throw("Strict value is not equal to itself.") | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | ||
31 | 31 | @Callable(i) | |
32 | - | func switchShortToLong (market | |
32 | + | func switchShortToLong (market,leverage) = if ((i.caller != this)) | |
33 | 33 | then throw("you are not allowed to switch positions") | |
34 | 34 | else { | |
35 | 35 | let contract = Address(fromBase58String(market)) | |
36 | 36 | let closePosition = invoke(contract, "closePosition", nil, nil) | |
37 | 37 | if ((closePosition == closePosition)) | |
38 | 38 | then { | |
39 | 39 | let shortPosition = invoke(contract, "increasePosition", [LONG, leverage, 1, ""], [i.payments[0]]) | |
40 | 40 | if ((shortPosition == shortPosition)) | |
41 | 41 | then { | |
42 | 42 | let return = assetBalance(this, assetId) | |
43 | 43 | [ScriptTransfer(i.caller, return, assetId)] | |
44 | 44 | } | |
45 | 45 | else throw("Strict value is not equal to itself.") | |
46 | 46 | } | |
47 | 47 | else throw("Strict value is not equal to itself.") | |
48 | 48 | } | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | @Verifier(tx) | |
52 | 52 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
53 | 53 |
github/deemru/w8io/169f3d6 40.17 ms ◑