tx · 42TUUXdLX7CDFFR5otWW2R69MzMSo7qGxg439VChX8gV

3MxaubN2nHCzE5spNox3ZCbPbDMfczSFrZS:  -0.01400000 Waves

2021.10.25 00:57 [1760969] smart account 3MxaubN2nHCzE5spNox3ZCbPbDMfczSFrZS > SELF 0.00000000 Waves

{ "type": 13, "id": "42TUUXdLX7CDFFR5otWW2R69MzMSo7qGxg439VChX8gV", "fee": 1400000, "feeAssetId": null, "timestamp": 1635112651110, "version": 1, "sender": "3MxaubN2nHCzE5spNox3ZCbPbDMfczSFrZS", "senderPublicKey": "FWDMjbKuHyuUuAo4utnjwDgcbsiysMPDjX835SxvtLHq", "proofs": [ "2G4ax9etgm2Ab6vaRKrBMaaxV4To2CD3Z8vH6QxAThbtzpKt7FqUM3NPpNmK8resphovNVsfF9FrSnMyTZSnCxf5" ], "script": "base64:AAIFAAAAAAAAABAIAhIAEgASAwoBARIDCgEBAAAAFQAAAAAHYmFsYW5jZQkBAAAAB0FkZHJlc3MAAAABAQAAABoBVMiyryG3C7/Yidq0/9LPxzKMhegBrag41AAAAAARU1dPUGdvdmVybmFuY2VBZHIJAAQmAAAAAQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAAB2JhbGFuY2UCAAAAD1NXT1BfZ292ZXJuYW5jZQIAAAAVRW1wdHkgU1dPUF9nb3Zlcm5hbmNlAAAAAA1XYXZlc1VzZG5Qb29sCQEAAAAFdmFsdWUAAAABCQAEJgAAAAEJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAdiYWxhbmNlAgAAAA9XQVZFU19VU0ROX1Bvb2wCAAAAFUVtcHR5IFdBVkVTX1VTRE5fUG9vbAAAAAAXZGVmaWhlbHBlck1hbmFnZXJQdWJLZXkJAAJZAAAAAQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAdiYWxhbmNlAgAAABlkZWZpaGVscGVyX21hbmFnZXJfUHViS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HBlck1hbmFnZXJQdWJLZXkHCQAAAgAAAAECAAAAKk9ubHkgb3duZXIgb3IgYWRtaW4gY2FuIGNhbGwgdGhpcyBmdW5jdGlvbgQAAAALY2xhaW1BbW91bnQICQEAAAAJY2xhaW1DYWxjAAAAAQUAAAAEdGhpcwAAAAJfMgMJAABmAAAAAgUAAAANbWluU1dPUHJld2FyZAUAAAALY2xhaW1BbW91bnQJAAACAAAAAQIAAAAqQW1vdW50IHRvIGNsYWltIGlzIGxlc3MgdGhhbiBtaW5TV09QcmV3YXJkBAAAAAF6CQAD/AAAAAQFAAAADmdvdmVybmFuY2VBZGRyAgAAABFjbGFpbUFuZFN0YWtlU1dPUAUAAAADbmlsBQAAAANuaWwDCQAAAAAAAAIFAAAAAXoFAAAAAXoFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABaQEAAAASZ292ZXJuYW5jZVdpdGhkcmF3AAAAAQAAAA1hbXRUb1dpdGhkcmF3AwkBAAAAAiE9AAAAAggFAAAAAWkAAAAGY2FsbGVyBQAAAAVvd25lcgkAAAIAAAABAgAAACFPbmx5IG93bmVyIGNhbiBjYWxsIHRoaXMgZnVuY3Rpb24EAAAAAXoJAAP8AAAABAUAAAAOZ292ZXJuYW5jZUFkZHICAAAADHdpdGhkcmF3U1dPUAkABEwAAAACBQAAAA1hbXRUb1dpdGhkcmF3BQAAAANuaWwFAAAAA25pbAMJAAAAAAAAAgUAAAABegUAAAABegkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAADWFtdFRvV2l0aGRyYXcFAAAABFNXT1AFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAAAHUH8Gw==", "chainId": 84, "height": 1760969, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: CFZDnpoB7tPFQuLf4DKLeNB5To5hKDfnXFHcBCZ3sxoR Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 5 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let a = Address(base58'3N8DGyUZufuYfENW6HZovoKaTkD3ESpAPj1')
5+
6+let b = addressFromString(valueOrErrorMessage(getString(a, "SWOP_governance"), "Empty SWOP_governance"))
7+
8+let c = value(addressFromString(valueOrErrorMessage(getString(a, "WAVES_USDN_Pool"), "Empty WAVES_USDN_Pool")))
9+
10+let d = fromBase58String(valueOrElse(getString(a, "defihelper_manager_PubKey"), "Empty key defihelper_manager_PubKey"))
11+
12+let e = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv'
13+
14+let f = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv'
15+
16+let g = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv'
17+
18+let h = "owner"
19+
20+let i = Address(base58'3N5W8da2iiijVieA6qLGo7KzCJj8B19smWU')
21+
22+let j = addressFromString(valueOrErrorMessage(getString(this, "keyOwner"), "Empty keyOwner"))
23+
24+let k = valueOrErrorMessage(getBoolean(a, "isProtocolActive"), "Empty key isProtocolActive")
25+
26+let l = "last_interest"
27+
28+let m = "_SWOP_amount"
29+
30+let n = "_last_interest"
31+
32+let o = base58'Ehie5xYpeN8op1Cctc6aGUrqx8jq3jtf1DSjXDbfm7aT'
33+
34+let p = 100000000
35+
36+func q () = {
37+ let r = valueOrElse(getInteger(i, l), 0)
38+ r
39+ }
40+
41+
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
48+ }
49+
50+
51+func x (y) = valueOrElse(getInteger(i, (toString(y) + m)), 0)
52+
53+
54+func z (y,r) = {
55+ let A = x(y)
56+ let B = getInteger(i, (toString(y) + n))
57+ let C = {
58+ let D = B
59+ if ($isInstanceOf(D, "Int"))
60+ then {
61+ let B = D
62+ B
63+ }
64+ else r
65+ }
66+ $Tuple2(C, A)
67+ }
68+
69+
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)
78+ }
79+
80+
81+@Callable(K)
82+func init () = if (isDefined(getString(this, h)))
83+ then throw("Contract already initialized")
84+ else if ((size(K.payments) == 0))
85+ then [StringEntry(h, toString(K.caller))]
86+ else if ((size(K.payments) == 1))
87+ then {
88+ let L = $Tuple2(K.payments[0].amount, K.payments[0].assetId)
89+ let M = L._1
90+ let N = L._2
91+ if ((N != o))
92+ then throw("Only SWOP payment available in init()")
93+ else {
94+ let O = invoke(i, "lockSWOP", nil, [AttachedPayment(o, M)])
95+ if ((O == O))
96+ then {
97+ let P = invoke(a, "updateBalance", [100], nil)
98+ if ((P == P))
99+ then [StringEntry(h, toString(K.caller))]
100+ else throw("Strict value is not equal to itself.")
101+ }
102+ else throw("Strict value is not equal to itself.")
103+ }
104+ }
105+ else throw("Incorrect paynemt. You should attach SWOP or empty payment")
106+
107+
108+
109+@Callable(K)
110+func governanceLockSWOP () = {
111+ let Q = $Tuple2(K.payments[0].amount, K.payments[0].assetId)
112+ let M = Q._1
113+ let N = Q._2
114+ if ((N != o))
115+ then throw("Only SWOP payment available in governanceLockSWOP()")
116+ else {
117+ let O = invoke(i, "lockSWOP", nil, [AttachedPayment(o, M)])
118+ if ((O == O))
119+ then [StringEntry(h, toString(K.caller))]
120+ else throw("Strict value is not equal to itself.")
121+ }
122+ }
123+
124+
125+
126+@Callable(K)
127+func governanceClaimAndStake (R) = if (if ((K.caller != j))
128+ then (K.callerPublicKey != d)
129+ else false)
130+ then throw("Only owner or admin can call this function")
131+ else {
132+ let I = E(this)._2
133+ if ((R > I))
134+ then throw("Amount to claim is less than minSWOPreward")
135+ else {
136+ let O = invoke(i, "claimAndStakeSWOP", nil, nil)
137+ if ((O == O))
138+ then nil
139+ else throw("Strict value is not equal to itself.")
140+ }
141+ }
142+
143+
144+
145+@Callable(K)
146+func governanceWithdraw (S) = if ((K.caller != j))
147+ then throw("Only owner can call this function")
148+ else {
149+ let O = invoke(i, "withdrawSWOP", [S], nil)
150+ if ((O == O))
151+ then [ScriptTransfer(K.caller, S, o)]
152+ else throw("Strict value is not equal to itself.")
153+ }
154+
155+

github/deemru/w8io/169f3d6 
21.23 ms