tx · CT38S7wUUk2m8hxerk8xRbP7aC5HfhfDSxKEaQMMsLPu 3NCkVR5gTgfosVUNRTsUHc6kXdhh2V3betH: -0.03700000 Waves 2023.03.03 23:06 [2474335] smart account 3NCkVR5gTgfosVUNRTsUHc6kXdhh2V3betH > SELF 0.00000000 Waves
{ "type": 13, "id": "CT38S7wUUk2m8hxerk8xRbP7aC5HfhfDSxKEaQMMsLPu", "fee": 3700000, "feeAssetId": null, "timestamp": 1677874016522, "version": 2, "chainId": 84, "sender": "3NCkVR5gTgfosVUNRTsUHc6kXdhh2V3betH", "senderPublicKey": "3mgJJUcUNFHYP2pNkbkfB2C8D4gSEKEGisFByu2i6xoM", "proofs": [ "3VzgDWxxG2GubqMjLNdFuyZ3NcDtMWEgVuMMAtzKaw4HeHkRyse5DqBJn57H2uctdYo9VFTqbCFGRBwT4PKQBgQ" ], "script": "base64:BgIqCAISBQoDCAgIEgASABIECgIICBIECgIIARIAEgMKAQgSAwoBCBIDCgEIFgAHa19mdW5kcwIHa19mdW5kcwAXa19hc3NldF9tYW5hZ2VyX2FkZHJlc3MCF2tfYXNzZXRfbWFuYWdlcl9hZGRyZXNzABRrX2Nvb3JkaW5hdG9yQWRkcmVzcwIUa19jb29yZGluYXRvckFkZHJlc3MAEGtfb3JkZXJzX2FkZHJlc3MCEGtfb3JkZXJzX2FkZHJlc3MAD2tfdmF1bHRfYWRkcmVzcwIPa192YXVsdF9hZGRyZXNzAAVrX2FtbQIFa19hbW0AD2tfYWRtaW5fYWRkcmVzcwIPa19hZG1pbl9hZGRyZXNzABFrX3N0YWtpbmdfYWRkcmVzcwIRa19zdGFraW5nX2FkZHJlc3MADWtfaW5pdGlhbGl6ZWQCDWtfaW5pdGlhbGl6ZWQACGtfcGF1c2VkAghrX3BhdXNlZAEOdG9Db21wb3NpdGVLZXkCBF9rZXkIX2FkZHJlc3MJAKwCAgkArAICBQRfa2V5AgFfBQhfYWRkcmVzcwEJYmFsYW5jZU9mAQhfYXNzZXRJZAkBC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atus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4qa9sF5Ct77GhVPnmvKGw1FueY37QqMAoFcgMEcdessd Next: yUBx7abeS1ib8eAcFauLQAwhagmUwdorVgsVpeu9nKL Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let k_funds = "k_funds" | |
5 | 5 | ||
6 | - | let k_vires_address = "k_vires_address" | |
7 | - | ||
8 | - | let k_vires_vault = "k_vires_vault" | |
9 | - | ||
10 | - | let k_asset_claimed_profit = "k_asset_claimed_profit" | |
6 | + | let k_asset_manager_address = "k_asset_manager_address" | |
11 | 7 | ||
12 | 8 | let k_coordinatorAddress = "k_coordinatorAddress" | |
13 | 9 | ||
19 | 15 | ||
20 | 16 | let k_admin_address = "k_admin_address" | |
21 | 17 | ||
22 | - | let k_quote_asset = "k_quote_asset" | |
23 | - | ||
24 | - | let k_quote_staking = "k_quote_staking" | |
25 | - | ||
26 | 18 | let k_staking_address = "k_staking_address" | |
27 | 19 | ||
28 | 20 | let k_initialized = "k_initialized" | |
21 | + | ||
22 | + | let k_paused = "k_paused" | |
29 | 23 | ||
30 | 24 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
31 | 25 | ||
33 | 27 | func balanceOf (_assetId) = valueOrElse(getInteger(this, toCompositeKey(k_funds, _assetId)), 0) | |
34 | 28 | ||
35 | 29 | ||
36 | - | func coordinator () = valueOrErrorMessage(addressFromString( | |
30 | + | func coordinator () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, k_coordinatorAddress), "Coordinator not set Manager")), "Coordinator address invalid") | |
37 | 31 | ||
38 | 32 | ||
39 | - | func vaultAddress () = valueOrErrorMessage(addressFromString( | |
33 | + | func vaultAddress () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(coordinator(), k_vault_address), "Vault address not set")), "Vault address invalid") | |
40 | 34 | ||
41 | 35 | ||
42 | - | func ordersAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_orders_address)), "Orders not set") | |
36 | + | func ordersAddress () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(coordinator(), k_orders_address), "Orders address not set")), "Orders address invalid") | |
37 | + | ||
38 | + | ||
39 | + | func adminAddress () = addressFromString(valueOrErrorMessage(getString(coordinator(), k_admin_address), "Admin address not set")) | |
40 | + | ||
41 | + | ||
42 | + | func stakingAddress () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(coordinator(), k_staking_address), "Staking address not set")), "Staking address invalid") | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func initialized () = valueOrElse(getBoolean(this, k_initialized), false) | |
46 | 46 | ||
47 | 47 | ||
48 | - | func | |
48 | + | func paused () = valueOrElse(getBoolean(this, k_paused), false) | |
49 | 49 | ||
50 | 50 | ||
51 | - | func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset)) | |
52 | - | ||
53 | - | ||
54 | - | func stakingAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_staking_address)), "Staking not set") | |
55 | - | ||
56 | - | ||
57 | - | func viresAddress () = valueOrErrorMessage(addressFromString(getStringValue(this, k_vires_address)), "Vires not set") | |
58 | - | ||
59 | - | ||
60 | - | func viresVault (_assetId) = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, toCompositeKey(k_vires_vault, _assetId)), ("No vault for token " + _assetId))), ("Invalid address for token " + _assetId)) | |
51 | + | func assetManagerAddress (_assetId) = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, toCompositeKey(k_asset_manager_address, _assetId)), ("No asset manager for token " + _assetId))), ("Invalid asset manager address for token " + _assetId)) | |
61 | 52 | ||
62 | 53 | ||
63 | 54 | func isWhitelist (_address) = if (if ((_address == toString(stakingAddress()))) | |
71 | 62 | ||
72 | 63 | ||
73 | 64 | @Callable(i) | |
74 | - | func initialize (_coordinator,_ | |
65 | + | func initialize (_coordinator,_quoteAssetId,_quoteAssetManager) = if (if (initialized()) | |
75 | 66 | then true | |
76 | 67 | else (i.caller != this)) | |
77 | 68 | then throw("Unable to initialize") | |
78 | - | else [StringEntry(k_coordinatorAddress, toString(addressFromStringValue(_coordinator))), StringEntry( | |
69 | + | else [StringEntry(k_coordinatorAddress, toString(addressFromStringValue(_coordinator))), StringEntry(toCompositeKey(k_asset_manager_address, _quoteAssetId), toString(addressFromStringValue(_quoteAssetManager))), BooleanEntry(k_initialized, true)] | |
79 | 70 | ||
80 | 71 | ||
81 | 72 | ||
82 | 73 | @Callable(i) | |
83 | - | func addTokenVault (_assetId,_vaultAddress) = if (if (!(initialized())) | |
84 | - | then true | |
85 | - | else (i.caller != adminAddress())) | |
86 | - | then throw("Invalid addTokenVault params") | |
87 | - | else [StringEntry(toCompositeKey(k_vires_vault, _assetId), toString(addressFromStringValue(_vaultAddress)))] | |
74 | + | func unpause () = if ((i.caller != adminAddress())) | |
75 | + | then throw("Invalid unpause params") | |
76 | + | else [BooleanEntry(k_paused, false)] | |
88 | 77 | ||
89 | 78 | ||
90 | 79 | ||
91 | 80 | @Callable(i) | |
92 | - | func withdraw (_assetId,_amount) = if (if (if (!(isWhitelist(toString(i.caller)))) | |
81 | + | func pause () = if ((i.caller != adminAddress())) | |
82 | + | then throw("Invalid pause params") | |
83 | + | else [BooleanEntry(k_paused, true)] | |
84 | + | ||
85 | + | ||
86 | + | ||
87 | + | @Callable(i) | |
88 | + | func addAssetManager (_assetId,_vaultAddress) = if (if (if (!(initialized())) | |
89 | + | then true | |
90 | + | else (i.caller != adminAddress())) | |
91 | + | then true | |
92 | + | else isDefined(getString(toCompositeKey(k_asset_manager_address, _assetId)))) | |
93 | + | then throw("Invalid addTokenVault params") | |
94 | + | else [StringEntry(toCompositeKey(k_asset_manager_address, _assetId), toString(addressFromStringValue(_vaultAddress)))] | |
95 | + | ||
96 | + | ||
97 | + | ||
98 | + | @Callable(i) | |
99 | + | func withdraw (_assetId,_amount) = if (if (if (if (!(isWhitelist(toString(i.caller)))) | |
93 | 100 | then true | |
94 | 101 | else !(initialized())) | |
102 | + | then true | |
103 | + | else paused()) | |
95 | 104 | then true | |
96 | 105 | else (_amount > balanceOf(_assetId))) | |
97 | 106 | then throw(((("Invalid withdraw params (manager) " + toString(_amount)) + " > ") + toString(balanceOf(_assetId)))) | |
98 | 107 | else { | |
99 | - | let unstake = invoke( | |
108 | + | let unstake = invoke(assetManagerAddress(_assetId), "withdraw", [_assetId, _amount], nil) | |
100 | 109 | if ((unstake == unstake)) | |
101 | 110 | then { | |
102 | 111 | let currentAssetBalance = (balanceOf(_assetId) - _amount) | |
111 | 120 | func deposit () = { | |
112 | 121 | let _amount = i.payments[0].amount | |
113 | 122 | let _assetId = toBase58String(valueOrErrorMessage(i.payments[0].assetId, "No assetId")) | |
114 | - | if (if (if ((i.payments[0].assetId != quoteAsset())) | |
115 | - | then true | |
116 | - | else !(initialized())) | |
123 | + | if (if (if (if (!(initialized())) | |
117 | 124 | then true | |
118 | 125 | else if (!(isWhitelist(toString(i.caller)))) | |
119 | 126 | then (i.caller != adminAddress()) | |
120 | 127 | else false) | |
128 | + | then true | |
129 | + | else paused()) | |
130 | + | then true | |
131 | + | else (size(i.payments) != 1)) | |
121 | 132 | then throw("Invalid deposit params (manager)") | |
122 | 133 | else { | |
123 | - | let vault = viresVault(_assetId) | |
124 | - | let stake = invoke(viresAddress(), "deposit", [toString(vault), false], [AttachedPayment(i.payments[0].assetId, _amount)]) | |
134 | + | let stake = invoke(assetManagerAddress(_assetId), "deposit", nil, [AttachedPayment(i.payments[0].assetId, _amount)]) | |
125 | 135 | if ((stake == stake)) | |
126 | 136 | then { | |
127 | 137 | let currentAssetBalance = (balanceOf(_assetId) + _amount) | |
134 | 144 | ||
135 | 145 | ||
136 | 146 | @Callable(i) | |
137 | - | func claimProfit (_assetId) = if (if (if ((fromBase58String(_assetId) != quoteAsset())) | |
138 | - | then true | |
139 | - | else !(initialized())) | |
147 | + | func claimProfit (_assetId) = if (if (!(initialized())) | |
140 | 148 | then true | |
141 | 149 | else (i.caller != vaultAddress())) | |
142 | - | then throw("Invalid claimProfit params") | |
150 | + | then throw("Invalid claimProfit params (manager)") | |
143 | 151 | else { | |
144 | - | let | |
145 | - | if (( | |
152 | + | let doClaimProfitResult = invoke(assetManagerAddress(_assetId), "claimProfit", [_assetId], nil) | |
153 | + | if ((doClaimProfitResult == doClaimProfitResult)) | |
146 | 154 | then { | |
147 | - | let | |
148 | - | case t: | |
149 | - | t | |
155 | + | let profit = match doClaimProfitResult { | |
156 | + | case t: Int => | |
157 | + | t | |
150 | 158 | case _ => | |
151 | - | throw("Invalid | |
159 | + | throw("Invalid claimProfit result type") | |
152 | 160 | } | |
153 | - | let profit = (currentAssetBalance - balanceOf(_assetId)) | |
154 | - | let unstake = invoke(viresAddress(), "withdraw", [_assetId, profit], nil) | |
155 | - | if ((unstake == unstake)) | |
156 | - | then $Tuple2([ScriptTransfer(i.caller, profit, fromBase58String(_assetId))], profit) | |
157 | - | else throw("Strict value is not equal to itself.") | |
161 | + | $Tuple2([ScriptTransfer(i.caller, profit, fromBase58String(_assetId))], profit) | |
158 | 162 | } | |
159 | 163 | else throw("Strict value is not equal to itself.") | |
160 | 164 | } | |
162 | 166 | ||
163 | 167 | ||
164 | 168 | @Callable(i) | |
165 | - | func view_claimProfit (_assetId) = if (if ((fromBase58String(_assetId) != quoteAsset())) | |
166 | - | then true | |
167 | - | else !(initialized())) | |
168 | - | then throw("Invalid view_claimProfit params") | |
169 | + | func view_claimProfit (_assetId) = if (!(initialized())) | |
170 | + | then throw("Invalid view_claimProfit params (manager)") | |
169 | 171 | else { | |
170 | - | let | |
171 | - | if (( | |
172 | + | let doClaimProfitResult = invoke(assetManagerAddress(_assetId), "claimProfit", [_assetId], nil) | |
173 | + | if ((doClaimProfitResult == doClaimProfitResult)) | |
172 | 174 | then { | |
173 | - | let | |
174 | - | case t: | |
175 | - | t | |
175 | + | let profit = match doClaimProfitResult { | |
176 | + | case t: Int => | |
177 | + | t | |
176 | 178 | case _ => | |
177 | - | throw("Invalid | |
179 | + | throw("Invalid claimProfit result type") | |
178 | 180 | } | |
179 | - | let profit = (currentAssetBalance - balanceOf(_assetId)) | |
180 | - | throw(((((toString(balanceOf(_assetId)) + ",") + toString(currentAssetBalance)) + ",") + toString(profit))) | |
181 | + | throw(((((toString(balanceOf(_assetId)) + ",") + toString((balanceOf(_assetId) + profit))) + ",") + toString(profit))) | |
181 | 182 | } | |
182 | 183 | else throw("Strict value is not equal to itself.") | |
183 | 184 | } | |
185 | + | ||
186 | + | ||
187 | + | ||
188 | + | @Callable(i) | |
189 | + | func migrate (_assetId) = { | |
190 | + | let _amount = balanceOf(_assetId) | |
191 | + | if (if (if (!(initialized())) | |
192 | + | then true | |
193 | + | else (i.caller != adminAddress())) | |
194 | + | then true | |
195 | + | else !(paused())) | |
196 | + | then throw("Invalid migrate params (manager)") | |
197 | + | else { | |
198 | + | let unstake = invoke(valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, "k_vires_address"), "No legacy vires address")), "Invalid legacy vires address"), "withdraw", [_assetId, _amount], nil) | |
199 | + | if ((unstake == unstake)) | |
200 | + | then { | |
201 | + | let stake = invoke(assetManagerAddress(_assetId), "deposit", nil, [AttachedPayment(fromBase58String(_assetId), _amount)]) | |
202 | + | if ((stake == stake)) | |
203 | + | then [DeleteEntry("k_vires_address"), DeleteEntry("k_vires_vault")] | |
204 | + | else throw("Strict value is not equal to itself.") | |
205 | + | } | |
206 | + | else throw("Strict value is not equal to itself.") | |
207 | + | } | |
208 | + | } | |
184 | 209 | ||
185 | 210 | ||
186 | 211 | @Verifier(tx) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let k_funds = "k_funds" | |
5 | 5 | ||
6 | - | let k_vires_address = "k_vires_address" | |
7 | - | ||
8 | - | let k_vires_vault = "k_vires_vault" | |
9 | - | ||
10 | - | let k_asset_claimed_profit = "k_asset_claimed_profit" | |
6 | + | let k_asset_manager_address = "k_asset_manager_address" | |
11 | 7 | ||
12 | 8 | let k_coordinatorAddress = "k_coordinatorAddress" | |
13 | 9 | ||
14 | 10 | let k_orders_address = "k_orders_address" | |
15 | 11 | ||
16 | 12 | let k_vault_address = "k_vault_address" | |
17 | 13 | ||
18 | 14 | let k_amm = "k_amm" | |
19 | 15 | ||
20 | 16 | let k_admin_address = "k_admin_address" | |
21 | 17 | ||
22 | - | let k_quote_asset = "k_quote_asset" | |
23 | - | ||
24 | - | let k_quote_staking = "k_quote_staking" | |
25 | - | ||
26 | 18 | let k_staking_address = "k_staking_address" | |
27 | 19 | ||
28 | 20 | let k_initialized = "k_initialized" | |
21 | + | ||
22 | + | let k_paused = "k_paused" | |
29 | 23 | ||
30 | 24 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
31 | 25 | ||
32 | 26 | ||
33 | 27 | func balanceOf (_assetId) = valueOrElse(getInteger(this, toCompositeKey(k_funds, _assetId)), 0) | |
34 | 28 | ||
35 | 29 | ||
36 | - | func coordinator () = valueOrErrorMessage(addressFromString( | |
30 | + | func coordinator () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, k_coordinatorAddress), "Coordinator not set Manager")), "Coordinator address invalid") | |
37 | 31 | ||
38 | 32 | ||
39 | - | func vaultAddress () = valueOrErrorMessage(addressFromString( | |
33 | + | func vaultAddress () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(coordinator(), k_vault_address), "Vault address not set")), "Vault address invalid") | |
40 | 34 | ||
41 | 35 | ||
42 | - | func ordersAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_orders_address)), "Orders not set") | |
36 | + | func ordersAddress () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(coordinator(), k_orders_address), "Orders address not set")), "Orders address invalid") | |
37 | + | ||
38 | + | ||
39 | + | func adminAddress () = addressFromString(valueOrErrorMessage(getString(coordinator(), k_admin_address), "Admin address not set")) | |
40 | + | ||
41 | + | ||
42 | + | func stakingAddress () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(coordinator(), k_staking_address), "Staking address not set")), "Staking address invalid") | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func initialized () = valueOrElse(getBoolean(this, k_initialized), false) | |
46 | 46 | ||
47 | 47 | ||
48 | - | func | |
48 | + | func paused () = valueOrElse(getBoolean(this, k_paused), false) | |
49 | 49 | ||
50 | 50 | ||
51 | - | func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset)) | |
52 | - | ||
53 | - | ||
54 | - | func stakingAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_staking_address)), "Staking not set") | |
55 | - | ||
56 | - | ||
57 | - | func viresAddress () = valueOrErrorMessage(addressFromString(getStringValue(this, k_vires_address)), "Vires not set") | |
58 | - | ||
59 | - | ||
60 | - | func viresVault (_assetId) = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, toCompositeKey(k_vires_vault, _assetId)), ("No vault for token " + _assetId))), ("Invalid address for token " + _assetId)) | |
51 | + | func assetManagerAddress (_assetId) = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, toCompositeKey(k_asset_manager_address, _assetId)), ("No asset manager for token " + _assetId))), ("Invalid asset manager address for token " + _assetId)) | |
61 | 52 | ||
62 | 53 | ||
63 | 54 | func isWhitelist (_address) = if (if ((_address == toString(stakingAddress()))) | |
64 | 55 | then true | |
65 | 56 | else (_address == toString(vaultAddress()))) | |
66 | 57 | then true | |
67 | 58 | else (_address == toString(ordersAddress())) | |
68 | 59 | ||
69 | 60 | ||
70 | 61 | func updateFunds (_assetId,_value) = [IntegerEntry(toCompositeKey(k_funds, _assetId), _value)] | |
71 | 62 | ||
72 | 63 | ||
73 | 64 | @Callable(i) | |
74 | - | func initialize (_coordinator,_ | |
65 | + | func initialize (_coordinator,_quoteAssetId,_quoteAssetManager) = if (if (initialized()) | |
75 | 66 | then true | |
76 | 67 | else (i.caller != this)) | |
77 | 68 | then throw("Unable to initialize") | |
78 | - | else [StringEntry(k_coordinatorAddress, toString(addressFromStringValue(_coordinator))), StringEntry( | |
69 | + | else [StringEntry(k_coordinatorAddress, toString(addressFromStringValue(_coordinator))), StringEntry(toCompositeKey(k_asset_manager_address, _quoteAssetId), toString(addressFromStringValue(_quoteAssetManager))), BooleanEntry(k_initialized, true)] | |
79 | 70 | ||
80 | 71 | ||
81 | 72 | ||
82 | 73 | @Callable(i) | |
83 | - | func addTokenVault (_assetId,_vaultAddress) = if (if (!(initialized())) | |
84 | - | then true | |
85 | - | else (i.caller != adminAddress())) | |
86 | - | then throw("Invalid addTokenVault params") | |
87 | - | else [StringEntry(toCompositeKey(k_vires_vault, _assetId), toString(addressFromStringValue(_vaultAddress)))] | |
74 | + | func unpause () = if ((i.caller != adminAddress())) | |
75 | + | then throw("Invalid unpause params") | |
76 | + | else [BooleanEntry(k_paused, false)] | |
88 | 77 | ||
89 | 78 | ||
90 | 79 | ||
91 | 80 | @Callable(i) | |
92 | - | func withdraw (_assetId,_amount) = if (if (if (!(isWhitelist(toString(i.caller)))) | |
81 | + | func pause () = if ((i.caller != adminAddress())) | |
82 | + | then throw("Invalid pause params") | |
83 | + | else [BooleanEntry(k_paused, true)] | |
84 | + | ||
85 | + | ||
86 | + | ||
87 | + | @Callable(i) | |
88 | + | func addAssetManager (_assetId,_vaultAddress) = if (if (if (!(initialized())) | |
89 | + | then true | |
90 | + | else (i.caller != adminAddress())) | |
91 | + | then true | |
92 | + | else isDefined(getString(toCompositeKey(k_asset_manager_address, _assetId)))) | |
93 | + | then throw("Invalid addTokenVault params") | |
94 | + | else [StringEntry(toCompositeKey(k_asset_manager_address, _assetId), toString(addressFromStringValue(_vaultAddress)))] | |
95 | + | ||
96 | + | ||
97 | + | ||
98 | + | @Callable(i) | |
99 | + | func withdraw (_assetId,_amount) = if (if (if (if (!(isWhitelist(toString(i.caller)))) | |
93 | 100 | then true | |
94 | 101 | else !(initialized())) | |
102 | + | then true | |
103 | + | else paused()) | |
95 | 104 | then true | |
96 | 105 | else (_amount > balanceOf(_assetId))) | |
97 | 106 | then throw(((("Invalid withdraw params (manager) " + toString(_amount)) + " > ") + toString(balanceOf(_assetId)))) | |
98 | 107 | else { | |
99 | - | let unstake = invoke( | |
108 | + | let unstake = invoke(assetManagerAddress(_assetId), "withdraw", [_assetId, _amount], nil) | |
100 | 109 | if ((unstake == unstake)) | |
101 | 110 | then { | |
102 | 111 | let currentAssetBalance = (balanceOf(_assetId) - _amount) | |
103 | 112 | (updateFunds(_assetId, currentAssetBalance) ++ [ScriptTransfer(i.caller, _amount, fromBase58String(_assetId))]) | |
104 | 113 | } | |
105 | 114 | else throw("Strict value is not equal to itself.") | |
106 | 115 | } | |
107 | 116 | ||
108 | 117 | ||
109 | 118 | ||
110 | 119 | @Callable(i) | |
111 | 120 | func deposit () = { | |
112 | 121 | let _amount = i.payments[0].amount | |
113 | 122 | let _assetId = toBase58String(valueOrErrorMessage(i.payments[0].assetId, "No assetId")) | |
114 | - | if (if (if ((i.payments[0].assetId != quoteAsset())) | |
115 | - | then true | |
116 | - | else !(initialized())) | |
123 | + | if (if (if (if (!(initialized())) | |
117 | 124 | then true | |
118 | 125 | else if (!(isWhitelist(toString(i.caller)))) | |
119 | 126 | then (i.caller != adminAddress()) | |
120 | 127 | else false) | |
128 | + | then true | |
129 | + | else paused()) | |
130 | + | then true | |
131 | + | else (size(i.payments) != 1)) | |
121 | 132 | then throw("Invalid deposit params (manager)") | |
122 | 133 | else { | |
123 | - | let vault = viresVault(_assetId) | |
124 | - | let stake = invoke(viresAddress(), "deposit", [toString(vault), false], [AttachedPayment(i.payments[0].assetId, _amount)]) | |
134 | + | let stake = invoke(assetManagerAddress(_assetId), "deposit", nil, [AttachedPayment(i.payments[0].assetId, _amount)]) | |
125 | 135 | if ((stake == stake)) | |
126 | 136 | then { | |
127 | 137 | let currentAssetBalance = (balanceOf(_assetId) + _amount) | |
128 | 138 | updateFunds(_assetId, currentAssetBalance) | |
129 | 139 | } | |
130 | 140 | else throw("Strict value is not equal to itself.") | |
131 | 141 | } | |
132 | 142 | } | |
133 | 143 | ||
134 | 144 | ||
135 | 145 | ||
136 | 146 | @Callable(i) | |
137 | - | func claimProfit (_assetId) = if (if (if ((fromBase58String(_assetId) != quoteAsset())) | |
138 | - | then true | |
139 | - | else !(initialized())) | |
147 | + | func claimProfit (_assetId) = if (if (!(initialized())) | |
140 | 148 | then true | |
141 | 149 | else (i.caller != vaultAddress())) | |
142 | - | then throw("Invalid claimProfit params") | |
150 | + | then throw("Invalid claimProfit params (manager)") | |
143 | 151 | else { | |
144 | - | let | |
145 | - | if (( | |
152 | + | let doClaimProfitResult = invoke(assetManagerAddress(_assetId), "claimProfit", [_assetId], nil) | |
153 | + | if ((doClaimProfitResult == doClaimProfitResult)) | |
146 | 154 | then { | |
147 | - | let | |
148 | - | case t: | |
149 | - | t | |
155 | + | let profit = match doClaimProfitResult { | |
156 | + | case t: Int => | |
157 | + | t | |
150 | 158 | case _ => | |
151 | - | throw("Invalid | |
159 | + | throw("Invalid claimProfit result type") | |
152 | 160 | } | |
153 | - | let profit = (currentAssetBalance - balanceOf(_assetId)) | |
154 | - | let unstake = invoke(viresAddress(), "withdraw", [_assetId, profit], nil) | |
155 | - | if ((unstake == unstake)) | |
156 | - | then $Tuple2([ScriptTransfer(i.caller, profit, fromBase58String(_assetId))], profit) | |
157 | - | else throw("Strict value is not equal to itself.") | |
161 | + | $Tuple2([ScriptTransfer(i.caller, profit, fromBase58String(_assetId))], profit) | |
158 | 162 | } | |
159 | 163 | else throw("Strict value is not equal to itself.") | |
160 | 164 | } | |
161 | 165 | ||
162 | 166 | ||
163 | 167 | ||
164 | 168 | @Callable(i) | |
165 | - | func view_claimProfit (_assetId) = if (if ((fromBase58String(_assetId) != quoteAsset())) | |
166 | - | then true | |
167 | - | else !(initialized())) | |
168 | - | then throw("Invalid view_claimProfit params") | |
169 | + | func view_claimProfit (_assetId) = if (!(initialized())) | |
170 | + | then throw("Invalid view_claimProfit params (manager)") | |
169 | 171 | else { | |
170 | - | let | |
171 | - | if (( | |
172 | + | let doClaimProfitResult = invoke(assetManagerAddress(_assetId), "claimProfit", [_assetId], nil) | |
173 | + | if ((doClaimProfitResult == doClaimProfitResult)) | |
172 | 174 | then { | |
173 | - | let | |
174 | - | case t: | |
175 | - | t | |
175 | + | let profit = match doClaimProfitResult { | |
176 | + | case t: Int => | |
177 | + | t | |
176 | 178 | case _ => | |
177 | - | throw("Invalid | |
179 | + | throw("Invalid claimProfit result type") | |
178 | 180 | } | |
179 | - | let profit = (currentAssetBalance - balanceOf(_assetId)) | |
180 | - | throw(((((toString(balanceOf(_assetId)) + ",") + toString(currentAssetBalance)) + ",") + toString(profit))) | |
181 | + | throw(((((toString(balanceOf(_assetId)) + ",") + toString((balanceOf(_assetId) + profit))) + ",") + toString(profit))) | |
181 | 182 | } | |
182 | 183 | else throw("Strict value is not equal to itself.") | |
183 | 184 | } | |
185 | + | ||
186 | + | ||
187 | + | ||
188 | + | @Callable(i) | |
189 | + | func migrate (_assetId) = { | |
190 | + | let _amount = balanceOf(_assetId) | |
191 | + | if (if (if (!(initialized())) | |
192 | + | then true | |
193 | + | else (i.caller != adminAddress())) | |
194 | + | then true | |
195 | + | else !(paused())) | |
196 | + | then throw("Invalid migrate params (manager)") | |
197 | + | else { | |
198 | + | let unstake = invoke(valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, "k_vires_address"), "No legacy vires address")), "Invalid legacy vires address"), "withdraw", [_assetId, _amount], nil) | |
199 | + | if ((unstake == unstake)) | |
200 | + | then { | |
201 | + | let stake = invoke(assetManagerAddress(_assetId), "deposit", nil, [AttachedPayment(fromBase58String(_assetId), _amount)]) | |
202 | + | if ((stake == stake)) | |
203 | + | then [DeleteEntry("k_vires_address"), DeleteEntry("k_vires_vault")] | |
204 | + | else throw("Strict value is not equal to itself.") | |
205 | + | } | |
206 | + | else throw("Strict value is not equal to itself.") | |
207 | + | } | |
208 | + | } | |
184 | 209 | ||
185 | 210 | ||
186 | 211 | @Verifier(tx) | |
187 | 212 | func verify () = { | |
188 | 213 | let coordinatorStr = getString(this, k_coordinatorAddress) | |
189 | 214 | if (isDefined(coordinatorStr)) | |
190 | 215 | then { | |
191 | 216 | let admin = getString(addressFromStringValue(value(coordinatorStr)), k_admin_address) | |
192 | 217 | if (isDefined(admin)) | |
193 | 218 | then valueOrElse(getBoolean(addressFromStringValue(value(admin)), ((("status_" + toString(this)) + "_") + toBase58String(tx.id))), false) | |
194 | 219 | else throw("unable to verify: admin not set in coordinator") | |
195 | 220 | } | |
196 | 221 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
197 | 222 | } | |
198 | 223 |
github/deemru/w8io/026f985 45.21 ms ◑