tx · D6q5mBJvdjQN97fdRpVX1mKrCfxaGTDD4ti47Nym3HWX

3N3P5euNnTjmGsZHxXceWDyFZM7CN9YPjhp:  -0.01400000 Waves

2021.05.13 09:54 [1523570] smart account 3N3P5euNnTjmGsZHxXceWDyFZM7CN9YPjhp > SELF 0.00000000 Waves

{ "type": 13, "id": "D6q5mBJvdjQN97fdRpVX1mKrCfxaGTDD4ti47Nym3HWX", "fee": 1400000, "feeAssetId": null, "timestamp": 1620888863795, "version": 2, "chainId": 84, "sender": "3N3P5euNnTjmGsZHxXceWDyFZM7CN9YPjhp", "senderPublicKey": "ECgJ5aXMvEomM6yWA4tsqXdM3az7ddLr4cLr3yNJwJUb", "proofs": [ "2uh943Qp9YD4FvM9PHh988jT8krU8MQH2EoEi3bML2p8fEGHfyk24xxQBxUusRgkgExLUyRUfuJCk1wyAZhdHTf4" ], "script": "base64:AAIEAAAAAAAAACwIAhIDCgEIEgYKBAgBAQgSCAoGCAEBAQgIEhEKDwgICAgBCAEIAQgBCAEIAQAAAAEBAAAAB2N1cnJlbnQAAAABAAAAAWkEAAAAA3BtdAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAJYAAAAAQkBAAAABXZhbHVlAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkAgAAAAVXQVZFUwAAAAQAAAABaQEAAAAVcmFua2luZ1Nwb25zb3JEZXBvc2l0AAAAAQAAAA5tb250aFRpbWVzdGFtcAQAAAADcG10CQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAABAAAAAljdXJyZW50SWQJAQAAAAdjdXJyZW50AAAAAQUAAAABaQQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMJAA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dFRyYW5zZmVyAAAAAwUAAAALbmV0MWFkZHJlc3MFAAAACm5ldDFhbW91bnQFAAAADmN1cnJlbnRBc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAC25ldDJhZGRyZXNzBQAAAApuZXQyYW1vdW50BQAAAA5jdXJyZW50QXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAtuZXQzYWRkcmVzcwUAAAAKbmV0M2Ftb3VudAUAAAAOY3VycmVudEFzc2V0SWQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAMYm9vYnlhZGRyZXNzBQAAAAtib29ieWFtb3VudAUAAAAOY3VycmVudEFzc2V0SWQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAPbmVhcnBpbjFhZGRyZXNzBQAAAA5uZWFycGluMWFtb3VudAUAAAAOY3VycmVudEFzc2V0SWQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAPbmVhcnBpbjJhZGRyZXNzBQAAAA5uZWFycGluMmFtb3VudAUAAAAOY3VycmVudEFzc2V0SWQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5xAWRlA==", "height": 1523570, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CyLkH4c3jbnyVwRGhZmoFtvGkAtbY8EKYas28YQBoXhC Next: F3vaB8tUCLLPYUdKX7ScVBfXFVMLb9TJ1VGzGiQXyHZW Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let par7Id = base58'BCqo4hvDBB2dzmidJQKkVtQtkgEQVVwMy1jjV4R4tNB4'
5-
64 func current (i) = {
75 let pmt = i.payments[0]
86 if (isDefined(pmt.assetId))
97 then toBase58String(value(pmt.assetId))
108 else "WAVES"
119 }
10+
11+
12+@Callable(i)
13+func rankingSponsorDeposit (monthTimestamp) = {
14+ let pmt = i.payments[0]
15+ let currentId = current(i)
16+ let currentKey = toBase58String(i.caller.bytes)
17+ let currentAmount = match getInteger(this, ((((("ranking_sponsor_" + currentKey) + "_") + currentId) + "_") + monthTimestamp)) {
18+ case a: Int =>
19+ a
20+ case _ =>
21+ 0
22+ }
23+ let newAmount = (currentAmount + pmt.amount)
24+ let rankingCurrentAmount = match getInteger(this, ((("ranking_sponsor" + currentId) + "_") + monthTimestamp)) {
25+ case a: Int =>
26+ a
27+ case _ =>
28+ 0
29+ }
30+ let rankingNewAmount = (rankingCurrentAmount + pmt.amount)
31+[IntegerEntry(((((("ranking_sponsor_" + currentKey) + "_") + currentId) + "_") + monthTimestamp), newAmount), IntegerEntry(((("ranking_sponsor_" + currentId) + "_") + monthTimestamp), rankingNewAmount)]
32+ }
33+
1234
1335
1436 @Callable(i)
85107 let net2amount = (compeCurrentAmount * (net2percent / 100))
86108 let net3address = addressFromStringValue(net3)
87109 let net3amount = (compeCurrentAmount * (net3percent / 100))
88- let boobyaddress = addressFromStringValue(net3)
89- let boobyamount = (compeCurrentAmount * (net3percent / 100))
110+ let boobyaddress = addressFromStringValue(booby)
111+ let boobyamount = (compeCurrentAmount * (boobypercent / 100))
90112 let nearpin1address = addressFromStringValue(nearpin1)
91113 let nearpin1amount = (compeCurrentAmount * (nearpin1percent / 100))
92114 let nearpin2address = addressFromStringValue(nearpin2)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let par7Id = base58'BCqo4hvDBB2dzmidJQKkVtQtkgEQVVwMy1jjV4R4tNB4'
5-
64 func current (i) = {
75 let pmt = i.payments[0]
86 if (isDefined(pmt.assetId))
97 then toBase58String(value(pmt.assetId))
108 else "WAVES"
119 }
10+
11+
12+@Callable(i)
13+func rankingSponsorDeposit (monthTimestamp) = {
14+ let pmt = i.payments[0]
15+ let currentId = current(i)
16+ let currentKey = toBase58String(i.caller.bytes)
17+ let currentAmount = match getInteger(this, ((((("ranking_sponsor_" + currentKey) + "_") + currentId) + "_") + monthTimestamp)) {
18+ case a: Int =>
19+ a
20+ case _ =>
21+ 0
22+ }
23+ let newAmount = (currentAmount + pmt.amount)
24+ let rankingCurrentAmount = match getInteger(this, ((("ranking_sponsor" + currentId) + "_") + monthTimestamp)) {
25+ case a: Int =>
26+ a
27+ case _ =>
28+ 0
29+ }
30+ let rankingNewAmount = (rankingCurrentAmount + pmt.amount)
31+[IntegerEntry(((((("ranking_sponsor_" + currentKey) + "_") + currentId) + "_") + monthTimestamp), newAmount), IntegerEntry(((("ranking_sponsor_" + currentId) + "_") + monthTimestamp), rankingNewAmount)]
32+ }
33+
1234
1335
1436 @Callable(i)
1537 func sponsorDeposit (compeNumber,compeEndTimestamp,timestamp,compeAddress) = {
1638 let pmt = i.payments[0]
1739 let currentId = current(i)
1840 if ((timestamp > compeEndTimestamp))
1941 then throw("Competition is finished")
2042 else {
2143 let currentKey = toBase58String(i.caller.bytes)
2244 let currentAmount = match getInteger(this, ((((("sponsor_" + currentKey) + "_") + currentId) + "_") + compeNumber)) {
2345 case a: Int =>
2446 a
2547 case _ =>
2648 0
2749 }
2850 let newAmount = (currentAmount + pmt.amount)
2951 let compeCurrentAmount = match getInteger(this, ((((compeNumber + "_") + compeAddress) + "_") + currentId)) {
3052 case a: Int =>
3153 a
3254 case _ =>
3355 0
3456 }
3557 let compeNewAmount = (compeCurrentAmount + pmt.amount)
3658 [IntegerEntry(((((("sponsor_" + currentKey) + "_") + currentId) + "_") + compeNumber), newAmount), IntegerEntry(((((compeNumber + "_") + compeAddress) + "_") + currentId), compeNewAmount)]
3759 }
3860 }
3961
4062
4163
4264 @Callable(i)
4365 func sponsorWithdraw (compeNumber,compeEndTimestamp,timestamp,amount,assetId,compeAddress) = {
4466 let currentKey = toBase58String(i.caller.bytes)
4567 let currentAssetId = fromBase58String(assetId)
4668 let currentAmount = match getInteger(this, ((((("sponsor_" + currentKey) + "_") + assetId) + "_") + compeNumber)) {
4769 case a: Int =>
4870 a
4971 case _ =>
5072 0
5173 }
5274 let newAmount = (currentAmount - amount)
5375 let compeCurrentAmount = match getInteger(this, ((((compeNumber + "_") + compeAddress) + "_") + assetId)) {
5476 case a: Int =>
5577 a
5678 case _ =>
5779 0
5880 }
5981 let compeNewAmount = (compeCurrentAmount - amount)
6082 if ((timestamp > compeEndTimestamp))
6183 then throw("Competition is finished")
6284 else if ((0 > amount))
6385 then throw("Can't withdraw negative amount")
6486 else if ((0 > newAmount))
6587 then throw("Not enough balance")
6688 else if ((0 > compeNewAmount))
6789 then throw("Can't withdraw negative bounty amount")
6890 else [IntegerEntry(((((("sponsor_" + currentKey) + "_") + assetId) + "_") + compeNumber), newAmount), IntegerEntry(((((compeNumber + "_") + compeAddress) + "_") + assetId), compeNewAmount), ScriptTransfer(i.caller, amount, currentAssetId)]
6991 }
7092
7193
7294
7395 @Callable(i)
7496 func sponsorDistribution (compeNumber,assetId,compeAddress,net1,net1percent,net2,net2percent,net3,net3percent,booby,boobypercent,nearpin1,nearpin1percent,nearpin2,nearpin2percent) = {
7597 let currentAssetId = fromBase58String(assetId)
7698 let compeCurrentAmount = match getInteger(this, ((((compeNumber + "_") + compeAddress) + "_") + assetId)) {
7799 case a: Int =>
78100 a
79101 case _ =>
80102 0
81103 }
82104 let net1address = addressFromStringValue(net1)
83105 let net1amount = (compeCurrentAmount * (net1percent / 100))
84106 let net2address = addressFromStringValue(net2)
85107 let net2amount = (compeCurrentAmount * (net2percent / 100))
86108 let net3address = addressFromStringValue(net3)
87109 let net3amount = (compeCurrentAmount * (net3percent / 100))
88- let boobyaddress = addressFromStringValue(net3)
89- let boobyamount = (compeCurrentAmount * (net3percent / 100))
110+ let boobyaddress = addressFromStringValue(booby)
111+ let boobyamount = (compeCurrentAmount * (boobypercent / 100))
90112 let nearpin1address = addressFromStringValue(nearpin1)
91113 let nearpin1amount = (compeCurrentAmount * (nearpin1percent / 100))
92114 let nearpin2address = addressFromStringValue(nearpin2)
93115 let nearpin2amount = (compeCurrentAmount * (nearpin2percent / 100))
94116 if ((compeCurrentAmount == 0))
95117 then throw("Can't distribution negative amount")
96118 else [IntegerEntry(((((compeNumber + "_") + compeAddress) + "_") + assetId), 0), ScriptTransfer(net1address, net1amount, currentAssetId), ScriptTransfer(net2address, net2amount, currentAssetId), ScriptTransfer(net3address, net3amount, currentAssetId), ScriptTransfer(boobyaddress, boobyamount, currentAssetId), ScriptTransfer(nearpin1address, nearpin1amount, currentAssetId), ScriptTransfer(nearpin2address, nearpin2amount, currentAssetId)]
97119 }
98120
99121
100122 @Verifier(tx)
101123 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
102124

github/deemru/w8io/169f3d6 
29.68 ms