tx · CfzPho1k357tX7VFc1RgM8d8LuqNX9mK6yKegjxDcsUd 3N38SpkeVviCgRf2LWTpahvE6JKg3yrrkgN: -0.01400000 Waves 2020.09.11 13:20 [1172527] smart account 3N38SpkeVviCgRf2LWTpahvE6JKg3yrrkgN > SELF 0.00000000 Waves
{ "type": 13, "id": "CfzPho1k357tX7VFc1RgM8d8LuqNX9mK6yKegjxDcsUd", "fee": 1400000, "feeAssetId": null, "timestamp": 1599819667068, "version": 1, "sender": "3N38SpkeVviCgRf2LWTpahvE6JKg3yrrkgN", "senderPublicKey": "AFxdzRLfjLbKYeqXAbCEK1b8bpLJqAF5HU4B8a8RmxDX", "proofs": [ "5n4uXJWGjkeeBocyhgJT1KV1DmGpLctXLiM1WmP4hTUdiWLgK4Ppx43biGNgM6PWif7p9fYSSrFfJsf92ugGwTMX" ], "script": "base64:AAIEAAAAAAAAAA0IAhIAEgASABIDCgEBAAAACQAAAAAISWRUb2tlbkEJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMCAAAADWFzc2V0SWRUb2tlbkEAAAAACElkVG9rZW5CCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzAgAAAA1hc3NldElkVG9rZW5CAAAAABFhc3NldElkVG9rZW5TaGFyZQkBAAAAEUBleHRyTmF0aXZlKDEwNTIpAAAAAgUAAAAEdGhpcwIAAAAOc2hhcmVfdG9rZW5faWQAAAAAEHRva2VuU2hhcmVTdXBwbHkJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAAEnNoYXJlX3Rva2VuX3N1cHBseQAAAAAJY29taXNzaW9uAAAAAAAAAAAAAAAAAAd2ZXJzaW9uAgAAAAUwLjAuMgEAAAAHYXNzZXRJZAAAAAEAAAAFYXNzZXQDCQAAAAAAAAIFAAAABWFzc2V0AgAAAAVXQVZFUwUAAAAEdW5pdAkAAlkAAAABBQAAAAVhc3NldAAAAAANYXNzZXRJZF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tb3VudAkAAGQAAAACBQAAABJ0b2tlblJlY2VpdmVBbW91bnQFAAAADGFtb3VudFRva2VuQQkAAGUAAAACAAAAAAAAAABkBQAAAAljb21pc3Npb24AAAAAAAAAAGQDCQAAZgAAAAIFAAAAD21pblRva2VuUmVjaWV2ZQUAAAAPdG9rZW5TZW5kQW1vdW50CQAAAgAAAAECAAAAWVByaWNlIGhhcyBjaGFuZ2VkIGRyYW1hdGljYWx5LiBSZWNlaXZpbmcgdG9rZW4gYW1vdW50IGRvbid0IHNhdGlzZnkgc3BlY2lmaWVkIHByaWNlIGxldmVsBAAAAAthc3NldElkU2VudAUAAAANYXNzZXRJZFRva2VuQgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAMYW1vdW50VG9rZW5BCQAAZAAAAAIFAAAADGFtb3VudFRva2VuQQUAAAASdG9rZW5SZWNlaXZlQW1vdW50CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAxhbW91bnRUb2tlbkIJAABlAAAAAgUAAAAMYW1vdW50VG9rZW5CBQAAAA90b2tlblNlbmRBbW91bnQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAADmV4Y2hhbmdlX2NvdW50CQAAZAAAAAIFAAAABWNvdW50AAAAAAAAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAApjb250ZXh0T2JqAAAABmNhbGxlcgUAAAAPdG9rZW5TZW5kQW1vdW50BQAAAAthc3NldElkU2VudAUAAAADbmlsCQAAAgAAAAECAAAAFEFzc2V0IGlzIG5vdCBhbGxvd2VkAAAAALC7exw=", "chainId": 84, "height": 1172527, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 4 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let IdTokenA = getStringValue(this, "assetIdTokenA") | |
5 | + | ||
6 | + | let IdTokenB = getStringValue(this, "assetIdTokenB") | |
7 | + | ||
8 | + | let assetIdTokenShare = getBinaryValue(this, "share_token_id") | |
9 | + | ||
10 | + | let tokenShareSupply = getIntegerValue(this, "share_token_supply") | |
11 | + | ||
12 | + | let comission = 0 | |
13 | + | ||
14 | + | let version = "0.0.2" | |
15 | + | ||
16 | + | func assetId (asset) = if ((asset == "WAVES")) | |
17 | + | then unit | |
18 | + | else fromBase58String(asset) | |
19 | + | ||
20 | + | ||
21 | + | let assetIdTokenA = assetId(IdTokenA) | |
22 | + | ||
23 | + | let assetIdTokenB = assetId(IdTokenB) | |
24 | + | ||
25 | + | @Callable(contextObj) | |
26 | + | func fund () = { | |
27 | + | let paymentA = value(contextObj.payments[0]) | |
28 | + | let paymentB = value(contextObj.payments[1]) | |
29 | + | let assetIdReceivedA = paymentA.assetId | |
30 | + | let tokenReceiveAmountA = paymentA.amount | |
31 | + | let assetIdReceivedB = paymentB.assetId | |
32 | + | let tokenReceiveAmountB = paymentB.amount | |
33 | + | if (isDefined(getBoolean(this, "status"))) | |
34 | + | then throw("already active") | |
35 | + | else { | |
36 | + | let shareTokenName = "share_token_" | |
37 | + | let shareTokenInitialAmount = (pow(tokenReceiveAmountA, 0, 5, 1, 0, DOWN) * pow(tokenReceiveAmountB, 0, 5, 1, 0, DOWN)) | |
38 | + | let shareTokenAssetId = calculateAssetId(Issue(shareTokenName, shareTokenName, shareTokenInitialAmount, 0, true)) | |
39 | + | let assetIdTokenStringA = match assetIdReceivedA { | |
40 | + | case t: Unit => | |
41 | + | "WAVES" | |
42 | + | case t: ByteVector => | |
43 | + | toBase58String(value(assetIdReceivedA)) | |
44 | + | case _ => | |
45 | + | throw("Match error") | |
46 | + | } | |
47 | + | let assetIdTokenStringB = match assetIdReceivedB { | |
48 | + | case t: Unit => | |
49 | + | "WAVES" | |
50 | + | case t: ByteVector => | |
51 | + | toBase58String(value(assetIdReceivedB)) | |
52 | + | case _ => | |
53 | + | throw("Match error") | |
54 | + | } | |
55 | + | [IntegerEntry("amountTokenA", tokenReceiveAmountA), IntegerEntry("amountTokenB", tokenReceiveAmountB), StringEntry("assetIdTokenA", assetIdTokenStringA), StringEntry("assetIdTokenB", assetIdTokenStringB), IntegerEntry("exchange_count", 0), BooleanEntry("status", true), IntegerEntry("comission", comission), StringEntry("version", version), Issue(shareTokenName, shareTokenName, shareTokenInitialAmount, 0, true), ScriptTransfer(contextObj.caller, shareTokenInitialAmount, shareTokenAssetId), BinaryEntry("share_token_id", shareTokenAssetId), IntegerEntry("share_token_supply", shareTokenInitialAmount)] | |
56 | + | } | |
57 | + | } | |
58 | + | ||
59 | + | ||
60 | + | ||
61 | + | @Callable(contextObj) | |
62 | + | func replenishment () = { | |
63 | + | let paymentA = value(contextObj.payments[0]) | |
64 | + | let paymentB = value(contextObj.payments[1]) | |
65 | + | let assetIdReceivedA = paymentA.assetId | |
66 | + | let tokenReceiveAmountA = paymentA.amount | |
67 | + | let assetIdReceivedB = paymentB.assetId | |
68 | + | let tokenReceiveAmountB = paymentB.amount | |
69 | + | let dAppTokensAmountA = getIntegerValue(this, "amountTokenA") | |
70 | + | let dAppTokensAmountB = getIntegerValue(this, "amountTokenB") | |
71 | + | if (if ((assetIdReceivedA != assetIdTokenA)) | |
72 | + | then true | |
73 | + | else (assetIdReceivedB != assetIdTokenB)) | |
74 | + | then throw("incorrect assets") | |
75 | + | else { | |
76 | + | let tokenRatio = fraction((tokenReceiveAmountA * dAppTokensAmountB), 1000, (tokenReceiveAmountB * dAppTokensAmountA)) | |
77 | + | if (!(if ((tokenRatio > 990)) | |
78 | + | then (1010 > tokenRatio) | |
79 | + | else false)) | |
80 | + | then throw("incorrect assets amount") | |
81 | + | else { | |
82 | + | let shareTokenToPayAmount = ((tokenReceiveAmountA * tokenShareSupply) / dAppTokensAmountA) | |
83 | + | [Reissue(assetIdTokenShare, shareTokenToPayAmount, true), ScriptTransfer(contextObj.caller, shareTokenToPayAmount, assetIdTokenShare), IntegerEntry("share_token_supply", (tokenShareSupply + shareTokenToPayAmount)), IntegerEntry("amountTokenA", (dAppTokensAmountA + tokenReceiveAmountA)), IntegerEntry("amountTokenB", (dAppTokensAmountB + tokenReceiveAmountB))] | |
84 | + | } | |
85 | + | } | |
86 | + | } | |
87 | + | ||
88 | + | ||
89 | + | ||
90 | + | @Callable(contextObj) | |
91 | + | func withdraw () = { | |
92 | + | let dAppTokensAmountA = getIntegerValue(this, "amountTokenA") | |
93 | + | let dAppTokensAmountB = getIntegerValue(this, "amountTokenB") | |
94 | + | let payment = value(contextObj.payments[0]) | |
95 | + | let assetIdReceived = payment.assetId | |
96 | + | let tokenReceiveAmount = payment.amount | |
97 | + | if ((assetIdTokenShare != assetIdReceived)) | |
98 | + | then throw(("you need to attach share token for this dApp " + toBase58String(assetIdTokenShare))) | |
99 | + | else { | |
100 | + | let tokensToPayA = ((tokenReceiveAmount * dAppTokensAmountA) / tokenShareSupply) | |
101 | + | let tokensToPayB = ((tokenReceiveAmount * dAppTokensAmountB) / tokenShareSupply) | |
102 | + | [Burn(assetIdTokenShare, tokenReceiveAmount), IntegerEntry("amountTokenA", (dAppTokensAmountA - tokensToPayA)), IntegerEntry("amountTokenB", (dAppTokensAmountB - tokensToPayB)), IntegerEntry("share_token_supply", (tokenShareSupply - tokenReceiveAmount)), ScriptTransfer(contextObj.caller, dAppTokensAmountB, assetIdTokenA), ScriptTransfer(contextObj.caller, dAppTokensAmountB, assetIdTokenB)] | |
103 | + | } | |
104 | + | } | |
105 | + | ||
106 | + | ||
107 | + | ||
108 | + | @Callable(contextObj) | |
109 | + | func exchanger (minTokenRecieve) = if (if ((0 > comission)) | |
110 | + | then true | |
111 | + | else (comission > 100)) | |
112 | + | then throw("incorrect comission value") | |
113 | + | else { | |
114 | + | let amountTokenB = getIntegerValue(this, "amountTokenB") | |
115 | + | let amountTokenA = getIntegerValue(this, "amountTokenA") | |
116 | + | let payment = value(contextObj.payments[0]) | |
117 | + | let assetIdReceived = payment.assetId | |
118 | + | let tokenReceiveAmount = payment.amount | |
119 | + | let count = match getInteger(this, "exchange_count") { | |
120 | + | case i: Int => | |
121 | + | (value(getInteger(this, "exchange_count")) + i) | |
122 | + | case _ => | |
123 | + | 0 | |
124 | + | } | |
125 | + | if ((assetIdReceived == assetIdTokenB)) | |
126 | + | then { | |
127 | + | let tokenSendAmount = ((fraction(amountTokenA, tokenReceiveAmount, (tokenReceiveAmount + amountTokenB)) * (100 - comission)) / 100) | |
128 | + | if ((minTokenRecieve > tokenSendAmount)) | |
129 | + | then throw("Price has changed dramaticaly. Receiving token amount don't satisfy specified price level") | |
130 | + | else { | |
131 | + | let assetIdSent = assetIdTokenA | |
132 | + | [IntegerEntry("amountTokenA", (amountTokenA - tokenSendAmount)), IntegerEntry("amountTokenB", (amountTokenB + tokenReceiveAmount)), IntegerEntry("exchange_count", (count + 1)), ScriptTransfer(contextObj.caller, tokenSendAmount, assetIdSent)] | |
133 | + | } | |
134 | + | } | |
135 | + | else if ((assetIdReceived == assetIdTokenA)) | |
136 | + | then { | |
137 | + | let tokenSendAmount = ((fraction(amountTokenB, tokenReceiveAmount, (tokenReceiveAmount + amountTokenA)) * (100 - comission)) / 100) | |
138 | + | if ((minTokenRecieve > tokenSendAmount)) | |
139 | + | then throw("Price has changed dramaticaly. Receiving token amount don't satisfy specified price level") | |
140 | + | else { | |
141 | + | let assetIdSent = assetIdTokenB | |
142 | + | [IntegerEntry("amountTokenA", (amountTokenA + tokenReceiveAmount)), IntegerEntry("amountTokenB", (amountTokenB - tokenSendAmount)), IntegerEntry("exchange_count", (count + 1)), ScriptTransfer(contextObj.caller, tokenSendAmount, assetIdSent)] | |
143 | + | } | |
144 | + | } | |
145 | + | else throw("Asset is not allowed") | |
146 | + | } | |
147 | + | ||
148 | + |
github/deemru/w8io/026f985 27.10 ms ◑