tx · Feh4WjZbmCp6FrtH9iwsessVLaGkL1pTz6LjXAK4xFwx 3N61Cvq5XcnPk9rxpy2Rnp3bSr4syNGUJph: -0.01400000 Waves 2021.10.25 13:35 [1761726] smart account 3N61Cvq5XcnPk9rxpy2Rnp3bSr4syNGUJph > SELF 0.00000000 Waves
{ "type": 13, "id": "Feh4WjZbmCp6FrtH9iwsessVLaGkL1pTz6LjXAK4xFwx", "fee": 1400000, "feeAssetId": null, "timestamp": 1635158111024, "version": 2, "chainId": 84, "sender": "3N61Cvq5XcnPk9rxpy2Rnp3bSr4syNGUJph", "senderPublicKey": "G7cNXePvAHUHmZfXa1eHnvFeH6DuykPC5wm9v9djTKgD", "proofs": [ "5CoTAgqGZ4t6AVvUoHizVTE3wVrbWPoAz52BwP6uAePw3pL9Kg32vL2CAssR2xKSdk7RMuELrsGGZmDoKcBsoRkV" ], "script": "base64:AAIFAAAAAAAAABEIAhIAEgASAwoBCBIECgIIAQAAAAIAAAAACXVzZXJBc3NldAIAAAAsR3JmZ3BjemNjcm41QWJydUxjdFh3Qzk0MWRnd2lwQnk2SFpZRGFRWEhidWsAAAAACWRBcHBBc3NldAIAAAAsN2FwU0p4TG54REt1bmI3YUJHYXVnNXFmVFg4OGpwYzNSMjI0OXBidUpVMngAAAAEAAAAAmE4AQAAAARpbml0AAAAAAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAADMzUFBIN3g3aXFvYlc1eml5aVJDaWMxOXJRcUtyNm5QWWFLMV9saXF1aWRpdHlfdG9rZW4CAAAALENIZWpCVFNybXMxZDRwS3dhVlZUdE44WnRKQzk0dzU3eEZOYloxd0dBU1ZQCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAAMTNQUEg3eDdpcW9iVzV6aXlpUkNpYzE5clFxS3I2blBZYUsxX3NlcnZpY2VfdG9rZW4CAAAALDdvY1JYVXNVcnR5ajlHQWN4Ukp0OHRjcHNnZ0ZadDdjNDY3cUZleXBQYTF5BQA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zZXQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAADXBvb2xBbW91bnRLZXkFAAAADW5ld1Bvb2xBbW91bnQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAAEXVzZXJQb29sQW1vdW50S2V5BQAAABFuZXdVc2VyUG9vbEFtb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAARdXNlclBvb2xFYXJuZWRLZXkFAAAADW5ld1VzZXJFYXJuZWQFAAAAA25pbAkAAAIAAAABAgAAACZZb3UgaGF2ZSBub3Qgc3VjaCBiYWxhbmNlIGZvciB3aXRoZHJhdwAAAAEAAAACYjYBAAAAAmI3AAAAAAkAAfQAAAADCAUAAAACYjYAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJiNgAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJiNgAAAA9zZW5kZXJQdWJsaWNLZXm3h/uN", "height": 1761726, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DhBLBNfaAfvzuRjs9BTco3CEFsZrb3ws6uLyn1V6nTzG Next: 8BGdtMf5VdTzV7WYPB7Xu69Nccnx1a7HVccmPW6HvYqL Diff:
Old | New | Differences | |
---|---|---|---|
26 | 26 | let j = (g + "_asset_balance") | |
27 | 27 | let k = toString(f.caller) | |
28 | 28 | let l = (((g + "_") + k) + "_asset_balance") | |
29 | - | let m = getIntegerValue(this, j) | |
30 | - | let n = { | |
31 | - | let o = getInteger(l) | |
32 | - | if ($isInstanceOf(o, "Int")) | |
29 | + | let m = getStringValue(this, (g + "_service_token")) | |
30 | + | let n = getIntegerValue(this, j) | |
31 | + | let o = { | |
32 | + | let p = getInteger(l) | |
33 | + | if ($isInstanceOf(p, "Int")) | |
33 | 34 | then { | |
34 | - | let | |
35 | - | | |
35 | + | let q = p | |
36 | + | q | |
36 | 37 | } | |
37 | 38 | else { | |
38 | - | let | |
39 | + | let r = p | |
39 | 40 | 0 | |
40 | 41 | } | |
41 | 42 | } | |
42 | - | let r = (m + h) | |
43 | 43 | let s = (n + h) | |
44 | - | [ScriptTransfer(f.caller, h, fromBase58String(b)), IntegerEntry(j, r), IntegerEntry(l, s)] | |
44 | + | let t = (o + h) | |
45 | + | [ScriptTransfer(f.caller, h, fromBase58String(m)), IntegerEntry(j, s), IntegerEntry(l, t)] | |
45 | 46 | } | |
46 | 47 | ||
47 | 48 | ||
48 | 49 | ||
49 | 50 | @Callable(f) | |
50 | - | func withdraw (g, | |
51 | + | func withdraw (g,u) = { | |
51 | 52 | let h = f.payments[0].amount | |
52 | 53 | let i = f.payments[0].assetId | |
53 | 54 | let j = (g + "_asset_balance") | |
54 | 55 | let k = toString(f.caller) | |
55 | 56 | let l = (((g + "_") + k) + "_asset_balance") | |
56 | - | let | |
57 | - | let | |
58 | - | let | |
59 | - | let | |
60 | - | if ($isInstanceOf( | |
57 | + | let v = (((g + "_") + k) + "_earned") | |
58 | + | let n = getIntegerValue(this, j) | |
59 | + | let o = { | |
60 | + | let p = getInteger(l) | |
61 | + | if ($isInstanceOf(p, "Int")) | |
61 | 62 | then { | |
62 | - | let | |
63 | - | | |
63 | + | let q = p | |
64 | + | q | |
64 | 65 | } | |
65 | 66 | else { | |
66 | - | let | |
67 | + | let r = p | |
67 | 68 | 0 | |
68 | 69 | } | |
69 | 70 | } | |
70 | - | let | |
71 | - | let | |
72 | - | if ($isInstanceOf( | |
71 | + | let w = { | |
72 | + | let p = getInteger(l) | |
73 | + | if ($isInstanceOf(p, "Int")) | |
73 | 74 | then { | |
74 | - | let | |
75 | - | | |
75 | + | let q = p | |
76 | + | q | |
76 | 77 | } | |
77 | 78 | else { | |
78 | - | let | |
79 | + | let r = p | |
79 | 80 | 0 | |
80 | 81 | } | |
81 | 82 | } | |
82 | - | let | |
83 | - | let | |
84 | - | if (( | |
83 | + | let x = (w + (h * u)) | |
84 | + | let s = (n - h) | |
85 | + | if ((o >= h)) | |
85 | 86 | then { | |
86 | - | let | |
87 | - | [ScriptTransfer(f.caller, h, fromBase58String(a)), IntegerEntry(j, | |
87 | + | let t = (o - h) | |
88 | + | [ScriptTransfer(f.caller, h, fromBase58String(a)), IntegerEntry(j, s), IntegerEntry(l, t), IntegerEntry(v, x)] | |
88 | 89 | } | |
89 | 90 | else throw("You have not such balance for withdraw") | |
90 | 91 | } | |
91 | 92 | ||
92 | 93 | ||
93 | - | @Verifier( | |
94 | - | func | |
94 | + | @Verifier(y) | |
95 | + | func z () = sigVerify(y.bodyBytes, y.proofs[0], y.senderPublicKey) | |
95 | 96 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "Grfgpczccrn5AbruLctXwC941dgwipBy6HZYDaQXHbuk" | |
5 | 5 | ||
6 | 6 | let b = "7apSJxLnxDKunb7aBGaug5qfTX88jpc3R2249pbuJU2x" | |
7 | 7 | ||
8 | 8 | @Callable(c) | |
9 | 9 | func init () = [StringEntry("3PPH7x7iqobW5ziyiRCic19rQqKr6nPYaK1_liquidity_token", "CHejBTSrms1d4pKwaVVTtN8ZtJC94w57xFNbZ1wGASVP"), StringEntry("3PPH7x7iqobW5ziyiRCic19rQqKr6nPYaK1_service_token", "7ocRXUsUrtyj9GAcxRJt8tcpsggFZt7c467qFeypPa1y")] | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | ||
13 | 13 | @Callable(c) | |
14 | 14 | func call () = { | |
15 | 15 | let d = Issue("Asset1", "Asset from dApp", 100000, 2, true, unit, 0) | |
16 | 16 | let e = calculateAssetId(d) | |
17 | 17 | [BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), d] | |
18 | 18 | } | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | ||
22 | 22 | @Callable(f) | |
23 | 23 | func deposit (g) = { | |
24 | 24 | let h = f.payments[0].amount | |
25 | 25 | let i = f.payments[0].assetId | |
26 | 26 | let j = (g + "_asset_balance") | |
27 | 27 | let k = toString(f.caller) | |
28 | 28 | let l = (((g + "_") + k) + "_asset_balance") | |
29 | - | let m = getIntegerValue(this, j) | |
30 | - | let n = { | |
31 | - | let o = getInteger(l) | |
32 | - | if ($isInstanceOf(o, "Int")) | |
29 | + | let m = getStringValue(this, (g + "_service_token")) | |
30 | + | let n = getIntegerValue(this, j) | |
31 | + | let o = { | |
32 | + | let p = getInteger(l) | |
33 | + | if ($isInstanceOf(p, "Int")) | |
33 | 34 | then { | |
34 | - | let | |
35 | - | | |
35 | + | let q = p | |
36 | + | q | |
36 | 37 | } | |
37 | 38 | else { | |
38 | - | let | |
39 | + | let r = p | |
39 | 40 | 0 | |
40 | 41 | } | |
41 | 42 | } | |
42 | - | let r = (m + h) | |
43 | 43 | let s = (n + h) | |
44 | - | [ScriptTransfer(f.caller, h, fromBase58String(b)), IntegerEntry(j, r), IntegerEntry(l, s)] | |
44 | + | let t = (o + h) | |
45 | + | [ScriptTransfer(f.caller, h, fromBase58String(m)), IntegerEntry(j, s), IntegerEntry(l, t)] | |
45 | 46 | } | |
46 | 47 | ||
47 | 48 | ||
48 | 49 | ||
49 | 50 | @Callable(f) | |
50 | - | func withdraw (g, | |
51 | + | func withdraw (g,u) = { | |
51 | 52 | let h = f.payments[0].amount | |
52 | 53 | let i = f.payments[0].assetId | |
53 | 54 | let j = (g + "_asset_balance") | |
54 | 55 | let k = toString(f.caller) | |
55 | 56 | let l = (((g + "_") + k) + "_asset_balance") | |
56 | - | let | |
57 | - | let | |
58 | - | let | |
59 | - | let | |
60 | - | if ($isInstanceOf( | |
57 | + | let v = (((g + "_") + k) + "_earned") | |
58 | + | let n = getIntegerValue(this, j) | |
59 | + | let o = { | |
60 | + | let p = getInteger(l) | |
61 | + | if ($isInstanceOf(p, "Int")) | |
61 | 62 | then { | |
62 | - | let | |
63 | - | | |
63 | + | let q = p | |
64 | + | q | |
64 | 65 | } | |
65 | 66 | else { | |
66 | - | let | |
67 | + | let r = p | |
67 | 68 | 0 | |
68 | 69 | } | |
69 | 70 | } | |
70 | - | let | |
71 | - | let | |
72 | - | if ($isInstanceOf( | |
71 | + | let w = { | |
72 | + | let p = getInteger(l) | |
73 | + | if ($isInstanceOf(p, "Int")) | |
73 | 74 | then { | |
74 | - | let | |
75 | - | | |
75 | + | let q = p | |
76 | + | q | |
76 | 77 | } | |
77 | 78 | else { | |
78 | - | let | |
79 | + | let r = p | |
79 | 80 | 0 | |
80 | 81 | } | |
81 | 82 | } | |
82 | - | let | |
83 | - | let | |
84 | - | if (( | |
83 | + | let x = (w + (h * u)) | |
84 | + | let s = (n - h) | |
85 | + | if ((o >= h)) | |
85 | 86 | then { | |
86 | - | let | |
87 | - | [ScriptTransfer(f.caller, h, fromBase58String(a)), IntegerEntry(j, | |
87 | + | let t = (o - h) | |
88 | + | [ScriptTransfer(f.caller, h, fromBase58String(a)), IntegerEntry(j, s), IntegerEntry(l, t), IntegerEntry(v, x)] | |
88 | 89 | } | |
89 | 90 | else throw("You have not such balance for withdraw") | |
90 | 91 | } | |
91 | 92 | ||
92 | 93 | ||
93 | - | @Verifier( | |
94 | - | func | |
94 | + | @Verifier(y) | |
95 | + | func z () = sigVerify(y.bodyBytes, y.proofs[0], y.senderPublicKey) | |
95 | 96 |
github/deemru/w8io/169f3d6 65.27 ms ◑