tx · A7tQLacqwaE1AfSaWS1jYGfPjX6RrQHunWAxXh9avLb5 3N8n6BtTBKRZBoPuMzaPBH9FyJhfv9xDFJH: -0.01400000 Waves 2022.07.26 15:07 [2156742] smart account 3N8n6BtTBKRZBoPuMzaPBH9FyJhfv9xDFJH > SELF 0.00000000 Waves
{ "type": 13, "id": "A7tQLacqwaE1AfSaWS1jYGfPjX6RrQHunWAxXh9avLb5", "fee": 1400000, "feeAssetId": null, "timestamp": 1658837339923, "version": 2, "chainId": 84, "sender": "3N8n6BtTBKRZBoPuMzaPBH9FyJhfv9xDFJH", "senderPublicKey": "4hcnYaYoB2XaCzyJ7wfePpG7EfTd6st6aCAhkskJ9cQ5", "proofs": [ "11APUpDpdX4uGPC1VE3AcZwk3CpBF34uuwuBw9ZnTPi4BRCNJhyccLtREYN9m5DiuzLLvcfuPUKEVxQyU9JV9pM" ], "script": "base64:BgIeCAISABIAEgASABIAEgASABIAEgASABIAEgASABIAHQAKdXNkdFVzZG5MUAEg202DNWRHG5bvnwwvoM991XmdkujhmzUPwT/MewJwKQsADXVzZHRVc2RuTFBUQ0kBIAqBzantQGEdmEq4Oth6BGhTCCbAyZjxYcEpfvod3iryAAh3eFVzZG5MUAEgG7mhj3vOTKXN+s5HyQsWjk32W97C65PB1sWo0bGqCxwAC3d4VXNkbkxQVENJASC37N3mGwJ72rYTh/1V0NY8tseiNz1LiL3Be29IRACYLwAKdXNkY1VzZG5MUAEgA2kB/BsKmAqIzY/+EVmFhSaRMrNakvwm6Uhd05/eXHYADXVzZGNVc2RuTFBUQ0kBIPYCN93Tn++GRS9cI0cPlV/ROm2hK8KntJtUQQdS9W7GAAp1c2RjVXNkdExQASDG+KR0G1ZIVhCfkH7CM/Qxa4sESiwr/ZlLh/WFm3zkjAANdXNkY1VzZHRMUFRDSQEgAsaFfARLM8fi74dnh1L7VYL9s9+EI7agWsU13c9XSv4ADHB1enpsZVVzZG5MUAEgwzPGdM4jqqQi30kk5cSZa3gEsHdWgnT/uNEd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AgUBcwUBcwQDdXBkCQEMSW50ZWdlckVudHJ5AgUJa2V5V1hVU0ROBQJhbQQEdXBkSwkBDEludGVnZXJFbnRyeQIFEWtleXd4VXNkbkNvbXBvdW5kAAAJAMwIAgUDdXBkCQDMCAIFBHVwZEsFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXmLDcRS", "height": 2156742, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GApHSFqRwAUqRnBgS8FouyWUXnn543cH6i3sSRPtGdfW Next: 81FMM2p8CUY4QDTGX3neMeFiQ83nsttiA1JjMmLbDGRe Diff:
Old | New | Differences | |
---|---|---|---|
60 | 60 | func checkAddress (caller) = if ((caller != oracle)) | |
61 | 61 | then false | |
62 | 62 | else true | |
63 | + | ||
64 | + | ||
65 | + | @Callable(i) | |
66 | + | func initUsdtUsdn () = { | |
67 | + | let pm = value(i.payments[0]) | |
68 | + | let am = pm.amount | |
69 | + | if ((pm.assetId != usdtUsdnLP)) | |
70 | + | then throw("Unexpected token") | |
71 | + | else { | |
72 | + | let s = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pm]) | |
73 | + | if ((s == s)) | |
74 | + | then { | |
75 | + | let upd = IntegerEntry(keyStaked, am) | |
76 | + | let updK = IntegerEntry(keyCompound, 0) | |
77 | + | [upd, updK] | |
78 | + | } | |
79 | + | else throw("Strict value is not equal to itself.") | |
80 | + | } | |
81 | + | } | |
82 | + | ||
63 | 83 | ||
64 | 84 | ||
65 | 85 | @Callable(i) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let usdtUsdnLP = base58'Fm4qczu6Pepz8KUhh3Heb6LeTVfpSMX5vvNgw3x764CS' | |
5 | 5 | ||
6 | 6 | let usdtUsdnLPTCI = base58'i1snzKxSEZVokh9TWj8hTJQEDBsocnL2hRWsSbsMPK7' | |
7 | 7 | ||
8 | 8 | let wxUsdnLP = base58'2sEBVcyDFK2LupCf7MeA4vzHhGK4DC1WjbKGQCLYDqib' | |
9 | 9 | ||
10 | 10 | let wxUsdnLPTCI = base58'DNy6WBfhPE4y82RonGdHhZEunNotEDzmNfrBomWnsyGi' | |
11 | 11 | ||
12 | 12 | let usdcUsdnLP = base58'EK6N7S38xbtBT3SxAqoGdDLCiX6rojX6G169CnSyuE5' | |
13 | 13 | ||
14 | 14 | let usdcUsdnLPTCI = base58'HZKFpNfyPG5gt4D6Nfy1zQSg2Ptmqv932GjNTCyBEeKP' | |
15 | 15 | ||
16 | 16 | let usdcUsdtLP = base58'EPhdEfmQaNcHyvDmRGhnLhgcJtKZ2a4k3ZBmKWtAEWyH' | |
17 | 17 | ||
18 | 18 | let usdcUsdtLPTCI = base58'BqPYkaiz7Le6fFu1rjZ54anrpT57EpvyugZCUqrsjXj' | |
19 | 19 | ||
20 | 20 | let puzzleUsdnLP = base58'E8zHu33GfcNyGLypX77gZiUXfvuZQeaYmiEfsy7VYNwP' | |
21 | 21 | ||
22 | 22 | let puzzleUsdnLPTCI = base58'Dh9QXSSABE5V6aRfu3mCbDAUokbpE7ER7pbZV6cvyg1A' | |
23 | 23 | ||
24 | 24 | let wxId = base58'Atqv59EYzjFGuitKVnMRk6H8FukjoV3ktPorbEys25on' | |
25 | 25 | ||
26 | 26 | let keySponsorship = "Sponsorship_in_lock" | |
27 | 27 | ||
28 | 28 | let isStopped = false | |
29 | 29 | ||
30 | 30 | let keyStaked = "STAKED_LP" | |
31 | 31 | ||
32 | 32 | let keyCompound = "From_Compound" | |
33 | 33 | ||
34 | 34 | let keywxUsdnCompound = "WX_USDN_compound" | |
35 | 35 | ||
36 | 36 | let keyWXUSDN = "WX_USDN" | |
37 | 37 | ||
38 | 38 | let keyUsdcUsdnCompound = "USDC_USDN_compound" | |
39 | 39 | ||
40 | 40 | let keyUSDCUSDN = "USDC_USDN" | |
41 | 41 | ||
42 | 42 | let keyUsdcUsdtCompound = "USDC_USDT_compound" | |
43 | 43 | ||
44 | 44 | let keyUSDCUSDT = "USDC_USDT" | |
45 | 45 | ||
46 | 46 | let keyPuzzleUsdnCompound = "PUZZLE_USDN_compound" | |
47 | 47 | ||
48 | 48 | let keyPUZZLEUSDN = "PUZZLE_USDN" | |
49 | 49 | ||
50 | 50 | let def = 100000000 | |
51 | 51 | ||
52 | 52 | let feePerc = 10000000000 | |
53 | 53 | ||
54 | 54 | let tw = base58'3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH' | |
55 | 55 | ||
56 | 56 | let oracle = base58'3P6phwFZFQtZFuc9dvdXsgvtg8JEFVgECPA' | |
57 | 57 | ||
58 | 58 | let stakePool = "3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz" | |
59 | 59 | ||
60 | 60 | func checkAddress (caller) = if ((caller != oracle)) | |
61 | 61 | then false | |
62 | 62 | else true | |
63 | + | ||
64 | + | ||
65 | + | @Callable(i) | |
66 | + | func initUsdtUsdn () = { | |
67 | + | let pm = value(i.payments[0]) | |
68 | + | let am = pm.amount | |
69 | + | if ((pm.assetId != usdtUsdnLP)) | |
70 | + | then throw("Unexpected token") | |
71 | + | else { | |
72 | + | let s = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pm]) | |
73 | + | if ((s == s)) | |
74 | + | then { | |
75 | + | let upd = IntegerEntry(keyStaked, am) | |
76 | + | let updK = IntegerEntry(keyCompound, 0) | |
77 | + | [upd, updK] | |
78 | + | } | |
79 | + | else throw("Strict value is not equal to itself.") | |
80 | + | } | |
81 | + | } | |
82 | + | ||
63 | 83 | ||
64 | 84 | ||
65 | 85 | @Callable(i) | |
66 | 86 | func withdraw () = { | |
67 | 87 | let payment = value(i.payments[0]) | |
68 | 88 | let am = payment.amount | |
69 | 89 | let id = payment.assetId | |
70 | 90 | if ((id == usdtUsdnLP)) | |
71 | 91 | then { | |
72 | 92 | let TCIAmount = match assetInfo(usdtUsdnLPTCI) { | |
73 | 93 | case q: Asset => | |
74 | 94 | q.quantity | |
75 | 95 | case _ => | |
76 | 96 | 0 | |
77 | 97 | } | |
78 | 98 | let usdnUsdtStaked = valueOrElse(getInteger(this, keyStaked), 0) | |
79 | 99 | let forSingleTCI = fraction(usdnUsdtStaked, def, TCIAmount) | |
80 | 100 | let usdnLpToWithdraw = fraction(forSingleTCI, am, def) | |
81 | 101 | let fee = fraction(usdnLpToWithdraw, def, feePerc) | |
82 | 102 | let unstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "unstake", ["Fm4qczu6Pepz8KUhh3Heb6LeTVfpSMX5vvNgw3x764CS", am], [payment]) | |
83 | 103 | if ((unstake == unstake)) | |
84 | 104 | then { | |
85 | 105 | let usdnLpfeeTransfer = ScriptTransfer(Address(tw), fee, usdtUsdnLP) | |
86 | 106 | let transfer = ScriptTransfer(i.caller, (usdnLpToWithdraw - fee), usdtUsdnLP) | |
87 | 107 | let updateUsdnLpStaked = IntegerEntry(keyStaked, (usdnUsdtStaked - usdnLpToWithdraw)) | |
88 | 108 | let brn = Burn(usdtUsdnLPTCI, am) | |
89 | 109 | if ((brn == brn)) | |
90 | 110 | then [usdnLpfeeTransfer, transfer, updateUsdnLpStaked] | |
91 | 111 | else throw("Strict value is not equal to itself.") | |
92 | 112 | } | |
93 | 113 | else throw("Strict value is not equal to itself.") | |
94 | 114 | } | |
95 | 115 | else if ((id == wxUsdnLPTCI)) | |
96 | 116 | then { | |
97 | 117 | let wxTciAm = match assetInfo(wxUsdnLPTCI) { | |
98 | 118 | case q: Asset => | |
99 | 119 | q.quantity | |
100 | 120 | case _ => | |
101 | 121 | 0 | |
102 | 122 | } | |
103 | 123 | let wxUsdnStaked = valueOrElse(getInteger(this, keyWXUSDN), 0) | |
104 | 124 | let singleWXLP = fraction(wxUsdnStaked, def, wxTciAm) | |
105 | 125 | let wxLpToWithdraw = fraction(singleWXLP, am, def) | |
106 | 126 | let fee = fraction(wxLpToWithdraw, def, feePerc) | |
107 | 127 | let unstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "unstake", ["2sEBVcyDFK2LupCf7MeA4vzHhGK4DC1WjbKGQCLYDqib", am], [payment]) | |
108 | 128 | if ((unstake == unstake)) | |
109 | 129 | then { | |
110 | 130 | let wxLpFeeTransfer = ScriptTransfer(Address(tw), fee, wxUsdnLP) | |
111 | 131 | let wxLpTransfer = ScriptTransfer(i.caller, (am - fee), wxUsdnLP) | |
112 | 132 | let updateWxLpStaked = IntegerEntry(keyWXUSDN, (wxUsdnStaked - wxLpToWithdraw)) | |
113 | 133 | let burnWxLpTci = Burn(wxUsdnLP, am) | |
114 | 134 | if ((burnWxLpTci == burnWxLpTci)) | |
115 | 135 | then [wxLpFeeTransfer, wxLpTransfer, updateWxLpStaked] | |
116 | 136 | else throw("Strict value is not equal to itself.") | |
117 | 137 | } | |
118 | 138 | else throw("Strict value is not equal to itself.") | |
119 | 139 | } | |
120 | 140 | else if ((id == usdcUsdnLPTCI)) | |
121 | 141 | then { | |
122 | 142 | let usdcUsdnTCI = match assetInfo(usdcUsdnLPTCI) { | |
123 | 143 | case q: Asset => | |
124 | 144 | q.quantity | |
125 | 145 | case _ => | |
126 | 146 | 0 | |
127 | 147 | } | |
128 | 148 | let usdcUsdnStaked = valueOrElse(getInteger(this, keyUSDCUSDN), 0) | |
129 | 149 | let singleUsdcLP = fraction(usdcUsdnTCI, def, usdcUsdnStaked) | |
130 | 150 | let usdcLpToWithdraw = fraction(singleUsdcLP, am, def) | |
131 | 151 | let fee = fraction(usdcLpToWithdraw, def, feePerc) | |
132 | 152 | let usdcUsdnLPFee = ScriptTransfer(Address(tw), fee, usdcUsdnLP) | |
133 | 153 | let usdcUsdnTransfer = ScriptTransfer(i.caller, (am - fee), usdcUsdnLP) | |
134 | 154 | let updateUsdcUsdnLpStaked = IntegerEntry(keyUSDCUSDN, (usdcUsdnStaked - usdcLpToWithdraw)) | |
135 | 155 | let burnUsdcUsdnLpTci = Burn(usdcUsdnLPTCI, am) | |
136 | 156 | if ((burnUsdcUsdnLpTci == burnUsdcUsdnLpTci)) | |
137 | 157 | then [usdcUsdnLPFee, usdcUsdnTransfer, updateUsdcUsdnLpStaked] | |
138 | 158 | else throw("Strict value is not equal to itself.") | |
139 | 159 | } | |
140 | 160 | else if ((id == usdcUsdtLPTCI)) | |
141 | 161 | then { | |
142 | 162 | let usdcUsdtTci = match assetInfo(usdcUsdnLPTCI) { | |
143 | 163 | case q: Asset => | |
144 | 164 | q.quantity | |
145 | 165 | case _ => | |
146 | 166 | 0 | |
147 | 167 | } | |
148 | 168 | let usdcUsdtStaked = valueOrElse(getInteger(this, keyUSDCUSDT), 0) | |
149 | 169 | let singleUsdcUsdt = fraction(usdcUsdtTci, def, usdcUsdtStaked) | |
150 | 170 | let usdcUsdtLpToWithdraw = fraction(singleUsdcUsdt, am, def) | |
151 | 171 | let fee = fraction(usdcUsdtLpToWithdraw, def, feePerc) | |
152 | 172 | let usdcUsdtLPFee = ScriptTransfer(Address(tw), fee, usdcUsdtLP) | |
153 | 173 | let usdcUsdtTransfer = ScriptTransfer(i.caller, (am - fee), usdcUsdtLP) | |
154 | 174 | let updateUsdcUsdtLpStaked = IntegerEntry(keyUSDCUSDT, (usdcUsdtStaked - usdcUsdtLpToWithdraw)) | |
155 | 175 | let burnWxLpTci = Burn(usdcUsdnLPTCI, am) | |
156 | 176 | if ((burnWxLpTci == burnWxLpTci)) | |
157 | 177 | then [usdcUsdtLPFee, usdcUsdtTransfer, updateUsdcUsdtLpStaked] | |
158 | 178 | else throw("Strict value is not equal to itself.") | |
159 | 179 | } | |
160 | 180 | else if ((id == puzzleUsdnLPTCI)) | |
161 | 181 | then { | |
162 | 182 | let puzzleUsdnTci = match assetInfo(puzzleUsdnLPTCI) { | |
163 | 183 | case q: Asset => | |
164 | 184 | q.quantity | |
165 | 185 | case _ => | |
166 | 186 | 0 | |
167 | 187 | } | |
168 | 188 | let puzzleLPStaked = valueOrElse(getInteger(this, keyPUZZLEUSDN), 0) | |
169 | 189 | let singlePuzzleUsdn = fraction(puzzleUsdnTci, def, puzzleLPStaked) | |
170 | 190 | let puzzleUsdnWithdraw = fraction(singlePuzzleUsdn, am, def) | |
171 | 191 | let fee = fraction(puzzleUsdnWithdraw, def, feePerc) | |
172 | 192 | let puzzleUsdnLPFee = ScriptTransfer(Address(tw), fee, puzzleUsdnLP) | |
173 | 193 | let puzzleUsdnTransfer = ScriptTransfer(i.caller, (am - fee), puzzleUsdnLP) | |
174 | 194 | let updatePuzzleUsdnLpStaked = IntegerEntry(keyPUZZLEUSDN, (puzzleLPStaked - puzzleUsdnWithdraw)) | |
175 | 195 | let burnPuzzleTCI = Burn(puzzleUsdnLPTCI, am) | |
176 | 196 | if ((burnPuzzleTCI == burnPuzzleTCI)) | |
177 | 197 | then [puzzleUsdnLPFee, puzzleUsdnTransfer, updatePuzzleUsdnLpStaked] | |
178 | 198 | else throw("Strict value is not equal to itself.") | |
179 | 199 | } | |
180 | 200 | else throw("Invalid asset") | |
181 | 201 | } | |
182 | 202 | ||
183 | 203 | ||
184 | 204 | ||
185 | 205 | @Callable(i) | |
186 | 206 | func depositWxUsdnLP () = { | |
187 | 207 | let pmt = value(i.payments[0]) | |
188 | 208 | let pmtAmount = pmt.amount | |
189 | 209 | if ((pmt.assetId != wxUsdnLP)) | |
190 | 210 | then throw("attach WXUSDNLP tokens only") | |
191 | 211 | else if (isStopped) | |
192 | 212 | then throw("smart contract is on lock") | |
193 | 213 | else { | |
194 | 214 | let tkStaked = valueOrElse(getInteger(this, keyWXUSDN), 0) | |
195 | 215 | let totalIssued = match assetInfo(wxUsdnLPTCI) { | |
196 | 216 | case asset: Asset => | |
197 | 217 | asset.quantity | |
198 | 218 | case _ => | |
199 | 219 | throw("Can't find asset") | |
200 | 220 | } | |
201 | 221 | let one = fraction(totalIssued, 100000000, tkStaked) | |
202 | 222 | let toIssue = fraction(pmtAmount, one, 100000000) | |
203 | 223 | let updateState = IntegerEntry(keyWXUSDN, (tkStaked + pmtAmount)) | |
204 | 224 | let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt]) | |
205 | 225 | if ((LPstake == LPstake)) | |
206 | 226 | then { | |
207 | 227 | let LPIssue = Reissue(wxUsdnLPTCI, toIssue, true) | |
208 | 228 | let transfer = ScriptTransfer(i.caller, toIssue, wxUsdnLPTCI) | |
209 | 229 | [LPIssue, transfer, updateState] | |
210 | 230 | } | |
211 | 231 | else throw("Strict value is not equal to itself.") | |
212 | 232 | } | |
213 | 233 | } | |
214 | 234 | ||
215 | 235 | ||
216 | 236 | ||
217 | 237 | @Callable(i) | |
218 | 238 | func depositUsdtUsdnLP () = { | |
219 | 239 | let pmt = value(i.payments[0]) | |
220 | 240 | let pmtAmount = pmt.amount | |
221 | 241 | if ((pmt.assetId != usdtUsdnLP)) | |
222 | 242 | then throw("attach USDTUSDNLP tokens only") | |
223 | 243 | else if (isStopped) | |
224 | 244 | then throw("smart contract is on lock") | |
225 | 245 | else { | |
226 | 246 | let tkStaked = valueOrElse(getInteger(this, keyStaked), 0) | |
227 | 247 | let totalIssued = match assetInfo(usdtUsdnLPTCI) { | |
228 | 248 | case asset: Asset => | |
229 | 249 | asset.quantity | |
230 | 250 | case _ => | |
231 | 251 | throw("Can't find asset") | |
232 | 252 | } | |
233 | 253 | let fromCompound = valueOrElse(getInteger(this, keyCompound), 0) | |
234 | 254 | let forOne = fraction(totalIssued, 100000000, tkStaked) | |
235 | 255 | let toIssue = fraction(pmtAmount, forOne, 100000000) | |
236 | 256 | let updateState = IntegerEntry(keyStaked, (tkStaked + pmtAmount)) | |
237 | 257 | let LPstake = invoke(Address(base58'3PPNhHYkkEy13gRWDCaruQyhNbX2GrjYSyV'), "stake", nil, [pmt]) | |
238 | 258 | if ((LPstake == LPstake)) | |
239 | 259 | then { | |
240 | 260 | let LPIssue = Reissue(usdtUsdnLPTCI, toIssue, true) | |
241 | 261 | let transfer = ScriptTransfer(i.caller, toIssue, usdtUsdnLPTCI) | |
242 | 262 | [LPIssue, transfer, updateState] | |
243 | 263 | } | |
244 | 264 | else throw("Strict value is not equal to itself.") | |
245 | 265 | } | |
246 | 266 | } | |
247 | 267 | ||
248 | 268 | ||
249 | 269 | ||
250 | 270 | @Callable(i) | |
251 | 271 | func depositUsdcUsdnLP () = { | |
252 | 272 | let pmt = value(i.payments[0]) | |
253 | 273 | let pmtAmount = pmt.amount | |
254 | 274 | if ((pmt.assetId != usdcUsdnLP)) | |
255 | 275 | then throw("attach USDCUSDNLP tokens only") | |
256 | 276 | else if (isStopped) | |
257 | 277 | then throw("smart contract is on lock") | |
258 | 278 | else { | |
259 | 279 | let tkStaked = valueOrElse(getInteger(this, keyUSDCUSDN), 0) | |
260 | 280 | let totalIssued = match assetInfo(usdcUsdnLPTCI) { | |
261 | 281 | case asset: Asset => | |
262 | 282 | asset.quantity | |
263 | 283 | case _ => | |
264 | 284 | throw("Can't find asset") | |
265 | 285 | } | |
266 | 286 | let fromCompound = valueOrElse(getInteger(this, keyUsdcUsdnCompound), 0) | |
267 | 287 | let forOne = fraction(totalIssued, 100000000, tkStaked) | |
268 | 288 | let toIssue = fraction(pmtAmount, forOne, 100000000) | |
269 | 289 | let updateState = IntegerEntry(keyUSDCUSDN, (tkStaked + pmtAmount)) | |
270 | 290 | let LPstake = invoke(Address(base58'3PPNhHYkkEy13gRWDCaruQyhNbX2GrjYSyV'), "stake", nil, [pmt]) | |
271 | 291 | if ((LPstake == LPstake)) | |
272 | 292 | then { | |
273 | 293 | let LPIssue = Reissue(usdcUsdnLPTCI, toIssue, true) | |
274 | 294 | let transfer = ScriptTransfer(i.caller, toIssue, usdcUsdnLPTCI) | |
275 | 295 | [LPIssue, transfer, updateState] | |
276 | 296 | } | |
277 | 297 | else throw("Strict value is not equal to itself.") | |
278 | 298 | } | |
279 | 299 | } | |
280 | 300 | ||
281 | 301 | ||
282 | 302 | ||
283 | 303 | @Callable(i) | |
284 | 304 | func depositUsdcUsdtLP () = { | |
285 | 305 | let pmt = value(i.payments[0]) | |
286 | 306 | let pmtAmount = pmt.amount | |
287 | 307 | if ((pmt.assetId != usdcUsdtLP)) | |
288 | 308 | then throw("attach USDCUSDTLP tokens only") | |
289 | 309 | else if (isStopped) | |
290 | 310 | then throw("smart contract is on lock") | |
291 | 311 | else { | |
292 | 312 | let tkStaked = valueOrElse(getInteger(this, keyUSDCUSDT), 0) | |
293 | 313 | let totalIssued = match assetInfo(usdcUsdtLPTCI) { | |
294 | 314 | case asset: Asset => | |
295 | 315 | asset.quantity | |
296 | 316 | case _ => | |
297 | 317 | throw("Can't find asset") | |
298 | 318 | } | |
299 | 319 | let fromCompound = valueOrElse(getInteger(this, keyUsdcUsdtCompound), 0) | |
300 | 320 | let forOne = fraction(totalIssued, 100000000, tkStaked) | |
301 | 321 | let toIssue = fraction(pmtAmount, forOne, 100000000) | |
302 | 322 | let updateState = IntegerEntry(keyUSDCUSDT, (tkStaked + pmtAmount)) | |
303 | 323 | let LPstake = invoke(Address(base58'3PPNhHYkkEy13gRWDCaruQyhNbX2GrjYSyV'), "stake", nil, [pmt]) | |
304 | 324 | if ((LPstake == LPstake)) | |
305 | 325 | then { | |
306 | 326 | let LPIssue = Reissue(usdcUsdtLPTCI, toIssue, true) | |
307 | 327 | let transfer = ScriptTransfer(i.caller, toIssue, usdcUsdtLPTCI) | |
308 | 328 | [LPIssue, transfer, updateState] | |
309 | 329 | } | |
310 | 330 | else throw("Strict value is not equal to itself.") | |
311 | 331 | } | |
312 | 332 | } | |
313 | 333 | ||
314 | 334 | ||
315 | 335 | ||
316 | 336 | @Callable(i) | |
317 | 337 | func depositPuzzleUsdnLP () = { | |
318 | 338 | let pmt = value(i.payments[0]) | |
319 | 339 | let pmtAmount = pmt.amount | |
320 | 340 | if ((pmt.assetId != puzzleUsdnLP)) | |
321 | 341 | then throw("attach PUZZLEUDSNLP tokens only") | |
322 | 342 | else if (isStopped) | |
323 | 343 | then throw("smart contract is on lock") | |
324 | 344 | else { | |
325 | 345 | let tkStaked = valueOrElse(getInteger(this, keyPUZZLEUSDN), 0) | |
326 | 346 | let totalIssued = match assetInfo(puzzleUsdnLPTCI) { | |
327 | 347 | case asset: Asset => | |
328 | 348 | asset.quantity | |
329 | 349 | case _ => | |
330 | 350 | throw("Can't find asset") | |
331 | 351 | } | |
332 | 352 | let fromCompound = valueOrElse(getInteger(this, keyPuzzleUsdnCompound), 0) | |
333 | 353 | let forOne = fraction(totalIssued, 100000000, tkStaked) | |
334 | 354 | let toIssue = fraction(pmtAmount, forOne, 100000000) | |
335 | 355 | let updateState = IntegerEntry(keyPUZZLEUSDN, (tkStaked + pmtAmount)) | |
336 | 356 | let LPstake = invoke(Address(base58'3PPNhHYkkEy13gRWDCaruQyhNbX2GrjYSyV'), "stake", nil, [pmt]) | |
337 | 357 | if ((LPstake == LPstake)) | |
338 | 358 | then { | |
339 | 359 | let LPIssue = Reissue(puzzleUsdnLPTCI, toIssue, true) | |
340 | 360 | let transfer = ScriptTransfer(i.caller, toIssue, puzzleUsdnLPTCI) | |
341 | 361 | [LPIssue, transfer, updateState] | |
342 | 362 | } | |
343 | 363 | else throw("Strict value is not equal to itself.") | |
344 | 364 | } | |
345 | 365 | } | |
346 | 366 | ||
347 | 367 | ||
348 | 368 | ||
349 | 369 | @Callable(i) | |
350 | 370 | func compoundWxUsdnLP () = { | |
351 | 371 | let compound = value(i.payments[0]) | |
352 | 372 | let ca = compound.amount | |
353 | 373 | let isOracle = checkAddress(i.caller.bytes) | |
354 | 374 | if ((compound.assetId != wxUsdnLP)) | |
355 | 375 | then throw("attach WXUSDNLP tokens only") | |
356 | 376 | else if (!(isOracle)) | |
357 | 377 | then throw("You are not authotized to call this function") | |
358 | 378 | else { | |
359 | 379 | let fromCompound = valueOrElse(getInteger(this, keywxUsdnCompound), 0) | |
360 | 380 | let totalStaked = valueOrElse(getInteger(this, keyWXUSDN), 0) | |
361 | 381 | let stakeC = invoke(Address(base58'3PPNhHYkkEy13gRWDCaruQyhNbX2GrjYSyV'), "stake", nil, [compound]) | |
362 | 382 | if ((stakeC == stakeC)) | |
363 | 383 | then { | |
364 | 384 | let updateState = IntegerEntry(keyWXUSDN, (totalStaked + ca)) | |
365 | 385 | let tc = IntegerEntry(keywxUsdnCompound, (fromCompound + ca)) | |
366 | 386 | [updateState, tc] | |
367 | 387 | } | |
368 | 388 | else throw("Strict value is not equal to itself.") | |
369 | 389 | } | |
370 | 390 | } | |
371 | 391 | ||
372 | 392 | ||
373 | 393 | ||
374 | 394 | @Callable(i) | |
375 | 395 | func compoundUsdtUsdnLP () = { | |
376 | 396 | let compound = value(i.payments[0]) | |
377 | 397 | let ca = compound.amount | |
378 | 398 | let isOracle = checkAddress(i.caller.bytes) | |
379 | 399 | if ((compound.assetId != usdtUsdnLP)) | |
380 | 400 | then throw("attach USDTUSDNLP tokens only") | |
381 | 401 | else if (!(isOracle)) | |
382 | 402 | then throw("You are not authotized to call this function") | |
383 | 403 | else { | |
384 | 404 | let fromCompound = valueOrElse(getInteger(this, keyCompound), 0) | |
385 | 405 | let totalStaked = valueOrElse(getInteger(this, keyStaked), 0) | |
386 | 406 | let stakeC = invoke(Address(base58'3PPNhHYkkEy13gRWDCaruQyhNbX2GrjYSyV'), "stake", nil, [compound]) | |
387 | 407 | if ((stakeC == stakeC)) | |
388 | 408 | then { | |
389 | 409 | let updateState = IntegerEntry(keyStaked, (totalStaked + ca)) | |
390 | 410 | let tc = IntegerEntry(keyCompound, (fromCompound + ca)) | |
391 | 411 | [updateState, tc] | |
392 | 412 | } | |
393 | 413 | else throw("Strict value is not equal to itself.") | |
394 | 414 | } | |
395 | 415 | } | |
396 | 416 | ||
397 | 417 | ||
398 | 418 | ||
399 | 419 | @Callable(i) | |
400 | 420 | func compoundUsdcUsdnLP () = { | |
401 | 421 | let compound = value(i.payments[0]) | |
402 | 422 | let ca = compound.amount | |
403 | 423 | let isOracle = checkAddress(i.caller.bytes) | |
404 | 424 | if ((compound.assetId != usdcUsdnLP)) | |
405 | 425 | then throw("attach USDCUSDNLP tokens only") | |
406 | 426 | else if (!(isOracle)) | |
407 | 427 | then throw("You are not authotized to call this function") | |
408 | 428 | else { | |
409 | 429 | let fromCompound = valueOrElse(getInteger(this, keyUsdcUsdnCompound), 0) | |
410 | 430 | let totalStaked = valueOrElse(getInteger(this, keyUSDCUSDN), 0) | |
411 | 431 | let stakeC = invoke(Address(base58'3PPNhHYkkEy13gRWDCaruQyhNbX2GrjYSyV'), "stake", nil, [compound]) | |
412 | 432 | if ((stakeC == stakeC)) | |
413 | 433 | then { | |
414 | 434 | let updateState = IntegerEntry(keyUSDCUSDN, (totalStaked + ca)) | |
415 | 435 | let tc = IntegerEntry(keyUsdcUsdnCompound, (fromCompound + ca)) | |
416 | 436 | [updateState, tc] | |
417 | 437 | } | |
418 | 438 | else throw("Strict value is not equal to itself.") | |
419 | 439 | } | |
420 | 440 | } | |
421 | 441 | ||
422 | 442 | ||
423 | 443 | ||
424 | 444 | @Callable(i) | |
425 | 445 | func compoundUsdcUsdtLP () = { | |
426 | 446 | let compound = value(i.payments[0]) | |
427 | 447 | let ca = compound.amount | |
428 | 448 | let isOracle = checkAddress(i.caller.bytes) | |
429 | 449 | if ((compound.assetId != usdcUsdtLP)) | |
430 | 450 | then throw("attach USDCUSDTLP tokens only") | |
431 | 451 | else if (!(isOracle)) | |
432 | 452 | then throw("You are not authotized to call this function") | |
433 | 453 | else { | |
434 | 454 | let fromCompound = valueOrElse(getInteger(this, keyUsdcUsdtCompound), 0) | |
435 | 455 | let totalStaked = valueOrElse(getInteger(this, keyUSDCUSDT), 0) | |
436 | 456 | let stakeC = invoke(Address(base58'3PPNhHYkkEy13gRWDCaruQyhNbX2GrjYSyV'), "stake", nil, [compound]) | |
437 | 457 | if ((stakeC == stakeC)) | |
438 | 458 | then { | |
439 | 459 | let updateState = IntegerEntry(keyUSDCUSDT, (totalStaked + ca)) | |
440 | 460 | let tc = IntegerEntry(keyUsdcUsdtCompound, (fromCompound + ca)) | |
441 | 461 | [updateState, tc] | |
442 | 462 | } | |
443 | 463 | else throw("Strict value is not equal to itself.") | |
444 | 464 | } | |
445 | 465 | } | |
446 | 466 | ||
447 | 467 | ||
448 | 468 | ||
449 | 469 | @Callable(i) | |
450 | 470 | func compoundPuzzleUsdnLP () = { | |
451 | 471 | let compound = value(i.payments[0]) | |
452 | 472 | let ca = compound.amount | |
453 | 473 | let isOracle = checkAddress(i.caller.bytes) | |
454 | 474 | if ((compound.assetId != puzzleUsdnLP)) | |
455 | 475 | then throw("attach PUZZLEUSDNLP tokens only") | |
456 | 476 | else if (!(isOracle)) | |
457 | 477 | then throw("You are not authotized to call this function") | |
458 | 478 | else { | |
459 | 479 | let fromCompound = valueOrElse(getInteger(this, keyPuzzleUsdnCompound), 0) | |
460 | 480 | let totalStaked = valueOrElse(getInteger(this, keyPUZZLEUSDN), 0) | |
461 | 481 | let stakeC = invoke(Address(base58'3PPNhHYkkEy13gRWDCaruQyhNbX2GrjYSyV'), "stake", nil, [compound]) | |
462 | 482 | if ((stakeC == stakeC)) | |
463 | 483 | then { | |
464 | 484 | let updateState = IntegerEntry(keyPUZZLEUSDN, (totalStaked + ca)) | |
465 | 485 | let tc = IntegerEntry(keyPuzzleUsdnCompound, (fromCompound + ca)) | |
466 | 486 | [updateState, tc] | |
467 | 487 | } | |
468 | 488 | else throw("Strict value is not equal to itself.") | |
469 | 489 | } | |
470 | 490 | } | |
471 | 491 | ||
472 | 492 | ||
473 | 493 | ||
474 | 494 | @Callable(i) | |
475 | 495 | func sponsorBoost () = { | |
476 | 496 | let pm = value(i.payments[0]) | |
477 | 497 | let lockPeriod = 100 | |
478 | 498 | if ((pm.assetId != wxId)) | |
479 | 499 | then throw("Error") | |
480 | 500 | else { | |
481 | 501 | let sponsored = valueOrElse(getInteger(this, keySponsorship), 0) | |
482 | 502 | let lock = invoke(Address(base58'3PJL8Hn8LACaSBWLQ3UVhctA5cTQLBFwBAP'), "increaseLock", [lockPeriod], [pm]) | |
483 | 503 | if ((lock == lock)) | |
484 | 504 | then { | |
485 | 505 | let s = IntegerEntry(keySponsorship, (pm.amount + sponsored)) | |
486 | 506 | [s] | |
487 | 507 | } | |
488 | 508 | else throw("Strict value is not equal to itself.") | |
489 | 509 | } | |
490 | 510 | } | |
491 | 511 | ||
492 | 512 | ||
493 | 513 | ||
494 | 514 | @Callable(i) | |
495 | 515 | func initWX () = { | |
496 | 516 | let pm = value(i.payments[0]) | |
497 | 517 | let am = pm.amount | |
498 | 518 | if ((pm.assetId != wxUsdnLP)) | |
499 | 519 | then throw("Unexpected token") | |
500 | 520 | else { | |
501 | 521 | let s = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pm]) | |
502 | 522 | if ((s == s)) | |
503 | 523 | then { | |
504 | 524 | let upd = IntegerEntry(keyWXUSDN, am) | |
505 | 525 | let updK = IntegerEntry(keywxUsdnCompound, 0) | |
506 | 526 | [upd, updK] | |
507 | 527 | } | |
508 | 528 | else throw("Strict value is not equal to itself.") | |
509 | 529 | } | |
510 | 530 | } | |
511 | 531 | ||
512 | 532 | ||
513 | 533 | @Verifier(tx) | |
514 | 534 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
515 | 535 |
github/deemru/w8io/026f985 45.75 ms ◑