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:
Old | New | | Differences |
---|
14 | 14 | | @Callable(i) |
---|
15 | 15 | | func distributeProfits () = { |
---|
16 | 16 | | 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) |
---|
19 | 22 | | [ScriptTransfer(addressFromStringValue(ownerWallet), ownerAmount, unit), ScriptTransfer(addressFromStringValue(protocolWallet), protocolAmount, unit)] |
---|
| 23 | + | } |
---|
20 | 24 | | } |
---|
21 | 25 | | |
---|
22 | 26 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let ownerWallet = "3N6vTbtsSNjDsMpBFuuDEjkXyQ6qxNorHPz" |
---|
5 | 5 | | |
---|
6 | 6 | | let protocolWallet = "3N8Tqf9oLMMv62F3UL4saG4rGxfeZG3nEs4" |
---|
7 | 7 | | |
---|
8 | 8 | | let ownerPerc = 200000 |
---|
9 | 9 | | |
---|
10 | 10 | | let protocolPerc = 800000 |
---|
11 | 11 | | |
---|
12 | 12 | | let MULT6 = 1000000 |
---|
13 | 13 | | |
---|
14 | 14 | | @Callable(i) |
---|
15 | 15 | | func distributeProfits () = { |
---|
16 | 16 | | 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) |
---|
19 | 22 | | [ScriptTransfer(addressFromStringValue(ownerWallet), ownerAmount, unit), ScriptTransfer(addressFromStringValue(protocolWallet), protocolAmount, unit)] |
---|
| 23 | + | } |
---|
20 | 24 | | } |
---|
21 | 25 | | |
---|
22 | 26 | | |
---|