tx · BwAM9u7cK6NRK8Yf21Zq87ZyCdyqFLCRrposwjkANaF9

3MxaubN2nHCzE5spNox3ZCbPbDMfczSFrZS:  -0.01400000 Waves

2021.10.25 17:20 [1761954] smart account 3MxaubN2nHCzE5spNox3ZCbPbDMfczSFrZS > SELF 0.00000000 Waves

{ "type": 13, "id": "BwAM9u7cK6NRK8Yf21Zq87ZyCdyqFLCRrposwjkANaF9", "fee": 1400000, "feeAssetId": null, "timestamp": 1635171717817, "version": 1, "sender": "3MxaubN2nHCzE5spNox3ZCbPbDMfczSFrZS", "senderPublicKey": "FWDMjbKuHyuUuAo4utnjwDgcbsiysMPDjX835SxvtLHq", "proofs": [ "5QCQjcjv8Xfo2b1uNtrcCYogYjo9AxUhr7Gqjq9MCfB4CRfKLbKHsxKTHX99eP9hWCSEh2qyL693ci132kNU1sQw" ], "script": "base64:AAIFAAAAAAAAABAIAhIAEgASAwoBARIDCgEBAAAAFwAAAAAHYmFsYW5jZQkBAAAAB0FkZHJlc3MAAAABAQAAABoBVKMjU/C0oWt5judpFHXM19dztnXKmPy+aQAAAAARU1dPUGdvdmVybmFuY2VBZHIJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAAB2JhbGFuY2UCAAAAD1NXT1BfZ292ZXJuYW5jZQIAAAAVRW1wdHkgU1dPUF9nb3Zlcm5hbmNlAAAAAA1XYXZlc1VzZG5Qb29sCQEAAAAFdmFsdWUAAAABCQAEJgAAAAEJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAdiYWxhbmNlAgAAAA9XQVZFU19VU0ROX1Bvb2wCAAAAFUVtcHR5IFdBVkVTX1VTRE5fUG9vbAAAAAAXZGVmaWhlbHBlck1hbmFnZXJQdWJLZXkJAAJZAAAAAQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAdiYWxhbmNlAgAA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F3BQAAAARTV09QBQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAO5XAn8=", "chainId": 84, "height": 1761954, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3sjRy5uvZd8M25EaoMwU1owfxMU4KThg1xVRdwe982vP Next: 48TQYq1gFvN2eGAMj6UVFDn4WQsyXYEDdKddjDBVVzeo Diff:
OldNewDifferences
2121
2222 let j = addressFromString(valueOrErrorMessage(getString(this, h), "Empty keyOwner"))
2323
24-let k = valueOrErrorMessage(getBoolean(a, i), "Empty key isProtocolActive")
24+let k = valueOrErrorMessage(getString(this, h), "Empty keyOwner")
2525
26-let l = "last_interest"
26+let l = valueOrErrorMessage(getBoolean(a, i), "Empty key isProtocolActive")
2727
28-let m = "_SWOP_amount"
28+let m = "last_interest"
2929
30-let n = "_last_interest"
30+let n = "_SWOP_amount"
3131
32-let o = base58'Ccgesc9iWMSg1f8CqFP5nZwgF6xsGirReDhpvNp1JAWW'
32+let o = "_last_interest"
3333
34-let p = 100000000
34+let p = base58'Ccgesc9iWMSg1f8CqFP5nZwgF6xsGirReDhpvNp1JAWW'
3535
36-func q () = {
37- let r = valueOrElse(getInteger(b, l), 0)
38- r
36+let q = 100000000
37+
38+func r () = {
39+ let s = valueOrElse(getInteger(b, m), 0)
40+ s
3941 }
4042
4143
42-func s () = {
43- let t = valueOrErrorMessage(getInteger(c, "B_asset_balance"), "Empty B_asset_balance")
44- let u = valueOrErrorMessage(getInteger(c, "A_asset_balance"), "Empty A_asset_balance")
45- let v = valueOrErrorMessage(getInteger(a, "protocol_fee_in_usdn"), "Empty protocol_fee_in_usdn")
46- let w = fraction(t, v, u)
47- w
44+func t () = {
45+ let u = valueOrErrorMessage(getInteger(c, "B_asset_balance"), "Empty B_asset_balance")
46+ let v = valueOrErrorMessage(getInteger(c, "A_asset_balance"), "Empty A_asset_balance")
47+ let w = valueOrErrorMessage(getInteger(a, "protocol_fee_in_usdn"), "Empty protocol_fee_in_usdn")
48+ let x = fraction(u, w, v)
49+ x
4850 }
4951
5052
51-func x (y) = valueOrElse(getInteger(b, (toString(y) + m)), 0)
53+func y (z) = valueOrElse(getInteger(b, (toString(z) + n)), 0)
5254
5355
54-func z (y,r) = {
55- let A = x(y)
56- let B = getInteger(b, (toString(y) + n))
57- let C = {
58- let D = B
59- if ($isInstanceOf(D, "Int"))
56+func A (z,s) = {
57+ let B = y(z)
58+ let C = getInteger(b, (toString(z) + o))
59+ let D = {
60+ let E = C
61+ if ($isInstanceOf(E, "Int"))
6062 then {
61- let B = D
62- B
63+ let C = E
64+ C
6365 }
64- else r
66+ else s
6567 }
66- $Tuple2(C, A)
68+ $Tuple2(D, B)
6769 }
6870
6971
70-func E (F) = {
71- let r = q()
72- let G = z(F, r)
73- let B = G._1
74- let H = G._2
75- let I = fraction(H, (r - B), p)
76- let J = r
77- $Tuple2(J, I)
72+func F (G) = {
73+ let s = r()
74+ let H = A(G, s)
75+ let C = H._1
76+ let I = H._2
77+ let J = fraction(I, (s - C), q)
78+ let K = s
79+ $Tuple2(K, J)
7880 }
7981
8082
81-let K = s()
83+let L = t()
8284
83-@Callable(L)
85+@Callable(M)
8486 func init () = if (isDefined(getString(this, h)))
8587 then throw("Contract already initialized")
86- else if ((size(L.payments) == 0))
87- then [StringEntry(h, toString(L.caller))]
88- else if ((size(L.payments) == 1))
88+ else if ((size(M.payments) == 0))
89+ then [StringEntry(h, toString(M.caller))]
90+ else if ((size(M.payments) == 1))
8991 then {
90- let M = $Tuple2(L.payments[0].amount, L.payments[0].assetId)
91- let N = M._1
92- let O = M._2
93- if ((O != o))
92+ let N = $Tuple2(M.payments[0].amount, M.payments[0].assetId)
93+ let O = N._1
94+ let P = N._2
95+ if ((P != p))
9496 then throw("Only SWOP payment available in init()")
9597 else {
96- let P = invoke(b, "lockSWOP", nil, [AttachedPayment(o, N)])
97- if ((P == P))
98- then [StringEntry(h, toString(L.caller))]
98+ let Q = invoke(b, "lockSWOP", nil, [AttachedPayment(p, O)])
99+ if ((Q == Q))
100+ then [StringEntry(h, toString(M.caller))]
99101 else throw("Strict value is not equal to itself.")
100102 }
101103 }
103105
104106
105107
106-@Callable(L)
108+@Callable(M)
107109 func governanceLockSWOP () = {
108- let Q = $Tuple2(L.payments[0].amount, L.payments[0].assetId)
109- let N = Q._1
110- let O = Q._2
111- if ((O != o))
110+ let R = $Tuple2(M.payments[0].amount, M.payments[0].assetId)
111+ let O = R._1
112+ let P = R._2
113+ if ((P != p))
112114 then throw("Only SWOP payment available in governanceLockSWOP()")
113115 else {
114- let P = invoke(b, "lockSWOP", nil, [AttachedPayment(o, N)])
115- if ((P == P))
116+ let Q = invoke(b, "lockSWOP", nil, [AttachedPayment(p, O)])
117+ if ((Q == Q))
116118 then nil
117119 else throw("Strict value is not equal to itself.")
118120 }
120122
121123
122124
123-@Callable(L)
124-func governanceClaimAndStake (R) = if (if ((L.caller != j))
125- then (L.callerPublicKey != d)
125+@Callable(M)
126+func governanceClaimAndStake (S) = if (if ((M.caller != j))
127+ then (M.callerPublicKey != d)
126128 else false)
127129 then throw("Only owner or admin can call this function")
128130 else {
129- let I = E(this)._2
130- if ((R > I))
131+ let J = F(this)._2
132+ if ((S > J))
131133 then throw("Amount to claim is less than minSWOPreward")
132134 else {
133- let P = invoke(b, "claimAndStakeSWOP", nil, nil)
134- if ((P == P))
135+ let Q = invoke(b, "claimAndStakeSWOP", nil, nil)
136+ if ((Q == Q))
135137 then {
136- let S = invoke(a, "extractFee", [K, j], nil)
137- if ((S == S))
138+ let T = invoke(a, "extractFee", [L, k], nil)
139+ if ((T == T))
138140 then nil
139141 else throw("Strict value is not equal to itself.")
140142 }
144146
145147
146148
147-@Callable(L)
148-func governanceWithdraw (T) = if ((L.caller != j))
149+@Callable(M)
150+func governanceWithdraw (U) = if ((M.caller != j))
149151 then throw("Only owner can call this function")
150152 else {
151- let P = invoke(b, "withdrawSWOP", [T], nil)
152- if ((P == P))
153- then [ScriptTransfer(L.caller, T, o)]
153+ let Q = invoke(b, "withdrawSWOP", [U], nil)
154+ if ((Q == Q))
155+ then [ScriptTransfer(M.caller, U, p)]
154156 else throw("Strict value is not equal to itself.")
155157 }
156158
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = Address(base58'3N4ngEpA29qJdUKnRto5zUzXvJJLwUuNs5J')
55
66 let b = value(addressFromString(valueOrErrorMessage(getString(a, "SWOP_governance"), "Empty SWOP_governance")))
77
88 let c = value(addressFromString(valueOrErrorMessage(getString(a, "WAVES_USDN_Pool"), "Empty WAVES_USDN_Pool")))
99
1010 let d = fromBase58String(valueOrElse(getString(a, "defihelper_manager_PubKey"), "Empty key defihelper_manager_PubKey"))
1111
1212 let e = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv'
1313
1414 let f = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv'
1515
1616 let g = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv'
1717
1818 let h = "owner"
1919
2020 let i = "isProtocolActive"
2121
2222 let j = addressFromString(valueOrErrorMessage(getString(this, h), "Empty keyOwner"))
2323
24-let k = valueOrErrorMessage(getBoolean(a, i), "Empty key isProtocolActive")
24+let k = valueOrErrorMessage(getString(this, h), "Empty keyOwner")
2525
26-let l = "last_interest"
26+let l = valueOrErrorMessage(getBoolean(a, i), "Empty key isProtocolActive")
2727
28-let m = "_SWOP_amount"
28+let m = "last_interest"
2929
30-let n = "_last_interest"
30+let n = "_SWOP_amount"
3131
32-let o = base58'Ccgesc9iWMSg1f8CqFP5nZwgF6xsGirReDhpvNp1JAWW'
32+let o = "_last_interest"
3333
34-let p = 100000000
34+let p = base58'Ccgesc9iWMSg1f8CqFP5nZwgF6xsGirReDhpvNp1JAWW'
3535
36-func q () = {
37- let r = valueOrElse(getInteger(b, l), 0)
38- r
36+let q = 100000000
37+
38+func r () = {
39+ let s = valueOrElse(getInteger(b, m), 0)
40+ s
3941 }
4042
4143
42-func s () = {
43- let t = valueOrErrorMessage(getInteger(c, "B_asset_balance"), "Empty B_asset_balance")
44- let u = valueOrErrorMessage(getInteger(c, "A_asset_balance"), "Empty A_asset_balance")
45- let v = valueOrErrorMessage(getInteger(a, "protocol_fee_in_usdn"), "Empty protocol_fee_in_usdn")
46- let w = fraction(t, v, u)
47- w
44+func t () = {
45+ let u = valueOrErrorMessage(getInteger(c, "B_asset_balance"), "Empty B_asset_balance")
46+ let v = valueOrErrorMessage(getInteger(c, "A_asset_balance"), "Empty A_asset_balance")
47+ let w = valueOrErrorMessage(getInteger(a, "protocol_fee_in_usdn"), "Empty protocol_fee_in_usdn")
48+ let x = fraction(u, w, v)
49+ x
4850 }
4951
5052
51-func x (y) = valueOrElse(getInteger(b, (toString(y) + m)), 0)
53+func y (z) = valueOrElse(getInteger(b, (toString(z) + n)), 0)
5254
5355
54-func z (y,r) = {
55- let A = x(y)
56- let B = getInteger(b, (toString(y) + n))
57- let C = {
58- let D = B
59- if ($isInstanceOf(D, "Int"))
56+func A (z,s) = {
57+ let B = y(z)
58+ let C = getInteger(b, (toString(z) + o))
59+ let D = {
60+ let E = C
61+ if ($isInstanceOf(E, "Int"))
6062 then {
61- let B = D
62- B
63+ let C = E
64+ C
6365 }
64- else r
66+ else s
6567 }
66- $Tuple2(C, A)
68+ $Tuple2(D, B)
6769 }
6870
6971
70-func E (F) = {
71- let r = q()
72- let G = z(F, r)
73- let B = G._1
74- let H = G._2
75- let I = fraction(H, (r - B), p)
76- let J = r
77- $Tuple2(J, I)
72+func F (G) = {
73+ let s = r()
74+ let H = A(G, s)
75+ let C = H._1
76+ let I = H._2
77+ let J = fraction(I, (s - C), q)
78+ let K = s
79+ $Tuple2(K, J)
7880 }
7981
8082
81-let K = s()
83+let L = t()
8284
83-@Callable(L)
85+@Callable(M)
8486 func init () = if (isDefined(getString(this, h)))
8587 then throw("Contract already initialized")
86- else if ((size(L.payments) == 0))
87- then [StringEntry(h, toString(L.caller))]
88- else if ((size(L.payments) == 1))
88+ else if ((size(M.payments) == 0))
89+ then [StringEntry(h, toString(M.caller))]
90+ else if ((size(M.payments) == 1))
8991 then {
90- let M = $Tuple2(L.payments[0].amount, L.payments[0].assetId)
91- let N = M._1
92- let O = M._2
93- if ((O != o))
92+ let N = $Tuple2(M.payments[0].amount, M.payments[0].assetId)
93+ let O = N._1
94+ let P = N._2
95+ if ((P != p))
9496 then throw("Only SWOP payment available in init()")
9597 else {
96- let P = invoke(b, "lockSWOP", nil, [AttachedPayment(o, N)])
97- if ((P == P))
98- then [StringEntry(h, toString(L.caller))]
98+ let Q = invoke(b, "lockSWOP", nil, [AttachedPayment(p, O)])
99+ if ((Q == Q))
100+ then [StringEntry(h, toString(M.caller))]
99101 else throw("Strict value is not equal to itself.")
100102 }
101103 }
102104 else throw("Incorrect paynemt. You should attach SWOP or empty payment")
103105
104106
105107
106-@Callable(L)
108+@Callable(M)
107109 func governanceLockSWOP () = {
108- let Q = $Tuple2(L.payments[0].amount, L.payments[0].assetId)
109- let N = Q._1
110- let O = Q._2
111- if ((O != o))
110+ let R = $Tuple2(M.payments[0].amount, M.payments[0].assetId)
111+ let O = R._1
112+ let P = R._2
113+ if ((P != p))
112114 then throw("Only SWOP payment available in governanceLockSWOP()")
113115 else {
114- let P = invoke(b, "lockSWOP", nil, [AttachedPayment(o, N)])
115- if ((P == P))
116+ let Q = invoke(b, "lockSWOP", nil, [AttachedPayment(p, O)])
117+ if ((Q == Q))
116118 then nil
117119 else throw("Strict value is not equal to itself.")
118120 }
119121 }
120122
121123
122124
123-@Callable(L)
124-func governanceClaimAndStake (R) = if (if ((L.caller != j))
125- then (L.callerPublicKey != d)
125+@Callable(M)
126+func governanceClaimAndStake (S) = if (if ((M.caller != j))
127+ then (M.callerPublicKey != d)
126128 else false)
127129 then throw("Only owner or admin can call this function")
128130 else {
129- let I = E(this)._2
130- if ((R > I))
131+ let J = F(this)._2
132+ if ((S > J))
131133 then throw("Amount to claim is less than minSWOPreward")
132134 else {
133- let P = invoke(b, "claimAndStakeSWOP", nil, nil)
134- if ((P == P))
135+ let Q = invoke(b, "claimAndStakeSWOP", nil, nil)
136+ if ((Q == Q))
135137 then {
136- let S = invoke(a, "extractFee", [K, j], nil)
137- if ((S == S))
138+ let T = invoke(a, "extractFee", [L, k], nil)
139+ if ((T == T))
138140 then nil
139141 else throw("Strict value is not equal to itself.")
140142 }
141143 else throw("Strict value is not equal to itself.")
142144 }
143145 }
144146
145147
146148
147-@Callable(L)
148-func governanceWithdraw (T) = if ((L.caller != j))
149+@Callable(M)
150+func governanceWithdraw (U) = if ((M.caller != j))
149151 then throw("Only owner can call this function")
150152 else {
151- let P = invoke(b, "withdrawSWOP", [T], nil)
152- if ((P == P))
153- then [ScriptTransfer(L.caller, T, o)]
153+ let Q = invoke(b, "withdrawSWOP", [U], nil)
154+ if ((Q == Q))
155+ then [ScriptTransfer(M.caller, U, p)]
154156 else throw("Strict value is not equal to itself.")
155157 }
156158
157159

github/deemru/w8io/169f3d6 
51.71 ms