tx · FBVd4PENSumhkVFNBJeFef4YhihRZbYyfiERu7Qc9cSg

3N1XAEyg1TQGa5FCEerrRhLGi5KyVq26Xm8:  -0.00200000 Waves

2023.01.16 23:05 [2407950] smart account 3N1XAEyg1TQGa5FCEerrRhLGi5KyVq26Xm8 > SELF 0.00000000 Waves

{ "type": 13, "id": "FBVd4PENSumhkVFNBJeFef4YhihRZbYyfiERu7Qc9cSg", "fee": 200000, "feeAssetId": null, "timestamp": 1673899561527, "version": 2, "chainId": 84, "sender": "3N1XAEyg1TQGa5FCEerrRhLGi5KyVq26Xm8", "senderPublicKey": "ATuPi6fn8277fNiCoRgPTav9QG15CJoW95GEGcDmfYt8", "proofs": [ "5wfUv18fdMtDjzvpXToKutDe3dmsssMCg5R4JQ7KyUtujXvUqYpcQv9i3wBDutQetgVrEf26o9VYYtQ378Xt4wQR" ], "script": "base64:BgIJCAISABIDCgEIEQAFd2NkSWQCLDVXRTZIQlZzbUFiYXBUbVRLcG15V21VUjY3ZmMxNnliRnJOanh6bURCdFBhAAt3Y2REZWNpbWFscwACARN0b3RhbFNoYXJlQnlVc2VyS0VZAQVvd25lcgkAuQkCCQDMCAICBnNoYXJlcwkAzAgCBQVvd25lcgUDbmlsAgFfARR0b3RhbFNoYXJlQnlVc2VyUkVBRAEFb3duZXIJAQt2YWx1ZU9yRWxzZQIJAJoIAgUEdGhpcwkBE3RvdGFsU2hhcmVCeVVzZXJLRVkBBQVvd25lcgAAABJ0b3RhbElzc3VlZFdDRF9LRVkCEHRvdGFsX2lzc3VlZF9XQ0QBE3RvdGFsSXNzdWVkV0NEX1JFQUQACQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFEnRvdGFsSXNzdWVkV0NEX0tFWQAAAA50b3RhbFNoYXJlc0tFWQIMdG90YWxfc2hhcmVzAQ90b3RhbFNoYXJlc1JFQUQACQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFDnRvdGFsU2hhcmVzS0VZAAAAEnRvdGFsQ29sbGF0Z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XNzZXRJZAkAAgECFk9ubHkgV0FWRVMgaXMgYWxsb3dlZC4EB2FjY291bnQJAKUIAQgFAWkGY2FsbGVyBBB0b3RhbFNoYXJlQnlVc2VyCQEUdG90YWxTaGFyZUJ5VXNlclJFQUQBBQdhY2NvdW50BAt0b3RhbFNoYXJlcwkBD3RvdGFsU2hhcmVzUkVBRAAED3RvdGFsQ29sbGF0ZXJhbAkBE3RvdGFsQ29sbGF0ZXJhbFJFQUQACQDMCAIJAQxJbnRlZ2VyRW50cnkCCQETdG90YWxTaGFyZUJ5VXNlcktFWQEFB2FjY291bnQJAGQCBRB0b3RhbFNoYXJlQnlVc2VyCAUDcG10BmFtb3VudAkAzAgCCQEMSW50ZWdlckVudHJ5AgUOdG90YWxTaGFyZXNLRVkJAGQCBQt0b3RhbFNoYXJlcwgFA3BtdAZhbW91bnQJAMwIAgkBDEludGVnZXJFbnRyeQIFEnRvdGFsQ29sbGF0ZXJhbEtFWQkAZAIFD3RvdGFsQ29sbGF0ZXJhbAgFA3BtdAZhbW91bnQFA25pbAFpAQR0ZXN0AQdhY2NvdW50CQACAQkArAICAghSZXN1bHQ6IAkApAMBCQELZ2V0VXNlclRNREkBBQdhY2NvdW50AFOSf8s=", "height": 2407950, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JAkUNAc9ajxpH4av6EmcMe5nmjxv7VRLuD8KbrD8kNBa Next: 3NwPdgvxBCoh5krNCScVtwijAi1Rr9TLLZhvxD96UNyK Diff:
OldNewDifferences
2121 func i () = valueOrElse(getInteger(this, h), 0)
2222
2323
24-func j (d) = {
25- let k = i()
26- if ((k > 0))
24+let j = "total_collateral"
25+
26+func k () = valueOrElse(getInteger(this, j), 0)
27+
28+
29+func l (d) = {
30+ let m = i()
31+ if ((m > 0))
2732 then {
28- let l = e(d)
29- fraction(100000000, l, k)
33+ let n = e(d)
34+ fraction(100000000, n, m)
3035 }
3136 else 0
3237 }
3338
3439
35-let m = "A"
40+let o = "A"
3641
37-func n () = valueOrElse(getInteger(this, "A"), 100)
42+func p () = valueOrElse(getInteger(this, "A"), 100)
3843
3944
40-func o (p,q) = (500000000 - (log(p, b, 10, 0, 6, HALFUP) * q))
45+func q (r,s) = (500000000 - (log(r, b, 10, 0, 6, HALFUP) * s))
4146
4247
43-func r (p,q) = if ((p > 10000000))
44- then fraction(p, pow(10, 0, o(p, q), 8, 8, HALFUP), 100000000)
48+func t (r,s) = if ((r > 10000000))
49+ then fraction(r, pow(10, 0, q(r, s), 8, 8, HALFUP), 100000000)
4550 else 10000000
4651
4752
48-func s () = r(g(), n())
53+func u () = t(g(), p())
4954
5055
51-func t (d) = fraction(s(), j(d), 100000000)
56+func v (d) = fraction(u(), l(d), 100000000)
5257
5358
54-@Callable(u)
59+@Callable(w)
5560 func deposit_share () = {
56- let v = if ((size(u.payments) == 1))
57- then u.payments[0]
61+ let x = if ((size(w.payments) == 1))
62+ then w.payments[0]
5863 else throw("Attached payment is required")
59- if (isDefined(v.assetId))
64+ if (isDefined(x.assetId))
6065 then throw("Only WAVES is allowed.")
6166 else {
62- let w = toString(u.caller)
63- let x = e(w)
64- let k = i()
65-[IntegerEntry(c(w), (x + v.amount)), IntegerEntry(h, (k + v.amount))]
67+ let y = toString(w.caller)
68+ let z = e(y)
69+ let m = i()
70+ let A = k()
71+[IntegerEntry(c(y), (z + x.amount)), IntegerEntry(h, (m + x.amount)), IntegerEntry(j, (A + x.amount))]
6672 }
6773 }
6874
6975
7076
71-@Callable(u)
72-func test (w) = throw(("Result: " + toString(t(w))))
77+@Callable(w)
78+func test (y) = throw(("Result: " + toString(v(y))))
7379
7480
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "5WE6HBVsmAbapTmTKpmyWmUR67fc16ybFrNjxzmDBtPa"
55
66 let b = 2
77
88 func c (d) = makeString(["shares", d], "_")
99
1010
1111 func e (d) = valueOrElse(getInteger(this, c(d)), 0)
1212
1313
1414 let f = "total_issued_WCD"
1515
1616 func g () = valueOrElse(getInteger(this, f), 0)
1717
1818
1919 let h = "total_shares"
2020
2121 func i () = valueOrElse(getInteger(this, h), 0)
2222
2323
24-func j (d) = {
25- let k = i()
26- if ((k > 0))
24+let j = "total_collateral"
25+
26+func k () = valueOrElse(getInteger(this, j), 0)
27+
28+
29+func l (d) = {
30+ let m = i()
31+ if ((m > 0))
2732 then {
28- let l = e(d)
29- fraction(100000000, l, k)
33+ let n = e(d)
34+ fraction(100000000, n, m)
3035 }
3136 else 0
3237 }
3338
3439
35-let m = "A"
40+let o = "A"
3641
37-func n () = valueOrElse(getInteger(this, "A"), 100)
42+func p () = valueOrElse(getInteger(this, "A"), 100)
3843
3944
40-func o (p,q) = (500000000 - (log(p, b, 10, 0, 6, HALFUP) * q))
45+func q (r,s) = (500000000 - (log(r, b, 10, 0, 6, HALFUP) * s))
4146
4247
43-func r (p,q) = if ((p > 10000000))
44- then fraction(p, pow(10, 0, o(p, q), 8, 8, HALFUP), 100000000)
48+func t (r,s) = if ((r > 10000000))
49+ then fraction(r, pow(10, 0, q(r, s), 8, 8, HALFUP), 100000000)
4550 else 10000000
4651
4752
48-func s () = r(g(), n())
53+func u () = t(g(), p())
4954
5055
51-func t (d) = fraction(s(), j(d), 100000000)
56+func v (d) = fraction(u(), l(d), 100000000)
5257
5358
54-@Callable(u)
59+@Callable(w)
5560 func deposit_share () = {
56- let v = if ((size(u.payments) == 1))
57- then u.payments[0]
61+ let x = if ((size(w.payments) == 1))
62+ then w.payments[0]
5863 else throw("Attached payment is required")
59- if (isDefined(v.assetId))
64+ if (isDefined(x.assetId))
6065 then throw("Only WAVES is allowed.")
6166 else {
62- let w = toString(u.caller)
63- let x = e(w)
64- let k = i()
65-[IntegerEntry(c(w), (x + v.amount)), IntegerEntry(h, (k + v.amount))]
67+ let y = toString(w.caller)
68+ let z = e(y)
69+ let m = i()
70+ let A = k()
71+[IntegerEntry(c(y), (z + x.amount)), IntegerEntry(h, (m + x.amount)), IntegerEntry(j, (A + x.amount))]
6672 }
6773 }
6874
6975
7076
71-@Callable(u)
72-func test (w) = throw(("Result: " + toString(t(w))))
77+@Callable(w)
78+func test (y) = throw(("Result: " + toString(v(y))))
7379
7480

github/deemru/w8io/169f3d6 
47.63 ms