tx · Dnn5CU6jLKdfN55Pzt96MkTsqFGK9HVCNKpU9dhPPsRE

3N3P5euNnTjmGsZHxXceWDyFZM7CN9YPjhp:  -0.01400000 Waves

2021.04.18 02:24 [1487121] smart account 3N3P5euNnTjmGsZHxXceWDyFZM7CN9YPjhp > SELF 0.00000000 Waves

{ "type": 13, "id": "Dnn5CU6jLKdfN55Pzt96MkTsqFGK9HVCNKpU9dhPPsRE", "fee": 1400000, "feeAssetId": null, "timestamp": 1618701871839, "version": 2, "chainId": 84, "sender": "3N3P5euNnTjmGsZHxXceWDyFZM7CN9YPjhp", "senderPublicKey": "ECgJ5aXMvEomM6yWA4tsqXdM3az7ddLr4cLr3yNJwJUb", "proofs": [ "5cKtYtnJ1uFpVd6B3wprc3UCouXaj8Urn9JsqfF39po51vtSQpMvEGB7E55w2AP9A3n7su4WdrNJwQr3wGnS4YdU" ], "script": "base64:AAIEAAAAAAAAABMIAhIGCgQIAQEIEgcKBQgBAQEIAAAAAgAAAAAGcGFyN0lkAQAAACCXnW4Q/g8CyoQAfx9ug2MeGb+saXzue5DNzkjl0gdBIwEAAAAHY3VycmVudAAAAAEAAAABaQQAAAADcG10CQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAAAwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAlgAAAABCQEAAAAFdmFsdWUAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQCAAAABVdBVkVTAAAAAgAAAAFpAQAAAA5zcG9uc29yRGVwb3NpdAAAAAQAAAALY29tcGVOdW1iZXIAAAARY29tcGVFbmRUaW1lc3RhbXAAAAAJdGltZXN0YW1wAAAACWFzc2V0TmFtZQQAAAADcG10CQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAABAAAAAljdXJyZW50SWQJAQAAAAdjdXJyZW50AAAAAQUAAAABaQMJAABmAAAAAgUAAAAJdGltZXN0YW1wBQAAABFjb21wZUVuZFRp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YQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAQAAAAJbmV3QW1vdW50CQAAZQAAAAIFAAAADWN1cnJlbnRBbW91bnQFAAAABmFtb3VudAMJAABmAAAAAgUAAAAJdGltZXN0YW1wBQAAABNjb21wZVN0YXJ0VGltZXN0YW1wCQAAAgAAAAECAAAAH0NvbXBldGl0aW9uIGhhcyBhbHJlYWR5IHN0YXJ0ZWQDCQAAZgAAAAIAAAAAAAAAAAAFAAAABmFtb3VudAkAAAIAAAABAgAAAB5DYW4ndCB3aXRoZHJhdyBuZWdhdGl2ZSBhbW91bnQDCQAAZgAAAAIAAAAAAAAAAAAFAAAACW5ld0Ftb3VudAkAAAIAAAABAgAAABJOb3QgZW5vdWdoIGJhbGFuY2UJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAhzcG9uc29yXwUAAAAKY3VycmVudEtleQIAAAABXwUAAAAHYXNzZXRJZAIAAAABXwUAAAALY29tcGVOdW1iZXIFAAAACW5ld0Ftb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIFAAAAC2NvbXBlTnVtYmVyAgAAAAFfBQAAAAdhc3NldElkBQAAAAluZXdBbW91bnQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5X7hHVg==", "height": 1487121, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4svxSQUQ9GaFPnQXgqdgYnJSK2eWvjBqv8AskFqTXQqu Next: CL7LGWjXy6v7xepRUUVf6ZTmNVGYshK2soMKcacGFQcH Diff:
OldNewDifferences
33 {-# CONTENT_TYPE DAPP #-}
44 let par7Id = base58'BCqo4hvDBB2dzmidJQKkVtQtkgEQVVwMy1jjV4R4tNB4'
55
6+func current (i) = {
7+ let pmt = i.payments[0]
8+ if (isDefined(pmt.assetId))
9+ then toBase58String(value(pmt.assetId))
10+ else "WAVES"
11+ }
12+
13+
614 @Callable(i)
7-func sponsorDeposit (compeNumber,compeEndTimestamp,timestamp) = {
15+func sponsorDeposit (compeNumber,compeEndTimestamp,timestamp,assetName) = {
816 let pmt = i.payments[0]
17+ let currentId = current(i)
918 if ((timestamp > compeEndTimestamp))
1019 then throw("Competition is finished")
1120 else {
12- let currentId = toBase58String(value(pmt.assetId))
1321 let currentKey = toBase58String(i.caller.bytes)
1422 let currentAmount = match getInteger(this, currentKey) {
1523 case a: Int =>
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let par7Id = base58'BCqo4hvDBB2dzmidJQKkVtQtkgEQVVwMy1jjV4R4tNB4'
55
6+func current (i) = {
7+ let pmt = i.payments[0]
8+ if (isDefined(pmt.assetId))
9+ then toBase58String(value(pmt.assetId))
10+ else "WAVES"
11+ }
12+
13+
614 @Callable(i)
7-func sponsorDeposit (compeNumber,compeEndTimestamp,timestamp) = {
15+func sponsorDeposit (compeNumber,compeEndTimestamp,timestamp,assetName) = {
816 let pmt = i.payments[0]
17+ let currentId = current(i)
918 if ((timestamp > compeEndTimestamp))
1019 then throw("Competition is finished")
1120 else {
12- let currentId = toBase58String(value(pmt.assetId))
1321 let currentKey = toBase58String(i.caller.bytes)
1422 let currentAmount = match getInteger(this, currentKey) {
1523 case a: Int =>
1624 a
1725 case _ =>
1826 0
1927 }
2028 let newAmount = (currentAmount + pmt.amount)
2129 [IntegerEntry(((((("sponsor_" + currentKey) + "_") + currentId) + "_") + compeNumber), newAmount), IntegerEntry(((compeNumber + "_") + currentId), newAmount)]
2230 }
2331 }
2432
2533
2634
2735 @Callable(i)
2836 func sponsorWithDraw (compeNumber,compeStartTimestamp,timestamp,amount,assetId) = {
2937 let currentKey = toBase58String(i.caller.bytes)
3038 let currentAmount = match getInteger(this, ((currentKey + "_") + compeNumber)) {
3139 case a: Int =>
3240 a
3341 case _ =>
3442 0
3543 }
3644 let newAmount = (currentAmount - amount)
3745 if ((timestamp > compeStartTimestamp))
3846 then throw("Competition has already started")
3947 else if ((0 > amount))
4048 then throw("Can't withdraw negative amount")
4149 else if ((0 > newAmount))
4250 then throw("Not enough balance")
4351 else [IntegerEntry(((((("sponsor_" + currentKey) + "_") + assetId) + "_") + compeNumber), newAmount), IntegerEntry(((compeNumber + "_") + assetId), newAmount)]
4452 }
4553
4654
4755 @Verifier(tx)
4856 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
4957

github/deemru/w8io/169f3d6 
29.23 ms