tx · AKW2SvCMFrc61Cfc2dUDqBrsNf3Jth3zn731ULCJrXSt

3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h:  -0.05000000 Waves

2023.03.28 10:05 [2509479] smart account 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h > SELF 0.00000000 Waves

{ "type": 13, "id": "AKW2SvCMFrc61Cfc2dUDqBrsNf3Jth3zn731ULCJrXSt", "fee": 5000000, "feeAssetId": null, "timestamp": 1679987135876, "version": 2, "chainId": 84, "sender": "3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h", "senderPublicKey": "3z8Q6Zu3KppVmn6fJJvrLc1Wo3krVHSvfaNcerm82md2", "proofs": [ "2AKGJwXT3MT8PsaB8g6YwoJ2reMbVkyK68rkiMvZTWLCzPn61dcLV4RwN1rqNRN4wSpY4XVSEYPX5PaioDUjopFJ" ], "script": "base64:BgIRCAISABIAEgASBQoDAQEBEgAOAAxjb250cmFjdEZpbGUCCXJlYmFsYW5jZQAPa2V5c1RhcmdldFJhdGlvAg8lc19fdGFyZ2V0UmF0aW8AFGtleUFkZGl0aW9uYWxCYWxhbmNlAholc19fYWRkaXRpb25hbFdhdmVzQmFsYW5jZQAaa2V5U1dhdmVzQWRkaXRpb25hbEJhbGFuY2UCESVzX19zV2F2ZXNCYWxhbmNlABBrZXlTV2F2ZXNBc3NldElkAhElc19fc1dhdmVzQXNzZXRJZAAPa2V5UHJveHlBZGRyZXNzAhAlc19fcHJveHlBZGRyZXNzARBnZXRJbnRlZ2VyT3JaZXJvAQppbnRlZ2VyS2V5BAckbWF0Y2gwCQCaCAIFBHRoaXMFCmludGVnZXJLZXkDCQABAgUHJG1hdGNoMAIDSW50BAN2YWwFByRtYXRjaDAFA3ZhbAAAARBnZXRTdHJpbmdPclRocm93AQlzdHJpbmdLZXkEByRtYXRjaDAJAJ0IAgUEdGhpcwUJc3RyaW5nS2V5AwkAAQIFByRtYXRjaDACBlN0cmluZwQBcwUHJG1hdGNoMAUBcwk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RpdGlvbmFsQmFsYW5jZQkAawMFC3RhcmdldFJhdGlvBQ13aG9sZUJsYWxhbmNlAGQEBmNoYW5nZQkAZQIFEWFkZGl0aW9uYWxCYWxhbmNlBRd0YXJnZXRBZGRpdGlvbmFsQmFsYW5jZQQGbmV3UmVnCQBkAgUOcmVndWxhckJhbGFuY2UFBmNoYW5nZQMJAAACBQZjaGFuZ2UAAAUDbmlsAwkAZgIAAAUGY2hhbmdlBA9zZW5kV2F2ZXNBbW91bnQJAGgCBQZjaGFuZ2UA////////////AQkBB2RlcG9zaXQBBQ9zZW5kV2F2ZXNBbW91bnQEDmdldFdhdmVzQW1vdW50BQZjaGFuZ2UJAQh3aXRoZHJhdwEFDmdldFdhdmVzQW1vdW50CQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAJuTpWE=", "height": 2509479, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ZYfmLsTeAxZk97CX7PPMQG7g1478dGJrXATh9cfAWYD Next: 44fuU8CAFGwn9pdreeYxTFyZjNNnccaCtuD5AzgdAjR2 Diff:
OldNewDifferences
180180 let targetAdditionalBalance = fraction(targetRatio, wholeBlalance, 100)
181181 let change = (additionalBalance - targetAdditionalBalance)
182182 let newReg = (regularBalance + change)
183- if ((0 > change))
184- then {
185- let sendWavesAmount = (change * -1)
186- deposit(sendWavesAmount)
187- }
188- else {
189- let getWavesAmount = change
190- withdraw(getWavesAmount)
191- }
183+ if ((change == 0))
184+ then nil
185+ else if ((0 > change))
186+ then {
187+ let sendWavesAmount = (change * -1)
188+ deposit(sendWavesAmount)
189+ }
190+ else {
191+ let getWavesAmount = change
192+ withdraw(getWavesAmount)
193+ }
192194 }
193195 else throw("Strict value is not equal to itself.")
194196 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let contractFile = "rebalance"
55
66 let keysTargetRatio = "%s__targetRatio"
77
88 let keyAdditionalBalance = "%s__additionalWavesBalance"
99
1010 let keySWavesAdditionalBalance = "%s__sWavesBalance"
1111
1212 let keySWavesAssetId = "%s__sWavesAssetId"
1313
1414 let keyProxyAddress = "%s__proxyAddress"
1515
1616 func getIntegerOrZero (integerKey) = match getInteger(this, integerKey) {
1717 case val: Int =>
1818 val
1919 case _ =>
2020 0
2121 }
2222
2323
2424 func getStringOrThrow (stringKey) = match getString(this, stringKey) {
2525 case s: String =>
2626 s
2727 case _ =>
2828 throw((("[" + stringKey) + "] is empty"))
2929 }
3030
3131
3232 func getTargetRatio () = match getInteger(keysTargetRatio) {
3333 case s: Int =>
3434 s
3535 case _ =>
3636 80
3737 }
3838
3939
4040 func internalWavesBalance () = (wavesBalance(this).regular + getIntegerOrZero(keyAdditionalBalance))
4141
4242
4343 func internalRate () = {
4444 let additionalBalance = getIntegerOrZero(keyAdditionalBalance)
4545 let sWavesBalance = getIntegerOrZero(keySWavesAdditionalBalance)
4646 if ((additionalBalance == 0))
4747 then 0
4848 else fraction(100000000000, additionalBalance, sWavesBalance)
4949 }
5050
5151
5252 func getRate () = {
5353 let proxy = addressFromStringValue(getStringOrThrow(keyProxyAddress))
5454 let inv = invoke(proxy, "getRate", nil, nil)
5555 if ((inv == inv))
5656 then match inv {
5757 case s: String =>
5858 parseIntValue(s)
5959 case _ =>
6060 throw("ZERO rate")
6161 }
6262 else throw("Strict value is not equal to itself.")
6363 }
6464
6565
6666 func deposit (wavesAmount) = {
6767 let proxy = addressFromStringValue(getStringOrThrow(keyProxyAddress))
6868 let currentAdditionalBalance = getIntegerOrZero(keyAdditionalBalance)
6969 if ((currentAdditionalBalance == currentAdditionalBalance))
7070 then {
7171 let currentSWavesBalance = getIntegerOrZero(keySWavesAdditionalBalance)
7272 if ((currentSWavesBalance == currentSWavesBalance))
7373 then {
7474 let depositInvoke = invoke(proxy, "deposit", nil, [AttachedPayment(unit, wavesAmount)])
7575 if ((depositInvoke == depositInvoke))
7676 then match depositInvoke {
7777 case receivedSWaves: Int =>
7878 let newAdditionalBalance = (currentAdditionalBalance + wavesAmount)
7979 let newSWavesBalance = (currentSWavesBalance + receivedSWaves)
8080 [IntegerEntry(keyAdditionalBalance, newAdditionalBalance), IntegerEntry(keySWavesAdditionalBalance, newSWavesBalance)]
8181 case _ =>
8282 nil
8383 }
8484 else throw("Strict value is not equal to itself.")
8585 }
8686 else throw("Strict value is not equal to itself.")
8787 }
8888 else throw("Strict value is not equal to itself.")
8989 }
9090
9191
9292 func withdraw (wavesAmount) = {
9393 let proxy = addressFromStringValue(getStringOrThrow(keyProxyAddress))
9494 let sWavesId = fromBase58String(getStringOrThrow(keySWavesAssetId))
9595 if ((sWavesId == sWavesId))
9696 then {
9797 let currentAdditionalBalance = getIntegerOrZero(keyAdditionalBalance)
9898 if ((currentAdditionalBalance == currentAdditionalBalance))
9999 then {
100100 let currentSWavesBalance = getIntegerOrZero(keySWavesAdditionalBalance)
101101 if ((currentSWavesBalance == currentSWavesBalance))
102102 then {
103103 let currentProxyRate = getRate()
104104 if ((currentProxyRate == currentProxyRate))
105105 then {
106106 let sendSWavesAmount = fraction(1000000000000, wavesAmount, currentProxyRate)
107107 let depositInvoke = invoke(proxy, "withdraw", nil, [AttachedPayment(sWavesId, sendSWavesAmount)])
108108 if ((depositInvoke == depositInvoke))
109109 then match depositInvoke {
110110 case receivedWaves: Int =>
111111 let newAdditionalBalance = (currentAdditionalBalance - receivedWaves)
112112 let newSWavesBalance = (currentSWavesBalance - sendSWavesAmount)
113113 [IntegerEntry(keyAdditionalBalance, newAdditionalBalance), IntegerEntry(keySWavesAdditionalBalance, newSWavesBalance)]
114114 case _ =>
115115 nil
116116 }
117117 else throw("Strict value is not equal to itself.")
118118 }
119119 else throw("Strict value is not equal to itself.")
120120 }
121121 else throw("Strict value is not equal to itself.")
122122 }
123123 else throw("Strict value is not equal to itself.")
124124 }
125125 else throw("Strict value is not equal to itself.")
126126 }
127127
128128
129129 @Callable(i)
130130 func returnWavesBalance () = $Tuple2(nil, internalWavesBalance())
131131
132132
133133
134134 @Callable(i)
135135 func returnSWavesBalance () = $Tuple2(nil, getIntegerOrZero(keySWavesAdditionalBalance))
136136
137137
138138
139139 @Callable(i)
140140 func calcRatio () = {
141141 let regularWavesBalance = wavesBalance(this).regular
142142 let additional = getIntegerOrZero(keyAdditionalBalance)
143143 let ratio = fraction(100, additional, (additional + regularWavesBalance))
144144 $Tuple2(nil, ratio)
145145 }
146146
147147
148148
149149 @Callable(i)
150150 func calcRatioTest (regularBalance,additional,targetRatio) = {
151151 let sum = (regularBalance + additional)
152152 let targetAdditionalBalance = fraction(targetRatio, sum, 100)
153153 let change = (additional - targetAdditionalBalance)
154154 let newReg = (regularBalance + change)
155155 if ((0 > change))
156156 then {
157157 let sendAmount = (change * -1)
158158 $Tuple2(nil, [newReg, targetAdditionalBalance, change, ("deposit: " + toString(sendAmount))])
159159 }
160160 else {
161161 let sendAmount = change
162162 $Tuple2(nil, [newReg, targetAdditionalBalance, change, ("withdraw: " + toString(sendAmount))])
163163 }
164164 }
165165
166166
167167
168168 @Callable(i)
169169 func rebalance () = {
170170 let regularBalance = wavesBalance(this).regular
171171 if ((regularBalance == regularBalance))
172172 then {
173173 let additionalBalance = getIntegerOrZero(keyAdditionalBalance)
174174 if ((additionalBalance == additionalBalance))
175175 then {
176176 let targetRatio = getTargetRatio()
177177 if ((targetRatio == targetRatio))
178178 then {
179179 let wholeBlalance = (regularBalance + additionalBalance)
180180 let targetAdditionalBalance = fraction(targetRatio, wholeBlalance, 100)
181181 let change = (additionalBalance - targetAdditionalBalance)
182182 let newReg = (regularBalance + change)
183- if ((0 > change))
184- then {
185- let sendWavesAmount = (change * -1)
186- deposit(sendWavesAmount)
187- }
188- else {
189- let getWavesAmount = change
190- withdraw(getWavesAmount)
191- }
183+ if ((change == 0))
184+ then nil
185+ else if ((0 > change))
186+ then {
187+ let sendWavesAmount = (change * -1)
188+ deposit(sendWavesAmount)
189+ }
190+ else {
191+ let getWavesAmount = change
192+ withdraw(getWavesAmount)
193+ }
192194 }
193195 else throw("Strict value is not equal to itself.")
194196 }
195197 else throw("Strict value is not equal to itself.")
196198 }
197199 else throw("Strict value is not equal to itself.")
198200 }
199201
200202

github/deemru/w8io/169f3d6 
27.98 ms