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