tx · 4AnjzMjYD8mwBgUQ6TJxuFgBAZceJHhiDkio13vEXmSf

3N5RAMPJE4xs7mfEqKaHmhuWgVjXbK6dfGc:  -0.01000000 Waves

2022.02.04 17:24 [1908988] smart account 3N5RAMPJE4xs7mfEqKaHmhuWgVjXbK6dfGc > SELF 0.00000000 Waves

{ "type": 13, "id": "4AnjzMjYD8mwBgUQ6TJxuFgBAZceJHhiDkio13vEXmSf", "fee": 1000000, "feeAssetId": null, "timestamp": 1643984693401, "version": 2, "chainId": 84, "sender": "3N5RAMPJE4xs7mfEqKaHmhuWgVjXbK6dfGc", "senderPublicKey": "EAog7JJhHByJAZz8XubAMQbtFA3hXBrwbb3goJoVDs4Q", "proofs": [ "3p2n2tyhrGWPF2ZvwJw5UdmLmDaaGnHHmsNFqrNtRj2Apj5v1PK4ZwAxdFWzPDUvARv6X6miXpd4d7EQUgtYy1Kk" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIICAAAAAcAAAAAC3ByZXNlbmNlS2V5AgAAAAlwcmVzZW5jZXMAAAAACmFic2VuY2VLZXkCAAAACGFic2VuY2VzAAAAAAp0b3RhbENvdXJzAgAAAAp0b3RhbENvdXJzAAAAAApsZWFzZUlkS2V5AgAAAAdsZWFzZUlkAQAAAA1nZXROYlByZXNlbmNlAAAAAAQAAAAKbmJQcmVzZW5jZQkABB8AAAABBQAAAAtwcmVzZW5jZUtleQQAAAAHJG1hdGNoMAUAAAAKbmJQcmVzZW5jZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAF0BQAAAAckbWF0Y2gwBQAAAAF0AAAAAAAAAAAAAQAAAApnZXROYkNvdXJzAAAAAAQAAAAHbmJDb3VycwkABB8AAAABBQAAAAp0b3RhbENvdXJzBAAAAAckbWF0Y2gwBQAAAAduYkNvdXJzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAXQFAAAAByRtYXRjaDAFAAAAAXQAAAAAAAAAAAABAAAADGdldE5iQWJz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VnZXJFbnRyeQAAAAIFAAAAC3ByZXNlbmNlS2V5CQAAZAAAAAIFAAAACm5iUHJlc2VuY2UAAAAAAAAAAAEJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAACnRvdGFsQ291cnMJAABkAAAAAgUAAAAHbmJDb3VycwAAAAAAAAAAAQUAAAADbmlsCQAFFAAAAAIJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAACmFic2VuY2VLZXkJAABkAAAAAgUAAAAJbmJBYnNlbmNlAAAAAAAAAAABCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAAp0b3RhbENvdXJzCQAAZAAAAAIFAAAAB25iQ291cnMAAAAAAAAAAAEJAARMAAAAAgkBAAAAC0xlYXNlQ2FuY2VsAAAAAQkBAAAAEUBleHRyTmF0aXZlKDEwNTcpAAAAAQUAAAAKbGVhc2VJZEtleQUAAAADbmlsAAAAAAAAAAAAAAAAACPLck4=", "height": 1908988, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9o9PeFnQKgJ1JgmECvAa4SUjoF95b9GsrYvC5L3MBfhz Next: Gw9MFuHHPPM6h57iQHR4wsoEBN9AJAjRHnooJqb27Wfq Diff:
OldNewDifferences
5050 if ((presence == "présent"))
5151 then {
5252 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)
53+ if ((leasableBalance > 0))
54+ then {
55+ let lease = Lease(addressFromStringValue(addressToLease), leasableBalance)
56+ let leaseId = calculateLeaseId(lease)
57+[IntegerEntry(presenceKey, (nbPresence + 1)), IntegerEntry(totalCours, (nbCours + 1)), BinaryEntry(leaseIdKey, leaseId), lease]
58+ }
59+ else [IntegerEntry(presenceKey, (nbPresence + 1)), IntegerEntry(totalCours, (nbCours + 1))]
5660 }
57- else $Tuple2([IntegerEntry(absenceKey, (nbPresence + 1)), IntegerEntry(totalCours, (nbCours + 1)), LeaseCancel(getBinaryValue(leaseIdKey))], 0)
61+ else $Tuple2([IntegerEntry(absenceKey, (nbAbsence + 1)), IntegerEntry(totalCours, (nbCours + 1)), LeaseCancel(getBinaryValue(leaseIdKey))], 0)
5862 }
5963
6064
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let presenceKey = "presences"
55
66 let absenceKey = "absences"
77
88 let totalCours = "totalCours"
99
1010 let leaseIdKey = "leaseId"
1111
1212 func getNbPresence () = {
1313 let nbPresence = getInteger(presenceKey)
1414 match nbPresence {
1515 case t: Int =>
1616 t
1717 case _ =>
1818 0
1919 }
2020 }
2121
2222
2323 func getNbCours () = {
2424 let nbCours = getInteger(totalCours)
2525 match nbCours {
2626 case t: Int =>
2727 t
2828 case _ =>
2929 0
3030 }
3131 }
3232
3333
3434 func getNbAbsence () = {
3535 let nbAbsence = getInteger(absenceKey)
3636 match nbAbsence {
3737 case t: Int =>
3838 t
3939 case _ =>
4040 0
4141 }
4242 }
4343
4444
4545 @Callable(i)
4646 func validationPresence (presence,addressToLease) = {
4747 let nbPresence = getNbPresence()
4848 let nbCours = getNbCours()
4949 let nbAbsence = getNbAbsence()
5050 if ((presence == "présent"))
5151 then {
5252 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)
53+ if ((leasableBalance > 0))
54+ then {
55+ let lease = Lease(addressFromStringValue(addressToLease), leasableBalance)
56+ let leaseId = calculateLeaseId(lease)
57+[IntegerEntry(presenceKey, (nbPresence + 1)), IntegerEntry(totalCours, (nbCours + 1)), BinaryEntry(leaseIdKey, leaseId), lease]
58+ }
59+ else [IntegerEntry(presenceKey, (nbPresence + 1)), IntegerEntry(totalCours, (nbCours + 1))]
5660 }
57- else $Tuple2([IntegerEntry(absenceKey, (nbPresence + 1)), IntegerEntry(totalCours, (nbCours + 1)), LeaseCancel(getBinaryValue(leaseIdKey))], 0)
61+ else $Tuple2([IntegerEntry(absenceKey, (nbAbsence + 1)), IntegerEntry(totalCours, (nbCours + 1)), LeaseCancel(getBinaryValue(leaseIdKey))], 0)
5862 }
5963
6064

github/deemru/w8io/169f3d6 
31.26 ms