Skip to content

Commit a0e12a8

Browse files
committed
update sudt
1 parent 6e402a8 commit a0e12a8

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

tests/examples/sudt.cell

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,20 @@ import "debug"
22
import "tx"
33
import "cell"
44

5-
// main is the entry point of every cell script
65
function main() {
7-
tx.scriptVerify()
8-
9-
if(tx.isOwnerMode()) {
10-
return 0
6+
// tx.scriptVerify()
7+
if tx.isOwnerMode() {
8+
return 0
119
}
12-
13-
14-
var ins = tx.inputs()
15-
var outs = tx.outputs()
1610

17-
var in_sum uint64
18-
var out_sum uint64
11+
in_sum, out_sum := 0, 0
1912

20-
for _, input := range ins {
13+
for input := range tx.inputs() {
2114
in_sum += input
22-
if in_sum < input {
23-
debug.Printf("input overflow")
24-
return 1
25-
}
2615
}
2716

28-
for _, output := range outs {
17+
for output := range tx.outputs() {
2918
out_sum += output
30-
if out_sum < output {
31-
debug.Printf("output overflow")
32-
return 1
33-
}
3419
}
3520

3621
if in_sum < out_sum {
@@ -39,4 +24,4 @@ function main() {
3924
}
4025

4126
return 0
42-
}
27+
}

0 commit comments

Comments
 (0)