Skip to content

Instantly share code, notes, and snippets.

@strotter
Created February 16, 2018 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save strotter/c91c9610dbacc5d0ae96014daf9658bb to your computer and use it in GitHub Desktop.
Save strotter/c91c9610dbacc5d0ae96014daf9658bb to your computer and use it in GitHub Desktop.
web3j
public RemoteCall<TransactionReceipt> stop() {
Function function = new Function(
"stop",
Arrays.<Type>asList(),
Collections.<TypeReference<?>>emptyList());
return executeRemoteCallTransaction(function);
}
public RemoteCall<TransactionReceipt> approve(String _spender, BigInteger _value) {
Function function = new Function(
"approve",
Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(_spender),
new org.web3j.abi.datatypes.generated.Uint256(_value)),
Collections.<TypeReference<?>>emptyList());
return executeRemoteCallTransaction(function);
}
public RemoteCall<BigInteger> totalSupply() {
Function function = new Function("totalSupply",
Arrays.<Type>asList(),
Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
return executeRemoteCallSingleValueReturn(function, BigInteger.class);
}
public RemoteCall<TransactionReceipt> transferFrom(String _from, String _to, BigInteger _value) {
Function function = new Function(
"transferFrom",
Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(_from),
new org.web3j.abi.datatypes.Address(_to),
new org.web3j.abi.datatypes.generated.Uint256(_value)),
Collections.<TypeReference<?>>emptyList());
return executeRemoteCallTransaction(function);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment