tx · BeJcibcm9SaWD7FXVjmZJL3mmR8SztTm9HWEnFUUG365

3Mt7wmkWeioUsmfaBu6PsNq9j9SUs7f9qrs:  -0.04000000 Waves

2022.07.29 18:31 [2161301] smart account 3Mt7wmkWeioUsmfaBu6PsNq9j9SUs7f9qrs > SELF 0.00000000 Waves

{ "type": 13, "id": "BeJcibcm9SaWD7FXVjmZJL3mmR8SztTm9HWEnFUUG365", "fee": 4000000, "feeAssetId": null, "timestamp": 1659108731238, "version": 1, "sender": "3Mt7wmkWeioUsmfaBu6PsNq9j9SUs7f9qrs", "senderPublicKey": "BLEvt3fBtK9gbCuj3VA7nHviqe3TPkRrF9KL6ZaHGgr4", "proofs": [ "5z2vCi89j9ByKcEtn17guhRH2WQ5snztcHNkSNwPJJjEe3d7EGZJccApPjqgdYfR4TmRiZ71dTgA1KzY1LvbKaA6" ], "script": "base64:BgIRCAISAwoBARIDCgEIEgMKAQgxAAtyZXZpc2lvbk51bQIAAAZFVUxFUjgA1onPgQEABU1VTFQ2AMCEPQAGTVVMVFg2CQC2AgEAwIQ9AAVNVUxUOACAwtcvAAZNVUxUWDgJALYCAQCAwtcvAAZNVUxUMTIAgKCUpY0dAAZNVUxUMTgJALYCAQCAgJC7utat8A0AA1NFUAICX18AB1dBVkVTSUQJANkEAQIFV0FWRVMBFWtleUduc2J0RnJvbVN1cmZDb2VmZgACHSVzJXNfX2NmZ19fZ25zYnRGcm9tU3VyZkNvZWZmAQ9nZXRTdHJpbmdPckZhaWwCB2FkZHJlc3MDa2V5CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJ0IAgUHYWRkcmVzcwUDa2V5CQC5CQIJAMwIAgIKbWFuZGF0b3J5IAkAzAgCCQClCAEFB2FkZHJlc3MJAMwIAgIBLgkAzAgCBQNrZXkJAMwIAgIPIGlzIG5vdCBkZWZpbmVkBQNuaWwCAAEMZ2V0SW50T3JGYWlsAgdhZGRyZXNzA2tleQkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCa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SZXdhcmRTdHIFA25pbABTTAy9", "chainId": 84, "height": 2161301, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DPhiLbYzKNeiv3DDENQfZFqCUtSoEU18jicQdLbUJhPM Next: J9Wba82ZnfD3PBNwFCnftYKubtEV7bfoSrXNc3LQqop4 Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let revisionNum = ""
55
66 let EULER8 = 271828182
77
88 let MULT6 = 1000000
99
1010 let MULTX6 = toBigInt(1000000)
1111
1212 let MULT8 = 100000000
1313
1414 let MULTX8 = toBigInt(100000000)
1515
1616 let MULT12 = 1000000000000
1717
1818 let MULT18 = toBigInt(1000000000000000000)
1919
2020 let SEP = "__"
2121
2222 let WAVESID = fromBase58String("WAVES")
2323
2424 func keyGnsbtFromSurfCoeff () = "%s%s__cfg__gnsbtFromSurfCoeff"
2525
2626
2727 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
2828
2929
3030 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
3131
3232
3333 func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
3434
3535
3636 func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price)
3737
3838
3939 func convertWavesToNeutrino (amount,price) = fraction(amount, price, MULT8)
4040
4141
4242 func asAnyList (val) = match val {
4343 case valAnyList: List[Any] =>
4444 valAnyList
4545 case _ =>
4646 throw("fail to cast into List[Any]")
4747 }
4848
4949
5050 func asInt (val) = match val {
5151 case valInt: Int =>
5252 valInt
5353 case _ =>
5454 throw("fail to cast into Int")
5555 }
5656
5757
5858 func asString (val) = match val {
5959 case valStr: String =>
6060 valStr
6161 case _ =>
6262 throw("fail to cast into String")
6363 }
6464
6565
6666 func asTuple2Ints (val) = match val {
6767 case v: (Int, Int) =>
6868 v
6969 case _ =>
7070 throw("fail to cast into Tuple2 ints")
7171 }
7272
7373
7474 func asSwapParamsSTRUCT (val) = match val {
7575 case struct: (Int, Int, Int, Int, Int) =>
7676 struct
7777 case _ =>
7878 throw("fail to cast into Int")
7979 }
8080
8181
8282 func toTimestamp (start) = if ((0 > start))
8383 then -1
8484 else match blockInfoByHeight(start) {
8585 case block: BlockInfo =>
8686 block.timestamp
8787 case _ =>
8888 -1
8989 }
9090
9191
9292 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult))
9393
9494
9595 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18))
9696
9797
9898 let IdxControlCfgNeutrinoDapp = 1
9999
100100 let IdxControlCfgAuctionDapp = 2
101101
102102 let IdxControlCfgRpdDapp = 3
103103
104104 let IdxControlCfgMathDapp = 4
105105
106106 let IdxControlCfgLiquidationDapp = 5
107107
108108 let IdxControlCfgRestDapp = 6
109109
110110 let IdxControlCfgNodeRegistryDapp = 7
111111
112112 let IdxControlCfgNsbtStakingDapp = 8
113113
114114 let IdxControlCfgMediatorDapp = 9
115115
116116 let IdxControlCfgSurfStakingDapp = 10
117117
118118 let IdxControlCfgGnsbtControllerDapp = 11
119119
120120 func keyControlAddress () = "%s%s__config__controlAddress"
121121
122122
123123 func keyControlCfg () = "%s__controlConfig"
124124
125125
126126 func readControlCfgOrFail (control) = split(getStringOrFail(control, keyControlCfg()), SEP)
127127
128128
129129 func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx)))
130130
131131
132132 let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx"))
133133
134134 let controlCfg = readControlCfgOrFail(controlContract)
135135
136136 let mathContract = getContractAddressOrFail(controlCfg, IdxControlCfgMathDapp)
137137
138138 let neutrinoContract = getContractAddressOrFail(controlCfg, IdxControlCfgNeutrinoDapp)
139139
140140 let auctionContract = getContractAddressOrFail(controlCfg, IdxControlCfgAuctionDapp)
141141
142142 let liquidationContract = getContractAddressOrFail(controlCfg, IdxControlCfgLiquidationDapp)
143143
144144 let rpdContract = getContractAddressOrFail(controlCfg, IdxControlCfgRpdDapp)
145145
146146 let nsbtStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgNsbtStakingDapp)
147147
148148 let surfStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgSurfStakingDapp)
149149
150150 let gnsbtFromSurfCoeff = valueOrElse(getInteger(this, keyGnsbtFromSurfCoeff()), 60)
151151
152152 @Callable(i)
153153 func gnsbtFromSurfSYSREADONLY (surfAmt) = $Tuple2(nil, (surfAmt / gnsbtFromSurfCoeff))
154154
155155
156156
157157 @Callable(i)
158158 func gnsbtInfoSYSREADONLY (userAddressStrOrEmpty) = {
159159 let nsbtData = asAnyList(invoke(nsbtStakingContract, "nsbtStakingSYSREADONLY", [userAddressStrOrEmpty], nil))
160160 let nsbtUser = asInt(nsbtData[0])
161161 let nsbtTotal = asInt(nsbtData[1])
162162 let gNsbtFromNsbtUser = nsbtUser
163163 let gNsbtFromNsbtTotal = nsbtTotal
164164 let surfData = asAnyList(invoke(surfStakingContract, "surfStakingSYSREADONLY", [userAddressStrOrEmpty], nil))
165165 let surfUser = asInt(surfData[0])
166166 let surfTotal = asInt(surfData[1])
167167 let gNsbtFromSurfUser = asInt(surfData[2])
168168 let gNsbtFromSurfTotal = asInt(surfData[3])
169169 let gNsbtUser = (gNsbtFromNsbtUser + gNsbtFromSurfUser)
170170 let gNsbtTotal = (gNsbtFromNsbtTotal + gNsbtFromSurfTotal)
171171 $Tuple2(nil, [gNsbtUser, gNsbtTotal, [nsbtUser, nsbtTotal, gNsbtFromNsbtUser, gNsbtFromNsbtTotal], [surfUser, surfTotal, gNsbtFromSurfUser, gNsbtFromSurfTotal]])
172172 }
173173
174174
175175
176176 @Callable(i)
177177 func gnsbtRewardsSYSREADONLY (userAddressStrOrEmpty) = {
178178 let nsbtRewardStr = asString(invoke(nsbtStakingContract, "unclaimedRewardsREADONLY", [userAddressStrOrEmpty], nil))
179179 let surfRewardStr = asString(invoke(surfStakingContract, "unclaimedRewardsREADONLY", [userAddressStrOrEmpty], nil))
180180 $Tuple2(nil, [nsbtRewardStr, surfRewardStr])
181181 }
182182
183183

github/deemru/w8io/026f985 
26.49 ms