tx · A36CzN5PtZoatuZk8B5r2K4kCdPVyE9dro8BRtR9pn2N

3MrmQcYkqD2NWZCPBPxJh9ecDeCSHJaGvTX:  -0.01400000 Waves

2020.10.22 15:19 [1231770] smart account 3MrmQcYkqD2NWZCPBPxJh9ecDeCSHJaGvTX > SELF 0.00000000 Waves

{ "type": 13, "id": "A36CzN5PtZoatuZk8B5r2K4kCdPVyE9dro8BRtR9pn2N", "fee": 1400000, "feeAssetId": null, "timestamp": 1603369258718, "version": 1, "sender": "3MrmQcYkqD2NWZCPBPxJh9ecDeCSHJaGvTX", "senderPublicKey": "3jFYpyJ6e4HkngCSjP4y8XmWbp72HQExbfLDVKd4wZrr", "proofs": [ "4UaCPn95YMy8ARhsgcWTBoRQHdhw3WiGdFTwFGtDE614SV5QRCxkTbBLzSDYENMoauimfog1qe98zfsbhsh61odJ" ], "script": "base64:AAIEAAAAAAAAAA8IAhIAEgASABIAEgMKAQEAAAAQAAAAAAhJZFRva2VuQQkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwIAAAANYXNzZXRJZFRva2VuQQAAAAAISWRUb2tlbkIJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMCAAAADWFzc2V0SWRUb2tlbkIAAAAADGFtb3VudFRva2VuQgkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwIAAAAMYW1vdW50VG9rZW5CAAAAAAxhbW91bnRUb2tlbkEJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAADGFtb3VudFRva2VuQQAAAAARYXNzZXRJZFRva2VuU2hhcmUJAQAAABFAZXh0ck5hdGl2ZSgxMDUyKQAAAAIFAAAABHRoaXMCAAAADnNoYXJlX3Rva2VuX2lkAAAAABB0b2tlblNoYXJlU3VwcGx5CQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAAR0aGlzAgAAABJzaGFyZV90b2tlbl9z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AA1hc3NldElkVG9rZW5CCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAxhbW91bnRUb2tlbkEJAABkAAAAAgUAAAAMYW1vdW50VG9rZW5BBQAAABJ0b2tlblJlY2VpdmVBbW91bnQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAADGFtb3VudFRva2VuQgkAAGUAAAACBQAAAAxhbW91bnRUb2tlbkIFAAAAD3Rva2VuU2VuZEFtb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAOZXhjaGFuZ2VfY291bnQJAABkAAAAAgUAAAAFY291bnQAAAAAAAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAACmNvbnRleHRPYmoAAAAGY2FsbGVyBQAAAA90b2tlblNlbmRBbW91bnQFAAAAC2Fzc2V0SWRTZW50BQAAAANuaWwJAAACAAAAAQIAAAAUQXNzZXQgaXMgbm90IGFsbG93ZWQAAAAA2SK/xA==", "chainId": 84, "height": 1231770, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HJ9G3mZog1J8YYE5wAhod9juvn9GQb1MoJ8uPvBGcee Next: AzFFD6fcQsypHMNtruEw8Y8wt2g5JyP2GNbPqZsGGjD8 Diff:
OldNewDifferences
1313
1414 let tokenShareSupply = getIntegerValue(this, "share_token_supply")
1515
16-let comission = 2000
16+let comission = 500
1717
18-let comissionScaleDelimiter = 10000
18+let comissionScaleDelimiter = 1000000
1919
20-let version = "0.0.2"
20+let version = "1.0.0"
2121
2222 let scaleValue8 = 100000000
23+
24+let ratioThresholdMax = 100000000
25+
26+let ratioThresholdMin = 99999000
2327
2428 let scaleValue8Digits = 8
2529
7983 case _ =>
8084 throw("Match error")
8185 }
82-[IntegerEntry("amountTokenA", tokenReceiveAmountA), IntegerEntry("amountTokenB", tokenReceiveAmountB), StringEntry("assetIdTokenA", assetIdTokenStringA), StringEntry("assetIdTokenB", assetIdTokenStringB), IntegerEntry("exchange_count", 0), BooleanEntry("status", true), IntegerEntry("comission", comission), IntegerEntry("comissionScaleDelimiter", comissionScaleDelimiter), StringEntry("version", version), Issue(shareTokenName, shareTokenName, shareTokenInitialAmount, 8, true), ScriptTransfer(contextObj.caller, shareTokenInitialAmount, shareTokenAssetId), BinaryEntry("share_token_id", shareTokenAssetId), IntegerEntry("share_token_supply", shareTokenInitialAmount)]
86+[IntegerEntry("amountTokenA", tokenReceiveAmountA), IntegerEntry("amountTokenB", tokenReceiveAmountB), StringEntry("assetIdTokenA", assetIdTokenStringA), StringEntry("assetIdTokenB", assetIdTokenStringB), IntegerEntry("exchange_count", 0), BooleanEntry("status", true), IntegerEntry("comission", comission), IntegerEntry("comissionScaleDelimiter", comissionScaleDelimiter), StringEntry("version", version), Issue(shareTokenName, shareTokenName, shareTokenInitialAmount, digitsInShareToken, true), ScriptTransfer(contextObj.caller, shareTokenInitialAmount, shareTokenAssetId), BinaryEntry("share_token_id", shareTokenAssetId), IntegerEntry("share_token_supply", shareTokenInitialAmount)]
8387 }
8488 }
8589
112116 else [Reissue(assetIdTokenShare, shareTokenToPayAmount, true), ScriptTransfer(contextObj.caller, shareTokenToPayAmount, assetIdTokenShare), IntegerEntry("share_token_supply", (tokenShareSupply + shareTokenToPayAmount)), IntegerEntry("amountTokenA", (dAppTokensAmountA + tokenReceiveAmountA)), IntegerEntry("amountTokenB", (dAppTokensAmountB + tokenReceiveAmountB))]
113117 }
114118 }
119+ }
120+
121+
122+
123+@Callable(contextObj)
124+func replanishmentWithOneToken () = {
125+ let payment = value(contextObj.payments[0])
126+ let assetIdReceived = payment.assetId
127+ let tokenReceiveAmount = payment.amount
128+ if ((assetIdReceived == assetIdTokenA))
129+ then {
130+ let newAmountTokenA = (amountTokenA + tokenReceiveAmount)
131+ let priceAtoBwith8digits = fraction(newAmountTokenA, scaleValue8, amountTokenB)
132+ let tokenAmountBNewPriceOldInvariant = pow(fraction(amountTokenA, amountTokenB, priceAtoBwith8digits), 0, 5, 1, 0, HALFDOWN)
133+ let newTokenShareSupply = fraction(amountTokenB, tokenShareSupply, tokenAmountBNewPriceOldInvariant)
134+ let shareTokenToPayAmount = (newTokenShareSupply - tokenShareSupply)
135+[Reissue(assetIdTokenShare, shareTokenToPayAmount, true), ScriptTransfer(contextObj.caller, shareTokenToPayAmount, assetIdTokenShare), IntegerEntry("share_token_supply", (tokenShareSupply + shareTokenToPayAmount)), IntegerEntry("amountTokenA", newAmountTokenA)]
136+ }
137+ else if ((assetIdReceived == assetIdTokenB))
138+ then {
139+ let newAmountTokenB = (amountTokenB + tokenReceiveAmount)
140+ let priceAtoBwith8digits = fraction(amountTokenA, scaleValue8, newAmountTokenB)
141+ let tokenAmountBNewPriceOldInvariant = pow(fraction(amountTokenA, amountTokenB, priceAtoBwith8digits), 0, 5, 1, 0, HALFDOWN)
142+ let newTokenShareSupply = fraction(amountTokenB, tokenShareSupply, tokenAmountBNewPriceOldInvariant)
143+ let shareTokenToPayAmount = (newTokenShareSupply - tokenShareSupply)
144+[Reissue(assetIdTokenShare, shareTokenToPayAmount, true), ScriptTransfer(contextObj.caller, shareTokenToPayAmount, assetIdTokenShare), IntegerEntry("share_token_supply", (tokenShareSupply + shareTokenToPayAmount)), IntegerEntry("amountTokenB", newAmountTokenB)]
145+ }
146+ else throw("incorrect assets in payment")
115147 }
116148
117149
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let IdTokenA = getStringValue(this, "assetIdTokenA")
55
66 let IdTokenB = getStringValue(this, "assetIdTokenB")
77
88 let amountTokenB = getIntegerValue(this, "amountTokenB")
99
1010 let amountTokenA = getIntegerValue(this, "amountTokenA")
1111
1212 let assetIdTokenShare = getBinaryValue(this, "share_token_id")
1313
1414 let tokenShareSupply = getIntegerValue(this, "share_token_supply")
1515
16-let comission = 2000
16+let comission = 500
1717
18-let comissionScaleDelimiter = 10000
18+let comissionScaleDelimiter = 1000000
1919
20-let version = "0.0.2"
20+let version = "1.0.0"
2121
2222 let scaleValue8 = 100000000
23+
24+let ratioThresholdMax = 100000000
25+
26+let ratioThresholdMin = 99999000
2327
2428 let scaleValue8Digits = 8
2529
2630 func assetId (asset) = if ((asset == "WAVES"))
2731 then unit
2832 else fromBase58String(asset)
2933
3034
3135 let assetIdTokenA = assetId(IdTokenA)
3236
3337 let assetIdTokenB = assetId(IdTokenB)
3438
3539 @Callable(contextObj)
3640 func fund () = {
3741 let paymentA = value(contextObj.payments[0])
3842 let paymentB = value(contextObj.payments[1])
3943 let assetIdReceivedA = paymentA.assetId
4044 let tokenReceiveAmountA = paymentA.amount
4145 let assetIdReceivedB = paymentB.assetId
4246 let tokenReceiveAmountB = paymentB.amount
4347 let digitTokenA = match assetIdReceivedA {
4448 case p: Unit =>
4549 8
4650 case p: ByteVector =>
4751 value(assetInfo(p)).decimals
4852 case _ =>
4953 throw("Match error")
5054 }
5155 let digitTokenB = match assetIdReceivedB {
5256 case p: Unit =>
5357 8
5458 case p: ByteVector =>
5559 value(assetInfo(p)).decimals
5660 case _ =>
5761 throw("Match error")
5862 }
5963 if (isDefined(getBoolean(this, "status")))
6064 then throw("already active")
6165 else {
6266 let shareTokenName = ("ShareT_" + takeRight(toString(this), 5))
6367 let digitsInShareToken = ((digitTokenA + digitTokenB) / 2)
6468 let shareTokenInitialAmount = fraction(pow(tokenReceiveAmountA, digitTokenA, 5, 1, digitTokenA, HALFDOWN), pow(tokenReceiveAmountB, digitTokenB, 5, 1, digitTokenB, HALFDOWN), pow(10, 0, digitsInShareToken, 0, 0, HALFDOWN))
6569 let shareTokenAssetId = calculateAssetId(Issue(shareTokenName, shareTokenName, shareTokenInitialAmount, digitsInShareToken, true))
6670 let assetIdTokenStringA = match assetIdReceivedA {
6771 case t: Unit =>
6872 "WAVES"
6973 case t: ByteVector =>
7074 toBase58String(value(assetIdReceivedA))
7175 case _ =>
7276 throw("Match error")
7377 }
7478 let assetIdTokenStringB = match assetIdReceivedB {
7579 case t: Unit =>
7680 "WAVES"
7781 case t: ByteVector =>
7882 toBase58String(value(assetIdReceivedB))
7983 case _ =>
8084 throw("Match error")
8185 }
82-[IntegerEntry("amountTokenA", tokenReceiveAmountA), IntegerEntry("amountTokenB", tokenReceiveAmountB), StringEntry("assetIdTokenA", assetIdTokenStringA), StringEntry("assetIdTokenB", assetIdTokenStringB), IntegerEntry("exchange_count", 0), BooleanEntry("status", true), IntegerEntry("comission", comission), IntegerEntry("comissionScaleDelimiter", comissionScaleDelimiter), StringEntry("version", version), Issue(shareTokenName, shareTokenName, shareTokenInitialAmount, 8, true), ScriptTransfer(contextObj.caller, shareTokenInitialAmount, shareTokenAssetId), BinaryEntry("share_token_id", shareTokenAssetId), IntegerEntry("share_token_supply", shareTokenInitialAmount)]
86+[IntegerEntry("amountTokenA", tokenReceiveAmountA), IntegerEntry("amountTokenB", tokenReceiveAmountB), StringEntry("assetIdTokenA", assetIdTokenStringA), StringEntry("assetIdTokenB", assetIdTokenStringB), IntegerEntry("exchange_count", 0), BooleanEntry("status", true), IntegerEntry("comission", comission), IntegerEntry("comissionScaleDelimiter", comissionScaleDelimiter), StringEntry("version", version), Issue(shareTokenName, shareTokenName, shareTokenInitialAmount, digitsInShareToken, true), ScriptTransfer(contextObj.caller, shareTokenInitialAmount, shareTokenAssetId), BinaryEntry("share_token_id", shareTokenAssetId), IntegerEntry("share_token_supply", shareTokenInitialAmount)]
8387 }
8488 }
8589
8690
8791
8892 @Callable(contextObj)
8993 func replenishment () = {
9094 let paymentA = value(contextObj.payments[0])
9195 let paymentB = value(contextObj.payments[1])
9296 let assetIdReceivedA = paymentA.assetId
9397 let tokenReceiveAmountA = paymentA.amount
9498 let assetIdReceivedB = paymentB.assetId
9599 let tokenReceiveAmountB = paymentB.amount
96100 let dAppTokensAmountA = getIntegerValue(this, "amountTokenA")
97101 let dAppTokensAmountB = getIntegerValue(this, "amountTokenB")
98102 if (if ((assetIdReceivedA != assetIdTokenA))
99103 then true
100104 else (assetIdReceivedB != assetIdTokenB))
101105 then throw("incorrect assets")
102106 else {
103107 let tokenRatio = (fraction(tokenReceiveAmountA, (1000000000000 * 100000), dAppTokensAmountA) / fraction(dAppTokensAmountB, 1000000000000, tokenReceiveAmountB))
104108 if (!(if ((tokenRatio > 99990))
105109 then (100010 > tokenRatio)
106110 else false))
107111 then throw("incorrect assets amount")
108112 else {
109113 let shareTokenToPayAmount = fraction(tokenReceiveAmountA, tokenShareSupply, dAppTokensAmountA)
110114 if ((shareTokenToPayAmount == 0))
111115 then throw("you try replansish with very small amount")
112116 else [Reissue(assetIdTokenShare, shareTokenToPayAmount, true), ScriptTransfer(contextObj.caller, shareTokenToPayAmount, assetIdTokenShare), IntegerEntry("share_token_supply", (tokenShareSupply + shareTokenToPayAmount)), IntegerEntry("amountTokenA", (dAppTokensAmountA + tokenReceiveAmountA)), IntegerEntry("amountTokenB", (dAppTokensAmountB + tokenReceiveAmountB))]
113117 }
114118 }
119+ }
120+
121+
122+
123+@Callable(contextObj)
124+func replanishmentWithOneToken () = {
125+ let payment = value(contextObj.payments[0])
126+ let assetIdReceived = payment.assetId
127+ let tokenReceiveAmount = payment.amount
128+ if ((assetIdReceived == assetIdTokenA))
129+ then {
130+ let newAmountTokenA = (amountTokenA + tokenReceiveAmount)
131+ let priceAtoBwith8digits = fraction(newAmountTokenA, scaleValue8, amountTokenB)
132+ let tokenAmountBNewPriceOldInvariant = pow(fraction(amountTokenA, amountTokenB, priceAtoBwith8digits), 0, 5, 1, 0, HALFDOWN)
133+ let newTokenShareSupply = fraction(amountTokenB, tokenShareSupply, tokenAmountBNewPriceOldInvariant)
134+ let shareTokenToPayAmount = (newTokenShareSupply - tokenShareSupply)
135+[Reissue(assetIdTokenShare, shareTokenToPayAmount, true), ScriptTransfer(contextObj.caller, shareTokenToPayAmount, assetIdTokenShare), IntegerEntry("share_token_supply", (tokenShareSupply + shareTokenToPayAmount)), IntegerEntry("amountTokenA", newAmountTokenA)]
136+ }
137+ else if ((assetIdReceived == assetIdTokenB))
138+ then {
139+ let newAmountTokenB = (amountTokenB + tokenReceiveAmount)
140+ let priceAtoBwith8digits = fraction(amountTokenA, scaleValue8, newAmountTokenB)
141+ let tokenAmountBNewPriceOldInvariant = pow(fraction(amountTokenA, amountTokenB, priceAtoBwith8digits), 0, 5, 1, 0, HALFDOWN)
142+ let newTokenShareSupply = fraction(amountTokenB, tokenShareSupply, tokenAmountBNewPriceOldInvariant)
143+ let shareTokenToPayAmount = (newTokenShareSupply - tokenShareSupply)
144+[Reissue(assetIdTokenShare, shareTokenToPayAmount, true), ScriptTransfer(contextObj.caller, shareTokenToPayAmount, assetIdTokenShare), IntegerEntry("share_token_supply", (tokenShareSupply + shareTokenToPayAmount)), IntegerEntry("amountTokenB", newAmountTokenB)]
145+ }
146+ else throw("incorrect assets in payment")
115147 }
116148
117149
118150
119151 @Callable(contextObj)
120152 func withdraw () = {
121153 let dAppTokensAmountA = getIntegerValue(this, "amountTokenA")
122154 let dAppTokensAmountB = getIntegerValue(this, "amountTokenB")
123155 let payment = value(contextObj.payments[0])
124156 let assetIdReceived = payment.assetId
125157 let tokenReceiveAmount = payment.amount
126158 if ((assetIdTokenShare != assetIdReceived))
127159 then throw(("you need to attach share token for this dApp " + toBase58String(assetIdTokenShare)))
128160 else {
129161 let tokensToPayA = fraction(tokenReceiveAmount, dAppTokensAmountA, tokenShareSupply)
130162 let tokensToPayB = fraction(tokenReceiveAmount, dAppTokensAmountB, tokenShareSupply)
131163 [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)]
132164 }
133165 }
134166
135167
136168
137169 @Callable(contextObj)
138170 func exchanger (minTokenRecieve) = {
139171 let payment = value(contextObj.payments[0])
140172 let assetIdReceived = payment.assetId
141173 let tokenReceiveAmount = payment.amount
142174 let count = value(getInteger(this, "exchange_count"))
143175 if ((assetIdReceived == assetIdTokenB))
144176 then {
145177 let tokenSendAmount = ((fraction(amountTokenA, tokenReceiveAmount, (tokenReceiveAmount + amountTokenB)) * (comissionScaleDelimiter - comission)) / comissionScaleDelimiter)
146178 if ((minTokenRecieve > tokenSendAmount))
147179 then throw("Price has changed dramaticaly. Receiving token amount don't satisfy specified price level")
148180 else {
149181 let assetIdSent = assetIdTokenA
150182 [IntegerEntry("amountTokenA", (amountTokenA - tokenSendAmount)), IntegerEntry("amountTokenB", (amountTokenB + tokenReceiveAmount)), IntegerEntry("exchange_count", (count + 1)), ScriptTransfer(contextObj.caller, tokenSendAmount, assetIdSent)]
151183 }
152184 }
153185 else if ((assetIdReceived == assetIdTokenA))
154186 then {
155187 let tokenSendAmount = ((fraction(amountTokenB, tokenReceiveAmount, (tokenReceiveAmount + amountTokenA)) * (comissionScaleDelimiter - comission)) / comissionScaleDelimiter)
156188 if ((minTokenRecieve > tokenSendAmount))
157189 then throw("Price has changed dramaticaly. Receiving token amount don't satisfy specified price level")
158190 else {
159191 let assetIdSent = assetIdTokenB
160192 [IntegerEntry("amountTokenA", (amountTokenA + tokenReceiveAmount)), IntegerEntry("amountTokenB", (amountTokenB - tokenSendAmount)), IntegerEntry("exchange_count", (count + 1)), ScriptTransfer(contextObj.caller, tokenSendAmount, assetIdSent)]
161193 }
162194 }
163195 else throw("Asset is not allowed")
164196 }
165197
166198

github/deemru/w8io/026f985 
53.54 ms