tx · 2a63ZBPxJ4RxMLNJqKSSL4k5u178Lnv95VbrNYaybXuF 3N19jxhEYkphA6vga9hXTPsU5YfRMR27YoE: -0.04000000 Waves 2022.05.04 11:17 [2036689] smart account 3N19jxhEYkphA6vga9hXTPsU5YfRMR27YoE > SELF 0.00000000 Waves
{ "type": 13, "id": "2a63ZBPxJ4RxMLNJqKSSL4k5u178Lnv95VbrNYaybXuF", "fee": 4000000, "feeAssetId": null, "timestamp": 1651652280294, "version": 2, "chainId": 84, "sender": "3N19jxhEYkphA6vga9hXTPsU5YfRMR27YoE", "senderPublicKey": "B3JNxLE1zmVDjs6MqSA1d3N7V6dS5Rq2wvxZqqVHo1fK", "proofs": [ "T1WK5FwUrv3vmPgZ64eKGxCjHuAFuWqnAHTAjikrWs6sFuZqj1mBKpPZy7jWPHUkLWnHxXzgCfPbRKby9vCX817" ], "script": "base64:AAIFAAAAAAAAACQIAhIDCgEIEggKBggICAgICBIDCgEEEgcKBQgICAgIEgMKAQgAAAARAAAAAARtYWluAgAAAAptYWluX2Fzc2V0AAAAAAFsAgAAAAlscF9hc3NldF8AAAAAAmExAgAAAAxzd2FwX2Fzc2V0MV8AAAAAAnN0AgAAAA9hZGRyZXNzX3N0YWtlcl8AAAAAA3NzdAIAAAANYWRkcmVzc19wb29sXwAAAAADc3dwAgAAAA1hZGRyZXNzX3N3YXBfAAAAAAJhMgIAAAAMc3dhcF9hc3NldDJfAAAAAANhYTECAAAAB3Bvb2xfMV8AAAAAA2FhMgIAAAAHcG9vbF8yXwAAAAADc3QxAgAAAA5zdGFrZXJfYWRkcmVzcwAAAAAEdHlwZQIAAAAFdHlwZV8AAAAACWxlYXNlUG9vbAkBAAAAB0FkZHJlc3MAAAABCAUAAAAEdGhpcwAAAAVieXRlcwAAAAACc2ECAAAAD1NUQUtJTkdfQU1PVU5UXwAAAAACbGECAAAADUxFQVNFX0FNT1VOVF8AAAAAAml4AgAAAANJRF8AAAAADGV4Y2hhbmdlUmF0ZQAAAAAAAAAAB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AAAAEJAAEsAAAAAgUAAAAEdHlwZQUAAAAHYWRkcmVzcwkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQABLAAAAAIFAAAAAmExBQAAAAdhZGRyZXNzCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAAEsAAAAAgUAAAACYTIFAAAAB2FkZHJlc3MFAAAAA25pbAUAAAAJZGVsZXRFbnR5BAAAAAdiYmVudHJ5CQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAABFBNQUEJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAAHYWRkcmVzcwkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQABLAAAAAICAAAABVBPT0xfBQAAAARQTUFBCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAAEsAAAAAgUAAAABbAUAAAAEUE1BQQkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQABLAAAAAIFAAAAA2FhMQUAAAAHYWRkcmVzcwkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQABLAAAAAIFAAAAA2FhMgUAAAAHYWRkcmVzcwkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQABLAAAAAIFAAAABHR5cGUFAAAAB2FkZHJlc3MFAAAAA25pbAUAAAAHYmJlbnRyeQkAAAIAAAABAgAAAC5Pbmx5IHRoZSBBZG1pbiBpdHNlbGYgY2FuIGludm9rZSB0aGlzIGZ1bmN0aW9uAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5Ry1ijw==", "height": 2036689, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5QrjRYhhPAKEhvtWsKkfeqkyN7PJEua5Bm5ugp5rst9n Next: ECwb8qW1baA19ZFMfzYTSByjbC469T5mGT5z5UVVKAmb Diff:
Old | New | Differences | |
---|---|---|---|
85 | 85 | if ((i.caller == this)) | |
86 | 86 | then if ((PAA == "swap")) | |
87 | 87 | then { | |
88 | - | let prai = getStringValue(address) | |
89 | - | let deletEnty = [DeleteEntry(prai), DeleteEntry(address), DeleteEntry((type + address)), DeleteEntry((a1 + address)), DeleteEntry((a2 + address))] | |
88 | + | let deletEnty = [DeleteEntry(PMAA), DeleteEntry(address), DeleteEntry((type + address)), DeleteEntry((a1 + address)), DeleteEntry((a2 + address))] | |
90 | 89 | deletEnty | |
91 | 90 | } | |
92 | 91 | else { | |
93 | - | let prai = getStringValue(address) | |
94 | - | let bbentry = [DeleteEntry(address), DeleteEntry(("POOL_" + prai)), DeleteEntry((l + prai)), DeleteEntry((aa1 + address)), DeleteEntry((aa2 + address)), DeleteEntry((type + address))] | |
92 | + | let bbentry = [DeleteEntry(PMAA), DeleteEntry(address), DeleteEntry(("POOL_" + PMAA)), DeleteEntry((l + PMAA)), DeleteEntry((aa1 + address)), DeleteEntry((aa2 + address)), DeleteEntry((type + address))] | |
95 | 93 | bbentry | |
96 | 94 | } | |
97 | 95 | else throw("Only the Admin itself can invoke this function") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let main = "main_asset" | |
5 | 5 | ||
6 | 6 | let l = "lp_asset_" | |
7 | 7 | ||
8 | 8 | let a1 = "swap_asset1_" | |
9 | 9 | ||
10 | 10 | let st = "address_staker_" | |
11 | 11 | ||
12 | 12 | let sst = "address_pool_" | |
13 | 13 | ||
14 | 14 | let swp = "address_swap_" | |
15 | 15 | ||
16 | 16 | let a2 = "swap_asset2_" | |
17 | 17 | ||
18 | 18 | let aa1 = "pool_1_" | |
19 | 19 | ||
20 | 20 | let aa2 = "pool_2_" | |
21 | 21 | ||
22 | 22 | let st1 = "staker_address" | |
23 | 23 | ||
24 | 24 | let type = "type_" | |
25 | 25 | ||
26 | 26 | let leasePool = Address(this.bytes) | |
27 | 27 | ||
28 | 28 | let sa = "STAKING_AMOUNT_" | |
29 | 29 | ||
30 | 30 | let la = "LEASE_AMOUNT_" | |
31 | 31 | ||
32 | 32 | let ix = "ID_" | |
33 | 33 | ||
34 | 34 | let exchangeRate = 5 | |
35 | 35 | ||
36 | 36 | func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse " + address) + " as address"))) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | @Callable(i) | |
40 | 40 | func addMainAsset (id) = if ((i.caller == this)) | |
41 | 41 | then [StringEntry(main, id)] | |
42 | 42 | else throw("Only the Admin itself can invoke this function") | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | ||
46 | 46 | @Callable(i) | |
47 | 47 | func addPool (addres,pair,lp,stake,asset1,asset2) = { | |
48 | 48 | let address = getAddressIfValid(addres) | |
49 | 49 | let staker = getAddressIfValid(stake) | |
50 | 50 | let PMAA = getString(this, address) | |
51 | 51 | if ((i.caller == this)) | |
52 | 52 | then if (isDefined(PMAA)) | |
53 | 53 | then throw("The pool has been previously added.") | |
54 | 54 | else [StringEntry(address, pair), StringEntry(("POOL_" + pair), staker), StringEntry(address, ("POOL_" + pair)), StringEntry((l + pair), lp), StringEntry((aa1 + address), asset1), StringEntry((aa2 + address), asset2), StringEntry((type + address), "pools")] | |
55 | 55 | else throw("Only the Admin itself can invoke this function") | |
56 | 56 | } | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | ||
60 | 60 | @Callable(i) | |
61 | 61 | func activate (v) = if ((i.caller == this)) | |
62 | 62 | then [BooleanEntry("activate", v)] | |
63 | 63 | else throw("Only the Admin itself can invoke this function") | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | ||
67 | 67 | @Callable(i) | |
68 | 68 | func addSwap (addres,stake,pair,asset1,asset2) = { | |
69 | 69 | let address = getAddressIfValid(addres) | |
70 | 70 | let staker = getAddressIfValid(stake) | |
71 | 71 | let PMAA = getString(this, address) | |
72 | 72 | if ((i.caller == this)) | |
73 | 73 | then if (isDefined(PMAA)) | |
74 | 74 | then throw("The address for this swap has been previously added.") | |
75 | 75 | else [StringEntry(pair, staker), StringEntry(address, pair), StringEntry((a1 + address), asset1), StringEntry((a2 + address), asset2), StringEntry((type + address), "swap")] | |
76 | 76 | else throw("Only the Admin itself can invoke this function") | |
77 | 77 | } | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | ||
81 | 81 | @Callable(i) | |
82 | 82 | func removeSwapOrPool (address) = { | |
83 | 83 | let PAA = getStringValue(this, (type + address)) | |
84 | 84 | let PMAA = getStringValue(this, address) | |
85 | 85 | if ((i.caller == this)) | |
86 | 86 | then if ((PAA == "swap")) | |
87 | 87 | then { | |
88 | - | let prai = getStringValue(address) | |
89 | - | let deletEnty = [DeleteEntry(prai), DeleteEntry(address), DeleteEntry((type + address)), DeleteEntry((a1 + address)), DeleteEntry((a2 + address))] | |
88 | + | let deletEnty = [DeleteEntry(PMAA), DeleteEntry(address), DeleteEntry((type + address)), DeleteEntry((a1 + address)), DeleteEntry((a2 + address))] | |
90 | 89 | deletEnty | |
91 | 90 | } | |
92 | 91 | else { | |
93 | - | let prai = getStringValue(address) | |
94 | - | let bbentry = [DeleteEntry(address), DeleteEntry(("POOL_" + prai)), DeleteEntry((l + prai)), DeleteEntry((aa1 + address)), DeleteEntry((aa2 + address)), DeleteEntry((type + address))] | |
92 | + | let bbentry = [DeleteEntry(PMAA), DeleteEntry(address), DeleteEntry(("POOL_" + PMAA)), DeleteEntry((l + PMAA)), DeleteEntry((aa1 + address)), DeleteEntry((aa2 + address)), DeleteEntry((type + address))] | |
95 | 93 | bbentry | |
96 | 94 | } | |
97 | 95 | else throw("Only the Admin itself can invoke this function") | |
98 | 96 | } | |
99 | 97 | ||
100 | 98 | ||
101 | 99 | @Verifier(tx) | |
102 | 100 | func verify () = match tx { | |
103 | 101 | case _ => | |
104 | 102 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
105 | 103 | } | |
106 | 104 |
github/deemru/w8io/169f3d6 56.50 ms ◑