tx · BQeJbsSi6DhRJpXZude6nRSBNzzfTaaJtVzYcYG9MQQi

3NBG2Nuz2cjtG8wWcKLBGZ1bBpveU56gp77:  -0.04000000 Waves

2021.09.05 01:31 [1688901] smart account 3NBG2Nuz2cjtG8wWcKLBGZ1bBpveU56gp77 > SELF 0.00000000 Waves

{ "type": 13, "id": "BQeJbsSi6DhRJpXZude6nRSBNzzfTaaJtVzYcYG9MQQi", "fee": 4000000, "feeAssetId": null, "timestamp": 1630794719860, "version": 2, "chainId": 84, "sender": "3NBG2Nuz2cjtG8wWcKLBGZ1bBpveU56gp77", "senderPublicKey": "B565vUqaobfDQJcgjUnNdsSqnqWfRsAQDBb1JeciPWtP", "proofs": [ "3yzAr2GVGNm3p7DvJL4a87CqPWQVdbJ9Q2nPvNWskNdT4tP8yvBNnZujh9BHCxkmHbPMAhM9wXZSu2DCCE5bhJ7p" ], "script": "base64:AAIFAAAAAAAAADAIAhIHCgUIAQgBCBIECgIIBBIDCgEIEgMKAQgSBAoCCAESBwoFCAgBCAgSBAoCCAgAAAAuAAAAAApiYXNlRmFjdG9yAAAAAAAAAAPoAAAAAAliYXNlSW5kZXgAACOG8m/BAAAAAAAADWJsb2Nrc1BlclllYXIAAAAAAAAIBSAAAAAABmNvbmZpZwkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAAA1jb25maWdBZGRyZXNzAgAAAAAAAAAABWFkbWluCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAEFAAAABmNvbmZpZwIAAAAFYWRtaW4CAAAAAAAAAAALd2F2ZXRyb2xsZXIJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAGY29uZmlnAgAAAAt3YXZldHJvbGxlcgIAAAAAAAAAAAZvcmFjbGUJAQAAAAt2YWx1ZU9yRWxzZQAAAA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AAAAnR4AAAAD3NlbmRlclB1YmxpY0tleXcqsZY=", "height": 1688901, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BwH5zpgbryfLArQuU19zbQve4JxJDVfa77Bh2BeSVAyz Next: 9JGzBf2gYxVT6gHzUzkuQGh2VxpkMSwzk8s2wixoNB9y Diff:
OldNewDifferences
138138
139139 @Callable(al)
140140 func getUserHealthParameter (ai,am,an,ao,ap) = if (C(al.caller))
141- then {
142- let aq = valueOrElse(getIntegerValue(this, (ai + "_locked")), 0)
143- let ar = if ((w == an))
144- then (aq - am)
145- else aq
146- let as = if ((ap == h))
147- then (ah(ai) + ao)
148- else ah(ai)
149- let at = af(ar)
150- let au = invoke(addressFromStringValue(g), "getPrice", [h], nil)
151- let av = au
152- if ($isInstanceOf(av, "Int"))
153- then {
154- let aw = av
155- let ax = fraction(o, at, a)
156- let ac = pow(10, 0, i, 0, 0, CEILING)
157- let ay = fraction(ax, aw, ac)
158- let az = fraction(as, aw, ac)
159- let aA = fraction(az, a, p)
160- $Tuple2(nil, $Tuple2(ay, aA))
161- }
162- else throw("Incorrect pricing")
163- }
141+ then $Tuple2(nil, $Tuple2(2, 2))
164142 else throw("Address does not match with wavetroller address!")
165143
166144
167145
168146 @Callable(al)
169-func deposit (ai,aB) = if (C(al.caller))
147+func deposit (ai,aq) = if (C(al.caller))
170148 then {
171- let aC = ad(al.payments[0].amount)
172- let aD = (u + aC)
173- if (aB)
149+ let ar = ad(al.payments[0].amount)
150+ let as = (u + ar)
151+ if (aq)
174152 then {
175- let aE = (K(ai) + aC)
176- $Tuple2([I((ai + "_locked"), aE), I("dTokenSupply", aD), I("totalBorrow", W), I("totalSupply", (Y + al.payments[0].amount)), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), Reissue(fromBase58String(w), aC, true)], ((toString(al.payments[0].amount) + x) + "were successfully locked"))
153+ let at = (K(ai) + ar)
154+ $Tuple2([I((ai + "_locked"), at), I("dTokenSupply", as), I("totalBorrow", W), I("totalSupply", (Y + al.payments[0].amount)), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), Reissue(fromBase58String(w), ar, true)], ((toString(al.payments[0].amount) + x) + "were successfully locked"))
177155 }
178- else $Tuple2([I("dTokenSupply", aD), I("totalBorrow", W), I("totalSupply", (Y + al.payments[0].amount)), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), Reissue(fromBase58String(w), aC, true), ScriptTransfer(al.caller, aC, fromBase58String(w))], aC)
156+ else $Tuple2([I("dTokenSupply", as), I("totalBorrow", W), I("totalSupply", (Y + al.payments[0].amount)), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), Reissue(fromBase58String(w), ar, true), ScriptTransfer(al.caller, ar, fromBase58String(w))], ar)
179157 }
180158 else throw("Address does not match with wavetroller address!")
181159
184162 @Callable(al)
185163 func withdraw (ai) = if (C(al.caller))
186164 then {
187- let aF = (Y - W)
188- let aG = af(al.payments[0].amount)
189- if ((aF >= aG))
190- then $Tuple2([I("dTokenSupply", (u - al.payments[0].amount)), I("totalBorrow", W), I("totalSupply", (Y - aG)), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), Burn(fromBase58String(w), al.payments[0].amount), if ((h == "WAVES"))
191- then ScriptTransfer(al.caller, aG, unit)
192- else ScriptTransfer(al.caller, aG, fromBase58String(h))], aG)
165+ let au = (Y - W)
166+ let av = af(al.payments[0].amount)
167+ if ((au >= av))
168+ then $Tuple2([I("dTokenSupply", (u - al.payments[0].amount)), I("totalBorrow", W), I("totalSupply", (Y - av)), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), Burn(fromBase58String(w), al.payments[0].amount), if ((h == "WAVES"))
169+ then ScriptTransfer(al.caller, av, unit)
170+ else ScriptTransfer(al.caller, av, fromBase58String(h))], av)
193171 else throw("Pool liquidity is not sufficient!")
194172 }
195173 else throw("Address does not match with wavetroller address!")
199177 @Callable(al)
200178 func lockAsCollateral (ai) = if (C(al.caller))
201179 then {
202- let aH = (K(ai) + al.payments[0].amount)
203- $Tuple2([I((ai + "_locked"), aH), I("totalBorrow", W), I("totalSupply", Y), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height)], ((toString(al.payments[0].amount) + x) + "were successfully locked"))
180+ let aw = (K(ai) + al.payments[0].amount)
181+ $Tuple2([I((ai + "_locked"), aw), I("totalBorrow", W), I("totalSupply", Y), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height)], ((toString(al.payments[0].amount) + x) + "were successfully locked"))
204182 }
205183 else throw("Address does not match with wavetroller address!")
206184
207185
208186
209187 @Callable(al)
210-func borrow (ai,aI) = if (C(al.caller))
188+func borrow (ai,ax) = if (C(al.caller))
211189 then {
212- let as = ah(ai)
213- $Tuple2([I((ai + "_borrow"), (as + aI)), I((ai + "_index"), V), I("totalBorrow", (W + aI)), I("totalSupply", Y), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), if ((h == "WAVES"))
214- then ScriptTransfer(al.caller, aI, unit)
215- else ScriptTransfer(al.caller, aI, fromBase58String(h))], aI)
190+ let ay = ah(ai)
191+ $Tuple2([I((ai + "_borrow"), (ay + ax)), I((ai + "_index"), V), I("totalBorrow", (W + ax)), I("totalSupply", Y), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), if ((h == "WAVES"))
192+ then ScriptTransfer(al.caller, ax, unit)
193+ else ScriptTransfer(al.caller, ax, fromBase58String(h))], ax)
216194 }
217195 else throw("Address does not match with wavetroller address!")
218196
219197
220198
221199 @Callable(al)
222-func setup (aJ,aK,n,aL,aM) = if (!(isDefined(getString(this, "configAddress"))))
200+func setup (az,aA,n,aB,aC) = if (!(isDefined(getString(this, "configAddress"))))
223201 then {
224- let aN = Issue(aL, aM, 0, 8, true)
225- let aO = calculateAssetId(aN)
226-[aN, F("assetId", aJ), F("configAddress", aK), IntegerEntry("totalBorrow", 0), IntegerEntry("totalSupply", 0), IntegerEntry("totalReserve", 0), IntegerEntry("storedIndex", b), IntegerEntry("storedHeight", height), IntegerEntry("baseExchangeRate", n), F("dTokenName", aL), F("dTokenId", toBase58String(aO)), IntegerEntry("dTokenDecimals", 8), IntegerEntry("dTokenSupply", 0)]
202+ let aD = Issue(aB, aC, 0, 8, true)
203+ let aE = calculateAssetId(aD)
204+[aD, F("assetId", az), F("configAddress", aA), IntegerEntry("totalBorrow", 0), IntegerEntry("totalSupply", 0), IntegerEntry("totalReserve", 0), IntegerEntry("storedIndex", b), IntegerEntry("storedHeight", height), IntegerEntry("baseExchangeRate", n), F("dTokenName", aB), F("dTokenId", toBase58String(aE)), IntegerEntry("dTokenDecimals", 8), IntegerEntry("dTokenSupply", 0)]
227205 }
228206 else throw("Pool already setup!")
229207
230208
231209
232210 @Callable(al)
233-func writeEntry (aP,aQ) = [F(aP, aQ)]
211+func writeEntry (aF,aG) = [F(aF, aG)]
234212
235213
236-@Verifier(aR)
237-func aS () = sigVerify(aR.bodyBytes, aR.proofs[0], aR.senderPublicKey)
214+@Verifier(aH)
215+func aI () = sigVerify(aH.bodyBytes, aH.proofs[0], aH.senderPublicKey)
238216
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = 1000
55
66 let b = 10000000000000000
77
88 let c = 525600
99
1010 let d = valueOrElse(getString(this, "configAddress"), "")
1111
1212 let e = valueOrElse(getString(addressFromStringValue(d), "admin"), "")
1313
1414 let f = valueOrElse(getString(addressFromStringValue(d), "wavetroller"), "")
1515
1616 let g = valueOrElse(getString(addressFromStringValue(d), "oracle"), "")
1717
1818 let h = valueOrErrorMessage(getString(this, "assetId"), "No assetId could be found in data storage!")
1919
2020 let i = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_Decimals")), (("No key " + (h + "_Decimals")) + " was found"))
2121
2222 let j = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_Multiplier")), (("No key " + (h + "_Multiplier")) + " was found"))
2323
2424 let k = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_Kink")), (("No key " + (h + "_Kink")) + " was found"))
2525
2626 let l = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_JumpMultiplier")), (("No key " + (h + "_JumpMultiplier")) + " was found"))
2727
2828 let m = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_BaseRate")), (("No key " + (h + "_BaseRate")) + " was found"))
2929
3030 let n = valueOrErrorMessage(getInteger(this, "baseExchangeRate"), "No key baseExchangeRate was found")
3131
3232 let o = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_CollateralFactor")), (("No key " + (h + "_CollateralFactor")) + " was found"))
3333
3434 let p = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_Threshold")), (("No key " + (h + "_Threshold")) + " was found"))
3535
3636 let q = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_ReserveFactor")), (("No key " + (h + "_ReserveFactor")) + " was found"))
3737
3838 let r = valueOrElse(getInteger(this, "totalBorrow"), 0)
3939
4040 let s = valueOrElse(getInteger(this, "totalSupply"), 0)
4141
4242 let t = valueOrElse(getInteger(this, "totalReserve"), 0)
4343
4444 let u = valueOrErrorMessage(getInteger(this, "dTokenSupply"), "No key dTokenSupply was found")
4545
4646 let v = valueOrErrorMessage(getInteger(this, "dTokenDecimals"), "No key dTokenDecimals was found")
4747
4848 let w = valueOrErrorMessage(getString(this, "dTokenId"), "No key dTokenId was found")
4949
5050 let x = valueOrErrorMessage(getString(this, "dTokenName"), "No key dTokenName was found")
5151
5252 let y = valueOrElse(getInteger(this, "storedHeight"), height)
5353
5454 let z = valueOrElse(getInteger(this, "storedIndex"), 10000000000000000)
5555
5656 func A (B) = if ((addressFromStringValue(e) == B))
5757 then true
5858 else false
5959
6060
6161 func C (B) = if ((addressFromStringValue(f) == B))
6262 then true
6363 else false
6464
6565
6666 func D (E) = if ((E == h))
6767 then true
6868 else false
6969
7070
7171 func F (G,H) = StringEntry(G, H)
7272
7373
7474 func I (G,J) = IntegerEntry(G, J)
7575
7676
7777 func K (L) = valueOrElse(getInteger(this, (L + "_locked")), 0)
7878
7979
8080 let M = if ((s > 0))
8181 then fraction(r, a, s)
8282 else 0
8383
8484 let N = {
8585 let O = [M, k]
8686 let P = min(O)
8787 let Q = [0, (M - k)]
8888 let R = max(Q)
8989 ((fraction(j, P, a) + fraction(l, R, a)) + m)
9090 }
9191
9292 let S = fraction(fraction(N, M, a), (a - q), a)
9393
9494 let T = fraction(N, b, (c * a))
9595
9696 let U = (height - y)
9797
9898 let V = fraction(z, (b + (T * U)), b, CEILING)
9999
100100 let W = fraction(r, V, z)
101101
102102 let X = fraction(r, (T * U), b)
103103
104104 let Y = (s + fraction((a - q), X, a))
105105
106106 let Z = (t + fraction(q, X, a))
107107
108108 let aa = if ((u > 0))
109109 then {
110110 let ab = ((18 - v) + i)
111111 let ac = pow(10, 0, ab, 0, 0, CEILING)
112112 fraction(Y, ac, u)
113113 }
114114 else n
115115
116116 func ad (ae) = {
117117 let ab = ((18 - v) + i)
118118 let ac = pow(10, 0, ab, 0, 0, CEILING)
119119 fraction(ae, ac, aa)
120120 }
121121
122122
123123 func af (ag) = {
124124 let ab = ((18 - v) + i)
125125 let ac = pow(10, 0, ab, 0, 0, CEILING)
126126 fraction(ag, aa, ac)
127127 }
128128
129129
130130 func ah (ai) = {
131131 let aj = valueOrElse(getIntegerValue(this, (ai + "_borrow")), 0)
132132 let ak = valueOrElse(getIntegerValue(this, (ai + "_index")), 0)
133133 if ((ak > 0))
134134 then fraction(aj, V, ak)
135135 else 0
136136 }
137137
138138
139139 @Callable(al)
140140 func getUserHealthParameter (ai,am,an,ao,ap) = if (C(al.caller))
141- then {
142- let aq = valueOrElse(getIntegerValue(this, (ai + "_locked")), 0)
143- let ar = if ((w == an))
144- then (aq - am)
145- else aq
146- let as = if ((ap == h))
147- then (ah(ai) + ao)
148- else ah(ai)
149- let at = af(ar)
150- let au = invoke(addressFromStringValue(g), "getPrice", [h], nil)
151- let av = au
152- if ($isInstanceOf(av, "Int"))
153- then {
154- let aw = av
155- let ax = fraction(o, at, a)
156- let ac = pow(10, 0, i, 0, 0, CEILING)
157- let ay = fraction(ax, aw, ac)
158- let az = fraction(as, aw, ac)
159- let aA = fraction(az, a, p)
160- $Tuple2(nil, $Tuple2(ay, aA))
161- }
162- else throw("Incorrect pricing")
163- }
141+ then $Tuple2(nil, $Tuple2(2, 2))
164142 else throw("Address does not match with wavetroller address!")
165143
166144
167145
168146 @Callable(al)
169-func deposit (ai,aB) = if (C(al.caller))
147+func deposit (ai,aq) = if (C(al.caller))
170148 then {
171- let aC = ad(al.payments[0].amount)
172- let aD = (u + aC)
173- if (aB)
149+ let ar = ad(al.payments[0].amount)
150+ let as = (u + ar)
151+ if (aq)
174152 then {
175- let aE = (K(ai) + aC)
176- $Tuple2([I((ai + "_locked"), aE), I("dTokenSupply", aD), I("totalBorrow", W), I("totalSupply", (Y + al.payments[0].amount)), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), Reissue(fromBase58String(w), aC, true)], ((toString(al.payments[0].amount) + x) + "were successfully locked"))
153+ let at = (K(ai) + ar)
154+ $Tuple2([I((ai + "_locked"), at), I("dTokenSupply", as), I("totalBorrow", W), I("totalSupply", (Y + al.payments[0].amount)), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), Reissue(fromBase58String(w), ar, true)], ((toString(al.payments[0].amount) + x) + "were successfully locked"))
177155 }
178- else $Tuple2([I("dTokenSupply", aD), I("totalBorrow", W), I("totalSupply", (Y + al.payments[0].amount)), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), Reissue(fromBase58String(w), aC, true), ScriptTransfer(al.caller, aC, fromBase58String(w))], aC)
156+ else $Tuple2([I("dTokenSupply", as), I("totalBorrow", W), I("totalSupply", (Y + al.payments[0].amount)), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), Reissue(fromBase58String(w), ar, true), ScriptTransfer(al.caller, ar, fromBase58String(w))], ar)
179157 }
180158 else throw("Address does not match with wavetroller address!")
181159
182160
183161
184162 @Callable(al)
185163 func withdraw (ai) = if (C(al.caller))
186164 then {
187- let aF = (Y - W)
188- let aG = af(al.payments[0].amount)
189- if ((aF >= aG))
190- then $Tuple2([I("dTokenSupply", (u - al.payments[0].amount)), I("totalBorrow", W), I("totalSupply", (Y - aG)), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), Burn(fromBase58String(w), al.payments[0].amount), if ((h == "WAVES"))
191- then ScriptTransfer(al.caller, aG, unit)
192- else ScriptTransfer(al.caller, aG, fromBase58String(h))], aG)
165+ let au = (Y - W)
166+ let av = af(al.payments[0].amount)
167+ if ((au >= av))
168+ then $Tuple2([I("dTokenSupply", (u - al.payments[0].amount)), I("totalBorrow", W), I("totalSupply", (Y - av)), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), Burn(fromBase58String(w), al.payments[0].amount), if ((h == "WAVES"))
169+ then ScriptTransfer(al.caller, av, unit)
170+ else ScriptTransfer(al.caller, av, fromBase58String(h))], av)
193171 else throw("Pool liquidity is not sufficient!")
194172 }
195173 else throw("Address does not match with wavetroller address!")
196174
197175
198176
199177 @Callable(al)
200178 func lockAsCollateral (ai) = if (C(al.caller))
201179 then {
202- let aH = (K(ai) + al.payments[0].amount)
203- $Tuple2([I((ai + "_locked"), aH), I("totalBorrow", W), I("totalSupply", Y), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height)], ((toString(al.payments[0].amount) + x) + "were successfully locked"))
180+ let aw = (K(ai) + al.payments[0].amount)
181+ $Tuple2([I((ai + "_locked"), aw), I("totalBorrow", W), I("totalSupply", Y), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height)], ((toString(al.payments[0].amount) + x) + "were successfully locked"))
204182 }
205183 else throw("Address does not match with wavetroller address!")
206184
207185
208186
209187 @Callable(al)
210-func borrow (ai,aI) = if (C(al.caller))
188+func borrow (ai,ax) = if (C(al.caller))
211189 then {
212- let as = ah(ai)
213- $Tuple2([I((ai + "_borrow"), (as + aI)), I((ai + "_index"), V), I("totalBorrow", (W + aI)), I("totalSupply", Y), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), if ((h == "WAVES"))
214- then ScriptTransfer(al.caller, aI, unit)
215- else ScriptTransfer(al.caller, aI, fromBase58String(h))], aI)
190+ let ay = ah(ai)
191+ $Tuple2([I((ai + "_borrow"), (ay + ax)), I((ai + "_index"), V), I("totalBorrow", (W + ax)), I("totalSupply", Y), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), if ((h == "WAVES"))
192+ then ScriptTransfer(al.caller, ax, unit)
193+ else ScriptTransfer(al.caller, ax, fromBase58String(h))], ax)
216194 }
217195 else throw("Address does not match with wavetroller address!")
218196
219197
220198
221199 @Callable(al)
222-func setup (aJ,aK,n,aL,aM) = if (!(isDefined(getString(this, "configAddress"))))
200+func setup (az,aA,n,aB,aC) = if (!(isDefined(getString(this, "configAddress"))))
223201 then {
224- let aN = Issue(aL, aM, 0, 8, true)
225- let aO = calculateAssetId(aN)
226-[aN, F("assetId", aJ), F("configAddress", aK), IntegerEntry("totalBorrow", 0), IntegerEntry("totalSupply", 0), IntegerEntry("totalReserve", 0), IntegerEntry("storedIndex", b), IntegerEntry("storedHeight", height), IntegerEntry("baseExchangeRate", n), F("dTokenName", aL), F("dTokenId", toBase58String(aO)), IntegerEntry("dTokenDecimals", 8), IntegerEntry("dTokenSupply", 0)]
202+ let aD = Issue(aB, aC, 0, 8, true)
203+ let aE = calculateAssetId(aD)
204+[aD, F("assetId", az), F("configAddress", aA), IntegerEntry("totalBorrow", 0), IntegerEntry("totalSupply", 0), IntegerEntry("totalReserve", 0), IntegerEntry("storedIndex", b), IntegerEntry("storedHeight", height), IntegerEntry("baseExchangeRate", n), F("dTokenName", aB), F("dTokenId", toBase58String(aE)), IntegerEntry("dTokenDecimals", 8), IntegerEntry("dTokenSupply", 0)]
227205 }
228206 else throw("Pool already setup!")
229207
230208
231209
232210 @Callable(al)
233-func writeEntry (aP,aQ) = [F(aP, aQ)]
211+func writeEntry (aF,aG) = [F(aF, aG)]
234212
235213
236-@Verifier(aR)
237-func aS () = sigVerify(aR.bodyBytes, aR.proofs[0], aR.senderPublicKey)
214+@Verifier(aH)
215+func aI () = sigVerify(aH.bodyBytes, aH.proofs[0], aH.senderPublicKey)
238216

github/deemru/w8io/026f985 
53.00 ms