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