tx · Ab9c2yMRyajq17c2qt4vPSEfCzrda53GZKHPaYQRk7ck 3Mt7wmkWeioUsmfaBu6PsNq9j9SUs7f9qrs: -0.04000000 Waves 2022.08.03 11:07 [2168046] smart account 3Mt7wmkWeioUsmfaBu6PsNq9j9SUs7f9qrs > SELF 0.00000000 Waves
{ "type": 13, "id": "Ab9c2yMRyajq17c2qt4vPSEfCzrda53GZKHPaYQRk7ck", "fee": 4000000, "feeAssetId": null, "timestamp": 1659514064190, "version": 1, "sender": "3Mt7wmkWeioUsmfaBu6PsNq9j9SUs7f9qrs", "senderPublicKey": "BLEvt3fBtK9gbCuj3VA7nHviqe3TPkRrF9KL6ZaHGgr4", "proofs": [ "495pNNMwSnAEdLxVS2fTRNC6xUZF9RheWhid9HFNpKRMDVuPccFNPyZ6kNf7cYZ3XSdqQ4T9d5qwubXcYqoibLSM" ], "script": "base64:BgITCAISAwoBARIDCgEIEgASAwoBCDEAC3JldmlzaW9uTnVtAgAABkVVTEVSOADWic+BAQAFTVVMVDYAwIQ9AAZNVUxUWDYJALYCAQDAhD0ABU1VTFQ4AIDC1y8ABk1VTFRYOAkAtgIBAIDC1y8ABk1VTFQxMgCAoJSljR0ABk1VTFQxOAkAtgIBAICAkLu61q3wDQADU0VQAgJfXwAHV0FWRVNJRAkA2QQBAgVXQVZFUwEVa2V5R25zYnRGcm9tU3VyZkNvZWZmAAIdJXMlc19fY2ZnX19nbnNidEZyb21TdXJmQ29lZmYBD2dldFN0cmluZ09yRmFpbAIHYWRkcmVzcwNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnQgCBQdhZGRyZXNzBQNrZXkJALkJAgkAzAgCAgptYW5kYXRvcnkgCQDMCAIJAKUIAQUHYWRkcmVzcwkAzAgCAgEuCQDMCAIFA2tleQkAzAgCAg8gaXMgbm90IGRlZmluZWQFA25pbAIAAQxnZXRJbnRPckZhaWwCB2FkZHJlc3MDa2V5CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJoIAgU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2FyZHNTWVNSRUFET05MWQEVdXNlckFkZHJlc3NTdHJPckVtcHR5BA1uc2J0UmV3YXJkU3RyCQEIYXNTdHJpbmcBCQD8BwQFE25zYnRTdGFraW5nQ29udHJhY3QCGHVuY2xhaW1lZFJld2FyZHNSRUFET05MWQkAzAgCBRV1c2VyQWRkcmVzc1N0ck9yRW1wdHkFA25pbAUDbmlsBA1zdXJmUmV3YXJkU3RyCQEIYXNTdHJpbmcBCQD8BwQFE3N1cmZTdGFraW5nQ29udHJhY3QCGHVuY2xhaW1lZFJld2FyZHNSRUFET05MWQkAzAgCBRV1c2VyQWRkcmVzc1N0ck9yRW1wdHkFA25pbAUDbmlsCQCUCgIFA25pbAkAzAgCBQ1uc2J0UmV3YXJkU3RyCQDMCAIFDXN1cmZSZXdhcmRTdHIFA25pbACOhnVW", "chainId": 84, "height": 2168046, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: J9Wba82ZnfD3PBNwFCnftYKubtEV7bfoSrXNc3LQqop4 Next: 37p8xdjPb7PigFwfXEJVayt7JrDLLc5ojeKPy5Afb1Q8 Diff:
Old | New | Differences | |
---|---|---|---|
175 | 175 | ||
176 | 176 | @Callable(i) | |
177 | 177 | func claimRewards () = { | |
178 | - | let nsbtInv = invoke( | |
178 | + | let nsbtInv = invoke(nsbtStakingContract, "claimRewardsByOriginCaller", nil, nil) | |
179 | 179 | if ((nsbtInv == nsbtInv)) | |
180 | 180 | then { | |
181 | 181 | let surfInv = invoke(surfStakingContract, "claimRewardsByOriginCaller", nil, nil) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let revisionNum = "" | |
5 | 5 | ||
6 | 6 | let EULER8 = 271828182 | |
7 | 7 | ||
8 | 8 | let MULT6 = 1000000 | |
9 | 9 | ||
10 | 10 | let MULTX6 = toBigInt(1000000) | |
11 | 11 | ||
12 | 12 | let MULT8 = 100000000 | |
13 | 13 | ||
14 | 14 | let MULTX8 = toBigInt(100000000) | |
15 | 15 | ||
16 | 16 | let MULT12 = 1000000000000 | |
17 | 17 | ||
18 | 18 | let MULT18 = toBigInt(1000000000000000000) | |
19 | 19 | ||
20 | 20 | let SEP = "__" | |
21 | 21 | ||
22 | 22 | let WAVESID = fromBase58String("WAVES") | |
23 | 23 | ||
24 | 24 | func keyGnsbtFromSurfCoeff () = "%s%s__cfg__gnsbtFromSurfCoeff" | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func convertWavesToNeutrino (amount,price) = fraction(amount, price, MULT8) | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func asAnyList (val) = match val { | |
43 | 43 | case valAnyList: List[Any] => | |
44 | 44 | valAnyList | |
45 | 45 | case _ => | |
46 | 46 | throw("fail to cast into List[Any]") | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func asInt (val) = match val { | |
51 | 51 | case valInt: Int => | |
52 | 52 | valInt | |
53 | 53 | case _ => | |
54 | 54 | throw("fail to cast into Int") | |
55 | 55 | } | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func asString (val) = match val { | |
59 | 59 | case valStr: String => | |
60 | 60 | valStr | |
61 | 61 | case _ => | |
62 | 62 | throw("fail to cast into String") | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func asTuple2Ints (val) = match val { | |
67 | 67 | case v: (Int, Int) => | |
68 | 68 | v | |
69 | 69 | case _ => | |
70 | 70 | throw("fail to cast into Tuple2 ints") | |
71 | 71 | } | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func asSwapParamsSTRUCT (val) = match val { | |
75 | 75 | case struct: (Int, Int, Int, Int, Int) => | |
76 | 76 | struct | |
77 | 77 | case _ => | |
78 | 78 | throw("fail to cast into Int") | |
79 | 79 | } | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func toTimestamp (start) = if ((0 > start)) | |
83 | 83 | then -1 | |
84 | 84 | else match blockInfoByHeight(start) { | |
85 | 85 | case block: BlockInfo => | |
86 | 86 | block.timestamp | |
87 | 87 | case _ => | |
88 | 88 | -1 | |
89 | 89 | } | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult)) | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18)) | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | let IdxControlCfgNeutrinoDapp = 1 | |
99 | 99 | ||
100 | 100 | let IdxControlCfgAuctionDapp = 2 | |
101 | 101 | ||
102 | 102 | let IdxControlCfgRpdDapp = 3 | |
103 | 103 | ||
104 | 104 | let IdxControlCfgMathDapp = 4 | |
105 | 105 | ||
106 | 106 | let IdxControlCfgLiquidationDapp = 5 | |
107 | 107 | ||
108 | 108 | let IdxControlCfgRestDapp = 6 | |
109 | 109 | ||
110 | 110 | let IdxControlCfgNodeRegistryDapp = 7 | |
111 | 111 | ||
112 | 112 | let IdxControlCfgNsbtStakingDapp = 8 | |
113 | 113 | ||
114 | 114 | let IdxControlCfgMediatorDapp = 9 | |
115 | 115 | ||
116 | 116 | let IdxControlCfgSurfStakingDapp = 10 | |
117 | 117 | ||
118 | 118 | let IdxControlCfgGnsbtControllerDapp = 11 | |
119 | 119 | ||
120 | 120 | func keyControlAddress () = "%s%s__config__controlAddress" | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func keyControlCfg () = "%s__controlConfig" | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func readControlCfgOrFail (control) = split(getStringOrFail(control, keyControlCfg()), SEP) | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx))) | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx")) | |
133 | 133 | ||
134 | 134 | let controlCfg = readControlCfgOrFail(controlContract) | |
135 | 135 | ||
136 | 136 | let mathContract = getContractAddressOrFail(controlCfg, IdxControlCfgMathDapp) | |
137 | 137 | ||
138 | 138 | let neutrinoContract = getContractAddressOrFail(controlCfg, IdxControlCfgNeutrinoDapp) | |
139 | 139 | ||
140 | 140 | let auctionContract = getContractAddressOrFail(controlCfg, IdxControlCfgAuctionDapp) | |
141 | 141 | ||
142 | 142 | let liquidationContract = getContractAddressOrFail(controlCfg, IdxControlCfgLiquidationDapp) | |
143 | 143 | ||
144 | 144 | let rpdContract = getContractAddressOrFail(controlCfg, IdxControlCfgRpdDapp) | |
145 | 145 | ||
146 | 146 | let nsbtStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgNsbtStakingDapp) | |
147 | 147 | ||
148 | 148 | let surfStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgSurfStakingDapp) | |
149 | 149 | ||
150 | 150 | let gnsbtFromSurfCoeff = valueOrElse(getInteger(this, keyGnsbtFromSurfCoeff()), 60) | |
151 | 151 | ||
152 | 152 | @Callable(i) | |
153 | 153 | func gnsbtFromSurfSYSREADONLY (surfAmt) = $Tuple2(nil, (surfAmt / gnsbtFromSurfCoeff)) | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | ||
157 | 157 | @Callable(i) | |
158 | 158 | func gnsbtInfoSYSREADONLY (userAddressStrOrEmpty) = { | |
159 | 159 | let nsbtData = asAnyList(invoke(nsbtStakingContract, "nsbtStakingSYSREADONLY", [userAddressStrOrEmpty], nil)) | |
160 | 160 | let nsbtUser = asInt(nsbtData[0]) | |
161 | 161 | let nsbtTotal = asInt(nsbtData[1]) | |
162 | 162 | let gNsbtFromNsbtUser = nsbtUser | |
163 | 163 | let gNsbtFromNsbtTotal = nsbtTotal | |
164 | 164 | let surfData = asAnyList(invoke(surfStakingContract, "surfStakingSYSREADONLY", [userAddressStrOrEmpty], nil)) | |
165 | 165 | let surfUser = asInt(surfData[0]) | |
166 | 166 | let surfTotal = asInt(surfData[1]) | |
167 | 167 | let gNsbtFromSurfUser = asInt(surfData[2]) | |
168 | 168 | let gNsbtFromSurfTotal = asInt(surfData[3]) | |
169 | 169 | let gNsbtUser = (gNsbtFromNsbtUser + gNsbtFromSurfUser) | |
170 | 170 | let gNsbtTotal = (gNsbtFromNsbtTotal + gNsbtFromSurfTotal) | |
171 | 171 | $Tuple2(nil, [gNsbtUser, gNsbtTotal, [nsbtUser, nsbtTotal, gNsbtFromNsbtUser, gNsbtFromNsbtTotal], [surfUser, surfTotal, gNsbtFromSurfUser, gNsbtFromSurfTotal]]) | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | ||
176 | 176 | @Callable(i) | |
177 | 177 | func claimRewards () = { | |
178 | - | let nsbtInv = invoke( | |
178 | + | let nsbtInv = invoke(nsbtStakingContract, "claimRewardsByOriginCaller", nil, nil) | |
179 | 179 | if ((nsbtInv == nsbtInv)) | |
180 | 180 | then { | |
181 | 181 | let surfInv = invoke(surfStakingContract, "claimRewardsByOriginCaller", nil, nil) | |
182 | 182 | if ((surfInv == surfInv)) | |
183 | 183 | then nil | |
184 | 184 | else throw("Strict value is not equal to itself.") | |
185 | 185 | } | |
186 | 186 | else throw("Strict value is not equal to itself.") | |
187 | 187 | } | |
188 | 188 | ||
189 | 189 | ||
190 | 190 | ||
191 | 191 | @Callable(i) | |
192 | 192 | func gnsbtRewardsSYSREADONLY (userAddressStrOrEmpty) = { | |
193 | 193 | let nsbtRewardStr = asString(invoke(nsbtStakingContract, "unclaimedRewardsREADONLY", [userAddressStrOrEmpty], nil)) | |
194 | 194 | let surfRewardStr = asString(invoke(surfStakingContract, "unclaimedRewardsREADONLY", [userAddressStrOrEmpty], nil)) | |
195 | 195 | $Tuple2(nil, [nsbtRewardStr, surfRewardStr]) | |
196 | 196 | } | |
197 | 197 | ||
198 | 198 |
github/deemru/w8io/169f3d6 35.69 ms ◑