tx · X6E65JnqjwEkFCaPxQiguZT3D6puBrd1kd5qZt5WYXE
3N3P5euNnTjmGsZHxXceWDyFZM7CN9YPjhp: -0.01400000 Waves
2021.04.19 07:48 [1488881] smart account 3N3P5euNnTjmGsZHxXceWDyFZM7CN9YPjhp > SELF 0.00000000 Waves
{
"type": 13,
"id": "X6E65JnqjwEkFCaPxQiguZT3D6puBrd1kd5qZt5WYXE",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1618807688386,
"version": 2,
"chainId": 84,
"sender": "3N3P5euNnTjmGsZHxXceWDyFZM7CN9YPjhp",
"senderPublicKey": "ECgJ5aXMvEomM6yWA4tsqXdM3az7ddLr4cLr3yNJwJUb",
"proofs": [
"4qfmir8D9cmrugpidNnGDRHwUbLSwNWh4gA8CS6YsiyTk6hU9pbkYcc1v7TnuEo85VArq33tChtNsETuLsgSKJwj"
],
"script": "base64:AAIEAAAAAAAAABIIAhIFCgMIAQESBwoFCAEBAQgAAAACAAAAAAZwYXI3SWQBAAAAIJedbhD+DwLKhAB/H26DYx4Zv6xpfO57kM3OSOXSB0EjAQAAAAdjdXJyZW50AAAAAQAAAAFpBAAAAANwbXQJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAADCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQACWAAAAAEJAQAAAAV2YWx1ZQAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAIAAAAFV0FWRVMAAAACAAAAAWkBAAAADnNwb25zb3JEZXBvc2l0AAAAAwAAAAtjb21wZU51bWJlcgAAABFjb21wZUVuZFRpbWVzdGFtcAAAAAl0aW1lc3RhbXAEAAAAA3BtdAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAJY3VycmVudElkCQEAAAAHY3VycmVudAAAAAEFAAAAAWkDCQAAZgAAAAIFAAAACXRpbWVzdGFtcAUAAAARY29tcGVFbmRUaW1lc3RhbXAJAAAC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2l0aGRyYXcgbmVnYXRpdmUgYW1vdW50AwkAAGYAAAACAAAAAAAAAAAABQAAAAluZXdBbW91bnQJAAACAAAAAQIAAAASTm90IGVub3VnaCBiYWxhbmNlCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAIc3BvbnNvcl8FAAAACmN1cnJlbnRLZXkCAAAAAV8FAAAAB2Fzc2V0SWQCAAAAAV8FAAAAC2NvbXBlTnVtYmVyBQAAAAluZXdBbW91bnQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACBQAAAAtjb21wZU51bWJlcgIAAAABXwUAAAAHYXNzZXRJZAUAAAAOY29tcGVOZXdBbW91bnQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5lcf4TQ==",
"height": 1488881,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: F3nAj4Cxtn7Qfz1BpFk2NVWkop5oZsmmpQBrbct1QfYt
Next: 82XQZz5Vs3yn19Ymz4QWLa9DxsNbtWVgijsubvFXBm7Q
Diff:
Old | New | | Differences |
---|
26 | 26 | | 0 |
---|
27 | 27 | | } |
---|
28 | 28 | | let newAmount = (currentAmount + pmt.amount) |
---|
29 | | - | [IntegerEntry(((((("sponsor_" + currentKey) + "_") + currentId) + "_") + compeNumber), newAmount), IntegerEntry(((compeNumber + "_") + currentId), newAmount)] |
---|
| 29 | + | let compeCurrentAmount = match getInteger(this, ((compeNumber + "_") + currentId)) { |
---|
| 30 | + | case a: Int => |
---|
| 31 | + | a |
---|
| 32 | + | case _ => |
---|
| 33 | + | 0 |
---|
| 34 | + | } |
---|
| 35 | + | let compeNewAmount = (compeCurrentAmount + pmt.amount) |
---|
| 36 | + | [IntegerEntry(((((("sponsor_" + currentKey) + "_") + currentId) + "_") + compeNumber), newAmount), IntegerEntry(((compeNumber + "_") + currentId), compeNewAmount)] |
---|
30 | 37 | | } |
---|
31 | 38 | | } |
---|
32 | 39 | | |
---|
|
42 | 49 | | 0 |
---|
43 | 50 | | } |
---|
44 | 51 | | let newAmount = (currentAmount - amount) |
---|
| 52 | + | let compeCurrentAmount = match getInteger(this, ((compeNumber + "_") + assetId)) { |
---|
| 53 | + | case a: Int => |
---|
| 54 | + | a |
---|
| 55 | + | case _ => |
---|
| 56 | + | 0 |
---|
| 57 | + | } |
---|
| 58 | + | let compeNewAmount = (compeCurrentAmount + amount) |
---|
45 | 59 | | if ((timestamp > compeStartTimestamp)) |
---|
46 | 60 | | then throw("Competition has already started") |
---|
47 | 61 | | else if ((0 > amount)) |
---|
48 | 62 | | then throw("Can't withdraw negative amount") |
---|
49 | 63 | | else if ((0 > newAmount)) |
---|
50 | 64 | | then throw("Not enough balance") |
---|
51 | | - | else [IntegerEntry(((((("sponsor_" + currentKey) + "_") + assetId) + "_") + compeNumber), newAmount), IntegerEntry(((compeNumber + "_") + assetId), newAmount)] |
---|
| 65 | + | else [IntegerEntry(((((("sponsor_" + currentKey) + "_") + assetId) + "_") + compeNumber), newAmount), IntegerEntry(((compeNumber + "_") + assetId), compeNewAmount)] |
---|
52 | 66 | | } |
---|
53 | 67 | | |
---|
54 | 68 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 4 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let par7Id = base58'BCqo4hvDBB2dzmidJQKkVtQtkgEQVVwMy1jjV4R4tNB4' |
---|
5 | 5 | | |
---|
6 | 6 | | func current (i) = { |
---|
7 | 7 | | let pmt = i.payments[0] |
---|
8 | 8 | | if (isDefined(pmt.assetId)) |
---|
9 | 9 | | then toBase58String(value(pmt.assetId)) |
---|
10 | 10 | | else "WAVES" |
---|
11 | 11 | | } |
---|
12 | 12 | | |
---|
13 | 13 | | |
---|
14 | 14 | | @Callable(i) |
---|
15 | 15 | | func sponsorDeposit (compeNumber,compeEndTimestamp,timestamp) = { |
---|
16 | 16 | | let pmt = i.payments[0] |
---|
17 | 17 | | let currentId = current(i) |
---|
18 | 18 | | if ((timestamp > compeEndTimestamp)) |
---|
19 | 19 | | then throw("Competition is finished") |
---|
20 | 20 | | else { |
---|
21 | 21 | | let currentKey = toBase58String(i.caller.bytes) |
---|
22 | 22 | | let currentAmount = match getInteger(this, ((((("sponsor_" + currentKey) + "_") + currentId) + "_") + compeNumber)) { |
---|
23 | 23 | | case a: Int => |
---|
24 | 24 | | a |
---|
25 | 25 | | case _ => |
---|
26 | 26 | | 0 |
---|
27 | 27 | | } |
---|
28 | 28 | | let newAmount = (currentAmount + pmt.amount) |
---|
29 | | - | [IntegerEntry(((((("sponsor_" + currentKey) + "_") + currentId) + "_") + compeNumber), newAmount), IntegerEntry(((compeNumber + "_") + currentId), newAmount)] |
---|
| 29 | + | let compeCurrentAmount = match getInteger(this, ((compeNumber + "_") + currentId)) { |
---|
| 30 | + | case a: Int => |
---|
| 31 | + | a |
---|
| 32 | + | case _ => |
---|
| 33 | + | 0 |
---|
| 34 | + | } |
---|
| 35 | + | let compeNewAmount = (compeCurrentAmount + pmt.amount) |
---|
| 36 | + | [IntegerEntry(((((("sponsor_" + currentKey) + "_") + currentId) + "_") + compeNumber), newAmount), IntegerEntry(((compeNumber + "_") + currentId), compeNewAmount)] |
---|
30 | 37 | | } |
---|
31 | 38 | | } |
---|
32 | 39 | | |
---|
33 | 40 | | |
---|
34 | 41 | | |
---|
35 | 42 | | @Callable(i) |
---|
36 | 43 | | func sponsorWithdraw (compeNumber,compeStartTimestamp,timestamp,amount,assetId) = { |
---|
37 | 44 | | let currentKey = toBase58String(i.caller.bytes) |
---|
38 | 45 | | let currentAmount = match getInteger(this, ((((("sponsor_" + currentKey) + "_") + assetId) + "_") + compeNumber)) { |
---|
39 | 46 | | case a: Int => |
---|
40 | 47 | | a |
---|
41 | 48 | | case _ => |
---|
42 | 49 | | 0 |
---|
43 | 50 | | } |
---|
44 | 51 | | let newAmount = (currentAmount - amount) |
---|
| 52 | + | let compeCurrentAmount = match getInteger(this, ((compeNumber + "_") + assetId)) { |
---|
| 53 | + | case a: Int => |
---|
| 54 | + | a |
---|
| 55 | + | case _ => |
---|
| 56 | + | 0 |
---|
| 57 | + | } |
---|
| 58 | + | let compeNewAmount = (compeCurrentAmount + amount) |
---|
45 | 59 | | if ((timestamp > compeStartTimestamp)) |
---|
46 | 60 | | then throw("Competition has already started") |
---|
47 | 61 | | else if ((0 > amount)) |
---|
48 | 62 | | then throw("Can't withdraw negative amount") |
---|
49 | 63 | | else if ((0 > newAmount)) |
---|
50 | 64 | | then throw("Not enough balance") |
---|
51 | | - | else [IntegerEntry(((((("sponsor_" + currentKey) + "_") + assetId) + "_") + compeNumber), newAmount), IntegerEntry(((compeNumber + "_") + assetId), newAmount)] |
---|
| 65 | + | else [IntegerEntry(((((("sponsor_" + currentKey) + "_") + assetId) + "_") + compeNumber), newAmount), IntegerEntry(((compeNumber + "_") + assetId), compeNewAmount)] |
---|
52 | 66 | | } |
---|
53 | 67 | | |
---|
54 | 68 | | |
---|
55 | 69 | | @Verifier(tx) |
---|
56 | 70 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
57 | 71 | | |
---|