tx · 9UUA9eyMTDEbaq6wx9op4mSKFyiBTD8btzHeqLqhwMTx 3N61Cvq5XcnPk9rxpy2Rnp3bSr4syNGUJph: -0.01400000 Waves 2021.10.26 15:50 [1763278] smart account 3N61Cvq5XcnPk9rxpy2Rnp3bSr4syNGUJph > SELF 0.00000000 Waves
{ "type": 13, "id": "9UUA9eyMTDEbaq6wx9op4mSKFyiBTD8btzHeqLqhwMTx", "fee": 1400000, "feeAssetId": null, "timestamp": 1635252738173, "version": 2, "chainId": 84, "sender": "3N61Cvq5XcnPk9rxpy2Rnp3bSr4syNGUJph", "senderPublicKey": "G7cNXePvAHUHmZfXa1eHnvFeH6DuykPC5wm9v9djTKgD", "proofs": [ "5kk8NTeGKVQvoNgdrQJ5PHffsW8dbmwhkSKhrnRHxf59meUTaALoXYs3GJ7NxdazfV5V5waaBh5HgHswP9sggx5W" ], "script": "base64:AAIFAAAAAAAAABEIAhIAEgASAwoBCBIECgIIAQAAAAMAAAAACmRlcG9zaXRGZWUAAAAAAAAAA+gAAAAADWNvbnRyb2xsZXJGZWUAAAAAAAAAJxAAAAAAC3BsYXRmb3JtRmVlAAAAAAAAACcQAAAABAAAAAJhOAEAAAAEaW5pdAAAAAAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAAMTNQUEg3eDdpcW9iVzV6aXlpUkNpYzE5clFxS3I2blBZYUsxX2Fzc2V0X2JhbGFuY2UAAAAAAAAAAAAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAATjNQUEg3eDdpcW9iVzV6aXlpUkNpYzE5clFxS3I2blBZYUsxXzNNdGhzdUM1RUR5ZWhHb0t2eXp3aFp2TUVOcm9IUHNnYVhTX2Vhcm5lZAAAAAAAAAAAAAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAABVM1BQSDd4N2lxb2JXNXppeWlSQ2ljMTlyUXFLcjZuUFlhSzFfM010aHN1QzVFRHllaEdvS3Z5endoWnZNRU5yb0hQ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ACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAANcG9vbEFtb3VudEtleQUAAAANbmV3UG9vbEFtb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAARdXNlclBvb2xBbW91bnRLZXkFAAAAEW5ld1VzZXJQb29sQW1vdW50CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAABF1c2VyUG9vbEVhcm5lZEtleQUAAAAPdXNlckVhcm5lZFRvdGFsBQAAAANuaWwJAAACAAAAAQIAAAAmWW91IGhhdmUgbm90IHN1Y2ggYmFsYW5jZSBmb3Igd2l0aGRyYXcAAAABAAAAAmI2AQAAAAJiNwAAAAAJAAH0AAAAAwgFAAAAAmI2AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACYjYAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACYjYAAAAPc2VuZGVyUHVibGljS2V5V1AWdw==", "height": 1763278, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 98FMcrJd5dRW71fToMq2bpdEB7VLUWXTsrPP2sQsb3CC Next: HRfy2qqbncGWR4ZCTFzHAigbFrXq41HZmo42d1UhC3B Diff:
Old | New | Differences | |
---|---|---|---|
45 | 45 | let t = (o + i) | |
46 | 46 | let u = ((i - fraction(i, 1, a, DOWN)) - fraction(i, 1, b, DOWN)) | |
47 | 47 | let v = (p + u) | |
48 | - | [Reissue(fromBase58String(n), | |
48 | + | [Reissue(fromBase58String(n), u, true), ScriptTransfer(g.caller, u, fromBase58String(n)), IntegerEntry(k, t), IntegerEntry(m, v)] | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 1000 | |
5 | 5 | ||
6 | 6 | let b = 10000 | |
7 | 7 | ||
8 | 8 | let c = 10000 | |
9 | 9 | ||
10 | 10 | @Callable(d) | |
11 | 11 | func init () = [IntegerEntry("3PPH7x7iqobW5ziyiRCic19rQqKr6nPYaK1_asset_balance", 0), IntegerEntry("3PPH7x7iqobW5ziyiRCic19rQqKr6nPYaK1_3MthsuC5EDyehGoKvyzwhZvMENroHPsgaXS_earned", 0), IntegerEntry("3PPH7x7iqobW5ziyiRCic19rQqKr6nPYaK1_3MthsuC5EDyehGoKvyzwhZvMENroHPsgaXS_asset_balance", 0)] | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | ||
15 | 15 | @Callable(d) | |
16 | 16 | func call () = { | |
17 | 17 | let e = Issue("Asset1", "Asset from dApp", 100000, 2, true, unit, 0) | |
18 | 18 | let f = calculateAssetId(e) | |
19 | 19 | [BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), e] | |
20 | 20 | } | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | ||
24 | 24 | @Callable(g) | |
25 | 25 | func deposit (h) = { | |
26 | 26 | let i = g.payments[0].amount | |
27 | 27 | let j = g.payments[0].assetId | |
28 | 28 | let k = (h + "_asset_balance") | |
29 | 29 | let l = toString(g.caller) | |
30 | 30 | let m = (((h + "_") + l) + "_asset_balance") | |
31 | 31 | let n = getStringValue(this, (h + "_service_token")) | |
32 | 32 | let o = getIntegerValue(this, k) | |
33 | 33 | let p = { | |
34 | 34 | let q = getInteger(m) | |
35 | 35 | if ($isInstanceOf(q, "Int")) | |
36 | 36 | then { | |
37 | 37 | let r = q | |
38 | 38 | r | |
39 | 39 | } | |
40 | 40 | else { | |
41 | 41 | let s = q | |
42 | 42 | 0 | |
43 | 43 | } | |
44 | 44 | } | |
45 | 45 | let t = (o + i) | |
46 | 46 | let u = ((i - fraction(i, 1, a, DOWN)) - fraction(i, 1, b, DOWN)) | |
47 | 47 | let v = (p + u) | |
48 | - | [Reissue(fromBase58String(n), | |
48 | + | [Reissue(fromBase58String(n), u, true), ScriptTransfer(g.caller, u, fromBase58String(n)), IntegerEntry(k, t), IntegerEntry(m, v)] | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | ||
53 | 53 | @Callable(g) | |
54 | 54 | func withdraw (h,w) = { | |
55 | 55 | let i = g.payments[0].amount | |
56 | 56 | let j = g.payments[0].assetId | |
57 | 57 | let k = (h + "_asset_balance") | |
58 | 58 | let l = toString(g.caller) | |
59 | 59 | let m = (((h + "_") + l) + "_asset_balance") | |
60 | 60 | let x = (((h + "_") + l) + "_earned") | |
61 | 61 | let o = getIntegerValue(this, k) | |
62 | 62 | let p = { | |
63 | 63 | let q = getInteger(m) | |
64 | 64 | if ($isInstanceOf(q, "Int")) | |
65 | 65 | then { | |
66 | 66 | let r = q | |
67 | 67 | r | |
68 | 68 | } | |
69 | 69 | else { | |
70 | 70 | let s = q | |
71 | 71 | 0 | |
72 | 72 | } | |
73 | 73 | } | |
74 | 74 | let y = { | |
75 | 75 | let q = getInteger(x) | |
76 | 76 | if ($isInstanceOf(q, "Int")) | |
77 | 77 | then { | |
78 | 78 | let r = q | |
79 | 79 | r | |
80 | 80 | } | |
81 | 81 | else { | |
82 | 82 | let s = q | |
83 | 83 | 0 | |
84 | 84 | } | |
85 | 85 | } | |
86 | 86 | let n = getStringValue(this, (h + "_liquidity_token")) | |
87 | 87 | let z = { | |
88 | 88 | let q = assetInfo(fromBase58String(n)) | |
89 | 89 | if ($isInstanceOf(q, "Asset")) | |
90 | 90 | then { | |
91 | 91 | let A = q | |
92 | 92 | A.decimals | |
93 | 93 | } | |
94 | 94 | else throw("Can't find asset") | |
95 | 95 | } | |
96 | 96 | let B = (w + y) | |
97 | 97 | let C = ((i - fraction(i, 1, c, HALFUP)) - fraction(i, 1, b, HALFUP)) | |
98 | 98 | let t = (o - C) | |
99 | 99 | if ((p >= i)) | |
100 | 100 | then { | |
101 | 101 | let v = (p - C) | |
102 | 102 | [ScriptTransfer(g.caller, C, fromBase58String(n)), IntegerEntry(k, t), IntegerEntry(m, v), IntegerEntry(x, B)] | |
103 | 103 | } | |
104 | 104 | else throw("You have not such balance for withdraw") | |
105 | 105 | } | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | @Verifier(D) | |
109 | 109 | func E () = sigVerify(D.bodyBytes, D.proofs[0], D.senderPublicKey) | |
110 | 110 |
github/deemru/w8io/026f985 46.95 ms ◑