tx · 6jmXJHpXx2K6YY2uUoaf5a5wYZ2mVbK4UdrB3MNnkZ5A 3N8n6BtTBKRZBoPuMzaPBH9FyJhfv9xDFJH: -0.01700000 Waves 2022.07.12 11:29 [2136277] smart account 3N8n6BtTBKRZBoPuMzaPBH9FyJhfv9xDFJH > SELF 0.00000000 Waves
{ "type": 13, "id": "6jmXJHpXx2K6YY2uUoaf5a5wYZ2mVbK4UdrB3MNnkZ5A", "fee": 1700000, "feeAssetId": null, "timestamp": 1657614569324, "version": 2, "chainId": 84, "sender": "3N8n6BtTBKRZBoPuMzaPBH9FyJhfv9xDFJH", "senderPublicKey": "4hcnYaYoB2XaCzyJ7wfePpG7EfTd6st6aCAhkskJ9cQ5", "proofs": [ "Qi9Y5sdEUcztNuGpsAwXHQJ7BRSbZGdCEhkUo3DZ42AVSBtJZeQiFZofqM34PCVEFK5zNt7P5USRBj4pkt3bWwj" ], "script": "base64:AAIFAAAAAAAAAB4IAhIAEgASABIAEgASABIAEgASABIAEgASABIAEgAAAAAVAAAAAAh1c2RuVXNkdAEAAAAg202DNWRHG5bvnwwvoM991XmdkujhmzUPwT/MewJwKQsAAAAADXVzZG5Vc2R0TFBUQ0kBAAAAIAqBzantQGEdmEq4Oth6BGhTCCbAyZjxYcEpfvod3iryAAAAAAh3eFVzZG5MUAEAAAAgG7mhj3vOTKXN+s5HyQsWjk32W97C65PB1sWo0bGqCxwAAAAAC3d4VXNkbkxQVENJAQAAACC37N3mGwJ72rYTh/1V0NY8tseiNz1LiL3Be29IRACYLwAAAAALd2F2ZXNVc2RuTHABAAAAINUKknePcghEmMkNN/IegHNiilmrJ+abeEGdbsH03iJ2AAAAAA53YXZlc1VzZG5MUFRDSQEAAAAgxRp2zzmtZIv1fW7qZyCOpdLB08oGyQGtTSaCWHrWElkAAAAACWV0aFVzZG5MUAEAAAAgf0Ew/c/5+Zy9fq7UHSNMMuNJS4SB4kp3y/IQBPX7+eEAAAAADGV0aFVzZG5MUFRDSQEAAAAg4e0WyvK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WwJAARMAAAAAgUAAAACcG0FAAAAA25pbAMJAAAAAAAAAgUAAAABcwUAAAABcwQAAAADdXBkCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAKa2V5QnRjVXNkbgUAAAACYW0EAAAABHVwZEsJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAABJrZXlCdGNVc2RuQ29tcG91bmQAAAAAAAAAAAAEAAAAB0xQSXNzdWUJAQAAAAdSZWlzc3VlAAAAAwUAAAAMYnRjVXNkbkxQVENJBQAAAAJhbQYEAAAAAnRyCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAAAmFtBQAAAAxidGNVc2RuTFBUQ0kJAARMAAAAAgUAAAADdXBkCQAETAAAAAIFAAAABHVwZEsJAARMAAAAAgUAAAAHTFBJc3N1ZQkABEwAAAACBQAAAAJ0cgUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V50JfmDQ==", "height": 2136277, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5HhAwVotTmKjHeffwqu8ffJKxcq4ZggZgAKmZUgoVmzq Next: GdLzyVURca9Gv6i57jA1vuQNkdMUhNJ6j5dvoGY4fD2p Diff:
Old | New | Differences | |
---|---|---|---|
155 | 155 | case _ => | |
156 | 156 | throw("Can't find asset") | |
157 | 157 | } | |
158 | - | let toIssue = (pmtAmount * (totalIssued / tkStaked)) | |
158 | + | let one = fraction(totalIssued, 100000000, tkStaked) | |
159 | + | let toIssue = fraction(pmtAmount, one, 100000000) | |
159 | 160 | let updateState = IntegerEntry(keyUsdtUsdn, (tkStaked + pmtAmount)) | |
160 | 161 | let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt]) | |
161 | 162 | if ((LPstake == LPstake)) | |
186 | 187 | case _ => | |
187 | 188 | throw("Can't find asset") | |
188 | 189 | } | |
189 | - | let toIssue = (pmtAmount * ((totalIssued - assetBalance(this, ethUsdnLPTCI)) / tkStaked)) | |
190 | + | let one = fraction((totalIssued - assetBalance(this, btcUsdnLPTCI)), 100000000, tkStaked) | |
191 | + | let toIssue = fraction(pmtAmount, one, 100000000) | |
190 | 192 | let updateState = IntegerEntry(keyEthUsdn, (tkStaked + pmtAmount)) | |
191 | 193 | let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt]) | |
192 | 194 | if ((LPstake == LPstake)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let usdnUsdt = base58'Fm4qczu6Pepz8KUhh3Heb6LeTVfpSMX5vvNgw3x764CS' | |
5 | 5 | ||
6 | 6 | let usdnUsdtLPTCI = base58'i1snzKxSEZVokh9TWj8hTJQEDBsocnL2hRWsSbsMPK7' | |
7 | 7 | ||
8 | 8 | let wxUsdnLP = base58'2sEBVcyDFK2LupCf7MeA4vzHhGK4DC1WjbKGQCLYDqib' | |
9 | 9 | ||
10 | 10 | let wxUsdnLPTCI = base58'DNy6WBfhPE4y82RonGdHhZEunNotEDzmNfrBomWnsyGi' | |
11 | 11 | ||
12 | 12 | let wavesUsdnLp = base58'FLdC14nUVRyiSYjVrMo3X4g8rXQjLbNRaGAyQAm8V68V' | |
13 | 13 | ||
14 | 14 | let wavesUsdnLPTCI = base58'EGQiqw8jLjg6SVLUeeqMLjk3EjhEVHtjkJ6w46HyFfep' | |
15 | 15 | ||
16 | 16 | let ethUsdnLP = base58'9ZkS8GoUWn69QhgF1RsRtS9CFtc7ZbDNX5N238Jmqjdr' | |
17 | 17 | ||
18 | 18 | let ethUsdnLPTCI = base58'GCvR4BmCSjncVEEwr9psvhN5mctdNTGPs8Xp4b2oQNFZ' | |
19 | 19 | ||
20 | 20 | let btcUsdnLP = base58'2RmyyZ39ZoPoTWksM6urmjgx9mB8ksP8Ru6ba8u89mZm' | |
21 | 21 | ||
22 | 22 | let btcUsdnLPTCI = base58'4jarprgmcev38EU5p2duJAznZSLUxZ831jCT2vf95Hey' | |
23 | 23 | ||
24 | 24 | let isStopped = false | |
25 | 25 | ||
26 | 26 | let keyUsdtUsdn = "STAKED_LP" | |
27 | 27 | ||
28 | 28 | let keyUsdtUsdnCompound = "From_Compound" | |
29 | 29 | ||
30 | 30 | let keywxUsdnCompound = "WX_USDN_compound" | |
31 | 31 | ||
32 | 32 | let keyWXUSDN = "WX_USDN" | |
33 | 33 | ||
34 | 34 | let keyWAVESUSDN = "WAVES_USDN" | |
35 | 35 | ||
36 | 36 | let keyWavesCompound = "WAVES_USDN_COMPOUND" | |
37 | 37 | ||
38 | 38 | let keyBtcUsdn = "BTC_USDN" | |
39 | 39 | ||
40 | 40 | let keyBtcUsdnCompound = "BTC_USDN_COMPOUND" | |
41 | 41 | ||
42 | 42 | let keyEthUsdn = "ETH_USDN" | |
43 | 43 | ||
44 | 44 | let keyEthUsdnCompound = "ETH_USDN_COMPOUND" | |
45 | 45 | ||
46 | 46 | @Callable(i) | |
47 | 47 | func depositBtcUsdnLP () = { | |
48 | 48 | let pmt = value(i.payments[0]) | |
49 | 49 | let pmtAmount = pmt.amount | |
50 | 50 | if ((pmt.assetId != btcUsdnLP)) | |
51 | 51 | then throw("attach BTCUSDNLP tokens only") | |
52 | 52 | else if (isStopped) | |
53 | 53 | then throw("smart contract is on lock") | |
54 | 54 | else { | |
55 | 55 | let tkStaked = valueOrElse(getInteger(this, keyBtcUsdn), 0) | |
56 | 56 | let totalIssued = match assetInfo(btcUsdnLPTCI) { | |
57 | 57 | case asset: Asset => | |
58 | 58 | asset.quantity | |
59 | 59 | case _ => | |
60 | 60 | throw("Can't find asset") | |
61 | 61 | } | |
62 | 62 | let one = fraction((totalIssued - assetBalance(this, btcUsdnLPTCI)), 100000000, tkStaked) | |
63 | 63 | let toIssue = fraction(pmtAmount, one, 100000000) | |
64 | 64 | let updateState = IntegerEntry(keyBtcUsdn, (tkStaked + pmtAmount)) | |
65 | 65 | let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt]) | |
66 | 66 | if ((LPstake == LPstake)) | |
67 | 67 | then { | |
68 | 68 | let LPIssue = Reissue(btcUsdnLPTCI, toIssue, true) | |
69 | 69 | let transfer = ScriptTransfer(i.caller, toIssue, btcUsdnLPTCI) | |
70 | 70 | [LPIssue, transfer, updateState] | |
71 | 71 | } | |
72 | 72 | else throw("Strict value is not equal to itself.") | |
73 | 73 | } | |
74 | 74 | } | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | ||
78 | 78 | @Callable(i) | |
79 | 79 | func depositWavesUsdnLP () = { | |
80 | 80 | let pmt = value(i.payments[0]) | |
81 | 81 | let pmtAmount = pmt.amount | |
82 | 82 | if ((pmt.assetId != wavesUsdnLp)) | |
83 | 83 | then throw("attach WAVESUSDNLP tokens only") | |
84 | 84 | else if (isStopped) | |
85 | 85 | then throw("smart contract is on lock") | |
86 | 86 | else { | |
87 | 87 | let tkStaked = valueOrElse(getInteger(this, keyWAVESUSDN), 0) | |
88 | 88 | let totalIssued = match assetInfo(wavesUsdnLPTCI) { | |
89 | 89 | case asset: Asset => | |
90 | 90 | asset.quantity | |
91 | 91 | case _ => | |
92 | 92 | throw("Can't find asset") | |
93 | 93 | } | |
94 | 94 | let one = fraction(totalIssued, 100000000, tkStaked) | |
95 | 95 | let toIssue = fraction(pmtAmount, one, 100000000) | |
96 | 96 | let updateState = IntegerEntry(keyWAVESUSDN, (tkStaked + pmtAmount)) | |
97 | 97 | let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt]) | |
98 | 98 | if ((LPstake == LPstake)) | |
99 | 99 | then { | |
100 | 100 | let LPIssue = Reissue(wavesUsdnLPTCI, toIssue, true) | |
101 | 101 | let transfer = ScriptTransfer(i.caller, toIssue, wavesUsdnLPTCI) | |
102 | 102 | [LPIssue, transfer, updateState] | |
103 | 103 | } | |
104 | 104 | else throw("Strict value is not equal to itself.") | |
105 | 105 | } | |
106 | 106 | } | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | ||
110 | 110 | @Callable(i) | |
111 | 111 | func depositWxUsdnLP () = { | |
112 | 112 | let pmt = value(i.payments[0]) | |
113 | 113 | let pmtAmount = pmt.amount | |
114 | 114 | if ((pmt.assetId != wxUsdnLP)) | |
115 | 115 | then throw("attach WXUSDNLP tokens only") | |
116 | 116 | else if (isStopped) | |
117 | 117 | then throw("smart contract is on lock") | |
118 | 118 | else { | |
119 | 119 | let tkStaked = valueOrElse(getInteger(this, keyWXUSDN), 0) | |
120 | 120 | let totalIssued = match assetInfo(wxUsdnLPTCI) { | |
121 | 121 | case asset: Asset => | |
122 | 122 | asset.quantity | |
123 | 123 | case _ => | |
124 | 124 | throw("Can't find asset") | |
125 | 125 | } | |
126 | 126 | let one = fraction(totalIssued, 100000000, tkStaked) | |
127 | 127 | let toIssue = fraction(pmtAmount, one, 100000000) | |
128 | 128 | let updateState = IntegerEntry(keyWXUSDN, (tkStaked + pmtAmount)) | |
129 | 129 | let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt]) | |
130 | 130 | if ((LPstake == LPstake)) | |
131 | 131 | then { | |
132 | 132 | let LPIssue = Reissue(wxUsdnLPTCI, toIssue, true) | |
133 | 133 | let transfer = ScriptTransfer(i.caller, toIssue, wxUsdnLPTCI) | |
134 | 134 | [LPIssue, transfer, updateState] | |
135 | 135 | } | |
136 | 136 | else throw("Strict value is not equal to itself.") | |
137 | 137 | } | |
138 | 138 | } | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | ||
142 | 142 | @Callable(i) | |
143 | 143 | func depositUsdtUsdnLP () = { | |
144 | 144 | let pmt = value(i.payments[0]) | |
145 | 145 | let pmtAmount = pmt.amount | |
146 | 146 | if ((pmt.assetId != usdnUsdt)) | |
147 | 147 | then throw("attach USDTUSDNLP tokens only") | |
148 | 148 | else if (isStopped) | |
149 | 149 | then throw("smart contract is on lock") | |
150 | 150 | else { | |
151 | 151 | let tkStaked = valueOrElse(getInteger(this, keyUsdtUsdn), 0) | |
152 | 152 | let totalIssued = match assetInfo(usdnUsdtLPTCI) { | |
153 | 153 | case asset: Asset => | |
154 | 154 | asset.quantity | |
155 | 155 | case _ => | |
156 | 156 | throw("Can't find asset") | |
157 | 157 | } | |
158 | - | let toIssue = (pmtAmount * (totalIssued / tkStaked)) | |
158 | + | let one = fraction(totalIssued, 100000000, tkStaked) | |
159 | + | let toIssue = fraction(pmtAmount, one, 100000000) | |
159 | 160 | let updateState = IntegerEntry(keyUsdtUsdn, (tkStaked + pmtAmount)) | |
160 | 161 | let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt]) | |
161 | 162 | if ((LPstake == LPstake)) | |
162 | 163 | then { | |
163 | 164 | let LPIssue = Reissue(usdnUsdtLPTCI, toIssue, true) | |
164 | 165 | let transfer = ScriptTransfer(i.caller, toIssue, usdnUsdtLPTCI) | |
165 | 166 | [LPIssue, transfer, updateState] | |
166 | 167 | } | |
167 | 168 | else throw("Strict value is not equal to itself.") | |
168 | 169 | } | |
169 | 170 | } | |
170 | 171 | ||
171 | 172 | ||
172 | 173 | ||
173 | 174 | @Callable(i) | |
174 | 175 | func depositEthUsdnLP () = { | |
175 | 176 | let pmt = value(i.payments[0]) | |
176 | 177 | let pmtAmount = pmt.amount | |
177 | 178 | if ((pmt.assetId != ethUsdnLP)) | |
178 | 179 | then throw("attach ETHUSDNLP tokens only") | |
179 | 180 | else if (isStopped) | |
180 | 181 | then throw("smart contract is on lock") | |
181 | 182 | else { | |
182 | 183 | let tkStaked = valueOrElse(getInteger(this, keyEthUsdn), 0) | |
183 | 184 | let totalIssued = match assetInfo(ethUsdnLPTCI) { | |
184 | 185 | case asset: Asset => | |
185 | 186 | asset.quantity | |
186 | 187 | case _ => | |
187 | 188 | throw("Can't find asset") | |
188 | 189 | } | |
189 | - | let toIssue = (pmtAmount * ((totalIssued - assetBalance(this, ethUsdnLPTCI)) / tkStaked)) | |
190 | + | let one = fraction((totalIssued - assetBalance(this, btcUsdnLPTCI)), 100000000, tkStaked) | |
191 | + | let toIssue = fraction(pmtAmount, one, 100000000) | |
190 | 192 | let updateState = IntegerEntry(keyEthUsdn, (tkStaked + pmtAmount)) | |
191 | 193 | let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt]) | |
192 | 194 | if ((LPstake == LPstake)) | |
193 | 195 | then { | |
194 | 196 | let LPIssue = Reissue(ethUsdnLPTCI, toIssue, true) | |
195 | 197 | let transfer = ScriptTransfer(i.caller, toIssue, ethUsdnLPTCI) | |
196 | 198 | [LPIssue, transfer, updateState] | |
197 | 199 | } | |
198 | 200 | else throw("Strict value is not equal to itself.") | |
199 | 201 | } | |
200 | 202 | } | |
201 | 203 | ||
202 | 204 | ||
203 | 205 | ||
204 | 206 | @Callable(i) | |
205 | 207 | func compoundBTCUSDNLP () = { | |
206 | 208 | let compound = value(i.payments[0]) | |
207 | 209 | let ca = compound.amount | |
208 | 210 | if ((compound.assetId != btcUsdnLP)) | |
209 | 211 | then throw("attach BTCUSDNLP tokens only") | |
210 | 212 | else { | |
211 | 213 | let fromCompound = valueOrElse(getInteger(this, keyBtcUsdnCompound), 0) | |
212 | 214 | let totalStaked = valueOrElse(getInteger(this, keyBtcUsdn), 0) | |
213 | 215 | let stakeC = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [compound]) | |
214 | 216 | if ((stakeC == stakeC)) | |
215 | 217 | then { | |
216 | 218 | let updateState = IntegerEntry(keyBtcUsdn, (totalStaked + ca)) | |
217 | 219 | let tc = IntegerEntry(keyBtcUsdnCompound, (fromCompound + ca)) | |
218 | 220 | [updateState, tc] | |
219 | 221 | } | |
220 | 222 | else throw("Strict value is not equal to itself.") | |
221 | 223 | } | |
222 | 224 | } | |
223 | 225 | ||
224 | 226 | ||
225 | 227 | ||
226 | 228 | @Callable(i) | |
227 | 229 | func compoundETHUSDNLP () = { | |
228 | 230 | let compound = value(i.payments[0]) | |
229 | 231 | let ca = compound.amount | |
230 | 232 | if ((compound.assetId != ethUsdnLP)) | |
231 | 233 | then throw("attach ETHUSDNLP tokens only") | |
232 | 234 | else { | |
233 | 235 | let fromCompound = valueOrElse(getInteger(this, keyEthUsdnCompound), 0) | |
234 | 236 | let totalStaked = valueOrElse(getInteger(this, keyEthUsdn), 0) | |
235 | 237 | let stakeC = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [compound]) | |
236 | 238 | if ((stakeC == stakeC)) | |
237 | 239 | then { | |
238 | 240 | let updateState = IntegerEntry(keyEthUsdn, (totalStaked + ca)) | |
239 | 241 | let tc = IntegerEntry(keyEthUsdnCompound, (fromCompound + ca)) | |
240 | 242 | [updateState, tc] | |
241 | 243 | } | |
242 | 244 | else throw("Strict value is not equal to itself.") | |
243 | 245 | } | |
244 | 246 | } | |
245 | 247 | ||
246 | 248 | ||
247 | 249 | ||
248 | 250 | @Callable(i) | |
249 | 251 | func compoundWXUSDNLP () = { | |
250 | 252 | let compound = value(i.payments[0]) | |
251 | 253 | let ca = compound.amount | |
252 | 254 | if ((compound.assetId != wxUsdnLP)) | |
253 | 255 | then throw("attach WXUSDNLP tokens only") | |
254 | 256 | else { | |
255 | 257 | let fromCompound = valueOrElse(getInteger(this, keywxUsdnCompound), 0) | |
256 | 258 | let totalStaked = valueOrElse(getInteger(this, keyWXUSDN), 0) | |
257 | 259 | let stakeC = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [compound]) | |
258 | 260 | if ((stakeC == stakeC)) | |
259 | 261 | then { | |
260 | 262 | let updateState = IntegerEntry(keyWXUSDN, (totalStaked + ca)) | |
261 | 263 | let tc = IntegerEntry(keywxUsdnCompound, (fromCompound + ca)) | |
262 | 264 | [updateState, tc] | |
263 | 265 | } | |
264 | 266 | else throw("Strict value is not equal to itself.") | |
265 | 267 | } | |
266 | 268 | } | |
267 | 269 | ||
268 | 270 | ||
269 | 271 | ||
270 | 272 | @Callable(i) | |
271 | 273 | func compoundUSDTUSDNLP () = { | |
272 | 274 | let compound = value(i.payments[0]) | |
273 | 275 | let ca = compound.amount | |
274 | 276 | if ((compound.assetId != usdnUsdt)) | |
275 | 277 | then throw("attach USDTUSDNLP tokens only") | |
276 | 278 | else { | |
277 | 279 | let fromCompound = valueOrElse(getInteger(this, keyUsdtUsdnCompound), 0) | |
278 | 280 | let totalStaked = valueOrElse(getInteger(this, keyUsdtUsdn), 0) | |
279 | 281 | let stakeC = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [compound]) | |
280 | 282 | if ((stakeC == stakeC)) | |
281 | 283 | then { | |
282 | 284 | let updateState = IntegerEntry(keyUsdtUsdn, (totalStaked + ca)) | |
283 | 285 | let tc = IntegerEntry(keyUsdtUsdnCompound, (fromCompound + ca)) | |
284 | 286 | [updateState, tc] | |
285 | 287 | } | |
286 | 288 | else throw("Strict value is not equal to itself.") | |
287 | 289 | } | |
288 | 290 | } | |
289 | 291 | ||
290 | 292 | ||
291 | 293 | ||
292 | 294 | @Callable(i) | |
293 | 295 | func compoundWAVESUSDNLP () = { | |
294 | 296 | let compound = value(i.payments[0]) | |
295 | 297 | let ca = compound.amount | |
296 | 298 | if ((compound.assetId != wavesUsdnLp)) | |
297 | 299 | then throw("attach WAVESUSDNLP tokens only") | |
298 | 300 | else { | |
299 | 301 | let fromCompound = valueOrElse(getInteger(this, keyWavesCompound), 0) | |
300 | 302 | let totalStaked = valueOrElse(getInteger(this, keyWAVESUSDN), 0) | |
301 | 303 | let stakeC = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [compound]) | |
302 | 304 | if ((stakeC == stakeC)) | |
303 | 305 | then { | |
304 | 306 | let updateState = IntegerEntry(keyWAVESUSDN, (totalStaked + ca)) | |
305 | 307 | let tc = IntegerEntry(keyWavesCompound, (fromCompound + ca)) | |
306 | 308 | [updateState, tc] | |
307 | 309 | } | |
308 | 310 | else throw("Strict value is not equal to itself.") | |
309 | 311 | } | |
310 | 312 | } | |
311 | 313 | ||
312 | 314 | ||
313 | 315 | ||
314 | 316 | @Callable(i) | |
315 | 317 | func initWX () = { | |
316 | 318 | let pm = value(i.payments[0]) | |
317 | 319 | let am = pm.amount | |
318 | 320 | if ((pm.assetId != wxUsdnLP)) | |
319 | 321 | then throw("Unexpected token") | |
320 | 322 | else { | |
321 | 323 | let s = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pm]) | |
322 | 324 | if ((s == s)) | |
323 | 325 | then { | |
324 | 326 | let upd = IntegerEntry(keyWXUSDN, am) | |
325 | 327 | let updK = IntegerEntry(keywxUsdnCompound, 0) | |
326 | 328 | [upd, updK] | |
327 | 329 | } | |
328 | 330 | else throw("Strict value is not equal to itself.") | |
329 | 331 | } | |
330 | 332 | } | |
331 | 333 | ||
332 | 334 | ||
333 | 335 | ||
334 | 336 | @Callable(i) | |
335 | 337 | func initWAVES () = { | |
336 | 338 | let pm = value(i.payments[0]) | |
337 | 339 | let am = pm.amount | |
338 | 340 | if ((pm.assetId != wavesUsdnLp)) | |
339 | 341 | then throw("Unexpected token") | |
340 | 342 | else { | |
341 | 343 | let s = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pm]) | |
342 | 344 | if ((s == s)) | |
343 | 345 | then { | |
344 | 346 | let upd = IntegerEntry(keyWAVESUSDN, am) | |
345 | 347 | let updK = IntegerEntry(keyWavesCompound, 0) | |
346 | 348 | [upd, updK] | |
347 | 349 | } | |
348 | 350 | else throw("Strict value is not equal to itself.") | |
349 | 351 | } | |
350 | 352 | } | |
351 | 353 | ||
352 | 354 | ||
353 | 355 | ||
354 | 356 | @Callable(i) | |
355 | 357 | func initETH () = { | |
356 | 358 | let pm = value(i.payments[0]) | |
357 | 359 | let am = pm.amount | |
358 | 360 | if ((pm.assetId != ethUsdnLP)) | |
359 | 361 | then throw("Unexpected token") | |
360 | 362 | else { | |
361 | 363 | let s = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pm]) | |
362 | 364 | if ((s == s)) | |
363 | 365 | then { | |
364 | 366 | let upd = IntegerEntry(keyEthUsdn, am) | |
365 | 367 | let updK = IntegerEntry(keyEthUsdnCompound, 0) | |
366 | 368 | let issue = Reissue(ethUsdnLPTCI, am, true) | |
367 | 369 | let send = ScriptTransfer(i.caller, am, ethUsdnLPTCI) | |
368 | 370 | [upd, updK, issue, send] | |
369 | 371 | } | |
370 | 372 | else throw("Strict value is not equal to itself.") | |
371 | 373 | } | |
372 | 374 | } | |
373 | 375 | ||
374 | 376 | ||
375 | 377 | ||
376 | 378 | @Callable(i) | |
377 | 379 | func initBTC () = { | |
378 | 380 | let pm = value(i.payments[0]) | |
379 | 381 | let am = pm.amount | |
380 | 382 | if ((pm.assetId != btcUsdnLP)) | |
381 | 383 | then throw("Unexpected token") | |
382 | 384 | else { | |
383 | 385 | let s = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pm]) | |
384 | 386 | if ((s == s)) | |
385 | 387 | then { | |
386 | 388 | let upd = IntegerEntry(keyBtcUsdn, am) | |
387 | 389 | let updK = IntegerEntry(keyBtcUsdnCompound, 0) | |
388 | 390 | let LPIssue = Reissue(btcUsdnLPTCI, am, true) | |
389 | 391 | let tr = ScriptTransfer(i.caller, am, btcUsdnLPTCI) | |
390 | 392 | [upd, updK, LPIssue, tr] | |
391 | 393 | } | |
392 | 394 | else throw("Strict value is not equal to itself.") | |
393 | 395 | } | |
394 | 396 | } | |
395 | 397 | ||
396 | 398 | ||
397 | 399 | @Verifier(tx) | |
398 | 400 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
399 | 401 |
github/deemru/w8io/026f985 44.48 ms ◑