tx · DgNDjkTtE1qJoLncKwwuhSkn9hhDWxyYtnCEjpdNEQPY

3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h:  -0.05000000 Waves

2023.03.27 10:34 [2508090] smart account 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h > SELF 0.00000000 Waves

{ "type": 13, "id": "DgNDjkTtE1qJoLncKwwuhSkn9hhDWxyYtnCEjpdNEQPY", "fee": 5000000, "feeAssetId": null, "timestamp": 1679902493735, "version": 2, "chainId": 84, "sender": "3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h", "senderPublicKey": "3z8Q6Zu3KppVmn6fJJvrLc1Wo3krVHSvfaNcerm82md2", "proofs": [ "23TyfgfTQFXzKmrFbQisMwCdjCYMUBJGBXKj8z8abvW9ekW3CxBD3BmirdePh41qbKYW5q2Skf48Fc8KAqK2bJzM" ], "script": "base64:BgIGCAISABIACAAMY29udHJhY3RGaWxlAglyZWJhbGFuY2UAD2tleXNUYXJnZXRSYXRpbwIPJXNfX3RhcmdldFJhdGlvABRrZXlBZGRpdGlvbmFsQmFsYW5jZQIbJXNfX2FkZGl0dGlvbmFsV2F2ZXNCYWxhbmNlABhrZXlTV2F2ZXNBZGRpdGlvbkJhbGFuY2UCESVzX19zV2F2ZXNCYWxhbmNlABBrZXlTV2F2ZXNBc3NldElkAhElc19fc1dhdmVzQXNzZXRJZAAPa2V5UHJveHlBZGRyZXNzAhAlc19fcHJveHlBZGRyZXNzARBnZXRJbnRlZ2VyT3JaZXJvAQppbnRlZ2VyS2V5BAckbWF0Y2gwCQCaCAIFBHRoaXMFCmludGVnZXJLZXkDCQABAgUHJG1hdGNoMAIDSW50BAN2YWwFByRtYXRjaDAFA3ZhbAAAARBnZXRTdHJpbmdPclRocm93AQlzdHJpbmdLZXkEByRtYXRjaDAJAJ0IAgUEdGhpcwUJc3RyaW5nS2V5AwkAAQIFByRtYXRjaDACBlN0cmluZwQBcwUHJG1hdGNoMAUBcwkAAgEJAKwCAgkArAICAgFbBQlzdHJpbmdLZXkCCl0gaXMgZW1wdHkCAWkBEnJldHVybldhdmVzQmFsYW5jZQAJAJQKAgUDbmlsCQBkAggJAO8HAQUEdGhpcwdyZWd1bGFyCQEQZ2V0SW50ZWdlck9yWmVybwEFFGtleUFkZGl0aW9uYWxCYWxhbmNlAWkBE3JldHVyblNXYXZlc0JhbGFuY2UABAtzV2F2ZXNBc3NldAkAnQgCBQR0aGlzBRBrZXlTV2F2ZXNBc3NldElkCQCUCgIFA25pbAkAZAIJAPAHAgUEdGhpcwkA2QQBCQEQZ2V0U3RyaW5nT3JUaHJvdwEFEGtleVNXYXZlc0Fzc2V0SWQJARBnZXRJbnRlZ2VyT3JaZXJvAQUYa2V5U1dhdmVzQWRkaXRpb25CYWxhbmNlADhSuZw=", "height": 2508090, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2UTREQJdDQs8jDE9FDMFWNyX5eAJ1jw1oSaYXXRuzFks Next: C9PbueCwr1Y7fe6WeHxFk5chD3WVsRiAwY6hS9JQ7iup Diff:
OldNewDifferences
1313
1414 let keyProxyAddress = "%s__proxyAddress"
1515
16-func getAdditionalBalanceOrZero () = match getInteger(this, keyAdditionalBalance) {
17- case bal: Int =>
18- bal
16+func getIntegerOrZero (integerKey) = match getInteger(this, integerKey) {
17+ case val: Int =>
18+ val
1919 case _ =>
2020 0
2121 }
2222
2323
24+func getStringOrThrow (stringKey) = match getString(this, stringKey) {
25+ case s: String =>
26+ s
27+ case _ =>
28+ throw((("[" + stringKey) + "] is empty"))
29+}
30+
31+
2432 @Callable(i)
25-func returnBalance () = $Tuple2(nil, (wavesBalance(this).regular + getAdditionalBalanceOrZero()))
33+func returnWavesBalance () = $Tuple2(nil, (wavesBalance(this).regular + getIntegerOrZero(keyAdditionalBalance)))
34+
35+
36+
37+@Callable(i)
38+func returnSWavesBalance () = {
39+ let sWavesAsset = getString(this, keySWavesAssetId)
40+ $Tuple2(nil, (assetBalance(this, fromBase58String(getStringOrThrow(keySWavesAssetId))) + getIntegerOrZero(keySWavesAdditionBalance)))
41+ }
2642
2743
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__addittionalWavesBalance"
99
1010 let keySWavesAdditionBalance = "%s__sWavesBalance"
1111
1212 let keySWavesAssetId = "%s__sWavesAssetId"
1313
1414 let keyProxyAddress = "%s__proxyAddress"
1515
16-func getAdditionalBalanceOrZero () = match getInteger(this, keyAdditionalBalance) {
17- case bal: Int =>
18- bal
16+func getIntegerOrZero (integerKey) = match getInteger(this, integerKey) {
17+ case val: Int =>
18+ val
1919 case _ =>
2020 0
2121 }
2222
2323
24+func getStringOrThrow (stringKey) = match getString(this, stringKey) {
25+ case s: String =>
26+ s
27+ case _ =>
28+ throw((("[" + stringKey) + "] is empty"))
29+}
30+
31+
2432 @Callable(i)
25-func returnBalance () = $Tuple2(nil, (wavesBalance(this).regular + getAdditionalBalanceOrZero()))
33+func returnWavesBalance () = $Tuple2(nil, (wavesBalance(this).regular + getIntegerOrZero(keyAdditionalBalance)))
34+
35+
36+
37+@Callable(i)
38+func returnSWavesBalance () = {
39+ let sWavesAsset = getString(this, keySWavesAssetId)
40+ $Tuple2(nil, (assetBalance(this, fromBase58String(getStringOrThrow(keySWavesAssetId))) + getIntegerOrZero(keySWavesAdditionBalance)))
41+ }
2642
2743

github/deemru/w8io/026f985 
20.46 ms