tx · BvUGq2nyZAKdLi7ZYpZCpvvvuWaEhYjLQQjGymRyo2QA 3NCmxWYFZubbGN5XE2mAEdmBZTGJB8CyjUT: -0.01400000 Waves 2021.10.26 22:28 [1763679] smart account 3NCmxWYFZubbGN5XE2mAEdmBZTGJB8CyjUT > SELF 0.00000000 Waves
{ "type": 13, "id": "BvUGq2nyZAKdLi7ZYpZCpvvvuWaEhYjLQQjGymRyo2QA", "fee": 1400000, "feeAssetId": null, "timestamp": 1635276529534, "version": 1, "sender": "3NCmxWYFZubbGN5XE2mAEdmBZTGJB8CyjUT", "senderPublicKey": "BokN66T6bpA4HtsD7qU1ai4cZXgmaBT4ncjSaCCmKdww", "proofs": [ "2MXE7gyJQwwFZA4vzUA4wGbiQn9BdHddAENBTDCkodLgxrdSKC11NDGYQNHDZT7XnMB1iY1FDshSuorDHseN2QMg" ], "script": "base64:AAIFAAAAAAAAABAIAhIAEgASAwoBARIDCgEBAAAAFAAAAAAHYmFsYW5jZQkBAAAAB0FkZHJlc3MAAAABAQAAABoBVKMjU/C0oWt5judpFHXM19dztnXKmPy+aQAAAAARU1dPUGdvdmVybmFuY2VBZHIJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAAB2JhbGFuY2UCAAAAD1NXT1BfZ292ZXJuYW5jZQIAAAAVRW1wdHkgU1dPUF9nb3Zlcm5hbmNlAAAAABdkZWZpaGVscGVyTWFuYWdlclB1YktleQkAAlkAAAABCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAAB2JhbGFuY2UCAAAAGWRlZmloZWxwZXJfbWFuYWdlcl9QdWJLZXkCAAAAI0VtcHR5IGtleSBkZWZpaGVscGVyX21hbmFnZXJfUHViS2V5AAAAAAxhZG1pblB1YktleTEBAAAAIJI0rvSL2N+4Jd3ss8OgEArwbahdnCXQKg1y+jLzTuJDAAAAAAxhZG1pblB1YktleTIBAAAAI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AAAAQFAAAAEVNXT1Bnb3Zlcm5hbmNlQWRyAgAAAAx3aXRoZHJhd1NXT1AJAARMAAAAAgUAAAANYW10VG9XaXRoZHJhdwUAAAADbmlsBQAAAANuaWwDCQAAAAAAAAIFAAAAAXoFAAAAAXoJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAA1hbXRUb1dpdGhkcmF3BQAAAARTV09QBQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAOhvuBY=", "chainId": 84, "height": 1763679, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = Address(base58'3N4ngEpA29qJdUKnRto5zUzXvJJLwUuNs5J') | |
5 | + | ||
6 | + | let b = value(addressFromString(valueOrErrorMessage(getString(a, "SWOP_governance"), "Empty SWOP_governance"))) | |
7 | + | ||
8 | + | let c = fromBase58String(valueOrElse(getString(a, "defihelper_manager_PubKey"), "Empty key defihelper_manager_PubKey")) | |
9 | + | ||
10 | + | let d = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv' | |
11 | + | ||
12 | + | let e = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv' | |
13 | + | ||
14 | + | let f = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv' | |
15 | + | ||
16 | + | let g = "owner" | |
17 | + | ||
18 | + | let h = "isProtocolActive" | |
19 | + | ||
20 | + | let i = addressFromString(valueOrErrorMessage(getString(this, g), "Empty keyOwner")) | |
21 | + | ||
22 | + | let j = valueOrErrorMessage(getString(this, g), "Empty keyOwner") | |
23 | + | ||
24 | + | let k = valueOrErrorMessage(getBoolean(a, h), "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'Ccgesc9iWMSg1f8CqFP5nZwgF6xsGirReDhpvNp1JAWW' | |
33 | + | ||
34 | + | let p = 100000000 | |
35 | + | ||
36 | + | func q () = { | |
37 | + | let r = valueOrElse(getInteger(b, l), 0) | |
38 | + | r | |
39 | + | } | |
40 | + | ||
41 | + | ||
42 | + | func s (t) = valueOrElse(getInteger(b, (toString(t) + m)), 0) | |
43 | + | ||
44 | + | ||
45 | + | func u (t,r) = { | |
46 | + | let v = s(t) | |
47 | + | let w = getInteger(b, (toString(t) + n)) | |
48 | + | let x = { | |
49 | + | let y = w | |
50 | + | if ($isInstanceOf(y, "Int")) | |
51 | + | then { | |
52 | + | let w = y | |
53 | + | w | |
54 | + | } | |
55 | + | else r | |
56 | + | } | |
57 | + | $Tuple2(x, v) | |
58 | + | } | |
59 | + | ||
60 | + | ||
61 | + | func z (A) = { | |
62 | + | let r = q() | |
63 | + | let B = u(A, r) | |
64 | + | let w = B._1 | |
65 | + | let C = B._2 | |
66 | + | let D = fraction(C, (r - w), p) | |
67 | + | let E = r | |
68 | + | $Tuple2(E, D) | |
69 | + | } | |
70 | + | ||
71 | + | ||
72 | + | @Callable(F) | |
73 | + | func init () = if (isDefined(getString(this, g))) | |
74 | + | then throw("Contract already initialized") | |
75 | + | else if ((size(F.payments) == 0)) | |
76 | + | then [StringEntry(g, toString(F.caller))] | |
77 | + | else if ((size(F.payments) == 1)) | |
78 | + | then { | |
79 | + | let G = $Tuple2(F.payments[0].amount, F.payments[0].assetId) | |
80 | + | let H = G._1 | |
81 | + | let I = G._2 | |
82 | + | if ((I != o)) | |
83 | + | then throw("Only SWOP payment available in init()") | |
84 | + | else { | |
85 | + | let J = invoke(b, "lockSWOP", nil, [AttachedPayment(o, H)]) | |
86 | + | if ((J == J)) | |
87 | + | then [StringEntry(g, toString(F.caller))] | |
88 | + | else throw("Strict value is not equal to itself.") | |
89 | + | } | |
90 | + | } | |
91 | + | else throw("Incorrect paynemt. You should attach SWOP or empty payment") | |
92 | + | ||
93 | + | ||
94 | + | ||
95 | + | @Callable(F) | |
96 | + | func governanceLockSWOP () = { | |
97 | + | let K = $Tuple2(F.payments[0].amount, F.payments[0].assetId) | |
98 | + | let H = K._1 | |
99 | + | let I = K._2 | |
100 | + | if ((I != o)) | |
101 | + | then throw("Only SWOP payment available in governanceLockSWOP()") | |
102 | + | else { | |
103 | + | let J = invoke(b, "lockSWOP", nil, [AttachedPayment(o, H)]) | |
104 | + | if ((J == J)) | |
105 | + | then nil | |
106 | + | else throw("Strict value is not equal to itself.") | |
107 | + | } | |
108 | + | } | |
109 | + | ||
110 | + | ||
111 | + | ||
112 | + | @Callable(F) | |
113 | + | func governanceClaimAndStake (L) = if (if ((F.caller != i)) | |
114 | + | then (F.callerPublicKey != c) | |
115 | + | else false) | |
116 | + | then throw("Only owner or admin can call this function") | |
117 | + | else { | |
118 | + | let D = z(this)._2 | |
119 | + | if ((L > D)) | |
120 | + | then throw("Amount to claim is less than minSWOPreward") | |
121 | + | else { | |
122 | + | let M = if ((F.caller == i)) | |
123 | + | then false | |
124 | + | else true | |
125 | + | let J = invoke(b, "claimAndStakeSWOP", nil, nil) | |
126 | + | if ((J == J)) | |
127 | + | then { | |
128 | + | let N = invoke(a, "extractFee", [j, M], nil) | |
129 | + | if ((N == N)) | |
130 | + | then nil | |
131 | + | else throw("Strict value is not equal to itself.") | |
132 | + | } | |
133 | + | else throw("Strict value is not equal to itself.") | |
134 | + | } | |
135 | + | } | |
136 | + | ||
137 | + | ||
138 | + | ||
139 | + | @Callable(F) | |
140 | + | func governanceWithdraw (O) = if ((F.caller != i)) | |
141 | + | then throw("Only owner can call this function") | |
142 | + | else { | |
143 | + | let J = invoke(b, "withdrawSWOP", [O], nil) | |
144 | + | if ((J == J)) | |
145 | + | then [ScriptTransfer(F.caller, O, o)] | |
146 | + | else throw("Strict value is not equal to itself.") | |
147 | + | } | |
148 | + | ||
149 | + |
github/deemru/w8io/169f3d6 17.41 ms ◑