tx · 8jJdMvS4DLPqPZvRu3rXHLoKuhxfazKXqBKR4bnEg2oN

3NBwFnJJuWKWv8V8iHZaHpFxaKufnJaMTz2:  -0.00900000 Waves

2022.06.15 11:43 [2097267] smart account 3NBwFnJJuWKWv8V8iHZaHpFxaKufnJaMTz2 > SELF 0.00000000 Waves

{ "type": 13, "id": "8jJdMvS4DLPqPZvRu3rXHLoKuhxfazKXqBKR4bnEg2oN", "fee": 900000, "feeAssetId": null, "timestamp": 1655282702170, "version": 2, "chainId": 84, "sender": "3NBwFnJJuWKWv8V8iHZaHpFxaKufnJaMTz2", "senderPublicKey": "44YC8eMKCBUTPoFyGtugn4GcfPKnhsB2a4f2bWfuY38u", "proofs": [ "qFqrbV962bKNJ6qBCASQ2YB2XeH2bLksLDiGEBNHj9zFmXuaV4vcV1ga2hCPWNgerMvRVQpy19FXFjnqacBKvPD" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAABQAAAAALb3duZXJXYWxsZXQCAAAAIzNONnZUYnRzU05qRHNNcEJGdXVERWprWHlRNnF4Tm9ySFB6AAAAAA5wcm90b2NvbFdhbGxldAIAAAAjM044VHFmOW9MTU12NjJGM1VMNHNhRzRyR3hmZVpHM25FczQAAAAACW93bmVyUGVyYwAAAAAAAAMNQAAAAAAMcHJvdG9jb2xQZXJjAAAAAAAADDUAAAAAAAVNVUxUNgAAAAAAAA9CQAAAAAEAAAABaQEAAAARZGlzdHJpYnV0ZVByb2ZpdHMAAAAABAAAAAdiYWxhbmNlCQAD7wAAAAEFAAAABHRoaXMDCQAAZgAAAAIAAAAAAAAAAAAIBQAAAAdiYWxhbmNlAAAACWF2YWlsYWJsZQkAAAIAAAABAgAAABdObyBwcm9maXQgdG8gZGlzdHJpYnV0ZQQAAAALb3duZXJBbW91bnQJAABrAAAAAwgFAAAAB2JhbGFuY2UAAAAJYXZhaWxhYmxlBQAAAAlvd25lclBlcmMFAAAABU1VTFQ2BAAAAA5wcm90b2NvbEFtb3VudAkAAGUAAAACCAUAAAAHYmFsYW5jZQAAAAlhdmFpbGFibGUFAAAAC293bmVyQW1vdW50CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAEFAAAAC293bmVyV2FsbGV0BQAAAAtvd25lckFtb3VudAUAAAAEdW5pdAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAA5wcm90b2NvbFdhbGxldAUAAAAOcHJvdG9jb2xBbW91bnQFAAAABHVuaXQFAAAAA25pbAAAAABUy5ht", "height": 2097267, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: hXD688ye7eBFXV7vrdmTKyQzoCVcgVZTMSbJYdQRVPP Next: BLyvWCdHVf5nAG9ipopwwwN2LiqznXGkWrSNGstHp927 Diff:
OldNewDifferences
1414 @Callable(i)
1515 func distributeProfits () = {
1616 let balance = wavesBalance(this)
17- let ownerAmount = fraction(balance.available, ownerPerc, MULT6)
18- let protocolAmount = (balance.available - ownerAmount)
17+ if ((0 > balance.available))
18+ then throw("No profit to distribute")
19+ else {
20+ let ownerAmount = fraction(balance.available, ownerPerc, MULT6)
21+ let protocolAmount = (balance.available - ownerAmount)
1922 [ScriptTransfer(addressFromStringValue(ownerWallet), ownerAmount, unit), ScriptTransfer(addressFromStringValue(protocolWallet), protocolAmount, unit)]
23+ }
2024 }
2125
2226
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let ownerWallet = "3N6vTbtsSNjDsMpBFuuDEjkXyQ6qxNorHPz"
55
66 let protocolWallet = "3N8Tqf9oLMMv62F3UL4saG4rGxfeZG3nEs4"
77
88 let ownerPerc = 200000
99
1010 let protocolPerc = 800000
1111
1212 let MULT6 = 1000000
1313
1414 @Callable(i)
1515 func distributeProfits () = {
1616 let balance = wavesBalance(this)
17- let ownerAmount = fraction(balance.available, ownerPerc, MULT6)
18- let protocolAmount = (balance.available - ownerAmount)
17+ if ((0 > balance.available))
18+ then throw("No profit to distribute")
19+ else {
20+ let ownerAmount = fraction(balance.available, ownerPerc, MULT6)
21+ let protocolAmount = (balance.available - ownerAmount)
1922 [ScriptTransfer(addressFromStringValue(ownerWallet), ownerAmount, unit), ScriptTransfer(addressFromStringValue(protocolWallet), protocolAmount, unit)]
23+ }
2024 }
2125
2226

github/deemru/w8io/026f985 
21.63 ms