tx · BVPtun9bc8j2ioFCCUFm3zDwMxvx6v254qF96yLXyZGR

3N4ngEpA29qJdUKnRto5zUzXvJJLwUuNs5J:  -0.01400000 Waves

2021.10.25 17:30 [1761964] smart account 3N4ngEpA29qJdUKnRto5zUzXvJJLwUuNs5J > SELF 0.00000000 Waves

{ "type": 13, "id": "BVPtun9bc8j2ioFCCUFm3zDwMxvx6v254qF96yLXyZGR", "fee": 1400000, "feeAssetId": null, "timestamp": 1635172211049, "version": 1, "sender": "3N4ngEpA29qJdUKnRto5zUzXvJJLwUuNs5J", "senderPublicKey": "B7ayemTreAJnAMuzH9P3MnVXhpL6PTtRBrV29h7EUS1H", "proofs": [ "j998YNdDK4V24GqMSdAUFBnPXRKu6jhD5ASQsyeZaGX72YF1c2aCErzebAV8VLs5hnJGw5PUZampoLAuyPth2fM" ], "script": "base64:AAIFAAAAAAAAACQIAhIGCgQICAgBEgQKAggEEgMKAQESBAoCAQgSABIDCgEBEgAAAAAKAAAAAA5TV09QZ292ZXJuYW5jZQkABCYAAAABCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAABHRoaXMCAAAAD1NXT1BfZ292ZXJuYW5jZQIAAAAhRW1wdHkga2V5IFNXT1BfZ292ZXJuYW5jZV9hZGRyZXNzAAAAAA1XYXZlc1VzZG5Qb29sCQAEJgAAAAEJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwIAAAAPV0FWRVNfVVNETl9Qb29sAgAAACFFbXB0eSBrZXkgU1dPUF9nb3Zlcm5hbmNlX2FkZHJlc3MAAAAAF2RlZmloZWxwZXJNYW5hZ2VyUHViS2V5CQACWQAAAAEJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwIAAAAZZGVmaWhlbHBlcl9tYW5hZ2VyX1B1YktleQIAAAAjRW1wdHkga2V5IGRlZmloZWxwZXJfbWFuYWdlcl9QdWJLZXkAAAAADGFkbWluUHViS2V5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bGxlclN0cgkABCUAAAABCAUAAAABaQAAAAZjYWxsZXIEAAAADWNhbGxlckJhbGFuY2UJAQAAABBnZXRDYWxsZXJCYWxhbmNlAAAAAQUAAAAJY2FsbGVyU3RyAwkAAGYAAAACBQAAAAt3aXRoZHJhd0FtdAUAAAANY2FsbGVyQmFsYW5jZQkAAAIAAAABAgAAABt3aXRoZHJhd0FtdCA+IGNhbGxlckJhbGFuY2UJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgUAAAAJY2FsbGVyU3RyBQAAAAprZXlCYWxhbmNlCQAAZQAAAAIFAAAADWNhbGxlckJhbGFuY2UFAAAAC3dpdGhkcmF3QW10CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAALd2l0aGRyYXdBbXQFAAAABHVuaXQFAAAAA25pbAAAAAFpAQAAAAhzaHV0ZG93bgAAAAADCQEAAAABIQAAAAEFAAAAEGlzUHJvdG9jb2xBY3RpdmUJAAACAAAAAQIAAAAXUHJvdG9sIHN0b3BwZWQgYnkgYWRtaW4DCQEAAAABIQAAAAEJAQAAAA9jb250YWluc0VsZW1lbnQAAAACCQAETAAAAAIFAAAADGFkbWluUHViS2V5MQkABEwAAAACBQAAAAxhZG1pblB1YktleTIJAARMAAAAAgUAAAAMYWRtaW5QdWJLZXkzCQAETAAAAAIFAAAAF2RlZmloZWxwZXJNYW5hZ2VyUHViS2V5BQAAAANuaWwIBQAAAAFpAAAAD2NhbGxlclB1YmxpY0tleQkAAAIAAAABAgAAACFPbmx5IGFkbWluIGNhbiBjYWxsIHRoaXMgZnVuY3Rpb24JAARMAAAAAgkBAAAADEJvb2xlYW5FbnRyeQAAAAICAAAAEGlzUHJvdG9jb2xBY3RpdmUHBQAAAANuaWwAAAAA2lv76g==", "chainId": 84, "height": 1761964, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2ADxAXYA6kfNgyHVtebV4eiLV8fRVQMhPNC9vciJhjwf Next: 3cmV7haLVPsmk9pP2xgxyvC1dsMz4tFkAj6kjmsXa3Du Diff:
OldNewDifferences
6969 func extractFee (u,v) = if (!(i))
7070 then throw("Protol stopped by admin")
7171 else {
72- let w = valueOrErrorMessage(getBoolean(this, v), ("Empty key newUser: " + v))
72+ let w = valueOrErrorMessage(getBoolean(this, toString(p.caller)), ("Empty key i.caller: " + toString(p.caller)))
7373 if (!(w))
7474 then throw("This automate is inactive")
7575 else {
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
1818 let h = "fee_in_usdn"
1919
2020 let i = valueOrErrorMessage(getBoolean(this, "isProtocolActive"), "Empty key isProtocolActive")
2121
2222 func j (k) = {
2323 let l = {
2424 let m = getInteger(this, (k + g))
2525 if ($isInstanceOf(m, "Int"))
2626 then {
2727 let n = m
2828 n
2929 }
3030 else if ($isInstanceOf(m, "Unit"))
3131 then {
3232 let o = m
3333 0
3434 }
3535 else throw("Match error")
3636 }
3737 l
3838 }
3939
4040
4141 @Callable(p)
4242 func init (c,b,q,r) = if (if (isDefined(getString(this, "WAVES_USDN_Pool")))
4343 then true
4444 else isDefined(getString(this, "defihelper_manager_PubKey")))
4545 then throw("Already initialized")
4646 else [StringEntry("defihelper_manager_PubKey", c), StringEntry("WAVES_USDN_Pool", b), StringEntry("SWOP_governance", q), IntegerEntry("protocol_fee_in_usdn", r), BooleanEntry("isProtocolActive", true)]
4747
4848
4949
5050 @Callable(p)
5151 func updateAutomateStatus (s,t) = if (!(i))
5252 then throw("Protol stopped by admin")
5353 else if (!(containsElement([c], p.callerPublicKey)))
5454 then throw("Only admin can call this function")
5555 else [BooleanEntry(s, t)]
5656
5757
5858
5959 @Callable(p)
6060 func updateProtocolFee (r) = if (!(i))
6161 then throw("Protol stopped by admin")
6262 else if (!(containsElement([c], p.callerPublicKey)))
6363 then throw("Only admin can call this function")
6464 else [IntegerEntry("protocol_fee_in_usdn", r)]
6565
6666
6767
6868 @Callable(p)
6969 func extractFee (u,v) = if (!(i))
7070 then throw("Protol stopped by admin")
7171 else {
72- let w = valueOrErrorMessage(getBoolean(this, v), ("Empty key newUser: " + v))
72+ let w = valueOrErrorMessage(getBoolean(this, toString(p.caller)), ("Empty key i.caller: " + toString(p.caller)))
7373 if (!(w))
7474 then throw("This automate is inactive")
7575 else {
7676 let x = valueOrErrorMessage(getInteger(this, (v + g)), (("Empty key user + keyBalance: " + v) + g))
7777 [IntegerEntry((v + g), (x - u))]
7878 }
7979 }
8080
8181
8282
8383 @Callable(p)
8484 func replanishBalance () = if (!(i))
8585 then throw("Protol stopped by admin")
8686 else {
8787 let y = $Tuple2(p.payments[0].amount, p.payments[0].assetId)
8888 let z = y._1
8989 let A = y._2
9090 if ((A != unit))
9191 then throw("Only WAVES available for replanishment")
9292 else {
9393 let k = toString(p.caller)
9494 let l = j(k)
9595 [IntegerEntry((k + g), (l + z))]
9696 }
9797 }
9898
9999
100100
101101 @Callable(p)
102102 func withdraw (B) = if (!(i))
103103 then throw("Protol stopped by admin")
104104 else {
105105 let k = toString(p.caller)
106106 let l = j(k)
107107 if ((B > l))
108108 then throw("withdrawAmt > callerBalance")
109109 else [IntegerEntry((k + g), (l - B)), ScriptTransfer(p.caller, B, unit)]
110110 }
111111
112112
113113
114114 @Callable(p)
115115 func shutdown () = if (!(i))
116116 then throw("Protol stopped by admin")
117117 else if (!(containsElement([d, e, f, c], p.callerPublicKey)))
118118 then throw("Only admin can call this function")
119119 else [BooleanEntry("isProtocolActive", false)]
120120
121121

github/deemru/w8io/169f3d6 
31.23 ms