tx · 2Dftq43M9T3a3NYK693EYQTs29w3TBmwPnVQUj5ZXymV 3NCdyrMGZ5jfKPu79jjNiUejWRdQtEwKduD: -0.01400000 Waves 2021.02.01 15:29 [1379100] smart account 3NCdyrMGZ5jfKPu79jjNiUejWRdQtEwKduD > SELF 0.00000000 Waves
{ "type": 13, "id": "2Dftq43M9T3a3NYK693EYQTs29w3TBmwPnVQUj5ZXymV", "fee": 1400000, "feeAssetId": null, "timestamp": 1612182653641, "version": 2, "chainId": 84, "sender": "3NCdyrMGZ5jfKPu79jjNiUejWRdQtEwKduD", "senderPublicKey": "GHCcpQWhq3KPA8MHcLKffvcHoJFXk6bdo67cHXjbpKy1", "proofs": [ "2qVQenxpPA317LXL2wKhnVaKQWYCyL6bZPtTN2aJbzhKG4d4i23Hin2PcAHVaFTSFM7whWCWitUWedULrCcD7RDU" ], "script": "base64:AAIEAAAAAAAAAAYIAhIAEgAAAAADAQAAAAphY2NlcHRCdGZjAAAAAgAAAANzdW0AAAABZQMJAQAAAAIhPQAAAAIIBQAAAAFlAAAAB2Fzc2V0SWQBAAAAIBUVgoZaLToHoF7JWTbYfTPPIZn5jsOYG4nZknFTL9EjCQAAAgAAAAECAAAAJFdBVkVTPC0+QlRGQyBTd2FwIGFjY2VwdHMgb25seSBXQVZFUwkAAGQAAAACBQAAAANzdW0IBQAAAAFlAAAABmFtb3VudAEAAAALYWNjZXB0V2F2ZXMAAAACAAAAA3N1bQAAAAFlAwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAAFlAAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAjQlRGQzwtPldBVkVTIFN3YXAgYWNjZXB0cyBvbmx5IEJURkMJAABkAAAAAgUAAAADc3VtCAUAAAABZQAAAAZhbW91bnQBAAAACGdldFByaWNlAAAAAAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzAgAAAAxXYXZlc1BlckJ0ZmMDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAA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WVudHMEAAAACyRzaXplNzU3NzkyCQABkAAAAAEFAAAACyRsaXN0NzU3NzkyBAAAAAskYWNjMDc1Nzc5MgAAAAAAAAAAAAMJAAAAAAAAAgUAAAALJHNpemU3NTc3OTIAAAAAAAAAAAAFAAAACyRhY2MwNzU3NzkyBAAAAAskYWNjMTc1Nzc5MgkBAAAAC2FjY2VwdFdhdmVzAAAAAgUAAAALJGFjYzA3NTc3OTIJAAGRAAAAAgUAAAALJGxpc3Q3NTc3OTIAAAAAAAAAAAADCQAAAAAAAAIFAAAACyRzaXplNzU3NzkyAAAAAAAAAAABBQAAAAskYWNjMTc1Nzc5MgQAAAALJGFjYzI3NTc3OTIJAQAAAAthY2NlcHRXYXZlcwAAAAIFAAAACyRhY2MxNzU3NzkyCQABkQAAAAIFAAAACyRsaXN0NzU3NzkyAAAAAAAAAAABAwkAAAAAAAACBQAAAAskc2l6ZTc1Nzc5MgAAAAAAAAAAAgUAAAALJGFjYzI3NTc3OTIEAAAACyRhY2MzNzU3NzkyCQEAAAALYWNjZXB0V2F2ZXMAAAACBQAAAAskYWNjMjc1Nzc5MgkAAZEAAAACBQAAAAskbGlzdDc1Nzc5MgAAAAAAAAAAAgkAAAIAAAABAgAAABJMaXN0IHNpemUgZXhjZWVkIDIJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAB0FkZHJlc3MAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzCQAAaQAAAAIFAAAAA3N1bQkBAAAACGdldFByaWNlAAAAAAkBAAAABFVuaXQAAAAABQAAAANuaWwAAAAAMKP1nQ==", "height": 1379100, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Co2fRZ6kWXBRQ3LLkf1M6JwCjj2Cv9QVKSjzqN2E5dbt Next: 8WDuCyFSw5NRmihgYupYV4FooYjyc1vkYM5579SHZxRP Diff:
Old | New | Differences | |
---|---|---|---|
13 | 13 | ||
14 | 14 | func getPrice () = match getInteger(this, "WavesPerBtfc") { | |
15 | 15 | case a: Int => | |
16 | + | a | |
17 | + | case _ => | |
16 | 18 | 2 | |
17 | - | case _ => | |
18 | - | 0 | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func acceptBtfc (sum,e) = if ((e.assetId != base58'2RJawE14PWhu2XYg1zsmDM46K595DdA2QQHXg9avsrTU')) | |
5 | 5 | then throw("WAVES<->BTFC Swap accepts only WAVES") | |
6 | 6 | else (sum + e.amount) | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func acceptWaves (sum,e) = if (isDefined(e.assetId)) | |
10 | 10 | then throw("BTFC<->WAVES Swap accepts only BTFC") | |
11 | 11 | else (sum + e.amount) | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | func getPrice () = match getInteger(this, "WavesPerBtfc") { | |
15 | 15 | case a: Int => | |
16 | + | a | |
17 | + | case _ => | |
16 | 18 | 2 | |
17 | - | case _ => | |
18 | - | 0 | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | @Callable(i) | |
23 | 23 | func FromBtfcToWaves () = { | |
24 | 24 | let sum = { | |
25 | 25 | let $list590624 = i.payments | |
26 | 26 | let $size590624 = size($list590624) | |
27 | 27 | let $acc0590624 = 0 | |
28 | 28 | if (($size590624 == 0)) | |
29 | 29 | then $acc0590624 | |
30 | 30 | else { | |
31 | 31 | let $acc1590624 = acceptBtfc($acc0590624, $list590624[0]) | |
32 | 32 | if (($size590624 == 1)) | |
33 | 33 | then $acc1590624 | |
34 | 34 | else { | |
35 | 35 | let $acc2590624 = acceptBtfc($acc1590624, $list590624[1]) | |
36 | 36 | if (($size590624 == 2)) | |
37 | 37 | then $acc2590624 | |
38 | 38 | else { | |
39 | 39 | let $acc3590624 = acceptBtfc($acc2590624, $list590624[2]) | |
40 | 40 | throw("List size exceed 2") | |
41 | 41 | } | |
42 | 42 | } | |
43 | 43 | } | |
44 | 44 | } | |
45 | 45 | [ScriptTransfer(Address(i.caller.bytes), (sum * getPrice()), Unit())] | |
46 | 46 | } | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | ||
50 | 50 | @Callable(i) | |
51 | 51 | func FromWavesToBtfc () = { | |
52 | 52 | let sum = { | |
53 | 53 | let $list757792 = i.payments | |
54 | 54 | let $size757792 = size($list757792) | |
55 | 55 | let $acc0757792 = 0 | |
56 | 56 | if (($size757792 == 0)) | |
57 | 57 | then $acc0757792 | |
58 | 58 | else { | |
59 | 59 | let $acc1757792 = acceptWaves($acc0757792, $list757792[0]) | |
60 | 60 | if (($size757792 == 1)) | |
61 | 61 | then $acc1757792 | |
62 | 62 | else { | |
63 | 63 | let $acc2757792 = acceptWaves($acc1757792, $list757792[1]) | |
64 | 64 | if (($size757792 == 2)) | |
65 | 65 | then $acc2757792 | |
66 | 66 | else { | |
67 | 67 | let $acc3757792 = acceptWaves($acc2757792, $list757792[2]) | |
68 | 68 | throw("List size exceed 2") | |
69 | 69 | } | |
70 | 70 | } | |
71 | 71 | } | |
72 | 72 | } | |
73 | 73 | [ScriptTransfer(Address(i.caller.bytes), (sum / getPrice()), Unit())] | |
74 | 74 | } | |
75 | 75 | ||
76 | 76 |
github/deemru/w8io/169f3d6 31.75 ms ◑