tx · 8eUvo2sFT22UkxvQaP4LsHUY9oVfLV4kSFPfoyAkJGqD 3N8UaqrCTjypGPWXSvFJVSLv23bfuiPoJAh: -0.01000000 Waves 2023.01.06 03:11 [2392358] smart account 3N8UaqrCTjypGPWXSvFJVSLv23bfuiPoJAh > SELF 0.00000000 Waves
{ "type": 13, "id": "8eUvo2sFT22UkxvQaP4LsHUY9oVfLV4kSFPfoyAkJGqD", "fee": 1000000, "feeAssetId": null, "timestamp": 1672963902083, "version": 2, "chainId": 84, "sender": "3N8UaqrCTjypGPWXSvFJVSLv23bfuiPoJAh", "senderPublicKey": "6Q6JdfeHgdjpVbDxjoVAbQhxeGaQXS7B4WYGzk2tYsGT", "proofs": [ "2AgkkVFz2y9s54cG2Ht4QFuWr6vBWVk3uFQbRRomqvk1ULYrzmDeVmTrALwL8NfqQSyeMYVgRF8hb8vAWZ7Bwok9" ], "script": "base64:BgI2CAISAwoBBBIHCgUEBAQEBBIECgIBARIDCgEEEgMKAQQSAwoBCBIDCgEBEgQKAggBEgQKAggBEwACYW8CCGFkZHJlc3NfAAJhYwIIYWN0aXZhdGUABnBvb2xBYwIOYWN0aXZhdGVfcG9vbHMABnN3YXBBYwINYWN0aXZhdGVfc3dhcAAGbmZldEFjAgxhY3RpdmF0ZV9uZnQAC2xpcXVpZGl0eUFjAhJhY3RpdmF0ZV9saXF1aWRpdHkAA2JjRAITYmxvY2tfZGlzdHJpYnVpdGlvbgAJYnJpZGdlc0FjAhBhY3RpdmF0ZV9icmlkZ2VzAANhQUQCBWFkbWluAAJvQwIHb3JhY2xlXwACb1QCDHRvdGFsX29yYWNsZQAFd2F2ZXMCBVdBVkVTAAZhV2F2ZXMCDGFjY2VwdF93YXZlcwAFV0FWRVMFBHVuaXQBEWFkbWluVmVyaWZpY2F0aW9uAQFpBAckbWF0Y2gwCQCdCAIFBHRoaXMCBWFkbWluAwkAAQIFByRtYXRjaDACBlN0cmluZwQBdAUHJG1hdGNoMAkAAAIJAQdBZGRyZXNzAQ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yQWRtaW4Av5WpUA==", "height": 2392358, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AqRvNzuL98Npfvtecw7r6A5YkbV2EaKvCcGzymSyTwQt Next: EMtK1S8XUS4H9wVLNYcpSNMMe9EpMemYeJJjAWiXXNcD Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let ao = "address_" | |
5 | + | ||
4 | 6 | let ac = "activate" | |
5 | 7 | ||
6 | 8 | let poolAc = "activate_pools" | |
7 | 9 | ||
8 | 10 | let swapAc = "activate_swap" | |
11 | + | ||
12 | + | let nfetAc = "activate_nft" | |
9 | 13 | ||
10 | 14 | let liquidityAc = "activate_liquidity" | |
11 | 15 | ||
19 | 23 | ||
20 | 24 | let oT = "total_oracle" | |
21 | 25 | ||
26 | + | let waves = "WAVES" | |
27 | + | ||
22 | 28 | let aWaves = "accept_waves" | |
23 | 29 | ||
24 | - | func adminVerification () = match getString(this, "admin") { | |
30 | + | let WAVES = unit | |
31 | + | ||
32 | + | func adminVerification (i) = match getString(this, "admin") { | |
25 | 33 | case t: String => | |
26 | - | Address(fromBase58String(t)) | |
34 | + | (Address(fromBase58String(t)) == i.caller) | |
27 | 35 | case _ => | |
28 | - | this | |
36 | + | (this == i.caller) | |
29 | 37 | } | |
30 | 38 | ||
31 | 39 | ||
32 | - | let rateFee = "percentage_rate_fee" | |
40 | + | let rateFee = "percentage_rate_fee_swap" | |
41 | + | ||
42 | + | let rateFeeLimit = "rate_fee_limit" | |
43 | + | ||
44 | + | let rateFeeHeight = "rate_fee_height" | |
33 | 45 | ||
34 | 46 | let errorAdmin = "Only the Admin itself can invoke this function" | |
35 | 47 | ||
36 | 48 | @Callable(i) | |
37 | - | func activate (v) = if (if ((i.caller == this)) | |
38 | - | then true | |
39 | - | else (i.caller == adminVerification())) | |
49 | + | func activate (v) = if (adminVerification(i)) | |
40 | 50 | then [BooleanEntry(ac, v)] | |
41 | 51 | else throw(errorAdmin) | |
42 | 52 | ||
43 | 53 | ||
44 | 54 | ||
45 | 55 | @Callable(i) | |
46 | - | func maintenance (pools,swap,stake,bridges) = if (if ((i.caller == this)) | |
47 | - | then true | |
48 | - | else (i.caller == adminVerification())) | |
49 | - | then [BooleanEntry(poolAc, pools), BooleanEntry(swapAc, swap), BooleanEntry(liquidityAc, stake), BooleanEntry(bridgesAc, bridges)] | |
56 | + | func maintenance (pools,swap,stake,bridges,nft) = if (adminVerification(i)) | |
57 | + | then [BooleanEntry(poolAc, pools), BooleanEntry(swapAc, swap), BooleanEntry(liquidityAc, stake), BooleanEntry(bridgesAc, bridges), BooleanEntry(nfetAc, nft)] | |
50 | 58 | else throw(errorAdmin) | |
51 | 59 | ||
52 | 60 | ||
53 | 61 | ||
54 | 62 | @Callable(i) | |
55 | - | func percentualRateFeeSwapEdit (rate) = if (if ((i.caller == this)) | |
56 | - | then true | |
57 | - | else (i.caller == adminVerification())) | |
58 | - | then [IntegerEntry(rateFee, rate)] | |
63 | + | func RateFee (rateSwap,limitHeight) = if (adminVerification(i)) | |
64 | + | then [IntegerEntry(rateFee, rateSwap), IntegerEntry(rateFeeHeight, limitHeight), IntegerEntry(rateFeeLimit, 100000000000000000)] | |
59 | 65 | else throw(errorAdmin) | |
60 | 66 | ||
61 | 67 | ||
62 | 68 | ||
63 | 69 | @Callable(i) | |
64 | - | func acceptWaves (activate) = if (if ((i.caller == this)) | |
65 | - | then true | |
66 | - | else (i.caller == adminVerification())) | |
70 | + | func recommendation (activate) = if (adminVerification(i)) | |
71 | + | then [BooleanEntry("RECOMMENDATION", activate)] | |
72 | + | else throw(errorAdmin) | |
73 | + | ||
74 | + | ||
75 | + | ||
76 | + | @Callable(i) | |
77 | + | func acceptWaves (activate) = if (adminVerification(i)) | |
67 | 78 | then [BooleanEntry(aWaves, activate)] | |
68 | 79 | else throw(errorAdmin) | |
69 | 80 | ||
70 | 81 | ||
71 | 82 | ||
72 | 83 | @Callable(i) | |
73 | - | func addAdmin (address) = if (if ((i.caller == this)) | |
74 | - | then true | |
75 | - | else (i.caller == adminVerification())) | |
84 | + | func addAdmin (address) = if (adminVerification(i)) | |
76 | 85 | then [StringEntry(aAD, address)] | |
77 | 86 | else throw(errorAdmin) | |
78 | 87 | ||
79 | 88 | ||
80 | 89 | ||
81 | 90 | @Callable(i) | |
82 | - | func BlockDistribution (amount) = if (if ((i.caller == this)) | |
83 | - | then true | |
84 | - | else (i.caller == adminVerification())) | |
91 | + | func BlockDistribution (amount) = if (adminVerification(i)) | |
85 | 92 | then [IntegerEntry(bcD, amount)] | |
86 | 93 | else throw(errorAdmin) | |
87 | 94 | ||
88 | 95 | ||
89 | 96 | ||
90 | 97 | @Callable(i) | |
91 | - | func SetOracle (address,number) = if (if ((i.caller == this)) | |
92 | - | then true | |
93 | - | else (i.caller == adminVerification())) | |
98 | + | func SetOracle (address,number) = if (adminVerification(i)) | |
94 | 99 | then [StringEntry((oC + toString(number)), address), IntegerEntry(oT, number)] | |
95 | 100 | else throw(errorAdmin) | |
101 | + | ||
102 | + | ||
103 | + | ||
104 | + | @Callable(i) | |
105 | + | func Set (address,T) = { | |
106 | + | let ki = if ((T == 1)) | |
107 | + | then (ao + "IDO") | |
108 | + | else if ((T == 2)) | |
109 | + | then (ao + "BRIDGES") | |
110 | + | else if ((T == 3)) | |
111 | + | then (ao + "FARMS") | |
112 | + | else if ((T == 4)) | |
113 | + | then (ao + "POOLS") | |
114 | + | else (ao + "NFT") | |
115 | + | if (adminVerification(i)) | |
116 | + | then [StringEntry(ki, address)] | |
117 | + | else throw(errorAdmin) | |
118 | + | } | |
96 | 119 | ||
97 | 120 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let ao = "address_" | |
5 | + | ||
4 | 6 | let ac = "activate" | |
5 | 7 | ||
6 | 8 | let poolAc = "activate_pools" | |
7 | 9 | ||
8 | 10 | let swapAc = "activate_swap" | |
11 | + | ||
12 | + | let nfetAc = "activate_nft" | |
9 | 13 | ||
10 | 14 | let liquidityAc = "activate_liquidity" | |
11 | 15 | ||
12 | 16 | let bcD = "block_distribuition" | |
13 | 17 | ||
14 | 18 | let bridgesAc = "activate_bridges" | |
15 | 19 | ||
16 | 20 | let aAD = "admin" | |
17 | 21 | ||
18 | 22 | let oC = "oracle_" | |
19 | 23 | ||
20 | 24 | let oT = "total_oracle" | |
21 | 25 | ||
26 | + | let waves = "WAVES" | |
27 | + | ||
22 | 28 | let aWaves = "accept_waves" | |
23 | 29 | ||
24 | - | func adminVerification () = match getString(this, "admin") { | |
30 | + | let WAVES = unit | |
31 | + | ||
32 | + | func adminVerification (i) = match getString(this, "admin") { | |
25 | 33 | case t: String => | |
26 | - | Address(fromBase58String(t)) | |
34 | + | (Address(fromBase58String(t)) == i.caller) | |
27 | 35 | case _ => | |
28 | - | this | |
36 | + | (this == i.caller) | |
29 | 37 | } | |
30 | 38 | ||
31 | 39 | ||
32 | - | let rateFee = "percentage_rate_fee" | |
40 | + | let rateFee = "percentage_rate_fee_swap" | |
41 | + | ||
42 | + | let rateFeeLimit = "rate_fee_limit" | |
43 | + | ||
44 | + | let rateFeeHeight = "rate_fee_height" | |
33 | 45 | ||
34 | 46 | let errorAdmin = "Only the Admin itself can invoke this function" | |
35 | 47 | ||
36 | 48 | @Callable(i) | |
37 | - | func activate (v) = if (if ((i.caller == this)) | |
38 | - | then true | |
39 | - | else (i.caller == adminVerification())) | |
49 | + | func activate (v) = if (adminVerification(i)) | |
40 | 50 | then [BooleanEntry(ac, v)] | |
41 | 51 | else throw(errorAdmin) | |
42 | 52 | ||
43 | 53 | ||
44 | 54 | ||
45 | 55 | @Callable(i) | |
46 | - | func maintenance (pools,swap,stake,bridges) = if (if ((i.caller == this)) | |
47 | - | then true | |
48 | - | else (i.caller == adminVerification())) | |
49 | - | then [BooleanEntry(poolAc, pools), BooleanEntry(swapAc, swap), BooleanEntry(liquidityAc, stake), BooleanEntry(bridgesAc, bridges)] | |
56 | + | func maintenance (pools,swap,stake,bridges,nft) = if (adminVerification(i)) | |
57 | + | then [BooleanEntry(poolAc, pools), BooleanEntry(swapAc, swap), BooleanEntry(liquidityAc, stake), BooleanEntry(bridgesAc, bridges), BooleanEntry(nfetAc, nft)] | |
50 | 58 | else throw(errorAdmin) | |
51 | 59 | ||
52 | 60 | ||
53 | 61 | ||
54 | 62 | @Callable(i) | |
55 | - | func percentualRateFeeSwapEdit (rate) = if (if ((i.caller == this)) | |
56 | - | then true | |
57 | - | else (i.caller == adminVerification())) | |
58 | - | then [IntegerEntry(rateFee, rate)] | |
63 | + | func RateFee (rateSwap,limitHeight) = if (adminVerification(i)) | |
64 | + | then [IntegerEntry(rateFee, rateSwap), IntegerEntry(rateFeeHeight, limitHeight), IntegerEntry(rateFeeLimit, 100000000000000000)] | |
59 | 65 | else throw(errorAdmin) | |
60 | 66 | ||
61 | 67 | ||
62 | 68 | ||
63 | 69 | @Callable(i) | |
64 | - | func acceptWaves (activate) = if (if ((i.caller == this)) | |
65 | - | then true | |
66 | - | else (i.caller == adminVerification())) | |
70 | + | func recommendation (activate) = if (adminVerification(i)) | |
71 | + | then [BooleanEntry("RECOMMENDATION", activate)] | |
72 | + | else throw(errorAdmin) | |
73 | + | ||
74 | + | ||
75 | + | ||
76 | + | @Callable(i) | |
77 | + | func acceptWaves (activate) = if (adminVerification(i)) | |
67 | 78 | then [BooleanEntry(aWaves, activate)] | |
68 | 79 | else throw(errorAdmin) | |
69 | 80 | ||
70 | 81 | ||
71 | 82 | ||
72 | 83 | @Callable(i) | |
73 | - | func addAdmin (address) = if (if ((i.caller == this)) | |
74 | - | then true | |
75 | - | else (i.caller == adminVerification())) | |
84 | + | func addAdmin (address) = if (adminVerification(i)) | |
76 | 85 | then [StringEntry(aAD, address)] | |
77 | 86 | else throw(errorAdmin) | |
78 | 87 | ||
79 | 88 | ||
80 | 89 | ||
81 | 90 | @Callable(i) | |
82 | - | func BlockDistribution (amount) = if (if ((i.caller == this)) | |
83 | - | then true | |
84 | - | else (i.caller == adminVerification())) | |
91 | + | func BlockDistribution (amount) = if (adminVerification(i)) | |
85 | 92 | then [IntegerEntry(bcD, amount)] | |
86 | 93 | else throw(errorAdmin) | |
87 | 94 | ||
88 | 95 | ||
89 | 96 | ||
90 | 97 | @Callable(i) | |
91 | - | func SetOracle (address,number) = if (if ((i.caller == this)) | |
92 | - | then true | |
93 | - | else (i.caller == adminVerification())) | |
98 | + | func SetOracle (address,number) = if (adminVerification(i)) | |
94 | 99 | then [StringEntry((oC + toString(number)), address), IntegerEntry(oT, number)] | |
95 | 100 | else throw(errorAdmin) | |
101 | + | ||
102 | + | ||
103 | + | ||
104 | + | @Callable(i) | |
105 | + | func Set (address,T) = { | |
106 | + | let ki = if ((T == 1)) | |
107 | + | then (ao + "IDO") | |
108 | + | else if ((T == 2)) | |
109 | + | then (ao + "BRIDGES") | |
110 | + | else if ((T == 3)) | |
111 | + | then (ao + "FARMS") | |
112 | + | else if ((T == 4)) | |
113 | + | then (ao + "POOLS") | |
114 | + | else (ao + "NFT") | |
115 | + | if (adminVerification(i)) | |
116 | + | then [StringEntry(ki, address)] | |
117 | + | else throw(errorAdmin) | |
118 | + | } | |
96 | 119 | ||
97 | 120 |
github/deemru/w8io/169f3d6 58.05 ms ◑