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:AAIFAAAAAAAAACAIAhIFCgMIBAESBAoCCAQSAwoBARIDCgEBEgMKAQgSAAAAAAkAAAAADlNXT1Bnb3Zlcm5hbmNlCQAEJgAAAAEJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwIAAAAPU1dPUF9nb3Zlcm5hbmNlAgAAACFFbXB0eSBrZXkgU1dPUF9nb3Zlcm5hbmNlX2FkZHJlc3MAAAAADVdhdmVzVXNkblBvb2wJAAQmAAAAAQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAAA9XQVZFU19VU0ROX1Bvb2wCAAAAIUVtcHR5IGtleSBTV09QX2dvdmVybmFuY2VfYWRkcmVzcwAAAAAXZGVmaWhlbHBlck1hbmFnZXJQdWJLZXkJAAJZAAAAAQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAABlkZWZpaGVscGVyX21hbmFnZXJfUHViS2V5AgAAACNFbXB0eSBrZXkgZGVmaWhlbHBlcl9tYW5hZ2VyX1B1YktleQ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nVuY3Rpb24JAARMAAAAAgkBAAAADEJvb2xlYW5FbnRyeQAAAAICAAAAEGlzUHJvdG9jb2xBY3RpdmUHBQAAAANuaWwAAAAAN4a6EQ==",
"chainId": 84,
"height": 1760862,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: GC6fw3HRAbKm39bhi727Kq9f2xWzAgYF2JTSm6zkarDz
Next: FbxSSCJJ9pmqn3eEJuyCGiLQQJzcFGnBAqxLbUh1HTAz
Diff:
Old | New | | Differences |
---|
15 | 15 | | |
---|
16 | 16 | | let g = "_balance" |
---|
17 | 17 | | |
---|
18 | | - | let h = valueOrErrorMessage(getBoolean(this, "isProtocolActive"), "Empty key isProtocolActive") |
---|
| 18 | + | let h = "fee_in_usdn" |
---|
19 | 19 | | |
---|
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"))) |
---|
22 | 26 | | 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)] |
---|
24 | 28 | | |
---|
25 | 29 | | |
---|
26 | 30 | | |
---|
27 | | - | @Callable(i) |
---|
28 | | - | func updateAutomateStatus (k,l) = if (!(h)) |
---|
| 31 | + | @Callable(j) |
---|
| 32 | + | func updateAutomateStatus (l,m) = if (!(i)) |
---|
29 | 33 | | then throw("Protol stopped by admin") |
---|
30 | | - | else if (!(containsElement([c], i.callerPublicKey))) |
---|
| 34 | + | else if (!(containsElement([c], j.callerPublicKey))) |
---|
31 | 35 | | then throw("Only admin can call this function") |
---|
32 | | - | else [BooleanEntry(k, l)] |
---|
| 36 | + | else [BooleanEntry(l, m)] |
---|
33 | 37 | | |
---|
34 | 38 | | |
---|
35 | 39 | | |
---|
36 | | - | @Callable(i) |
---|
37 | | - | func updateProtocolFee (j) = if (!(h)) |
---|
| 40 | + | @Callable(j) |
---|
| 41 | + | func updateProtocolFee (k) = if (!(i)) |
---|
38 | 42 | | then throw("Protol stopped by admin") |
---|
39 | | - | else if (!(containsElement([c], i.callerPublicKey))) |
---|
| 43 | + | else if (!(containsElement([c], j.callerPublicKey))) |
---|
40 | 44 | | then throw("Only admin can call this function") |
---|
41 | | - | else [IntegerEntry("protocol_fee_in_usdn", j)] |
---|
| 45 | + | else [IntegerEntry("protocol_fee_in_usdn", k)] |
---|
42 | 46 | | |
---|
43 | 47 | | |
---|
44 | 48 | | |
---|
45 | | - | @Callable(i) |
---|
46 | | - | func updateBalance (m) = if (!(h)) |
---|
| 49 | + | @Callable(j) |
---|
| 50 | + | func updateBalance (n) = if (!(i)) |
---|
47 | 51 | | then throw("Protol stopped by admin") |
---|
48 | 52 | | 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)) |
---|
52 | 56 | | then throw("This automate is inactive") |
---|
53 | 57 | | 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))] |
---|
56 | 60 | | } |
---|
57 | 61 | | } |
---|
58 | 62 | | |
---|
59 | 63 | | |
---|
60 | 64 | | |
---|
61 | | - | @Callable(i) |
---|
62 | | - | func replanishBalance (n) = if (!(h)) |
---|
| 65 | + | @Callable(j) |
---|
| 66 | + | func replanishBalance (o) = if (!(i)) |
---|
63 | 67 | | then throw("Protol stopped by admin") |
---|
64 | 68 | | 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)) |
---|
69 | 73 | | then throw("Only WAVES available for replanishment") |
---|
70 | 74 | | 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))] |
---|
73 | 77 | | } |
---|
74 | 78 | | } |
---|
75 | 79 | | |
---|
76 | 80 | | |
---|
77 | 81 | | |
---|
78 | | - | @Callable(i) |
---|
79 | | - | func shutdown () = if (!(h)) |
---|
| 82 | + | @Callable(j) |
---|
| 83 | + | func shutdown () = if (!(i)) |
---|
80 | 84 | | 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))) |
---|
82 | 86 | | then throw("Only admin can call this function") |
---|
83 | 87 | | else [BooleanEntry("isProtocolActive", false)] |
---|
84 | 88 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = addressFromString(valueOrElse(getString(this, "SWOP_governance"), "Empty key SWOP_governance_address")) |
---|
5 | 5 | | |
---|
6 | 6 | | let b = addressFromString(valueOrElse(getString(this, "WAVES_USDN_Pool"), "Empty key SWOP_governance_address")) |
---|
7 | 7 | | |
---|
8 | 8 | | let c = fromBase58String(valueOrElse(getString(this, "defihelper_manager_PubKey"), "Empty key defihelper_manager_PubKey")) |
---|
9 | 9 | | |
---|
10 | 10 | | let d = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv' |
---|
11 | 11 | | |
---|
12 | 12 | | let e = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv' |
---|
13 | 13 | | |
---|
14 | 14 | | let f = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv' |
---|
15 | 15 | | |
---|
16 | 16 | | let g = "_balance" |
---|
17 | 17 | | |
---|
18 | | - | let h = valueOrErrorMessage(getBoolean(this, "isProtocolActive"), "Empty key isProtocolActive") |
---|
| 18 | + | let h = "fee_in_usdn" |
---|
19 | 19 | | |
---|
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"))) |
---|
22 | 26 | | 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)] |
---|
24 | 28 | | |
---|
25 | 29 | | |
---|
26 | 30 | | |
---|
27 | | - | @Callable(i) |
---|
28 | | - | func updateAutomateStatus (k,l) = if (!(h)) |
---|
| 31 | + | @Callable(j) |
---|
| 32 | + | func updateAutomateStatus (l,m) = if (!(i)) |
---|
29 | 33 | | then throw("Protol stopped by admin") |
---|
30 | | - | else if (!(containsElement([c], i.callerPublicKey))) |
---|
| 34 | + | else if (!(containsElement([c], j.callerPublicKey))) |
---|
31 | 35 | | then throw("Only admin can call this function") |
---|
32 | | - | else [BooleanEntry(k, l)] |
---|
| 36 | + | else [BooleanEntry(l, m)] |
---|
33 | 37 | | |
---|
34 | 38 | | |
---|
35 | 39 | | |
---|
36 | | - | @Callable(i) |
---|
37 | | - | func updateProtocolFee (j) = if (!(h)) |
---|
| 40 | + | @Callable(j) |
---|
| 41 | + | func updateProtocolFee (k) = if (!(i)) |
---|
38 | 42 | | then throw("Protol stopped by admin") |
---|
39 | | - | else if (!(containsElement([c], i.callerPublicKey))) |
---|
| 43 | + | else if (!(containsElement([c], j.callerPublicKey))) |
---|
40 | 44 | | then throw("Only admin can call this function") |
---|
41 | | - | else [IntegerEntry("protocol_fee_in_usdn", j)] |
---|
| 45 | + | else [IntegerEntry("protocol_fee_in_usdn", k)] |
---|
42 | 46 | | |
---|
43 | 47 | | |
---|
44 | 48 | | |
---|
45 | | - | @Callable(i) |
---|
46 | | - | func updateBalance (m) = if (!(h)) |
---|
| 49 | + | @Callable(j) |
---|
| 50 | + | func updateBalance (n) = if (!(i)) |
---|
47 | 51 | | then throw("Protol stopped by admin") |
---|
48 | 52 | | 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)) |
---|
52 | 56 | | then throw("This automate is inactive") |
---|
53 | 57 | | 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))] |
---|
56 | 60 | | } |
---|
57 | 61 | | } |
---|
58 | 62 | | |
---|
59 | 63 | | |
---|
60 | 64 | | |
---|
61 | | - | @Callable(i) |
---|
62 | | - | func replanishBalance (n) = if (!(h)) |
---|
| 65 | + | @Callable(j) |
---|
| 66 | + | func replanishBalance (o) = if (!(i)) |
---|
63 | 67 | | then throw("Protol stopped by admin") |
---|
64 | 68 | | 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)) |
---|
69 | 73 | | then throw("Only WAVES available for replanishment") |
---|
70 | 74 | | 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))] |
---|
73 | 77 | | } |
---|
74 | 78 | | } |
---|
75 | 79 | | |
---|
76 | 80 | | |
---|
77 | 81 | | |
---|
78 | | - | @Callable(i) |
---|
79 | | - | func shutdown () = if (!(h)) |
---|
| 82 | + | @Callable(j) |
---|
| 83 | + | func shutdown () = if (!(i)) |
---|
80 | 84 | | 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))) |
---|
82 | 86 | | then throw("Only admin can call this function") |
---|
83 | 87 | | else [BooleanEntry("isProtocolActive", false)] |
---|
84 | 88 | | |
---|
85 | 89 | | |
---|