tx · AyvHf53oAhd9xGmjEpdmTPbpRPDdc5VkPoxrs5NMKyvo

3MvXnAcEtL9x3i499UcvTQZPufrT5ZZUEd5:  -0.01300000 Waves

2022.09.12 17:24 [2226003] smart account 3MvXnAcEtL9x3i499UcvTQZPufrT5ZZUEd5 > SELF 0.00000000 Waves

{ "type": 13, "id": "AyvHf53oAhd9xGmjEpdmTPbpRPDdc5VkPoxrs5NMKyvo", "fee": 1300000, "feeAssetId": null, "timestamp": 1662992757619, "version": 1, "sender": "3MvXnAcEtL9x3i499UcvTQZPufrT5ZZUEd5", "senderPublicKey": "GSAhb4fdky75LiCZ4p4DDK4rmWpmsgGBg1ZVdtPfmRES", "proofs": [ "23LQ58Px8DsL2FV6vDyH6KXnS3ZJ3agBSKSBLi8r9k7csQr3docmS4UFvh9dNG3EBvFQbCw2h6S4syuvZHRLSox2" ], "script": "base64:BgImCAISCgoICAgBAQEBAQESAwoBCBIECgIICBIFCgMICAESBAoCCAgPARNrZXlNYW5hZ2VyUHVibGljS2V5AAIUJXNfX21hbmFnZXJQdWJsaWNLZXkBF2NvbGxlY3RXaXRoZHJhd0RlbGF5S2V5AgZhc3NldEEGYXNzZXRCCQC5CQIJAMwIAgIVJXMlcyVzX193aXRoZHJhd0RlbGF5CQDMCAIFBmFzc2V0QQkAzAgCBQZhc3NldEIFA25pbAICX18BHGNvbGxlY3REZXBvc2l0RmVlUGVybWlsbGVLZXkCBmFzc2V0QQZhc3NldEIJALkJAgkAzAgCAholcyVzJXNfX2RlcG9zaXRGZWVQZXJtaWxsZQkAzAgCBQZhc3NldEEJAMwIAgUGYXNzZXRCBQNuaWwCAl9fAR1jb2xsZWN0V2l0aGRyYXdGZWVQZXJtaWxsZUtleQIGYXNzZXRBBmFzc2V0QgkAuQkCCQDMCAICGyVzJXMlc19fd2l0aGRyYXdGZWVQZXJtaWxsZQkAzAgCBQZhc3NldEEJAMwIAgUGYXNzZXRCBQNuaWwCAl9fARpjb2xsZWN0TWluQW1vdW50RGVwb3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mF3QXNzZXRCBQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkABA90YXJnZXRQdWJsaWNLZXkEByRtYXRjaDAJARZtYW5hZ2VyUHVibGljS2V5T3JVbml0AAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAJwawUHJG1hdGNoMAUCcGsDCQABAgUHJG1hdGNoMAIEVW5pdAgFAnR4D3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQ90YXJnZXRQdWJsaWNLZXn8weC8", "chainId": 84, "height": 2226003, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: zW2PW8MLZuACT52u9w7FsurykWxCiXKPVPGd8EJSTnC Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 6 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+func keyManagerPublicKey () = "%s__managerPublicKey"
5+
6+
7+func collectWithdrawDelayKey (assetA,assetB) = makeString(["%s%s%s__withdrawDelay", assetA, assetB], "__")
8+
9+
10+func collectDepositFeePermilleKey (assetA,assetB) = makeString(["%s%s%s__depositFeePermille", assetA, assetB], "__")
11+
12+
13+func collectWithdrawFeePermilleKey (assetA,assetB) = makeString(["%s%s%s__withdrawFeePermille", assetA, assetB], "__")
14+
15+
16+func collectMinAmountDepositKey (assetA,assetB) = makeString(["%s%s%s__minAmountDeposit", assetA, assetB], "__")
17+
18+
19+func collectAssetsPairStatusKey (assetA,assetB) = makeString(["%s%s%s__assetsPairStatus", assetA, assetB], "__")
20+
21+
22+func collectMinAmountWithdrawKey (assetA,assetB) = makeString(["%s%s%s__minAmountWithdraw", assetA, assetB], "__")
23+
24+
25+func collectBalanceKey (assetA,assetB,userAddress) = makeString(["%s%s%s%s__balance", assetA, assetB, userAddress], "__")
26+
27+
28+func collectTotalCommissionsCollectedDepositKey (assetA,assetB) = makeString(["%s%s%s%s__totalCommissionsCollected__deposit", assetA, assetB], "__")
29+
30+
31+func collectTotalCommissionsCollectedWithdrawKey (assetA,assetB) = makeString(["%s%s%s%s__totalCommissionsCollected__withdraw", assetA, assetB], "__")
32+
33+
34+func collectAssetLockTimeKey (assetA,assetB,userAddress) = makeString(["%s%s%s%s__assetLockTime", assetA, assetB, userAddress], "__")
35+
36+
37+func collectProcessInProgressKey (userAddress,assetA,assetB,heightInKey) = makeString(["%s%s%s%s__withdrawProcess__inProgress", userAddress, assetA, assetB, toString(heightInKey)], "__")
38+
39+
40+func collectProcessDoneKey (userAddress,assetA,assetB,heightInKey) = makeString(["%s%s%s%s__withdrawProcess__done", userAddress, assetA, assetB, toString(heightInKey)], "__")
41+
42+
43+func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
44+ case s: String =>
45+ fromBase58String(s)
46+ case _: Unit =>
47+ unit
48+ case _ =>
49+ throw("Match error")
50+}
51+
52+
53+func mustManager (i) = {
54+ let pd = throw("Permission denied")
55+ match managerPublicKeyOrUnit() {
56+ case pk: ByteVector =>
57+ if ((i.callerPublicKey == pk))
58+ then true
59+ else pd
60+ case _: Unit =>
61+ if ((i.caller == this))
62+ then true
63+ else pd
64+ case _ =>
65+ throw("Match error")
66+ }
67+ }
68+
69+
70+@Callable(i)
71+func registerAsset (assetA,assetB,withdrawDelay,depositFee,withdrawFee,minAmountDeposit,minAmountWithdraw,pairStatus) = {
72+ let checkCaller = mustManager(i)
73+ if ((checkCaller == checkCaller))
74+ then {
75+ let withdrawDelayKey = collectWithdrawDelayKey(assetA, assetB)
76+ let depositFeePermilleKey = collectDepositFeePermilleKey(assetA, assetB)
77+ let withdrawFeePermilleKey = collectWithdrawFeePermilleKey(assetA, assetB)
78+ let minAmountDepositKey = collectMinAmountDepositKey(assetA, assetB)
79+ let minAmountWithdrawKey = collectMinAmountWithdrawKey(assetA, assetB)
80+ let pairStatusKey = collectAssetsPairStatusKey(assetA, assetB)
81+[IntegerEntry(withdrawDelayKey, withdrawDelay), IntegerEntry(depositFeePermilleKey, depositFee), IntegerEntry(withdrawFeePermilleKey, withdrawFee), IntegerEntry(minAmountDepositKey, minAmountDeposit), IntegerEntry(minAmountWithdrawKey, minAmountWithdraw), IntegerEntry(pairStatusKey, pairStatus)]
82+ }
83+ else throw("Strict value is not equal to itself.")
84+ }
85+
86+
87+
88+@Callable(i)
89+func swapAssetsAToB (assetB) = {
90+ let payment = value(i.payments[0])
91+ let assetA = toBase58String(value(payment.assetId))
92+ let userAddress = toString(i.caller)
93+ let minAmountDeposit = valueOrErrorMessage(getInteger(collectMinAmountDepositKey(assetA, assetB)), "This asset pair does not exist.")
94+ let toDeposit = payment.amount
95+ let depositFeePermilleKey = collectDepositFeePermilleKey(assetA, assetB)
96+ let depositFee = valueOrElse(getInteger(this, depositFeePermilleKey), 0)
97+ let fee = ((toDeposit / 1000) * depositFee)
98+ let currentUserBalance = valueOrElse(getInteger(collectBalanceKey(assetA, assetB, userAddress)), 0)
99+ let totalCommissions = valueOrElse(getInteger(collectTotalCommissionsCollectedDepositKey(assetA, assetB)), 0)
100+ let asset = fromBase58String(value(assetB))
101+ if ((value(getInteger(collectAssetsPairStatusKey(assetA, assetB))) != 0))
102+ then throw("The couple's deposit is blocked.")
103+ else if ((minAmountDeposit > payment.amount))
104+ then throw("Swap amount fail, amount is to small.")
105+ else [IntegerEntry(collectBalanceKey(assetA, assetB, userAddress), ((currentUserBalance + payment.amount) - fee)), IntegerEntry(collectTotalCommissionsCollectedDepositKey(assetA, assetB), (totalCommissions + fee)), ScriptTransfer(i.caller, toDeposit, asset)]
106+ }
107+
108+
109+
110+@Callable(i)
111+func initializationSwapAssetsBToA (assetA,assetB) = {
112+ let payment = value(i.payments[0])
113+ let amount = payment.amount
114+ let userAddress = toString(i.caller)
115+ let minAmountDeposit = valueOrErrorMessage(getInteger(collectMinAmountWithdrawKey(assetA, assetB)), "This asset pair does not exist.")
116+ let assetLockHeight = (height + valueOrElse(getInteger(collectWithdrawDelayKey(assetA, assetB)), 0))
117+ let currentUserBalance = valueOrErrorMessage(getInteger(collectBalanceKey(assetA, assetB, userAddress)), "This user balance does not exist.")
118+ let totalCommissions = valueOrElse(getInteger(collectTotalCommissionsCollectedDepositKey(assetA, assetB)), 0)
119+ let withdrawFeePermilleKey = collectWithdrawFeePermilleKey(assetA, assetB)
120+ let withdrawFee = valueOrElse(getInteger(withdrawFeePermilleKey), 0)
121+ let fee = ((amount / 1000) * withdrawFee)
122+[IntegerEntry(collectAssetLockTimeKey(assetA, assetB, userAddress), assetLockHeight), IntegerEntry(collectBalanceKey(assetA, assetB, userAddress), ((currentUserBalance - amount) - fee)), IntegerEntry(collectProcessInProgressKey(userAddress, assetA, assetB, assetLockHeight), (amount - fee)), IntegerEntry(collectTotalCommissionsCollectedWithdrawKey(assetA, assetB), (totalCommissions + fee))]
123+ }
124+
125+
126+
127+@Callable(i)
128+func withdrawAsset (assetA,assetB,heightInKey) = {
129+ let userAddress = toString(i.caller)
130+ let assetLockTime = valueOrElse(getInteger(collectAssetLockTimeKey(assetA, assetB, userAddress)), 0)
131+ let toWithdraw = valueOrElse(getInteger(collectProcessInProgressKey(userAddress, assetA, assetB, heightInKey)), 0)
132+ let asset = fromBase58String(value(assetA))
133+ if ((height > assetLockTime))
134+ then throw((("Withdrawal is possible after " + toString(heightInKey)) + " height or you have already withdrawn."))
135+ else [DeleteEntry(collectProcessInProgressKey(userAddress, assetA, assetB, heightInKey)), IntegerEntry(collectProcessDoneKey(userAddress, assetA, assetB, heightInKey), toWithdraw), IntegerEntry(collectBalanceKey(assetA, assetB, userAddress), toWithdraw), ScriptTransfer(i.caller, toWithdraw, asset)]
136+ }
137+
138+
139+
140+@Callable(i)
141+func withdrawFee (assetA,assetB) = {
142+ let checkCaller = mustManager(i)
143+ if ((checkCaller == checkCaller))
144+ then {
145+ let toWithdrawA = valueOrElse(getInteger(collectTotalCommissionsCollectedDepositKey(assetA, assetB)), 0)
146+ let withdrawAssetA = fromBase58String(value(assetA))
147+ let toWithdrawB = valueOrElse(getInteger(collectTotalCommissionsCollectedWithdrawKey(assetA, assetB)), 0)
148+ let withdrawAssetB = fromBase58String(value(assetB))
149+[IntegerEntry(collectTotalCommissionsCollectedDepositKey(assetA, assetB), 0), ScriptTransfer(i.caller, toWithdrawA, withdrawAssetA), IntegerEntry(collectTotalCommissionsCollectedWithdrawKey(assetA, assetB), 0), ScriptTransfer(i.caller, toWithdrawB, withdrawAssetB)]
150+ }
151+ else throw("Strict value is not equal to itself.")
152+ }
153+
154+
155+@Verifier(tx)
156+func verify () = {
157+ let targetPublicKey = match managerPublicKeyOrUnit() {
158+ case pk: ByteVector =>
159+ pk
160+ case _: Unit =>
161+ tx.senderPublicKey
162+ case _ =>
163+ throw("Match error")
164+ }
165+ sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
166+ }
167+

github/deemru/w8io/169f3d6 
40.46 ms