tx · wn68uwQNcKNu2fnA6L4mLCikGQpDLArk3yF9FMfpzpN 3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH: -0.04000000 Waves 2022.04.15 12:46 [2009511] smart account 3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH > SELF 0.00000000 Waves
{ "type": 13, "id": "wn68uwQNcKNu2fnA6L4mLCikGQpDLArk3yF9FMfpzpN", "fee": 4000000, "feeAssetId": null, "timestamp": 1650015964336, "version": 2, "chainId": 84, "sender": "3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH", "senderPublicKey": "HJ4JLtArYaaiBiWho6gzLRbKUVM6ZVTaKmci6sgFQtEm", "proofs": [ "4raEYDcdwdZnf1zWSZA3QdHt67KaABNNMTKc9UrSBEFiCrS7MbjYXBW9T2PSJ3aJzsiw6h6zW7wKP2L6fcziuzz6" ], "script": "base64:AAIFAAAAAAAAATEIAhIAEgMKAQEaBwoBYRICSUQaBwoBYhICTFAaDgoBYxIJaXNTdG9wcGVkGgYKAWQSAWkaCAoBZRIDcG10Gg4KAWYSCXBtdEFtb3VudBoPCgFnEgppblRyZWFzdXJ5GhAKAWgSC3RvdGFsSXNzdWVkGgwKAWkSByRtYXRjaDAaCgoBahIFYXNzZXQaFAoBaxIPc2luZ2xlTFBpblZhbHVlGhIKAWwSDWFtb3VudFRvSXNzdWUaDAoBbRIHTFBJc3N1ZRoNCgFuEgh0cmFuc2ZlchoLCgFvEgZhbW91bnQaDQoBcBIIYXR0YWNoZWQaDgoBcRIJcGF5bWVudElEGg4KAXISCW5ld0Ftb3VudBoMCgFzEgdidXJuaW5nGgcKAXQSAnR4GgsKAXUSBnZlcmlmeQAAAAMAAAAAAWEBAAAAIP8QR3aaHO4gAEH6GV3RAr44yVLBwb023LSVkrkR45liAAAAAAFiAQAAACBUgJin8ZP4V+99JlgBkqGEJd4kKpy7bL9Mn0vxHVzLPwAAAAABYwcAAAACAAAAAWQBAAAABXN0YWtlAAAAAAQAA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ACAAAAAQIAAAAeQ2FuJ3Qgd2l0aGRyYXcgbmVnYXRpdmUgYW1vdW50AwkAAGYAAAACAAAAAAAAAAAABQAAAAFyCQAAAgAAAAECAAAAEk5vdCBlbm91Z2ggYmFsYW5jZQQAAAABcwkBAAAABEJ1cm4AAAACBQAAAAFiBQAAAAFvBAAAAAFuCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABZAAAAAZjYWxsZXIFAAAAAXIFAAAAAWEJAARMAAAAAgUAAAABcwkABEwAAAACBQAAAAFuBQAAAANuaWwAAAABAAAAAXQBAAAAAXUAAAAACQAB9AAAAAMIBQAAAAF0AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAABdAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAF0AAAAD3NlbmRlclB1YmxpY0tlebRmSN8=", "height": 2009511, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 48KTb5dZVfL8idwwA5rMw38qF7TV41yDXnJQuPCgujTw Next: 631VSpNZxBTioNMk5TfKCXp4SLQr6FVi8QjwHoxaTS4k Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'JAfMu2seKNzTVfqi5w5Pjh4kwwPTZPCEFpc2q2vDyFeh' | |
5 | 5 | ||
6 | 6 | let b = base58'6gryiTrJoLkNzBtZLVBuCyCvnxPY77TVUS2ouYYjjVTU' | |
7 | 7 | ||
8 | 8 | let c = false | |
9 | 9 | ||
10 | 10 | @Callable(d) | |
11 | 11 | func stake () = { | |
12 | 12 | let e = value(d.payments[0]) | |
13 | 13 | let f = e.amount | |
14 | 14 | if ((e.assetId != a)) | |
15 | 15 | then throw("attach testNSBT tokens only") | |
16 | 16 | else if (c) | |
17 | 17 | then throw("smart contract is on lock") | |
18 | 18 | else { | |
19 | 19 | let g = assetBalance(this, a) | |
20 | 20 | let h = { | |
21 | 21 | let i = assetInfo(b) | |
22 | 22 | if ($isInstanceOf(i, "Asset")) | |
23 | 23 | then { | |
24 | 24 | let j = i | |
25 | 25 | j.quantity | |
26 | 26 | } | |
27 | 27 | else throw("Can't find asset") | |
28 | 28 | } | |
29 | 29 | let k = ((g * 100000000) / h) | |
30 | 30 | let l = ((f * k) / 100000000) | |
31 | 31 | let m = Reissue(b, l, true) | |
32 | 32 | let n = ScriptTransfer(d.caller, l, b) | |
33 | 33 | [m, n] | |
34 | 34 | } | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | ||
39 | 39 | @Callable(d) | |
40 | 40 | func withdraw (o) = { | |
41 | 41 | let p = d.payments[0] | |
42 | 42 | let q = d.payments[0].assetId | |
43 | 43 | if ((q != b)) | |
44 | 44 | then throw("Attach the correct LP token") | |
45 | 45 | else { | |
46 | 46 | let r = (p.amount - o) | |
47 | 47 | if ((0 > o)) | |
48 | 48 | then throw("Can't withdraw negative amount") | |
49 | 49 | else if ((0 > r)) | |
50 | 50 | then throw("Not enough balance") | |
51 | 51 | else { | |
52 | 52 | let s = Burn(b, o) | |
53 | 53 | let n = ScriptTransfer(d.caller, r, a) | |
54 | 54 | [s, n] | |
55 | 55 | } | |
56 | 56 | } | |
57 | 57 | } | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | @Verifier(t) | |
61 | 61 | func u () = sigVerify(t.bodyBytes, t.proofs[0], t.senderPublicKey) | |
62 | 62 |
github/deemru/w8io/169f3d6 21.31 ms ◑