File tree Expand file tree Collapse file tree 1 file changed +7
-22
lines changed Expand file tree Collapse file tree 1 file changed +7
-22
lines changed Original file line number Diff line number Diff line change @@ -2,35 +2,20 @@ import "debug"
2
2
import "tx"
3
3
import "cell"
4
4
5
- // main is the entry point of every cell script
6
5
function main() {
7
- tx.scriptVerify()
8
-
9
- if(tx.isOwnerMode()) {
10
- return 0
6
+ // tx.scriptVerify()
7
+ if tx.isOwnerMode() {
8
+ return 0
11
9
}
12
-
13
-
14
- var ins = tx.inputs()
15
- var outs = tx.outputs()
16
10
17
- var in_sum uint64
18
- var out_sum uint64
11
+ in_sum, out_sum := 0, 0
19
12
20
- for _, input := range ins {
13
+ for input := range tx.inputs() {
21
14
in_sum += input
22
- if in_sum < input {
23
- debug.Printf("input overflow")
24
- return 1
25
- }
26
15
}
27
16
28
- for _, output := range outs {
17
+ for output := range tx.outputs() {
29
18
out_sum += output
30
- if out_sum < output {
31
- debug.Printf("output overflow")
32
- return 1
33
- }
34
19
}
35
20
36
21
if in_sum < out_sum {
@@ -39,4 +24,4 @@ function main() {
39
24
}
40
25
41
26
return 0
42
- }
27
+ }
You can’t perform that action at this time.
0 commit comments