File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ /* Bu örnek projede parametre olarak alınan adımı mevcut adımın bir sonraki adımıyla karşılaştırarak işlem kabulünü veya reddini belirler.
2
+ Eğer adım doğru sırayla gelmişse true değeri döndürülür; aksi takdirde false değeri döndürülür. */
3
+
4
+ // SPDX-License-Identifier: MIT
5
+ pragma solidity ^ 0.8.0 ;
6
+
7
+ contract checkSequence {
8
+ uint public currentStep;
9
+
10
+ constructor (){
11
+ currentStep = 0 ; // Başlangıç adımı
12
+ }
13
+
14
+ function checkSequenceVerify (uint step ) public view returns (bool ){
15
+ if (step == currentStep + 1 ){
16
+ return true ; // işlem kabul edilir
17
+ }
18
+ else {
19
+ return false ; // işlem reddildi
20
+ }
21
+ }
22
+
23
+ function updateStep () public {
24
+ currentStep += 1 ; // adım güncellendi.
25
+ }
26
+ }
27
+
28
+ /*
29
+ Author Muhammed Akıncı
30
+ */
You can’t perform that action at this time.
0 commit comments