tx · 8w2dYL4G25Yq1hgK5CHrqUdiiYCVraaQuHu9Gsk8K9QM

3N4ngEpA29qJdUKnRto5zUzXvJJLwUuNs5J:  -0.01400000 Waves

2021.10.24 23:10 [1760862] smart account 3N4ngEpA29qJdUKnRto5zUzXvJJLwUuNs5J > SELF 0.00000000 Waves

{ "type": 13, "id": "8w2dYL4G25Yq1hgK5CHrqUdiiYCVraaQuHu9Gsk8K9QM", "fee": 1400000, "feeAssetId": null, "timestamp": 1635106266958, "version": 1, "sender": "3N4ngEpA29qJdUKnRto5zUzXvJJLwUuNs5J", "senderPublicKey": "B7ayemTreAJnAMuzH9P3MnVXhpL6PTtRBrV29h7EUS1H", "proofs": [ "5jtoXctpjp3Zf29iG4Wm55WuSvT6TCc7mRefC4bLCHXo2c9UqJRFZmXTtDcZwNknq8GMUFinapA9i94prdBze3Cb" ], "script": "base64:AAIFAAAAAAAAACAIAhIFCgMIBAESBAoCCAQSAwoBARIDCgEBEgMKAQgSAAAAAAkAAAAADlNXT1Bnb3Zlcm5hbmNlCQAEJgAAAAEJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwIAAAAPU1dPUF9nb3Zlcm5hbmNlAgAAACFFbXB0eSBrZXkgU1dPUF9nb3Zlcm5hbmNlX2FkZHJlc3MAAAAADVdhdmVzVXNkblBvb2wJAAQmAAAAAQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAAA9XQVZFU19VU0ROX1Bvb2wCAAAAIUVtcHR5IGtleSBTV09QX2dvdmVybmFuY2VfYWRkcmVzcwAAAAAXZGVmaWhlbHBlck1hbmFnZXJQdWJLZXkJAAJZAAAAAQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAABlkZWZpaGVscGVyX21hbmFnZXJfUHViS2V5AgAAACNFbXB0eSBrZXkgZGVmaWhlbHBlcl9tYW5hZ2VyX1B1YktleQAAAAAMYW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b24JAARMAAAAAgkBAAAADEJvb2xlYW5FbnRyeQAAAAICAAAAEGlzUHJvdG9jb2xBY3RpdmUHBQAAAANuaWwAAAAAN4a6EQ==", "chainId": 84, "height": 1760862, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GC6fw3HRAbKm39bhi727Kq9f2xWzAgYF2JTSm6zkarDz Next: FbxSSCJJ9pmqn3eEJuyCGiLQQJzcFGnBAqxLbUh1HTAz Diff:
OldNewDifferences
1515
1616 let g = "_balance"
1717
18-let h = valueOrErrorMessage(getBoolean(this, "isProtocolActive"), "Empty key isProtocolActive")
18+let h = "fee_in_usdn"
1919
20-@Callable(i)
21-func init (c,b,j) = if ((scriptHash(this) != unit))
20+let i = valueOrErrorMessage(getBoolean(this, "isProtocolActive"), "Empty key isProtocolActive")
21+
22+@Callable(j)
23+func init (c,b,k) = if (if (isDefined(getString(this, "WAVES_USDN_Pool")))
24+ then true
25+ else isDefined(getString(this, "defihelper_manager_PubKey")))
2226 then throw("Already initialized")
23- else [StringEntry("defihelper_manager_PubKey", c), BooleanEntry("WAVES_USDN_Pool", b), IntegerEntry("defihelper_manager_PubKey", j), BooleanEntry("isProtocolActive", false)]
27+ else [StringEntry("defihelper_manager_PubKey", c), BooleanEntry("WAVES_USDN_Pool", b), IntegerEntry("fee_in_usdn", k), BooleanEntry("isProtocolActive", true)]
2428
2529
2630
27-@Callable(i)
28-func updateAutomateStatus (k,l) = if (!(h))
31+@Callable(j)
32+func updateAutomateStatus (l,m) = if (!(i))
2933 then throw("Protol stopped by admin")
30- else if (!(containsElement([c], i.callerPublicKey)))
34+ else if (!(containsElement([c], j.callerPublicKey)))
3135 then throw("Only admin can call this function")
32- else [BooleanEntry(k, l)]
36+ else [BooleanEntry(l, m)]
3337
3438
3539
36-@Callable(i)
37-func updateProtocolFee (j) = if (!(h))
40+@Callable(j)
41+func updateProtocolFee (k) = if (!(i))
3842 then throw("Protol stopped by admin")
39- else if (!(containsElement([c], i.callerPublicKey)))
43+ else if (!(containsElement([c], j.callerPublicKey)))
4044 then throw("Only admin can call this function")
41- else [IntegerEntry("protocol_fee_in_usdn", j)]
45+ else [IntegerEntry("protocol_fee_in_usdn", k)]
4246
4347
4448
45-@Callable(i)
46-func updateBalance (m) = if (!(h))
49+@Callable(j)
50+func updateBalance (n) = if (!(i))
4751 then throw("Protol stopped by admin")
4852 else {
49- let n = toString(i.caller)
50- let o = valueOrErrorMessage(getBoolean(this, n), ("Empty key newUser: " + n))
51- if (!(o))
53+ let o = toString(j.caller)
54+ let p = valueOrErrorMessage(getBoolean(this, o), ("Empty key newUser: " + o))
55+ if (!(p))
5256 then throw("This automate is inactive")
5357 else {
54- let p = valueOrErrorMessage(getInteger(this, (n + g)), (("Empty key automateAddrStr + keyBalance: " + n) + g))
55-[IntegerEntry(n, (p - m))]
58+ let q = valueOrErrorMessage(getInteger(this, (o + g)), (("Empty key automateAddrStr + keyBalance: " + o) + g))
59+[IntegerEntry(o, (q - n))]
5660 }
5761 }
5862
5963
6064
61-@Callable(i)
62-func replanishBalance (n) = if (!(h))
65+@Callable(j)
66+func replanishBalance (o) = if (!(i))
6367 then throw("Protol stopped by admin")
6468 else {
65- let q = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
66- let r = q._1
67- let s = q._2
68- if ((s != unit))
69+ let r = $Tuple2(j.payments[0].amount, j.payments[0].assetId)
70+ let s = r._1
71+ let t = r._2
72+ if ((t != unit))
6973 then throw("Only WAVES available for replanishment")
7074 else {
71- let p = valueOrErrorMessage(getInteger(this, (n + g)), (("Empty key automateAddrStr + keyBalance: " + n) + g))
72-[IntegerEntry(n, (p + r))]
75+ let q = valueOrErrorMessage(getInteger(this, (o + g)), (("Empty key automateAddrStr + keyBalance: " + o) + g))
76+[IntegerEntry(o, (q + s))]
7377 }
7478 }
7579
7680
7781
78-@Callable(i)
79-func shutdown () = if (!(h))
82+@Callable(j)
83+func shutdown () = if (!(i))
8084 then throw("Protol stopped by admin")
81- else if (!(containsElement([d, e, f, c], i.callerPublicKey)))
85+ else if (!(containsElement([d, e, f, c], j.callerPublicKey)))
8286 then throw("Only admin can call this function")
8387 else [BooleanEntry("isProtocolActive", false)]
8488
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = addressFromString(valueOrElse(getString(this, "SWOP_governance"), "Empty key SWOP_governance_address"))
55
66 let b = addressFromString(valueOrElse(getString(this, "WAVES_USDN_Pool"), "Empty key SWOP_governance_address"))
77
88 let c = fromBase58String(valueOrElse(getString(this, "defihelper_manager_PubKey"), "Empty key defihelper_manager_PubKey"))
99
1010 let d = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv'
1111
1212 let e = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv'
1313
1414 let f = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv'
1515
1616 let g = "_balance"
1717
18-let h = valueOrErrorMessage(getBoolean(this, "isProtocolActive"), "Empty key isProtocolActive")
18+let h = "fee_in_usdn"
1919
20-@Callable(i)
21-func init (c,b,j) = if ((scriptHash(this) != unit))
20+let i = valueOrErrorMessage(getBoolean(this, "isProtocolActive"), "Empty key isProtocolActive")
21+
22+@Callable(j)
23+func init (c,b,k) = if (if (isDefined(getString(this, "WAVES_USDN_Pool")))
24+ then true
25+ else isDefined(getString(this, "defihelper_manager_PubKey")))
2226 then throw("Already initialized")
23- else [StringEntry("defihelper_manager_PubKey", c), BooleanEntry("WAVES_USDN_Pool", b), IntegerEntry("defihelper_manager_PubKey", j), BooleanEntry("isProtocolActive", false)]
27+ else [StringEntry("defihelper_manager_PubKey", c), BooleanEntry("WAVES_USDN_Pool", b), IntegerEntry("fee_in_usdn", k), BooleanEntry("isProtocolActive", true)]
2428
2529
2630
27-@Callable(i)
28-func updateAutomateStatus (k,l) = if (!(h))
31+@Callable(j)
32+func updateAutomateStatus (l,m) = if (!(i))
2933 then throw("Protol stopped by admin")
30- else if (!(containsElement([c], i.callerPublicKey)))
34+ else if (!(containsElement([c], j.callerPublicKey)))
3135 then throw("Only admin can call this function")
32- else [BooleanEntry(k, l)]
36+ else [BooleanEntry(l, m)]
3337
3438
3539
36-@Callable(i)
37-func updateProtocolFee (j) = if (!(h))
40+@Callable(j)
41+func updateProtocolFee (k) = if (!(i))
3842 then throw("Protol stopped by admin")
39- else if (!(containsElement([c], i.callerPublicKey)))
43+ else if (!(containsElement([c], j.callerPublicKey)))
4044 then throw("Only admin can call this function")
41- else [IntegerEntry("protocol_fee_in_usdn", j)]
45+ else [IntegerEntry("protocol_fee_in_usdn", k)]
4246
4347
4448
45-@Callable(i)
46-func updateBalance (m) = if (!(h))
49+@Callable(j)
50+func updateBalance (n) = if (!(i))
4751 then throw("Protol stopped by admin")
4852 else {
49- let n = toString(i.caller)
50- let o = valueOrErrorMessage(getBoolean(this, n), ("Empty key newUser: " + n))
51- if (!(o))
53+ let o = toString(j.caller)
54+ let p = valueOrErrorMessage(getBoolean(this, o), ("Empty key newUser: " + o))
55+ if (!(p))
5256 then throw("This automate is inactive")
5357 else {
54- let p = valueOrErrorMessage(getInteger(this, (n + g)), (("Empty key automateAddrStr + keyBalance: " + n) + g))
55-[IntegerEntry(n, (p - m))]
58+ let q = valueOrErrorMessage(getInteger(this, (o + g)), (("Empty key automateAddrStr + keyBalance: " + o) + g))
59+[IntegerEntry(o, (q - n))]
5660 }
5761 }
5862
5963
6064
61-@Callable(i)
62-func replanishBalance (n) = if (!(h))
65+@Callable(j)
66+func replanishBalance (o) = if (!(i))
6367 then throw("Protol stopped by admin")
6468 else {
65- let q = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
66- let r = q._1
67- let s = q._2
68- if ((s != unit))
69+ let r = $Tuple2(j.payments[0].amount, j.payments[0].assetId)
70+ let s = r._1
71+ let t = r._2
72+ if ((t != unit))
6973 then throw("Only WAVES available for replanishment")
7074 else {
71- let p = valueOrErrorMessage(getInteger(this, (n + g)), (("Empty key automateAddrStr + keyBalance: " + n) + g))
72-[IntegerEntry(n, (p + r))]
75+ let q = valueOrErrorMessage(getInteger(this, (o + g)), (("Empty key automateAddrStr + keyBalance: " + o) + g))
76+[IntegerEntry(o, (q + s))]
7377 }
7478 }
7579
7680
7781
78-@Callable(i)
79-func shutdown () = if (!(h))
82+@Callable(j)
83+func shutdown () = if (!(i))
8084 then throw("Protol stopped by admin")
81- else if (!(containsElement([d, e, f, c], i.callerPublicKey)))
85+ else if (!(containsElement([d, e, f, c], j.callerPublicKey)))
8286 then throw("Only admin can call this function")
8387 else [BooleanEntry("isProtocolActive", false)]
8488
8589

github/deemru/w8io/169f3d6 
31.96 ms