solidity结构体
contract test { struct Demo { uint64 uid; uint64 amount; } function send(Demo calldata demo) public {} }
java使用web3j构建参数 :
@Data class Demo extends StaticStruct { public Uint64 uid; public Uint64 amount; public Demo(long uid, long amount) { super(new Type[]{new Uint64(uid),new Uint64(amount)}); }
构建参数可以用这种方式吗? 现在发现上链死活失败
Function function = new Function( "send", List.of(new Demo(1,2)), Collections.emptyList());
第二个问题是 java种怎么打印出来传输的参数呢?
像js就直接是json串
{ "uid":1, "amount":2 }