mirror of
https://gitee.com/BDWare/agent-backend
synced 2025-01-10 09:54:11 +00:00
20 lines
519 B
Plaintext
20 lines
519 B
Plaintext
@Access("verified")
|
||
@LogType("Arg", "IO")
|
||
@LogLocation("lo")
|
||
@Description("这是个使用注解的合约示例,只有一个方法")
|
||
contract AnnotationExample{
|
||
@LogType("Branch")
|
||
@Description("计算score之和,参数示例: [{\"score\":20},{\"score\":20}]")
|
||
export function main(arg){
|
||
point = JSON.parse(arg);
|
||
var s = 0;
|
||
print(point[0].score);
|
||
print(point.length);
|
||
for (var i = 0; i < point.length; i++){
|
||
s += point[i].score / 1.0;
|
||
}
|
||
print("ss= " + s);
|
||
return s;
|
||
}
|
||
}
|