A method of control implemented by an electronic device, said method comprising, during an EMV transaction implemented by the device comprising a memory wherein is stored an indicator comprising a plurality of components, the following steps: - an initial state change of each component of the indicator, the initial state change being performed prior to the implementation of a critical step of the transaction, and the indicator having an initial state prior to said initial state change, - during or after each of the steps of a plurality of steps of the transaction subsequent to said initial state change, a reverse state change of one of the indicator components, - a final reverse state change of said indicator after the start of the implementation of the critical step of the transaction, so that the indicator returns to said initial state, said final reverse state change comprising a reverse state change of at least one of said components of the indicator to recover the state of the component prior to the initial state change of that component, the method comprising a reverse state change during a step of the transaction and during a step of writing to a memory of the device specific to the step of the transaction, the initial state change being implemented during an application processing initialization step, the initial state change being implemented during a step of writing an application transaction counter value to said memory, and the final state change (E71, E71') being implemented during said critical step, the critical step being a cryptogram-generating step (E70,E70'), the final state change being implemented during a step of writing to said memory specific to the cryptogram-generating step, the indicator being a counter of uncompleted transactions, said initial state change being an initial increment, said final reverse state change being a final decrement, the method further comprising a comparison of said counter with a threshold and, if said counter is greater than said threshold, the implementation of a security treatment. - an initial state change of each component of the indicator, the initial state change being performed prior to the implementation of a critical step of the transaction, and the indicator having an initial state prior to said initial state change, - during or after each of the steps of a plurality of steps of the transaction subsequent to said initial state change, a reverse state change of one of the indicator components, - a final reverse state change of said indicator after the start of the implementation of the critical step of the transaction, so that the indicator returns to said initial state, said final reverse state change comprising a reverse state change of at least one of said components of the indicator to recover the state of the component prior to the initial state change of that component, the method comprising a reverse state change during a step of the transaction and during a step of writing to a memory of the device specific to the step of the transaction, the initial state change being implemented during an application processing initialization step, the initial state change being implemented during a step of writing an application transaction counter value to said memory, and the final state change (E71, E71') being implemented during said critical step, the critical step being a cryptogram-generating step (E70,E70'), the final state change being implemented during a step of writing to said memory specific to the cryptogram-generating step, the indicator being a counter of uncompleted transactions, said initial state change being an initial increment, said final reverse state change being a final decrement, the method further comprising a comparison of said counter with a threshold and, if said counter is greater than said threshold, the implementation of a security treatment. said final reverse state change comprising a reverse state change of at least one of said components of the indicator to recover the state of the component prior to the initial state change of that component, the method comprising a reverse state change during a step of the transaction and during a step of writing to a memory of the device specific to the step of the transaction, the initial state change being implemented during an application processing initialization step, the initial state change being implemented during a step of writing an application transaction counter value to said memory, and the final state change (E71, E71') being implemented during said critical step, the critical step being a cryptogram-generating step (E70,E70'), the final state change being implemented during a step of writing to said memory specific to the cryptogram-generating step, the indicator being a counter of uncompleted transactions, said initial state change being an initial increment, said final reverse state change being a final decrement, the method further comprising a comparison of said counter with a threshold and, if said counter is greater than said threshold, the implementation of a security treatment.