tx · Gw9MFuHHPPM6h57iQHR4wsoEBN9AJAjRHnooJqb27Wfq

3N5RAMPJE4xs7mfEqKaHmhuWgVjXbK6dfGc:  -0.01000000 Waves

2022.02.04 17:41 [1909007] smart account 3N5RAMPJE4xs7mfEqKaHmhuWgVjXbK6dfGc > SELF 0.00000000 Waves

{ "type": 13, "id": "Gw9MFuHHPPM6h57iQHR4wsoEBN9AJAjRHnooJqb27Wfq", "fee": 1000000, "feeAssetId": null, "timestamp": 1643985716594, "version": 2, "chainId": 84, "sender": "3N5RAMPJE4xs7mfEqKaHmhuWgVjXbK6dfGc", "senderPublicKey": "EAog7JJhHByJAZz8XubAMQbtFA3hXBrwbb3goJoVDs4Q", "proofs": [ "2k45NmtKAxE1LSihfNc4L6sfKoCPoRPupRRD9tEPNAXg9gxzRsiqqFhM35ktYoNM7oETMDRgHP9ruBh2N6RKgRpG" ], "script": "base64:AAIFAAAAAAAAAAkIAhIFCgMICBgAAAAHAAAAAAtwcmVzZW5jZUtleQIAAAAJcHJlc2VuY2VzAAAAAAphYnNlbmNlS2V5AgAAAAhhYnNlbmNlcwAAAAAKdG90YWxDb3VycwIAAAAKdG90YWxDb3VycwAAAAAKbGVhc2VJZEtleQIAAAAHbGVhc2VJZAEAAAANZ2V0TmJQcmVzZW5jZQAAAAAEAAAACm5iUHJlc2VuY2UJAAQfAAAAAQUAAAALcHJlc2VuY2VLZXkEAAAAByRtYXRjaDAFAAAACm5iUHJlc2VuY2UDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABdAUAAAAHJG1hdGNoMAUAAAABdAAAAAAAAAAAAAEAAAAKZ2V0TmJDb3VycwAAAAAEAAAAB25iQ291cnMJAAQfAAAAAQUAAAAKdG90YWxDb3VycwQAAAAHJG1hdGNoMAUAAAAHbmJDb3VycwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAF0BQAAAAckbWF0Y2gwBQAAAAF0AAAAAAAAAAAAAQAAAAxnZXROYkFic2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ZW5jZUtleQkAAGQAAAACBQAAAAluYkFic2VuY2UAAAAAAAAAAAEJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAACnRvdGFsQ291cnMJAABkAAAAAgUAAAAHbmJDb3VycwAAAAAAAAAAAQkABEwAAAACCQEAAAALTGVhc2VDYW5jZWwAAAABCQEAAAARQGV4dHJOYXRpdmUoMTA1NykAAAABBQAAAApsZWFzZUlkS2V5BQAAAANuaWwAAAAAOXtMWA==", "height": 1909007, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4AnjzMjYD8mwBgUQ6TJxuFgBAZceJHhiDkio13vEXmSf Next: C6oz4cMV5tzMdNBAjPmjFUB1t4yvZBQFTkcxGJpkpiSe Diff:
OldNewDifferences
4343
4444
4545 @Callable(i)
46-func validationPresence (presence,addressToLease) = {
46+func validationPresence (presence,addressToLease,addresses) = {
4747 let nbPresence = getNbPresence()
4848 let nbCours = getNbCours()
4949 let nbAbsence = getNbAbsence()
50- if ((presence == "présent"))
50+ if ((size(addresses) > 0))
5151 then {
52- let leasableBalance = (wavesBalance(this).available - 10000000)
53- if ((leasableBalance > 0))
54- then {
55- let lease = Lease(addressFromStringValue(addressToLease), leasableBalance)
56- let leaseId = calculateLeaseId(lease)
52+ let firstStudent = addressFromStringValue(take(addresses[0], 35))
53+ let firstStudentStatus = takeRight(addresses[0], (size(addresses[0]) - 36))
54+ let listeAdresses = removeByIndex(addresses, 0)
55+ let res = invoke(firstStudent, "validationPresence", [firstStudentStatus, addressToLease, listeAdresses], nil)
56+ if ((res == res))
57+ then if ((presence == "présent"))
58+ then {
59+ let leasableBalance = (wavesBalance(this).available - 10000000)
60+ if ((leasableBalance > 0))
61+ then {
62+ let lease = Lease(addressFromStringValue(addressToLease), leasableBalance)
63+ let leaseId = calculateLeaseId(lease)
5764 [IntegerEntry(presenceKey, (nbPresence + 1)), IntegerEntry(totalCours, (nbCours + 1)), BinaryEntry(leaseIdKey, leaseId), lease]
58- }
59- else [IntegerEntry(presenceKey, (nbPresence + 1)), IntegerEntry(totalCours, (nbCours + 1))]
65+ }
66+ else [IntegerEntry(presenceKey, (nbPresence + 1)), IntegerEntry(totalCours, (nbCours + 1))]
67+ }
68+ else [IntegerEntry(absenceKey, (nbAbsence + 1)), IntegerEntry(totalCours, (nbCours + 1)), LeaseCancel(getBinaryValue(leaseIdKey))]
69+ else throw("Strict value is not equal to itself.")
6070 }
61- else $Tuple2([IntegerEntry(absenceKey, (nbAbsence + 1)), IntegerEntry(totalCours, (nbCours + 1)), LeaseCancel(getBinaryValue(leaseIdKey))], 0)
71+ else if ((presence == "présent"))
72+ then {
73+ let leasableBalance = (wavesBalance(this).available - 10000000)
74+ if ((leasableBalance > 0))
75+ then {
76+ let lease = Lease(addressFromStringValue(addressToLease), leasableBalance)
77+ let leaseId = calculateLeaseId(lease)
78+[IntegerEntry(presenceKey, (nbPresence + 1)), IntegerEntry(totalCours, (nbCours + 1)), BinaryEntry(leaseIdKey, leaseId), lease]
79+ }
80+ else [IntegerEntry(presenceKey, (nbPresence + 1)), IntegerEntry(totalCours, (nbCours + 1))]
81+ }
82+ else [IntegerEntry(absenceKey, (nbAbsence + 1)), IntegerEntry(totalCours, (nbCours + 1)), LeaseCancel(getBinaryValue(leaseIdKey))]
6283 }
6384
6485
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)
46-func validationPresence (presence,addressToLease) = {
46+func validationPresence (presence,addressToLease,addresses) = {
4747 let nbPresence = getNbPresence()
4848 let nbCours = getNbCours()
4949 let nbAbsence = getNbAbsence()
50- if ((presence == "présent"))
50+ if ((size(addresses) > 0))
5151 then {
52- let leasableBalance = (wavesBalance(this).available - 10000000)
53- if ((leasableBalance > 0))
54- then {
55- let lease = Lease(addressFromStringValue(addressToLease), leasableBalance)
56- let leaseId = calculateLeaseId(lease)
52+ let firstStudent = addressFromStringValue(take(addresses[0], 35))
53+ let firstStudentStatus = takeRight(addresses[0], (size(addresses[0]) - 36))
54+ let listeAdresses = removeByIndex(addresses, 0)
55+ let res = invoke(firstStudent, "validationPresence", [firstStudentStatus, addressToLease, listeAdresses], nil)
56+ if ((res == res))
57+ then if ((presence == "présent"))
58+ then {
59+ let leasableBalance = (wavesBalance(this).available - 10000000)
60+ if ((leasableBalance > 0))
61+ then {
62+ let lease = Lease(addressFromStringValue(addressToLease), leasableBalance)
63+ let leaseId = calculateLeaseId(lease)
5764 [IntegerEntry(presenceKey, (nbPresence + 1)), IntegerEntry(totalCours, (nbCours + 1)), BinaryEntry(leaseIdKey, leaseId), lease]
58- }
59- else [IntegerEntry(presenceKey, (nbPresence + 1)), IntegerEntry(totalCours, (nbCours + 1))]
65+ }
66+ else [IntegerEntry(presenceKey, (nbPresence + 1)), IntegerEntry(totalCours, (nbCours + 1))]
67+ }
68+ else [IntegerEntry(absenceKey, (nbAbsence + 1)), IntegerEntry(totalCours, (nbCours + 1)), LeaseCancel(getBinaryValue(leaseIdKey))]
69+ else throw("Strict value is not equal to itself.")
6070 }
61- else $Tuple2([IntegerEntry(absenceKey, (nbAbsence + 1)), IntegerEntry(totalCours, (nbCours + 1)), LeaseCancel(getBinaryValue(leaseIdKey))], 0)
71+ else if ((presence == "présent"))
72+ then {
73+ let leasableBalance = (wavesBalance(this).available - 10000000)
74+ if ((leasableBalance > 0))
75+ then {
76+ let lease = Lease(addressFromStringValue(addressToLease), leasableBalance)
77+ let leaseId = calculateLeaseId(lease)
78+[IntegerEntry(presenceKey, (nbPresence + 1)), IntegerEntry(totalCours, (nbCours + 1)), BinaryEntry(leaseIdKey, leaseId), lease]
79+ }
80+ else [IntegerEntry(presenceKey, (nbPresence + 1)), IntegerEntry(totalCours, (nbCours + 1))]
81+ }
82+ else [IntegerEntry(absenceKey, (nbAbsence + 1)), IntegerEntry(totalCours, (nbCours + 1)), LeaseCancel(getBinaryValue(leaseIdKey))]
6283 }
6384
6485

github/deemru/w8io/169f3d6 
25.02 ms