tx · FoYhckbmVawhzQvsWRNpSaTBRuKZMY1XG4q2Shx1uwXk 3N3P5euNnTjmGsZHxXceWDyFZM7CN9YPjhp: -0.01000000 Waves 2021.04.16 09:57 [1484672] smart account 3N3P5euNnTjmGsZHxXceWDyFZM7CN9YPjhp > SELF 0.00000000 Waves
{ "type": 13, "id": "FoYhckbmVawhzQvsWRNpSaTBRuKZMY1XG4q2Shx1uwXk", "fee": 1000000, "feeAssetId": null, "timestamp": 1618556244343, "version": 2, "chainId": 84, "sender": "3N3P5euNnTjmGsZHxXceWDyFZM7CN9YPjhp", "senderPublicKey": "ECgJ5aXMvEomM6yWA4tsqXdM3az7ddLr4cLr3yNJwJUb", "proofs": [ "Qbv8jUE1BBkwpjnCELEXrrgaaejP87maKWR5SFQbPx7LmKp9Ae1Bu6uZm8vtHSxkTPLVUgqpyCAESVXDBnisXFb" ], "script": "base64:AAIEAAAAAAAAABEIAhIFCgMIAQESBgoECAEBAQAAAAEAAAAABnBhcjdJZAEAAAAgl51uEP4PAsqEAH8fboNjHhm/rGl87nuQzc5I5dIHQSMAAAACAAAAAWkBAAAADnNwb25zb3JEZXBvc2l0AAAAAwAAAAtjb21wZU51bWJlcgAAABFjb21wZUVuZFRpbWVzdGFtcAAAAAl0aW1lc3RhbXAEAAAAA3BtdAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAMJAABmAAAAAgUAAAAJdGltZXN0YW1wBQAAABFjb21wZUVuZFRpbWVzdGFtcAkAAAIAAAABAgAAABdDb21wZXRpdGlvbiBpcyBmaW5pc2hlZAMJAAAAAAAAAggFAAAAA3BtdAAAAAdhc3NldElkBQAAAAZwYXI3SWQJAAACAAAAAQIAAAAgQ2FuIGhvZGwgUEFSNyBvbmx5IGF0IHRoZSBtb21lbnQEAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAANY3VycmVudEFtb3VudAQAAAAHJG1hdGNoMAkABB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AAAHkNhbid0IHdpdGhkcmF3IG5lZ2F0aXZlIGFtb3VudAMJAABmAAAAAgAAAAAAAAAAAAUAAAAJbmV3QW1vdW50CQAAAgAAAAECAAAAEk5vdCBlbm91Z2ggYmFsYW5jZQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAIc3BvbnNvcl8FAAAACmN1cnJlbnRLZXkCAAAAAV8FAAAAC2NvbXBlTnVtYmVyBQAAAAluZXdBbW91bnQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAAC2NvbXBlTnVtYmVyBQAAAAluZXdBbW91bnQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5LHrlYA==", "height": 1484672, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: HP8QZfFYaQwrf1N4jixeeADCPMRYKwRe5ZFK7ben4mG5 Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 4 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let par7Id = base58'BCqo4hvDBB2dzmidJQKkVtQtkgEQVVwMy1jjV4R4tNB4' | |
5 | + | ||
6 | + | @Callable(i) | |
7 | + | func sponsorDeposit (compeNumber,compeEndTimestamp,timestamp) = { | |
8 | + | let pmt = i.payments[0] | |
9 | + | if ((timestamp > compeEndTimestamp)) | |
10 | + | then throw("Competition is finished") | |
11 | + | else if ((pmt.assetId == par7Id)) | |
12 | + | then throw("Can hodl PAR7 only at the moment") | |
13 | + | else { | |
14 | + | let currentKey = toBase58String(i.caller.bytes) | |
15 | + | let currentAmount = match getInteger(this, currentKey) { | |
16 | + | case a: Int => | |
17 | + | a | |
18 | + | case _ => | |
19 | + | 0 | |
20 | + | } | |
21 | + | let newAmount = (currentAmount + pmt.amount) | |
22 | + | [IntegerEntry(((("sponsor_" + currentKey) + "_") + compeNumber), newAmount), IntegerEntry(compeNumber, newAmount)] | |
23 | + | } | |
24 | + | } | |
25 | + | ||
26 | + | ||
27 | + | ||
28 | + | @Callable(i) | |
29 | + | func sponsorWithDraw (compeNumber,compeStartTimestamp,timestamp,amount) = { | |
30 | + | let currentKey = toBase58String(i.caller.bytes) | |
31 | + | let currentAmount = match getInteger(this, ((currentKey + "_") + compeNumber)) { | |
32 | + | case a: Int => | |
33 | + | a | |
34 | + | case _ => | |
35 | + | 0 | |
36 | + | } | |
37 | + | let newAmount = (currentAmount - amount) | |
38 | + | if ((timestamp > compeStartTimestamp)) | |
39 | + | then throw("Competition has already started") | |
40 | + | else if ((0 > amount)) | |
41 | + | then throw("Can't withdraw negative amount") | |
42 | + | else if ((0 > newAmount)) | |
43 | + | then throw("Not enough balance") | |
44 | + | else [IntegerEntry(((("sponsor_" + currentKey) + "_") + compeNumber), newAmount), IntegerEntry(compeNumber, newAmount)] | |
45 | + | } | |
46 | + | ||
47 | + | ||
48 | + | @Verifier(tx) | |
49 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
50 | + |
github/deemru/w8io/169f3d6 17.28 ms ◑