tx · G656L6rdpNU1cUYQEjyQLLpQQ5v9vFk6De3XZLwRnLTu 3MymToccYDK8vuwr1LMzxVp51X6WmsafFit: -0.01400000 Waves 2020.10.27 23:53 [1239534] smart account 3MymToccYDK8vuwr1LMzxVp51X6WmsafFit > SELF 0.00000000 Waves
{ "type": 13, "id": "G656L6rdpNU1cUYQEjyQLLpQQ5v9vFk6De3XZLwRnLTu", "fee": 1400000, "feeAssetId": null, "timestamp": 1603831999982, "version": 1, "sender": "3MymToccYDK8vuwr1LMzxVp51X6WmsafFit", "senderPublicKey": "95zM5yLX9Tu2LveeQnFdr16kXErmdFxxv1zsy5BpUcc6", "proofs": [ "4QaoBgCsWuiHTXnXKEvVu7nvF4iNsWcFY1mNNu9D37nqhgWzrdQor3HCtyrki2Met7gtvoM8FnRRq8TCRABZEVTj" ], "script": "base64:AAIEAAAAAAAAAA8IAhIAEgASABIAEgMKAQEAAAASAAAAABFnb3Zlcm5hbmNlQWRkcmVzcwkBAAAAB0FkZHJlc3MAAAABAQAAABoBVF6YEMHl9HWSG0PCLWD9SJEGklQoyOQRRAAAAAAISWRUb2tlbkEJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMCAAAADWFzc2V0SWRUb2tlbkEAAAAACElkVG9rZW5CCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzAgAAAA1hc3NldElkVG9rZW5CAAAAAAxhbW91bnRUb2tlbkIJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAADGFtb3VudFRva2VuQgAAAAAMYW1vdW50VG9rZW5BCQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAAR0aGlzAgAAAAxhbW91bnRUb2tlbkEAAAAADElkVG9rZW5TaGFyZQkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwIAAAAOc2hhcmVfdG9rZW5faWQAAAAAEHRva2VuU2hhcmVTdXBwbH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AAFnRva2VuU2VuZEFtb3VudFdpdGhGZWUFAAAAE3Rva2VuU2VuZEdvdmVybmFuY2UJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAACmNvbnRleHRPYmoAAAAGY2FsbGVyBQAAABZ0b2tlblNlbmRBbW91bnRXaXRoRmVlBQAAAAthc3NldElkU2VuZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAABFnb3Zlcm5hbmNlQWRkcmVzcwUAAAATdG9rZW5TZW5kR292ZXJuYW5jZQUAAAALYXNzZXRJZFNlbmQFAAAAA25pbAkAAAIAAAABAgAAABRBc3NldCBpcyBub3QgYWxsb3dlZAAAAABZLpJa", "chainId": 84, "height": 1239534, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HzoFrGixaASNTb4Zi4armBqWtr7acxAcYcpu9GfvGPV8 Next: none Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let governanceAddress = Address(base58' | |
4 | + | let governanceAddress = Address(base58'3MxYFTeR3zyt474rNiKiMDh4Njpf8Mdt7um') | |
5 | 5 | ||
6 | 6 | let IdTokenA = getStringValue(this, "assetIdTokenA") | |
7 | 7 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let governanceAddress = Address(base58' | |
4 | + | let governanceAddress = Address(base58'3MxYFTeR3zyt474rNiKiMDh4Njpf8Mdt7um') | |
5 | 5 | ||
6 | 6 | let IdTokenA = getStringValue(this, "assetIdTokenA") | |
7 | 7 | ||
8 | 8 | let IdTokenB = getStringValue(this, "assetIdTokenB") | |
9 | 9 | ||
10 | 10 | let amountTokenB = getIntegerValue(this, "amountTokenB") | |
11 | 11 | ||
12 | 12 | let amountTokenA = getIntegerValue(this, "amountTokenA") | |
13 | 13 | ||
14 | 14 | let IdTokenShare = getStringValue(this, "share_token_id") | |
15 | 15 | ||
16 | 16 | let tokenShareSupply = getIntegerValue(this, "share_token_supply") | |
17 | 17 | ||
18 | 18 | let comission = 300 | |
19 | 19 | ||
20 | 20 | let commisionGovernance = 200 | |
21 | 21 | ||
22 | 22 | let comissionScaleDelimiter = 1000000 | |
23 | 23 | ||
24 | 24 | let version = "1.0.0" | |
25 | 25 | ||
26 | 26 | let scaleValue3 = 1000 | |
27 | 27 | ||
28 | 28 | let scaleValue8 = 100000000 | |
29 | 29 | ||
30 | 30 | let scaleValue8Digits = 8 | |
31 | 31 | ||
32 | 32 | func assetId (asset) = if ((asset == "WAVES")) | |
33 | 33 | then unit | |
34 | 34 | else fromBase58String(asset) | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | let assetIdTokenA = assetId(IdTokenA) | |
38 | 38 | ||
39 | 39 | let assetIdTokenB = assetId(IdTokenB) | |
40 | 40 | ||
41 | 41 | let assetIdTokenShare = fromBase58String(IdTokenShare) | |
42 | 42 | ||
43 | 43 | @Callable(contextObj) | |
44 | 44 | func fund () = { | |
45 | 45 | let paymentA = value(contextObj.payments[0]) | |
46 | 46 | let paymentB = value(contextObj.payments[1]) | |
47 | 47 | let assetIdReceivedA = paymentA.assetId | |
48 | 48 | let tokenReceiveAmountA = paymentA.amount | |
49 | 49 | let assetIdReceivedB = paymentB.assetId | |
50 | 50 | let tokenReceiveAmountB = paymentB.amount | |
51 | 51 | let digitTokenA = match assetIdReceivedA { | |
52 | 52 | case p: Unit => | |
53 | 53 | 8 | |
54 | 54 | case p: ByteVector => | |
55 | 55 | value(assetInfo(p)).decimals | |
56 | 56 | case _ => | |
57 | 57 | throw("Match error") | |
58 | 58 | } | |
59 | 59 | let digitTokenB = match assetIdReceivedB { | |
60 | 60 | case p: Unit => | |
61 | 61 | 8 | |
62 | 62 | case p: ByteVector => | |
63 | 63 | value(assetInfo(p)).decimals | |
64 | 64 | case _ => | |
65 | 65 | throw("Match error") | |
66 | 66 | } | |
67 | 67 | if (isDefined(getBoolean(this, "status"))) | |
68 | 68 | then throw("already active") | |
69 | 69 | else { | |
70 | 70 | let shareTokenName = ("ShareT_" + takeRight(toString(this), 5)) | |
71 | 71 | let digitsInShareToken = ((digitTokenA + digitTokenB) / 2) | |
72 | 72 | let shareTokenInitialAmount = fraction(pow(tokenReceiveAmountA, digitTokenA, 5, 1, digitTokenA, HALFDOWN), pow(tokenReceiveAmountB, digitTokenB, 5, 1, digitTokenB, HALFDOWN), pow(10, 0, digitsInShareToken, 0, 0, HALFDOWN)) | |
73 | 73 | let shareTokenAssetId = calculateAssetId(Issue(shareTokenName, shareTokenName, shareTokenInitialAmount, digitsInShareToken, true)) | |
74 | 74 | let assetIdTokenStringA = match assetIdReceivedA { | |
75 | 75 | case t: Unit => | |
76 | 76 | "WAVES" | |
77 | 77 | case t: ByteVector => | |
78 | 78 | toBase58String(value(assetIdReceivedA)) | |
79 | 79 | case _ => | |
80 | 80 | throw("Match error") | |
81 | 81 | } | |
82 | 82 | let assetIdTokenStringB = match assetIdReceivedB { | |
83 | 83 | case t: Unit => | |
84 | 84 | "WAVES" | |
85 | 85 | case t: ByteVector => | |
86 | 86 | toBase58String(value(assetIdReceivedB)) | |
87 | 87 | case _ => | |
88 | 88 | throw("Match error") | |
89 | 89 | } | |
90 | 90 | [IntegerEntry("amountTokenA", tokenReceiveAmountA), IntegerEntry("amountTokenB", tokenReceiveAmountB), StringEntry("assetIdTokenA", assetIdTokenStringA), StringEntry("assetIdTokenB", assetIdTokenStringB), BooleanEntry("status", true), IntegerEntry("comission", comission), IntegerEntry("comissionScaleDelimiter", comissionScaleDelimiter), StringEntry("version", version), Issue(shareTokenName, shareTokenName, shareTokenInitialAmount, digitsInShareToken, true), ScriptTransfer(contextObj.caller, shareTokenInitialAmount, shareTokenAssetId), StringEntry("share_token_id", toBase58String(shareTokenAssetId)), IntegerEntry("share_token_supply", shareTokenInitialAmount)] | |
91 | 91 | } | |
92 | 92 | } | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | ||
96 | 96 | @Callable(contextObj) | |
97 | 97 | func replenishmentWithTwoToken () = { | |
98 | 98 | let paymentA = value(contextObj.payments[0]) | |
99 | 99 | let paymentB = value(contextObj.payments[1]) | |
100 | 100 | let assetIdReceivedA = paymentA.assetId | |
101 | 101 | let tokenReceiveAmountA = paymentA.amount | |
102 | 102 | let assetIdReceivedB = paymentB.assetId | |
103 | 103 | let tokenReceiveAmountB = paymentB.amount | |
104 | 104 | let dAppTokensAmountA = getIntegerValue(this, "amountTokenA") | |
105 | 105 | let dAppTokensAmountB = getIntegerValue(this, "amountTokenB") | |
106 | 106 | if (if ((assetIdReceivedA != assetIdTokenA)) | |
107 | 107 | then true | |
108 | 108 | else (assetIdReceivedB != assetIdTokenB)) | |
109 | 109 | then throw("incorrect assets") | |
110 | 110 | else { | |
111 | 111 | let tokenRatio = (fraction(dAppTokensAmountA, (1000000000000 * scaleValue3), tokenReceiveAmountA) / fraction(dAppTokensAmountB, 1000000000000, tokenReceiveAmountB)) | |
112 | 112 | if (!((tokenRatio == scaleValue3))) | |
113 | 113 | then throw("incorrect assets amount: amounts must have the contract ratio") | |
114 | 114 | else { | |
115 | 115 | let shareTokenToPayAmount = fraction(tokenReceiveAmountA, tokenShareSupply, dAppTokensAmountA) | |
116 | 116 | if ((shareTokenToPayAmount == 0)) | |
117 | 117 | then throw("you try replansish with very small amount") | |
118 | 118 | else [Reissue(assetIdTokenShare, shareTokenToPayAmount, true), ScriptTransfer(contextObj.caller, shareTokenToPayAmount, assetIdTokenShare), IntegerEntry("share_token_supply", (tokenShareSupply + shareTokenToPayAmount)), IntegerEntry("amountTokenA", (dAppTokensAmountA + tokenReceiveAmountA)), IntegerEntry("amountTokenB", (dAppTokensAmountB + tokenReceiveAmountB))] | |
119 | 119 | } | |
120 | 120 | } | |
121 | 121 | } | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | ||
125 | 125 | @Callable(contextObj) | |
126 | 126 | func replanishmentWithOneToken () = { | |
127 | 127 | let payment = value(contextObj.payments[0]) | |
128 | 128 | let assetIdReceived = payment.assetId | |
129 | 129 | let tokenReceiveAmount = payment.amount | |
130 | 130 | if ((assetIdReceived == assetIdTokenA)) | |
131 | 131 | then { | |
132 | 132 | let newAmountTokenA = (amountTokenA + tokenReceiveAmount) | |
133 | 133 | let priceAtoBwith8digits = fraction(newAmountTokenA, scaleValue8, amountTokenB) | |
134 | 134 | let tokenAmountBNewPriceOldInvariant = pow(fraction(amountTokenA, amountTokenB, priceAtoBwith8digits), 0, 5, 1, 0, HALFDOWN) | |
135 | 135 | let newTokenShareSupply = fraction(amountTokenB, tokenShareSupply, tokenAmountBNewPriceOldInvariant) | |
136 | 136 | let shareTokenToPayAmount = (newTokenShareSupply - tokenShareSupply) | |
137 | 137 | [Reissue(assetIdTokenShare, shareTokenToPayAmount, true), ScriptTransfer(contextObj.caller, shareTokenToPayAmount, assetIdTokenShare), IntegerEntry("share_token_supply", (tokenShareSupply + shareTokenToPayAmount)), IntegerEntry("amountTokenA", newAmountTokenA)] | |
138 | 138 | } | |
139 | 139 | else if ((assetIdReceived == assetIdTokenB)) | |
140 | 140 | then { | |
141 | 141 | let newAmountTokenB = (amountTokenB + tokenReceiveAmount) | |
142 | 142 | let priceAtoBwith8digits = fraction(amountTokenA, scaleValue8, newAmountTokenB) | |
143 | 143 | let tokenAmountBNewPriceOldInvariant = pow(fraction(amountTokenA, amountTokenB, priceAtoBwith8digits), 0, 5, 1, 0, HALFDOWN) | |
144 | 144 | let newTokenShareSupply = fraction(amountTokenB, tokenShareSupply, tokenAmountBNewPriceOldInvariant) | |
145 | 145 | let shareTokenToPayAmount = (newTokenShareSupply - tokenShareSupply) | |
146 | 146 | [Reissue(assetIdTokenShare, shareTokenToPayAmount, true), ScriptTransfer(contextObj.caller, shareTokenToPayAmount, assetIdTokenShare), IntegerEntry("share_token_supply", (tokenShareSupply + shareTokenToPayAmount)), IntegerEntry("amountTokenB", newAmountTokenB)] | |
147 | 147 | } | |
148 | 148 | else throw("incorrect assets in payment") | |
149 | 149 | } | |
150 | 150 | ||
151 | 151 | ||
152 | 152 | ||
153 | 153 | @Callable(contextObj) | |
154 | 154 | func withdraw () = { | |
155 | 155 | let dAppTokensAmountA = getIntegerValue(this, "amountTokenA") | |
156 | 156 | let dAppTokensAmountB = getIntegerValue(this, "amountTokenB") | |
157 | 157 | let payment = value(contextObj.payments[0]) | |
158 | 158 | let assetIdReceived = payment.assetId | |
159 | 159 | let tokenReceiveAmount = payment.amount | |
160 | 160 | if ((assetIdTokenShare != assetIdReceived)) | |
161 | 161 | then throw(("you need to attach share token for this dApp " + toBase58String(assetIdTokenShare))) | |
162 | 162 | else { | |
163 | 163 | let tokensToPayA = fraction(tokenReceiveAmount, dAppTokensAmountA, tokenShareSupply) | |
164 | 164 | let tokensToPayB = fraction(tokenReceiveAmount, dAppTokensAmountB, tokenShareSupply) | |
165 | 165 | if ((getBooleanValue(this, "status") != true)) | |
166 | 166 | then throw("status: Unactive") | |
167 | 167 | else [ScriptTransfer(contextObj.caller, tokensToPayA, assetIdTokenA), ScriptTransfer(contextObj.caller, tokensToPayB, assetIdTokenB), IntegerEntry("amountTokenA", (dAppTokensAmountA - tokensToPayA)), IntegerEntry("amountTokenB", (dAppTokensAmountB - tokensToPayB)), IntegerEntry("share_token_supply", (tokenShareSupply - tokenReceiveAmount)), Burn(assetIdTokenShare, tokenReceiveAmount)] | |
168 | 168 | } | |
169 | 169 | } | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | ||
173 | 173 | @Callable(contextObj) | |
174 | 174 | func exchanger (minTokenRecieve) = { | |
175 | 175 | let payment = value(contextObj.payments[0]) | |
176 | 176 | let assetIdReceived = payment.assetId | |
177 | 177 | let tokenReceiveAmount = payment.amount | |
178 | 178 | if ((getBooleanValue(this, "status") != true)) | |
179 | 179 | then throw("status: Unactive") | |
180 | 180 | else if ((assetIdReceived == assetIdTokenB)) | |
181 | 181 | then { | |
182 | 182 | let tokenSendAmountWithoutFee = fraction(amountTokenA, tokenReceiveAmount, (tokenReceiveAmount + amountTokenB)) | |
183 | 183 | let tokenSendAmountWithFee = fraction(tokenSendAmountWithoutFee, (comissionScaleDelimiter - comission), comissionScaleDelimiter) | |
184 | 184 | let tokenSendGovernance = fraction(tokenSendAmountWithoutFee, commisionGovernance, comissionScaleDelimiter) | |
185 | 185 | if ((minTokenRecieve > tokenSendAmountWithFee)) | |
186 | 186 | then throw("Price has changed dramaticaly. Receiving token amount don't satisfy specified price level") | |
187 | 187 | else { | |
188 | 188 | let assetIdSend = assetIdTokenA | |
189 | 189 | [IntegerEntry("amountTokenA", ((amountTokenA - tokenSendAmountWithFee) - tokenSendGovernance)), IntegerEntry("amountTokenB", (amountTokenB + tokenReceiveAmount)), ScriptTransfer(contextObj.caller, tokenSendAmountWithFee, assetIdSend), ScriptTransfer(governanceAddress, tokenSendGovernance, assetIdSend)] | |
190 | 190 | } | |
191 | 191 | } | |
192 | 192 | else if ((assetIdReceived == assetIdTokenA)) | |
193 | 193 | then { | |
194 | 194 | let tokenSendAmountWithoutFee = fraction(amountTokenB, tokenReceiveAmount, (tokenReceiveAmount + amountTokenA)) | |
195 | 195 | let tokenSendAmountWithFee = fraction(tokenSendAmountWithoutFee, (comissionScaleDelimiter - comission), comissionScaleDelimiter) | |
196 | 196 | let tokenSendGovernance = fraction(tokenSendAmountWithoutFee, commisionGovernance, comissionScaleDelimiter) | |
197 | 197 | if ((minTokenRecieve > tokenSendAmountWithFee)) | |
198 | 198 | then throw("Price has changed dramaticaly. Receiving token amount don't satisfy specified price level") | |
199 | 199 | else { | |
200 | 200 | let assetIdSend = assetIdTokenB | |
201 | 201 | [IntegerEntry("amountTokenA", (amountTokenA + tokenReceiveAmount)), IntegerEntry("amountTokenB", ((amountTokenB - tokenSendAmountWithFee) - tokenSendGovernance)), ScriptTransfer(contextObj.caller, tokenSendAmountWithFee, assetIdSend), ScriptTransfer(governanceAddress, tokenSendGovernance, assetIdSend)] | |
202 | 202 | } | |
203 | 203 | } | |
204 | 204 | else throw("Asset is not allowed") | |
205 | 205 | } | |
206 | 206 | ||
207 | 207 |
github/deemru/w8io/169f3d6 114.87 ms ◑