Slide 39
Slide 39 text
Greeter.java
public final class Greeter extends Contract {
private static final String BINARY = “6060604052604....";
...
public RemoteCall greet() {
Function function = new Function("greet",
Arrays.asList(),
Arrays.>asList(
new TypeReference() {}));
return executeRemoteCallSingleValueReturn(
function, String.class);
}
public static RemoteCall deploy(
Web3j web3j, Credentials credentials,
BigInteger gasPrice, BigInteger gasLimit,
String _greeting) {
String encodedConstructor = FunctionEncoder.encodeConstructor(
Arrays.asList(_greeting));
return deployAsync(
Greeter.class, web3j, credentials, gasPrice, gasLimit,
BINARY, encodedConstructor, initialValue);
}
...