tx · 9o9PeFnQKgJ1JgmECvAa4SUjoF95b9GsrYvC5L3MBfhz 3N5RAMPJE4xs7mfEqKaHmhuWgVjXbK6dfGc: -0.01000000 Waves 2022.02.04 16:52 [1908955] smart account 3N5RAMPJE4xs7mfEqKaHmhuWgVjXbK6dfGc > SELF 0.00000000 Waves
{ "type": 13, "id": "9o9PeFnQKgJ1JgmECvAa4SUjoF95b9GsrYvC5L3MBfhz", "fee": 1000000, "feeAssetId": null, "timestamp": 1643982797439, "version": 2, "chainId": 84, "sender": "3N5RAMPJE4xs7mfEqKaHmhuWgVjXbK6dfGc", "senderPublicKey": "EAog7JJhHByJAZz8XubAMQbtFA3hXBrwbb3goJoVDs4Q", "proofs": [ "4h5ncVGBhxMHfwjdZ4oyN19r9yjM99QEZWhVt5nRfmqFjuYMwPR4AL514f7v1iiwjgvzRUKmwcvNdW4i7beMbXaa" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIICAAAAAcAAAAAC3ByZXNlbmNlS2V5AgAAAAlwcmVzZW5jZXMAAAAACmFic2VuY2VLZXkCAAAACGFic2VuY2VzAAAAAAp0b3RhbENvdXJzAgAAAAp0b3RhbENvdXJzAAAAAApsZWFzZUlkS2V5AgAAAAdsZWFzZUlkAQAAAA1nZXROYlByZXNlbmNlAAAAAAQAAAAKbmJQcmVzZW5jZQkABB8AAAABBQAAAAtwcmVzZW5jZUtleQQAAAAHJG1hdGNoMAUAAAAKbmJQcmVzZW5jZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAF0BQAAAAckbWF0Y2gwBQAAAAF0AAAAAAAAAAAAAQAAAApnZXROYkNvdXJzAAAAAAQAAAAHbmJDb3VycwkABB8AAAABBQAAAAp0b3RhbENvdXJzBAAAAAckbWF0Y2gwBQAAAAduYkNvdXJzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAXQFAAAAByRtYXRjaDAFAAAAAXQAAAAAAAAAAAABAAAADGdldE5iQWJzZW5j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JzZW5jZUtleQkAAGQAAAACBQAAAApuYlByZXNlbmNlAAAAAAAAAAABCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAAp0b3RhbENvdXJzCQAAZAAAAAIFAAAAB25iQ291cnMAAAAAAAAAAAEJAARMAAAAAgkBAAAAC0xlYXNlQ2FuY2VsAAAAAQkBAAAAEUBleHRyTmF0aXZlKDEwNTcpAAAAAQUAAAAKbGVhc2VJZEtleQUAAAADbmlsAAAAAAAAAAAAAAAAAMS5gJs=", "height": 1908955, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 4AnjzMjYD8mwBgUQ6TJxuFgBAZceJHhiDkio13vEXmSf Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let presenceKey = "presences" | |
5 | + | ||
6 | + | let absenceKey = "absences" | |
7 | + | ||
8 | + | let totalCours = "totalCours" | |
9 | + | ||
10 | + | let leaseIdKey = "leaseId" | |
11 | + | ||
12 | + | func getNbPresence () = { | |
13 | + | let nbPresence = getInteger(presenceKey) | |
14 | + | match nbPresence { | |
15 | + | case t: Int => | |
16 | + | t | |
17 | + | case _ => | |
18 | + | 0 | |
19 | + | } | |
20 | + | } | |
21 | + | ||
22 | + | ||
23 | + | func getNbCours () = { | |
24 | + | let nbCours = getInteger(totalCours) | |
25 | + | match nbCours { | |
26 | + | case t: Int => | |
27 | + | t | |
28 | + | case _ => | |
29 | + | 0 | |
30 | + | } | |
31 | + | } | |
32 | + | ||
33 | + | ||
34 | + | func getNbAbsence () = { | |
35 | + | let nbAbsence = getInteger(absenceKey) | |
36 | + | match nbAbsence { | |
37 | + | case t: Int => | |
38 | + | t | |
39 | + | case _ => | |
40 | + | 0 | |
41 | + | } | |
42 | + | } | |
43 | + | ||
44 | + | ||
45 | + | @Callable(i) | |
46 | + | func validationPresence (presence,addressToLease) = { | |
47 | + | let nbPresence = getNbPresence() | |
48 | + | let nbCours = getNbCours() | |
49 | + | let nbAbsence = getNbAbsence() | |
50 | + | if ((presence == "présent")) | |
51 | + | then { | |
52 | + | let leasableBalance = (wavesBalance(this).available - 10000000) | |
53 | + | let lease = Lease(addressFromStringValue(addressToLease), leasableBalance) | |
54 | + | let leaseId = calculateLeaseId(lease) | |
55 | + | $Tuple2([IntegerEntry(presenceKey, (nbPresence + 1)), IntegerEntry(totalCours, (nbCours + 1)), BinaryEntry(leaseIdKey, leaseId), lease], 0) | |
56 | + | } | |
57 | + | else $Tuple2([IntegerEntry(absenceKey, (nbPresence + 1)), IntegerEntry(totalCours, (nbCours + 1)), LeaseCancel(getBinaryValue(leaseIdKey))], 0) | |
58 | + | } | |
59 | + | ||
60 | + |
github/deemru/w8io/169f3d6 27.88 ms ◑